var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __esm = (fn, res) => function __init() {
  return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
};
var __commonJS = (cb, mod) => function __require() {
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
};
var __export = (target, all) => {
  for (var name2 in all)
    __defProp(target, name2, { get: all[name2], enumerable: true });
};
var __copyProps = (to, from2, except, desc) => {
  if (from2 && typeof from2 === "object" || typeof from2 === "function") {
    for (let key of __getOwnPropNames(from2))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from2[key], enumerable: !(desc = __getOwnPropDesc(from2, key)) || desc.enumerable });
  }
  return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// node_modules/react/cjs/react.development.js
var require_react_development = __commonJS({
  "node_modules/react/cjs/react.development.js"(exports, module) {
    "use strict";
    if (true) {
      (function() {
        "use strict";
        if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === "function") {
          __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
        }
        var ReactVersion = "18.2.0";
        var REACT_ELEMENT_TYPE = Symbol.for("react.element");
        var REACT_PORTAL_TYPE = Symbol.for("react.portal");
        var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
        var REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode");
        var REACT_PROFILER_TYPE = Symbol.for("react.profiler");
        var REACT_PROVIDER_TYPE = Symbol.for("react.provider");
        var REACT_CONTEXT_TYPE = Symbol.for("react.context");
        var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref");
        var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense");
        var REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list");
        var REACT_MEMO_TYPE = Symbol.for("react.memo");
        var REACT_LAZY_TYPE = Symbol.for("react.lazy");
        var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen");
        var MAYBE_ITERATOR_SYMBOL = 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 = {
          /**
           * @internal
           * @type {ReactComponent}
           */
          current: null
        };
        var ReactCurrentBatchConfig = {
          transition: null
        };
        var ReactCurrentActQueue = {
          current: null,
          // Used to reproduce behavior of `batchedUpdates` in legacy mode.
          isBatchingLegacy: false,
          didScheduleLegacyUpdate: false
        };
        var ReactCurrentOwner = {
          /**
           * @internal
           * @type {ReactComponent}
           */
          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 enableScopeAPI = false;
        var enableCacheElement = false;
        var enableTransitionTracing = false;
        var enableLegacyHidden = false;
        var enableDebugTracing = false;
        var ReactSharedInternals = {
          ReactCurrentDispatcher,
          ReactCurrentBatchConfig,
          ReactCurrentOwner
        };
        {
          ReactSharedInternals.ReactDebugCurrentFrame = ReactDebugCurrentFrame;
          ReactSharedInternals.ReactCurrentActQueue = ReactCurrentActQueue;
        }
        function warn5(format3) {
          {
            {
              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", format3, args);
            }
          }
        }
        function error(format3) {
          {
            {
              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", format3, args);
            }
          }
        }
        function printWarning(level, format3, args) {
          {
            var ReactDebugCurrentFrame2 = ReactSharedInternals.ReactDebugCurrentFrame;
            var stack = ReactDebugCurrentFrame2.getStackAddendum();
            if (stack !== "") {
              format3 += "%s";
              args = args.concat([stack]);
            }
            var argsWithFormat = args.map(function(item) {
              return String(item);
            });
            argsWithFormat.unshift("Warning: " + format3);
            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 = {
          /**
           * Checks whether or not this composite component is mounted.
           * @param {ReactClass} publicInstance The instance we want to test.
           * @return {boolean} True if mounted, false otherwise.
           * @protected
           * @final
           */
          isMounted: function(publicInstance) {
            return false;
          },
          /**
           * Forces an update. This should only be invoked when it is known with
           * certainty that we are **not** in a DOM transaction.
           *
           * You may want to call this when you know that some deeper aspect of the
           * component's state has changed but `setState` was not called.
           *
           * This will not invoke `shouldComponentUpdate`, but it will invoke
           * `componentWillUpdate` and `componentDidUpdate`.
           *
           * @param {ReactClass} publicInstance The instance that should rerender.
           * @param {?function} callback Called after component is updated.
           * @param {?string} callerName name of the calling function in the public API.
           * @internal
           */
          enqueueForceUpdate: function(publicInstance, callback, callerName) {
            warnNoop(publicInstance, "forceUpdate");
          },
          /**
           * Replaces all of the state. Always use this or `setState` to mutate state.
           * You should treat `this.state` as immutable.
           *
           * There is no guarantee that `this.state` will be immediately updated, so
           * accessing `this.state` after calling this method may return the old value.
           *
           * @param {ReactClass} publicInstance The instance that should rerender.
           * @param {object} completeState Next state.
           * @param {?function} callback Called after component is updated.
           * @param {?string} callerName name of the calling function in the public API.
           * @internal
           */
          enqueueReplaceState: function(publicInstance, completeState, callback, callerName) {
            warnNoop(publicInstance, "replaceState");
          },
          /**
           * Sets a subset of the state. This only exists because _pendingState is
           * internal. This provides a merging strategy that is not available to deep
           * properties which is confusing. TODO: Expose pendingState or don't use it
           * during the merge.
           *
           * @param {ReactClass} publicInstance The instance that should rerender.
           * @param {object} partialState Next partial state to be merged with state.
           * @param {?function} callback Called after component is updated.
           * @param {?string} Name of the calling function in the public API.
           * @internal
           */
          enqueueSetState: function(publicInstance, partialState, callback, callerName) {
            warnNoop(publicInstance, "setState");
          }
        };
        var assign3 = Object.assign;
        var emptyObject = {};
        {
          Object.freeze(emptyObject);
        }
        function Component8(props, context2, updater) {
          this.props = props;
          this.context = context2;
          this.refs = emptyObject;
          this.updater = updater || ReactNoopUpdateQueue;
        }
        Component8.prototype.isReactComponent = {};
        Component8.prototype.setState = function(partialState, callback) {
          if (typeof partialState !== "object" && typeof partialState !== "function" && partialState != null) {
            throw new 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");
        };
        Component8.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(Component8.prototype, methodName, {
              get: function() {
                warn5("%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 = Component8.prototype;
        function PureComponent15(props, context2, updater) {
          this.props = props;
          this.context = context2;
          this.refs = emptyObject;
          this.updater = updater || ReactNoopUpdateQueue;
        }
        var pureComponentPrototype = PureComponent15.prototype = new ComponentDummy();
        pureComponentPrototype.constructor = PureComponent15;
        assign3(pureComponentPrototype, Component8.prototype);
        pureComponentPrototype.isPureReactComponent = true;
        function createRef3() {
          var refObject = {
            current: null
          };
          {
            Object.seal(refObject);
          }
          return refObject;
        }
        var isArrayImpl = Array.isArray;
        function isArray2(a2) {
          return isArrayImpl(a2);
        }
        function typeName2(value) {
          {
            var hasToStringTag = typeof Symbol === "function" && Symbol.toStringTag;
            var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
            return type;
          }
        }
        function willCoercionThrow(value) {
          {
            try {
              testStringCoercion(value);
              return false;
            } catch (e3) {
              return true;
            }
          }
        }
        function testStringCoercion(value) {
          return "" + value;
        }
        function checkKeyStringCoercion(value) {
          {
            if (willCoercionThrow(value)) {
              error("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", typeName2(value));
              return testStringCoercion(value);
            }
          }
        }
        function getWrappedName(outerType, innerType, wrapperName) {
          var displayName = outerType.displayName;
          if (displayName) {
            return displayName;
          }
          var functionName = innerType.displayName || innerType.name || "";
          return functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName;
        }
        function getContextName(type) {
          return type.displayName || "Context";
        }
        function getComponentNameFromType(type) {
          if (type == null) {
            return null;
          }
          {
            if (typeof type.tag === "number") {
              error("Received an unexpected object in getComponentNameFromType(). 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 context2 = type;
                return getContextName(context2) + ".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:
                var outerName = type.displayName || null;
                if (outerName !== null) {
                  return outerName;
                }
                return getComponentNameFromType(type.type) || "Memo";
              case REACT_LAZY_TYPE: {
                var lazyComponent = type;
                var payload = lazyComponent._payload;
                var init = lazyComponent._init;
                try {
                  return getComponentNameFromType(init(payload));
                } catch (x2) {
                  return null;
                }
              }
            }
          }
          return null;
        }
        var hasOwnProperty3 = Object.prototype.hasOwnProperty;
        var RESERVED_PROPS = {
          key: true,
          ref: true,
          __self: true,
          __source: true
        };
        var specialPropKeyWarningShown, specialPropRefWarningShown, didWarnAboutStringRefs;
        {
          didWarnAboutStringRefs = {};
        }
        function hasValidRef(config2) {
          {
            if (hasOwnProperty3.call(config2, "ref")) {
              var getter = Object.getOwnPropertyDescriptor(config2, "ref").get;
              if (getter && getter.isReactWarning) {
                return false;
              }
            }
          }
          return config2.ref !== void 0;
        }
        function hasValidKey(config2) {
          {
            if (hasOwnProperty3.call(config2, "key")) {
              var getter = Object.getOwnPropertyDescriptor(config2, "key").get;
              if (getter && getter.isReactWarning) {
                return false;
              }
            }
          }
          return config2.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(config2) {
          {
            if (typeof config2.ref === "string" && ReactCurrentOwner.current && config2.__self && ReactCurrentOwner.current.stateNode !== config2.__self) {
              var componentName = getComponentNameFromType(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, config2.ref);
                didWarnAboutStringRefs[componentName] = true;
              }
            }
          }
        }
        var ReactElement = function(type, key, ref, self2, source, owner, props) {
          var element2 = {
            // This tag allows us to uniquely identify this as a React Element
            $$typeof: REACT_ELEMENT_TYPE,
            // Built-in properties that belong on the element
            type,
            key,
            ref,
            props,
            // Record the component responsible for creating this element.
            _owner: owner
          };
          {
            element2._store = {};
            Object.defineProperty(element2._store, "validated", {
              configurable: false,
              enumerable: false,
              writable: true,
              value: false
            });
            Object.defineProperty(element2, "_self", {
              configurable: false,
              enumerable: false,
              writable: false,
              value: self2
            });
            Object.defineProperty(element2, "_source", {
              configurable: false,
              enumerable: false,
              writable: false,
              value: source
            });
            if (Object.freeze) {
              Object.freeze(element2.props);
              Object.freeze(element2);
            }
          }
          return element2;
        };
        function createElement17(type, config2, children) {
          var propName;
          var props = {};
          var key = null;
          var ref = null;
          var self2 = null;
          var source = null;
          if (config2 != null) {
            if (hasValidRef(config2)) {
              ref = config2.ref;
              {
                warnIfStringRefCannotBeAutoConverted(config2);
              }
            }
            if (hasValidKey(config2)) {
              {
                checkKeyStringCoercion(config2.key);
              }
              key = "" + config2.key;
            }
            self2 = config2.__self === void 0 ? null : config2.__self;
            source = config2.__source === void 0 ? null : config2.__source;
            for (propName in config2) {
              if (hasOwnProperty3.call(config2, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
                props[propName] = config2[propName];
              }
            }
          }
          var childrenLength = arguments.length - 2;
          if (childrenLength === 1) {
            props.children = children;
          } else if (childrenLength > 1) {
            var childArray = Array(childrenLength);
            for (var i2 = 0; i2 < childrenLength; i2++) {
              childArray[i2] = arguments[i2 + 2];
            }
            {
              if (Object.freeze) {
                Object.freeze(childArray);
              }
            }
            props.children = childArray;
          }
          if (type && type.defaultProps) {
            var defaultProps5 = type.defaultProps;
            for (propName in defaultProps5) {
              if (props[propName] === void 0) {
                props[propName] = defaultProps5[propName];
              }
            }
          }
          {
            if (key || ref) {
              var displayName = typeof type === "function" ? type.displayName || type.name || "Unknown" : type;
              if (key) {
                defineKeyPropWarningGetter(props, displayName);
              }
              if (ref) {
                defineRefPropWarningGetter(props, displayName);
              }
            }
          }
          return ReactElement(type, key, ref, self2, 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 cloneElement10(element2, config2, children) {
          if (element2 === null || element2 === void 0) {
            throw new Error("React.cloneElement(...): The argument must be a React element, but you passed " + element2 + ".");
          }
          var propName;
          var props = assign3({}, element2.props);
          var key = element2.key;
          var ref = element2.ref;
          var self2 = element2._self;
          var source = element2._source;
          var owner = element2._owner;
          if (config2 != null) {
            if (hasValidRef(config2)) {
              ref = config2.ref;
              owner = ReactCurrentOwner.current;
            }
            if (hasValidKey(config2)) {
              {
                checkKeyStringCoercion(config2.key);
              }
              key = "" + config2.key;
            }
            var defaultProps5;
            if (element2.type && element2.type.defaultProps) {
              defaultProps5 = element2.type.defaultProps;
            }
            for (propName in config2) {
              if (hasOwnProperty3.call(config2, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
                if (config2[propName] === void 0 && defaultProps5 !== void 0) {
                  props[propName] = defaultProps5[propName];
                } else {
                  props[propName] = config2[propName];
                }
              }
            }
          }
          var childrenLength = arguments.length - 2;
          if (childrenLength === 1) {
            props.children = children;
          } else if (childrenLength > 1) {
            var childArray = Array(childrenLength);
            for (var i2 = 0; i2 < childrenLength; i2++) {
              childArray[i2] = arguments[i2 + 2];
            }
            props.children = childArray;
          }
          return ReactElement(element2.type, key, ref, self2, source, owner, props);
        }
        function isValidElement10(object) {
          return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
        }
        var SEPARATOR = ".";
        var SUBSEPARATOR = ":";
        function escape2(key) {
          var escapeRegex = /[=:]/g;
          var escaperLookup = {
            "=": "=0",
            ":": "=2"
          };
          var escapedString = key.replace(escapeRegex, function(match2) {
            return escaperLookup[match2];
          });
          return "$" + escapedString;
        }
        var didWarnAboutMaps = false;
        var userProvidedKeyEscapeRegex = /\/+/g;
        function escapeUserProvidedKey(text2) {
          return text2.replace(userProvidedKeyEscapeRegex, "$&/");
        }
        function getElementKey(element2, index) {
          if (typeof element2 === "object" && element2 !== null && element2.key != null) {
            {
              checkKeyStringCoercion(element2.key);
            }
            return escape2("" + element2.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 (isArray2(mappedChild)) {
              var escapedChildKey = "";
              if (childKey != null) {
                escapedChildKey = escapeUserProvidedKey(childKey) + "/";
              }
              mapIntoArray(mappedChild, array, escapedChildKey, "", function(c4) {
                return c4;
              });
            } else if (mappedChild != null) {
              if (isValidElement10(mappedChild)) {
                {
                  if (mappedChild.key && (!_child || _child.key !== mappedChild.key)) {
                    checkKeyStringCoercion(mappedChild.key);
                  }
                }
                mappedChild = cloneAndReplaceKey(
                  mappedChild,
                  // Keep both the (mapped) and old keys if they differ, just as
                  // traverseAllChildren used to do for objects as children
                  escapedPrefix + // $FlowFixMe Flow incorrectly thinks React.Portal doesn't have a key
                  (mappedChild.key && (!_child || _child.key !== mappedChild.key) ? (
                    // $FlowFixMe Flow incorrectly thinks existing element's key can be a number
                    // eslint-disable-next-line react-internal/safe-string-coercion
                    escapeUserProvidedKey("" + mappedChild.key) + "/"
                  ) : "") + childKey
                );
              }
              array.push(mappedChild);
            }
            return 1;
          }
          var child;
          var nextName;
          var subtreeCount = 0;
          var nextNamePrefix = nameSoFar === "" ? SEPARATOR : nameSoFar + SUBSEPARATOR;
          if (isArray2(children)) {
            for (var i2 = 0; i2 < children.length; i2++) {
              child = children[i2];
              nextName = nextNamePrefix + getElementKey(child, i2);
              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) {
                    warn5("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 = String(children);
              throw new 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, context2) {
          if (children == null) {
            return children;
          }
          var result = [];
          var count2 = 0;
          mapIntoArray(children, result, "", "", function(child) {
            return func.call(context2, child, count2++);
          });
          return result;
        }
        function countChildren(children) {
          var n2 = 0;
          mapChildren(children, function() {
            n2++;
          });
          return n2;
        }
        function forEachChildren(children, forEachFunc, forEachContext) {
          mapChildren(children, function() {
            forEachFunc.apply(this, arguments);
          }, forEachContext);
        }
        function toArray3(children) {
          return mapChildren(children, function(child) {
            return child;
          }) || [];
        }
        function onlyChild(children) {
          if (!isValidElement10(children)) {
            throw new Error("React.Children.only expected to receive a single React element child.");
          }
          return children;
        }
        function createContext17(defaultValue) {
          var context2 = {
            $$typeof: REACT_CONTEXT_TYPE,
            // As a workaround to support multiple concurrent renderers, we categorize
            // some renderers as primary and others as secondary. We only expect
            // there to be two concurrent renderers at most: React Native (primary) and
            // Fabric (secondary); React DOM (primary) and React ART (secondary).
            // Secondary renderers store their context values on separate fields.
            _currentValue: defaultValue,
            _currentValue2: defaultValue,
            // Used to track how many concurrent renderers this context currently
            // supports within in a single renderer. Such as parallel server rendering.
            _threadCount: 0,
            // These are circular
            Provider: null,
            Consumer: null,
            // Add these to use same hidden class in VM as ServerContext
            _defaultValue: null,
            _globalName: null
          };
          context2.Provider = {
            $$typeof: REACT_PROVIDER_TYPE,
            _context: context2
          };
          var hasWarnedAboutUsingNestedContextConsumers = false;
          var hasWarnedAboutUsingConsumerProvider = false;
          var hasWarnedAboutDisplayNameOnConsumer = false;
          {
            var Consumer = {
              $$typeof: REACT_CONTEXT_TYPE,
              _context: context2
            };
            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 context2.Provider;
                },
                set: function(_Provider) {
                  context2.Provider = _Provider;
                }
              },
              _currentValue: {
                get: function() {
                  return context2._currentValue;
                },
                set: function(_currentValue) {
                  context2._currentValue = _currentValue;
                }
              },
              _currentValue2: {
                get: function() {
                  return context2._currentValue2;
                },
                set: function(_currentValue2) {
                  context2._currentValue2 = _currentValue2;
                }
              },
              _threadCount: {
                get: function() {
                  return context2._threadCount;
                },
                set: function(_threadCount) {
                  context2._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 context2.Consumer;
                }
              },
              displayName: {
                get: function() {
                  return context2.displayName;
                },
                set: function(displayName) {
                  if (!hasWarnedAboutDisplayNameOnConsumer) {
                    warn5("Setting `displayName` on Context.Consumer has no effect. You should set it directly on the context with Context.displayName = '%s'.", displayName);
                    hasWarnedAboutDisplayNameOnConsumer = true;
                  }
                }
              }
            });
            context2.Consumer = Consumer;
          }
          {
            context2._currentRenderer = null;
            context2._currentRenderer2 = null;
          }
          return context2;
        }
        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();
            thenable.then(function(moduleObject2) {
              if (payload._status === Pending || payload._status === Uninitialized) {
                var resolved = payload;
                resolved._status = Resolved;
                resolved._result = moduleObject2;
              }
            }, function(error2) {
              if (payload._status === Pending || payload._status === Uninitialized) {
                var rejected = payload;
                rejected._status = Rejected;
                rejected._result = error2;
              }
            });
            if (payload._status === Uninitialized) {
              var pending = payload;
              pending._status = Pending;
              pending._result = thenable;
            }
          }
          if (payload._status === Resolved) {
            var moduleObject = payload._result;
            {
              if (moduleObject === 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'))\n\nDid you accidentally put curly braces around the import?", moduleObject);
              }
            }
            {
              if (!("default" in moduleObject)) {
                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);
              }
            }
            return moduleObject.default;
          } else {
            throw payload._result;
          }
        }
        function lazy(ctor) {
          var payload = {
            // We use these fields to store the result.
            _status: Uninitialized,
            _result: ctor
          };
          var lazyType = {
            $$typeof: REACT_LAZY_TYPE,
            _payload: payload,
            _init: lazyInitializer
          };
          {
            var defaultProps5;
            var propTypes;
            Object.defineProperties(lazyType, {
              defaultProps: {
                configurable: true,
                get: function() {
                  return defaultProps5;
                },
                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.");
                  defaultProps5 = 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 forwardRef15(render2) {
          {
            if (render2 != null && render2.$$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 render2 !== "function") {
              error("forwardRef requires a render function but was given %s.", render2 === null ? "null" : typeof render2);
            } else {
              if (render2.length !== 0 && render2.length !== 2) {
                error("forwardRef render functions accept exactly two parameters: props and ref. %s", render2.length === 1 ? "Did you forget to use the ref parameter?" : "Any additional parameter will be undefined.");
              }
            }
            if (render2 != null) {
              if (render2.defaultProps != null || render2.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: render2
          };
          {
            var ownName;
            Object.defineProperty(elementType, "displayName", {
              enumerable: false,
              configurable: true,
              get: function() {
                return ownName;
              },
              set: function(name2) {
                ownName = name2;
                if (!render2.name && !render2.displayName) {
                  render2.displayName = name2;
                }
              }
            });
          }
          return elementType;
        }
        var REACT_MODULE_REFERENCE;
        {
          REACT_MODULE_REFERENCE = Symbol.for("react.module.reference");
        }
        function isValidElementType(type) {
          if (typeof type === "string" || typeof type === "function") {
            return true;
          }
          if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing) {
            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 || // This needs to include all possible module reference object
            // types supported by any Flight configuration anywhere since
            // we don't know which Flight build this will end up being used
            // with.
            type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== void 0) {
              return true;
            }
          }
          return false;
        }
        function memo2(type, compare2) {
          {
            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: compare2 === void 0 ? null : compare2
          };
          {
            var ownName;
            Object.defineProperty(elementType, "displayName", {
              enumerable: false,
              configurable: true,
              get: function() {
                return ownName;
              },
              set: function(name2) {
                ownName = name2;
                if (!type.name && !type.displayName) {
                  type.displayName = name2;
                }
              }
            });
          }
          return elementType;
        }
        function resolveDispatcher() {
          var dispatcher = ReactCurrentDispatcher.current;
          {
            if (dispatcher === null) {
              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 useContext17(Context2) {
          var dispatcher = resolveDispatcher();
          {
            if (Context2._context !== void 0) {
              var realContext = Context2._context;
              if (realContext.Consumer === Context2) {
                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 === Context2) {
                error("Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?");
              }
            }
          }
          return dispatcher.useContext(Context2);
        }
        function useState33(initialState) {
          var dispatcher = resolveDispatcher();
          return dispatcher.useState(initialState);
        }
        function useReducer2(reducer, initialArg, init) {
          var dispatcher = resolveDispatcher();
          return dispatcher.useReducer(reducer, initialArg, init);
        }
        function useRef28(initialValue) {
          var dispatcher = resolveDispatcher();
          return dispatcher.useRef(initialValue);
        }
        function useEffect30(create4, deps) {
          var dispatcher = resolveDispatcher();
          return dispatcher.useEffect(create4, deps);
        }
        function useInsertionEffect3(create4, deps) {
          var dispatcher = resolveDispatcher();
          return dispatcher.useInsertionEffect(create4, deps);
        }
        function useLayoutEffect12(create4, deps) {
          var dispatcher = resolveDispatcher();
          return dispatcher.useLayoutEffect(create4, deps);
        }
        function useCallback28(callback, deps) {
          var dispatcher = resolveDispatcher();
          return dispatcher.useCallback(callback, deps);
        }
        function useMemo47(create4, deps) {
          var dispatcher = resolveDispatcher();
          return dispatcher.useMemo(create4, deps);
        }
        function useImperativeHandle5(ref, create4, deps) {
          var dispatcher = resolveDispatcher();
          return dispatcher.useImperativeHandle(ref, create4, deps);
        }
        function useDebugValue3(value, formatterFn) {
          {
            var dispatcher = resolveDispatcher();
            return dispatcher.useDebugValue(value, formatterFn);
          }
        }
        function useTransition2() {
          var dispatcher = resolveDispatcher();
          return dispatcher.useTransition();
        }
        function useDeferredValue2(value) {
          var dispatcher = resolveDispatcher();
          return dispatcher.useDeferredValue(value);
        }
        function useId2() {
          var dispatcher = resolveDispatcher();
          return dispatcher.useId();
        }
        function useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {
          var dispatcher = resolveDispatcher();
          return dispatcher.useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
        }
        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: assign3({}, props, {
                  value: prevLog
                }),
                info: assign3({}, props, {
                  value: prevInfo
                }),
                warn: assign3({}, props, {
                  value: prevWarn
                }),
                error: assign3({}, props, {
                  value: prevError
                }),
                group: assign3({}, props, {
                  value: prevGroup
                }),
                groupCollapsed: assign3({}, props, {
                  value: prevGroupCollapsed
                }),
                groupEnd: assign3({}, 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 prefix3;
        function describeBuiltInComponentFrame(name2, source, ownerFn) {
          {
            if (prefix3 === void 0) {
              try {
                throw Error();
              } catch (x2) {
                var match2 = x2.stack.trim().match(/\n( *(at )?)/);
                prefix3 = match2 && match2[1] || "";
              }
            }
            return "\n" + prefix3 + name2;
          }
        }
        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 (x2) {
                  control = x2;
                }
                Reflect.construct(fn, [], Fake);
              } else {
                try {
                  Fake.call();
                } catch (x2) {
                  control = x2;
                }
                fn.call(Fake.prototype);
              }
            } else {
              try {
                throw Error();
              } catch (x2) {
                control = x2;
              }
              fn();
            }
          } catch (sample) {
            if (sample && control && typeof sample.stack === "string") {
              var sampleLines = sample.stack.split("\n");
              var controlLines = control.stack.split("\n");
              var s2 = sampleLines.length - 1;
              var c4 = controlLines.length - 1;
              while (s2 >= 1 && c4 >= 0 && sampleLines[s2] !== controlLines[c4]) {
                c4--;
              }
              for (; s2 >= 1 && c4 >= 0; s2--, c4--) {
                if (sampleLines[s2] !== controlLines[c4]) {
                  if (s2 !== 1 || c4 !== 1) {
                    do {
                      s2--;
                      c4--;
                      if (c4 < 0 || sampleLines[s2] !== controlLines[c4]) {
                        var _frame = "\n" + sampleLines[s2].replace(" at new ", " at ");
                        if (fn.displayName && _frame.includes("<anonymous>")) {
                          _frame = _frame.replace("<anonymous>", fn.displayName);
                        }
                        {
                          if (typeof fn === "function") {
                            componentFrameCache.set(fn, _frame);
                          }
                        }
                        return _frame;
                      }
                    } while (s2 >= 1 && c4 >= 0);
                  }
                  break;
                }
              }
            }
          } finally {
            reentry = false;
            {
              ReactCurrentDispatcher$1.current = previousDispatcher;
              reenableLogs();
            }
            Error.prepareStackTrace = previousPrepareStackTrace;
          }
          var name2 = fn ? fn.displayName || fn.name : "";
          var syntheticFrame = name2 ? describeBuiltInComponentFrame(name2) : "";
          {
            if (typeof fn === "function") {
              componentFrameCache.set(fn, syntheticFrame);
            }
          }
          return syntheticFrame;
        }
        function describeFunctionComponentFrame(fn, source, ownerFn) {
          {
            return describeNativeComponentFrame(fn, false);
          }
        }
        function shouldConstruct(Component9) {
          var prototype = Component9.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_LAZY_TYPE: {
                var lazyComponent = type;
                var payload = lazyComponent._payload;
                var init = lazyComponent._init;
                try {
                  return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
                } catch (x2) {
                }
              }
            }
          }
          return "";
        }
        var loggedTypeFailures = {};
        var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
        function setCurrentlyValidatingElement(element2) {
          {
            if (element2) {
              var owner = element2._owner;
              var stack = describeUnknownElementTypeFrameInDEV(element2.type, element2._source, owner ? owner.type : null);
              ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
            } else {
              ReactDebugCurrentFrame$1.setExtraStackFrame(null);
            }
          }
        }
        function checkPropTypes(typeSpecs, values2, location2, componentName, element2) {
          {
            var has2 = Function.call.bind(hasOwnProperty3);
            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") + ": " + location2 + " 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](values2, typeSpecName, componentName, location2, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
                } catch (ex) {
                  error$1 = ex;
                }
                if (error$1 && !(error$1 instanceof Error)) {
                  setCurrentlyValidatingElement(element2);
                  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", location2, typeSpecName, typeof error$1);
                  setCurrentlyValidatingElement(null);
                }
                if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
                  loggedTypeFailures[error$1.message] = true;
                  setCurrentlyValidatingElement(element2);
                  error("Failed %s type: %s", location2, error$1.message);
                  setCurrentlyValidatingElement(null);
                }
              }
            }
          }
        }
        function setCurrentlyValidatingElement$1(element2) {
          {
            if (element2) {
              var owner = element2._owner;
              var stack = describeUnknownElementTypeFrameInDEV(element2.type, element2._source, owner ? owner.type : null);
              setExtraStackFrame(stack);
            } else {
              setExtraStackFrame(null);
            }
          }
        }
        var propTypesMisspellWarningShown;
        {
          propTypesMisspellWarningShown = false;
        }
        function getDeclarationErrorAddendum() {
          if (ReactCurrentOwner.current) {
            var name2 = getComponentNameFromType(ReactCurrentOwner.current.type);
            if (name2) {
              return "\n\nCheck the render method of `" + name2 + "`.";
            }
          }
          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(element2, parentType) {
          if (!element2._store || element2._store.validated || element2.key != null) {
            return;
          }
          element2._store.validated = true;
          var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
          if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
            return;
          }
          ownerHasKeyUseWarning[currentComponentErrorInfo] = true;
          var childOwner = "";
          if (element2 && element2._owner && element2._owner !== ReactCurrentOwner.current) {
            childOwner = " It was passed a child from " + getComponentNameFromType(element2._owner.type) + ".";
          }
          {
            setCurrentlyValidatingElement$1(element2);
            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(node56, parentType) {
          if (typeof node56 !== "object") {
            return;
          }
          if (isArray2(node56)) {
            for (var i2 = 0; i2 < node56.length; i2++) {
              var child = node56[i2];
              if (isValidElement10(child)) {
                validateExplicitKey(child, parentType);
              }
            }
          } else if (isValidElement10(node56)) {
            if (node56._store) {
              node56._store.validated = true;
            }
          } else if (node56) {
            var iteratorFn = getIteratorFn(node56);
            if (typeof iteratorFn === "function") {
              if (iteratorFn !== node56.entries) {
                var iterator = iteratorFn.call(node56);
                var step;
                while (!(step = iterator.next()).done) {
                  if (isValidElement10(step.value)) {
                    validateExplicitKey(step.value, parentType);
                  }
                }
              }
            }
          }
        }
        function validatePropTypes(element2) {
          {
            var type = element2.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 || // Note: Memo only checks outer props here.
            // Inner props are checked in the reconciler.
            type.$$typeof === REACT_MEMO_TYPE)) {
              propTypes = type.propTypes;
            } else {
              return;
            }
            if (propTypes) {
              var name2 = getComponentNameFromType(type);
              checkPropTypes(propTypes, element2.props, "prop", name2, element2);
            } else if (type.PropTypes !== void 0 && !propTypesMisspellWarningShown) {
              propTypesMisspellWarningShown = true;
              var _name = getComponentNameFromType(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(fragment2) {
          {
            var keys4 = Object.keys(fragment2.props);
            for (var i2 = 0; i2 < keys4.length; i2++) {
              var key = keys4[i2];
              if (key !== "children" && key !== "key") {
                setCurrentlyValidatingElement$1(fragment2);
                error("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", key);
                setCurrentlyValidatingElement$1(null);
                break;
              }
            }
            if (fragment2.ref !== null) {
              setCurrentlyValidatingElement$1(fragment2);
              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 (isArray2(type)) {
              typeString = "array";
            } else if (type !== void 0 && type.$$typeof === REACT_ELEMENT_TYPE) {
              typeString = "<" + (getComponentNameFromType(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 element2 = createElement17.apply(this, arguments);
          if (element2 == null) {
            return element2;
          }
          if (validType) {
            for (var i2 = 2; i2 < arguments.length; i2++) {
              validateChildKeys(arguments[i2], type);
            }
          }
          if (type === REACT_FRAGMENT_TYPE) {
            validateFragmentProps(element2);
          } else {
            validatePropTypes(element2);
          }
          return element2;
        }
        var didWarnAboutDeprecatedCreateFactory = false;
        function createFactoryWithValidation(type) {
          var validatedFactory = createElementWithValidation.bind(null, type);
          validatedFactory.type = type;
          {
            if (!didWarnAboutDeprecatedCreateFactory) {
              didWarnAboutDeprecatedCreateFactory = true;
              warn5("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() {
                warn5("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(element2, props, children) {
          var newElement = cloneElement10.apply(this, arguments);
          for (var i2 = 2; i2 < arguments.length; i2++) {
            validateChildKeys(arguments[i2], newElement.type);
          }
          validatePropTypes(newElement);
          return newElement;
        }
        function startTransition13(scope, options) {
          var prevTransition = ReactCurrentBatchConfig.transition;
          ReactCurrentBatchConfig.transition = {};
          var currentTransition = ReactCurrentBatchConfig.transition;
          {
            ReactCurrentBatchConfig.transition._updatedFibers = /* @__PURE__ */ new Set();
          }
          try {
            scope();
          } finally {
            ReactCurrentBatchConfig.transition = prevTransition;
            {
              if (prevTransition === null && currentTransition._updatedFibers) {
                var updatedFibersCount = currentTransition._updatedFibers.size;
                if (updatedFibersCount > 10) {
                  warn5("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table.");
                }
                currentTransition._updatedFibers.clear();
              }
            }
          }
        }
        var didWarnAboutMessageChannel = false;
        var enqueueTaskImpl = null;
        function enqueueTask(task) {
          if (enqueueTaskImpl === null) {
            try {
              var requireString = ("require" + Math.random()).slice(0, 7);
              var nodeRequire = module && module[requireString];
              enqueueTaskImpl = nodeRequire.call(module, "timers").setImmediate;
            } catch (_err) {
              enqueueTaskImpl = function(callback) {
                {
                  if (didWarnAboutMessageChannel === false) {
                    didWarnAboutMessageChannel = true;
                    if (typeof MessageChannel === "undefined") {
                      error("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning.");
                    }
                  }
                }
                var channel = new MessageChannel();
                channel.port1.onmessage = callback;
                channel.port2.postMessage(void 0);
              };
            }
          }
          return enqueueTaskImpl(task);
        }
        var actScopeDepth = 0;
        var didWarnNoAwaitAct = false;
        function act2(callback) {
          {
            var prevActScopeDepth = actScopeDepth;
            actScopeDepth++;
            if (ReactCurrentActQueue.current === null) {
              ReactCurrentActQueue.current = [];
            }
            var prevIsBatchingLegacy = ReactCurrentActQueue.isBatchingLegacy;
            var result;
            try {
              ReactCurrentActQueue.isBatchingLegacy = true;
              result = callback();
              if (!prevIsBatchingLegacy && ReactCurrentActQueue.didScheduleLegacyUpdate) {
                var queue = ReactCurrentActQueue.current;
                if (queue !== null) {
                  ReactCurrentActQueue.didScheduleLegacyUpdate = false;
                  flushActQueue(queue);
                }
              }
            } catch (error2) {
              popActScope(prevActScopeDepth);
              throw error2;
            } finally {
              ReactCurrentActQueue.isBatchingLegacy = prevIsBatchingLegacy;
            }
            if (result !== null && typeof result === "object" && typeof result.then === "function") {
              var thenableResult = result;
              var wasAwaited = false;
              var thenable = {
                then: function(resolve2, reject) {
                  wasAwaited = true;
                  thenableResult.then(function(returnValue2) {
                    popActScope(prevActScopeDepth);
                    if (actScopeDepth === 0) {
                      recursivelyFlushAsyncActWork(returnValue2, resolve2, reject);
                    } else {
                      resolve2(returnValue2);
                    }
                  }, function(error2) {
                    popActScope(prevActScopeDepth);
                    reject(error2);
                  });
                }
              };
              {
                if (!didWarnNoAwaitAct && typeof Promise !== "undefined") {
                  Promise.resolve().then(function() {
                  }).then(function() {
                    if (!wasAwaited) {
                      didWarnNoAwaitAct = true;
                      error("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);");
                    }
                  });
                }
              }
              return thenable;
            } else {
              var returnValue = result;
              popActScope(prevActScopeDepth);
              if (actScopeDepth === 0) {
                var _queue = ReactCurrentActQueue.current;
                if (_queue !== null) {
                  flushActQueue(_queue);
                  ReactCurrentActQueue.current = null;
                }
                var _thenable = {
                  then: function(resolve2, reject) {
                    if (ReactCurrentActQueue.current === null) {
                      ReactCurrentActQueue.current = [];
                      recursivelyFlushAsyncActWork(returnValue, resolve2, reject);
                    } else {
                      resolve2(returnValue);
                    }
                  }
                };
                return _thenable;
              } else {
                var _thenable2 = {
                  then: function(resolve2, reject) {
                    resolve2(returnValue);
                  }
                };
                return _thenable2;
              }
            }
          }
        }
        function popActScope(prevActScopeDepth) {
          {
            if (prevActScopeDepth !== actScopeDepth - 1) {
              error("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. ");
            }
            actScopeDepth = prevActScopeDepth;
          }
        }
        function recursivelyFlushAsyncActWork(returnValue, resolve2, reject) {
          {
            var queue = ReactCurrentActQueue.current;
            if (queue !== null) {
              try {
                flushActQueue(queue);
                enqueueTask(function() {
                  if (queue.length === 0) {
                    ReactCurrentActQueue.current = null;
                    resolve2(returnValue);
                  } else {
                    recursivelyFlushAsyncActWork(returnValue, resolve2, reject);
                  }
                });
              } catch (error2) {
                reject(error2);
              }
            } else {
              resolve2(returnValue);
            }
          }
        }
        var isFlushing = false;
        function flushActQueue(queue) {
          {
            if (!isFlushing) {
              isFlushing = true;
              var i2 = 0;
              try {
                for (; i2 < queue.length; i2++) {
                  var callback = queue[i2];
                  do {
                    callback = callback(true);
                  } while (callback !== null);
                }
                queue.length = 0;
              } catch (error2) {
                queue = queue.slice(i2 + 1);
                throw error2;
              } finally {
                isFlushing = false;
              }
            }
          }
        }
        var createElement$1 = createElementWithValidation;
        var cloneElement$1 = cloneElementWithValidation;
        var createFactory = createFactoryWithValidation;
        var Children9 = {
          map: mapChildren,
          forEach: forEachChildren,
          count: countChildren,
          toArray: toArray3,
          only: onlyChild
        };
        exports.Children = Children9;
        exports.Component = Component8;
        exports.Fragment = REACT_FRAGMENT_TYPE;
        exports.Profiler = REACT_PROFILER_TYPE;
        exports.PureComponent = PureComponent15;
        exports.StrictMode = REACT_STRICT_MODE_TYPE;
        exports.Suspense = REACT_SUSPENSE_TYPE;
        exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactSharedInternals;
        exports.cloneElement = cloneElement$1;
        exports.createContext = createContext17;
        exports.createElement = createElement$1;
        exports.createFactory = createFactory;
        exports.createRef = createRef3;
        exports.forwardRef = forwardRef15;
        exports.isValidElement = isValidElement10;
        exports.lazy = lazy;
        exports.memo = memo2;
        exports.startTransition = startTransition13;
        exports.unstable_act = act2;
        exports.useCallback = useCallback28;
        exports.useContext = useContext17;
        exports.useDebugValue = useDebugValue3;
        exports.useDeferredValue = useDeferredValue2;
        exports.useEffect = useEffect30;
        exports.useId = useId2;
        exports.useImperativeHandle = useImperativeHandle5;
        exports.useInsertionEffect = useInsertionEffect3;
        exports.useLayoutEffect = useLayoutEffect12;
        exports.useMemo = useMemo47;
        exports.useReducer = useReducer2;
        exports.useRef = useRef28;
        exports.useState = useState33;
        exports.useSyncExternalStore = useSyncExternalStore;
        exports.useTransition = useTransition2;
        exports.version = ReactVersion;
        if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop === "function") {
          __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
        }
      })();
    }
  }
});

// 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/react-dom/node_modules/scheduler/cjs/scheduler.development.js
var require_scheduler_development = __commonJS({
  "node_modules/react-dom/node_modules/scheduler/cjs/scheduler.development.js"(exports) {
    "use strict";
    if (true) {
      (function() {
        "use strict";
        if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === "function") {
          __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
        }
        var enableSchedulerDebugging = false;
        var enableProfiling = false;
        var frameYieldMs = 5;
        function push(heap, node56) {
          var index = heap.length;
          heap.push(node56);
          siftUp(heap, node56, index);
        }
        function peek2(heap) {
          return heap.length === 0 ? null : heap[0];
        }
        function pop(heap) {
          if (heap.length === 0) {
            return null;
          }
          var first = heap[0];
          var last = heap.pop();
          if (last !== first) {
            heap[0] = last;
            siftDown(heap, last, 0);
          }
          return first;
        }
        function siftUp(heap, node56, i2) {
          var index = i2;
          while (index > 0) {
            var parentIndex = index - 1 >>> 1;
            var parent = heap[parentIndex];
            if (compare2(parent, node56) > 0) {
              heap[parentIndex] = node56;
              heap[index] = parent;
              index = parentIndex;
            } else {
              return;
            }
          }
        }
        function siftDown(heap, node56, i2) {
          var index = i2;
          var length2 = heap.length;
          var halfLength = length2 >>> 1;
          while (index < halfLength) {
            var leftIndex = (index + 1) * 2 - 1;
            var left = heap[leftIndex];
            var rightIndex = leftIndex + 1;
            var right = heap[rightIndex];
            if (compare2(left, node56) < 0) {
              if (rightIndex < length2 && compare2(right, left) < 0) {
                heap[index] = right;
                heap[rightIndex] = node56;
                index = rightIndex;
              } else {
                heap[index] = left;
                heap[leftIndex] = node56;
                index = leftIndex;
              }
            } else if (rightIndex < length2 && compare2(right, node56) < 0) {
              heap[index] = right;
              heap[rightIndex] = node56;
              index = rightIndex;
            } else {
              return;
            }
          }
        }
        function compare2(a2, b) {
          var diff = a2.sortIndex - b.sortIndex;
          return diff !== 0 ? diff : a2.id - b.id;
        }
        var ImmediatePriority = 1;
        var UserBlockingPriority = 2;
        var NormalPriority = 3;
        var LowPriority = 4;
        var IdlePriority = 5;
        function markTaskErrored(task, ms) {
        }
        var hasPerformanceNow = typeof performance === "object" && typeof performance.now === "function";
        if (hasPerformanceNow) {
          var localPerformance = performance;
          exports.unstable_now = function() {
            return localPerformance.now();
          };
        } else {
          var localDate2 = Date;
          var initialTime = localDate2.now();
          exports.unstable_now = function() {
            return localDate2.now() - initialTime;
          };
        }
        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;
        var localSetTimeout = typeof setTimeout === "function" ? setTimeout : null;
        var localClearTimeout = typeof clearTimeout === "function" ? clearTimeout : null;
        var localSetImmediate = typeof setImmediate !== "undefined" ? setImmediate : null;
        var isInputPending2 = typeof navigator !== "undefined" && navigator.scheduling !== void 0 && navigator.scheduling.isInputPending !== void 0 ? navigator.scheduling.isInputPending.bind(navigator.scheduling) : null;
        function advanceTimers(currentTime) {
          var timer = peek2(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 = peek2(timerQueue);
          }
        }
        function handleTimeout(currentTime) {
          isHostTimeoutScheduled = false;
          advanceTimers(currentTime);
          if (!isHostCallbackScheduled) {
            if (peek2(taskQueue) !== null) {
              isHostCallbackScheduled = true;
              requestHostCallback(flushWork);
            } else {
              var firstTimer = peek2(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 = peek2(taskQueue);
          while (currentTask !== null && !enableSchedulerDebugging) {
            if (currentTask.expirationTime > currentTime && (!hasTimeRemaining || shouldYieldToHost())) {
              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 === peek2(taskQueue)) {
                  pop(taskQueue);
                }
              }
              advanceTimers(currentTime);
            } else {
              pop(taskQueue);
            }
            currentTask = peek2(taskQueue);
          }
          if (currentTask !== null) {
            return true;
          } else {
            var firstTimer = peek2(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_scheduleCallback2(priorityLevel, callback, options) {
          var currentTime = exports.unstable_now();
          var startTime2;
          if (typeof options === "object" && options !== null) {
            var delay = options.delay;
            if (typeof delay === "number" && delay > 0) {
              startTime2 = currentTime + delay;
            } else {
              startTime2 = currentTime;
            }
          } else {
            startTime2 = currentTime;
          }
          var timeout2;
          switch (priorityLevel) {
            case ImmediatePriority:
              timeout2 = IMMEDIATE_PRIORITY_TIMEOUT;
              break;
            case UserBlockingPriority:
              timeout2 = USER_BLOCKING_PRIORITY_TIMEOUT;
              break;
            case IdlePriority:
              timeout2 = IDLE_PRIORITY_TIMEOUT;
              break;
            case LowPriority:
              timeout2 = LOW_PRIORITY_TIMEOUT;
              break;
            case NormalPriority:
            default:
              timeout2 = NORMAL_PRIORITY_TIMEOUT;
              break;
          }
          var expirationTime = startTime2 + timeout2;
          var newTask = {
            id: taskIdCounter++,
            callback,
            priorityLevel,
            startTime: startTime2,
            expirationTime,
            sortIndex: -1
          };
          if (startTime2 > currentTime) {
            newTask.sortIndex = startTime2;
            push(timerQueue, newTask);
            if (peek2(taskQueue) === null && newTask === peek2(timerQueue)) {
              if (isHostTimeoutScheduled) {
                cancelHostTimeout();
              } else {
                isHostTimeoutScheduled = true;
              }
              requestHostTimeout(handleTimeout, startTime2 - 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 peek2(taskQueue);
        }
        function unstable_cancelCallback(task) {
          task.callback = null;
        }
        function unstable_getCurrentPriorityLevel() {
          return currentPriorityLevel;
        }
        var isMessageLoopRunning = false;
        var scheduledHostCallback = null;
        var taskTimeoutID = -1;
        var frameInterval = frameYieldMs;
        var startTime = -1;
        function shouldYieldToHost() {
          var timeElapsed = exports.unstable_now() - startTime;
          if (timeElapsed < frameInterval) {
            return false;
          }
          return true;
        }
        function requestPaint() {
        }
        function forceFrameRate(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) {
            frameInterval = Math.floor(1e3 / fps);
          } else {
            frameInterval = frameYieldMs;
          }
        }
        var performWorkUntilDeadline = function() {
          if (scheduledHostCallback !== null) {
            var currentTime = exports.unstable_now();
            startTime = currentTime;
            var hasTimeRemaining = true;
            var hasMoreWork = true;
            try {
              hasMoreWork = scheduledHostCallback(hasTimeRemaining, currentTime);
            } finally {
              if (hasMoreWork) {
                schedulePerformWorkUntilDeadline();
              } else {
                isMessageLoopRunning = false;
                scheduledHostCallback = null;
              }
            }
          } else {
            isMessageLoopRunning = false;
          }
        };
        var schedulePerformWorkUntilDeadline;
        if (typeof localSetImmediate === "function") {
          schedulePerformWorkUntilDeadline = function() {
            localSetImmediate(performWorkUntilDeadline);
          };
        } else if (typeof MessageChannel !== "undefined") {
          var channel = new MessageChannel();
          var port = channel.port2;
          channel.port1.onmessage = performWorkUntilDeadline;
          schedulePerformWorkUntilDeadline = function() {
            port.postMessage(null);
          };
        } else {
          schedulePerformWorkUntilDeadline = function() {
            localSetTimeout(performWorkUntilDeadline, 0);
          };
        }
        function requestHostCallback(callback) {
          scheduledHostCallback = callback;
          if (!isMessageLoopRunning) {
            isMessageLoopRunning = true;
            schedulePerformWorkUntilDeadline();
          }
        }
        function requestHostTimeout(callback, ms) {
          taskTimeoutID = localSetTimeout(function() {
            callback(exports.unstable_now());
          }, ms);
        }
        function cancelHostTimeout() {
          localClearTimeout(taskTimeoutID);
          taskTimeoutID = -1;
        }
        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_forceFrameRate = forceFrameRate;
        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_scheduleCallback2;
        exports.unstable_shouldYield = shouldYieldToHost;
        exports.unstable_wrapCallback = unstable_wrapCallback;
        if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop === "function") {
          __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
        }
      })();
    }
  }
});

// node_modules/react-dom/node_modules/scheduler/index.js
var require_scheduler = __commonJS({
  "node_modules/react-dom/node_modules/scheduler/index.js"(exports, module) {
    "use strict";
    if (false) {
      module.exports = null;
    } else {
      module.exports = require_scheduler_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";
        if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === "function") {
          __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
        }
        var React116 = require_react();
        var Scheduler = require_scheduler();
        var ReactSharedInternals = React116.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
        var suppressWarning = false;
        function setSuppressWarning(newSuppressWarning) {
          {
            suppressWarning = newSuppressWarning;
          }
        }
        function warn5(format3) {
          {
            if (!suppressWarning) {
              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", format3, args);
            }
          }
        }
        function error(format3) {
          {
            if (!suppressWarning) {
              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", format3, args);
            }
          }
        }
        function printWarning(level, format3, args) {
          {
            var ReactDebugCurrentFrame2 = ReactSharedInternals.ReactDebugCurrentFrame;
            var stack = ReactDebugCurrentFrame2.getStackAddendum();
            if (stack !== "") {
              format3 += "%s";
              args = args.concat([stack]);
            }
            var argsWithFormat = args.map(function(item) {
              return String(item);
            });
            argsWithFormat.unshift("Warning: " + format3);
            Function.prototype.apply.call(console[level], console, argsWithFormat);
          }
        }
        var FunctionComponent = 0;
        var ClassComponent = 1;
        var IndeterminateComponent = 2;
        var HostRoot = 3;
        var HostPortal = 4;
        var HostComponent = 5;
        var HostText = 6;
        var Fragment9 = 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 ScopeComponent = 21;
        var OffscreenComponent = 22;
        var LegacyHiddenComponent = 23;
        var CacheComponent = 24;
        var TracingMarkerComponent = 25;
        var enableClientRenderFallbackOnTextMismatch = true;
        var enableNewReconciler = false;
        var enableLazyContextPropagation = false;
        var enableLegacyHidden = false;
        var enableSuspenseAvoidThisFallback = false;
        var disableCommentsAsDOMContainers = true;
        var enableCustomElementPropertySupport = false;
        var warnAboutStringRefs = false;
        var enableSchedulingProfiler = true;
        var enableProfilerTimer = true;
        var enableProfilerCommitHooks = true;
        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 i2 = 0; i2 < dependencies.length; i2++) {
            allNativeEvents.add(dependencies[i2]);
          }
        }
        var canUseDOM = !!(typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined");
        var hasOwnProperty3 = Object.prototype.hasOwnProperty;
        function typeName2(value) {
          {
            var hasToStringTag = typeof Symbol === "function" && Symbol.toStringTag;
            var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
            return type;
          }
        }
        function willCoercionThrow(value) {
          {
            try {
              testStringCoercion(value);
              return false;
            } catch (e3) {
              return true;
            }
          }
        }
        function testStringCoercion(value) {
          return "" + value;
        }
        function checkAttributeStringCoercion(value, attributeName) {
          {
            if (willCoercionThrow(value)) {
              error("The provided `%s` attribute is an unsupported type %s. This value must be coerced to a string before before using it here.", attributeName, typeName2(value));
              return testStringCoercion(value);
            }
          }
        }
        function checkKeyStringCoercion(value) {
          {
            if (willCoercionThrow(value)) {
              error("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", typeName2(value));
              return testStringCoercion(value);
            }
          }
        }
        function checkPropStringCoercion(value, propName) {
          {
            if (willCoercionThrow(value)) {
              error("The provided `%s` prop is an unsupported type %s. This value must be coerced to a string before before using it here.", propName, typeName2(value));
              return testStringCoercion(value);
            }
          }
        }
        function checkCSSPropertyStringCoercion(value, propName) {
          {
            if (willCoercionThrow(value)) {
              error("The provided `%s` CSS property is an unsupported type %s. This value must be coerced to a string before before using it here.", propName, typeName2(value));
              return testStringCoercion(value);
            }
          }
        }
        function checkHtmlStringCoercion(value) {
          {
            if (willCoercionThrow(value)) {
              error("The provided HTML markup uses a value of unsupported type %s. This value must be coerced to a string before before using it here.", typeName2(value));
              return testStringCoercion(value);
            }
          }
        }
        function checkFormFieldValueStringCoercion(value) {
          {
            if (willCoercionThrow(value)) {
              error("Form field values (value, checked, defaultValue, or defaultChecked props) must be strings, not %s. This value must be coerced to a string before before using it here.", typeName2(value));
              return testStringCoercion(value);
            }
          }
        }
        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 VALID_ATTRIBUTE_NAME_REGEX = new RegExp("^[" + ATTRIBUTE_NAME_START_CHAR + "][" + ATTRIBUTE_NAME_CHAR + "]*$");
        var illegalAttributeNameCache = {};
        var validatedAttributeNameCache = {};
        function isAttributeNameSafe(attributeName) {
          if (hasOwnProperty3.call(validatedAttributeNameCache, attributeName)) {
            return true;
          }
          if (hasOwnProperty3.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(name2, propertyInfo, isCustomComponentTag) {
          if (propertyInfo !== null) {
            return propertyInfo.type === RESERVED;
          }
          if (isCustomComponentTag) {
            return false;
          }
          if (name2.length > 2 && (name2[0] === "o" || name2[0] === "O") && (name2[1] === "n" || name2[1] === "N")) {
            return true;
          }
          return false;
        }
        function shouldRemoveAttributeWithWarning(name2, 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 prefix4 = name2.toLowerCase().slice(0, 5);
                return prefix4 !== "data-" && prefix4 !== "aria-";
              }
            }
            default:
              return false;
          }
        }
        function shouldRemoveAttribute(name2, value, propertyInfo, isCustomComponentTag) {
          if (value === null || typeof value === "undefined") {
            return true;
          }
          if (shouldRemoveAttributeWithWarning(name2, 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(name2) {
          return properties.hasOwnProperty(name2) ? properties[name2] : null;
        }
        function PropertyInfoRecord(name2, 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 = name2;
          this.type = type;
          this.sanitizeURL = sanitizeURL2;
          this.removeEmptyString = removeEmptyString;
        }
        var properties = {};
        var reservedProps = [
          "children",
          "dangerouslySetInnerHTML",
          // TODO: This prevents the assignment of defaultValue to regular
          // elements (not just inputs). Now that ReactDOMInput assigns to the
          // defaultValue property -- do we need this?
          "defaultValue",
          "defaultChecked",
          "innerHTML",
          "suppressContentEditableWarning",
          "suppressHydrationWarning",
          "style"
        ];
        reservedProps.forEach(function(name2) {
          properties[name2] = new PropertyInfoRecord(
            name2,
            RESERVED,
            false,
            // mustUseProperty
            name2,
            // attributeName
            null,
            // attributeNamespace
            false,
            // sanitizeURL
            false
          );
        });
        [["acceptCharset", "accept-charset"], ["className", "class"], ["htmlFor", "for"], ["httpEquiv", "http-equiv"]].forEach(function(_ref18) {
          var name2 = _ref18[0], attributeName = _ref18[1];
          properties[name2] = new PropertyInfoRecord(
            name2,
            STRING,
            false,
            // mustUseProperty
            attributeName,
            // attributeName
            null,
            // attributeNamespace
            false,
            // sanitizeURL
            false
          );
        });
        ["contentEditable", "draggable", "spellCheck", "value"].forEach(function(name2) {
          properties[name2] = new PropertyInfoRecord(
            name2,
            BOOLEANISH_STRING,
            false,
            // mustUseProperty
            name2.toLowerCase(),
            // attributeName
            null,
            // attributeNamespace
            false,
            // sanitizeURL
            false
          );
        });
        ["autoReverse", "externalResourcesRequired", "focusable", "preserveAlpha"].forEach(function(name2) {
          properties[name2] = new PropertyInfoRecord(
            name2,
            BOOLEANISH_STRING,
            false,
            // mustUseProperty
            name2,
            // attributeName
            null,
            // attributeNamespace
            false,
            // sanitizeURL
            false
          );
        });
        [
          "allowFullScreen",
          "async",
          // Note: there is a special case that prevents it from being written to the DOM
          // on the client side because the browsers are inconsistent. Instead we call focus().
          "autoFocus",
          "autoPlay",
          "controls",
          "default",
          "defer",
          "disabled",
          "disablePictureInPicture",
          "disableRemotePlayback",
          "formNoValidate",
          "hidden",
          "loop",
          "noModule",
          "noValidate",
          "open",
          "playsInline",
          "readOnly",
          "required",
          "reversed",
          "scoped",
          "seamless",
          // Microdata
          "itemScope"
        ].forEach(function(name2) {
          properties[name2] = new PropertyInfoRecord(
            name2,
            BOOLEAN,
            false,
            // mustUseProperty
            name2.toLowerCase(),
            // attributeName
            null,
            // attributeNamespace
            false,
            // sanitizeURL
            false
          );
        });
        [
          "checked",
          // Note: `option.selected` is not updated if `select.multiple` is
          // disabled with `removeAttribute`. We have special logic for handling this.
          "multiple",
          "muted",
          "selected"
          // NOTE: if you add a camelCased prop to this list,
          // you'll need to set attributeName to name.toLowerCase()
          // instead in the assignment below.
        ].forEach(function(name2) {
          properties[name2] = new PropertyInfoRecord(
            name2,
            BOOLEAN,
            true,
            // mustUseProperty
            name2,
            // attributeName
            null,
            // attributeNamespace
            false,
            // sanitizeURL
            false
          );
        });
        [
          "capture",
          "download"
          // NOTE: if you add a camelCased prop to this list,
          // you'll need to set attributeName to name.toLowerCase()
          // instead in the assignment below.
        ].forEach(function(name2) {
          properties[name2] = new PropertyInfoRecord(
            name2,
            OVERLOADED_BOOLEAN,
            false,
            // mustUseProperty
            name2,
            // attributeName
            null,
            // attributeNamespace
            false,
            // sanitizeURL
            false
          );
        });
        [
          "cols",
          "rows",
          "size",
          "span"
          // NOTE: if you add a camelCased prop to this list,
          // you'll need to set attributeName to name.toLowerCase()
          // instead in the assignment below.
        ].forEach(function(name2) {
          properties[name2] = new PropertyInfoRecord(
            name2,
            POSITIVE_NUMERIC,
            false,
            // mustUseProperty
            name2,
            // attributeName
            null,
            // attributeNamespace
            false,
            // sanitizeURL
            false
          );
        });
        ["rowSpan", "start"].forEach(function(name2) {
          properties[name2] = new PropertyInfoRecord(
            name2,
            NUMERIC,
            false,
            // mustUseProperty
            name2.toLowerCase(),
            // attributeName
            null,
            // attributeNamespace
            false,
            // sanitizeURL
            false
          );
        });
        var CAMELIZE = /[\-\:]([a-z])/g;
        var capitalize = function(token2) {
          return token2[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"
          // NOTE: if you add a camelCased prop to this list,
          // you'll need to set attributeName to name.toLowerCase()
          // instead in the assignment below.
        ].forEach(function(attributeName) {
          var name2 = attributeName.replace(CAMELIZE, capitalize);
          properties[name2] = new PropertyInfoRecord(
            name2,
            STRING,
            false,
            // mustUseProperty
            attributeName,
            null,
            // attributeNamespace
            false,
            // sanitizeURL
            false
          );
        });
        [
          "xlink:actuate",
          "xlink:arcrole",
          "xlink:role",
          "xlink:show",
          "xlink:title",
          "xlink:type"
          // NOTE: if you add a camelCased prop to this list,
          // you'll need to set attributeName to name.toLowerCase()
          // instead in the assignment below.
        ].forEach(function(attributeName) {
          var name2 = attributeName.replace(CAMELIZE, capitalize);
          properties[name2] = new PropertyInfoRecord(
            name2,
            STRING,
            false,
            // mustUseProperty
            attributeName,
            "http://www.w3.org/1999/xlink",
            false,
            // sanitizeURL
            false
          );
        });
        [
          "xml:base",
          "xml:lang",
          "xml:space"
          // NOTE: if you add a camelCased prop to this list,
          // you'll need to set attributeName to name.toLowerCase()
          // instead in the assignment below.
        ].forEach(function(attributeName) {
          var name2 = attributeName.replace(CAMELIZE, capitalize);
          properties[name2] = new PropertyInfoRecord(
            name2,
            STRING,
            false,
            // mustUseProperty
            attributeName,
            "http://www.w3.org/XML/1998/namespace",
            false,
            // sanitizeURL
            false
          );
        });
        ["tabIndex", "crossOrigin"].forEach(function(attributeName) {
          properties[attributeName] = new PropertyInfoRecord(
            attributeName,
            STRING,
            false,
            // mustUseProperty
            attributeName.toLowerCase(),
            // attributeName
            null,
            // attributeNamespace
            false,
            // sanitizeURL
            false
          );
        });
        var xlinkHref = "xlinkHref";
        properties[xlinkHref] = new PropertyInfoRecord(
          "xlinkHref",
          STRING,
          false,
          // mustUseProperty
          "xlink:href",
          "http://www.w3.org/1999/xlink",
          true,
          // sanitizeURL
          false
        );
        ["src", "href", "action", "formAction"].forEach(function(attributeName) {
          properties[attributeName] = new PropertyInfoRecord(
            attributeName,
            STRING,
            false,
            // mustUseProperty
            attributeName.toLowerCase(),
            // attributeName
            null,
            // attributeNamespace
            true,
            // sanitizeURL
            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(node56, name2, expected, propertyInfo) {
          {
            if (propertyInfo.mustUseProperty) {
              var propertyName2 = propertyInfo.propertyName;
              return node56[propertyName2];
            } else {
              {
                checkAttributeStringCoercion(expected, name2);
              }
              if (propertyInfo.sanitizeURL) {
                sanitizeURL("" + expected);
              }
              var attributeName = propertyInfo.attributeName;
              var stringValue = null;
              if (propertyInfo.type === OVERLOADED_BOOLEAN) {
                if (node56.hasAttribute(attributeName)) {
                  var value = node56.getAttribute(attributeName);
                  if (value === "") {
                    return true;
                  }
                  if (shouldRemoveAttribute(name2, expected, propertyInfo, false)) {
                    return value;
                  }
                  if (value === "" + expected) {
                    return expected;
                  }
                  return value;
                }
              } else if (node56.hasAttribute(attributeName)) {
                if (shouldRemoveAttribute(name2, expected, propertyInfo, false)) {
                  return node56.getAttribute(attributeName);
                }
                if (propertyInfo.type === BOOLEAN) {
                  return expected;
                }
                stringValue = node56.getAttribute(attributeName);
              }
              if (shouldRemoveAttribute(name2, expected, propertyInfo, false)) {
                return stringValue === null ? expected : stringValue;
              } else if (stringValue === "" + expected) {
                return expected;
              } else {
                return stringValue;
              }
            }
          }
        }
        function getValueForAttribute(node56, name2, expected, isCustomComponentTag) {
          {
            if (!isAttributeNameSafe(name2)) {
              return;
            }
            if (!node56.hasAttribute(name2)) {
              return expected === void 0 ? void 0 : null;
            }
            var value = node56.getAttribute(name2);
            {
              checkAttributeStringCoercion(expected, name2);
            }
            if (value === "" + expected) {
              return expected;
            }
            return value;
          }
        }
        function setValueForProperty(node56, name2, value, isCustomComponentTag) {
          var propertyInfo = getPropertyInfo(name2);
          if (shouldIgnoreAttribute(name2, propertyInfo, isCustomComponentTag)) {
            return;
          }
          if (shouldRemoveAttribute(name2, value, propertyInfo, isCustomComponentTag)) {
            value = null;
          }
          if (isCustomComponentTag || propertyInfo === null) {
            if (isAttributeNameSafe(name2)) {
              var _attributeName = name2;
              if (value === null) {
                node56.removeAttribute(_attributeName);
              } else {
                {
                  checkAttributeStringCoercion(value, name2);
                }
                node56.setAttribute(_attributeName, "" + value);
              }
            }
            return;
          }
          var mustUseProperty = propertyInfo.mustUseProperty;
          if (mustUseProperty) {
            var propertyName2 = propertyInfo.propertyName;
            if (value === null) {
              var type = propertyInfo.type;
              node56[propertyName2] = type === BOOLEAN ? false : "";
            } else {
              node56[propertyName2] = value;
            }
            return;
          }
          var attributeName = propertyInfo.attributeName, attributeNamespace = propertyInfo.attributeNamespace;
          if (value === null) {
            node56.removeAttribute(attributeName);
          } else {
            var _type = propertyInfo.type;
            var attributeValue;
            if (_type === BOOLEAN || _type === OVERLOADED_BOOLEAN && value === true) {
              attributeValue = "";
            } else {
              {
                {
                  checkAttributeStringCoercion(value, attributeName);
                }
                attributeValue = "" + value;
              }
              if (propertyInfo.sanitizeURL) {
                sanitizeURL(attributeValue.toString());
              }
            }
            if (attributeNamespace) {
              node56.setAttributeNS(attributeNamespace, attributeName, attributeValue);
            } else {
              node56.setAttribute(attributeName, attributeValue);
            }
          }
        }
        var REACT_ELEMENT_TYPE = Symbol.for("react.element");
        var REACT_PORTAL_TYPE = Symbol.for("react.portal");
        var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
        var REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode");
        var REACT_PROFILER_TYPE = Symbol.for("react.profiler");
        var REACT_PROVIDER_TYPE = Symbol.for("react.provider");
        var REACT_CONTEXT_TYPE = Symbol.for("react.context");
        var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref");
        var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense");
        var REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list");
        var REACT_MEMO_TYPE = Symbol.for("react.memo");
        var REACT_LAZY_TYPE = Symbol.for("react.lazy");
        var REACT_SCOPE_TYPE = Symbol.for("react.scope");
        var REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for("react.debug_trace_mode");
        var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen");
        var REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden");
        var REACT_CACHE_TYPE = Symbol.for("react.cache");
        var REACT_TRACING_MARKER_TYPE = Symbol.for("react.tracing_marker");
        var MAYBE_ITERATOR_SYMBOL = 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 assign3 = Object.assign;
        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: assign3({}, props, {
                  value: prevLog
                }),
                info: assign3({}, props, {
                  value: prevInfo
                }),
                warn: assign3({}, props, {
                  value: prevWarn
                }),
                error: assign3({}, props, {
                  value: prevError
                }),
                group: assign3({}, props, {
                  value: prevGroup
                }),
                groupCollapsed: assign3({}, props, {
                  value: prevGroupCollapsed
                }),
                groupEnd: assign3({}, 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 prefix3;
        function describeBuiltInComponentFrame(name2, source, ownerFn) {
          {
            if (prefix3 === void 0) {
              try {
                throw Error();
              } catch (x2) {
                var match2 = x2.stack.trim().match(/\n( *(at )?)/);
                prefix3 = match2 && match2[1] || "";
              }
            }
            return "\n" + prefix3 + name2;
          }
        }
        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 (x2) {
                  control = x2;
                }
                Reflect.construct(fn, [], Fake);
              } else {
                try {
                  Fake.call();
                } catch (x2) {
                  control = x2;
                }
                fn.call(Fake.prototype);
              }
            } else {
              try {
                throw Error();
              } catch (x2) {
                control = x2;
              }
              fn();
            }
          } catch (sample) {
            if (sample && control && typeof sample.stack === "string") {
              var sampleLines = sample.stack.split("\n");
              var controlLines = control.stack.split("\n");
              var s2 = sampleLines.length - 1;
              var c4 = controlLines.length - 1;
              while (s2 >= 1 && c4 >= 0 && sampleLines[s2] !== controlLines[c4]) {
                c4--;
              }
              for (; s2 >= 1 && c4 >= 0; s2--, c4--) {
                if (sampleLines[s2] !== controlLines[c4]) {
                  if (s2 !== 1 || c4 !== 1) {
                    do {
                      s2--;
                      c4--;
                      if (c4 < 0 || sampleLines[s2] !== controlLines[c4]) {
                        var _frame = "\n" + sampleLines[s2].replace(" at new ", " at ");
                        if (fn.displayName && _frame.includes("<anonymous>")) {
                          _frame = _frame.replace("<anonymous>", fn.displayName);
                        }
                        {
                          if (typeof fn === "function") {
                            componentFrameCache.set(fn, _frame);
                          }
                        }
                        return _frame;
                      }
                    } while (s2 >= 1 && c4 >= 0);
                  }
                  break;
                }
              }
            }
          } finally {
            reentry = false;
            {
              ReactCurrentDispatcher.current = previousDispatcher;
              reenableLogs();
            }
            Error.prepareStackTrace = previousPrepareStackTrace;
          }
          var name2 = fn ? fn.displayName || fn.name : "";
          var syntheticFrame = name2 ? describeBuiltInComponentFrame(name2) : "";
          {
            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(Component8) {
          var prototype = Component8.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_LAZY_TYPE: {
                var lazyComponent = type;
                var payload = lazyComponent._payload;
                var init = lazyComponent._init;
                try {
                  return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
                } catch (x2) {
                }
              }
            }
          }
          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 ClassComponent:
              return describeClassComponentFrame(fiber.type);
            default:
              return "";
          }
        }
        function getStackByFiberInDevAndProd(workInProgress2) {
          try {
            var info = "";
            var node56 = workInProgress2;
            do {
              info += describeFiber(node56);
              node56 = node56.return;
            } while (node56);
            return info;
          } catch (x2) {
            return "\nError generating stack: " + x2.message + "\n" + x2.stack;
          }
        }
        function getWrappedName(outerType, innerType, wrapperName) {
          var displayName = outerType.displayName;
          if (displayName) {
            return displayName;
          }
          var functionName = innerType.displayName || innerType.name || "";
          return functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName;
        }
        function getContextName(type) {
          return type.displayName || "Context";
        }
        function getComponentNameFromType(type) {
          if (type == null) {
            return null;
          }
          {
            if (typeof type.tag === "number") {
              error("Received an unexpected object in getComponentNameFromType(). 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 context2 = type;
                return getContextName(context2) + ".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:
                var outerName = type.displayName || null;
                if (outerName !== null) {
                  return outerName;
                }
                return getComponentNameFromType(type.type) || "Memo";
              case REACT_LAZY_TYPE: {
                var lazyComponent = type;
                var payload = lazyComponent._payload;
                var init = lazyComponent._init;
                try {
                  return getComponentNameFromType(init(payload));
                } catch (x2) {
                  return null;
                }
              }
            }
          }
          return null;
        }
        function getWrappedName$1(outerType, innerType, wrapperName) {
          var functionName = innerType.displayName || innerType.name || "";
          return outerType.displayName || (functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName);
        }
        function getContextName$1(type) {
          return type.displayName || "Context";
        }
        function getComponentNameFromFiber(fiber) {
          var tag = fiber.tag, type = fiber.type;
          switch (tag) {
            case CacheComponent:
              return "Cache";
            case ContextConsumer:
              var context2 = type;
              return getContextName$1(context2) + ".Consumer";
            case ContextProvider:
              var provider = type;
              return getContextName$1(provider._context) + ".Provider";
            case DehydratedFragment:
              return "DehydratedFragment";
            case ForwardRef:
              return getWrappedName$1(type, type.render, "ForwardRef");
            case Fragment9:
              return "Fragment";
            case HostComponent:
              return type;
            case HostPortal:
              return "Portal";
            case HostRoot:
              return "Root";
            case HostText:
              return "Text";
            case LazyComponent:
              return getComponentNameFromType(type);
            case Mode:
              if (type === REACT_STRICT_MODE_TYPE) {
                return "StrictMode";
              }
              return "Mode";
            case OffscreenComponent:
              return "Offscreen";
            case Profiler:
              return "Profiler";
            case ScopeComponent:
              return "Scope";
            case SuspenseComponent:
              return "Suspense";
            case SuspenseListComponent:
              return "SuspenseList";
            case TracingMarkerComponent:
              return "TracingMarker";
            case ClassComponent:
            case FunctionComponent:
            case IncompleteClassComponent:
            case IndeterminateComponent:
            case MemoComponent:
            case SimpleMemoComponent:
              if (typeof type === "function") {
                return type.displayName || type.name || null;
              }
              if (typeof type === "string") {
                return type;
              }
              break;
          }
          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 getComponentNameFromFiber(owner);
            }
          }
          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 = fiber === null ? null : getCurrentFiberStackInDev;
            current = fiber;
            isRendering = false;
          }
        }
        function getCurrentFiber() {
          {
            return current;
          }
        }
        function setIsRendering(rendering) {
          {
            isRendering = rendering;
          }
        }
        function toString2(value) {
          return "" + value;
        }
        function getToStringValue(value) {
          switch (typeof value) {
            case "boolean":
            case "number":
            case "string":
            case "undefined":
              return value;
            case "object":
              {
                checkFormFieldValueStringCoercion(value);
              }
              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(node56) {
          return node56._valueTracker;
        }
        function detachTracker(node56) {
          node56._valueTracker = null;
        }
        function getValueFromNode(node56) {
          var value = "";
          if (!node56) {
            return value;
          }
          if (isCheckable(node56)) {
            value = node56.checked ? "true" : "false";
          } else {
            value = node56.value;
          }
          return value;
        }
        function trackValueOnNode(node56) {
          var valueField = isCheckable(node56) ? "checked" : "value";
          var descriptor = Object.getOwnPropertyDescriptor(node56.constructor.prototype, valueField);
          {
            checkFormFieldValueStringCoercion(node56[valueField]);
          }
          var currentValue = "" + node56[valueField];
          if (node56.hasOwnProperty(valueField) || typeof descriptor === "undefined" || typeof descriptor.get !== "function" || typeof descriptor.set !== "function") {
            return;
          }
          var get4 = descriptor.get, set4 = descriptor.set;
          Object.defineProperty(node56, valueField, {
            configurable: true,
            get: function() {
              return get4.call(this);
            },
            set: function(value) {
              {
                checkFormFieldValueStringCoercion(value);
              }
              currentValue = "" + value;
              set4.call(this, value);
            }
          });
          Object.defineProperty(node56, valueField, {
            enumerable: descriptor.enumerable
          });
          var tracker = {
            getValue: function() {
              return currentValue;
            },
            setValue: function(value) {
              {
                checkFormFieldValueStringCoercion(value);
              }
              currentValue = "" + value;
            },
            stopTracking: function() {
              detachTracker(node56);
              delete node56[valueField];
            }
          };
          return tracker;
        }
        function track(node56) {
          if (getTracker(node56)) {
            return;
          }
          node56._valueTracker = trackValueOnNode(node56);
        }
        function updateValueIfChanged(node56) {
          if (!node56) {
            return false;
          }
          var tracker = getTracker(node56);
          if (!tracker) {
            return true;
          }
          var lastValue = tracker.getValue();
          var nextValue = getValueFromNode(node56);
          if (nextValue !== lastValue) {
            tracker.setValue(nextValue);
            return true;
          }
          return false;
        }
        function getActiveElement(doc2) {
          doc2 = doc2 || (typeof document !== "undefined" ? document : void 0);
          if (typeof doc2 === "undefined") {
            return null;
          }
          try {
            return doc2.activeElement || doc2.body;
          } catch (e3) {
            return doc2.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(element2, props) {
          var node56 = element2;
          var checked = props.checked;
          var hostProps = assign3({}, props, {
            defaultChecked: void 0,
            defaultValue: void 0,
            value: void 0,
            checked: checked != null ? checked : node56._wrapperState.initialChecked
          });
          return hostProps;
        }
        function initWrapperState(element2, 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 node56 = element2;
          var defaultValue = props.defaultValue == null ? "" : props.defaultValue;
          node56._wrapperState = {
            initialChecked: props.checked != null ? props.checked : props.defaultChecked,
            initialValue: getToStringValue(props.value != null ? props.value : defaultValue),
            controlled: isControlled(props)
          };
        }
        function updateChecked(element2, props) {
          var node56 = element2;
          var checked = props.checked;
          if (checked != null) {
            setValueForProperty(node56, "checked", checked, false);
          }
        }
        function updateWrapper(element2, props) {
          var node56 = element2;
          {
            var controlled = isControlled(props);
            if (!node56._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 (node56._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(element2, props);
          var value = getToStringValue(props.value);
          var type = props.type;
          if (value != null) {
            if (type === "number") {
              if (value === 0 && node56.value === "" || // We explicitly want to coerce to number here if possible.
              // eslint-disable-next-line
              node56.value != value) {
                node56.value = toString2(value);
              }
            } else if (node56.value !== toString2(value)) {
              node56.value = toString2(value);
            }
          } else if (type === "submit" || type === "reset") {
            node56.removeAttribute("value");
            return;
          }
          {
            if (props.hasOwnProperty("value")) {
              setDefaultValue(node56, props.type, value);
            } else if (props.hasOwnProperty("defaultValue")) {
              setDefaultValue(node56, props.type, getToStringValue(props.defaultValue));
            }
          }
          {
            if (props.checked == null && props.defaultChecked != null) {
              node56.defaultChecked = !!props.defaultChecked;
            }
          }
        }
        function postMountWrapper(element2, props, isHydrating2) {
          var node56 = element2;
          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 = toString2(node56._wrapperState.initialValue);
            if (!isHydrating2) {
              {
                if (initialValue !== node56.value) {
                  node56.value = initialValue;
                }
              }
            }
            {
              node56.defaultValue = initialValue;
            }
          }
          var name2 = node56.name;
          if (name2 !== "") {
            node56.name = "";
          }
          {
            node56.defaultChecked = !node56.defaultChecked;
            node56.defaultChecked = !!node56._wrapperState.initialChecked;
          }
          if (name2 !== "") {
            node56.name = name2;
          }
        }
        function restoreControlledState(element2, props) {
          var node56 = element2;
          updateWrapper(node56, props);
          updateNamedCousins(node56, props);
        }
        function updateNamedCousins(rootNode, props) {
          var name2 = props.name;
          if (props.type === "radio" && name2 != null) {
            var queryRoot = rootNode;
            while (queryRoot.parentNode) {
              queryRoot = queryRoot.parentNode;
            }
            {
              checkAttributeStringCoercion(name2, "name");
            }
            var group = queryRoot.querySelectorAll("input[name=" + JSON.stringify("" + name2) + '][type="radio"]');
            for (var i2 = 0; i2 < group.length; i2++) {
              var otherNode = group[i2];
              if (otherNode === rootNode || otherNode.form !== rootNode.form) {
                continue;
              }
              var otherProps = getFiberCurrentPropsFromNode(otherNode);
              if (!otherProps) {
                throw new Error("ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported.");
              }
              updateValueIfChanged(otherNode);
              updateWrapper(otherNode, otherProps);
            }
          }
        }
        function setDefaultValue(node56, type, value) {
          if (
            // Focused number inputs synchronize on blur. See ChangeEventPlugin.js
            type !== "number" || getActiveElement(node56.ownerDocument) !== node56
          ) {
            if (value == null) {
              node56.defaultValue = toString2(node56._wrapperState.initialValue);
            } else if (node56.defaultValue !== toString2(value)) {
              node56.defaultValue = toString2(value);
            }
          }
        }
        var didWarnSelectedSetOnOption = false;
        var didWarnInvalidChild = false;
        var didWarnInvalidInnerHTML = false;
        function validateProps(element2, props) {
          {
            if (props.value == null) {
              if (typeof props.children === "object" && props.children !== null) {
                React116.Children.forEach(props.children, function(child) {
                  if (child == null) {
                    return;
                  }
                  if (typeof child === "string" || typeof child === "number") {
                    return;
                  }
                  if (!didWarnInvalidChild) {
                    didWarnInvalidChild = true;
                    error("Cannot infer the option value of complex children. Pass a `value` prop or use a plain string as children to <option>.");
                  }
                });
              } else if (props.dangerouslySetInnerHTML != null) {
                if (!didWarnInvalidInnerHTML) {
                  didWarnInvalidInnerHTML = true;
                  error("Pass a `value` prop if you set dangerouslyInnerHTML so React knows which value should be selected.");
                }
              }
            }
            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(element2, props) {
          if (props.value != null) {
            element2.setAttribute("value", toString2(getToStringValue(props.value)));
          }
        }
        var isArrayImpl = Array.isArray;
        function isArray2(a2) {
          return isArrayImpl(a2);
        }
        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 i2 = 0; i2 < valuePropNames.length; i2++) {
              var propName = valuePropNames[i2];
              if (props[propName] == null) {
                continue;
              }
              var propNameIsArray = isArray2(props[propName]);
              if (props.multiple && !propNameIsArray) {
                error("The `%s` prop supplied to <select> must be an array if `multiple` is true.%s", propName, getDeclarationErrorAddendum());
              } else if (!props.multiple && propNameIsArray) {
                error("The `%s` prop supplied to <select> must be a scalar value if `multiple` is false.%s", propName, getDeclarationErrorAddendum());
              }
            }
          }
        }
        function updateOptions(node56, multiple, propValue, setDefaultSelected) {
          var options2 = node56.options;
          if (multiple) {
            var selectedValues = propValue;
            var selectedValue = {};
            for (var i2 = 0; i2 < selectedValues.length; i2++) {
              selectedValue["$" + selectedValues[i2]] = 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 = toString2(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$1(element2, props) {
          return assign3({}, props, {
            value: void 0
          });
        }
        function initWrapperState$1(element2, props) {
          var node56 = element2;
          {
            checkSelectPropTypes(props);
          }
          node56._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(element2, props) {
          var node56 = element2;
          node56.multiple = !!props.multiple;
          var value = props.value;
          if (value != null) {
            updateOptions(node56, !!props.multiple, value, false);
          } else if (props.defaultValue != null) {
            updateOptions(node56, !!props.multiple, props.defaultValue, true);
          }
        }
        function postUpdateWrapper(element2, props) {
          var node56 = element2;
          var wasMultiple = node56._wrapperState.wasMultiple;
          node56._wrapperState.wasMultiple = !!props.multiple;
          var value = props.value;
          if (value != null) {
            updateOptions(node56, !!props.multiple, value, false);
          } else if (wasMultiple !== !!props.multiple) {
            if (props.defaultValue != null) {
              updateOptions(node56, !!props.multiple, props.defaultValue, true);
            } else {
              updateOptions(node56, !!props.multiple, props.multiple ? [] : "", false);
            }
          }
        }
        function restoreControlledState$1(element2, props) {
          var node56 = element2;
          var value = props.value;
          if (value != null) {
            updateOptions(node56, !!props.multiple, value, false);
          }
        }
        var didWarnValDefaultVal = false;
        function getHostProps$2(element2, props) {
          var node56 = element2;
          if (props.dangerouslySetInnerHTML != null) {
            throw new Error("`dangerouslySetInnerHTML` does not make sense on <textarea>.");
          }
          var hostProps = assign3({}, props, {
            value: void 0,
            defaultValue: void 0,
            children: toString2(node56._wrapperState.initialValue)
          });
          return hostProps;
        }
        function initWrapperState$2(element2, props) {
          var node56 = element2;
          {
            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 new Error("If you supply `defaultValue` on a <textarea>, do not pass children.");
                }
                if (isArray2(children)) {
                  if (children.length > 1) {
                    throw new Error("<textarea> can only have at most one child.");
                  }
                  children = children[0];
                }
                defaultValue = children;
              }
            }
            if (defaultValue == null) {
              defaultValue = "";
            }
            initialValue = defaultValue;
          }
          node56._wrapperState = {
            initialValue: getToStringValue(initialValue)
          };
        }
        function updateWrapper$1(element2, props) {
          var node56 = element2;
          var value = getToStringValue(props.value);
          var defaultValue = getToStringValue(props.defaultValue);
          if (value != null) {
            var newValue = toString2(value);
            if (newValue !== node56.value) {
              node56.value = newValue;
            }
            if (props.defaultValue == null && node56.defaultValue !== newValue) {
              node56.defaultValue = newValue;
            }
          }
          if (defaultValue != null) {
            node56.defaultValue = toString2(defaultValue);
          }
        }
        function postMountWrapper$3(element2, props) {
          var node56 = element2;
          var textContent = node56.textContent;
          if (textContent === node56._wrapperState.initialValue) {
            if (textContent !== "" && textContent !== null) {
              node56.value = textContent;
            }
          }
        }
        function restoreControlledState$2(element2, props) {
          updateWrapper$1(element2, 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";
        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(node56, html) {
          if (node56.namespaceURI === SVG_NAMESPACE) {
            if (!("innerHTML" in node56)) {
              reusableSVGContainer = reusableSVGContainer || document.createElement("div");
              reusableSVGContainer.innerHTML = "<svg>" + html.valueOf().toString() + "</svg>";
              var svgNode = reusableSVGContainer.firstChild;
              while (node56.firstChild) {
                node56.removeChild(node56.firstChild);
              }
              while (svgNode.firstChild) {
                node56.appendChild(svgNode.firstChild);
              }
              return;
            }
          }
          node56.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(node56, text2) {
          if (text2) {
            var firstChild = node56.firstChild;
            if (firstChild && firstChild === node56.lastChild && firstChild.nodeType === TEXT_NODE) {
              firstChild.nodeValue = text2;
              return;
            }
          }
          node56.textContent = text2;
        };
        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,
          aspectRatio: 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,
          // SVG-related properties
          fillOpacity: true,
          floodOpacity: true,
          stopOpacity: true,
          strokeDasharray: true,
          strokeDashoffset: true,
          strokeMiterlimit: true,
          strokeOpacity: true,
          strokeWidth: true
        };
        function prefixKey(prefix4, key) {
          return prefix4 + key.charAt(0).toUpperCase() + key.substring(1);
        }
        var prefixes2 = ["Webkit", "ms", "Moz", "O"];
        Object.keys(isUnitlessNumber).forEach(function(prop) {
          prefixes2.forEach(function(prefix4) {
            isUnitlessNumber[prefixKey(prefix4, prop)] = isUnitlessNumber[prop];
          });
        });
        function dangerousStyleValue(name2, value, isCustomProperty3) {
          var isEmpty = value == null || typeof value === "boolean" || value === "";
          if (isEmpty) {
            return "";
          }
          if (!isCustomProperty3 && typeof value === "number" && value !== 0 && !(isUnitlessNumber.hasOwnProperty(name2) && isUnitlessNumber[name2])) {
            return value + "px";
          }
          {
            checkCSSPropertyStringCoercion(value, name2);
          }
          return ("" + value).trim();
        }
        var uppercasePattern = /([A-Z])/g;
        var msPattern = /^ms-/;
        function hyphenateStyleName(name2) {
          return name2.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(string2) {
            return string2.replace(hyphenPattern, function(_, character2) {
              return character2.toUpperCase();
            });
          };
          var warnHyphenatedStyleName = function(name2) {
            if (warnedStyleNames.hasOwnProperty(name2) && warnedStyleNames[name2]) {
              return;
            }
            warnedStyleNames[name2] = true;
            error(
              "Unsupported style property %s. Did you mean %s?",
              name2,
              // As Andi Smith suggests
              // (http://www.andismith.com/blog/2012/02/modernizr-prefixed/), an `-ms` prefix
              // is converted to lowercase `ms`.
              camelize(name2.replace(msPattern$1, "ms-"))
            );
          };
          var warnBadVendoredStyleName = function(name2) {
            if (warnedStyleNames.hasOwnProperty(name2) && warnedStyleNames[name2]) {
              return;
            }
            warnedStyleNames[name2] = true;
            error("Unsupported vendor-prefixed style property %s. Did you mean %s?", name2, name2.charAt(0).toUpperCase() + name2.slice(1));
          };
          var warnStyleValueWithSemicolon = function(name2, value) {
            if (warnedStyleValues.hasOwnProperty(value) && warnedStyleValues[value]) {
              return;
            }
            warnedStyleValues[value] = true;
            error(`Style property values shouldn't contain a semicolon. Try "%s: %s" instead.`, name2, value.replace(badStyleValueWithSemicolonPattern, ""));
          };
          var warnStyleValueIsNaN = function(name2, value) {
            if (warnedForNaNValue) {
              return;
            }
            warnedForNaNValue = true;
            error("`NaN` is an invalid value for the `%s` css style property.", name2);
          };
          var warnStyleValueIsInfinity = function(name2, value) {
            if (warnedForInfinityValue) {
              return;
            }
            warnedForInfinityValue = true;
            error("`Infinity` is an invalid value for the `%s` css style property.", name2);
          };
          warnValidStyle = function(name2, value) {
            if (name2.indexOf("-") > -1) {
              warnHyphenatedStyleName(name2);
            } else if (badVendoredStyleNamePattern.test(name2)) {
              warnBadVendoredStyleName(name2);
            } else if (badStyleValueWithSemicolonPattern.test(value)) {
              warnStyleValueWithSemicolon(name2, value);
            }
            if (typeof value === "number") {
              if (isNaN(value)) {
                warnStyleValueIsNaN(name2, value);
              } else if (!isFinite(value)) {
                warnStyleValueIsInfinity(name2, value);
              }
            }
          };
        }
        var warnValidStyle$1 = warnValidStyle;
        function createDangerousStringForStyles(styles) {
          {
            var serialized = "";
            var delimiter2 = "";
            for (var styleName in styles) {
              if (!styles.hasOwnProperty(styleName)) {
                continue;
              }
              var styleValue = styles[styleName];
              if (styleValue != null) {
                var isCustomProperty3 = styleName.indexOf("--") === 0;
                serialized += delimiter2 + (isCustomProperty3 ? styleName : hyphenateStyleName(styleName)) + ":";
                serialized += dangerousStyleValue(styleName, styleValue, isCustomProperty3);
                delimiter2 = ";";
              }
            }
            return serialized || null;
          }
        }
        function setValueForStyles(node56, styles) {
          var style2 = node56.style;
          for (var styleName in styles) {
            if (!styles.hasOwnProperty(styleName)) {
              continue;
            }
            var isCustomProperty3 = styleName.indexOf("--") === 0;
            {
              if (!isCustomProperty3) {
                warnValidStyle$1(styleName, styles[styleName]);
              }
            }
            var styleValue = dangerousStyleValue(styleName, styles[styleName], isCustomProperty3);
            if (styleName === "float") {
              styleName = "cssFloat";
            }
            if (isCustomProperty3) {
              style2.setProperty(styleName, styleValue);
            } else {
              style2[styleName] = styleValue;
            }
          }
        }
        function isValueEmpty(value) {
          return value == null || typeof value === "boolean" || value === "";
        }
        function expandShorthandMap(styles) {
          var expanded = {};
          for (var key in styles) {
            var longhands = shorthandToLonghand[key] || [key];
            for (var i2 = 0; i2 < longhands.length; i2++) {
              expanded[longhands[i2]] = key;
            }
          }
          return expanded;
        }
        function validateShorthandPropertyCollisionInDev(styleUpdates, nextStyles) {
          {
            if (!nextStyles) {
              return;
            }
            var expandedUpdates = expandShorthandMap(styleUpdates);
            var expandedStyles = expandShorthandMap(nextStyles);
            var warnedAbout = {};
            for (var key in expandedUpdates) {
              var originalKey = expandedUpdates[key];
              var correctOriginalKey = expandedStyles[key];
              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
          // NOTE: menuitem's close tag should be omitted, but that causes problems.
        };
        var voidElementTags = assign3({
          menuitem: true
        }, omittedCloseTags);
        var HTML = "__html";
        function assertValidProps(tag, props) {
          if (!props) {
            return;
          }
          if (voidElementTags[tag]) {
            if (props.children != null || props.dangerouslySetInnerHTML != null) {
              throw new Error(tag + " is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`.");
            }
          }
          if (props.dangerouslySetInnerHTML != null) {
            if (props.children != null) {
              throw new Error("Can only set one of `children` or `props.dangerouslySetInnerHTML`.");
            }
            if (typeof props.dangerouslySetInnerHTML !== "object" || !(HTML in props.dangerouslySetInnerHTML)) {
              throw new 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 new 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 = {
          // HTML
          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",
          imagesizes: "imageSizes",
          imagesrcset: "imageSrcSet",
          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",
          // SVG
          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,
          // state
          "aria-description": 0,
          "aria-details": 0,
          "aria-disabled": 0,
          // state
          "aria-hidden": 0,
          // state
          "aria-invalid": 0,
          // state
          "aria-keyshortcuts": 0,
          "aria-label": 0,
          "aria-roledescription": 0,
          // Widget Attributes
          "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,
          // Live Region Attributes
          "aria-atomic": 0,
          "aria-busy": 0,
          "aria-live": 0,
          "aria-relevant": 0,
          // Drag-and-Drop Attributes
          "aria-dropeffect": 0,
          "aria-grabbed": 0,
          // Relationship Attributes
          "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 + "]*$");
        function validateProperty(tagName, name2) {
          {
            if (hasOwnProperty3.call(warnedProperties, name2) && warnedProperties[name2]) {
              return true;
            }
            if (rARIACamel.test(name2)) {
              var ariaName = "aria-" + name2.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.", name2);
                warnedProperties[name2] = true;
                return true;
              }
              if (name2 !== correctName) {
                error("Invalid ARIA attribute `%s`. Did you mean `%s`?", name2, correctName);
                warnedProperties[name2] = true;
                return true;
              }
            }
            if (rARIA.test(name2)) {
              var lowerCasedName = name2.toLowerCase();
              var standardName = ariaProperties.hasOwnProperty(lowerCasedName) ? lowerCasedName : null;
              if (standardName == null) {
                warnedProperties[name2] = true;
                return false;
              }
              if (name2 !== standardName) {
                error("Unknown ARIA attribute `%s`. Did you mean `%s`?", name2, standardName);
                warnedProperties[name2] = true;
                return true;
              }
            }
          }
          return true;
        }
        function warnInvalidARIAProps(type, props) {
          {
            var invalidProps = [];
            for (var key in props) {
              var isValid = validateProperty(type, key);
              if (!isValid) {
                invalidProps.push(key);
              }
            }
            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 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, name2, value, eventRegistry) {
            if (hasOwnProperty3.call(warnedProperties$1, name2) && warnedProperties$1[name2]) {
              return true;
            }
            var lowerCasedName = name2.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[name2] = true;
              return true;
            }
            if (eventRegistry != null) {
              var registrationNameDependencies2 = eventRegistry.registrationNameDependencies, possibleRegistrationNames2 = eventRegistry.possibleRegistrationNames;
              if (registrationNameDependencies2.hasOwnProperty(name2)) {
                return true;
              }
              var registrationName = possibleRegistrationNames2.hasOwnProperty(lowerCasedName) ? possibleRegistrationNames2[lowerCasedName] : null;
              if (registrationName != null) {
                error("Invalid event handler property `%s`. Did you mean `%s`?", name2, registrationName);
                warnedProperties$1[name2] = true;
                return true;
              }
              if (EVENT_NAME_REGEX.test(name2)) {
                error("Unknown event handler property `%s`. It will be ignored.", name2);
                warnedProperties$1[name2] = true;
                return true;
              }
            } else if (EVENT_NAME_REGEX.test(name2)) {
              if (INVALID_EVENT_NAME_REGEX.test(name2)) {
                error("Invalid event handler property `%s`. React events use the camelCase naming convention, for example `onClick`.", name2);
              }
              warnedProperties$1[name2] = true;
              return true;
            }
            if (rARIA$1.test(name2) || rARIACamel$1.test(name2)) {
              return true;
            }
            if (lowerCasedName === "innerhtml") {
              error("Directly setting property `innerHTML` is not permitted. For more information, lookup documentation on `dangerouslySetInnerHTML`.");
              warnedProperties$1[name2] = true;
              return true;
            }
            if (lowerCasedName === "aria") {
              error("The `aria` attribute is reserved for future use in React. Pass individual `aria-` attributes instead.");
              warnedProperties$1[name2] = 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[name2] = 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.", name2);
              warnedProperties$1[name2] = true;
              return true;
            }
            var propertyInfo = getPropertyInfo(name2);
            var isReserved = propertyInfo !== null && propertyInfo.type === RESERVED;
            if (possibleStandardNames.hasOwnProperty(lowerCasedName)) {
              var standardName = possibleStandardNames[lowerCasedName];
              if (standardName !== name2) {
                error("Invalid DOM property `%s`. Did you mean `%s`?", name2, standardName);
                warnedProperties$1[name2] = true;
                return true;
              }
            } else if (!isReserved && name2 !== 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.", name2, lowerCasedName);
              warnedProperties$1[name2] = true;
              return true;
            }
            if (typeof value === "boolean" && shouldRemoveAttributeWithWarning(name2, 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, name2, name2, value, name2);
              } 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, name2, name2, value, name2, name2, name2);
              }
              warnedProperties$1[name2] = true;
              return true;
            }
            if (isReserved) {
              return true;
            }
            if (shouldRemoveAttributeWithWarning(name2, value, propertyInfo, false)) {
              warnedProperties$1[name2] = 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, name2, 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".', name2, value);
              warnedProperties$1[name2] = true;
              return true;
            }
            return true;
          };
        }
        var warnUnknownProperties = function(type, props, eventRegistry) {
          {
            var unknownProps = [];
            for (var key in props) {
              var isValid = validateProperty$1(type, key, props[key], eventRegistry);
              if (!isValid) {
                unknownProps.push(key);
              }
            }
            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 SHOULD_NOT_PROCESS_POLYFILL_EVENT_PLUGINS = IS_EVENT_HANDLE_NON_MANAGED_NODE | IS_NON_DELEGATED | IS_CAPTURE_PHASE;
        var currentReplayingEvent = null;
        function setReplayingEvent(event) {
          {
            if (currentReplayingEvent !== null) {
              error("Expected currently replaying event to be null. This error is likely caused by a bug in React. Please file an issue.");
            }
          }
          currentReplayingEvent = event;
        }
        function resetReplayingEvent() {
          {
            if (currentReplayingEvent === null) {
              error("Expected currently replaying event to not be null. This error is likely caused by a bug in React. Please file an issue.");
            }
          }
          currentReplayingEvent = null;
        }
        function isReplayingEvent(event) {
          return event === currentReplayingEvent;
        }
        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 new 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 i2 = 0; i2 < queuedTargets.length; i2++) {
              restoreStateOfTarget(queuedTargets[i2]);
            }
          }
        }
        var batchedUpdatesImpl = function(fn, bookkeeping) {
          return fn(bookkeeping);
        };
        var flushSyncImpl = function() {
        };
        var isInsideEventHandler = false;
        function finishEventHandler() {
          var controlledComponentsHavePendingUpdates = needsStateRestore();
          if (controlledComponentsHavePendingUpdates) {
            flushSyncImpl();
            restoreStateIfNeeded();
          }
        }
        function batchedUpdates(fn, a2, b) {
          if (isInsideEventHandler) {
            return fn(a2, b);
          }
          isInsideEventHandler = true;
          try {
            return batchedUpdatesImpl(fn, a2, b);
          } finally {
            isInsideEventHandler = false;
            finishEventHandler();
          }
        }
        function setBatchingImplementation(_batchedUpdatesImpl, _discreteUpdatesImpl, _flushSyncImpl) {
          batchedUpdatesImpl = _batchedUpdatesImpl;
          flushSyncImpl = _flushSyncImpl;
        }
        function isInteractive(tag) {
          return tag === "button" || tag === "input" || tag === "select" || tag === "textarea";
        }
        function shouldPreventMouseEvent(name2, type, props) {
          switch (name2) {
            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 new 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 (e3) {
            passiveBrowserEventsSupported = false;
          }
        }
        function invokeGuardedCallbackProd(name2, func, context2, a2, b, c4, d, e3, f) {
          var funcArgs = Array.prototype.slice.call(arguments, 3);
          try {
            func.apply(context2, 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(name2, func, context2, a2, b, c4, d, e3, f) {
              if (typeof document === "undefined" || document === null) {
                throw new 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(context2, 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-" + (name2 ? name2 : "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(name2, func, context2, a2, b, c4, d, e3, f) {
          hasError = false;
          caughtError = null;
          invokeGuardedCallbackImpl$1.apply(reporter, arguments);
        }
        function invokeGuardedCallbackAndCatchFirstError(name2, func, context2, a2, b, c4, d, e3, 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 new Error("clearCaughtError was called but no error was captured. This error is likely caused by a bug in React. Please file an issue.");
          }
        }
        function get3(key) {
          return key._reactInternals;
        }
        function has2(key) {
          return key._reactInternals !== void 0;
        }
        function set3(key, value) {
          key._reactInternals = value;
        }
        var NoFlags = (
          /*                      */
          0
        );
        var PerformedWork = (
          /*                */
          1
        );
        var Placement = (
          /*                    */
          2
        );
        var Update = (
          /*                       */
          4
        );
        var ChildDeletion = (
          /*                */
          16
        );
        var ContentReset = (
          /*                 */
          32
        );
        var Callback = (
          /*                     */
          64
        );
        var DidCapture = (
          /*                   */
          128
        );
        var ForceClientRender = (
          /*            */
          256
        );
        var Ref = (
          /*                          */
          512
        );
        var Snapshot = (
          /*                     */
          1024
        );
        var Passive = (
          /*                      */
          2048
        );
        var Hydrating = (
          /*                    */
          4096
        );
        var Visibility2 = (
          /*                   */
          8192
        );
        var StoreConsistency = (
          /*             */
          16384
        );
        var LifecycleEffectMask = Passive | Update | Callback | Ref | Snapshot | StoreConsistency;
        var HostEffectMask = (
          /*               */
          32767
        );
        var Incomplete = (
          /*                   */
          32768
        );
        var ShouldCapture = (
          /*                */
          65536
        );
        var ForceUpdateForLegacySuspense = (
          /* */
          131072
        );
        var Forked = (
          /*                       */
          1048576
        );
        var RefStatic = (
          /*                    */
          2097152
        );
        var LayoutStatic = (
          /*                 */
          4194304
        );
        var PassiveStatic = (
          /*                */
          8388608
        );
        var MountLayoutDev = (
          /*               */
          16777216
        );
        var MountPassiveDev = (
          /*              */
          33554432
        );
        var BeforeMutationMask = (
          // TODO: Remove Update flag from before mutation phase by re-landing Visibility
          // flag logic (see #20043)
          Update | Snapshot | 0
        );
        var MutationMask = Placement | Update | ChildDeletion | ContentReset | Ref | Hydrating | Visibility2;
        var LayoutMask = Update | Callback | Ref | Visibility2;
        var PassiveMask = Passive | ChildDeletion;
        var StaticMask = LayoutStatic | PassiveStatic | RefStatic;
        var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
        function getNearestMountedFiber(fiber) {
          var node56 = fiber;
          var nearestMounted = fiber;
          if (!fiber.alternate) {
            var nextNode = node56;
            do {
              node56 = nextNode;
              if ((node56.flags & (Placement | Hydrating)) !== NoFlags) {
                nearestMounted = node56.return;
              }
              nextNode = node56.return;
            } while (nextNode);
          } else {
            while (node56.return) {
              node56 = node56.return;
            }
          }
          if (node56.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.", getComponentNameFromFiber(ownerFiber) || "A component");
              }
              instance._warnedAboutRefsInRender = true;
            }
          }
          var fiber = get3(component);
          if (!fiber) {
            return false;
          }
          return getNearestMountedFiber(fiber) === fiber;
        }
        function assertIsMounted(fiber) {
          if (getNearestMountedFiber(fiber) !== fiber) {
            throw new 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 new Error("Unable to find node on an unmounted component.");
            }
            if (nearestMounted !== fiber) {
              return null;
            }
            return fiber;
          }
          var a2 = fiber;
          var b = alternate;
          while (true) {
            var parentA = a2.return;
            if (parentA === null) {
              break;
            }
            var parentB = parentA.alternate;
            if (parentB === null) {
              var nextParent = parentA.return;
              if (nextParent !== null) {
                a2 = b = nextParent;
                continue;
              }
              break;
            }
            if (parentA.child === parentB.child) {
              var child = parentA.child;
              while (child) {
                if (child === a2) {
                  assertIsMounted(parentA);
                  return fiber;
                }
                if (child === b) {
                  assertIsMounted(parentA);
                  return alternate;
                }
                child = child.sibling;
              }
              throw new Error("Unable to find node on an unmounted component.");
            }
            if (a2.return !== b.return) {
              a2 = parentA;
              b = parentB;
            } else {
              var didFindChild = false;
              var _child = parentA.child;
              while (_child) {
                if (_child === a2) {
                  didFindChild = true;
                  a2 = parentA;
                  b = parentB;
                  break;
                }
                if (_child === b) {
                  didFindChild = true;
                  b = parentA;
                  a2 = parentB;
                  break;
                }
                _child = _child.sibling;
              }
              if (!didFindChild) {
                _child = parentB.child;
                while (_child) {
                  if (_child === a2) {
                    didFindChild = true;
                    a2 = parentB;
                    b = parentA;
                    break;
                  }
                  if (_child === b) {
                    didFindChild = true;
                    b = parentB;
                    a2 = parentA;
                    break;
                  }
                  _child = _child.sibling;
                }
                if (!didFindChild) {
                  throw new 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 (a2.alternate !== b) {
              throw new Error("Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue.");
            }
          }
          if (a2.tag !== HostRoot) {
            throw new Error("Unable to find node on an unmounted component.");
          }
          if (a2.stateNode.current === a2) {
            return fiber;
          }
          return alternate;
        }
        function findCurrentHostFiber(parent) {
          var currentParent = findCurrentFiberUsingSlowPath(parent);
          return currentParent !== null ? findCurrentHostFiberImpl(currentParent) : null;
        }
        function findCurrentHostFiberImpl(node56) {
          if (node56.tag === HostComponent || node56.tag === HostText) {
            return node56;
          }
          var child = node56.child;
          while (child !== null) {
            var match2 = findCurrentHostFiberImpl(child);
            if (match2 !== null) {
              return match2;
            }
            child = child.sibling;
          }
          return null;
        }
        function findCurrentHostFiberWithNoPortals(parent) {
          var currentParent = findCurrentFiberUsingSlowPath(parent);
          return currentParent !== null ? findCurrentHostFiberWithNoPortalsImpl(currentParent) : null;
        }
        function findCurrentHostFiberWithNoPortalsImpl(node56) {
          if (node56.tag === HostComponent || node56.tag === HostText) {
            return node56;
          }
          var child = node56.child;
          while (child !== null) {
            if (child.tag !== HostPortal) {
              var match2 = findCurrentHostFiberWithNoPortalsImpl(child);
              if (match2 !== null) {
                return match2;
              }
            }
            child = child.sibling;
          }
          return null;
        }
        var scheduleCallback = Scheduler.unstable_scheduleCallback;
        var cancelCallback = Scheduler.unstable_cancelCallback;
        var shouldYield = Scheduler.unstable_shouldYield;
        var requestPaint = Scheduler.unstable_requestPaint;
        var now2 = Scheduler.unstable_now;
        var getCurrentPriorityLevel = Scheduler.unstable_getCurrentPriorityLevel;
        var ImmediatePriority = Scheduler.unstable_ImmediatePriority;
        var UserBlockingPriority = Scheduler.unstable_UserBlockingPriority;
        var NormalPriority = Scheduler.unstable_NormalPriority;
        var LowPriority = Scheduler.unstable_LowPriority;
        var IdlePriority = Scheduler.unstable_IdlePriority;
        var unstable_yieldValue = Scheduler.unstable_yieldValue;
        var unstable_setDisableYieldValue = Scheduler.unstable_setDisableYieldValue;
        var rendererID = null;
        var injectedHook = null;
        var injectedProfilingHooks = 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 {
            if (enableSchedulingProfiler) {
              internals = assign3({}, internals, {
                getLaneLabelMap,
                injectProfilingHooks
              });
            }
            rendererID = hook.inject(internals);
            injectedHook = hook;
          } catch (err) {
            {
              error("React instrumentation encountered an error: %s.", err);
            }
          }
          if (hook.checkDCE) {
            return true;
          } else {
            return false;
          }
        }
        function onScheduleRoot(root3, children) {
          {
            if (injectedHook && typeof injectedHook.onScheduleFiberRoot === "function") {
              try {
                injectedHook.onScheduleFiberRoot(rendererID, root3, children);
              } catch (err) {
                if (!hasLoggedError) {
                  hasLoggedError = true;
                  error("React instrumentation encountered an error: %s", err);
                }
              }
            }
          }
        }
        function onCommitRoot(root3, eventPriority) {
          if (injectedHook && typeof injectedHook.onCommitFiberRoot === "function") {
            try {
              var didError = (root3.current.flags & DidCapture) === DidCapture;
              if (enableProfilerTimer) {
                var schedulerPriority;
                switch (eventPriority) {
                  case DiscreteEventPriority2:
                    schedulerPriority = ImmediatePriority;
                    break;
                  case ContinuousEventPriority2:
                    schedulerPriority = UserBlockingPriority;
                    break;
                  case DefaultEventPriority2:
                    schedulerPriority = NormalPriority;
                    break;
                  case IdleEventPriority:
                    schedulerPriority = IdlePriority;
                    break;
                  default:
                    schedulerPriority = NormalPriority;
                    break;
                }
                injectedHook.onCommitFiberRoot(rendererID, root3, schedulerPriority, didError);
              } else {
                injectedHook.onCommitFiberRoot(rendererID, root3, void 0, didError);
              }
            } catch (err) {
              {
                if (!hasLoggedError) {
                  hasLoggedError = true;
                  error("React instrumentation encountered an error: %s", err);
                }
              }
            }
          }
        }
        function onPostCommitRoot(root3) {
          if (injectedHook && typeof injectedHook.onPostCommitFiberRoot === "function") {
            try {
              injectedHook.onPostCommitFiberRoot(rendererID, root3);
            } 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);
                }
              }
            }
          }
        }
        function setIsStrictModeForDevtools(newIsStrictMode) {
          {
            if (typeof unstable_yieldValue === "function") {
              unstable_setDisableYieldValue(newIsStrictMode);
              setSuppressWarning(newIsStrictMode);
            }
            if (injectedHook && typeof injectedHook.setStrictMode === "function") {
              try {
                injectedHook.setStrictMode(rendererID, newIsStrictMode);
              } catch (err) {
                {
                  if (!hasLoggedError) {
                    hasLoggedError = true;
                    error("React instrumentation encountered an error: %s", err);
                  }
                }
              }
            }
          }
        }
        function injectProfilingHooks(profilingHooks) {
          injectedProfilingHooks = profilingHooks;
        }
        function getLaneLabelMap() {
          {
            var map3 = /* @__PURE__ */ new Map();
            var lane = 1;
            for (var index2 = 0; index2 < TotalLanes; index2++) {
              var label = getLabelForLane(lane);
              map3.set(lane, label);
              lane *= 2;
            }
            return map3;
          }
        }
        function markCommitStarted(lanes) {
          {
            if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markCommitStarted === "function") {
              injectedProfilingHooks.markCommitStarted(lanes);
            }
          }
        }
        function markCommitStopped() {
          {
            if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markCommitStopped === "function") {
              injectedProfilingHooks.markCommitStopped();
            }
          }
        }
        function markComponentRenderStarted(fiber) {
          {
            if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentRenderStarted === "function") {
              injectedProfilingHooks.markComponentRenderStarted(fiber);
            }
          }
        }
        function markComponentRenderStopped() {
          {
            if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentRenderStopped === "function") {
              injectedProfilingHooks.markComponentRenderStopped();
            }
          }
        }
        function markComponentPassiveEffectMountStarted(fiber) {
          {
            if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentPassiveEffectMountStarted === "function") {
              injectedProfilingHooks.markComponentPassiveEffectMountStarted(fiber);
            }
          }
        }
        function markComponentPassiveEffectMountStopped() {
          {
            if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentPassiveEffectMountStopped === "function") {
              injectedProfilingHooks.markComponentPassiveEffectMountStopped();
            }
          }
        }
        function markComponentPassiveEffectUnmountStarted(fiber) {
          {
            if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStarted === "function") {
              injectedProfilingHooks.markComponentPassiveEffectUnmountStarted(fiber);
            }
          }
        }
        function markComponentPassiveEffectUnmountStopped() {
          {
            if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStopped === "function") {
              injectedProfilingHooks.markComponentPassiveEffectUnmountStopped();
            }
          }
        }
        function markComponentLayoutEffectMountStarted(fiber) {
          {
            if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentLayoutEffectMountStarted === "function") {
              injectedProfilingHooks.markComponentLayoutEffectMountStarted(fiber);
            }
          }
        }
        function markComponentLayoutEffectMountStopped() {
          {
            if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentLayoutEffectMountStopped === "function") {
              injectedProfilingHooks.markComponentLayoutEffectMountStopped();
            }
          }
        }
        function markComponentLayoutEffectUnmountStarted(fiber) {
          {
            if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentLayoutEffectUnmountStarted === "function") {
              injectedProfilingHooks.markComponentLayoutEffectUnmountStarted(fiber);
            }
          }
        }
        function markComponentLayoutEffectUnmountStopped() {
          {
            if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentLayoutEffectUnmountStopped === "function") {
              injectedProfilingHooks.markComponentLayoutEffectUnmountStopped();
            }
          }
        }
        function markComponentErrored(fiber, thrownValue, lanes) {
          {
            if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentErrored === "function") {
              injectedProfilingHooks.markComponentErrored(fiber, thrownValue, lanes);
            }
          }
        }
        function markComponentSuspended(fiber, wakeable, lanes) {
          {
            if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentSuspended === "function") {
              injectedProfilingHooks.markComponentSuspended(fiber, wakeable, lanes);
            }
          }
        }
        function markLayoutEffectsStarted(lanes) {
          {
            if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markLayoutEffectsStarted === "function") {
              injectedProfilingHooks.markLayoutEffectsStarted(lanes);
            }
          }
        }
        function markLayoutEffectsStopped() {
          {
            if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markLayoutEffectsStopped === "function") {
              injectedProfilingHooks.markLayoutEffectsStopped();
            }
          }
        }
        function markPassiveEffectsStarted(lanes) {
          {
            if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markPassiveEffectsStarted === "function") {
              injectedProfilingHooks.markPassiveEffectsStarted(lanes);
            }
          }
        }
        function markPassiveEffectsStopped() {
          {
            if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markPassiveEffectsStopped === "function") {
              injectedProfilingHooks.markPassiveEffectsStopped();
            }
          }
        }
        function markRenderStarted(lanes) {
          {
            if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markRenderStarted === "function") {
              injectedProfilingHooks.markRenderStarted(lanes);
            }
          }
        }
        function markRenderYielded() {
          {
            if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markRenderYielded === "function") {
              injectedProfilingHooks.markRenderYielded();
            }
          }
        }
        function markRenderStopped() {
          {
            if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markRenderStopped === "function") {
              injectedProfilingHooks.markRenderStopped();
            }
          }
        }
        function markRenderScheduled(lane) {
          {
            if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markRenderScheduled === "function") {
              injectedProfilingHooks.markRenderScheduled(lane);
            }
          }
        }
        function markForceUpdateScheduled(fiber, lane) {
          {
            if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markForceUpdateScheduled === "function") {
              injectedProfilingHooks.markForceUpdateScheduled(fiber, lane);
            }
          }
        }
        function markStateUpdateScheduled(fiber, lane) {
          {
            if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markStateUpdateScheduled === "function") {
              injectedProfilingHooks.markStateUpdateScheduled(fiber, lane);
            }
          }
        }
        var NoMode = (
          /*                         */
          0
        );
        var ConcurrentMode = (
          /*                 */
          1
        );
        var ProfileMode = (
          /*                    */
          2
        );
        var StrictLegacyMode = (
          /*               */
          8
        );
        var StrictEffectsMode = (
          /*              */
          16
        );
        var clz32 = Math.clz32 ? Math.clz32 : clz32Fallback;
        var log2 = Math.log;
        var LN2 = Math.LN2;
        function clz32Fallback(x2) {
          var asUint = x2 >>> 0;
          if (asUint === 0) {
            return 32;
          }
          return 31 - (log2(asUint) / LN2 | 0) | 0;
        }
        var TotalLanes = 31;
        var NoLanes = (
          /*                        */
          0
        );
        var NoLane = (
          /*                          */
          0
        );
        var SyncLane = (
          /*                        */
          1
        );
        var InputContinuousHydrationLane = (
          /*    */
          2
        );
        var InputContinuousLane = (
          /*             */
          4
        );
        var DefaultHydrationLane = (
          /*            */
          8
        );
        var DefaultLane = (
          /*                     */
          16
        );
        var TransitionHydrationLane = (
          /*                */
          32
        );
        var TransitionLanes = (
          /*                       */
          4194240
        );
        var TransitionLane1 = (
          /*                        */
          64
        );
        var TransitionLane2 = (
          /*                        */
          128
        );
        var TransitionLane3 = (
          /*                        */
          256
        );
        var TransitionLane4 = (
          /*                        */
          512
        );
        var TransitionLane5 = (
          /*                        */
          1024
        );
        var TransitionLane6 = (
          /*                        */
          2048
        );
        var TransitionLane7 = (
          /*                        */
          4096
        );
        var TransitionLane8 = (
          /*                        */
          8192
        );
        var TransitionLane9 = (
          /*                        */
          16384
        );
        var TransitionLane10 = (
          /*                       */
          32768
        );
        var TransitionLane11 = (
          /*                       */
          65536
        );
        var TransitionLane12 = (
          /*                       */
          131072
        );
        var TransitionLane13 = (
          /*                       */
          262144
        );
        var TransitionLane14 = (
          /*                       */
          524288
        );
        var TransitionLane15 = (
          /*                       */
          1048576
        );
        var TransitionLane16 = (
          /*                       */
          2097152
        );
        var RetryLanes = (
          /*                            */
          130023424
        );
        var RetryLane1 = (
          /*                             */
          4194304
        );
        var RetryLane2 = (
          /*                             */
          8388608
        );
        var RetryLane3 = (
          /*                             */
          16777216
        );
        var RetryLane4 = (
          /*                             */
          33554432
        );
        var RetryLane5 = (
          /*                             */
          67108864
        );
        var SomeRetryLane = RetryLane1;
        var SelectiveHydrationLane = (
          /*          */
          134217728
        );
        var NonIdleLanes = (
          /*                          */
          268435455
        );
        var IdleHydrationLane = (
          /*               */
          268435456
        );
        var IdleLane = (
          /*                        */
          536870912
        );
        var OffscreenLane = (
          /*                   */
          1073741824
        );
        function getLabelForLane(lane) {
          {
            if (lane & SyncLane) {
              return "Sync";
            }
            if (lane & InputContinuousHydrationLane) {
              return "InputContinuousHydration";
            }
            if (lane & InputContinuousLane) {
              return "InputContinuous";
            }
            if (lane & DefaultHydrationLane) {
              return "DefaultHydration";
            }
            if (lane & DefaultLane) {
              return "Default";
            }
            if (lane & TransitionHydrationLane) {
              return "TransitionHydration";
            }
            if (lane & TransitionLanes) {
              return "Transition";
            }
            if (lane & RetryLanes) {
              return "Retry";
            }
            if (lane & SelectiveHydrationLane) {
              return "SelectiveHydration";
            }
            if (lane & IdleHydrationLane) {
              return "IdleHydration";
            }
            if (lane & IdleLane) {
              return "Idle";
            }
            if (lane & OffscreenLane) {
              return "Offscreen";
            }
          }
        }
        var NoTimestamp = -1;
        var nextTransitionLane = TransitionLane1;
        var nextRetryLane = RetryLane1;
        function getHighestPriorityLanes(lanes) {
          switch (getHighestPriorityLane(lanes)) {
            case SyncLane:
              return SyncLane;
            case InputContinuousHydrationLane:
              return InputContinuousHydrationLane;
            case InputContinuousLane:
              return InputContinuousLane;
            case DefaultHydrationLane:
              return DefaultHydrationLane;
            case DefaultLane:
              return DefaultLane;
            case TransitionHydrationLane:
              return TransitionHydrationLane;
            case TransitionLane1:
            case TransitionLane2:
            case TransitionLane3:
            case TransitionLane4:
            case TransitionLane5:
            case TransitionLane6:
            case TransitionLane7:
            case TransitionLane8:
            case TransitionLane9:
            case TransitionLane10:
            case TransitionLane11:
            case TransitionLane12:
            case TransitionLane13:
            case TransitionLane14:
            case TransitionLane15:
            case TransitionLane16:
              return lanes & TransitionLanes;
            case RetryLane1:
            case RetryLane2:
            case RetryLane3:
            case RetryLane4:
            case RetryLane5:
              return lanes & RetryLanes;
            case SelectiveHydrationLane:
              return SelectiveHydrationLane;
            case IdleHydrationLane:
              return IdleHydrationLane;
            case IdleLane:
              return IdleLane;
            case OffscreenLane:
              return OffscreenLane;
            default:
              {
                error("Should have found matching lanes. This is a bug in React.");
              }
              return lanes;
          }
        }
        function getNextLanes(root3, wipLanes) {
          var pendingLanes = root3.pendingLanes;
          if (pendingLanes === NoLanes) {
            return NoLanes;
          }
          var nextLanes = NoLanes;
          var suspendedLanes = root3.suspendedLanes;
          var pingedLanes = root3.pingedLanes;
          var nonIdlePendingLanes = pendingLanes & NonIdleLanes;
          if (nonIdlePendingLanes !== NoLanes) {
            var nonIdleUnblockedLanes = nonIdlePendingLanes & ~suspendedLanes;
            if (nonIdleUnblockedLanes !== NoLanes) {
              nextLanes = getHighestPriorityLanes(nonIdleUnblockedLanes);
            } else {
              var nonIdlePingedLanes = nonIdlePendingLanes & pingedLanes;
              if (nonIdlePingedLanes !== NoLanes) {
                nextLanes = getHighestPriorityLanes(nonIdlePingedLanes);
              }
            }
          } else {
            var unblockedLanes = pendingLanes & ~suspendedLanes;
            if (unblockedLanes !== NoLanes) {
              nextLanes = getHighestPriorityLanes(unblockedLanes);
            } else {
              if (pingedLanes !== NoLanes) {
                nextLanes = getHighestPriorityLanes(pingedLanes);
              }
            }
          }
          if (nextLanes === NoLanes) {
            return NoLanes;
          }
          if (wipLanes !== NoLanes && wipLanes !== nextLanes && // If we already suspended with a delay, then interrupting is fine. Don't
          // bother waiting until the root is complete.
          (wipLanes & suspendedLanes) === NoLanes) {
            var nextLane = getHighestPriorityLane(nextLanes);
            var wipLane = getHighestPriorityLane(wipLanes);
            if (
              // Tests whether the next lane is equal or lower priority than the wip
              // one. This works because the bits decrease in priority as you go left.
              nextLane >= wipLane || // Default priority updates should not interrupt transition updates. The
              // only difference between default updates and transition updates is that
              // default updates do not support refresh transitions.
              nextLane === DefaultLane && (wipLane & TransitionLanes) !== NoLanes
            ) {
              return wipLanes;
            }
          }
          if ((nextLanes & InputContinuousLane) !== NoLanes) {
            nextLanes |= pendingLanes & DefaultLane;
          }
          var entangledLanes = root3.entangledLanes;
          if (entangledLanes !== NoLanes) {
            var entanglements = root3.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(root3, lanes) {
          var eventTimes = root3.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) {
          switch (lane) {
            case SyncLane:
            case InputContinuousHydrationLane:
            case InputContinuousLane:
              return currentTime + 250;
            case DefaultHydrationLane:
            case DefaultLane:
            case TransitionHydrationLane:
            case TransitionLane1:
            case TransitionLane2:
            case TransitionLane3:
            case TransitionLane4:
            case TransitionLane5:
            case TransitionLane6:
            case TransitionLane7:
            case TransitionLane8:
            case TransitionLane9:
            case TransitionLane10:
            case TransitionLane11:
            case TransitionLane12:
            case TransitionLane13:
            case TransitionLane14:
            case TransitionLane15:
            case TransitionLane16:
              return currentTime + 5e3;
            case RetryLane1:
            case RetryLane2:
            case RetryLane3:
            case RetryLane4:
            case RetryLane5:
              return NoTimestamp;
            case SelectiveHydrationLane:
            case IdleHydrationLane:
            case IdleLane:
            case OffscreenLane:
              return NoTimestamp;
            default:
              {
                error("Should have found matching lanes. This is a bug in React.");
              }
              return NoTimestamp;
          }
        }
        function markStarvedLanesAsExpired(root3, currentTime) {
          var pendingLanes = root3.pendingLanes;
          var suspendedLanes = root3.suspendedLanes;
          var pingedLanes = root3.pingedLanes;
          var expirationTimes = root3.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) {
              root3.expiredLanes |= lane;
            }
            lanes &= ~lane;
          }
        }
        function getHighestPriorityPendingLanes(root3) {
          return getHighestPriorityLanes(root3.pendingLanes);
        }
        function getLanesToRetrySynchronouslyOnError(root3) {
          var everythingButOffscreen = root3.pendingLanes & ~OffscreenLane;
          if (everythingButOffscreen !== NoLanes) {
            return everythingButOffscreen;
          }
          if (everythingButOffscreen & OffscreenLane) {
            return OffscreenLane;
          }
          return NoLanes;
        }
        function includesSyncLane(lanes) {
          return (lanes & SyncLane) !== NoLanes;
        }
        function includesNonIdleWork(lanes) {
          return (lanes & NonIdleLanes) !== NoLanes;
        }
        function includesOnlyRetries(lanes) {
          return (lanes & RetryLanes) === lanes;
        }
        function includesOnlyNonUrgentLanes(lanes) {
          var UrgentLanes = SyncLane | InputContinuousLane | DefaultLane;
          return (lanes & UrgentLanes) === NoLanes;
        }
        function includesOnlyTransitions(lanes) {
          return (lanes & TransitionLanes) === lanes;
        }
        function includesBlockingLane(root3, lanes) {
          var SyncDefaultLanes = InputContinuousHydrationLane | InputContinuousLane | DefaultHydrationLane | DefaultLane;
          return (lanes & SyncDefaultLanes) !== NoLanes;
        }
        function includesExpiredLane(root3, lanes) {
          return (lanes & root3.expiredLanes) !== NoLanes;
        }
        function isTransitionLane(lane) {
          return (lane & TransitionLanes) !== NoLanes;
        }
        function claimNextTransitionLane() {
          var lane = nextTransitionLane;
          nextTransitionLane <<= 1;
          if ((nextTransitionLane & TransitionLanes) === NoLanes) {
            nextTransitionLane = TransitionLane1;
          }
          return lane;
        }
        function claimNextRetryLane() {
          var lane = nextRetryLane;
          nextRetryLane <<= 1;
          if ((nextRetryLane & RetryLanes) === NoLanes) {
            nextRetryLane = RetryLane1;
          }
          return lane;
        }
        function getHighestPriorityLane(lanes) {
          return lanes & -lanes;
        }
        function pickArbitraryLane(lanes) {
          return getHighestPriorityLane(lanes);
        }
        function pickArbitraryLaneIndex(lanes) {
          return 31 - clz32(lanes);
        }
        function laneToIndex(lane) {
          return pickArbitraryLaneIndex(lane);
        }
        function includesSomeLane(a2, b) {
          return (a2 & b) !== NoLanes;
        }
        function isSubsetOfLanes(set4, subset) {
          return (set4 & subset) === subset;
        }
        function mergeLanes(a2, b) {
          return a2 | b;
        }
        function removeLanes(set4, subset) {
          return set4 & ~subset;
        }
        function intersectLanes(a2, b) {
          return a2 & b;
        }
        function laneToLanes(lane) {
          return lane;
        }
        function higherPriorityLane(a2, b) {
          return a2 !== NoLane && a2 < b ? a2 : b;
        }
        function createLaneMap(initial) {
          var laneMap = [];
          for (var i2 = 0; i2 < TotalLanes; i2++) {
            laneMap.push(initial);
          }
          return laneMap;
        }
        function markRootUpdated(root3, updateLane, eventTime) {
          root3.pendingLanes |= updateLane;
          if (updateLane !== IdleLane) {
            root3.suspendedLanes = NoLanes;
            root3.pingedLanes = NoLanes;
          }
          var eventTimes = root3.eventTimes;
          var index2 = laneToIndex(updateLane);
          eventTimes[index2] = eventTime;
        }
        function markRootSuspended(root3, suspendedLanes) {
          root3.suspendedLanes |= suspendedLanes;
          root3.pingedLanes &= ~suspendedLanes;
          var expirationTimes = root3.expirationTimes;
          var lanes = suspendedLanes;
          while (lanes > 0) {
            var index2 = pickArbitraryLaneIndex(lanes);
            var lane = 1 << index2;
            expirationTimes[index2] = NoTimestamp;
            lanes &= ~lane;
          }
        }
        function markRootPinged(root3, pingedLanes, eventTime) {
          root3.pingedLanes |= root3.suspendedLanes & pingedLanes;
        }
        function markRootFinished(root3, remainingLanes) {
          var noLongerPendingLanes = root3.pendingLanes & ~remainingLanes;
          root3.pendingLanes = remainingLanes;
          root3.suspendedLanes = NoLanes;
          root3.pingedLanes = NoLanes;
          root3.expiredLanes &= remainingLanes;
          root3.mutableReadLanes &= remainingLanes;
          root3.entangledLanes &= remainingLanes;
          var entanglements = root3.entanglements;
          var eventTimes = root3.eventTimes;
          var expirationTimes = root3.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(root3, entangledLanes) {
          var rootEntangledLanes = root3.entangledLanes |= entangledLanes;
          var entanglements = root3.entanglements;
          var lanes = rootEntangledLanes;
          while (lanes) {
            var index2 = pickArbitraryLaneIndex(lanes);
            var lane = 1 << index2;
            if (
              // Is this one of the newly entangled lanes?
              lane & entangledLanes | // Is this lane transitively entangled with the newly entangled lanes?
              entanglements[index2] & entangledLanes
            ) {
              entanglements[index2] |= entangledLanes;
            }
            lanes &= ~lane;
          }
        }
        function getBumpedLaneForHydration(root3, renderLanes2) {
          var renderLane = getHighestPriorityLane(renderLanes2);
          var lane;
          switch (renderLane) {
            case InputContinuousLane:
              lane = InputContinuousHydrationLane;
              break;
            case DefaultLane:
              lane = DefaultHydrationLane;
              break;
            case TransitionLane1:
            case TransitionLane2:
            case TransitionLane3:
            case TransitionLane4:
            case TransitionLane5:
            case TransitionLane6:
            case TransitionLane7:
            case TransitionLane8:
            case TransitionLane9:
            case TransitionLane10:
            case TransitionLane11:
            case TransitionLane12:
            case TransitionLane13:
            case TransitionLane14:
            case TransitionLane15:
            case TransitionLane16:
            case RetryLane1:
            case RetryLane2:
            case RetryLane3:
            case RetryLane4:
            case RetryLane5:
              lane = TransitionHydrationLane;
              break;
            case IdleLane:
              lane = IdleHydrationLane;
              break;
            default:
              lane = NoLane;
              break;
          }
          if ((lane & (root3.suspendedLanes | renderLanes2)) !== NoLane) {
            return NoLane;
          }
          return lane;
        }
        function addFiberToLanesMap(root3, fiber, lanes) {
          if (!isDevToolsPresent) {
            return;
          }
          var pendingUpdatersLaneMap = root3.pendingUpdatersLaneMap;
          while (lanes > 0) {
            var index2 = laneToIndex(lanes);
            var lane = 1 << index2;
            var updaters = pendingUpdatersLaneMap[index2];
            updaters.add(fiber);
            lanes &= ~lane;
          }
        }
        function movePendingFibersToMemoized(root3, lanes) {
          if (!isDevToolsPresent) {
            return;
          }
          var pendingUpdatersLaneMap = root3.pendingUpdatersLaneMap;
          var memoizedUpdaters = root3.memoizedUpdaters;
          while (lanes > 0) {
            var index2 = laneToIndex(lanes);
            var lane = 1 << index2;
            var updaters = pendingUpdatersLaneMap[index2];
            if (updaters.size > 0) {
              updaters.forEach(function(fiber) {
                var alternate = fiber.alternate;
                if (alternate === null || !memoizedUpdaters.has(alternate)) {
                  memoizedUpdaters.add(fiber);
                }
              });
              updaters.clear();
            }
            lanes &= ~lane;
          }
        }
        function getTransitionsForLanes(root3, lanes) {
          {
            return null;
          }
        }
        var DiscreteEventPriority2 = SyncLane;
        var ContinuousEventPriority2 = InputContinuousLane;
        var DefaultEventPriority2 = DefaultLane;
        var IdleEventPriority = IdleLane;
        var currentUpdatePriority = NoLane;
        function getCurrentUpdatePriority() {
          return currentUpdatePriority;
        }
        function setCurrentUpdatePriority(newPriority) {
          currentUpdatePriority = newPriority;
        }
        function runWithPriority(priority, fn) {
          var previousPriority = currentUpdatePriority;
          try {
            currentUpdatePriority = priority;
            return fn();
          } finally {
            currentUpdatePriority = previousPriority;
          }
        }
        function higherEventPriority(a2, b) {
          return a2 !== 0 && a2 < b ? a2 : b;
        }
        function lowerEventPriority(a2, b) {
          return a2 === 0 || a2 > b ? a2 : b;
        }
        function isHigherEventPriority(a2, b) {
          return a2 !== 0 && a2 < b;
        }
        function lanesToEventPriority(lanes) {
          var lane = getHighestPriorityLane(lanes);
          if (!isHigherEventPriority(DiscreteEventPriority2, lane)) {
            return DiscreteEventPriority2;
          }
          if (!isHigherEventPriority(ContinuousEventPriority2, lane)) {
            return ContinuousEventPriority2;
          }
          if (includesNonIdleWork(lane)) {
            return DefaultEventPriority2;
          }
          return IdleEventPriority;
        }
        function isRootDehydrated(root3) {
          var currentState2 = root3.current.memoizedState;
          return currentState2.isDehydrated;
        }
        var _attemptSynchronousHydration;
        function setAttemptSynchronousHydration(fn) {
          _attemptSynchronousHydration = fn;
        }
        function attemptSynchronousHydration(fiber) {
          _attemptSynchronousHydration(fiber);
        }
        var attemptContinuousHydration;
        function setAttemptContinuousHydration(fn) {
          attemptContinuousHydration = fn;
        }
        var attemptHydrationAtCurrentPriority;
        function setAttemptHydrationAtCurrentPriority(fn) {
          attemptHydrationAtCurrentPriority = fn;
        }
        var getCurrentUpdatePriority$1;
        function setGetCurrentUpdatePriority(fn) {
          getCurrentUpdatePriority$1 = 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 = [];
        var discreteReplayableEvents = [
          "mousedown",
          "mouseup",
          "touchcancel",
          "touchend",
          "touchstart",
          "auxclick",
          "dblclick",
          "pointercancel",
          "pointerdown",
          "pointerup",
          "dragend",
          "dragstart",
          "drop",
          "compositionend",
          "compositionstart",
          "keydown",
          "keypress",
          "keyup",
          "input",
          "textInput",
          // Intentionally camelCase
          "copy",
          "cut",
          "paste",
          "click",
          "change",
          "contextmenu",
          "reset",
          "submit"
        ];
        function isDiscreteEventThatRequiresHydration(eventType) {
          return discreteReplayableEvents.indexOf(eventType) > -1;
        }
        function createQueuedReplayableEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent) {
          return {
            blockedOn,
            domEventName,
            eventSystemFlags,
            nativeEvent,
            targetContainers: [targetContainer]
          };
        }
        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.priority, function() {
                    attemptHydrationAtCurrentPriority(nearestMounted);
                  });
                  return;
                }
              } else if (tag === HostRoot) {
                var root3 = nearestMounted.stateNode;
                if (isRootDehydrated(root3)) {
                  queuedTarget.blockedOn = getContainerFromFiber(nearestMounted);
                  return;
                }
              }
            }
          }
          queuedTarget.blockedOn = null;
        }
        function queueExplicitHydrationTarget(target) {
          var updatePriority = getCurrentUpdatePriority$1();
          var queuedTarget = {
            blockedOn: null,
            target,
            priority: updatePriority
          };
          var i2 = 0;
          for (; i2 < queuedExplicitHydrationTargets.length; i2++) {
            if (!isHigherEventPriority(updatePriority, queuedExplicitHydrationTargets[i2].priority)) {
              break;
            }
          }
          queuedExplicitHydrationTargets.splice(i2, 0, queuedTarget);
          if (i2 === 0) {
            attemptExplicitHydrationTarget(queuedTarget);
          }
        }
        function attemptReplayContinuousQueuedEvent(queuedEvent) {
          if (queuedEvent.blockedOn !== null) {
            return false;
          }
          var targetContainers = queuedEvent.targetContainers;
          while (targetContainers.length > 0) {
            var targetContainer = targetContainers[0];
            var nextBlockedOn = findInstanceBlockingEvent(queuedEvent.domEventName, queuedEvent.eventSystemFlags, targetContainer, queuedEvent.nativeEvent);
            if (nextBlockedOn === null) {
              {
                var nativeEvent = queuedEvent.nativeEvent;
                var nativeEventClone = new nativeEvent.constructor(nativeEvent.type, nativeEvent);
                setReplayingEvent(nativeEventClone);
                nativeEvent.target.dispatchEvent(nativeEventClone);
                resetReplayingEvent();
              }
            } else {
              var _fiber3 = getInstanceFromNode(nextBlockedOn);
              if (_fiber3 !== null) {
                attemptContinuousHydration(_fiber3);
              }
              queuedEvent.blockedOn = nextBlockedOn;
              return false;
            }
            targetContainers.shift();
          }
          return true;
        }
        function attemptReplayContinuousQueuedEventInMap(queuedEvent, key, map3) {
          if (attemptReplayContinuousQueuedEvent(queuedEvent)) {
            map3.delete(key);
          }
        }
        function replayUnblockedEvents() {
          hasScheduledReplayAttempt = false;
          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 i2 = 1; i2 < queuedDiscreteEvents.length; i2++) {
              var queuedEvent = queuedDiscreteEvents[i2];
              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 ReactCurrentBatchConfig = ReactSharedInternals.ReactCurrentBatchConfig;
        var _enabled = true;
        function setEnabled(enabled) {
          _enabled = !!enabled;
        }
        function isEnabled() {
          return _enabled;
        }
        function createEventListenerWrapperWithPriority(targetContainer, domEventName, eventSystemFlags) {
          var eventPriority = getEventPriority2(domEventName);
          var listenerWrapper;
          switch (eventPriority) {
            case DiscreteEventPriority2:
              listenerWrapper = dispatchDiscreteEvent;
              break;
            case ContinuousEventPriority2:
              listenerWrapper = dispatchContinuousEvent;
              break;
            case DefaultEventPriority2:
            default:
              listenerWrapper = dispatchEvent;
              break;
          }
          return listenerWrapper.bind(null, domEventName, eventSystemFlags, targetContainer);
        }
        function dispatchDiscreteEvent(domEventName, eventSystemFlags, container, nativeEvent) {
          var previousPriority = getCurrentUpdatePriority();
          var prevTransition = ReactCurrentBatchConfig.transition;
          ReactCurrentBatchConfig.transition = null;
          try {
            setCurrentUpdatePriority(DiscreteEventPriority2);
            dispatchEvent(domEventName, eventSystemFlags, container, nativeEvent);
          } finally {
            setCurrentUpdatePriority(previousPriority);
            ReactCurrentBatchConfig.transition = prevTransition;
          }
        }
        function dispatchContinuousEvent(domEventName, eventSystemFlags, container, nativeEvent) {
          var previousPriority = getCurrentUpdatePriority();
          var prevTransition = ReactCurrentBatchConfig.transition;
          ReactCurrentBatchConfig.transition = null;
          try {
            setCurrentUpdatePriority(ContinuousEventPriority2);
            dispatchEvent(domEventName, eventSystemFlags, container, nativeEvent);
          } finally {
            setCurrentUpdatePriority(previousPriority);
            ReactCurrentBatchConfig.transition = prevTransition;
          }
        }
        function dispatchEvent(domEventName, eventSystemFlags, targetContainer, nativeEvent) {
          if (!_enabled) {
            return;
          }
          {
            dispatchEventWithEnableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay(domEventName, eventSystemFlags, targetContainer, nativeEvent);
          }
        }
        function dispatchEventWithEnableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay(domEventName, eventSystemFlags, targetContainer, nativeEvent) {
          var blockedOn = findInstanceBlockingEvent(domEventName, eventSystemFlags, targetContainer, nativeEvent);
          if (blockedOn === null) {
            dispatchEventForPluginEventSystem(domEventName, eventSystemFlags, nativeEvent, return_targetInst, targetContainer);
            clearIfContinuousEvent(domEventName, nativeEvent);
            return;
          }
          if (queueIfContinuousEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent)) {
            nativeEvent.stopPropagation();
            return;
          }
          clearIfContinuousEvent(domEventName, nativeEvent);
          if (eventSystemFlags & IS_CAPTURE_PHASE && isDiscreteEventThatRequiresHydration(domEventName)) {
            while (blockedOn !== null) {
              var fiber = getInstanceFromNode(blockedOn);
              if (fiber !== null) {
                attemptSynchronousHydration(fiber);
              }
              var nextBlockedOn = findInstanceBlockingEvent(domEventName, eventSystemFlags, targetContainer, nativeEvent);
              if (nextBlockedOn === null) {
                dispatchEventForPluginEventSystem(domEventName, eventSystemFlags, nativeEvent, return_targetInst, targetContainer);
              }
              if (nextBlockedOn === blockedOn) {
                break;
              }
              blockedOn = nextBlockedOn;
            }
            if (blockedOn !== null) {
              nativeEvent.stopPropagation();
            }
            return;
          }
          dispatchEventForPluginEventSystem(domEventName, eventSystemFlags, nativeEvent, null, targetContainer);
        }
        var return_targetInst = null;
        function findInstanceBlockingEvent(domEventName, eventSystemFlags, targetContainer, nativeEvent) {
          return_targetInst = null;
          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 root3 = nearestMounted.stateNode;
                if (isRootDehydrated(root3)) {
                  return getContainerFromFiber(nearestMounted);
                }
                targetInst = null;
              } else if (nearestMounted !== targetInst) {
                targetInst = null;
              }
            }
          }
          return_targetInst = targetInst;
          return null;
        }
        function getEventPriority2(domEventName) {
          switch (domEventName) {
            case "cancel":
            case "click":
            case "close":
            case "contextmenu":
            case "copy":
            case "cut":
            case "auxclick":
            case "dblclick":
            case "dragend":
            case "dragstart":
            case "drop":
            case "focusin":
            case "focusout":
            case "input":
            case "invalid":
            case "keydown":
            case "keypress":
            case "keyup":
            case "mousedown":
            case "mouseup":
            case "paste":
            case "pause":
            case "play":
            case "pointercancel":
            case "pointerdown":
            case "pointerup":
            case "ratechange":
            case "reset":
            case "resize":
            case "seeked":
            case "submit":
            case "touchcancel":
            case "touchend":
            case "touchstart":
            case "volumechange":
            case "change":
            case "selectionchange":
            case "textInput":
            case "compositionstart":
            case "compositionend":
            case "compositionupdate":
            case "beforeblur":
            case "afterblur":
            case "beforeinput":
            case "blur":
            case "fullscreenchange":
            case "focus":
            case "hashchange":
            case "popstate":
            case "select":
            case "selectstart":
              return DiscreteEventPriority2;
            case "drag":
            case "dragenter":
            case "dragexit":
            case "dragleave":
            case "dragover":
            case "mousemove":
            case "mouseout":
            case "mouseover":
            case "pointermove":
            case "pointerout":
            case "pointerover":
            case "scroll":
            case "toggle":
            case "touchmove":
            case "wheel":
            case "mouseenter":
            case "mouseleave":
            case "pointerenter":
            case "pointerleave":
              return ContinuousEventPriority2;
            case "message": {
              var schedulerPriority = getCurrentPriorityLevel();
              switch (schedulerPriority) {
                case ImmediatePriority:
                  return DiscreteEventPriority2;
                case UserBlockingPriority:
                  return ContinuousEventPriority2;
                case NormalPriority:
                case LowPriority:
                  return DefaultEventPriority2;
                case IdlePriority:
                  return IdleEventPriority;
                default:
                  return DefaultEventPriority2;
              }
            }
            default:
              return DefaultEventPriority2;
          }
        }
        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 root2 = null;
        var startText = null;
        var fallbackText = null;
        function initialize(nativeEventTarget) {
          root2 = nativeEventTarget;
          startText = getText();
          return true;
        }
        function reset() {
          root2 = 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 root2) {
            return root2.value;
          }
          return root2.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 normalize3 = Interface[_propName];
              if (normalize3) {
                this[_propName] = normalize3(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;
          }
          assign3(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;
            },
            /**
             * We release all dispatched `SyntheticEvent`s after each event loop, adding
             * them back into the pool. This allows a way to hold onto a reference that
             * won't be added back into the pool.
             */
            persist: function() {
            },
            /**
             * Checks if this event should be released back into the pool.
             *
             * @return {boolean} True if this should not be released, false otherwise.
             */
            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 = assign3({}, 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 = assign3({}, 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 = assign3({}, MouseEventInterface, {
          dataTransfer: 0
        });
        var SyntheticDragEvent = createSyntheticEvent(DragEventInterface);
        var FocusEventInterface = assign3({}, UIEventInterface, {
          relatedTarget: 0
        });
        var SyntheticFocusEvent = createSyntheticEvent(FocusEventInterface);
        var AnimationEventInterface = assign3({}, EventInterface, {
          animationName: 0,
          elapsedTime: 0,
          pseudoElement: 0
        });
        var SyntheticAnimationEvent = createSyntheticEvent(AnimationEventInterface);
        var ClipboardEventInterface = assign3({}, EventInterface, {
          clipboardData: function(event) {
            return "clipboardData" in event ? event.clipboardData : window.clipboardData;
          }
        });
        var SyntheticClipboardEvent = createSyntheticEvent(ClipboardEventInterface);
        var CompositionEventInterface = assign3({}, 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 key = normalizeKey[nativeEvent.key] || nativeEvent.key;
            if (key !== "Unidentified") {
              return key;
            }
          }
          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 = assign3({}, UIEventInterface, {
          key: getEventKey,
          code: 0,
          location: 0,
          ctrlKey: 0,
          shiftKey: 0,
          altKey: 0,
          metaKey: 0,
          repeat: 0,
          locale: 0,
          getModifierState: getEventModifierState,
          // Legacy Interface
          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 = assign3({}, 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 = assign3({}, UIEventInterface, {
          touches: 0,
          targetTouches: 0,
          changedTouches: 0,
          altKey: 0,
          metaKey: 0,
          ctrlKey: 0,
          shiftKey: 0,
          getModifierState: getEventModifierState
        });
        var SyntheticTouchEvent = createSyntheticEvent(TouchEventInterface);
        var TransitionEventInterface = assign3({}, EventInterface, {
          propertyName: 0,
          elapsedTime: 0,
          pseudoElement: 0
        });
        var SyntheticTransitionEvent = createSyntheticEvent(TransitionEventInterface);
        var WheelEventInterface = assign3({}, MouseEventInterface, {
          deltaX: function(event) {
            return "deltaX" in event ? event.deltaX : (
              // Fallback to `wheelDeltaX` for Webkit and normalize (right is positive).
              "wheelDeltaX" in event ? -event.wheelDeltaX : 0
            );
          },
          deltaY: function(event) {
            return "deltaY" in event ? event.deltaY : (
              // Fallback to `wheelDeltaY` for Webkit and normalize (down is positive).
              "wheelDeltaY" in event ? -event.wheelDeltaY : (
                // Fallback to `wheelDelta` for IE<9 and normalize (down is positive).
                "wheelDelta" in event ? -event.wheelDelta : 0
              )
            );
          },
          deltaZ: 0,
          // Browsers without "deltaMode" is reporting in raw wheel delta where one
          // notch on the scroll is always +/- 120, roughly equivalent to pixels.
          // A good approximation of DOM_DELTA_LINE (1) is 5% of viewport size or
          // ~40 pixels, for DOM_DELTA_SCREEN (2) it is 87.5% of viewport size.
          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) && // ctrlKey && altKey is equivalent to AltGr, and is not a command.
          !(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 element2 = document.createElement("div");
            element2.setAttribute(eventName, "return;");
            isSupported = typeof element2[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(node56) {
          var state = node56._wrapperState;
          if (!state || !state.controlled || node56.type !== "number") {
            return;
          }
          {
            setDefaultValue(node56, "number", node56.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 && !isReplayingEvent(nativeEvent)) {
            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 doc2 = nativeEventTarget.ownerDocument;
            if (doc2) {
              win = doc2.defaultView || doc2.parentWindow;
            } else {
              win = window;
            }
          }
          var from2;
          var to;
          if (isOutEvent) {
            var _related = nativeEvent.relatedTarget || nativeEvent.toElement;
            from2 = 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 {
            from2 = null;
            to = targetInst;
          }
          if (from2 === 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 = from2 == null ? win : getNodeFromInstance(from2);
          var toNode = to == null ? win : getNodeFromInstance(to);
          var leave = new SyntheticEventCtor(leaveEventType, eventTypePrefix + "leave", from2, 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, from2, to);
        }
        function is2(x2, y2) {
          return x2 === y2 && (x2 !== 0 || 1 / x2 === 1 / y2) || x2 !== x2 && y2 !== y2;
        }
        var objectIs = typeof Object.is === "function" ? Object.is : is2;
        function shallowEqual3(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 i2 = 0; i2 < keysA.length; i2++) {
            var currentKey = keysA[i2];
            if (!hasOwnProperty3.call(objB, currentKey) || !objectIs(objA[currentKey], objB[currentKey])) {
              return false;
            }
          }
          return true;
        }
        function getLeafNode(node56) {
          while (node56 && node56.firstChild) {
            node56 = node56.firstChild;
          }
          return node56;
        }
        function getSiblingNode(node56) {
          while (node56) {
            if (node56.nextSibling) {
              return node56.nextSibling;
            }
            node56 = node56.parentNode;
          }
        }
        function getNodeForCharacterOffset(root3, offset) {
          var node56 = getLeafNode(root3);
          var nodeStart2 = 0;
          var nodeEnd = 0;
          while (node56) {
            if (node56.nodeType === TEXT_NODE) {
              nodeEnd = nodeStart2 + node56.textContent.length;
              if (nodeStart2 <= offset && nodeEnd >= offset) {
                return {
                  node: node56,
                  offset: offset - nodeStart2
                };
              }
              nodeStart2 = nodeEnd;
            }
            node56 = getLeafNode(getSiblingNode(node56));
          }
        }
        function getOffsets(outerNode) {
          var ownerDocument = outerNode.ownerDocument;
          var win = ownerDocument && ownerDocument.defaultView || window;
          var selection2 = win.getSelection && win.getSelection();
          if (!selection2 || selection2.rangeCount === 0) {
            return null;
          }
          var anchorNode = selection2.anchorNode, anchorOffset = selection2.anchorOffset, focusNode = selection2.focusNode, focusOffset = selection2.focusOffset;
          try {
            anchorNode.nodeType;
            focusNode.nodeType;
          } catch (e3) {
            return null;
          }
          return getModernOffsetsFromPoints(outerNode, anchorNode, anchorOffset, focusNode, focusOffset);
        }
        function getModernOffsetsFromPoints(outerNode, anchorNode, anchorOffset, focusNode, focusOffset) {
          var length2 = 0;
          var start = -1;
          var end = -1;
          var indexWithinAnchor = 0;
          var indexWithinFocus = 0;
          var node56 = outerNode;
          var parentNode = null;
          outer:
            while (true) {
              var next2 = null;
              while (true) {
                if (node56 === anchorNode && (anchorOffset === 0 || node56.nodeType === TEXT_NODE)) {
                  start = length2 + anchorOffset;
                }
                if (node56 === focusNode && (focusOffset === 0 || node56.nodeType === TEXT_NODE)) {
                  end = length2 + focusOffset;
                }
                if (node56.nodeType === TEXT_NODE) {
                  length2 += node56.nodeValue.length;
                }
                if ((next2 = node56.firstChild) === null) {
                  break;
                }
                parentNode = node56;
                node56 = next2;
              }
              while (true) {
                if (node56 === outerNode) {
                  break outer;
                }
                if (parentNode === anchorNode && ++indexWithinAnchor === anchorOffset) {
                  start = length2;
                }
                if (parentNode === focusNode && ++indexWithinFocus === focusOffset) {
                  end = length2;
                }
                if ((next2 = node56.nextSibling) !== null) {
                  break;
                }
                node56 = parentNode;
                parentNode = node56.parentNode;
              }
              node56 = next2;
            }
          if (start === -1 || end === -1) {
            return null;
          }
          return {
            start,
            end
          };
        }
        function setOffsets(node56, offsets) {
          var doc2 = node56.ownerDocument || document;
          var win = doc2 && doc2.defaultView || window;
          if (!win.getSelection) {
            return;
          }
          var selection2 = win.getSelection();
          var length2 = node56.textContent.length;
          var start = Math.min(offsets.start, length2);
          var end = offsets.end === void 0 ? start : Math.min(offsets.end, length2);
          if (!selection2.extend && start > end) {
            var temp = end;
            end = start;
            start = temp;
          }
          var startMarker = getNodeForCharacterOffset(node56, start);
          var endMarker = getNodeForCharacterOffset(node56, end);
          if (startMarker && endMarker) {
            if (selection2.rangeCount === 1 && selection2.anchorNode === startMarker.node && selection2.anchorOffset === startMarker.offset && selection2.focusNode === endMarker.node && selection2.focusOffset === endMarker.offset) {
              return;
            }
            var range4 = doc2.createRange();
            range4.setStart(startMarker.node, startMarker.offset);
            selection2.removeAllRanges();
            if (start > end) {
              selection2.addRange(range4);
              selection2.extend(endMarker.node, endMarker.offset);
            } else {
              range4.setEnd(endMarker.node, endMarker.offset);
              selection2.addRange(range4);
            }
          }
        }
        function isTextNode(node56) {
          return node56 && node56.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(node56) {
          return node56 && node56.ownerDocument && containsNode(node56.ownerDocument.documentElement, node56);
        }
        function isSameOriginFrame(iframe) {
          try {
            return typeof iframe.contentWindow.location.href === "string";
          } catch (err) {
            return false;
          }
        }
        function getActiveElementDeep() {
          var win = window;
          var element2 = getActiveElement();
          while (element2 instanceof win.HTMLIFrameElement) {
            if (isSameOriginFrame(element2)) {
              win = element2.contentWindow;
            } else {
              return element2;
            }
            element2 = getActiveElement(win.document);
          }
          return element2;
        }
        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) ? getSelection2(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 i2 = 0; i2 < ancestors.length; i2++) {
              var info = ancestors[i2];
              info.element.scrollLeft = info.left;
              info.element.scrollTop = info.top;
            }
          }
        }
        function getSelection2(input) {
          var selection2;
          if ("selectionStart" in input) {
            selection2 = {
              start: input.selectionStart,
              end: input.selectionEnd
            };
          } else {
            selection2 = getOffsets(input);
          }
          return selection2 || {
            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(node56) {
          if ("selectionStart" in node56 && hasSelectionCapabilities(node56)) {
            return {
              start: node56.selectionStart,
              end: node56.selectionEnd
            };
          } else {
            var win = node56.ownerDocument && node56.ownerDocument.defaultView || window;
            var selection2 = win.getSelection();
            return {
              anchorNode: selection2.anchorNode,
              anchorOffset: selection2.anchorOffset,
              focusNode: selection2.focusNode,
              focusOffset: selection2.focusOffset
            };
          }
        }
        function getEventTargetDocument(eventTarget) {
          return eventTarget.window === eventTarget ? eventTarget.document : eventTarget.nodeType === DOCUMENT_NODE ? eventTarget : eventTarget.ownerDocument;
        }
        function constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget) {
          var doc2 = getEventTargetDocument(nativeEventTarget);
          if (mouseDown || activeElement$1 == null || activeElement$1 !== getActiveElement(doc2)) {
            return;
          }
          var currentSelection = getSelection$1(activeElement$1);
          if (!lastSelection || !shallowEqual3(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 makePrefixMap(styleProp, eventName) {
          var prefixes3 = {};
          prefixes3[styleProp.toLowerCase()] = eventName.toLowerCase();
          prefixes3["Webkit" + styleProp] = "webkit" + eventName;
          prefixes3["Moz" + styleProp] = "moz" + eventName;
          return prefixes3;
        }
        var vendorPrefixes = {
          animationend: makePrefixMap("Animation", "AnimationEnd"),
          animationiteration: makePrefixMap("Animation", "AnimationIteration"),
          animationstart: makePrefixMap("Animation", "AnimationStart"),
          transitionend: makePrefixMap("Transition", "TransitionEnd")
        };
        var prefixedEventNames = {};
        var style = {};
        if (canUseDOM) {
          style = 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 style) {
              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 simpleEventPluginEvents = ["abort", "auxClick", "cancel", "canPlay", "canPlayThrough", "click", "close", "contextMenu", "copy", "cut", "drag", "dragEnd", "dragEnter", "dragExit", "dragLeave", "dragOver", "dragStart", "drop", "durationChange", "emptied", "encrypted", "ended", "error", "gotPointerCapture", "input", "invalid", "keyDown", "keyPress", "keyUp", "load", "loadedData", "loadedMetadata", "loadStart", "lostPointerCapture", "mouseDown", "mouseMove", "mouseOut", "mouseOver", "mouseUp", "paste", "pause", "play", "playing", "pointerCancel", "pointerDown", "pointerMove", "pointerOut", "pointerOver", "pointerUp", "progress", "rateChange", "reset", "resize", "seeked", "seeking", "stalled", "submit", "suspend", "timeUpdate", "touchCancel", "touchEnd", "touchStart", "volumeChange", "scroll", "toggle", "touchMove", "waiting", "wheel"];
        function registerSimpleEvent(domEventName, reactName) {
          topLevelEventsToReactNames.set(domEventName, reactName);
          registerTwoPhaseEvent(reactName, [domEventName]);
        }
        function registerSimpleEvents() {
          for (var i2 = 0; i2 < simpleEventPluginEvents.length; i2++) {
            var eventName = simpleEventPluginEvents[i2];
            var domEventName = eventName.toLowerCase();
            var capitalizedEvent = eventName[0].toUpperCase() + eventName.slice(1);
            registerSimpleEvent(domEventName, "on" + capitalizedEvent);
          }
          registerSimpleEvent(ANIMATION_END, "onAnimationEnd");
          registerSimpleEvent(ANIMATION_ITERATION, "onAnimationIteration");
          registerSimpleEvent(ANIMATION_START, "onAnimationStart");
          registerSimpleEvent("dblclick", "onDoubleClick");
          registerSimpleEvent("focusin", "onFocus");
          registerSimpleEvent("focusout", "onBlur");
          registerSimpleEvent(TRANSITION_END, "onTransitionEnd");
        }
        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 && // TODO: ideally, we'd eventually add all events from
            // nonDelegatedEvents list in DOMPluginEventSystem.
            // Then we can remove this special list.
            // This is a breaking change that can wait until React 18.
            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);
            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", "resize", "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 i2 = dispatchListeners.length - 1; i2 >= 0; i2--) {
              var _dispatchListeners$i = dispatchListeners[i2], 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 i2 = 0; i2 < dispatchQueue.length; i2++) {
            var _dispatchQueue$i = dispatchQueue[i2], 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) {
          {
            if (!nonDelegatedEvents.has(domEventName)) {
              error('Did not expect a listenToNonDelegatedEvent() call for "%s". This is a bug in React. Please file an issue.', domEventName);
            }
          }
          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);
          }
        }
        function listenToNativeEvent(domEventName, isCapturePhaseListener, target) {
          {
            if (nonDelegatedEvents.has(domEventName) && !isCapturePhaseListener) {
              error('Did not expect a listenToNativeEvent() call for "%s" in the bubble phase. This is a bug in React. Please file an issue.', domEventName);
            }
          }
          var eventSystemFlags = 0;
          if (isCapturePhaseListener) {
            eventSystemFlags |= IS_CAPTURE_PHASE;
          }
          addTrappedEventListener(target, domEventName, eventSystemFlags, isCapturePhaseListener);
        }
        var listeningMarker = "_reactListening" + Math.random().toString(36).slice(2);
        function listenToAllSupportedEvents(rootContainerElement) {
          if (!rootContainerElement[listeningMarker]) {
            rootContainerElement[listeningMarker] = true;
            allNativeEvents.forEach(function(domEventName) {
              if (domEventName !== "selectionchange") {
                if (!nonDelegatedEvents.has(domEventName)) {
                  listenToNativeEvent(domEventName, false, rootContainerElement);
                }
                listenToNativeEvent(domEventName, true, rootContainerElement);
              }
            });
            var ownerDocument = rootContainerElement.nodeType === DOCUMENT_NODE ? rootContainerElement : rootContainerElement.ownerDocument;
            if (ownerDocument !== null) {
              if (!ownerDocument[listeningMarker]) {
                ownerDocument[listeningMarker] = true;
                listenToNativeEvent("selectionchange", false, ownerDocument);
              }
            }
          }
        }
        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 node56 = targetInst;
              mainLoop:
                while (true) {
                  if (node56 === null) {
                    return;
                  }
                  var nodeTag = node56.tag;
                  if (nodeTag === HostRoot || nodeTag === HostPortal) {
                    var container = node56.stateNode.containerInfo;
                    if (isMatchingRootContainer(container, targetContainerNode)) {
                      break;
                    }
                    if (nodeTag === HostPortal) {
                      var grandNode = node56.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) {
                        node56 = ancestorInst = parentNode;
                        continue mainLoop;
                      }
                      container = container.parentNode;
                    }
                  }
                  node56 = node56.return;
                }
            }
          }
          batchedUpdates(function() {
            return dispatchEventsForPlugins(domEventName, eventSystemFlags, nativeEvent, ancestorInst);
          });
        }
        function createDispatchListener(instance, listener, currentTarget) {
          return {
            instance,
            listener,
            currentTarget
          };
        }
        function accumulateSinglePhaseListeners(targetFiber, reactName, nativeEventType, inCapturePhase, accumulateTargetOnly, nativeEvent) {
          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, common2, inCapturePhase) {
          var registrationName = event._reactName;
          var listeners = [];
          var instance = target;
          while (instance !== null) {
            if (instance === common2) {
              break;
            }
            var _instance4 = instance, alternate = _instance4.alternate, stateNode = _instance4.stateNode, tag = _instance4.tag;
            if (alternate !== null && alternate === common2) {
              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, from2, to) {
          var common2 = from2 && to ? getLowestCommonAncestor(from2, to) : null;
          if (from2 !== null) {
            accumulateEnterLeaveListenersForEvent(dispatchQueue, leaveEvent, from2, common2, false);
          }
          if (to !== null && enterEvent !== null) {
            accumulateEnterLeaveListenersForEvent(dispatchQueue, enterEvent, to, common2, 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 warnedUnknownTags;
        var validatePropertiesInDevelopment;
        var warnForPropDifference;
        var warnForExtraAttributes;
        var warnForInvalidEventListener;
        var canDiffStyleForHydrationWarning;
        var normalizeHTML;
        {
          warnedUnknownTags = {
            // There are working polyfills for <dialog>. Let people use it.
            dialog: true,
            // Electron ships a custom <webview> tag to display external web content in
            // an isolated frame and process.
            // This tag is not present in non Electron environments such as JSDom which
            // is often used for testing purposes.
            // @see https://electronjs.org/docs/api/webview-tag
            webview: true
          };
          validatePropertiesInDevelopment = function(type, props) {
            validateProperties(type, props);
            validateProperties$1(type, props);
            validateProperties$2(type, props, {
              registrationNameDependencies,
              possibleRegistrationNames
            });
          };
          canDiffStyleForHydrationWarning = canUseDOM && !document.documentMode;
          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(name2) {
              names.push(name2);
            });
            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 ? parent.ownerDocument.createElement(parent.tagName) : parent.ownerDocument.createElementNS(parent.namespaceURI, parent.tagName);
            testElement.innerHTML = html;
            return testElement.innerHTML;
          };
        }
        var NORMALIZE_NEWLINES_REGEX = /\r\n?/g;
        var NORMALIZE_NULL_AND_REPLACEMENT_REGEX = /\u0000|\uFFFD/g;
        function normalizeMarkupForTextOrAttribute(markup) {
          {
            checkHtmlStringCoercion(markup);
          }
          var markupString = typeof markup === "string" ? markup : "" + markup;
          return markupString.replace(NORMALIZE_NEWLINES_REGEX, "\n").replace(NORMALIZE_NULL_AND_REPLACEMENT_REGEX, "");
        }
        function checkForUnmatchedText(serverText, clientText, isConcurrentMode, shouldWarnDev) {
          var normalizedClientText = normalizeMarkupForTextOrAttribute(clientText);
          var normalizedServerText = normalizeMarkupForTextOrAttribute(serverText);
          if (normalizedServerText === normalizedClientText) {
            return;
          }
          if (shouldWarnDev) {
            {
              if (!didWarnInvalidHydration) {
                didWarnInvalidHydration = true;
                error('Text content did not match. Server: "%s" Client: "%s"', normalizedServerText, normalizedClientText);
              }
            }
          }
          if (isConcurrentMode && enableClientRenderFallbackOnTextMismatch) {
            throw new Error("Text content does not match server-rendered HTML.");
          }
        }
        function getOwnerDocumentFromRootContainer(rootContainerElement) {
          return rootContainerElement.nodeType === DOCUMENT_NODE ? rootContainerElement : rootContainerElement.ownerDocument;
        }
        function noop2() {
        }
        function trapClickOnNonInteractiveElement(node56) {
          node56.onclick = noop2;
        }
        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 i2 = 0; i2 < updatePayload.length; i2 += 2) {
            var propKey = updatePayload[i2];
            var propValue = updatePayload[i2 + 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 createElement17(type, props, rootContainerElement, parentNamespace) {
          var isCustomComponentTag;
          var ownerDocument = getOwnerDocumentFromRootContainer(rootContainerElement);
          var domElement;
          var namespaceURI = parentNamespace;
          if (namespaceURI === HTML_NAMESPACE) {
            namespaceURI = getIntrinsicNamespace(type);
          }
          if (namespaceURI === HTML_NAMESPACE) {
            {
              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 div = ownerDocument.createElement("div");
              div.innerHTML = "<script><\/script>";
              var firstChild = div.firstChild;
              domElement = div.removeChild(firstChild);
            } else if (typeof props.is === "string") {
              domElement = ownerDocument.createElement(type, {
                is: props.is
              });
            } else {
              domElement = ownerDocument.createElement(type);
              if (type === "select") {
                var node56 = domElement;
                if (props.multiple) {
                  node56.multiple = true;
                } else if (props.size) {
                  node56.size = props.size;
                }
              }
            }
          } else {
            domElement = ownerDocument.createElementNS(namespaceURI, type);
          }
          {
            if (namespaceURI === HTML_NAMESPACE) {
              if (!isCustomComponentTag && Object.prototype.toString.call(domElement) === "[object HTMLUnknownElement]" && !hasOwnProperty3.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(text2, rootContainerElement) {
          return getOwnerDocumentFromRootContainer(rootContainerElement).createTextNode(text2);
        }
        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 i2 = 0; i2 < mediaEventTypes.length; i2++) {
                listenToNonDelegatedEvent(mediaEventTypes[i2], 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 = rawProps;
              break;
            case "select":
              initWrapperState$1(domElement, rawProps);
              props = getHostProps$1(domElement, rawProps);
              listenToNonDelegatedEvent("invalid", domElement);
              break;
            case "textarea":
              initWrapperState$2(domElement, rawProps);
              props = getHostProps$2(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 "select":
              lastProps = getHostProps$1(domElement, lastRawProps);
              nextProps = getHostProps$1(domElement, nextRawProps);
              updatePayload = [];
              break;
            case "textarea":
              lastProps = getHostProps$2(domElement, lastRawProps);
              nextProps = getHostProps$2(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 {
              (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, isConcurrentMode, shouldWarnDev) {
          var isCustomComponentTag;
          var extraAttributeNames;
          {
            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 i2 = 0; i2 < mediaEventTypes.length; i2++) {
                listenToNonDelegatedEvent(mediaEventTypes[i2], 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 name2 = attributes[_i].name.toLowerCase();
              switch (name2) {
                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 (rawProps[SUPPRESS_HYDRATION_WARNING] !== true) {
                    checkForUnmatchedText(domElement.textContent, nextProp, isConcurrentMode, shouldWarnDev);
                  }
                  updatePayload = [CHILDREN, nextProp];
                }
              } else if (typeof nextProp === "number") {
                if (domElement.textContent !== "" + nextProp) {
                  if (rawProps[SUPPRESS_HYDRATION_WARNING] !== true) {
                    checkForUnmatchedText(domElement.textContent, nextProp, isConcurrentMode, shouldWarnDev);
                  }
                  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 (shouldWarnDev && true && // Convince Flow we've calculated it (it's DEV-only in this method.)
            typeof isCustomComponentTag === "boolean") {
              var serverValue = void 0;
              var propertyInfo = isCustomComponentTag && enableCustomElementPropertySupport ? null : getPropertyInfo(propKey);
              if (rawProps[SUPPRESS_HYDRATION_WARNING] === true)
                ;
              else if (propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING || // Controlled attributes are not validated
              // TODO: Only ignore them on controlled tags.
              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 && !enableCustomElementPropertySupport) {
                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) {
                    ownNamespace = getIntrinsicNamespace(tag);
                  }
                  if (ownNamespace === HTML_NAMESPACE) {
                    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);
                }
                var dontWarnCustomElement = enableCustomElementPropertySupport;
                if (!dontWarnCustomElement && nextProp !== serverValue && !isMismatchDueToBadCasing) {
                  warnForPropDifference(propKey, serverValue, nextProp);
                }
              }
            }
          }
          {
            if (shouldWarnDev) {
              if (
                // $FlowFixMe - Should be inferred as not undefined.
                extraAttributeNames.size > 0 && rawProps[SUPPRESS_HYDRATION_WARNING] !== true
              ) {
                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, text2, isConcurrentMode) {
          var isDifferent = textNode.nodeValue !== text2;
          return isDifferent;
        }
        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, text2) {
          {
            if (text2 === "") {
              return;
            }
            if (didWarnInvalidHydration) {
              return;
            }
            didWarnInvalidHydration = true;
            error('Expected server HTML to contain a matching text node for "%s" in <%s>.', text2, 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",
            // https://html.spec.whatwg.org/multipage/syntax.html#html-integration-point
            // TODO: Distinguish by namespace here -- for <title>, including it here
            // errs on the side of fewer warnings
            "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 = assign3({}, 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 = "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 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 root3 = rootContainerInstance.documentElement;
              namespace = root3 ? root3.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 string2 = "" + props.children;
              var ownAncestorInfo = updatedAncestorInfo(hostContextDev.ancestorInfo, type);
              validateDOMNesting(null, string2, ownAncestorInfo);
            }
            parentNamespace = hostContextDev.namespace;
          }
          var domElement = createElement17(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);
          switch (type) {
            case "button":
            case "input":
            case "select":
            case "textarea":
              return !!props.autoFocus;
            case "img":
              return true;
            default:
              return false;
          }
        }
        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 string2 = "" + newProps.children;
              var ownAncestorInfo = updatedAncestorInfo(hostContextDev.ancestorInfo, type);
              validateDOMNesting(null, string2, ownAncestorInfo);
            }
          }
          return diffProperties(domElement, type, oldProps, newProps);
        }
        function shouldSetTextContent(type, props) {
          return type === "textarea" || type === "noscript" || typeof props.children === "string" || typeof props.children === "number" || typeof props.dangerouslySetInnerHTML === "object" && props.dangerouslySetInnerHTML !== null && props.dangerouslySetInnerHTML.__html != null;
        }
        function createTextInstance(text2, rootContainerInstance, hostContext, internalInstanceHandle) {
          {
            var hostContextDev = hostContext;
            validateDOMNesting(null, text2, hostContextDev.ancestorInfo);
          }
          var textNode = createTextNode(text2, rootContainerInstance);
          precacheFiberNode(internalInstanceHandle, textNode);
          return textNode;
        }
        function getCurrentEventPriority() {
          var currentEvent = window.event;
          if (currentEvent === void 0) {
            return DefaultEventPriority2;
          }
          return getEventPriority2(currentEvent.type);
        }
        var scheduleTimeout = typeof setTimeout === "function" ? setTimeout : void 0;
        var cancelTimeout = typeof clearTimeout === "function" ? clearTimeout : void 0;
        var noTimeout = -1;
        var localPromise = typeof Promise === "function" ? Promise : void 0;
        var scheduleMicrotask = typeof queueMicrotask === "function" ? queueMicrotask : typeof localPromise !== "undefined" ? function(callback) {
          return localPromise.resolve(null).then(callback).catch(handleErrorInNextTick);
        } : scheduleTimeout;
        function handleErrorInNextTick(error2) {
          setTimeout(function() {
            throw error2;
          });
        }
        function commitMount(domElement, type, newProps, internalInstanceHandle) {
          switch (type) {
            case "button":
            case "input":
            case "select":
            case "textarea":
              if (newProps.autoFocus) {
                domElement.focus();
              }
              return;
            case "img": {
              if (newProps.src) {
                domElement.src = newProps.src;
              }
              return;
            }
          }
        }
        function commitUpdate(domElement, updatePayload, type, oldProps, newProps, internalInstanceHandle) {
          updateProperties(domElement, updatePayload, type, oldProps, newProps);
          updateFiberProps(domElement, 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 clearSuspenseBoundary(parentInstance, suspenseInstance) {
          var node56 = suspenseInstance;
          var depth = 0;
          do {
            var nextNode = node56.nextSibling;
            parentInstance.removeChild(node56);
            if (nextNode && nextNode.nodeType === COMMENT_NODE) {
              var data = nextNode.data;
              if (data === SUSPENSE_END_DATA) {
                if (depth === 0) {
                  parentInstance.removeChild(nextNode);
                  retryIfBlockedOn(suspenseInstance);
                  return;
                } else {
                  depth--;
                }
              } else if (data === SUSPENSE_START_DATA || data === SUSPENSE_PENDING_START_DATA || data === SUSPENSE_FALLBACK_START_DATA) {
                depth++;
              }
            }
            node56 = nextNode;
          } while (node56);
          retryIfBlockedOn(suspenseInstance);
        }
        function clearSuspenseBoundaryFromContainer(container, suspenseInstance) {
          if (container.nodeType === COMMENT_NODE) {
            clearSuspenseBoundary(container.parentNode, suspenseInstance);
          } else if (container.nodeType === ELEMENT_NODE) {
            clearSuspenseBoundary(container, suspenseInstance);
          }
          retryIfBlockedOn(container);
        }
        function hideInstance(instance) {
          instance = instance;
          var style2 = instance.style;
          if (typeof style2.setProperty === "function") {
            style2.setProperty("display", "none", "important");
          } else {
            style2.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, text2) {
          textInstance.nodeValue = text2;
        }
        function clearContainer(container) {
          if (container.nodeType === ELEMENT_NODE) {
            container.textContent = "";
          } else if (container.nodeType === DOCUMENT_NODE) {
            if (container.documentElement) {
              container.removeChild(container.documentElement);
            }
          }
        }
        function canHydrateInstance(instance, type, props) {
          if (instance.nodeType !== ELEMENT_NODE || type.toLowerCase() !== instance.nodeName.toLowerCase()) {
            return null;
          }
          return instance;
        }
        function canHydrateTextInstance(instance, text2) {
          if (text2 === "" || instance.nodeType !== TEXT_NODE) {
            return null;
          }
          return instance;
        }
        function canHydrateSuspenseInstance(instance) {
          if (instance.nodeType !== COMMENT_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 getSuspenseInstanceFallbackErrorDetails(instance) {
          var dataset = instance.nextSibling && instance.nextSibling.dataset;
          var digest, message, stack;
          if (dataset) {
            digest = dataset.dgst;
            {
              message = dataset.msg;
              stack = dataset.stck;
            }
          }
          {
            return {
              message,
              digest,
              stack
            };
          }
        }
        function registerSuspenseInstanceRetry(instance, callback) {
          instance._reactRetry = callback;
        }
        function getNextHydratable(node56) {
          for (; node56 != null; node56 = node56.nextSibling) {
            var nodeType = node56.nodeType;
            if (nodeType === ELEMENT_NODE || nodeType === TEXT_NODE) {
              break;
            }
            if (nodeType === COMMENT_NODE) {
              var nodeData = node56.data;
              if (nodeData === SUSPENSE_START_DATA || nodeData === SUSPENSE_FALLBACK_START_DATA || nodeData === SUSPENSE_PENDING_START_DATA) {
                break;
              }
              if (nodeData === SUSPENSE_END_DATA) {
                return null;
              }
            }
          }
          return node56;
        }
        function getNextHydratableSibling(instance) {
          return getNextHydratable(instance.nextSibling);
        }
        function getFirstHydratableChild(parentInstance) {
          return getNextHydratable(parentInstance.firstChild);
        }
        function getFirstHydratableChildWithinContainer(parentContainer) {
          return getNextHydratable(parentContainer.firstChild);
        }
        function getFirstHydratableChildWithinSuspenseInstance(parentInstance) {
          return getNextHydratable(parentInstance.nextSibling);
        }
        function hydrateInstance(instance, type, props, rootContainerInstance, hostContext, internalInstanceHandle, shouldWarnDev) {
          precacheFiberNode(internalInstanceHandle, instance);
          updateFiberProps(instance, props);
          var parentNamespace;
          {
            var hostContextDev = hostContext;
            parentNamespace = hostContextDev.namespace;
          }
          var isConcurrentMode = (internalInstanceHandle.mode & ConcurrentMode) !== NoMode;
          return diffHydratedProperties(instance, type, props, parentNamespace, rootContainerInstance, isConcurrentMode, shouldWarnDev);
        }
        function hydrateTextInstance(textInstance, text2, internalInstanceHandle, shouldWarnDev) {
          precacheFiberNode(internalInstanceHandle, textInstance);
          var isConcurrentMode = (internalInstanceHandle.mode & ConcurrentMode) !== NoMode;
          return diffHydratedText(textInstance, text2);
        }
        function hydrateSuspenseInstance(suspenseInstance, internalInstanceHandle) {
          precacheFiberNode(internalInstanceHandle, suspenseInstance);
        }
        function getNextHydratableInstanceAfterSuspenseInstance(suspenseInstance) {
          var node56 = suspenseInstance.nextSibling;
          var depth = 0;
          while (node56) {
            if (node56.nodeType === COMMENT_NODE) {
              var data = node56.data;
              if (data === SUSPENSE_END_DATA) {
                if (depth === 0) {
                  return getNextHydratableSibling(node56);
                } else {
                  depth--;
                }
              } else if (data === SUSPENSE_START_DATA || data === SUSPENSE_FALLBACK_START_DATA || data === SUSPENSE_PENDING_START_DATA) {
                depth++;
              }
            }
            node56 = node56.nextSibling;
          }
          return null;
        }
        function getParentSuspenseInstance(targetInstance) {
          var node56 = targetInstance.previousSibling;
          var depth = 0;
          while (node56) {
            if (node56.nodeType === COMMENT_NODE) {
              var data = node56.data;
              if (data === SUSPENSE_START_DATA || data === SUSPENSE_FALLBACK_START_DATA || data === SUSPENSE_PENDING_START_DATA) {
                if (depth === 0) {
                  return node56;
                } else {
                  depth--;
                }
              } else if (data === SUSPENSE_END_DATA) {
                depth++;
              }
            }
            node56 = node56.previousSibling;
          }
          return null;
        }
        function commitHydratedContainer(container) {
          retryIfBlockedOn(container);
        }
        function commitHydratedSuspenseInstance(suspenseInstance) {
          retryIfBlockedOn(suspenseInstance);
        }
        function shouldDeleteUnhydratedTailInstances(parentType) {
          return parentType !== "head" && parentType !== "body";
        }
        function didNotMatchHydratedContainerTextInstance(parentContainer, textInstance, text2, isConcurrentMode) {
          var shouldWarnDev = true;
          checkForUnmatchedText(textInstance.nodeValue, text2, isConcurrentMode, shouldWarnDev);
        }
        function didNotMatchHydratedTextInstance(parentType, parentProps, parentInstance, textInstance, text2, isConcurrentMode) {
          if (parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) {
            var shouldWarnDev = true;
            checkForUnmatchedText(textInstance.nodeValue, text2, isConcurrentMode, shouldWarnDev);
          }
        }
        function didNotHydrateInstanceWithinContainer(parentContainer, instance) {
          {
            if (instance.nodeType === ELEMENT_NODE) {
              warnForDeletedHydratableElement(parentContainer, instance);
            } else if (instance.nodeType === COMMENT_NODE)
              ;
            else {
              warnForDeletedHydratableText(parentContainer, instance);
            }
          }
        }
        function didNotHydrateInstanceWithinSuspenseInstance(parentInstance, instance) {
          {
            var parentNode = parentInstance.parentNode;
            if (parentNode !== null) {
              if (instance.nodeType === ELEMENT_NODE) {
                warnForDeletedHydratableElement(parentNode, instance);
              } else if (instance.nodeType === COMMENT_NODE)
                ;
              else {
                warnForDeletedHydratableText(parentNode, instance);
              }
            }
          }
        }
        function didNotHydrateInstance(parentType, parentProps, parentInstance, instance, isConcurrentMode) {
          {
            if (isConcurrentMode || 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 didNotFindHydratableInstanceWithinContainer(parentContainer, type, props) {
          {
            warnForInsertedHydratedElement(parentContainer, type);
          }
        }
        function didNotFindHydratableTextInstanceWithinContainer(parentContainer, text2) {
          {
            warnForInsertedHydratedText(parentContainer, text2);
          }
        }
        function didNotFindHydratableInstanceWithinSuspenseInstance(parentInstance, type, props) {
          {
            var parentNode = parentInstance.parentNode;
            if (parentNode !== null)
              warnForInsertedHydratedElement(parentNode, type);
          }
        }
        function didNotFindHydratableTextInstanceWithinSuspenseInstance(parentInstance, text2) {
          {
            var parentNode = parentInstance.parentNode;
            if (parentNode !== null)
              warnForInsertedHydratedText(parentNode, text2);
          }
        }
        function didNotFindHydratableInstance(parentType, parentProps, parentInstance, type, props, isConcurrentMode) {
          {
            if (isConcurrentMode || parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) {
              warnForInsertedHydratedElement(parentInstance, type);
            }
          }
        }
        function didNotFindHydratableTextInstance(parentType, parentProps, parentInstance, text2, isConcurrentMode) {
          {
            if (isConcurrentMode || parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) {
              warnForInsertedHydratedText(parentInstance, text2);
            }
          }
        }
        function errorHydratingContainer(parentContainer) {
          {
            error("An error occurred during hydration. The server HTML was replaced with client content in <%s>.", parentContainer.nodeName.toLowerCase());
          }
        }
        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;
        var internalEventHandlerListenersKey = "__reactListeners$" + randomKey;
        var internalEventHandlesSetKey = "__reactHandles$" + randomKey;
        function detachDeletedInstance(node56) {
          delete node56[internalInstanceKey];
          delete node56[internalPropsKey];
          delete node56[internalEventHandlersKey];
          delete node56[internalEventHandlerListenersKey];
          delete node56[internalEventHandlesSetKey];
        }
        function precacheFiberNode(hostInst, node56) {
          node56[internalInstanceKey] = hostInst;
        }
        function markContainerAsRoot(hostRoot, node56) {
          node56[internalContainerInstanceKey] = hostRoot;
        }
        function unmarkContainerAsRoot(node56) {
          node56[internalContainerInstanceKey] = null;
        }
        function isContainerMarkedAsRoot(node56) {
          return !!node56[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(node56) {
          var inst = node56[internalInstanceKey] || node56[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 new Error("getNodeFromInstance: Invalid argument.");
        }
        function getFiberCurrentPropsFromNode(node56) {
          return node56[internalPropsKey] || null;
        }
        function updateFiberProps(node56, props) {
          node56[internalPropsKey] = props;
        }
        function getEventListenerSet(node56) {
          var elementListenerSet = node56[internalEventHandlersKey];
          if (elementListenerSet === void 0) {
            elementListenerSet = node56[internalEventHandlersKey] = /* @__PURE__ */ new Set();
          }
          return elementListenerSet;
        }
        var loggedTypeFailures = {};
        var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
        function setCurrentlyValidatingElement(element2) {
          {
            if (element2) {
              var owner = element2._owner;
              var stack = describeUnknownElementTypeFrameInDEV(element2.type, element2._source, owner ? owner.type : null);
              ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
            } else {
              ReactDebugCurrentFrame$1.setExtraStackFrame(null);
            }
          }
        }
        function checkPropTypes(typeSpecs, values2, location2, componentName, element2) {
          {
            var has3 = Function.call.bind(hasOwnProperty3);
            for (var typeSpecName in typeSpecs) {
              if (has3(typeSpecs, typeSpecName)) {
                var error$1 = void 0;
                try {
                  if (typeof typeSpecs[typeSpecName] !== "function") {
                    var err = Error((componentName || "React class") + ": " + location2 + " 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](values2, typeSpecName, componentName, location2, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
                } catch (ex) {
                  error$1 = ex;
                }
                if (error$1 && !(error$1 instanceof Error)) {
                  setCurrentlyValidatingElement(element2);
                  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", location2, typeSpecName, typeof error$1);
                  setCurrentlyValidatingElement(null);
                }
                if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
                  loggedTypeFailures[error$1.message] = true;
                  setCurrentlyValidatingElement(element2);
                  error("Failed %s type: %s", location2, error$1.message);
                  setCurrentlyValidatingElement(null);
                }
              }
            }
          }
        }
        var valueStack = [];
        var fiberStack;
        {
          fiberStack = [];
        }
        var index = -1;
        function createCursor(defaultValue) {
          return {
            current: defaultValue
          };
        }
        function pop(cursor3, fiber) {
          if (index < 0) {
            {
              error("Unexpected pop.");
            }
            return;
          }
          {
            if (fiber !== fiberStack[index]) {
              error("Unexpected Fiber popped.");
            }
          }
          cursor3.current = valueStack[index];
          valueStack[index] = null;
          {
            fiberStack[index] = null;
          }
          index--;
        }
        function push(cursor3, value, fiber) {
          index++;
          valueStack[index] = cursor3.current;
          {
            fiberStack[index] = fiber;
          }
          cursor3.current = value;
        }
        var warnedAboutMissingGetChildContext;
        {
          warnedAboutMissingGetChildContext = {};
        }
        var emptyContextObject = {};
        {
          Object.freeze(emptyContextObject);
        }
        var contextStackCursor = createCursor(emptyContextObject);
        var didPerformWorkStackCursor = createCursor(false);
        var previousContext = emptyContextObject;
        function getUnmaskedContext(workInProgress2, Component8, didPushOwnContextIfProvider) {
          {
            if (didPushOwnContextIfProvider && isContextProvider(Component8)) {
              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 context2 = {};
            for (var key in contextTypes) {
              context2[key] = unmaskedContext[key];
            }
            {
              var name2 = getComponentNameFromFiber(workInProgress2) || "Unknown";
              checkPropTypes(contextTypes, context2, "context", name2);
            }
            if (instance) {
              cacheContext(workInProgress2, unmaskedContext, context2);
            }
            return context2;
          }
        }
        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, context2, didChange) {
          {
            if (contextStackCursor.current !== emptyContextObject) {
              throw new Error("Unexpected context found on stack. This error is likely caused by a bug in React. Please file an issue.");
            }
            push(contextStackCursor, context2, 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 = getComponentNameFromFiber(fiber) || "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 new Error((getComponentNameFromFiber(fiber) || "Unknown") + '.getChildContext(): key "' + contextKey + '" is not defined in childContextTypes.');
              }
            }
            {
              var name2 = getComponentNameFromFiber(fiber) || "Unknown";
              checkPropTypes(childContextTypes, childContext, "child context", name2);
            }
            return assign3({}, 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 new 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 new 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 node56 = fiber;
            do {
              switch (node56.tag) {
                case HostRoot:
                  return node56.stateNode.context;
                case ClassComponent: {
                  var Component8 = node56.type;
                  if (isContextProvider(Component8)) {
                    return node56.stateNode.__reactInternalMemoizedMergedChildContext;
                  }
                  break;
                }
              }
              node56 = node56.return;
            } while (node56 !== null);
            throw new Error("Found unexpected detached subtree parent. This error is likely caused by a bug in React. Please file an issue.");
          }
        }
        var LegacyRoot = 0;
        var ConcurrentRoot2 = 1;
        var syncQueue = null;
        var includesLegacySyncCallbacks = false;
        var isFlushingSyncQueue = false;
        function scheduleSyncCallback(callback) {
          if (syncQueue === null) {
            syncQueue = [callback];
          } else {
            syncQueue.push(callback);
          }
        }
        function scheduleLegacySyncCallback(callback) {
          includesLegacySyncCallbacks = true;
          scheduleSyncCallback(callback);
        }
        function flushSyncCallbacksOnlyInLegacyMode() {
          if (includesLegacySyncCallbacks) {
            flushSyncCallbacks();
          }
        }
        function flushSyncCallbacks() {
          if (!isFlushingSyncQueue && syncQueue !== null) {
            isFlushingSyncQueue = true;
            var i2 = 0;
            var previousUpdatePriority = getCurrentUpdatePriority();
            try {
              var isSync = true;
              var queue = syncQueue;
              setCurrentUpdatePriority(DiscreteEventPriority2);
              for (; i2 < queue.length; i2++) {
                var callback = queue[i2];
                do {
                  callback = callback(isSync);
                } while (callback !== null);
              }
              syncQueue = null;
              includesLegacySyncCallbacks = false;
            } catch (error2) {
              if (syncQueue !== null) {
                syncQueue = syncQueue.slice(i2 + 1);
              }
              scheduleCallback(ImmediatePriority, flushSyncCallbacks);
              throw error2;
            } finally {
              setCurrentUpdatePriority(previousUpdatePriority);
              isFlushingSyncQueue = false;
            }
          }
          return null;
        }
        var forkStack = [];
        var forkStackIndex = 0;
        var treeForkProvider = null;
        var treeForkCount = 0;
        var idStack = [];
        var idStackIndex = 0;
        var treeContextProvider = null;
        var treeContextId = 1;
        var treeContextOverflow = "";
        function isForkedChild(workInProgress2) {
          warnIfNotHydrating();
          return (workInProgress2.flags & Forked) !== NoFlags;
        }
        function getForksAtLevel(workInProgress2) {
          warnIfNotHydrating();
          return treeForkCount;
        }
        function getTreeId() {
          var overflow = treeContextOverflow;
          var idWithLeadingBit = treeContextId;
          var id2 = idWithLeadingBit & ~getLeadingBit(idWithLeadingBit);
          return id2.toString(32) + overflow;
        }
        function pushTreeFork(workInProgress2, totalChildren) {
          warnIfNotHydrating();
          forkStack[forkStackIndex++] = treeForkCount;
          forkStack[forkStackIndex++] = treeForkProvider;
          treeForkProvider = workInProgress2;
          treeForkCount = totalChildren;
        }
        function pushTreeId(workInProgress2, totalChildren, index2) {
          warnIfNotHydrating();
          idStack[idStackIndex++] = treeContextId;
          idStack[idStackIndex++] = treeContextOverflow;
          idStack[idStackIndex++] = treeContextProvider;
          treeContextProvider = workInProgress2;
          var baseIdWithLeadingBit = treeContextId;
          var baseOverflow = treeContextOverflow;
          var baseLength = getBitLength(baseIdWithLeadingBit) - 1;
          var baseId = baseIdWithLeadingBit & ~(1 << baseLength);
          var slot = index2 + 1;
          var length2 = getBitLength(totalChildren) + baseLength;
          if (length2 > 30) {
            var numberOfOverflowBits = baseLength - baseLength % 5;
            var newOverflowBits = (1 << numberOfOverflowBits) - 1;
            var newOverflow = (baseId & newOverflowBits).toString(32);
            var restOfBaseId = baseId >> numberOfOverflowBits;
            var restOfBaseLength = baseLength - numberOfOverflowBits;
            var restOfLength = getBitLength(totalChildren) + restOfBaseLength;
            var restOfNewBits = slot << restOfBaseLength;
            var id2 = restOfNewBits | restOfBaseId;
            var overflow = newOverflow + baseOverflow;
            treeContextId = 1 << restOfLength | id2;
            treeContextOverflow = overflow;
          } else {
            var newBits = slot << baseLength;
            var _id2 = newBits | baseId;
            var _overflow = baseOverflow;
            treeContextId = 1 << length2 | _id2;
            treeContextOverflow = _overflow;
          }
        }
        function pushMaterializedTreeId(workInProgress2) {
          warnIfNotHydrating();
          var returnFiber = workInProgress2.return;
          if (returnFiber !== null) {
            var numberOfForks = 1;
            var slotIndex = 0;
            pushTreeFork(workInProgress2, numberOfForks);
            pushTreeId(workInProgress2, numberOfForks, slotIndex);
          }
        }
        function getBitLength(number5) {
          return 32 - clz32(number5);
        }
        function getLeadingBit(id2) {
          return 1 << getBitLength(id2) - 1;
        }
        function popTreeContext(workInProgress2) {
          while (workInProgress2 === treeForkProvider) {
            treeForkProvider = forkStack[--forkStackIndex];
            forkStack[forkStackIndex] = null;
            treeForkCount = forkStack[--forkStackIndex];
            forkStack[forkStackIndex] = null;
          }
          while (workInProgress2 === treeContextProvider) {
            treeContextProvider = idStack[--idStackIndex];
            idStack[idStackIndex] = null;
            treeContextOverflow = idStack[--idStackIndex];
            idStack[idStackIndex] = null;
            treeContextId = idStack[--idStackIndex];
            idStack[idStackIndex] = null;
          }
        }
        function getSuspendedTreeContext() {
          warnIfNotHydrating();
          if (treeContextProvider !== null) {
            return {
              id: treeContextId,
              overflow: treeContextOverflow
            };
          } else {
            return null;
          }
        }
        function restoreSuspendedTreeContext(workInProgress2, suspendedContext) {
          warnIfNotHydrating();
          idStack[idStackIndex++] = treeContextId;
          idStack[idStackIndex++] = treeContextOverflow;
          idStack[idStackIndex++] = treeContextProvider;
          treeContextId = suspendedContext.id;
          treeContextOverflow = suspendedContext.overflow;
          treeContextProvider = workInProgress2;
        }
        function warnIfNotHydrating() {
          {
            if (!getIsHydrating()) {
              error("Expected to be hydrating. This is a bug in React. Please file an issue.");
            }
          }
        }
        var hydrationParentFiber = null;
        var nextHydratableInstance = null;
        var isHydrating = false;
        var didSuspendOrErrorDEV = false;
        var hydrationErrors = null;
        function warnIfHydrating() {
          {
            if (isHydrating) {
              error("We should not be hydrating here. This is a bug in React. Please file a bug.");
            }
          }
        }
        function markDidThrowWhileHydratingDEV() {
          {
            didSuspendOrErrorDEV = true;
          }
        }
        function didSuspendOrErrorWhileHydratingDEV() {
          {
            return didSuspendOrErrorDEV;
          }
        }
        function enterHydrationState(fiber) {
          var parentInstance = fiber.stateNode.containerInfo;
          nextHydratableInstance = getFirstHydratableChildWithinContainer(parentInstance);
          hydrationParentFiber = fiber;
          isHydrating = true;
          hydrationErrors = null;
          didSuspendOrErrorDEV = false;
          return true;
        }
        function reenterHydrationStateFromDehydratedSuspenseInstance(fiber, suspenseInstance, treeContext) {
          nextHydratableInstance = getFirstHydratableChildWithinSuspenseInstance(suspenseInstance);
          hydrationParentFiber = fiber;
          isHydrating = true;
          hydrationErrors = null;
          didSuspendOrErrorDEV = false;
          if (treeContext !== null) {
            restoreSuspendedTreeContext(fiber, treeContext);
          }
          return true;
        }
        function warnUnhydratedInstance(returnFiber, instance) {
          {
            switch (returnFiber.tag) {
              case HostRoot: {
                didNotHydrateInstanceWithinContainer(returnFiber.stateNode.containerInfo, instance);
                break;
              }
              case HostComponent: {
                var isConcurrentMode = (returnFiber.mode & ConcurrentMode) !== NoMode;
                didNotHydrateInstance(
                  returnFiber.type,
                  returnFiber.memoizedProps,
                  returnFiber.stateNode,
                  instance,
                  // TODO: Delete this argument when we remove the legacy root API.
                  isConcurrentMode
                );
                break;
              }
              case SuspenseComponent: {
                var suspenseState = returnFiber.memoizedState;
                if (suspenseState.dehydrated !== null)
                  didNotHydrateInstanceWithinSuspenseInstance(suspenseState.dehydrated, instance);
                break;
              }
            }
          }
        }
        function deleteHydratableInstance(returnFiber, instance) {
          warnUnhydratedInstance(returnFiber, instance);
          var childToDelete = createFiberFromHostInstanceForDeletion();
          childToDelete.stateNode = instance;
          childToDelete.return = returnFiber;
          var deletions = returnFiber.deletions;
          if (deletions === null) {
            returnFiber.deletions = [childToDelete];
            returnFiber.flags |= ChildDeletion;
          } else {
            deletions.push(childToDelete);
          }
        }
        function warnNonhydratedInstance(returnFiber, fiber) {
          {
            if (didSuspendOrErrorDEV) {
              return;
            }
            switch (returnFiber.tag) {
              case HostRoot: {
                var parentContainer = returnFiber.stateNode.containerInfo;
                switch (fiber.tag) {
                  case HostComponent:
                    var type = fiber.type;
                    var props = fiber.pendingProps;
                    didNotFindHydratableInstanceWithinContainer(parentContainer, type);
                    break;
                  case HostText:
                    var text2 = fiber.pendingProps;
                    didNotFindHydratableTextInstanceWithinContainer(parentContainer, text2);
                    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;
                    var isConcurrentMode = (returnFiber.mode & ConcurrentMode) !== NoMode;
                    didNotFindHydratableInstance(
                      parentType,
                      parentProps,
                      parentInstance,
                      _type,
                      _props,
                      // TODO: Delete this argument when we remove the legacy root API.
                      isConcurrentMode
                    );
                    break;
                  }
                  case HostText: {
                    var _text = fiber.pendingProps;
                    var _isConcurrentMode = (returnFiber.mode & ConcurrentMode) !== NoMode;
                    didNotFindHydratableTextInstance(
                      parentType,
                      parentProps,
                      parentInstance,
                      _text,
                      // TODO: Delete this argument when we remove the legacy root API.
                      _isConcurrentMode
                    );
                    break;
                  }
                }
                break;
              }
              case SuspenseComponent: {
                var suspenseState = returnFiber.memoizedState;
                var _parentInstance = suspenseState.dehydrated;
                if (_parentInstance !== null)
                  switch (fiber.tag) {
                    case HostComponent:
                      var _type2 = fiber.type;
                      var _props2 = fiber.pendingProps;
                      didNotFindHydratableInstanceWithinSuspenseInstance(_parentInstance, _type2);
                      break;
                    case HostText:
                      var _text2 = fiber.pendingProps;
                      didNotFindHydratableTextInstanceWithinSuspenseInstance(_parentInstance, _text2);
                      break;
                  }
                break;
              }
              default:
                return;
            }
          }
        }
        function insertNonHydratedInstance(returnFiber, fiber) {
          fiber.flags = fiber.flags & ~Hydrating | Placement;
          warnNonhydratedInstance(returnFiber, fiber);
        }
        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;
                hydrationParentFiber = fiber;
                nextHydratableInstance = getFirstHydratableChild(instance);
                return true;
              }
              return false;
            }
            case HostText: {
              var text2 = fiber.pendingProps;
              var textInstance = canHydrateTextInstance(nextInstance, text2);
              if (textInstance !== null) {
                fiber.stateNode = textInstance;
                hydrationParentFiber = fiber;
                nextHydratableInstance = null;
                return true;
              }
              return false;
            }
            case SuspenseComponent: {
              var suspenseInstance = canHydrateSuspenseInstance(nextInstance);
              if (suspenseInstance !== null) {
                var suspenseState = {
                  dehydrated: suspenseInstance,
                  treeContext: getSuspendedTreeContext(),
                  retryLane: OffscreenLane
                };
                fiber.memoizedState = suspenseState;
                var dehydratedFragment = createFiberFromDehydratedFragment(suspenseInstance);
                dehydratedFragment.return = fiber;
                fiber.child = dehydratedFragment;
                hydrationParentFiber = fiber;
                nextHydratableInstance = null;
                return true;
              }
              return false;
            }
            default:
              return false;
          }
        }
        function shouldClientRenderOnMismatch(fiber) {
          return (fiber.mode & ConcurrentMode) !== NoMode && (fiber.flags & DidCapture) === NoFlags;
        }
        function throwOnHydrationMismatch(fiber) {
          throw new Error("Hydration failed because the initial UI does not match what was rendered on the server.");
        }
        function tryToClaimNextHydratableInstance(fiber) {
          if (!isHydrating) {
            return;
          }
          var nextInstance = nextHydratableInstance;
          if (!nextInstance) {
            if (shouldClientRenderOnMismatch(fiber)) {
              warnNonhydratedInstance(hydrationParentFiber, fiber);
              throwOnHydrationMismatch();
            }
            insertNonHydratedInstance(hydrationParentFiber, fiber);
            isHydrating = false;
            hydrationParentFiber = fiber;
            return;
          }
          var firstAttemptedInstance = nextInstance;
          if (!tryHydrate(fiber, nextInstance)) {
            if (shouldClientRenderOnMismatch(fiber)) {
              warnNonhydratedInstance(hydrationParentFiber, fiber);
              throwOnHydrationMismatch();
            }
            nextInstance = getNextHydratableSibling(firstAttemptedInstance);
            var prevHydrationParentFiber = hydrationParentFiber;
            if (!nextInstance || !tryHydrate(fiber, nextInstance)) {
              insertNonHydratedInstance(hydrationParentFiber, fiber);
              isHydrating = false;
              hydrationParentFiber = fiber;
              return;
            }
            deleteHydratableInstance(prevHydrationParentFiber, firstAttemptedInstance);
          }
        }
        function prepareToHydrateHostInstance(fiber, rootContainerInstance, hostContext) {
          var instance = fiber.stateNode;
          var shouldWarnIfMismatchDev = !didSuspendOrErrorDEV;
          var updatePayload = hydrateInstance(instance, fiber.type, fiber.memoizedProps, rootContainerInstance, hostContext, fiber, shouldWarnIfMismatchDev);
          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;
                  var isConcurrentMode = (returnFiber.mode & ConcurrentMode) !== NoMode;
                  didNotMatchHydratedContainerTextInstance(
                    parentContainer,
                    textInstance,
                    textContent,
                    // TODO: Delete this argument when we remove the legacy root API.
                    isConcurrentMode
                  );
                  break;
                }
                case HostComponent: {
                  var parentType = returnFiber.type;
                  var parentProps = returnFiber.memoizedProps;
                  var parentInstance = returnFiber.stateNode;
                  var _isConcurrentMode2 = (returnFiber.mode & ConcurrentMode) !== NoMode;
                  didNotMatchHydratedTextInstance(
                    parentType,
                    parentProps,
                    parentInstance,
                    textInstance,
                    textContent,
                    // TODO: Delete this argument when we remove the legacy root API.
                    _isConcurrentMode2
                  );
                  break;
                }
              }
            }
          }
          return shouldUpdate;
        }
        function prepareToHydrateHostSuspenseInstance(fiber) {
          var suspenseState = fiber.memoizedState;
          var suspenseInstance = suspenseState !== null ? suspenseState.dehydrated : null;
          if (!suspenseInstance) {
            throw new Error("Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue.");
          }
          hydrateSuspenseInstance(suspenseInstance, fiber);
        }
        function skipPastDehydratedSuspenseInstance(fiber) {
          var suspenseState = fiber.memoizedState;
          var suspenseInstance = suspenseState !== null ? suspenseState.dehydrated : null;
          if (!suspenseInstance) {
            throw new 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;
          }
          if (fiber.tag !== HostRoot && (fiber.tag !== HostComponent || shouldDeleteUnhydratedTailInstances(fiber.type) && !shouldSetTextContent(fiber.type, fiber.memoizedProps))) {
            var nextInstance = nextHydratableInstance;
            if (nextInstance) {
              if (shouldClientRenderOnMismatch(fiber)) {
                warnIfUnhydratedTailNodes(fiber);
                throwOnHydrationMismatch();
              } else {
                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 hasUnhydratedTailNodes() {
          return isHydrating && nextHydratableInstance !== null;
        }
        function warnIfUnhydratedTailNodes(fiber) {
          var nextInstance = nextHydratableInstance;
          while (nextInstance) {
            warnUnhydratedInstance(fiber, nextInstance);
            nextInstance = getNextHydratableSibling(nextInstance);
          }
        }
        function resetHydrationState() {
          hydrationParentFiber = null;
          nextHydratableInstance = null;
          isHydrating = false;
          didSuspendOrErrorDEV = false;
        }
        function upgradeHydrationErrorsToRecoverable() {
          if (hydrationErrors !== null) {
            queueRecoverableErrors(hydrationErrors);
            hydrationErrors = null;
          }
        }
        function getIsHydrating() {
          return isHydrating;
        }
        function queueHydrationError(error2) {
          if (hydrationErrors === null) {
            hydrationErrors = [error2];
          } else {
            hydrationErrors.push(error2);
          }
        }
        var ReactCurrentBatchConfig$1 = ReactSharedInternals.ReactCurrentBatchConfig;
        var NoTransition = null;
        function requestCurrentTransition() {
          return ReactCurrentBatchConfig$1.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 node56 = fiber;
            while (node56 !== null) {
              if (node56.mode & StrictLegacyMode) {
                maybeStrictRoot = node56;
              }
              node56 = node56.return;
            }
            return maybeStrictRoot;
          };
          var setToSortedString = function(set4) {
            var array = [];
            set4.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" && // Don't warn about react-lifecycles-compat polyfilled components.
            instance.componentWillMount.__suppressDeprecationWarning !== true) {
              pendingComponentWillMountWarnings.push(fiber);
            }
            if (fiber.mode & StrictLegacyMode && typeof instance.UNSAFE_componentWillMount === "function") {
              pendingUNSAFE_ComponentWillMountWarnings.push(fiber);
            }
            if (typeof instance.componentWillReceiveProps === "function" && instance.componentWillReceiveProps.__suppressDeprecationWarning !== true) {
              pendingComponentWillReceivePropsWarnings.push(fiber);
            }
            if (fiber.mode & StrictLegacyMode && typeof instance.UNSAFE_componentWillReceiveProps === "function") {
              pendingUNSAFE_ComponentWillReceivePropsWarnings.push(fiber);
            }
            if (typeof instance.componentWillUpdate === "function" && instance.componentWillUpdate.__suppressDeprecationWarning !== true) {
              pendingComponentWillUpdateWarnings.push(fiber);
            }
            if (fiber.mode & StrictLegacyMode && 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(getComponentNameFromFiber(fiber) || "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(getComponentNameFromFiber(fiber) || "Component");
                didWarnAboutUnsafeLifecycles.add(fiber.type);
              });
              pendingUNSAFE_ComponentWillMountWarnings = [];
            }
            var componentWillReceivePropsUniqueNames = /* @__PURE__ */ new Set();
            if (pendingComponentWillReceivePropsWarnings.length > 0) {
              pendingComponentWillReceivePropsWarnings.forEach(function(fiber) {
                componentWillReceivePropsUniqueNames.add(getComponentNameFromFiber(fiber) || "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(getComponentNameFromFiber(fiber) || "Component");
                didWarnAboutUnsafeLifecycles.add(fiber.type);
              });
              pendingUNSAFE_ComponentWillReceivePropsWarnings = [];
            }
            var componentWillUpdateUniqueNames = /* @__PURE__ */ new Set();
            if (pendingComponentWillUpdateWarnings.length > 0) {
              pendingComponentWillUpdateWarnings.forEach(function(fiber) {
                componentWillUpdateUniqueNames.add(getComponentNameFromFiber(fiber) || "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(getComponentNameFromFiber(fiber) || "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);
              warn5("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);
              warn5("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);
              warn5("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(getComponentNameFromFiber(fiber) || "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(Component8, baseProps) {
          if (Component8 && Component8.defaultProps) {
            var props = assign3({}, baseProps);
            var defaultProps5 = Component8.defaultProps;
            for (var propName in defaultProps5) {
              if (props[propName] === void 0) {
                props[propName] = defaultProps5[propName];
              }
            }
            return props;
          }
          return baseProps;
        }
        var valueCursor = createCursor(null);
        var rendererSigil;
        {
          rendererSigil = {};
        }
        var currentlyRenderingFiber = null;
        var lastContextDependency = null;
        var lastFullyObservedContext = null;
        var isDisallowedContextReadInDEV = false;
        function resetContextDependencies() {
          currentlyRenderingFiber = null;
          lastContextDependency = null;
          lastFullyObservedContext = null;
          {
            isDisallowedContextReadInDEV = false;
          }
        }
        function enterDisallowedContextReadInDEV() {
          {
            isDisallowedContextReadInDEV = true;
          }
        }
        function exitDisallowedContextReadInDEV() {
          {
            isDisallowedContextReadInDEV = false;
          }
        }
        function pushProvider(providerFiber, context2, nextValue) {
          {
            push(valueCursor, context2._currentValue, providerFiber);
            context2._currentValue = nextValue;
            {
              if (context2._currentRenderer !== void 0 && context2._currentRenderer !== null && context2._currentRenderer !== rendererSigil) {
                error("Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported.");
              }
              context2._currentRenderer = rendererSigil;
            }
          }
        }
        function popProvider(context2, providerFiber) {
          var currentValue = valueCursor.current;
          pop(valueCursor, providerFiber);
          {
            {
              context2._currentValue = currentValue;
            }
          }
        }
        function scheduleContextWorkOnParentPath(parent, renderLanes2, propagationRoot) {
          var node56 = parent;
          while (node56 !== null) {
            var alternate = node56.alternate;
            if (!isSubsetOfLanes(node56.childLanes, renderLanes2)) {
              node56.childLanes = mergeLanes(node56.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);
            }
            if (node56 === propagationRoot) {
              break;
            }
            node56 = node56.return;
          }
          {
            if (node56 !== propagationRoot) {
              error("Expected to find the propagation root when scheduling context work. This error is likely caused by a bug in React. Please file an issue.");
            }
          }
        }
        function propagateContextChange(workInProgress2, context2, renderLanes2) {
          {
            propagateContextChange_eager(workInProgress2, context2, renderLanes2);
          }
        }
        function propagateContextChange_eager(workInProgress2, context2, 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 === context2) {
                  if (fiber.tag === ClassComponent) {
                    var lane = pickArbitraryLane(renderLanes2);
                    var update = createUpdate(NoTimestamp, lane);
                    update.tag = ForceUpdate;
                    var updateQueue = fiber.updateQueue;
                    if (updateQueue === null)
                      ;
                    else {
                      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;
                    }
                  }
                  fiber.lanes = mergeLanes(fiber.lanes, renderLanes2);
                  var alternate = fiber.alternate;
                  if (alternate !== null) {
                    alternate.lanes = mergeLanes(alternate.lanes, renderLanes2);
                  }
                  scheduleContextWorkOnParentPath(fiber.return, renderLanes2, workInProgress2);
                  list.lanes = mergeLanes(list.lanes, renderLanes2);
                  break;
                }
                dependency = dependency.next;
              }
            } else if (fiber.tag === ContextProvider) {
              nextFiber = fiber.type === workInProgress2.type ? null : fiber.child;
            } else if (fiber.tag === DehydratedFragment) {
              var parentSuspense = fiber.return;
              if (parentSuspense === null) {
                throw new Error("We just came from a parent so we must have had a parent. This is a bug in React.");
              }
              parentSuspense.lanes = mergeLanes(parentSuspense.lanes, renderLanes2);
              var _alternate = parentSuspense.alternate;
              if (_alternate !== null) {
                _alternate.lanes = mergeLanes(_alternate.lanes, renderLanes2);
              }
              scheduleContextWorkOnParentPath(parentSuspense, renderLanes2, workInProgress2);
              nextFiber = fiber.sibling;
            } 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;
          lastFullyObservedContext = 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(context2) {
          {
            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().");
            }
          }
          var value = context2._currentValue;
          if (lastFullyObservedContext === context2)
            ;
          else {
            var contextItem = {
              context: context2,
              memoizedValue: value,
              next: null
            };
            if (lastContextDependency === null) {
              if (currentlyRenderingFiber === null) {
                throw new 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
              };
            } else {
              lastContextDependency = lastContextDependency.next = contextItem;
            }
          }
          return value;
        }
        var concurrentQueues = null;
        function pushConcurrentUpdateQueue(queue) {
          if (concurrentQueues === null) {
            concurrentQueues = [queue];
          } else {
            concurrentQueues.push(queue);
          }
        }
        function finishQueueingConcurrentUpdates() {
          if (concurrentQueues !== null) {
            for (var i2 = 0; i2 < concurrentQueues.length; i2++) {
              var queue = concurrentQueues[i2];
              var lastInterleavedUpdate = queue.interleaved;
              if (lastInterleavedUpdate !== null) {
                queue.interleaved = null;
                var firstInterleavedUpdate = lastInterleavedUpdate.next;
                var lastPendingUpdate = queue.pending;
                if (lastPendingUpdate !== null) {
                  var firstPendingUpdate = lastPendingUpdate.next;
                  lastPendingUpdate.next = firstInterleavedUpdate;
                  lastInterleavedUpdate.next = firstPendingUpdate;
                }
                queue.pending = lastInterleavedUpdate;
              }
            }
            concurrentQueues = null;
          }
        }
        function enqueueConcurrentHookUpdate(fiber, queue, update, lane) {
          var interleaved = queue.interleaved;
          if (interleaved === null) {
            update.next = update;
            pushConcurrentUpdateQueue(queue);
          } else {
            update.next = interleaved.next;
            interleaved.next = update;
          }
          queue.interleaved = update;
          return markUpdateLaneFromFiberToRoot(fiber, lane);
        }
        function enqueueConcurrentHookUpdateAndEagerlyBailout(fiber, queue, update, lane) {
          var interleaved = queue.interleaved;
          if (interleaved === null) {
            update.next = update;
            pushConcurrentUpdateQueue(queue);
          } else {
            update.next = interleaved.next;
            interleaved.next = update;
          }
          queue.interleaved = update;
        }
        function enqueueConcurrentClassUpdate(fiber, queue, update, lane) {
          var interleaved = queue.interleaved;
          if (interleaved === null) {
            update.next = update;
            pushConcurrentUpdateQueue(queue);
          } else {
            update.next = interleaved.next;
            interleaved.next = update;
          }
          queue.interleaved = update;
          return markUpdateLaneFromFiberToRoot(fiber, lane);
        }
        function enqueueConcurrentRenderForLane(fiber, lane) {
          return markUpdateLaneFromFiberToRoot(fiber, lane);
        }
        var unsafe_markUpdateLaneFromFiberToRoot = markUpdateLaneFromFiberToRoot;
        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 node56 = 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);
                }
              }
            }
            node56 = parent;
            parent = parent.return;
          }
          if (node56.tag === HostRoot) {
            var root3 = node56.stateNode;
            return root3;
          } else {
            return null;
          }
        }
        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,
              interleaved: null,
              lanes: NoLanes
            },
            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, lane) {
          var updateQueue = fiber.updateQueue;
          if (updateQueue === null) {
            return null;
          }
          var sharedQueue = updateQueue.shared;
          {
            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;
            }
          }
          if (isUnsafeClassRenderPhaseUpdate()) {
            var pending = sharedQueue.pending;
            if (pending === null) {
              update.next = update;
            } else {
              update.next = pending.next;
              pending.next = update;
            }
            sharedQueue.pending = update;
            return unsafe_markUpdateLaneFromFiberToRoot(fiber, lane);
          } else {
            return enqueueConcurrentClassUpdate(fiber, sharedQueue, update, lane);
          }
        }
        function entangleTransitions(root3, fiber, lane) {
          var updateQueue = fiber.updateQueue;
          if (updateQueue === null) {
            return;
          }
          var sharedQueue = updateQueue.shared;
          if (isTransitionLane(lane)) {
            var queueLanes = sharedQueue.lanes;
            queueLanes = intersectLanes(queueLanes, root3.pendingLanes);
            var newQueueLanes = mergeLanes(queueLanes, lane);
            sharedQueue.lanes = newQueueLanes;
            markRootEntangled(root3, newQueueLanes);
          }
        }
        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 & StrictLegacyMode) {
                    setIsStrictModeForDevtools(true);
                    try {
                      payload.call(instance, prevState, nextProps);
                    } finally {
                      setIsStrictModeForDevtools(false);
                    }
                  }
                  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 & StrictLegacyMode) {
                    setIsStrictModeForDevtools(true);
                    try {
                      _payload.call(instance, prevState, nextProps);
                    } finally {
                      setIsStrictModeForDevtools(false);
                    }
                  }
                  exitDisallowedContextReadInDEV();
                }
              } else {
                partialState = _payload;
              }
              if (partialState === null || partialState === void 0) {
                return prevState;
              }
              return assign3({}, 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,
                    // This update is going to be committed so we never want uncommit
                    // it. Using NoLane works because 0 is a subset of all bitmasks, so
                    // this will never be skipped by the check above.
                    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 && // If the update was already committed, we should not queue its
                // callback again.
                update.lane !== NoLane) {
                  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;
            var lastInterleaved = queue.shared.interleaved;
            if (lastInterleaved !== null) {
              var interleaved = lastInterleaved;
              do {
                newLanes = mergeLanes(newLanes, interleaved.lane);
                interleaved = interleaved.next;
              } while (interleaved !== lastInterleaved);
            } else if (firstBaseUpdate === null) {
              queue.shared.lanes = NoLanes;
            }
            markSkippedUpdateLanes(newLanes);
            workInProgress2.lanes = newLanes;
            workInProgress2.memoizedState = newState;
          }
          {
            currentlyProcessingQueue = null;
          }
        }
        function callCallback(callback, context2) {
          if (typeof callback !== "function") {
            throw new Error("Invalid argument passed as callback. Expected a function. Instead " + ("received: " + callback));
          }
          callback.call(context2);
        }
        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 i2 = 0; i2 < effects.length; i2++) {
              var effect = effects[i2];
              var callback = effect.callback;
              if (callback !== null) {
                effect.callback = null;
                callCallback(callback, instance);
              }
            }
          }
        }
        var fakeInternalInstance = {};
        var emptyRefsObject = new React116.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 key = callerName + "_" + callback;
            if (!didWarnOnInvalidCallback.has(key)) {
              didWarnOnInvalidCallback.add(key);
              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 = getComponentNameFromType(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 new 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;
          var partialState = getDerivedStateFromProps(nextProps, prevState);
          {
            if (workInProgress2.mode & StrictLegacyMode) {
              setIsStrictModeForDevtools(true);
              try {
                partialState = getDerivedStateFromProps(nextProps, prevState);
              } finally {
                setIsStrictModeForDevtools(false);
              }
            }
            warnOnUndefinedDerivedState(ctor, partialState);
          }
          var memoizedState = partialState === null || partialState === void 0 ? prevState : assign3({}, 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 = get3(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;
            }
            var root3 = enqueueUpdate(fiber, update, lane);
            if (root3 !== null) {
              scheduleUpdateOnFiber(root3, fiber, lane, eventTime);
              entangleTransitions(root3, fiber, lane);
            }
            {
              markStateUpdateScheduled(fiber, lane);
            }
          },
          enqueueReplaceState: function(inst, payload, callback) {
            var fiber = get3(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;
            }
            var root3 = enqueueUpdate(fiber, update, lane);
            if (root3 !== null) {
              scheduleUpdateOnFiber(root3, fiber, lane, eventTime);
              entangleTransitions(root3, fiber, lane);
            }
            {
              markStateUpdateScheduled(fiber, lane);
            }
          },
          enqueueForceUpdate: function(inst, callback) {
            var fiber = get3(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;
            }
            var root3 = enqueueUpdate(fiber, update, lane);
            if (root3 !== null) {
              scheduleUpdateOnFiber(root3, fiber, lane, eventTime);
              entangleTransitions(root3, fiber, lane);
            }
            {
              markForceUpdateScheduled(fiber, lane);
            }
          }
        };
        function checkShouldComponentUpdate(workInProgress2, ctor, oldProps, newProps, oldState, newState, nextContext) {
          var instance = workInProgress2.stateNode;
          if (typeof instance.shouldComponentUpdate === "function") {
            var shouldUpdate = instance.shouldComponentUpdate(newProps, newState, nextContext);
            {
              if (workInProgress2.mode & StrictLegacyMode) {
                setIsStrictModeForDevtools(true);
                try {
                  shouldUpdate = instance.shouldComponentUpdate(newProps, newState, nextContext);
                } finally {
                  setIsStrictModeForDevtools(false);
                }
              }
              if (shouldUpdate === void 0) {
                error("%s.shouldComponentUpdate(): Returned undefined instead of a boolean value. Make sure to return true or false.", getComponentNameFromType(ctor) || "Component");
              }
            }
            return shouldUpdate;
          }
          if (ctor.prototype && ctor.prototype.isPureReactComponent) {
            return !shallowEqual3(oldProps, newProps) || !shallowEqual3(oldState, newState);
          }
          return true;
        }
        function checkClassInstance(workInProgress2, ctor, newProps) {
          var instance = workInProgress2.stateNode;
          {
            var name2 = getComponentNameFromType(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?", name2);
              } else {
                error("%s(...): No `render` method found on the returned component instance: you may have forgotten to define `render`.", name2);
              }
            }
            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?", name2);
            }
            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.", name2);
            }
            if (instance.propTypes) {
              error("propTypes was defined as an instance property on %s. Use a static property to define propTypes instead.", name2);
            }
            if (instance.contextType) {
              error("contextType was defined as an instance property on %s. Use a static property to define contextType instead.", name2);
            }
            {
              if (instance.contextTypes) {
                error("contextTypes was defined as an instance property on %s. Use a static property to define contextTypes instead.", name2);
              }
              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.", name2);
              }
            }
            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.", name2);
            }
            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.", getComponentNameFromType(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()?", name2);
            }
            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().", name2);
            }
            if (typeof instance.componentWillRecieveProps === "function") {
              error("%s has a method called componentWillRecieveProps(). Did you mean componentWillReceiveProps()?", name2);
            }
            if (typeof instance.UNSAFE_componentWillRecieveProps === "function") {
              error("%s has a method called UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?", name2);
            }
            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.", name2, name2);
            }
            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.", name2, name2);
            }
            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.", getComponentNameFromType(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.", name2);
            }
            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.", name2);
            }
            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.", name2);
            }
            var _state = instance.state;
            if (_state && (typeof _state !== "object" || isArray2(_state))) {
              error("%s.state: must be set to an object or null", name2);
            }
            if (typeof instance.getChildContext === "function" && typeof ctor.childContextTypes !== "object") {
              error("%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().", name2);
            }
          }
        }
        function adoptClassInstance(workInProgress2, instance) {
          instance.updater = classComponentUpdater;
          workInProgress2.stateNode = instance;
          set3(instance, workInProgress2);
          {
            instance._reactInternalInstance = fakeInternalInstance;
          }
        }
        function constructClassInstance(workInProgress2, ctor, props) {
          var isLegacyContextConsumer = false;
          var unmaskedContext = emptyContextObject;
          var context2 = emptyContextObject;
          var contextType = ctor.contextType;
          {
            if ("contextType" in ctor) {
              var isValid = (
                // Allow null for conditional declaration
                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", getComponentNameFromType(ctor) || "Component", addendum);
              }
            }
          }
          if (typeof contextType === "object" && contextType !== null) {
            context2 = readContext(contextType);
          } else {
            unmaskedContext = getUnmaskedContext(workInProgress2, ctor, true);
            var contextTypes = ctor.contextTypes;
            isLegacyContextConsumer = contextTypes !== null && contextTypes !== void 0;
            context2 = isLegacyContextConsumer ? getMaskedContext(workInProgress2, unmaskedContext) : emptyContextObject;
          }
          var instance = new ctor(props, context2);
          {
            if (workInProgress2.mode & StrictLegacyMode) {
              setIsStrictModeForDevtools(true);
              try {
                instance = new ctor(props, context2);
              } finally {
                setIsStrictModeForDevtools(false);
              }
            }
          }
          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 = getComponentNameFromType(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 = getComponentNameFromType(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, context2);
          }
          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.", getComponentNameFromFiber(workInProgress2) || "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 = getComponentNameFromFiber(workInProgress2) || "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 = getComponentNameFromType(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 & StrictLegacyMode) {
              ReactStrictModeWarnings.recordLegacyContextWarning(workInProgress2, instance);
            }
            {
              ReactStrictModeWarnings.recordUnsafeLifecycleWarnings(workInProgress2, instance);
            }
          }
          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") {
            var fiberFlags = Update;
            {
              fiberFlags |= LayoutStatic;
            }
            if ((workInProgress2.mode & StrictEffectsMode) !== NoMode) {
              fiberFlags |= MountLayoutDev;
            }
            workInProgress2.flags |= fiberFlags;
          }
        }
        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") {
              var fiberFlags = Update;
              {
                fiberFlags |= LayoutStatic;
              }
              if ((workInProgress2.mode & StrictEffectsMode) !== NoMode) {
                fiberFlags |= MountLayoutDev;
              }
              workInProgress2.flags |= fiberFlags;
            }
            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") {
              var _fiberFlags = Update;
              {
                _fiberFlags |= LayoutStatic;
              }
              if ((workInProgress2.mode & StrictEffectsMode) !== NoMode) {
                _fiberFlags |= MountLayoutDev;
              }
              workInProgress2.flags |= _fiberFlags;
            }
          } else {
            if (typeof instance.componentDidMount === "function") {
              var _fiberFlags2 = Update;
              {
                _fiberFlags2 |= LayoutStatic;
              }
              if ((workInProgress2.mode & StrictEffectsMode) !== NoMode) {
                _fiberFlags2 |= MountLayoutDev;
              }
              workInProgress2.flags |= _fiberFlags2;
            }
            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() && !enableLazyContextPropagation) {
            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) || // TODO: In some cases, we'll end up checking if context has changed twice,
          // both before and after `shouldComponentUpdate` has been called. Not ideal,
          // but I'm loath to refactor this function. This only happens for memoized
          // components so it's not that common.
          enableLazyContextPropagation;
          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 new 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 = getComponentNameFromFiber(returnFiber) || "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.');
          };
        }
        function coerceRef(returnFiber, current2, element2) {
          var mixedRef = element2.ref;
          if (mixedRef !== null && typeof mixedRef !== "function" && typeof mixedRef !== "object") {
            {
              if ((returnFiber.mode & StrictLegacyMode || warnAboutStringRefs) && // We warn in ReactElement.js if owner and self are equal for string refs
              // because these cannot be automatically converted to an arrow function
              // using a codemod. Therefore, we don't have to warn about string refs again.
              !(element2._owner && element2._self && element2._owner.stateNode !== element2._self)) {
                var componentName = getComponentNameFromFiber(returnFiber) || "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 (element2._owner) {
              var owner = element2._owner;
              var inst;
              if (owner) {
                var ownerFiber = owner;
                if (ownerFiber.tag !== ClassComponent) {
                  throw new 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 new Error("Missing owner for string ref " + mixedRef + ". This error is likely caused by a bug in React. Please file an issue.");
              }
              var resolvedInst = inst;
              {
                checkPropStringCoercion(mixedRef, "ref");
              }
              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 = resolvedInst.refs;
                if (refs === emptyRefsObject) {
                  refs = resolvedInst.refs = {};
                }
                if (value === null) {
                  delete refs[stringRef];
                } else {
                  refs[stringRef] = value;
                }
              };
              ref._stringRef = stringRef;
              return ref;
            } else {
              if (typeof mixedRef !== "string") {
                throw new Error("Expected ref to be a function, a string, an object returned by React.createRef(), or null.");
              }
              if (!element2._owner) {
                throw new 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) {
          var childString = Object.prototype.toString.call(newChild);
          throw new Error("Objects are not valid as a React child (found: " + (childString === "[object Object]" ? "object with keys {" + Object.keys(newChild).join(", ") + "}" : childString) + "). If you meant to render a collection of children, use an array instead.");
        }
        function warnOnFunctionType(returnFiber) {
          {
            var componentName = getComponentNameFromFiber(returnFiber) || "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 resolveLazy(lazyType) {
          var payload = lazyType._payload;
          var init = lazyType._init;
          return init(payload);
        }
        function ChildReconciler(shouldTrackSideEffects) {
          function deleteChild(returnFiber, childToDelete) {
            if (!shouldTrackSideEffects) {
              return;
            }
            var deletions = returnFiber.deletions;
            if (deletions === null) {
              returnFiber.deletions = [childToDelete];
              returnFiber.flags |= ChildDeletion;
            } else {
              deletions.push(childToDelete);
            }
          }
          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) {
              newFiber.flags |= Forked;
              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, element2, lanes) {
            var elementType = element2.type;
            if (elementType === REACT_FRAGMENT_TYPE) {
              return updateFragment2(returnFiber, current2, element2.props.children, lanes, element2.key);
            }
            if (current2 !== null) {
              if (current2.elementType === elementType || // Keep this check inline so it only runs on the false path:
              isCompatibleFamilyForHotReloading(current2, element2) || // Lazy types should reconcile their resolved type.
              // We need to do this after the Hot Reloading check above,
              // because hot reloading has different semantics than prod because
              // it doesn't resuspend. So we can't let the call below suspend.
              typeof elementType === "object" && elementType !== null && elementType.$$typeof === REACT_LAZY_TYPE && resolveLazy(elementType) === current2.type) {
                var existing = useFiber(current2, element2.props);
                existing.ref = coerceRef(returnFiber, current2, element2);
                existing.return = returnFiber;
                {
                  existing._debugSource = element2._source;
                  existing._debugOwner = element2._owner;
                }
                return existing;
              }
            }
            var created = createFiberFromElement(element2, returnFiber.mode, lanes);
            created.ref = coerceRef(returnFiber, current2, element2);
            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, fragment2, lanes, key) {
            if (current2 === null || current2.tag !== Fragment9) {
              var created = createFiberFromFragment(fragment2, returnFiber.mode, lanes, key);
              created.return = returnFiber;
              return created;
            } else {
              var existing = useFiber(current2, fragment2);
              existing.return = returnFiber;
              return existing;
            }
          }
          function createChild(returnFiber, newChild, lanes) {
            if (typeof newChild === "string" && newChild !== "" || 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;
                }
                case REACT_LAZY_TYPE: {
                  var payload = newChild._payload;
                  var init = newChild._init;
                  return createChild(returnFiber, init(payload), lanes);
                }
              }
              if (isArray2(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 key = oldFiber !== null ? oldFiber.key : null;
            if (typeof newChild === "string" && newChild !== "" || typeof newChild === "number") {
              if (key !== 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 === key) {
                    return updateElement(returnFiber, oldFiber, newChild, lanes);
                  } else {
                    return null;
                  }
                }
                case REACT_PORTAL_TYPE: {
                  if (newChild.key === key) {
                    return updatePortal(returnFiber, oldFiber, newChild, lanes);
                  } else {
                    return null;
                  }
                }
                case REACT_LAZY_TYPE: {
                  var payload = newChild._payload;
                  var init = newChild._init;
                  return updateSlot(returnFiber, oldFiber, init(payload), lanes);
                }
              }
              if (isArray2(newChild) || getIteratorFn(newChild)) {
                if (key !== 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" && newChild !== "" || 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;
                  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);
                }
                case REACT_LAZY_TYPE:
                  var payload = newChild._payload;
                  var init = newChild._init;
                  return updateFromMap(existingChildren, returnFiber, newIdx, init(payload), lanes);
              }
              if (isArray2(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 key = child.key;
                  if (typeof key !== "string") {
                    break;
                  }
                  if (knownKeys === null) {
                    knownKeys = /* @__PURE__ */ new Set();
                    knownKeys.add(key);
                    break;
                  }
                  if (!knownKeys.has(key)) {
                    knownKeys.add(key);
                    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.", key);
                  break;
                case REACT_LAZY_TYPE:
                  var payload = child._payload;
                  var init = child._init;
                  warnOnInvalidKey(init(payload), knownKeys, returnFiber);
                  break;
              }
            }
            return knownKeys;
          }
          function reconcileChildrenArray(returnFiber, currentFirstChild, newChildren, lanes) {
            {
              var knownKeys = null;
              for (var i2 = 0; i2 < newChildren.length; i2++) {
                var child = newChildren[i2];
                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);
              if (getIsHydrating()) {
                var numberOfForks = newIdx;
                pushTreeFork(returnFiber, numberOfForks);
              }
              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;
              }
              if (getIsHydrating()) {
                var _numberOfForks = newIdx;
                pushTreeFork(returnFiber, _numberOfForks);
              }
              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);
              });
            }
            if (getIsHydrating()) {
              var _numberOfForks2 = newIdx;
              pushTreeFork(returnFiber, _numberOfForks2);
            }
            return resultingFirstChild;
          }
          function reconcileChildrenIterator(returnFiber, currentFirstChild, newChildrenIterable, lanes) {
            var iteratorFn = getIteratorFn(newChildrenIterable);
            if (typeof iteratorFn !== "function") {
              throw new 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" && // $FlowFixMe Flow doesn't know about toStringTag
              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 new 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);
              if (getIsHydrating()) {
                var numberOfForks = newIdx;
                pushTreeFork(returnFiber, numberOfForks);
              }
              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;
              }
              if (getIsHydrating()) {
                var _numberOfForks3 = newIdx;
                pushTreeFork(returnFiber, _numberOfForks3);
              }
              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);
              });
            }
            if (getIsHydrating()) {
              var _numberOfForks4 = newIdx;
              pushTreeFork(returnFiber, _numberOfForks4);
            }
            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, element2, lanes) {
            var key = element2.key;
            var child = currentFirstChild;
            while (child !== null) {
              if (child.key === key) {
                var elementType = element2.type;
                if (elementType === REACT_FRAGMENT_TYPE) {
                  if (child.tag === Fragment9) {
                    deleteRemainingChildren(returnFiber, child.sibling);
                    var existing = useFiber(child, element2.props.children);
                    existing.return = returnFiber;
                    {
                      existing._debugSource = element2._source;
                      existing._debugOwner = element2._owner;
                    }
                    return existing;
                  }
                } else {
                  if (child.elementType === elementType || // Keep this check inline so it only runs on the false path:
                  isCompatibleFamilyForHotReloading(child, element2) || // Lazy types should reconcile their resolved type.
                  // We need to do this after the Hot Reloading check above,
                  // because hot reloading has different semantics than prod because
                  // it doesn't resuspend. So we can't let the call below suspend.
                  typeof elementType === "object" && elementType !== null && elementType.$$typeof === REACT_LAZY_TYPE && resolveLazy(elementType) === child.type) {
                    deleteRemainingChildren(returnFiber, child.sibling);
                    var _existing = useFiber(child, element2.props);
                    _existing.ref = coerceRef(returnFiber, child, element2);
                    _existing.return = returnFiber;
                    {
                      _existing._debugSource = element2._source;
                      _existing._debugOwner = element2._owner;
                    }
                    return _existing;
                  }
                }
                deleteRemainingChildren(returnFiber, child);
                break;
              } else {
                deleteChild(returnFiber, child);
              }
              child = child.sibling;
            }
            if (element2.type === REACT_FRAGMENT_TYPE) {
              var created = createFiberFromFragment(element2.props.children, returnFiber.mode, lanes, element2.key);
              created.return = returnFiber;
              return created;
            } else {
              var _created4 = createFiberFromElement(element2, returnFiber.mode, lanes);
              _created4.ref = coerceRef(returnFiber, currentFirstChild, element2);
              _created4.return = returnFiber;
              return _created4;
            }
          }
          function reconcileSinglePortal(returnFiber, currentFirstChild, portal, lanes) {
            var key = portal.key;
            var child = currentFirstChild;
            while (child !== null) {
              if (child.key === key) {
                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;
            }
            if (typeof newChild === "object" && newChild !== null) {
              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));
                case REACT_LAZY_TYPE:
                  var payload = newChild._payload;
                  var init = newChild._init;
                  return reconcileChildFibers2(returnFiber, currentFirstChild, init(payload), lanes);
              }
              if (isArray2(newChild)) {
                return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, lanes);
              }
              if (getIteratorFn(newChild)) {
                return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, lanes);
              }
              throwOnInvalidObjectType(returnFiber, newChild);
            }
            if (typeof newChild === "string" && newChild !== "" || typeof newChild === "number") {
              return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, "" + newChild, lanes));
            }
            {
              if (typeof newChild === "function") {
                warnOnFunctionType(returnFiber);
              }
            }
            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 new 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(c4) {
          if (c4 === NO_CONTEXT) {
            throw new Error("Expected host context to exist. This error is likely caused by a bug in React. Please file an issue.");
          }
          return c4;
        }
        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 context2 = requiredContext(contextStackCursor$1.current);
          return context2;
        }
        function pushHostContext(fiber) {
          var rootInstance = requiredContext(rootInstanceStackCursor.current);
          var context2 = requiredContext(contextStackCursor$1.current);
          var nextContext = getChildHostContext(context2, fiber.type);
          if (context2 === 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;
          {
            return true;
          }
        }
        function findFirstSuspended(row) {
          var node56 = row;
          while (node56 !== null) {
            if (node56.tag === SuspenseComponent) {
              var state = node56.memoizedState;
              if (state !== null) {
                var dehydrated = state.dehydrated;
                if (dehydrated === null || isSuspenseInstancePending(dehydrated) || isSuspenseInstanceFallback(dehydrated)) {
                  return node56;
                }
              }
            } else if (node56.tag === SuspenseListComponent && // revealOrder undefined can't be trusted because it don't
            // keep track of whether it suspended or not.
            node56.memoizedProps.revealOrder !== void 0) {
              var didSuspend = (node56.flags & DidCapture) !== NoFlags;
              if (didSuspend) {
                return node56;
              }
            } else if (node56.child !== null) {
              node56.child.return = node56;
              node56 = node56.child;
              continue;
            }
            if (node56 === row) {
              return null;
            }
            while (node56.sibling === null) {
              if (node56.return === null || node56.return === row) {
                return null;
              }
              node56 = node56.return;
            }
            node56.sibling.return = node56.return;
            node56 = node56.sibling;
          }
          return null;
        }
        var NoFlags$1 = (
          /*   */
          0
        );
        var HasEffect = (
          /* */
          1
        );
        var Insertion5 = (
          /*  */
          2
        );
        var Layout2 = (
          /*    */
          4
        );
        var Passive$1 = (
          /*   */
          8
        );
        var workInProgressSources = [];
        function resetWorkInProgressVersions() {
          for (var i2 = 0; i2 < workInProgressSources.length; i2++) {
            var mutableSource = workInProgressSources[i2];
            {
              mutableSource._workInProgressVersionPrimary = null;
            }
          }
          workInProgressSources.length = 0;
        }
        function registerMutableSourceForHydration(root3, mutableSource) {
          var getVersion = mutableSource._getVersion;
          var version = getVersion(mutableSource._source);
          if (root3.mutableSourceEagerHydrationData == null) {
            root3.mutableSourceEagerHydrationData = [mutableSource, version];
          } else {
            root3.mutableSourceEagerHydrationData.push(mutableSource, version);
          }
        }
        var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher, ReactCurrentBatchConfig$2 = ReactSharedInternals.ReactCurrentBatchConfig;
        var didWarnAboutMismatchedHooksForComponent;
        var didWarnUncachedGetSnapshot;
        {
          didWarnAboutMismatchedHooksForComponent = /* @__PURE__ */ new Set();
        }
        var renderLanes = NoLanes;
        var currentlyRenderingFiber$1 = null;
        var currentHook = null;
        var workInProgressHook = null;
        var didScheduleRenderPhaseUpdate = false;
        var didScheduleRenderPhaseUpdateDuringThisPass = false;
        var localIdCounter = 0;
        var globalClientIdCounter = 0;
        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 && !isArray2(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 = getComponentNameFromFiber(currentlyRenderingFiber$1);
            if (!didWarnAboutMismatchedHooksForComponent.has(componentName)) {
              didWarnAboutMismatchedHooksForComponent.add(componentName);
              if (hookTypesDev !== null) {
                var table = "";
                var secondColumnStart = 30;
                for (var i2 = 0; i2 <= hookTypesUpdateIndexDev; i2++) {
                  var oldHookName = hookTypesDev[i2];
                  var newHookName = i2 === hookTypesUpdateIndexDev ? currentHookName : oldHookName;
                  var row = i2 + 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 new 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 i2 = 0; i2 < prevDeps.length && i2 < nextDeps.length; i2++) {
            if (objectIs(nextDeps[i2], prevDeps[i2])) {
              continue;
            }
            return false;
          }
          return true;
        }
        function renderWithHooks(current2, workInProgress2, Component8, 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 = Component8(props, secondArg);
          if (didScheduleRenderPhaseUpdateDuringThisPass) {
            var numberOfReRenders = 0;
            do {
              didScheduleRenderPhaseUpdateDuringThisPass = false;
              localIdCounter = 0;
              if (numberOfReRenders >= RE_RENDER_LIMIT) {
                throw new 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 = Component8(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;
            if (current2 !== null && (current2.flags & StaticMask) !== (workInProgress2.flags & StaticMask) && // Disable this warning in legacy mode, because legacy Suspense is weird
            // and creates false positives. To make this work in legacy mode, we'd
            // need to mark fibers that commit in an incomplete state, somehow. For
            // now I'll disable the warning that most of the bugs that would trigger
            // it are either exclusive to concurrent mode or exist in both.
            (current2.mode & ConcurrentMode) !== NoMode) {
              error("Internal React error: Expected static flag was missing. Please notify the React team.");
            }
          }
          didScheduleRenderPhaseUpdate = false;
          if (didRenderTooFewHooks) {
            throw new Error("Rendered fewer hooks than expected. This may be caused by an accidental early return statement.");
          }
          return children;
        }
        function checkDidRenderIdHook() {
          var didRenderIdHook = localIdCounter !== 0;
          localIdCounter = 0;
          return didRenderIdHook;
        }
        function bailoutHooks(current2, workInProgress2, lanes) {
          workInProgress2.updateQueue = current2.updateQueue;
          if ((workInProgress2.mode & StrictEffectsMode) !== NoMode) {
            workInProgress2.flags &= ~(MountPassiveDev | MountLayoutDev | Passive | Update);
          } else {
            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;
          localIdCounter = 0;
        }
        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 new 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,
            stores: 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 = {
            pending: null,
            interleaved: null,
            lanes: NoLanes,
            dispatch: null,
            lastRenderedReducer: reducer,
            lastRenderedState: initialState
          };
          hook.queue = queue;
          var dispatch = queue.dispatch = dispatchReducerAction.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 new 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,
                  hasEagerState: update.hasEagerState,
                  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 = {
                    // This update is going to be committed so we never want uncommit
                    // it. Using NoLane works because 0 is a subset of all bitmasks, so
                    // this will never be skipped by the check above.
                    lane: NoLane,
                    action: update.action,
                    hasEagerState: update.hasEagerState,
                    eagerState: update.eagerState,
                    next: null
                  };
                  newBaseQueueLast = newBaseQueueLast.next = _clone;
                }
                if (update.hasEagerState) {
                  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 lastInterleaved = queue.interleaved;
          if (lastInterleaved !== null) {
            var interleaved = lastInterleaved;
            do {
              var interleavedLane = interleaved.lane;
              currentlyRenderingFiber$1.lanes = mergeLanes(currentlyRenderingFiber$1.lanes, interleavedLane);
              markSkippedUpdateLanes(interleavedLane);
              interleaved = interleaved.next;
            } while (interleaved !== lastInterleaved);
          } else if (baseQueue === null) {
            queue.lanes = NoLanes;
          }
          var dispatch = queue.dispatch;
          return [hook.memoizedState, dispatch];
        }
        function rerenderReducer(reducer, initialArg, init) {
          var hook = updateWorkInProgressHook();
          var queue = hook.queue;
          if (queue === null) {
            throw new 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 mountMutableSource(source, getSnapshot, subscribe) {
          {
            return void 0;
          }
        }
        function updateMutableSource(source, getSnapshot, subscribe) {
          {
            return void 0;
          }
        }
        function mountSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {
          var fiber = currentlyRenderingFiber$1;
          var hook = mountWorkInProgressHook();
          var nextSnapshot;
          var isHydrating2 = getIsHydrating();
          if (isHydrating2) {
            if (getServerSnapshot === void 0) {
              throw new Error("Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering.");
            }
            nextSnapshot = getServerSnapshot();
            {
              if (!didWarnUncachedGetSnapshot) {
                if (nextSnapshot !== getServerSnapshot()) {
                  error("The result of getServerSnapshot should be cached to avoid an infinite loop");
                  didWarnUncachedGetSnapshot = true;
                }
              }
            }
          } else {
            nextSnapshot = getSnapshot();
            {
              if (!didWarnUncachedGetSnapshot) {
                var cachedSnapshot = getSnapshot();
                if (!objectIs(nextSnapshot, cachedSnapshot)) {
                  error("The result of getSnapshot should be cached to avoid an infinite loop");
                  didWarnUncachedGetSnapshot = true;
                }
              }
            }
            var root3 = getWorkInProgressRoot();
            if (root3 === null) {
              throw new Error("Expected a work-in-progress root. This is a bug in React. Please file an issue.");
            }
            if (!includesBlockingLane(root3, renderLanes)) {
              pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot);
            }
          }
          hook.memoizedState = nextSnapshot;
          var inst = {
            value: nextSnapshot,
            getSnapshot
          };
          hook.queue = inst;
          mountEffect(subscribeToStore.bind(null, fiber, inst, subscribe), [subscribe]);
          fiber.flags |= Passive;
          pushEffect(HasEffect | Passive$1, updateStoreInstance.bind(null, fiber, inst, nextSnapshot, getSnapshot), void 0, null);
          return nextSnapshot;
        }
        function updateSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {
          var fiber = currentlyRenderingFiber$1;
          var hook = updateWorkInProgressHook();
          var nextSnapshot = getSnapshot();
          {
            if (!didWarnUncachedGetSnapshot) {
              var cachedSnapshot = getSnapshot();
              if (!objectIs(nextSnapshot, cachedSnapshot)) {
                error("The result of getSnapshot should be cached to avoid an infinite loop");
                didWarnUncachedGetSnapshot = true;
              }
            }
          }
          var prevSnapshot = hook.memoizedState;
          var snapshotChanged = !objectIs(prevSnapshot, nextSnapshot);
          if (snapshotChanged) {
            hook.memoizedState = nextSnapshot;
            markWorkInProgressReceivedUpdate();
          }
          var inst = hook.queue;
          updateEffect(subscribeToStore.bind(null, fiber, inst, subscribe), [subscribe]);
          if (inst.getSnapshot !== getSnapshot || snapshotChanged || // Check if the susbcribe function changed. We can save some memory by
          // checking whether we scheduled a subscription effect above.
          workInProgressHook !== null && workInProgressHook.memoizedState.tag & HasEffect) {
            fiber.flags |= Passive;
            pushEffect(HasEffect | Passive$1, updateStoreInstance.bind(null, fiber, inst, nextSnapshot, getSnapshot), void 0, null);
            var root3 = getWorkInProgressRoot();
            if (root3 === null) {
              throw new Error("Expected a work-in-progress root. This is a bug in React. Please file an issue.");
            }
            if (!includesBlockingLane(root3, renderLanes)) {
              pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot);
            }
          }
          return nextSnapshot;
        }
        function pushStoreConsistencyCheck(fiber, getSnapshot, renderedSnapshot) {
          fiber.flags |= StoreConsistency;
          var check = {
            getSnapshot,
            value: renderedSnapshot
          };
          var componentUpdateQueue = currentlyRenderingFiber$1.updateQueue;
          if (componentUpdateQueue === null) {
            componentUpdateQueue = createFunctionComponentUpdateQueue();
            currentlyRenderingFiber$1.updateQueue = componentUpdateQueue;
            componentUpdateQueue.stores = [check];
          } else {
            var stores = componentUpdateQueue.stores;
            if (stores === null) {
              componentUpdateQueue.stores = [check];
            } else {
              stores.push(check);
            }
          }
        }
        function updateStoreInstance(fiber, inst, nextSnapshot, getSnapshot) {
          inst.value = nextSnapshot;
          inst.getSnapshot = getSnapshot;
          if (checkIfSnapshotChanged(inst)) {
            forceStoreRerender(fiber);
          }
        }
        function subscribeToStore(fiber, inst, subscribe) {
          var handleStoreChange = function() {
            if (checkIfSnapshotChanged(inst)) {
              forceStoreRerender(fiber);
            }
          };
          return subscribe(handleStoreChange);
        }
        function checkIfSnapshotChanged(inst) {
          var latestGetSnapshot = inst.getSnapshot;
          var prevValue = inst.value;
          try {
            var nextValue = latestGetSnapshot();
            return !objectIs(prevValue, nextValue);
          } catch (error2) {
            return true;
          }
        }
        function forceStoreRerender(fiber) {
          var root3 = enqueueConcurrentRenderForLane(fiber, SyncLane);
          if (root3 !== null) {
            scheduleUpdateOnFiber(root3, fiber, SyncLane, NoTimestamp);
          }
        }
        function mountState(initialState) {
          var hook = mountWorkInProgressHook();
          if (typeof initialState === "function") {
            initialState = initialState();
          }
          hook.memoizedState = hook.baseState = initialState;
          var queue = {
            pending: null,
            interleaved: null,
            lanes: NoLanes,
            dispatch: null,
            lastRenderedReducer: basicStateReducer,
            lastRenderedState: initialState
          };
          hook.queue = queue;
          var dispatch = queue.dispatch = dispatchSetState.bind(null, currentlyRenderingFiber$1, queue);
          return [hook.memoizedState, dispatch];
        }
        function updateState(initialState) {
          return updateReducer(basicStateReducer);
        }
        function rerenderState(initialState) {
          return rerenderReducer(basicStateReducer);
        }
        function pushEffect(tag, create4, destroy, deps) {
          var effect = {
            tag,
            create: create4,
            destroy,
            deps,
            // Circular
            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 _ref22 = {
              current: initialValue
            };
            hook.memoizedState = _ref22;
            return _ref22;
          }
        }
        function updateRef(initialValue) {
          var hook = updateWorkInProgressHook();
          return hook.memoizedState;
        }
        function mountEffectImpl(fiberFlags, hookFlags, create4, deps) {
          var hook = mountWorkInProgressHook();
          var nextDeps = deps === void 0 ? null : deps;
          currentlyRenderingFiber$1.flags |= fiberFlags;
          hook.memoizedState = pushEffect(HasEffect | hookFlags, create4, void 0, nextDeps);
        }
        function updateEffectImpl(fiberFlags, hookFlags, create4, 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)) {
                hook.memoizedState = pushEffect(hookFlags, create4, destroy, nextDeps);
                return;
              }
            }
          }
          currentlyRenderingFiber$1.flags |= fiberFlags;
          hook.memoizedState = pushEffect(HasEffect | hookFlags, create4, destroy, nextDeps);
        }
        function mountEffect(create4, deps) {
          if ((currentlyRenderingFiber$1.mode & StrictEffectsMode) !== NoMode) {
            return mountEffectImpl(MountPassiveDev | Passive | PassiveStatic, Passive$1, create4, deps);
          } else {
            return mountEffectImpl(Passive | PassiveStatic, Passive$1, create4, deps);
          }
        }
        function updateEffect(create4, deps) {
          return updateEffectImpl(Passive, Passive$1, create4, deps);
        }
        function mountInsertionEffect(create4, deps) {
          return mountEffectImpl(Update, Insertion5, create4, deps);
        }
        function updateInsertionEffect(create4, deps) {
          return updateEffectImpl(Update, Insertion5, create4, deps);
        }
        function mountLayoutEffect(create4, deps) {
          var fiberFlags = Update;
          {
            fiberFlags |= LayoutStatic;
          }
          if ((currentlyRenderingFiber$1.mode & StrictEffectsMode) !== NoMode) {
            fiberFlags |= MountLayoutDev;
          }
          return mountEffectImpl(fiberFlags, Layout2, create4, deps);
        }
        function updateLayoutEffect(create4, deps) {
          return updateEffectImpl(Update, Layout2, create4, deps);
        }
        function imperativeHandleEffect(create4, ref) {
          if (typeof ref === "function") {
            var refCallback = ref;
            var _inst = create4();
            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 = create4();
            refObject.current = _inst2;
            return function() {
              refObject.current = null;
            };
          }
        }
        function mountImperativeHandle(ref, create4, deps) {
          {
            if (typeof create4 !== "function") {
              error("Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.", create4 !== null ? typeof create4 : "null");
            }
          }
          var effectDeps = deps !== null && deps !== void 0 ? deps.concat([ref]) : null;
          var fiberFlags = Update;
          {
            fiberFlags |= LayoutStatic;
          }
          if ((currentlyRenderingFiber$1.mode & StrictEffectsMode) !== NoMode) {
            fiberFlags |= MountLayoutDev;
          }
          return mountEffectImpl(fiberFlags, Layout2, imperativeHandleEffect.bind(null, create4, ref), effectDeps);
        }
        function updateImperativeHandle(ref, create4, deps) {
          {
            if (typeof create4 !== "function") {
              error("Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.", create4 !== null ? typeof create4 : "null");
            }
          }
          var effectDeps = deps !== null && deps !== void 0 ? deps.concat([ref]) : null;
          return updateEffectImpl(Update, Layout2, imperativeHandleEffect.bind(null, create4, 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 hook = mountWorkInProgressHook();
          hook.memoizedState = value;
          return value;
        }
        function updateDeferredValue(value) {
          var hook = updateWorkInProgressHook();
          var resolvedCurrentHook = currentHook;
          var prevValue = resolvedCurrentHook.memoizedState;
          return updateDeferredValueImpl(hook, prevValue, value);
        }
        function rerenderDeferredValue(value) {
          var hook = updateWorkInProgressHook();
          if (currentHook === null) {
            hook.memoizedState = value;
            return value;
          } else {
            var prevValue = currentHook.memoizedState;
            return updateDeferredValueImpl(hook, prevValue, value);
          }
        }
        function updateDeferredValueImpl(hook, prevValue, value) {
          var shouldDeferValue = !includesOnlyNonUrgentLanes(renderLanes);
          if (shouldDeferValue) {
            if (!objectIs(value, prevValue)) {
              var deferredLane = claimNextTransitionLane();
              currentlyRenderingFiber$1.lanes = mergeLanes(currentlyRenderingFiber$1.lanes, deferredLane);
              markSkippedUpdateLanes(deferredLane);
              hook.baseState = true;
            }
            return prevValue;
          } else {
            if (hook.baseState) {
              hook.baseState = false;
              markWorkInProgressReceivedUpdate();
            }
            hook.memoizedState = value;
            return value;
          }
        }
        function startTransition13(setPending, callback, options2) {
          var previousPriority = getCurrentUpdatePriority();
          setCurrentUpdatePriority(higherEventPriority(previousPriority, ContinuousEventPriority2));
          setPending(true);
          var prevTransition = ReactCurrentBatchConfig$2.transition;
          ReactCurrentBatchConfig$2.transition = {};
          var currentTransition = ReactCurrentBatchConfig$2.transition;
          {
            ReactCurrentBatchConfig$2.transition._updatedFibers = /* @__PURE__ */ new Set();
          }
          try {
            setPending(false);
            callback();
          } finally {
            setCurrentUpdatePriority(previousPriority);
            ReactCurrentBatchConfig$2.transition = prevTransition;
            {
              if (prevTransition === null && currentTransition._updatedFibers) {
                var updatedFibersCount = currentTransition._updatedFibers.size;
                if (updatedFibersCount > 10) {
                  warn5("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table.");
                }
                currentTransition._updatedFibers.clear();
              }
            }
          }
        }
        function mountTransition() {
          var _mountState = mountState(false), isPending = _mountState[0], setPending = _mountState[1];
          var start = startTransition13.bind(null, setPending);
          var hook = mountWorkInProgressHook();
          hook.memoizedState = start;
          return [isPending, start];
        }
        function updateTransition() {
          var _updateState = updateState(), isPending = _updateState[0];
          var hook = updateWorkInProgressHook();
          var start = hook.memoizedState;
          return [isPending, start];
        }
        function rerenderTransition() {
          var _rerenderState = rerenderState(), isPending = _rerenderState[0];
          var hook = updateWorkInProgressHook();
          var start = hook.memoizedState;
          return [isPending, start];
        }
        var isUpdatingOpaqueValueInRenderPhase = false;
        function getIsUpdatingOpaqueValueInRenderPhaseInDEV() {
          {
            return isUpdatingOpaqueValueInRenderPhase;
          }
        }
        function mountId() {
          var hook = mountWorkInProgressHook();
          var root3 = getWorkInProgressRoot();
          var identifierPrefix = root3.identifierPrefix;
          var id2;
          if (getIsHydrating()) {
            var treeId = getTreeId();
            id2 = ":" + identifierPrefix + "R" + treeId;
            var localId = localIdCounter++;
            if (localId > 0) {
              id2 += "H" + localId.toString(32);
            }
            id2 += ":";
          } else {
            var globalClientId = globalClientIdCounter++;
            id2 = ":" + identifierPrefix + "r" + globalClientId.toString(32) + ":";
          }
          hook.memoizedState = id2;
          return id2;
        }
        function updateId() {
          var hook = updateWorkInProgressHook();
          var id2 = hook.memoizedState;
          return id2;
        }
        function dispatchReducerAction(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 lane = requestUpdateLane(fiber);
          var update = {
            lane,
            action,
            hasEagerState: false,
            eagerState: null,
            next: null
          };
          if (isRenderPhaseUpdate(fiber)) {
            enqueueRenderPhaseUpdate(queue, update);
          } else {
            var root3 = enqueueConcurrentHookUpdate(fiber, queue, update, lane);
            if (root3 !== null) {
              var eventTime = requestEventTime();
              scheduleUpdateOnFiber(root3, fiber, lane, eventTime);
              entangleTransitionUpdate(root3, queue, lane);
            }
          }
          markUpdateInDevTools(fiber, lane);
        }
        function dispatchSetState(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 lane = requestUpdateLane(fiber);
          var update = {
            lane,
            action,
            hasEagerState: false,
            eagerState: null,
            next: null
          };
          if (isRenderPhaseUpdate(fiber)) {
            enqueueRenderPhaseUpdate(queue, update);
          } else {
            var alternate = fiber.alternate;
            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 currentState2 = queue.lastRenderedState;
                  var eagerState = lastRenderedReducer(currentState2, action);
                  update.hasEagerState = true;
                  update.eagerState = eagerState;
                  if (objectIs(eagerState, currentState2)) {
                    enqueueConcurrentHookUpdateAndEagerlyBailout(fiber, queue, update, lane);
                    return;
                  }
                } catch (error2) {
                } finally {
                  {
                    ReactCurrentDispatcher$1.current = prevDispatcher;
                  }
                }
              }
            }
            var root3 = enqueueConcurrentHookUpdate(fiber, queue, update, lane);
            if (root3 !== null) {
              var eventTime = requestEventTime();
              scheduleUpdateOnFiber(root3, fiber, lane, eventTime);
              entangleTransitionUpdate(root3, queue, lane);
            }
          }
          markUpdateInDevTools(fiber, lane);
        }
        function isRenderPhaseUpdate(fiber) {
          var alternate = fiber.alternate;
          return fiber === currentlyRenderingFiber$1 || alternate !== null && alternate === currentlyRenderingFiber$1;
        }
        function enqueueRenderPhaseUpdate(queue, update) {
          didScheduleRenderPhaseUpdateDuringThisPass = didScheduleRenderPhaseUpdate = true;
          var pending = queue.pending;
          if (pending === null) {
            update.next = update;
          } else {
            update.next = pending.next;
            pending.next = update;
          }
          queue.pending = update;
        }
        function entangleTransitionUpdate(root3, queue, lane) {
          if (isTransitionLane(lane)) {
            var queueLanes = queue.lanes;
            queueLanes = intersectLanes(queueLanes, root3.pendingLanes);
            var newQueueLanes = mergeLanes(queueLanes, lane);
            queue.lanes = newQueueLanes;
            markRootEntangled(root3, newQueueLanes);
          }
        }
        function markUpdateInDevTools(fiber, lane, action) {
          {
            markStateUpdateScheduled(fiber, lane);
          }
        }
        var ContextOnlyDispatcher = {
          readContext,
          useCallback: throwInvalidHookError,
          useContext: throwInvalidHookError,
          useEffect: throwInvalidHookError,
          useImperativeHandle: throwInvalidHookError,
          useInsertionEffect: throwInvalidHookError,
          useLayoutEffect: throwInvalidHookError,
          useMemo: throwInvalidHookError,
          useReducer: throwInvalidHookError,
          useRef: throwInvalidHookError,
          useState: throwInvalidHookError,
          useDebugValue: throwInvalidHookError,
          useDeferredValue: throwInvalidHookError,
          useTransition: throwInvalidHookError,
          useMutableSource: throwInvalidHookError,
          useSyncExternalStore: throwInvalidHookError,
          useId: 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(context2) {
              return readContext(context2);
            },
            useCallback: function(callback, deps) {
              currentHookNameInDev = "useCallback";
              mountHookTypesDev();
              checkDepsAreArrayDev(deps);
              return mountCallback(callback, deps);
            },
            useContext: function(context2) {
              currentHookNameInDev = "useContext";
              mountHookTypesDev();
              return readContext(context2);
            },
            useEffect: function(create4, deps) {
              currentHookNameInDev = "useEffect";
              mountHookTypesDev();
              checkDepsAreArrayDev(deps);
              return mountEffect(create4, deps);
            },
            useImperativeHandle: function(ref, create4, deps) {
              currentHookNameInDev = "useImperativeHandle";
              mountHookTypesDev();
              checkDepsAreArrayDev(deps);
              return mountImperativeHandle(ref, create4, deps);
            },
            useInsertionEffect: function(create4, deps) {
              currentHookNameInDev = "useInsertionEffect";
              mountHookTypesDev();
              checkDepsAreArrayDev(deps);
              return mountInsertionEffect(create4, deps);
            },
            useLayoutEffect: function(create4, deps) {
              currentHookNameInDev = "useLayoutEffect";
              mountHookTypesDev();
              checkDepsAreArrayDev(deps);
              return mountLayoutEffect(create4, deps);
            },
            useMemo: function(create4, deps) {
              currentHookNameInDev = "useMemo";
              mountHookTypesDev();
              checkDepsAreArrayDev(deps);
              var prevDispatcher = ReactCurrentDispatcher$1.current;
              ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
              try {
                return mountMemo(create4, 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();
            },
            useSyncExternalStore: function(subscribe, getSnapshot, getServerSnapshot) {
              currentHookNameInDev = "useSyncExternalStore";
              mountHookTypesDev();
              return mountSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
            },
            useId: function() {
              currentHookNameInDev = "useId";
              mountHookTypesDev();
              return mountId();
            },
            unstable_isNewReconciler: enableNewReconciler
          };
          HooksDispatcherOnMountWithHookTypesInDEV = {
            readContext: function(context2) {
              return readContext(context2);
            },
            useCallback: function(callback, deps) {
              currentHookNameInDev = "useCallback";
              updateHookTypesDev();
              return mountCallback(callback, deps);
            },
            useContext: function(context2) {
              currentHookNameInDev = "useContext";
              updateHookTypesDev();
              return readContext(context2);
            },
            useEffect: function(create4, deps) {
              currentHookNameInDev = "useEffect";
              updateHookTypesDev();
              return mountEffect(create4, deps);
            },
            useImperativeHandle: function(ref, create4, deps) {
              currentHookNameInDev = "useImperativeHandle";
              updateHookTypesDev();
              return mountImperativeHandle(ref, create4, deps);
            },
            useInsertionEffect: function(create4, deps) {
              currentHookNameInDev = "useInsertionEffect";
              updateHookTypesDev();
              return mountInsertionEffect(create4, deps);
            },
            useLayoutEffect: function(create4, deps) {
              currentHookNameInDev = "useLayoutEffect";
              updateHookTypesDev();
              return mountLayoutEffect(create4, deps);
            },
            useMemo: function(create4, deps) {
              currentHookNameInDev = "useMemo";
              updateHookTypesDev();
              var prevDispatcher = ReactCurrentDispatcher$1.current;
              ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
              try {
                return mountMemo(create4, 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();
            },
            useSyncExternalStore: function(subscribe, getSnapshot, getServerSnapshot) {
              currentHookNameInDev = "useSyncExternalStore";
              updateHookTypesDev();
              return mountSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
            },
            useId: function() {
              currentHookNameInDev = "useId";
              updateHookTypesDev();
              return mountId();
            },
            unstable_isNewReconciler: enableNewReconciler
          };
          HooksDispatcherOnUpdateInDEV = {
            readContext: function(context2) {
              return readContext(context2);
            },
            useCallback: function(callback, deps) {
              currentHookNameInDev = "useCallback";
              updateHookTypesDev();
              return updateCallback(callback, deps);
            },
            useContext: function(context2) {
              currentHookNameInDev = "useContext";
              updateHookTypesDev();
              return readContext(context2);
            },
            useEffect: function(create4, deps) {
              currentHookNameInDev = "useEffect";
              updateHookTypesDev();
              return updateEffect(create4, deps);
            },
            useImperativeHandle: function(ref, create4, deps) {
              currentHookNameInDev = "useImperativeHandle";
              updateHookTypesDev();
              return updateImperativeHandle(ref, create4, deps);
            },
            useInsertionEffect: function(create4, deps) {
              currentHookNameInDev = "useInsertionEffect";
              updateHookTypesDev();
              return updateInsertionEffect(create4, deps);
            },
            useLayoutEffect: function(create4, deps) {
              currentHookNameInDev = "useLayoutEffect";
              updateHookTypesDev();
              return updateLayoutEffect(create4, deps);
            },
            useMemo: function(create4, deps) {
              currentHookNameInDev = "useMemo";
              updateHookTypesDev();
              var prevDispatcher = ReactCurrentDispatcher$1.current;
              ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
              try {
                return updateMemo(create4, 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();
            },
            useSyncExternalStore: function(subscribe, getSnapshot, getServerSnapshot) {
              currentHookNameInDev = "useSyncExternalStore";
              updateHookTypesDev();
              return updateSyncExternalStore(subscribe, getSnapshot);
            },
            useId: function() {
              currentHookNameInDev = "useId";
              updateHookTypesDev();
              return updateId();
            },
            unstable_isNewReconciler: enableNewReconciler
          };
          HooksDispatcherOnRerenderInDEV = {
            readContext: function(context2) {
              return readContext(context2);
            },
            useCallback: function(callback, deps) {
              currentHookNameInDev = "useCallback";
              updateHookTypesDev();
              return updateCallback(callback, deps);
            },
            useContext: function(context2) {
              currentHookNameInDev = "useContext";
              updateHookTypesDev();
              return readContext(context2);
            },
            useEffect: function(create4, deps) {
              currentHookNameInDev = "useEffect";
              updateHookTypesDev();
              return updateEffect(create4, deps);
            },
            useImperativeHandle: function(ref, create4, deps) {
              currentHookNameInDev = "useImperativeHandle";
              updateHookTypesDev();
              return updateImperativeHandle(ref, create4, deps);
            },
            useInsertionEffect: function(create4, deps) {
              currentHookNameInDev = "useInsertionEffect";
              updateHookTypesDev();
              return updateInsertionEffect(create4, deps);
            },
            useLayoutEffect: function(create4, deps) {
              currentHookNameInDev = "useLayoutEffect";
              updateHookTypesDev();
              return updateLayoutEffect(create4, deps);
            },
            useMemo: function(create4, deps) {
              currentHookNameInDev = "useMemo";
              updateHookTypesDev();
              var prevDispatcher = ReactCurrentDispatcher$1.current;
              ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnRerenderInDEV;
              try {
                return updateMemo(create4, 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();
            },
            useSyncExternalStore: function(subscribe, getSnapshot, getServerSnapshot) {
              currentHookNameInDev = "useSyncExternalStore";
              updateHookTypesDev();
              return updateSyncExternalStore(subscribe, getSnapshot);
            },
            useId: function() {
              currentHookNameInDev = "useId";
              updateHookTypesDev();
              return updateId();
            },
            unstable_isNewReconciler: enableNewReconciler
          };
          InvalidNestedHooksDispatcherOnMountInDEV = {
            readContext: function(context2) {
              warnInvalidContextAccess();
              return readContext(context2);
            },
            useCallback: function(callback, deps) {
              currentHookNameInDev = "useCallback";
              warnInvalidHookAccess();
              mountHookTypesDev();
              return mountCallback(callback, deps);
            },
            useContext: function(context2) {
              currentHookNameInDev = "useContext";
              warnInvalidHookAccess();
              mountHookTypesDev();
              return readContext(context2);
            },
            useEffect: function(create4, deps) {
              currentHookNameInDev = "useEffect";
              warnInvalidHookAccess();
              mountHookTypesDev();
              return mountEffect(create4, deps);
            },
            useImperativeHandle: function(ref, create4, deps) {
              currentHookNameInDev = "useImperativeHandle";
              warnInvalidHookAccess();
              mountHookTypesDev();
              return mountImperativeHandle(ref, create4, deps);
            },
            useInsertionEffect: function(create4, deps) {
              currentHookNameInDev = "useInsertionEffect";
              warnInvalidHookAccess();
              mountHookTypesDev();
              return mountInsertionEffect(create4, deps);
            },
            useLayoutEffect: function(create4, deps) {
              currentHookNameInDev = "useLayoutEffect";
              warnInvalidHookAccess();
              mountHookTypesDev();
              return mountLayoutEffect(create4, deps);
            },
            useMemo: function(create4, deps) {
              currentHookNameInDev = "useMemo";
              warnInvalidHookAccess();
              mountHookTypesDev();
              var prevDispatcher = ReactCurrentDispatcher$1.current;
              ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
              try {
                return mountMemo(create4, 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();
            },
            useSyncExternalStore: function(subscribe, getSnapshot, getServerSnapshot) {
              currentHookNameInDev = "useSyncExternalStore";
              warnInvalidHookAccess();
              mountHookTypesDev();
              return mountSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
            },
            useId: function() {
              currentHookNameInDev = "useId";
              warnInvalidHookAccess();
              mountHookTypesDev();
              return mountId();
            },
            unstable_isNewReconciler: enableNewReconciler
          };
          InvalidNestedHooksDispatcherOnUpdateInDEV = {
            readContext: function(context2) {
              warnInvalidContextAccess();
              return readContext(context2);
            },
            useCallback: function(callback, deps) {
              currentHookNameInDev = "useCallback";
              warnInvalidHookAccess();
              updateHookTypesDev();
              return updateCallback(callback, deps);
            },
            useContext: function(context2) {
              currentHookNameInDev = "useContext";
              warnInvalidHookAccess();
              updateHookTypesDev();
              return readContext(context2);
            },
            useEffect: function(create4, deps) {
              currentHookNameInDev = "useEffect";
              warnInvalidHookAccess();
              updateHookTypesDev();
              return updateEffect(create4, deps);
            },
            useImperativeHandle: function(ref, create4, deps) {
              currentHookNameInDev = "useImperativeHandle";
              warnInvalidHookAccess();
              updateHookTypesDev();
              return updateImperativeHandle(ref, create4, deps);
            },
            useInsertionEffect: function(create4, deps) {
              currentHookNameInDev = "useInsertionEffect";
              warnInvalidHookAccess();
              updateHookTypesDev();
              return updateInsertionEffect(create4, deps);
            },
            useLayoutEffect: function(create4, deps) {
              currentHookNameInDev = "useLayoutEffect";
              warnInvalidHookAccess();
              updateHookTypesDev();
              return updateLayoutEffect(create4, deps);
            },
            useMemo: function(create4, deps) {
              currentHookNameInDev = "useMemo";
              warnInvalidHookAccess();
              updateHookTypesDev();
              var prevDispatcher = ReactCurrentDispatcher$1.current;
              ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
              try {
                return updateMemo(create4, 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();
            },
            useSyncExternalStore: function(subscribe, getSnapshot, getServerSnapshot) {
              currentHookNameInDev = "useSyncExternalStore";
              warnInvalidHookAccess();
              updateHookTypesDev();
              return updateSyncExternalStore(subscribe, getSnapshot);
            },
            useId: function() {
              currentHookNameInDev = "useId";
              warnInvalidHookAccess();
              updateHookTypesDev();
              return updateId();
            },
            unstable_isNewReconciler: enableNewReconciler
          };
          InvalidNestedHooksDispatcherOnRerenderInDEV = {
            readContext: function(context2) {
              warnInvalidContextAccess();
              return readContext(context2);
            },
            useCallback: function(callback, deps) {
              currentHookNameInDev = "useCallback";
              warnInvalidHookAccess();
              updateHookTypesDev();
              return updateCallback(callback, deps);
            },
            useContext: function(context2) {
              currentHookNameInDev = "useContext";
              warnInvalidHookAccess();
              updateHookTypesDev();
              return readContext(context2);
            },
            useEffect: function(create4, deps) {
              currentHookNameInDev = "useEffect";
              warnInvalidHookAccess();
              updateHookTypesDev();
              return updateEffect(create4, deps);
            },
            useImperativeHandle: function(ref, create4, deps) {
              currentHookNameInDev = "useImperativeHandle";
              warnInvalidHookAccess();
              updateHookTypesDev();
              return updateImperativeHandle(ref, create4, deps);
            },
            useInsertionEffect: function(create4, deps) {
              currentHookNameInDev = "useInsertionEffect";
              warnInvalidHookAccess();
              updateHookTypesDev();
              return updateInsertionEffect(create4, deps);
            },
            useLayoutEffect: function(create4, deps) {
              currentHookNameInDev = "useLayoutEffect";
              warnInvalidHookAccess();
              updateHookTypesDev();
              return updateLayoutEffect(create4, deps);
            },
            useMemo: function(create4, deps) {
              currentHookNameInDev = "useMemo";
              warnInvalidHookAccess();
              updateHookTypesDev();
              var prevDispatcher = ReactCurrentDispatcher$1.current;
              ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
              try {
                return updateMemo(create4, 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();
            },
            useSyncExternalStore: function(subscribe, getSnapshot, getServerSnapshot) {
              currentHookNameInDev = "useSyncExternalStore";
              warnInvalidHookAccess();
              updateHookTypesDev();
              return updateSyncExternalStore(subscribe, getSnapshot);
            },
            useId: function() {
              currentHookNameInDev = "useId";
              warnInvalidHookAccess();
              updateHookTypesDev();
              return updateId();
            },
            unstable_isNewReconciler: enableNewReconciler
          };
        }
        var now$1 = Scheduler.unstable_now;
        var commitTime = 0;
        var layoutEffectStartTime = -1;
        var profilerStartTime = -1;
        var passiveEffectStartTime = -1;
        var currentUpdateIsNested = false;
        var nestedUpdateScheduled = false;
        function isCurrentUpdateNested() {
          return currentUpdateIsNested;
        }
        function markNestedUpdateScheduled() {
          {
            nestedUpdateScheduled = true;
          }
        }
        function resetNestedUpdateFlag() {
          {
            currentUpdateIsNested = false;
            nestedUpdateScheduled = false;
          }
        }
        function syncNestedUpdateFlag() {
          {
            currentUpdateIsNested = nestedUpdateScheduled;
            nestedUpdateScheduled = false;
          }
        }
        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 recordLayoutEffectDuration(fiber) {
          if (layoutEffectStartTime >= 0) {
            var elapsedTime = now$1() - layoutEffectStartTime;
            layoutEffectStartTime = -1;
            var parentFiber = fiber.return;
            while (parentFiber !== null) {
              switch (parentFiber.tag) {
                case HostRoot:
                  var root3 = parentFiber.stateNode;
                  root3.effectDuration += elapsedTime;
                  return;
                case Profiler:
                  var parentStateNode = parentFiber.stateNode;
                  parentStateNode.effectDuration += elapsedTime;
                  return;
              }
              parentFiber = parentFiber.return;
            }
          }
        }
        function recordPassiveEffectDuration(fiber) {
          if (passiveEffectStartTime >= 0) {
            var elapsedTime = now$1() - passiveEffectStartTime;
            passiveEffectStartTime = -1;
            var parentFiber = fiber.return;
            while (parentFiber !== null) {
              switch (parentFiber.tag) {
                case HostRoot:
                  var root3 = parentFiber.stateNode;
                  if (root3 !== null) {
                    root3.passiveEffectDuration += elapsedTime;
                  }
                  return;
                case Profiler:
                  var parentStateNode = parentFiber.stateNode;
                  if (parentStateNode !== null) {
                    parentStateNode.passiveEffectDuration += elapsedTime;
                  }
                  return;
              }
              parentFiber = parentFiber.return;
            }
          }
        }
        function startLayoutEffectTimer() {
          layoutEffectStartTime = now$1();
        }
        function startPassiveEffectTimer() {
          passiveEffectStartTime = now$1();
        }
        function transferActualDuration(fiber) {
          var child = fiber.child;
          while (child) {
            fiber.actualDuration += child.actualDuration;
            child = child.sibling;
          }
        }
        function createCapturedValueAtFiber(value, source) {
          return {
            value,
            source,
            stack: getStackByFiberInDevAndProd(source),
            digest: null
          };
        }
        function createCapturedValue(value, digest, stack) {
          return {
            value,
            source: null,
            stack: stack != null ? stack : null,
            digest: digest != null ? digest : null
          };
        }
        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 ? getComponentNameFromFiber(source) : null;
              var componentNameMessage = componentName ? "The above error occurred in the <" + componentName + "> component:" : "The above error occurred in one of your React components:";
              var errorBoundaryMessage;
              if (boundary.tag === HostRoot) {
                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.";
              } else {
                var errorBoundaryName = getComponentNameFromFiber(boundary) || "Anonymous";
                errorBoundaryMessage = "React will try to recreate this component tree from scratch " + ("using the error boundary you provided, " + errorBoundaryName + ".");
              }
              var combinedMessage = componentNameMessage + "\n" + componentStack + "\n\n" + ("" + errorBoundaryMessage);
              console["error"](combinedMessage);
            } else {
              console["error"](error2);
            }
          } catch (e3) {
            setTimeout(function() {
              throw e3;
            });
          }
        }
        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() {
              return getDerivedStateFromError(error$1);
            };
            update.callback = function() {
              {
                markFailedErrorBoundaryForHotReloading(fiber);
              }
              logCapturedError(fiber, errorInfo);
            };
          }
          var inst = fiber.stateNode;
          if (inst !== null && typeof inst.componentDidCatch === "function") {
            update.callback = function callback() {
              {
                markFailedErrorBoundaryForHotReloading(fiber);
              }
              logCapturedError(fiber, errorInfo);
              if (typeof getDerivedStateFromError !== "function") {
                markLegacyErrorBoundaryAsFailed(this);
              }
              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.", getComponentNameFromFiber(fiber) || "Unknown");
                  }
                }
              }
            };
          }
          return update;
        }
        function attachPingListener(root3, wakeable, lanes) {
          var pingCache = root3.pingCache;
          var threadIDs;
          if (pingCache === null) {
            pingCache = root3.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, root3, wakeable, lanes);
            {
              if (isDevToolsPresent) {
                restorePendingUpdaters(root3, lanes);
              }
            }
            wakeable.then(ping, ping);
          }
        }
        function attachRetryListener(suspenseBoundary, root3, wakeable, lanes) {
          var wakeables = suspenseBoundary.updateQueue;
          if (wakeables === null) {
            var updateQueue = /* @__PURE__ */ new Set();
            updateQueue.add(wakeable);
            suspenseBoundary.updateQueue = updateQueue;
          } else {
            wakeables.add(wakeable);
          }
        }
        function resetSuspendedComponent(sourceFiber, rootRenderLanes) {
          var tag = sourceFiber.tag;
          if ((sourceFiber.mode & ConcurrentMode) === NoMode && (tag === FunctionComponent || tag === ForwardRef || tag === SimpleMemoComponent)) {
            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;
            }
          }
        }
        function getNearestSuspenseBoundaryToCapture(returnFiber) {
          var node56 = returnFiber;
          do {
            if (node56.tag === SuspenseComponent && shouldCaptureSuspense(node56)) {
              return node56;
            }
            node56 = node56.return;
          } while (node56 !== null);
          return null;
        }
        function markSuspenseBoundaryShouldCapture(suspenseBoundary, returnFiber, sourceFiber, root3, rootRenderLanes) {
          if ((suspenseBoundary.mode & ConcurrentMode) === NoMode) {
            if (suspenseBoundary === returnFiber) {
              suspenseBoundary.flags |= ShouldCapture;
            } else {
              suspenseBoundary.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, SyncLane);
                }
              }
              sourceFiber.lanes = mergeLanes(sourceFiber.lanes, SyncLane);
            }
            return suspenseBoundary;
          }
          suspenseBoundary.flags |= ShouldCapture;
          suspenseBoundary.lanes = rootRenderLanes;
          return suspenseBoundary;
        }
        function throwException(root3, returnFiber, sourceFiber, value, rootRenderLanes) {
          sourceFiber.flags |= Incomplete;
          {
            if (isDevToolsPresent) {
              restorePendingUpdaters(root3, rootRenderLanes);
            }
          }
          if (value !== null && typeof value === "object" && typeof value.then === "function") {
            var wakeable = value;
            resetSuspendedComponent(sourceFiber);
            {
              if (getIsHydrating() && sourceFiber.mode & ConcurrentMode) {
                markDidThrowWhileHydratingDEV();
              }
            }
            var suspenseBoundary = getNearestSuspenseBoundaryToCapture(returnFiber);
            if (suspenseBoundary !== null) {
              suspenseBoundary.flags &= ~ForceClientRender;
              markSuspenseBoundaryShouldCapture(suspenseBoundary, returnFiber, sourceFiber, root3, rootRenderLanes);
              if (suspenseBoundary.mode & ConcurrentMode) {
                attachPingListener(root3, wakeable, rootRenderLanes);
              }
              attachRetryListener(suspenseBoundary, root3, wakeable);
              return;
            } else {
              if (!includesSyncLane(rootRenderLanes)) {
                attachPingListener(root3, wakeable, rootRenderLanes);
                renderDidSuspendDelayIfPossible();
                return;
              }
              var uncaughtSuspenseError = new Error("A component suspended while responding to synchronous input. This will cause the UI to be replaced with a loading indicator. To fix, updates that suspend should be wrapped with startTransition.");
              value = uncaughtSuspenseError;
            }
          } else {
            if (getIsHydrating() && sourceFiber.mode & ConcurrentMode) {
              markDidThrowWhileHydratingDEV();
              var _suspenseBoundary = getNearestSuspenseBoundaryToCapture(returnFiber);
              if (_suspenseBoundary !== null) {
                if ((_suspenseBoundary.flags & ShouldCapture) === NoFlags) {
                  _suspenseBoundary.flags |= ForceClientRender;
                }
                markSuspenseBoundaryShouldCapture(_suspenseBoundary, returnFiber, sourceFiber, root3, rootRenderLanes);
                queueHydrationError(createCapturedValueAtFiber(value, sourceFiber));
                return;
              }
            }
          }
          value = createCapturedValueAtFiber(value, sourceFiber);
          renderDidError(value);
          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 _update = createClassErrorUpdate(workInProgress2, errorInfo, _lane);
                  enqueueCapturedUpdate(workInProgress2, _update);
                  return;
                }
                break;
            }
            workInProgress2 = workInProgress2.return;
          } while (workInProgress2 !== null);
        }
        function getSuspendedCache() {
          {
            return null;
          }
        }
        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, Component8, nextProps, renderLanes2) {
          {
            if (workInProgress2.type !== workInProgress2.elementType) {
              var innerPropTypes = Component8.propTypes;
              if (innerPropTypes) {
                checkPropTypes(
                  innerPropTypes,
                  nextProps,
                  // Resolved props
                  "prop",
                  getComponentNameFromType(Component8)
                );
              }
            }
          }
          var render3 = Component8.render;
          var ref = workInProgress2.ref;
          var nextChildren;
          var hasId;
          prepareToReadContext(workInProgress2, renderLanes2);
          {
            markComponentRenderStarted(workInProgress2);
          }
          {
            ReactCurrentOwner$1.current = workInProgress2;
            setIsRendering(true);
            nextChildren = renderWithHooks(current2, workInProgress2, render3, nextProps, ref, renderLanes2);
            hasId = checkDidRenderIdHook();
            if (workInProgress2.mode & StrictLegacyMode) {
              setIsStrictModeForDevtools(true);
              try {
                nextChildren = renderWithHooks(current2, workInProgress2, render3, nextProps, ref, renderLanes2);
                hasId = checkDidRenderIdHook();
              } finally {
                setIsStrictModeForDevtools(false);
              }
            }
            setIsRendering(false);
          }
          {
            markComponentRenderStopped();
          }
          if (current2 !== null && !didReceiveUpdate) {
            bailoutHooks(current2, workInProgress2, renderLanes2);
            return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
          }
          if (getIsHydrating() && hasId) {
            pushMaterializedTreeId(workInProgress2);
          }
          workInProgress2.flags |= PerformedWork;
          reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
          return workInProgress2.child;
        }
        function updateMemoComponent(current2, workInProgress2, Component8, nextProps, renderLanes2) {
          if (current2 === null) {
            var type = Component8.type;
            if (isSimpleFunctionComponent(type) && Component8.compare === null && // SimpleMemoComponent codepath doesn't resolve outer props either.
            Component8.defaultProps === void 0) {
              var resolvedType = type;
              {
                resolvedType = resolveFunctionForHotReloading(type);
              }
              workInProgress2.tag = SimpleMemoComponent;
              workInProgress2.type = resolvedType;
              {
                validateFunctionComponentInDev(workInProgress2, type);
              }
              return updateSimpleMemoComponent(current2, workInProgress2, resolvedType, nextProps, renderLanes2);
            }
            {
              var innerPropTypes = type.propTypes;
              if (innerPropTypes) {
                checkPropTypes(
                  innerPropTypes,
                  nextProps,
                  // Resolved props
                  "prop",
                  getComponentNameFromType(type)
                );
              }
            }
            var child = createFiberFromTypeAndProps(Component8.type, null, nextProps, workInProgress2, workInProgress2.mode, renderLanes2);
            child.ref = workInProgress2.ref;
            child.return = workInProgress2;
            workInProgress2.child = child;
            return child;
          }
          {
            var _type = Component8.type;
            var _innerPropTypes = _type.propTypes;
            if (_innerPropTypes) {
              checkPropTypes(
                _innerPropTypes,
                nextProps,
                // Resolved props
                "prop",
                getComponentNameFromType(_type)
              );
            }
          }
          var currentChild = current2.child;
          var hasScheduledUpdateOrContext = checkScheduledUpdateOrContext(current2, renderLanes2);
          if (!hasScheduledUpdateOrContext) {
            var prevProps = currentChild.memoizedProps;
            var compare2 = Component8.compare;
            compare2 = compare2 !== null ? compare2 : shallowEqual3;
            if (compare2(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, Component8, nextProps, 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 (x2) {
                  outerMemoType = null;
                }
                var outerPropTypes = outerMemoType && outerMemoType.propTypes;
                if (outerPropTypes) {
                  checkPropTypes(
                    outerPropTypes,
                    nextProps,
                    // Resolved (SimpleMemoComponent has no defaultProps)
                    "prop",
                    getComponentNameFromType(outerMemoType)
                  );
                }
              }
            }
          }
          if (current2 !== null) {
            var prevProps = current2.memoizedProps;
            if (shallowEqual3(prevProps, nextProps) && current2.ref === workInProgress2.ref && // Prevent bailout if the implementation changed due to hot reload.
            workInProgress2.type === current2.type) {
              didReceiveUpdate = false;
              workInProgress2.pendingProps = nextProps = prevProps;
              if (!checkScheduledUpdateOrContext(current2, renderLanes2)) {
                workInProgress2.lanes = current2.lanes;
                return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
              } else if ((current2.flags & ForceUpdateForLegacySuspense) !== NoFlags) {
                didReceiveUpdate = true;
              }
            }
          }
          return updateFunctionComponent(current2, workInProgress2, Component8, 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" || enableLegacyHidden) {
            if ((workInProgress2.mode & ConcurrentMode) === NoMode) {
              var nextState = {
                baseLanes: NoLanes,
                cachePool: null,
                transitions: null
              };
              workInProgress2.memoizedState = nextState;
              pushRenderLanes(workInProgress2, renderLanes2);
            } else if (!includesSomeLane(renderLanes2, OffscreenLane)) {
              var spawnedCachePool = null;
              var nextBaseLanes;
              if (prevState !== null) {
                var prevBaseLanes = prevState.baseLanes;
                nextBaseLanes = mergeLanes(prevBaseLanes, renderLanes2);
              } else {
                nextBaseLanes = renderLanes2;
              }
              workInProgress2.lanes = workInProgress2.childLanes = laneToLanes(OffscreenLane);
              var _nextState = {
                baseLanes: nextBaseLanes,
                cachePool: spawnedCachePool,
                transitions: null
              };
              workInProgress2.memoizedState = _nextState;
              workInProgress2.updateQueue = null;
              pushRenderLanes(workInProgress2, nextBaseLanes);
              return null;
            } else {
              var _nextState2 = {
                baseLanes: NoLanes,
                cachePool: null,
                transitions: null
              };
              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;
        }
        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;
            {
              workInProgress2.flags |= RefStatic;
            }
          }
        }
        function updateFunctionComponent(current2, workInProgress2, Component8, nextProps, renderLanes2) {
          {
            if (workInProgress2.type !== workInProgress2.elementType) {
              var innerPropTypes = Component8.propTypes;
              if (innerPropTypes) {
                checkPropTypes(
                  innerPropTypes,
                  nextProps,
                  // Resolved props
                  "prop",
                  getComponentNameFromType(Component8)
                );
              }
            }
          }
          var context2;
          {
            var unmaskedContext = getUnmaskedContext(workInProgress2, Component8, true);
            context2 = getMaskedContext(workInProgress2, unmaskedContext);
          }
          var nextChildren;
          var hasId;
          prepareToReadContext(workInProgress2, renderLanes2);
          {
            markComponentRenderStarted(workInProgress2);
          }
          {
            ReactCurrentOwner$1.current = workInProgress2;
            setIsRendering(true);
            nextChildren = renderWithHooks(current2, workInProgress2, Component8, nextProps, context2, renderLanes2);
            hasId = checkDidRenderIdHook();
            if (workInProgress2.mode & StrictLegacyMode) {
              setIsStrictModeForDevtools(true);
              try {
                nextChildren = renderWithHooks(current2, workInProgress2, Component8, nextProps, context2, renderLanes2);
                hasId = checkDidRenderIdHook();
              } finally {
                setIsStrictModeForDevtools(false);
              }
            }
            setIsRendering(false);
          }
          {
            markComponentRenderStopped();
          }
          if (current2 !== null && !didReceiveUpdate) {
            bailoutHooks(current2, workInProgress2, renderLanes2);
            return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
          }
          if (getIsHydrating() && hasId) {
            pushMaterializedTreeId(workInProgress2);
          }
          workInProgress2.flags |= PerformedWork;
          reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
          return workInProgress2.child;
        }
        function updateClassComponent(current2, workInProgress2, Component8, nextProps, renderLanes2) {
          {
            switch (shouldError(workInProgress2)) {
              case false: {
                var _instance = workInProgress2.stateNode;
                var ctor = workInProgress2.type;
                var tempInstance = new ctor(workInProgress2.memoizedProps, _instance.context);
                var state = tempInstance.state;
                _instance.updater.enqueueSetState(_instance, state, null);
                break;
              }
              case true: {
                workInProgress2.flags |= DidCapture;
                workInProgress2.flags |= ShouldCapture;
                var error$1 = new Error("Simulated error coming from DevTools");
                var lane = pickArbitraryLane(renderLanes2);
                workInProgress2.lanes = mergeLanes(workInProgress2.lanes, lane);
                var update = createClassErrorUpdate(workInProgress2, createCapturedValueAtFiber(error$1, workInProgress2), lane);
                enqueueCapturedUpdate(workInProgress2, update);
                break;
              }
            }
            if (workInProgress2.type !== workInProgress2.elementType) {
              var innerPropTypes = Component8.propTypes;
              if (innerPropTypes) {
                checkPropTypes(
                  innerPropTypes,
                  nextProps,
                  // Resolved props
                  "prop",
                  getComponentNameFromType(Component8)
                );
              }
            }
          }
          var hasContext;
          if (isContextProvider(Component8)) {
            hasContext = true;
            pushContextProvider(workInProgress2);
          } else {
            hasContext = false;
          }
          prepareToReadContext(workInProgress2, renderLanes2);
          var instance = workInProgress2.stateNode;
          var shouldUpdate;
          if (instance === null) {
            resetSuspendedCurrentOnMountInLegacyMode(current2, workInProgress2);
            constructClassInstance(workInProgress2, Component8, nextProps);
            mountClassInstance(workInProgress2, Component8, nextProps, renderLanes2);
            shouldUpdate = true;
          } else if (current2 === null) {
            shouldUpdate = resumeMountClassInstance(workInProgress2, Component8, nextProps, renderLanes2);
          } else {
            shouldUpdate = updateClassInstance(current2, workInProgress2, Component8, nextProps, renderLanes2);
          }
          var nextUnitOfWork = finishClassComponent(current2, workInProgress2, Component8, 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.", getComponentNameFromFiber(workInProgress2) || "a component");
              }
              didWarnAboutReassigningProps = true;
            }
          }
          return nextUnitOfWork;
        }
        function finishClassComponent(current2, workInProgress2, Component8, shouldUpdate, hasContext, renderLanes2) {
          markRef(current2, workInProgress2);
          var didCaptureError = (workInProgress2.flags & DidCapture) !== NoFlags;
          if (!shouldUpdate && !didCaptureError) {
            if (hasContext) {
              invalidateContextProvider(workInProgress2, Component8, false);
            }
            return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
          }
          var instance = workInProgress2.stateNode;
          ReactCurrentOwner$1.current = workInProgress2;
          var nextChildren;
          if (didCaptureError && typeof Component8.getDerivedStateFromError !== "function") {
            nextChildren = null;
            {
              stopProfilerTimerIfRunning();
            }
          } else {
            {
              markComponentRenderStarted(workInProgress2);
            }
            {
              setIsRendering(true);
              nextChildren = instance.render();
              if (workInProgress2.mode & StrictLegacyMode) {
                setIsStrictModeForDevtools(true);
                try {
                  instance.render();
                } finally {
                  setIsStrictModeForDevtools(false);
                }
              }
              setIsRendering(false);
            }
            {
              markComponentRenderStopped();
            }
          }
          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, Component8, true);
          }
          return workInProgress2.child;
        }
        function pushHostRootContext(workInProgress2) {
          var root3 = workInProgress2.stateNode;
          if (root3.pendingContext) {
            pushTopLevelContextObject(workInProgress2, root3.pendingContext, root3.pendingContext !== root3.context);
          } else if (root3.context) {
            pushTopLevelContextObject(workInProgress2, root3.context, false);
          }
          pushHostContainer(workInProgress2, root3.containerInfo);
        }
        function updateHostRoot(current2, workInProgress2, renderLanes2) {
          pushHostRootContext(workInProgress2);
          if (current2 === null) {
            throw new Error("Should have a current fiber. This is a bug in React.");
          }
          var nextProps = workInProgress2.pendingProps;
          var prevState = workInProgress2.memoizedState;
          var prevChildren = prevState.element;
          cloneUpdateQueue(current2, workInProgress2);
          processUpdateQueue(workInProgress2, nextProps, null, renderLanes2);
          var nextState = workInProgress2.memoizedState;
          var root3 = workInProgress2.stateNode;
          var nextChildren = nextState.element;
          if (prevState.isDehydrated) {
            var overrideState = {
              element: nextChildren,
              isDehydrated: false,
              cache: nextState.cache,
              pendingSuspenseBoundaries: nextState.pendingSuspenseBoundaries,
              transitions: nextState.transitions
            };
            var updateQueue = workInProgress2.updateQueue;
            updateQueue.baseState = overrideState;
            workInProgress2.memoizedState = overrideState;
            if (workInProgress2.flags & ForceClientRender) {
              var recoverableError = createCapturedValueAtFiber(new Error("There was an error while hydrating. Because the error happened outside of a Suspense boundary, the entire root will switch to client rendering."), workInProgress2);
              return mountHostRootWithoutHydrating(current2, workInProgress2, nextChildren, renderLanes2, recoverableError);
            } else if (nextChildren !== prevChildren) {
              var _recoverableError = createCapturedValueAtFiber(new Error("This root received an early update, before anything was able hydrate. Switched the entire root to client rendering."), workInProgress2);
              return mountHostRootWithoutHydrating(current2, workInProgress2, nextChildren, renderLanes2, _recoverableError);
            } else {
              enterHydrationState(workInProgress2);
              var child = mountChildFibers(workInProgress2, null, nextChildren, renderLanes2);
              workInProgress2.child = child;
              var node56 = child;
              while (node56) {
                node56.flags = node56.flags & ~Placement | Hydrating;
                node56 = node56.sibling;
              }
            }
          } else {
            resetHydrationState();
            if (nextChildren === prevChildren) {
              return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
            }
            reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
          }
          return workInProgress2.child;
        }
        function mountHostRootWithoutHydrating(current2, workInProgress2, nextChildren, renderLanes2, recoverableError) {
          resetHydrationState();
          queueHydrationError(recoverableError);
          workInProgress2.flags |= ForceClientRender;
          reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
          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, renderLanes2) {
          resetSuspendedCurrentOnMountInLegacyMode(_current, workInProgress2);
          var props = workInProgress2.pendingProps;
          var lazyComponent = elementType;
          var payload = lazyComponent._payload;
          var init = lazyComponent._init;
          var Component8 = init(payload);
          workInProgress2.type = Component8;
          var resolvedTag = workInProgress2.tag = resolveLazyComponentTag(Component8);
          var resolvedProps = resolveDefaultProps(Component8, props);
          var child;
          switch (resolvedTag) {
            case FunctionComponent: {
              {
                validateFunctionComponentInDev(workInProgress2, Component8);
                workInProgress2.type = Component8 = resolveFunctionForHotReloading(Component8);
              }
              child = updateFunctionComponent(null, workInProgress2, Component8, resolvedProps, renderLanes2);
              return child;
            }
            case ClassComponent: {
              {
                workInProgress2.type = Component8 = resolveClassForHotReloading(Component8);
              }
              child = updateClassComponent(null, workInProgress2, Component8, resolvedProps, renderLanes2);
              return child;
            }
            case ForwardRef: {
              {
                workInProgress2.type = Component8 = resolveForwardRefForHotReloading(Component8);
              }
              child = updateForwardRef(null, workInProgress2, Component8, resolvedProps, renderLanes2);
              return child;
            }
            case MemoComponent: {
              {
                if (workInProgress2.type !== workInProgress2.elementType) {
                  var outerPropTypes = Component8.propTypes;
                  if (outerPropTypes) {
                    checkPropTypes(
                      outerPropTypes,
                      resolvedProps,
                      // Resolved for outer only
                      "prop",
                      getComponentNameFromType(Component8)
                    );
                  }
                }
              }
              child = updateMemoComponent(
                null,
                workInProgress2,
                Component8,
                resolveDefaultProps(Component8.type, resolvedProps),
                // The inner type can have defaults too
                renderLanes2
              );
              return child;
            }
          }
          var hint = "";
          {
            if (Component8 !== null && typeof Component8 === "object" && Component8.$$typeof === REACT_LAZY_TYPE) {
              hint = " Did you wrap a component in React.lazy() more than once?";
            }
          }
          throw new Error("Element type is invalid. Received a promise that resolves to: " + Component8 + ". " + ("Lazy element type must resolve to a class or function." + hint));
        }
        function mountIncompleteClassComponent(_current, workInProgress2, Component8, nextProps, renderLanes2) {
          resetSuspendedCurrentOnMountInLegacyMode(_current, workInProgress2);
          workInProgress2.tag = ClassComponent;
          var hasContext;
          if (isContextProvider(Component8)) {
            hasContext = true;
            pushContextProvider(workInProgress2);
          } else {
            hasContext = false;
          }
          prepareToReadContext(workInProgress2, renderLanes2);
          constructClassInstance(workInProgress2, Component8, nextProps);
          mountClassInstance(workInProgress2, Component8, nextProps, renderLanes2);
          return finishClassComponent(null, workInProgress2, Component8, true, hasContext, renderLanes2);
        }
        function mountIndeterminateComponent(_current, workInProgress2, Component8, renderLanes2) {
          resetSuspendedCurrentOnMountInLegacyMode(_current, workInProgress2);
          var props = workInProgress2.pendingProps;
          var context2;
          {
            var unmaskedContext = getUnmaskedContext(workInProgress2, Component8, false);
            context2 = getMaskedContext(workInProgress2, unmaskedContext);
          }
          prepareToReadContext(workInProgress2, renderLanes2);
          var value;
          var hasId;
          {
            markComponentRenderStarted(workInProgress2);
          }
          {
            if (Component8.prototype && typeof Component8.prototype.render === "function") {
              var componentName = getComponentNameFromType(Component8) || "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 & StrictLegacyMode) {
              ReactStrictModeWarnings.recordLegacyContextWarning(workInProgress2, null);
            }
            setIsRendering(true);
            ReactCurrentOwner$1.current = workInProgress2;
            value = renderWithHooks(null, workInProgress2, Component8, props, context2, renderLanes2);
            hasId = checkDidRenderIdHook();
            setIsRendering(false);
          }
          {
            markComponentRenderStopped();
          }
          workInProgress2.flags |= PerformedWork;
          {
            if (typeof value === "object" && value !== null && typeof value.render === "function" && value.$$typeof === void 0) {
              var _componentName = getComponentNameFromType(Component8) || "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 (
            // Run these checks in production only if the flag is off.
            // Eventually we'll delete this branch altogether.
            typeof value === "object" && value !== null && typeof value.render === "function" && value.$$typeof === void 0
          ) {
            {
              var _componentName2 = getComponentNameFromType(Component8) || "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(Component8)) {
              hasContext = true;
              pushContextProvider(workInProgress2);
            } else {
              hasContext = false;
            }
            workInProgress2.memoizedState = value.state !== null && value.state !== void 0 ? value.state : null;
            initializeUpdateQueue(workInProgress2);
            adoptClassInstance(workInProgress2, value);
            mountClassInstance(workInProgress2, Component8, props, renderLanes2);
            return finishClassComponent(null, workInProgress2, Component8, true, hasContext, renderLanes2);
          } else {
            workInProgress2.tag = FunctionComponent;
            {
              if (workInProgress2.mode & StrictLegacyMode) {
                setIsStrictModeForDevtools(true);
                try {
                  value = renderWithHooks(null, workInProgress2, Component8, props, context2, renderLanes2);
                  hasId = checkDidRenderIdHook();
                } finally {
                  setIsStrictModeForDevtools(false);
                }
              }
            }
            if (getIsHydrating() && hasId) {
              pushMaterializedTreeId(workInProgress2);
            }
            reconcileChildren(null, workInProgress2, value, renderLanes2);
            {
              validateFunctionComponentInDev(workInProgress2, Component8);
            }
            return workInProgress2.child;
          }
        }
        function validateFunctionComponentInDev(workInProgress2, Component8) {
          {
            if (Component8) {
              if (Component8.childContextTypes) {
                error("%s(...): childContextTypes cannot be defined on a function component.", Component8.displayName || Component8.name || "Component");
              }
            }
            if (workInProgress2.ref !== null) {
              var info = "";
              var ownerName = getCurrentFiberOwnerNameInDevOrNull();
              if (ownerName) {
                info += "\n\nCheck the render method of `" + ownerName + "`.";
              }
              var warningKey = ownerName || "";
              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 Component8.getDerivedStateFromProps === "function") {
              var _componentName3 = getComponentNameFromType(Component8) || "Unknown";
              if (!didWarnAboutGetDerivedStateOnFunctionComponent[_componentName3]) {
                error("%s: Function components do not support getDerivedStateFromProps.", _componentName3);
                didWarnAboutGetDerivedStateOnFunctionComponent[_componentName3] = true;
              }
            }
            if (typeof Component8.contextType === "object" && Component8.contextType !== null) {
              var _componentName4 = getComponentNameFromType(Component8) || "Unknown";
              if (!didWarnAboutContextTypeOnFunctionComponent[_componentName4]) {
                error("%s: Function components do not support contextType.", _componentName4);
                didWarnAboutContextTypeOnFunctionComponent[_componentName4] = true;
              }
            }
          }
        }
        var SUSPENDED_MARKER = {
          dehydrated: null,
          treeContext: null,
          retryLane: NoLane
        };
        function mountSuspenseOffscreenState(renderLanes2) {
          return {
            baseLanes: renderLanes2,
            cachePool: getSuspendedCache(),
            transitions: null
          };
        }
        function updateSuspenseOffscreenState(prevOffscreenState, renderLanes2) {
          var cachePool = null;
          return {
            baseLanes: mergeLanes(prevOffscreenState.baseLanes, renderLanes2),
            cachePool,
            transitions: prevOffscreenState.transitions
          };
        }
        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) {
              {
                suspenseContext = addSubtreeSuspenseContext(suspenseContext, InvisibleParentSuspenseContext);
              }
            }
          }
          suspenseContext = setDefaultShallowSuspenseContext(suspenseContext);
          pushSuspenseContext(workInProgress2, suspenseContext);
          if (current2 === null) {
            tryToClaimNextHydratableInstance(workInProgress2);
            var suspenseState = workInProgress2.memoizedState;
            if (suspenseState !== null) {
              var dehydrated = suspenseState.dehydrated;
              if (dehydrated !== null) {
                return mountDehydratedSuspenseComponent(workInProgress2, dehydrated);
              }
            }
            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 {
              return mountSuspensePrimaryChildren(workInProgress2, nextPrimaryChildren);
            }
          } else {
            var prevState = current2.memoizedState;
            if (prevState !== null) {
              var _dehydrated = prevState.dehydrated;
              if (_dehydrated !== null) {
                return updateDehydratedSuspenseComponent(current2, workInProgress2, didSuspend, nextProps, _dehydrated, prevState, renderLanes2);
              }
            }
            if (showFallback) {
              var _nextFallbackChildren = nextProps.fallback;
              var _nextPrimaryChildren = nextProps.children;
              var fallbackChildFragment = updateSuspenseFallbackChildren(current2, workInProgress2, _nextPrimaryChildren, _nextFallbackChildren, renderLanes2);
              var _primaryChildFragment2 = workInProgress2.child;
              var prevOffscreenState = current2.child.memoizedState;
              _primaryChildFragment2.memoizedState = prevOffscreenState === null ? mountSuspenseOffscreenState(renderLanes2) : updateSuspenseOffscreenState(prevOffscreenState, renderLanes2);
              _primaryChildFragment2.childLanes = getRemainingWorkInPrimaryTree(current2, renderLanes2);
              workInProgress2.memoizedState = SUSPENDED_MARKER;
              return fallbackChildFragment;
            } else {
              var _nextPrimaryChildren2 = nextProps.children;
              var _primaryChildFragment3 = updateSuspensePrimaryChildren(current2, workInProgress2, _nextPrimaryChildren2, renderLanes2);
              workInProgress2.memoizedState = null;
              return _primaryChildFragment3;
            }
          }
        }
        function mountSuspensePrimaryChildren(workInProgress2, primaryChildren, renderLanes2) {
          var mode = workInProgress2.mode;
          var primaryChildProps = {
            mode: "visible",
            children: primaryChildren
          };
          var primaryChildFragment = mountWorkInProgressOffscreenFiber(primaryChildProps, mode);
          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 & ConcurrentMode) === 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 = mountWorkInProgressOffscreenFiber(primaryChildProps, mode);
            fallbackChildFragment = createFiberFromFragment(fallbackChildren, mode, renderLanes2, null);
          }
          primaryChildFragment.return = workInProgress2;
          fallbackChildFragment.return = workInProgress2;
          primaryChildFragment.sibling = fallbackChildFragment;
          workInProgress2.child = primaryChildFragment;
          return fallbackChildFragment;
        }
        function mountWorkInProgressOffscreenFiber(offscreenProps, mode, renderLanes2) {
          return createFiberFromOffscreen(offscreenProps, mode, NoLanes, null);
        }
        function updateWorkInProgressOffscreenFiber(current2, offscreenProps) {
          return createWorkInProgress(current2, offscreenProps);
        }
        function updateSuspensePrimaryChildren(current2, workInProgress2, primaryChildren, renderLanes2) {
          var currentPrimaryChildFragment = current2.child;
          var currentFallbackChildFragment = currentPrimaryChildFragment.sibling;
          var primaryChildFragment = updateWorkInProgressOffscreenFiber(currentPrimaryChildFragment, {
            mode: "visible",
            children: primaryChildren
          });
          if ((workInProgress2.mode & ConcurrentMode) === NoMode) {
            primaryChildFragment.lanes = renderLanes2;
          }
          primaryChildFragment.return = workInProgress2;
          primaryChildFragment.sibling = null;
          if (currentFallbackChildFragment !== null) {
            var deletions = workInProgress2.deletions;
            if (deletions === null) {
              workInProgress2.deletions = [currentFallbackChildFragment];
              workInProgress2.flags |= ChildDeletion;
            } else {
              deletions.push(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 (
            // In legacy mode, we commit the primary tree as if it successfully
            // completed, even though it's in an inconsistent state.
            (mode & ConcurrentMode) === NoMode && // Make sure we're on the second pass, i.e. the primary child fragment was
            // already cloned. In legacy mode, the only case where this isn't true is
            // when DevTools forces us to display a fallback; we skip the first render
            // pass entirely and go straight to rendering the fallback. (In Concurrent
            // Mode, SuspenseList can also trigger this scenario, but this is a legacy-
            // only codepath.)
            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;
            }
            workInProgress2.deletions = null;
          } else {
            primaryChildFragment = updateWorkInProgressOffscreenFiber(currentPrimaryChildFragment, primaryChildProps);
            primaryChildFragment.subtreeFlags = currentPrimaryChildFragment.subtreeFlags & StaticMask;
          }
          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 retrySuspenseComponentWithoutHydrating(current2, workInProgress2, renderLanes2, recoverableError) {
          if (recoverableError !== null) {
            queueHydrationError(recoverableError);
          }
          reconcileChildFibers(workInProgress2, current2.child, null, renderLanes2);
          var nextProps = workInProgress2.pendingProps;
          var primaryChildren = nextProps.children;
          var primaryChildFragment = mountSuspensePrimaryChildren(workInProgress2, primaryChildren);
          primaryChildFragment.flags |= Placement;
          workInProgress2.memoizedState = null;
          return primaryChildFragment;
        }
        function mountSuspenseFallbackAfterRetryWithoutHydrating(current2, workInProgress2, primaryChildren, fallbackChildren, renderLanes2) {
          var fiberMode = workInProgress2.mode;
          var primaryChildProps = {
            mode: "visible",
            children: primaryChildren
          };
          var primaryChildFragment = mountWorkInProgressOffscreenFiber(primaryChildProps, fiberMode);
          var fallbackChildFragment = createFiberFromFragment(fallbackChildren, fiberMode, renderLanes2, null);
          fallbackChildFragment.flags |= Placement;
          primaryChildFragment.return = workInProgress2;
          fallbackChildFragment.return = workInProgress2;
          primaryChildFragment.sibling = fallbackChildFragment;
          workInProgress2.child = primaryChildFragment;
          if ((workInProgress2.mode & ConcurrentMode) !== NoMode) {
            reconcileChildFibers(workInProgress2, current2.child, null, renderLanes2);
          }
          return fallbackChildFragment;
        }
        function mountDehydratedSuspenseComponent(workInProgress2, suspenseInstance, renderLanes2) {
          if ((workInProgress2.mode & ConcurrentMode) === NoMode) {
            {
              error("Cannot hydrate Suspense in legacy mode. Switch from ReactDOM.hydrate(element, container) to ReactDOMClient.hydrateRoot(container, <App />).render(element) or remove the Suspense components from the server rendered components.");
            }
            workInProgress2.lanes = laneToLanes(SyncLane);
          } else if (isSuspenseInstanceFallback(suspenseInstance)) {
            workInProgress2.lanes = laneToLanes(DefaultHydrationLane);
          } else {
            workInProgress2.lanes = laneToLanes(OffscreenLane);
          }
          return null;
        }
        function updateDehydratedSuspenseComponent(current2, workInProgress2, didSuspend, nextProps, suspenseInstance, suspenseState, renderLanes2) {
          if (!didSuspend) {
            warnIfHydrating();
            if ((workInProgress2.mode & ConcurrentMode) === NoMode) {
              return retrySuspenseComponentWithoutHydrating(
                current2,
                workInProgress2,
                renderLanes2,
                // TODO: When we delete legacy mode, we should make this error argument
                // required — every concurrent mode path that causes hydration to
                // de-opt to client rendering should have an error message.
                null
              );
            }
            if (isSuspenseInstanceFallback(suspenseInstance)) {
              var digest, message, stack;
              {
                var _getSuspenseInstanceF = getSuspenseInstanceFallbackErrorDetails(suspenseInstance);
                digest = _getSuspenseInstanceF.digest;
                message = _getSuspenseInstanceF.message;
                stack = _getSuspenseInstanceF.stack;
              }
              var error2;
              if (message) {
                error2 = new Error(message);
              } else {
                error2 = new Error("The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering.");
              }
              var capturedValue = createCapturedValue(error2, digest, stack);
              return retrySuspenseComponentWithoutHydrating(current2, workInProgress2, renderLanes2, capturedValue);
            }
            var hasContextChanged2 = includesSomeLane(renderLanes2, current2.childLanes);
            if (didReceiveUpdate || hasContextChanged2) {
              var root3 = getWorkInProgressRoot();
              if (root3 !== null) {
                var attemptHydrationAtLane = getBumpedLaneForHydration(root3, renderLanes2);
                if (attemptHydrationAtLane !== NoLane && attemptHydrationAtLane !== suspenseState.retryLane) {
                  suspenseState.retryLane = attemptHydrationAtLane;
                  var eventTime = NoTimestamp;
                  enqueueConcurrentRenderForLane(current2, attemptHydrationAtLane);
                  scheduleUpdateOnFiber(root3, current2, attemptHydrationAtLane, eventTime);
                }
              }
              renderDidSuspendDelayIfPossible();
              var _capturedValue = createCapturedValue(new Error("This Suspense boundary received an update before it finished hydrating. This caused the boundary to switch to client rendering. The usual way to fix this is to wrap the original update in startTransition."));
              return retrySuspenseComponentWithoutHydrating(current2, workInProgress2, renderLanes2, _capturedValue);
            } else if (isSuspenseInstancePending(suspenseInstance)) {
              workInProgress2.flags |= DidCapture;
              workInProgress2.child = current2.child;
              var retry = retryDehydratedSuspenseBoundary.bind(null, current2);
              registerSuspenseInstanceRetry(suspenseInstance, retry);
              return null;
            } else {
              reenterHydrationStateFromDehydratedSuspenseInstance(workInProgress2, suspenseInstance, suspenseState.treeContext);
              var primaryChildren = nextProps.children;
              var primaryChildFragment = mountSuspensePrimaryChildren(workInProgress2, primaryChildren);
              primaryChildFragment.flags |= Hydrating;
              return primaryChildFragment;
            }
          } else {
            if (workInProgress2.flags & ForceClientRender) {
              workInProgress2.flags &= ~ForceClientRender;
              var _capturedValue2 = createCapturedValue(new Error("There was an error while hydrating this Suspense boundary. Switched to client rendering."));
              return retrySuspenseComponentWithoutHydrating(current2, workInProgress2, renderLanes2, _capturedValue2);
            } else if (workInProgress2.memoizedState !== null) {
              workInProgress2.child = current2.child;
              workInProgress2.flags |= DidCapture;
              return null;
            } else {
              var nextPrimaryChildren = nextProps.children;
              var nextFallbackChildren = nextProps.fallback;
              var fallbackChildFragment = mountSuspenseFallbackAfterRetryWithoutHydrating(current2, workInProgress2, nextPrimaryChildren, nextFallbackChildren, renderLanes2);
              var _primaryChildFragment4 = workInProgress2.child;
              _primaryChildFragment4.memoizedState = mountSuspenseOffscreenState(renderLanes2);
              workInProgress2.memoizedState = SUSPENDED_MARKER;
              return fallbackChildFragment;
            }
          }
        }
        function scheduleSuspenseWorkOnFiber(fiber, renderLanes2, propagationRoot) {
          fiber.lanes = mergeLanes(fiber.lanes, renderLanes2);
          var alternate = fiber.alternate;
          if (alternate !== null) {
            alternate.lanes = mergeLanes(alternate.lanes, renderLanes2);
          }
          scheduleContextWorkOnParentPath(fiber.return, renderLanes2, propagationRoot);
        }
        function propagateSuspenseContextChange(workInProgress2, firstChild, renderLanes2) {
          var node56 = firstChild;
          while (node56 !== null) {
            if (node56.tag === SuspenseComponent) {
              var state = node56.memoizedState;
              if (state !== null) {
                scheduleSuspenseWorkOnFiber(node56, renderLanes2, workInProgress2);
              }
            } else if (node56.tag === SuspenseListComponent) {
              scheduleSuspenseWorkOnFiber(node56, renderLanes2, workInProgress2);
            } else if (node56.child !== null) {
              node56.child.return = node56;
              node56 = node56.child;
              continue;
            }
            if (node56 === workInProgress2) {
              return;
            }
            while (node56.sibling === null) {
              if (node56.return === null || node56.return === workInProgress2) {
                return;
              }
              node56 = node56.return;
            }
            node56.sibling.return = node56.return;
            node56 = node56.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 isAnArray = isArray2(childSlot);
            var isIterable = !isAnArray && typeof getIteratorFn(childSlot) === "function";
            if (isAnArray || isIterable) {
              var type = isAnArray ? "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 (isArray2(children)) {
                for (var i2 = 0; i2 < children.length; i2++) {
                  if (!validateSuspenseListNestedChild(children[i2], i2)) {
                    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) {
          var renderState = workInProgress2.memoizedState;
          if (renderState === null) {
            workInProgress2.memoizedState = {
              isBackwards,
              rendering: null,
              renderingStartTime: 0,
              last: lastContentRow,
              tail,
              tailMode
            };
          } else {
            renderState.isBackwards = isBackwards;
            renderState.rendering = null;
            renderState.renderingStartTime = 0;
            renderState.last = lastContentRow;
            renderState.tail = tail;
            renderState.tailMode = tailMode;
          }
        }
        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 & ConcurrentMode) === 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,
                  // isBackwards
                  tail,
                  lastContentRow,
                  tailMode
                );
                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,
                  // isBackwards
                  _tail,
                  null,
                  // last
                  tailMode
                );
                break;
              }
              case "together": {
                initSuspenseListRenderState(
                  workInProgress2,
                  false,
                  // isBackwards
                  null,
                  // tail
                  null,
                  // last
                  void 0
                );
                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 context2 = 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, context2, newValue);
          {
            if (oldProps !== null) {
              var oldValue = oldProps.value;
              if (objectIs(oldValue, newValue)) {
                if (oldProps.children === newProps.children && !hasContextChanged()) {
                  return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
                }
              } else {
                propagateContextChange(workInProgress2, context2, renderLanes2);
              }
            }
          }
          var newChildren = newProps.children;
          reconcileChildren(current2, workInProgress2, newChildren, renderLanes2);
          return workInProgress2.child;
        }
        var hasWarnedAboutUsingContextAsConsumer = false;
        function updateContextConsumer(current2, workInProgress2, renderLanes2) {
          var context2 = workInProgress2.type;
          {
            if (context2._context === void 0) {
              if (context2 !== context2.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 {
              context2 = context2._context;
            }
          }
          var newProps = workInProgress2.pendingProps;
          var render3 = newProps.children;
          {
            if (typeof render3 !== "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(context2);
          {
            markComponentRenderStarted(workInProgress2);
          }
          var newChildren;
          {
            ReactCurrentOwner$1.current = workInProgress2;
            setIsRendering(true);
            newChildren = render3(newValue);
            setIsRendering(false);
          }
          {
            markComponentRenderStopped();
          }
          workInProgress2.flags |= PerformedWork;
          reconcileChildren(current2, workInProgress2, newChildren, renderLanes2);
          return workInProgress2.child;
        }
        function markWorkInProgressReceivedUpdate() {
          didReceiveUpdate = true;
        }
        function resetSuspendedCurrentOnMountInLegacyMode(current2, workInProgress2) {
          if ((workInProgress2.mode & ConcurrentMode) === NoMode) {
            if (current2 !== null) {
              current2.alternate = null;
              workInProgress2.alternate = null;
              workInProgress2.flags |= Placement;
            }
          }
        }
        function bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2) {
          if (current2 !== null) {
            workInProgress2.dependencies = current2.dependencies;
          }
          {
            stopProfilerTimerIfRunning();
          }
          markSkippedUpdateLanes(workInProgress2.lanes);
          if (!includesSomeLane(renderLanes2, workInProgress2.childLanes)) {
            {
              return null;
            }
          }
          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 deletions = returnFiber.deletions;
            if (deletions === null) {
              returnFiber.deletions = [current2];
              returnFiber.flags |= ChildDeletion;
            } else {
              deletions.push(current2);
            }
            newWorkInProgress.flags |= Placement;
            return newWorkInProgress;
          }
        }
        function checkScheduledUpdateOrContext(current2, renderLanes2) {
          var updateLanes = current2.lanes;
          if (includesSomeLane(updateLanes, renderLanes2)) {
            return true;
          }
          return false;
        }
        function attemptEarlyBailoutIfNoScheduledUpdate(current2, workInProgress2, renderLanes2) {
          switch (workInProgress2.tag) {
            case HostRoot:
              pushHostRootContext(workInProgress2);
              var root3 = workInProgress2.stateNode;
              resetHydrationState();
              break;
            case HostComponent:
              pushHostContext(workInProgress2);
              break;
            case ClassComponent: {
              var Component8 = workInProgress2.type;
              if (isContextProvider(Component8)) {
                pushContextProvider(workInProgress2);
              }
              break;
            }
            case HostPortal:
              pushHostContainer(workInProgress2, workInProgress2.stateNode.containerInfo);
              break;
            case ContextProvider: {
              var newValue = workInProgress2.memoizedProps.value;
              var context2 = workInProgress2.type._context;
              pushProvider(workInProgress2, context2, 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) {
                if (state.dehydrated !== null) {
                  pushSuspenseContext(workInProgress2, setDefaultShallowSuspenseContext(suspenseStackCursor.current));
                  workInProgress2.flags |= DidCapture;
                  return 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);
        }
        function beginWork(current2, workInProgress2, renderLanes2) {
          {
            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() || // Force a re-render if the implementation changed due to hot reload:
            workInProgress2.type !== current2.type) {
              didReceiveUpdate = true;
            } else {
              var hasScheduledUpdateOrContext = checkScheduledUpdateOrContext(current2, renderLanes2);
              if (!hasScheduledUpdateOrContext && // If this is the second pass of an error or suspense boundary, there
              // may not be work scheduled on `current`, so we check for this flag.
              (workInProgress2.flags & DidCapture) === NoFlags) {
                didReceiveUpdate = false;
                return attemptEarlyBailoutIfNoScheduledUpdate(current2, workInProgress2, renderLanes2);
              }
              if ((current2.flags & ForceUpdateForLegacySuspense) !== NoFlags) {
                didReceiveUpdate = true;
              } else {
                didReceiveUpdate = false;
              }
            }
          } else {
            didReceiveUpdate = false;
            if (getIsHydrating() && isForkedChild(workInProgress2)) {
              var slotIndex = workInProgress2.index;
              var numberOfForks = getForksAtLevel();
              pushTreeId(workInProgress2, numberOfForks, slotIndex);
            }
          }
          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, renderLanes2);
            }
            case FunctionComponent: {
              var Component8 = workInProgress2.type;
              var unresolvedProps = workInProgress2.pendingProps;
              var resolvedProps = workInProgress2.elementType === Component8 ? unresolvedProps : resolveDefaultProps(Component8, unresolvedProps);
              return updateFunctionComponent(current2, workInProgress2, Component8, resolvedProps, renderLanes2);
            }
            case ClassComponent: {
              var _Component = workInProgress2.type;
              var _unresolvedProps = workInProgress2.pendingProps;
              var _resolvedProps = workInProgress2.elementType === _Component ? _unresolvedProps : resolveDefaultProps(_Component, _unresolvedProps);
              return updateClassComponent(current2, workInProgress2, _Component, _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 Fragment9:
              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,
                      // Resolved for outer only
                      "prop",
                      getComponentNameFromType(_type2)
                    );
                  }
                }
              }
              _resolvedProps3 = resolveDefaultProps(_type2.type, _resolvedProps3);
              return updateMemoComponent(current2, workInProgress2, _type2, _resolvedProps3, renderLanes2);
            }
            case SimpleMemoComponent: {
              return updateSimpleMemoComponent(current2, workInProgress2, workInProgress2.type, workInProgress2.pendingProps, renderLanes2);
            }
            case IncompleteClassComponent: {
              var _Component2 = workInProgress2.type;
              var _unresolvedProps4 = workInProgress2.pendingProps;
              var _resolvedProps4 = workInProgress2.elementType === _Component2 ? _unresolvedProps4 : resolveDefaultProps(_Component2, _unresolvedProps4);
              return mountIncompleteClassComponent(current2, workInProgress2, _Component2, _resolvedProps4, renderLanes2);
            }
            case SuspenseListComponent: {
              return updateSuspenseListComponent(current2, workInProgress2, renderLanes2);
            }
            case ScopeComponent: {
              break;
            }
            case OffscreenComponent: {
              return updateOffscreenComponent(current2, workInProgress2, renderLanes2);
            }
          }
          throw new 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;
          {
            workInProgress2.flags |= RefStatic;
          }
        }
        var appendAllChildren;
        var updateHostContainer;
        var updateHostComponent$1;
        var updateHostText$1;
        {
          appendAllChildren = function(parent, workInProgress2, needsVisibilityToggle, isHidden) {
            var node56 = workInProgress2.child;
            while (node56 !== null) {
              if (node56.tag === HostComponent || node56.tag === HostText) {
                appendInitialChild(parent, node56.stateNode);
              } else if (node56.tag === HostPortal)
                ;
              else if (node56.child !== null) {
                node56.child.return = node56;
                node56 = node56.child;
                continue;
              }
              if (node56 === workInProgress2) {
                return;
              }
              while (node56.sibling === null) {
                if (node56.return === null || node56.return === workInProgress2) {
                  return;
                }
                node56 = node56.return;
              }
              node56.sibling.return = node56.return;
              node56 = node56.sibling;
            }
          };
          updateHostContainer = function(current2, 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 bubbleProperties(completedWork) {
          var didBailout = completedWork.alternate !== null && completedWork.alternate.child === completedWork.child;
          var newChildLanes = NoLanes;
          var subtreeFlags = NoFlags;
          if (!didBailout) {
            if ((completedWork.mode & ProfileMode) !== NoMode) {
              var actualDuration = completedWork.actualDuration;
              var treeBaseDuration = completedWork.selfBaseDuration;
              var child = completedWork.child;
              while (child !== null) {
                newChildLanes = mergeLanes(newChildLanes, mergeLanes(child.lanes, child.childLanes));
                subtreeFlags |= child.subtreeFlags;
                subtreeFlags |= child.flags;
                actualDuration += child.actualDuration;
                treeBaseDuration += child.treeBaseDuration;
                child = child.sibling;
              }
              completedWork.actualDuration = actualDuration;
              completedWork.treeBaseDuration = treeBaseDuration;
            } else {
              var _child = completedWork.child;
              while (_child !== null) {
                newChildLanes = mergeLanes(newChildLanes, mergeLanes(_child.lanes, _child.childLanes));
                subtreeFlags |= _child.subtreeFlags;
                subtreeFlags |= _child.flags;
                _child.return = completedWork;
                _child = _child.sibling;
              }
            }
            completedWork.subtreeFlags |= subtreeFlags;
          } else {
            if ((completedWork.mode & ProfileMode) !== NoMode) {
              var _treeBaseDuration = completedWork.selfBaseDuration;
              var _child2 = completedWork.child;
              while (_child2 !== null) {
                newChildLanes = mergeLanes(newChildLanes, mergeLanes(_child2.lanes, _child2.childLanes));
                subtreeFlags |= _child2.subtreeFlags & StaticMask;
                subtreeFlags |= _child2.flags & StaticMask;
                _treeBaseDuration += _child2.treeBaseDuration;
                _child2 = _child2.sibling;
              }
              completedWork.treeBaseDuration = _treeBaseDuration;
            } else {
              var _child3 = completedWork.child;
              while (_child3 !== null) {
                newChildLanes = mergeLanes(newChildLanes, mergeLanes(_child3.lanes, _child3.childLanes));
                subtreeFlags |= _child3.subtreeFlags & StaticMask;
                subtreeFlags |= _child3.flags & StaticMask;
                _child3.return = completedWork;
                _child3 = _child3.sibling;
              }
            }
            completedWork.subtreeFlags |= subtreeFlags;
          }
          completedWork.childLanes = newChildLanes;
          return didBailout;
        }
        function completeDehydratedSuspenseBoundary(current2, workInProgress2, nextState) {
          if (hasUnhydratedTailNodes() && (workInProgress2.mode & ConcurrentMode) !== NoMode && (workInProgress2.flags & DidCapture) === NoFlags) {
            warnIfUnhydratedTailNodes(workInProgress2);
            resetHydrationState();
            workInProgress2.flags |= ForceClientRender | Incomplete | ShouldCapture;
            return false;
          }
          var wasHydrated = popHydrationState(workInProgress2);
          if (nextState !== null && nextState.dehydrated !== null) {
            if (current2 === null) {
              if (!wasHydrated) {
                throw new Error("A dehydrated suspense component was completed without a hydrated node. This is probably a bug in React.");
              }
              prepareToHydrateHostSuspenseInstance(workInProgress2);
              bubbleProperties(workInProgress2);
              {
                if ((workInProgress2.mode & ProfileMode) !== NoMode) {
                  var isTimedOutSuspense = nextState !== null;
                  if (isTimedOutSuspense) {
                    var primaryChildFragment = workInProgress2.child;
                    if (primaryChildFragment !== null) {
                      workInProgress2.treeBaseDuration -= primaryChildFragment.treeBaseDuration;
                    }
                  }
                }
              }
              return false;
            } else {
              resetHydrationState();
              if ((workInProgress2.flags & DidCapture) === NoFlags) {
                workInProgress2.memoizedState = null;
              }
              workInProgress2.flags |= Update;
              bubbleProperties(workInProgress2);
              {
                if ((workInProgress2.mode & ProfileMode) !== NoMode) {
                  var _isTimedOutSuspense = nextState !== null;
                  if (_isTimedOutSuspense) {
                    var _primaryChildFragment = workInProgress2.child;
                    if (_primaryChildFragment !== null) {
                      workInProgress2.treeBaseDuration -= _primaryChildFragment.treeBaseDuration;
                    }
                  }
                }
              }
              return false;
            }
          } else {
            upgradeHydrationErrorsToRecoverable();
            return true;
          }
        }
        function completeWork(current2, workInProgress2, renderLanes2) {
          var newProps = workInProgress2.pendingProps;
          popTreeContext(workInProgress2);
          switch (workInProgress2.tag) {
            case IndeterminateComponent:
            case LazyComponent:
            case SimpleMemoComponent:
            case FunctionComponent:
            case ForwardRef:
            case Fragment9:
            case Mode:
            case Profiler:
            case ContextConsumer:
            case MemoComponent:
              bubbleProperties(workInProgress2);
              return null;
            case ClassComponent: {
              var Component8 = workInProgress2.type;
              if (isContextProvider(Component8)) {
                popContext(workInProgress2);
              }
              bubbleProperties(workInProgress2);
              return null;
            }
            case HostRoot: {
              var fiberRoot = workInProgress2.stateNode;
              popHostContainer(workInProgress2);
              popTopLevelContextObject(workInProgress2);
              resetWorkInProgressVersions();
              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 (current2 !== null) {
                    var prevState = current2.memoizedState;
                    if (
                      // Check if this is a client root
                      !prevState.isDehydrated || // Check if we reverted to client rendering (e.g. due to an error)
                      (workInProgress2.flags & ForceClientRender) !== NoFlags
                    ) {
                      workInProgress2.flags |= Snapshot;
                      upgradeHydrationErrorsToRecoverable();
                    }
                  }
                }
              }
              updateHostContainer(current2, workInProgress2);
              bubbleProperties(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 new Error("We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.");
                  }
                  bubbleProperties(workInProgress2);
                  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);
                }
              }
              bubbleProperties(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 new 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);
                }
              }
              bubbleProperties(workInProgress2);
              return null;
            }
            case SuspenseComponent: {
              popSuspenseContext(workInProgress2);
              var nextState = workInProgress2.memoizedState;
              if (current2 === null || current2.memoizedState !== null && current2.memoizedState.dehydrated !== null) {
                var fallthroughToNormalSuspensePath = completeDehydratedSuspenseBoundary(current2, workInProgress2, nextState);
                if (!fallthroughToNormalSuspensePath) {
                  if (workInProgress2.flags & ShouldCapture) {
                    return workInProgress2;
                  } else {
                    return null;
                  }
                }
              }
              if ((workInProgress2.flags & DidCapture) !== NoFlags) {
                workInProgress2.lanes = renderLanes2;
                if ((workInProgress2.mode & ProfileMode) !== NoMode) {
                  transferActualDuration(workInProgress2);
                }
                return workInProgress2;
              }
              var nextDidTimeout = nextState !== null;
              var prevDidTimeout = current2 !== null && current2.memoizedState !== null;
              if (nextDidTimeout !== prevDidTimeout) {
                if (nextDidTimeout) {
                  var _offscreenFiber2 = workInProgress2.child;
                  _offscreenFiber2.flags |= Visibility2;
                  if ((workInProgress2.mode & ConcurrentMode) !== NoMode) {
                    var hasInvisibleChildContext = current2 === null && (workInProgress2.memoizedProps.unstable_avoidThisFallback !== true || !enableSuspenseAvoidThisFallback);
                    if (hasInvisibleChildContext || hasSuspenseContext(suspenseStackCursor.current, InvisibleParentSuspenseContext)) {
                      renderDidSuspend();
                    } else {
                      renderDidSuspendDelayIfPossible();
                    }
                  }
                }
              }
              var wakeables = workInProgress2.updateQueue;
              if (wakeables !== null) {
                workInProgress2.flags |= Update;
              }
              bubbleProperties(workInProgress2);
              {
                if ((workInProgress2.mode & ProfileMode) !== NoMode) {
                  if (nextDidTimeout) {
                    var primaryChildFragment = workInProgress2.child;
                    if (primaryChildFragment !== null) {
                      workInProgress2.treeBaseDuration -= primaryChildFragment.treeBaseDuration;
                    }
                  }
                }
              }
              return null;
            }
            case HostPortal:
              popHostContainer(workInProgress2);
              updateHostContainer(current2, workInProgress2);
              if (current2 === null) {
                preparePortalMount(workInProgress2.stateNode.containerInfo);
              }
              bubbleProperties(workInProgress2);
              return null;
            case ContextProvider:
              var context2 = workInProgress2.type._context;
              popProvider(context2, workInProgress2);
              bubbleProperties(workInProgress2);
              return null;
            case IncompleteClassComponent: {
              var _Component = workInProgress2.type;
              if (isContextProvider(_Component)) {
                popContext(workInProgress2);
              }
              bubbleProperties(workInProgress2);
              return null;
            }
            case SuspenseListComponent: {
              popSuspenseContext(workInProgress2);
              var renderState = workInProgress2.memoizedState;
              if (renderState === null) {
                bubbleProperties(workInProgress2);
                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 newThenables = suspended.updateQueue;
                        if (newThenables !== null) {
                          workInProgress2.updateQueue = newThenables;
                          workInProgress2.flags |= Update;
                        }
                        workInProgress2.subtreeFlags = NoFlags;
                        resetChildFibers(workInProgress2, renderLanes2);
                        pushSuspenseContext(workInProgress2, setShallowSuspenseContext(suspenseStackCursor.current, ForceSuspenseFallback));
                        return workInProgress2.child;
                      }
                      row = row.sibling;
                    }
                  }
                  if (renderState.tail !== null && now2() > getRenderTargetTime()) {
                    workInProgress2.flags |= DidCapture;
                    didSuspendAlready = true;
                    cutOffTailIfNeeded(renderState, false);
                    workInProgress2.lanes = SomeRetryLane;
                  }
                } else {
                  cutOffTailIfNeeded(renderState, false);
                }
              } else {
                if (!didSuspendAlready) {
                  var _suspended = findFirstSuspended(renderedTail);
                  if (_suspended !== null) {
                    workInProgress2.flags |= DidCapture;
                    didSuspendAlready = true;
                    var _newThenables = _suspended.updateQueue;
                    if (_newThenables !== null) {
                      workInProgress2.updateQueue = _newThenables;
                      workInProgress2.flags |= Update;
                    }
                    cutOffTailIfNeeded(renderState, true);
                    if (renderState.tail === null && renderState.tailMode === "hidden" && !renderedTail.alternate && !getIsHydrating()) {
                      bubbleProperties(workInProgress2);
                      return null;
                    }
                  } else if (
                    // The time it took to render last row is greater than the remaining
                    // time we have to render. So rendering one more row would likely
                    // exceed it.
                    now2() * 2 - renderState.renderingStartTime > getRenderTargetTime() && renderLanes2 !== OffscreenLane
                  ) {
                    workInProgress2.flags |= DidCapture;
                    didSuspendAlready = true;
                    cutOffTailIfNeeded(renderState, false);
                    workInProgress2.lanes = 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 next2 = renderState.tail;
                renderState.rendering = next2;
                renderState.tail = next2.sibling;
                renderState.renderingStartTime = now2();
                next2.sibling = null;
                var suspenseContext = suspenseStackCursor.current;
                if (didSuspendAlready) {
                  suspenseContext = setShallowSuspenseContext(suspenseContext, ForceSuspenseFallback);
                } else {
                  suspenseContext = setDefaultShallowSuspenseContext(suspenseContext);
                }
                pushSuspenseContext(workInProgress2, suspenseContext);
                return next2;
              }
              bubbleProperties(workInProgress2);
              return null;
            }
            case ScopeComponent: {
              break;
            }
            case OffscreenComponent:
            case LegacyHiddenComponent: {
              popRenderLanes(workInProgress2);
              var _nextState = workInProgress2.memoizedState;
              var nextIsHidden = _nextState !== null;
              if (current2 !== null) {
                var _prevState = current2.memoizedState;
                var prevIsHidden = _prevState !== null;
                if (prevIsHidden !== nextIsHidden && // LegacyHidden doesn't do any hiding — it only pre-renders.
                !enableLegacyHidden) {
                  workInProgress2.flags |= Visibility2;
                }
              }
              if (!nextIsHidden || (workInProgress2.mode & ConcurrentMode) === NoMode) {
                bubbleProperties(workInProgress2);
              } else {
                if (includesSomeLane(subtreeRenderLanes, OffscreenLane)) {
                  bubbleProperties(workInProgress2);
                  {
                    if (workInProgress2.subtreeFlags & (Placement | Update)) {
                      workInProgress2.flags |= Visibility2;
                    }
                  }
                }
              }
              return null;
            }
            case CacheComponent: {
              return null;
            }
            case TracingMarkerComponent: {
              return null;
            }
          }
          throw new Error("Unknown unit of work tag (" + workInProgress2.tag + "). This error is likely caused by a bug in React. Please file an issue.");
        }
        function unwindWork(current2, workInProgress2, renderLanes2) {
          popTreeContext(workInProgress2);
          switch (workInProgress2.tag) {
            case ClassComponent: {
              var Component8 = workInProgress2.type;
              if (isContextProvider(Component8)) {
                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: {
              var root3 = workInProgress2.stateNode;
              popHostContainer(workInProgress2);
              popTopLevelContextObject(workInProgress2);
              resetWorkInProgressVersions();
              var _flags = workInProgress2.flags;
              if ((_flags & ShouldCapture) !== NoFlags && (_flags & DidCapture) === NoFlags) {
                workInProgress2.flags = _flags & ~ShouldCapture | DidCapture;
                return workInProgress2;
              }
              return null;
            }
            case HostComponent: {
              popHostContext(workInProgress2);
              return null;
            }
            case SuspenseComponent: {
              popSuspenseContext(workInProgress2);
              var suspenseState = workInProgress2.memoizedState;
              if (suspenseState !== null && suspenseState.dehydrated !== null) {
                if (workInProgress2.alternate === null) {
                  throw new Error("Threw in newly mounted dehydrated component. This is likely a bug in React. Please file an issue.");
                }
                resetHydrationState();
              }
              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:
              var context2 = workInProgress2.type._context;
              popProvider(context2, workInProgress2);
              return null;
            case OffscreenComponent:
            case LegacyHiddenComponent:
              popRenderLanes(workInProgress2);
              return null;
            case CacheComponent:
              return null;
            default:
              return null;
          }
        }
        function unwindInterruptedWork(current2, interruptedWork, renderLanes2) {
          popTreeContext(interruptedWork);
          switch (interruptedWork.tag) {
            case ClassComponent: {
              var childContextTypes = interruptedWork.type.childContextTypes;
              if (childContextTypes !== null && childContextTypes !== void 0) {
                popContext(interruptedWork);
              }
              break;
            }
            case HostRoot: {
              var root3 = interruptedWork.stateNode;
              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:
              var context2 = interruptedWork.type._context;
              popProvider(context2, interruptedWork);
              break;
            case OffscreenComponent:
            case LegacyHiddenComponent:
              popRenderLanes(interruptedWork);
              break;
          }
        }
        var didWarnAboutUndefinedSnapshotBeforeUpdate = null;
        {
          didWarnAboutUndefinedSnapshotBeforeUpdate = /* @__PURE__ */ new Set();
        }
        var offscreenSubtreeIsHidden = false;
        var offscreenSubtreeWasHidden = false;
        var PossiblyWeakSet = typeof WeakSet === "function" ? WeakSet : Set;
        var nextEffect = null;
        var inProgressLanes = null;
        var inProgressRoot = null;
        function reportUncaughtErrorInDEV(error2) {
          {
            invokeGuardedCallback(null, function() {
              throw error2;
            });
            clearCaughtError();
          }
        }
        var callComponentWillUnmountWithTimer = function(current2, instance) {
          instance.props = current2.memoizedProps;
          instance.state = current2.memoizedState;
          if (current2.mode & ProfileMode) {
            try {
              startLayoutEffectTimer();
              instance.componentWillUnmount();
            } finally {
              recordLayoutEffectDuration(current2);
            }
          } else {
            instance.componentWillUnmount();
          }
        };
        function safelyCallCommitHookLayoutEffectListMount(current2, nearestMountedAncestor) {
          try {
            commitHookEffectListMount(Layout2, current2);
          } catch (error2) {
            captureCommitPhaseError(current2, nearestMountedAncestor, error2);
          }
        }
        function safelyCallComponentWillUnmount(current2, nearestMountedAncestor, instance) {
          try {
            callComponentWillUnmountWithTimer(current2, instance);
          } catch (error2) {
            captureCommitPhaseError(current2, nearestMountedAncestor, error2);
          }
        }
        function safelyCallComponentDidMount(current2, nearestMountedAncestor, instance) {
          try {
            instance.componentDidMount();
          } catch (error2) {
            captureCommitPhaseError(current2, nearestMountedAncestor, error2);
          }
        }
        function safelyAttachRef(current2, nearestMountedAncestor) {
          try {
            commitAttachRef(current2);
          } catch (error2) {
            captureCommitPhaseError(current2, nearestMountedAncestor, error2);
          }
        }
        function safelyDetachRef(current2, nearestMountedAncestor) {
          var ref = current2.ref;
          if (ref !== null) {
            if (typeof ref === "function") {
              var retVal;
              try {
                if (enableProfilerTimer && enableProfilerCommitHooks && current2.mode & ProfileMode) {
                  try {
                    startLayoutEffectTimer();
                    retVal = ref(null);
                  } finally {
                    recordLayoutEffectDuration(current2);
                  }
                } else {
                  retVal = ref(null);
                }
              } catch (error2) {
                captureCommitPhaseError(current2, nearestMountedAncestor, error2);
              }
              {
                if (typeof retVal === "function") {
                  error("Unexpected return value from a callback ref in %s. A callback ref should not return a function.", getComponentNameFromFiber(current2));
                }
              }
            } else {
              ref.current = null;
            }
          }
        }
        function safelyCallDestroy(current2, nearestMountedAncestor, destroy) {
          try {
            destroy();
          } catch (error2) {
            captureCommitPhaseError(current2, nearestMountedAncestor, error2);
          }
        }
        var focusedInstanceHandle = null;
        var shouldFireAfterActiveInstanceBlur = false;
        function commitBeforeMutationEffects(root3, firstChild) {
          focusedInstanceHandle = prepareForCommit(root3.containerInfo);
          nextEffect = firstChild;
          commitBeforeMutationEffects_begin();
          var shouldFire = shouldFireAfterActiveInstanceBlur;
          shouldFireAfterActiveInstanceBlur = false;
          focusedInstanceHandle = null;
          return shouldFire;
        }
        function commitBeforeMutationEffects_begin() {
          while (nextEffect !== null) {
            var fiber = nextEffect;
            var child = fiber.child;
            if ((fiber.subtreeFlags & BeforeMutationMask) !== NoFlags && child !== null) {
              child.return = fiber;
              nextEffect = child;
            } else {
              commitBeforeMutationEffects_complete();
            }
          }
        }
        function commitBeforeMutationEffects_complete() {
          while (nextEffect !== null) {
            var fiber = nextEffect;
            setCurrentFiber(fiber);
            try {
              commitBeforeMutationEffectsOnFiber(fiber);
            } catch (error2) {
              captureCommitPhaseError(fiber, fiber.return, error2);
            }
            resetCurrentFiber();
            var sibling = fiber.sibling;
            if (sibling !== null) {
              sibling.return = fiber.return;
              nextEffect = sibling;
              return;
            }
            nextEffect = fiber.return;
          }
        }
        function commitBeforeMutationEffectsOnFiber(finishedWork) {
          var current2 = finishedWork.alternate;
          var flags = finishedWork.flags;
          if ((flags & Snapshot) !== NoFlags) {
            setCurrentFiber(finishedWork);
            switch (finishedWork.tag) {
              case FunctionComponent:
              case ForwardRef:
              case SimpleMemoComponent: {
                break;
              }
              case ClassComponent: {
                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.", getComponentNameFromFiber(finishedWork) || "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.", getComponentNameFromFiber(finishedWork) || "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.", getComponentNameFromFiber(finishedWork));
                    }
                  }
                  instance.__reactInternalSnapshotBeforeUpdate = snapshot;
                }
                break;
              }
              case HostRoot: {
                {
                  var root3 = finishedWork.stateNode;
                  clearContainer(root3.containerInfo);
                }
                break;
              }
              case HostComponent:
              case HostText:
              case HostPortal:
              case IncompleteClassComponent:
                break;
              default: {
                throw new 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.");
              }
            }
            resetCurrentFiber();
          }
        }
        function commitHookEffectListUnmount(flags, finishedWork, nearestMountedAncestor) {
          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 & flags) === flags) {
                var destroy = effect.destroy;
                effect.destroy = void 0;
                if (destroy !== void 0) {
                  {
                    if ((flags & Passive$1) !== NoFlags$1) {
                      markComponentPassiveEffectUnmountStarted(finishedWork);
                    } else if ((flags & Layout2) !== NoFlags$1) {
                      markComponentLayoutEffectUnmountStarted(finishedWork);
                    }
                  }
                  {
                    if ((flags & Insertion5) !== NoFlags$1) {
                      setIsRunningInsertionEffect(true);
                    }
                  }
                  safelyCallDestroy(finishedWork, nearestMountedAncestor, destroy);
                  {
                    if ((flags & Insertion5) !== NoFlags$1) {
                      setIsRunningInsertionEffect(false);
                    }
                  }
                  {
                    if ((flags & Passive$1) !== NoFlags$1) {
                      markComponentPassiveEffectUnmountStopped();
                    } else if ((flags & Layout2) !== NoFlags$1) {
                      markComponentLayoutEffectUnmountStopped();
                    }
                  }
                }
              }
              effect = effect.next;
            } while (effect !== firstEffect);
          }
        }
        function commitHookEffectListMount(flags, 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 & flags) === flags) {
                {
                  if ((flags & Passive$1) !== NoFlags$1) {
                    markComponentPassiveEffectMountStarted(finishedWork);
                  } else if ((flags & Layout2) !== NoFlags$1) {
                    markComponentLayoutEffectMountStarted(finishedWork);
                  }
                }
                var create4 = effect.create;
                {
                  if ((flags & Insertion5) !== NoFlags$1) {
                    setIsRunningInsertionEffect(true);
                  }
                }
                effect.destroy = create4();
                {
                  if ((flags & Insertion5) !== NoFlags$1) {
                    setIsRunningInsertionEffect(false);
                  }
                }
                {
                  if ((flags & Passive$1) !== NoFlags$1) {
                    markComponentPassiveEffectMountStopped();
                  } else if ((flags & Layout2) !== NoFlags$1) {
                    markComponentLayoutEffectMountStopped();
                  }
                }
                {
                  var destroy = effect.destroy;
                  if (destroy !== void 0 && typeof destroy !== "function") {
                    var hookName = void 0;
                    if ((effect.tag & Layout2) !== NoFlags) {
                      hookName = "useLayoutEffect";
                    } else if ((effect.tag & Insertion5) !== NoFlags) {
                      hookName = "useInsertionEffect";
                    } else {
                      hookName = "useEffect";
                    }
                    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 " + hookName + "(async () => ...) or returned a Promise. Instead, write the async function inside your effect and call it immediately:\n\n" + hookName + "(() => {\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("%s must not return anything besides a function, which is used for clean-up.%s", hookName, addendum);
                  }
                }
              }
              effect = effect.next;
            } while (effect !== firstEffect);
          }
        }
        function commitPassiveEffectDurations(finishedRoot, finishedWork) {
          {
            if ((finishedWork.flags & Update) !== NoFlags) {
              switch (finishedWork.tag) {
                case Profiler: {
                  var passiveEffectDuration = finishedWork.stateNode.passiveEffectDuration;
                  var _finishedWork$memoize = finishedWork.memoizedProps, id2 = _finishedWork$memoize.id, onPostCommit = _finishedWork$memoize.onPostCommit;
                  var commitTime2 = getCommitTime();
                  var phase = finishedWork.alternate === null ? "mount" : "update";
                  {
                    if (isCurrentUpdateNested()) {
                      phase = "nested-update";
                    }
                  }
                  if (typeof onPostCommit === "function") {
                    onPostCommit(id2, phase, passiveEffectDuration, commitTime2);
                  }
                  var parentFiber = finishedWork.return;
                  outer:
                    while (parentFiber !== null) {
                      switch (parentFiber.tag) {
                        case HostRoot:
                          var root3 = parentFiber.stateNode;
                          root3.passiveEffectDuration += passiveEffectDuration;
                          break outer;
                        case Profiler:
                          var parentStateNode = parentFiber.stateNode;
                          parentStateNode.passiveEffectDuration += passiveEffectDuration;
                          break outer;
                      }
                      parentFiber = parentFiber.return;
                    }
                  break;
                }
              }
            }
          }
        }
        function commitLayoutEffectOnFiber(finishedRoot, current2, finishedWork, committedLanes) {
          if ((finishedWork.flags & LayoutMask) !== NoFlags) {
            switch (finishedWork.tag) {
              case FunctionComponent:
              case ForwardRef:
              case SimpleMemoComponent: {
                if (!offscreenSubtreeWasHidden) {
                  if (finishedWork.mode & ProfileMode) {
                    try {
                      startLayoutEffectTimer();
                      commitHookEffectListMount(Layout2 | HasEffect, finishedWork);
                    } finally {
                      recordLayoutEffectDuration(finishedWork);
                    }
                  } else {
                    commitHookEffectListMount(Layout2 | HasEffect, finishedWork);
                  }
                }
                break;
              }
              case ClassComponent: {
                var instance = finishedWork.stateNode;
                if (finishedWork.flags & Update) {
                  if (!offscreenSubtreeWasHidden) {
                    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.", getComponentNameFromFiber(finishedWork) || "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.", getComponentNameFromFiber(finishedWork) || "instance");
                          }
                        }
                      }
                      if (finishedWork.mode & ProfileMode) {
                        try {
                          startLayoutEffectTimer();
                          instance.componentDidMount();
                        } finally {
                          recordLayoutEffectDuration(finishedWork);
                        }
                      } else {
                        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.", getComponentNameFromFiber(finishedWork) || "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.", getComponentNameFromFiber(finishedWork) || "instance");
                          }
                        }
                      }
                      if (finishedWork.mode & ProfileMode) {
                        try {
                          startLayoutEffectTimer();
                          instance.componentDidUpdate(prevProps, prevState, instance.__reactInternalSnapshotBeforeUpdate);
                        } finally {
                          recordLayoutEffectDuration(finishedWork);
                        }
                      } else {
                        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.", getComponentNameFromFiber(finishedWork) || "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.", getComponentNameFromFiber(finishedWork) || "instance");
                      }
                    }
                  }
                  commitUpdateQueue(finishedWork, updateQueue, instance);
                }
                break;
              }
              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);
                }
                break;
              }
              case HostComponent: {
                var _instance2 = finishedWork.stateNode;
                if (current2 === null && finishedWork.flags & Update) {
                  var type = finishedWork.type;
                  var props = finishedWork.memoizedProps;
                  commitMount(_instance2, type, props);
                }
                break;
              }
              case HostText: {
                break;
              }
              case HostPortal: {
                break;
              }
              case Profiler: {
                {
                  var _finishedWork$memoize2 = finishedWork.memoizedProps, onCommit = _finishedWork$memoize2.onCommit, onRender = _finishedWork$memoize2.onRender;
                  var effectDuration = finishedWork.stateNode.effectDuration;
                  var commitTime2 = getCommitTime();
                  var phase = current2 === null ? "mount" : "update";
                  {
                    if (isCurrentUpdateNested()) {
                      phase = "nested-update";
                    }
                  }
                  if (typeof onRender === "function") {
                    onRender(finishedWork.memoizedProps.id, phase, finishedWork.actualDuration, finishedWork.treeBaseDuration, finishedWork.actualStartTime, commitTime2);
                  }
                  {
                    if (typeof onCommit === "function") {
                      onCommit(finishedWork.memoizedProps.id, phase, effectDuration, commitTime2);
                    }
                    enqueuePendingPassiveProfilerEffect(finishedWork);
                    var parentFiber = finishedWork.return;
                    outer:
                      while (parentFiber !== null) {
                        switch (parentFiber.tag) {
                          case HostRoot:
                            var root3 = parentFiber.stateNode;
                            root3.effectDuration += effectDuration;
                            break outer;
                          case Profiler:
                            var parentStateNode = parentFiber.stateNode;
                            parentStateNode.effectDuration += effectDuration;
                            break outer;
                        }
                        parentFiber = parentFiber.return;
                      }
                  }
                }
                break;
              }
              case SuspenseComponent: {
                commitSuspenseHydrationCallbacks(finishedRoot, finishedWork);
                break;
              }
              case SuspenseListComponent:
              case IncompleteClassComponent:
              case ScopeComponent:
              case OffscreenComponent:
              case LegacyHiddenComponent:
              case TracingMarkerComponent: {
                break;
              }
              default:
                throw new 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.");
            }
          }
          if (!offscreenSubtreeWasHidden) {
            {
              if (finishedWork.flags & Ref) {
                commitAttachRef(finishedWork);
              }
            }
          }
        }
        function reappearLayoutEffectsOnFiber(node56) {
          switch (node56.tag) {
            case FunctionComponent:
            case ForwardRef:
            case SimpleMemoComponent: {
              if (node56.mode & ProfileMode) {
                try {
                  startLayoutEffectTimer();
                  safelyCallCommitHookLayoutEffectListMount(node56, node56.return);
                } finally {
                  recordLayoutEffectDuration(node56);
                }
              } else {
                safelyCallCommitHookLayoutEffectListMount(node56, node56.return);
              }
              break;
            }
            case ClassComponent: {
              var instance = node56.stateNode;
              if (typeof instance.componentDidMount === "function") {
                safelyCallComponentDidMount(node56, node56.return, instance);
              }
              safelyAttachRef(node56, node56.return);
              break;
            }
            case HostComponent: {
              safelyAttachRef(node56, node56.return);
              break;
            }
          }
        }
        function hideOrUnhideAllChildren(finishedWork, isHidden) {
          var hostSubtreeRoot = null;
          {
            var node56 = finishedWork;
            while (true) {
              if (node56.tag === HostComponent) {
                if (hostSubtreeRoot === null) {
                  hostSubtreeRoot = node56;
                  try {
                    var instance = node56.stateNode;
                    if (isHidden) {
                      hideInstance(instance);
                    } else {
                      unhideInstance(node56.stateNode, node56.memoizedProps);
                    }
                  } catch (error2) {
                    captureCommitPhaseError(finishedWork, finishedWork.return, error2);
                  }
                }
              } else if (node56.tag === HostText) {
                if (hostSubtreeRoot === null) {
                  try {
                    var _instance3 = node56.stateNode;
                    if (isHidden) {
                      hideTextInstance(_instance3);
                    } else {
                      unhideTextInstance(_instance3, node56.memoizedProps);
                    }
                  } catch (error2) {
                    captureCommitPhaseError(finishedWork, finishedWork.return, error2);
                  }
                }
              } else if ((node56.tag === OffscreenComponent || node56.tag === LegacyHiddenComponent) && node56.memoizedState !== null && node56 !== finishedWork)
                ;
              else if (node56.child !== null) {
                node56.child.return = node56;
                node56 = node56.child;
                continue;
              }
              if (node56 === finishedWork) {
                return;
              }
              while (node56.sibling === null) {
                if (node56.return === null || node56.return === finishedWork) {
                  return;
                }
                if (hostSubtreeRoot === node56) {
                  hostSubtreeRoot = null;
                }
                node56 = node56.return;
              }
              if (hostSubtreeRoot === node56) {
                hostSubtreeRoot = null;
              }
              node56.sibling.return = node56.return;
              node56 = node56.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") {
              var retVal;
              if (finishedWork.mode & ProfileMode) {
                try {
                  startLayoutEffectTimer();
                  retVal = ref(instanceToUse);
                } finally {
                  recordLayoutEffectDuration(finishedWork);
                }
              } else {
                retVal = ref(instanceToUse);
              }
              {
                if (typeof retVal === "function") {
                  error("Unexpected return value from a callback ref in %s. A callback ref should not return a function.", getComponentNameFromFiber(finishedWork));
                }
              }
            } else {
              {
                if (!ref.hasOwnProperty("current")) {
                  error("Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().", getComponentNameFromFiber(finishedWork));
                }
              }
              ref.current = instanceToUse;
            }
          }
        }
        function detachFiberMutation(fiber) {
          var alternate = fiber.alternate;
          if (alternate !== null) {
            alternate.return = null;
          }
          fiber.return = null;
        }
        function detachFiberAfterEffects(fiber) {
          var alternate = fiber.alternate;
          if (alternate !== null) {
            fiber.alternate = null;
            detachFiberAfterEffects(alternate);
          }
          {
            fiber.child = null;
            fiber.deletions = null;
            fiber.sibling = null;
            if (fiber.tag === HostComponent) {
              var hostInstance = fiber.stateNode;
              if (hostInstance !== null) {
                detachDeletedInstance(hostInstance);
              }
            }
            fiber.stateNode = null;
            {
              fiber._debugOwner = null;
            }
            {
              fiber.return = null;
              fiber.dependencies = null;
              fiber.memoizedProps = null;
              fiber.memoizedState = null;
              fiber.pendingProps = null;
              fiber.stateNode = null;
              fiber.updateQueue = null;
            }
          }
        }
        function getHostParentFiber(fiber) {
          var parent = fiber.return;
          while (parent !== null) {
            if (isHostParent(parent)) {
              return parent;
            }
            parent = parent.return;
          }
          throw new 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 node56 = fiber;
          siblings:
            while (true) {
              while (node56.sibling === null) {
                if (node56.return === null || isHostParent(node56.return)) {
                  return null;
                }
                node56 = node56.return;
              }
              node56.sibling.return = node56.return;
              node56 = node56.sibling;
              while (node56.tag !== HostComponent && node56.tag !== HostText && node56.tag !== DehydratedFragment) {
                if (node56.flags & Placement) {
                  continue siblings;
                }
                if (node56.child === null || node56.tag === HostPortal) {
                  continue siblings;
                } else {
                  node56.child.return = node56;
                  node56 = node56.child;
                }
              }
              if (!(node56.flags & Placement)) {
                return node56.stateNode;
              }
            }
        }
        function commitPlacement(finishedWork) {
          var parentFiber = getHostParentFiber(finishedWork);
          switch (parentFiber.tag) {
            case HostComponent: {
              var parent = parentFiber.stateNode;
              if (parentFiber.flags & ContentReset) {
                resetTextContent(parent);
                parentFiber.flags &= ~ContentReset;
              }
              var before = getHostSibling(finishedWork);
              insertOrAppendPlacementNode(finishedWork, before, parent);
              break;
            }
            case HostRoot:
            case HostPortal: {
              var _parent = parentFiber.stateNode.containerInfo;
              var _before = getHostSibling(finishedWork);
              insertOrAppendPlacementNodeIntoContainer(finishedWork, _before, _parent);
              break;
            }
            default:
              throw new Error("Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue.");
          }
        }
        function insertOrAppendPlacementNodeIntoContainer(node56, before, parent) {
          var tag = node56.tag;
          var isHost = tag === HostComponent || tag === HostText;
          if (isHost) {
            var stateNode = node56.stateNode;
            if (before) {
              insertInContainerBefore(parent, stateNode, before);
            } else {
              appendChildToContainer(parent, stateNode);
            }
          } else if (tag === HostPortal)
            ;
          else {
            var child = node56.child;
            if (child !== null) {
              insertOrAppendPlacementNodeIntoContainer(child, before, parent);
              var sibling = child.sibling;
              while (sibling !== null) {
                insertOrAppendPlacementNodeIntoContainer(sibling, before, parent);
                sibling = sibling.sibling;
              }
            }
          }
        }
        function insertOrAppendPlacementNode(node56, before, parent) {
          var tag = node56.tag;
          var isHost = tag === HostComponent || tag === HostText;
          if (isHost) {
            var stateNode = node56.stateNode;
            if (before) {
              insertBefore(parent, stateNode, before);
            } else {
              appendChild(parent, stateNode);
            }
          } else if (tag === HostPortal)
            ;
          else {
            var child = node56.child;
            if (child !== null) {
              insertOrAppendPlacementNode(child, before, parent);
              var sibling = child.sibling;
              while (sibling !== null) {
                insertOrAppendPlacementNode(sibling, before, parent);
                sibling = sibling.sibling;
              }
            }
          }
        }
        var hostParent = null;
        var hostParentIsContainer = false;
        function commitDeletionEffects(root3, returnFiber, deletedFiber) {
          {
            var parent = returnFiber;
            findParent:
              while (parent !== null) {
                switch (parent.tag) {
                  case HostComponent: {
                    hostParent = parent.stateNode;
                    hostParentIsContainer = false;
                    break findParent;
                  }
                  case HostRoot: {
                    hostParent = parent.stateNode.containerInfo;
                    hostParentIsContainer = true;
                    break findParent;
                  }
                  case HostPortal: {
                    hostParent = parent.stateNode.containerInfo;
                    hostParentIsContainer = true;
                    break findParent;
                  }
                }
                parent = parent.return;
              }
            if (hostParent === null) {
              throw new Error("Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.");
            }
            commitDeletionEffectsOnFiber(root3, returnFiber, deletedFiber);
            hostParent = null;
            hostParentIsContainer = false;
          }
          detachFiberMutation(deletedFiber);
        }
        function recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, parent) {
          var child = parent.child;
          while (child !== null) {
            commitDeletionEffectsOnFiber(finishedRoot, nearestMountedAncestor, child);
            child = child.sibling;
          }
        }
        function commitDeletionEffectsOnFiber(finishedRoot, nearestMountedAncestor, deletedFiber) {
          onCommitUnmount(deletedFiber);
          switch (deletedFiber.tag) {
            case HostComponent: {
              if (!offscreenSubtreeWasHidden) {
                safelyDetachRef(deletedFiber, nearestMountedAncestor);
              }
            }
            case HostText: {
              {
                var prevHostParent = hostParent;
                var prevHostParentIsContainer = hostParentIsContainer;
                hostParent = null;
                recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber);
                hostParent = prevHostParent;
                hostParentIsContainer = prevHostParentIsContainer;
                if (hostParent !== null) {
                  if (hostParentIsContainer) {
                    removeChildFromContainer(hostParent, deletedFiber.stateNode);
                  } else {
                    removeChild(hostParent, deletedFiber.stateNode);
                  }
                }
              }
              return;
            }
            case DehydratedFragment: {
              {
                if (hostParent !== null) {
                  if (hostParentIsContainer) {
                    clearSuspenseBoundaryFromContainer(hostParent, deletedFiber.stateNode);
                  } else {
                    clearSuspenseBoundary(hostParent, deletedFiber.stateNode);
                  }
                }
              }
              return;
            }
            case HostPortal: {
              {
                var _prevHostParent = hostParent;
                var _prevHostParentIsContainer = hostParentIsContainer;
                hostParent = deletedFiber.stateNode.containerInfo;
                hostParentIsContainer = true;
                recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber);
                hostParent = _prevHostParent;
                hostParentIsContainer = _prevHostParentIsContainer;
              }
              return;
            }
            case FunctionComponent:
            case ForwardRef:
            case MemoComponent:
            case SimpleMemoComponent: {
              if (!offscreenSubtreeWasHidden) {
                var updateQueue = deletedFiber.updateQueue;
                if (updateQueue !== null) {
                  var lastEffect = updateQueue.lastEffect;
                  if (lastEffect !== null) {
                    var firstEffect = lastEffect.next;
                    var effect = firstEffect;
                    do {
                      var _effect = effect, destroy = _effect.destroy, tag = _effect.tag;
                      if (destroy !== void 0) {
                        if ((tag & Insertion5) !== NoFlags$1) {
                          safelyCallDestroy(deletedFiber, nearestMountedAncestor, destroy);
                        } else if ((tag & Layout2) !== NoFlags$1) {
                          {
                            markComponentLayoutEffectUnmountStarted(deletedFiber);
                          }
                          if (deletedFiber.mode & ProfileMode) {
                            startLayoutEffectTimer();
                            safelyCallDestroy(deletedFiber, nearestMountedAncestor, destroy);
                            recordLayoutEffectDuration(deletedFiber);
                          } else {
                            safelyCallDestroy(deletedFiber, nearestMountedAncestor, destroy);
                          }
                          {
                            markComponentLayoutEffectUnmountStopped();
                          }
                        }
                      }
                      effect = effect.next;
                    } while (effect !== firstEffect);
                  }
                }
              }
              recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber);
              return;
            }
            case ClassComponent: {
              if (!offscreenSubtreeWasHidden) {
                safelyDetachRef(deletedFiber, nearestMountedAncestor);
                var instance = deletedFiber.stateNode;
                if (typeof instance.componentWillUnmount === "function") {
                  safelyCallComponentWillUnmount(deletedFiber, nearestMountedAncestor, instance);
                }
              }
              recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber);
              return;
            }
            case ScopeComponent: {
              recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber);
              return;
            }
            case OffscreenComponent: {
              if (
                // TODO: Remove this dead flag
                deletedFiber.mode & ConcurrentMode
              ) {
                var prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden;
                offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden || deletedFiber.memoizedState !== null;
                recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber);
                offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden;
              } else {
                recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber);
              }
              break;
            }
            default: {
              recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber);
              return;
            }
          }
        }
        function commitSuspenseCallback(finishedWork) {
          var newState = finishedWork.memoizedState;
        }
        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)) {
                retryCache.add(wakeable);
                {
                  if (isDevToolsPresent) {
                    if (inProgressLanes !== null && inProgressRoot !== null) {
                      restorePendingUpdaters(inProgressRoot, inProgressLanes);
                    } else {
                      throw Error("Expected finished root and lanes to be set. This is a bug in React.");
                    }
                  }
                }
                wakeable.then(retry, retry);
              }
            });
          }
        }
        function commitMutationEffects(root3, finishedWork, committedLanes) {
          inProgressLanes = committedLanes;
          inProgressRoot = root3;
          setCurrentFiber(finishedWork);
          commitMutationEffectsOnFiber(finishedWork, root3);
          setCurrentFiber(finishedWork);
          inProgressLanes = null;
          inProgressRoot = null;
        }
        function recursivelyTraverseMutationEffects(root3, parentFiber, lanes) {
          var deletions = parentFiber.deletions;
          if (deletions !== null) {
            for (var i2 = 0; i2 < deletions.length; i2++) {
              var childToDelete = deletions[i2];
              try {
                commitDeletionEffects(root3, parentFiber, childToDelete);
              } catch (error2) {
                captureCommitPhaseError(childToDelete, parentFiber, error2);
              }
            }
          }
          var prevDebugFiber = getCurrentFiber();
          if (parentFiber.subtreeFlags & MutationMask) {
            var child = parentFiber.child;
            while (child !== null) {
              setCurrentFiber(child);
              commitMutationEffectsOnFiber(child, root3);
              child = child.sibling;
            }
          }
          setCurrentFiber(prevDebugFiber);
        }
        function commitMutationEffectsOnFiber(finishedWork, root3, lanes) {
          var current2 = finishedWork.alternate;
          var flags = finishedWork.flags;
          switch (finishedWork.tag) {
            case FunctionComponent:
            case ForwardRef:
            case MemoComponent:
            case SimpleMemoComponent: {
              recursivelyTraverseMutationEffects(root3, finishedWork);
              commitReconciliationEffects(finishedWork);
              if (flags & Update) {
                try {
                  commitHookEffectListUnmount(Insertion5 | HasEffect, finishedWork, finishedWork.return);
                  commitHookEffectListMount(Insertion5 | HasEffect, finishedWork);
                } catch (error2) {
                  captureCommitPhaseError(finishedWork, finishedWork.return, error2);
                }
                if (finishedWork.mode & ProfileMode) {
                  try {
                    startLayoutEffectTimer();
                    commitHookEffectListUnmount(Layout2 | HasEffect, finishedWork, finishedWork.return);
                  } catch (error2) {
                    captureCommitPhaseError(finishedWork, finishedWork.return, error2);
                  }
                  recordLayoutEffectDuration(finishedWork);
                } else {
                  try {
                    commitHookEffectListUnmount(Layout2 | HasEffect, finishedWork, finishedWork.return);
                  } catch (error2) {
                    captureCommitPhaseError(finishedWork, finishedWork.return, error2);
                  }
                }
              }
              return;
            }
            case ClassComponent: {
              recursivelyTraverseMutationEffects(root3, finishedWork);
              commitReconciliationEffects(finishedWork);
              if (flags & Ref) {
                if (current2 !== null) {
                  safelyDetachRef(current2, current2.return);
                }
              }
              return;
            }
            case HostComponent: {
              recursivelyTraverseMutationEffects(root3, finishedWork);
              commitReconciliationEffects(finishedWork);
              if (flags & Ref) {
                if (current2 !== null) {
                  safelyDetachRef(current2, current2.return);
                }
              }
              {
                if (finishedWork.flags & ContentReset) {
                  var instance = finishedWork.stateNode;
                  try {
                    resetTextContent(instance);
                  } catch (error2) {
                    captureCommitPhaseError(finishedWork, finishedWork.return, error2);
                  }
                }
                if (flags & Update) {
                  var _instance4 = finishedWork.stateNode;
                  if (_instance4 != 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) {
                      try {
                        commitUpdate(_instance4, updatePayload, type, oldProps, newProps, finishedWork);
                      } catch (error2) {
                        captureCommitPhaseError(finishedWork, finishedWork.return, error2);
                      }
                    }
                  }
                }
              }
              return;
            }
            case HostText: {
              recursivelyTraverseMutationEffects(root3, finishedWork);
              commitReconciliationEffects(finishedWork);
              if (flags & Update) {
                {
                  if (finishedWork.stateNode === null) {
                    throw new 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;
                  try {
                    commitTextUpdate(textInstance, oldText, newText);
                  } catch (error2) {
                    captureCommitPhaseError(finishedWork, finishedWork.return, error2);
                  }
                }
              }
              return;
            }
            case HostRoot: {
              recursivelyTraverseMutationEffects(root3, finishedWork);
              commitReconciliationEffects(finishedWork);
              if (flags & Update) {
                {
                  if (current2 !== null) {
                    var prevRootState = current2.memoizedState;
                    if (prevRootState.isDehydrated) {
                      try {
                        commitHydratedContainer(root3.containerInfo);
                      } catch (error2) {
                        captureCommitPhaseError(finishedWork, finishedWork.return, error2);
                      }
                    }
                  }
                }
              }
              return;
            }
            case HostPortal: {
              recursivelyTraverseMutationEffects(root3, finishedWork);
              commitReconciliationEffects(finishedWork);
              return;
            }
            case SuspenseComponent: {
              recursivelyTraverseMutationEffects(root3, finishedWork);
              commitReconciliationEffects(finishedWork);
              var offscreenFiber = finishedWork.child;
              if (offscreenFiber.flags & Visibility2) {
                var offscreenInstance = offscreenFiber.stateNode;
                var newState = offscreenFiber.memoizedState;
                var isHidden = newState !== null;
                offscreenInstance.isHidden = isHidden;
                if (isHidden) {
                  var wasHidden = offscreenFiber.alternate !== null && offscreenFiber.alternate.memoizedState !== null;
                  if (!wasHidden) {
                    markCommitTimeOfFallback();
                  }
                }
              }
              if (flags & Update) {
                try {
                  commitSuspenseCallback(finishedWork);
                } catch (error2) {
                  captureCommitPhaseError(finishedWork, finishedWork.return, error2);
                }
                attachSuspenseRetryListeners(finishedWork);
              }
              return;
            }
            case OffscreenComponent: {
              var _wasHidden = current2 !== null && current2.memoizedState !== null;
              if (
                // TODO: Remove this dead flag
                finishedWork.mode & ConcurrentMode
              ) {
                var prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden;
                offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden || _wasHidden;
                recursivelyTraverseMutationEffects(root3, finishedWork);
                offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden;
              } else {
                recursivelyTraverseMutationEffects(root3, finishedWork);
              }
              commitReconciliationEffects(finishedWork);
              if (flags & Visibility2) {
                var _offscreenInstance = finishedWork.stateNode;
                var _newState = finishedWork.memoizedState;
                var _isHidden = _newState !== null;
                var offscreenBoundary = finishedWork;
                _offscreenInstance.isHidden = _isHidden;
                {
                  if (_isHidden) {
                    if (!_wasHidden) {
                      if ((offscreenBoundary.mode & ConcurrentMode) !== NoMode) {
                        nextEffect = offscreenBoundary;
                        var offscreenChild = offscreenBoundary.child;
                        while (offscreenChild !== null) {
                          nextEffect = offscreenChild;
                          disappearLayoutEffects_begin(offscreenChild);
                          offscreenChild = offscreenChild.sibling;
                        }
                      }
                    }
                  }
                }
                {
                  hideOrUnhideAllChildren(offscreenBoundary, _isHidden);
                }
              }
              return;
            }
            case SuspenseListComponent: {
              recursivelyTraverseMutationEffects(root3, finishedWork);
              commitReconciliationEffects(finishedWork);
              if (flags & Update) {
                attachSuspenseRetryListeners(finishedWork);
              }
              return;
            }
            case ScopeComponent: {
              return;
            }
            default: {
              recursivelyTraverseMutationEffects(root3, finishedWork);
              commitReconciliationEffects(finishedWork);
              return;
            }
          }
        }
        function commitReconciliationEffects(finishedWork) {
          var flags = finishedWork.flags;
          if (flags & Placement) {
            try {
              commitPlacement(finishedWork);
            } catch (error2) {
              captureCommitPhaseError(finishedWork, finishedWork.return, error2);
            }
            finishedWork.flags &= ~Placement;
          }
          if (flags & Hydrating) {
            finishedWork.flags &= ~Hydrating;
          }
        }
        function commitLayoutEffects(finishedWork, root3, committedLanes) {
          inProgressLanes = committedLanes;
          inProgressRoot = root3;
          nextEffect = finishedWork;
          commitLayoutEffects_begin(finishedWork, root3, committedLanes);
          inProgressLanes = null;
          inProgressRoot = null;
        }
        function commitLayoutEffects_begin(subtreeRoot, root3, committedLanes) {
          var isModernRoot = (subtreeRoot.mode & ConcurrentMode) !== NoMode;
          while (nextEffect !== null) {
            var fiber = nextEffect;
            var firstChild = fiber.child;
            if (fiber.tag === OffscreenComponent && isModernRoot) {
              var isHidden = fiber.memoizedState !== null;
              var newOffscreenSubtreeIsHidden = isHidden || offscreenSubtreeIsHidden;
              if (newOffscreenSubtreeIsHidden) {
                commitLayoutMountEffects_complete(subtreeRoot, root3, committedLanes);
                continue;
              } else {
                var current2 = fiber.alternate;
                var wasHidden = current2 !== null && current2.memoizedState !== null;
                var newOffscreenSubtreeWasHidden = wasHidden || offscreenSubtreeWasHidden;
                var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden;
                var prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden;
                offscreenSubtreeIsHidden = newOffscreenSubtreeIsHidden;
                offscreenSubtreeWasHidden = newOffscreenSubtreeWasHidden;
                if (offscreenSubtreeWasHidden && !prevOffscreenSubtreeWasHidden) {
                  nextEffect = fiber;
                  reappearLayoutEffects_begin(fiber);
                }
                var child = firstChild;
                while (child !== null) {
                  nextEffect = child;
                  commitLayoutEffects_begin(
                    child,
                    // New root; bubble back up to here and stop.
                    root3,
                    committedLanes
                  );
                  child = child.sibling;
                }
                nextEffect = fiber;
                offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden;
                offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden;
                commitLayoutMountEffects_complete(subtreeRoot, root3, committedLanes);
                continue;
              }
            }
            if ((fiber.subtreeFlags & LayoutMask) !== NoFlags && firstChild !== null) {
              firstChild.return = fiber;
              nextEffect = firstChild;
            } else {
              commitLayoutMountEffects_complete(subtreeRoot, root3, committedLanes);
            }
          }
        }
        function commitLayoutMountEffects_complete(subtreeRoot, root3, committedLanes) {
          while (nextEffect !== null) {
            var fiber = nextEffect;
            if ((fiber.flags & LayoutMask) !== NoFlags) {
              var current2 = fiber.alternate;
              setCurrentFiber(fiber);
              try {
                commitLayoutEffectOnFiber(root3, current2, fiber, committedLanes);
              } catch (error2) {
                captureCommitPhaseError(fiber, fiber.return, error2);
              }
              resetCurrentFiber();
            }
            if (fiber === subtreeRoot) {
              nextEffect = null;
              return;
            }
            var sibling = fiber.sibling;
            if (sibling !== null) {
              sibling.return = fiber.return;
              nextEffect = sibling;
              return;
            }
            nextEffect = fiber.return;
          }
        }
        function disappearLayoutEffects_begin(subtreeRoot) {
          while (nextEffect !== null) {
            var fiber = nextEffect;
            var firstChild = fiber.child;
            switch (fiber.tag) {
              case FunctionComponent:
              case ForwardRef:
              case MemoComponent:
              case SimpleMemoComponent: {
                if (fiber.mode & ProfileMode) {
                  try {
                    startLayoutEffectTimer();
                    commitHookEffectListUnmount(Layout2, fiber, fiber.return);
                  } finally {
                    recordLayoutEffectDuration(fiber);
                  }
                } else {
                  commitHookEffectListUnmount(Layout2, fiber, fiber.return);
                }
                break;
              }
              case ClassComponent: {
                safelyDetachRef(fiber, fiber.return);
                var instance = fiber.stateNode;
                if (typeof instance.componentWillUnmount === "function") {
                  safelyCallComponentWillUnmount(fiber, fiber.return, instance);
                }
                break;
              }
              case HostComponent: {
                safelyDetachRef(fiber, fiber.return);
                break;
              }
              case OffscreenComponent: {
                var isHidden = fiber.memoizedState !== null;
                if (isHidden) {
                  disappearLayoutEffects_complete(subtreeRoot);
                  continue;
                }
                break;
              }
            }
            if (firstChild !== null) {
              firstChild.return = fiber;
              nextEffect = firstChild;
            } else {
              disappearLayoutEffects_complete(subtreeRoot);
            }
          }
        }
        function disappearLayoutEffects_complete(subtreeRoot) {
          while (nextEffect !== null) {
            var fiber = nextEffect;
            if (fiber === subtreeRoot) {
              nextEffect = null;
              return;
            }
            var sibling = fiber.sibling;
            if (sibling !== null) {
              sibling.return = fiber.return;
              nextEffect = sibling;
              return;
            }
            nextEffect = fiber.return;
          }
        }
        function reappearLayoutEffects_begin(subtreeRoot) {
          while (nextEffect !== null) {
            var fiber = nextEffect;
            var firstChild = fiber.child;
            if (fiber.tag === OffscreenComponent) {
              var isHidden = fiber.memoizedState !== null;
              if (isHidden) {
                reappearLayoutEffects_complete(subtreeRoot);
                continue;
              }
            }
            if (firstChild !== null) {
              firstChild.return = fiber;
              nextEffect = firstChild;
            } else {
              reappearLayoutEffects_complete(subtreeRoot);
            }
          }
        }
        function reappearLayoutEffects_complete(subtreeRoot) {
          while (nextEffect !== null) {
            var fiber = nextEffect;
            setCurrentFiber(fiber);
            try {
              reappearLayoutEffectsOnFiber(fiber);
            } catch (error2) {
              captureCommitPhaseError(fiber, fiber.return, error2);
            }
            resetCurrentFiber();
            if (fiber === subtreeRoot) {
              nextEffect = null;
              return;
            }
            var sibling = fiber.sibling;
            if (sibling !== null) {
              sibling.return = fiber.return;
              nextEffect = sibling;
              return;
            }
            nextEffect = fiber.return;
          }
        }
        function commitPassiveMountEffects(root3, finishedWork, committedLanes, committedTransitions) {
          nextEffect = finishedWork;
          commitPassiveMountEffects_begin(finishedWork, root3, committedLanes, committedTransitions);
        }
        function commitPassiveMountEffects_begin(subtreeRoot, root3, committedLanes, committedTransitions) {
          while (nextEffect !== null) {
            var fiber = nextEffect;
            var firstChild = fiber.child;
            if ((fiber.subtreeFlags & PassiveMask) !== NoFlags && firstChild !== null) {
              firstChild.return = fiber;
              nextEffect = firstChild;
            } else {
              commitPassiveMountEffects_complete(subtreeRoot, root3, committedLanes, committedTransitions);
            }
          }
        }
        function commitPassiveMountEffects_complete(subtreeRoot, root3, committedLanes, committedTransitions) {
          while (nextEffect !== null) {
            var fiber = nextEffect;
            if ((fiber.flags & Passive) !== NoFlags) {
              setCurrentFiber(fiber);
              try {
                commitPassiveMountOnFiber(root3, fiber, committedLanes, committedTransitions);
              } catch (error2) {
                captureCommitPhaseError(fiber, fiber.return, error2);
              }
              resetCurrentFiber();
            }
            if (fiber === subtreeRoot) {
              nextEffect = null;
              return;
            }
            var sibling = fiber.sibling;
            if (sibling !== null) {
              sibling.return = fiber.return;
              nextEffect = sibling;
              return;
            }
            nextEffect = fiber.return;
          }
        }
        function commitPassiveMountOnFiber(finishedRoot, finishedWork, committedLanes, committedTransitions) {
          switch (finishedWork.tag) {
            case FunctionComponent:
            case ForwardRef:
            case SimpleMemoComponent: {
              if (finishedWork.mode & ProfileMode) {
                startPassiveEffectTimer();
                try {
                  commitHookEffectListMount(Passive$1 | HasEffect, finishedWork);
                } finally {
                  recordPassiveEffectDuration(finishedWork);
                }
              } else {
                commitHookEffectListMount(Passive$1 | HasEffect, finishedWork);
              }
              break;
            }
          }
        }
        function commitPassiveUnmountEffects(firstChild) {
          nextEffect = firstChild;
          commitPassiveUnmountEffects_begin();
        }
        function commitPassiveUnmountEffects_begin() {
          while (nextEffect !== null) {
            var fiber = nextEffect;
            var child = fiber.child;
            if ((nextEffect.flags & ChildDeletion) !== NoFlags) {
              var deletions = fiber.deletions;
              if (deletions !== null) {
                for (var i2 = 0; i2 < deletions.length; i2++) {
                  var fiberToDelete = deletions[i2];
                  nextEffect = fiberToDelete;
                  commitPassiveUnmountEffectsInsideOfDeletedTree_begin(fiberToDelete, fiber);
                }
                {
                  var previousFiber = fiber.alternate;
                  if (previousFiber !== null) {
                    var detachedChild = previousFiber.child;
                    if (detachedChild !== null) {
                      previousFiber.child = null;
                      do {
                        var detachedSibling = detachedChild.sibling;
                        detachedChild.sibling = null;
                        detachedChild = detachedSibling;
                      } while (detachedChild !== null);
                    }
                  }
                }
                nextEffect = fiber;
              }
            }
            if ((fiber.subtreeFlags & PassiveMask) !== NoFlags && child !== null) {
              child.return = fiber;
              nextEffect = child;
            } else {
              commitPassiveUnmountEffects_complete();
            }
          }
        }
        function commitPassiveUnmountEffects_complete() {
          while (nextEffect !== null) {
            var fiber = nextEffect;
            if ((fiber.flags & Passive) !== NoFlags) {
              setCurrentFiber(fiber);
              commitPassiveUnmountOnFiber(fiber);
              resetCurrentFiber();
            }
            var sibling = fiber.sibling;
            if (sibling !== null) {
              sibling.return = fiber.return;
              nextEffect = sibling;
              return;
            }
            nextEffect = fiber.return;
          }
        }
        function commitPassiveUnmountOnFiber(finishedWork) {
          switch (finishedWork.tag) {
            case FunctionComponent:
            case ForwardRef:
            case SimpleMemoComponent: {
              if (finishedWork.mode & ProfileMode) {
                startPassiveEffectTimer();
                commitHookEffectListUnmount(Passive$1 | HasEffect, finishedWork, finishedWork.return);
                recordPassiveEffectDuration(finishedWork);
              } else {
                commitHookEffectListUnmount(Passive$1 | HasEffect, finishedWork, finishedWork.return);
              }
              break;
            }
          }
        }
        function commitPassiveUnmountEffectsInsideOfDeletedTree_begin(deletedSubtreeRoot, nearestMountedAncestor) {
          while (nextEffect !== null) {
            var fiber = nextEffect;
            setCurrentFiber(fiber);
            commitPassiveUnmountInsideDeletedTreeOnFiber(fiber, nearestMountedAncestor);
            resetCurrentFiber();
            var child = fiber.child;
            if (child !== null) {
              child.return = fiber;
              nextEffect = child;
            } else {
              commitPassiveUnmountEffectsInsideOfDeletedTree_complete(deletedSubtreeRoot);
            }
          }
        }
        function commitPassiveUnmountEffectsInsideOfDeletedTree_complete(deletedSubtreeRoot) {
          while (nextEffect !== null) {
            var fiber = nextEffect;
            var sibling = fiber.sibling;
            var returnFiber = fiber.return;
            {
              detachFiberAfterEffects(fiber);
              if (fiber === deletedSubtreeRoot) {
                nextEffect = null;
                return;
              }
            }
            if (sibling !== null) {
              sibling.return = returnFiber;
              nextEffect = sibling;
              return;
            }
            nextEffect = returnFiber;
          }
        }
        function commitPassiveUnmountInsideDeletedTreeOnFiber(current2, nearestMountedAncestor) {
          switch (current2.tag) {
            case FunctionComponent:
            case ForwardRef:
            case SimpleMemoComponent: {
              if (current2.mode & ProfileMode) {
                startPassiveEffectTimer();
                commitHookEffectListUnmount(Passive$1, current2, nearestMountedAncestor);
                recordPassiveEffectDuration(current2);
              } else {
                commitHookEffectListUnmount(Passive$1, current2, nearestMountedAncestor);
              }
              break;
            }
          }
        }
        function invokeLayoutEffectMountInDEV(fiber) {
          {
            switch (fiber.tag) {
              case FunctionComponent:
              case ForwardRef:
              case SimpleMemoComponent: {
                try {
                  commitHookEffectListMount(Layout2 | HasEffect, fiber);
                } catch (error2) {
                  captureCommitPhaseError(fiber, fiber.return, error2);
                }
                break;
              }
              case ClassComponent: {
                var instance = fiber.stateNode;
                try {
                  instance.componentDidMount();
                } catch (error2) {
                  captureCommitPhaseError(fiber, fiber.return, error2);
                }
                break;
              }
            }
          }
        }
        function invokePassiveEffectMountInDEV(fiber) {
          {
            switch (fiber.tag) {
              case FunctionComponent:
              case ForwardRef:
              case SimpleMemoComponent: {
                try {
                  commitHookEffectListMount(Passive$1 | HasEffect, fiber);
                } catch (error2) {
                  captureCommitPhaseError(fiber, fiber.return, error2);
                }
                break;
              }
            }
          }
        }
        function invokeLayoutEffectUnmountInDEV(fiber) {
          {
            switch (fiber.tag) {
              case FunctionComponent:
              case ForwardRef:
              case SimpleMemoComponent: {
                try {
                  commitHookEffectListUnmount(Layout2 | HasEffect, fiber, fiber.return);
                } catch (error2) {
                  captureCommitPhaseError(fiber, fiber.return, error2);
                }
                break;
              }
              case ClassComponent: {
                var instance = fiber.stateNode;
                if (typeof instance.componentWillUnmount === "function") {
                  safelyCallComponentWillUnmount(fiber, fiber.return, instance);
                }
                break;
              }
            }
          }
        }
        function invokePassiveEffectUnmountInDEV(fiber) {
          {
            switch (fiber.tag) {
              case FunctionComponent:
              case ForwardRef:
              case SimpleMemoComponent: {
                try {
                  commitHookEffectListUnmount(Passive$1 | HasEffect, fiber, fiber.return);
                } catch (error2) {
                  captureCommitPhaseError(fiber, fiber.return, error2);
                }
              }
            }
          }
        }
        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 = Symbol.for;
          COMPONENT_TYPE = symbolFor("selector.component");
          HAS_PSEUDO_CLASS_TYPE = symbolFor("selector.has_pseudo_class");
          ROLE_TYPE = symbolFor("selector.role");
          TEST_NAME_TYPE = symbolFor("selector.test_id");
          TEXT_TYPE = symbolFor("selector.text");
        }
        var commitHooks = [];
        function onCommitRoot$1() {
          {
            commitHooks.forEach(function(commitHook) {
              return commitHook();
            });
          }
        }
        var ReactCurrentActQueue = ReactSharedInternals.ReactCurrentActQueue;
        function isLegacyActEnvironment(fiber) {
          {
            var isReactActEnvironmentGlobal = (
              // $FlowExpectedError – Flow doesn't know about IS_REACT_ACT_ENVIRONMENT global
              typeof IS_REACT_ACT_ENVIRONMENT !== "undefined" ? IS_REACT_ACT_ENVIRONMENT : void 0
            );
            var jestIsDefined = typeof jest !== "undefined";
            return jestIsDefined && isReactActEnvironmentGlobal !== false;
          }
        }
        function isConcurrentActEnvironment() {
          {
            var isReactActEnvironmentGlobal = (
              // $FlowExpectedError – Flow doesn't know about IS_REACT_ACT_ENVIRONMENT global
              typeof IS_REACT_ACT_ENVIRONMENT !== "undefined" ? IS_REACT_ACT_ENVIRONMENT : void 0
            );
            if (!isReactActEnvironmentGlobal && ReactCurrentActQueue.current !== null) {
              error("The current testing environment is not configured to support act(...)");
            }
            return isReactActEnvironmentGlobal;
          }
        }
        var ceil = Math.ceil;
        var ReactCurrentDispatcher$2 = ReactSharedInternals.ReactCurrentDispatcher, ReactCurrentOwner$2 = ReactSharedInternals.ReactCurrentOwner, ReactCurrentBatchConfig$3 = ReactSharedInternals.ReactCurrentBatchConfig, ReactCurrentActQueue$1 = ReactSharedInternals.ReactCurrentActQueue;
        var NoContext = (
          /*             */
          0
        );
        var BatchedContext = (
          /*               */
          1
        );
        var RenderContext = (
          /*                */
          2
        );
        var CommitContext = (
          /*                */
          4
        );
        var RootInProgress = 0;
        var RootFatalErrored = 1;
        var RootErrored = 2;
        var RootSuspended = 3;
        var RootSuspendedWithDelay = 4;
        var RootCompleted = 5;
        var RootDidNotComplete = 6;
        var executionContext = NoContext;
        var workInProgressRoot = null;
        var workInProgress = null;
        var workInProgressRootRenderLanes = NoLanes;
        var subtreeRenderLanes = NoLanes;
        var subtreeRenderLanesCursor = createCursor(NoLanes);
        var workInProgressRootExitStatus = RootInProgress;
        var workInProgressRootFatalError = null;
        var workInProgressRootIncludedLanes = NoLanes;
        var workInProgressRootSkippedLanes = NoLanes;
        var workInProgressRootInterleavedUpdatedLanes = NoLanes;
        var workInProgressRootPingedLanes = NoLanes;
        var workInProgressRootConcurrentErrors = null;
        var workInProgressRootRecoverableErrors = null;
        var globalMostRecentFallbackTime = 0;
        var FALLBACK_THROTTLE_MS = 500;
        var workInProgressRootRenderTargetTime = Infinity;
        var RENDER_TIMEOUT_MS = 500;
        var workInProgressTransitions = null;
        function resetRenderTimer() {
          workInProgressRootRenderTargetTime = now2() + RENDER_TIMEOUT_MS;
        }
        function getRenderTargetTime() {
          return workInProgressRootRenderTargetTime;
        }
        var hasUncaughtError = false;
        var firstUncaughtError = null;
        var legacyErrorBoundariesThatAlreadyFailed = null;
        var rootDoesHavePassiveEffects = false;
        var rootWithPendingPassiveEffects = null;
        var pendingPassiveEffectsLanes = NoLanes;
        var pendingPassiveProfilerEffects = [];
        var pendingPassiveTransitions = null;
        var NESTED_UPDATE_LIMIT = 50;
        var nestedUpdateCount = 0;
        var rootWithNestedUpdates = null;
        var isFlushingPassiveEffects = false;
        var didScheduleUpdateDuringPassiveEffects = false;
        var NESTED_PASSIVE_UPDATE_LIMIT = 50;
        var nestedPassiveUpdateCount = 0;
        var rootWithPassiveNestedUpdates = null;
        var currentEventTime = NoTimestamp;
        var currentEventTransitionLane = NoLanes;
        var isRunningInsertionEffect = false;
        function getWorkInProgressRoot() {
          return workInProgressRoot;
        }
        function requestEventTime() {
          if ((executionContext & (RenderContext | CommitContext)) !== NoContext) {
            return now2();
          }
          if (currentEventTime !== NoTimestamp) {
            return currentEventTime;
          }
          currentEventTime = now2();
          return currentEventTime;
        }
        function requestUpdateLane(fiber) {
          var mode = fiber.mode;
          if ((mode & ConcurrentMode) === NoMode) {
            return SyncLane;
          } else if ((executionContext & RenderContext) !== NoContext && workInProgressRootRenderLanes !== NoLanes) {
            return pickArbitraryLane(workInProgressRootRenderLanes);
          }
          var isTransition = requestCurrentTransition() !== NoTransition;
          if (isTransition) {
            if (ReactCurrentBatchConfig$3.transition !== null) {
              var transition = ReactCurrentBatchConfig$3.transition;
              if (!transition._updatedFibers) {
                transition._updatedFibers = /* @__PURE__ */ new Set();
              }
              transition._updatedFibers.add(fiber);
            }
            if (currentEventTransitionLane === NoLane) {
              currentEventTransitionLane = claimNextTransitionLane();
            }
            return currentEventTransitionLane;
          }
          var updateLane = getCurrentUpdatePriority();
          if (updateLane !== NoLane) {
            return updateLane;
          }
          var eventLane = getCurrentEventPriority();
          return eventLane;
        }
        function requestRetryLane(fiber) {
          var mode = fiber.mode;
          if ((mode & ConcurrentMode) === NoMode) {
            return SyncLane;
          }
          return claimNextRetryLane();
        }
        function scheduleUpdateOnFiber(root3, fiber, lane, eventTime) {
          checkForNestedUpdates();
          {
            if (isRunningInsertionEffect) {
              error("useInsertionEffect must not schedule updates.");
            }
          }
          {
            if (isFlushingPassiveEffects) {
              didScheduleUpdateDuringPassiveEffects = true;
            }
          }
          markRootUpdated(root3, lane, eventTime);
          if ((executionContext & RenderContext) !== NoLanes && root3 === workInProgressRoot) {
            warnAboutRenderPhaseUpdatesInDEV(fiber);
          } else {
            {
              if (isDevToolsPresent) {
                addFiberToLanesMap(root3, fiber, lane);
              }
            }
            warnIfUpdatesNotWrappedWithActDEV(fiber);
            if (root3 === workInProgressRoot) {
              if ((executionContext & RenderContext) === NoContext) {
                workInProgressRootInterleavedUpdatedLanes = mergeLanes(workInProgressRootInterleavedUpdatedLanes, lane);
              }
              if (workInProgressRootExitStatus === RootSuspendedWithDelay) {
                markRootSuspended$1(root3, workInProgressRootRenderLanes);
              }
            }
            ensureRootIsScheduled(root3, eventTime);
            if (lane === SyncLane && executionContext === NoContext && (fiber.mode & ConcurrentMode) === NoMode && // Treat `act` as if it's inside `batchedUpdates`, even in legacy mode.
            !ReactCurrentActQueue$1.isBatchingLegacy) {
              resetRenderTimer();
              flushSyncCallbacksOnlyInLegacyMode();
            }
          }
        }
        function scheduleInitialHydrationOnRoot(root3, lane, eventTime) {
          var current2 = root3.current;
          current2.lanes = lane;
          markRootUpdated(root3, lane, eventTime);
          ensureRootIsScheduled(root3, eventTime);
        }
        function isUnsafeClassRenderPhaseUpdate(fiber) {
          return (
            // TODO: Remove outdated deferRenderPhaseUpdateToNextBatch experiment. We
            // decided not to enable it.
            (executionContext & RenderContext) !== NoContext
          );
        }
        function ensureRootIsScheduled(root3, currentTime) {
          var existingCallbackNode = root3.callbackNode;
          markStarvedLanesAsExpired(root3, currentTime);
          var nextLanes = getNextLanes(root3, root3 === workInProgressRoot ? workInProgressRootRenderLanes : NoLanes);
          if (nextLanes === NoLanes) {
            if (existingCallbackNode !== null) {
              cancelCallback$1(existingCallbackNode);
            }
            root3.callbackNode = null;
            root3.callbackPriority = NoLane;
            return;
          }
          var newCallbackPriority = getHighestPriorityLane(nextLanes);
          var existingCallbackPriority = root3.callbackPriority;
          if (existingCallbackPriority === newCallbackPriority && // Special case related to `act`. If the currently scheduled task is a
          // Scheduler task, rather than an `act` task, cancel it and re-scheduled
          // on the `act` queue.
          !(ReactCurrentActQueue$1.current !== null && existingCallbackNode !== fakeActCallbackNode)) {
            {
              if (existingCallbackNode == null && existingCallbackPriority !== SyncLane) {
                error("Expected scheduled callback to exist. This error is likely caused by a bug in React. Please file an issue.");
              }
            }
            return;
          }
          if (existingCallbackNode != null) {
            cancelCallback$1(existingCallbackNode);
          }
          var newCallbackNode;
          if (newCallbackPriority === SyncLane) {
            if (root3.tag === LegacyRoot) {
              if (ReactCurrentActQueue$1.isBatchingLegacy !== null) {
                ReactCurrentActQueue$1.didScheduleLegacyUpdate = true;
              }
              scheduleLegacySyncCallback(performSyncWorkOnRoot.bind(null, root3));
            } else {
              scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root3));
            }
            {
              if (ReactCurrentActQueue$1.current !== null) {
                ReactCurrentActQueue$1.current.push(flushSyncCallbacks);
              } else {
                scheduleMicrotask(function() {
                  if ((executionContext & (RenderContext | CommitContext)) === NoContext) {
                    flushSyncCallbacks();
                  }
                });
              }
            }
            newCallbackNode = null;
          } else {
            var schedulerPriorityLevel;
            switch (lanesToEventPriority(nextLanes)) {
              case DiscreteEventPriority2:
                schedulerPriorityLevel = ImmediatePriority;
                break;
              case ContinuousEventPriority2:
                schedulerPriorityLevel = UserBlockingPriority;
                break;
              case DefaultEventPriority2:
                schedulerPriorityLevel = NormalPriority;
                break;
              case IdleEventPriority:
                schedulerPriorityLevel = IdlePriority;
                break;
              default:
                schedulerPriorityLevel = NormalPriority;
                break;
            }
            newCallbackNode = scheduleCallback$1(schedulerPriorityLevel, performConcurrentWorkOnRoot.bind(null, root3));
          }
          root3.callbackPriority = newCallbackPriority;
          root3.callbackNode = newCallbackNode;
        }
        function performConcurrentWorkOnRoot(root3, didTimeout) {
          {
            resetNestedUpdateFlag();
          }
          currentEventTime = NoTimestamp;
          currentEventTransitionLane = NoLanes;
          if ((executionContext & (RenderContext | CommitContext)) !== NoContext) {
            throw new Error("Should not already be working.");
          }
          var originalCallbackNode = root3.callbackNode;
          var didFlushPassiveEffects = flushPassiveEffects();
          if (didFlushPassiveEffects) {
            if (root3.callbackNode !== originalCallbackNode) {
              return null;
            }
          }
          var lanes = getNextLanes(root3, root3 === workInProgressRoot ? workInProgressRootRenderLanes : NoLanes);
          if (lanes === NoLanes) {
            return null;
          }
          var shouldTimeSlice = !includesBlockingLane(root3, lanes) && !includesExpiredLane(root3, lanes) && !didTimeout;
          var exitStatus = shouldTimeSlice ? renderRootConcurrent(root3, lanes) : renderRootSync(root3, lanes);
          if (exitStatus !== RootInProgress) {
            if (exitStatus === RootErrored) {
              var errorRetryLanes = getLanesToRetrySynchronouslyOnError(root3);
              if (errorRetryLanes !== NoLanes) {
                lanes = errorRetryLanes;
                exitStatus = recoverFromConcurrentError(root3, errorRetryLanes);
              }
            }
            if (exitStatus === RootFatalErrored) {
              var fatalError = workInProgressRootFatalError;
              prepareFreshStack(root3, NoLanes);
              markRootSuspended$1(root3, lanes);
              ensureRootIsScheduled(root3, now2());
              throw fatalError;
            }
            if (exitStatus === RootDidNotComplete) {
              markRootSuspended$1(root3, lanes);
            } else {
              var renderWasConcurrent = !includesBlockingLane(root3, lanes);
              var finishedWork = root3.current.alternate;
              if (renderWasConcurrent && !isRenderConsistentWithExternalStores(finishedWork)) {
                exitStatus = renderRootSync(root3, lanes);
                if (exitStatus === RootErrored) {
                  var _errorRetryLanes = getLanesToRetrySynchronouslyOnError(root3);
                  if (_errorRetryLanes !== NoLanes) {
                    lanes = _errorRetryLanes;
                    exitStatus = recoverFromConcurrentError(root3, _errorRetryLanes);
                  }
                }
                if (exitStatus === RootFatalErrored) {
                  var _fatalError = workInProgressRootFatalError;
                  prepareFreshStack(root3, NoLanes);
                  markRootSuspended$1(root3, lanes);
                  ensureRootIsScheduled(root3, now2());
                  throw _fatalError;
                }
              }
              root3.finishedWork = finishedWork;
              root3.finishedLanes = lanes;
              finishConcurrentRender(root3, exitStatus, lanes);
            }
          }
          ensureRootIsScheduled(root3, now2());
          if (root3.callbackNode === originalCallbackNode) {
            return performConcurrentWorkOnRoot.bind(null, root3);
          }
          return null;
        }
        function recoverFromConcurrentError(root3, errorRetryLanes) {
          var errorsFromFirstAttempt = workInProgressRootConcurrentErrors;
          if (isRootDehydrated(root3)) {
            var rootWorkInProgress = prepareFreshStack(root3, errorRetryLanes);
            rootWorkInProgress.flags |= ForceClientRender;
            {
              errorHydratingContainer(root3.containerInfo);
            }
          }
          var exitStatus = renderRootSync(root3, errorRetryLanes);
          if (exitStatus !== RootErrored) {
            var errorsFromSecondAttempt = workInProgressRootRecoverableErrors;
            workInProgressRootRecoverableErrors = errorsFromFirstAttempt;
            if (errorsFromSecondAttempt !== null) {
              queueRecoverableErrors(errorsFromSecondAttempt);
            }
          }
          return exitStatus;
        }
        function queueRecoverableErrors(errors) {
          if (workInProgressRootRecoverableErrors === null) {
            workInProgressRootRecoverableErrors = errors;
          } else {
            workInProgressRootRecoverableErrors.push.apply(workInProgressRootRecoverableErrors, errors);
          }
        }
        function finishConcurrentRender(root3, exitStatus, lanes) {
          switch (exitStatus) {
            case RootInProgress:
            case RootFatalErrored: {
              throw new Error("Root did not complete. This is a bug in React.");
            }
            case RootErrored: {
              commitRoot(root3, workInProgressRootRecoverableErrors, workInProgressTransitions);
              break;
            }
            case RootSuspended: {
              markRootSuspended$1(root3, lanes);
              if (includesOnlyRetries(lanes) && // do not delay if we're inside an act() scope
              !shouldForceFlushFallbacksInDEV()) {
                var msUntilTimeout = globalMostRecentFallbackTime + FALLBACK_THROTTLE_MS - now2();
                if (msUntilTimeout > 10) {
                  var nextLanes = getNextLanes(root3, NoLanes);
                  if (nextLanes !== NoLanes) {
                    break;
                  }
                  var suspendedLanes = root3.suspendedLanes;
                  if (!isSubsetOfLanes(suspendedLanes, lanes)) {
                    var eventTime = requestEventTime();
                    markRootPinged(root3, suspendedLanes);
                    break;
                  }
                  root3.timeoutHandle = scheduleTimeout(commitRoot.bind(null, root3, workInProgressRootRecoverableErrors, workInProgressTransitions), msUntilTimeout);
                  break;
                }
              }
              commitRoot(root3, workInProgressRootRecoverableErrors, workInProgressTransitions);
              break;
            }
            case RootSuspendedWithDelay: {
              markRootSuspended$1(root3, lanes);
              if (includesOnlyTransitions(lanes)) {
                break;
              }
              if (!shouldForceFlushFallbacksInDEV()) {
                var mostRecentEventTime = getMostRecentEventTime(root3, lanes);
                var eventTimeMs = mostRecentEventTime;
                var timeElapsedMs = now2() - eventTimeMs;
                var _msUntilTimeout = jnd(timeElapsedMs) - timeElapsedMs;
                if (_msUntilTimeout > 10) {
                  root3.timeoutHandle = scheduleTimeout(commitRoot.bind(null, root3, workInProgressRootRecoverableErrors, workInProgressTransitions), _msUntilTimeout);
                  break;
                }
              }
              commitRoot(root3, workInProgressRootRecoverableErrors, workInProgressTransitions);
              break;
            }
            case RootCompleted: {
              commitRoot(root3, workInProgressRootRecoverableErrors, workInProgressTransitions);
              break;
            }
            default: {
              throw new Error("Unknown root exit status.");
            }
          }
        }
        function isRenderConsistentWithExternalStores(finishedWork) {
          var node56 = finishedWork;
          while (true) {
            if (node56.flags & StoreConsistency) {
              var updateQueue = node56.updateQueue;
              if (updateQueue !== null) {
                var checks = updateQueue.stores;
                if (checks !== null) {
                  for (var i2 = 0; i2 < checks.length; i2++) {
                    var check = checks[i2];
                    var getSnapshot = check.getSnapshot;
                    var renderedValue = check.value;
                    try {
                      if (!objectIs(getSnapshot(), renderedValue)) {
                        return false;
                      }
                    } catch (error2) {
                      return false;
                    }
                  }
                }
              }
            }
            var child = node56.child;
            if (node56.subtreeFlags & StoreConsistency && child !== null) {
              child.return = node56;
              node56 = child;
              continue;
            }
            if (node56 === finishedWork) {
              return true;
            }
            while (node56.sibling === null) {
              if (node56.return === null || node56.return === finishedWork) {
                return true;
              }
              node56 = node56.return;
            }
            node56.sibling.return = node56.return;
            node56 = node56.sibling;
          }
          return true;
        }
        function markRootSuspended$1(root3, suspendedLanes) {
          suspendedLanes = removeLanes(suspendedLanes, workInProgressRootPingedLanes);
          suspendedLanes = removeLanes(suspendedLanes, workInProgressRootInterleavedUpdatedLanes);
          markRootSuspended(root3, suspendedLanes);
        }
        function performSyncWorkOnRoot(root3) {
          {
            syncNestedUpdateFlag();
          }
          if ((executionContext & (RenderContext | CommitContext)) !== NoContext) {
            throw new Error("Should not already be working.");
          }
          flushPassiveEffects();
          var lanes = getNextLanes(root3, NoLanes);
          if (!includesSomeLane(lanes, SyncLane)) {
            ensureRootIsScheduled(root3, now2());
            return null;
          }
          var exitStatus = renderRootSync(root3, lanes);
          if (root3.tag !== LegacyRoot && exitStatus === RootErrored) {
            var errorRetryLanes = getLanesToRetrySynchronouslyOnError(root3);
            if (errorRetryLanes !== NoLanes) {
              lanes = errorRetryLanes;
              exitStatus = recoverFromConcurrentError(root3, errorRetryLanes);
            }
          }
          if (exitStatus === RootFatalErrored) {
            var fatalError = workInProgressRootFatalError;
            prepareFreshStack(root3, NoLanes);
            markRootSuspended$1(root3, lanes);
            ensureRootIsScheduled(root3, now2());
            throw fatalError;
          }
          if (exitStatus === RootDidNotComplete) {
            throw new Error("Root did not complete. This is a bug in React.");
          }
          var finishedWork = root3.current.alternate;
          root3.finishedWork = finishedWork;
          root3.finishedLanes = lanes;
          commitRoot(root3, workInProgressRootRecoverableErrors, workInProgressTransitions);
          ensureRootIsScheduled(root3, now2());
          return null;
        }
        function flushRoot(root3, lanes) {
          if (lanes !== NoLanes) {
            markRootEntangled(root3, mergeLanes(lanes, SyncLane));
            ensureRootIsScheduled(root3, now2());
            if ((executionContext & (RenderContext | CommitContext)) === NoContext) {
              resetRenderTimer();
              flushSyncCallbacks();
            }
          }
        }
        function batchedUpdates$1(fn, a2) {
          var prevExecutionContext = executionContext;
          executionContext |= BatchedContext;
          try {
            return fn(a2);
          } finally {
            executionContext = prevExecutionContext;
            if (executionContext === NoContext && // Treat `act` as if it's inside `batchedUpdates`, even in legacy mode.
            !ReactCurrentActQueue$1.isBatchingLegacy) {
              resetRenderTimer();
              flushSyncCallbacksOnlyInLegacyMode();
            }
          }
        }
        function discreteUpdates(fn, a2, b, c4, d) {
          var previousPriority = getCurrentUpdatePriority();
          var prevTransition = ReactCurrentBatchConfig$3.transition;
          try {
            ReactCurrentBatchConfig$3.transition = null;
            setCurrentUpdatePriority(DiscreteEventPriority2);
            return fn(a2, b, c4, d);
          } finally {
            setCurrentUpdatePriority(previousPriority);
            ReactCurrentBatchConfig$3.transition = prevTransition;
            if (executionContext === NoContext) {
              resetRenderTimer();
            }
          }
        }
        function flushSync(fn) {
          if (rootWithPendingPassiveEffects !== null && rootWithPendingPassiveEffects.tag === LegacyRoot && (executionContext & (RenderContext | CommitContext)) === NoContext) {
            flushPassiveEffects();
          }
          var prevExecutionContext = executionContext;
          executionContext |= BatchedContext;
          var prevTransition = ReactCurrentBatchConfig$3.transition;
          var previousPriority = getCurrentUpdatePriority();
          try {
            ReactCurrentBatchConfig$3.transition = null;
            setCurrentUpdatePriority(DiscreteEventPriority2);
            if (fn) {
              return fn();
            } else {
              return void 0;
            }
          } finally {
            setCurrentUpdatePriority(previousPriority);
            ReactCurrentBatchConfig$3.transition = prevTransition;
            executionContext = prevExecutionContext;
            if ((executionContext & (RenderContext | CommitContext)) === NoContext) {
              flushSyncCallbacks();
            }
          }
        }
        function isAlreadyRendering() {
          return (executionContext & (RenderContext | CommitContext)) !== NoContext;
        }
        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(root3, lanes) {
          root3.finishedWork = null;
          root3.finishedLanes = NoLanes;
          var timeoutHandle = root3.timeoutHandle;
          if (timeoutHandle !== noTimeout) {
            root3.timeoutHandle = noTimeout;
            cancelTimeout(timeoutHandle);
          }
          if (workInProgress !== null) {
            var interruptedWork = workInProgress.return;
            while (interruptedWork !== null) {
              var current2 = interruptedWork.alternate;
              unwindInterruptedWork(current2, interruptedWork);
              interruptedWork = interruptedWork.return;
            }
          }
          workInProgressRoot = root3;
          var rootWorkInProgress = createWorkInProgress(root3.current, null);
          workInProgress = rootWorkInProgress;
          workInProgressRootRenderLanes = subtreeRenderLanes = workInProgressRootIncludedLanes = lanes;
          workInProgressRootExitStatus = RootInProgress;
          workInProgressRootFatalError = null;
          workInProgressRootSkippedLanes = NoLanes;
          workInProgressRootInterleavedUpdatedLanes = NoLanes;
          workInProgressRootPingedLanes = NoLanes;
          workInProgressRootConcurrentErrors = null;
          workInProgressRootRecoverableErrors = null;
          finishQueueingConcurrentUpdates();
          {
            ReactStrictModeWarnings.discardPendingWarnings();
          }
          return rootWorkInProgress;
        }
        function handleError(root3, 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);
              }
              if (enableSchedulingProfiler) {
                markComponentRenderStopped();
                if (thrownValue !== null && typeof thrownValue === "object" && typeof thrownValue.then === "function") {
                  var wakeable = thrownValue;
                  markComponentSuspended(erroredWork, wakeable, workInProgressRootRenderLanes);
                } else {
                  markComponentErrored(erroredWork, thrownValue, workInProgressRootRenderLanes);
                }
              }
              throwException(root3, 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 markCommitTimeOfFallback() {
          globalMostRecentFallbackTime = now2();
        }
        function markSkippedUpdateLanes(lane) {
          workInProgressRootSkippedLanes = mergeLanes(lane, workInProgressRootSkippedLanes);
        }
        function renderDidSuspend() {
          if (workInProgressRootExitStatus === RootInProgress) {
            workInProgressRootExitStatus = RootSuspended;
          }
        }
        function renderDidSuspendDelayIfPossible() {
          if (workInProgressRootExitStatus === RootInProgress || workInProgressRootExitStatus === RootSuspended || workInProgressRootExitStatus === RootErrored) {
            workInProgressRootExitStatus = RootSuspendedWithDelay;
          }
          if (workInProgressRoot !== null && (includesNonIdleWork(workInProgressRootSkippedLanes) || includesNonIdleWork(workInProgressRootInterleavedUpdatedLanes))) {
            markRootSuspended$1(workInProgressRoot, workInProgressRootRenderLanes);
          }
        }
        function renderDidError(error2) {
          if (workInProgressRootExitStatus !== RootSuspendedWithDelay) {
            workInProgressRootExitStatus = RootErrored;
          }
          if (workInProgressRootConcurrentErrors === null) {
            workInProgressRootConcurrentErrors = [error2];
          } else {
            workInProgressRootConcurrentErrors.push(error2);
          }
        }
        function renderHasNotSuspendedYet() {
          return workInProgressRootExitStatus === RootInProgress;
        }
        function renderRootSync(root3, lanes) {
          var prevExecutionContext = executionContext;
          executionContext |= RenderContext;
          var prevDispatcher = pushDispatcher();
          if (workInProgressRoot !== root3 || workInProgressRootRenderLanes !== lanes) {
            {
              if (isDevToolsPresent) {
                var memoizedUpdaters = root3.memoizedUpdaters;
                if (memoizedUpdaters.size > 0) {
                  restorePendingUpdaters(root3, workInProgressRootRenderLanes);
                  memoizedUpdaters.clear();
                }
                movePendingFibersToMemoized(root3, lanes);
              }
            }
            workInProgressTransitions = getTransitionsForLanes();
            prepareFreshStack(root3, lanes);
          }
          {
            markRenderStarted(lanes);
          }
          do {
            try {
              workLoopSync();
              break;
            } catch (thrownValue) {
              handleError(root3, thrownValue);
            }
          } while (true);
          resetContextDependencies();
          executionContext = prevExecutionContext;
          popDispatcher(prevDispatcher);
          if (workInProgress !== null) {
            throw new Error("Cannot commit an incomplete root. This error is likely caused by a bug in React. Please file an issue.");
          }
          {
            markRenderStopped();
          }
          workInProgressRoot = null;
          workInProgressRootRenderLanes = NoLanes;
          return workInProgressRootExitStatus;
        }
        function workLoopSync() {
          while (workInProgress !== null) {
            performUnitOfWork(workInProgress);
          }
        }
        function renderRootConcurrent(root3, lanes) {
          var prevExecutionContext = executionContext;
          executionContext |= RenderContext;
          var prevDispatcher = pushDispatcher();
          if (workInProgressRoot !== root3 || workInProgressRootRenderLanes !== lanes) {
            {
              if (isDevToolsPresent) {
                var memoizedUpdaters = root3.memoizedUpdaters;
                if (memoizedUpdaters.size > 0) {
                  restorePendingUpdaters(root3, workInProgressRootRenderLanes);
                  memoizedUpdaters.clear();
                }
                movePendingFibersToMemoized(root3, lanes);
              }
            }
            workInProgressTransitions = getTransitionsForLanes();
            resetRenderTimer();
            prepareFreshStack(root3, lanes);
          }
          {
            markRenderStarted(lanes);
          }
          do {
            try {
              workLoopConcurrent();
              break;
            } catch (thrownValue) {
              handleError(root3, thrownValue);
            }
          } while (true);
          resetContextDependencies();
          popDispatcher(prevDispatcher);
          executionContext = prevExecutionContext;
          if (workInProgress !== null) {
            {
              markRenderYielded();
            }
            return RootInProgress;
          } else {
            {
              markRenderStopped();
            }
            workInProgressRoot = null;
            workInProgressRootRenderLanes = NoLanes;
            return workInProgressRootExitStatus;
          }
        }
        function workLoopConcurrent() {
          while (workInProgress !== null && !shouldYield()) {
            performUnitOfWork(workInProgress);
          }
        }
        function performUnitOfWork(unitOfWork) {
          var current2 = unitOfWork.alternate;
          setCurrentFiber(unitOfWork);
          var next2;
          if ((unitOfWork.mode & ProfileMode) !== NoMode) {
            startProfilerTimer(unitOfWork);
            next2 = beginWork$1(current2, unitOfWork, subtreeRenderLanes);
            stopProfilerTimerIfRunningAndRecordDelta(unitOfWork, true);
          } else {
            next2 = beginWork$1(current2, unitOfWork, subtreeRenderLanes);
          }
          resetCurrentFiber();
          unitOfWork.memoizedProps = unitOfWork.pendingProps;
          if (next2 === null) {
            completeUnitOfWork(unitOfWork);
          } else {
            workInProgress = next2;
          }
          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 next2 = void 0;
              if ((completedWork.mode & ProfileMode) === NoMode) {
                next2 = completeWork(current2, completedWork, subtreeRenderLanes);
              } else {
                startProfilerTimer(completedWork);
                next2 = completeWork(current2, completedWork, subtreeRenderLanes);
                stopProfilerTimerIfRunningAndRecordDelta(completedWork, false);
              }
              resetCurrentFiber();
              if (next2 !== null) {
                workInProgress = next2;
                return;
              }
            } else {
              var _next = unwindWork(current2, 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.flags |= Incomplete;
                returnFiber.subtreeFlags = NoFlags;
                returnFiber.deletions = null;
              } else {
                workInProgressRootExitStatus = RootDidNotComplete;
                workInProgress = null;
                return;
              }
            }
            var siblingFiber = completedWork.sibling;
            if (siblingFiber !== null) {
              workInProgress = siblingFiber;
              return;
            }
            completedWork = returnFiber;
            workInProgress = completedWork;
          } while (completedWork !== null);
          if (workInProgressRootExitStatus === RootInProgress) {
            workInProgressRootExitStatus = RootCompleted;
          }
        }
        function commitRoot(root3, recoverableErrors, transitions) {
          var previousUpdateLanePriority = getCurrentUpdatePriority();
          var prevTransition = ReactCurrentBatchConfig$3.transition;
          try {
            ReactCurrentBatchConfig$3.transition = null;
            setCurrentUpdatePriority(DiscreteEventPriority2);
            commitRootImpl(root3, recoverableErrors, transitions, previousUpdateLanePriority);
          } finally {
            ReactCurrentBatchConfig$3.transition = prevTransition;
            setCurrentUpdatePriority(previousUpdateLanePriority);
          }
          return null;
        }
        function commitRootImpl(root3, recoverableErrors, transitions, renderPriorityLevel) {
          do {
            flushPassiveEffects();
          } while (rootWithPendingPassiveEffects !== null);
          flushRenderPhaseStrictModeWarningsInDEV();
          if ((executionContext & (RenderContext | CommitContext)) !== NoContext) {
            throw new Error("Should not already be working.");
          }
          var finishedWork = root3.finishedWork;
          var lanes = root3.finishedLanes;
          {
            markCommitStarted(lanes);
          }
          if (finishedWork === null) {
            {
              markCommitStopped();
            }
            return null;
          } else {
            {
              if (lanes === NoLanes) {
                error("root.finishedLanes should not be empty during a commit. This is a bug in React.");
              }
            }
          }
          root3.finishedWork = null;
          root3.finishedLanes = NoLanes;
          if (finishedWork === root3.current) {
            throw new Error("Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue.");
          }
          root3.callbackNode = null;
          root3.callbackPriority = NoLane;
          var remainingLanes = mergeLanes(finishedWork.lanes, finishedWork.childLanes);
          markRootFinished(root3, remainingLanes);
          if (root3 === workInProgressRoot) {
            workInProgressRoot = null;
            workInProgress = null;
            workInProgressRootRenderLanes = NoLanes;
          }
          if ((finishedWork.subtreeFlags & PassiveMask) !== NoFlags || (finishedWork.flags & PassiveMask) !== NoFlags) {
            if (!rootDoesHavePassiveEffects) {
              rootDoesHavePassiveEffects = true;
              pendingPassiveTransitions = transitions;
              scheduleCallback$1(NormalPriority, function() {
                flushPassiveEffects();
                return null;
              });
            }
          }
          var subtreeHasEffects = (finishedWork.subtreeFlags & (BeforeMutationMask | MutationMask | LayoutMask | PassiveMask)) !== NoFlags;
          var rootHasEffect = (finishedWork.flags & (BeforeMutationMask | MutationMask | LayoutMask | PassiveMask)) !== NoFlags;
          if (subtreeHasEffects || rootHasEffect) {
            var prevTransition = ReactCurrentBatchConfig$3.transition;
            ReactCurrentBatchConfig$3.transition = null;
            var previousPriority = getCurrentUpdatePriority();
            setCurrentUpdatePriority(DiscreteEventPriority2);
            var prevExecutionContext = executionContext;
            executionContext |= CommitContext;
            ReactCurrentOwner$2.current = null;
            var shouldFireAfterActiveInstanceBlur2 = commitBeforeMutationEffects(root3, finishedWork);
            {
              recordCommitTime();
            }
            commitMutationEffects(root3, finishedWork, lanes);
            resetAfterCommit(root3.containerInfo);
            root3.current = finishedWork;
            {
              markLayoutEffectsStarted(lanes);
            }
            commitLayoutEffects(finishedWork, root3, lanes);
            {
              markLayoutEffectsStopped();
            }
            requestPaint();
            executionContext = prevExecutionContext;
            setCurrentUpdatePriority(previousPriority);
            ReactCurrentBatchConfig$3.transition = prevTransition;
          } else {
            root3.current = finishedWork;
            {
              recordCommitTime();
            }
          }
          var rootDidHavePassiveEffects = rootDoesHavePassiveEffects;
          if (rootDoesHavePassiveEffects) {
            rootDoesHavePassiveEffects = false;
            rootWithPendingPassiveEffects = root3;
            pendingPassiveEffectsLanes = lanes;
          } else {
            {
              nestedPassiveUpdateCount = 0;
              rootWithPassiveNestedUpdates = null;
            }
          }
          remainingLanes = root3.pendingLanes;
          if (remainingLanes === NoLanes) {
            legacyErrorBoundariesThatAlreadyFailed = null;
          }
          {
            if (!rootDidHavePassiveEffects) {
              commitDoubleInvokeEffectsInDEV(root3.current, false);
            }
          }
          onCommitRoot(finishedWork.stateNode, renderPriorityLevel);
          {
            if (isDevToolsPresent) {
              root3.memoizedUpdaters.clear();
            }
          }
          {
            onCommitRoot$1();
          }
          ensureRootIsScheduled(root3, now2());
          if (recoverableErrors !== null) {
            var onRecoverableError = root3.onRecoverableError;
            for (var i2 = 0; i2 < recoverableErrors.length; i2++) {
              var recoverableError = recoverableErrors[i2];
              var componentStack = recoverableError.stack;
              var digest = recoverableError.digest;
              onRecoverableError(recoverableError.value, {
                componentStack,
                digest
              });
            }
          }
          if (hasUncaughtError) {
            hasUncaughtError = false;
            var error$1 = firstUncaughtError;
            firstUncaughtError = null;
            throw error$1;
          }
          if (includesSomeLane(pendingPassiveEffectsLanes, SyncLane) && root3.tag !== LegacyRoot) {
            flushPassiveEffects();
          }
          remainingLanes = root3.pendingLanes;
          if (includesSomeLane(remainingLanes, SyncLane)) {
            {
              markNestedUpdateScheduled();
            }
            if (root3 === rootWithNestedUpdates) {
              nestedUpdateCount++;
            } else {
              nestedUpdateCount = 0;
              rootWithNestedUpdates = root3;
            }
          } else {
            nestedUpdateCount = 0;
          }
          flushSyncCallbacks();
          {
            markCommitStopped();
          }
          return null;
        }
        function flushPassiveEffects() {
          if (rootWithPendingPassiveEffects !== null) {
            var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes);
            var priority = lowerEventPriority(DefaultEventPriority2, renderPriority);
            var prevTransition = ReactCurrentBatchConfig$3.transition;
            var previousPriority = getCurrentUpdatePriority();
            try {
              ReactCurrentBatchConfig$3.transition = null;
              setCurrentUpdatePriority(priority);
              return flushPassiveEffectsImpl();
            } finally {
              setCurrentUpdatePriority(previousPriority);
              ReactCurrentBatchConfig$3.transition = prevTransition;
            }
          }
          return false;
        }
        function enqueuePendingPassiveProfilerEffect(fiber) {
          {
            pendingPassiveProfilerEffects.push(fiber);
            if (!rootDoesHavePassiveEffects) {
              rootDoesHavePassiveEffects = true;
              scheduleCallback$1(NormalPriority, function() {
                flushPassiveEffects();
                return null;
              });
            }
          }
        }
        function flushPassiveEffectsImpl() {
          if (rootWithPendingPassiveEffects === null) {
            return false;
          }
          var transitions = pendingPassiveTransitions;
          pendingPassiveTransitions = null;
          var root3 = rootWithPendingPassiveEffects;
          var lanes = pendingPassiveEffectsLanes;
          rootWithPendingPassiveEffects = null;
          pendingPassiveEffectsLanes = NoLanes;
          if ((executionContext & (RenderContext | CommitContext)) !== NoContext) {
            throw new Error("Cannot flush passive effects while already rendering.");
          }
          {
            isFlushingPassiveEffects = true;
            didScheduleUpdateDuringPassiveEffects = false;
          }
          {
            markPassiveEffectsStarted(lanes);
          }
          var prevExecutionContext = executionContext;
          executionContext |= CommitContext;
          commitPassiveUnmountEffects(root3.current);
          commitPassiveMountEffects(root3, root3.current, lanes, transitions);
          {
            var profilerEffects = pendingPassiveProfilerEffects;
            pendingPassiveProfilerEffects = [];
            for (var i2 = 0; i2 < profilerEffects.length; i2++) {
              var _fiber = profilerEffects[i2];
              commitPassiveEffectDurations(root3, _fiber);
            }
          }
          {
            markPassiveEffectsStopped();
          }
          {
            commitDoubleInvokeEffectsInDEV(root3.current, true);
          }
          executionContext = prevExecutionContext;
          flushSyncCallbacks();
          {
            if (didScheduleUpdateDuringPassiveEffects) {
              if (root3 === rootWithPassiveNestedUpdates) {
                nestedPassiveUpdateCount++;
              } else {
                nestedPassiveUpdateCount = 0;
                rootWithPassiveNestedUpdates = root3;
              }
            } else {
              nestedPassiveUpdateCount = 0;
            }
            isFlushingPassiveEffects = false;
            didScheduleUpdateDuringPassiveEffects = false;
          }
          onPostCommitRoot(root3);
          {
            var stateNode = root3.current.stateNode;
            stateNode.effectDuration = 0;
            stateNode.passiveEffectDuration = 0;
          }
          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 = createCapturedValueAtFiber(error2, sourceFiber);
          var update = createRootErrorUpdate(rootFiber, errorInfo, SyncLane);
          var root3 = enqueueUpdate(rootFiber, update, SyncLane);
          var eventTime = requestEventTime();
          if (root3 !== null) {
            markRootUpdated(root3, SyncLane, eventTime);
            ensureRootIsScheduled(root3, eventTime);
          }
        }
        function captureCommitPhaseError(sourceFiber, nearestMountedAncestor, error$1) {
          {
            reportUncaughtErrorInDEV(error$1);
            setIsRunningInsertionEffect(false);
          }
          if (sourceFiber.tag === HostRoot) {
            captureCommitPhaseErrorOnRoot(sourceFiber, sourceFiber, error$1);
            return;
          }
          var fiber = null;
          {
            fiber = nearestMountedAncestor;
          }
          while (fiber !== null) {
            if (fiber.tag === HostRoot) {
              captureCommitPhaseErrorOnRoot(fiber, sourceFiber, error$1);
              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 = createCapturedValueAtFiber(error$1, sourceFiber);
                var update = createClassErrorUpdate(fiber, errorInfo, SyncLane);
                var root3 = enqueueUpdate(fiber, update, SyncLane);
                var eventTime = requestEventTime();
                if (root3 !== null) {
                  markRootUpdated(root3, SyncLane, eventTime);
                  ensureRootIsScheduled(root3, eventTime);
                }
                return;
              }
            }
            fiber = fiber.return;
          }
          {
            error("Internal React error: Attempted to capture a commit phase error inside a detached tree. This indicates a bug in React. Likely causes include deleting the same fiber more than once, committing an already-finished tree, or an inconsistent return pointer.\n\nError message:\n\n%s", error$1);
          }
        }
        function pingSuspendedRoot(root3, wakeable, pingedLanes) {
          var pingCache = root3.pingCache;
          if (pingCache !== null) {
            pingCache.delete(wakeable);
          }
          var eventTime = requestEventTime();
          markRootPinged(root3, pingedLanes);
          warnIfSuspenseResolutionNotWrappedWithActDEV(root3);
          if (workInProgressRoot === root3 && isSubsetOfLanes(workInProgressRootRenderLanes, pingedLanes)) {
            if (workInProgressRootExitStatus === RootSuspendedWithDelay || workInProgressRootExitStatus === RootSuspended && includesOnlyRetries(workInProgressRootRenderLanes) && now2() - globalMostRecentFallbackTime < FALLBACK_THROTTLE_MS) {
              prepareFreshStack(root3, NoLanes);
            } else {
              workInProgressRootPingedLanes = mergeLanes(workInProgressRootPingedLanes, pingedLanes);
            }
          }
          ensureRootIsScheduled(root3, eventTime);
        }
        function retryTimedOutBoundary(boundaryFiber, retryLane) {
          if (retryLane === NoLane) {
            retryLane = requestRetryLane(boundaryFiber);
          }
          var eventTime = requestEventTime();
          var root3 = enqueueConcurrentRenderForLane(boundaryFiber, retryLane);
          if (root3 !== null) {
            markRootUpdated(root3, retryLane, eventTime);
            ensureRootIsScheduled(root3, eventTime);
          }
        }
        function retryDehydratedSuspenseBoundary(boundaryFiber) {
          var suspenseState = boundaryFiber.memoizedState;
          var retryLane = NoLane;
          if (suspenseState !== null) {
            retryLane = suspenseState.retryLane;
          }
          retryTimedOutBoundary(boundaryFiber, retryLane);
        }
        function resolveRetryWakeable(boundaryFiber, wakeable) {
          var retryLane = NoLane;
          var retryCache;
          switch (boundaryFiber.tag) {
            case SuspenseComponent:
              retryCache = boundaryFiber.stateNode;
              var suspenseState = boundaryFiber.memoizedState;
              if (suspenseState !== null) {
                retryLane = suspenseState.retryLane;
              }
              break;
            case SuspenseListComponent:
              retryCache = boundaryFiber.stateNode;
              break;
            default:
              throw new Error("Pinged unknown suspense boundary type. This is probably a bug in React.");
          }
          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 new 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;
              rootWithPassiveNestedUpdates = null;
              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();
            }
          }
        }
        function commitDoubleInvokeEffectsInDEV(fiber, hasPassiveEffects) {
          {
            setCurrentFiber(fiber);
            invokeEffectsInDev(fiber, MountLayoutDev, invokeLayoutEffectUnmountInDEV);
            if (hasPassiveEffects) {
              invokeEffectsInDev(fiber, MountPassiveDev, invokePassiveEffectUnmountInDEV);
            }
            invokeEffectsInDev(fiber, MountLayoutDev, invokeLayoutEffectMountInDEV);
            if (hasPassiveEffects) {
              invokeEffectsInDev(fiber, MountPassiveDev, invokePassiveEffectMountInDEV);
            }
            resetCurrentFiber();
          }
        }
        function invokeEffectsInDev(firstChild, fiberFlags, invokeEffectFn) {
          {
            var current2 = firstChild;
            var subtreeRoot = null;
            while (current2 !== null) {
              var primarySubtreeFlag = current2.subtreeFlags & fiberFlags;
              if (current2 !== subtreeRoot && current2.child !== null && primarySubtreeFlag !== NoFlags) {
                current2 = current2.child;
              } else {
                if ((current2.flags & fiberFlags) !== NoFlags) {
                  invokeEffectFn(current2);
                }
                if (current2.sibling !== null) {
                  current2 = current2.sibling;
                } else {
                  current2 = subtreeRoot = current2.return;
                }
              }
            }
          }
        }
        var didWarnStateUpdateForNotYetMountedComponent = null;
        function warnAboutUpdateOnNotYetMountedFiberInDEV(fiber) {
          {
            if ((executionContext & RenderContext) !== NoContext) {
              return;
            }
            if (!(fiber.mode & ConcurrentMode)) {
              return;
            }
            var tag = fiber.tag;
            if (tag !== IndeterminateComponent && tag !== HostRoot && tag !== ClassComponent && tag !== FunctionComponent && tag !== ForwardRef && tag !== MemoComponent && tag !== SimpleMemoComponent) {
              return;
            }
            var componentName = getComponentNameFromFiber(fiber) || "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 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 (didSuspendOrErrorWhileHydratingDEV() || originalError !== null && typeof originalError === "object" && typeof originalError.then === "function") {
                throw originalError;
              }
              resetContextDependencies();
              resetHooksAfterThrow();
              unwindInterruptedWork(current2, unitOfWork);
              assignFiberPropertiesInDEV(unitOfWork, originalWorkInProgressCopy);
              if (unitOfWork.mode & ProfileMode) {
                startProfilerTimer(unitOfWork);
              }
              invokeGuardedCallback(null, beginWork, null, current2, unitOfWork, lanes);
              if (hasCaughtError()) {
                var replayError = clearCaughtError();
                if (typeof replayError === "object" && replayError !== null && replayError._suppressLogging && typeof originalError === "object" && originalError !== null && !originalError._suppressLogging) {
                  originalError._suppressLogging = true;
                }
              }
              throw originalError;
            }
          };
        }
        var didWarnAboutUpdateInRender = false;
        var didWarnAboutUpdateInRenderForAnotherComponent;
        {
          didWarnAboutUpdateInRenderForAnotherComponent = /* @__PURE__ */ new Set();
        }
        function warnAboutRenderPhaseUpdatesInDEV(fiber) {
          {
            if (isRendering && !getIsUpdatingOpaqueValueInRenderPhaseInDEV()) {
              switch (fiber.tag) {
                case FunctionComponent:
                case ForwardRef:
                case SimpleMemoComponent: {
                  var renderingComponentName = workInProgress && getComponentNameFromFiber(workInProgress) || "Unknown";
                  var dedupeKey = renderingComponentName;
                  if (!didWarnAboutUpdateInRenderForAnotherComponent.has(dedupeKey)) {
                    didWarnAboutUpdateInRenderForAnotherComponent.add(dedupeKey);
                    var setStateComponentName = getComponentNameFromFiber(fiber) || "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;
                }
              }
            }
          }
        }
        function restorePendingUpdaters(root3, lanes) {
          {
            if (isDevToolsPresent) {
              var memoizedUpdaters = root3.memoizedUpdaters;
              memoizedUpdaters.forEach(function(schedulingFiber) {
                addFiberToLanesMap(root3, schedulingFiber, lanes);
              });
            }
          }
        }
        var fakeActCallbackNode = {};
        function scheduleCallback$1(priorityLevel, callback) {
          {
            var actQueue = ReactCurrentActQueue$1.current;
            if (actQueue !== null) {
              actQueue.push(callback);
              return fakeActCallbackNode;
            } else {
              return scheduleCallback(priorityLevel, callback);
            }
          }
        }
        function cancelCallback$1(callbackNode) {
          if (callbackNode === fakeActCallbackNode) {
            return;
          }
          return cancelCallback(callbackNode);
        }
        function shouldForceFlushFallbacksInDEV() {
          return ReactCurrentActQueue$1.current !== null;
        }
        function warnIfUpdatesNotWrappedWithActDEV(fiber) {
          {
            if (fiber.mode & ConcurrentMode) {
              if (!isConcurrentActEnvironment()) {
                return;
              }
            } else {
              if (!isLegacyActEnvironment()) {
                return;
              }
              if (executionContext !== NoContext) {
                return;
              }
              if (fiber.tag !== FunctionComponent && fiber.tag !== ForwardRef && fiber.tag !== SimpleMemoComponent) {
                return;
              }
            }
            if (ReactCurrentActQueue$1.current === null) {
              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", getComponentNameFromFiber(fiber));
              } finally {
                if (previousFiber) {
                  setCurrentFiber(fiber);
                } else {
                  resetCurrentFiber();
                }
              }
            }
          }
        }
        function warnIfSuspenseResolutionNotWrappedWithActDEV(root3) {
          {
            if (root3.tag !== LegacyRoot && isConcurrentActEnvironment() && ReactCurrentActQueue$1.current === null) {
              error("A suspended resource finished loading inside a test, but the event was not wrapped in act(...).\n\nWhen testing, code that resolves suspended data should be wrapped into act(...):\n\nact(() => {\n  /* finish loading suspended data */\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");
            }
          }
        }
        function setIsRunningInsertionEffect(isRunning) {
          {
            isRunningInsertionEffect = isRunning;
          }
        }
        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, element2) {
          {
            if (resolveFamily === null) {
              return false;
            }
            var prevType = fiber.elementType;
            var nextType = element2.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(root3, update) {
          {
            if (resolveFamily === null) {
              return;
            }
            var staleFamilies = update.staleFamilies, updatedFamilies = update.updatedFamilies;
            flushPassiveEffects();
            flushSync(function() {
              scheduleFibersWithFamiliesRecursively(root3.current, updatedFamilies, staleFamilies);
            });
          }
        };
        var scheduleRoot = function(root3, element2) {
          {
            if (root3.context !== emptyContextObject) {
              return;
            }
            flushPassiveEffects();
            flushSync(function() {
              updateContainer(element2, root3, 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) {
              var _root = enqueueConcurrentRenderForLane(fiber, SyncLane);
              if (_root !== null) {
                scheduleUpdateOnFiber(_root, fiber, SyncLane, NoTimestamp);
              }
            }
            if (child !== null && !needsRemount) {
              scheduleFibersWithFamiliesRecursively(child, updatedFamilies, staleFamilies);
            }
            if (sibling !== null) {
              scheduleFibersWithFamiliesRecursively(sibling, updatedFamilies, staleFamilies);
            }
          }
        }
        var findHostInstancesForRefresh = function(root3, families) {
          {
            var hostInstances = /* @__PURE__ */ new Set();
            var types2 = new Set(families.map(function(family) {
              return family.current;
            }));
            findHostInstancesForMatchingFibersRecursively(root3.current, types2, hostInstances);
            return hostInstances;
          }
        };
        function findHostInstancesForMatchingFibersRecursively(fiber, types2, 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 (types2.has(candidateType)) {
                didMatch = true;
              }
            }
            if (didMatch) {
              findHostInstancesForFiberShallowly(fiber, hostInstances);
            } else {
              if (child !== null) {
                findHostInstancesForMatchingFibersRecursively(child, types2, hostInstances);
              }
            }
            if (sibling !== null) {
              findHostInstancesForMatchingFibersRecursively(sibling, types2, hostInstances);
            }
          }
        }
        function findHostInstancesForFiberShallowly(fiber, hostInstances) {
          {
            var foundHostInstances = findChildHostInstancesForFiberShallowly(fiber, hostInstances);
            if (foundHostInstances) {
              return;
            }
            var node56 = fiber;
            while (true) {
              switch (node56.tag) {
                case HostComponent:
                  hostInstances.add(node56.stateNode);
                  return;
                case HostPortal:
                  hostInstances.add(node56.stateNode.containerInfo);
                  return;
                case HostRoot:
                  hostInstances.add(node56.stateNode.containerInfo);
                  return;
              }
              if (node56.return === null) {
                throw new Error("Expected to reach root first.");
              }
              node56 = node56.return;
            }
          }
        }
        function findChildHostInstancesForFiberShallowly(fiber, hostInstances) {
          {
            var node56 = fiber;
            var foundHostInstances = false;
            while (true) {
              if (node56.tag === HostComponent) {
                foundHostInstances = true;
                hostInstances.add(node56.stateNode);
              } else if (node56.child !== null) {
                node56.child.return = node56;
                node56 = node56.child;
                continue;
              }
              if (node56 === fiber) {
                return foundHostInstances;
              }
              while (node56.sibling === null) {
                if (node56.return === null || node56.return === fiber) {
                  return foundHostInstances;
                }
                node56 = node56.return;
              }
              node56.sibling.return = node56.return;
              node56 = node56.sibling;
            }
          }
          return false;
        }
        var hasBadMapPolyfill;
        {
          hasBadMapPolyfill = false;
          try {
            var nonExtensibleObject = Object.preventExtensions({});
            /* @__PURE__ */ new Map([[nonExtensibleObject, null]]);
            /* @__PURE__ */ new Set([nonExtensibleObject]);
          } catch (e3) {
            hasBadMapPolyfill = true;
          }
        }
        function FiberNode(tag, pendingProps, key, mode) {
          this.tag = tag;
          this.key = key;
          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.subtreeFlags = NoFlags;
          this.deletions = 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._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, key, mode) {
          return new FiberNode(tag, pendingProps, key, mode);
        };
        function shouldConstruct$1(Component8) {
          var prototype = Component8.prototype;
          return !!(prototype && prototype.isReactComponent);
        }
        function isSimpleFunctionComponent(type) {
          return typeof type === "function" && !shouldConstruct$1(type) && type.defaultProps === void 0;
        }
        function resolveLazyComponentTag(Component8) {
          if (typeof Component8 === "function") {
            return shouldConstruct$1(Component8) ? ClassComponent : FunctionComponent;
          } else if (Component8 !== void 0 && Component8 !== null) {
            var $$typeof = Component8.$$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._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.subtreeFlags = NoFlags;
            workInProgress2.deletions = null;
            {
              workInProgress2.actualDuration = 0;
              workInProgress2.actualStartTime = -1;
            }
          }
          workInProgress2.flags = current2.flags & StaticMask;
          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 &= StaticMask | Placement;
          var current2 = workInProgress2.alternate;
          if (current2 === null) {
            workInProgress2.childLanes = NoLanes;
            workInProgress2.lanes = renderLanes2;
            workInProgress2.child = null;
            workInProgress2.subtreeFlags = NoFlags;
            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.subtreeFlags = NoFlags;
            workInProgress2.deletions = null;
            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, isStrictMode, concurrentUpdatesByDefaultOverride) {
          var mode;
          if (tag === ConcurrentRoot2) {
            mode = ConcurrentMode;
            if (isStrictMode === true) {
              mode |= StrictLegacyMode;
              {
                mode |= StrictEffectsMode;
              }
            }
          } else {
            mode = NoMode;
          }
          if (isDevToolsPresent) {
            mode |= ProfileMode;
          }
          return createFiber(HostRoot, null, null, mode);
        }
        function createFiberFromTypeAndProps(type, key, 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, key);
                case REACT_STRICT_MODE_TYPE:
                  fiberTag = Mode;
                  mode |= StrictLegacyMode;
                  if ((mode & ConcurrentMode) !== NoMode) {
                    mode |= StrictEffectsMode;
                  }
                  break;
                case REACT_PROFILER_TYPE:
                  return createFiberFromProfiler(pendingProps, mode, lanes, key);
                case REACT_SUSPENSE_TYPE:
                  return createFiberFromSuspense(pendingProps, mode, lanes, key);
                case REACT_SUSPENSE_LIST_TYPE:
                  return createFiberFromSuspenseList(pendingProps, mode, lanes, key);
                case REACT_OFFSCREEN_TYPE:
                  return createFiberFromOffscreen(pendingProps, mode, lanes, key);
                case REACT_LEGACY_HIDDEN_TYPE:
                case REACT_SCOPE_TYPE:
                case REACT_CACHE_TYPE:
                case REACT_TRACING_MARKER_TYPE:
                case REACT_DEBUG_TRACING_MODE_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;
                    }
                  }
                  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 ? getComponentNameFromFiber(owner) : null;
                    if (ownerName) {
                      info += "\n\nCheck the render method of `" + ownerName + "`.";
                    }
                  }
                  throw new 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, key, mode);
          fiber.elementType = type;
          fiber.type = resolvedType;
          fiber.lanes = lanes;
          {
            fiber._debugOwner = owner;
          }
          return fiber;
        }
        function createFiberFromElement(element2, mode, lanes) {
          var owner = null;
          {
            owner = element2._owner;
          }
          var type = element2.type;
          var key = element2.key;
          var pendingProps = element2.props;
          var fiber = createFiberFromTypeAndProps(type, key, pendingProps, owner, mode, lanes);
          {
            fiber._debugSource = element2._source;
            fiber._debugOwner = element2._owner;
          }
          return fiber;
        }
        function createFiberFromFragment(elements, mode, lanes, key) {
          var fiber = createFiber(Fragment9, elements, key, mode);
          fiber.lanes = lanes;
          return fiber;
        }
        function createFiberFromProfiler(pendingProps, mode, lanes, key) {
          {
            if (typeof pendingProps.id !== "string") {
              error('Profiler must specify an "id" of type `string` as a prop. Received the type `%s` instead.', typeof pendingProps.id);
            }
          }
          var fiber = createFiber(Profiler, pendingProps, key, mode | ProfileMode);
          fiber.elementType = REACT_PROFILER_TYPE;
          fiber.lanes = lanes;
          {
            fiber.stateNode = {
              effectDuration: 0,
              passiveEffectDuration: 0
            };
          }
          return fiber;
        }
        function createFiberFromSuspense(pendingProps, mode, lanes, key) {
          var fiber = createFiber(SuspenseComponent, pendingProps, key, mode);
          fiber.elementType = REACT_SUSPENSE_TYPE;
          fiber.lanes = lanes;
          return fiber;
        }
        function createFiberFromSuspenseList(pendingProps, mode, lanes, key) {
          var fiber = createFiber(SuspenseListComponent, pendingProps, key, mode);
          fiber.elementType = REACT_SUSPENSE_LIST_TYPE;
          fiber.lanes = lanes;
          return fiber;
        }
        function createFiberFromOffscreen(pendingProps, mode, lanes, key) {
          var fiber = createFiber(OffscreenComponent, pendingProps, key, mode);
          fiber.elementType = REACT_OFFSCREEN_TYPE;
          fiber.lanes = lanes;
          var primaryChildInstance = {
            isHidden: false
          };
          fiber.stateNode = primaryChildInstance;
          return fiber;
        }
        function createFiberFromText(content2, mode, lanes) {
          var fiber = createFiber(HostText, content2, null, mode);
          fiber.lanes = lanes;
          return fiber;
        }
        function createFiberFromHostInstanceForDeletion() {
          var fiber = createFiber(HostComponent, null, null, NoMode);
          fiber.elementType = "DELETED";
          return fiber;
        }
        function createFiberFromDehydratedFragment(dehydratedNode) {
          var fiber = createFiber(DehydratedFragment, null, null, NoMode);
          fiber.stateNode = dehydratedNode;
          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,
            // Used by persistent updates
            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.subtreeFlags = source.subtreeFlags;
          target.deletions = source.deletions;
          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._debugSource = source._debugSource;
          target._debugOwner = source._debugOwner;
          target._debugNeedsRemount = source._debugNeedsRemount;
          target._debugHookTypes = source._debugHookTypes;
          return target;
        }
        function FiberRootNode(containerInfo, tag, hydrate2, identifierPrefix, onRecoverableError) {
          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.callbackNode = null;
          this.callbackPriority = NoLane;
          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.identifierPrefix = identifierPrefix;
          this.onRecoverableError = onRecoverableError;
          {
            this.mutableSourceEagerHydrationData = null;
          }
          {
            this.effectDuration = 0;
            this.passiveEffectDuration = 0;
          }
          {
            this.memoizedUpdaters = /* @__PURE__ */ new Set();
            var pendingUpdatersLaneMap = this.pendingUpdatersLaneMap = [];
            for (var _i = 0; _i < TotalLanes; _i++) {
              pendingUpdatersLaneMap.push(/* @__PURE__ */ new Set());
            }
          }
          {
            switch (tag) {
              case ConcurrentRoot2:
                this._debugRootType = hydrate2 ? "hydrateRoot()" : "createRoot()";
                break;
              case LegacyRoot:
                this._debugRootType = hydrate2 ? "hydrate()" : "render()";
                break;
            }
          }
        }
        function createFiberRoot(containerInfo, tag, hydrate2, initialChildren, hydrationCallbacks, isStrictMode, concurrentUpdatesByDefaultOverride, identifierPrefix, onRecoverableError, transitionCallbacks) {
          var root3 = new FiberRootNode(containerInfo, tag, hydrate2, identifierPrefix, onRecoverableError);
          var uninitializedFiber = createHostRootFiber(tag, isStrictMode);
          root3.current = uninitializedFiber;
          uninitializedFiber.stateNode = root3;
          {
            var _initialState = {
              element: initialChildren,
              isDehydrated: hydrate2,
              cache: null,
              // not enabled yet
              transitions: null,
              pendingSuspenseBoundaries: null
            };
            uninitializedFiber.memoizedState = _initialState;
          }
          initializeUpdateQueue(uninitializedFiber);
          return root3;
        }
        var ReactVersion = "18.2.0";
        function createPortal2(children, containerInfo, implementation) {
          var key = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : null;
          {
            checkKeyStringCoercion(key);
          }
          return {
            // This tag allow us to uniquely identify this as a React Portal
            $$typeof: REACT_PORTAL_TYPE,
            key: key == null ? null : "" + key,
            children,
            containerInfo,
            implementation
          };
        }
        var didWarnAboutNestedUpdates;
        var didWarnAboutFindNodeInStrictMode;
        {
          didWarnAboutNestedUpdates = false;
          didWarnAboutFindNodeInStrictMode = {};
        }
        function getContextForSubtree(parentComponent) {
          if (!parentComponent) {
            return emptyContextObject;
          }
          var fiber = get3(parentComponent);
          var parentContext = findCurrentUnmaskedContext(fiber);
          if (fiber.tag === ClassComponent) {
            var Component8 = fiber.type;
            if (isContextProvider(Component8)) {
              return processChildContext(fiber, Component8, parentContext);
            }
          }
          return parentContext;
        }
        function findHostInstanceWithWarning(component, methodName) {
          {
            var fiber = get3(component);
            if (fiber === void 0) {
              if (typeof component.render === "function") {
                throw new Error("Unable to find node on an unmounted component.");
              } else {
                var keys4 = Object.keys(component).join(",");
                throw new Error("Argument appears to not be a ReactComponent. Keys: " + keys4);
              }
            }
            var hostFiber = findCurrentHostFiber(fiber);
            if (hostFiber === null) {
              return null;
            }
            if (hostFiber.mode & StrictLegacyMode) {
              var componentName = getComponentNameFromFiber(fiber) || "Component";
              if (!didWarnAboutFindNodeInStrictMode[componentName]) {
                didWarnAboutFindNodeInStrictMode[componentName] = true;
                var previousFiber = current;
                try {
                  setCurrentFiber(hostFiber);
                  if (fiber.mode & StrictLegacyMode) {
                    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, hydrationCallbacks, isStrictMode, concurrentUpdatesByDefaultOverride, identifierPrefix, onRecoverableError, transitionCallbacks) {
          var hydrate2 = false;
          var initialChildren = null;
          return createFiberRoot(containerInfo, tag, hydrate2, initialChildren, hydrationCallbacks, isStrictMode, concurrentUpdatesByDefaultOverride, identifierPrefix, onRecoverableError);
        }
        function createHydrationContainer(initialChildren, callback, containerInfo, tag, hydrationCallbacks, isStrictMode, concurrentUpdatesByDefaultOverride, identifierPrefix, onRecoverableError, transitionCallbacks) {
          var hydrate2 = true;
          var root3 = createFiberRoot(containerInfo, tag, hydrate2, initialChildren, hydrationCallbacks, isStrictMode, concurrentUpdatesByDefaultOverride, identifierPrefix, onRecoverableError);
          root3.context = getContextForSubtree(null);
          var current2 = root3.current;
          var eventTime = requestEventTime();
          var lane = requestUpdateLane(current2);
          var update = createUpdate(eventTime, lane);
          update.callback = callback !== void 0 && callback !== null ? callback : null;
          enqueueUpdate(current2, update, lane);
          scheduleInitialHydrationOnRoot(root3, lane, eventTime);
          return root3;
        }
        function updateContainer(element2, container, parentComponent, callback) {
          {
            onScheduleRoot(container, element2);
          }
          var current$1 = container.current;
          var eventTime = requestEventTime();
          var lane = requestUpdateLane(current$1);
          {
            markRenderScheduled(lane);
          }
          var context2 = getContextForSubtree(parentComponent);
          if (container.context === null) {
            container.context = context2;
          } else {
            container.pendingContext = context2;
          }
          {
            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.", getComponentNameFromFiber(current) || "Unknown");
            }
          }
          var update = createUpdate(eventTime, lane);
          update.payload = {
            element: element2
          };
          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;
          }
          var root3 = enqueueUpdate(current$1, update, lane);
          if (root3 !== null) {
            scheduleUpdateOnFiber(root3, current$1, lane, eventTime);
            entangleTransitions(root3, current$1, lane);
          }
          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 attemptSynchronousHydration$1(fiber) {
          switch (fiber.tag) {
            case HostRoot: {
              var root3 = fiber.stateNode;
              if (isRootDehydrated(root3)) {
                var lanes = getHighestPriorityPendingLanes(root3);
                flushRoot(root3, lanes);
              }
              break;
            }
            case SuspenseComponent: {
              flushSync(function() {
                var root4 = enqueueConcurrentRenderForLane(fiber, SyncLane);
                if (root4 !== null) {
                  var eventTime = requestEventTime();
                  scheduleUpdateOnFiber(root4, fiber, SyncLane, eventTime);
                }
              });
              var retryLane = SyncLane;
              markRetryLaneIfNotHydrated(fiber, retryLane);
              break;
            }
          }
        }
        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 attemptContinuousHydration$1(fiber) {
          if (fiber.tag !== SuspenseComponent) {
            return;
          }
          var lane = SelectiveHydrationLane;
          var root3 = enqueueConcurrentRenderForLane(fiber, lane);
          if (root3 !== null) {
            var eventTime = requestEventTime();
            scheduleUpdateOnFiber(root3, fiber, lane, eventTime);
          }
          markRetryLaneIfNotHydrated(fiber, lane);
        }
        function attemptHydrationAtCurrentPriority$1(fiber) {
          if (fiber.tag !== SuspenseComponent) {
            return;
          }
          var lane = requestUpdateLane(fiber);
          var root3 = enqueueConcurrentRenderForLane(fiber, lane);
          if (root3 !== null) {
            var eventTime = requestEventTime();
            scheduleUpdateOnFiber(root3, fiber, lane, eventTime);
          }
          markRetryLaneIfNotHydrated(fiber, lane);
        }
        function findHostInstanceWithNoPortals(fiber) {
          var hostFiber = findCurrentHostFiberWithNoPortals(fiber);
          if (hostFiber === null) {
            return null;
          }
          return hostFiber.stateNode;
        }
        var shouldErrorImpl = function(fiber) {
          return null;
        };
        function shouldError(fiber) {
          return shouldErrorImpl(fiber);
        }
        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 setErrorHandler = null;
        var setSuspenseHandler = null;
        {
          var copyWithDeleteImpl = function(obj, path2, index2) {
            var key = path2[index2];
            var updated = isArray2(obj) ? obj.slice() : assign3({}, obj);
            if (index2 + 1 === path2.length) {
              if (isArray2(updated)) {
                updated.splice(key, 1);
              } else {
                delete updated[key];
              }
              return updated;
            }
            updated[key] = copyWithDeleteImpl(obj[key], path2, index2 + 1);
            return updated;
          };
          var copyWithDelete = function(obj, path2) {
            return copyWithDeleteImpl(obj, path2, 0);
          };
          var copyWithRenameImpl = function(obj, oldPath, newPath, index2) {
            var oldKey = oldPath[index2];
            var updated = isArray2(obj) ? obj.slice() : assign3({}, obj);
            if (index2 + 1 === oldPath.length) {
              var newKey = newPath[index2];
              updated[newKey] = updated[oldKey];
              if (isArray2(updated)) {
                updated.splice(oldKey, 1);
              } else {
                delete updated[oldKey];
              }
            } else {
              updated[oldKey] = copyWithRenameImpl(
                // $FlowFixMe number or string is fine here
                obj[oldKey],
                oldPath,
                newPath,
                index2 + 1
              );
            }
            return updated;
          };
          var copyWithRename = function(obj, oldPath, newPath) {
            if (oldPath.length !== newPath.length) {
              warn5("copyWithRename() expects paths of the same length");
              return;
            } else {
              for (var i2 = 0; i2 < newPath.length - 1; i2++) {
                if (oldPath[i2] !== newPath[i2]) {
                  warn5("copyWithRename() expects paths to be the same except for the deepest key");
                  return;
                }
              }
            }
            return copyWithRenameImpl(obj, oldPath, newPath, 0);
          };
          var copyWithSetImpl = function(obj, path2, index2, value) {
            if (index2 >= path2.length) {
              return value;
            }
            var key = path2[index2];
            var updated = isArray2(obj) ? obj.slice() : assign3({}, obj);
            updated[key] = copyWithSetImpl(obj[key], path2, index2 + 1, value);
            return updated;
          };
          var copyWithSet = function(obj, path2, value) {
            return copyWithSetImpl(obj, path2, 0, value);
          };
          var findHook = function(fiber, id2) {
            var currentHook2 = fiber.memoizedState;
            while (currentHook2 !== null && id2 > 0) {
              currentHook2 = currentHook2.next;
              id2--;
            }
            return currentHook2;
          };
          overrideHookState = function(fiber, id2, path2, value) {
            var hook = findHook(fiber, id2);
            if (hook !== null) {
              var newState = copyWithSet(hook.memoizedState, path2, value);
              hook.memoizedState = newState;
              hook.baseState = newState;
              fiber.memoizedProps = assign3({}, fiber.memoizedProps);
              var root3 = enqueueConcurrentRenderForLane(fiber, SyncLane);
              if (root3 !== null) {
                scheduleUpdateOnFiber(root3, fiber, SyncLane, NoTimestamp);
              }
            }
          };
          overrideHookStateDeletePath = function(fiber, id2, path2) {
            var hook = findHook(fiber, id2);
            if (hook !== null) {
              var newState = copyWithDelete(hook.memoizedState, path2);
              hook.memoizedState = newState;
              hook.baseState = newState;
              fiber.memoizedProps = assign3({}, fiber.memoizedProps);
              var root3 = enqueueConcurrentRenderForLane(fiber, SyncLane);
              if (root3 !== null) {
                scheduleUpdateOnFiber(root3, fiber, SyncLane, NoTimestamp);
              }
            }
          };
          overrideHookStateRenamePath = function(fiber, id2, oldPath, newPath) {
            var hook = findHook(fiber, id2);
            if (hook !== null) {
              var newState = copyWithRename(hook.memoizedState, oldPath, newPath);
              hook.memoizedState = newState;
              hook.baseState = newState;
              fiber.memoizedProps = assign3({}, fiber.memoizedProps);
              var root3 = enqueueConcurrentRenderForLane(fiber, SyncLane);
              if (root3 !== null) {
                scheduleUpdateOnFiber(root3, fiber, SyncLane, NoTimestamp);
              }
            }
          };
          overrideProps = function(fiber, path2, value) {
            fiber.pendingProps = copyWithSet(fiber.memoizedProps, path2, value);
            if (fiber.alternate) {
              fiber.alternate.pendingProps = fiber.pendingProps;
            }
            var root3 = enqueueConcurrentRenderForLane(fiber, SyncLane);
            if (root3 !== null) {
              scheduleUpdateOnFiber(root3, fiber, SyncLane, NoTimestamp);
            }
          };
          overridePropsDeletePath = function(fiber, path2) {
            fiber.pendingProps = copyWithDelete(fiber.memoizedProps, path2);
            if (fiber.alternate) {
              fiber.alternate.pendingProps = fiber.pendingProps;
            }
            var root3 = enqueueConcurrentRenderForLane(fiber, SyncLane);
            if (root3 !== null) {
              scheduleUpdateOnFiber(root3, fiber, SyncLane, NoTimestamp);
            }
          };
          overridePropsRenamePath = function(fiber, oldPath, newPath) {
            fiber.pendingProps = copyWithRename(fiber.memoizedProps, oldPath, newPath);
            if (fiber.alternate) {
              fiber.alternate.pendingProps = fiber.pendingProps;
            }
            var root3 = enqueueConcurrentRenderForLane(fiber, SyncLane);
            if (root3 !== null) {
              scheduleUpdateOnFiber(root3, fiber, SyncLane, NoTimestamp);
            }
          };
          scheduleUpdate = function(fiber) {
            var root3 = enqueueConcurrentRenderForLane(fiber, SyncLane);
            if (root3 !== null) {
              scheduleUpdateOnFiber(root3, fiber, SyncLane, NoTimestamp);
            }
          };
          setErrorHandler = function(newShouldErrorImpl) {
            shouldErrorImpl = newShouldErrorImpl;
          };
          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,
            setErrorHandler,
            setSuspenseHandler,
            scheduleUpdate,
            currentDispatcherRef: ReactCurrentDispatcher2,
            findHostInstanceByFiber,
            findFiberByHostInstance: findFiberByHostInstance || emptyFindFiberByHostInstance,
            // React Refresh
            findHostInstancesForRefresh,
            scheduleRefresh,
            scheduleRoot,
            setRefreshHandler,
            // Enables DevTools to append owner stacks to error messages in DEV mode.
            getCurrentFiber: getCurrentFiberForDevTools,
            // Enables DevTools to detect reconciler version rather than renderer version
            // which may not match for third party renderers.
            reconcilerVersion: ReactVersion
          });
        }
        var defaultOnRecoverableError = typeof reportError === "function" ? (
          // In modern browsers, reportError will dispatch an error event,
          // emulating an uncaught JavaScript error.
          reportError
        ) : function(error2) {
          console["error"](error2);
        };
        function ReactDOMRoot(internalRoot) {
          this._internalRoot = internalRoot;
        }
        ReactDOMHydrationRoot.prototype.render = ReactDOMRoot.prototype.render = function(children) {
          var root3 = this._internalRoot;
          if (root3 === null) {
            throw new Error("Cannot update an unmounted root.");
          }
          {
            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().");
            } else if (isValidContainer(arguments[1])) {
              error("You passed a container to the second argument of root.render(...). You don't need to pass it again since you already passed it to create the root.");
            } else if (typeof arguments[1] !== "undefined") {
              error("You passed a second argument to root.render(...) but it only accepts one argument.");
            }
            var container = root3.containerInfo;
            if (container.nodeType !== COMMENT_NODE) {
              var hostInstance = findHostInstanceWithNoPortals(root3.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, root3, null, null);
        };
        ReactDOMHydrationRoot.prototype.unmount = ReactDOMRoot.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 root3 = this._internalRoot;
          if (root3 !== null) {
            this._internalRoot = null;
            var container = root3.containerInfo;
            {
              if (isAlreadyRendering()) {
                error("Attempted to synchronously unmount a root while React was already rendering. React cannot finish unmounting the root until the current render has completed, which may lead to a race condition.");
              }
            }
            flushSync(function() {
              updateContainer(null, root3, null, null);
            });
            unmarkContainerAsRoot(container);
          }
        };
        function createRoot3(container, options2) {
          if (!isValidContainer(container)) {
            throw new Error("createRoot(...): Target container is not a DOM element.");
          }
          warnIfReactDOMContainerInDEV(container);
          var isStrictMode = false;
          var concurrentUpdatesByDefaultOverride = false;
          var identifierPrefix = "";
          var onRecoverableError = defaultOnRecoverableError;
          var transitionCallbacks = null;
          if (options2 !== null && options2 !== void 0) {
            {
              if (options2.hydrate) {
                warn5("hydrate through createRoot is deprecated. Use ReactDOMClient.hydrateRoot(container, <App />) instead.");
              } else {
                if (typeof options2 === "object" && options2 !== null && options2.$$typeof === REACT_ELEMENT_TYPE) {
                  error("You passed a JSX element to createRoot. You probably meant to call root.render instead. Example usage:\n\n  let root = createRoot(domContainer);\n  root.render(<App />);");
                }
              }
            }
            if (options2.unstable_strictMode === true) {
              isStrictMode = true;
            }
            if (options2.identifierPrefix !== void 0) {
              identifierPrefix = options2.identifierPrefix;
            }
            if (options2.onRecoverableError !== void 0) {
              onRecoverableError = options2.onRecoverableError;
            }
            if (options2.transitionCallbacks !== void 0) {
              transitionCallbacks = options2.transitionCallbacks;
            }
          }
          var root3 = createContainer(container, ConcurrentRoot2, null, isStrictMode, concurrentUpdatesByDefaultOverride, identifierPrefix, onRecoverableError);
          markContainerAsRoot(root3.current, container);
          var rootContainerElement = container.nodeType === COMMENT_NODE ? container.parentNode : container;
          listenToAllSupportedEvents(rootContainerElement);
          return new ReactDOMRoot(root3);
        }
        function ReactDOMHydrationRoot(internalRoot) {
          this._internalRoot = internalRoot;
        }
        function scheduleHydration(target) {
          if (target) {
            queueExplicitHydrationTarget(target);
          }
        }
        ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = scheduleHydration;
        function hydrateRoot(container, initialChildren, options2) {
          if (!isValidContainer(container)) {
            throw new Error("hydrateRoot(...): Target container is not a DOM element.");
          }
          warnIfReactDOMContainerInDEV(container);
          {
            if (initialChildren === void 0) {
              error("Must provide initial children as second argument to hydrateRoot. Example usage: hydrateRoot(domContainer, <App />)");
            }
          }
          var hydrationCallbacks = options2 != null ? options2 : null;
          var mutableSources = options2 != null && options2.hydratedSources || null;
          var isStrictMode = false;
          var concurrentUpdatesByDefaultOverride = false;
          var identifierPrefix = "";
          var onRecoverableError = defaultOnRecoverableError;
          if (options2 !== null && options2 !== void 0) {
            if (options2.unstable_strictMode === true) {
              isStrictMode = true;
            }
            if (options2.identifierPrefix !== void 0) {
              identifierPrefix = options2.identifierPrefix;
            }
            if (options2.onRecoverableError !== void 0) {
              onRecoverableError = options2.onRecoverableError;
            }
          }
          var root3 = createHydrationContainer(initialChildren, null, container, ConcurrentRoot2, hydrationCallbacks, isStrictMode, concurrentUpdatesByDefaultOverride, identifierPrefix, onRecoverableError);
          markContainerAsRoot(root3.current, container);
          listenToAllSupportedEvents(container);
          if (mutableSources) {
            for (var i2 = 0; i2 < mutableSources.length; i2++) {
              var mutableSource = mutableSources[i2];
              registerMutableSourceForHydration(root3, mutableSource);
            }
          }
          return new ReactDOMHydrationRoot(root3);
        }
        function isValidContainer(node56) {
          return !!(node56 && (node56.nodeType === ELEMENT_NODE || node56.nodeType === DOCUMENT_NODE || node56.nodeType === DOCUMENT_FRAGMENT_NODE || !disableCommentsAsDOMContainers));
        }
        function isValidContainerLegacy(node56) {
          return !!(node56 && (node56.nodeType === ELEMENT_NODE || node56.nodeType === DOCUMENT_NODE || node56.nodeType === DOCUMENT_FRAGMENT_NODE || node56.nodeType === COMMENT_NODE && node56.nodeValue === " react-mount-point-unstable "));
        }
        function warnIfReactDOMContainerInDEV(container) {
          {
            if (container.nodeType === ELEMENT_NODE && container.tagName && container.tagName.toUpperCase() === "BODY") {
              error("createRoot(): Creating roots directly with 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 using a container element created for your app.");
            }
            if (isContainerMarkedAsRoot(container)) {
              if (container._reactRootContainer) {
                error("You are calling ReactDOMClient.createRoot() on a container that was previously passed to ReactDOM.render(). This is not supported.");
              } else {
                error("You are calling ReactDOMClient.createRoot() on a container that has already been passed to createRoot() before. Instead, call root.render() on the existing root instead if you want to update it.");
              }
            }
          }
        }
        var ReactCurrentOwner$3 = ReactSharedInternals.ReactCurrentOwner;
        var topLevelUpdateWarnings;
        {
          topLevelUpdateWarnings = function(container) {
            if (container._reactRootContainer && container.nodeType !== COMMENT_NODE) {
              var hostInstance = findHostInstanceWithNoPortals(container._reactRootContainer.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 rootEl2 = getReactRootElementInContainer(container);
            var hasNonRootReactChild = !!(rootEl2 && getInstanceFromNode(rootEl2));
            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 noopOnRecoverableError() {
        }
        function legacyCreateRootFromDOMContainer(container, initialChildren, parentComponent, callback, isHydrationContainer) {
          if (isHydrationContainer) {
            if (typeof callback === "function") {
              var originalCallback = callback;
              callback = function() {
                var instance = getPublicRootInstance(root3);
                originalCallback.call(instance);
              };
            }
            var root3 = createHydrationContainer(
              initialChildren,
              callback,
              container,
              LegacyRoot,
              null,
              // hydrationCallbacks
              false,
              // isStrictMode
              false,
              // concurrentUpdatesByDefaultOverride,
              "",
              // identifierPrefix
              noopOnRecoverableError
            );
            container._reactRootContainer = root3;
            markContainerAsRoot(root3.current, container);
            var rootContainerElement = container.nodeType === COMMENT_NODE ? container.parentNode : container;
            listenToAllSupportedEvents(rootContainerElement);
            flushSync();
            return root3;
          } else {
            var rootSibling;
            while (rootSibling = container.lastChild) {
              container.removeChild(rootSibling);
            }
            if (typeof callback === "function") {
              var _originalCallback = callback;
              callback = function() {
                var instance = getPublicRootInstance(_root);
                _originalCallback.call(instance);
              };
            }
            var _root = createContainer(
              container,
              LegacyRoot,
              null,
              // hydrationCallbacks
              false,
              // isStrictMode
              false,
              // concurrentUpdatesByDefaultOverride,
              "",
              // identifierPrefix
              noopOnRecoverableError
            );
            container._reactRootContainer = _root;
            markContainerAsRoot(_root.current, container);
            var _rootContainerElement = container.nodeType === COMMENT_NODE ? container.parentNode : container;
            listenToAllSupportedEvents(_rootContainerElement);
            flushSync(function() {
              updateContainer(initialChildren, _root, parentComponent, callback);
            });
            return _root;
          }
        }
        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 maybeRoot = container._reactRootContainer;
          var root3;
          if (!maybeRoot) {
            root3 = legacyCreateRootFromDOMContainer(container, children, parentComponent, callback, forceHydrate);
          } else {
            root3 = maybeRoot;
            if (typeof callback === "function") {
              var originalCallback = callback;
              callback = function() {
                var instance = getPublicRootInstance(root3);
                originalCallback.call(instance);
              };
            }
            updateContainer(children, root3, parentComponent, callback);
          }
          return getPublicRootInstance(root3);
        }
        function findDOMNode2(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.", getComponentNameFromType(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(element2, container, callback) {
          {
            error("ReactDOM.hydrate is no longer supported in React 18. Use hydrateRoot instead. Until you switch to the new API, your app will behave as if it's running React 17. Learn more: https://reactjs.org/link/switch-to-createroot");
          }
          if (!isValidContainerLegacy(container)) {
            throw new 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 ReactDOMClient.createRoot(). This is not supported. Did you mean to call hydrateRoot(container, element)?");
            }
          }
          return legacyRenderSubtreeIntoContainer(null, element2, container, true, callback);
        }
        function render2(element2, container, callback) {
          {
            error("ReactDOM.render is no longer supported in React 18. Use createRoot instead. Until you switch to the new API, your app will behave as if it's running React 17. Learn more: https://reactjs.org/link/switch-to-createroot");
          }
          if (!isValidContainerLegacy(container)) {
            throw new 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 ReactDOMClient.createRoot(). This is not supported. Did you mean to call root.render(element)?");
            }
          }
          return legacyRenderSubtreeIntoContainer(null, element2, container, false, callback);
        }
        function unstable_renderSubtreeIntoContainer(parentComponent, element2, containerNode, callback) {
          {
            error("ReactDOM.unstable_renderSubtreeIntoContainer() is no longer supported in React 18. Consider using a portal instead. Until you switch to the createRoot API, your app will behave as if it's running React 17. Learn more: https://reactjs.org/link/switch-to-createroot");
          }
          if (!isValidContainerLegacy(containerNode)) {
            throw new Error("Target container is not a DOM element.");
          }
          if (parentComponent == null || !has2(parentComponent)) {
            throw new Error("parentComponent must be a valid React Component");
          }
          return legacyRenderSubtreeIntoContainer(parentComponent, element2, containerNode, false, callback);
        }
        function unmountComponentAtNode2(container) {
          if (!isValidContainerLegacy(container)) {
            throw new 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 ReactDOMClient.createRoot(). This is not supported. Did you mean to call root.unmount()?");
            }
          }
          if (container._reactRootContainer) {
            {
              var rootEl2 = getReactRootElementInContainer(container);
              var renderedByDifferentReact = rootEl2 && !getInstanceFromNode(rootEl2);
              if (renderedByDifferentReact) {
                error("unmountComponentAtNode(): The node you're attempting to unmount was rendered by another copy of React.");
              }
            }
            flushSync(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 && isValidContainerLegacy(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;
          }
        }
        setAttemptSynchronousHydration(attemptSynchronousHydration$1);
        setAttemptContinuousHydration(attemptContinuousHydration$1);
        setAttemptHydrationAtCurrentPriority(attemptHydrationAtCurrentPriority$1);
        setGetCurrentUpdatePriority(getCurrentUpdatePriority);
        setAttemptHydrationAtPriority(runWithPriority);
        {
          if (typeof Map !== "function" || // $FlowIssue Flow incorrectly thinks Map has no prototype
          Map.prototype == null || typeof Map.prototype.forEach !== "function" || typeof Set !== "function" || // $FlowIssue Flow incorrectly thinks Set has no prototype
          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, flushSync);
        function createPortal$1(children, container) {
          var key = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null;
          if (!isValidContainer(container)) {
            throw new Error("Target container is not a DOM element.");
          }
          return createPortal2(children, container, null, key);
        }
        function renderSubtreeIntoContainer(parentComponent, element2, containerNode, callback) {
          return unstable_renderSubtreeIntoContainer(parentComponent, element2, containerNode, callback);
        }
        var Internals = {
          usingClientEntryPoint: false,
          // Keep in sync with ReactTestUtils.js.
          // This is an array for better minification.
          Events: [getInstanceFromNode, getNodeFromInstance, getFiberCurrentPropsFromNode, enqueueStateRestore, restoreStateIfNeeded, batchedUpdates$1]
        };
        function createRoot$1(container, options2) {
          {
            if (!Internals.usingClientEntryPoint && true) {
              error('You are importing createRoot from "react-dom" which is not supported. You should instead import it from "react-dom/client".');
            }
          }
          return createRoot3(container, options2);
        }
        function hydrateRoot$1(container, initialChildren, options2) {
          {
            if (!Internals.usingClientEntryPoint && true) {
              error('You are importing hydrateRoot from "react-dom" which is not supported. You should instead import it from "react-dom/client".');
            }
          }
          return hydrateRoot(container, initialChildren, options2);
        }
        function flushSync$1(fn) {
          {
            if (isAlreadyRendering()) {
              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 flushSync(fn);
        }
        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.createRoot = createRoot$1;
        exports.findDOMNode = findDOMNode2;
        exports.flushSync = flushSync$1;
        exports.hydrate = hydrate;
        exports.hydrateRoot = hydrateRoot$1;
        exports.render = render2;
        exports.unmountComponentAtNode = unmountComponentAtNode2;
        exports.unstable_batchedUpdates = batchedUpdates$1;
        exports.unstable_renderSubtreeIntoContainer = renderSubtreeIntoContainer;
        exports.version = ReactVersion;
        if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop === "function") {
          __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
        }
      })();
    }
  }
});

// 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();
    }
  }
});

// node_modules/react-dom/client.js
var require_client = __commonJS({
  "node_modules/react-dom/client.js"(exports) {
    "use strict";
    var m = require_react_dom();
    if (false) {
      exports.createRoot = m.createRoot;
      exports.hydrateRoot = m.hydrateRoot;
    } else {
      i2 = m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
      exports.createRoot = function(c4, o) {
        i2.usingClientEntryPoint = true;
        try {
          return m.createRoot(c4, o);
        } finally {
          i2.usingClientEntryPoint = false;
        }
      };
      exports.hydrateRoot = function(c4, h, o) {
        i2.usingClientEntryPoint = true;
        try {
          return m.hydrateRoot(c4, h, o);
        } finally {
          i2.usingClientEntryPoint = false;
        }
      };
    }
    var i2;
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/util/RelayFeatureFlags.js
var require_RelayFeatureFlags = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/util/RelayFeatureFlags.js"(exports, module) {
    "use strict";
    var RelayFeatureFlags = {
      ENABLE_CLIENT_EDGES: false,
      ENABLE_VARIABLE_CONNECTION_KEY: false,
      ENABLE_PARTIAL_RENDERING_DEFAULT: true,
      ENABLE_REACT_FLIGHT_COMPONENT_FIELD: false,
      ENABLE_RELAY_RESOLVERS: false,
      ENABLE_GETFRAGMENTIDENTIFIER_OPTIMIZATION: false,
      ENABLE_FRIENDLY_QUERY_NAME_GQL_URL: false,
      ENABLE_LOAD_QUERY_REQUEST_DEDUPING: true,
      ENABLE_DO_NOT_WRAP_LIVE_QUERY: false,
      ENABLE_NOTIFY_SUBSCRIPTION: false,
      BATCH_ASYNC_MODULE_UPDATES_FN: null,
      ENABLE_CONTAINERS_SUBSCRIBE_ON_COMMIT: false,
      MAX_DATA_ID_LENGTH: null,
      STRING_INTERN_LEVEL: 0,
      USE_REACT_CACHE: false,
      USE_REACT_CACHE_LEGACY_TIMEOUTS: true,
      ENABLE_QUERY_RENDERER_SET_STATE_PREVENTION: false
    };
    module.exports = RelayFeatureFlags;
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/util/StringInterner.js
var require_StringInterner = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/util/StringInterner.js"(exports, module) {
    "use strict";
    var internTable = /* @__PURE__ */ new Map();
    var nextIndex = 1;
    var digits = initDigitTable();
    var INTERN_PREFIX = "	";
    var ESCAPE_PREFIX = "\v";
    function initDigitTable() {
      var digits2 = /* @__PURE__ */ new Set();
      for (var i2 = 0; i2 < 10; ++i2) {
        digits2.add(i2.toString());
      }
      return digits2;
    }
    function escape2(str) {
      if (
        // "\t<digit>..." -> "\v\t<digit>..."
        str[0] === INTERN_PREFIX && digits.has(str[1]) || // "\v..." -> "\v\v..."
        str[0] === ESCAPE_PREFIX
      ) {
        return ESCAPE_PREFIX + str;
      }
      return str;
    }
    function intern(str, limit) {
      if (limit == null || str.length < limit) {
        return escape2(str);
      }
      var internedString = internTable.get(str);
      if (internedString != null) {
        return internedString;
      }
      internedString = INTERN_PREFIX + nextIndex++;
      internTable.set(str, internedString);
      return internedString;
    }
    module.exports = {
      intern
    };
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/store/ClientID.js
var require_ClientID = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/store/ClientID.js"(exports, module) {
    "use strict";
    var RelayFeatureFlags = require_RelayFeatureFlags();
    var _require = require_StringInterner();
    var intern = _require.intern;
    var PREFIX = "client:";
    function generateClientID(id2, storageKey, index) {
      var internedId = RelayFeatureFlags.STRING_INTERN_LEVEL <= 0 ? id2 : intern(id2, RelayFeatureFlags.MAX_DATA_ID_LENGTH);
      var key = internedId + ":" + storageKey;
      if (index != null) {
        key += ":" + index;
      }
      if (key.indexOf(PREFIX) !== 0) {
        key = PREFIX + key;
      }
      return key;
    }
    function isClientID(id2) {
      return id2.indexOf(PREFIX) === 0;
    }
    var localID = 0;
    function generateUniqueClientID() {
      return "".concat(PREFIX, "local:").concat(localID++);
    }
    function generateClientObjectClientID(typename, localId, index) {
      var key = "".concat(PREFIX).concat(typename, ":").concat(localId);
      if (index != null) {
        key += ":" + index;
      }
      return key;
    }
    module.exports = {
      generateClientID,
      generateClientObjectClientID,
      generateUniqueClientID,
      isClientID
    };
  }
});

// node_modules/@babel/runtime/helpers/interopRequireDefault.js
var require_interopRequireDefault = __commonJS({
  "node_modules/@babel/runtime/helpers/interopRequireDefault.js"(exports, module) {
    function _interopRequireDefault(obj) {
      return obj && obj.__esModule ? obj : {
        "default": obj
      };
    }
    module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
  }
});

// node_modules/@babel/runtime/helpers/arrayLikeToArray.js
var require_arrayLikeToArray = __commonJS({
  "node_modules/@babel/runtime/helpers/arrayLikeToArray.js"(exports, module) {
    function _arrayLikeToArray25(arr, len) {
      if (len == null || len > arr.length)
        len = arr.length;
      for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++)
        arr2[i2] = arr[i2];
      return arr2;
    }
    module.exports = _arrayLikeToArray25, module.exports.__esModule = true, module.exports["default"] = module.exports;
  }
});

// node_modules/@babel/runtime/helpers/arrayWithoutHoles.js
var require_arrayWithoutHoles = __commonJS({
  "node_modules/@babel/runtime/helpers/arrayWithoutHoles.js"(exports, module) {
    var arrayLikeToArray = require_arrayLikeToArray();
    function _arrayWithoutHoles14(arr) {
      if (Array.isArray(arr))
        return arrayLikeToArray(arr);
    }
    module.exports = _arrayWithoutHoles14, module.exports.__esModule = true, module.exports["default"] = module.exports;
  }
});

// node_modules/@babel/runtime/helpers/iterableToArray.js
var require_iterableToArray = __commonJS({
  "node_modules/@babel/runtime/helpers/iterableToArray.js"(exports, module) {
    function _iterableToArray15(iter) {
      if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
        return Array.from(iter);
    }
    module.exports = _iterableToArray15, module.exports.__esModule = true, module.exports["default"] = module.exports;
  }
});

// node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js
var require_unsupportedIterableToArray = __commonJS({
  "node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js"(exports, module) {
    var arrayLikeToArray = require_arrayLikeToArray();
    function _unsupportedIterableToArray25(o, minLen) {
      if (!o)
        return;
      if (typeof o === "string")
        return arrayLikeToArray(o, minLen);
      var n2 = Object.prototype.toString.call(o).slice(8, -1);
      if (n2 === "Object" && o.constructor)
        n2 = o.constructor.name;
      if (n2 === "Map" || n2 === "Set")
        return Array.from(o);
      if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2))
        return arrayLikeToArray(o, minLen);
    }
    module.exports = _unsupportedIterableToArray25, module.exports.__esModule = true, module.exports["default"] = module.exports;
  }
});

// node_modules/@babel/runtime/helpers/nonIterableSpread.js
var require_nonIterableSpread = __commonJS({
  "node_modules/@babel/runtime/helpers/nonIterableSpread.js"(exports, module) {
    function _nonIterableSpread14() {
      throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
    }
    module.exports = _nonIterableSpread14, module.exports.__esModule = true, module.exports["default"] = module.exports;
  }
});

// node_modules/@babel/runtime/helpers/toConsumableArray.js
var require_toConsumableArray = __commonJS({
  "node_modules/@babel/runtime/helpers/toConsumableArray.js"(exports, module) {
    var arrayWithoutHoles = require_arrayWithoutHoles();
    var iterableToArray = require_iterableToArray();
    var unsupportedIterableToArray = require_unsupportedIterableToArray();
    var nonIterableSpread = require_nonIterableSpread();
    function _toConsumableArray14(arr) {
      return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();
    }
    module.exports = _toConsumableArray14, module.exports.__esModule = true, module.exports["default"] = module.exports;
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/util/RelayDefaultHandleKey.js
var require_RelayDefaultHandleKey = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/util/RelayDefaultHandleKey.js"(exports, module) {
    "use strict";
    module.exports = {
      DEFAULT_HANDLE_KEY: ""
    };
  }
});

// node_modules/invariant/browser.js
var require_browser = __commonJS({
  "node_modules/invariant/browser.js"(exports, module) {
    "use strict";
    var invariant3 = function(condition, format3, a2, b, c4, d, e3, f) {
      if (true) {
        if (format3 === void 0) {
          throw new Error("invariant requires an error message argument");
        }
      }
      if (!condition) {
        var error;
        if (format3 === void 0) {
          error = new Error(
            "Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings."
          );
        } else {
          var args = [a2, b, c4, d, e3, f];
          var argIndex = 0;
          error = new Error(
            format3.replace(/%s/g, function() {
              return args[argIndex++];
            })
          );
          error.name = "Invariant Violation";
        }
        error.framesToPop = 1;
        throw error;
      }
    };
    module.exports = invariant3;
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/util/getRelayHandleKey.js
var require_getRelayHandleKey = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/util/getRelayHandleKey.js"(exports, module) {
    "use strict";
    var _require = require_RelayDefaultHandleKey();
    var DEFAULT_HANDLE_KEY = _require.DEFAULT_HANDLE_KEY;
    var invariant3 = require_browser();
    function getRelayHandleKey(handleName, key, fieldName) {
      if (key && key !== DEFAULT_HANDLE_KEY) {
        return "__".concat(key, "_").concat(handleName);
      }
      !(fieldName != null) ? true ? invariant3(false, "getRelayHandleKey: Expected either `fieldName` or `key` in `handle` to be provided") : invariant3(false) : void 0;
      return "__".concat(fieldName, "_").concat(handleName);
    }
    module.exports = getRelayHandleKey;
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/util/RelayConcreteNode.js
var require_RelayConcreteNode = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/util/RelayConcreteNode.js"(exports, module) {
    "use strict";
    var RelayConcreteNode = {
      ACTOR_CHANGE: "ActorChange",
      CONDITION: "Condition",
      CLIENT_COMPONENT: "ClientComponent",
      CLIENT_EDGE_TO_SERVER_OBJECT: "ClientEdgeToServerObject",
      CLIENT_EDGE_TO_CLIENT_OBJECT: "ClientEdgeToClientObject",
      CLIENT_EXTENSION: "ClientExtension",
      DEFER: "Defer",
      CONNECTION: "Connection",
      FLIGHT_FIELD: "FlightField",
      FRAGMENT: "Fragment",
      FRAGMENT_SPREAD: "FragmentSpread",
      INLINE_DATA_FRAGMENT_SPREAD: "InlineDataFragmentSpread",
      INLINE_DATA_FRAGMENT: "InlineDataFragment",
      INLINE_FRAGMENT: "InlineFragment",
      LINKED_FIELD: "LinkedField",
      LINKED_HANDLE: "LinkedHandle",
      LITERAL: "Literal",
      LIST_VALUE: "ListValue",
      LOCAL_ARGUMENT: "LocalArgument",
      MODULE_IMPORT: "ModuleImport",
      ALIASED_FRAGMENT_SPREAD: "AliasedFragmentSpread",
      ALIASED_INLINE_FRAGMENT_SPREAD: "AliasedInlineFragmentSpread",
      RELAY_RESOLVER: "RelayResolver",
      RELAY_LIVE_RESOLVER: "RelayLiveResolver",
      REQUIRED_FIELD: "RequiredField",
      OBJECT_VALUE: "ObjectValue",
      OPERATION: "Operation",
      REQUEST: "Request",
      ROOT_ARGUMENT: "RootArgument",
      SCALAR_FIELD: "ScalarField",
      SCALAR_HANDLE: "ScalarHandle",
      SPLIT_OPERATION: "SplitOperation",
      STREAM: "Stream",
      TYPE_DISCRIMINATOR: "TypeDiscriminator",
      UPDATABLE_QUERY: "UpdatableQuery",
      VARIABLE: "Variable"
    };
    module.exports = RelayConcreteNode;
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/util/stableCopy.js
var require_stableCopy = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/util/stableCopy.js"(exports, module) {
    "use strict";
    function stableCopy(value) {
      if (!value || typeof value !== "object") {
        return value;
      }
      if (Array.isArray(value)) {
        return value.map(stableCopy);
      }
      var keys4 = Object.keys(value).sort();
      var stable = {};
      for (var i2 = 0; i2 < keys4.length; i2++) {
        stable[keys4[i2]] = stableCopy(value[keys4[i2]]);
      }
      return stable;
    }
    module.exports = stableCopy;
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/store/RelayStoreUtils.js
var require_RelayStoreUtils = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/store/RelayStoreUtils.js"(exports, module) {
    "use strict";
    var _interopRequireDefault = require_interopRequireDefault()["default"];
    var _toConsumableArray22 = _interopRequireDefault(require_toConsumableArray());
    var getRelayHandleKey = require_getRelayHandleKey();
    var RelayConcreteNode = require_RelayConcreteNode();
    var stableCopy = require_stableCopy();
    var invariant3 = require_browser();
    var VARIABLE = RelayConcreteNode.VARIABLE;
    var LITERAL = RelayConcreteNode.LITERAL;
    var OBJECT_VALUE = RelayConcreteNode.OBJECT_VALUE;
    var LIST_VALUE = RelayConcreteNode.LIST_VALUE;
    var MODULE_COMPONENT_KEY_PREFIX = "__module_component_";
    var MODULE_OPERATION_KEY_PREFIX = "__module_operation_";
    function getArgumentValue(arg, variables) {
      if (arg.kind === VARIABLE) {
        return getStableVariableValue(arg.variableName, variables);
      } else if (arg.kind === LITERAL) {
        return arg.value;
      } else if (arg.kind === OBJECT_VALUE) {
        var value = {};
        arg.fields.forEach(function(field) {
          value[field.name] = getArgumentValue(field, variables);
        });
        return value;
      } else if (arg.kind === LIST_VALUE) {
        var _value = [];
        arg.items.forEach(function(item) {
          item != null ? _value.push(getArgumentValue(item, variables)) : null;
        });
        return _value;
      }
    }
    function getArgumentValues(args, variables) {
      var values2 = {};
      args.forEach(function(arg) {
        values2[arg.name] = getArgumentValue(arg, variables);
      });
      return values2;
    }
    function getHandleStorageKey(handleField, variables) {
      var dynamicKey = handleField.dynamicKey, handle = handleField.handle, key = handleField.key, name2 = handleField.name, args = handleField.args, filters = handleField.filters;
      var handleName = getRelayHandleKey(handle, key, name2);
      var filterArgs = null;
      if (args && filters && args.length !== 0 && filters.length !== 0) {
        filterArgs = args.filter(function(arg) {
          return filters.indexOf(arg.name) > -1;
        });
      }
      if (dynamicKey) {
        filterArgs = filterArgs != null ? [dynamicKey].concat((0, _toConsumableArray22["default"])(filterArgs)) : [dynamicKey];
      }
      if (filterArgs === null) {
        return handleName;
      } else {
        return formatStorageKey(handleName, getArgumentValues(filterArgs, variables));
      }
    }
    function getStorageKey(field, variables) {
      if (field.storageKey) {
        return field.storageKey;
      }
      var args = getArguments(field);
      var name2 = field.name;
      return args && args.length !== 0 ? formatStorageKey(name2, getArgumentValues(args, variables)) : name2;
    }
    function getArguments(field) {
      if (field.kind === "RelayResolver" || field.kind === "RelayLiveResolver") {
        var _field$fragment2;
        if (field.args == null) {
          var _field$fragment;
          return (_field$fragment = field.fragment) === null || _field$fragment === void 0 ? void 0 : _field$fragment.args;
        }
        if (((_field$fragment2 = field.fragment) === null || _field$fragment2 === void 0 ? void 0 : _field$fragment2.args) == null) {
          return field.args;
        }
        return field.args.concat(field.fragment.args);
      }
      var args = typeof field.args === "undefined" ? void 0 : field.args;
      return args;
    }
    function getStableStorageKey(name2, args) {
      return formatStorageKey(name2, stableCopy(args));
    }
    function formatStorageKey(name2, argValues) {
      if (!argValues) {
        return name2;
      }
      var values2 = [];
      for (var argName in argValues) {
        if (argValues.hasOwnProperty(argName)) {
          var value = argValues[argName];
          if (value != null) {
            var _JSON$stringify;
            values2.push(argName + ":" + ((_JSON$stringify = JSON.stringify(value)) !== null && _JSON$stringify !== void 0 ? _JSON$stringify : "undefined"));
          }
        }
      }
      return values2.length === 0 ? name2 : name2 + "(".concat(values2.join(","), ")");
    }
    function getStableVariableValue(name2, variables) {
      !variables.hasOwnProperty(name2) ? true ? invariant3(false, "getVariableValue(): Undefined variable `%s`.", name2) : invariant3(false) : void 0;
      return stableCopy(variables[name2]);
    }
    function getModuleComponentKey(documentName) {
      return "".concat(MODULE_COMPONENT_KEY_PREFIX).concat(documentName);
    }
    function getModuleOperationKey(documentName) {
      return "".concat(MODULE_OPERATION_KEY_PREFIX).concat(documentName);
    }
    var RelayStoreUtils = {
      ACTOR_IDENTIFIER_KEY: "__actorIdentifier",
      CLIENT_EDGE_TRAVERSAL_PATH: "__clientEdgeTraversalPath",
      FRAGMENTS_KEY: "__fragments",
      FRAGMENT_OWNER_KEY: "__fragmentOwner",
      FRAGMENT_PROP_NAME_KEY: "__fragmentPropName",
      MODULE_COMPONENT_KEY: "__module_component",
      // alias returned by Reader
      ID_KEY: "__id",
      REF_KEY: "__ref",
      REFS_KEY: "__refs",
      ROOT_ID: "client:root",
      ROOT_TYPE: "__Root",
      TYPENAME_KEY: "__typename",
      INVALIDATED_AT_KEY: "__invalidated_at",
      IS_WITHIN_UNMATCHED_TYPE_REFINEMENT: "__isWithinUnmatchedTypeRefinement",
      RELAY_RESOLVER_VALUE_KEY: "__resolverValue",
      RELAY_RESOLVER_INVALIDATION_KEY: "__resolverValueMayBeInvalid",
      RELAY_RESOLVER_SNAPSHOT_KEY: "__resolverSnapshot",
      RELAY_RESOLVER_ERROR_KEY: "__resolverError",
      RELAY_RESOLVER_OUTPUT_TYPE_RECORD_IDS: "__resolverOutputTypeRecordIDs",
      formatStorageKey,
      getArgumentValue,
      getArgumentValues,
      getHandleStorageKey,
      getStorageKey,
      getStableStorageKey,
      getModuleComponentKey,
      getModuleOperationKey
    };
    module.exports = RelayStoreUtils;
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/handlers/connection/ConnectionInterface.js
var require_ConnectionInterface = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/handlers/connection/ConnectionInterface.js"(exports, module) {
    "use strict";
    var CONNECTION_CALLS = {
      after: true,
      before: true,
      find: true,
      first: true,
      last: true,
      surrounds: true
    };
    var config2 = {
      CURSOR: "cursor",
      EDGES: "edges",
      END_CURSOR: "endCursor",
      HAS_NEXT_PAGE: "hasNextPage",
      HAS_PREV_PAGE: "hasPreviousPage",
      NODE: "node",
      PAGE_INFO_TYPE: "PageInfo",
      PAGE_INFO: "pageInfo",
      START_CURSOR: "startCursor"
    };
    var ConnectionInterface = {
      inject: function inject(newConfig) {
        config2 = newConfig;
      },
      get: function get3() {
        return config2;
      },
      /**
       * Checks whether a call exists strictly to encode which parts of a connection
       * to fetch. Fields that only differ by connection call values should have the
       * same identity.
       */
      isConnectionCall: function isConnectionCall(call) {
        return CONNECTION_CALLS.hasOwnProperty(call.name);
      }
    };
    module.exports = ConnectionInterface;
  }
});

// node_modules/fbjs/lib/emptyFunction.js
var require_emptyFunction = __commonJS({
  "node_modules/fbjs/lib/emptyFunction.js"(exports, module) {
    "use strict";
    function makeEmptyFunction(arg) {
      return function() {
        return arg;
      };
    }
    var emptyFunction = function emptyFunction2() {
    };
    emptyFunction.thatReturns = makeEmptyFunction;
    emptyFunction.thatReturnsFalse = makeEmptyFunction(false);
    emptyFunction.thatReturnsTrue = makeEmptyFunction(true);
    emptyFunction.thatReturnsNull = makeEmptyFunction(null);
    emptyFunction.thatReturnsThis = function() {
      return this;
    };
    emptyFunction.thatReturnsArgument = function(arg) {
      return arg;
    };
    module.exports = emptyFunction;
  }
});

// node_modules/fbjs/lib/warning.js
var require_warning = __commonJS({
  "node_modules/fbjs/lib/warning.js"(exports, module) {
    "use strict";
    var emptyFunction = require_emptyFunction();
    function printWarning(format3) {
      for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
        args[_key - 1] = arguments[_key];
      }
      var argIndex = 0;
      var message = "Warning: " + format3.replace(/%s/g, function() {
        return args[argIndex++];
      });
      if (typeof console !== "undefined") {
        console.error(message);
      }
      try {
        throw new Error(message);
      } catch (x2) {
      }
    }
    var warning2 = true ? function(condition, format3) {
      if (format3 === void 0) {
        throw new Error("`warning(condition, format, ...args)` requires a warning message argument");
      }
      if (!condition) {
        for (var _len2 = arguments.length, args = new Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
          args[_key2 - 2] = arguments[_key2];
        }
        printWarning.apply(void 0, [format3].concat(args));
      }
    } : emptyFunction;
    module.exports = warning2;
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/handlers/connection/ConnectionHandler.js
var require_ConnectionHandler = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/handlers/connection/ConnectionHandler.js"(exports, module) {
    "use strict";
    var _require = require_ClientID();
    var generateClientID = _require.generateClientID;
    var _require2 = require_RelayStoreUtils();
    var getStableStorageKey = _require2.getStableStorageKey;
    var getRelayHandleKey = require_getRelayHandleKey();
    var ConnectionInterface = require_ConnectionInterface();
    var invariant3 = require_browser();
    var warning2 = require_warning();
    var CONNECTION = "connection";
    var NEXT_EDGE_INDEX = "__connection_next_edge_index";
    function update(store, payload) {
      var record = store.get(payload.dataID);
      if (!record) {
        return;
      }
      var _ConnectionInterface$ = ConnectionInterface.get(), EDGES = _ConnectionInterface$.EDGES, END_CURSOR = _ConnectionInterface$.END_CURSOR, HAS_NEXT_PAGE = _ConnectionInterface$.HAS_NEXT_PAGE, HAS_PREV_PAGE = _ConnectionInterface$.HAS_PREV_PAGE, PAGE_INFO = _ConnectionInterface$.PAGE_INFO, PAGE_INFO_TYPE = _ConnectionInterface$.PAGE_INFO_TYPE, START_CURSOR = _ConnectionInterface$.START_CURSOR;
      var serverConnection = record.getLinkedRecord(payload.fieldKey);
      var serverPageInfo = serverConnection && serverConnection.getLinkedRecord(PAGE_INFO);
      if (!serverConnection) {
        record.setValue(null, payload.handleKey);
        return;
      }
      var clientConnectionID = generateClientID(record.getDataID(), payload.handleKey);
      var clientConnectionField = record.getLinkedRecord(payload.handleKey);
      var clientConnection = clientConnectionField !== null && clientConnectionField !== void 0 ? clientConnectionField : store.get(clientConnectionID);
      var clientPageInfo = clientConnection && clientConnection.getLinkedRecord(PAGE_INFO);
      if (!clientConnection) {
        var connection = store.create(clientConnectionID, serverConnection.getType());
        connection.setValue(0, NEXT_EDGE_INDEX);
        connection.copyFieldsFrom(serverConnection);
        var serverEdges = serverConnection.getLinkedRecords(EDGES);
        if (serverEdges) {
          serverEdges = serverEdges.map(function(edge) {
            return buildConnectionEdge(store, connection, edge);
          });
          connection.setLinkedRecords(serverEdges, EDGES);
        }
        record.setLinkedRecord(connection, payload.handleKey);
        clientPageInfo = store.create(generateClientID(connection.getDataID(), PAGE_INFO), PAGE_INFO_TYPE);
        clientPageInfo.setValue(false, HAS_NEXT_PAGE);
        clientPageInfo.setValue(false, HAS_PREV_PAGE);
        clientPageInfo.setValue(null, END_CURSOR);
        clientPageInfo.setValue(null, START_CURSOR);
        if (serverPageInfo) {
          clientPageInfo.copyFieldsFrom(serverPageInfo);
        }
        connection.setLinkedRecord(clientPageInfo, PAGE_INFO);
      } else {
        if (clientConnectionField == null) {
          record.setLinkedRecord(clientConnection, payload.handleKey);
        }
        var _connection = clientConnection;
        var _serverEdges = serverConnection.getLinkedRecords(EDGES);
        if (_serverEdges) {
          _serverEdges = _serverEdges.map(function(edge) {
            return buildConnectionEdge(store, _connection, edge);
          });
        }
        var prevEdges = _connection.getLinkedRecords(EDGES);
        var prevPageInfo = _connection.getLinkedRecord(PAGE_INFO);
        _connection.copyFieldsFrom(serverConnection);
        if (prevEdges) {
          _connection.setLinkedRecords(prevEdges, EDGES);
        }
        if (prevPageInfo) {
          _connection.setLinkedRecord(prevPageInfo, PAGE_INFO);
        }
        var nextEdges = [];
        var args = payload.args;
        if (prevEdges && _serverEdges) {
          if (args.after != null) {
            if (clientPageInfo && args.after === clientPageInfo.getValue(END_CURSOR)) {
              var nodeIDs = /* @__PURE__ */ new Set();
              mergeEdges(prevEdges, nextEdges, nodeIDs);
              mergeEdges(_serverEdges, nextEdges, nodeIDs);
            } else {
              true ? warning2(false, "Relay: Unexpected after cursor `%s`, edges must be fetched from the end of the list (`%s`).", args.after, clientPageInfo && clientPageInfo.getValue(END_CURSOR)) : void 0;
              return;
            }
          } else if (args.before != null) {
            if (clientPageInfo && args.before === clientPageInfo.getValue(START_CURSOR)) {
              var _nodeIDs = /* @__PURE__ */ new Set();
              mergeEdges(_serverEdges, nextEdges, _nodeIDs);
              mergeEdges(prevEdges, nextEdges, _nodeIDs);
            } else {
              true ? warning2(false, "Relay: Unexpected before cursor `%s`, edges must be fetched from the beginning of the list (`%s`).", args.before, clientPageInfo && clientPageInfo.getValue(START_CURSOR)) : void 0;
              return;
            }
          } else {
            nextEdges = _serverEdges;
          }
        } else if (_serverEdges) {
          nextEdges = _serverEdges;
        } else {
          nextEdges = prevEdges;
        }
        if (nextEdges != null && nextEdges !== prevEdges) {
          _connection.setLinkedRecords(nextEdges, EDGES);
        }
        if (clientPageInfo && serverPageInfo) {
          if (args.after == null && args.before == null) {
            clientPageInfo.copyFieldsFrom(serverPageInfo);
          } else if (args.before != null || args.after == null && args.last) {
            clientPageInfo.setValue(!!serverPageInfo.getValue(HAS_PREV_PAGE), HAS_PREV_PAGE);
            var startCursor = serverPageInfo.getValue(START_CURSOR);
            if (typeof startCursor === "string") {
              clientPageInfo.setValue(startCursor, START_CURSOR);
            }
          } else if (args.after != null || args.before == null && args.first) {
            clientPageInfo.setValue(!!serverPageInfo.getValue(HAS_NEXT_PAGE), HAS_NEXT_PAGE);
            var endCursor = serverPageInfo.getValue(END_CURSOR);
            if (typeof endCursor === "string") {
              clientPageInfo.setValue(endCursor, END_CURSOR);
            }
          }
        }
      }
    }
    function getConnection(record, key, filters) {
      var handleKey = getRelayHandleKey(CONNECTION, key, null);
      return record.getLinkedRecord(handleKey, filters);
    }
    function getConnectionID(recordID, key, filters) {
      var handleKey = getRelayHandleKey(CONNECTION, key, null);
      var storageKey = getStableStorageKey(handleKey, filters);
      return generateClientID(recordID, storageKey);
    }
    function insertEdgeAfter(record, newEdge, cursor3) {
      var _ConnectionInterface$2 = ConnectionInterface.get(), CURSOR = _ConnectionInterface$2.CURSOR, EDGES = _ConnectionInterface$2.EDGES;
      var edges = record.getLinkedRecords(EDGES);
      if (!edges) {
        record.setLinkedRecords([newEdge], EDGES);
        return;
      }
      var nextEdges;
      if (cursor3 == null) {
        nextEdges = edges.concat(newEdge);
      } else {
        nextEdges = [];
        var foundCursor = false;
        for (var ii = 0; ii < edges.length; ii++) {
          var edge = edges[ii];
          nextEdges.push(edge);
          if (edge == null) {
            continue;
          }
          var edgeCursor = edge.getValue(CURSOR);
          if (cursor3 === edgeCursor) {
            nextEdges.push(newEdge);
            foundCursor = true;
          }
        }
        if (!foundCursor) {
          nextEdges.push(newEdge);
        }
      }
      record.setLinkedRecords(nextEdges, EDGES);
    }
    function createEdge(store, record, node56, edgeType) {
      var _ConnectionInterface$3 = ConnectionInterface.get(), NODE = _ConnectionInterface$3.NODE;
      var edgeID = generateClientID(record.getDataID(), node56.getDataID());
      var edge = store.get(edgeID);
      if (!edge) {
        edge = store.create(edgeID, edgeType);
      }
      edge.setLinkedRecord(node56, NODE);
      if (edge.getValue("cursor") == null) {
        edge.setValue(null, "cursor");
      }
      return edge;
    }
    function insertEdgeBefore(record, newEdge, cursor3) {
      var _ConnectionInterface$4 = ConnectionInterface.get(), CURSOR = _ConnectionInterface$4.CURSOR, EDGES = _ConnectionInterface$4.EDGES;
      var edges = record.getLinkedRecords(EDGES);
      if (!edges) {
        record.setLinkedRecords([newEdge], EDGES);
        return;
      }
      var nextEdges;
      if (cursor3 == null) {
        nextEdges = [newEdge].concat(edges);
      } else {
        nextEdges = [];
        var foundCursor = false;
        for (var ii = 0; ii < edges.length; ii++) {
          var edge = edges[ii];
          if (edge != null) {
            var edgeCursor = edge.getValue(CURSOR);
            if (cursor3 === edgeCursor) {
              nextEdges.push(newEdge);
              foundCursor = true;
            }
          }
          nextEdges.push(edge);
        }
        if (!foundCursor) {
          nextEdges.unshift(newEdge);
        }
      }
      record.setLinkedRecords(nextEdges, EDGES);
    }
    function deleteNode(record, nodeID) {
      var _ConnectionInterface$5 = ConnectionInterface.get(), EDGES = _ConnectionInterface$5.EDGES, NODE = _ConnectionInterface$5.NODE;
      var edges = record.getLinkedRecords(EDGES);
      if (!edges) {
        return;
      }
      var nextEdges;
      for (var ii = 0; ii < edges.length; ii++) {
        var edge = edges[ii];
        var node56 = edge && edge.getLinkedRecord(NODE);
        if (node56 != null && node56.getDataID() === nodeID) {
          if (nextEdges === void 0) {
            nextEdges = edges.slice(0, ii);
          }
        } else if (nextEdges !== void 0) {
          nextEdges.push(edge);
        }
      }
      if (nextEdges !== void 0) {
        record.setLinkedRecords(nextEdges, EDGES);
      }
    }
    function buildConnectionEdge(store, connection, edge) {
      if (edge == null) {
        return edge;
      }
      var _ConnectionInterface$6 = ConnectionInterface.get(), EDGES = _ConnectionInterface$6.EDGES;
      var edgeIndex = connection.getValue(NEXT_EDGE_INDEX);
      !(typeof edgeIndex === "number") ? true ? invariant3(false, "ConnectionHandler: Expected %s to be a number, got `%s`.", NEXT_EDGE_INDEX, edgeIndex) : invariant3(false) : void 0;
      var edgeID = generateClientID(connection.getDataID(), EDGES, edgeIndex);
      var connectionEdge = store.create(edgeID, edge.getType());
      connectionEdge.copyFieldsFrom(edge);
      if (connectionEdge.getValue("cursor") == null) {
        connectionEdge.setValue(null, "cursor");
      }
      connection.setValue(edgeIndex + 1, NEXT_EDGE_INDEX);
      return connectionEdge;
    }
    function mergeEdges(sourceEdges, targetEdges, nodeIDs) {
      var _ConnectionInterface$7 = ConnectionInterface.get(), NODE = _ConnectionInterface$7.NODE;
      for (var ii = 0; ii < sourceEdges.length; ii++) {
        var edge = sourceEdges[ii];
        if (!edge) {
          continue;
        }
        var node56 = edge.getLinkedRecord(NODE);
        var nodeID = node56 && node56.getDataID();
        if (nodeID) {
          if (nodeIDs.has(nodeID)) {
            continue;
          }
          nodeIDs.add(nodeID);
        }
        targetEdges.push(edge);
      }
    }
    module.exports = {
      buildConnectionEdge,
      createEdge,
      deleteNode,
      getConnection,
      getConnectionID,
      insertEdgeAfter,
      insertEdgeBefore,
      update
    };
  }
});

// node_modules/@babel/runtime/helpers/createForOfIteratorHelper.js
var require_createForOfIteratorHelper = __commonJS({
  "node_modules/@babel/runtime/helpers/createForOfIteratorHelper.js"(exports, module) {
    var unsupportedIterableToArray = require_unsupportedIterableToArray();
    function _createForOfIteratorHelper(o, allowArrayLike) {
      var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
      if (!it) {
        if (Array.isArray(o) || (it = unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
          if (it)
            o = it;
          var i2 = 0;
          var F = function F2() {
          };
          return {
            s: F,
            n: function n2() {
              if (i2 >= o.length)
                return {
                  done: true
                };
              return {
                done: false,
                value: o[i2++]
              };
            },
            e: function e3(_e) {
              throw _e;
            },
            f: F
          };
        }
        throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
      }
      var normalCompletion = true, didErr = false, err;
      return {
        s: function s2() {
          it = it.call(o);
        },
        n: function n2() {
          var step = it.next();
          normalCompletion = step.done;
          return step;
        },
        e: function e3(_e2) {
          didErr = true;
          err = _e2;
        },
        f: function f() {
          try {
            if (!normalCompletion && it["return"] != null)
              it["return"]();
          } finally {
            if (didErr)
              throw err;
          }
        }
      };
    }
    module.exports = _createForOfIteratorHelper, module.exports.__esModule = true, module.exports["default"] = module.exports;
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/handlers/connection/MutationHandlers.js
var require_MutationHandlers = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/handlers/connection/MutationHandlers.js"(exports, module) {
    "use strict";
    var _interopRequireDefault = require_interopRequireDefault()["default"];
    var _createForOfIteratorHelper2 = _interopRequireDefault(require_createForOfIteratorHelper());
    var ConnectionHandler = require_ConnectionHandler();
    var ConnectionInterface = require_ConnectionInterface();
    var invariant3 = require_browser();
    var warning2 = require_warning();
    var DeleteRecordHandler = {
      update: function update(store, payload) {
        var record = store.get(payload.dataID);
        if (record != null) {
          var idOrIds = record.getValue(payload.fieldKey);
          if (typeof idOrIds === "string") {
            store["delete"](idOrIds);
          } else if (Array.isArray(idOrIds)) {
            idOrIds.forEach(function(id2) {
              if (typeof id2 === "string") {
                store["delete"](id2);
              }
            });
          }
        }
      }
    };
    var DeleteEdgeHandler = {
      update: function update(store, payload) {
        var record = store.get(payload.dataID);
        if (record == null) {
          return;
        }
        var connections = payload.handleArgs.connections;
        !(connections != null) ? true ? invariant3(false, "MutationHandlers: Expected connection IDs to be specified.") : invariant3(false) : void 0;
        var idOrIds = record.getValue(payload.fieldKey);
        var idList = Array.isArray(idOrIds) ? idOrIds : [idOrIds];
        idList.forEach(function(id2) {
          if (typeof id2 === "string") {
            var _iterator = (0, _createForOfIteratorHelper2["default"])(connections), _step;
            try {
              for (_iterator.s(); !(_step = _iterator.n()).done; ) {
                var connectionID = _step.value;
                var connection = store.get(connectionID);
                if (connection == null) {
                  true ? warning2(false, "[Relay][Mutation] The connection with id '".concat(connectionID, "' doesn't exist.")) : void 0;
                  continue;
                }
                ConnectionHandler.deleteNode(connection, id2);
              }
            } catch (err) {
              _iterator.e(err);
            } finally {
              _iterator.f();
            }
          }
        });
      }
    };
    var AppendEdgeHandler = {
      update: edgeUpdater(ConnectionHandler.insertEdgeAfter)
    };
    var PrependEdgeHandler = {
      update: edgeUpdater(ConnectionHandler.insertEdgeBefore)
    };
    var AppendNodeHandler = {
      update: nodeUpdater(ConnectionHandler.insertEdgeAfter)
    };
    var PrependNodeHandler = {
      update: nodeUpdater(ConnectionHandler.insertEdgeBefore)
    };
    function edgeUpdater(insertFn) {
      return function(store, payload) {
        var _serverEdges;
        var record = store.get(payload.dataID);
        if (record == null) {
          return;
        }
        var connections = payload.handleArgs.connections;
        !(connections != null) ? true ? invariant3(false, "MutationHandlers: Expected connection IDs to be specified.") : invariant3(false) : void 0;
        var singleServerEdge, serverEdges;
        try {
          singleServerEdge = record.getLinkedRecord(payload.fieldKey);
        } catch (_unused) {
        }
        if (!singleServerEdge) {
          try {
            serverEdges = record.getLinkedRecords(payload.fieldKey);
          } catch (_unused2) {
          }
        }
        if (singleServerEdge == null && serverEdges == null) {
          true ? warning2(false, "MutationHandlers: Expected the server edge to be non-null.") : void 0;
          return;
        }
        var _ConnectionInterface$ = ConnectionInterface.get(), NODE = _ConnectionInterface$.NODE, EDGES = _ConnectionInterface$.EDGES;
        var serverEdgeList = (_serverEdges = serverEdges) !== null && _serverEdges !== void 0 ? _serverEdges : [singleServerEdge];
        var _iterator2 = (0, _createForOfIteratorHelper2["default"])(serverEdgeList), _step2;
        try {
          var _loop = function _loop2() {
            var serverEdge = _step2.value;
            if (serverEdge == null) {
              return "continue";
            }
            var serverNode = serverEdge.getLinkedRecord("node");
            if (!serverNode) {
              return "continue";
            }
            var serverNodeId = serverNode.getDataID();
            var _iterator3 = (0, _createForOfIteratorHelper2["default"])(connections), _step3;
            try {
              for (_iterator3.s(); !(_step3 = _iterator3.n()).done; ) {
                var connectionID = _step3.value;
                var connection = store.get(connectionID);
                if (connection == null) {
                  true ? warning2(false, "[Relay][Mutation] The connection with id '".concat(connectionID, "' doesn't exist.")) : void 0;
                  continue;
                }
                var nodeAlreadyExistsInConnection = (_connection$getLinked = connection.getLinkedRecords(EDGES)) === null || _connection$getLinked === void 0 ? void 0 : _connection$getLinked.some(function(edge) {
                  var _edge$getLinkedRecord;
                  return (edge === null || edge === void 0 ? void 0 : (_edge$getLinkedRecord = edge.getLinkedRecord(NODE)) === null || _edge$getLinkedRecord === void 0 ? void 0 : _edge$getLinkedRecord.getDataID()) === serverNodeId;
                });
                if (nodeAlreadyExistsInConnection) {
                  continue;
                }
                var clientEdge = ConnectionHandler.buildConnectionEdge(store, connection, serverEdge);
                !(clientEdge != null) ? true ? invariant3(false, "MutationHandlers: Failed to build the edge.") : invariant3(false) : void 0;
                insertFn(connection, clientEdge);
              }
            } catch (err) {
              _iterator3.e(err);
            } finally {
              _iterator3.f();
            }
          };
          for (_iterator2.s(); !(_step2 = _iterator2.n()).done; ) {
            var _connection$getLinked;
            var _ret = _loop();
            if (_ret === "continue")
              continue;
          }
        } catch (err) {
          _iterator2.e(err);
        } finally {
          _iterator2.f();
        }
      };
    }
    function nodeUpdater(insertFn) {
      return function(store, payload) {
        var _serverNodes;
        var record = store.get(payload.dataID);
        if (record == null) {
          return;
        }
        var _payload$handleArgs = payload.handleArgs, connections = _payload$handleArgs.connections, edgeTypeName = _payload$handleArgs.edgeTypeName;
        !(connections != null) ? true ? invariant3(false, "MutationHandlers: Expected connection IDs to be specified.") : invariant3(false) : void 0;
        !(edgeTypeName != null) ? true ? invariant3(false, "MutationHandlers: Expected edge typename to be specified.") : invariant3(false) : void 0;
        var singleServerNode;
        var serverNodes;
        try {
          singleServerNode = record.getLinkedRecord(payload.fieldKey);
        } catch (_unused3) {
        }
        if (!singleServerNode) {
          try {
            serverNodes = record.getLinkedRecords(payload.fieldKey);
          } catch (_unused4) {
          }
        }
        if (singleServerNode == null && serverNodes == null) {
          true ? warning2(false, "MutationHandlers: Expected target node to exist.") : void 0;
          return;
        }
        var _ConnectionInterface$2 = ConnectionInterface.get(), NODE = _ConnectionInterface$2.NODE, EDGES = _ConnectionInterface$2.EDGES;
        var serverNodeList = (_serverNodes = serverNodes) !== null && _serverNodes !== void 0 ? _serverNodes : [singleServerNode];
        var _iterator4 = (0, _createForOfIteratorHelper2["default"])(serverNodeList), _step4;
        try {
          var _loop2 = function _loop22() {
            var serverNode = _step4.value;
            if (serverNode == null) {
              return "continue";
            }
            var serverNodeId = serverNode.getDataID();
            var _iterator5 = (0, _createForOfIteratorHelper2["default"])(connections), _step5;
            try {
              for (_iterator5.s(); !(_step5 = _iterator5.n()).done; ) {
                var connectionID = _step5.value;
                var connection = store.get(connectionID);
                if (connection == null) {
                  true ? warning2(false, "[Relay][Mutation] The connection with id '".concat(connectionID, "' doesn't exist.")) : void 0;
                  continue;
                }
                var nodeAlreadyExistsInConnection = (_connection$getLinked2 = connection.getLinkedRecords(EDGES)) === null || _connection$getLinked2 === void 0 ? void 0 : _connection$getLinked2.some(function(edge) {
                  var _edge$getLinkedRecord2;
                  return (edge === null || edge === void 0 ? void 0 : (_edge$getLinkedRecord2 = edge.getLinkedRecord(NODE)) === null || _edge$getLinkedRecord2 === void 0 ? void 0 : _edge$getLinkedRecord2.getDataID()) === serverNodeId;
                });
                if (nodeAlreadyExistsInConnection) {
                  continue;
                }
                var clientEdge = ConnectionHandler.createEdge(store, connection, serverNode, edgeTypeName);
                !(clientEdge != null) ? true ? invariant3(false, "MutationHandlers: Failed to build the edge.") : invariant3(false) : void 0;
                insertFn(connection, clientEdge);
              }
            } catch (err) {
              _iterator5.e(err);
            } finally {
              _iterator5.f();
            }
          };
          for (_iterator4.s(); !(_step4 = _iterator4.n()).done; ) {
            var _connection$getLinked2;
            var _ret2 = _loop2();
            if (_ret2 === "continue")
              continue;
          }
        } catch (err) {
          _iterator4.e(err);
        } finally {
          _iterator4.f();
        }
      };
    }
    module.exports = {
      AppendEdgeHandler,
      DeleteRecordHandler,
      PrependEdgeHandler,
      AppendNodeHandler,
      PrependNodeHandler,
      DeleteEdgeHandler
    };
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/handlers/RelayDefaultHandlerProvider.js
var require_RelayDefaultHandlerProvider = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/handlers/RelayDefaultHandlerProvider.js"(exports, module) {
    "use strict";
    var ConnectionHandler = require_ConnectionHandler();
    var MutationHandlers = require_MutationHandlers();
    var invariant3 = require_browser();
    function RelayDefaultHandlerProvider(handle) {
      switch (handle) {
        case "connection":
          return ConnectionHandler;
        case "deleteRecord":
          return MutationHandlers.DeleteRecordHandler;
        case "deleteEdge":
          return MutationHandlers.DeleteEdgeHandler;
        case "appendEdge":
          return MutationHandlers.AppendEdgeHandler;
        case "prependEdge":
          return MutationHandlers.PrependEdgeHandler;
        case "appendNode":
          return MutationHandlers.AppendNodeHandler;
        case "prependNode":
          return MutationHandlers.PrependNodeHandler;
      }
      true ? true ? invariant3(false, "RelayDefaultHandlerProvider: No handler provided for `%s`.", handle) : invariant3(false) : void 0;
    }
    module.exports = RelayDefaultHandlerProvider;
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/query/GraphQLTag.js
var require_GraphQLTag = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/query/GraphQLTag.js"(exports, module) {
    "use strict";
    var RelayConcreteNode = require_RelayConcreteNode();
    var invariant3 = require_browser();
    var warning2 = require_warning();
    function graphql40(strings) {
      true ? true ? invariant3(false, "graphql: Unexpected invocation at runtime. Either the Babel transform was not set up, or it failed to identify this call site. Make sure it is being used verbatim as `graphql`. Note also that there cannot be a space between graphql and the backtick that follows.") : invariant3(false) : void 0;
    }
    function getNode(taggedNode) {
      var node56 = taggedNode;
      if (typeof node56 === "function") {
        node56 = node56();
        true ? warning2(false, "RelayGraphQLTag: node `%s` unexpectedly wrapped in a function.", node56.kind === "Fragment" ? node56.name : node56.operation.name) : void 0;
      } else if (node56["default"]) {
        node56 = node56["default"];
      }
      return node56;
    }
    function isFragment2(node56) {
      var fragment2 = getNode(node56);
      return typeof fragment2 === "object" && fragment2 !== null && fragment2.kind === RelayConcreteNode.FRAGMENT;
    }
    function isRequest(node56) {
      var request = getNode(node56);
      return typeof request === "object" && request !== null && request.kind === RelayConcreteNode.REQUEST;
    }
    function isUpdatableQuery(node56) {
      var updatableQuery = getNode(node56);
      return typeof updatableQuery === "object" && updatableQuery !== null && updatableQuery.kind === RelayConcreteNode.UPDATABLE_QUERY;
    }
    function isInlineDataFragment(node56) {
      var fragment2 = getNode(node56);
      return typeof fragment2 === "object" && fragment2 !== null && fragment2.kind === RelayConcreteNode.INLINE_DATA_FRAGMENT;
    }
    function getFragment(taggedNode) {
      var fragment2 = getNode(taggedNode);
      !isFragment2(fragment2) ? true ? invariant3(false, "GraphQLTag: Expected a fragment, got `%s`.", JSON.stringify(fragment2)) : invariant3(false) : void 0;
      return fragment2;
    }
    function getPaginationFragment(taggedNode) {
      var _fragment$metadata;
      var fragment2 = getFragment(taggedNode);
      var refetch = (_fragment$metadata = fragment2.metadata) === null || _fragment$metadata === void 0 ? void 0 : _fragment$metadata.refetch;
      var connection = refetch === null || refetch === void 0 ? void 0 : refetch.connection;
      if (refetch === null || typeof refetch !== "object" || connection === null || typeof connection !== "object") {
        return null;
      }
      return fragment2;
    }
    function getRefetchableFragment(taggedNode) {
      var _fragment$metadata2;
      var fragment2 = getFragment(taggedNode);
      var refetch = (_fragment$metadata2 = fragment2.metadata) === null || _fragment$metadata2 === void 0 ? void 0 : _fragment$metadata2.refetch;
      if (refetch === null || typeof refetch !== "object") {
        return null;
      }
      return fragment2;
    }
    function getRequest(taggedNode) {
      var request = getNode(taggedNode);
      !isRequest(request) ? true ? invariant3(false, "GraphQLTag: Expected a request, got `%s`.", JSON.stringify(request)) : invariant3(false) : void 0;
      return request;
    }
    function getUpdatableQuery(taggedNode) {
      var updatableQuery = getNode(taggedNode);
      !isUpdatableQuery(updatableQuery) ? true ? invariant3(false, "GraphQLTag: Expected a request, got `%s`.", JSON.stringify(updatableQuery)) : invariant3(false) : void 0;
      return updatableQuery;
    }
    function getInlineDataFragment(taggedNode) {
      var fragment2 = getNode(taggedNode);
      !isInlineDataFragment(fragment2) ? true ? invariant3(false, "GraphQLTag: Expected an inline data fragment, got `%s`.", JSON.stringify(fragment2)) : invariant3(false) : void 0;
      return fragment2;
    }
    module.exports = {
      getFragment,
      getNode,
      getPaginationFragment,
      getRefetchableFragment,
      getRequest,
      getUpdatableQuery,
      getInlineDataFragment,
      graphql: graphql40,
      isFragment: isFragment2,
      isRequest,
      isUpdatableQuery,
      isInlineDataFragment
    };
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/store/isRelayModernEnvironment.js
var require_isRelayModernEnvironment = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/store/isRelayModernEnvironment.js"(exports, module) {
    "use strict";
    function isRelayModernEnvironment(environment) {
      return Boolean(environment && environment["@@RelayModernEnvironment"]);
    }
    module.exports = isRelayModernEnvironment;
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/util/deepFreeze.js
var require_deepFreeze = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/util/deepFreeze.js"(exports, module) {
    "use strict";
    function deepFreeze(object) {
      Object.freeze(object);
      Object.getOwnPropertyNames(object).forEach(function(name2) {
        var property = object[name2];
        if (property && typeof property === "object" && !Object.isFrozen(property)) {
          deepFreeze(property);
        }
      });
      return object;
    }
    module.exports = deepFreeze;
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/util/getRequestIdentifier.js
var require_getRequestIdentifier = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/util/getRequestIdentifier.js"(exports, module) {
    "use strict";
    var stableCopy = require_stableCopy();
    var invariant3 = require_browser();
    function getRequestIdentifier(parameters, variables) {
      var requestID = parameters.cacheID != null ? parameters.cacheID : parameters.id;
      !(requestID != null) ? true ? invariant3(false, "getRequestIdentifier: Expected request `%s` to have either a valid `id` or `cacheID` property", parameters.name) : invariant3(false) : void 0;
      return requestID + JSON.stringify(stableCopy(variables));
    }
    module.exports = getRequestIdentifier;
  }
});

// node_modules/@babel/runtime/helpers/typeof.js
var require_typeof = __commonJS({
  "node_modules/@babel/runtime/helpers/typeof.js"(exports, module) {
    function _typeof47(o) {
      "@babel/helpers - typeof";
      return module.exports = _typeof47 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
        return typeof o2;
      } : function(o2) {
        return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
      }, module.exports.__esModule = true, module.exports["default"] = module.exports, _typeof47(o);
    }
    module.exports = _typeof47, module.exports.__esModule = true, module.exports["default"] = module.exports;
  }
});

// node_modules/@babel/runtime/helpers/toPrimitive.js
var require_toPrimitive = __commonJS({
  "node_modules/@babel/runtime/helpers/toPrimitive.js"(exports, module) {
    var _typeof47 = require_typeof()["default"];
    function _toPrimitive43(input, hint) {
      if (_typeof47(input) !== "object" || input === null)
        return input;
      var prim = input[Symbol.toPrimitive];
      if (prim !== void 0) {
        var res = prim.call(input, hint || "default");
        if (_typeof47(res) !== "object")
          return res;
        throw new TypeError("@@toPrimitive must return a primitive value.");
      }
      return (hint === "string" ? String : Number)(input);
    }
    module.exports = _toPrimitive43, module.exports.__esModule = true, module.exports["default"] = module.exports;
  }
});

// node_modules/@babel/runtime/helpers/toPropertyKey.js
var require_toPropertyKey = __commonJS({
  "node_modules/@babel/runtime/helpers/toPropertyKey.js"(exports, module) {
    var _typeof47 = require_typeof()["default"];
    var toPrimitive = require_toPrimitive();
    function _toPropertyKey43(arg) {
      var key = toPrimitive(arg, "string");
      return _typeof47(key) === "symbol" ? key : String(key);
    }
    module.exports = _toPropertyKey43, module.exports.__esModule = true, module.exports["default"] = module.exports;
  }
});

// node_modules/@babel/runtime/helpers/defineProperty.js
var require_defineProperty = __commonJS({
  "node_modules/@babel/runtime/helpers/defineProperty.js"(exports, module) {
    var toPropertyKey = require_toPropertyKey();
    function _defineProperty42(obj, key, value) {
      key = toPropertyKey(key);
      if (key in obj) {
        Object.defineProperty(obj, key, {
          value,
          enumerable: true,
          configurable: true,
          writable: true
        });
      } else {
        obj[key] = value;
      }
      return obj;
    }
    module.exports = _defineProperty42, module.exports.__esModule = true, module.exports["default"] = module.exports;
  }
});

// node_modules/@babel/runtime/helpers/objectSpread2.js
var require_objectSpread2 = __commonJS({
  "node_modules/@babel/runtime/helpers/objectSpread2.js"(exports, module) {
    var defineProperty = require_defineProperty();
    function ownKeys41(e3, r3) {
      var t3 = Object.keys(e3);
      if (Object.getOwnPropertySymbols) {
        var o = Object.getOwnPropertySymbols(e3);
        r3 && (o = o.filter(function(r4) {
          return Object.getOwnPropertyDescriptor(e3, r4).enumerable;
        })), t3.push.apply(t3, o);
      }
      return t3;
    }
    function _objectSpread210(e3) {
      for (var r3 = 1; r3 < arguments.length; r3++) {
        var t3 = null != arguments[r3] ? arguments[r3] : {};
        r3 % 2 ? ownKeys41(Object(t3), true).forEach(function(r4) {
          defineProperty(e3, r4, t3[r4]);
        }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e3, Object.getOwnPropertyDescriptors(t3)) : ownKeys41(Object(t3)).forEach(function(r4) {
          Object.defineProperty(e3, r4, Object.getOwnPropertyDescriptor(t3, r4));
        });
      }
      return e3;
    }
    module.exports = _objectSpread210, module.exports.__esModule = true, module.exports["default"] = module.exports;
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/store/RelayConcreteVariables.js
var require_RelayConcreteVariables = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/store/RelayConcreteVariables.js"(exports, module) {
    "use strict";
    var _interopRequireDefault = require_interopRequireDefault()["default"];
    var _objectSpread210 = _interopRequireDefault(require_objectSpread2());
    var _require = require_RelayStoreUtils();
    var getArgumentValues = _require.getArgumentValues;
    var invariant3 = require_browser();
    function getFragmentVariables(fragment2, rootVariables, argumentVariables) {
      if (fragment2.argumentDefinitions == null) {
        return argumentVariables;
      }
      var variables;
      fragment2.argumentDefinitions.forEach(function(definition) {
        if (argumentVariables.hasOwnProperty(definition.name)) {
          return;
        }
        variables = variables || (0, _objectSpread210["default"])({}, argumentVariables);
        switch (definition.kind) {
          case "LocalArgument":
            variables[definition.name] = definition.defaultValue;
            break;
          case "RootArgument":
            if (!rootVariables.hasOwnProperty(definition.name)) {
              variables[definition.name] = void 0;
              break;
            }
            variables[definition.name] = rootVariables[definition.name];
            break;
          default:
            definition;
            true ? true ? invariant3(false, "RelayConcreteVariables: Unexpected node kind `%s` in fragment `%s`.", definition.kind, fragment2.name) : invariant3(false) : void 0;
        }
      });
      return variables || argumentVariables;
    }
    function getOperationVariables(operation, providedVariables, variables) {
      var operationVariables = {};
      operation.argumentDefinitions.forEach(function(def) {
        var value = def.defaultValue;
        if (variables[def.name] != null) {
          value = variables[def.name];
        }
        operationVariables[def.name] = value;
      });
      if (providedVariables != null) {
        Object.keys(providedVariables).forEach(function(varName) {
          operationVariables[varName] = providedVariables[varName].get();
        });
      }
      return operationVariables;
    }
    function getLocalVariables(currentVariables, argumentDefinitions, args) {
      if (argumentDefinitions == null) {
        return currentVariables;
      }
      var nextVariables = (0, _objectSpread210["default"])({}, currentVariables);
      var nextArgs = args ? getArgumentValues(args, currentVariables) : {};
      argumentDefinitions.forEach(function(def) {
        var _nextArgs$def$name;
        var value = (_nextArgs$def$name = nextArgs[def.name]) !== null && _nextArgs$def$name !== void 0 ? _nextArgs$def$name : def.defaultValue;
        nextVariables[def.name] = value;
      });
      return nextVariables;
    }
    module.exports = {
      getLocalVariables,
      getFragmentVariables,
      getOperationVariables
    };
  }
});

// node_modules/fbjs/lib/areEqual.js
var require_areEqual = __commonJS({
  "node_modules/fbjs/lib/areEqual.js"(exports, module) {
    "use strict";
    var aStackPool = [];
    var bStackPool = [];
    function areEqual2(a2, b) {
      var aStack = aStackPool.length ? aStackPool.pop() : [];
      var bStack = bStackPool.length ? bStackPool.pop() : [];
      var result = eq(a2, b, aStack, bStack);
      aStack.length = 0;
      bStack.length = 0;
      aStackPool.push(aStack);
      bStackPool.push(bStack);
      return result;
    }
    function eq(a2, b, aStack, bStack) {
      if (a2 === b) {
        return a2 !== 0 || 1 / a2 == 1 / b;
      }
      if (a2 == null || b == null) {
        return false;
      }
      if (typeof a2 != "object" || typeof b != "object") {
        return false;
      }
      var objToStr = Object.prototype.toString;
      var className = objToStr.call(a2);
      if (className != objToStr.call(b)) {
        return false;
      }
      switch (className) {
        case "[object String]":
          return a2 == String(b);
        case "[object Number]":
          return isNaN(a2) || isNaN(b) ? false : a2 == Number(b);
        case "[object Date]":
        case "[object Boolean]":
          return +a2 == +b;
        case "[object RegExp]":
          return a2.source == b.source && a2.global == b.global && a2.multiline == b.multiline && a2.ignoreCase == b.ignoreCase;
      }
      var length2 = aStack.length;
      while (length2--) {
        if (aStack[length2] == a2) {
          return bStack[length2] == b;
        }
      }
      aStack.push(a2);
      bStack.push(b);
      var size = 0;
      if (className === "[object Array]") {
        size = a2.length;
        if (size !== b.length) {
          return false;
        }
        while (size--) {
          if (!eq(a2[size], b[size], aStack, bStack)) {
            return false;
          }
        }
      } else {
        if (a2.constructor !== b.constructor) {
          return false;
        }
        if (a2.hasOwnProperty("valueOf") && b.hasOwnProperty("valueOf")) {
          return a2.valueOf() == b.valueOf();
        }
        var keys4 = Object.keys(a2);
        if (keys4.length != Object.keys(b).length) {
          return false;
        }
        for (var i2 = 0; i2 < keys4.length; i2++) {
          if (!eq(a2[keys4[i2]], b[keys4[i2]], aStack, bStack)) {
            return false;
          }
        }
      }
      aStack.pop();
      bStack.pop();
      return true;
    }
    module.exports = areEqual2;
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/store/RelayModernSelector.js
var require_RelayModernSelector = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/store/RelayModernSelector.js"(exports, module) {
    "use strict";
    var _require = require_RelayConcreteVariables();
    var getFragmentVariables = _require.getFragmentVariables;
    var _require2 = require_RelayStoreUtils();
    var CLIENT_EDGE_TRAVERSAL_PATH = _require2.CLIENT_EDGE_TRAVERSAL_PATH;
    var FRAGMENT_OWNER_KEY = _require2.FRAGMENT_OWNER_KEY;
    var FRAGMENTS_KEY = _require2.FRAGMENTS_KEY;
    var ID_KEY = _require2.ID_KEY;
    var IS_WITHIN_UNMATCHED_TYPE_REFINEMENT = _require2.IS_WITHIN_UNMATCHED_TYPE_REFINEMENT;
    var areEqual2 = require_areEqual();
    var invariant3 = require_browser();
    var warning2 = require_warning();
    function getSingularSelector(fragment2, item) {
      !(typeof item === "object" && item !== null && !Array.isArray(item)) ? true ? invariant3(false, "RelayModernSelector: Expected value for fragment `%s` to be an object, got `%s`.", fragment2.name, JSON.stringify(item)) : invariant3(false) : void 0;
      var dataID = item[ID_KEY];
      var fragments = item[FRAGMENTS_KEY];
      var mixedOwner = item[FRAGMENT_OWNER_KEY];
      var isWithinUnmatchedTypeRefinement = item[IS_WITHIN_UNMATCHED_TYPE_REFINEMENT] === true;
      var mixedClientEdgeTraversalPath = item[CLIENT_EDGE_TRAVERSAL_PATH];
      if (typeof dataID === "string" && typeof fragments === "object" && fragments !== null && typeof fragments[fragment2.name] === "object" && fragments[fragment2.name] !== null && typeof mixedOwner === "object" && mixedOwner !== null && (mixedClientEdgeTraversalPath == null || Array.isArray(mixedClientEdgeTraversalPath))) {
        var owner = mixedOwner;
        var clientEdgeTraversalPath = mixedClientEdgeTraversalPath;
        var argumentVariables = fragments[fragment2.name];
        var fragmentVariables = getFragmentVariables(fragment2, owner.variables, argumentVariables);
        return createReaderSelector(fragment2, dataID, fragmentVariables, owner, isWithinUnmatchedTypeRefinement, clientEdgeTraversalPath);
      }
      if (true) {
        var stringifiedItem = JSON.stringify(item);
        if (stringifiedItem.length > 499) {
          stringifiedItem = stringifiedItem.substr(0, 498) + "\u2026";
        }
        true ? warning2(false, "RelayModernSelector: Expected object to contain data for fragment `%s`, got `%s`. Make sure that the parent operation/fragment included fragment `...%s` without `@relay(mask: false)`.", fragment2.name, stringifiedItem, fragment2.name) : void 0;
      }
      return null;
    }
    function getPluralSelector(fragment2, items) {
      var selectors = null;
      items.forEach(function(item, ii) {
        var selector = item != null ? getSingularSelector(fragment2, item) : null;
        if (selector != null) {
          selectors = selectors || [];
          selectors.push(selector);
        }
      });
      if (selectors == null) {
        return null;
      } else {
        return {
          kind: "PluralReaderSelector",
          selectors
        };
      }
    }
    function getSelector(fragment2, item) {
      if (item == null) {
        return item;
      } else if (fragment2.metadata && fragment2.metadata.plural === true) {
        !Array.isArray(item) ? true ? invariant3(false, "RelayModernSelector: Expected value for fragment `%s` to be an array, got `%s`. Remove `@relay(plural: true)` from fragment `%s` to allow the prop to be an object.", fragment2.name, JSON.stringify(item), fragment2.name) : invariant3(false) : void 0;
        return getPluralSelector(fragment2, item);
      } else {
        !!Array.isArray(item) ? true ? invariant3(false, "RelayModernSelector: Expected value for fragment `%s` to be an object, got `%s`. Add `@relay(plural: true)` to fragment `%s` to allow the prop to be an array of items.", fragment2.name, JSON.stringify(item), fragment2.name) : invariant3(false) : void 0;
        return getSingularSelector(fragment2, item);
      }
    }
    function getSelectorsFromObject(fragments, object) {
      var selectors = {};
      for (var key in fragments) {
        if (fragments.hasOwnProperty(key)) {
          var fragment2 = fragments[key];
          var item = object[key];
          selectors[key] = getSelector(fragment2, item);
        }
      }
      return selectors;
    }
    function getDataIDsFromObject(fragments, object) {
      var ids = {};
      for (var key in fragments) {
        if (fragments.hasOwnProperty(key)) {
          var fragment2 = fragments[key];
          var item = object[key];
          ids[key] = getDataIDsFromFragment(fragment2, item);
        }
      }
      return ids;
    }
    function getDataIDsFromFragment(fragment2, item) {
      if (item == null) {
        return item;
      } else if (fragment2.metadata && fragment2.metadata.plural === true) {
        !Array.isArray(item) ? true ? invariant3(false, "RelayModernSelector: Expected value for fragment `%s` to be an array, got `%s`. Remove `@relay(plural: true)` from fragment `%s` to allow the prop to be an object.", fragment2.name, JSON.stringify(item), fragment2.name) : invariant3(false) : void 0;
        return getDataIDs(fragment2, item);
      } else {
        !!Array.isArray(item) ? true ? invariant3(false, "RelayModernFragmentSpecResolver: Expected value for fragment `%s` to be an object, got `%s`. Add `@relay(plural: true)` to fragment `%s` to allow the prop to be an array of items.", fragment2.name, JSON.stringify(item), fragment2.name) : invariant3(false) : void 0;
        return getDataID(fragment2, item);
      }
    }
    function getDataIDs(fragment2, items) {
      var ids = null;
      items.forEach(function(item) {
        var id2 = item != null ? getDataID(fragment2, item) : null;
        if (id2 != null) {
          ids = ids || [];
          ids.push(id2);
        }
      });
      return ids;
    }
    function getDataID(fragment2, item) {
      !(typeof item === "object" && item !== null && !Array.isArray(item)) ? true ? invariant3(false, "RelayModernSelector: Expected value for fragment `%s` to be an object, got `%s`.", fragment2.name, JSON.stringify(item)) : invariant3(false) : void 0;
      var dataID = item[ID_KEY];
      if (typeof dataID === "string") {
        return dataID;
      }
      true ? warning2(false, "RelayModernSelector: Expected object to contain data for fragment `%s`, got `%s`. Make sure that the parent operation/fragment included fragment `...%s` without `@relay(mask: false)`, or `null` is passed as the fragment reference for `%s` if it's conditonally included and the condition isn't met.", fragment2.name, JSON.stringify(item), fragment2.name, fragment2.name) : void 0;
      return null;
    }
    function getVariablesFromObject(fragments, object) {
      var variables = {};
      for (var key in fragments) {
        if (fragments.hasOwnProperty(key)) {
          var fragment2 = fragments[key];
          var item = object[key];
          var itemVariables = getVariablesFromFragment(fragment2, item);
          Object.assign(variables, itemVariables);
        }
      }
      return variables;
    }
    function getVariablesFromFragment(fragment2, item) {
      var _fragment$metadata;
      if (item == null) {
        return {};
      } else if (((_fragment$metadata = fragment2.metadata) === null || _fragment$metadata === void 0 ? void 0 : _fragment$metadata.plural) === true) {
        !Array.isArray(item) ? true ? invariant3(false, "RelayModernSelector: Expected value for fragment `%s` to be an array, got `%s`. Remove `@relay(plural: true)` from fragment `%s` to allow the prop to be an object.", fragment2.name, JSON.stringify(item), fragment2.name) : invariant3(false) : void 0;
        return getVariablesFromPluralFragment(fragment2, item);
      } else {
        !!Array.isArray(item) ? true ? invariant3(false, "RelayModernFragmentSpecResolver: Expected value for fragment `%s` to be an object, got `%s`. Add `@relay(plural: true)` to fragment `%s` to allow the prop to be an array of items.", fragment2.name, JSON.stringify(item), fragment2.name) : invariant3(false) : void 0;
        return getVariablesFromSingularFragment(fragment2, item) || {};
      }
    }
    function getVariablesFromSingularFragment(fragment2, item) {
      var selector = getSingularSelector(fragment2, item);
      if (!selector) {
        return null;
      }
      return selector.variables;
    }
    function getVariablesFromPluralFragment(fragment2, items) {
      var variables = {};
      items.forEach(function(value, ii) {
        if (value != null) {
          var itemVariables = getVariablesFromSingularFragment(fragment2, value);
          if (itemVariables != null) {
            Object.assign(variables, itemVariables);
          }
        }
      });
      return variables;
    }
    function areEqualSingularSelectors(thisSelector, thatSelector) {
      return thisSelector.owner === thatSelector.owner && thisSelector.dataID === thatSelector.dataID && thisSelector.node === thatSelector.node && areEqual2(thisSelector.variables, thatSelector.variables);
    }
    function areEqualSelectors(a2, b) {
      if (a2 === b) {
        return true;
      } else if (a2 == null) {
        return b == null;
      } else if (b == null) {
        return a2 == null;
      } else if (a2.kind === "SingularReaderSelector" && b.kind === "SingularReaderSelector") {
        return areEqualSingularSelectors(a2, b);
      } else if (a2.kind === "PluralReaderSelector" && b.kind === "PluralReaderSelector") {
        return a2.selectors.length === b.selectors.length && a2.selectors.every(function(s2, i2) {
          return areEqualSingularSelectors(s2, b.selectors[i2]);
        });
      } else {
        return false;
      }
    }
    function createReaderSelector(fragment2, dataID, variables, request) {
      var isWithinUnmatchedTypeRefinement = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : false;
      var clientEdgeTraversalPath = arguments.length > 5 ? arguments[5] : void 0;
      return {
        kind: "SingularReaderSelector",
        dataID,
        isWithinUnmatchedTypeRefinement,
        clientEdgeTraversalPath: clientEdgeTraversalPath !== null && clientEdgeTraversalPath !== void 0 ? clientEdgeTraversalPath : null,
        node: fragment2,
        variables,
        owner: request
      };
    }
    function createNormalizationSelector(node56, dataID, variables) {
      return {
        dataID,
        node: node56,
        variables
      };
    }
    module.exports = {
      areEqualSelectors,
      createReaderSelector,
      createNormalizationSelector,
      getDataIDsFromFragment,
      getDataIDsFromObject,
      getSingularSelector,
      getPluralSelector,
      getSelector,
      getSelectorsFromObject,
      getVariablesFromSingularFragment,
      getVariablesFromPluralFragment,
      getVariablesFromFragment,
      getVariablesFromObject
    };
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/store/RelayModernOperationDescriptor.js
var require_RelayModernOperationDescriptor = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/store/RelayModernOperationDescriptor.js"(exports, module) {
    "use strict";
    var deepFreeze = require_deepFreeze();
    var getRequestIdentifier = require_getRequestIdentifier();
    var _require = require_RelayConcreteVariables();
    var getOperationVariables = _require.getOperationVariables;
    var _require2 = require_RelayModernSelector();
    var createNormalizationSelector = _require2.createNormalizationSelector;
    var createReaderSelector = _require2.createReaderSelector;
    var _require3 = require_RelayStoreUtils();
    var ROOT_ID = _require3.ROOT_ID;
    function createOperationDescriptor(request, variables, cacheConfig) {
      var dataID = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : ROOT_ID;
      var operation = request.operation;
      var operationVariables = getOperationVariables(operation, request.params.providedVariables, variables);
      var requestDescriptor = createRequestDescriptor(request, operationVariables, cacheConfig);
      var operationDescriptor = {
        fragment: createReaderSelector(request.fragment, dataID, operationVariables, requestDescriptor),
        request: requestDescriptor,
        root: createNormalizationSelector(operation, dataID, operationVariables)
      };
      if (true) {
        Object.freeze(operationDescriptor.fragment);
        Object.freeze(operationDescriptor.root);
        Object.freeze(operationDescriptor);
      }
      return operationDescriptor;
    }
    function createRequestDescriptor(request, variables, cacheConfig) {
      var requestDescriptor = {
        identifier: getRequestIdentifier(request.params, variables),
        node: request,
        variables,
        cacheConfig
      };
      if (true) {
        deepFreeze(variables);
        Object.freeze(request);
        Object.freeze(requestDescriptor);
      }
      return requestDescriptor;
    }
    module.exports = {
      createOperationDescriptor,
      createRequestDescriptor
    };
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/mutations/RelayDeclarativeMutationConfig.js
var require_RelayDeclarativeMutationConfig = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/mutations/RelayDeclarativeMutationConfig.js"(exports, module) {
    "use strict";
    var _interopRequireDefault = require_interopRequireDefault()["default"];
    var _createForOfIteratorHelper2 = _interopRequireDefault(require_createForOfIteratorHelper());
    var ConnectionHandler = require_ConnectionHandler();
    var warning2 = require_warning();
    var MutationTypes = Object.freeze({
      RANGE_ADD: "RANGE_ADD",
      RANGE_DELETE: "RANGE_DELETE",
      NODE_DELETE: "NODE_DELETE"
    });
    var RangeOperations = Object.freeze({
      APPEND: "append",
      PREPEND: "prepend"
    });
    function convert(configs, request, optimisticUpdater, updater) {
      var configOptimisticUpdates = optimisticUpdater ? [optimisticUpdater] : [];
      var configUpdates = updater ? [updater] : [];
      configs.forEach(function(config2) {
        switch (config2.type) {
          case "NODE_DELETE":
            var nodeDeleteResult = nodeDelete(config2, request);
            if (nodeDeleteResult) {
              configOptimisticUpdates.push(nodeDeleteResult);
              configUpdates.push(nodeDeleteResult);
            }
            break;
          case "RANGE_ADD":
            var rangeAddResult = rangeAdd(config2, request);
            if (rangeAddResult) {
              configOptimisticUpdates.push(rangeAddResult);
              configUpdates.push(rangeAddResult);
            }
            break;
          case "RANGE_DELETE":
            var rangeDeleteResult = rangeDelete(config2, request);
            if (rangeDeleteResult) {
              configOptimisticUpdates.push(rangeDeleteResult);
              configUpdates.push(rangeDeleteResult);
            }
            break;
        }
      });
      return {
        optimisticUpdater: function optimisticUpdater2(store, data) {
          configOptimisticUpdates.forEach(function(eachOptimisticUpdater) {
            eachOptimisticUpdater(store, data);
          });
        },
        updater: function updater2(store, data) {
          configUpdates.forEach(function(eachUpdater) {
            eachUpdater(store, data);
          });
        }
      };
    }
    function nodeDelete(config2, request) {
      var deletedIDFieldName = config2.deletedIDFieldName;
      var rootField = getRootField(request);
      if (!rootField) {
        return null;
      }
      return function(store, data) {
        var payload = store.getRootField(rootField);
        if (!payload) {
          return;
        }
        var deleteID = payload.getValue(deletedIDFieldName);
        var deleteIDs = Array.isArray(deleteID) ? deleteID : [deleteID];
        deleteIDs.forEach(function(id2) {
          if (id2 && typeof id2 === "string") {
            store["delete"](id2);
          }
        });
      };
    }
    function rangeAdd(config2, request) {
      var parentID = config2.parentID, connectionInfo = config2.connectionInfo, edgeName = config2.edgeName;
      if (!parentID) {
        true ? warning2(false, "RelayDeclarativeMutationConfig: For mutation config RANGE_ADD to work you must include a parentID") : void 0;
        return null;
      }
      var rootField = getRootField(request);
      if (!connectionInfo || !rootField) {
        return null;
      }
      return function(store, data) {
        var parent = store.get(parentID);
        if (!parent) {
          return;
        }
        var payload = store.getRootField(rootField);
        if (!payload) {
          return;
        }
        var serverEdge = payload.getLinkedRecord(edgeName);
        var _iterator = (0, _createForOfIteratorHelper2["default"])(connectionInfo), _step;
        try {
          for (_iterator.s(); !(_step = _iterator.n()).done; ) {
            var info = _step.value;
            if (!serverEdge) {
              continue;
            }
            var connection = ConnectionHandler.getConnection(parent, info.key, info.filters);
            if (!connection) {
              continue;
            }
            var clientEdge = ConnectionHandler.buildConnectionEdge(store, connection, serverEdge);
            if (!clientEdge) {
              continue;
            }
            switch (info.rangeBehavior) {
              case "append":
                ConnectionHandler.insertEdgeAfter(connection, clientEdge);
                break;
              case "prepend":
                ConnectionHandler.insertEdgeBefore(connection, clientEdge);
                break;
              default:
                true ? warning2(false, "RelayDeclarativeMutationConfig: RANGE_ADD range behavior `%s` will not work as expected in RelayModern, supported range behaviors are 'append', 'prepend'.", info.rangeBehavior) : void 0;
                break;
            }
          }
        } catch (err) {
          _iterator.e(err);
        } finally {
          _iterator.f();
        }
      };
    }
    function rangeDelete(config2, request) {
      var parentID = config2.parentID, connectionKeys = config2.connectionKeys, pathToConnection = config2.pathToConnection, deletedIDFieldName = config2.deletedIDFieldName;
      if (!parentID) {
        true ? warning2(false, "RelayDeclarativeMutationConfig: For mutation config RANGE_DELETE to work you must include a parentID") : void 0;
        return null;
      }
      var rootField = getRootField(request);
      if (!rootField) {
        return null;
      }
      return function(store, data) {
        if (!data) {
          return;
        }
        var deleteIDs = [];
        var deletedIDField = data[rootField];
        if (deletedIDField && Array.isArray(deletedIDFieldName)) {
          var _iterator2 = (0, _createForOfIteratorHelper2["default"])(deletedIDFieldName), _step2;
          try {
            for (_iterator2.s(); !(_step2 = _iterator2.n()).done; ) {
              var eachField = _step2.value;
              if (deletedIDField && typeof deletedIDField === "object") {
                deletedIDField = deletedIDField[eachField];
              }
            }
          } catch (err) {
            _iterator2.e(err);
          } finally {
            _iterator2.f();
          }
          if (Array.isArray(deletedIDField)) {
            deletedIDField.forEach(function(idObject) {
              if (idObject && idObject.id && typeof idObject === "object" && typeof idObject.id === "string") {
                deleteIDs.push(idObject.id);
              }
            });
          } else if (deletedIDField && deletedIDField.id && typeof deletedIDField.id === "string") {
            deleteIDs.push(deletedIDField.id);
          }
        } else if (deletedIDField && typeof deletedIDFieldName === "string" && typeof deletedIDField === "object") {
          deletedIDField = deletedIDField[deletedIDFieldName];
          if (typeof deletedIDField === "string") {
            deleteIDs.push(deletedIDField);
          } else if (Array.isArray(deletedIDField)) {
            deletedIDField.forEach(function(id2) {
              if (typeof id2 === "string") {
                deleteIDs.push(id2);
              }
            });
          }
        }
        deleteNode(parentID, connectionKeys, pathToConnection, store, deleteIDs);
      };
    }
    function deleteNode(parentID, connectionKeys, pathToConnection, store, deleteIDs) {
      true ? warning2(connectionKeys != null, "RelayDeclarativeMutationConfig: RANGE_DELETE must provide a connectionKeys") : void 0;
      var parent = store.get(parentID);
      if (!parent) {
        return;
      }
      if (pathToConnection.length < 2) {
        true ? warning2(false, "RelayDeclarativeMutationConfig: RANGE_DELETE pathToConnection must include at least parent and connection") : void 0;
        return;
      }
      var recordProxy = parent;
      for (var i2 = 1; i2 < pathToConnection.length - 1; i2++) {
        if (recordProxy) {
          recordProxy = recordProxy.getLinkedRecord(pathToConnection[i2]);
        }
      }
      if (!connectionKeys || !recordProxy) {
        true ? warning2(false, "RelayDeclarativeMutationConfig: RANGE_DELETE pathToConnection is incorrect. Unable to find connection with parentID: %s and path: %s", parentID, pathToConnection.toString()) : void 0;
        return;
      }
      var _iterator3 = (0, _createForOfIteratorHelper2["default"])(connectionKeys), _step3;
      try {
        var _loop = function _loop2() {
          var key = _step3.value;
          var connection = ConnectionHandler.getConnection(recordProxy, key.key, key.filters);
          if (connection) {
            deleteIDs.forEach(function(deleteID) {
              ConnectionHandler.deleteNode(connection, deleteID);
            });
          }
        };
        for (_iterator3.s(); !(_step3 = _iterator3.n()).done; ) {
          _loop();
        }
      } catch (err) {
        _iterator3.e(err);
      } finally {
        _iterator3.f();
      }
    }
    function getRootField(request) {
      if (request.fragment.selections && request.fragment.selections.length > 0 && request.fragment.selections[0].kind === "LinkedField") {
        return request.fragment.selections[0].name;
      }
      return null;
    }
    module.exports = {
      MutationTypes,
      RangeOperations,
      convert
    };
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/mutations/applyOptimisticMutation.js
var require_applyOptimisticMutation = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/mutations/applyOptimisticMutation.js"(exports, module) {
    "use strict";
    var _require = require_GraphQLTag();
    var getRequest = _require.getRequest;
    var isRelayModernEnvironment = require_isRelayModernEnvironment();
    var _require2 = require_RelayModernOperationDescriptor();
    var createOperationDescriptor = _require2.createOperationDescriptor;
    var RelayDeclarativeMutationConfig = require_RelayDeclarativeMutationConfig();
    var invariant3 = require_browser();
    function applyOptimisticMutation(environment, config2) {
      !isRelayModernEnvironment(environment) ? true ? invariant3(false, "commitMutation: expected `environment` to be an instance of `RelayModernEnvironment`.") : invariant3(false) : void 0;
      var mutation = getRequest(config2.mutation);
      if (mutation.params.operationKind !== "mutation") {
        throw new Error("commitMutation: Expected mutation operation");
      }
      var optimisticUpdater = config2.optimisticUpdater;
      var configs = config2.configs, optimisticResponse = config2.optimisticResponse, variables = config2.variables;
      var operation = createOperationDescriptor(mutation, variables);
      if (configs) {
        var _RelayDeclarativeMuta = RelayDeclarativeMutationConfig.convert(configs, mutation, optimisticUpdater);
        optimisticUpdater = _RelayDeclarativeMuta.optimisticUpdater;
      }
      return environment.applyMutation({
        operation,
        response: optimisticResponse,
        updater: optimisticUpdater
      });
    }
    module.exports = applyOptimisticMutation;
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/mutations/commitLocalUpdate.js
var require_commitLocalUpdate = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/mutations/commitLocalUpdate.js"(exports, module) {
    "use strict";
    function commitLocalUpdate(environment, updater) {
      environment.commitUpdate(updater);
    }
    module.exports = commitLocalUpdate;
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/mutations/validateMutation.js
var require_validateMutation = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/mutations/validateMutation.js"(exports, module) {
    "use strict";
    var _interopRequireDefault = require_interopRequireDefault()["default"];
    var _objectSpread210 = _interopRequireDefault(require_objectSpread2());
    var _require = require_RelayConcreteNode();
    var ACTOR_CHANGE = _require.ACTOR_CHANGE;
    var CLIENT_COMPONENT = _require.CLIENT_COMPONENT;
    var CLIENT_EDGE_TO_CLIENT_OBJECT = _require.CLIENT_EDGE_TO_CLIENT_OBJECT;
    var CLIENT_EXTENSION = _require.CLIENT_EXTENSION;
    var CONDITION = _require.CONDITION;
    var DEFER = _require.DEFER;
    var FLIGHT_FIELD = _require.FLIGHT_FIELD;
    var FRAGMENT_SPREAD = _require.FRAGMENT_SPREAD;
    var INLINE_FRAGMENT = _require.INLINE_FRAGMENT;
    var LINKED_FIELD = _require.LINKED_FIELD;
    var LINKED_HANDLE = _require.LINKED_HANDLE;
    var MODULE_IMPORT = _require.MODULE_IMPORT;
    var RELAY_RESOLVER = _require.RELAY_RESOLVER;
    var SCALAR_FIELD = _require.SCALAR_FIELD;
    var SCALAR_HANDLE = _require.SCALAR_HANDLE;
    var STREAM = _require.STREAM;
    var TYPE_DISCRIMINATOR = _require.TYPE_DISCRIMINATOR;
    var warning2 = require_warning();
    var hasOwnProperty3 = Object.prototype.hasOwnProperty;
    var validateMutation = function validateMutation2() {
    };
    if (true) {
      addFieldToDiff = function addFieldToDiff2(path2, diff, isScalar) {
        var deepLoc = diff;
        path2.split(".").forEach(function(key, index, arr) {
          if (deepLoc[key] == null) {
            deepLoc[key] = {};
          }
          if (isScalar && index === arr.length - 1) {
            deepLoc[key] = "<scalar>";
          }
          deepLoc = deepLoc[key];
        });
      };
      validateMutation = function validateMutation2(optimisticResponse, mutation, variables) {
        var operationName = mutation.operation.name;
        var context2 = {
          path: "ROOT",
          visitedPaths: /* @__PURE__ */ new Set(),
          variables: variables || {},
          missingDiff: {},
          extraDiff: {},
          moduleImportPaths: /* @__PURE__ */ new Set()
        };
        validateSelections(optimisticResponse, mutation.operation.selections, context2);
        validateOptimisticResponse(optimisticResponse, context2);
        true ? warning2(context2.missingDiff.ROOT == null, "Expected `optimisticResponse` to match structure of server response for mutation `%s`, please define fields for all of\n%s", operationName, JSON.stringify(context2.missingDiff.ROOT, null, 2)) : void 0;
        true ? warning2(context2.extraDiff.ROOT == null, "Expected `optimisticResponse` to match structure of server response for mutation `%s`, please remove all fields of\n%s", operationName, JSON.stringify(context2.extraDiff.ROOT, null, 2)) : void 0;
      };
      validateSelections = function validateSelections2(optimisticResponse, selections, context2) {
        selections.forEach(function(selection2) {
          return validateSelection(optimisticResponse, selection2, context2);
        });
      };
      validateSelection = function validateSelection2(optimisticResponse, selection2, context2) {
        switch (selection2.kind) {
          case CONDITION:
            validateSelections(optimisticResponse, selection2.selections, context2);
            return;
          case CLIENT_COMPONENT:
          case FRAGMENT_SPREAD:
            validateSelections(optimisticResponse, selection2.fragment.selections, context2);
            return;
          case SCALAR_FIELD:
          case LINKED_FIELD:
          case FLIGHT_FIELD:
            return validateField2(optimisticResponse, selection2, context2);
          case ACTOR_CHANGE:
            return validateField2(optimisticResponse, selection2.linkedField, context2);
          case INLINE_FRAGMENT:
            var type = selection2.type;
            var isConcreteType = selection2.abstractKey == null;
            validateAbstractKey(context2, selection2.abstractKey);
            selection2.selections.forEach(function(subselection) {
              if (isConcreteType && optimisticResponse.__typename !== type) {
                return;
              }
              validateSelection2(optimisticResponse, subselection, context2);
            });
            return;
          case CLIENT_EXTENSION:
            selection2.selections.forEach(function(subselection) {
              validateSelection2(optimisticResponse, subselection, context2);
            });
            return;
          case MODULE_IMPORT:
            return validateModuleImport(context2);
          case TYPE_DISCRIMINATOR:
            return validateAbstractKey(context2, selection2.abstractKey);
          case RELAY_RESOLVER:
          case CLIENT_EDGE_TO_CLIENT_OBJECT:
          case LINKED_HANDLE:
          case SCALAR_HANDLE:
          case DEFER:
          case STREAM: {
            return;
          }
          default:
            selection2;
            return;
        }
      };
      validateModuleImport = function validateModuleImport2(context2) {
        context2.moduleImportPaths.add(context2.path);
      };
      validateAbstractKey = function validateAbstractKey2(context2, abstractKey) {
        if (abstractKey != null) {
          var path2 = "".concat(context2.path, ".").concat(abstractKey);
          context2.visitedPaths.add(path2);
        }
      };
      validateField2 = function validateField3(optimisticResponse, field, context2) {
        var fieldName = field.alias || field.name;
        var path2 = "".concat(context2.path, ".").concat(fieldName);
        context2.visitedPaths.add(path2);
        switch (field.kind) {
          case SCALAR_FIELD:
            if (hasOwnProperty3.call(optimisticResponse, fieldName) === false) {
              addFieldToDiff(path2, context2.missingDiff, true);
            }
            return;
          case LINKED_FIELD:
            var selections = field.selections;
            if (optimisticResponse[fieldName] === null || hasOwnProperty3.call(optimisticResponse, fieldName) && optimisticResponse[fieldName] === void 0) {
              return;
            }
            if (field.plural) {
              if (Array.isArray(optimisticResponse[fieldName])) {
                optimisticResponse[fieldName].forEach(function(r3) {
                  if (r3 !== null) {
                    validateSelections(r3, selections, (0, _objectSpread210["default"])((0, _objectSpread210["default"])({}, context2), {}, {
                      path: path2
                    }));
                  }
                });
                return;
              } else {
                addFieldToDiff(path2, context2.missingDiff);
                return;
              }
            } else {
              if (optimisticResponse[fieldName] instanceof Object) {
                validateSelections(optimisticResponse[fieldName], selections, (0, _objectSpread210["default"])((0, _objectSpread210["default"])({}, context2), {}, {
                  path: path2
                }));
                return;
              } else {
                addFieldToDiff(path2, context2.missingDiff);
                return;
              }
            }
          case FLIGHT_FIELD:
            if (optimisticResponse[fieldName] === null || hasOwnProperty3.call(optimisticResponse, fieldName) && optimisticResponse[fieldName] === void 0) {
              return;
            }
            throw new Error("validateMutation: Flight fields are not compatible with optimistic updates, as React does not have the component code necessary to process new data on the client. Instead, you should update your code to require a full refetch of the Flight field so your UI can be updated.");
        }
      };
      validateOptimisticResponse = function validateOptimisticResponse2(optimisticResponse, context2) {
        if (Array.isArray(optimisticResponse)) {
          optimisticResponse.forEach(function(r3) {
            if (r3 instanceof Object) {
              validateOptimisticResponse2(r3, context2);
            }
          });
          return;
        }
        Object.keys(optimisticResponse).forEach(function(key) {
          var value = optimisticResponse[key];
          var path2 = "".concat(context2.path, ".").concat(key);
          if (context2.moduleImportPaths.has(path2)) {
            return;
          }
          if (!context2.visitedPaths.has(path2)) {
            addFieldToDiff(path2, context2.extraDiff);
            return;
          }
          if (value instanceof Object) {
            validateOptimisticResponse2(value, (0, _objectSpread210["default"])((0, _objectSpread210["default"])({}, context2), {}, {
              path: path2
            }));
          }
        });
      };
    }
    var addFieldToDiff;
    var validateSelections;
    var validateSelection;
    var validateModuleImport;
    var validateAbstractKey;
    var validateField2;
    var validateOptimisticResponse;
    module.exports = validateMutation;
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/mutations/commitMutation.js
var require_commitMutation = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/mutations/commitMutation.js"(exports, module) {
    "use strict";
    var _interopRequireDefault = require_interopRequireDefault()["default"];
    var _toConsumableArray22 = _interopRequireDefault(require_toConsumableArray());
    var _require = require_GraphQLTag();
    var getRequest = _require.getRequest;
    var _require2 = require_ClientID();
    var generateUniqueClientID = _require2.generateUniqueClientID;
    var isRelayModernEnvironment = require_isRelayModernEnvironment();
    var _require3 = require_RelayModernOperationDescriptor();
    var createOperationDescriptor = _require3.createOperationDescriptor;
    var RelayDeclarativeMutationConfig = require_RelayDeclarativeMutationConfig();
    var validateMutation = require_validateMutation();
    var invariant3 = require_browser();
    var warning2 = require_warning();
    function commitMutation(environment, config2) {
      !isRelayModernEnvironment(environment) ? true ? invariant3(false, "commitMutation: expected `environment` to be an instance of `RelayModernEnvironment`.") : invariant3(false) : void 0;
      var mutation = getRequest(config2.mutation);
      if (mutation.params.operationKind !== "mutation") {
        throw new Error("commitMutation: Expected mutation operation");
      }
      if (mutation.kind !== "Request") {
        throw new Error("commitMutation: Expected mutation to be of type request");
      }
      var optimisticResponse = config2.optimisticResponse, optimisticUpdater = config2.optimisticUpdater, updater = config2.updater;
      var configs = config2.configs, cacheConfig = config2.cacheConfig, onError = config2.onError, onUnsubscribe = config2.onUnsubscribe, variables = config2.variables, uploadables = config2.uploadables;
      var operation = createOperationDescriptor(mutation, variables, cacheConfig, generateUniqueClientID());
      if (typeof optimisticResponse === "function") {
        optimisticResponse = optimisticResponse();
        true ? warning2(false, "commitMutation: Expected `optimisticResponse` to be an object, received a function.") : void 0;
      }
      if (true) {
        if (optimisticResponse instanceof Object) {
          validateMutation(optimisticResponse, mutation, variables);
        }
      }
      if (configs) {
        var _RelayDeclarativeMuta = RelayDeclarativeMutationConfig.convert(configs, mutation, optimisticUpdater, updater);
        optimisticUpdater = _RelayDeclarativeMuta.optimisticUpdater;
        updater = _RelayDeclarativeMuta.updater;
      }
      var errors = [];
      var subscription2 = environment.executeMutation({
        operation,
        optimisticResponse,
        optimisticUpdater,
        updater,
        uploadables
      }).subscribe({
        next: function next2(payload) {
          var _config$onNext;
          if (Array.isArray(payload)) {
            payload.forEach(function(item) {
              if (item.errors) {
                errors.push.apply(errors, (0, _toConsumableArray22["default"])(item.errors));
              }
            });
          } else {
            if (payload.errors) {
              errors.push.apply(errors, (0, _toConsumableArray22["default"])(payload.errors));
            }
          }
          (_config$onNext = config2.onNext) === null || _config$onNext === void 0 ? void 0 : _config$onNext.call(config2);
        },
        complete: function complete() {
          var onCompleted = config2.onCompleted;
          if (onCompleted) {
            var snapshot = environment.lookup(operation.fragment);
            onCompleted(snapshot.data, errors.length !== 0 ? errors : null);
          }
        },
        error: onError,
        unsubscribe: onUnsubscribe
      });
      return {
        dispose: subscription2.unsubscribe
      };
    }
    module.exports = commitMutation;
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/util/withProvidedVariables.js
var require_withProvidedVariables = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/util/withProvidedVariables.js"(exports, module) {
    "use strict";
    var areEqual2 = require_areEqual();
    var warning2 = require_warning();
    var WEAKMAP_SUPPORTED = typeof WeakMap === "function";
    var debugCache = WEAKMAP_SUPPORTED ? /* @__PURE__ */ new WeakMap() : /* @__PURE__ */ new Map();
    function withProvidedVariables(userSuppliedVariables, providedVariables) {
      if (providedVariables != null) {
        var operationVariables = {};
        Object.assign(operationVariables, userSuppliedVariables);
        Object.keys(providedVariables).forEach(function(varName) {
          var providerFunction = providedVariables[varName].get;
          var providerResult = providerFunction();
          if (!debugCache.has(providerFunction)) {
            debugCache.set(providerFunction, providerResult);
            operationVariables[varName] = providerResult;
          } else {
            var cachedResult = debugCache.get(providerFunction);
            if (true) {
              true ? warning2(areEqual2(providerResult, cachedResult), "Relay: Expected function `%s` for provider `%s` to be a pure function, but got conflicting return values `%s` and `%s`", providerFunction.name, varName, providerResult, cachedResult) : void 0;
            }
            operationVariables[varName] = cachedResult;
          }
        });
        return operationVariables;
      } else {
        return userSuppliedVariables;
      }
    }
    withProvidedVariables.tests_only_resetDebugCache = true ? function() {
      debugCache = WEAKMAP_SUPPORTED ? /* @__PURE__ */ new WeakMap() : /* @__PURE__ */ new Map();
    } : void 0;
    module.exports = withProvidedVariables;
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/util/isPromise.js
var require_isPromise = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/util/isPromise.js"(exports, module) {
    "use strict";
    function isPromise(p) {
      return !!p && typeof p.then === "function";
    }
    module.exports = isPromise;
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/network/RelayObservable.js
var require_RelayObservable = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/network/RelayObservable.js"(exports, module) {
    "use strict";
    var isPromise = require_isPromise();
    var hostReportError = swallowError;
    var RelayObservable = /* @__PURE__ */ function() {
      RelayObservable2.create = function create4(source) {
        return new RelayObservable2(source);
      };
      function RelayObservable2(source) {
        if (true) {
          if (!source || typeof source !== "function") {
            throw new Error("Source must be a Function: " + String(source));
          }
        }
        this._source = source;
      }
      RelayObservable2.onUnhandledError = function onUnhandledError(callback) {
        hostReportError = callback;
      };
      RelayObservable2.from = function from2(obj) {
        return isObservable(obj) ? fromObservable(obj) : isPromise(obj) ? fromPromise(obj) : fromValue(obj);
      };
      var _proto = RelayObservable2.prototype;
      _proto["catch"] = function _catch(fn) {
        var _this = this;
        return RelayObservable2.create(function(sink) {
          var subscription2;
          _this.subscribe({
            start: function start(sub) {
              subscription2 = sub;
            },
            next: sink.next,
            complete: sink.complete,
            error: function error(_error2) {
              try {
                fn(_error2).subscribe({
                  start: function start(sub) {
                    subscription2 = sub;
                  },
                  next: sink.next,
                  complete: sink.complete,
                  error: sink.error
                });
              } catch (error2) {
                sink.error(
                  error2,
                  true
                  /* isUncaughtThrownError */
                );
              }
            }
          });
          return function() {
            return subscription2.unsubscribe();
          };
        });
      };
      _proto.concat = function concat(next2) {
        var _this2 = this;
        return RelayObservable2.create(function(sink) {
          var current;
          _this2.subscribe({
            start: function start(subscription2) {
              current = subscription2;
            },
            next: sink.next,
            error: sink.error,
            complete: function complete() {
              current = next2.subscribe(sink);
            }
          });
          return function() {
            current && current.unsubscribe();
          };
        });
      };
      _proto["do"] = function _do(observer) {
        var _this3 = this;
        return RelayObservable2.create(function(sink) {
          var both = function both2(action) {
            return function() {
              try {
                observer[action] && observer[action].apply(observer, arguments);
              } catch (error) {
                hostReportError(
                  error,
                  true
                  /* isUncaughtThrownError */
                );
              }
              sink[action] && sink[action].apply(sink, arguments);
            };
          };
          return _this3.subscribe({
            start: both("start"),
            next: both("next"),
            error: both("error"),
            complete: both("complete"),
            unsubscribe: both("unsubscribe")
          });
        });
      };
      _proto["finally"] = function _finally(fn) {
        var _this4 = this;
        return RelayObservable2.create(function(sink) {
          var subscription2 = _this4.subscribe(sink);
          return function() {
            subscription2.unsubscribe();
            fn();
          };
        });
      };
      _proto.ifEmpty = function ifEmpty(alternate) {
        var _this5 = this;
        return RelayObservable2.create(function(sink) {
          var hasValue = false;
          var current = _this5.subscribe({
            next: function next2(value) {
              hasValue = true;
              sink.next(value);
            },
            error: sink.error,
            complete: function complete() {
              if (hasValue) {
                sink.complete();
              } else {
                current = alternate.subscribe(sink);
              }
            }
          });
          return function() {
            current.unsubscribe();
          };
        });
      };
      _proto.subscribe = function subscribe(observer) {
        if (true) {
          if (!observer || typeof observer !== "object") {
            throw new Error("Observer must be an Object with callbacks: " + String(observer));
          }
        }
        return _subscribe(this._source, observer);
      };
      _proto.map = function map3(fn) {
        var _this6 = this;
        return RelayObservable2.create(function(sink) {
          var subscription2 = _this6.subscribe({
            complete: sink.complete,
            error: sink.error,
            next: function next2(value) {
              try {
                var mapValue = fn(value);
                sink.next(mapValue);
              } catch (error) {
                sink.error(
                  error,
                  true
                  /* isUncaughtThrownError */
                );
              }
            }
          });
          return function() {
            subscription2.unsubscribe();
          };
        });
      };
      _proto.mergeMap = function mergeMap(fn) {
        var _this7 = this;
        return RelayObservable2.create(function(sink) {
          var subscriptions = [];
          function start(subscription2) {
            this._sub = subscription2;
            subscriptions.push(subscription2);
          }
          function complete() {
            subscriptions.splice(subscriptions.indexOf(this._sub), 1);
            if (subscriptions.length === 0) {
              sink.complete();
            }
          }
          _this7.subscribe({
            start,
            next: function next2(value) {
              try {
                if (!sink.closed) {
                  RelayObservable2.from(fn(value)).subscribe({
                    start,
                    next: sink.next,
                    error: sink.error,
                    complete
                  });
                }
              } catch (error) {
                sink.error(
                  error,
                  true
                  /* isUncaughtThrownError */
                );
              }
            },
            error: sink.error,
            complete
          });
          return function() {
            subscriptions.forEach(function(sub) {
              return sub.unsubscribe();
            });
            subscriptions.length = 0;
          };
        });
      };
      _proto.poll = function poll(pollInterval) {
        var _this8 = this;
        if (true) {
          if (typeof pollInterval !== "number" || pollInterval <= 0) {
            throw new Error("RelayObservable: Expected pollInterval to be positive, got: " + pollInterval);
          }
        }
        return RelayObservable2.create(function(sink) {
          var subscription2;
          var timeout2;
          var poll2 = function poll3() {
            subscription2 = _this8.subscribe({
              next: sink.next,
              error: sink.error,
              complete: function complete() {
                timeout2 = setTimeout(poll3, pollInterval);
              }
            });
          };
          poll2();
          return function() {
            clearTimeout(timeout2);
            subscription2.unsubscribe();
          };
        });
      };
      _proto.toPromise = function toPromise() {
        var _this9 = this;
        return new Promise(function(resolve2, reject) {
          var resolved = false;
          _this9.subscribe({
            next: function next2(val) {
              if (!resolved) {
                resolved = true;
                resolve2(val);
              }
            },
            error: reject,
            complete: resolve2
          });
        });
      };
      return RelayObservable2;
    }();
    function isObservable(obj) {
      return typeof obj === "object" && obj !== null && typeof obj.subscribe === "function";
    }
    function fromObservable(obj) {
      return obj instanceof RelayObservable ? obj : RelayObservable.create(function(sink) {
        return obj.subscribe(sink);
      });
    }
    function fromPromise(promise) {
      return RelayObservable.create(function(sink) {
        promise.then(function(value) {
          sink.next(value);
          sink.complete();
        }, sink.error);
      });
    }
    function fromValue(value) {
      return RelayObservable.create(function(sink) {
        sink.next(value);
        sink.complete();
      });
    }
    function _subscribe(source, observer) {
      var closed = false;
      var cleanup;
      var withClosed = function withClosed2(obj) {
        return Object.defineProperty(obj, "closed", {
          get: function get3() {
            return closed;
          }
        });
      };
      function doCleanup() {
        if (cleanup) {
          if (cleanup.unsubscribe) {
            cleanup.unsubscribe();
          } else {
            try {
              cleanup();
            } catch (error) {
              hostReportError(
                error,
                true
                /* isUncaughtThrownError */
              );
            }
          }
          cleanup = void 0;
        }
      }
      var subscription2 = withClosed({
        unsubscribe: function unsubscribe() {
          if (!closed) {
            closed = true;
            try {
              observer.unsubscribe && observer.unsubscribe(subscription2);
            } catch (error) {
              hostReportError(
                error,
                true
                /* isUncaughtThrownError */
              );
            } finally {
              doCleanup();
            }
          }
        }
      });
      try {
        observer.start && observer.start(subscription2);
      } catch (error) {
        hostReportError(
          error,
          true
          /* isUncaughtThrownError */
        );
      }
      if (closed) {
        return subscription2;
      }
      var sink = withClosed({
        next: function next2(value) {
          if (!closed && observer.next) {
            try {
              observer.next(value);
            } catch (error) {
              hostReportError(
                error,
                true
                /* isUncaughtThrownError */
              );
            }
          }
        },
        error: function error(_error3, isUncaughtThrownError) {
          if (closed || !observer.error) {
            closed = true;
            hostReportError(_error3, isUncaughtThrownError || false);
            doCleanup();
          } else {
            closed = true;
            try {
              observer.error(_error3);
            } catch (error2) {
              hostReportError(
                error2,
                true
                /* isUncaughtThrownError */
              );
            } finally {
              doCleanup();
            }
          }
        },
        complete: function complete() {
          if (!closed) {
            closed = true;
            try {
              observer.complete && observer.complete();
            } catch (error) {
              hostReportError(
                error,
                true
                /* isUncaughtThrownError */
              );
            } finally {
              doCleanup();
            }
          }
        }
      });
      try {
        cleanup = source(sink);
      } catch (error) {
        sink.error(
          error,
          true
          /* isUncaughtThrownError */
        );
      }
      if (true) {
        if (cleanup !== void 0 && typeof cleanup !== "function" && (!cleanup || typeof cleanup.unsubscribe !== "function")) {
          throw new Error("Returned cleanup function which cannot be called: " + String(cleanup));
        }
      }
      if (closed) {
        doCleanup();
      }
      return subscription2;
    }
    function swallowError(_error, _isUncaughtThrownError) {
    }
    if (true) {
      RelayObservable.onUnhandledError(function(error, isUncaughtThrownError) {
        if (typeof fail === "function") {
          fail(String(error));
        } else if (isUncaughtThrownError) {
          setTimeout(function() {
            throw error;
          });
        } else if (typeof console !== "undefined") {
          console.error("RelayObservable: Unhandled Error", error);
        }
      });
    }
    module.exports = RelayObservable;
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/network/ConvertToExecuteFunction.js
var require_ConvertToExecuteFunction = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/network/ConvertToExecuteFunction.js"(exports, module) {
    "use strict";
    var RelayObservable = require_RelayObservable();
    function convertFetch(fn) {
      return function fetch2(request, variables, cacheConfig, uploadables, logRequestInfo) {
        var result = fn(request, variables, cacheConfig, uploadables, logRequestInfo);
        if (result instanceof Error) {
          return RelayObservable.create(function(sink) {
            return sink.error(result);
          });
        }
        return RelayObservable.from(result);
      };
    }
    module.exports = {
      convertFetch
    };
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/network/RelayNetwork.js
var require_RelayNetwork = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/network/RelayNetwork.js"(exports, module) {
    "use strict";
    var withProvidedVariables = require_withProvidedVariables();
    var _require = require_ConvertToExecuteFunction();
    var convertFetch = _require.convertFetch;
    var invariant3 = require_browser();
    function create4(fetchFn, subscribe) {
      var observeFetch = convertFetch(fetchFn);
      function execute(request, variables, cacheConfig, uploadables, logRequestInfo) {
        var operationVariables = withProvidedVariables(variables, request.providedVariables);
        if (request.operationKind === "subscription") {
          !subscribe ? true ? invariant3(false, "RelayNetwork: This network layer does not support Subscriptions. To use Subscriptions, provide a custom network layer.") : invariant3(false) : void 0;
          !!uploadables ? true ? invariant3(false, "RelayNetwork: Cannot provide uploadables while subscribing.") : invariant3(false) : void 0;
          return subscribe(request, operationVariables, cacheConfig);
        }
        var pollInterval = cacheConfig.poll;
        if (pollInterval != null) {
          !!uploadables ? true ? invariant3(false, "RelayNetwork: Cannot provide uploadables while polling.") : invariant3(false) : void 0;
          return observeFetch(request, operationVariables, {
            force: true
          }).poll(pollInterval);
        }
        return observeFetch(request, operationVariables, cacheConfig, uploadables, logRequestInfo);
      }
      return {
        execute
      };
    }
    module.exports = {
      create: create4
    };
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/network/RelayQueryResponseCache.js
var require_RelayQueryResponseCache = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/network/RelayQueryResponseCache.js"(exports, module) {
    "use strict";
    var _interopRequireDefault = require_interopRequireDefault()["default"];
    var _objectSpread210 = _interopRequireDefault(require_objectSpread2());
    var stableCopy = require_stableCopy();
    var invariant3 = require_browser();
    var RelayQueryResponseCache = /* @__PURE__ */ function() {
      function RelayQueryResponseCache2(_ref18) {
        var size = _ref18.size, ttl = _ref18.ttl;
        !(size > 0) ? true ? invariant3(false, "RelayQueryResponseCache: Expected the max cache size to be > 0, got `%s`.", size) : invariant3(false) : void 0;
        !(ttl > 0) ? true ? invariant3(false, "RelayQueryResponseCache: Expected the max ttl to be > 0, got `%s`.", ttl) : invariant3(false) : void 0;
        this._responses = /* @__PURE__ */ new Map();
        this._size = size;
        this._ttl = ttl;
      }
      var _proto = RelayQueryResponseCache2.prototype;
      _proto.clear = function clear2() {
        this._responses.clear();
      };
      _proto.get = function get3(queryID, variables) {
        var _this = this;
        var cacheKey = getCacheKey(queryID, variables);
        this._responses.forEach(function(response2, key) {
          if (!isCurrent(response2.fetchTime, _this._ttl)) {
            _this._responses["delete"](key);
          }
        });
        var response = this._responses.get(cacheKey);
        if (response == null) {
          return null;
        }
        if (Array.isArray(response.payload)) {
          return response.payload.map(function(payload) {
            return (0, _objectSpread210["default"])((0, _objectSpread210["default"])({}, payload), {}, {
              extensions: (0, _objectSpread210["default"])((0, _objectSpread210["default"])({}, payload.extensions), {}, {
                cacheTimestamp: response.fetchTime
              })
            });
          });
        }
        return (0, _objectSpread210["default"])((0, _objectSpread210["default"])({}, response.payload), {}, {
          extensions: (0, _objectSpread210["default"])((0, _objectSpread210["default"])({}, response.payload.extensions), {}, {
            cacheTimestamp: response.fetchTime
          })
        });
      };
      _proto.set = function set3(queryID, variables, payload) {
        var fetchTime = Date.now();
        var cacheKey = getCacheKey(queryID, variables);
        this._responses["delete"](cacheKey);
        this._responses.set(cacheKey, {
          fetchTime,
          payload
        });
        if (this._responses.size > this._size) {
          var firstKey = this._responses.keys().next();
          if (!firstKey.done) {
            this._responses["delete"](firstKey.value);
          }
        }
      };
      return RelayQueryResponseCache2;
    }();
    function getCacheKey(queryID, variables) {
      return JSON.stringify(stableCopy({
        queryID,
        variables
      }));
    }
    function isCurrent(fetchTime, ttl) {
      return fetchTime + ttl >= Date.now();
    }
    module.exports = RelayQueryResponseCache;
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/util/handlePotentialSnapshotErrors.js
var require_handlePotentialSnapshotErrors = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/util/handlePotentialSnapshotErrors.js"(exports, module) {
    "use strict";
    var _interopRequireDefault = require_interopRequireDefault()["default"];
    var _createForOfIteratorHelper2 = _interopRequireDefault(require_createForOfIteratorHelper());
    function handlePotentialSnapshotErrors(environment, missingRequiredFields, relayResolverErrors) {
      var _iterator = (0, _createForOfIteratorHelper2["default"])(relayResolverErrors), _step;
      try {
        for (_iterator.s(); !(_step = _iterator.n()).done; ) {
          var resolverError = _step.value;
          environment.requiredFieldLogger({
            kind: "relay_resolver.error",
            owner: resolverError.field.owner,
            fieldPath: resolverError.field.path,
            error: resolverError.error
          });
        }
      } catch (err) {
        _iterator.e(err);
      } finally {
        _iterator.f();
      }
      if (missingRequiredFields != null) {
        switch (missingRequiredFields.action) {
          case "THROW": {
            var _missingRequiredField = missingRequiredFields.field, path2 = _missingRequiredField.path, owner = _missingRequiredField.owner;
            environment.requiredFieldLogger({
              kind: "missing_field.throw",
              owner,
              fieldPath: path2
            });
            throw new Error("Relay: Missing @required value at path '".concat(path2, "' in '").concat(owner, "'."));
          }
          case "LOG":
            missingRequiredFields.fields.forEach(function(_ref18) {
              var path3 = _ref18.path, owner2 = _ref18.owner;
              environment.requiredFieldLogger({
                kind: "missing_field.log",
                owner: owner2,
                fieldPath: path3
              });
            });
            break;
          default: {
            missingRequiredFields.action;
          }
        }
      }
    }
    module.exports = handlePotentialSnapshotErrors;
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/util/RelayReplaySubject.js
var require_RelayReplaySubject = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/util/RelayReplaySubject.js"(exports, module) {
    "use strict";
    var _interopRequireDefault = require_interopRequireDefault()["default"];
    var _createForOfIteratorHelper2 = _interopRequireDefault(require_createForOfIteratorHelper());
    var _defineProperty210 = _interopRequireDefault(require_defineProperty());
    var RelayObservable = require_RelayObservable();
    var invariant3 = require_browser();
    var RelayReplaySubject = /* @__PURE__ */ function() {
      function RelayReplaySubject2() {
        var _this = this;
        (0, _defineProperty210["default"])(this, "_complete", false);
        (0, _defineProperty210["default"])(this, "_events", []);
        (0, _defineProperty210["default"])(this, "_sinks", /* @__PURE__ */ new Set());
        (0, _defineProperty210["default"])(this, "_subscription", []);
        this._observable = RelayObservable.create(function(sink) {
          _this._sinks.add(sink);
          var events = _this._events;
          for (var i2 = 0; i2 < events.length; i2++) {
            if (sink.closed) {
              break;
            }
            var event = events[i2];
            switch (event.kind) {
              case "complete":
                sink.complete();
                break;
              case "error":
                sink.error(event.error);
                break;
              case "next":
                sink.next(event.data);
                break;
              default:
                event.kind;
                true ? true ? invariant3(false, "RelayReplaySubject: Unknown event kind `%s`.", event.kind) : invariant3(false) : void 0;
            }
          }
          return function() {
            _this._sinks["delete"](sink);
          };
        });
      }
      var _proto = RelayReplaySubject2.prototype;
      _proto.complete = function complete() {
        if (this._complete === true) {
          return;
        }
        this._complete = true;
        this._events.push({
          kind: "complete"
        });
        this._sinks.forEach(function(sink) {
          return sink.complete();
        });
      };
      _proto.error = function error(_error) {
        if (this._complete === true) {
          return;
        }
        this._complete = true;
        this._events.push({
          kind: "error",
          error: _error
        });
        this._sinks.forEach(function(sink) {
          return sink.error(_error);
        });
      };
      _proto.next = function next2(data) {
        if (this._complete === true) {
          return;
        }
        this._events.push({
          kind: "next",
          data
        });
        this._sinks.forEach(function(sink) {
          return sink.next(data);
        });
      };
      _proto.subscribe = function subscribe(observer) {
        var subscription2 = this._observable.subscribe(observer);
        this._subscription.push(subscription2);
        return subscription2;
      };
      _proto.unsubscribe = function unsubscribe() {
        var _iterator = (0, _createForOfIteratorHelper2["default"])(this._subscription), _step;
        try {
          for (_iterator.s(); !(_step = _iterator.n()).done; ) {
            var subscription2 = _step.value;
            subscription2.unsubscribe();
          }
        } catch (err) {
          _iterator.e(err);
        } finally {
          _iterator.f();
        }
        this._subscription = [];
      };
      _proto.getObserverCount = function getObserverCount() {
        return this._sinks.size;
      };
      return RelayReplaySubject2;
    }();
    module.exports = RelayReplaySubject;
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/query/fetchQueryInternal.js
var require_fetchQueryInternal = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/query/fetchQueryInternal.js"(exports, module) {
    "use strict";
    var Observable = require_RelayObservable();
    var RelayFeatureFlags = require_RelayFeatureFlags();
    var RelayReplaySubject = require_RelayReplaySubject();
    var invariant3 = require_browser();
    var WEAKMAP_SUPPORTED = typeof WeakMap === "function";
    var requestCachesByEnvironment = WEAKMAP_SUPPORTED ? /* @__PURE__ */ new WeakMap() : /* @__PURE__ */ new Map();
    function fetchQuery7(environment, operation) {
      return fetchQueryDeduped(environment, operation.request.identifier, function() {
        return environment.execute({
          operation
        });
      });
    }
    function fetchQueryDeduped(environment, identifier2, fetchFn) {
      return Observable.create(function(sink) {
        var requestCache = getRequestCache(environment);
        var cachedRequest = requestCache.get(identifier2);
        if (!cachedRequest) {
          fetchFn()["finally"](function() {
            return requestCache["delete"](identifier2);
          }).subscribe({
            start: function start(subscription2) {
              cachedRequest = {
                identifier: identifier2,
                subject: new RelayReplaySubject(),
                subjectForInFlightStatus: new RelayReplaySubject(),
                subscription: subscription2,
                promise: null
              };
              requestCache.set(identifier2, cachedRequest);
            },
            next: function next2(response) {
              var cachedReq = getCachedRequest(requestCache, identifier2);
              cachedReq.subject.next(response);
              cachedReq.subjectForInFlightStatus.next(response);
            },
            error: function error(_error) {
              var cachedReq = getCachedRequest(requestCache, identifier2);
              cachedReq.subject.error(_error);
              cachedReq.subjectForInFlightStatus.error(_error);
            },
            complete: function complete() {
              var cachedReq = getCachedRequest(requestCache, identifier2);
              cachedReq.subject.complete();
              cachedReq.subjectForInFlightStatus.complete();
            },
            unsubscribe: function unsubscribe(subscription2) {
              var cachedReq = getCachedRequest(requestCache, identifier2);
              cachedReq.subject.unsubscribe();
              cachedReq.subjectForInFlightStatus.unsubscribe();
            }
          });
        }
        !(cachedRequest != null) ? true ? invariant3(false, "[fetchQueryInternal] fetchQueryDeduped: Expected `start` to be called synchronously") : invariant3(false) : void 0;
        return getObservableForCachedRequest(requestCache, cachedRequest).subscribe(sink);
      });
    }
    function getObservableForCachedRequest(requestCache, cachedRequest) {
      return Observable.create(function(sink) {
        var subscription2 = cachedRequest.subject.subscribe(sink);
        return function() {
          subscription2.unsubscribe();
          var cachedRequestInstance = requestCache.get(cachedRequest.identifier);
          if (cachedRequestInstance) {
            var requestSubscription = cachedRequestInstance.subscription;
            if (requestSubscription != null && cachedRequestInstance.subject.getObserverCount() === 0) {
              requestSubscription.unsubscribe();
              requestCache["delete"](cachedRequest.identifier);
            }
          }
        };
      });
    }
    function getActiveStatusObservableForCachedRequest(environment, requestCache, cachedRequest) {
      return Observable.create(function(sink) {
        var subscription2 = cachedRequest.subjectForInFlightStatus.subscribe({
          error: sink.error,
          next: function next2(response) {
            if (!environment.isRequestActive(cachedRequest.identifier)) {
              sink.complete();
              return;
            }
            sink.next();
          },
          complete: sink.complete,
          unsubscribe: sink.complete
        });
        return function() {
          subscription2.unsubscribe();
        };
      });
    }
    function getPromiseForActiveRequest(environment, request) {
      var requestCache = getRequestCache(environment);
      var cachedRequest = requestCache.get(request.identifier);
      if (!cachedRequest) {
        return null;
      }
      if (!environment.isRequestActive(cachedRequest.identifier)) {
        return null;
      }
      if (RelayFeatureFlags.USE_REACT_CACHE) {
        var existing = cachedRequest.promise;
        if (existing) {
          return existing;
        }
      }
      var promise = new Promise(function(resolve2, reject) {
        var resolveOnNext = false;
        getActiveStatusObservableForCachedRequest(environment, requestCache, cachedRequest).subscribe({
          complete: resolve2,
          error: reject,
          next: function next2(response) {
            if (resolveOnNext) {
              resolve2(response);
            }
          }
        });
        resolveOnNext = true;
      });
      if (RelayFeatureFlags.USE_REACT_CACHE) {
        cachedRequest.promise = promise;
        var cleanup = function cleanup2() {
          cachedRequest.promise = null;
        };
        promise.then(cleanup, cleanup);
      }
      return promise;
    }
    function getObservableForActiveRequest(environment, request) {
      var requestCache = getRequestCache(environment);
      var cachedRequest = requestCache.get(request.identifier);
      if (!cachedRequest) {
        return null;
      }
      if (!environment.isRequestActive(cachedRequest.identifier)) {
        return null;
      }
      return getActiveStatusObservableForCachedRequest(environment, requestCache, cachedRequest);
    }
    function getRequestCache(environment) {
      var cached = requestCachesByEnvironment.get(environment);
      if (cached != null) {
        return cached;
      }
      var requestCache = /* @__PURE__ */ new Map();
      requestCachesByEnvironment.set(environment, requestCache);
      return requestCache;
    }
    function getCachedRequest(requestCache, identifier2) {
      var cached = requestCache.get(identifier2);
      !(cached != null) ? true ? invariant3(false, "[fetchQueryInternal] getCachedRequest: Expected request to be cached") : invariant3(false) : void 0;
      return cached;
    }
    module.exports = {
      fetchQuery: fetchQuery7,
      fetchQueryDeduped,
      getPromiseForActiveRequest,
      getObservableForActiveRequest
    };
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/query/fetchQuery.js
var require_fetchQuery = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/query/fetchQuery.js"(exports, module) {
    "use strict";
    var _interopRequireDefault = require_interopRequireDefault()["default"];
    var _objectSpread210 = _interopRequireDefault(require_objectSpread2());
    var RelayObservable = require_RelayObservable();
    var _require = require_RelayModernOperationDescriptor();
    var createOperationDescriptor = _require.createOperationDescriptor;
    var handlePotentialSnapshotErrors = require_handlePotentialSnapshotErrors();
    var fetchQueryInternal = require_fetchQueryInternal();
    var _require2 = require_GraphQLTag();
    var getRequest = _require2.getRequest;
    var invariant3 = require_browser();
    function fetchQuery7(environment, query2, variables, options) {
      var _options$fetchPolicy;
      var queryNode = getRequest(query2);
      !(queryNode.params.operationKind === "query") ? true ? invariant3(false, "fetchQuery: Expected query operation") : invariant3(false) : void 0;
      var networkCacheConfig = (0, _objectSpread210["default"])({
        force: true
      }, options === null || options === void 0 ? void 0 : options.networkCacheConfig);
      var operation = createOperationDescriptor(queryNode, variables, networkCacheConfig);
      var fetchPolicy = (_options$fetchPolicy = options === null || options === void 0 ? void 0 : options.fetchPolicy) !== null && _options$fetchPolicy !== void 0 ? _options$fetchPolicy : "network-only";
      function readData(snapshot) {
        handlePotentialSnapshotErrors(environment, snapshot.missingRequiredFields, snapshot.relayResolverErrors);
        return snapshot.data;
      }
      switch (fetchPolicy) {
        case "network-only": {
          return getNetworkObservable(environment, operation).map(readData);
        }
        case "store-or-network": {
          if (environment.check(operation).status === "available") {
            return RelayObservable.from(environment.lookup(operation.fragment)).map(readData);
          }
          return getNetworkObservable(environment, operation).map(readData);
        }
        default:
          fetchPolicy;
          throw new Error("fetchQuery: Invalid fetchPolicy " + fetchPolicy);
      }
    }
    function getNetworkObservable(environment, operation) {
      return fetchQueryInternal.fetchQuery(environment, operation).map(function() {
        return environment.lookup(operation.fragment);
      });
    }
    module.exports = fetchQuery7;
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/query/fetchQuery_DEPRECATED.js
var require_fetchQuery_DEPRECATED = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/query/fetchQuery_DEPRECATED.js"(exports, module) {
    "use strict";
    var _require = require_RelayModernOperationDescriptor();
    var createOperationDescriptor = _require.createOperationDescriptor;
    var _require2 = require_GraphQLTag();
    var getRequest = _require2.getRequest;
    function fetchQuery_DEPRECATED(environment, taggedNode, variables, cacheConfig) {
      var query2 = getRequest(taggedNode);
      if (query2.params.operationKind !== "query") {
        throw new Error("fetchQuery: Expected query operation");
      }
      var operation = createOperationDescriptor(query2, variables, cacheConfig);
      return environment.execute({
        operation
      }).map(function() {
        return environment.lookup(operation.fragment).data;
      }).toPromise();
    }
    module.exports = fetchQuery_DEPRECATED;
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/query/PreloadableQueryRegistry.js
var require_PreloadableQueryRegistry = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/query/PreloadableQueryRegistry.js"(exports, module) {
    "use strict";
    var PreloadableQueryRegistry = /* @__PURE__ */ function() {
      function PreloadableQueryRegistry2() {
        this._preloadableQueries = /* @__PURE__ */ new Map();
        this._callbacks = /* @__PURE__ */ new Map();
      }
      var _proto = PreloadableQueryRegistry2.prototype;
      _proto.set = function set3(key, value) {
        this._preloadableQueries.set(key, value);
        var callbacks = this._callbacks.get(key);
        if (callbacks != null) {
          callbacks.forEach(function(cb) {
            try {
              cb(value);
            } catch (e3) {
              setTimeout(function() {
                throw e3;
              }, 0);
            }
          });
        }
      };
      _proto.get = function get3(key) {
        return this._preloadableQueries.get(key);
      };
      _proto.onLoad = function onLoad(key, callback) {
        var _this$_callbacks$get;
        var callbacks = (_this$_callbacks$get = this._callbacks.get(key)) !== null && _this$_callbacks$get !== void 0 ? _this$_callbacks$get : /* @__PURE__ */ new Set();
        callbacks.add(callback);
        var dispose2 = function dispose3() {
          callbacks["delete"](callback);
        };
        this._callbacks.set(key, callbacks);
        return {
          dispose: dispose2
        };
      };
      _proto.clear = function clear2() {
        this._preloadableQueries.clear();
      };
      return PreloadableQueryRegistry2;
    }();
    var preloadableQueryRegistry = new PreloadableQueryRegistry();
    module.exports = preloadableQueryRegistry;
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/util/getPendingOperationsForFragment.js
var require_getPendingOperationsForFragment = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/util/getPendingOperationsForFragment.js"(exports, module) {
    "use strict";
    var _require = require_fetchQueryInternal();
    var getPromiseForActiveRequest = _require.getPromiseForActiveRequest;
    function getPendingOperationsForFragment(environment, fragmentNode, fragmentOwner) {
      var _pendingOperations$ma, _pendingOperations;
      var pendingOperations = [];
      var promise = getPromiseForActiveRequest(environment, fragmentOwner);
      if (promise != null) {
        pendingOperations = [fragmentOwner];
      } else {
        var _result$pendingOperat, _result$promise;
        var result = environment.getOperationTracker().getPendingOperationsAffectingOwner(fragmentOwner);
        pendingOperations = (_result$pendingOperat = result === null || result === void 0 ? void 0 : result.pendingOperations) !== null && _result$pendingOperat !== void 0 ? _result$pendingOperat : [];
        promise = (_result$promise = result === null || result === void 0 ? void 0 : result.promise) !== null && _result$promise !== void 0 ? _result$promise : null;
      }
      if (!promise) {
        return null;
      }
      var pendingOperationName = (_pendingOperations$ma = (_pendingOperations = pendingOperations) === null || _pendingOperations === void 0 ? void 0 : _pendingOperations.map(function(op) {
        return op.node.params.name;
      }).join(",")) !== null && _pendingOperations$ma !== void 0 ? _pendingOperations$ma : null;
      if (pendingOperationName == null || pendingOperationName.length === 0) {
        pendingOperationName = "Unknown pending operation";
      }
      var fragmentName = fragmentNode.name;
      var promiseDisplayName = pendingOperationName === fragmentName ? "Relay(".concat(pendingOperationName, ")") : "Relay(".concat(pendingOperationName, ":").concat(fragmentName, ")");
      promise.displayName = promiseDisplayName;
      environment.__log({
        name: "pendingoperation.found",
        fragment: fragmentNode,
        fragmentOwner,
        pendingOperations
      });
      return {
        promise,
        pendingOperations
      };
    }
    module.exports = getPendingOperationsForFragment;
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/util/isScalarAndEqual.js
var require_isScalarAndEqual = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/util/isScalarAndEqual.js"(exports, module) {
    "use strict";
    function isScalarAndEqual(valueA, valueB) {
      return valueA === valueB && (valueA === null || typeof valueA !== "object");
    }
    module.exports = isScalarAndEqual;
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/util/recycleNodesInto.js
var require_recycleNodesInto = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/util/recycleNodesInto.js"(exports, module) {
    "use strict";
    var hasWeakSetDefined = typeof WeakSet !== "undefined";
    var hasWeakMapDefined = typeof WeakMap !== "undefined";
    function recycleNodesInto(prevData, nextData) {
      if (prevData === nextData || typeof prevData !== "object" || prevData instanceof Set || prevData instanceof Map || hasWeakSetDefined && prevData instanceof WeakSet || hasWeakMapDefined && prevData instanceof WeakMap || !prevData || typeof nextData !== "object" || nextData instanceof Set || nextData instanceof Map || hasWeakSetDefined && nextData instanceof WeakSet || hasWeakMapDefined && nextData instanceof WeakMap || !nextData) {
        return nextData;
      }
      var canRecycle = false;
      var prevArray = Array.isArray(prevData) ? prevData : null;
      var nextArray = Array.isArray(nextData) ? nextData : null;
      if (prevArray && nextArray) {
        canRecycle = nextArray.reduce(function(wasEqual, nextItem, ii) {
          var prevValue = prevArray[ii];
          var nextValue = recycleNodesInto(prevValue, nextItem);
          if (nextValue !== nextArray[ii]) {
            if (true) {
              if (!Object.isFrozen(nextArray)) {
                nextArray[ii] = nextValue;
              }
            } else {
              nextArray[ii] = nextValue;
            }
          }
          return wasEqual && nextValue === prevArray[ii];
        }, true) && prevArray.length === nextArray.length;
      } else if (!prevArray && !nextArray) {
        var prevObject = prevData;
        var nextObject = nextData;
        var prevKeys = Object.keys(prevObject);
        var nextKeys = Object.keys(nextObject);
        canRecycle = nextKeys.reduce(function(wasEqual, key) {
          var prevValue = prevObject[key];
          var nextValue = recycleNodesInto(prevValue, nextObject[key]);
          if (nextValue !== nextObject[key]) {
            if (true) {
              if (!Object.isFrozen(nextObject)) {
                nextObject[key] = nextValue;
              }
            } else {
              nextObject[key] = nextValue;
            }
          }
          return wasEqual && nextValue === prevObject[key];
        }, true) && prevKeys.length === nextKeys.length;
      }
      return canRecycle ? prevData : nextData;
    }
    module.exports = recycleNodesInto;
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/store/RelayModernFragmentSpecResolver.js
var require_RelayModernFragmentSpecResolver = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/store/RelayModernFragmentSpecResolver.js"(exports, module) {
    "use strict";
    var _interopRequireDefault = require_interopRequireDefault()["default"];
    var _objectSpread210 = _interopRequireDefault(require_objectSpread2());
    var _defineProperty210 = _interopRequireDefault(require_defineProperty());
    var getPendingOperationsForFragment = require_getPendingOperationsForFragment();
    var handlePotentialSnapshotErrors = require_handlePotentialSnapshotErrors();
    var isScalarAndEqual = require_isScalarAndEqual();
    var recycleNodesInto = require_recycleNodesInto();
    var RelayFeatureFlags = require_RelayFeatureFlags();
    var _require = require_RelayModernOperationDescriptor();
    var createRequestDescriptor = _require.createRequestDescriptor;
    var _require2 = require_RelayModernSelector();
    var areEqualSelectors = _require2.areEqualSelectors;
    var createReaderSelector = _require2.createReaderSelector;
    var getSelectorsFromObject = _require2.getSelectorsFromObject;
    var areEqual2 = require_areEqual();
    var invariant3 = require_browser();
    var warning2 = require_warning();
    var RelayModernFragmentSpecResolver = /* @__PURE__ */ function() {
      function RelayModernFragmentSpecResolver2(context2, fragments, props, callback, rootIsQueryRenderer) {
        var _this = this;
        (0, _defineProperty210["default"])(this, "_onChange", function() {
          _this._stale = true;
          if (typeof _this._callback === "function") {
            _this._callback();
          }
        });
        this._callback = callback;
        this._context = context2;
        this._data = {};
        this._fragments = fragments;
        this._props = {};
        this._resolvers = {};
        this._stale = false;
        this._rootIsQueryRenderer = rootIsQueryRenderer;
        this.setProps(props);
      }
      var _proto = RelayModernFragmentSpecResolver2.prototype;
      _proto.dispose = function dispose2() {
        for (var key in this._resolvers) {
          if (this._resolvers.hasOwnProperty(key)) {
            disposeCallback(this._resolvers[key]);
          }
        }
      };
      _proto.resolve = function resolve2() {
        if (this._stale) {
          var prevData = this._data;
          var nextData;
          for (var key in this._resolvers) {
            if (this._resolvers.hasOwnProperty(key)) {
              var resolver = this._resolvers[key];
              var prevItem = prevData[key];
              if (resolver) {
                var nextItem = resolver.resolve();
                if (nextData || nextItem !== prevItem) {
                  nextData = nextData || (0, _objectSpread210["default"])({}, prevData);
                  nextData[key] = nextItem;
                }
              } else {
                var prop = this._props[key];
                var _nextItem = prop !== void 0 ? prop : null;
                if (nextData || !isScalarAndEqual(_nextItem, prevItem)) {
                  nextData = nextData || (0, _objectSpread210["default"])({}, prevData);
                  nextData[key] = _nextItem;
                }
              }
            }
          }
          this._data = nextData || prevData;
          this._stale = false;
        }
        return this._data;
      };
      _proto.setCallback = function setCallback(props, callback) {
        this._callback = callback;
        if (RelayFeatureFlags.ENABLE_CONTAINERS_SUBSCRIBE_ON_COMMIT === true) {
          this.setProps(props);
        }
      };
      _proto.setProps = function setProps(props) {
        this._props = {};
        var ownedSelectors = getSelectorsFromObject(this._fragments, props);
        for (var key in ownedSelectors) {
          if (ownedSelectors.hasOwnProperty(key)) {
            var ownedSelector = ownedSelectors[key];
            var resolver = this._resolvers[key];
            if (ownedSelector == null) {
              if (resolver != null) {
                resolver.dispose();
              }
              resolver = null;
            } else if (ownedSelector.kind === "PluralReaderSelector") {
              if (resolver == null) {
                resolver = new SelectorListResolver(this._context.environment, this._rootIsQueryRenderer, ownedSelector, this._callback != null, this._onChange);
              } else {
                !(resolver instanceof SelectorListResolver) ? true ? invariant3(false, "RelayModernFragmentSpecResolver: Expected prop `%s` to always be an array.", key) : invariant3(false) : void 0;
                resolver.setSelector(ownedSelector);
              }
            } else {
              if (resolver == null) {
                resolver = new SelectorResolver(this._context.environment, this._rootIsQueryRenderer, ownedSelector, this._callback != null, this._onChange);
              } else {
                !(resolver instanceof SelectorResolver) ? true ? invariant3(false, "RelayModernFragmentSpecResolver: Expected prop `%s` to always be an object.", key) : invariant3(false) : void 0;
                resolver.setSelector(ownedSelector);
              }
            }
            this._props[key] = props[key];
            this._resolvers[key] = resolver;
          }
        }
        this._stale = true;
      };
      _proto.setVariables = function setVariables(variables, request) {
        for (var key in this._resolvers) {
          if (this._resolvers.hasOwnProperty(key)) {
            var resolver = this._resolvers[key];
            if (resolver) {
              resolver.setVariables(variables, request);
            }
          }
        }
        this._stale = true;
      };
      return RelayModernFragmentSpecResolver2;
    }();
    var SelectorResolver = /* @__PURE__ */ function() {
      function SelectorResolver2(environment, rootIsQueryRenderer, selector, subscribeOnConstruction, callback) {
        var _this2 = this;
        (0, _defineProperty210["default"])(this, "_onChange", function(snapshot) {
          _this2._data = snapshot.data;
          _this2._isMissingData = snapshot.isMissingData;
          _this2._missingRequiredFields = snapshot.missingRequiredFields;
          _this2._relayResolverErrors = snapshot.relayResolverErrors;
          _this2._callback();
        });
        var _snapshot = environment.lookup(selector);
        this._callback = callback;
        this._data = _snapshot.data;
        this._isMissingData = _snapshot.isMissingData;
        this._missingRequiredFields = _snapshot.missingRequiredFields;
        this._relayResolverErrors = _snapshot.relayResolverErrors;
        this._environment = environment;
        this._rootIsQueryRenderer = rootIsQueryRenderer;
        this._selector = selector;
        if (RelayFeatureFlags.ENABLE_CONTAINERS_SUBSCRIBE_ON_COMMIT === true) {
          if (subscribeOnConstruction) {
            this._subscription = environment.subscribe(_snapshot, this._onChange);
          }
        } else {
          this._subscription = environment.subscribe(_snapshot, this._onChange);
        }
      }
      var _proto2 = SelectorResolver2.prototype;
      _proto2.dispose = function dispose2() {
        if (this._subscription) {
          this._subscription.dispose();
          this._subscription = null;
        }
      };
      _proto2.resolve = function resolve2() {
        if (this._isMissingData === true) {
          var pendingOperationsResult = getPendingOperationsForFragment(this._environment, this._selector.node, this._selector.owner);
          var promise = pendingOperationsResult === null || pendingOperationsResult === void 0 ? void 0 : pendingOperationsResult.promise;
          if (promise != null) {
            if (this._rootIsQueryRenderer) {
              true ? warning2(false, "Relay: Relay Container for fragment `%s` has missing data and would suspend. When using features such as @defer or @module, use `useFragment` instead of a Relay Container.", this._selector.node.name) : void 0;
            } else {
              var _pendingOperationsRes;
              var pendingOperations = (_pendingOperationsRes = pendingOperationsResult === null || pendingOperationsResult === void 0 ? void 0 : pendingOperationsResult.pendingOperations) !== null && _pendingOperationsRes !== void 0 ? _pendingOperationsRes : [];
              true ? warning2(false, "Relay: Relay Container for fragment `%s` suspended. When using features such as @defer or @module, use `useFragment` instead of a Relay Container.", this._selector.node.name) : void 0;
              this._environment.__log({
                name: "suspense.fragment",
                data: this._data,
                fragment: this._selector.node,
                isRelayHooks: false,
                isMissingData: this._isMissingData,
                isPromiseCached: false,
                pendingOperations
              });
              throw promise;
            }
          }
        }
        handlePotentialSnapshotErrors(this._environment, this._missingRequiredFields, this._relayResolverErrors);
        return this._data;
      };
      _proto2.setSelector = function setSelector(selector) {
        if (this._subscription != null && areEqualSelectors(selector, this._selector)) {
          return;
        }
        this.dispose();
        var snapshot = this._environment.lookup(selector);
        this._data = recycleNodesInto(this._data, snapshot.data);
        this._isMissingData = snapshot.isMissingData;
        this._missingRequiredFields = snapshot.missingRequiredFields;
        this._relayResolverErrors = snapshot.relayResolverErrors;
        this._selector = selector;
        this._subscription = this._environment.subscribe(snapshot, this._onChange);
      };
      _proto2.setVariables = function setVariables(variables, request) {
        if (areEqual2(variables, this._selector.variables)) {
          return;
        }
        var requestDescriptor = createRequestDescriptor(request, variables);
        var selector = createReaderSelector(this._selector.node, this._selector.dataID, variables, requestDescriptor);
        this.setSelector(selector);
      };
      return SelectorResolver2;
    }();
    var SelectorListResolver = /* @__PURE__ */ function() {
      function SelectorListResolver2(environment, rootIsQueryRenderer, selector, subscribeOnConstruction, callback) {
        var _this3 = this;
        (0, _defineProperty210["default"])(this, "_onChange", function(data) {
          _this3._stale = true;
          _this3._callback();
        });
        this._callback = callback;
        this._data = [];
        this._environment = environment;
        this._resolvers = [];
        this._stale = true;
        this._rootIsQueryRenderer = rootIsQueryRenderer;
        this._subscribeOnConstruction = subscribeOnConstruction;
        this.setSelector(selector);
      }
      var _proto3 = SelectorListResolver2.prototype;
      _proto3.dispose = function dispose2() {
        this._resolvers.forEach(disposeCallback);
      };
      _proto3.resolve = function resolve2() {
        if (this._stale) {
          var prevData = this._data;
          var nextData;
          for (var ii = 0; ii < this._resolvers.length; ii++) {
            var prevItem = prevData[ii];
            var nextItem = this._resolvers[ii].resolve();
            if (nextData || nextItem !== prevItem) {
              nextData = nextData || prevData.slice(0, ii);
              nextData.push(nextItem);
            }
          }
          if (!nextData && this._resolvers.length !== prevData.length) {
            nextData = prevData.slice(0, this._resolvers.length);
          }
          this._data = nextData || prevData;
          this._stale = false;
        }
        return this._data;
      };
      _proto3.setSelector = function setSelector(selector) {
        var selectors = selector.selectors;
        while (this._resolvers.length > selectors.length) {
          var resolver = this._resolvers.pop();
          resolver.dispose();
        }
        for (var ii = 0; ii < selectors.length; ii++) {
          if (ii < this._resolvers.length) {
            this._resolvers[ii].setSelector(selectors[ii]);
          } else {
            this._resolvers[ii] = new SelectorResolver(this._environment, this._rootIsQueryRenderer, selectors[ii], this._subscribeOnConstruction, this._onChange);
          }
        }
        this._stale = true;
      };
      _proto3.setVariables = function setVariables(variables, request) {
        this._resolvers.forEach(function(resolver) {
          return resolver.setVariables(variables, request);
        });
        this._stale = true;
      };
      return SelectorListResolver2;
    }();
    function disposeCallback(disposable) {
      disposable && disposable.dispose();
    }
    module.exports = RelayModernFragmentSpecResolver;
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/store/createFragmentSpecResolver.js
var require_createFragmentSpecResolver = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/store/createFragmentSpecResolver.js"(exports, module) {
    "use strict";
    var RelayModernFragmentSpecResolver = require_RelayModernFragmentSpecResolver();
    var warning2 = require_warning();
    function createFragmentSpecResolver(context2, containerName, fragments, props, rootIsQueryRenderer, callback) {
      if (true) {
        var fragmentNames = Object.keys(fragments);
        fragmentNames.forEach(function(fragmentName) {
          var propValue = props[fragmentName];
          true ? warning2(propValue !== void 0, "createFragmentSpecResolver: Expected prop `%s` to be supplied to `%s`, but got `undefined`. Pass an explicit `null` if this is intentional.", fragmentName, containerName) : void 0;
        });
      }
      return new RelayModernFragmentSpecResolver(context2, fragments, props, callback, rootIsQueryRenderer);
    }
    module.exports = createFragmentSpecResolver;
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/store/createRelayContext.js
var require_createRelayContext = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/store/createRelayContext.js"(exports, module) {
    "use strict";
    var invariant3 = require_browser();
    var relayContext;
    var firstReact;
    function createRelayContext(react) {
      if (!relayContext) {
        relayContext = react.createContext(null);
        if (true) {
          relayContext.displayName = "RelayContext";
        }
        firstReact = react;
      }
      !(react === firstReact) ? true ? invariant3(false, "[createRelayContext]: You are passing a different instance of React", react.version) : invariant3(false) : void 0;
      return relayContext;
    }
    module.exports = createRelayContext;
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/store/readInlineData.js
var require_readInlineData = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/store/readInlineData.js"(exports, module) {
    "use strict";
    var _require = require_GraphQLTag();
    var getInlineDataFragment = _require.getInlineDataFragment;
    var _require2 = require_RelayStoreUtils();
    var FRAGMENTS_KEY = _require2.FRAGMENTS_KEY;
    var invariant3 = require_browser();
    function readInlineData(fragment2, fragmentRef) {
      var _fragmentRef$FRAGMENT;
      var inlineDataFragment = getInlineDataFragment(fragment2);
      if (fragmentRef == null) {
        return fragmentRef;
      }
      !(typeof fragmentRef === "object") ? true ? invariant3(false, "readInlineData(): Expected an object, got `%s`.", typeof fragmentRef) : invariant3(false) : void 0;
      var inlineData = (_fragmentRef$FRAGMENT = fragmentRef[FRAGMENTS_KEY]) === null || _fragmentRef$FRAGMENT === void 0 ? void 0 : _fragmentRef$FRAGMENT[inlineDataFragment.name];
      !(inlineData != null) ? true ? invariant3(false, "readInlineData(): Expected fragment `%s` to be spread in the parent fragment.", inlineDataFragment.name) : invariant3(false) : void 0;
      return inlineData;
    }
    module.exports = readInlineData;
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/multi-actor-environment/ActorIdentifier.js
var require_ActorIdentifier = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/multi-actor-environment/ActorIdentifier.js"(exports, module) {
    "use strict";
    var invariant3 = require_browser();
    var INTERNAL_ACTOR_IDENTIFIER_DO_NOT_USE = "INTERNAL_ACTOR_IDENTIFIER_DO_NOT_USE";
    function assertInternalActorIdentifier(actorIdentifier) {
      !(actorIdentifier === INTERNAL_ACTOR_IDENTIFIER_DO_NOT_USE) ? true ? invariant3(false, 'Expected to use only internal version of the `actorIdentifier`. "%s" was provided.', actorIdentifier) : invariant3(false) : void 0;
    }
    module.exports = {
      assertInternalActorIdentifier,
      getActorIdentifier: function getActorIdentifier(actorID) {
        return actorID;
      },
      getDefaultActorIdentifier: function getDefaultActorIdentifier() {
        throw new Error("Not Implemented");
      },
      INTERNAL_ACTOR_IDENTIFIER_DO_NOT_USE
    };
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/util/generateID.js
var require_generateID = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/util/generateID.js"(exports, module) {
    "use strict";
    var id2 = 1e5;
    function generateID() {
      return id2++;
    }
    module.exports = generateID;
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/network/wrapNetworkWithLogObserver.js
var require_wrapNetworkWithLogObserver = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/network/wrapNetworkWithLogObserver.js"(exports, module) {
    "use strict";
    var generateID = require_generateID();
    function wrapNetworkWithLogObserver(env, network) {
      return {
        execute: function execute(params, variables, cacheConfig, uploadables) {
          var networkRequestId = generateID();
          var logObserver = {
            start: function start(subscription2) {
              env.__log({
                name: "network.start",
                networkRequestId,
                params,
                variables,
                cacheConfig
              });
            },
            next: function next2(response) {
              env.__log({
                name: "network.next",
                networkRequestId,
                response
              });
            },
            error: function error(_error) {
              env.__log({
                name: "network.error",
                networkRequestId,
                error: _error
              });
            },
            complete: function complete() {
              env.__log({
                name: "network.complete",
                networkRequestId
              });
            },
            unsubscribe: function unsubscribe() {
              env.__log({
                name: "network.unsubscribe",
                networkRequestId
              });
            }
          };
          var logRequestInfo = function logRequestInfo2(info) {
            env.__log({
              name: "network.info",
              networkRequestId,
              info
            });
          };
          return network.execute(params, variables, cacheConfig, uploadables, logRequestInfo)["do"](logObserver);
        }
      };
    }
    module.exports = wrapNetworkWithLogObserver;
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/store/RelayOperationTracker.js
var require_RelayOperationTracker = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/store/RelayOperationTracker.js"(exports, module) {
    "use strict";
    var _interopRequireDefault = require_interopRequireDefault()["default"];
    var _createForOfIteratorHelper2 = _interopRequireDefault(require_createForOfIteratorHelper());
    var invariant3 = require_browser();
    var RelayOperationTracker = /* @__PURE__ */ function() {
      function RelayOperationTracker2() {
        this._ownersToPendingOperations = /* @__PURE__ */ new Map();
        this._pendingOperationsToOwners = /* @__PURE__ */ new Map();
        this._ownersToPendingPromise = /* @__PURE__ */ new Map();
      }
      var _proto = RelayOperationTracker2.prototype;
      _proto.update = function update(pendingOperation, affectedOwners) {
        if (affectedOwners.size === 0) {
          return;
        }
        var pendingOperationIdentifier = pendingOperation.identifier;
        var newlyAffectedOwnersIdentifier = /* @__PURE__ */ new Set();
        var _iterator = (0, _createForOfIteratorHelper2["default"])(affectedOwners), _step;
        try {
          for (_iterator.s(); !(_step = _iterator.n()).done; ) {
            var owner = _step.value;
            var ownerIdentifier = owner.identifier;
            var pendingOperationsAffectingOwner = this._ownersToPendingOperations.get(ownerIdentifier);
            if (pendingOperationsAffectingOwner != null) {
              if (!pendingOperationsAffectingOwner.has(pendingOperationIdentifier)) {
                pendingOperationsAffectingOwner.set(pendingOperationIdentifier, pendingOperation);
                newlyAffectedOwnersIdentifier.add(ownerIdentifier);
              }
            } else {
              this._ownersToPendingOperations.set(ownerIdentifier, /* @__PURE__ */ new Map([[pendingOperationIdentifier, pendingOperation]]));
              newlyAffectedOwnersIdentifier.add(ownerIdentifier);
            }
          }
        } catch (err) {
          _iterator.e(err);
        } finally {
          _iterator.f();
        }
        if (newlyAffectedOwnersIdentifier.size === 0) {
          return;
        }
        var ownersAffectedByPendingOperation = this._pendingOperationsToOwners.get(pendingOperationIdentifier) || /* @__PURE__ */ new Set();
        var _iterator2 = (0, _createForOfIteratorHelper2["default"])(newlyAffectedOwnersIdentifier), _step2;
        try {
          for (_iterator2.s(); !(_step2 = _iterator2.n()).done; ) {
            var _ownerIdentifier = _step2.value;
            this._resolveOwnerResolvers(_ownerIdentifier);
            ownersAffectedByPendingOperation.add(_ownerIdentifier);
          }
        } catch (err) {
          _iterator2.e(err);
        } finally {
          _iterator2.f();
        }
        this._pendingOperationsToOwners.set(pendingOperationIdentifier, ownersAffectedByPendingOperation);
      };
      _proto.complete = function complete(pendingOperation) {
        var pendingOperationIdentifier = pendingOperation.identifier;
        var affectedOwnersIdentifier = this._pendingOperationsToOwners.get(pendingOperationIdentifier);
        if (affectedOwnersIdentifier == null) {
          return;
        }
        var completedOwnersIdentifier = /* @__PURE__ */ new Set();
        var updatedOwnersIdentifier = /* @__PURE__ */ new Set();
        var _iterator3 = (0, _createForOfIteratorHelper2["default"])(affectedOwnersIdentifier), _step3;
        try {
          for (_iterator3.s(); !(_step3 = _iterator3.n()).done; ) {
            var ownerIdentifier = _step3.value;
            var pendingOperationsAffectingOwner = this._ownersToPendingOperations.get(ownerIdentifier);
            if (!pendingOperationsAffectingOwner) {
              continue;
            }
            pendingOperationsAffectingOwner["delete"](pendingOperationIdentifier);
            if (pendingOperationsAffectingOwner.size > 0) {
              updatedOwnersIdentifier.add(ownerIdentifier);
            } else {
              completedOwnersIdentifier.add(ownerIdentifier);
            }
          }
        } catch (err) {
          _iterator3.e(err);
        } finally {
          _iterator3.f();
        }
        var _iterator4 = (0, _createForOfIteratorHelper2["default"])(completedOwnersIdentifier), _step4;
        try {
          for (_iterator4.s(); !(_step4 = _iterator4.n()).done; ) {
            var _ownerIdentifier2 = _step4.value;
            this._resolveOwnerResolvers(_ownerIdentifier2);
            this._ownersToPendingOperations["delete"](_ownerIdentifier2);
          }
        } catch (err) {
          _iterator4.e(err);
        } finally {
          _iterator4.f();
        }
        var _iterator5 = (0, _createForOfIteratorHelper2["default"])(updatedOwnersIdentifier), _step5;
        try {
          for (_iterator5.s(); !(_step5 = _iterator5.n()).done; ) {
            var _ownerIdentifier3 = _step5.value;
            this._resolveOwnerResolvers(_ownerIdentifier3);
          }
        } catch (err) {
          _iterator5.e(err);
        } finally {
          _iterator5.f();
        }
        this._pendingOperationsToOwners["delete"](pendingOperationIdentifier);
      };
      _proto._resolveOwnerResolvers = function _resolveOwnerResolvers(ownerIdentifier) {
        var promiseEntry = this._ownersToPendingPromise.get(ownerIdentifier);
        if (promiseEntry != null) {
          promiseEntry.resolve();
        }
        this._ownersToPendingPromise["delete"](ownerIdentifier);
      };
      _proto.getPendingOperationsAffectingOwner = function getPendingOperationsAffectingOwner(owner) {
        var ownerIdentifier = owner.identifier;
        var pendingOperationsForOwner = this._ownersToPendingOperations.get(ownerIdentifier);
        if (pendingOperationsForOwner == null || pendingOperationsForOwner.size === 0) {
          return null;
        }
        var cachedPromiseEntry = this._ownersToPendingPromise.get(ownerIdentifier);
        if (cachedPromiseEntry != null) {
          return {
            promise: cachedPromiseEntry.promise,
            pendingOperations: cachedPromiseEntry.pendingOperations
          };
        }
        var resolve2;
        var promise = new Promise(function(r3) {
          resolve2 = r3;
        });
        !(resolve2 != null) ? true ? invariant3(false, "RelayOperationTracker: Expected resolver to be defined. If youare seeing this, it is likely a bug in Relay.") : invariant3(false) : void 0;
        var pendingOperations = Array.from(pendingOperationsForOwner.values());
        this._ownersToPendingPromise.set(ownerIdentifier, {
          promise,
          resolve: resolve2,
          pendingOperations
        });
        return {
          promise,
          pendingOperations
        };
      };
      return RelayOperationTracker2;
    }();
    module.exports = RelayOperationTracker;
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/util/registerEnvironmentWithDevTools.js
var require_registerEnvironmentWithDevTools = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/util/registerEnvironmentWithDevTools.js"(exports, module) {
    "use strict";
    function registerEnvironmentWithDevTools(environment) {
      var _global = typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : void 0;
      var devToolsHook = _global && _global.__RELAY_DEVTOOLS_HOOK__;
      if (devToolsHook) {
        devToolsHook.registerEnvironment(environment);
      }
    }
    module.exports = registerEnvironmentWithDevTools;
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/store/ViewerPattern.js
var require_ViewerPattern = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/store/ViewerPattern.js"(exports, module) {
    "use strict";
    var _require = require_ClientID();
    var generateClientID = _require.generateClientID;
    var _require2 = require_RelayStoreUtils();
    var ROOT_ID = _require2.ROOT_ID;
    var VIEWER_ID = generateClientID(ROOT_ID, "viewer");
    var VIEWER_TYPE = "Viewer";
    module.exports = {
      VIEWER_ID,
      VIEWER_TYPE
    };
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/store/defaultGetDataID.js
var require_defaultGetDataID = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/store/defaultGetDataID.js"(exports, module) {
    "use strict";
    var _require = require_ViewerPattern();
    var VIEWER_ID = _require.VIEWER_ID;
    var VIEWER_TYPE = _require.VIEWER_TYPE;
    function defaultGetDataID(fieldValue, typeName2) {
      if (typeName2 === VIEWER_TYPE) {
        return fieldValue.id == null ? VIEWER_ID : fieldValue.id;
      }
      return fieldValue.id;
    }
    module.exports = defaultGetDataID;
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/store/defaultRequiredFieldLogger.js
var require_defaultRequiredFieldLogger = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/store/defaultRequiredFieldLogger.js"(exports, module) {
    "use strict";
    var defaultRequiredFieldLogger = function defaultRequiredFieldLogger2(event) {
      if (event.kind === "missing_field.log") {
        throw new Error("Relay Environment Configuration Error (dev only): `@required(action: LOG)` requires that the Relay Environment be configured with a `requiredFieldLogger`.");
      }
    };
    module.exports = defaultRequiredFieldLogger;
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/util/getOperation.js
var require_getOperation = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/util/getOperation.js"(exports, module) {
    "use strict";
    var _require = require_RelayConcreteNode();
    var REQUEST = _require.REQUEST;
    var SPLIT_OPERATION = _require.SPLIT_OPERATION;
    function getOperation(node56) {
      switch (node56.kind) {
        case REQUEST:
          return node56.operation;
        case SPLIT_OPERATION:
        default:
          return node56;
      }
    }
    module.exports = getOperation;
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/util/RelayError.js
var require_RelayError = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/util/RelayError.js"(exports, module) {
    "use strict";
    function createError(type, name2, messageFormat) {
      for (var _len = arguments.length, messageParams = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
        messageParams[_key - 3] = arguments[_key];
      }
      var index = 0;
      var message = messageFormat.replace(/%s/g, function() {
        return String(messageParams[index++]);
      });
      var err = new Error(message);
      var error = Object.assign(err, {
        name: name2,
        messageFormat,
        messageParams,
        type,
        taalOpcodes: [2, 2]
        // skip frame (code=2) twice
      });
      if (error.stack === void 0) {
        try {
          throw error;
        } catch (_unused) {
        }
      }
      return error;
    }
    module.exports = {
      create: function create4(name2, messageFormat) {
        for (var _len2 = arguments.length, messageParams = new Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
          messageParams[_key2 - 2] = arguments[_key2];
        }
        return createError.apply(void 0, ["error", name2, messageFormat].concat(messageParams));
      },
      createWarning: function createWarning(name2, messageFormat) {
        for (var _len3 = arguments.length, messageParams = new Array(_len3 > 2 ? _len3 - 2 : 0), _key3 = 2; _key3 < _len3; _key3++) {
          messageParams[_key3 - 2] = arguments[_key3];
        }
        return createError.apply(void 0, ["warn", name2, messageFormat].concat(messageParams));
      }
    };
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/util/withDuration.js
var require_withDuration = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/util/withDuration.js"(exports, module) {
    "use strict";
    var _window;
    var _window$performance;
    var isPerformanceNowAvailable = typeof window !== "undefined" && typeof ((_window = window) === null || _window === void 0 ? void 0 : (_window$performance = _window.performance) === null || _window$performance === void 0 ? void 0 : _window$performance.now) === "function";
    function currentTimestamp() {
      if (isPerformanceNowAvailable) {
        return window.performance.now();
      }
      return Date.now();
    }
    function withDuration(cb) {
      var startTime = currentTimestamp();
      var result = cb();
      return [currentTimestamp() - startTime, result];
    }
    module.exports = withDuration;
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/store/experimental-live-resolvers/LiveResolverSuspenseSentinel.js
var require_LiveResolverSuspenseSentinel = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/store/experimental-live-resolvers/LiveResolverSuspenseSentinel.js"(exports, module) {
    "use strict";
    var LIVE_RESOLVER_SUSPENSE_SENTINEL = Object.freeze({
      __LIVE_RESOLVER_SUSPENSE_SENTINEL: true
    });
    function suspenseSentinel() {
      return LIVE_RESOLVER_SUSPENSE_SENTINEL;
    }
    function isSuspenseSentinel(value) {
      return value === LIVE_RESOLVER_SUSPENSE_SENTINEL;
    }
    module.exports = {
      isSuspenseSentinel,
      suspenseSentinel
    };
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/store/RelayModernRecord.js
var require_RelayModernRecord = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/store/RelayModernRecord.js"(exports, module) {
    "use strict";
    var _interopRequireDefault = require_interopRequireDefault()["default"];
    var _objectSpread210 = _interopRequireDefault(require_objectSpread2());
    var deepFreeze = require_deepFreeze();
    var _require = require_ClientID();
    var generateClientObjectClientID = _require.generateClientObjectClientID;
    var isClientID = _require.isClientID;
    var _require2 = require_LiveResolverSuspenseSentinel();
    var isSuspenseSentinel = _require2.isSuspenseSentinel;
    var _require3 = require_RelayStoreUtils();
    var ACTOR_IDENTIFIER_KEY = _require3.ACTOR_IDENTIFIER_KEY;
    var ID_KEY = _require3.ID_KEY;
    var INVALIDATED_AT_KEY = _require3.INVALIDATED_AT_KEY;
    var REF_KEY = _require3.REF_KEY;
    var REFS_KEY = _require3.REFS_KEY;
    var RELAY_RESOLVER_VALUE_KEY = _require3.RELAY_RESOLVER_VALUE_KEY;
    var ROOT_ID = _require3.ROOT_ID;
    var TYPENAME_KEY = _require3.TYPENAME_KEY;
    var areEqual2 = require_areEqual();
    var invariant3 = require_browser();
    var warning2 = require_warning();
    function clone(record) {
      return (0, _objectSpread210["default"])({}, record);
    }
    function copyFields(source, sink) {
      for (var key in source) {
        if (source.hasOwnProperty(key)) {
          if (key !== ID_KEY && key !== TYPENAME_KEY) {
            sink[key] = source[key];
          }
        }
      }
    }
    function create4(dataID, typeName2) {
      var record = {};
      record[ID_KEY] = dataID;
      record[TYPENAME_KEY] = typeName2;
      return record;
    }
    function getDataID(record) {
      return record[ID_KEY];
    }
    function getType(record) {
      return record[TYPENAME_KEY];
    }
    function getValue(record, storageKey) {
      var value = record[storageKey];
      if (value && typeof value === "object") {
        !(!value.hasOwnProperty(REF_KEY) && !value.hasOwnProperty(REFS_KEY)) ? true ? invariant3(false, "RelayModernRecord.getValue(): Expected a scalar (non-link) value for `%s.%s` but found %s.", record[ID_KEY], storageKey, value.hasOwnProperty(REF_KEY) ? "a linked record" : "plural linked records") : invariant3(false) : void 0;
      }
      return value;
    }
    function getLinkedRecordID(record, storageKey) {
      var maybeLink = record[storageKey];
      if (maybeLink == null) {
        return maybeLink;
      }
      var link = maybeLink;
      !(typeof link === "object" && link && typeof link[REF_KEY] === "string") ? true ? invariant3(false, "RelayModernRecord.getLinkedRecordID(): Expected `%s.%s` to be a linked ID, was `%s`.%s", record[ID_KEY], storageKey, JSON.stringify(link), typeof link === "object" && link[REFS_KEY] !== void 0 ? " It appears to be a plural linked record: did you mean to call getLinkedRecords() instead of getLinkedRecord()?" : "") : invariant3(false) : void 0;
      return link[REF_KEY];
    }
    function getLinkedRecordIDs(record, storageKey) {
      var links = record[storageKey];
      if (links == null) {
        return links;
      }
      !(typeof links === "object" && Array.isArray(links[REFS_KEY])) ? true ? invariant3(false, "RelayModernRecord.getLinkedRecordIDs(): Expected `%s.%s` to contain an array of linked IDs, got `%s`.%s", record[ID_KEY], storageKey, JSON.stringify(links), typeof links === "object" && links[REF_KEY] !== void 0 ? " It appears to be a singular linked record: did you mean to call getLinkedRecord() instead of getLinkedRecords()?" : "") : invariant3(false) : void 0;
      return links[REFS_KEY];
    }
    function getInvalidationEpoch(record) {
      if (record == null) {
        return null;
      }
      var invalidatedAt = record[INVALIDATED_AT_KEY];
      if (typeof invalidatedAt !== "number") {
        return null;
      }
      return invalidatedAt;
    }
    function update(prevRecord, nextRecord) {
      if (true) {
        var _getType, _getType2;
        var prevID = getDataID(prevRecord);
        var nextID2 = getDataID(nextRecord);
        true ? warning2(prevID === nextID2, "RelayModernRecord: Invalid record update, expected both versions of the record to have the same id, got `%s` and `%s`.", prevID, nextID2) : void 0;
        var prevType = (_getType = getType(prevRecord)) !== null && _getType !== void 0 ? _getType : null;
        var nextType = (_getType2 = getType(nextRecord)) !== null && _getType2 !== void 0 ? _getType2 : null;
        true ? warning2(isClientID(nextID2) && nextID2 !== ROOT_ID || prevType === nextType, "RelayModernRecord: Invalid record update, expected both versions of record `%s` to have the same `%s` but got conflicting types `%s` and `%s`. The GraphQL server likely violated the globally unique id requirement by returning the same id for different objects.", prevID, TYPENAME_KEY, prevType, nextType) : void 0;
      }
      var updated = null;
      var keys4 = Object.keys(nextRecord);
      for (var ii = 0; ii < keys4.length; ii++) {
        var key = keys4[ii];
        if (updated || !areEqual2(prevRecord[key], nextRecord[key])) {
          updated = updated !== null ? updated : (0, _objectSpread210["default"])({}, prevRecord);
          updated[key] = nextRecord[key];
        }
      }
      return updated !== null ? updated : prevRecord;
    }
    function merge2(record1, record2) {
      if (true) {
        var _getType3, _getType4;
        var prevID = getDataID(record1);
        var nextID2 = getDataID(record2);
        true ? warning2(prevID === nextID2, "RelayModernRecord: Invalid record merge, expected both versions of the record to have the same id, got `%s` and `%s`.", prevID, nextID2) : void 0;
        var prevType = (_getType3 = getType(record1)) !== null && _getType3 !== void 0 ? _getType3 : null;
        var nextType = (_getType4 = getType(record2)) !== null && _getType4 !== void 0 ? _getType4 : null;
        true ? warning2(isClientID(nextID2) && nextID2 !== ROOT_ID || prevType === nextType, "RelayModernRecord: Invalid record merge, expected both versions of record `%s` to have the same `%s` but got conflicting types `%s` and `%s`. The GraphQL server likely violated the globally unique id requirement by returning the same id for different objects.", prevID, TYPENAME_KEY, prevType, nextType) : void 0;
      }
      return (0, _objectSpread210["default"])((0, _objectSpread210["default"])({}, record1), record2);
    }
    function freeze(record) {
      deepFreeze(record);
    }
    function setValue(record, storageKey, value) {
      if (true) {
        var prevID = getDataID(record);
        if (storageKey === ID_KEY) {
          true ? warning2(prevID === value, "RelayModernRecord: Invalid field update, expected both versions of the record to have the same id, got `%s` and `%s`.", prevID, value) : void 0;
        } else if (storageKey === TYPENAME_KEY) {
          var _getType5;
          var prevType = (_getType5 = getType(record)) !== null && _getType5 !== void 0 ? _getType5 : null;
          var nextType = value !== null && value !== void 0 ? value : null;
          true ? warning2(isClientID(getDataID(record)) && getDataID(record) !== ROOT_ID || prevType === nextType, "RelayModernRecord: Invalid field update, expected both versions of record `%s` to have the same `%s` but got conflicting types `%s` and `%s`. The GraphQL server likely violated the globally unique id requirement by returning the same id for different objects.", prevID, TYPENAME_KEY, prevType, nextType) : void 0;
        }
      }
      record[storageKey] = value;
    }
    function setLinkedRecordID(record, storageKey, linkedID) {
      var link = {};
      link[REF_KEY] = linkedID;
      record[storageKey] = link;
    }
    function setLinkedRecordIDs(record, storageKey, linkedIDs) {
      var links = {};
      links[REFS_KEY] = linkedIDs;
      record[storageKey] = links;
    }
    function setActorLinkedRecordID(record, storageKey, actorIdentifier, linkedID) {
      var link = {};
      link[REF_KEY] = linkedID;
      link[ACTOR_IDENTIFIER_KEY] = actorIdentifier;
      record[storageKey] = link;
    }
    function getActorLinkedRecordID(record, storageKey) {
      var link = record[storageKey];
      if (link == null) {
        return link;
      }
      !(typeof link === "object" && typeof link[REF_KEY] === "string" && link[ACTOR_IDENTIFIER_KEY] != null) ? true ? invariant3(false, "RelayModernRecord.getActorLinkedRecordID(): Expected `%s.%s` to be an actor specific linked ID, was `%s`.", record[ID_KEY], storageKey, JSON.stringify(link)) : invariant3(false) : void 0;
      return [link[ACTOR_IDENTIFIER_KEY], link[REF_KEY]];
    }
    function getResolverLinkedRecordID(record, typeName2) {
      var id2 = getValue(record, RELAY_RESOLVER_VALUE_KEY);
      if (id2 == null || isSuspenseSentinel(id2)) {
        return null;
      }
      if (typeof id2 === "object") {
        id2 = id2.id;
      }
      !(typeof id2 === "string") ? true ? invariant3(false, "RelayModernRecord.getResolverLinkedRecordID(): Expected value to be a linked ID, was `%s`.", JSON.stringify(id2)) : invariant3(false) : void 0;
      return generateClientObjectClientID(typeName2, id2);
    }
    function getResolverLinkedRecordIDs(record, typeName2) {
      var resolverValue = getValue(record, RELAY_RESOLVER_VALUE_KEY);
      if (resolverValue == null || isSuspenseSentinel(resolverValue)) {
        return null;
      }
      !Array.isArray(resolverValue) ? true ? invariant3(false, "RelayModernRecord.getResolverLinkedRecordIDs(): Expected value to be an array of linked IDs, was `%s`.", JSON.stringify(resolverValue)) : invariant3(false) : void 0;
      return resolverValue.map(function(id2) {
        if (id2 == null) {
          return null;
        }
        if (typeof id2 === "object") {
          id2 = id2.id;
        }
        !(typeof id2 === "string") ? true ? invariant3(false, "RelayModernRecord.getResolverLinkedRecordIDs(): Expected item within resolver linked field to be a DataID, was `%s`.", JSON.stringify(id2)) : invariant3(false) : void 0;
        return generateClientObjectClientID(typeName2, id2);
      });
    }
    module.exports = {
      clone,
      copyFields,
      create: create4,
      freeze,
      getDataID,
      getInvalidationEpoch,
      getLinkedRecordID,
      getLinkedRecordIDs,
      getType,
      getValue,
      merge: merge2,
      setValue,
      setLinkedRecordID,
      setLinkedRecordIDs,
      update,
      getActorLinkedRecordID,
      setActorLinkedRecordID,
      getResolverLinkedRecordID,
      getResolverLinkedRecordIDs
    };
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/store/RelayRecordState.js
var require_RelayRecordState = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/store/RelayRecordState.js"(exports, module) {
    "use strict";
    var RelayRecordState = {
      /**
       * Record exists (either fetched from the server or produced by a local,
       * optimistic update).
       */
      EXISTENT: "EXISTENT",
      /**
       * Record is known not to exist (either as the result of a mutation, or
       * because the server returned `null` when queried for the record).
       */
      NONEXISTENT: "NONEXISTENT",
      /**
       * Record State is unknown because it has not yet been fetched from the
       * server.
       */
      UNKNOWN: "UNKNOWN"
    };
    module.exports = RelayRecordState;
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/store/RelayRecordSource.js
var require_RelayRecordSource = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/store/RelayRecordSource.js"(exports, module) {
    "use strict";
    var _interopRequireDefault = require_interopRequireDefault()["default"];
    var _createForOfIteratorHelper2 = _interopRequireDefault(require_createForOfIteratorHelper());
    var RelayRecordState = require_RelayRecordState();
    var EXISTENT = RelayRecordState.EXISTENT;
    var NONEXISTENT = RelayRecordState.NONEXISTENT;
    var UNKNOWN = RelayRecordState.UNKNOWN;
    var RelayRecordSource = /* @__PURE__ */ function() {
      function RelayRecordSource2(records) {
        var _this = this;
        this._records = /* @__PURE__ */ new Map();
        if (records != null) {
          Object.keys(records).forEach(function(key) {
            _this._records.set(key, records[key]);
          });
        }
      }
      RelayRecordSource2.create = function create4(records) {
        return new RelayRecordSource2(records);
      };
      var _proto = RelayRecordSource2.prototype;
      _proto.clear = function clear2() {
        this._records = /* @__PURE__ */ new Map();
      };
      _proto["delete"] = function _delete(dataID) {
        this._records.set(dataID, null);
      };
      _proto.get = function get3(dataID) {
        return this._records.get(dataID);
      };
      _proto.getRecordIDs = function getRecordIDs() {
        return Array.from(this._records.keys());
      };
      _proto.getStatus = function getStatus(dataID) {
        if (!this._records.has(dataID)) {
          return UNKNOWN;
        }
        return this._records.get(dataID) == null ? NONEXISTENT : EXISTENT;
      };
      _proto.has = function has2(dataID) {
        return this._records.has(dataID);
      };
      _proto.remove = function remove2(dataID) {
        this._records["delete"](dataID);
      };
      _proto.set = function set3(dataID, record) {
        this._records.set(dataID, record);
      };
      _proto.size = function size() {
        return this._records.size;
      };
      _proto.toJSON = function toJSON2() {
        var obj = {};
        var _iterator = (0, _createForOfIteratorHelper2["default"])(this._records), _step;
        try {
          for (_iterator.s(); !(_step = _iterator.n()).done; ) {
            var _step$value = _step.value, key = _step$value[0], value = _step$value[1];
            obj[key] = value;
          }
        } catch (err) {
          _iterator.e(err);
        } finally {
          _iterator.f();
        }
        return obj;
      };
      return RelayRecordSource2;
    }();
    module.exports = RelayRecordSource;
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/multi-actor-environment/ActorUtils.js
var require_ActorUtils = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/multi-actor-environment/ActorUtils.js"(exports, module) {
    "use strict";
    var ACTOR_IDENTIFIER_FIELD_NAME = "actor_key";
    var _require = require_ActorIdentifier();
    var getActorIdentifier = _require.getActorIdentifier;
    function getActorIdentifierFromPayload(payload) {
      if (payload != null && typeof payload === "object" && typeof payload[ACTOR_IDENTIFIER_FIELD_NAME] === "string") {
        return getActorIdentifier(payload[ACTOR_IDENTIFIER_FIELD_NAME]);
      }
    }
    module.exports = {
      ACTOR_IDENTIFIER_FIELD_NAME,
      getActorIdentifierFromPayload
    };
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/store/RelayStoreReactFlightUtils.js
var require_RelayStoreReactFlightUtils = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/store/RelayStoreReactFlightUtils.js"(exports, module) {
    "use strict";
    var _require = require_RelayModernRecord();
    var getType = _require.getType;
    var invariant3 = require_browser();
    var REACT_FLIGHT_EXECUTABLE_DEFINITIONS_STORAGE_KEY = "executableDefinitions";
    var REACT_FLIGHT_TREE_STORAGE_KEY = "tree";
    var REACT_FLIGHT_TYPE_NAME = "ReactFlightComponent";
    function refineToReactFlightPayloadData(payload) {
      if (payload == null || typeof payload !== "object" || typeof payload.status !== "string" || !Array.isArray(payload.tree) && payload.tree !== null || !Array.isArray(payload.queries) || !Array.isArray(payload.fragments) || !Array.isArray(payload.errors)) {
        return null;
      }
      return payload;
    }
    function getReactFlightClientResponse(record) {
      !(getType(record) === REACT_FLIGHT_TYPE_NAME) ? true ? invariant3(false, "getReactFlightClientResponse(): Expected a ReactFlightComponentRecord, got %s.", record) : invariant3(false) : void 0;
      return record[REACT_FLIGHT_TREE_STORAGE_KEY];
    }
    module.exports = {
      REACT_FLIGHT_EXECUTABLE_DEFINITIONS_STORAGE_KEY,
      REACT_FLIGHT_TREE_STORAGE_KEY,
      REACT_FLIGHT_TYPE_NAME,
      getReactFlightClientResponse,
      refineToReactFlightPayloadData
    };
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/store/TypeID.js
var require_TypeID = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/store/TypeID.js"(exports, module) {
    "use strict";
    var PREFIX = "client:__type:";
    var TYPE_SCHEMA_TYPE = "__TypeSchema";
    function generateTypeID(typeName2) {
      return PREFIX + typeName2;
    }
    function isTypeID(id2) {
      return id2.indexOf(PREFIX) === 0;
    }
    module.exports = {
      generateTypeID,
      isTypeID,
      TYPE_SCHEMA_TYPE
    };
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/store/RelayResponseNormalizer.js
var require_RelayResponseNormalizer = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/store/RelayResponseNormalizer.js"(exports, module) {
    "use strict";
    var _interopRequireDefault = require_interopRequireDefault()["default"];
    var _createForOfIteratorHelper2 = _interopRequireDefault(require_createForOfIteratorHelper());
    var _toConsumableArray22 = _interopRequireDefault(require_toConsumableArray());
    var _require = require_ActorUtils();
    var ACTOR_IDENTIFIER_FIELD_NAME = _require.ACTOR_IDENTIFIER_FIELD_NAME;
    var getActorIdentifierFromPayload = _require.getActorIdentifierFromPayload;
    var _require2 = require_RelayConcreteNode();
    var ACTOR_CHANGE = _require2.ACTOR_CHANGE;
    var CLIENT_COMPONENT = _require2.CLIENT_COMPONENT;
    var CLIENT_EDGE_TO_CLIENT_OBJECT = _require2.CLIENT_EDGE_TO_CLIENT_OBJECT;
    var CLIENT_EXTENSION = _require2.CLIENT_EXTENSION;
    var CONDITION = _require2.CONDITION;
    var DEFER = _require2.DEFER;
    var FLIGHT_FIELD = _require2.FLIGHT_FIELD;
    var FRAGMENT_SPREAD = _require2.FRAGMENT_SPREAD;
    var INLINE_FRAGMENT = _require2.INLINE_FRAGMENT;
    var LINKED_FIELD = _require2.LINKED_FIELD;
    var LINKED_HANDLE = _require2.LINKED_HANDLE;
    var MODULE_IMPORT = _require2.MODULE_IMPORT;
    var RELAY_RESOLVER = _require2.RELAY_RESOLVER;
    var SCALAR_FIELD = _require2.SCALAR_FIELD;
    var SCALAR_HANDLE = _require2.SCALAR_HANDLE;
    var STREAM = _require2.STREAM;
    var TYPE_DISCRIMINATOR = _require2.TYPE_DISCRIMINATOR;
    var RelayFeatureFlags = require_RelayFeatureFlags();
    var _require3 = require_ClientID();
    var generateClientID = _require3.generateClientID;
    var isClientID = _require3.isClientID;
    var _require4 = require_RelayConcreteVariables();
    var getLocalVariables = _require4.getLocalVariables;
    var RelayModernRecord = require_RelayModernRecord();
    var _require5 = require_RelayModernSelector();
    var createNormalizationSelector = _require5.createNormalizationSelector;
    var _require6 = require_RelayStoreReactFlightUtils();
    var REACT_FLIGHT_EXECUTABLE_DEFINITIONS_STORAGE_KEY = _require6.REACT_FLIGHT_EXECUTABLE_DEFINITIONS_STORAGE_KEY;
    var REACT_FLIGHT_TREE_STORAGE_KEY = _require6.REACT_FLIGHT_TREE_STORAGE_KEY;
    var REACT_FLIGHT_TYPE_NAME = _require6.REACT_FLIGHT_TYPE_NAME;
    var refineToReactFlightPayloadData = _require6.refineToReactFlightPayloadData;
    var _require7 = require_RelayStoreUtils();
    var ROOT_ID = _require7.ROOT_ID;
    var ROOT_TYPE = _require7.ROOT_TYPE;
    var TYPENAME_KEY = _require7.TYPENAME_KEY;
    var getArgumentValues = _require7.getArgumentValues;
    var getHandleStorageKey = _require7.getHandleStorageKey;
    var getModuleComponentKey = _require7.getModuleComponentKey;
    var getModuleOperationKey = _require7.getModuleOperationKey;
    var getStorageKey = _require7.getStorageKey;
    var _require8 = require_TypeID();
    var TYPE_SCHEMA_TYPE = _require8.TYPE_SCHEMA_TYPE;
    var generateTypeID = _require8.generateTypeID;
    var areEqual2 = require_areEqual();
    var invariant3 = require_browser();
    var warning2 = require_warning();
    function normalize3(recordSource, selector, response, options) {
      var dataID = selector.dataID, node56 = selector.node, variables = selector.variables;
      var normalizer = new RelayResponseNormalizer(recordSource, variables, options);
      return normalizer.normalizeResponse(node56, dataID, response);
    }
    var RelayResponseNormalizer = /* @__PURE__ */ function() {
      function RelayResponseNormalizer2(recordSource, variables, options) {
        this._actorIdentifier = options.actorIdentifier;
        this._getDataId = options.getDataID;
        this._handleFieldPayloads = [];
        this._treatMissingFieldsAsNull = options.treatMissingFieldsAsNull;
        this._incrementalPlaceholders = [];
        this._isClientExtension = false;
        this._isUnmatchedAbstractType = false;
        this._followupPayloads = [];
        this._path = options.path ? (0, _toConsumableArray22["default"])(options.path) : [];
        this._recordSource = recordSource;
        this._variables = variables;
        this._reactFlightPayloadDeserializer = options.reactFlightPayloadDeserializer;
        this._reactFlightServerErrorHandler = options.reactFlightServerErrorHandler;
        this._shouldProcessClientComponents = options.shouldProcessClientComponents;
      }
      var _proto = RelayResponseNormalizer2.prototype;
      _proto.normalizeResponse = function normalizeResponse(node56, dataID, data) {
        var record = this._recordSource.get(dataID);
        !record ? true ? invariant3(false, "RelayResponseNormalizer(): Expected root record `%s` to exist.", dataID) : invariant3(false) : void 0;
        this._assignClientAbstractTypes(node56);
        this._traverseSelections(node56, record, data);
        return {
          errors: null,
          fieldPayloads: this._handleFieldPayloads,
          incrementalPlaceholders: this._incrementalPlaceholders,
          followupPayloads: this._followupPayloads,
          source: this._recordSource,
          isFinal: false
        };
      };
      _proto._assignClientAbstractTypes = function _assignClientAbstractTypes(node56) {
        var clientAbstractTypes = node56.clientAbstractTypes;
        if (clientAbstractTypes != null) {
          for (var _i = 0, _Object$keys = Object.keys(clientAbstractTypes); _i < _Object$keys.length; _i++) {
            var abstractType = _Object$keys[_i];
            var _iterator = (0, _createForOfIteratorHelper2["default"])(clientAbstractTypes[abstractType]), _step;
            try {
              for (_iterator.s(); !(_step = _iterator.n()).done; ) {
                var concreteType = _step.value;
                var typeID = generateTypeID(concreteType);
                var typeRecord = this._recordSource.get(typeID);
                if (typeRecord == null) {
                  typeRecord = RelayModernRecord.create(typeID, TYPE_SCHEMA_TYPE);
                  this._recordSource.set(typeID, typeRecord);
                }
                RelayModernRecord.setValue(typeRecord, abstractType, true);
              }
            } catch (err) {
              _iterator.e(err);
            } finally {
              _iterator.f();
            }
          }
        }
      };
      _proto._getVariableValue = function _getVariableValue(name2) {
        !this._variables.hasOwnProperty(name2) ? true ? invariant3(false, "RelayResponseNormalizer(): Undefined variable `%s`.", name2) : invariant3(false) : void 0;
        return this._variables[name2];
      };
      _proto._getRecordType = function _getRecordType(data) {
        var typeName2 = data[TYPENAME_KEY];
        !(typeName2 != null) ? true ? invariant3(false, "RelayResponseNormalizer(): Expected a typename for record `%s`.", JSON.stringify(data, null, 2)) : invariant3(false) : void 0;
        return typeName2;
      };
      _proto._traverseSelections = function _traverseSelections(node56, record, data) {
        for (var i2 = 0; i2 < node56.selections.length; i2++) {
          var selection2 = node56.selections[i2];
          switch (selection2.kind) {
            case SCALAR_FIELD:
            case LINKED_FIELD:
              this._normalizeField(node56, selection2, record, data);
              break;
            case CONDITION:
              var conditionValue = Boolean(this._getVariableValue(selection2.condition));
              if (conditionValue === selection2.passingValue) {
                this._traverseSelections(selection2, record, data);
              }
              break;
            case FRAGMENT_SPREAD: {
              var prevVariables = this._variables;
              this._variables = getLocalVariables(this._variables, selection2.fragment.argumentDefinitions, selection2.args);
              this._traverseSelections(selection2.fragment, record, data);
              this._variables = prevVariables;
              break;
            }
            case INLINE_FRAGMENT: {
              var abstractKey = selection2.abstractKey;
              if (abstractKey == null) {
                var typeName2 = RelayModernRecord.getType(record);
                if (typeName2 === selection2.type) {
                  this._traverseSelections(selection2, record, data);
                }
              } else {
                var implementsInterface = data.hasOwnProperty(abstractKey);
                var _typeName = RelayModernRecord.getType(record);
                var typeID = generateTypeID(_typeName);
                var typeRecord = this._recordSource.get(typeID);
                if (typeRecord == null) {
                  typeRecord = RelayModernRecord.create(typeID, TYPE_SCHEMA_TYPE);
                  this._recordSource.set(typeID, typeRecord);
                }
                RelayModernRecord.setValue(typeRecord, abstractKey, implementsInterface);
                if (implementsInterface) {
                  this._traverseSelections(selection2, record, data);
                }
              }
              break;
            }
            case TYPE_DISCRIMINATOR: {
              var _abstractKey = selection2.abstractKey;
              var _implementsInterface = data.hasOwnProperty(_abstractKey);
              var _typeName2 = RelayModernRecord.getType(record);
              var _typeID = generateTypeID(_typeName2);
              var _typeRecord = this._recordSource.get(_typeID);
              if (_typeRecord == null) {
                _typeRecord = RelayModernRecord.create(_typeID, TYPE_SCHEMA_TYPE);
                this._recordSource.set(_typeID, _typeRecord);
              }
              RelayModernRecord.setValue(_typeRecord, _abstractKey, _implementsInterface);
              break;
            }
            case LINKED_HANDLE:
            case SCALAR_HANDLE:
              var args = selection2.args ? getArgumentValues(selection2.args, this._variables) : {};
              var fieldKey = getStorageKey(selection2, this._variables);
              var handleKey = getHandleStorageKey(selection2, this._variables);
              this._handleFieldPayloads.push({
                args,
                dataID: RelayModernRecord.getDataID(record),
                fieldKey,
                handle: selection2.handle,
                handleKey,
                handleArgs: selection2.handleArgs ? getArgumentValues(selection2.handleArgs, this._variables) : {}
              });
              break;
            case MODULE_IMPORT:
              this._normalizeModuleImport(node56, selection2, record, data);
              break;
            case DEFER:
              this._normalizeDefer(selection2, record, data);
              break;
            case STREAM:
              this._normalizeStream(selection2, record, data);
              break;
            case CLIENT_EXTENSION:
              var isClientExtension = this._isClientExtension;
              this._isClientExtension = true;
              this._traverseSelections(selection2, record, data);
              this._isClientExtension = isClientExtension;
              break;
            case CLIENT_COMPONENT:
              if (this._shouldProcessClientComponents === false) {
                break;
              }
              this._traverseSelections(selection2.fragment, record, data);
              break;
            case FLIGHT_FIELD:
              if (RelayFeatureFlags.ENABLE_REACT_FLIGHT_COMPONENT_FIELD) {
                this._normalizeFlightField(node56, selection2, record, data);
              } else {
                throw new Error("Flight fields are not yet supported.");
              }
              break;
            case ACTOR_CHANGE:
              this._normalizeActorChange(node56, selection2, record, data);
              break;
            case RELAY_RESOLVER:
              this._normalizeResolver(selection2, record, data);
              break;
            case CLIENT_EDGE_TO_CLIENT_OBJECT:
              this._normalizeResolver(selection2.backingField, record, data);
              break;
            default:
              selection2;
              true ? true ? invariant3(false, "RelayResponseNormalizer(): Unexpected ast kind `%s`.", selection2.kind) : invariant3(false) : void 0;
          }
        }
      };
      _proto._normalizeResolver = function _normalizeResolver(resolver, record, data) {
        if (resolver.fragment != null) {
          this._traverseSelections(resolver.fragment, record, data);
        }
      };
      _proto._normalizeDefer = function _normalizeDefer(defer2, record, data) {
        var isDeferred = defer2["if"] === null || this._getVariableValue(defer2["if"]);
        if (true) {
          true ? warning2(typeof isDeferred === "boolean", "RelayResponseNormalizer: Expected value for @defer `if` argument to be a boolean, got `%s`.", isDeferred) : void 0;
        }
        if (isDeferred === false) {
          this._traverseSelections(defer2, record, data);
        } else {
          this._incrementalPlaceholders.push({
            kind: "defer",
            data,
            label: defer2.label,
            path: (0, _toConsumableArray22["default"])(this._path),
            selector: createNormalizationSelector(defer2, RelayModernRecord.getDataID(record), this._variables),
            typeName: RelayModernRecord.getType(record),
            actorIdentifier: this._actorIdentifier
          });
        }
      };
      _proto._normalizeStream = function _normalizeStream(stream, record, data) {
        this._traverseSelections(stream, record, data);
        var isStreamed = stream["if"] === null || this._getVariableValue(stream["if"]);
        if (true) {
          true ? warning2(typeof isStreamed === "boolean", "RelayResponseNormalizer: Expected value for @stream `if` argument to be a boolean, got `%s`.", isStreamed) : void 0;
        }
        if (isStreamed === true) {
          this._incrementalPlaceholders.push({
            kind: "stream",
            label: stream.label,
            path: (0, _toConsumableArray22["default"])(this._path),
            parentID: RelayModernRecord.getDataID(record),
            node: stream,
            variables: this._variables,
            actorIdentifier: this._actorIdentifier
          });
        }
      };
      _proto._normalizeModuleImport = function _normalizeModuleImport(parent, moduleImport, record, data) {
        !(typeof data === "object" && data) ? true ? invariant3(false, "RelayResponseNormalizer: Expected data for @module to be an object.") : invariant3(false) : void 0;
        var typeName2 = RelayModernRecord.getType(record);
        var componentKey = getModuleComponentKey(moduleImport.documentName);
        var componentReference = moduleImport.componentModuleProvider || data[componentKey];
        RelayModernRecord.setValue(record, componentKey, componentReference !== null && componentReference !== void 0 ? componentReference : null);
        var operationKey = getModuleOperationKey(moduleImport.documentName);
        var operationReference = moduleImport.operationModuleProvider || data[operationKey];
        RelayModernRecord.setValue(record, operationKey, operationReference !== null && operationReference !== void 0 ? operationReference : null);
        if (operationReference != null) {
          this._followupPayloads.push({
            kind: "ModuleImportPayload",
            args: moduleImport.args,
            data,
            dataID: RelayModernRecord.getDataID(record),
            operationReference,
            path: (0, _toConsumableArray22["default"])(this._path),
            typeName: typeName2,
            variables: this._variables,
            actorIdentifier: this._actorIdentifier
          });
        }
      };
      _proto._normalizeField = function _normalizeField(parent, selection2, record, data) {
        !(typeof data === "object" && data) ? true ? invariant3(false, "writeField(): Expected data for field `%s` to be an object.", selection2.name) : invariant3(false) : void 0;
        var responseKey = selection2.alias || selection2.name;
        var storageKey = getStorageKey(selection2, this._variables);
        var fieldValue = data[responseKey];
        if (fieldValue == null) {
          if (fieldValue === void 0) {
            var isOptionalField = this._isClientExtension || this._isUnmatchedAbstractType;
            if (isOptionalField) {
              return;
            } else if (!this._treatMissingFieldsAsNull) {
              if (true) {
                true ? warning2(false, "RelayResponseNormalizer: Payload did not contain a value for field `%s: %s`. Check that you are parsing with the same query that was used to fetch the payload.", responseKey, storageKey) : void 0;
              }
              return;
            }
          }
          if (true) {
            if (selection2.kind === SCALAR_FIELD) {
              this._validateConflictingFieldsWithIdenticalId(
                record,
                storageKey,
                // When using `treatMissingFieldsAsNull` the conflicting validation raises a false positive
                // because the value is set using `null` but validated using `fieldValue` which at this point
                // will be `undefined`.
                // Setting this to `null` matches the value that we actually set to the `fieldValue`.
                null
              );
            }
          }
          RelayModernRecord.setValue(record, storageKey, null);
          return;
        }
        if (selection2.kind === SCALAR_FIELD) {
          if (true) {
            this._validateConflictingFieldsWithIdenticalId(record, storageKey, fieldValue);
          }
          RelayModernRecord.setValue(record, storageKey, fieldValue);
        } else if (selection2.kind === LINKED_FIELD) {
          this._path.push(responseKey);
          if (selection2.plural) {
            this._normalizePluralLink(selection2, record, storageKey, fieldValue);
          } else {
            this._normalizeLink(selection2, record, storageKey, fieldValue);
          }
          this._path.pop();
        } else {
          selection2;
          true ? true ? invariant3(false, "RelayResponseNormalizer(): Unexpected ast kind `%s` during normalization.", selection2.kind) : invariant3(false) : void 0;
        }
      };
      _proto._normalizeActorChange = function _normalizeActorChange(parent, selection2, record, data) {
        var _field$concreteType;
        var field = selection2.linkedField;
        !(typeof data === "object" && data) ? true ? invariant3(false, "_normalizeActorChange(): Expected data for field `%s` to be an object.", field.name) : invariant3(false) : void 0;
        var responseKey = field.alias || field.name;
        var storageKey = getStorageKey(field, this._variables);
        var fieldValue = data[responseKey];
        if (fieldValue == null) {
          if (fieldValue === void 0) {
            var isOptionalField = this._isClientExtension || this._isUnmatchedAbstractType;
            if (isOptionalField) {
              return;
            } else if (!this._treatMissingFieldsAsNull) {
              if (true) {
                true ? warning2(false, "RelayResponseNormalizer: Payload did not contain a value for field `%s: %s`. Check that you are parsing with the same query that was used to fetch the payload.", responseKey, storageKey) : void 0;
              }
              return;
            }
          }
          RelayModernRecord.setValue(record, storageKey, null);
          return;
        }
        var actorIdentifier = getActorIdentifierFromPayload(fieldValue);
        if (actorIdentifier == null) {
          if (true) {
            true ? warning2(false, "RelayResponseNormalizer: Payload did not contain a value for field `%s`. Check that you are parsing with the same query that was used to fetch the payload. Payload is `%s`.", ACTOR_IDENTIFIER_FIELD_NAME, JSON.stringify(fieldValue, null, 2)) : void 0;
          }
          RelayModernRecord.setValue(record, storageKey, null);
          return;
        }
        var typeName2 = (_field$concreteType = field.concreteType) !== null && _field$concreteType !== void 0 ? _field$concreteType : this._getRecordType(fieldValue);
        var nextID2 = this._getDataId(
          // $FlowFixMe[incompatible-call]
          fieldValue,
          typeName2
        ) || RelayModernRecord.getLinkedRecordID(record, storageKey) || generateClientID(RelayModernRecord.getDataID(record), storageKey);
        !(typeof nextID2 === "string") ? true ? invariant3(false, "RelayResponseNormalizer: Expected id on field `%s` to be a string.", storageKey) : invariant3(false) : void 0;
        RelayModernRecord.setActorLinkedRecordID(record, storageKey, actorIdentifier, nextID2);
        this._followupPayloads.push({
          kind: "ActorPayload",
          data: fieldValue,
          dataID: nextID2,
          path: [].concat((0, _toConsumableArray22["default"])(this._path), [responseKey]),
          typeName: typeName2,
          variables: this._variables,
          node: field,
          actorIdentifier
        });
      };
      _proto._normalizeFlightField = function _normalizeFlightField(parent, selection2, record, data) {
        var responseKey = selection2.alias || selection2.name;
        var storageKey = getStorageKey(selection2, this._variables);
        var fieldValue = data[responseKey];
        if (fieldValue == null) {
          if (fieldValue === void 0) {
            if (this._isUnmatchedAbstractType) {
              return;
            } else {
              !this._treatMissingFieldsAsNull ? true ? invariant3(false, "RelayResponseNormalizer: Payload did not contain a value for field `%s: %s`. Check that you are parsing with the same query that was used to fetch the payload.", responseKey, storageKey) : invariant3(false) : void 0;
            }
          }
          RelayModernRecord.setValue(record, storageKey, null);
          return;
        }
        var reactFlightPayload = refineToReactFlightPayloadData(fieldValue);
        var reactFlightPayloadDeserializer = this._reactFlightPayloadDeserializer;
        !(reactFlightPayload != null) ? true ? invariant3(false, "RelayResponseNormalizer: Expected React Flight payload data to be an object with `status`, tree`, `queries` and `errors` properties, got `%s`.", fieldValue) : invariant3(false) : void 0;
        !(typeof reactFlightPayloadDeserializer === "function") ? true ? invariant3(false, "RelayResponseNormalizer: Expected reactFlightPayloadDeserializer to be a function, got `%s`.", reactFlightPayloadDeserializer) : invariant3(false) : void 0;
        if (reactFlightPayload.errors.length > 0) {
          if (typeof this._reactFlightServerErrorHandler === "function") {
            this._reactFlightServerErrorHandler(reactFlightPayload.status, reactFlightPayload.errors);
          } else {
            true ? warning2(false, "RelayResponseNormalizer: Received server errors for field `%s`.\n\n%s\n%s", responseKey, reactFlightPayload.errors[0].message, reactFlightPayload.errors[0].stack) : void 0;
          }
        }
        var reactFlightID = generateClientID(RelayModernRecord.getDataID(record), getStorageKey(selection2, this._variables));
        var reactFlightClientResponseRecord = this._recordSource.get(reactFlightID);
        if (reactFlightClientResponseRecord == null) {
          reactFlightClientResponseRecord = RelayModernRecord.create(reactFlightID, REACT_FLIGHT_TYPE_NAME);
          this._recordSource.set(reactFlightID, reactFlightClientResponseRecord);
        }
        if (reactFlightPayload.tree == null) {
          true ? warning2(false, "RelayResponseNormalizer: Expected `tree` not to be null. This typically indicates that a fatal server error prevented any Server Component rows from being written.") : void 0;
          RelayModernRecord.setValue(reactFlightClientResponseRecord, REACT_FLIGHT_TREE_STORAGE_KEY, null);
          RelayModernRecord.setValue(reactFlightClientResponseRecord, REACT_FLIGHT_EXECUTABLE_DEFINITIONS_STORAGE_KEY, []);
          RelayModernRecord.setLinkedRecordID(record, storageKey, reactFlightID);
          return;
        }
        var reactFlightClientResponse = reactFlightPayloadDeserializer(reactFlightPayload.tree);
        RelayModernRecord.setValue(reactFlightClientResponseRecord, REACT_FLIGHT_TREE_STORAGE_KEY, reactFlightClientResponse);
        var reachableExecutableDefinitions = [];
        var _iterator2 = (0, _createForOfIteratorHelper2["default"])(reactFlightPayload.queries), _step2;
        try {
          for (_iterator2.s(); !(_step2 = _iterator2.n()).done; ) {
            var query2 = _step2.value;
            if (query2.response.data != null) {
              this._followupPayloads.push({
                kind: "ModuleImportPayload",
                args: null,
                data: query2.response.data,
                dataID: ROOT_ID,
                operationReference: query2.module,
                path: [],
                typeName: ROOT_TYPE,
                variables: query2.variables,
                actorIdentifier: this._actorIdentifier
              });
            }
            reachableExecutableDefinitions.push({
              module: query2.module,
              variables: query2.variables
            });
          }
        } catch (err) {
          _iterator2.e(err);
        } finally {
          _iterator2.f();
        }
        var _iterator3 = (0, _createForOfIteratorHelper2["default"])(reactFlightPayload.fragments), _step3;
        try {
          for (_iterator3.s(); !(_step3 = _iterator3.n()).done; ) {
            var fragment2 = _step3.value;
            if (fragment2.response.data != null) {
              this._followupPayloads.push({
                kind: "ModuleImportPayload",
                args: null,
                data: fragment2.response.data,
                dataID: fragment2.__id,
                operationReference: fragment2.module,
                path: [],
                typeName: fragment2.__typename,
                variables: fragment2.variables,
                actorIdentifier: this._actorIdentifier
              });
            }
            reachableExecutableDefinitions.push({
              module: fragment2.module,
              variables: fragment2.variables
            });
          }
        } catch (err) {
          _iterator3.e(err);
        } finally {
          _iterator3.f();
        }
        RelayModernRecord.setValue(reactFlightClientResponseRecord, REACT_FLIGHT_EXECUTABLE_DEFINITIONS_STORAGE_KEY, reachableExecutableDefinitions);
        RelayModernRecord.setLinkedRecordID(record, storageKey, reactFlightID);
      };
      _proto._normalizeLink = function _normalizeLink(field, record, storageKey, fieldValue) {
        var _field$concreteType2;
        !(typeof fieldValue === "object" && fieldValue) ? true ? invariant3(false, "RelayResponseNormalizer: Expected data for field `%s` to be an object.", storageKey) : invariant3(false) : void 0;
        var nextID2 = this._getDataId(
          // $FlowFixMe[incompatible-variance]
          fieldValue,
          // $FlowFixMe[incompatible-variance]
          (_field$concreteType2 = field.concreteType) !== null && _field$concreteType2 !== void 0 ? _field$concreteType2 : this._getRecordType(fieldValue)
        ) || // Reuse previously generated client IDs
        RelayModernRecord.getLinkedRecordID(record, storageKey) || generateClientID(RelayModernRecord.getDataID(record), storageKey);
        !(typeof nextID2 === "string") ? true ? invariant3(false, "RelayResponseNormalizer: Expected id on field `%s` to be a string.", storageKey) : invariant3(false) : void 0;
        if (true) {
          this._validateConflictingLinkedFieldsWithIdenticalId(record, RelayModernRecord.getLinkedRecordID(record, storageKey), nextID2, storageKey);
        }
        RelayModernRecord.setLinkedRecordID(record, storageKey, nextID2);
        var nextRecord = this._recordSource.get(nextID2);
        if (!nextRecord) {
          var typeName2 = field.concreteType || this._getRecordType(fieldValue);
          nextRecord = RelayModernRecord.create(nextID2, typeName2);
          this._recordSource.set(nextID2, nextRecord);
        } else if (true) {
          this._validateRecordType(nextRecord, field, fieldValue);
        }
        this._traverseSelections(field, nextRecord, fieldValue);
      };
      _proto._normalizePluralLink = function _normalizePluralLink(field, record, storageKey, fieldValue) {
        var _this = this;
        !Array.isArray(fieldValue) ? true ? invariant3(false, "RelayResponseNormalizer: Expected data for field `%s` to be an array of objects.", storageKey) : invariant3(false) : void 0;
        var prevIDs = RelayModernRecord.getLinkedRecordIDs(record, storageKey);
        var nextIDs = [];
        fieldValue.forEach(function(item, nextIndex) {
          var _field$concreteType3;
          if (item == null) {
            nextIDs.push(item);
            return;
          }
          _this._path.push(String(nextIndex));
          !(typeof item === "object") ? true ? invariant3(false, "RelayResponseNormalizer: Expected elements for field `%s` to be objects.", storageKey) : invariant3(false) : void 0;
          var nextID2 = _this._getDataId(
            // $FlowFixMe[incompatible-variance]
            item,
            // $FlowFixMe[incompatible-variance]
            (_field$concreteType3 = field.concreteType) !== null && _field$concreteType3 !== void 0 ? _field$concreteType3 : _this._getRecordType(item)
          ) || prevIDs && prevIDs[nextIndex] || // Reuse previously generated client IDs:
          generateClientID(RelayModernRecord.getDataID(record), storageKey, nextIndex);
          !(typeof nextID2 === "string") ? true ? invariant3(false, "RelayResponseNormalizer: Expected id of elements of field `%s` to be strings.", storageKey) : invariant3(false) : void 0;
          nextIDs.push(nextID2);
          var nextRecord = _this._recordSource.get(nextID2);
          if (!nextRecord) {
            var typeName2 = field.concreteType || _this._getRecordType(item);
            nextRecord = RelayModernRecord.create(nextID2, typeName2);
            _this._recordSource.set(nextID2, nextRecord);
          } else if (true) {
            _this._validateRecordType(nextRecord, field, item);
          }
          if (true) {
            if (prevIDs) {
              _this._validateConflictingLinkedFieldsWithIdenticalId(record, prevIDs[nextIndex], nextID2, storageKey);
            }
          }
          _this._traverseSelections(field, nextRecord, item);
          _this._path.pop();
        });
        RelayModernRecord.setLinkedRecordIDs(record, storageKey, nextIDs);
      };
      _proto._validateRecordType = function _validateRecordType(record, field, payload) {
        var _field$concreteType4;
        var typeName2 = (_field$concreteType4 = field.concreteType) !== null && _field$concreteType4 !== void 0 ? _field$concreteType4 : this._getRecordType(payload);
        var dataID = RelayModernRecord.getDataID(record);
        true ? warning2(isClientID(dataID) && dataID !== ROOT_ID || RelayModernRecord.getType(record) === typeName2, "RelayResponseNormalizer: Invalid record `%s`. Expected %s to be consistent, but the record was assigned conflicting types `%s` and `%s`. The GraphQL server likely violated the globally unique id requirement by returning the same id for different objects.", dataID, TYPENAME_KEY, RelayModernRecord.getType(record), typeName2) : void 0;
      };
      _proto._validateConflictingFieldsWithIdenticalId = function _validateConflictingFieldsWithIdenticalId(record, storageKey, fieldValue) {
        if (true) {
          var dataID = RelayModernRecord.getDataID(record);
          var previousValue = RelayModernRecord.getValue(record, storageKey);
          true ? warning2(storageKey === TYPENAME_KEY || previousValue === void 0 || areEqual2(previousValue, fieldValue), "RelayResponseNormalizer: Invalid record. The record contains two instances of the same id: `%s` with conflicting field, %s and its values: %s and %s. If two fields are different but share the same id, one field will overwrite the other.", dataID, storageKey, previousValue, fieldValue) : void 0;
        }
      };
      _proto._validateConflictingLinkedFieldsWithIdenticalId = function _validateConflictingLinkedFieldsWithIdenticalId(record, prevID, nextID2, storageKey) {
        if (true) {
          true ? warning2(prevID === void 0 || prevID === nextID2, "RelayResponseNormalizer: Invalid record. The record contains references to the conflicting field, %s and its id values: %s and %s. We need to make sure that the record the field points to remains consistent or one field will overwrite the other.", storageKey, prevID, nextID2) : void 0;
        }
      };
      return RelayResponseNormalizer2;
    }();
    module.exports = {
      normalize: normalize3
    };
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/store/OperationExecutor.js
var require_OperationExecutor = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/store/OperationExecutor.js"(exports, module) {
    "use strict";
    var _interopRequireDefault = require_interopRequireDefault()["default"];
    var _objectSpread210 = _interopRequireDefault(require_objectSpread2());
    var _createForOfIteratorHelper2 = _interopRequireDefault(require_createForOfIteratorHelper());
    var _defineProperty210 = _interopRequireDefault(require_defineProperty());
    var _toConsumableArray22 = _interopRequireDefault(require_toConsumableArray());
    var RelayObservable = require_RelayObservable();
    var generateID = require_generateID();
    var getOperation = require_getOperation();
    var RelayError = require_RelayError();
    var RelayFeatureFlags = require_RelayFeatureFlags();
    var stableCopy = require_stableCopy();
    var withDuration = require_withDuration();
    var _require = require_ClientID();
    var generateClientID = _require.generateClientID;
    var generateUniqueClientID = _require.generateUniqueClientID;
    var _require2 = require_RelayConcreteVariables();
    var getLocalVariables = _require2.getLocalVariables;
    var RelayModernRecord = require_RelayModernRecord();
    var _require3 = require_RelayModernSelector();
    var createNormalizationSelector = _require3.createNormalizationSelector;
    var createReaderSelector = _require3.createReaderSelector;
    var RelayRecordSource = require_RelayRecordSource();
    var RelayResponseNormalizer = require_RelayResponseNormalizer();
    var _require4 = require_RelayStoreUtils();
    var ROOT_TYPE = _require4.ROOT_TYPE;
    var TYPENAME_KEY = _require4.TYPENAME_KEY;
    var getStorageKey = _require4.getStorageKey;
    var invariant3 = require_browser();
    var warning2 = require_warning();
    function execute(config2) {
      return new Executor(config2);
    }
    var Executor = /* @__PURE__ */ function() {
      function Executor2(_ref22) {
        var _this = this;
        var actorIdentifier = _ref22.actorIdentifier, getDataID = _ref22.getDataID, getPublishQueue = _ref22.getPublishQueue, getStore = _ref22.getStore, isClientPayload = _ref22.isClientPayload, operation = _ref22.operation, operationExecutions = _ref22.operationExecutions, operationLoader = _ref22.operationLoader, operationTracker = _ref22.operationTracker, optimisticConfig = _ref22.optimisticConfig, _reactFlightPayloadDeserializer = _ref22.reactFlightPayloadDeserializer, reactFlightServerErrorHandler = _ref22.reactFlightServerErrorHandler, scheduler = _ref22.scheduler, shouldProcessClientComponents = _ref22.shouldProcessClientComponents, sink = _ref22.sink, source = _ref22.source, treatMissingFieldsAsNull = _ref22.treatMissingFieldsAsNull, updater = _ref22.updater, log2 = _ref22.log;
        (0, _defineProperty210["default"])(this, "_deserializeReactFlightPayloadWithLogging", function(tree) {
          var reactFlightPayloadDeserializer = _this._reactFlightPayloadDeserializer;
          !(typeof reactFlightPayloadDeserializer === "function") ? true ? invariant3(false, "OperationExecutor: Expected reactFlightPayloadDeserializer to be available when calling _deserializeReactFlightPayloadWithLogging.") : invariant3(false) : void 0;
          var _withDuration = withDuration(function() {
            return reactFlightPayloadDeserializer(tree);
          }), duration = _withDuration[0], result = _withDuration[1];
          _this._log({
            name: "execute.flight.payload_deserialize",
            executeId: _this._executeId,
            operationName: _this._operation.request.node.params.name,
            duration
          });
          return result;
        });
        this._actorIdentifier = actorIdentifier;
        this._getDataID = getDataID;
        this._treatMissingFieldsAsNull = treatMissingFieldsAsNull;
        this._incrementalPayloadsPending = false;
        this._incrementalResults = /* @__PURE__ */ new Map();
        this._log = log2;
        this._executeId = generateID();
        this._nextSubscriptionId = 0;
        this._operation = operation;
        this._operationExecutions = operationExecutions;
        this._operationLoader = operationLoader;
        this._operationTracker = operationTracker;
        this._operationUpdateEpochs = /* @__PURE__ */ new Map();
        this._optimisticUpdates = null;
        this._pendingModulePayloadsCount = 0;
        this._getPublishQueue = getPublishQueue;
        this._scheduler = scheduler;
        this._sink = sink;
        this._source = /* @__PURE__ */ new Map();
        this._state = "started";
        this._getStore = getStore;
        this._subscriptions = /* @__PURE__ */ new Map();
        this._updater = updater;
        this._isClientPayload = isClientPayload === true;
        this._reactFlightPayloadDeserializer = _reactFlightPayloadDeserializer;
        this._reactFlightServerErrorHandler = reactFlightServerErrorHandler;
        this._isSubscriptionOperation = this._operation.request.node.params.operationKind === "subscription";
        this._shouldProcessClientComponents = shouldProcessClientComponents;
        this._retainDisposables = /* @__PURE__ */ new Map();
        this._seenActors = /* @__PURE__ */ new Set();
        this._completeFns = [];
        var id2 = this._nextSubscriptionId++;
        source.subscribe({
          complete: function complete() {
            return _this._complete(id2);
          },
          error: function error(_error2) {
            return _this._error(_error2);
          },
          next: function next2(response) {
            try {
              _this._next(id2, response);
            } catch (error) {
              sink.error(error);
            }
          },
          start: function start(subscription2) {
            var _this$_operation$requ;
            _this._start(id2, subscription2);
            _this._log({
              name: "execute.start",
              executeId: _this._executeId,
              params: _this._operation.request.node.params,
              variables: _this._operation.request.variables,
              cacheConfig: (_this$_operation$requ = _this._operation.request.cacheConfig) !== null && _this$_operation$requ !== void 0 ? _this$_operation$requ : {}
            });
          }
        });
        if (optimisticConfig != null) {
          this._processOptimisticResponse(optimisticConfig.response != null ? {
            data: optimisticConfig.response
          } : null, optimisticConfig.updater, false);
        }
      }
      var _proto = Executor2.prototype;
      _proto.cancel = function cancel() {
        var _this2 = this;
        if (this._state === "completed") {
          return;
        }
        this._state = "completed";
        this._operationExecutions["delete"](this._operation.request.identifier);
        if (this._subscriptions.size !== 0) {
          this._subscriptions.forEach(function(sub) {
            return sub.unsubscribe();
          });
          this._subscriptions.clear();
        }
        var optimisticUpdates = this._optimisticUpdates;
        if (optimisticUpdates !== null) {
          this._optimisticUpdates = null;
          optimisticUpdates.forEach(function(update) {
            return _this2._getPublishQueueAndSaveActor().revertUpdate(update);
          });
          this._runPublishQueue();
        }
        this._incrementalResults.clear();
        if (this._asyncStoreUpdateDisposable != null) {
          this._asyncStoreUpdateDisposable.dispose();
          this._asyncStoreUpdateDisposable = null;
        }
        this._completeFns = [];
        this._completeOperationTracker();
        this._disposeRetainedData();
      };
      _proto._updateActiveState = function _updateActiveState() {
        var activeState;
        switch (this._state) {
          case "started": {
            activeState = "active";
            break;
          }
          case "loading_incremental": {
            activeState = "active";
            break;
          }
          case "completed": {
            activeState = "inactive";
            break;
          }
          case "loading_final": {
            activeState = this._pendingModulePayloadsCount > 0 ? "active" : "inactive";
            break;
          }
          default:
            this._state;
            true ? true ? invariant3(false, "OperationExecutor: invalid executor state.") : invariant3(false) : void 0;
        }
        this._operationExecutions.set(this._operation.request.identifier, activeState);
      };
      _proto._schedule = function _schedule(task) {
        var _this3 = this;
        var scheduler = this._scheduler;
        if (scheduler != null) {
          var id2 = this._nextSubscriptionId++;
          RelayObservable.create(function(sink) {
            var cancellationToken = scheduler.schedule(function() {
              try {
                task();
                sink.complete();
              } catch (error) {
                sink.error(error);
              }
            });
            return function() {
              return scheduler.cancel(cancellationToken);
            };
          }).subscribe({
            complete: function complete() {
              return _this3._complete(id2);
            },
            error: function error(_error3) {
              return _this3._error(_error3);
            },
            start: function start(subscription2) {
              return _this3._start(id2, subscription2);
            }
          });
        } else {
          task();
        }
      };
      _proto._complete = function _complete(id2) {
        this._subscriptions["delete"](id2);
        if (this._subscriptions.size === 0) {
          this.cancel();
          this._sink.complete();
          this._log({
            name: "execute.complete",
            executeId: this._executeId
          });
        }
      };
      _proto._error = function _error(error) {
        this.cancel();
        this._sink.error(error);
        this._log({
          name: "execute.error",
          executeId: this._executeId,
          error
        });
      };
      _proto._start = function _start3(id2, subscription2) {
        this._subscriptions.set(id2, subscription2);
        this._updateActiveState();
      };
      _proto._next = function _next(_id2, response) {
        var _this4 = this;
        this._schedule(function() {
          var _withDuration2 = withDuration(function() {
            _this4._handleNext(response);
            _this4._maybeCompleteSubscriptionOperationTracking();
          }), duration = _withDuration2[0];
          _this4._log({
            name: "execute.next",
            executeId: _this4._executeId,
            response,
            duration
          });
        });
      };
      _proto._handleErrorResponse = function _handleErrorResponse(responses) {
        var _this5 = this;
        var results = [];
        responses.forEach(function(response) {
          if (response.data === null && response.extensions != null && !response.hasOwnProperty("errors")) {
            return;
          } else if (response.data == null) {
            var errors = response.hasOwnProperty("errors") && response.errors != null ? response.errors : null;
            var messages = errors ? errors.map(function(_ref32) {
              var message = _ref32.message;
              return message;
            }).join("\n") : "(No errors)";
            var error = RelayError.create("RelayNetwork", "No data returned for operation `" + _this5._operation.request.node.params.name + "`, got error(s):\n" + messages + "\n\nSee the error `source` property for more information.");
            error.source = {
              errors,
              operation: _this5._operation.request.node,
              variables: _this5._operation.request.variables
            };
            error.stack;
            throw error;
          } else {
            var responseWithData = response;
            results.push(responseWithData);
          }
        });
        return results;
      };
      _proto._handleOptimisticResponses = function _handleOptimisticResponses(responses) {
        var _response$extensions;
        if (responses.length > 1) {
          if (responses.some(function(responsePart) {
            var _responsePart$extensi;
            return ((_responsePart$extensi = responsePart.extensions) === null || _responsePart$extensi === void 0 ? void 0 : _responsePart$extensi.isOptimistic) === true;
          })) {
            true ? true ? invariant3(false, "OperationExecutor: Optimistic responses cannot be batched.") : invariant3(false) : void 0;
          }
          return false;
        }
        var response = responses[0];
        var isOptimistic = ((_response$extensions = response.extensions) === null || _response$extensions === void 0 ? void 0 : _response$extensions.isOptimistic) === true;
        if (isOptimistic && this._state !== "started") {
          true ? true ? invariant3(false, "OperationExecutor: optimistic payload received after server payload.") : invariant3(false) : void 0;
        }
        if (isOptimistic) {
          this._processOptimisticResponse(response, null, this._treatMissingFieldsAsNull);
          this._sink.next(response);
          return true;
        }
        return false;
      };
      _proto._handleNext = function _handleNext(response) {
        if (this._state === "completed") {
          return;
        }
        this._seenActors.clear();
        var responses = Array.isArray(response) ? response : [response];
        var responsesWithData = this._handleErrorResponse(responses);
        if (responsesWithData.length === 0) {
          var isFinal = responses.some(function(x2) {
            var _x$extensions;
            return ((_x$extensions = x2.extensions) === null || _x$extensions === void 0 ? void 0 : _x$extensions.is_final) === true;
          });
          if (isFinal) {
            this._state = "loading_final";
            this._updateActiveState();
            this._incrementalPayloadsPending = false;
          }
          this._sink.next(response);
          return;
        }
        var isOptimistic = this._handleOptimisticResponses(responsesWithData);
        if (isOptimistic) {
          return;
        }
        var _partitionGraphQLResp = partitionGraphQLResponses(responsesWithData), nonIncrementalResponses = _partitionGraphQLResp[0], incrementalResponses = _partitionGraphQLResp[1];
        var hasNonIncrementalResponses = nonIncrementalResponses.length > 0;
        if (hasNonIncrementalResponses) {
          if (this._isSubscriptionOperation) {
            var nextID2 = generateUniqueClientID();
            this._operation = {
              request: this._operation.request,
              fragment: createReaderSelector(this._operation.fragment.node, nextID2, this._operation.fragment.variables, this._operation.fragment.owner),
              root: createNormalizationSelector(this._operation.root.node, nextID2, this._operation.root.variables)
            };
          }
          var payloadFollowups = this._processResponses(nonIncrementalResponses);
          this._processPayloadFollowups(payloadFollowups);
        }
        if (incrementalResponses.length > 0) {
          var _payloadFollowups = this._processIncrementalResponses(incrementalResponses);
          this._processPayloadFollowups(_payloadFollowups);
        }
        if (this._isSubscriptionOperation) {
          if (responsesWithData[0].extensions == null) {
            responsesWithData[0].extensions = {
              __relay_subscription_root_id: this._operation.fragment.dataID
            };
          } else {
            responsesWithData[0].extensions.__relay_subscription_root_id = this._operation.fragment.dataID;
          }
        }
        var updatedOwners = this._runPublishQueue(hasNonIncrementalResponses ? this._operation : void 0);
        if (hasNonIncrementalResponses) {
          if (this._incrementalPayloadsPending) {
            this._retainData();
          }
        }
        this._updateOperationTracker(updatedOwners);
        this._sink.next(response);
      };
      _proto._processOptimisticResponse = function _processOptimisticResponse(response, updater, treatMissingFieldsAsNull) {
        var _this6 = this;
        !(this._optimisticUpdates === null) ? true ? invariant3(false, "OperationExecutor: environment.execute: only support one optimistic response per execute.") : invariant3(false) : void 0;
        if (response == null && updater == null) {
          return;
        }
        var optimisticUpdates = [];
        if (response) {
          var payload = normalizeResponse(response, this._operation.root, ROOT_TYPE, {
            actorIdentifier: this._actorIdentifier,
            getDataID: this._getDataID,
            path: [],
            reactFlightPayloadDeserializer: this._reactFlightPayloadDeserializer != null ? this._deserializeReactFlightPayloadWithLogging : null,
            reactFlightServerErrorHandler: this._reactFlightServerErrorHandler,
            shouldProcessClientComponents: this._shouldProcessClientComponents,
            treatMissingFieldsAsNull
          });
          validateOptimisticResponsePayload(payload);
          optimisticUpdates.push({
            operation: this._operation,
            payload,
            updater
          });
          this._processOptimisticFollowups(payload, optimisticUpdates);
        } else if (updater) {
          optimisticUpdates.push({
            operation: this._operation,
            payload: {
              errors: null,
              fieldPayloads: null,
              incrementalPlaceholders: null,
              followupPayloads: null,
              source: RelayRecordSource.create(),
              isFinal: false
            },
            updater
          });
        }
        this._optimisticUpdates = optimisticUpdates;
        optimisticUpdates.forEach(function(update) {
          return _this6._getPublishQueueAndSaveActor().applyUpdate(update);
        });
        this._runPublishQueue();
      };
      _proto._processOptimisticFollowups = function _processOptimisticFollowups(payload, optimisticUpdates) {
        if (payload.followupPayloads && payload.followupPayloads.length) {
          var followupPayloads = payload.followupPayloads;
          var _iterator = (0, _createForOfIteratorHelper2["default"])(followupPayloads), _step;
          try {
            for (_iterator.s(); !(_step = _iterator.n()).done; ) {
              var followupPayload = _step.value;
              switch (followupPayload.kind) {
                case "ModuleImportPayload":
                  var operationLoader = this._expectOperationLoader();
                  var operation = operationLoader.get(followupPayload.operationReference);
                  if (operation == null) {
                    this._processAsyncOptimisticModuleImport(followupPayload);
                  } else {
                    var moduleImportOptimisticUpdates = this._processOptimisticModuleImport(operation, followupPayload);
                    optimisticUpdates.push.apply(optimisticUpdates, (0, _toConsumableArray22["default"])(moduleImportOptimisticUpdates));
                  }
                  break;
                case "ActorPayload":
                  true ? warning2(false, "OperationExecutor: Unexpected optimistic ActorPayload. These updates are not supported.") : void 0;
                  break;
                default:
                  followupPayload;
                  true ? true ? invariant3(false, "OperationExecutor: Unexpected followup kind `%s`. when processing optimistic updates.", followupPayload.kind) : invariant3(false) : void 0;
              }
            }
          } catch (err) {
            _iterator.e(err);
          } finally {
            _iterator.f();
          }
        }
      };
      _proto._normalizeFollowupPayload = function _normalizeFollowupPayload(followupPayload, normalizationNode) {
        var variables;
        if (normalizationNode.kind === "SplitOperation" && followupPayload.kind === "ModuleImportPayload") {
          variables = getLocalVariables(followupPayload.variables, normalizationNode.argumentDefinitions, followupPayload.args);
        } else {
          variables = followupPayload.variables;
        }
        var selector = createNormalizationSelector(normalizationNode, followupPayload.dataID, variables);
        return normalizeResponse({
          data: followupPayload.data
        }, selector, followupPayload.typeName, {
          actorIdentifier: this._actorIdentifier,
          getDataID: this._getDataID,
          path: followupPayload.path,
          reactFlightPayloadDeserializer: this._reactFlightPayloadDeserializer != null ? this._deserializeReactFlightPayloadWithLogging : null,
          reactFlightServerErrorHandler: this._reactFlightServerErrorHandler,
          treatMissingFieldsAsNull: this._treatMissingFieldsAsNull,
          shouldProcessClientComponents: this._shouldProcessClientComponents
        });
      };
      _proto._processOptimisticModuleImport = function _processOptimisticModuleImport(normalizationRootNode, moduleImportPayload) {
        var operation = getOperation(normalizationRootNode);
        var optimisticUpdates = [];
        var modulePayload = this._normalizeFollowupPayload(moduleImportPayload, operation);
        validateOptimisticResponsePayload(modulePayload);
        optimisticUpdates.push({
          operation: this._operation,
          payload: modulePayload,
          updater: null
        });
        this._processOptimisticFollowups(modulePayload, optimisticUpdates);
        return optimisticUpdates;
      };
      _proto._processAsyncOptimisticModuleImport = function _processAsyncOptimisticModuleImport(moduleImportPayload) {
        var _this7 = this;
        this._expectOperationLoader().load(moduleImportPayload.operationReference).then(function(operation) {
          if (operation == null || _this7._state !== "started") {
            return;
          }
          var moduleImportOptimisticUpdates = _this7._processOptimisticModuleImport(operation, moduleImportPayload);
          moduleImportOptimisticUpdates.forEach(function(update) {
            return _this7._getPublishQueueAndSaveActor().applyUpdate(update);
          });
          if (_this7._optimisticUpdates == null) {
            true ? warning2(false, "OperationExecutor: Unexpected ModuleImport optimistic update in operation %s." + _this7._operation.request.node.params.name) : void 0;
          } else {
            var _this$_optimisticUpda;
            (_this$_optimisticUpda = _this7._optimisticUpdates).push.apply(_this$_optimisticUpda, (0, _toConsumableArray22["default"])(moduleImportOptimisticUpdates));
            _this7._runPublishQueue();
          }
        });
      };
      _proto._processResponses = function _processResponses(responses) {
        var _this8 = this;
        if (this._optimisticUpdates !== null) {
          this._optimisticUpdates.forEach(function(update) {
            _this8._getPublishQueueAndSaveActor().revertUpdate(update);
          });
          this._optimisticUpdates = null;
        }
        this._incrementalPayloadsPending = false;
        this._incrementalResults.clear();
        this._source.clear();
        return responses.map(function(payloadPart) {
          var relayPayload = normalizeResponse(payloadPart, _this8._operation.root, ROOT_TYPE, {
            actorIdentifier: _this8._actorIdentifier,
            getDataID: _this8._getDataID,
            path: [],
            reactFlightPayloadDeserializer: _this8._reactFlightPayloadDeserializer != null ? _this8._deserializeReactFlightPayloadWithLogging : null,
            reactFlightServerErrorHandler: _this8._reactFlightServerErrorHandler,
            treatMissingFieldsAsNull: _this8._treatMissingFieldsAsNull,
            shouldProcessClientComponents: _this8._shouldProcessClientComponents
          });
          _this8._getPublishQueueAndSaveActor().commitPayload(_this8._operation, relayPayload, _this8._updater);
          return relayPayload;
        });
      };
      _proto._processPayloadFollowups = function _processPayloadFollowups(payloads) {
        var _this9 = this;
        if (this._state === "completed") {
          return;
        }
        payloads.forEach(function(payload) {
          var incrementalPlaceholders = payload.incrementalPlaceholders, followupPayloads = payload.followupPayloads, isFinal = payload.isFinal;
          _this9._state = isFinal ? "loading_final" : "loading_incremental";
          _this9._updateActiveState();
          if (isFinal) {
            _this9._incrementalPayloadsPending = false;
          }
          if (followupPayloads && followupPayloads.length !== 0) {
            followupPayloads.forEach(function(followupPayload) {
              var _followupPayload$acto;
              var prevActorIdentifier = _this9._actorIdentifier;
              _this9._actorIdentifier = (_followupPayload$acto = followupPayload.actorIdentifier) !== null && _followupPayload$acto !== void 0 ? _followupPayload$acto : _this9._actorIdentifier;
              _this9._processFollowupPayload(followupPayload);
              _this9._actorIdentifier = prevActorIdentifier;
            });
          }
          if (incrementalPlaceholders && incrementalPlaceholders.length !== 0) {
            _this9._incrementalPayloadsPending = _this9._state !== "loading_final";
            incrementalPlaceholders.forEach(function(incrementalPlaceholder) {
              var _incrementalPlacehold;
              var prevActorIdentifier = _this9._actorIdentifier;
              _this9._actorIdentifier = (_incrementalPlacehold = incrementalPlaceholder.actorIdentifier) !== null && _incrementalPlacehold !== void 0 ? _incrementalPlacehold : _this9._actorIdentifier;
              _this9._processIncrementalPlaceholder(payload, incrementalPlaceholder);
              _this9._actorIdentifier = prevActorIdentifier;
            });
            if (_this9._isClientPayload || _this9._state === "loading_final") {
              true ? warning2(_this9._isClientPayload, "RelayModernEnvironment: Operation `%s` contains @defer/@stream directives but was executed in non-streaming mode. See https://fburl.com/relay-incremental-delivery-non-streaming-warning.", _this9._operation.request.node.params.name) : void 0;
              var relayPayloads = [];
              incrementalPlaceholders.forEach(function(placeholder2) {
                if (placeholder2.kind === "defer") {
                  relayPayloads.push(_this9._processDeferResponse(placeholder2.label, placeholder2.path, placeholder2, {
                    data: placeholder2.data
                  }));
                }
              });
              if (relayPayloads.length > 0) {
                _this9._processPayloadFollowups(relayPayloads);
              }
            }
          }
        });
      };
      _proto._maybeCompleteSubscriptionOperationTracking = function _maybeCompleteSubscriptionOperationTracking() {
        if (!this._isSubscriptionOperation) {
          return;
        }
        if (this._pendingModulePayloadsCount === 0 && this._incrementalPayloadsPending === false) {
          this._completeOperationTracker();
        }
      };
      _proto._processFollowupPayload = function _processFollowupPayload(followupPayload) {
        var _this10 = this;
        switch (followupPayload.kind) {
          case "ModuleImportPayload":
            var operationLoader = this._expectOperationLoader();
            var node56 = operationLoader.get(followupPayload.operationReference);
            if (node56 != null) {
              this._processFollowupPayloadWithNormalizationNode(followupPayload, getOperation(node56));
            } else {
              var id2 = this._nextSubscriptionId++;
              this._pendingModulePayloadsCount++;
              var decrementPendingCount = function decrementPendingCount2() {
                _this10._pendingModulePayloadsCount--;
                _this10._maybeCompleteSubscriptionOperationTracking();
              };
              var networkObservable = RelayObservable.from(new Promise(function(resolve2, reject) {
                operationLoader.load(followupPayload.operationReference).then(resolve2, reject);
              }));
              RelayObservable.create(function(sink) {
                var cancellationToken;
                var subscription2 = networkObservable.subscribe({
                  next: function next2(loadedNode) {
                    if (loadedNode != null) {
                      var publishModuleImportPayload = function publishModuleImportPayload2() {
                        try {
                          var operation = getOperation(loadedNode);
                          var batchAsyncModuleUpdatesFN = RelayFeatureFlags.BATCH_ASYNC_MODULE_UPDATES_FN;
                          var shouldScheduleAsyncStoreUpdate = batchAsyncModuleUpdatesFN != null && _this10._pendingModulePayloadsCount > 1;
                          var _withDuration3 = withDuration(function() {
                            _this10._handleFollowupPayload(followupPayload, operation);
                            if (shouldScheduleAsyncStoreUpdate) {
                              _this10._scheduleAsyncStoreUpdate(
                                // $FlowFixMe[incompatible-call] `shouldScheduleAsyncStoreUpdate` check should cover `null` case
                                batchAsyncModuleUpdatesFN,
                                sink.complete
                              );
                            } else {
                              var updatedOwners = _this10._runPublishQueue();
                              _this10._updateOperationTracker(updatedOwners);
                            }
                          }), duration = _withDuration3[0];
                          _this10._log({
                            name: "execute.async.module",
                            executeId: _this10._executeId,
                            operationName: operation.name,
                            duration
                          });
                          if (!shouldScheduleAsyncStoreUpdate) {
                            sink.complete();
                          }
                        } catch (error) {
                          sink.error(error);
                        }
                      };
                      var scheduler = _this10._scheduler;
                      if (scheduler == null) {
                        publishModuleImportPayload();
                      } else {
                        cancellationToken = scheduler.schedule(publishModuleImportPayload);
                      }
                    } else {
                      sink.complete();
                    }
                  },
                  error: sink.error
                });
                return function() {
                  subscription2.unsubscribe();
                  if (_this10._scheduler != null && cancellationToken != null) {
                    _this10._scheduler.cancel(cancellationToken);
                  }
                };
              }).subscribe({
                complete: function complete() {
                  _this10._complete(id2);
                  decrementPendingCount();
                },
                error: function error(_error4) {
                  _this10._error(_error4);
                  decrementPendingCount();
                },
                start: function start(subscription2) {
                  return _this10._start(id2, subscription2);
                }
              });
            }
            break;
          case "ActorPayload":
            this._processFollowupPayloadWithNormalizationNode(followupPayload, followupPayload.node);
            break;
          default:
            followupPayload;
            true ? true ? invariant3(false, "OperationExecutor: Unexpected followup kind `%s`.", followupPayload.kind) : invariant3(false) : void 0;
        }
      };
      _proto._processFollowupPayloadWithNormalizationNode = function _processFollowupPayloadWithNormalizationNode(followupPayload, normalizationNode) {
        this._handleFollowupPayload(followupPayload, normalizationNode);
        this._maybeCompleteSubscriptionOperationTracking();
      };
      _proto._handleFollowupPayload = function _handleFollowupPayload(followupPayload, normalizationNode) {
        var relayPayload = this._normalizeFollowupPayload(followupPayload, normalizationNode);
        this._getPublishQueueAndSaveActor().commitPayload(this._operation, relayPayload);
        this._processPayloadFollowups([relayPayload]);
      };
      _proto._processIncrementalPlaceholder = function _processIncrementalPlaceholder(relayPayload, placeholder2) {
        var _relayPayload$fieldPa;
        var label = placeholder2.label, path2 = placeholder2.path;
        var pathKey = path2.map(String).join(".");
        var resultForLabel = this._incrementalResults.get(label);
        if (resultForLabel == null) {
          resultForLabel = /* @__PURE__ */ new Map();
          this._incrementalResults.set(label, resultForLabel);
        }
        var resultForPath = resultForLabel.get(pathKey);
        var pendingResponses = resultForPath != null && resultForPath.kind === "response" ? resultForPath.responses : null;
        resultForLabel.set(pathKey, {
          kind: "placeholder",
          placeholder: placeholder2
        });
        var parentID;
        if (placeholder2.kind === "stream") {
          parentID = placeholder2.parentID;
        } else if (placeholder2.kind === "defer") {
          parentID = placeholder2.selector.dataID;
        } else {
          placeholder2;
          true ? true ? invariant3(false, "OperationExecutor: Unsupported incremental placeholder kind `%s`.", placeholder2.kind) : invariant3(false) : void 0;
        }
        var parentRecord = relayPayload.source.get(parentID);
        var parentPayloads = ((_relayPayload$fieldPa = relayPayload.fieldPayloads) !== null && _relayPayload$fieldPa !== void 0 ? _relayPayload$fieldPa : []).filter(function(fieldPayload) {
          var fieldID = generateClientID(fieldPayload.dataID, fieldPayload.fieldKey);
          return (
            // handlers applied to the streamed field itself
            fieldPayload.dataID === parentID || // handlers applied to a field on an ancestor object, where
            // ancestor.field links to the parent record (example: connections)
            fieldID === parentID
          );
        });
        !(parentRecord != null) ? true ? invariant3(false, "OperationExecutor: Expected record `%s` to exist.", parentID) : invariant3(false) : void 0;
        var nextParentRecord;
        var nextParentPayloads;
        var previousParentEntry = this._source.get(parentID);
        if (previousParentEntry != null) {
          nextParentRecord = RelayModernRecord.update(previousParentEntry.record, parentRecord);
          var handlePayloads = /* @__PURE__ */ new Map();
          var dedupePayload = function dedupePayload2(payload) {
            var key = stableStringify(payload);
            handlePayloads.set(key, payload);
          };
          previousParentEntry.fieldPayloads.forEach(dedupePayload);
          parentPayloads.forEach(dedupePayload);
          nextParentPayloads = Array.from(handlePayloads.values());
        } else {
          nextParentRecord = parentRecord;
          nextParentPayloads = parentPayloads;
        }
        this._source.set(parentID, {
          record: nextParentRecord,
          fieldPayloads: nextParentPayloads
        });
        if (pendingResponses != null) {
          var payloadFollowups = this._processIncrementalResponses(pendingResponses);
          this._processPayloadFollowups(payloadFollowups);
        }
      };
      _proto._processIncrementalResponses = function _processIncrementalResponses(incrementalResponses) {
        var _this11 = this;
        var relayPayloads = [];
        incrementalResponses.forEach(function(incrementalResponse) {
          var label = incrementalResponse.label, path2 = incrementalResponse.path, response = incrementalResponse.response;
          var resultForLabel = _this11._incrementalResults.get(label);
          if (resultForLabel == null) {
            resultForLabel = /* @__PURE__ */ new Map();
            _this11._incrementalResults.set(label, resultForLabel);
          }
          if (label.indexOf("$defer$") !== -1) {
            var pathKey = path2.map(String).join(".");
            var resultForPath = resultForLabel.get(pathKey);
            if (resultForPath == null) {
              resultForPath = {
                kind: "response",
                responses: [incrementalResponse]
              };
              resultForLabel.set(pathKey, resultForPath);
              return;
            } else if (resultForPath.kind === "response") {
              resultForPath.responses.push(incrementalResponse);
              return;
            }
            var placeholder2 = resultForPath.placeholder;
            !(placeholder2.kind === "defer") ? true ? invariant3(false, "OperationExecutor: Expected data for path `%s` for label `%s` to be data for @defer, was `@%s`.", pathKey, label, placeholder2.kind) : invariant3(false) : void 0;
            relayPayloads.push(_this11._processDeferResponse(label, path2, placeholder2, response));
          } else {
            var _pathKey = path2.slice(0, -2).map(String).join(".");
            var _resultForPath = resultForLabel.get(_pathKey);
            if (_resultForPath == null) {
              _resultForPath = {
                kind: "response",
                responses: [incrementalResponse]
              };
              resultForLabel.set(_pathKey, _resultForPath);
              return;
            } else if (_resultForPath.kind === "response") {
              _resultForPath.responses.push(incrementalResponse);
              return;
            }
            var _placeholder = _resultForPath.placeholder;
            !(_placeholder.kind === "stream") ? true ? invariant3(false, "OperationExecutor: Expected data for path `%s` for label `%s` to be data for @stream, was `@%s`.", _pathKey, label, _placeholder.kind) : invariant3(false) : void 0;
            relayPayloads.push(_this11._processStreamResponse(label, path2, _placeholder, response));
          }
        });
        return relayPayloads;
      };
      _proto._processDeferResponse = function _processDeferResponse(label, path2, placeholder2, response) {
        var _placeholder$actorIde;
        var parentID = placeholder2.selector.dataID;
        var prevActorIdentifier = this._actorIdentifier;
        this._actorIdentifier = (_placeholder$actorIde = placeholder2.actorIdentifier) !== null && _placeholder$actorIde !== void 0 ? _placeholder$actorIde : this._actorIdentifier;
        var relayPayload = normalizeResponse(response, placeholder2.selector, placeholder2.typeName, {
          actorIdentifier: this._actorIdentifier,
          getDataID: this._getDataID,
          path: placeholder2.path,
          reactFlightPayloadDeserializer: this._reactFlightPayloadDeserializer != null ? this._deserializeReactFlightPayloadWithLogging : null,
          reactFlightServerErrorHandler: this._reactFlightServerErrorHandler,
          treatMissingFieldsAsNull: this._treatMissingFieldsAsNull,
          shouldProcessClientComponents: this._shouldProcessClientComponents
        });
        this._getPublishQueueAndSaveActor().commitPayload(this._operation, relayPayload);
        var parentEntry = this._source.get(parentID);
        !(parentEntry != null) ? true ? invariant3(false, "OperationExecutor: Expected the parent record `%s` for @defer data to exist.", parentID) : invariant3(false) : void 0;
        var fieldPayloads = parentEntry.fieldPayloads;
        if (fieldPayloads.length !== 0) {
          var _response$extensions2;
          var handleFieldsRelayPayload = {
            errors: null,
            fieldPayloads,
            incrementalPlaceholders: null,
            followupPayloads: null,
            source: RelayRecordSource.create(),
            isFinal: ((_response$extensions2 = response.extensions) === null || _response$extensions2 === void 0 ? void 0 : _response$extensions2.is_final) === true
          };
          this._getPublishQueueAndSaveActor().commitPayload(this._operation, handleFieldsRelayPayload);
        }
        this._actorIdentifier = prevActorIdentifier;
        return relayPayload;
      };
      _proto._processStreamResponse = function _processStreamResponse(label, path2, placeholder2, response) {
        var parentID = placeholder2.parentID, node56 = placeholder2.node, variables = placeholder2.variables, actorIdentifier = placeholder2.actorIdentifier;
        var prevActorIdentifier = this._actorIdentifier;
        this._actorIdentifier = actorIdentifier !== null && actorIdentifier !== void 0 ? actorIdentifier : this._actorIdentifier;
        var field = node56.selections[0];
        !(field != null && field.kind === "LinkedField" && field.plural === true) ? true ? invariant3(false, "OperationExecutor: Expected @stream to be used on a plural field.") : invariant3(false) : void 0;
        var _this$_normalizeStrea = this._normalizeStreamItem(response, parentID, field, variables, path2, placeholder2.path), fieldPayloads = _this$_normalizeStrea.fieldPayloads, itemID = _this$_normalizeStrea.itemID, itemIndex = _this$_normalizeStrea.itemIndex, prevIDs = _this$_normalizeStrea.prevIDs, relayPayload = _this$_normalizeStrea.relayPayload, storageKey = _this$_normalizeStrea.storageKey;
        this._getPublishQueueAndSaveActor().commitPayload(this._operation, relayPayload, function(store) {
          var currentParentRecord = store.get(parentID);
          if (currentParentRecord == null) {
            return;
          }
          var currentItems = currentParentRecord.getLinkedRecords(storageKey);
          if (currentItems == null) {
            return;
          }
          if (currentItems.length !== prevIDs.length || currentItems.some(function(currentItem, index) {
            return prevIDs[index] !== (currentItem && currentItem.getDataID());
          })) {
            return;
          }
          var nextItems = (0, _toConsumableArray22["default"])(currentItems);
          nextItems[itemIndex] = store.get(itemID);
          currentParentRecord.setLinkedRecords(nextItems, storageKey);
        });
        if (fieldPayloads.length !== 0) {
          var handleFieldsRelayPayload = {
            errors: null,
            fieldPayloads,
            incrementalPlaceholders: null,
            followupPayloads: null,
            source: RelayRecordSource.create(),
            isFinal: false
          };
          this._getPublishQueueAndSaveActor().commitPayload(this._operation, handleFieldsRelayPayload);
        }
        this._actorIdentifier = prevActorIdentifier;
        return relayPayload;
      };
      _proto._normalizeStreamItem = function _normalizeStreamItem(response, parentID, field, variables, path2, normalizationPath) {
        var _field$alias, _field$concreteType, _ref18, _this$_getDataID;
        var data = response.data;
        !(typeof data === "object") ? true ? invariant3(false, "OperationExecutor: Expected the GraphQL @stream payload `data` value to be an object.") : invariant3(false) : void 0;
        var responseKey = (_field$alias = field.alias) !== null && _field$alias !== void 0 ? _field$alias : field.name;
        var storageKey = getStorageKey(field, variables);
        var parentEntry = this._source.get(parentID);
        !(parentEntry != null) ? true ? invariant3(false, "OperationExecutor: Expected the parent record `%s` for @stream data to exist.", parentID) : invariant3(false) : void 0;
        var parentRecord = parentEntry.record, fieldPayloads = parentEntry.fieldPayloads;
        var prevIDs = RelayModernRecord.getLinkedRecordIDs(parentRecord, storageKey);
        !(prevIDs != null) ? true ? invariant3(false, "OperationExecutor: Expected record `%s` to have fetched field `%s` with @stream.", parentID, field.name) : invariant3(false) : void 0;
        var finalPathEntry = path2[path2.length - 1];
        var itemIndex = parseInt(finalPathEntry, 10);
        !(itemIndex === finalPathEntry && itemIndex >= 0) ? true ? invariant3(false, "OperationExecutor: Expected path for @stream to end in a positive integer index, got `%s`", finalPathEntry) : invariant3(false) : void 0;
        var typeName2 = (_field$concreteType = field.concreteType) !== null && _field$concreteType !== void 0 ? _field$concreteType : data[TYPENAME_KEY];
        !(typeof typeName2 === "string") ? true ? invariant3(false, "OperationExecutor: Expected @stream field `%s` to have a __typename.", field.name) : invariant3(false) : void 0;
        var itemID = (_ref18 = (_this$_getDataID = this._getDataID(data, typeName2)) !== null && _this$_getDataID !== void 0 ? _this$_getDataID : prevIDs === null || prevIDs === void 0 ? void 0 : prevIDs[itemIndex]) !== null && _ref18 !== void 0 ? _ref18 : (
          // Reuse previously generated client IDs
          generateClientID(parentID, storageKey, itemIndex)
        );
        !(typeof itemID === "string") ? true ? invariant3(false, "OperationExecutor: Expected id of elements of field `%s` to be strings.", storageKey) : invariant3(false) : void 0;
        var selector = createNormalizationSelector(field, itemID, variables);
        var nextParentRecord = RelayModernRecord.clone(parentRecord);
        var nextIDs = (0, _toConsumableArray22["default"])(prevIDs);
        nextIDs[itemIndex] = itemID;
        RelayModernRecord.setLinkedRecordIDs(nextParentRecord, storageKey, nextIDs);
        this._source.set(parentID, {
          record: nextParentRecord,
          fieldPayloads
        });
        var relayPayload = normalizeResponse(response, selector, typeName2, {
          actorIdentifier: this._actorIdentifier,
          getDataID: this._getDataID,
          path: [].concat((0, _toConsumableArray22["default"])(normalizationPath), [responseKey, String(itemIndex)]),
          reactFlightPayloadDeserializer: this._reactFlightPayloadDeserializer != null ? this._deserializeReactFlightPayloadWithLogging : null,
          reactFlightServerErrorHandler: this._reactFlightServerErrorHandler,
          treatMissingFieldsAsNull: this._treatMissingFieldsAsNull,
          shouldProcessClientComponents: this._shouldProcessClientComponents
        });
        return {
          fieldPayloads,
          itemID,
          itemIndex,
          prevIDs,
          relayPayload,
          storageKey
        };
      };
      _proto._scheduleAsyncStoreUpdate = function _scheduleAsyncStoreUpdate(scheduleFn, completeFn) {
        var _this12 = this;
        this._completeFns.push(completeFn);
        if (this._asyncStoreUpdateDisposable != null) {
          return;
        }
        this._asyncStoreUpdateDisposable = scheduleFn(function() {
          _this12._asyncStoreUpdateDisposable = null;
          var updatedOwners = _this12._runPublishQueue();
          _this12._updateOperationTracker(updatedOwners);
          var _iterator2 = (0, _createForOfIteratorHelper2["default"])(_this12._completeFns), _step2;
          try {
            for (_iterator2.s(); !(_step2 = _iterator2.n()).done; ) {
              var complete = _step2.value;
              complete();
            }
          } catch (err) {
            _iterator2.e(err);
          } finally {
            _iterator2.f();
          }
          _this12._completeFns = [];
        });
      };
      _proto._updateOperationTracker = function _updateOperationTracker(updatedOwners) {
        if (updatedOwners != null && updatedOwners.length > 0) {
          this._operationTracker.update(this._operation.request, new Set(updatedOwners));
        }
      };
      _proto._completeOperationTracker = function _completeOperationTracker() {
        this._operationTracker.complete(this._operation.request);
      };
      _proto._getPublishQueueAndSaveActor = function _getPublishQueueAndSaveActor() {
        this._seenActors.add(this._actorIdentifier);
        return this._getPublishQueue(this._actorIdentifier);
      };
      _proto._getActorsToVisit = function _getActorsToVisit() {
        if (this._seenActors.size === 0) {
          return /* @__PURE__ */ new Set([this._actorIdentifier]);
        } else {
          return this._seenActors;
        }
      };
      _proto._runPublishQueue = function _runPublishQueue(operation) {
        var updatedOwners = /* @__PURE__ */ new Set();
        var _iterator3 = (0, _createForOfIteratorHelper2["default"])(this._getActorsToVisit()), _step3;
        try {
          for (_iterator3.s(); !(_step3 = _iterator3.n()).done; ) {
            var actorIdentifier = _step3.value;
            var owners = this._getPublishQueue(actorIdentifier).run(operation);
            owners.forEach(function(owner) {
              return updatedOwners.add(owner);
            });
          }
        } catch (err) {
          _iterator3.e(err);
        } finally {
          _iterator3.f();
        }
        return Array.from(updatedOwners);
      };
      _proto._retainData = function _retainData() {
        var _iterator4 = (0, _createForOfIteratorHelper2["default"])(this._getActorsToVisit()), _step4;
        try {
          for (_iterator4.s(); !(_step4 = _iterator4.n()).done; ) {
            var actorIdentifier = _step4.value;
            if (!this._retainDisposables.has(actorIdentifier)) {
              this._retainDisposables.set(actorIdentifier, this._getStore(actorIdentifier).retain(this._operation));
            }
          }
        } catch (err) {
          _iterator4.e(err);
        } finally {
          _iterator4.f();
        }
      };
      _proto._disposeRetainedData = function _disposeRetainedData() {
        var _iterator5 = (0, _createForOfIteratorHelper2["default"])(this._retainDisposables.values()), _step5;
        try {
          for (_iterator5.s(); !(_step5 = _iterator5.n()).done; ) {
            var disposable = _step5.value;
            disposable.dispose();
          }
        } catch (err) {
          _iterator5.e(err);
        } finally {
          _iterator5.f();
        }
        this._retainDisposables.clear();
      };
      _proto._expectOperationLoader = function _expectOperationLoader() {
        var operationLoader = this._operationLoader;
        !operationLoader ? true ? invariant3(false, "OperationExecutor: Expected an operationLoader to be configured when using `@match`.") : invariant3(false) : void 0;
        return operationLoader;
      };
      return Executor2;
    }();
    function partitionGraphQLResponses(responses) {
      var nonIncrementalResponses = [];
      var incrementalResponses = [];
      responses.forEach(function(response) {
        if (response.path != null || response.label != null) {
          var label = response.label, path2 = response.path;
          if (label == null || path2 == null) {
            true ? true ? invariant3(false, "OperationExecutor: invalid incremental payload, expected `path` and `label` to either both be null/undefined, or `path` to be an `Array<string | number>` and `label` to be a `string`.") : invariant3(false) : void 0;
          }
          incrementalResponses.push({
            label,
            path: path2,
            response
          });
        } else {
          nonIncrementalResponses.push(response);
        }
      });
      return [nonIncrementalResponses, incrementalResponses];
    }
    function normalizeResponse(response, selector, typeName2, options) {
      var _response$extensions3;
      var data = response.data, errors = response.errors;
      var source = RelayRecordSource.create();
      var record = RelayModernRecord.create(selector.dataID, typeName2);
      source.set(selector.dataID, record);
      var relayPayload = RelayResponseNormalizer.normalize(source, selector, data, options);
      return (0, _objectSpread210["default"])((0, _objectSpread210["default"])({}, relayPayload), {}, {
        errors,
        isFinal: ((_response$extensions3 = response.extensions) === null || _response$extensions3 === void 0 ? void 0 : _response$extensions3.is_final) === true
      });
    }
    function stableStringify(value) {
      var _JSON$stringify;
      return (_JSON$stringify = JSON.stringify(stableCopy(value))) !== null && _JSON$stringify !== void 0 ? _JSON$stringify : "";
    }
    function validateOptimisticResponsePayload(payload) {
      var incrementalPlaceholders = payload.incrementalPlaceholders;
      if (incrementalPlaceholders != null && incrementalPlaceholders.length !== 0) {
        true ? true ? invariant3(false, "OperationExecutor: optimistic responses cannot be returned for operations that use incremental data delivery (@defer, @stream, and @stream_connection).") : invariant3(false) : void 0;
      }
    }
    module.exports = {
      execute
    };
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/mutations/RelayRecordSourceMutator.js
var require_RelayRecordSourceMutator = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/mutations/RelayRecordSourceMutator.js"(exports, module) {
    "use strict";
    var RelayModernRecord = require_RelayModernRecord();
    var _require = require_RelayRecordState();
    var EXISTENT = _require.EXISTENT;
    var invariant3 = require_browser();
    var RelayRecordSourceMutator = /* @__PURE__ */ function() {
      function RelayRecordSourceMutator2(base2, sink) {
        this.__sources = [sink, base2];
        this._base = base2;
        this._sink = sink;
      }
      var _proto = RelayRecordSourceMutator2.prototype;
      _proto.unstable_getRawRecordWithChanges = function unstable_getRawRecordWithChanges(dataID) {
        var baseRecord = this._base.get(dataID);
        var sinkRecord = this._sink.get(dataID);
        if (sinkRecord === void 0) {
          if (baseRecord == null) {
            return baseRecord;
          }
          var nextRecord = RelayModernRecord.clone(baseRecord);
          if (true) {
            RelayModernRecord.freeze(nextRecord);
          }
          return nextRecord;
        } else if (sinkRecord === null) {
          return null;
        } else if (baseRecord != null) {
          var _nextRecord = RelayModernRecord.update(baseRecord, sinkRecord);
          if (true) {
            if (_nextRecord !== baseRecord) {
              RelayModernRecord.freeze(_nextRecord);
            }
          }
          return _nextRecord;
        } else {
          var _nextRecord2 = RelayModernRecord.clone(sinkRecord);
          if (true) {
            RelayModernRecord.freeze(_nextRecord2);
          }
          return _nextRecord2;
        }
      };
      _proto._getSinkRecord = function _getSinkRecord(dataID) {
        var sinkRecord = this._sink.get(dataID);
        if (!sinkRecord) {
          var baseRecord = this._base.get(dataID);
          !baseRecord ? true ? invariant3(false, "RelayRecordSourceMutator: Cannot modify non-existent record `%s`.", dataID) : invariant3(false) : void 0;
          sinkRecord = RelayModernRecord.create(dataID, RelayModernRecord.getType(baseRecord));
          this._sink.set(dataID, sinkRecord);
        }
        return sinkRecord;
      };
      _proto.copyFields = function copyFields(sourceID, sinkID) {
        var sinkSource = this._sink.get(sourceID);
        var baseSource = this._base.get(sourceID);
        !(sinkSource || baseSource) ? true ? invariant3(false, "RelayRecordSourceMutator#copyFields(): Cannot copy fields from non-existent record `%s`.", sourceID) : invariant3(false) : void 0;
        var sink = this._getSinkRecord(sinkID);
        if (baseSource) {
          RelayModernRecord.copyFields(baseSource, sink);
        }
        if (sinkSource) {
          RelayModernRecord.copyFields(sinkSource, sink);
        }
      };
      _proto.copyFieldsFromRecord = function copyFieldsFromRecord(record, sinkID) {
        var sink = this._getSinkRecord(sinkID);
        RelayModernRecord.copyFields(record, sink);
      };
      _proto.create = function create4(dataID, typeName2) {
        !(this._base.getStatus(dataID) !== EXISTENT && this._sink.getStatus(dataID) !== EXISTENT) ? true ? invariant3(false, "RelayRecordSourceMutator#create(): Cannot create a record with id `%s`, this record already exists.", dataID) : invariant3(false) : void 0;
        var record = RelayModernRecord.create(dataID, typeName2);
        this._sink.set(dataID, record);
      };
      _proto["delete"] = function _delete(dataID) {
        this._sink["delete"](dataID);
      };
      _proto.getStatus = function getStatus(dataID) {
        return this._sink.has(dataID) ? this._sink.getStatus(dataID) : this._base.getStatus(dataID);
      };
      _proto.getType = function getType(dataID) {
        for (var ii = 0; ii < this.__sources.length; ii++) {
          var record = this.__sources[ii].get(dataID);
          if (record) {
            return RelayModernRecord.getType(record);
          } else if (record === null) {
            return null;
          }
        }
      };
      _proto.getValue = function getValue(dataID, storageKey) {
        for (var ii = 0; ii < this.__sources.length; ii++) {
          var record = this.__sources[ii].get(dataID);
          if (record) {
            var value = RelayModernRecord.getValue(record, storageKey);
            if (value !== void 0) {
              return value;
            }
          } else if (record === null) {
            return null;
          }
        }
      };
      _proto.setValue = function setValue(dataID, storageKey, value) {
        var sinkRecord = this._getSinkRecord(dataID);
        RelayModernRecord.setValue(sinkRecord, storageKey, value);
      };
      _proto.getLinkedRecordID = function getLinkedRecordID(dataID, storageKey) {
        for (var ii = 0; ii < this.__sources.length; ii++) {
          var record = this.__sources[ii].get(dataID);
          if (record) {
            var linkedID = RelayModernRecord.getLinkedRecordID(record, storageKey);
            if (linkedID !== void 0) {
              return linkedID;
            }
          } else if (record === null) {
            return null;
          }
        }
      };
      _proto.setLinkedRecordID = function setLinkedRecordID(dataID, storageKey, linkedID) {
        var sinkRecord = this._getSinkRecord(dataID);
        RelayModernRecord.setLinkedRecordID(sinkRecord, storageKey, linkedID);
      };
      _proto.getLinkedRecordIDs = function getLinkedRecordIDs(dataID, storageKey) {
        for (var ii = 0; ii < this.__sources.length; ii++) {
          var record = this.__sources[ii].get(dataID);
          if (record) {
            var linkedIDs = RelayModernRecord.getLinkedRecordIDs(record, storageKey);
            if (linkedIDs !== void 0) {
              return linkedIDs;
            }
          } else if (record === null) {
            return null;
          }
        }
      };
      _proto.setLinkedRecordIDs = function setLinkedRecordIDs(dataID, storageKey, linkedIDs) {
        var sinkRecord = this._getSinkRecord(dataID);
        RelayModernRecord.setLinkedRecordIDs(sinkRecord, storageKey, linkedIDs);
      };
      return RelayRecordSourceMutator2;
    }();
    module.exports = RelayRecordSourceMutator;
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/mutations/createUpdatableProxy.js
var require_createUpdatableProxy = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/mutations/createUpdatableProxy.js"(exports, module) {
    "use strict";
    var _interopRequireDefault = require_interopRequireDefault()["default"];
    var _createForOfIteratorHelper2 = _interopRequireDefault(require_createForOfIteratorHelper());
    var _require = require_RelayStoreUtils();
    var getArgumentValues = _require.getArgumentValues;
    var _require2 = require_RelayConcreteNode();
    var ACTOR_CHANGE = _require2.ACTOR_CHANGE;
    var ALIASED_FRAGMENT_SPREAD = _require2.ALIASED_FRAGMENT_SPREAD;
    var ALIASED_INLINE_FRAGMENT_SPREAD = _require2.ALIASED_INLINE_FRAGMENT_SPREAD;
    var CLIENT_EDGE_TO_CLIENT_OBJECT = _require2.CLIENT_EDGE_TO_CLIENT_OBJECT;
    var CLIENT_EDGE_TO_SERVER_OBJECT = _require2.CLIENT_EDGE_TO_SERVER_OBJECT;
    var CLIENT_EXTENSION = _require2.CLIENT_EXTENSION;
    var CONDITION = _require2.CONDITION;
    var DEFER = _require2.DEFER;
    var FLIGHT_FIELD = _require2.FLIGHT_FIELD;
    var FRAGMENT_SPREAD = _require2.FRAGMENT_SPREAD;
    var INLINE_DATA_FRAGMENT_SPREAD = _require2.INLINE_DATA_FRAGMENT_SPREAD;
    var INLINE_FRAGMENT = _require2.INLINE_FRAGMENT;
    var LINKED_FIELD = _require2.LINKED_FIELD;
    var MODULE_IMPORT = _require2.MODULE_IMPORT;
    var RELAY_LIVE_RESOLVER = _require2.RELAY_LIVE_RESOLVER;
    var RELAY_RESOLVER = _require2.RELAY_RESOLVER;
    var REQUIRED_FIELD = _require2.REQUIRED_FIELD;
    var SCALAR_FIELD = _require2.SCALAR_FIELD;
    var STREAM = _require2.STREAM;
    var nonUpdatableKeys = ["id", "__id", "__typename", "js"];
    function createUpdatableProxy(updatableProxyRootRecord, variables, selections, recordSourceProxy, missingFieldHandlers) {
      var mutableUpdatableProxy = {};
      updateProxyFromSelections(mutableUpdatableProxy, updatableProxyRootRecord, variables, selections, recordSourceProxy, missingFieldHandlers);
      if (true) {
        Object.freeze(mutableUpdatableProxy);
      }
      return mutableUpdatableProxy;
    }
    function updateProxyFromSelections(mutableUpdatableProxy, updatableProxyRootRecord, variables, selections, recordSourceProxy, missingFieldHandlers) {
      var _selection$alias3;
      var _iterator = (0, _createForOfIteratorHelper2["default"])(selections), _step;
      try {
        var _loop = function _loop2() {
          var selection2 = _step.value;
          switch (selection2.kind) {
            case LINKED_FIELD:
              if (selection2.plural) {
                Object.defineProperty(mutableUpdatableProxy, (_selection$alias = selection2.alias) !== null && _selection$alias !== void 0 ? _selection$alias : selection2.name, {
                  get: createGetterForPluralLinkedField(selection2, variables, updatableProxyRootRecord, recordSourceProxy, missingFieldHandlers),
                  set: createSetterForPluralLinkedField(selection2, variables, updatableProxyRootRecord, recordSourceProxy)
                });
              } else {
                Object.defineProperty(mutableUpdatableProxy, (_selection$alias2 = selection2.alias) !== null && _selection$alias2 !== void 0 ? _selection$alias2 : selection2.name, {
                  get: createGetterForSingularLinkedField(selection2, variables, updatableProxyRootRecord, recordSourceProxy, missingFieldHandlers),
                  set: createSetterForSingularLinkedField(selection2, variables, updatableProxyRootRecord, recordSourceProxy)
                });
              }
              break;
            case SCALAR_FIELD:
              var scalarFieldName = (_selection$alias3 = selection2.alias) !== null && _selection$alias3 !== void 0 ? _selection$alias3 : selection2.name;
              Object.defineProperty(mutableUpdatableProxy, scalarFieldName, {
                get: function get3() {
                  var _selection$args;
                  var newVariables = getArgumentValues((_selection$args = selection2.args) !== null && _selection$args !== void 0 ? _selection$args : [], variables);
                  var value = updatableProxyRootRecord.getValue(
                    selection2.name,
                    newVariables
                    // $FlowFixMe[unclear-type] Typed by the generated updatable query flow type
                  );
                  if (value == null) {
                    value = getScalarUsingMissingFieldHandlers(selection2, newVariables, updatableProxyRootRecord, recordSourceProxy, missingFieldHandlers);
                  }
                  return value;
                },
                set: nonUpdatableKeys.includes(selection2.name) ? void 0 : (
                  // $FlowFixMe[unclear-type] Typed by the generated updatable query flow type
                  function(newValue) {
                    var _selection$args2;
                    var newVariables = getArgumentValues((_selection$args2 = selection2.args) !== null && _selection$args2 !== void 0 ? _selection$args2 : [], variables);
                    updatableProxyRootRecord.setValue__UNSAFE(newValue, selection2.name, newVariables);
                  }
                )
              });
              break;
            case INLINE_FRAGMENT:
              if (updatableProxyRootRecord.getType() === selection2.type) {
                updateProxyFromSelections(mutableUpdatableProxy, updatableProxyRootRecord, variables, selection2.selections, recordSourceProxy, missingFieldHandlers);
              }
              break;
            case CLIENT_EXTENSION:
              updateProxyFromSelections(mutableUpdatableProxy, updatableProxyRootRecord, variables, selection2.selections, recordSourceProxy, missingFieldHandlers);
              break;
            case FRAGMENT_SPREAD:
              break;
            case CONDITION:
            case ACTOR_CHANGE:
            case ALIASED_FRAGMENT_SPREAD:
            case INLINE_DATA_FRAGMENT_SPREAD:
            case ALIASED_INLINE_FRAGMENT_SPREAD:
            case CLIENT_EDGE_TO_CLIENT_OBJECT:
            case CLIENT_EDGE_TO_SERVER_OBJECT:
            case DEFER:
            case FLIGHT_FIELD:
            case MODULE_IMPORT:
            case RELAY_LIVE_RESOLVER:
            case REQUIRED_FIELD:
            case STREAM:
            case RELAY_RESOLVER:
              throw new Error("Encountered an unexpected ReaderSelection variant in RelayRecordSourceProxy. This indicates a bug in Relay.");
            default:
              selection2.kind;
              throw new Error("Encountered an unexpected ReaderSelection variant in RelayRecordSourceProxy. This indicates a bug in Relay.");
          }
        };
        for (_iterator.s(); !(_step = _iterator.n()).done; ) {
          var _selection$alias;
          var _selection$alias2;
          _loop();
        }
      } catch (err) {
        _iterator.e(err);
      } finally {
        _iterator.f();
      }
    }
    function createSetterForPluralLinkedField(selection2, variables, updatableProxyRootRecord, recordSourceProxy) {
      return function set3(newValue) {
        var _selection$args3;
        var newVariables = getArgumentValues((_selection$args3 = selection2.args) !== null && _selection$args3 !== void 0 ? _selection$args3 : [], variables);
        if (newValue == null) {
          throw new Error("Do not assign null to plural linked fields; assign an empty array instead.");
        } else {
          var recordProxies = newValue.map(function(item) {
            if (item == null) {
              throw new Error("When assigning an array of items, none of the items should be null or undefined.");
            }
            var __id = item.__id;
            if (__id == null) {
              throw new Error("The __id field must be present on each item passed to the setter. This indicates a bug in Relay.");
            }
            var newValueRecord = recordSourceProxy.get(__id);
            if (newValueRecord == null) {
              throw new Error("Did not find item with data id ".concat(__id, " in the store."));
            }
            return newValueRecord;
          });
          updatableProxyRootRecord.setLinkedRecords(recordProxies, selection2.name, newVariables);
        }
      };
    }
    function createSetterForSingularLinkedField(selection2, variables, updatableProxyRootRecord, recordSourceProxy) {
      return function set3(newValue) {
        var _selection$args4;
        var newVariables = getArgumentValues((_selection$args4 = selection2.args) !== null && _selection$args4 !== void 0 ? _selection$args4 : [], variables);
        if (newValue == null) {
          updatableProxyRootRecord.setValue(newValue, selection2.name, newVariables);
        } else {
          var __id = newValue.__id;
          if (__id == null) {
            throw new Error("The __id field must be present on the argument. This indicates a bug in Relay.");
          }
          var newValueRecord = recordSourceProxy.get(__id);
          if (newValueRecord == null) {
            throw new Error("Did not find item with data id ".concat(__id, " in the store."));
          }
          updatableProxyRootRecord.setLinkedRecord(newValueRecord, selection2.name, newVariables);
        }
      };
    }
    function createGetterForPluralLinkedField(selection2, variables, updatableProxyRootRecord, recordSourceProxy, missingFieldHandlers) {
      return function() {
        var _selection$args5;
        var newVariables = getArgumentValues((_selection$args5 = selection2.args) !== null && _selection$args5 !== void 0 ? _selection$args5 : [], variables);
        var linkedRecords = updatableProxyRootRecord.getLinkedRecords(selection2.name, newVariables);
        if (linkedRecords === void 0) {
          linkedRecords = getPluralLinkedRecordUsingMissingFieldHandlers(selection2, newVariables, updatableProxyRootRecord, recordSourceProxy, missingFieldHandlers);
        }
        if (linkedRecords != null) {
          return linkedRecords.map(function(linkedRecord) {
            if (linkedRecord != null) {
              var updatableProxy = {};
              updateProxyFromSelections(updatableProxy, linkedRecord, variables, selection2.selections, recordSourceProxy, missingFieldHandlers);
              if (true) {
                Object.freeze(updatableProxy);
              }
              return updatableProxy;
            } else {
              return linkedRecord;
            }
          });
        } else {
          return linkedRecords;
        }
      };
    }
    function createGetterForSingularLinkedField(selection2, variables, updatableProxyRootRecord, recordSourceProxy, missingFieldHandlers) {
      return function() {
        var _selection$args6;
        var newVariables = getArgumentValues((_selection$args6 = selection2.args) !== null && _selection$args6 !== void 0 ? _selection$args6 : [], variables);
        var linkedRecord = updatableProxyRootRecord.getLinkedRecord(selection2.name, newVariables);
        if (linkedRecord === void 0) {
          linkedRecord = getLinkedRecordUsingMissingFieldHandlers(selection2, newVariables, updatableProxyRootRecord, recordSourceProxy, missingFieldHandlers);
        }
        if (linkedRecord != null) {
          var updatableProxy = {};
          updateProxyFromSelections(updatableProxy, linkedRecord, variables, selection2.selections, recordSourceProxy, missingFieldHandlers);
          if (true) {
            Object.freeze(updatableProxy);
          }
          return updatableProxy;
        } else {
          return linkedRecord;
        }
      };
    }
    function getLinkedRecordUsingMissingFieldHandlers(selection2, newVariables, updatableProxyRootRecord, recordSourceProxy, missingFieldHandlers) {
      var _iterator2 = (0, _createForOfIteratorHelper2["default"])(missingFieldHandlers), _step2;
      try {
        for (_iterator2.s(); !(_step2 = _iterator2.n()).done; ) {
          var handler = _step2.value;
          if (handler.kind === "linked") {
            var newId = handler.handle(selection2, updatableProxyRootRecord, newVariables, recordSourceProxy);
            if (newId != null) {
              return recordSourceProxy.get(newId);
            }
          }
        }
      } catch (err) {
        _iterator2.e(err);
      } finally {
        _iterator2.f();
      }
    }
    function getPluralLinkedRecordUsingMissingFieldHandlers(selection2, newVariables, updatableProxyRootRecord, recordSourceProxy, missingFieldHandlers) {
      var _iterator3 = (0, _createForOfIteratorHelper2["default"])(missingFieldHandlers), _step3;
      try {
        for (_iterator3.s(); !(_step3 = _iterator3.n()).done; ) {
          var handler = _step3.value;
          if (handler.kind === "pluralLinked") {
            var newIds = handler.handle(selection2, updatableProxyRootRecord, newVariables, recordSourceProxy);
            if (newIds != null) {
              return newIds.map(function(newId) {
                if (newId != null) {
                  return recordSourceProxy.get(newId);
                }
              });
            }
          }
        }
      } catch (err) {
        _iterator3.e(err);
      } finally {
        _iterator3.f();
      }
    }
    function getScalarUsingMissingFieldHandlers(selection2, newVariables, updatableProxyRootRecord, recordSourceProxy, missingFieldHandlers) {
      var _iterator4 = (0, _createForOfIteratorHelper2["default"])(missingFieldHandlers), _step4;
      try {
        for (_iterator4.s(); !(_step4 = _iterator4.n()).done; ) {
          var handler = _step4.value;
          if (handler.kind === "scalar") {
            var value = handler.handle(selection2, updatableProxyRootRecord, newVariables, recordSourceProxy);
            if (value !== void 0) {
              return value;
            }
          }
        }
      } catch (err) {
        _iterator4.e(err);
      } finally {
        _iterator4.f();
      }
    }
    module.exports = {
      createUpdatableProxy
    };
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/mutations/readUpdatableFragment.js
var require_readUpdatableFragment = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/mutations/readUpdatableFragment.js"(exports, module) {
    "use strict";
    var _require = require_GraphQLTag();
    var getFragment = _require.getFragment;
    var _require2 = require_RelayModernSelector();
    var getVariablesFromFragment = _require2.getVariablesFromFragment;
    var _require3 = require_RelayStoreUtils();
    var ID_KEY = _require3.ID_KEY;
    var _require4 = require_createUpdatableProxy();
    var createUpdatableProxy = _require4.createUpdatableProxy;
    var invariant3 = require_browser();
    function readUpdatableFragment(fragment2, fragmentReference, proxy, missingFieldHandlers) {
      var updatableFragment = getFragment(fragment2);
      var fragmentVariables = getVariablesFromFragment(updatableFragment, fragmentReference);
      var id2 = fragmentReference[ID_KEY];
      var fragmentRoot = proxy.get(id2);
      !(fragmentRoot != null) ? true ? invariant3(false, "No record with ".concat(id2, " was found. This likely indicates a problem with Relay.")) : invariant3(false) : void 0;
      return {
        // $FlowFixMe[incompatible-call]
        updatableData: createUpdatableProxy(fragmentRoot, fragmentVariables, updatableFragment.selections, proxy, missingFieldHandlers)
      };
    }
    module.exports = {
      readUpdatableFragment
    };
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/mutations/readUpdatableQuery.js
var require_readUpdatableQuery = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/mutations/readUpdatableQuery.js"(exports, module) {
    "use strict";
    var _require = require_GraphQLTag();
    var getUpdatableQuery = _require.getUpdatableQuery;
    var _require2 = require_createUpdatableProxy();
    var createUpdatableProxy = _require2.createUpdatableProxy;
    function readUpdatableQuery(query2, variables, proxy, missingFieldHandlers) {
      var updatableQuery = getUpdatableQuery(query2);
      return {
        // $FlowFixMe[incompatible-call]
        updatableData: createUpdatableProxy(proxy.getRoot(), variables, updatableQuery.fragment.selections, proxy, missingFieldHandlers)
      };
    }
    module.exports = {
      readUpdatableQuery
    };
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/mutations/RelayRecordProxy.js
var require_RelayRecordProxy = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/mutations/RelayRecordProxy.js"(exports, module) {
    "use strict";
    var _require = require_ClientID();
    var generateClientID = _require.generateClientID;
    var _require2 = require_RelayStoreUtils();
    var getStableStorageKey = _require2.getStableStorageKey;
    var invariant3 = require_browser();
    var RelayRecordProxy = /* @__PURE__ */ function() {
      function RelayRecordProxy2(source, mutator, dataID) {
        this._dataID = dataID;
        this._mutator = mutator;
        this._source = source;
      }
      var _proto = RelayRecordProxy2.prototype;
      _proto.copyFieldsFrom = function copyFieldsFrom(source) {
        this._mutator.copyFields(source.getDataID(), this._dataID);
      };
      _proto.getDataID = function getDataID() {
        return this._dataID;
      };
      _proto.getType = function getType() {
        var type = this._mutator.getType(this._dataID);
        !(type != null) ? true ? invariant3(false, "RelayRecordProxy: Cannot get the type of deleted record `%s`.", this._dataID) : invariant3(false) : void 0;
        return type;
      };
      _proto.getValue = function getValue(name2, args) {
        var storageKey = getStableStorageKey(name2, args);
        return this._mutator.getValue(this._dataID, storageKey);
      };
      _proto.setValue = function setValue(value, name2, args) {
        !isValidLeafValue(value) ? true ? invariant3(false, "RelayRecordProxy#setValue(): Expected a scalar or array of scalars, got `%s`.", JSON.stringify(value)) : invariant3(false) : void 0;
        return this.setValue__UNSAFE(value, name2, args);
      };
      _proto.setValue__UNSAFE = function setValue__UNSAFE(value, name2, args) {
        var storageKey = getStableStorageKey(name2, args);
        this._mutator.setValue(this._dataID, storageKey, value);
        return this;
      };
      _proto.getLinkedRecord = function getLinkedRecord(name2, args) {
        var storageKey = getStableStorageKey(name2, args);
        var linkedID = this._mutator.getLinkedRecordID(this._dataID, storageKey);
        return linkedID != null ? this._source.get(linkedID) : linkedID;
      };
      _proto.setLinkedRecord = function setLinkedRecord(record, name2, args) {
        !(record instanceof RelayRecordProxy2) ? true ? invariant3(false, "RelayRecordProxy#setLinkedRecord(): Expected a record, got `%s`.", record) : invariant3(false) : void 0;
        var storageKey = getStableStorageKey(name2, args);
        var linkedID = record.getDataID();
        this._mutator.setLinkedRecordID(this._dataID, storageKey, linkedID);
        return this;
      };
      _proto.getOrCreateLinkedRecord = function getOrCreateLinkedRecord(name2, typeName2, args) {
        var linkedRecord = this.getLinkedRecord(name2, args);
        if (!linkedRecord) {
          var _this$_source$get;
          var storageKey = getStableStorageKey(name2, args);
          var clientID = generateClientID(this.getDataID(), storageKey);
          linkedRecord = (_this$_source$get = this._source.get(clientID)) !== null && _this$_source$get !== void 0 ? _this$_source$get : this._source.create(clientID, typeName2);
          this.setLinkedRecord(linkedRecord, name2, args);
        }
        return linkedRecord;
      };
      _proto.getLinkedRecords = function getLinkedRecords(name2, args) {
        var _this = this;
        var storageKey = getStableStorageKey(name2, args);
        var linkedIDs = this._mutator.getLinkedRecordIDs(this._dataID, storageKey);
        if (linkedIDs == null) {
          return linkedIDs;
        }
        return linkedIDs.map(function(linkedID) {
          return linkedID != null ? _this._source.get(linkedID) : linkedID;
        });
      };
      _proto.setLinkedRecords = function setLinkedRecords(records, name2, args) {
        !Array.isArray(records) ? true ? invariant3(false, "RelayRecordProxy#setLinkedRecords(): Expected records to be an array, got `%s`.", records) : invariant3(false) : void 0;
        var storageKey = getStableStorageKey(name2, args);
        var linkedIDs = records.map(function(record) {
          return record && record.getDataID();
        });
        this._mutator.setLinkedRecordIDs(this._dataID, storageKey, linkedIDs);
        return this;
      };
      _proto.invalidateRecord = function invalidateRecord() {
        this._source.markIDForInvalidation(this._dataID);
      };
      return RelayRecordProxy2;
    }();
    function isValidLeafValue(value) {
      return value == null || typeof value !== "object" || Array.isArray(value) && value.every(isValidLeafValue);
    }
    module.exports = RelayRecordProxy;
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/mutations/RelayRecordSourceProxy.js
var require_RelayRecordSourceProxy = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/mutations/RelayRecordSourceProxy.js"(exports, module) {
    "use strict";
    var RelayModernRecord = require_RelayModernRecord();
    var _require = require_RelayRecordState();
    var EXISTENT = _require.EXISTENT;
    var NONEXISTENT = _require.NONEXISTENT;
    var _require2 = require_RelayStoreUtils();
    var ROOT_ID = _require2.ROOT_ID;
    var ROOT_TYPE = _require2.ROOT_TYPE;
    var _require3 = require_readUpdatableFragment();
    var _readUpdatableFragment = _require3.readUpdatableFragment;
    var _require4 = require_readUpdatableQuery();
    var _readUpdatableQuery = _require4.readUpdatableQuery;
    var RelayRecordProxy = require_RelayRecordProxy();
    var invariant3 = require_browser();
    var RelayRecordSourceProxy = /* @__PURE__ */ function() {
      function RelayRecordSourceProxy2(mutator, getDataID, handlerProvider, missingFieldHandlers) {
        this.__mutator = mutator;
        this._handlerProvider = handlerProvider || null;
        this._proxies = {};
        this._getDataID = getDataID;
        this._invalidatedStore = false;
        this._idsMarkedForInvalidation = /* @__PURE__ */ new Set();
        this._missingFieldHandlers = missingFieldHandlers;
      }
      var _proto = RelayRecordSourceProxy2.prototype;
      _proto.publishSource = function publishSource(source, fieldPayloads) {
        var _this = this;
        var dataIDs = source.getRecordIDs();
        dataIDs.forEach(function(dataID) {
          var status = source.getStatus(dataID);
          if (status === EXISTENT) {
            var sourceRecord = source.get(dataID);
            if (sourceRecord) {
              if (_this.__mutator.getStatus(dataID) !== EXISTENT) {
                _this.create(dataID, RelayModernRecord.getType(sourceRecord));
              }
              _this.__mutator.copyFieldsFromRecord(sourceRecord, dataID);
            }
          } else if (status === NONEXISTENT) {
            _this["delete"](dataID);
          }
        });
        if (fieldPayloads && fieldPayloads.length) {
          fieldPayloads.forEach(function(fieldPayload) {
            var handler = _this._handlerProvider && _this._handlerProvider(fieldPayload.handle);
            !handler ? true ? invariant3(false, "RelayModernEnvironment: Expected a handler to be provided for handle `%s`.", fieldPayload.handle) : invariant3(false) : void 0;
            handler.update(_this, fieldPayload);
          });
        }
      };
      _proto.create = function create4(dataID, typeName2) {
        this.__mutator.create(dataID, typeName2);
        delete this._proxies[dataID];
        var record = this.get(dataID);
        !record ? true ? invariant3(false, "RelayRecordSourceProxy#create(): Expected the created record to exist.") : invariant3(false) : void 0;
        return record;
      };
      _proto["delete"] = function _delete(dataID) {
        !(dataID !== ROOT_ID) ? true ? invariant3(false, "RelayRecordSourceProxy#delete(): Cannot delete the root record.") : invariant3(false) : void 0;
        delete this._proxies[dataID];
        this.__mutator["delete"](dataID);
      };
      _proto.get = function get3(dataID) {
        if (!this._proxies.hasOwnProperty(dataID)) {
          var status = this.__mutator.getStatus(dataID);
          if (status === EXISTENT) {
            this._proxies[dataID] = new RelayRecordProxy(this, this.__mutator, dataID);
          } else {
            this._proxies[dataID] = status === NONEXISTENT ? null : void 0;
          }
        }
        return this._proxies[dataID];
      };
      _proto.getRoot = function getRoot2() {
        var root2 = this.get(ROOT_ID);
        if (!root2) {
          root2 = this.create(ROOT_ID, ROOT_TYPE);
        }
        !(root2 && root2.getType() === ROOT_TYPE) ? true ? invariant3(false, "RelayRecordSourceProxy#getRoot(): Expected the source to contain a root record, %s.", root2 == null ? "no root record found" : "found a root record of type `".concat(root2.getType(), "`")) : invariant3(false) : void 0;
        return root2;
      };
      _proto.invalidateStore = function invalidateStore() {
        this._invalidatedStore = true;
      };
      _proto.isStoreMarkedForInvalidation = function isStoreMarkedForInvalidation() {
        return this._invalidatedStore;
      };
      _proto.markIDForInvalidation = function markIDForInvalidation(dataID) {
        this._idsMarkedForInvalidation.add(dataID);
      };
      _proto.getIDsMarkedForInvalidation = function getIDsMarkedForInvalidation() {
        return this._idsMarkedForInvalidation;
      };
      _proto.readUpdatableQuery = function readUpdatableQuery(query2, variables) {
        return _readUpdatableQuery(query2, variables, this, this._missingFieldHandlers);
      };
      _proto.readUpdatableFragment = function readUpdatableFragment(fragment2, fragmentReference) {
        return _readUpdatableFragment(fragment2, fragmentReference, this, this._missingFieldHandlers);
      };
      return RelayRecordSourceProxy2;
    }();
    module.exports = RelayRecordSourceProxy;
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/mutations/RelayRecordSourceSelectorProxy.js
var require_RelayRecordSourceSelectorProxy = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/mutations/RelayRecordSourceSelectorProxy.js"(exports, module) {
    "use strict";
    var _require = require_RelayStoreUtils();
    var ROOT_TYPE = _require.ROOT_TYPE;
    var getStorageKey = _require.getStorageKey;
    var _require2 = require_readUpdatableFragment();
    var _readUpdatableFragment = _require2.readUpdatableFragment;
    var _require3 = require_readUpdatableQuery();
    var _readUpdatableQuery = _require3.readUpdatableQuery;
    var invariant3 = require_browser();
    var RelayRecordSourceSelectorProxy = /* @__PURE__ */ function() {
      function RelayRecordSourceSelectorProxy2(mutator, recordSource, readSelector, missingFieldHandlers) {
        this.__mutator = mutator;
        this.__recordSource = recordSource;
        this._readSelector = readSelector;
        this._missingFieldHandlers = missingFieldHandlers;
      }
      var _proto = RelayRecordSourceSelectorProxy2.prototype;
      _proto.create = function create4(dataID, typeName2) {
        return this.__recordSource.create(dataID, typeName2);
      };
      _proto["delete"] = function _delete(dataID) {
        this.__recordSource["delete"](dataID);
      };
      _proto.get = function get3(dataID) {
        return this.__recordSource.get(dataID);
      };
      _proto.getRoot = function getRoot2() {
        return this.__recordSource.getRoot();
      };
      _proto.getOperationRoot = function getOperationRoot() {
        var root2 = this.__recordSource.get(this._readSelector.dataID);
        if (!root2) {
          root2 = this.__recordSource.create(this._readSelector.dataID, ROOT_TYPE);
        }
        return root2;
      };
      _proto._getRootField = function _getRootField(selector, fieldName, plural) {
        var field = selector.node.selections.find(function(selection2) {
          return selection2.kind === "LinkedField" && selection2.name === fieldName || selection2.kind === "RequiredField" && selection2.field.name === fieldName;
        });
        if (field && field.kind === "RequiredField") {
          field = field.field;
        }
        !(field && field.kind === "LinkedField") ? true ? invariant3(false, "RelayRecordSourceSelectorProxy#getRootField(): Cannot find root field `%s`, no such field is defined on GraphQL document `%s`.", fieldName, selector.node.name) : invariant3(false) : void 0;
        !(field.plural === plural) ? true ? invariant3(false, "RelayRecordSourceSelectorProxy#getRootField(): Expected root field `%s` to be %s.", fieldName, plural ? "plural" : "singular") : invariant3(false) : void 0;
        return field;
      };
      _proto.getRootField = function getRootField(fieldName) {
        var field = this._getRootField(this._readSelector, fieldName, false);
        var storageKey = getStorageKey(field, this._readSelector.variables);
        return this.getOperationRoot().getLinkedRecord(storageKey);
      };
      _proto.getPluralRootField = function getPluralRootField(fieldName) {
        var field = this._getRootField(this._readSelector, fieldName, true);
        var storageKey = getStorageKey(field, this._readSelector.variables);
        return this.getOperationRoot().getLinkedRecords(storageKey);
      };
      _proto.invalidateStore = function invalidateStore() {
        this.__recordSource.invalidateStore();
      };
      _proto.readUpdatableQuery = function readUpdatableQuery(query2, variables) {
        return _readUpdatableQuery(query2, variables, this, this._missingFieldHandlers);
      };
      _proto.readUpdatableFragment = function readUpdatableFragment(fragment2, fragmentReference) {
        return _readUpdatableFragment(fragment2, fragmentReference, this, this._missingFieldHandlers);
      };
      return RelayRecordSourceSelectorProxy2;
    }();
    module.exports = RelayRecordSourceSelectorProxy;
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/store/ResolverCache.js
var require_ResolverCache = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/store/ResolverCache.js"(exports, module) {
    "use strict";
    var _interopRequireDefault = require_interopRequireDefault()["default"];
    var _createForOfIteratorHelper2 = _interopRequireDefault(require_createForOfIteratorHelper());
    var recycleNodesInto = require_recycleNodesInto();
    var _require = require_RelayConcreteNode();
    var RELAY_LIVE_RESOLVER = _require.RELAY_LIVE_RESOLVER;
    var _require2 = require_ClientID();
    var generateClientID = _require2.generateClientID;
    var RelayModernRecord = require_RelayModernRecord();
    var _require3 = require_RelayStoreUtils();
    var RELAY_RESOLVER_ERROR_KEY = _require3.RELAY_RESOLVER_ERROR_KEY;
    var RELAY_RESOLVER_INVALIDATION_KEY = _require3.RELAY_RESOLVER_INVALIDATION_KEY;
    var RELAY_RESOLVER_SNAPSHOT_KEY = _require3.RELAY_RESOLVER_SNAPSHOT_KEY;
    var RELAY_RESOLVER_VALUE_KEY = _require3.RELAY_RESOLVER_VALUE_KEY;
    var getStorageKey = _require3.getStorageKey;
    var invariant3 = require_browser();
    var warning2 = require_warning();
    var emptySet = /* @__PURE__ */ new Set();
    var NoopResolverCache = /* @__PURE__ */ function() {
      function NoopResolverCache2() {
      }
      var _proto = NoopResolverCache2.prototype;
      _proto.readFromCacheOrEvaluate = function readFromCacheOrEvaluate(recordID, field, variables, evaluate, getDataForResolverFragment) {
        !(field.kind !== RELAY_LIVE_RESOLVER) ? true ? invariant3(false, "This store does not support Live Resolvers") : invariant3(false) : void 0;
        var _evaluate = evaluate(), resolverResult = _evaluate.resolverResult, snapshot = _evaluate.snapshot, error = _evaluate.error;
        return [resolverResult, void 0, error, snapshot, void 0, void 0];
      };
      _proto.invalidateDataIDs = function invalidateDataIDs(updatedDataIDs) {
      };
      _proto.ensureClientRecord = function ensureClientRecord(id2, typeName2) {
        true ? true ? invariant3(false, "Client Edges to Client Objects are not supported in this version of Relay Store") : invariant3(false) : void 0;
      };
      _proto.notifyUpdatedSubscribers = function notifyUpdatedSubscribers(updatedDataIDs) {
      };
      return NoopResolverCache2;
    }();
    function addDependencyEdge(edges, from2, to) {
      var set3 = edges.get(from2);
      if (!set3) {
        set3 = /* @__PURE__ */ new Set();
        edges.set(from2, set3);
      }
      set3.add(to);
    }
    var RecordResolverCache = /* @__PURE__ */ function() {
      function RecordResolverCache2(getRecordSource) {
        this._resolverIDToRecordIDs = /* @__PURE__ */ new Map();
        this._recordIDToResolverIDs = /* @__PURE__ */ new Map();
        this._getRecordSource = getRecordSource;
      }
      var _proto2 = RecordResolverCache2.prototype;
      _proto2.readFromCacheOrEvaluate = function readFromCacheOrEvaluate(recordID, field, variables, evaluate, getDataForResolverFragment) {
        var recordSource = this._getRecordSource();
        var record = recordSource.get(recordID);
        !(record != null) ? true ? invariant3(false, "We expect record to exist in the store.") : invariant3(false) : void 0;
        var storageKey = getStorageKey(field, variables);
        var linkedID = RelayModernRecord.getLinkedRecordID(record, storageKey);
        var linkedRecord = linkedID == null ? null : recordSource.get(linkedID);
        if (linkedRecord == null || this._isInvalid(linkedRecord, getDataForResolverFragment)) {
          var _linkedID;
          linkedID = (_linkedID = linkedID) !== null && _linkedID !== void 0 ? _linkedID : generateClientID(recordID, storageKey);
          linkedRecord = RelayModernRecord.create(linkedID, "__RELAY_RESOLVER__");
          var evaluationResult = evaluate();
          RelayModernRecord.setValue(linkedRecord, RELAY_RESOLVER_VALUE_KEY, evaluationResult.resolverResult);
          RelayModernRecord.setValue(linkedRecord, RELAY_RESOLVER_SNAPSHOT_KEY, evaluationResult.snapshot);
          RelayModernRecord.setValue(linkedRecord, RELAY_RESOLVER_ERROR_KEY, evaluationResult.error);
          recordSource.set(linkedID, linkedRecord);
          var currentRecord = recordSource.get(recordID);
          !(currentRecord != null) ? true ? invariant3(false, "Expected the parent record to still be in the record source.") : invariant3(false) : void 0;
          var nextRecord = RelayModernRecord.clone(currentRecord);
          RelayModernRecord.setLinkedRecordID(nextRecord, storageKey, linkedID);
          recordSource.set(recordID, nextRecord);
          if (field.fragment != null) {
            var _evaluationResult$sna;
            var fragmentStorageKey = getStorageKey(field.fragment, variables);
            var resolverID = generateClientID(recordID, fragmentStorageKey);
            addDependencyEdge(this._resolverIDToRecordIDs, resolverID, linkedID);
            addDependencyEdge(this._recordIDToResolverIDs, recordID, resolverID);
            var seenRecordIds = (_evaluationResult$sna = evaluationResult.snapshot) === null || _evaluationResult$sna === void 0 ? void 0 : _evaluationResult$sna.seenRecords;
            if (seenRecordIds != null) {
              var _iterator = (0, _createForOfIteratorHelper2["default"])(seenRecordIds), _step;
              try {
                for (_iterator.s(); !(_step = _iterator.n()).done; ) {
                  var seenRecordID = _step.value;
                  addDependencyEdge(this._recordIDToResolverIDs, seenRecordID, resolverID);
                }
              } catch (err) {
                _iterator.e(err);
              } finally {
                _iterator.f();
              }
            }
          }
        }
        var answer = linkedRecord[RELAY_RESOLVER_VALUE_KEY];
        var snapshot = linkedRecord[RELAY_RESOLVER_SNAPSHOT_KEY];
        var error = linkedRecord[RELAY_RESOLVER_ERROR_KEY];
        return [answer, linkedID, error, snapshot, void 0, void 0];
      };
      _proto2.invalidateDataIDs = function invalidateDataIDs(updatedDataIDs) {
        var recordSource = this._getRecordSource();
        var visited = /* @__PURE__ */ new Set();
        var recordsToVisit = Array.from(updatedDataIDs);
        while (recordsToVisit.length) {
          var recordID = recordsToVisit.pop();
          updatedDataIDs.add(recordID);
          var _iterator2 = (0, _createForOfIteratorHelper2["default"])((_this$_recordIDToReso = this._recordIDToResolverIDs.get(recordID)) !== null && _this$_recordIDToReso !== void 0 ? _this$_recordIDToReso : emptySet), _step2;
          try {
            for (_iterator2.s(); !(_step2 = _iterator2.n()).done; ) {
              var _this$_recordIDToReso;
              var fragment2 = _step2.value;
              if (!visited.has(fragment2)) {
                var _iterator3 = (0, _createForOfIteratorHelper2["default"])((_this$_resolverIDToRe = this._resolverIDToRecordIDs.get(fragment2)) !== null && _this$_resolverIDToRe !== void 0 ? _this$_resolverIDToRe : emptySet), _step3;
                try {
                  for (_iterator3.s(); !(_step3 = _iterator3.n()).done; ) {
                    var _this$_resolverIDToRe;
                    var anotherRecordID = _step3.value;
                    this._markInvalidatedResolverRecord(anotherRecordID, recordSource, updatedDataIDs);
                    if (!visited.has(anotherRecordID)) {
                      recordsToVisit.push(anotherRecordID);
                    }
                  }
                } catch (err) {
                  _iterator3.e(err);
                } finally {
                  _iterator3.f();
                }
              }
            }
          } catch (err) {
            _iterator2.e(err);
          } finally {
            _iterator2.f();
          }
        }
      };
      _proto2._markInvalidatedResolverRecord = function _markInvalidatedResolverRecord(dataID, recordSource, updatedDataIDs) {
        var record = recordSource.get(dataID);
        if (!record) {
          true ? warning2(false, "Expected a resolver record with ID %s, but it was missing.", dataID) : void 0;
          return;
        }
        var nextRecord = RelayModernRecord.clone(record);
        RelayModernRecord.setValue(nextRecord, RELAY_RESOLVER_INVALIDATION_KEY, true);
        recordSource.set(dataID, nextRecord);
      };
      _proto2._isInvalid = function _isInvalid(record, getDataForResolverFragment) {
        if (!RelayModernRecord.getValue(record, RELAY_RESOLVER_INVALIDATION_KEY)) {
          return false;
        }
        var snapshot = RelayModernRecord.getValue(record, RELAY_RESOLVER_SNAPSHOT_KEY);
        var originalInputs = snapshot === null || snapshot === void 0 ? void 0 : snapshot.data;
        var readerSelector = snapshot === null || snapshot === void 0 ? void 0 : snapshot.selector;
        if (originalInputs == null || readerSelector == null) {
          true ? warning2(false, "Expected previous inputs and reader selector on resolver record with ID %s, but they were missing.", RelayModernRecord.getDataID(record)) : void 0;
          return true;
        }
        var _getDataForResolverFr = getDataForResolverFragment(readerSelector), latestValues = _getDataForResolverFr.data;
        var recycled = recycleNodesInto(originalInputs, latestValues);
        if (recycled !== originalInputs) {
          return true;
        }
        return false;
      };
      _proto2.ensureClientRecord = function ensureClientRecord(id2, typename) {
        true ? true ? invariant3(false, "Client Edges to Client Objects are not supported in this version of Relay Store") : invariant3(false) : void 0;
      };
      _proto2.notifyUpdatedSubscribers = function notifyUpdatedSubscribers(updatedDataIDs) {
        true ? true ? invariant3(false, "Processing @outputType records is not supported in this version of Relay Store") : invariant3(false) : void 0;
      };
      return RecordResolverCache2;
    }();
    module.exports = {
      NoopResolverCache,
      RecordResolverCache
    };
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/store/ResolverFragments.js
var require_ResolverFragments = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/store/ResolverFragments.js"(exports, module) {
    "use strict";
    var _require = require_GraphQLTag();
    var getFragment = _require.getFragment;
    var _require2 = require_RelayModernSelector();
    var getSelector = _require2.getSelector;
    var invariant3 = require_browser();
    var contextStack = [];
    function withResolverContext(context2, cb) {
      contextStack.push(context2);
      try {
        return cb();
      } finally {
        contextStack.pop();
      }
    }
    function readFragment(fragmentInput, fragmentKey) {
      if (!contextStack.length) {
        throw new Error("readFragment should be called only from within a Relay Resolver function.");
      }
      var context2 = contextStack[contextStack.length - 1];
      var fragmentNode = getFragment(fragmentInput);
      var fragmentSelector = getSelector(fragmentNode, fragmentKey);
      !(fragmentSelector != null) ? true ? invariant3(false, "Expected a selector for the fragment of the resolver ".concat(fragmentNode.name, ", but got null.")) : invariant3(false) : void 0;
      !(fragmentSelector.kind === "SingularReaderSelector") ? true ? invariant3(false, "Expected a singular reader selector for the fragment of the resolver ".concat(fragmentNode.name, ", but it was plural.")) : invariant3(false) : void 0;
      var _context$getDataForRe = context2.getDataForResolverFragment(fragmentSelector, fragmentKey), data = _context$getDataForRe.data, isMissingData = _context$getDataForRe.isMissingData;
      if (isMissingData) {
        throw RESOLVER_FRAGMENT_MISSING_DATA_SENTINEL;
      }
      return data;
    }
    var RESOLVER_FRAGMENT_MISSING_DATA_SENTINEL = {};
    module.exports = {
      readFragment,
      withResolverContext,
      RESOLVER_FRAGMENT_MISSING_DATA_SENTINEL
    };
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/store/RelayReader.js
var require_RelayReader = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/store/RelayReader.js"(exports, module) {
    "use strict";
    var _interopRequireDefault = require_interopRequireDefault()["default"];
    var _createForOfIteratorHelper2 = _interopRequireDefault(require_createForOfIteratorHelper());
    var _defineProperty210 = _interopRequireDefault(require_defineProperty());
    var _toConsumableArray22 = _interopRequireDefault(require_toConsumableArray());
    var _require = require_RelayConcreteNode();
    var ACTOR_CHANGE = _require.ACTOR_CHANGE;
    var ALIASED_FRAGMENT_SPREAD = _require.ALIASED_FRAGMENT_SPREAD;
    var ALIASED_INLINE_FRAGMENT_SPREAD = _require.ALIASED_INLINE_FRAGMENT_SPREAD;
    var CLIENT_EDGE_TO_CLIENT_OBJECT = _require.CLIENT_EDGE_TO_CLIENT_OBJECT;
    var CLIENT_EDGE_TO_SERVER_OBJECT = _require.CLIENT_EDGE_TO_SERVER_OBJECT;
    var CLIENT_EXTENSION = _require.CLIENT_EXTENSION;
    var CONDITION = _require.CONDITION;
    var DEFER = _require.DEFER;
    var FLIGHT_FIELD = _require.FLIGHT_FIELD;
    var FRAGMENT_SPREAD = _require.FRAGMENT_SPREAD;
    var INLINE_DATA_FRAGMENT_SPREAD = _require.INLINE_DATA_FRAGMENT_SPREAD;
    var INLINE_FRAGMENT = _require.INLINE_FRAGMENT;
    var LINKED_FIELD = _require.LINKED_FIELD;
    var MODULE_IMPORT = _require.MODULE_IMPORT;
    var RELAY_LIVE_RESOLVER = _require.RELAY_LIVE_RESOLVER;
    var RELAY_RESOLVER = _require.RELAY_RESOLVER;
    var REQUIRED_FIELD = _require.REQUIRED_FIELD;
    var SCALAR_FIELD = _require.SCALAR_FIELD;
    var STREAM = _require.STREAM;
    var RelayFeatureFlags = require_RelayFeatureFlags();
    var _require2 = require_LiveResolverSuspenseSentinel();
    var isSuspenseSentinel = _require2.isSuspenseSentinel;
    var RelayConcreteVariables = require_RelayConcreteVariables();
    var RelayModernRecord = require_RelayModernRecord();
    var _require3 = require_RelayStoreReactFlightUtils();
    var getReactFlightClientResponse = _require3.getReactFlightClientResponse;
    var _require4 = require_RelayStoreUtils();
    var CLIENT_EDGE_TRAVERSAL_PATH = _require4.CLIENT_EDGE_TRAVERSAL_PATH;
    var FRAGMENT_OWNER_KEY = _require4.FRAGMENT_OWNER_KEY;
    var FRAGMENT_PROP_NAME_KEY = _require4.FRAGMENT_PROP_NAME_KEY;
    var FRAGMENTS_KEY = _require4.FRAGMENTS_KEY;
    var ID_KEY = _require4.ID_KEY;
    var IS_WITHIN_UNMATCHED_TYPE_REFINEMENT = _require4.IS_WITHIN_UNMATCHED_TYPE_REFINEMENT;
    var MODULE_COMPONENT_KEY = _require4.MODULE_COMPONENT_KEY;
    var ROOT_ID = _require4.ROOT_ID;
    var getArgumentValues = _require4.getArgumentValues;
    var getModuleComponentKey = _require4.getModuleComponentKey;
    var getStorageKey = _require4.getStorageKey;
    var _require5 = require_ResolverCache();
    var NoopResolverCache = _require5.NoopResolverCache;
    var _require6 = require_ResolverFragments();
    var RESOLVER_FRAGMENT_MISSING_DATA_SENTINEL = _require6.RESOLVER_FRAGMENT_MISSING_DATA_SENTINEL;
    var withResolverContext = _require6.withResolverContext;
    var _require7 = require_TypeID();
    var generateTypeID = _require7.generateTypeID;
    var invariant3 = require_browser();
    function read(recordSource, selector, resolverCache) {
      var reader = new RelayReader(recordSource, selector, resolverCache !== null && resolverCache !== void 0 ? resolverCache : new NoopResolverCache());
      return reader.read();
    }
    var RelayReader = /* @__PURE__ */ function() {
      function RelayReader2(recordSource, selector, resolverCache) {
        var _selector$clientEdgeT;
        this._clientEdgeTraversalPath = RelayFeatureFlags.ENABLE_CLIENT_EDGES && (_selector$clientEdgeT = selector.clientEdgeTraversalPath) !== null && _selector$clientEdgeT !== void 0 && _selector$clientEdgeT.length ? (0, _toConsumableArray22["default"])(selector.clientEdgeTraversalPath) : [];
        this._missingClientEdges = [];
        this._missingLiveResolverFields = [];
        this._isMissingData = false;
        this._isWithinUnmatchedTypeRefinement = false;
        this._missingRequiredFields = null;
        this._owner = selector.owner;
        this._recordSource = recordSource;
        this._seenRecords = /* @__PURE__ */ new Set();
        this._selector = selector;
        this._variables = selector.variables;
        this._resolverCache = resolverCache;
        this._resolverErrors = [];
        this._fragmentName = selector.node.name;
        this._updatedDataIDs = /* @__PURE__ */ new Set();
      }
      var _proto = RelayReader2.prototype;
      _proto.read = function read2() {
        var _this$_selector = this._selector, node56 = _this$_selector.node, dataID = _this$_selector.dataID, isWithinUnmatchedTypeRefinement = _this$_selector.isWithinUnmatchedTypeRefinement;
        var abstractKey = node56.abstractKey;
        var record = this._recordSource.get(dataID);
        var isDataExpectedToBePresent = !isWithinUnmatchedTypeRefinement;
        if (isDataExpectedToBePresent && abstractKey == null && record != null) {
          var recordType = RelayModernRecord.getType(record);
          if (recordType !== node56.type && // The root record type is a special `__Root` type and may not match the
          // type on the ast, so ignore type mismatches at the root.
          // We currently detect whether we're at the root by checking against ROOT_ID,
          // but this does not work for mutations/subscriptions which generate unique
          // root ids. This is acceptable in practice as we don't read data for mutations/
          // subscriptions in a situation where we would use isMissingData to decide whether
          // to suspend or not.
          // TODO T96653810: Correctly detect reading from root of mutation/subscription
          dataID !== ROOT_ID) {
            isDataExpectedToBePresent = false;
          }
        }
        if (isDataExpectedToBePresent && abstractKey != null && record != null) {
          var implementsInterface = this._implementsInterface(record, abstractKey);
          if (implementsInterface === false) {
            isDataExpectedToBePresent = false;
          } else if (implementsInterface == null) {
            this._isMissingData = true;
          }
        }
        this._isWithinUnmatchedTypeRefinement = !isDataExpectedToBePresent;
        var data = this._traverse(node56, dataID, null);
        if (this._updatedDataIDs.size > 0) {
          this._resolverCache.notifyUpdatedSubscribers(this._updatedDataIDs);
          this._updatedDataIDs.clear();
        }
        return {
          data,
          isMissingData: this._isMissingData && isDataExpectedToBePresent,
          missingClientEdges: RelayFeatureFlags.ENABLE_CLIENT_EDGES && this._missingClientEdges.length ? this._missingClientEdges : null,
          missingLiveResolverFields: this._missingLiveResolverFields,
          seenRecords: this._seenRecords,
          selector: this._selector,
          missingRequiredFields: this._missingRequiredFields,
          relayResolverErrors: this._resolverErrors
        };
      };
      _proto._markDataAsMissing = function _markDataAsMissing() {
        this._isMissingData = true;
        if (RelayFeatureFlags.ENABLE_CLIENT_EDGES && this._clientEdgeTraversalPath.length) {
          var top2 = this._clientEdgeTraversalPath[this._clientEdgeTraversalPath.length - 1];
          if (top2 !== null) {
            this._missingClientEdges.push({
              request: top2.readerClientEdge.operation,
              clientEdgeDestinationID: top2.clientEdgeDestinationID
            });
          }
        }
      };
      _proto._traverse = function _traverse(node56, dataID, prevData) {
        var record = this._recordSource.get(dataID);
        this._seenRecords.add(dataID);
        if (record == null) {
          if (record === void 0) {
            this._markDataAsMissing();
          }
          return record;
        }
        var data = prevData || {};
        var hadRequiredData = this._traverseSelections(node56.selections, record, data);
        return hadRequiredData ? data : null;
      };
      _proto._getVariableValue = function _getVariableValue(name2) {
        !this._variables.hasOwnProperty(name2) ? true ? invariant3(false, "RelayReader(): Undefined variable `%s`.", name2) : invariant3(false) : void 0;
        return this._variables[name2];
      };
      _proto._maybeReportUnexpectedNull = function _maybeReportUnexpectedNull(fieldPath, action, _record) {
        var _this$_missingRequire;
        if (((_this$_missingRequire = this._missingRequiredFields) === null || _this$_missingRequire === void 0 ? void 0 : _this$_missingRequire.action) === "THROW") {
          return;
        }
        var owner = this._fragmentName;
        switch (action) {
          case "THROW":
            this._missingRequiredFields = {
              action,
              field: {
                path: fieldPath,
                owner
              }
            };
            return;
          case "LOG":
            if (this._missingRequiredFields == null) {
              this._missingRequiredFields = {
                action,
                fields: [{
                  path: fieldPath,
                  owner
                }]
              };
            } else {
              this._missingRequiredFields = {
                action,
                fields: [].concat((0, _toConsumableArray22["default"])(this._missingRequiredFields.fields), [{
                  path: fieldPath,
                  owner
                }])
              };
            }
            return;
          default:
            action;
        }
      };
      _proto._traverseSelections = function _traverseSelections(selections, record, data) {
        for (var i2 = 0; i2 < selections.length; i2++) {
          var selection2 = selections[i2];
          switch (selection2.kind) {
            case REQUIRED_FIELD: {
              var fieldValue = this._readRequiredField(selection2, record, data);
              if (fieldValue == null) {
                var action = selection2.action;
                if (action !== "NONE") {
                  this._maybeReportUnexpectedNull(selection2.path, action, record);
                }
                return false;
              }
              break;
            }
            case SCALAR_FIELD:
              this._readScalar(selection2, record, data);
              break;
            case LINKED_FIELD:
              if (selection2.plural) {
                this._readPluralLink(selection2, record, data);
              } else {
                this._readLink(selection2, record, data);
              }
              break;
            case CONDITION:
              var conditionValue = Boolean(this._getVariableValue(selection2.condition));
              if (conditionValue === selection2.passingValue) {
                var hasExpectedData = this._traverseSelections(selection2.selections, record, data);
                if (!hasExpectedData) {
                  return false;
                }
              }
              break;
            case INLINE_FRAGMENT: {
              if (this._readInlineFragment(selection2, record, data) === false) {
                return false;
              }
              break;
            }
            case RELAY_LIVE_RESOLVER:
            case RELAY_RESOLVER: {
              if (!RelayFeatureFlags.ENABLE_RELAY_RESOLVERS) {
                throw new Error("Relay Resolver fields are not yet supported.");
              }
              this._readResolverField(selection2, record, data);
              break;
            }
            case FRAGMENT_SPREAD:
              this._createFragmentPointer(selection2, record, data);
              break;
            case ALIASED_FRAGMENT_SPREAD:
              data[selection2.name] = this._createAliasedFragmentSpread(selection2, record);
              break;
            case ALIASED_INLINE_FRAGMENT_SPREAD: {
              var _fieldValue = this._readInlineFragment(selection2.fragment, record, {});
              if (_fieldValue === false) {
                _fieldValue = null;
              }
              data[selection2.name] = _fieldValue;
              break;
            }
            case MODULE_IMPORT:
              this._readModuleImport(selection2, record, data);
              break;
            case INLINE_DATA_FRAGMENT_SPREAD:
              this._createInlineDataOrResolverFragmentPointer(selection2, record, data);
              break;
            case DEFER:
            case CLIENT_EXTENSION: {
              var isMissingData = this._isMissingData;
              var alreadyMissingClientEdges = this._missingClientEdges.length;
              if (RelayFeatureFlags.ENABLE_CLIENT_EDGES) {
                this._clientEdgeTraversalPath.push(null);
              }
              var _hasExpectedData = this._traverseSelections(selection2.selections, record, data);
              this._isMissingData = isMissingData || this._missingClientEdges.length > alreadyMissingClientEdges || this._missingLiveResolverFields.length > 0;
              if (RelayFeatureFlags.ENABLE_CLIENT_EDGES) {
                this._clientEdgeTraversalPath.pop();
              }
              if (!_hasExpectedData) {
                return false;
              }
              break;
            }
            case STREAM: {
              var _hasExpectedData2 = this._traverseSelections(selection2.selections, record, data);
              if (!_hasExpectedData2) {
                return false;
              }
              break;
            }
            case FLIGHT_FIELD:
              if (RelayFeatureFlags.ENABLE_REACT_FLIGHT_COMPONENT_FIELD) {
                this._readFlightField(selection2, record, data);
              } else {
                throw new Error("Flight fields are not yet supported.");
              }
              break;
            case ACTOR_CHANGE:
              this._readActorChange(selection2, record, data);
              break;
            case CLIENT_EDGE_TO_CLIENT_OBJECT:
            case CLIENT_EDGE_TO_SERVER_OBJECT:
              if (RelayFeatureFlags.ENABLE_CLIENT_EDGES) {
                this._readClientEdge(selection2, record, data);
              } else {
                throw new Error("Client edges are not yet supported.");
              }
              break;
            default:
              selection2;
              true ? true ? invariant3(false, "RelayReader(): Unexpected ast kind `%s`.", selection2.kind) : invariant3(false) : void 0;
          }
        }
        return true;
      };
      _proto._readRequiredField = function _readRequiredField(selection2, record, data) {
        switch (selection2.field.kind) {
          case SCALAR_FIELD:
            return this._readScalar(selection2.field, record, data);
          case LINKED_FIELD:
            if (selection2.field.plural) {
              return this._readPluralLink(selection2.field, record, data);
            } else {
              return this._readLink(selection2.field, record, data);
            }
          case RELAY_RESOLVER:
            if (!RelayFeatureFlags.ENABLE_RELAY_RESOLVERS) {
              throw new Error("Relay Resolver fields are not yet supported.");
            }
            return this._readResolverField(selection2.field, record, data);
          case RELAY_LIVE_RESOLVER:
            if (!RelayFeatureFlags.ENABLE_RELAY_RESOLVERS) {
              throw new Error("Relay Resolver fields are not yet supported.");
            }
            return this._readResolverField(selection2.field, record, data);
          case CLIENT_EDGE_TO_CLIENT_OBJECT:
          case CLIENT_EDGE_TO_SERVER_OBJECT:
            if (!RelayFeatureFlags.ENABLE_RELAY_RESOLVERS) {
              throw new Error("Relay Resolver fields are not yet supported.");
            }
            return this._readClientEdge(selection2.field, record, data);
          default:
            selection2.field.kind;
            true ? true ? invariant3(false, "RelayReader(): Unexpected ast kind `%s`.", selection2.kind) : invariant3(false) : void 0;
        }
      };
      _proto._readResolverField = function _readResolverField(field, record, data) {
        var _this = this;
        var _field$alias;
        var fragment2 = field.fragment;
        var parentRecordID = RelayModernRecord.getDataID(record);
        var snapshot;
        var getDataForResolverFragment = function getDataForResolverFragment2(singularReaderSelector) {
          if (snapshot != null) {
            return {
              data: snapshot.data,
              isMissingData: snapshot.isMissingData
            };
          }
          snapshot = read(_this._recordSource, singularReaderSelector, _this._resolverCache);
          return {
            data: snapshot.data,
            isMissingData: snapshot.isMissingData
          };
        };
        var evaluate = function evaluate2() {
          if (fragment2 != null) {
            var key = {
              __id: parentRecordID,
              __fragmentOwner: _this._owner,
              __fragments: (0, _defineProperty210["default"])({}, fragment2.name, fragment2.args ? getArgumentValues(fragment2.args, _this._variables) : {})
            };
            var resolverContext = {
              getDataForResolverFragment
            };
            return withResolverContext(resolverContext, function() {
              var _getResolverValue = getResolverValue(field, _this._variables, key, _this._fragmentName), resolverResult2 = _getResolverValue[0], resolverError2 = _getResolverValue[1];
              return {
                resolverResult: resolverResult2,
                snapshot,
                error: resolverError2
              };
            });
          } else {
            var _getResolverValue2 = getResolverValue(field, _this._variables, null, _this._fragmentName), resolverResult = _getResolverValue2[0], _resolverError = _getResolverValue2[1];
            return {
              resolverResult,
              snapshot: void 0,
              error: _resolverError
            };
          }
        };
        var _this$_resolverCache$ = this._resolverCache.readFromCacheOrEvaluate(parentRecordID, field, this._variables, evaluate, getDataForResolverFragment), result = _this$_resolverCache$[0], seenRecord = _this$_resolverCache$[1], resolverError = _this$_resolverCache$[2], cachedSnapshot = _this$_resolverCache$[3], suspenseID = _this$_resolverCache$[4], updatedDataIDs = _this$_resolverCache$[5];
        if (cachedSnapshot != null) {
          if (cachedSnapshot.missingRequiredFields != null) {
            this._addMissingRequiredFields(cachedSnapshot.missingRequiredFields);
          }
          if (cachedSnapshot.missingClientEdges != null) {
            var _iterator = (0, _createForOfIteratorHelper2["default"])(cachedSnapshot.missingClientEdges), _step;
            try {
              for (_iterator.s(); !(_step = _iterator.n()).done; ) {
                var missing = _step.value;
                this._missingClientEdges.push(missing);
              }
            } catch (err) {
              _iterator.e(err);
            } finally {
              _iterator.f();
            }
          }
          if (cachedSnapshot.missingLiveResolverFields != null) {
            this._isMissingData = this._isMissingData || cachedSnapshot.missingLiveResolverFields.length > 0;
            var _iterator2 = (0, _createForOfIteratorHelper2["default"])(cachedSnapshot.missingLiveResolverFields), _step2;
            try {
              for (_iterator2.s(); !(_step2 = _iterator2.n()).done; ) {
                var missingResolverField = _step2.value;
                this._missingLiveResolverFields.push(missingResolverField);
              }
            } catch (err) {
              _iterator2.e(err);
            } finally {
              _iterator2.f();
            }
          }
          var _iterator3 = (0, _createForOfIteratorHelper2["default"])(cachedSnapshot.relayResolverErrors), _step3;
          try {
            for (_iterator3.s(); !(_step3 = _iterator3.n()).done; ) {
              var error = _step3.value;
              this._resolverErrors.push(error);
            }
          } catch (err) {
            _iterator3.e(err);
          } finally {
            _iterator3.f();
          }
          this._isMissingData = this._isMissingData || cachedSnapshot.isMissingData;
        }
        if (resolverError) {
          this._resolverErrors.push(resolverError);
        }
        if (seenRecord != null) {
          this._seenRecords.add(seenRecord);
        }
        if (suspenseID != null) {
          this._isMissingData = true;
          this._missingLiveResolverFields.push({
            path: "".concat(this._fragmentName, ".").concat(field.path),
            liveStateID: suspenseID
          });
        }
        if (updatedDataIDs != null) {
          var _iterator4 = (0, _createForOfIteratorHelper2["default"])(updatedDataIDs), _step4;
          try {
            for (_iterator4.s(); !(_step4 = _iterator4.n()).done; ) {
              var recordID = _step4.value;
              this._updatedDataIDs.add(recordID);
            }
          } catch (err) {
            _iterator4.e(err);
          } finally {
            _iterator4.f();
          }
        }
        var applicationName = (_field$alias = field.alias) !== null && _field$alias !== void 0 ? _field$alias : field.name;
        data[applicationName] = result;
        return result;
      };
      _proto._readClientEdge = function _readClientEdge(field, record, data) {
        var _backingField$alias;
        var backingField = field.backingField;
        !(backingField.kind !== "ClientExtension") ? true ? invariant3(false, "Client extension client edges are not yet implemented.") : invariant3(false) : void 0;
        var applicationName = (_backingField$alias = backingField.alias) !== null && _backingField$alias !== void 0 ? _backingField$alias : backingField.name;
        var backingFieldData = {};
        this._traverseSelections([backingField], record, backingFieldData);
        var clientEdgeResolverResponse = backingFieldData[applicationName];
        if (clientEdgeResolverResponse == null || isSuspenseSentinel(clientEdgeResolverResponse)) {
          data[applicationName] = clientEdgeResolverResponse;
          return;
        }
        var validClientEdgeResolverResponse = assertValidClientEdgeResolverResponse(field, clientEdgeResolverResponse);
        switch (validClientEdgeResolverResponse.kind) {
          case "PluralConcrete":
            var storeIDs = getStoreIDsForPluralClientEdgeResolver(field, validClientEdgeResolverResponse.ids, this._resolverCache);
            this._clientEdgeTraversalPath.push(null);
            data[applicationName] = this._readLinkedIds(field.linkedField, storeIDs, record, data);
            this._clientEdgeTraversalPath.pop();
            break;
          case "SingularConcrete":
            var _getStoreIDAndTravers = getStoreIDAndTraversalPathSegmentForSingularClientEdgeResolver(field, validClientEdgeResolverResponse.id, this._resolverCache), storeID = _getStoreIDAndTravers[0], traversalPathSegment = _getStoreIDAndTravers[1];
            this._clientEdgeTraversalPath.push(traversalPathSegment);
            var prevData = data[applicationName];
            !(prevData == null || typeof prevData === "object") ? true ? invariant3(false, "RelayReader(): Expected data for field `%s` on record `%s` to be an object, got `%s`.", applicationName, RelayModernRecord.getDataID(record), prevData) : invariant3(false) : void 0;
            data[applicationName] = this._traverse(
              field.linkedField,
              storeID,
              // $FlowFixMe[incompatible-variance]
              prevData
            );
            this._clientEdgeTraversalPath.pop();
            break;
          default:
            validClientEdgeResolverResponse.kind;
        }
      };
      _proto._readFlightField = function _readFlightField(field, record, data) {
        var _field$alias2;
        var applicationName = (_field$alias2 = field.alias) !== null && _field$alias2 !== void 0 ? _field$alias2 : field.name;
        var storageKey = getStorageKey(field, this._variables);
        var reactFlightClientResponseRecordID = RelayModernRecord.getLinkedRecordID(record, storageKey);
        if (reactFlightClientResponseRecordID == null) {
          data[applicationName] = reactFlightClientResponseRecordID;
          if (reactFlightClientResponseRecordID === void 0) {
            this._markDataAsMissing();
          }
          return reactFlightClientResponseRecordID;
        }
        var reactFlightClientResponseRecord = this._recordSource.get(reactFlightClientResponseRecordID);
        this._seenRecords.add(reactFlightClientResponseRecordID);
        if (reactFlightClientResponseRecord == null) {
          data[applicationName] = reactFlightClientResponseRecord;
          if (reactFlightClientResponseRecord === void 0) {
            this._markDataAsMissing();
          }
          return reactFlightClientResponseRecord;
        }
        var clientResponse = getReactFlightClientResponse(reactFlightClientResponseRecord);
        data[applicationName] = clientResponse;
        return clientResponse;
      };
      _proto._readScalar = function _readScalar(field, record, data) {
        var _field$alias3;
        var applicationName = (_field$alias3 = field.alias) !== null && _field$alias3 !== void 0 ? _field$alias3 : field.name;
        var storageKey = getStorageKey(field, this._variables);
        var value = RelayModernRecord.getValue(record, storageKey);
        if (value === void 0) {
          this._markDataAsMissing();
        }
        data[applicationName] = value;
        return value;
      };
      _proto._readLink = function _readLink(field, record, data) {
        var _field$alias4;
        var applicationName = (_field$alias4 = field.alias) !== null && _field$alias4 !== void 0 ? _field$alias4 : field.name;
        var storageKey = getStorageKey(field, this._variables);
        var linkedID = RelayModernRecord.getLinkedRecordID(record, storageKey);
        if (linkedID == null) {
          data[applicationName] = linkedID;
          if (linkedID === void 0) {
            this._markDataAsMissing();
          }
          return linkedID;
        }
        var prevData = data[applicationName];
        !(prevData == null || typeof prevData === "object") ? true ? invariant3(false, "RelayReader(): Expected data for field `%s` on record `%s` to be an object, got `%s`.", applicationName, RelayModernRecord.getDataID(record), prevData) : invariant3(false) : void 0;
        var value = this._traverse(field, linkedID, prevData);
        data[applicationName] = value;
        return value;
      };
      _proto._readActorChange = function _readActorChange(field, record, data) {
        var _field$alias5;
        var applicationName = (_field$alias5 = field.alias) !== null && _field$alias5 !== void 0 ? _field$alias5 : field.name;
        var storageKey = getStorageKey(field, this._variables);
        var externalRef = RelayModernRecord.getActorLinkedRecordID(record, storageKey);
        if (externalRef == null) {
          data[applicationName] = externalRef;
          if (externalRef === void 0) {
            this._markDataAsMissing();
          }
          return data[applicationName];
        }
        var actorIdentifier = externalRef[0], dataID = externalRef[1];
        var fragmentRef = {};
        this._createFragmentPointer(field.fragmentSpread, {
          __id: dataID
        }, fragmentRef);
        data[applicationName] = {
          __fragmentRef: fragmentRef,
          __viewer: actorIdentifier
        };
        return data[applicationName];
      };
      _proto._readPluralLink = function _readPluralLink(field, record, data) {
        var storageKey = getStorageKey(field, this._variables);
        var linkedIDs = RelayModernRecord.getLinkedRecordIDs(record, storageKey);
        return this._readLinkedIds(field, linkedIDs, record, data);
      };
      _proto._readLinkedIds = function _readLinkedIds(field, linkedIDs, record, data) {
        var _this2 = this;
        var _field$alias6;
        var applicationName = (_field$alias6 = field.alias) !== null && _field$alias6 !== void 0 ? _field$alias6 : field.name;
        if (linkedIDs == null) {
          data[applicationName] = linkedIDs;
          if (linkedIDs === void 0) {
            this._markDataAsMissing();
          }
          return linkedIDs;
        }
        var prevData = data[applicationName];
        !(prevData == null || Array.isArray(prevData)) ? true ? invariant3(false, "RelayReader(): Expected data for field `%s` on record `%s` to be an array, got `%s`.", applicationName, RelayModernRecord.getDataID(record), prevData) : invariant3(false) : void 0;
        var linkedArray = prevData || [];
        linkedIDs.forEach(function(linkedID, nextIndex) {
          if (linkedID == null) {
            if (linkedID === void 0) {
              _this2._markDataAsMissing();
            }
            linkedArray[nextIndex] = linkedID;
            return;
          }
          var prevItem = linkedArray[nextIndex];
          !(prevItem == null || typeof prevItem === "object") ? true ? invariant3(false, "RelayReader(): Expected data for field `%s` on record `%s` to be an object, got `%s`.", applicationName, RelayModernRecord.getDataID(record), prevItem) : invariant3(false) : void 0;
          linkedArray[nextIndex] = _this2._traverse(field, linkedID, prevItem);
        });
        data[applicationName] = linkedArray;
        return linkedArray;
      };
      _proto._readModuleImport = function _readModuleImport(moduleImport, record, data) {
        var componentKey = getModuleComponentKey(moduleImport.documentName);
        var component = RelayModernRecord.getValue(record, componentKey);
        if (component == null) {
          if (component === void 0) {
            this._markDataAsMissing();
          }
          return;
        }
        this._createFragmentPointer({
          kind: "FragmentSpread",
          name: moduleImport.fragmentName,
          args: moduleImport.args
        }, record, data);
        data[FRAGMENT_PROP_NAME_KEY] = moduleImport.fragmentPropName;
        data[MODULE_COMPONENT_KEY] = component;
      };
      _proto._createAliasedFragmentSpread = function _createAliasedFragmentSpread(namedFragmentSpread, record) {
        var abstractKey = namedFragmentSpread.abstractKey;
        if (abstractKey == null) {
          var typeName2 = RelayModernRecord.getType(record);
          if (typeName2 == null || typeName2 !== namedFragmentSpread.type) {
            return null;
          }
        } else {
          var implementsInterface = this._implementsInterface(record, abstractKey);
          if (implementsInterface === false) {
            return null;
          } else if (implementsInterface == null) {
            this._markDataAsMissing();
            return void 0;
          }
        }
        var fieldData = {};
        this._createFragmentPointer(namedFragmentSpread.fragment, record, fieldData);
        return fieldData;
      };
      _proto._readInlineFragment = function _readInlineFragment(inlineFragment, record, data) {
        var abstractKey = inlineFragment.abstractKey;
        if (abstractKey == null) {
          var typeName2 = RelayModernRecord.getType(record);
          if (typeName2 == null || typeName2 !== inlineFragment.type) {
            return null;
          } else {
            var hasExpectedData = this._traverseSelections(inlineFragment.selections, record, data);
            if (!hasExpectedData) {
              return false;
            }
          }
        } else {
          var implementsInterface = this._implementsInterface(record, abstractKey);
          var parentIsMissingData = this._isMissingData;
          var parentIsWithinUnmatchedTypeRefinement = this._isWithinUnmatchedTypeRefinement;
          this._isWithinUnmatchedTypeRefinement = parentIsWithinUnmatchedTypeRefinement || implementsInterface === false;
          this._traverseSelections(inlineFragment.selections, record, data);
          this._isWithinUnmatchedTypeRefinement = parentIsWithinUnmatchedTypeRefinement;
          if (implementsInterface === false) {
            this._isMissingData = parentIsMissingData;
            return void 0;
          } else if (implementsInterface == null) {
            this._markDataAsMissing();
            return null;
          }
        }
        return data;
      };
      _proto._createFragmentPointer = function _createFragmentPointer(fragmentSpread, record, data) {
        var fragmentPointers = data[FRAGMENTS_KEY];
        if (fragmentPointers == null) {
          fragmentPointers = data[FRAGMENTS_KEY] = {};
        }
        !(typeof fragmentPointers === "object" && fragmentPointers != null) ? true ? invariant3(false, "RelayReader: Expected fragment spread data to be an object, got `%s`.", fragmentPointers) : invariant3(false) : void 0;
        if (data[ID_KEY] == null) {
          data[ID_KEY] = RelayModernRecord.getDataID(record);
        }
        fragmentPointers[fragmentSpread.name] = fragmentSpread.args ? getArgumentValues(fragmentSpread.args, this._variables) : {};
        data[FRAGMENT_OWNER_KEY] = this._owner;
        data[IS_WITHIN_UNMATCHED_TYPE_REFINEMENT] = this._isWithinUnmatchedTypeRefinement;
        if (RelayFeatureFlags.ENABLE_CLIENT_EDGES) {
          if (this._clientEdgeTraversalPath.length > 0 && this._clientEdgeTraversalPath[this._clientEdgeTraversalPath.length - 1] !== null) {
            data[CLIENT_EDGE_TRAVERSAL_PATH] = (0, _toConsumableArray22["default"])(this._clientEdgeTraversalPath);
          }
        }
      };
      _proto._createInlineDataOrResolverFragmentPointer = function _createInlineDataOrResolverFragmentPointer(fragmentSpreadOrFragment, record, data) {
        var fragmentPointers = data[FRAGMENTS_KEY];
        if (fragmentPointers == null) {
          fragmentPointers = data[FRAGMENTS_KEY] = {};
        }
        !(typeof fragmentPointers === "object" && fragmentPointers != null) ? true ? invariant3(false, "RelayReader: Expected fragment spread data to be an object, got `%s`.", fragmentPointers) : invariant3(false) : void 0;
        if (data[ID_KEY] == null) {
          data[ID_KEY] = RelayModernRecord.getDataID(record);
        }
        var inlineData = {};
        var parentFragmentName = this._fragmentName;
        this._fragmentName = fragmentSpreadOrFragment.name;
        var parentVariables = this._variables;
        var argumentVariables = fragmentSpreadOrFragment.args ? getArgumentValues(fragmentSpreadOrFragment.args, this._variables) : {};
        this._variables = RelayConcreteVariables.getFragmentVariables(fragmentSpreadOrFragment, this._owner.variables, argumentVariables);
        this._traverseSelections(fragmentSpreadOrFragment.selections, record, inlineData);
        this._variables = parentVariables;
        this._fragmentName = parentFragmentName;
        fragmentPointers[fragmentSpreadOrFragment.name] = inlineData;
      };
      _proto._addMissingRequiredFields = function _addMissingRequiredFields(additional) {
        if (this._missingRequiredFields == null) {
          this._missingRequiredFields = additional;
          return;
        }
        if (this._missingRequiredFields.action === "THROW") {
          return;
        }
        if (additional.action === "THROW") {
          this._missingRequiredFields = additional;
          return;
        }
        this._missingRequiredFields = {
          action: "LOG",
          fields: [].concat((0, _toConsumableArray22["default"])(this._missingRequiredFields.fields), (0, _toConsumableArray22["default"])(additional.fields))
        };
      };
      _proto._implementsInterface = function _implementsInterface(record, abstractKey) {
        var typeName2 = RelayModernRecord.getType(record);
        var typeRecord = this._recordSource.get(generateTypeID(typeName2));
        var implementsInterface = typeRecord != null ? RelayModernRecord.getValue(typeRecord, abstractKey) : null;
        return implementsInterface;
      };
      return RelayReader2;
    }();
    function getResolverValue(field, variables, fragmentKey, ownerName) {
      var resolverFunction = typeof field.resolverModule === "function" ? field.resolverModule : field.resolverModule["default"];
      var resolverResult = null;
      var resolverError = null;
      try {
        var resolverFunctionArgs = [];
        if (field.fragment != null) {
          resolverFunctionArgs.push(fragmentKey);
        }
        var args = field.args ? getArgumentValues(field.args, variables) : void 0;
        resolverFunctionArgs.push(args);
        resolverResult = resolverFunction.apply(null, resolverFunctionArgs);
      } catch (e3) {
        if (e3 === RESOLVER_FRAGMENT_MISSING_DATA_SENTINEL) {
          resolverResult = void 0;
        } else {
          var _field$path;
          var path2 = (_field$path = field.path) !== null && _field$path !== void 0 ? _field$path : "[UNKNOWN]";
          resolverError = {
            field: {
              path: path2,
              owner: ownerName
            },
            error: e3
          };
        }
      }
      return [resolverResult, resolverError];
    }
    function assertValidClientEdgeResolverResponse(field, clientEdgeResolverResponse) {
      if (field.linkedField.plural) {
        !Array.isArray(clientEdgeResolverResponse) ? true ? invariant3(false, "Expected plural Client Edge Relay Resolver to return an array containing IDs or objects with shape {id}.") : invariant3(false) : void 0;
        return {
          kind: "PluralConcrete",
          ids: clientEdgeResolverResponse.map(function(response) {
            return extractIdFromResponse(response, "Expected this plural Client Edge Relay Resolver to return an array containing IDs or objects with shape {id}.");
          })
        };
      } else {
        return {
          kind: "SingularConcrete",
          id: extractIdFromResponse(clientEdgeResolverResponse, "Expected this Client Edge Relay Resolver to return an ID of type `string` or an object with shape {id}.")
        };
      }
    }
    function getStoreIDAndTraversalPathSegmentForSingularClientEdgeResolver(field, clientEdgeResolverResponse, resolverCache) {
      if (field.kind === CLIENT_EDGE_TO_CLIENT_OBJECT) {
        if (field.backingField.normalizationInfo == null) {
          var concreteType = field.concreteType;
          !(concreteType != null) ? true ? invariant3(false, "Expected at least one of backingField.normalizationInfo or field.concreteType to be non-null. This indicates a bug in Relay.") : invariant3(false) : void 0;
          return [resolverCache.ensureClientRecord(clientEdgeResolverResponse, concreteType), null];
        } else {
          return [clientEdgeResolverResponse, null];
        }
      } else {
        return [clientEdgeResolverResponse, {
          readerClientEdge: field,
          clientEdgeDestinationID: clientEdgeResolverResponse
        }];
      }
    }
    function getStoreIDsForPluralClientEdgeResolver(field, clientEdgeResolverResponse, resolverCache) {
      if (field.kind === CLIENT_EDGE_TO_CLIENT_OBJECT) {
        if (field.backingField.normalizationInfo == null) {
          var concreteType = field.concreteType;
          !(concreteType != null) ? true ? invariant3(false, "Expected at least one of backingField.normalizationInfo or field.concreteType to be non-null. This indicates a bug in Relay.") : invariant3(false) : void 0;
          return clientEdgeResolverResponse.map(function(id2) {
            return resolverCache.ensureClientRecord(id2, concreteType);
          });
        } else {
          return clientEdgeResolverResponse;
        }
      } else {
        true ? true ? invariant3(false, "Unexpected Client Edge to plural server type. This should be prevented by the compiler.") : invariant3(false) : void 0;
      }
    }
    function extractIdFromResponse(individualResponse, errorMessage) {
      if (typeof individualResponse === "string") {
        return individualResponse;
      } else if (typeof individualResponse === "object" && individualResponse != null && typeof individualResponse.id === "string") {
        return individualResponse.id;
      }
      true ? true ? invariant3(false, errorMessage) : invariant3(false) : void 0;
    }
    module.exports = {
      read
    };
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/store/RelayPublishQueue.js
var require_RelayPublishQueue = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/store/RelayPublishQueue.js"(exports, module) {
    "use strict";
    var _global$ErrorUtils$ap;
    var _global$ErrorUtils;
    var RelayRecordSourceMutator = require_RelayRecordSourceMutator();
    var RelayRecordSourceProxy = require_RelayRecordSourceProxy();
    var RelayRecordSourceSelectorProxy = require_RelayRecordSourceSelectorProxy();
    var RelayReader = require_RelayReader();
    var RelayRecordSource = require_RelayRecordSource();
    var invariant3 = require_browser();
    var warning2 = require_warning();
    var _global = typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : void 0;
    var applyWithGuard = (_global$ErrorUtils$ap = _global === null || _global === void 0 ? void 0 : (_global$ErrorUtils = _global.ErrorUtils) === null || _global$ErrorUtils === void 0 ? void 0 : _global$ErrorUtils.applyWithGuard) !== null && _global$ErrorUtils$ap !== void 0 ? _global$ErrorUtils$ap : function(callback, context2, args, onError, name2) {
      return callback.apply(context2, args);
    };
    var RelayPublishQueue = /* @__PURE__ */ function() {
      function RelayPublishQueue2(store, handlerProvider, getDataID, missingFieldHandlers) {
        this._hasStoreSnapshot = false;
        this._handlerProvider = handlerProvider || null;
        this._pendingBackupRebase = false;
        this._pendingData = /* @__PURE__ */ new Set();
        this._pendingOptimisticUpdates = /* @__PURE__ */ new Set();
        this._store = store;
        this._appliedOptimisticUpdates = /* @__PURE__ */ new Set();
        this._gcHold = null;
        this._getDataID = getDataID;
        this._missingFieldHandlers = missingFieldHandlers;
      }
      var _proto = RelayPublishQueue2.prototype;
      _proto.applyUpdate = function applyUpdate(updater) {
        !(!this._appliedOptimisticUpdates.has(updater) && !this._pendingOptimisticUpdates.has(updater)) ? true ? invariant3(false, "RelayPublishQueue: Cannot apply the same update function more than once concurrently.") : invariant3(false) : void 0;
        this._pendingOptimisticUpdates.add(updater);
      };
      _proto.revertUpdate = function revertUpdate(updater) {
        if (this._pendingOptimisticUpdates.has(updater)) {
          this._pendingOptimisticUpdates["delete"](updater);
        } else if (this._appliedOptimisticUpdates.has(updater)) {
          this._pendingBackupRebase = true;
          this._appliedOptimisticUpdates["delete"](updater);
        }
      };
      _proto.revertAll = function revertAll() {
        this._pendingBackupRebase = true;
        this._pendingOptimisticUpdates.clear();
        this._appliedOptimisticUpdates.clear();
      };
      _proto.commitPayload = function commitPayload(operation, payload, updater) {
        this._pendingBackupRebase = true;
        this._pendingData.add({
          kind: "payload",
          operation,
          payload,
          updater
        });
      };
      _proto.commitUpdate = function commitUpdate(updater) {
        this._pendingBackupRebase = true;
        this._pendingData.add({
          kind: "updater",
          updater
        });
      };
      _proto.commitSource = function commitSource(source) {
        this._pendingBackupRebase = true;
        this._pendingData.add({
          kind: "source",
          source
        });
      };
      _proto.run = function run2(sourceOperation) {
        var runWillClearGcHold = this._appliedOptimisticUpdates === 0 && !!this._gcHold;
        var runIsANoop = (
          // this._pendingBackupRebase is true if an applied optimistic
          // update has potentially been reverted or if this._pendingData is not empty.
          !this._pendingBackupRebase && this._pendingOptimisticUpdates.size === 0 && !runWillClearGcHold
        );
        if (true) {
          true ? warning2(!runIsANoop, "RelayPublishQueue.run was called, but the call would have been a noop.") : void 0;
          true ? warning2(this._isRunning !== true, "A store update was detected within another store update. Please make sure new store updates aren't being executed within an updater function for a different update.") : void 0;
          this._isRunning = true;
        }
        if (runIsANoop) {
          if (true) {
            this._isRunning = false;
          }
          return [];
        }
        if (this._pendingBackupRebase) {
          if (this._hasStoreSnapshot) {
            this._store.restore();
            this._hasStoreSnapshot = false;
          }
        }
        var invalidatedStore = this._commitData();
        if (this._pendingOptimisticUpdates.size || this._pendingBackupRebase && this._appliedOptimisticUpdates.size) {
          if (!this._hasStoreSnapshot) {
            this._store.snapshot();
            this._hasStoreSnapshot = true;
          }
          this._applyUpdates();
        }
        this._pendingBackupRebase = false;
        if (this._appliedOptimisticUpdates.size > 0) {
          if (!this._gcHold) {
            this._gcHold = this._store.holdGC();
          }
        } else {
          if (this._gcHold) {
            this._gcHold.dispose();
            this._gcHold = null;
          }
        }
        if (true) {
          this._isRunning = false;
        }
        return this._store.notify(sourceOperation, invalidatedStore);
      };
      _proto._publishSourceFromPayload = function _publishSourceFromPayload(pendingPayload) {
        var _this = this;
        var payload = pendingPayload.payload, operation = pendingPayload.operation, updater = pendingPayload.updater;
        var source = payload.source, fieldPayloads = payload.fieldPayloads;
        var mutator = new RelayRecordSourceMutator(this._store.getSource(), source);
        var recordSourceProxy = new RelayRecordSourceProxy(mutator, this._getDataID, this._handlerProvider, this._missingFieldHandlers);
        if (fieldPayloads && fieldPayloads.length) {
          fieldPayloads.forEach(function(fieldPayload) {
            var handler = _this._handlerProvider && _this._handlerProvider(fieldPayload.handle);
            !handler ? true ? invariant3(false, "RelayModernEnvironment: Expected a handler to be provided for handle `%s`.", fieldPayload.handle) : invariant3(false) : void 0;
            handler.update(recordSourceProxy, fieldPayload);
          });
        }
        if (updater) {
          var selector = operation.fragment;
          !(selector != null) ? true ? invariant3(false, "RelayModernEnvironment: Expected a selector to be provided with updater function.") : invariant3(false) : void 0;
          var recordSourceSelectorProxy = new RelayRecordSourceSelectorProxy(mutator, recordSourceProxy, selector, this._missingFieldHandlers);
          var selectorData = lookupSelector(source, selector);
          updater(recordSourceSelectorProxy, selectorData);
        }
        var idsMarkedForInvalidation = recordSourceProxy.getIDsMarkedForInvalidation();
        this._store.publish(source, idsMarkedForInvalidation);
        return recordSourceProxy.isStoreMarkedForInvalidation();
      };
      _proto._commitData = function _commitData() {
        var _this2 = this;
        if (!this._pendingData.size) {
          return false;
        }
        var invalidatedStore = false;
        this._pendingData.forEach(function(data) {
          if (data.kind === "payload") {
            var payloadInvalidatedStore = _this2._publishSourceFromPayload(data);
            invalidatedStore = invalidatedStore || payloadInvalidatedStore;
          } else if (data.kind === "source") {
            var source = data.source;
            _this2._store.publish(source);
          } else {
            var updater = data.updater;
            var sink = RelayRecordSource.create();
            var mutator = new RelayRecordSourceMutator(_this2._store.getSource(), sink);
            var recordSourceProxy = new RelayRecordSourceProxy(mutator, _this2._getDataID, _this2._handlerProvider, _this2._missingFieldHandlers);
            applyWithGuard(updater, null, [recordSourceProxy], null, "RelayPublishQueue:commitData");
            invalidatedStore = invalidatedStore || recordSourceProxy.isStoreMarkedForInvalidation();
            var idsMarkedForInvalidation = recordSourceProxy.getIDsMarkedForInvalidation();
            _this2._store.publish(sink, idsMarkedForInvalidation);
          }
        });
        this._pendingData.clear();
        return invalidatedStore;
      };
      _proto._applyUpdates = function _applyUpdates() {
        var _this3 = this;
        var sink = RelayRecordSource.create();
        var mutator = new RelayRecordSourceMutator(this._store.getSource(), sink);
        var recordSourceProxy = new RelayRecordSourceProxy(mutator, this._getDataID, this._handlerProvider, this._missingFieldHandlers);
        var processUpdate = function processUpdate2(optimisticUpdate) {
          if (optimisticUpdate.storeUpdater) {
            var storeUpdater = optimisticUpdate.storeUpdater;
            applyWithGuard(storeUpdater, null, [recordSourceProxy], null, "RelayPublishQueue:applyUpdates");
          } else {
            var operation = optimisticUpdate.operation, payload = optimisticUpdate.payload, updater = optimisticUpdate.updater;
            var source = payload.source, fieldPayloads = payload.fieldPayloads;
            if (source) {
              recordSourceProxy.publishSource(source, fieldPayloads);
            }
            if (updater) {
              var selectorData;
              if (source) {
                selectorData = lookupSelector(source, operation.fragment);
              }
              var recordSourceSelectorProxy = new RelayRecordSourceSelectorProxy(mutator, recordSourceProxy, operation.fragment, _this3._missingFieldHandlers);
              applyWithGuard(updater, null, [recordSourceSelectorProxy, selectorData], null, "RelayPublishQueue:applyUpdates");
            }
          }
        };
        if (this._pendingBackupRebase && this._appliedOptimisticUpdates.size) {
          this._appliedOptimisticUpdates.forEach(processUpdate);
        }
        if (this._pendingOptimisticUpdates.size) {
          this._pendingOptimisticUpdates.forEach(function(optimisticUpdate) {
            processUpdate(optimisticUpdate);
            _this3._appliedOptimisticUpdates.add(optimisticUpdate);
          });
          this._pendingOptimisticUpdates.clear();
        }
        this._store.publish(sink);
      };
      return RelayPublishQueue2;
    }();
    function lookupSelector(source, selector) {
      var selectorData = RelayReader.read(source, selector).data;
      if (true) {
        var deepFreeze = require_deepFreeze();
        if (selectorData) {
          deepFreeze(selectorData);
        }
      }
      return selectorData;
    }
    module.exports = RelayPublishQueue;
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/store/StoreInspector.js
var require_StoreInspector = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/store/StoreInspector.js"(exports, module) {
    "use strict";
    var _interopRequireDefault = require_interopRequireDefault()["default"];
    var _objectSpread210 = _interopRequireDefault(require_objectSpread2());
    var _toConsumableArray22 = _interopRequireDefault(require_toConsumableArray());
    var inspect = function inspect2() {
    };
    if (true) {
      formattersInstalled = false;
      installDevtoolFormatters = function installDevtoolFormatters2() {
        var _window$devtoolsForma;
        if (formattersInstalled) {
          return;
        }
        formattersInstalled = true;
        if (window.devtoolsFormatters == null) {
          window.devtoolsFormatters = [];
        }
        if (!Array.isArray(window.devtoolsFormatters)) {
          return;
        }
        console.info('Make sure to select "Enable custom formatters" in the Chrome Developer Tools settings, tab "Preferences" under the "Console" section.');
        (_window$devtoolsForma = window.devtoolsFormatters).push.apply(_window$devtoolsForma, (0, _toConsumableArray22["default"])(createFormatters()));
      };
      createFormatters = function createFormatters2() {
        var listStyle = {
          style: "list-style-type: none; padding: 0; margin: 0 0 0 12px; font-style: normal"
        };
        var keyStyle = {
          style: "rgb(136, 19, 145)"
        };
        var nullStyle = {
          style: "color: #777"
        };
        var reference = function reference2(object, config2) {
          return object == null ? ["span", nullStyle, "undefined"] : ["object", {
            object,
            config: config2
          }];
        };
        var renderRecordHeader = function renderRecordHeader2(record) {
          return ["span", {
            style: "font-style: italic"
          }, record.__typename, ["span", nullStyle, ' {id: "', record.__id, '", \u2026}']];
        };
        var isRecord = function isRecord2(o) {
          return o != null && typeof o.__id === "string";
        };
        var RecordEntry = function RecordEntry2(key, value) {
          this.key = key;
          this.value = value;
        };
        var renderRecordEntries = function renderRecordEntries2(record) {
          var children = Object.keys(record).map(function(key) {
            return ["li", {}, ["object", {
              object: new RecordEntry(key, record[key])
            }]];
          });
          return ["ol", listStyle].concat((0, _toConsumableArray22["default"])(children));
        };
        var recordFormatter = {
          header: function header(obj) {
            if (!isRecord(obj)) {
              return null;
            }
            return renderRecordHeader(obj);
          },
          hasBody: function hasBody(obj) {
            return true;
          },
          body: function body(obj) {
            return renderRecordEntries(obj);
          }
        };
        var recordEntryFormatter = {
          header: function header(obj) {
            if (obj instanceof RecordEntry) {
              var value = isRecord(obj.value) ? renderRecordHeader(obj.value) : reference(obj.value);
              return ["span", keyStyle, obj.key, ": ", value];
            }
            return null;
          },
          hasBody: function hasBody(obj) {
            return isRecord(obj.value);
          },
          body: function body(obj) {
            return renderRecordEntries(obj.value);
          }
        };
        return [recordFormatter, recordEntryFormatter];
      };
      getWrappedRecord = function getWrappedRecord2(source, dataID) {
        var record = source.get(dataID);
        if (record == null) {
          return record;
        }
        return new Proxy((0, _objectSpread210["default"])({}, record), {
          get: function get3(target, prop) {
            var value = target[prop];
            if (value == null) {
              return value;
            }
            if (typeof value === "object") {
              if (typeof value.__ref === "string") {
                return getWrappedRecord2(source, value.__ref);
              }
              if (Array.isArray(value.__refs)) {
                return value.__refs.map(function(ref) {
                  return getWrappedRecord2(source, ref);
                });
              }
            }
            return value;
          }
        });
      };
      inspect = function inspect2(environment, dataID) {
        installDevtoolFormatters();
        return getWrappedRecord(environment.getStore().getSource(), dataID !== null && dataID !== void 0 ? dataID : "client:root");
      };
    }
    var formattersInstalled;
    var installDevtoolFormatters;
    var createFormatters;
    var getWrappedRecord;
    module.exports = {
      inspect
    };
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/store/RelayModernEnvironment.js
var require_RelayModernEnvironment = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/store/RelayModernEnvironment.js"(exports, module) {
    "use strict";
    var _interopRequireDefault = require_interopRequireDefault()["default"];
    var _objectSpread210 = _interopRequireDefault(require_objectSpread2());
    var RelayDefaultHandlerProvider = require_RelayDefaultHandlerProvider();
    var _require = require_ActorIdentifier();
    var INTERNAL_ACTOR_IDENTIFIER_DO_NOT_USE = _require.INTERNAL_ACTOR_IDENTIFIER_DO_NOT_USE;
    var assertInternalActorIdentifier = _require.assertInternalActorIdentifier;
    var RelayObservable = require_RelayObservable();
    var wrapNetworkWithLogObserver = require_wrapNetworkWithLogObserver();
    var RelayOperationTracker = require_RelayOperationTracker();
    var registerEnvironmentWithDevTools = require_registerEnvironmentWithDevTools();
    var RelayFeatureFlags = require_RelayFeatureFlags();
    var defaultGetDataID = require_defaultGetDataID();
    var defaultRequiredFieldLogger = require_defaultRequiredFieldLogger();
    var OperationExecutor = require_OperationExecutor();
    var RelayPublishQueue = require_RelayPublishQueue();
    var RelayRecordSource = require_RelayRecordSource();
    var invariant3 = require_browser();
    var RelayModernEnvironment = /* @__PURE__ */ function() {
      function RelayModernEnvironment2(config2) {
        var _this = this;
        var _config$log, _config$requiredField, _config$UNSTABLE_defa, _config$getDataID, _config$missingFieldH, _config$handlerProvid, _config$scheduler, _config$isServer, _config$operationTrac;
        this.configName = config2.configName;
        this._treatMissingFieldsAsNull = config2.treatMissingFieldsAsNull === true;
        var operationLoader = config2.operationLoader;
        var reactFlightPayloadDeserializer = config2.reactFlightPayloadDeserializer;
        var reactFlightServerErrorHandler = config2.reactFlightServerErrorHandler;
        if (true) {
          if (operationLoader != null) {
            !(typeof operationLoader === "object" && typeof operationLoader.get === "function" && typeof operationLoader.load === "function") ? true ? invariant3(false, "RelayModernEnvironment: Expected `operationLoader` to be an object with get() and load() functions, got `%s`.", operationLoader) : invariant3(false) : void 0;
          }
          if (reactFlightPayloadDeserializer != null) {
            !(typeof reactFlightPayloadDeserializer === "function") ? true ? invariant3(false, "RelayModernEnvironment: Expected `reactFlightPayloadDeserializer`  to be a function, got `%s`.", reactFlightPayloadDeserializer) : invariant3(false) : void 0;
          }
        }
        this.__log = (_config$log = config2.log) !== null && _config$log !== void 0 ? _config$log : emptyFunction;
        this.requiredFieldLogger = (_config$requiredField = config2.requiredFieldLogger) !== null && _config$requiredField !== void 0 ? _config$requiredField : defaultRequiredFieldLogger;
        this._defaultRenderPolicy = ((_config$UNSTABLE_defa = config2.UNSTABLE_defaultRenderPolicy) !== null && _config$UNSTABLE_defa !== void 0 ? _config$UNSTABLE_defa : RelayFeatureFlags.ENABLE_PARTIAL_RENDERING_DEFAULT === true) ? "partial" : "full";
        this._operationLoader = operationLoader;
        this._operationExecutions = /* @__PURE__ */ new Map();
        this._network = wrapNetworkWithLogObserver(this, config2.network);
        this._getDataID = (_config$getDataID = config2.getDataID) !== null && _config$getDataID !== void 0 ? _config$getDataID : defaultGetDataID;
        this._missingFieldHandlers = (_config$missingFieldH = config2.missingFieldHandlers) !== null && _config$missingFieldH !== void 0 ? _config$missingFieldH : [];
        this._publishQueue = new RelayPublishQueue(config2.store, (_config$handlerProvid = config2.handlerProvider) !== null && _config$handlerProvid !== void 0 ? _config$handlerProvid : RelayDefaultHandlerProvider, this._getDataID, this._missingFieldHandlers);
        this._scheduler = (_config$scheduler = config2.scheduler) !== null && _config$scheduler !== void 0 ? _config$scheduler : null;
        this._store = config2.store;
        this.options = config2.options;
        this._isServer = (_config$isServer = config2.isServer) !== null && _config$isServer !== void 0 ? _config$isServer : false;
        this.__setNet = function(newNet) {
          return _this._network = wrapNetworkWithLogObserver(_this, newNet);
        };
        if (true) {
          var _require2 = require_StoreInspector(), inspect = _require2.inspect;
          this.DEBUG_inspect = function(dataID) {
            return inspect(_this, dataID);
          };
        }
        this._operationTracker = (_config$operationTrac = config2.operationTracker) !== null && _config$operationTrac !== void 0 ? _config$operationTrac : new RelayOperationTracker();
        this._reactFlightPayloadDeserializer = reactFlightPayloadDeserializer;
        this._reactFlightServerErrorHandler = reactFlightServerErrorHandler;
        this._shouldProcessClientComponents = config2.shouldProcessClientComponents;
        registerEnvironmentWithDevTools(this);
      }
      var _proto = RelayModernEnvironment2.prototype;
      _proto.getStore = function getStore() {
        return this._store;
      };
      _proto.getNetwork = function getNetwork() {
        return this._network;
      };
      _proto.getOperationTracker = function getOperationTracker() {
        return this._operationTracker;
      };
      _proto.getScheduler = function getScheduler() {
        return this._scheduler;
      };
      _proto.isRequestActive = function isRequestActive(requestIdentifier) {
        var activeState = this._operationExecutions.get(requestIdentifier);
        return activeState === "active";
      };
      _proto.UNSTABLE_getDefaultRenderPolicy = function UNSTABLE_getDefaultRenderPolicy() {
        return this._defaultRenderPolicy;
      };
      _proto.applyUpdate = function applyUpdate(optimisticUpdate) {
        var _this2 = this;
        var dispose2 = function dispose3() {
          _this2._scheduleUpdates(function() {
            _this2._publishQueue.revertUpdate(optimisticUpdate);
            _this2._publishQueue.run();
          });
        };
        this._scheduleUpdates(function() {
          _this2._publishQueue.applyUpdate(optimisticUpdate);
          _this2._publishQueue.run();
        });
        return {
          dispose: dispose2
        };
      };
      _proto.revertUpdate = function revertUpdate(update) {
        var _this3 = this;
        this._scheduleUpdates(function() {
          _this3._publishQueue.revertUpdate(update);
          _this3._publishQueue.run();
        });
      };
      _proto.replaceUpdate = function replaceUpdate(update, newUpdate) {
        var _this4 = this;
        this._scheduleUpdates(function() {
          _this4._publishQueue.revertUpdate(update);
          _this4._publishQueue.applyUpdate(newUpdate);
          _this4._publishQueue.run();
        });
      };
      _proto.applyMutation = function applyMutation(optimisticConfig) {
        var subscription2 = this._execute({
          createSource: function createSource() {
            return RelayObservable.create(function(_sink) {
            });
          },
          isClientPayload: false,
          operation: optimisticConfig.operation,
          optimisticConfig,
          updater: null
        }).subscribe({});
        return {
          dispose: function dispose2() {
            return subscription2.unsubscribe();
          }
        };
      };
      _proto.check = function check(operation) {
        if (this._missingFieldHandlers.length === 0 && !operationHasClientAbstractTypes(operation)) {
          return this._store.check(operation);
        }
        return this._checkSelectorAndHandleMissingFields(operation, this._missingFieldHandlers);
      };
      _proto.commitPayload = function commitPayload(operation, payload) {
        this._execute({
          createSource: function createSource() {
            return RelayObservable.from({
              data: payload
            });
          },
          isClientPayload: true,
          operation,
          optimisticConfig: null,
          updater: null
        }).subscribe({});
      };
      _proto.commitUpdate = function commitUpdate(updater) {
        var _this5 = this;
        this._scheduleUpdates(function() {
          _this5._publishQueue.commitUpdate(updater);
          _this5._publishQueue.run();
        });
      };
      _proto.lookup = function lookup(readSelector) {
        return this._store.lookup(readSelector);
      };
      _proto.subscribe = function subscribe(snapshot, callback) {
        return this._store.subscribe(snapshot, callback);
      };
      _proto.retain = function retain(operation) {
        return this._store.retain(operation);
      };
      _proto.isServer = function isServer() {
        return this._isServer;
      };
      _proto._checkSelectorAndHandleMissingFields = function _checkSelectorAndHandleMissingFields(operation, handlers2) {
        var _this6 = this;
        var target = RelayRecordSource.create();
        var source = this._store.getSource();
        var result = this._store.check(operation, {
          handlers: handlers2,
          defaultActorIdentifier: INTERNAL_ACTOR_IDENTIFIER_DO_NOT_USE,
          getSourceForActor: function getSourceForActor(actorIdentifier) {
            assertInternalActorIdentifier(actorIdentifier);
            return source;
          },
          getTargetForActor: function getTargetForActor(actorIdentifier) {
            assertInternalActorIdentifier(actorIdentifier);
            return target;
          }
        });
        if (target.size() > 0) {
          this._scheduleUpdates(function() {
            _this6._publishQueue.commitSource(target);
            _this6._publishQueue.run();
          });
        }
        return result;
      };
      _proto._scheduleUpdates = function _scheduleUpdates(task) {
        var scheduler = this._scheduler;
        if (scheduler != null) {
          scheduler.schedule(task);
        } else {
          task();
        }
      };
      _proto.execute = function execute(_ref18) {
        var _this7 = this;
        var operation = _ref18.operation;
        return this._execute({
          createSource: function createSource() {
            return _this7.getNetwork().execute(operation.request.node.params, operation.request.variables, operation.request.cacheConfig || {}, null);
          },
          isClientPayload: false,
          operation,
          optimisticConfig: null,
          updater: null
        });
      };
      _proto.executeSubscription = function executeSubscription(_ref22) {
        var _this8 = this;
        var operation = _ref22.operation, updater = _ref22.updater;
        return this._execute({
          createSource: function createSource() {
            return _this8.getNetwork().execute(operation.request.node.params, operation.request.variables, operation.request.cacheConfig || {}, null);
          },
          isClientPayload: false,
          operation,
          optimisticConfig: null,
          updater
        });
      };
      _proto.executeMutation = function executeMutation(_ref32) {
        var _this9 = this;
        var operation = _ref32.operation, optimisticResponse = _ref32.optimisticResponse, optimisticUpdater = _ref32.optimisticUpdater, updater = _ref32.updater, uploadables = _ref32.uploadables;
        var optimisticConfig;
        if (optimisticResponse || optimisticUpdater) {
          optimisticConfig = {
            operation,
            response: optimisticResponse,
            updater: optimisticUpdater
          };
        }
        return this._execute({
          createSource: function createSource() {
            return _this9.getNetwork().execute(operation.request.node.params, operation.request.variables, (0, _objectSpread210["default"])((0, _objectSpread210["default"])({}, operation.request.cacheConfig), {}, {
              force: true
            }), uploadables);
          },
          isClientPayload: false,
          operation,
          optimisticConfig,
          updater
        });
      };
      _proto.executeWithSource = function executeWithSource(_ref42) {
        var operation = _ref42.operation, source = _ref42.source;
        return this._execute({
          createSource: function createSource() {
            return source;
          },
          isClientPayload: false,
          operation,
          optimisticConfig: null,
          updater: null
        });
      };
      _proto.toJSON = function toJSON2() {
        var _this$configName;
        return "RelayModernEnvironment(".concat((_this$configName = this.configName) !== null && _this$configName !== void 0 ? _this$configName : "", ")");
      };
      _proto._execute = function _execute(_ref52) {
        var _this10 = this;
        var createSource = _ref52.createSource, isClientPayload = _ref52.isClientPayload, operation = _ref52.operation, optimisticConfig = _ref52.optimisticConfig, updater = _ref52.updater;
        var publishQueue = this._publishQueue;
        var store = this._store;
        return RelayObservable.create(function(sink) {
          var executor = OperationExecutor.execute({
            actorIdentifier: INTERNAL_ACTOR_IDENTIFIER_DO_NOT_USE,
            getDataID: _this10._getDataID,
            isClientPayload,
            log: _this10.__log,
            operation,
            operationExecutions: _this10._operationExecutions,
            operationLoader: _this10._operationLoader,
            operationTracker: _this10._operationTracker,
            optimisticConfig,
            getPublishQueue: function getPublishQueue(actorIdentifier) {
              assertInternalActorIdentifier(actorIdentifier);
              return publishQueue;
            },
            reactFlightPayloadDeserializer: _this10._reactFlightPayloadDeserializer,
            reactFlightServerErrorHandler: _this10._reactFlightServerErrorHandler,
            scheduler: _this10._scheduler,
            shouldProcessClientComponents: _this10._shouldProcessClientComponents,
            sink,
            // NOTE: Some product tests expect `Network.execute` to be called only
            //       when the Observable is executed.
            source: createSource(),
            getStore: function getStore(actorIdentifier) {
              assertInternalActorIdentifier(actorIdentifier);
              return store;
            },
            treatMissingFieldsAsNull: _this10._treatMissingFieldsAsNull,
            updater
          });
          return function() {
            return executor.cancel();
          };
        });
      };
      return RelayModernEnvironment2;
    }();
    function operationHasClientAbstractTypes(operation) {
      return operation.root.node.kind === "Operation" && operation.root.node.clientAbstractTypes != null;
    }
    RelayModernEnvironment.prototype["@@RelayModernEnvironment"] = true;
    function emptyFunction() {
    }
    module.exports = RelayModernEnvironment;
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/util/resolveImmediate.js
var require_resolveImmediate = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/util/resolveImmediate.js"(exports, module) {
    "use strict";
    var resolvedPromise = Promise.resolve();
    function resolveImmediate(callback) {
      resolvedPromise.then(callback)["catch"](throwNext);
    }
    function throwNext(error) {
      setTimeout(function() {
        throw error;
      }, 0);
    }
    module.exports = resolveImmediate;
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/store/cloneRelayHandleSourceField.js
var require_cloneRelayHandleSourceField = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/store/cloneRelayHandleSourceField.js"(exports, module) {
    "use strict";
    var _require = require_RelayConcreteNode();
    var LINKED_FIELD = _require.LINKED_FIELD;
    var _require2 = require_RelayStoreUtils();
    var getHandleStorageKey = _require2.getHandleStorageKey;
    var areEqual2 = require_areEqual();
    var invariant3 = require_browser();
    function cloneRelayHandleSourceField(handleField, selections, variables) {
      var sourceField = selections.find(function(source) {
        return source.kind === LINKED_FIELD && source.name === handleField.name && source.alias === handleField.alias && areEqual2(source.args, handleField.args);
      });
      !(sourceField && sourceField.kind === LINKED_FIELD) ? true ? invariant3(false, "cloneRelayHandleSourceField: Expected a corresponding source field for handle `%s`.", handleField.handle) : invariant3(false) : void 0;
      var handleKey = getHandleStorageKey(handleField, variables);
      return {
        kind: "LinkedField",
        alias: sourceField.alias,
        name: handleKey,
        storageKey: handleKey,
        args: null,
        concreteType: sourceField.concreteType,
        plural: sourceField.plural,
        selections: sourceField.selections
      };
    }
    module.exports = cloneRelayHandleSourceField;
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/store/cloneRelayScalarHandleSourceField.js
var require_cloneRelayScalarHandleSourceField = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/store/cloneRelayScalarHandleSourceField.js"(exports, module) {
    "use strict";
    var _require = require_RelayConcreteNode();
    var SCALAR_FIELD = _require.SCALAR_FIELD;
    var _require2 = require_RelayStoreUtils();
    var getHandleStorageKey = _require2.getHandleStorageKey;
    var areEqual2 = require_areEqual();
    var invariant3 = require_browser();
    function cloneRelayScalarHandleSourceField(handleField, selections, variables) {
      var sourceField = selections.find(function(source) {
        return source.kind === SCALAR_FIELD && source.name === handleField.name && source.alias === handleField.alias && areEqual2(source.args, handleField.args);
      });
      !(sourceField && sourceField.kind === SCALAR_FIELD) ? true ? invariant3(false, "cloneRelayScalarHandleSourceField: Expected a corresponding source field for handle `%s`.", handleField.handle) : invariant3(false) : void 0;
      var handleKey = getHandleStorageKey(handleField, variables);
      return {
        kind: "ScalarField",
        alias: sourceField.alias,
        name: handleKey,
        storageKey: handleKey,
        args: null
      };
    }
    module.exports = cloneRelayScalarHandleSourceField;
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/store/DataChecker.js
var require_DataChecker = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/store/DataChecker.js"(exports, module) {
    "use strict";
    var _interopRequireDefault = require_interopRequireDefault()["default"];
    var _createForOfIteratorHelper2 = _interopRequireDefault(require_createForOfIteratorHelper());
    var RelayRecordSourceMutator = require_RelayRecordSourceMutator();
    var RelayRecordSourceProxy = require_RelayRecordSourceProxy();
    var getOperation = require_getOperation();
    var RelayConcreteNode = require_RelayConcreteNode();
    var RelayFeatureFlags = require_RelayFeatureFlags();
    var _require = require_ClientID();
    var isClientID = _require.isClientID;
    var cloneRelayHandleSourceField = require_cloneRelayHandleSourceField();
    var cloneRelayScalarHandleSourceField = require_cloneRelayScalarHandleSourceField();
    var _require2 = require_RelayConcreteVariables();
    var getLocalVariables = _require2.getLocalVariables;
    var RelayModernRecord = require_RelayModernRecord();
    var _require3 = require_RelayRecordState();
    var EXISTENT = _require3.EXISTENT;
    var UNKNOWN = _require3.UNKNOWN;
    var RelayStoreReactFlightUtils = require_RelayStoreReactFlightUtils();
    var RelayStoreUtils = require_RelayStoreUtils();
    var _require4 = require_TypeID();
    var TYPE_SCHEMA_TYPE = _require4.TYPE_SCHEMA_TYPE;
    var generateTypeID = _require4.generateTypeID;
    var invariant3 = require_browser();
    var ACTOR_CHANGE = RelayConcreteNode.ACTOR_CHANGE;
    var CONDITION = RelayConcreteNode.CONDITION;
    var CLIENT_COMPONENT = RelayConcreteNode.CLIENT_COMPONENT;
    var CLIENT_EXTENSION = RelayConcreteNode.CLIENT_EXTENSION;
    var CLIENT_EDGE_TO_CLIENT_OBJECT = RelayConcreteNode.CLIENT_EDGE_TO_CLIENT_OBJECT;
    var DEFER = RelayConcreteNode.DEFER;
    var FLIGHT_FIELD = RelayConcreteNode.FLIGHT_FIELD;
    var FRAGMENT_SPREAD = RelayConcreteNode.FRAGMENT_SPREAD;
    var INLINE_FRAGMENT = RelayConcreteNode.INLINE_FRAGMENT;
    var LINKED_FIELD = RelayConcreteNode.LINKED_FIELD;
    var LINKED_HANDLE = RelayConcreteNode.LINKED_HANDLE;
    var MODULE_IMPORT = RelayConcreteNode.MODULE_IMPORT;
    var RELAY_RESOLVER = RelayConcreteNode.RELAY_RESOLVER;
    var SCALAR_FIELD = RelayConcreteNode.SCALAR_FIELD;
    var SCALAR_HANDLE = RelayConcreteNode.SCALAR_HANDLE;
    var STREAM = RelayConcreteNode.STREAM;
    var TYPE_DISCRIMINATOR = RelayConcreteNode.TYPE_DISCRIMINATOR;
    var ROOT_ID = RelayStoreUtils.ROOT_ID;
    var getModuleOperationKey = RelayStoreUtils.getModuleOperationKey;
    var getStorageKey = RelayStoreUtils.getStorageKey;
    var getArgumentValues = RelayStoreUtils.getArgumentValues;
    function check(getSourceForActor, getTargetForActor, defaultActorIdentifier, selector, handlers2, operationLoader, getDataID, shouldProcessClientComponents) {
      var dataID = selector.dataID, node56 = selector.node, variables = selector.variables;
      var checker = new DataChecker(getSourceForActor, getTargetForActor, defaultActorIdentifier, variables, handlers2, operationLoader, getDataID, shouldProcessClientComponents);
      return checker.check(node56, dataID);
    }
    var DataChecker = /* @__PURE__ */ function() {
      function DataChecker2(getSourceForActor, getTargetForActor, defaultActorIdentifier, variables, handlers2, operationLoader, getDataID, shouldProcessClientComponents) {
        this._getSourceForActor = getSourceForActor;
        this._getTargetForActor = getTargetForActor;
        this._getDataID = getDataID;
        this._source = getSourceForActor(defaultActorIdentifier);
        this._mutatorRecordSourceProxyCache = /* @__PURE__ */ new Map();
        var _this$_getMutatorAndR = this._getMutatorAndRecordProxyForActor(defaultActorIdentifier), mutator = _this$_getMutatorAndR[0], recordSourceProxy = _this$_getMutatorAndR[1];
        this._mostRecentlyInvalidatedAt = null;
        this._handlers = handlers2;
        this._mutator = mutator;
        this._operationLoader = operationLoader !== null && operationLoader !== void 0 ? operationLoader : null;
        this._recordSourceProxy = recordSourceProxy;
        this._recordWasMissing = false;
        this._variables = variables;
        this._shouldProcessClientComponents = shouldProcessClientComponents;
      }
      var _proto = DataChecker2.prototype;
      _proto._getMutatorAndRecordProxyForActor = function _getMutatorAndRecordProxyForActor(actorIdentifier) {
        var tuple = this._mutatorRecordSourceProxyCache.get(actorIdentifier);
        if (tuple == null) {
          var target = this._getTargetForActor(actorIdentifier);
          var mutator = new RelayRecordSourceMutator(this._getSourceForActor(actorIdentifier), target);
          var recordSourceProxy = new RelayRecordSourceProxy(mutator, this._getDataID, void 0, this._handlers);
          tuple = [mutator, recordSourceProxy];
          this._mutatorRecordSourceProxyCache.set(actorIdentifier, tuple);
        }
        return tuple;
      };
      _proto.check = function check2(node56, dataID) {
        this._assignClientAbstractTypes(node56);
        this._traverse(node56, dataID);
        return this._recordWasMissing === true ? {
          status: "missing",
          mostRecentlyInvalidatedAt: this._mostRecentlyInvalidatedAt
        } : {
          status: "available",
          mostRecentlyInvalidatedAt: this._mostRecentlyInvalidatedAt
        };
      };
      _proto._getVariableValue = function _getVariableValue(name2) {
        !this._variables.hasOwnProperty(name2) ? true ? invariant3(false, "RelayAsyncLoader(): Undefined variable `%s`.", name2) : invariant3(false) : void 0;
        return this._variables[name2];
      };
      _proto._handleMissing = function _handleMissing() {
        this._recordWasMissing = true;
      };
      _proto._handleMissingScalarField = function _handleMissingScalarField(field, dataID) {
        if (field.name === "id" && field.alias == null && isClientID(dataID)) {
          return void 0;
        }
        var args = field.args != void 0 ? getArgumentValues(field.args, this._variables) : {};
        var _iterator = (0, _createForOfIteratorHelper2["default"])(this._handlers), _step;
        try {
          for (_iterator.s(); !(_step = _iterator.n()).done; ) {
            var handler = _step.value;
            if (handler.kind === "scalar") {
              var newValue = handler.handle(field, this._recordSourceProxy.get(dataID), args, this._recordSourceProxy);
              if (newValue !== void 0) {
                return newValue;
              }
            }
          }
        } catch (err) {
          _iterator.e(err);
        } finally {
          _iterator.f();
        }
        this._handleMissing();
      };
      _proto._handleMissingLinkField = function _handleMissingLinkField(field, dataID) {
        var args = field.args != void 0 ? getArgumentValues(field.args, this._variables) : {};
        var _iterator2 = (0, _createForOfIteratorHelper2["default"])(this._handlers), _step2;
        try {
          for (_iterator2.s(); !(_step2 = _iterator2.n()).done; ) {
            var handler = _step2.value;
            if (handler.kind === "linked") {
              var newValue = handler.handle(field, this._recordSourceProxy.get(dataID), args, this._recordSourceProxy);
              if (newValue !== void 0 && (newValue === null || this._mutator.getStatus(newValue) === EXISTENT)) {
                return newValue;
              }
            }
          }
        } catch (err) {
          _iterator2.e(err);
        } finally {
          _iterator2.f();
        }
        this._handleMissing();
      };
      _proto._handleMissingPluralLinkField = function _handleMissingPluralLinkField(field, dataID) {
        var _this = this;
        var args = field.args != void 0 ? getArgumentValues(field.args, this._variables) : {};
        var _iterator3 = (0, _createForOfIteratorHelper2["default"])(this._handlers), _step3;
        try {
          for (_iterator3.s(); !(_step3 = _iterator3.n()).done; ) {
            var handler = _step3.value;
            if (handler.kind === "pluralLinked") {
              var newValue = handler.handle(field, this._recordSourceProxy.get(dataID), args, this._recordSourceProxy);
              if (newValue != null) {
                var allItemsKnown = newValue.every(function(linkedID) {
                  return linkedID != null && _this._mutator.getStatus(linkedID) === EXISTENT;
                });
                if (allItemsKnown) {
                  return newValue;
                }
              } else if (newValue === null) {
                return null;
              }
            }
          }
        } catch (err) {
          _iterator3.e(err);
        } finally {
          _iterator3.f();
        }
        this._handleMissing();
      };
      _proto._traverse = function _traverse(node56, dataID) {
        var status = this._mutator.getStatus(dataID);
        if (status === UNKNOWN) {
          this._handleMissing();
        }
        if (status === EXISTENT) {
          var record = this._source.get(dataID);
          var invalidatedAt = RelayModernRecord.getInvalidationEpoch(record);
          if (invalidatedAt != null) {
            this._mostRecentlyInvalidatedAt = this._mostRecentlyInvalidatedAt != null ? Math.max(this._mostRecentlyInvalidatedAt, invalidatedAt) : invalidatedAt;
          }
          this._traverseSelections(node56.selections, dataID);
        }
      };
      _proto._traverseSelections = function _traverseSelections(selections, dataID) {
        var _this2 = this;
        selections.forEach(function(selection2) {
          switch (selection2.kind) {
            case SCALAR_FIELD:
              _this2._checkScalar(selection2, dataID);
              break;
            case LINKED_FIELD:
              if (selection2.plural) {
                _this2._checkPluralLink(selection2, dataID);
              } else {
                _this2._checkLink(selection2, dataID);
              }
              break;
            case ACTOR_CHANGE:
              _this2._checkActorChange(selection2.linkedField, dataID);
              break;
            case CONDITION:
              var conditionValue = Boolean(_this2._getVariableValue(selection2.condition));
              if (conditionValue === selection2.passingValue) {
                _this2._traverseSelections(selection2.selections, dataID);
              }
              break;
            case INLINE_FRAGMENT: {
              var _abstractKey = selection2.abstractKey;
              if (_abstractKey == null) {
                var typeName2 = _this2._mutator.getType(dataID);
                if (typeName2 === selection2.type) {
                  _this2._traverseSelections(selection2.selections, dataID);
                }
              } else {
                var _recordType = _this2._mutator.getType(dataID);
                !(_recordType != null) ? true ? invariant3(false, "DataChecker: Expected record `%s` to have a known type", dataID) : invariant3(false) : void 0;
                var _typeID = generateTypeID(_recordType);
                var _implementsInterface = _this2._mutator.getValue(_typeID, _abstractKey);
                if (_implementsInterface === true) {
                  _this2._traverseSelections(selection2.selections, dataID);
                } else if (_implementsInterface == null) {
                  _this2._handleMissing();
                }
              }
              break;
            }
            case LINKED_HANDLE: {
              var handleField = cloneRelayHandleSourceField(selection2, selections, _this2._variables);
              if (handleField.plural) {
                _this2._checkPluralLink(handleField, dataID);
              } else {
                _this2._checkLink(handleField, dataID);
              }
              break;
            }
            case SCALAR_HANDLE: {
              var _handleField = cloneRelayScalarHandleSourceField(selection2, selections, _this2._variables);
              _this2._checkScalar(_handleField, dataID);
              break;
            }
            case MODULE_IMPORT:
              _this2._checkModuleImport(selection2, dataID);
              break;
            case DEFER:
            case STREAM:
              _this2._traverseSelections(selection2.selections, dataID);
              break;
            case FRAGMENT_SPREAD:
              var prevVariables = _this2._variables;
              _this2._variables = getLocalVariables(_this2._variables, selection2.fragment.argumentDefinitions, selection2.args);
              _this2._traverseSelections(selection2.fragment.selections, dataID);
              _this2._variables = prevVariables;
              break;
            case CLIENT_EXTENSION:
              var recordWasMissing = _this2._recordWasMissing;
              _this2._traverseSelections(selection2.selections, dataID);
              _this2._recordWasMissing = recordWasMissing;
              break;
            case TYPE_DISCRIMINATOR:
              var abstractKey = selection2.abstractKey;
              var recordType = _this2._mutator.getType(dataID);
              !(recordType != null) ? true ? invariant3(false, "DataChecker: Expected record `%s` to have a known type", dataID) : invariant3(false) : void 0;
              var typeID = generateTypeID(recordType);
              var implementsInterface = _this2._mutator.getValue(typeID, abstractKey);
              if (implementsInterface == null) {
                _this2._handleMissing();
              }
              break;
            case FLIGHT_FIELD:
              if (RelayFeatureFlags.ENABLE_REACT_FLIGHT_COMPONENT_FIELD) {
                _this2._checkFlightField(selection2, dataID);
              } else {
                throw new Error("Flight fields are not yet supported.");
              }
              break;
            case CLIENT_COMPONENT:
              if (_this2._shouldProcessClientComponents === false) {
                break;
              }
              _this2._traverseSelections(selection2.fragment.selections, dataID);
              break;
            case RELAY_RESOLVER:
              _this2._checkResolver(selection2, dataID);
              break;
            case CLIENT_EDGE_TO_CLIENT_OBJECT:
              _this2._checkResolver(selection2.backingField, dataID);
              break;
            default:
              selection2;
              true ? true ? invariant3(false, "RelayAsyncLoader(): Unexpected ast kind `%s`.", selection2.kind) : invariant3(false) : void 0;
          }
        });
      };
      _proto._checkResolver = function _checkResolver(resolver, dataID) {
        if (resolver.fragment) {
          this._traverseSelections([resolver.fragment], dataID);
        }
      };
      _proto._checkModuleImport = function _checkModuleImport(moduleImport, dataID) {
        var operationLoader = this._operationLoader;
        !(operationLoader !== null) ? true ? invariant3(false, "DataChecker: Expected an operationLoader to be configured when using `@module`.") : invariant3(false) : void 0;
        var operationKey = getModuleOperationKey(moduleImport.documentName);
        var operationReference = this._mutator.getValue(dataID, operationKey);
        if (operationReference == null) {
          if (operationReference === void 0) {
            this._handleMissing();
          }
          return;
        }
        var normalizationRootNode = operationLoader.get(operationReference);
        if (normalizationRootNode != null) {
          var operation = getOperation(normalizationRootNode);
          var prevVariables = this._variables;
          this._variables = getLocalVariables(this._variables, operation.argumentDefinitions, moduleImport.args);
          this._traverse(operation, dataID);
          this._variables = prevVariables;
        } else {
          this._handleMissing();
        }
      };
      _proto._checkScalar = function _checkScalar(field, dataID) {
        var storageKey = getStorageKey(field, this._variables);
        var fieldValue = this._mutator.getValue(dataID, storageKey);
        if (fieldValue === void 0) {
          fieldValue = this._handleMissingScalarField(field, dataID);
          if (fieldValue !== void 0) {
            this._mutator.setValue(dataID, storageKey, fieldValue);
          }
        }
      };
      _proto._checkLink = function _checkLink(field, dataID) {
        var storageKey = getStorageKey(field, this._variables);
        var linkedID = this._mutator.getLinkedRecordID(dataID, storageKey);
        if (linkedID === void 0) {
          linkedID = this._handleMissingLinkField(field, dataID);
          if (linkedID != null) {
            this._mutator.setLinkedRecordID(dataID, storageKey, linkedID);
          } else if (linkedID === null) {
            this._mutator.setValue(dataID, storageKey, null);
          }
        }
        if (linkedID != null) {
          this._traverse(field, linkedID);
        }
      };
      _proto._checkPluralLink = function _checkPluralLink(field, dataID) {
        var _this3 = this;
        var storageKey = getStorageKey(field, this._variables);
        var linkedIDs = this._mutator.getLinkedRecordIDs(dataID, storageKey);
        if (linkedIDs === void 0) {
          linkedIDs = this._handleMissingPluralLinkField(field, dataID);
          if (linkedIDs != null) {
            this._mutator.setLinkedRecordIDs(dataID, storageKey, linkedIDs);
          } else if (linkedIDs === null) {
            this._mutator.setValue(dataID, storageKey, null);
          }
        }
        if (linkedIDs) {
          linkedIDs.forEach(function(linkedID) {
            if (linkedID != null) {
              _this3._traverse(field, linkedID);
            }
          });
        }
      };
      _proto._checkActorChange = function _checkActorChange(field, dataID) {
        var storageKey = getStorageKey(field, this._variables);
        var record = this._source.get(dataID);
        var tuple = record != null ? RelayModernRecord.getActorLinkedRecordID(record, storageKey) : record;
        if (tuple == null) {
          if (tuple === void 0) {
            this._handleMissing();
          }
        } else {
          var actorIdentifier = tuple[0], linkedID = tuple[1];
          var prevSource = this._source;
          var prevMutator = this._mutator;
          var prevRecordSourceProxy = this._recordSourceProxy;
          var _this$_getMutatorAndR2 = this._getMutatorAndRecordProxyForActor(actorIdentifier), mutator = _this$_getMutatorAndR2[0], recordSourceProxy = _this$_getMutatorAndR2[1];
          this._source = this._getSourceForActor(actorIdentifier);
          this._mutator = mutator;
          this._recordSourceProxy = recordSourceProxy;
          this._assignClientAbstractTypes(field);
          this._traverse(field, linkedID);
          this._source = prevSource;
          this._mutator = prevMutator;
          this._recordSourceProxy = prevRecordSourceProxy;
        }
      };
      _proto._checkFlightField = function _checkFlightField(field, dataID) {
        var storageKey = getStorageKey(field, this._variables);
        var linkedID = this._mutator.getLinkedRecordID(dataID, storageKey);
        if (linkedID == null) {
          if (linkedID === void 0) {
            this._handleMissing();
            return;
          }
          return;
        }
        var tree = this._mutator.getValue(linkedID, RelayStoreReactFlightUtils.REACT_FLIGHT_TREE_STORAGE_KEY);
        var reachableExecutableDefinitions = this._mutator.getValue(linkedID, RelayStoreReactFlightUtils.REACT_FLIGHT_EXECUTABLE_DEFINITIONS_STORAGE_KEY);
        if (tree == null || !Array.isArray(reachableExecutableDefinitions)) {
          this._handleMissing();
          return;
        }
        var operationLoader = this._operationLoader;
        !(operationLoader !== null) ? true ? invariant3(false, "DataChecker: Expected an operationLoader to be configured when using React Flight.") : invariant3(false) : void 0;
        var prevVariables = this._variables;
        var _iterator4 = (0, _createForOfIteratorHelper2["default"])(reachableExecutableDefinitions), _step4;
        try {
          for (_iterator4.s(); !(_step4 = _iterator4.n()).done; ) {
            var definition = _step4.value;
            this._variables = definition.variables;
            var normalizationRootNode = operationLoader.get(definition.module);
            if (normalizationRootNode != null) {
              var operation = getOperation(normalizationRootNode);
              this._traverseSelections(operation.selections, ROOT_ID);
            } else {
              this._handleMissing();
            }
          }
        } catch (err) {
          _iterator4.e(err);
        } finally {
          _iterator4.f();
        }
        this._variables = prevVariables;
      };
      _proto._assignClientAbstractTypes = function _assignClientAbstractTypes(node56) {
        var clientAbstractTypes = node56.clientAbstractTypes;
        if (clientAbstractTypes != null) {
          for (var _i = 0, _Object$keys = Object.keys(clientAbstractTypes); _i < _Object$keys.length; _i++) {
            var abstractType = _Object$keys[_i];
            var _iterator5 = (0, _createForOfIteratorHelper2["default"])(clientAbstractTypes[abstractType]), _step5;
            try {
              for (_iterator5.s(); !(_step5 = _iterator5.n()).done; ) {
                var concreteType = _step5.value;
                var typeID = generateTypeID(concreteType);
                if (this._source.get(typeID) == null) {
                  this._mutator.create(typeID, TYPE_SCHEMA_TYPE);
                }
                if (this._mutator.getValue(typeID, abstractType) == null) {
                  this._mutator.setValue(typeID, abstractType, true);
                }
              }
            } catch (err) {
              _iterator5.e(err);
            } finally {
              _iterator5.f();
            }
          }
        }
      };
      return DataChecker2;
    }();
    module.exports = {
      check
    };
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/store/RelayOptimisticRecordSource.js
var require_RelayOptimisticRecordSource = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/store/RelayOptimisticRecordSource.js"(exports, module) {
    "use strict";
    var _interopRequireDefault = require_interopRequireDefault()["default"];
    var _objectSpread210 = _interopRequireDefault(require_objectSpread2());
    var RelayRecordSource = require_RelayRecordSource();
    var invariant3 = require_browser();
    var UNPUBLISH_RECORD_SENTINEL = Object.freeze({
      __UNPUBLISH_RECORD_SENTINEL: true
    });
    var RelayOptimisticRecordSource = /* @__PURE__ */ function() {
      function RelayOptimisticRecordSource2(base2) {
        this._base = base2;
        this._sink = RelayRecordSource.create();
      }
      var _proto = RelayOptimisticRecordSource2.prototype;
      _proto.has = function has2(dataID) {
        if (this._sink.has(dataID)) {
          var sinkRecord = this._sink.get(dataID);
          return sinkRecord !== UNPUBLISH_RECORD_SENTINEL;
        } else {
          return this._base.has(dataID);
        }
      };
      _proto.get = function get3(dataID) {
        if (this._sink.has(dataID)) {
          var sinkRecord = this._sink.get(dataID);
          if (sinkRecord === UNPUBLISH_RECORD_SENTINEL) {
            return void 0;
          } else {
            return sinkRecord;
          }
        } else {
          return this._base.get(dataID);
        }
      };
      _proto.getStatus = function getStatus(dataID) {
        var record = this.get(dataID);
        if (record === void 0) {
          return "UNKNOWN";
        } else if (record === null) {
          return "NONEXISTENT";
        } else {
          return "EXISTENT";
        }
      };
      _proto.clear = function clear2() {
        this._base = RelayRecordSource.create();
        this._sink.clear();
      };
      _proto["delete"] = function _delete(dataID) {
        this._sink["delete"](dataID);
      };
      _proto.remove = function remove2(dataID) {
        this._sink.set(dataID, UNPUBLISH_RECORD_SENTINEL);
      };
      _proto.set = function set3(dataID, record) {
        this._sink.set(dataID, record);
      };
      _proto.getRecordIDs = function getRecordIDs() {
        return Object.keys(this.toJSON());
      };
      _proto.size = function size() {
        return Object.keys(this.toJSON()).length;
      };
      _proto.toJSON = function toJSON2() {
        var _this = this;
        var merged = (0, _objectSpread210["default"])({}, this._base.toJSON());
        this._sink.getRecordIDs().forEach(function(dataID) {
          var record = _this.get(dataID);
          if (record === void 0) {
            delete merged[dataID];
          } else {
            merged[dataID] = record;
          }
        });
        return merged;
      };
      _proto.getOptimisticRecordIDs = function getOptimisticRecordIDs2() {
        return new Set(this._sink.getRecordIDs());
      };
      return RelayOptimisticRecordSource2;
    }();
    function create4(base2) {
      return new RelayOptimisticRecordSource(base2);
    }
    function getOptimisticRecordIDs(source) {
      !(source instanceof RelayOptimisticRecordSource) ? true ? invariant3(false, "getOptimisticRecordIDs: Instance of RelayOptimisticRecordSource is expected") : invariant3(false) : void 0;
      return source.getOptimisticRecordIDs();
    }
    module.exports = {
      create: create4,
      getOptimisticRecordIDs
    };
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/store/experimental-live-resolvers/getOutputTypeRecordIDs.js
var require_getOutputTypeRecordIDs = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/store/experimental-live-resolvers/getOutputTypeRecordIDs.js"(exports, module) {
    "use strict";
    var RelayModernRecord = require_RelayModernRecord();
    var _require = require_RelayStoreUtils();
    var RELAY_RESOLVER_OUTPUT_TYPE_RECORD_IDS = _require.RELAY_RESOLVER_OUTPUT_TYPE_RECORD_IDS;
    var invariant3 = require_browser();
    function getOutputTypeRecordIDs(record) {
      var maybeOutputTypeRecordIDs = RelayModernRecord.getValue(record, RELAY_RESOLVER_OUTPUT_TYPE_RECORD_IDS);
      if (maybeOutputTypeRecordIDs == null) {
        return null;
      }
      !(maybeOutputTypeRecordIDs instanceof Set) ? true ? invariant3(false, "getOutputTypeRecordIDs: Expected the `%s` field on record `%s` to be of type Set. Instead, it is a %s.", RELAY_RESOLVER_OUTPUT_TYPE_RECORD_IDS, typeof maybeOutputTypeRecordIDs) : invariant3(false) : void 0;
      return maybeOutputTypeRecordIDs;
    }
    module.exports = getOutputTypeRecordIDs;
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/store/RelayReferenceMarker.js
var require_RelayReferenceMarker = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/store/RelayReferenceMarker.js"(exports, module) {
    "use strict";
    var _interopRequireDefault = require_interopRequireDefault()["default"];
    var _createForOfIteratorHelper2 = _interopRequireDefault(require_createForOfIteratorHelper());
    var getOperation = require_getOperation();
    var RelayConcreteNode = require_RelayConcreteNode();
    var RelayFeatureFlags = require_RelayFeatureFlags();
    var cloneRelayHandleSourceField = require_cloneRelayHandleSourceField();
    var getOutputTypeRecordIDs = require_getOutputTypeRecordIDs();
    var _require = require_RelayConcreteVariables();
    var getLocalVariables = _require.getLocalVariables;
    var RelayModernRecord = require_RelayModernRecord();
    var RelayStoreReactFlightUtils = require_RelayStoreReactFlightUtils();
    var RelayStoreUtils = require_RelayStoreUtils();
    var _require2 = require_TypeID();
    var generateTypeID = _require2.generateTypeID;
    var invariant3 = require_browser();
    var ACTOR_CHANGE = RelayConcreteNode.ACTOR_CHANGE;
    var CONDITION = RelayConcreteNode.CONDITION;
    var CLIENT_COMPONENT = RelayConcreteNode.CLIENT_COMPONENT;
    var CLIENT_EXTENSION = RelayConcreteNode.CLIENT_EXTENSION;
    var DEFER = RelayConcreteNode.DEFER;
    var FLIGHT_FIELD = RelayConcreteNode.FLIGHT_FIELD;
    var FRAGMENT_SPREAD = RelayConcreteNode.FRAGMENT_SPREAD;
    var INLINE_FRAGMENT = RelayConcreteNode.INLINE_FRAGMENT;
    var LINKED_FIELD = RelayConcreteNode.LINKED_FIELD;
    var MODULE_IMPORT = RelayConcreteNode.MODULE_IMPORT;
    var LINKED_HANDLE = RelayConcreteNode.LINKED_HANDLE;
    var SCALAR_FIELD = RelayConcreteNode.SCALAR_FIELD;
    var SCALAR_HANDLE = RelayConcreteNode.SCALAR_HANDLE;
    var STREAM = RelayConcreteNode.STREAM;
    var TYPE_DISCRIMINATOR = RelayConcreteNode.TYPE_DISCRIMINATOR;
    var RELAY_RESOLVER = RelayConcreteNode.RELAY_RESOLVER;
    var CLIENT_EDGE_TO_CLIENT_OBJECT = RelayConcreteNode.CLIENT_EDGE_TO_CLIENT_OBJECT;
    var ROOT_ID = RelayStoreUtils.ROOT_ID;
    var getStorageKey = RelayStoreUtils.getStorageKey;
    var getModuleOperationKey = RelayStoreUtils.getModuleOperationKey;
    function mark(recordSource, selector, references, operationLoader, shouldProcessClientComponents) {
      var dataID = selector.dataID, node56 = selector.node, variables = selector.variables;
      var marker = new RelayReferenceMarker(recordSource, variables, references, operationLoader, shouldProcessClientComponents);
      marker.mark(node56, dataID);
    }
    var RelayReferenceMarker = /* @__PURE__ */ function() {
      function RelayReferenceMarker2(recordSource, variables, references, operationLoader, shouldProcessClientComponents) {
        this._operationLoader = operationLoader !== null && operationLoader !== void 0 ? operationLoader : null;
        this._operationName = null;
        this._recordSource = recordSource;
        this._references = references;
        this._variables = variables;
        this._shouldProcessClientComponents = shouldProcessClientComponents;
      }
      var _proto = RelayReferenceMarker2.prototype;
      _proto.mark = function mark2(node56, dataID) {
        if (node56.kind === "Operation" || node56.kind === "SplitOperation") {
          this._operationName = node56.name;
        }
        this._traverse(node56, dataID);
      };
      _proto._traverse = function _traverse(node56, dataID) {
        this._references.add(dataID);
        var record = this._recordSource.get(dataID);
        if (record == null) {
          return;
        }
        this._traverseSelections(node56.selections, record);
      };
      _proto._getVariableValue = function _getVariableValue(name2) {
        !this._variables.hasOwnProperty(name2) ? true ? invariant3(false, "RelayReferenceMarker(): Undefined variable `%s`.", name2) : invariant3(false) : void 0;
        return this._variables[name2];
      };
      _proto._traverseSelections = function _traverseSelections(selections, record) {
        var _this = this;
        selections.forEach(function(selection2) {
          switch (selection2.kind) {
            case ACTOR_CHANGE:
              _this._traverseLink(selection2.linkedField, record);
              break;
            case LINKED_FIELD:
              if (selection2.plural) {
                _this._traversePluralLink(selection2, record);
              } else {
                _this._traverseLink(selection2, record);
              }
              break;
            case CONDITION:
              var conditionValue = Boolean(_this._getVariableValue(selection2.condition));
              if (conditionValue === selection2.passingValue) {
                _this._traverseSelections(selection2.selections, record);
              }
              break;
            case INLINE_FRAGMENT:
              if (selection2.abstractKey == null) {
                var typeName2 = RelayModernRecord.getType(record);
                if (typeName2 != null && typeName2 === selection2.type || // Our root record has a special type of `__Root` which may not
                // match the schema type of Query/Mutation or whatever the schema
                // specifies.
                //
                // If we have an inline fragment on a concrete type within an
                // operation root, and our query has been validated, we know that
                // concrete type must match, since the operation selection must be
                // on a concrete type.
                typeName2 === RelayStoreUtils.ROOT_TYPE) {
                  _this._traverseSelections(selection2.selections, record);
                }
              } else {
                var _typeName = RelayModernRecord.getType(record);
                var typeID = generateTypeID(_typeName);
                _this._references.add(typeID);
                _this._traverseSelections(selection2.selections, record);
              }
              break;
            case FRAGMENT_SPREAD:
              var prevVariables = _this._variables;
              _this._variables = getLocalVariables(_this._variables, selection2.fragment.argumentDefinitions, selection2.args);
              _this._traverseSelections(selection2.fragment.selections, record);
              _this._variables = prevVariables;
              break;
            case LINKED_HANDLE:
              var handleField = cloneRelayHandleSourceField(selection2, selections, _this._variables);
              if (handleField.plural) {
                _this._traversePluralLink(handleField, record);
              } else {
                _this._traverseLink(handleField, record);
              }
              break;
            case DEFER:
            case STREAM:
              _this._traverseSelections(selection2.selections, record);
              break;
            case SCALAR_FIELD:
            case SCALAR_HANDLE:
              break;
            case TYPE_DISCRIMINATOR: {
              var _typeName2 = RelayModernRecord.getType(record);
              var _typeID = generateTypeID(_typeName2);
              _this._references.add(_typeID);
              break;
            }
            case MODULE_IMPORT:
              _this._traverseModuleImport(selection2, record);
              break;
            case CLIENT_EXTENSION:
              _this._traverseSelections(selection2.selections, record);
              break;
            case FLIGHT_FIELD:
              if (RelayFeatureFlags.ENABLE_REACT_FLIGHT_COMPONENT_FIELD) {
                _this._traverseFlightField(selection2, record);
              } else {
                throw new Error("Flight fields are not yet supported.");
              }
              break;
            case CLIENT_COMPONENT:
              if (_this._shouldProcessClientComponents === false) {
                break;
              }
              _this._traverseSelections(selection2.fragment.selections, record);
              break;
            case RELAY_RESOLVER:
              _this._traverseResolverField(selection2, record);
              break;
            case CLIENT_EDGE_TO_CLIENT_OBJECT:
              _this._traverseClientEdgeToClientObject(selection2, record);
              break;
            default:
              selection2;
              true ? true ? invariant3(false, "RelayReferenceMarker: Unknown AST node `%s`.", selection2) : invariant3(false) : void 0;
          }
        });
      };
      _proto._traverseClientEdgeToClientObject = function _traverseClientEdgeToClientObject(field, record) {
        var dataID = this._traverseResolverField(field.backingField, record);
        if (dataID == null) {
          return;
        }
        var resolverRecord = this._recordSource.get(dataID);
        if (resolverRecord == null) {
          return;
        }
        if (field.backingField.isOutputType) {
          var outputTypeRecordIDs = getOutputTypeRecordIDs(resolverRecord);
          if (outputTypeRecordIDs != null) {
            var _iterator = (0, _createForOfIteratorHelper2["default"])(outputTypeRecordIDs), _step;
            try {
              for (_iterator.s(); !(_step = _iterator.n()).done; ) {
                var _dataID = _step.value;
                this._references.add(_dataID);
              }
            } catch (err) {
              _iterator.e(err);
            } finally {
              _iterator.f();
            }
          }
        } else {
          var linkedField = field.linkedField;
          var concreteType = linkedField.concreteType;
          if (concreteType == null) {
            return;
          }
          if (linkedField.plural) {
            var dataIDs = RelayModernRecord.getResolverLinkedRecordIDs(resolverRecord, concreteType);
            if (dataIDs != null) {
              var _iterator2 = (0, _createForOfIteratorHelper2["default"])(dataIDs), _step2;
              try {
                for (_iterator2.s(); !(_step2 = _iterator2.n()).done; ) {
                  var _dataID2 = _step2.value;
                  if (_dataID2 != null) {
                    this._traverse(linkedField, _dataID2);
                  }
                }
              } catch (err) {
                _iterator2.e(err);
              } finally {
                _iterator2.f();
              }
            }
          } else {
            var _dataID3 = RelayModernRecord.getResolverLinkedRecordID(resolverRecord, concreteType);
            if (_dataID3 != null) {
              this._traverse(linkedField, _dataID3);
            }
          }
        }
      };
      _proto._traverseResolverField = function _traverseResolverField(field, record) {
        var storageKey = getStorageKey(field, this._variables);
        var dataID = RelayModernRecord.getLinkedRecordID(record, storageKey);
        if (dataID != null) {
          this._references.add(dataID);
        }
        var fragment2 = field.fragment;
        if (fragment2 != null) {
          this._traverseSelections([fragment2], record);
        }
        return dataID;
      };
      _proto._traverseModuleImport = function _traverseModuleImport(moduleImport, record) {
        var _this$_operationName;
        var operationLoader = this._operationLoader;
        !(operationLoader !== null) ? true ? invariant3(false, "RelayReferenceMarker: Expected an operationLoader to be configured when using `@module`. Could not load fragment `%s` in operation `%s`.", moduleImport.fragmentName, (_this$_operationName = this._operationName) !== null && _this$_operationName !== void 0 ? _this$_operationName : "(unknown)") : invariant3(false) : void 0;
        var operationKey = getModuleOperationKey(moduleImport.documentName);
        var operationReference = RelayModernRecord.getValue(record, operationKey);
        if (operationReference == null) {
          return;
        }
        var normalizationRootNode = operationLoader.get(operationReference);
        if (normalizationRootNode != null) {
          var operation = getOperation(normalizationRootNode);
          var prevVariables = this._variables;
          this._variables = getLocalVariables(this._variables, operation.argumentDefinitions, moduleImport.args);
          this._traverseSelections(operation.selections, record);
          this._variables = prevVariables;
        }
      };
      _proto._traverseLink = function _traverseLink(field, record) {
        var storageKey = getStorageKey(field, this._variables);
        var linkedID = RelayModernRecord.getLinkedRecordID(record, storageKey);
        if (linkedID == null) {
          return;
        }
        this._traverse(field, linkedID);
      };
      _proto._traversePluralLink = function _traversePluralLink(field, record) {
        var _this2 = this;
        var storageKey = getStorageKey(field, this._variables);
        var linkedIDs = RelayModernRecord.getLinkedRecordIDs(record, storageKey);
        if (linkedIDs == null) {
          return;
        }
        linkedIDs.forEach(function(linkedID) {
          if (linkedID != null) {
            _this2._traverse(field, linkedID);
          }
        });
      };
      _proto._traverseFlightField = function _traverseFlightField(field, record) {
        var storageKey = getStorageKey(field, this._variables);
        var linkedID = RelayModernRecord.getLinkedRecordID(record, storageKey);
        if (linkedID == null) {
          return;
        }
        this._references.add(linkedID);
        var reactFlightClientResponseRecord = this._recordSource.get(linkedID);
        if (reactFlightClientResponseRecord == null) {
          return;
        }
        var reachableExecutableDefinitions = RelayModernRecord.getValue(reactFlightClientResponseRecord, RelayStoreReactFlightUtils.REACT_FLIGHT_EXECUTABLE_DEFINITIONS_STORAGE_KEY);
        if (!Array.isArray(reachableExecutableDefinitions)) {
          return;
        }
        var operationLoader = this._operationLoader;
        !(operationLoader !== null) ? true ? invariant3(false, "DataChecker: Expected an operationLoader to be configured when using React Flight") : invariant3(false) : void 0;
        var prevVariables = this._variables;
        var _iterator3 = (0, _createForOfIteratorHelper2["default"])(reachableExecutableDefinitions), _step3;
        try {
          for (_iterator3.s(); !(_step3 = _iterator3.n()).done; ) {
            var definition = _step3.value;
            this._variables = definition.variables;
            var operationReference = definition.module;
            var normalizationRootNode = operationLoader.get(operationReference);
            if (normalizationRootNode != null) {
              var operation = getOperation(normalizationRootNode);
              this._traverse(operation, ROOT_ID);
            }
          }
        } catch (err) {
          _iterator3.e(err);
        } finally {
          _iterator3.f();
        }
        this._variables = prevVariables;
      };
      return RelayReferenceMarker2;
    }();
    module.exports = {
      mark
    };
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/store/hasOverlappingIDs.js
var require_hasOverlappingIDs = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/store/hasOverlappingIDs.js"(exports, module) {
    "use strict";
    var ITERATOR_KEY = Symbol.iterator;
    function hasOverlappingIDs(seenRecords, updatedRecordIDs) {
      var iterator = seenRecords[ITERATOR_KEY]();
      var next2 = iterator.next();
      while (!next2.done) {
        var key = next2.value;
        if (updatedRecordIDs.has(key)) {
          return true;
        }
        next2 = iterator.next();
      }
      return false;
    }
    module.exports = hasOverlappingIDs;
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/store/RelayStoreSubscriptions.js
var require_RelayStoreSubscriptions = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/store/RelayStoreSubscriptions.js"(exports, module) {
    "use strict";
    var deepFreeze = require_deepFreeze();
    var recycleNodesInto = require_recycleNodesInto();
    var RelayFeatureFlags = require_RelayFeatureFlags();
    var hasOverlappingIDs = require_hasOverlappingIDs();
    var RelayReader = require_RelayReader();
    var RelayStoreSubscriptions = /* @__PURE__ */ function() {
      function RelayStoreSubscriptions2(log2, resolverCache) {
        this._subscriptions = /* @__PURE__ */ new Set();
        this.__log = log2;
        this._resolverCache = resolverCache;
      }
      var _proto = RelayStoreSubscriptions2.prototype;
      _proto.subscribe = function subscribe(snapshot, callback) {
        var _this = this;
        var subscription2 = {
          backup: null,
          callback,
          snapshot,
          stale: false
        };
        var dispose2 = function dispose3() {
          _this._subscriptions["delete"](subscription2);
        };
        this._subscriptions.add(subscription2);
        return {
          dispose: dispose2
        };
      };
      _proto.snapshotSubscriptions = function snapshotSubscriptions(source) {
        var _this2 = this;
        this._subscriptions.forEach(function(subscription2) {
          if (!subscription2.stale) {
            subscription2.backup = subscription2.snapshot;
            return;
          }
          var snapshot = subscription2.snapshot;
          var backup = RelayReader.read(source, snapshot.selector, _this2._resolverCache);
          var nextData = recycleNodesInto(snapshot.data, backup.data);
          backup.data = nextData;
          subscription2.backup = backup;
        });
      };
      _proto.restoreSubscriptions = function restoreSubscriptions() {
        this._subscriptions.forEach(function(subscription2) {
          var backup = subscription2.backup;
          subscription2.backup = null;
          if (backup) {
            if (backup.data !== subscription2.snapshot.data) {
              subscription2.stale = true;
            }
            subscription2.snapshot = {
              data: subscription2.snapshot.data,
              isMissingData: backup.isMissingData,
              missingClientEdges: backup.missingClientEdges,
              missingLiveResolverFields: backup.missingLiveResolverFields,
              seenRecords: backup.seenRecords,
              selector: backup.selector,
              missingRequiredFields: backup.missingRequiredFields,
              relayResolverErrors: backup.relayResolverErrors
            };
          } else {
            subscription2.stale = true;
          }
        });
      };
      _proto.updateSubscriptions = function updateSubscriptions(source, updatedRecordIDs, updatedOwners, sourceOperation) {
        var _this3 = this;
        var hasUpdatedRecords = updatedRecordIDs.size !== 0;
        this._subscriptions.forEach(function(subscription2) {
          var owner = _this3._updateSubscription(source, subscription2, updatedRecordIDs, hasUpdatedRecords, sourceOperation);
          if (owner != null) {
            updatedOwners.push(owner);
          }
        });
      };
      _proto._updateSubscription = function _updateSubscription(source, subscription2, updatedRecordIDs, hasUpdatedRecords, sourceOperation) {
        var backup = subscription2.backup, callback = subscription2.callback, snapshot = subscription2.snapshot, stale = subscription2.stale;
        var hasOverlappingUpdates = hasUpdatedRecords && hasOverlappingIDs(snapshot.seenRecords, updatedRecordIDs);
        if (!stale && !hasOverlappingUpdates) {
          return;
        }
        var nextSnapshot = hasOverlappingUpdates || !backup ? RelayReader.read(source, snapshot.selector, this._resolverCache) : backup;
        var nextData = recycleNodesInto(snapshot.data, nextSnapshot.data);
        nextSnapshot = {
          data: nextData,
          isMissingData: nextSnapshot.isMissingData,
          missingClientEdges: nextSnapshot.missingClientEdges,
          missingLiveResolverFields: nextSnapshot.missingLiveResolverFields,
          seenRecords: nextSnapshot.seenRecords,
          selector: nextSnapshot.selector,
          missingRequiredFields: nextSnapshot.missingRequiredFields,
          relayResolverErrors: nextSnapshot.relayResolverErrors
        };
        if (true) {
          deepFreeze(nextSnapshot);
        }
        subscription2.snapshot = nextSnapshot;
        subscription2.stale = false;
        if (nextSnapshot.data !== snapshot.data) {
          if (this.__log && RelayFeatureFlags.ENABLE_NOTIFY_SUBSCRIPTION) {
            this.__log({
              name: "store.notify.subscription",
              sourceOperation,
              snapshot,
              nextSnapshot
            });
          }
          callback(nextSnapshot);
          return snapshot.selector.owner;
        }
      };
      return RelayStoreSubscriptions2;
    }();
    module.exports = RelayStoreSubscriptions;
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/store/RelayModernStore.js
var require_RelayModernStore = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/store/RelayModernStore.js"(exports, module) {
    "use strict";
    var _interopRequireDefault = require_interopRequireDefault()["default"];
    var _createForOfIteratorHelper2 = _interopRequireDefault(require_createForOfIteratorHelper());
    var _defineProperty210 = _interopRequireDefault(require_defineProperty());
    var _require = require_ActorIdentifier();
    var INTERNAL_ACTOR_IDENTIFIER_DO_NOT_USE = _require.INTERNAL_ACTOR_IDENTIFIER_DO_NOT_USE;
    var assertInternalActorIdentifier = _require.assertInternalActorIdentifier;
    var deepFreeze = require_deepFreeze();
    var RelayFeatureFlags = require_RelayFeatureFlags();
    var resolveImmediate = require_resolveImmediate();
    var DataChecker = require_DataChecker();
    var defaultGetDataID = require_defaultGetDataID();
    var RelayModernRecord = require_RelayModernRecord();
    var RelayOptimisticRecordSource = require_RelayOptimisticRecordSource();
    var RelayReader = require_RelayReader();
    var RelayReferenceMarker = require_RelayReferenceMarker();
    var RelayStoreReactFlightUtils = require_RelayStoreReactFlightUtils();
    var RelayStoreSubscriptions = require_RelayStoreSubscriptions();
    var RelayStoreUtils = require_RelayStoreUtils();
    var _require2 = require_RelayStoreUtils();
    var ROOT_ID = _require2.ROOT_ID;
    var ROOT_TYPE = _require2.ROOT_TYPE;
    var _require3 = require_ResolverCache();
    var RecordResolverCache = _require3.RecordResolverCache;
    var invariant3 = require_browser();
    var DEFAULT_RELEASE_BUFFER_SIZE = 10;
    var RelayModernStore = /* @__PURE__ */ function() {
      function RelayModernStore2(source, options) {
        var _this = this;
        var _options$gcReleaseBuf, _options$gcScheduler, _options$getDataID, _options$log, _options$operationLoa;
        (0, _defineProperty210["default"])(this, "_gcStep", function() {
          if (_this._gcRun) {
            if (_this._gcRun.next().done) {
              _this._gcRun = null;
            } else {
              _this._gcScheduler(_this._gcStep);
            }
          }
        });
        if (true) {
          var storeIDs = source.getRecordIDs();
          for (var ii = 0; ii < storeIDs.length; ii++) {
            var record = source.get(storeIDs[ii]);
            if (record) {
              RelayModernRecord.freeze(record);
            }
          }
        }
        this._currentWriteEpoch = 0;
        this._gcHoldCounter = 0;
        this._gcReleaseBufferSize = (_options$gcReleaseBuf = options === null || options === void 0 ? void 0 : options.gcReleaseBufferSize) !== null && _options$gcReleaseBuf !== void 0 ? _options$gcReleaseBuf : DEFAULT_RELEASE_BUFFER_SIZE;
        this._gcRun = null;
        this._gcScheduler = (_options$gcScheduler = options === null || options === void 0 ? void 0 : options.gcScheduler) !== null && _options$gcScheduler !== void 0 ? _options$gcScheduler : resolveImmediate;
        this._getDataID = (_options$getDataID = options === null || options === void 0 ? void 0 : options.getDataID) !== null && _options$getDataID !== void 0 ? _options$getDataID : defaultGetDataID;
        this._globalInvalidationEpoch = null;
        this._invalidationSubscriptions = /* @__PURE__ */ new Set();
        this._invalidatedRecordIDs = /* @__PURE__ */ new Set();
        this.__log = (_options$log = options === null || options === void 0 ? void 0 : options.log) !== null && _options$log !== void 0 ? _options$log : null;
        this._queryCacheExpirationTime = options === null || options === void 0 ? void 0 : options.queryCacheExpirationTime;
        this._operationLoader = (_options$operationLoa = options === null || options === void 0 ? void 0 : options.operationLoader) !== null && _options$operationLoa !== void 0 ? _options$operationLoa : null;
        this._optimisticSource = null;
        this._recordSource = source;
        this._releaseBuffer = [];
        this._roots = /* @__PURE__ */ new Map();
        this._shouldScheduleGC = false;
        this._resolverCache = new RecordResolverCache(function() {
          return _this._getMutableRecordSource();
        });
        this._storeSubscriptions = new RelayStoreSubscriptions(options === null || options === void 0 ? void 0 : options.log, this._resolverCache);
        this._updatedRecordIDs = /* @__PURE__ */ new Set();
        this._shouldProcessClientComponents = options === null || options === void 0 ? void 0 : options.shouldProcessClientComponents;
        initializeRecordSource(this._recordSource);
      }
      var _proto = RelayModernStore2.prototype;
      _proto.getSource = function getSource() {
        var _this$_optimisticSour;
        return (_this$_optimisticSour = this._optimisticSource) !== null && _this$_optimisticSour !== void 0 ? _this$_optimisticSour : this._recordSource;
      };
      _proto._getMutableRecordSource = function _getMutableRecordSource() {
        var _this$_optimisticSour2;
        return (_this$_optimisticSour2 = this._optimisticSource) !== null && _this$_optimisticSour2 !== void 0 ? _this$_optimisticSour2 : this._recordSource;
      };
      _proto.check = function check(operation, options) {
        var _options$handlers, _options$getSourceFor, _options$getTargetFor, _options$defaultActor;
        var selector = operation.root;
        var source = this._getMutableRecordSource();
        var globalInvalidationEpoch = this._globalInvalidationEpoch;
        var rootEntry = this._roots.get(operation.request.identifier);
        var operationLastWrittenAt = rootEntry != null ? rootEntry.epoch : null;
        if (globalInvalidationEpoch != null) {
          if (operationLastWrittenAt == null || operationLastWrittenAt <= globalInvalidationEpoch) {
            return {
              status: "stale"
            };
          }
        }
        var handlers2 = (_options$handlers = options === null || options === void 0 ? void 0 : options.handlers) !== null && _options$handlers !== void 0 ? _options$handlers : [];
        var getSourceForActor = (_options$getSourceFor = options === null || options === void 0 ? void 0 : options.getSourceForActor) !== null && _options$getSourceFor !== void 0 ? _options$getSourceFor : function(actorIdentifier) {
          assertInternalActorIdentifier(actorIdentifier);
          return source;
        };
        var getTargetForActor = (_options$getTargetFor = options === null || options === void 0 ? void 0 : options.getTargetForActor) !== null && _options$getTargetFor !== void 0 ? _options$getTargetFor : function(actorIdentifier) {
          assertInternalActorIdentifier(actorIdentifier);
          return source;
        };
        var operationAvailability = DataChecker.check(getSourceForActor, getTargetForActor, (_options$defaultActor = options === null || options === void 0 ? void 0 : options.defaultActorIdentifier) !== null && _options$defaultActor !== void 0 ? _options$defaultActor : INTERNAL_ACTOR_IDENTIFIER_DO_NOT_USE, selector, handlers2, this._operationLoader, this._getDataID, this._shouldProcessClientComponents);
        return getAvailabilityStatus(operationAvailability, operationLastWrittenAt, rootEntry === null || rootEntry === void 0 ? void 0 : rootEntry.fetchTime, this._queryCacheExpirationTime);
      };
      _proto.retain = function retain(operation) {
        var _this2 = this;
        var id2 = operation.request.identifier;
        var disposed = false;
        var dispose2 = function dispose3() {
          if (disposed) {
            return;
          }
          disposed = true;
          var rootEntry2 = _this2._roots.get(id2);
          if (rootEntry2 == null) {
            return;
          }
          rootEntry2.refCount--;
          if (rootEntry2.refCount === 0) {
            var _queryCacheExpirationTime = _this2._queryCacheExpirationTime;
            var rootEntryIsStale = rootEntry2.fetchTime != null && _queryCacheExpirationTime != null && rootEntry2.fetchTime <= Date.now() - _queryCacheExpirationTime;
            if (rootEntryIsStale) {
              _this2._roots["delete"](id2);
              _this2.scheduleGC();
            } else {
              _this2._releaseBuffer.push(id2);
              if (_this2._releaseBuffer.length > _this2._gcReleaseBufferSize) {
                var _id2 = _this2._releaseBuffer.shift();
                _this2._roots["delete"](_id2);
                _this2.scheduleGC();
              }
            }
          }
        };
        var rootEntry = this._roots.get(id2);
        if (rootEntry != null) {
          if (rootEntry.refCount === 0) {
            this._releaseBuffer = this._releaseBuffer.filter(function(_id2) {
              return _id2 !== id2;
            });
          }
          rootEntry.refCount += 1;
        } else {
          this._roots.set(id2, {
            operation,
            refCount: 1,
            epoch: null,
            fetchTime: null
          });
        }
        return {
          dispose: dispose2
        };
      };
      _proto.lookup = function lookup(selector) {
        var source = this.getSource();
        var snapshot = RelayReader.read(source, selector, this._resolverCache);
        if (true) {
          deepFreeze(snapshot);
        }
        return snapshot;
      };
      _proto.notify = function notify(sourceOperation, invalidateStore) {
        var _this3 = this;
        var log2 = this.__log;
        if (log2 != null) {
          log2({
            name: "store.notify.start",
            sourceOperation
          });
        }
        this._currentWriteEpoch++;
        if (invalidateStore === true) {
          this._globalInvalidationEpoch = this._currentWriteEpoch;
        }
        if (RelayFeatureFlags.ENABLE_RELAY_RESOLVERS) {
          this._resolverCache.invalidateDataIDs(this._updatedRecordIDs);
        }
        var source = this.getSource();
        var updatedOwners = [];
        this._storeSubscriptions.updateSubscriptions(source, this._updatedRecordIDs, updatedOwners, sourceOperation);
        this._invalidationSubscriptions.forEach(function(subscription2) {
          _this3._updateInvalidationSubscription(subscription2, invalidateStore === true);
        });
        if (log2 != null) {
          log2({
            name: "store.notify.complete",
            sourceOperation,
            updatedRecordIDs: this._updatedRecordIDs,
            invalidatedRecordIDs: this._invalidatedRecordIDs
          });
        }
        this._updatedRecordIDs.clear();
        this._invalidatedRecordIDs.clear();
        if (sourceOperation != null) {
          var id2 = sourceOperation.request.identifier;
          var rootEntry = this._roots.get(id2);
          if (rootEntry != null) {
            rootEntry.epoch = this._currentWriteEpoch;
            rootEntry.fetchTime = Date.now();
          } else if (sourceOperation.request.node.params.operationKind === "query" && this._gcReleaseBufferSize > 0 && this._releaseBuffer.length < this._gcReleaseBufferSize) {
            var temporaryRootEntry = {
              operation: sourceOperation,
              refCount: 0,
              epoch: this._currentWriteEpoch,
              fetchTime: Date.now()
            };
            this._releaseBuffer.push(id2);
            this._roots.set(id2, temporaryRootEntry);
          }
        }
        return updatedOwners;
      };
      _proto.publish = function publish(source, idsMarkedForInvalidation) {
        var target = this._getMutableRecordSource();
        updateTargetFromSource(
          target,
          source,
          // We increment the current epoch at the end of the set of updates,
          // in notify(). Here, we pass what will be the incremented value of
          // the epoch to use to write to invalidated records.
          this._currentWriteEpoch + 1,
          idsMarkedForInvalidation,
          this._updatedRecordIDs,
          this._invalidatedRecordIDs
        );
        var log2 = this.__log;
        if (log2 != null) {
          log2({
            name: "store.publish",
            source,
            optimistic: target === this._optimisticSource
          });
        }
      };
      _proto.subscribe = function subscribe(snapshot, callback) {
        return this._storeSubscriptions.subscribe(snapshot, callback);
      };
      _proto.holdGC = function holdGC() {
        var _this4 = this;
        if (this._gcRun) {
          this._gcRun = null;
          this._shouldScheduleGC = true;
        }
        this._gcHoldCounter++;
        var dispose2 = function dispose3() {
          if (_this4._gcHoldCounter > 0) {
            _this4._gcHoldCounter--;
            if (_this4._gcHoldCounter === 0 && _this4._shouldScheduleGC) {
              _this4.scheduleGC();
              _this4._shouldScheduleGC = false;
            }
          }
        };
        return {
          dispose: dispose2
        };
      };
      _proto.toJSON = function toJSON2() {
        return "RelayModernStore()";
      };
      _proto.getEpoch = function getEpoch() {
        return this._currentWriteEpoch;
      };
      _proto.__getUpdatedRecordIDs = function __getUpdatedRecordIDs() {
        return this._updatedRecordIDs;
      };
      _proto.lookupInvalidationState = function lookupInvalidationState(dataIDs) {
        var _this5 = this;
        var invalidations = /* @__PURE__ */ new Map();
        dataIDs.forEach(function(dataID) {
          var _RelayModernRecord$ge;
          var record = _this5.getSource().get(dataID);
          invalidations.set(dataID, (_RelayModernRecord$ge = RelayModernRecord.getInvalidationEpoch(record)) !== null && _RelayModernRecord$ge !== void 0 ? _RelayModernRecord$ge : null);
        });
        invalidations.set("global", this._globalInvalidationEpoch);
        return {
          dataIDs,
          invalidations
        };
      };
      _proto.checkInvalidationState = function checkInvalidationState(prevInvalidationState) {
        var latestInvalidationState = this.lookupInvalidationState(prevInvalidationState.dataIDs);
        var currentInvalidations = latestInvalidationState.invalidations;
        var prevInvalidations = prevInvalidationState.invalidations;
        if (currentInvalidations.get("global") !== prevInvalidations.get("global")) {
          return true;
        }
        var _iterator = (0, _createForOfIteratorHelper2["default"])(prevInvalidationState.dataIDs), _step;
        try {
          for (_iterator.s(); !(_step = _iterator.n()).done; ) {
            var dataID = _step.value;
            if (currentInvalidations.get(dataID) !== prevInvalidations.get(dataID)) {
              return true;
            }
          }
        } catch (err) {
          _iterator.e(err);
        } finally {
          _iterator.f();
        }
        return false;
      };
      _proto.subscribeToInvalidationState = function subscribeToInvalidationState(invalidationState, callback) {
        var _this6 = this;
        var subscription2 = {
          callback,
          invalidationState
        };
        var dispose2 = function dispose3() {
          _this6._invalidationSubscriptions["delete"](subscription2);
        };
        this._invalidationSubscriptions.add(subscription2);
        return {
          dispose: dispose2
        };
      };
      _proto._updateInvalidationSubscription = function _updateInvalidationSubscription(subscription2, invalidatedStore) {
        var _this7 = this;
        var callback = subscription2.callback, invalidationState = subscription2.invalidationState;
        var dataIDs = invalidationState.dataIDs;
        var isSubscribedToInvalidatedIDs = invalidatedStore || dataIDs.some(function(dataID) {
          return _this7._invalidatedRecordIDs.has(dataID);
        });
        if (!isSubscribedToInvalidatedIDs) {
          return;
        }
        callback();
      };
      _proto.snapshot = function snapshot() {
        !(this._optimisticSource == null) ? true ? invariant3(false, "RelayModernStore: Unexpected call to snapshot() while a previous snapshot exists.") : invariant3(false) : void 0;
        var log2 = this.__log;
        if (log2 != null) {
          log2({
            name: "store.snapshot"
          });
        }
        this._storeSubscriptions.snapshotSubscriptions(this.getSource());
        if (this._gcRun) {
          this._gcRun = null;
          this._shouldScheduleGC = true;
        }
        this._optimisticSource = RelayOptimisticRecordSource.create(this.getSource());
      };
      _proto.restore = function restore() {
        !(this._optimisticSource != null) ? true ? invariant3(false, "RelayModernStore: Unexpected call to restore(), expected a snapshot to exist (make sure to call snapshot()).") : invariant3(false) : void 0;
        var log2 = this.__log;
        if (log2 != null) {
          log2({
            name: "store.restore"
          });
        }
        this._optimisticSource = null;
        if (this._shouldScheduleGC) {
          this.scheduleGC();
        }
        this._storeSubscriptions.restoreSubscriptions();
      };
      _proto.scheduleGC = function scheduleGC() {
        if (this._gcHoldCounter > 0) {
          this._shouldScheduleGC = true;
          return;
        }
        if (this._gcRun) {
          return;
        }
        this._gcRun = this._collect();
        this._gcScheduler(this._gcStep);
      };
      _proto.__gc = function __gc() {
        if (this._optimisticSource != null) {
          return;
        }
        var gcRun = this._collect();
        while (!gcRun.next().done) {
        }
      };
      _proto._collect = function* _collect() {
        top:
          while (true) {
            var startEpoch = this._currentWriteEpoch;
            var references = /* @__PURE__ */ new Set();
            var _iterator2 = (0, _createForOfIteratorHelper2["default"])(this._roots.values()), _step2;
            try {
              for (_iterator2.s(); !(_step2 = _iterator2.n()).done; ) {
                var operation = _step2.value.operation;
                var selector = operation.root;
                RelayReferenceMarker.mark(this._recordSource, selector, references, this._operationLoader, this._shouldProcessClientComponents);
                yield;
                if (startEpoch !== this._currentWriteEpoch) {
                  continue top;
                }
              }
            } catch (err) {
              _iterator2.e(err);
            } finally {
              _iterator2.f();
            }
            var log2 = this.__log;
            if (log2 != null) {
              log2({
                name: "store.gc",
                references
              });
            }
            if (references.size === 0) {
              this._recordSource.clear();
            } else {
              var storeIDs = this._recordSource.getRecordIDs();
              for (var ii = 0; ii < storeIDs.length; ii++) {
                var dataID = storeIDs[ii];
                if (!references.has(dataID)) {
                  this._recordSource.remove(dataID);
                }
              }
            }
            return;
          }
      };
      return RelayModernStore2;
    }();
    function initializeRecordSource(target) {
      if (!target.has(ROOT_ID)) {
        var rootRecord = RelayModernRecord.create(ROOT_ID, ROOT_TYPE);
        target.set(ROOT_ID, rootRecord);
      }
    }
    function updateTargetFromSource(target, source, currentWriteEpoch, idsMarkedForInvalidation, updatedRecordIDs, invalidatedRecordIDs) {
      if (idsMarkedForInvalidation) {
        idsMarkedForInvalidation.forEach(function(dataID2) {
          var targetRecord2 = target.get(dataID2);
          var sourceRecord2 = source.get(dataID2);
          if (sourceRecord2 === null) {
            return;
          }
          var nextRecord2;
          if (targetRecord2 != null) {
            nextRecord2 = RelayModernRecord.clone(targetRecord2);
          } else {
            nextRecord2 = sourceRecord2 != null ? RelayModernRecord.clone(sourceRecord2) : null;
          }
          if (!nextRecord2) {
            return;
          }
          RelayModernRecord.setValue(nextRecord2, RelayStoreUtils.INVALIDATED_AT_KEY, currentWriteEpoch);
          invalidatedRecordIDs.add(dataID2);
          target.set(dataID2, nextRecord2);
        });
      }
      var dataIDs = source.getRecordIDs();
      for (var ii = 0; ii < dataIDs.length; ii++) {
        var dataID = dataIDs[ii];
        var sourceRecord = source.get(dataID);
        var targetRecord = target.get(dataID);
        if (true) {
          if (sourceRecord) {
            RelayModernRecord.freeze(sourceRecord);
          }
        }
        if (sourceRecord && targetRecord) {
          var nextRecord = RelayModernRecord.getType(targetRecord) === RelayStoreReactFlightUtils.REACT_FLIGHT_TYPE_NAME ? sourceRecord : RelayModernRecord.update(targetRecord, sourceRecord);
          if (nextRecord !== targetRecord) {
            if (true) {
              RelayModernRecord.freeze(nextRecord);
            }
            updatedRecordIDs.add(dataID);
            target.set(dataID, nextRecord);
          }
        } else if (sourceRecord === null) {
          target["delete"](dataID);
          if (targetRecord !== null) {
            updatedRecordIDs.add(dataID);
          }
        } else if (sourceRecord) {
          target.set(dataID, sourceRecord);
          updatedRecordIDs.add(dataID);
        }
      }
    }
    function getAvailabilityStatus(operationAvailability, operationLastWrittenAt, operationFetchTime, queryCacheExpirationTime) {
      var mostRecentlyInvalidatedAt = operationAvailability.mostRecentlyInvalidatedAt, status = operationAvailability.status;
      if (typeof mostRecentlyInvalidatedAt === "number") {
        if (operationLastWrittenAt == null || mostRecentlyInvalidatedAt > operationLastWrittenAt) {
          return {
            status: "stale"
          };
        }
      }
      if (status === "missing") {
        return {
          status: "missing"
        };
      }
      if (operationFetchTime != null && queryCacheExpirationTime != null) {
        var isStale = operationFetchTime <= Date.now() - queryCacheExpirationTime;
        if (isStale) {
          return {
            status: "stale"
          };
        }
      }
      return {
        status: "available",
        fetchTime: operationFetchTime !== null && operationFetchTime !== void 0 ? operationFetchTime : null
      };
    }
    module.exports = RelayModernStore;
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/subscription/requestSubscription.js
var require_requestSubscription = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/subscription/requestSubscription.js"(exports, module) {
    "use strict";
    var RelayDeclarativeMutationConfig = require_RelayDeclarativeMutationConfig();
    var _require = require_GraphQLTag();
    var getRequest = _require.getRequest;
    var _require2 = require_RelayModernOperationDescriptor();
    var createOperationDescriptor = _require2.createOperationDescriptor;
    var _require3 = require_RelayModernSelector();
    var createReaderSelector = _require3.createReaderSelector;
    var warning2 = require_warning();
    function requestSubscription(environment, config2) {
      var subscription2 = getRequest(config2.subscription);
      if (subscription2.params.operationKind !== "subscription") {
        throw new Error("requestSubscription: Must use Subscription operation");
      }
      var configs = config2.configs, onCompleted = config2.onCompleted, onError = config2.onError, onNext = config2.onNext, variables = config2.variables, cacheConfig = config2.cacheConfig;
      var operation = createOperationDescriptor(subscription2, variables, cacheConfig);
      true ? warning2(!(config2.updater && configs), "requestSubscription: Expected only one of `updater` and `configs` to be provided") : void 0;
      var _ref18 = configs ? RelayDeclarativeMutationConfig.convert(configs, subscription2, null, config2.updater) : config2, updater = _ref18.updater;
      var sub = environment.executeSubscription({
        operation,
        updater
      }).subscribe({
        next: function next2(responses) {
          if (onNext != null) {
            var selector = operation.fragment;
            var nextID2;
            if (Array.isArray(responses)) {
              var _responses$, _responses$$extension;
              nextID2 = (_responses$ = responses[0]) === null || _responses$ === void 0 ? void 0 : (_responses$$extension = _responses$.extensions) === null || _responses$$extension === void 0 ? void 0 : _responses$$extension.__relay_subscription_root_id;
            } else {
              var _responses$extensions;
              nextID2 = (_responses$extensions = responses.extensions) === null || _responses$extensions === void 0 ? void 0 : _responses$extensions.__relay_subscription_root_id;
            }
            if (typeof nextID2 === "string") {
              selector = createReaderSelector(selector.node, nextID2, selector.variables, selector.owner);
            }
            var data = environment.lookup(selector).data;
            onNext(data);
          }
        },
        error: onError,
        complete: onCompleted
      });
      return {
        dispose: sub.unsubscribe
      };
    }
    module.exports = requestSubscription;
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/util/createPayloadFor3DField.js
var require_createPayloadFor3DField = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/util/createPayloadFor3DField.js"(exports, module) {
    "use strict";
    var _interopRequireDefault = require_interopRequireDefault()["default"];
    var _objectSpread210 = _interopRequireDefault(require_objectSpread2());
    var _require = require_RelayStoreUtils();
    var getModuleComponentKey = _require.getModuleComponentKey;
    var getModuleOperationKey = _require.getModuleOperationKey;
    function createPayloadFor3DField(name2, operation, component, response) {
      var data = (0, _objectSpread210["default"])({}, response);
      data[getModuleComponentKey(name2)] = component;
      data[getModuleOperationKey(name2)] = operation;
      return data;
    }
    module.exports = createPayloadFor3DField;
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/util/isEmptyObject.js
var require_isEmptyObject = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/util/isEmptyObject.js"(exports, module) {
    "use strict";
    var hasOwnProperty3 = Object.prototype.hasOwnProperty;
    function isEmptyObject2(obj) {
      for (var _key in obj) {
        if (hasOwnProperty3.call(obj, _key)) {
          return false;
        }
      }
      return true;
    }
    module.exports = isEmptyObject2;
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/util/getFragmentIdentifier.js
var require_getFragmentIdentifier = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/util/getFragmentIdentifier.js"(exports, module) {
    "use strict";
    var _require = require_RelayModernSelector();
    var getDataIDsFromFragment = _require.getDataIDsFromFragment;
    var getSelector = _require.getSelector;
    var getVariablesFromFragment = _require.getVariablesFromFragment;
    var isEmptyObject2 = require_isEmptyObject();
    var RelayFeatureFlags = require_RelayFeatureFlags();
    var stableCopy = require_stableCopy();
    var _require2 = require_StringInterner();
    var intern = _require2.intern;
    function getFragmentIdentifier(fragmentNode, fragmentRef) {
      var selector = getSelector(fragmentNode, fragmentRef);
      var fragmentOwnerIdentifier = selector == null ? "null" : selector.kind === "SingularReaderSelector" ? selector.owner.identifier : "[" + selector.selectors.map(function(sel) {
        return sel.owner.identifier;
      }).join(",") + "]";
      var fragmentVariables = getVariablesFromFragment(fragmentNode, fragmentRef);
      var dataIDs = getDataIDsFromFragment(fragmentNode, fragmentRef);
      if (RelayFeatureFlags.ENABLE_GETFRAGMENTIDENTIFIER_OPTIMIZATION) {
        var ids = typeof dataIDs === "undefined" ? "missing" : dataIDs == null ? "null" : Array.isArray(dataIDs) ? "[" + dataIDs.join(",") + "]" : dataIDs;
        ids = RelayFeatureFlags.STRING_INTERN_LEVEL <= 1 ? ids : intern(ids, RelayFeatureFlags.MAX_DATA_ID_LENGTH);
        return fragmentOwnerIdentifier + "/" + fragmentNode.name + "/" + (fragmentVariables == null || isEmptyObject2(fragmentVariables) ? "{}" : JSON.stringify(stableCopy(fragmentVariables))) + "/" + ids;
      } else {
        var _JSON$stringify;
        var _ids = (_JSON$stringify = JSON.stringify(dataIDs)) !== null && _JSON$stringify !== void 0 ? _JSON$stringify : "missing";
        _ids = RelayFeatureFlags.STRING_INTERN_LEVEL <= 1 ? _ids : intern(_ids, RelayFeatureFlags.MAX_DATA_ID_LENGTH);
        return fragmentOwnerIdentifier + "/" + fragmentNode.name + "/" + JSON.stringify(stableCopy(fragmentVariables)) + "/" + _ids;
      }
    }
    module.exports = getFragmentIdentifier;
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/util/getRefetchMetadata.js
var require_getRefetchMetadata = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/util/getRefetchMetadata.js"(exports, module) {
    "use strict";
    var invariant3 = require_browser();
    function getRefetchMetadata(fragmentNode, componentDisplayName) {
      var _fragmentNode$metadat, _fragmentNode$metadat2;
      !(((_fragmentNode$metadat = fragmentNode.metadata) === null || _fragmentNode$metadat === void 0 ? void 0 : _fragmentNode$metadat.plural) !== true) ? true ? invariant3(false, "Relay: getRefetchMetadata(): Expected fragment `%s` not to be plural when using `%s`. Remove `@relay(plural: true)` from fragment `%s` in order to use it with `%s`.", fragmentNode.name, componentDisplayName, fragmentNode.name, componentDisplayName) : invariant3(false) : void 0;
      var refetchMetadata = (_fragmentNode$metadat2 = fragmentNode.metadata) === null || _fragmentNode$metadat2 === void 0 ? void 0 : _fragmentNode$metadat2.refetch;
      !(refetchMetadata != null) ? true ? invariant3(false, "Relay: getRefetchMetadata(): Expected fragment `%s` to be refetchable when using `%s`. Did you forget to add a @refetchable directive to the fragment?", componentDisplayName, fragmentNode.name) : invariant3(false) : void 0;
      var refetchableRequest = refetchMetadata.operation["default"] ? refetchMetadata.operation["default"] : refetchMetadata.operation;
      var fragmentRefPathInResponse = refetchMetadata.fragmentPathInResult;
      !(typeof refetchableRequest !== "string") ? true ? invariant3(false, "Relay: getRefetchMetadata(): Expected refetch query to be an operation and not a string when using `%s`. If you're seeing this, this is likely a bug in Relay.", componentDisplayName) : invariant3(false) : void 0;
      var identifierField = refetchMetadata.identifierField;
      !(identifierField == null || typeof identifierField === "string") ? true ? invariant3(false, "Relay: getRefetchMetadata(): Expected `identifierField` to be a string.") : invariant3(false) : void 0;
      return {
        fragmentRefPathInResponse,
        identifierField,
        refetchableRequest,
        refetchMetadata
      };
    }
    module.exports = getRefetchMetadata;
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/util/getPaginationMetadata.js
var require_getPaginationMetadata = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/util/getPaginationMetadata.js"(exports, module) {
    "use strict";
    var getRefetchMetadata = require_getRefetchMetadata();
    var invariant3 = require_browser();
    function getPaginationMetadata(fragmentNode, componentDisplayName) {
      var _fragmentNode$metadat, _fragmentNode$metadat2;
      var _getRefetchMetadata = getRefetchMetadata(fragmentNode, componentDisplayName), paginationRequest = _getRefetchMetadata.refetchableRequest, refetchMetadata = _getRefetchMetadata.refetchMetadata;
      var paginationMetadata = refetchMetadata.connection;
      !(paginationMetadata != null) ? true ? invariant3(false, "Relay: getPaginationMetadata(): Expected fragment `%s` to include a connection when using `%s`. Did you forget to add a @connection directive to the connection field in the fragment?", componentDisplayName, fragmentNode.name) : invariant3(false) : void 0;
      var connectionPathInFragmentData = paginationMetadata.path;
      var connectionMetadata = ((_fragmentNode$metadat = (_fragmentNode$metadat2 = fragmentNode.metadata) === null || _fragmentNode$metadat2 === void 0 ? void 0 : _fragmentNode$metadat2.connection) !== null && _fragmentNode$metadat !== void 0 ? _fragmentNode$metadat : [])[0];
      !(connectionMetadata != null) ? true ? invariant3(false, "Relay: getPaginationMetadata(): Expected fragment `%s` to include a connection when using `%s`. Did you forget to add a @connection directive to the connection field in the fragment?", componentDisplayName, fragmentNode.name) : invariant3(false) : void 0;
      var identifierField = refetchMetadata.identifierField;
      !(identifierField == null || typeof identifierField === "string") ? true ? invariant3(false, "Relay: getRefetchMetadata(): Expected `identifierField` to be a string.") : invariant3(false) : void 0;
      return {
        connectionPathInFragmentData,
        identifierField,
        paginationRequest,
        paginationMetadata,
        stream: connectionMetadata.stream === true
      };
    }
    module.exports = getPaginationMetadata;
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/util/getPaginationVariables.js
var require_getPaginationVariables = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/util/getPaginationVariables.js"(exports, module) {
    "use strict";
    var _interopRequireDefault = require_interopRequireDefault()["default"];
    var _defineProperty210 = _interopRequireDefault(require_defineProperty());
    var _objectSpread42 = _interopRequireDefault(require_objectSpread2());
    var invariant3 = require_browser();
    var warning2 = require_warning();
    function getPaginationVariables(direction, count2, cursor3, baseVariables, extraVariables, paginationMetadata) {
      var _objectSpread310;
      var backwardMetadata = paginationMetadata.backward, forwardMetadata = paginationMetadata.forward;
      if (direction === "backward") {
        var _objectSpread210;
        !(backwardMetadata != null && backwardMetadata.count != null && backwardMetadata.cursor != null) ? true ? invariant3(false, "Relay: Expected backward pagination metadata to be available. If you're seeing this, this is likely a bug in Relay.") : invariant3(false) : void 0;
        true ? warning2(!extraVariables.hasOwnProperty(backwardMetadata.cursor), "Relay: `UNSTABLE_extraVariables` provided by caller should not contain cursor variable `%s`. This variable is automatically determined by Relay.", backwardMetadata.cursor) : void 0;
        true ? warning2(!extraVariables.hasOwnProperty(backwardMetadata.count), "Relay: `UNSTABLE_extraVariables` provided by caller should not contain count variable `%s`. This variable is automatically determined by Relay.", backwardMetadata.count) : void 0;
        var _paginationVariables = (0, _objectSpread42["default"])((0, _objectSpread42["default"])((0, _objectSpread42["default"])({}, baseVariables), extraVariables), {}, (_objectSpread210 = {}, (0, _defineProperty210["default"])(_objectSpread210, backwardMetadata.cursor, cursor3), (0, _defineProperty210["default"])(_objectSpread210, backwardMetadata.count, count2), _objectSpread210));
        if (forwardMetadata && forwardMetadata.cursor) {
          _paginationVariables[forwardMetadata.cursor] = null;
        }
        if (forwardMetadata && forwardMetadata.count) {
          _paginationVariables[forwardMetadata.count] = null;
        }
        return _paginationVariables;
      }
      !(forwardMetadata != null && forwardMetadata.count != null && forwardMetadata.cursor != null) ? true ? invariant3(false, "Relay: Expected forward pagination metadata to be available. If you're seeing this, this is likely a bug in Relay.") : invariant3(false) : void 0;
      true ? warning2(!extraVariables.hasOwnProperty(forwardMetadata.cursor), "Relay: `UNSTABLE_extraVariables` provided by caller should not contain cursor variable `%s`. This variable is automatically determined by Relay.", forwardMetadata.cursor) : void 0;
      true ? warning2(!extraVariables.hasOwnProperty(forwardMetadata.count), "Relay: `UNSTABLE_extraVariables` provided by caller should not contain count variable `%s`. This variable is automatically determined by Relay.", forwardMetadata.count) : void 0;
      var paginationVariables = (0, _objectSpread42["default"])((0, _objectSpread42["default"])((0, _objectSpread42["default"])({}, baseVariables), extraVariables), {}, (_objectSpread310 = {}, (0, _defineProperty210["default"])(_objectSpread310, forwardMetadata.cursor, cursor3), (0, _defineProperty210["default"])(_objectSpread310, forwardMetadata.count, count2), _objectSpread310));
      if (backwardMetadata && backwardMetadata.cursor) {
        paginationVariables[backwardMetadata.cursor] = null;
      }
      if (backwardMetadata && backwardMetadata.count) {
        paginationVariables[backwardMetadata.count] = null;
      }
      return paginationVariables;
    }
    module.exports = getPaginationVariables;
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/util/getValueAtPath.js
var require_getValueAtPath = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/util/getValueAtPath.js"(exports, module) {
    "use strict";
    var _interopRequireDefault = require_interopRequireDefault()["default"];
    var _createForOfIteratorHelper2 = _interopRequireDefault(require_createForOfIteratorHelper());
    var invariant3 = require_browser();
    function getValueAtPath(data, path2) {
      var result = data;
      var _iterator = (0, _createForOfIteratorHelper2["default"])(path2), _step;
      try {
        for (_iterator.s(); !(_step = _iterator.n()).done; ) {
          var key = _step.value;
          if (result == null) {
            return null;
          }
          if (typeof key === "number") {
            !Array.isArray(result) ? true ? invariant3(false, "Relay: Expected an array when extracting value at path. If you're seeing this, this is likely a bug in Relay.") : invariant3(false) : void 0;
            result = result[key];
          } else {
            !(typeof result === "object" && !Array.isArray(result)) ? true ? invariant3(false, "Relay: Expected an object when extracting value at path. If you're seeing this, this is likely a bug in Relay.") : invariant3(false) : void 0;
            result = result[key];
          }
        }
      } catch (err) {
        _iterator.e(err);
      } finally {
        _iterator.f();
      }
      return result;
    }
    module.exports = getValueAtPath;
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/util/RelayProfiler.js
var require_RelayProfiler = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/util/RelayProfiler.js"(exports, module) {
    "use strict";
    var profileHandlersByName = {};
    var defaultProfiler = {
      stop: function stop() {
      }
    };
    var RelayProfiler = {
      /**
       * Instruments profiling for arbitrarily asynchronous code by a name.
       *
       *   const timerProfiler = RelayProfiler.profile('timeout');
       *   setTimeout(function() {
       *     timerProfiler.stop();
       *   }, 1000);
       *
       *   RelayProfiler.attachProfileHandler('timeout', ...);
       *
       * Arbitrary state can also be passed into `profile` as a second argument. The
       * attached profile handlers will receive this as the second argument.
       */
      profile: function profile(name2, state) {
        var handlers2 = profileHandlersByName[name2];
        if (handlers2 && handlers2.length > 0) {
          var stopHandlers = [];
          for (var ii = handlers2.length - 1; ii >= 0; ii--) {
            var stopHandler = handlers2[ii](name2, state);
            stopHandlers.unshift(stopHandler);
          }
          return {
            stop: function stop(error) {
              stopHandlers.forEach(function(stopHandler2) {
                return stopHandler2(error);
              });
            }
          };
        }
        return defaultProfiler;
      },
      /**
       * Attaches a handler to profiles with the supplied name.
       */
      attachProfileHandler: function attachProfileHandler(name2, handler) {
        if (!profileHandlersByName.hasOwnProperty(name2)) {
          profileHandlersByName[name2] = [];
        }
        profileHandlersByName[name2].push(handler);
      },
      /**
       * Detaches a handler attached via `attachProfileHandler`.
       */
      detachProfileHandler: function detachProfileHandler(name2, handler) {
        if (profileHandlersByName.hasOwnProperty(name2)) {
          removeFromArray(profileHandlersByName[name2], handler);
        }
      }
    };
    function removeFromArray(array, element2) {
      var index = array.indexOf(element2);
      if (index !== -1) {
        array.splice(index, 1);
      }
    }
    module.exports = RelayProfiler;
  }
});

// node_modules/react-relay/node_modules/relay-runtime/lib/index.js
var require_lib = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/lib/index.js"(exports, module) {
    "use strict";
    var ConnectionHandler = require_ConnectionHandler();
    var ConnectionInterface = require_ConnectionInterface();
    var MutationHandlers = require_MutationHandlers();
    var RelayDefaultHandlerProvider = require_RelayDefaultHandlerProvider();
    var applyOptimisticMutation = require_applyOptimisticMutation();
    var commitLocalUpdate = require_commitLocalUpdate();
    var commitMutation = require_commitMutation();
    var RelayDeclarativeMutationConfig = require_RelayDeclarativeMutationConfig();
    var RelayNetwork = require_RelayNetwork();
    var RelayObservable = require_RelayObservable();
    var RelayQueryResponseCache = require_RelayQueryResponseCache();
    var fetchQuery7 = require_fetchQuery();
    var fetchQuery_DEPRECATED = require_fetchQuery_DEPRECATED();
    var fetchQueryInternal = require_fetchQueryInternal();
    var GraphQLTag = require_GraphQLTag();
    var PreloadableQueryRegistry = require_PreloadableQueryRegistry();
    var _require = require_ClientID();
    var generateClientID = _require.generateClientID;
    var generateUniqueClientID = _require.generateUniqueClientID;
    var isClientID = _require.isClientID;
    var createFragmentSpecResolver = require_createFragmentSpecResolver();
    var createRelayContext = require_createRelayContext();
    var isRelayModernEnvironment = require_isRelayModernEnvironment();
    var readInlineData = require_readInlineData();
    var RelayConcreteVariables = require_RelayConcreteVariables();
    var RelayModernEnvironment = require_RelayModernEnvironment();
    var RelayModernOperationDescriptor = require_RelayModernOperationDescriptor();
    var RelayModernRecord = require_RelayModernRecord();
    var RelayModernSelector = require_RelayModernSelector();
    var RelayModernStore = require_RelayModernStore();
    var RelayOperationTracker = require_RelayOperationTracker();
    var RelayRecordSource = require_RelayRecordSource();
    var RelayStoreUtils = require_RelayStoreUtils();
    var ResolverFragments = require_ResolverFragments();
    var ViewerPattern = require_ViewerPattern();
    var requestSubscription = require_requestSubscription();
    var createPayloadFor3DField = require_createPayloadFor3DField();
    var deepFreeze = require_deepFreeze();
    var getFragmentIdentifier = require_getFragmentIdentifier();
    var getPaginationMetadata = require_getPaginationMetadata();
    var getPaginationVariables = require_getPaginationVariables();
    var getPendingOperationsForFragment = require_getPendingOperationsForFragment();
    var getRefetchMetadata = require_getRefetchMetadata();
    var getRelayHandleKey = require_getRelayHandleKey();
    var getRequestIdentifier = require_getRequestIdentifier();
    var getValueAtPath = require_getValueAtPath();
    var handlePotentialSnapshotErrors = require_handlePotentialSnapshotErrors();
    var isPromise = require_isPromise();
    var isScalarAndEqual = require_isScalarAndEqual();
    var recycleNodesInto = require_recycleNodesInto();
    var RelayConcreteNode = require_RelayConcreteNode();
    var RelayDefaultHandleKey = require_RelayDefaultHandleKey();
    var RelayError = require_RelayError();
    var RelayFeatureFlags = require_RelayFeatureFlags();
    var RelayProfiler = require_RelayProfiler();
    var RelayReplaySubject = require_RelayReplaySubject();
    var stableCopy = require_stableCopy();
    var withProvidedVariables = require_withProvidedVariables();
    if (true) {
      mapStr = typeof Map !== "function" ? "Map" : null;
      setStr = typeof Set !== "function" ? "Set" : null;
      promiseStr = typeof Promise !== "function" ? "Promise" : null;
      objStr = typeof Object.assign !== "function" ? "Object.assign" : null;
      if (mapStr || setStr || promiseStr || objStr) {
        throw new Error("relay-runtime requires ".concat([mapStr, setStr, promiseStr, objStr].filter(Boolean).join(", and "), " to exist. ") + "Use a polyfill to provide these for older browsers.");
      }
    }
    var mapStr;
    var setStr;
    var promiseStr;
    var objStr;
    module.exports = {
      // Core API
      Environment: RelayModernEnvironment,
      Network: RelayNetwork,
      Observable: RelayObservable,
      QueryResponseCache: RelayQueryResponseCache,
      RecordSource: RelayRecordSource,
      Record: RelayModernRecord,
      ReplaySubject: RelayReplaySubject,
      Store: RelayModernStore,
      areEqualSelectors: RelayModernSelector.areEqualSelectors,
      createFragmentSpecResolver,
      createNormalizationSelector: RelayModernSelector.createNormalizationSelector,
      createOperationDescriptor: RelayModernOperationDescriptor.createOperationDescriptor,
      createReaderSelector: RelayModernSelector.createReaderSelector,
      createRequestDescriptor: RelayModernOperationDescriptor.createRequestDescriptor,
      getArgumentValues: RelayStoreUtils.getArgumentValues,
      getDataIDsFromFragment: RelayModernSelector.getDataIDsFromFragment,
      getDataIDsFromObject: RelayModernSelector.getDataIDsFromObject,
      getNode: GraphQLTag.getNode,
      getFragment: GraphQLTag.getFragment,
      getInlineDataFragment: GraphQLTag.getInlineDataFragment,
      getModuleComponentKey: RelayStoreUtils.getModuleComponentKey,
      getModuleOperationKey: RelayStoreUtils.getModuleOperationKey,
      getPaginationFragment: GraphQLTag.getPaginationFragment,
      getPluralSelector: RelayModernSelector.getPluralSelector,
      getRefetchableFragment: GraphQLTag.getRefetchableFragment,
      getRequest: GraphQLTag.getRequest,
      getRequestIdentifier,
      getSelector: RelayModernSelector.getSelector,
      getSelectorsFromObject: RelayModernSelector.getSelectorsFromObject,
      getSingularSelector: RelayModernSelector.getSingularSelector,
      getStorageKey: RelayStoreUtils.getStorageKey,
      getVariablesFromFragment: RelayModernSelector.getVariablesFromFragment,
      getVariablesFromObject: RelayModernSelector.getVariablesFromObject,
      getVariablesFromPluralFragment: RelayModernSelector.getVariablesFromPluralFragment,
      getVariablesFromSingularFragment: RelayModernSelector.getVariablesFromSingularFragment,
      handlePotentialSnapshotErrors,
      graphql: GraphQLTag.graphql,
      isFragment: GraphQLTag.isFragment,
      isInlineDataFragment: GraphQLTag.isInlineDataFragment,
      isRequest: GraphQLTag.isRequest,
      readInlineData,
      // Declarative mutation API
      MutationTypes: RelayDeclarativeMutationConfig.MutationTypes,
      RangeOperations: RelayDeclarativeMutationConfig.RangeOperations,
      // Extensions
      DefaultHandlerProvider: RelayDefaultHandlerProvider,
      ConnectionHandler,
      MutationHandlers,
      VIEWER_ID: ViewerPattern.VIEWER_ID,
      VIEWER_TYPE: ViewerPattern.VIEWER_TYPE,
      // Helpers (can be implemented via the above API)
      applyOptimisticMutation,
      commitLocalUpdate,
      commitMutation,
      fetchQuery: fetchQuery7,
      fetchQuery_DEPRECATED,
      isRelayModernEnvironment,
      requestSubscription,
      // Configuration interface for legacy or special uses
      ConnectionInterface,
      // Utilities
      PreloadableQueryRegistry,
      RelayProfiler,
      createPayloadFor3DField,
      // INTERNAL-ONLY: These exports might be removed at any point.
      RelayConcreteNode,
      RelayError,
      RelayFeatureFlags,
      DEFAULT_HANDLE_KEY: RelayDefaultHandleKey.DEFAULT_HANDLE_KEY,
      FRAGMENTS_KEY: RelayStoreUtils.FRAGMENTS_KEY,
      FRAGMENT_OWNER_KEY: RelayStoreUtils.FRAGMENT_OWNER_KEY,
      ID_KEY: RelayStoreUtils.ID_KEY,
      REF_KEY: RelayStoreUtils.REF_KEY,
      REFS_KEY: RelayStoreUtils.REFS_KEY,
      ROOT_ID: RelayStoreUtils.ROOT_ID,
      ROOT_TYPE: RelayStoreUtils.ROOT_TYPE,
      TYPENAME_KEY: RelayStoreUtils.TYPENAME_KEY,
      deepFreeze,
      generateClientID,
      generateUniqueClientID,
      getRelayHandleKey,
      isClientID,
      isPromise,
      isScalarAndEqual,
      recycleNodesInto,
      stableCopy,
      getFragmentIdentifier,
      getRefetchMetadata,
      getPaginationMetadata,
      getPaginationVariables,
      getPendingOperationsForFragment,
      getValueAtPath,
      __internal: {
        ResolverFragments,
        OperationTracker: RelayOperationTracker,
        createRelayContext,
        getOperationVariables: RelayConcreteVariables.getOperationVariables,
        fetchQuery: fetchQueryInternal.fetchQuery,
        fetchQueryDeduped: fetchQueryInternal.fetchQueryDeduped,
        getPromiseForActiveRequest: fetchQueryInternal.getPromiseForActiveRequest,
        getObservableForActiveRequest: fetchQueryInternal.getObservableForActiveRequest,
        withProvidedVariables
      }
    };
  }
});

// node_modules/react-relay/node_modules/relay-runtime/index.js
var require_relay_runtime = __commonJS({
  "node_modules/react-relay/node_modules/relay-runtime/index.js"(exports, module) {
    module.exports = require_lib();
  }
});

// node_modules/react-relay/lib/ReactRelayContext.js
var require_ReactRelayContext = __commonJS({
  "node_modules/react-relay/lib/ReactRelayContext.js"(exports, module) {
    "use strict";
    var React116 = require_react();
    var _require = require_relay_runtime();
    var createRelayContext = _require.__internal.createRelayContext;
    module.exports = createRelayContext(React116);
  }
});

// node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js
var require_objectWithoutPropertiesLoose = __commonJS({
  "node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js"(exports, module) {
    function _objectWithoutPropertiesLoose28(source, excluded) {
      if (source == null)
        return {};
      var target = {};
      var sourceKeys = Object.keys(source);
      var key, i2;
      for (i2 = 0; i2 < sourceKeys.length; i2++) {
        key = sourceKeys[i2];
        if (excluded.indexOf(key) >= 0)
          continue;
        target[key] = source[key];
      }
      return target;
    }
    module.exports = _objectWithoutPropertiesLoose28, module.exports.__esModule = true, module.exports["default"] = module.exports;
  }
});

// node_modules/@babel/runtime/helpers/assertThisInitialized.js
var require_assertThisInitialized = __commonJS({
  "node_modules/@babel/runtime/helpers/assertThisInitialized.js"(exports, module) {
    function _assertThisInitialized19(self2) {
      if (self2 === void 0) {
        throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
      }
      return self2;
    }
    module.exports = _assertThisInitialized19, module.exports.__esModule = true, module.exports["default"] = module.exports;
  }
});

// node_modules/@babel/runtime/helpers/setPrototypeOf.js
var require_setPrototypeOf = __commonJS({
  "node_modules/@babel/runtime/helpers/setPrototypeOf.js"(exports, module) {
    function _setPrototypeOf19(o, p) {
      module.exports = _setPrototypeOf19 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf20(o2, p2) {
        o2.__proto__ = p2;
        return o2;
      }, module.exports.__esModule = true, module.exports["default"] = module.exports;
      return _setPrototypeOf19(o, p);
    }
    module.exports = _setPrototypeOf19, module.exports.__esModule = true, module.exports["default"] = module.exports;
  }
});

// node_modules/@babel/runtime/helpers/inheritsLoose.js
var require_inheritsLoose = __commonJS({
  "node_modules/@babel/runtime/helpers/inheritsLoose.js"(exports, module) {
    var setPrototypeOf = require_setPrototypeOf();
    function _inheritsLoose3(subClass, superClass) {
      subClass.prototype = Object.create(superClass.prototype);
      subClass.prototype.constructor = subClass;
      setPrototypeOf(subClass, superClass);
    }
    module.exports = _inheritsLoose3, module.exports.__esModule = true, module.exports["default"] = module.exports;
  }
});

// node_modules/@babel/runtime/helpers/extends.js
var require_extends = __commonJS({
  "node_modules/@babel/runtime/helpers/extends.js"(exports, module) {
    function _extends41() {
      module.exports = _extends41 = Object.assign ? Object.assign.bind() : function(target) {
        for (var i2 = 1; i2 < arguments.length; i2++) {
          var source = arguments[i2];
          for (var key in source) {
            if (Object.prototype.hasOwnProperty.call(source, key)) {
              target[key] = source[key];
            }
          }
        }
        return target;
      }, module.exports.__esModule = true, module.exports["default"] = module.exports;
      return _extends41.apply(this, arguments);
    }
    module.exports = _extends41, module.exports.__esModule = true, module.exports["default"] = module.exports;
  }
});

// node_modules/react-relay/lib/assertFragmentMap.js
var require_assertFragmentMap = __commonJS({
  "node_modules/react-relay/lib/assertFragmentMap.js"(exports, module) {
    "use strict";
    var invariant3 = require_browser();
    function assertFragmentMap(componentName, fragmentSpec) {
      !(fragmentSpec && typeof fragmentSpec === "object") ? true ? invariant3(false, "Could not create Relay Container for `%s`. Expected a set of GraphQL fragments, got `%s` instead.", componentName, fragmentSpec) : invariant3(false) : void 0;
      for (var key in fragmentSpec) {
        if (fragmentSpec.hasOwnProperty(key)) {
          var fragment2 = fragmentSpec[key];
          !(fragment2 && (typeof fragment2 === "object" || typeof fragment2 === "function")) ? true ? invariant3(false, "Could not create Relay Container for `%s`. The value of fragment `%s` was expected to be a fragment, got `%s` instead.", componentName, key, fragment2) : invariant3(false) : void 0;
        }
      }
    }
    module.exports = assertFragmentMap;
  }
});

// node_modules/react-relay/lib/ReactRelayContainerUtils.js
var require_ReactRelayContainerUtils = __commonJS({
  "node_modules/react-relay/lib/ReactRelayContainerUtils.js"(exports, module) {
    "use strict";
    function getComponentName(component) {
      return component.displayName || component.name || "Component";
    }
    function getContainerName(Component8) {
      return "Relay(" + getComponentName(Component8) + ")";
    }
    module.exports = {
      getComponentName,
      getContainerName
    };
  }
});

// node_modules/react-relay/lib/ReactRelayQueryRendererContext.js
var require_ReactRelayQueryRendererContext = __commonJS({
  "node_modules/react-relay/lib/ReactRelayQueryRendererContext.js"(exports, module) {
    "use strict";
    var React116 = require_react();
    module.exports = React116.createContext({
      rootIsQueryRenderer: false
    });
  }
});

// node_modules/react-relay/lib/buildReactRelayContainer.js
var require_buildReactRelayContainer = __commonJS({
  "node_modules/react-relay/lib/buildReactRelayContainer.js"(exports, module) {
    "use strict";
    var _interopRequireDefault = require_interopRequireDefault()["default"];
    var _extends210 = _interopRequireDefault(require_extends());
    var assertFragmentMap = require_assertFragmentMap();
    var _require = require_ReactRelayContainerUtils();
    var getComponentName = _require.getComponentName;
    var getContainerName = _require.getContainerName;
    var ReactRelayContext = require_ReactRelayContext();
    var ReactRelayQueryRendererContext = require_ReactRelayQueryRendererContext();
    var invariant3 = require_browser();
    var React116 = require_react();
    var _require2 = require_relay_runtime();
    var getFragment = _require2.getFragment;
    var useContext17 = React116.useContext;
    function buildReactRelayContainer(ComponentClass, fragmentSpec, createContainerWithFragments) {
      var containerName = getContainerName(ComponentClass);
      assertFragmentMap(getComponentName(ComponentClass), fragmentSpec);
      var fragments = {};
      for (var key in fragmentSpec) {
        fragments[key] = getFragment(fragmentSpec[key]);
      }
      var Container = createContainerWithFragments(ComponentClass, fragments);
      Container.displayName = containerName;
      function forwardRef15(props, ref) {
        var _queryRendererContext;
        var context2 = useContext17(ReactRelayContext);
        !(context2 != null) ? true ? invariant3(false, "`%s` tried to render a context that was not valid this means that `%s` was rendered outside of a query renderer.", containerName, containerName) : invariant3(false) : void 0;
        var queryRendererContext = useContext17(ReactRelayQueryRendererContext);
        return /* @__PURE__ */ React116.createElement(Container, (0, _extends210["default"])({}, props, {
          __relayContext: context2,
          __rootIsQueryRenderer: (_queryRendererContext = queryRendererContext === null || queryRendererContext === void 0 ? void 0 : queryRendererContext.rootIsQueryRenderer) !== null && _queryRendererContext !== void 0 ? _queryRendererContext : false,
          componentRef: props.componentRef || ref
        }));
      }
      forwardRef15.displayName = containerName;
      var ForwardContainer = React116.forwardRef(forwardRef15);
      if (true) {
        ForwardContainer.__ComponentClass = ComponentClass;
        ForwardContainer.displayName = containerName;
      }
      return ForwardContainer;
    }
    module.exports = buildReactRelayContainer;
  }
});

// node_modules/react-relay/lib/isRelayEnvironment.js
var require_isRelayEnvironment = __commonJS({
  "node_modules/react-relay/lib/isRelayEnvironment.js"(exports, module) {
    "use strict";
    function isRelayEnvironment(environment) {
      return typeof environment === "object" && environment !== null && // TODO: add applyMutation/sendMutation once ready in both cores
      typeof environment.check === "function" && typeof environment.lookup === "function" && typeof environment.retain === "function" && typeof environment.execute === "function" && typeof environment.subscribe === "function";
    }
    module.exports = isRelayEnvironment;
  }
});

// node_modules/react-relay/lib/RelayContext.js
var require_RelayContext = __commonJS({
  "node_modules/react-relay/lib/RelayContext.js"(exports, module) {
    "use strict";
    var isRelayEnvironment = require_isRelayEnvironment();
    var invariant3 = require_browser();
    function assertRelayContext(relay) {
      !isRelayContext(relay) ? true ? invariant3(false, "RelayContext: Expected `context.relay` to be an object conforming to the `RelayContext` interface, got `%s`.", relay) : invariant3(false) : void 0;
      return relay;
    }
    function isRelayContext(context2) {
      return typeof context2 === "object" && context2 !== null && !Array.isArray(context2) && isRelayEnvironment(context2.environment);
    }
    module.exports = {
      assertRelayContext,
      isRelayContext
    };
  }
});

// node_modules/react-relay/lib/ReactRelayFragmentContainer.js
var require_ReactRelayFragmentContainer = __commonJS({
  "node_modules/react-relay/lib/ReactRelayFragmentContainer.js"(exports, module) {
    "use strict";
    var _interopRequireDefault = require_interopRequireDefault()["default"];
    var _objectSpread210 = _interopRequireDefault(require_objectSpread2());
    var _objectWithoutPropertiesLoose28 = _interopRequireDefault(require_objectWithoutPropertiesLoose());
    var _assertThisInitialized22 = _interopRequireDefault(require_assertThisInitialized());
    var _inheritsLoose22 = _interopRequireDefault(require_inheritsLoose());
    var _defineProperty210 = _interopRequireDefault(require_defineProperty());
    var _excluded36 = ["componentRef", "__relayContext", "__rootIsQueryRenderer"];
    var buildReactRelayContainer = require_buildReactRelayContainer();
    var _require = require_ReactRelayContainerUtils();
    var getContainerName = _require.getContainerName;
    var _require2 = require_RelayContext();
    var assertRelayContext = _require2.assertRelayContext;
    var areEqual2 = require_areEqual();
    var React116 = require_react();
    var _require3 = require_relay_runtime();
    var createFragmentSpecResolver = _require3.createFragmentSpecResolver;
    var getDataIDsFromObject = _require3.getDataIDsFromObject;
    var isScalarAndEqual = _require3.isScalarAndEqual;
    function createContainerWithFragments(Component8, fragments) {
      var _class4;
      var containerName = getContainerName(Component8);
      return _class4 = /* @__PURE__ */ function(_React$Component) {
        (0, _inheritsLoose22["default"])(_class5, _React$Component);
        function _class5(props) {
          var _props$__rootIsQueryR, _this;
          _this = _React$Component.call(this, props) || this;
          (0, _defineProperty210["default"])((0, _assertThisInitialized22["default"])(_this), "_handleFragmentDataUpdate", function() {
            var resolverFromThisUpdate = _this.state.resolver;
            _this.setState(function(updatedState) {
              return (
                // If this event belongs to the current data source, update.
                // Otherwise we should ignore it.
                resolverFromThisUpdate === updatedState.resolver ? {
                  data: updatedState.resolver.resolve(),
                  relayProp: getRelayProp(updatedState.relayProp.environment)
                } : null
              );
            });
          });
          var relayContext = assertRelayContext(props.__relayContext);
          var rootIsQueryRenderer = (_props$__rootIsQueryR = props.__rootIsQueryRenderer) !== null && _props$__rootIsQueryR !== void 0 ? _props$__rootIsQueryR : false;
          var resolver = createFragmentSpecResolver(relayContext, containerName, fragments, props, rootIsQueryRenderer);
          _this.state = {
            data: resolver.resolve(),
            prevProps: props,
            prevPropsContext: relayContext,
            relayProp: getRelayProp(relayContext.environment),
            resolver
          };
          return _this;
        }
        _class5.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, prevState) {
          var _nextProps$__rootIsQu;
          var prevProps = prevState.prevProps;
          var relayContext = assertRelayContext(nextProps.__relayContext);
          var rootIsQueryRenderer = (_nextProps$__rootIsQu = nextProps.__rootIsQueryRenderer) !== null && _nextProps$__rootIsQu !== void 0 ? _nextProps$__rootIsQu : false;
          var prevIDs = getDataIDsFromObject(fragments, prevProps);
          var nextIDs = getDataIDsFromObject(fragments, nextProps);
          var resolver = prevState.resolver;
          if (prevState.prevPropsContext.environment !== relayContext.environment || !areEqual2(prevIDs, nextIDs)) {
            resolver = createFragmentSpecResolver(relayContext, containerName, fragments, nextProps, rootIsQueryRenderer);
            return {
              data: resolver.resolve(),
              prevPropsContext: relayContext,
              prevProps: nextProps,
              relayProp: getRelayProp(relayContext.environment),
              resolver
            };
          } else {
            resolver.setProps(nextProps);
            var data = resolver.resolve();
            if (data !== prevState.data) {
              return {
                data,
                prevProps: nextProps,
                prevPropsContext: relayContext,
                relayProp: getRelayProp(relayContext.environment)
              };
            }
          }
          return null;
        };
        var _proto = _class5.prototype;
        _proto.componentDidMount = function componentDidMount() {
          this._subscribeToNewResolverAndRerenderIfStoreHasChanged();
        };
        _proto.componentDidUpdate = function componentDidUpdate(prevProps, prevState) {
          if (this.state.resolver !== prevState.resolver) {
            prevState.resolver.dispose();
            this._subscribeToNewResolverAndRerenderIfStoreHasChanged();
          } else {
            this._rerenderIfStoreHasChanged();
          }
        };
        _proto.componentWillUnmount = function componentWillUnmount() {
          this.state.resolver.dispose();
        };
        _proto.shouldComponentUpdate = function shouldComponentUpdate(nextProps, nextState) {
          if (nextState.data !== this.state.data) {
            return true;
          }
          var keys4 = Object.keys(nextProps);
          for (var ii = 0; ii < keys4.length; ii++) {
            var key = keys4[ii];
            if (key === "__relayContext") {
              if (nextState.prevPropsContext.environment !== this.state.prevPropsContext.environment) {
                return true;
              }
            } else {
              if (!fragments.hasOwnProperty(key) && !isScalarAndEqual(nextProps[key], this.props[key])) {
                return true;
              }
            }
          }
          return false;
        };
        _proto._rerenderIfStoreHasChanged = function _rerenderIfStoreHasChanged() {
          var _this$state = this.state, data = _this$state.data, resolver = _this$state.resolver;
          var maybeNewData = resolver.resolve();
          if (data !== maybeNewData) {
            this.setState({
              data: maybeNewData
            });
          }
        };
        _proto._subscribeToNewResolverAndRerenderIfStoreHasChanged = function _subscribeToNewResolverAndRerenderIfStoreHasChanged() {
          var _this$state2 = this.state, data = _this$state2.data, resolver = _this$state2.resolver;
          var maybeNewData = resolver.resolve();
          resolver.setCallback(this.props, this._handleFragmentDataUpdate);
          if (data !== maybeNewData) {
            this.setState({
              data: maybeNewData
            });
          }
        };
        _proto.render = function render2() {
          var _this$props = this.props, componentRef = _this$props.componentRef, __relayContext = _this$props.__relayContext, __rootIsQueryRenderer = _this$props.__rootIsQueryRenderer, props = (0, _objectWithoutPropertiesLoose28["default"])(_this$props, _excluded36);
          return React116.createElement(Component8, (0, _objectSpread210["default"])((0, _objectSpread210["default"])((0, _objectSpread210["default"])({}, props), this.state.data), {}, {
            ref: componentRef,
            relay: this.state.relayProp
          }));
        };
        return _class5;
      }(React116.Component), (0, _defineProperty210["default"])(_class4, "displayName", containerName), _class4;
    }
    function getRelayProp(environment) {
      return {
        environment
      };
    }
    function createContainer(Component8, fragmentSpec) {
      return buildReactRelayContainer(Component8, fragmentSpec, createContainerWithFragments);
    }
    module.exports = {
      createContainer
    };
  }
});

// node_modules/react-relay/lib/ReactRelayLocalQueryRenderer.js
var require_ReactRelayLocalQueryRenderer = __commonJS({
  "node_modules/react-relay/lib/ReactRelayLocalQueryRenderer.js"(exports, module) {
    "use strict";
    var ReactRelayContext = require_ReactRelayContext();
    var ReactRelayQueryRendererContext = require_ReactRelayQueryRendererContext();
    var areEqual2 = require_areEqual();
    var React116 = require_react();
    var _require = require_relay_runtime();
    var createOperationDescriptor = _require.createOperationDescriptor;
    var deepFreeze = _require.deepFreeze;
    var getRequest = _require.getRequest;
    var useLayoutEffect12 = React116.useLayoutEffect;
    var useState33 = React116.useState;
    var useRef28 = React116.useRef;
    var useMemo47 = React116.useMemo;
    var queryRendererContext = {
      rootIsQueryRenderer: true
    };
    function useDeepCompare(value) {
      var latestValue = React116.useRef(value);
      if (!areEqual2(latestValue.current, value)) {
        if (true) {
          deepFreeze(value);
        }
        latestValue.current = value;
      }
      return latestValue.current;
    }
    function ReactRelayLocalQueryRenderer(props) {
      var environment = props.environment, query2 = props.query, variables = props.variables, render2 = props.render;
      var latestVariables = useDeepCompare(variables);
      var operation = useMemo47(function() {
        var request = getRequest(query2);
        return createOperationDescriptor(request, latestVariables);
      }, [query2, latestVariables]);
      var relayContext = useMemo47(function() {
        return {
          environment
        };
      }, [environment]);
      var dataRef = useRef28(null);
      var _useState = useState33(null), forceUpdate = _useState[1];
      var cleanupFnRef = useRef28(null);
      var snapshot = useMemo47(function() {
        environment.check(operation);
        var res = environment.lookup(operation.fragment);
        dataRef.current = res.data;
        var retainDisposable = environment.retain(operation);
        var subscribeDisposable = environment.subscribe(res, function(newSnapshot) {
          dataRef.current = newSnapshot.data;
          forceUpdate(dataRef.current);
        });
        var disposed = false;
        function nextCleanupFn() {
          if (!disposed) {
            disposed = true;
            cleanupFnRef.current = null;
            retainDisposable.dispose();
            subscribeDisposable.dispose();
          }
        }
        if (cleanupFnRef.current) {
          cleanupFnRef.current();
        }
        cleanupFnRef.current = nextCleanupFn;
        return res;
      }, [environment, operation]);
      useLayoutEffect12(function() {
        var cleanupFn = cleanupFnRef.current;
        return function() {
          cleanupFn && cleanupFn();
        };
      }, [snapshot]);
      return /* @__PURE__ */ React116.createElement(ReactRelayContext.Provider, {
        value: relayContext
      }, /* @__PURE__ */ React116.createElement(ReactRelayQueryRendererContext.Provider, {
        value: queryRendererContext
      }, render2({
        props: dataRef.current
      })));
    }
    module.exports = ReactRelayLocalQueryRenderer;
  }
});

// node_modules/react-relay/lib/getRootVariablesForFragments.js
var require_getRootVariablesForFragments = __commonJS({
  "node_modules/react-relay/lib/getRootVariablesForFragments.js"(exports, module) {
    "use strict";
    var _interopRequireDefault = require_interopRequireDefault()["default"];
    var _objectSpread210 = _interopRequireDefault(require_objectSpread2());
    var _require = require_relay_runtime();
    var getSelector = _require.getSelector;
    function getRootVariablesForFragments(fragments, props) {
      var rootVariables = {};
      Object.keys(fragments).forEach(function(key) {
        var _selector$selectors$, _selector$selectors$2, _selector$owner$varia;
        var fragmentNode = fragments[key];
        var fragmentRef = props[key];
        var selector = getSelector(fragmentNode, fragmentRef);
        var fragmentOwnerVariables = selector != null && selector.kind === "PluralReaderSelector" ? (_selector$selectors$ = (_selector$selectors$2 = selector.selectors[0]) === null || _selector$selectors$2 === void 0 ? void 0 : _selector$selectors$2.owner.variables) !== null && _selector$selectors$ !== void 0 ? _selector$selectors$ : {} : (_selector$owner$varia = selector === null || selector === void 0 ? void 0 : selector.owner.variables) !== null && _selector$owner$varia !== void 0 ? _selector$owner$varia : {};
        rootVariables = (0, _objectSpread210["default"])((0, _objectSpread210["default"])({}, rootVariables), fragmentOwnerVariables);
      });
      return rootVariables;
    }
    module.exports = getRootVariablesForFragments;
  }
});

// node_modules/react-relay/lib/ReactRelayQueryFetcher.js
var require_ReactRelayQueryFetcher = __commonJS({
  "node_modules/react-relay/lib/ReactRelayQueryFetcher.js"(exports, module) {
    "use strict";
    var _interopRequireDefault = require_interopRequireDefault()["default"];
    var _defineProperty210 = _interopRequireDefault(require_defineProperty());
    var invariant3 = require_browser();
    var _require = require_relay_runtime();
    var fetchQuery7 = _require.__internal.fetchQuery;
    var createOperationDescriptor = _require.createOperationDescriptor;
    var isRelayModernEnvironment = _require.isRelayModernEnvironment;
    var ReactRelayQueryFetcher = /* @__PURE__ */ function() {
      function ReactRelayQueryFetcher2(args) {
        (0, _defineProperty210["default"])(this, "_selectionReferences", []);
        (0, _defineProperty210["default"])(this, "_didFetchFinish", false);
        if (args != null) {
          this._cacheSelectionReference = args.cacheSelectionReference;
          this._selectionReferences = args.selectionReferences;
        }
      }
      var _proto = ReactRelayQueryFetcher2.prototype;
      _proto.getSelectionReferences = function getSelectionReferences() {
        return {
          cacheSelectionReference: this._cacheSelectionReference,
          selectionReferences: this._selectionReferences
        };
      };
      _proto.lookupInStore = function lookupInStore(environment, operation, fetchPolicy) {
        if (fetchPolicy === "store-and-network" || fetchPolicy === "store-or-network") {
          if (environment.check(operation).status === "available") {
            this._retainCachedOperation(environment, operation);
            return environment.lookup(operation.fragment);
          }
        }
        return null;
      };
      _proto.getFetchResult = function getFetchResult() {
        if (this._didFetchFinish) {
          if (this._error != null) {
            return {
              error: this._error
            };
          } else if (this._snapshot != null) {
            return {
              snapshot: this._snapshot
            };
          }
        } else {
          return null;
        }
      };
      _proto.execute = function execute(_ref18) {
        var _this = this;
        var environment = _ref18.environment, operation = _ref18.operation, _ref$preservePrevious = _ref18.preservePreviousReferences, preservePreviousReferences = _ref$preservePrevious === void 0 ? false : _ref$preservePrevious;
        var reference = environment.retain(operation);
        var error = function error2() {
          _this._selectionReferences = _this._selectionReferences.concat(reference);
        };
        var complete = function complete2() {
          if (!preservePreviousReferences) {
            _this.disposeSelectionReferences();
          }
          _this._selectionReferences = _this._selectionReferences.concat(reference);
        };
        var unsubscribe = function unsubscribe2() {
          _this._selectionReferences = _this._selectionReferences.concat(reference);
        };
        if (!isRelayModernEnvironment(environment)) {
          return environment.execute({
            operation
          })["do"]({
            error,
            complete,
            unsubscribe
          });
        }
        return fetchQuery7(environment, operation)["do"]({
          error,
          complete,
          unsubscribe
        });
      };
      _proto.setOnDataChange = function setOnDataChange(onDataChange) {
        !this._fetchOptions ? true ? invariant3(false, "ReactRelayQueryFetcher: `setOnDataChange` should have been called after having called `fetch`") : invariant3(false) : void 0;
        if (typeof onDataChange === "function") {
          this._fetchOptions.onDataChangeCallbacks = this._fetchOptions.onDataChangeCallbacks || [];
          this._fetchOptions.onDataChangeCallbacks.push(onDataChange);
          if (this._didFetchFinish) {
            if (this._error != null) {
              onDataChange({
                error: this._error
              });
            } else if (this._snapshot != null) {
              onDataChange({
                snapshot: this._snapshot
              });
            }
          }
        }
      };
      _proto.fetch = function fetch2(fetchOptions, cacheConfigOverride) {
        var _this2 = this;
        var environment = fetchOptions.environment, operation = fetchOptions.operation, onDataChange = fetchOptions.onDataChange;
        var fetchHasReturned = false;
        var _error;
        this.disposeRequest();
        var oldOnDataChangeCallbacks = this._fetchOptions && this._fetchOptions.onDataChangeCallbacks;
        this._fetchOptions = {
          environment,
          onDataChangeCallbacks: oldOnDataChangeCallbacks || [],
          operation
        };
        if (onDataChange && this._fetchOptions.onDataChangeCallbacks.indexOf(onDataChange) === -1) {
          this._fetchOptions.onDataChangeCallbacks.push(onDataChange);
        }
        var operationOverride = cacheConfigOverride ? createOperationDescriptor(operation.request.node, operation.request.variables, cacheConfigOverride) : operation;
        var request = this.execute({
          environment,
          operation: operationOverride
        })["finally"](function() {
          _this2._pendingRequest = null;
        }).subscribe({
          next: function next2() {
            _this2._didFetchFinish = true;
            _this2._error = null;
            _this2._onQueryDataAvailable({
              notifyFirstResult: fetchHasReturned
            });
          },
          error: function error(err) {
            _this2._didFetchFinish = true;
            _this2._error = err;
            _this2._snapshot = null;
            var onDataChangeCallbacks = _this2._fetchOptions && _this2._fetchOptions.onDataChangeCallbacks;
            if (fetchHasReturned) {
              if (onDataChangeCallbacks) {
                onDataChangeCallbacks.forEach(function(onDataChange2) {
                  onDataChange2({
                    error: err
                  });
                });
              }
            } else {
              _error = err;
            }
          }
        });
        this._pendingRequest = {
          dispose: function dispose2() {
            request.unsubscribe();
          }
        };
        fetchHasReturned = true;
        if (_error) {
          throw _error;
        }
        return this._snapshot;
      };
      _proto.retry = function retry(cacheConfigOverride) {
        !this._fetchOptions ? true ? invariant3(false, "ReactRelayQueryFetcher: `retry` should be called after having called `fetch`") : invariant3(false) : void 0;
        return this.fetch({
          environment: this._fetchOptions.environment,
          operation: this._fetchOptions.operation,
          onDataChange: null
          // If there are onDataChangeCallbacks they will be reused
        }, cacheConfigOverride);
      };
      _proto.dispose = function dispose2() {
        this.disposeRequest();
        this.disposeSelectionReferences();
      };
      _proto.disposeRequest = function disposeRequest() {
        this._error = null;
        this._snapshot = null;
        if (this._pendingRequest) {
          this._pendingRequest.dispose();
        }
        if (this._rootSubscription) {
          this._rootSubscription.dispose();
          this._rootSubscription = null;
        }
      };
      _proto._retainCachedOperation = function _retainCachedOperation(environment, operation) {
        this._disposeCacheSelectionReference();
        this._cacheSelectionReference = environment.retain(operation);
      };
      _proto._disposeCacheSelectionReference = function _disposeCacheSelectionReference() {
        this._cacheSelectionReference && this._cacheSelectionReference.dispose();
        this._cacheSelectionReference = null;
      };
      _proto.disposeSelectionReferences = function disposeSelectionReferences() {
        this._disposeCacheSelectionReference();
        this._selectionReferences.forEach(function(r3) {
          return r3.dispose();
        });
        this._selectionReferences = [];
      };
      _proto._onQueryDataAvailable = function _onQueryDataAvailable(_ref22) {
        var _this3 = this;
        var notifyFirstResult = _ref22.notifyFirstResult;
        !this._fetchOptions ? true ? invariant3(false, "ReactRelayQueryFetcher: `_onQueryDataAvailable` should have been called after having called `fetch`") : invariant3(false) : void 0;
        var _this$_fetchOptions = this._fetchOptions, environment = _this$_fetchOptions.environment, onDataChangeCallbacks = _this$_fetchOptions.onDataChangeCallbacks, operation = _this$_fetchOptions.operation;
        if (this._snapshot) {
          return;
        }
        this._snapshot = environment.lookup(operation.fragment);
        this._rootSubscription = environment.subscribe(this._snapshot, function(snapshot2) {
          if (_this3._fetchOptions != null) {
            var maybeNewOnDataChangeCallbacks = _this3._fetchOptions.onDataChangeCallbacks;
            if (Array.isArray(maybeNewOnDataChangeCallbacks)) {
              maybeNewOnDataChangeCallbacks.forEach(function(onDataChange) {
                return onDataChange({
                  snapshot: snapshot2
                });
              });
            }
          }
        });
        if (this._snapshot && notifyFirstResult && Array.isArray(onDataChangeCallbacks)) {
          var snapshot = this._snapshot;
          onDataChangeCallbacks.forEach(function(onDataChange) {
            return onDataChange({
              snapshot
            });
          });
        }
      };
      return ReactRelayQueryFetcher2;
    }();
    module.exports = ReactRelayQueryFetcher;
  }
});

// node_modules/react-relay/lib/ReactRelayPaginationContainer.js
var require_ReactRelayPaginationContainer = __commonJS({
  "node_modules/react-relay/lib/ReactRelayPaginationContainer.js"(exports, module) {
    "use strict";
    var _interopRequireDefault = require_interopRequireDefault()["default"];
    var _extends210 = _interopRequireDefault(require_extends());
    var _objectWithoutPropertiesLoose28 = _interopRequireDefault(require_objectWithoutPropertiesLoose());
    var _assertThisInitialized22 = _interopRequireDefault(require_assertThisInitialized());
    var _inheritsLoose22 = _interopRequireDefault(require_inheritsLoose());
    var _defineProperty210 = _interopRequireDefault(require_defineProperty());
    var _objectSpread310 = _interopRequireDefault(require_objectSpread2());
    var _excluded36 = ["componentRef"];
    var _excluded212 = ["componentRef", "__relayContext", "__rootIsQueryRenderer"];
    var _excluded37 = ["componentRef", "__relayContext", "__rootIsQueryRenderer"];
    var buildReactRelayContainer = require_buildReactRelayContainer();
    var getRootVariablesForFragments = require_getRootVariablesForFragments();
    var _require = require_ReactRelayContainerUtils();
    var getComponentName = _require.getComponentName;
    var getContainerName = _require.getContainerName;
    var ReactRelayContext = require_ReactRelayContext();
    var ReactRelayQueryFetcher = require_ReactRelayQueryFetcher();
    var _require2 = require_RelayContext();
    var assertRelayContext = _require2.assertRelayContext;
    var areEqual2 = require_areEqual();
    var invariant3 = require_browser();
    var React116 = require_react();
    var _require3 = require_relay_runtime();
    var ConnectionInterface = _require3.ConnectionInterface;
    var Observable = _require3.Observable;
    var RelayFeatureFlags = _require3.RelayFeatureFlags;
    var createFragmentSpecResolver = _require3.createFragmentSpecResolver;
    var createOperationDescriptor = _require3.createOperationDescriptor;
    var getDataIDsFromObject = _require3.getDataIDsFromObject;
    var getRequest = _require3.getRequest;
    var getVariablesFromObject = _require3.getVariablesFromObject;
    var isScalarAndEqual = _require3.isScalarAndEqual;
    var warning2 = require_warning();
    var FORWARD = "forward";
    function createGetConnectionFromProps(metadata) {
      var path2 = metadata.path;
      !path2 ? true ? invariant3(false, "ReactRelayPaginationContainer: Unable to synthesize a getConnectionFromProps function.") : invariant3(false) : void 0;
      return function(props) {
        var data = props[metadata.fragmentName];
        for (var i2 = 0; i2 < path2.length; i2++) {
          if (!data || typeof data !== "object") {
            return null;
          }
          data = data[path2[i2]];
        }
        return data;
      };
    }
    function createGetFragmentVariables(metadata) {
      var countVariable = metadata.count;
      !countVariable ? true ? invariant3(false, "ReactRelayPaginationContainer: Unable to synthesize a getFragmentVariables function.") : invariant3(false) : void 0;
      return function(prevVars, totalCount) {
        return (0, _objectSpread310["default"])((0, _objectSpread310["default"])({}, prevVars), {}, (0, _defineProperty210["default"])({}, countVariable, totalCount));
      };
    }
    function findConnectionMetadata(fragments) {
      var foundConnectionMetadata = null;
      var isRelayModern = false;
      for (var fragmentName in fragments) {
        var fragment2 = fragments[fragmentName];
        var connectionMetadata = fragment2.metadata && fragment2.metadata.connection;
        if (fragment2.metadata !== void 0) {
          isRelayModern = true;
        }
        if (connectionMetadata) {
          !(connectionMetadata.length === 1) ? true ? invariant3(false, "ReactRelayPaginationContainer: Only a single @connection is supported, `%s` has %s.", fragmentName, connectionMetadata.length) : invariant3(false) : void 0;
          !!foundConnectionMetadata ? true ? invariant3(false, "ReactRelayPaginationContainer: Only a single fragment with @connection is supported.") : invariant3(false) : void 0;
          foundConnectionMetadata = (0, _objectSpread310["default"])((0, _objectSpread310["default"])({}, connectionMetadata[0]), {}, {
            fragmentName
          });
        }
      }
      !(!isRelayModern || foundConnectionMetadata !== null) ? true ? invariant3(false, "ReactRelayPaginationContainer: A @connection directive must be present.") : invariant3(false) : void 0;
      return foundConnectionMetadata || {};
    }
    function toObserver(observerOrCallback) {
      return typeof observerOrCallback === "function" ? {
        error: observerOrCallback,
        complete: observerOrCallback,
        unsubscribe: function unsubscribe(subscription2) {
          typeof observerOrCallback === "function" && observerOrCallback();
        }
      } : observerOrCallback || {};
    }
    function createContainerWithFragments(Component8, fragments, connectionConfig) {
      var _class4;
      var componentName = getComponentName(Component8);
      var containerName = getContainerName(Component8);
      var metadata = findConnectionMetadata(fragments);
      var getConnectionFromProps = connectionConfig.getConnectionFromProps || createGetConnectionFromProps(metadata);
      var direction = connectionConfig.direction || metadata.direction;
      !direction ? true ? invariant3(false, "ReactRelayPaginationContainer: Unable to infer direction of the connection, possibly because both first and last are provided.") : invariant3(false) : void 0;
      var getFragmentVariables = connectionConfig.getFragmentVariables || createGetFragmentVariables(metadata);
      return _class4 = /* @__PURE__ */ function(_React$Component) {
        (0, _inheritsLoose22["default"])(_class5, _React$Component);
        function _class5(props) {
          var _props$__rootIsQueryR, _this;
          _this = _React$Component.call(this, props) || this;
          (0, _defineProperty210["default"])((0, _assertThisInitialized22["default"])(_this), "_handleFragmentDataUpdate", function() {
            _this.setState({
              data: _this._resolver.resolve()
            });
          });
          (0, _defineProperty210["default"])((0, _assertThisInitialized22["default"])(_this), "_hasMore", function() {
            var connectionData = _this._getConnectionData();
            return !!(connectionData && connectionData.hasMore && connectionData.cursor);
          });
          (0, _defineProperty210["default"])((0, _assertThisInitialized22["default"])(_this), "_isLoading", function() {
            return !!_this._refetchSubscription;
          });
          (0, _defineProperty210["default"])((0, _assertThisInitialized22["default"])(_this), "_refetchConnection", function(totalCount, observerOrCallback, refetchVariables) {
            if (!_this._canFetchPage("refetchConnection")) {
              return {
                dispose: function dispose2() {
                }
              };
            }
            _this._refetchVariables = refetchVariables;
            var paginatingVariables = {
              count: totalCount,
              cursor: null,
              totalCount
            };
            var fetch2 = _this._fetchPage(paginatingVariables, toObserver(observerOrCallback), {
              force: true
            });
            return {
              dispose: fetch2.unsubscribe
            };
          });
          (0, _defineProperty210["default"])((0, _assertThisInitialized22["default"])(_this), "_loadMore", function(pageSize, observerOrCallback, options) {
            if (!_this._canFetchPage("loadMore")) {
              return {
                dispose: function dispose2() {
                }
              };
            }
            var observer = toObserver(observerOrCallback);
            var connectionData = _this._getConnectionData();
            if (!connectionData) {
              Observable.create(function(sink) {
                return sink.complete();
              }).subscribe(observer);
              return null;
            }
            var totalCount = connectionData.edgeCount + pageSize;
            if (options && options.force) {
              return _this._refetchConnection(totalCount, observerOrCallback);
            }
            var _ConnectionInterface$ = ConnectionInterface.get(), END_CURSOR = _ConnectionInterface$.END_CURSOR, START_CURSOR = _ConnectionInterface$.START_CURSOR;
            var cursor3 = connectionData.cursor;
            true ? warning2(cursor3 != null && cursor3 !== "", "ReactRelayPaginationContainer: Cannot `loadMore` without valid `%s` (got `%s`)", direction === FORWARD ? END_CURSOR : START_CURSOR, cursor3) : void 0;
            var paginatingVariables = {
              count: pageSize,
              cursor: cursor3,
              totalCount
            };
            var fetch2 = _this._fetchPage(paginatingVariables, observer, options);
            return {
              dispose: fetch2.unsubscribe
            };
          });
          var relayContext = assertRelayContext(props.__relayContext);
          var rootIsQueryRenderer = (_props$__rootIsQueryR = props.__rootIsQueryRenderer) !== null && _props$__rootIsQueryR !== void 0 ? _props$__rootIsQueryR : false;
          _this._isARequestInFlight = false;
          _this._refetchSubscription = null;
          _this._refetchVariables = null;
          if (RelayFeatureFlags.ENABLE_CONTAINERS_SUBSCRIBE_ON_COMMIT === true) {
            _this._resolver = createFragmentSpecResolver(relayContext, containerName, fragments, props, rootIsQueryRenderer);
          } else {
            _this._resolver = createFragmentSpecResolver(relayContext, containerName, fragments, props, rootIsQueryRenderer, _this._handleFragmentDataUpdate);
          }
          _this.state = {
            data: _this._resolver.resolve(),
            prevContext: relayContext,
            contextForChildren: relayContext,
            relayProp: _this._buildRelayProp(relayContext),
            resolverGeneration: 0
          };
          _this._isUnmounted = false;
          _this._hasFetched = false;
          return _this;
        }
        var _proto = _class5.prototype;
        _proto.componentDidMount = function componentDidMount() {
          this._isUnmounted = false;
          if (RelayFeatureFlags.ENABLE_CONTAINERS_SUBSCRIBE_ON_COMMIT === true) {
            this._subscribeToNewResolverAndRerenderIfStoreHasChanged();
          }
        };
        _proto.componentDidUpdate = function componentDidUpdate(prevProps, prevState) {
          if (RelayFeatureFlags.ENABLE_CONTAINERS_SUBSCRIBE_ON_COMMIT === true) {
            if (prevState.resolverGeneration !== this.state.resolverGeneration) {
              this._subscribeToNewResolverAndRerenderIfStoreHasChanged();
            } else {
              this._rerenderIfStoreHasChanged();
            }
          }
        };
        _proto.UNSAFE_componentWillReceiveProps = function UNSAFE_componentWillReceiveProps(nextProps) {
          var _this2 = this;
          var _nextProps$__rootIsQu;
          var relayContext = assertRelayContext(nextProps.__relayContext);
          var rootIsQueryRenderer = (_nextProps$__rootIsQu = nextProps.__rootIsQueryRenderer) !== null && _nextProps$__rootIsQu !== void 0 ? _nextProps$__rootIsQu : false;
          var prevIDs = getDataIDsFromObject(fragments, this.props);
          var nextIDs = getDataIDsFromObject(fragments, nextProps);
          var prevRootVariables = getRootVariablesForFragments(fragments, this.props);
          var nextRootVariables = getRootVariablesForFragments(fragments, nextProps);
          if (relayContext.environment !== this.state.prevContext.environment || !areEqual2(prevRootVariables, nextRootVariables) || !areEqual2(prevIDs, nextIDs)) {
            this._cleanup();
            if (RelayFeatureFlags.ENABLE_CONTAINERS_SUBSCRIBE_ON_COMMIT === true) {
              this._resolver = createFragmentSpecResolver(relayContext, containerName, fragments, nextProps, rootIsQueryRenderer);
            } else {
              this._resolver = createFragmentSpecResolver(relayContext, containerName, fragments, nextProps, rootIsQueryRenderer, this._handleFragmentDataUpdate);
            }
            this.setState(function(prevState) {
              return {
                prevContext: relayContext,
                contextForChildren: relayContext,
                relayProp: _this2._buildRelayProp(relayContext),
                resolverGeneration: prevState.resolverGeneration + 1
              };
            });
          } else if (!this._hasFetched) {
            this._resolver.setProps(nextProps);
          }
          var data = this._resolver.resolve();
          if (data !== this.state.data) {
            this.setState({
              data
            });
          }
        };
        _proto.componentWillUnmount = function componentWillUnmount() {
          this._isUnmounted = true;
          this._cleanup();
        };
        _proto.shouldComponentUpdate = function shouldComponentUpdate(nextProps, nextState) {
          if (nextState.data !== this.state.data || nextState.relayProp !== this.state.relayProp || nextState.resolverGeneration !== this.state.resolverGeneration) {
            return true;
          }
          var keys4 = Object.keys(nextProps);
          for (var ii = 0; ii < keys4.length; ii++) {
            var key = keys4[ii];
            if (key === "__relayContext") {
              if (nextState.prevContext.environment !== this.state.prevContext.environment) {
                return true;
              }
            } else {
              if (!fragments.hasOwnProperty(key) && !isScalarAndEqual(nextProps[key], this.props[key])) {
                return true;
              }
            }
          }
          return false;
        };
        _proto._buildRelayProp = function _buildRelayProp(relayContext) {
          return {
            hasMore: this._hasMore,
            isLoading: this._isLoading,
            loadMore: this._loadMore,
            refetchConnection: this._refetchConnection,
            environment: relayContext.environment
          };
        };
        _proto._rerenderIfStoreHasChanged = function _rerenderIfStoreHasChanged() {
          var data = this.state.data;
          var maybeNewData = this._resolver.resolve();
          if (data !== maybeNewData) {
            this.setState({
              data: maybeNewData
            });
          }
        };
        _proto._subscribeToNewResolverAndRerenderIfStoreHasChanged = function _subscribeToNewResolverAndRerenderIfStoreHasChanged() {
          var data = this.state.data;
          var maybeNewData = this._resolver.resolve();
          this._resolver.setCallback(this.props, this._handleFragmentDataUpdate);
          if (data !== maybeNewData) {
            this.setState({
              data: maybeNewData
            });
          }
        };
        _proto._getConnectionData = function _getConnectionData() {
          var _this$props = this.props, _ = _this$props.componentRef, restProps = (0, _objectWithoutPropertiesLoose28["default"])(_this$props, _excluded36);
          var props = (0, _objectSpread310["default"])((0, _objectSpread310["default"])({}, restProps), this.state.data);
          var connectionData = getConnectionFromProps(props);
          if (connectionData == null) {
            return null;
          }
          var _ConnectionInterface$2 = ConnectionInterface.get(), EDGES = _ConnectionInterface$2.EDGES, PAGE_INFO = _ConnectionInterface$2.PAGE_INFO, HAS_NEXT_PAGE = _ConnectionInterface$2.HAS_NEXT_PAGE, HAS_PREV_PAGE = _ConnectionInterface$2.HAS_PREV_PAGE, END_CURSOR = _ConnectionInterface$2.END_CURSOR, START_CURSOR = _ConnectionInterface$2.START_CURSOR;
          !(typeof connectionData === "object") ? true ? invariant3(false, "ReactRelayPaginationContainer: Expected `getConnectionFromProps()` in `%s`to return `null` or a plain object with %s and %s properties, got `%s`.", componentName, EDGES, PAGE_INFO, connectionData) : invariant3(false) : void 0;
          var edges = connectionData[EDGES];
          var pageInfo2 = connectionData[PAGE_INFO];
          if (edges == null || pageInfo2 == null) {
            return null;
          }
          !Array.isArray(edges) ? true ? invariant3(false, "ReactRelayPaginationContainer: Expected `getConnectionFromProps()` in `%s`to return an object with %s: Array, got `%s`.", componentName, EDGES, edges) : invariant3(false) : void 0;
          !(typeof pageInfo2 === "object") ? true ? invariant3(false, "ReactRelayPaginationContainer: Expected `getConnectionFromProps()` in `%s`to return an object with %s: Object, got `%s`.", componentName, PAGE_INFO, pageInfo2) : invariant3(false) : void 0;
          var hasMore = direction === FORWARD ? pageInfo2[HAS_NEXT_PAGE] : pageInfo2[HAS_PREV_PAGE];
          var cursor3 = direction === FORWARD ? pageInfo2[END_CURSOR] : pageInfo2[START_CURSOR];
          if (typeof hasMore !== "boolean" || edges.length !== 0 && typeof cursor3 === "undefined") {
            true ? warning2(false, "ReactRelayPaginationContainer: Cannot paginate without %s fields in `%s`. Be sure to fetch %s (got `%s`) and %s (got `%s`).", PAGE_INFO, componentName, direction === FORWARD ? HAS_NEXT_PAGE : HAS_PREV_PAGE, hasMore, direction === FORWARD ? END_CURSOR : START_CURSOR, cursor3) : void 0;
            return null;
          }
          return {
            cursor: cursor3,
            edgeCount: edges.length,
            hasMore
          };
        };
        _proto._getQueryFetcher = function _getQueryFetcher() {
          if (!this._queryFetcher) {
            this._queryFetcher = new ReactRelayQueryFetcher();
          }
          return this._queryFetcher;
        };
        _proto._canFetchPage = function _canFetchPage(method) {
          if (this._isUnmounted) {
            true ? warning2(false, "ReactRelayPaginationContainer: Unexpected call of `%s` on unmounted container `%s`. It looks like some instances of your container still trying to fetch data but they already unmounted. Please make sure you clear all timers, intervals, async calls, etc that may trigger `%s` call.", method, containerName, method) : void 0;
            return false;
          }
          return true;
        };
        _proto._fetchPage = function _fetchPage(paginatingVariables, observer, options) {
          var _this3 = this;
          var _assertRelayContext = assertRelayContext(this.props.__relayContext), environment = _assertRelayContext.environment;
          var _this$props2 = this.props, _ = _this$props2.componentRef, __relayContext = _this$props2.__relayContext, __rootIsQueryRenderer = _this$props2.__rootIsQueryRenderer, restProps = (0, _objectWithoutPropertiesLoose28["default"])(_this$props2, _excluded212);
          var props = (0, _objectSpread310["default"])((0, _objectSpread310["default"])({}, restProps), this.state.data);
          var fragmentVariables;
          var rootVariables = getRootVariablesForFragments(fragments, restProps);
          fragmentVariables = getVariablesFromObject(fragments, restProps);
          fragmentVariables = (0, _objectSpread310["default"])((0, _objectSpread310["default"])((0, _objectSpread310["default"])({}, rootVariables), fragmentVariables), this._refetchVariables);
          var fetchVariables = connectionConfig.getVariables(props, {
            count: paginatingVariables.count,
            cursor: paginatingVariables.cursor
          }, fragmentVariables);
          !(typeof fetchVariables === "object" && fetchVariables !== null) ? true ? invariant3(false, "ReactRelayPaginationContainer: Expected `getVariables()` to return an object, got `%s` in `%s`.", fetchVariables, componentName) : invariant3(false) : void 0;
          fetchVariables = (0, _objectSpread310["default"])((0, _objectSpread310["default"])({}, fetchVariables), this._refetchVariables);
          fragmentVariables = (0, _objectSpread310["default"])((0, _objectSpread310["default"])({}, fetchVariables), fragmentVariables);
          var cacheConfig = options ? {
            force: !!options.force
          } : void 0;
          if (cacheConfig != null && (options === null || options === void 0 ? void 0 : options.metadata) != null) {
            cacheConfig.metadata = options === null || options === void 0 ? void 0 : options.metadata;
          }
          var request = getRequest(connectionConfig.query);
          var operation = createOperationDescriptor(request, fetchVariables, cacheConfig);
          var refetchSubscription = null;
          if (this._refetchSubscription) {
            this._refetchSubscription.unsubscribe();
          }
          this._hasFetched = true;
          var onNext = function onNext2(payload, complete) {
            var prevData = _this3._resolver.resolve();
            _this3._resolver.setVariables(getFragmentVariables(fragmentVariables, paginatingVariables.totalCount), operation.request.node);
            var nextData = _this3._resolver.resolve();
            if (!areEqual2(prevData, nextData)) {
              _this3.setState({
                data: nextData,
                contextForChildren: {
                  environment: _this3.props.__relayContext.environment
                }
              }, complete);
            } else {
              complete();
            }
          };
          var cleanup = function cleanup2() {
            if (_this3._refetchSubscription === refetchSubscription) {
              _this3._refetchSubscription = null;
              _this3._isARequestInFlight = false;
            }
          };
          this._isARequestInFlight = true;
          refetchSubscription = this._getQueryFetcher().execute({
            environment,
            operation,
            preservePreviousReferences: true
          }).mergeMap(function(payload) {
            return Observable.create(function(sink) {
              onNext(payload, function() {
                sink.next();
                sink.complete();
              });
            });
          })["do"]({
            error: cleanup,
            complete: cleanup,
            unsubscribe: cleanup
          }).subscribe(observer || {});
          this._refetchSubscription = this._isARequestInFlight ? refetchSubscription : null;
          return refetchSubscription;
        };
        _proto._cleanup = function _cleanup() {
          this._resolver.dispose();
          this._refetchVariables = null;
          this._hasFetched = false;
          if (this._refetchSubscription) {
            this._refetchSubscription.unsubscribe();
            this._refetchSubscription = null;
            this._isARequestInFlight = false;
          }
          if (this._queryFetcher) {
            this._queryFetcher.dispose();
          }
        };
        _proto.render = function render2() {
          var _this$props3 = this.props, componentRef = _this$props3.componentRef, __relayContext = _this$props3.__relayContext, __rootIsQueryRenderer = _this$props3.__rootIsQueryRenderer, props = (0, _objectWithoutPropertiesLoose28["default"])(_this$props3, _excluded37);
          return /* @__PURE__ */ React116.createElement(ReactRelayContext.Provider, {
            value: this.state.contextForChildren
          }, /* @__PURE__ */ React116.createElement(Component8, (0, _extends210["default"])({}, props, this.state.data, {
            ref: componentRef,
            relay: this.state.relayProp
          })));
        };
        return _class5;
      }(React116.Component), (0, _defineProperty210["default"])(_class4, "displayName", containerName), _class4;
    }
    function createContainer(Component8, fragmentSpec, connectionConfig) {
      return buildReactRelayContainer(Component8, fragmentSpec, function(ComponentClass, fragments) {
        return createContainerWithFragments(ComponentClass, fragments, connectionConfig);
      });
    }
    module.exports = {
      createContainer
    };
  }
});

// node_modules/react-relay/lib/ReactRelayQueryRenderer.js
var require_ReactRelayQueryRenderer = __commonJS({
  "node_modules/react-relay/lib/ReactRelayQueryRenderer.js"(exports, module) {
    "use strict";
    var _interopRequireDefault = require_interopRequireDefault()["default"];
    var _objectSpread210 = _interopRequireDefault(require_objectSpread2());
    var _assertThisInitialized22 = _interopRequireDefault(require_assertThisInitialized());
    var _inheritsLoose22 = _interopRequireDefault(require_inheritsLoose());
    var _defineProperty210 = _interopRequireDefault(require_defineProperty());
    var ReactRelayContext = require_ReactRelayContext();
    var ReactRelayQueryFetcher = require_ReactRelayQueryFetcher();
    var ReactRelayQueryRendererContext = require_ReactRelayQueryRendererContext();
    var areEqual2 = require_areEqual();
    var React116 = require_react();
    var _require = require_relay_runtime();
    var RelayFeatureFlags = _require.RelayFeatureFlags;
    var _require2 = require_relay_runtime();
    var createOperationDescriptor = _require2.createOperationDescriptor;
    var deepFreeze = _require2.deepFreeze;
    var getRequest = _require2.getRequest;
    var requestCache = {};
    var queryRendererContext = {
      rootIsQueryRenderer: true
    };
    var ReactRelayQueryRenderer = /* @__PURE__ */ function(_React$Component) {
      (0, _inheritsLoose22["default"])(ReactRelayQueryRenderer2, _React$Component);
      function ReactRelayQueryRenderer2(props) {
        var _this;
        _this = _React$Component.call(this, props) || this;
        (0, _defineProperty210["default"])((0, _assertThisInitialized22["default"])(_this), "_handleDataChange", function(params) {
          var error = params.error == null ? null : params.error;
          var snapshot = params.snapshot == null ? null : params.snapshot;
          _this.setState(function(prevState) {
            var prevRequestCacheKey = prevState.requestCacheKey;
            if (prevRequestCacheKey) {
              delete requestCache[prevRequestCacheKey];
            }
            if (snapshot === prevState.snapshot && error === prevState.error) {
              return null;
            }
            return {
              renderProps: getRenderProps(error, snapshot, prevState.queryFetcher, prevState.retryCallbacks),
              snapshot,
              requestCacheKey: null
            };
          });
        });
        var retryCallbacks = {
          handleDataChange: null,
          handleRetryAfterError: null
        };
        var queryFetcher;
        var requestCacheKey;
        if (props.query) {
          var query2 = props.query;
          var request = getRequest(query2);
          requestCacheKey = getRequestCacheKey(request.params, props.variables);
          queryFetcher = requestCache[requestCacheKey] ? requestCache[requestCacheKey].queryFetcher : new ReactRelayQueryFetcher();
        } else {
          queryFetcher = new ReactRelayQueryFetcher();
        }
        _this._maybeHiddenOrFastRefresh = false;
        _this.state = (0, _objectSpread210["default"])({
          prevPropsEnvironment: props.environment,
          prevPropsVariables: props.variables,
          prevQuery: props.query,
          queryFetcher,
          retryCallbacks
        }, fetchQueryAndComputeStateFromProps(props, queryFetcher, retryCallbacks, requestCacheKey));
        return _this;
      }
      ReactRelayQueryRenderer2.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, prevState) {
        if (prevState.prevQuery !== nextProps.query || prevState.prevPropsEnvironment !== nextProps.environment || !areEqual2(prevState.prevPropsVariables, nextProps.variables)) {
          return resetQueryStateForUpdate(nextProps, prevState);
        }
        return null;
      };
      var _proto = ReactRelayQueryRenderer2.prototype;
      _proto.componentDidMount = function componentDidMount() {
        var _this2 = this;
        if (this._maybeHiddenOrFastRefresh === true) {
          this._maybeHiddenOrFastRefresh = false;
          this.setState(function(prevState) {
            var newState = resetQueryStateForUpdate(_this2.props, prevState);
            var requestCacheKey2 = newState.requestCacheKey, queryFetcher2 = newState.queryFetcher;
            if (requestCacheKey2 != null && requestCache[requestCacheKey2] != null) {
              if (RelayFeatureFlags.ENABLE_QUERY_RENDERER_SET_STATE_PREVENTION) {
                var fetchResult = queryFetcher2.getFetchResult();
                if (fetchResult != null) {
                  var _fetchResult$snapshot, _fetchResult$error;
                  var snapshot = (_fetchResult$snapshot = fetchResult.snapshot) !== null && _fetchResult$snapshot !== void 0 ? _fetchResult$snapshot : null;
                  var error = (_fetchResult$error = fetchResult.error) !== null && _fetchResult$error !== void 0 ? _fetchResult$error : null;
                  var prevRequestCacheKey = prevState.requestCacheKey;
                  if (prevRequestCacheKey != null) {
                    delete requestCache[prevRequestCacheKey];
                  }
                  newState.renderProps = getRenderProps(error, snapshot, queryFetcher2, prevState.retryCallbacks);
                  newState.snapshot = snapshot;
                  newState.requestCacheKey = null;
                } else {
                  queryFetcher2.setOnDataChange(_this2._handleDataChange);
                }
              } else {
                queryFetcher2.setOnDataChange(_this2._handleDataChange);
              }
            }
            return newState;
          });
          return;
        }
        var _this$state = this.state, retryCallbacks = _this$state.retryCallbacks, queryFetcher = _this$state.queryFetcher, requestCacheKey = _this$state.requestCacheKey;
        if (requestCacheKey) {
          delete requestCache[requestCacheKey];
        }
        retryCallbacks.handleDataChange = this._handleDataChange;
        retryCallbacks.handleRetryAfterError = function(error) {
          return _this2.setState(function(prevState) {
            var prevRequestCacheKey = prevState.requestCacheKey;
            if (prevRequestCacheKey) {
              delete requestCache[prevRequestCacheKey];
            }
            return {
              renderProps: getLoadingRenderProps(),
              requestCacheKey: null
            };
          });
        };
        if (this.props.query) {
          queryFetcher.setOnDataChange(this._handleDataChange);
        }
      };
      _proto.componentDidUpdate = function componentDidUpdate(_prevProps, prevState) {
        var _this$state2 = this.state, queryFetcher = _this$state2.queryFetcher, requestCacheKey = _this$state2.requestCacheKey;
        if (requestCacheKey) {
          delete requestCache[requestCacheKey];
          delete this.state.requestCacheKey;
        }
        if (this.props.query && queryFetcher !== prevState.queryFetcher) {
          queryFetcher.setOnDataChange(this._handleDataChange);
        }
      };
      _proto.componentWillUnmount = function componentWillUnmount() {
        this.state.queryFetcher.dispose();
        this._maybeHiddenOrFastRefresh = true;
      };
      _proto.shouldComponentUpdate = function shouldComponentUpdate(nextProps, nextState) {
        return nextProps.render !== this.props.render || nextState.renderProps !== this.state.renderProps;
      };
      _proto.render = function render2() {
        var _this$state3 = this.state, renderProps = _this$state3.renderProps, relayContext = _this$state3.relayContext;
        if (true) {
          deepFreeze(renderProps);
        }
        return /* @__PURE__ */ React116.createElement(ReactRelayContext.Provider, {
          value: relayContext
        }, /* @__PURE__ */ React116.createElement(ReactRelayQueryRendererContext.Provider, {
          value: queryRendererContext
        }, this.props.render(renderProps)));
      };
      return ReactRelayQueryRenderer2;
    }(React116.Component);
    function getLoadingRenderProps() {
      return {
        error: null,
        props: null,
        // `props: null` indicates that the data is being fetched (i.e. loading)
        retry: null
      };
    }
    function getEmptyRenderProps() {
      return {
        error: null,
        props: {},
        // `props: {}` indicates no data available
        retry: null
      };
    }
    function getRenderProps(error, snapshot, queryFetcher, retryCallbacks) {
      return {
        error: error ? error : null,
        props: snapshot ? snapshot.data : null,
        retry: function retry(cacheConfigOverride) {
          var syncSnapshot = queryFetcher.retry(cacheConfigOverride);
          if (syncSnapshot && typeof retryCallbacks.handleDataChange === "function") {
            retryCallbacks.handleDataChange({
              snapshot: syncSnapshot
            });
          } else if (error && typeof retryCallbacks.handleRetryAfterError === "function") {
            retryCallbacks.handleRetryAfterError(error);
          }
        }
      };
    }
    function getRequestCacheKey(request, variables) {
      return JSON.stringify({
        id: request.cacheID ? request.cacheID : request.id,
        variables
      });
    }
    function resetQueryStateForUpdate(props, prevState) {
      var query2 = props.query;
      var prevSelectionReferences = prevState.queryFetcher.getSelectionReferences();
      prevState.queryFetcher.disposeRequest();
      var queryFetcher;
      if (query2) {
        var request = getRequest(query2);
        var requestCacheKey = getRequestCacheKey(request.params, props.variables);
        queryFetcher = requestCache[requestCacheKey] ? requestCache[requestCacheKey].queryFetcher : new ReactRelayQueryFetcher(prevSelectionReferences);
      } else {
        queryFetcher = new ReactRelayQueryFetcher(prevSelectionReferences);
      }
      return (0, _objectSpread210["default"])({
        prevQuery: props.query,
        prevPropsEnvironment: props.environment,
        prevPropsVariables: props.variables,
        queryFetcher
      }, fetchQueryAndComputeStateFromProps(
        props,
        queryFetcher,
        prevState.retryCallbacks
        // passing no requestCacheKey will cause it to be recalculated internally
        // and we want the updated requestCacheKey, since variables may have changed
      ));
    }
    function fetchQueryAndComputeStateFromProps(props, queryFetcher, retryCallbacks, requestCacheKey) {
      var environment = props.environment, query2 = props.query, variables = props.variables, cacheConfig = props.cacheConfig;
      var genericEnvironment = environment;
      if (query2) {
        var request = getRequest(query2);
        var operation = createOperationDescriptor(request, variables, cacheConfig);
        var relayContext = {
          environment: genericEnvironment
        };
        if (typeof requestCacheKey === "string" && requestCache[requestCacheKey]) {
          var snapshot = requestCache[requestCacheKey].snapshot;
          if (snapshot) {
            return {
              error: null,
              relayContext,
              renderProps: getRenderProps(null, snapshot, queryFetcher, retryCallbacks),
              snapshot,
              requestCacheKey
            };
          } else {
            return {
              error: null,
              relayContext,
              renderProps: getLoadingRenderProps(),
              snapshot: null,
              requestCacheKey
            };
          }
        }
        try {
          var storeSnapshot = queryFetcher.lookupInStore(genericEnvironment, operation, props.fetchPolicy);
          var querySnapshot = queryFetcher.fetch({
            environment: genericEnvironment,
            onDataChange: null,
            operation
          });
          var _snapshot = querySnapshot || storeSnapshot;
          requestCacheKey = requestCacheKey || getRequestCacheKey(request.params, props.variables);
          requestCache[requestCacheKey] = {
            queryFetcher,
            snapshot: _snapshot
          };
          if (!_snapshot) {
            return {
              error: null,
              relayContext,
              renderProps: getLoadingRenderProps(),
              snapshot: null,
              requestCacheKey
            };
          }
          return {
            error: null,
            relayContext,
            renderProps: getRenderProps(null, _snapshot, queryFetcher, retryCallbacks),
            snapshot: _snapshot,
            requestCacheKey
          };
        } catch (error) {
          return {
            error,
            relayContext,
            renderProps: getRenderProps(error, null, queryFetcher, retryCallbacks),
            snapshot: null,
            requestCacheKey
          };
        }
      } else {
        queryFetcher.dispose();
        var _relayContext = {
          environment: genericEnvironment
        };
        return {
          error: null,
          relayContext: _relayContext,
          renderProps: getEmptyRenderProps(),
          requestCacheKey: null
          // if there is an error, don't cache request
        };
      }
    }
    module.exports = ReactRelayQueryRenderer;
  }
});

// node_modules/react-relay/lib/ReactRelayRefetchContainer.js
var require_ReactRelayRefetchContainer = __commonJS({
  "node_modules/react-relay/lib/ReactRelayRefetchContainer.js"(exports, module) {
    "use strict";
    var _interopRequireDefault = require_interopRequireDefault()["default"];
    var _extends210 = _interopRequireDefault(require_extends());
    var _objectWithoutPropertiesLoose28 = _interopRequireDefault(require_objectWithoutPropertiesLoose());
    var _objectSpread210 = _interopRequireDefault(require_objectSpread2());
    var _assertThisInitialized22 = _interopRequireDefault(require_assertThisInitialized());
    var _inheritsLoose22 = _interopRequireDefault(require_inheritsLoose());
    var _defineProperty210 = _interopRequireDefault(require_defineProperty());
    var _excluded36 = ["componentRef", "__relayContext", "__rootIsQueryRenderer"];
    var buildReactRelayContainer = require_buildReactRelayContainer();
    var getRootVariablesForFragments = require_getRootVariablesForFragments();
    var _require = require_ReactRelayContainerUtils();
    var getContainerName = _require.getContainerName;
    var ReactRelayContext = require_ReactRelayContext();
    var ReactRelayQueryFetcher = require_ReactRelayQueryFetcher();
    var _require2 = require_RelayContext();
    var assertRelayContext = _require2.assertRelayContext;
    var areEqual2 = require_areEqual();
    var React116 = require_react();
    var _require3 = require_relay_runtime();
    var Observable = _require3.Observable;
    var createFragmentSpecResolver = _require3.createFragmentSpecResolver;
    var createOperationDescriptor = _require3.createOperationDescriptor;
    var getDataIDsFromObject = _require3.getDataIDsFromObject;
    var getRequest = _require3.getRequest;
    var getVariablesFromObject = _require3.getVariablesFromObject;
    var isScalarAndEqual = _require3.isScalarAndEqual;
    var warning2 = require_warning();
    function createContainerWithFragments(Component8, fragments, taggedNode) {
      var _class4;
      var containerName = getContainerName(Component8);
      return _class4 = /* @__PURE__ */ function(_React$Component) {
        (0, _inheritsLoose22["default"])(_class5, _React$Component);
        function _class5(props) {
          var _props$__rootIsQueryR, _this;
          _this = _React$Component.call(this, props) || this;
          (0, _defineProperty210["default"])((0, _assertThisInitialized22["default"])(_this), "_handleFragmentDataUpdate", function() {
            var resolverFromThisUpdate = _this.state.resolver;
            _this.setState(function(updatedState) {
              return (
                // If this event belongs to the current data source, update.
                // Otherwise we should ignore it.
                resolverFromThisUpdate === updatedState.resolver ? {
                  data: updatedState.resolver.resolve()
                } : null
              );
            });
          });
          (0, _defineProperty210["default"])((0, _assertThisInitialized22["default"])(_this), "_refetch", function(refetchVariables, renderVariables, observerOrCallback, options) {
            if (_this._isUnmounted) {
              true ? warning2(false, "ReactRelayRefetchContainer: Unexpected call of `refetch` on unmounted container `%s`. It looks like some instances of your container still trying to refetch the data but they already unmounted. Please make sure you clear all timers, intervals, async calls, etc that may trigger `refetch`.", containerName) : void 0;
              return {
                dispose: function dispose2() {
                }
              };
            }
            var _assertRelayContext = assertRelayContext(_this.props.__relayContext), environment = _assertRelayContext.environment;
            var rootVariables = getRootVariablesForFragments(fragments, _this.props);
            var fetchVariables = typeof refetchVariables === "function" ? refetchVariables(_this._getFragmentVariables()) : refetchVariables;
            fetchVariables = (0, _objectSpread210["default"])((0, _objectSpread210["default"])({}, rootVariables), fetchVariables);
            var fragmentVariables = renderVariables ? (0, _objectSpread210["default"])((0, _objectSpread210["default"])({}, fetchVariables), renderVariables) : fetchVariables;
            var cacheConfig = options ? {
              force: !!options.force
            } : void 0;
            if (cacheConfig != null && (options === null || options === void 0 ? void 0 : options.metadata) != null) {
              cacheConfig.metadata = options === null || options === void 0 ? void 0 : options.metadata;
            }
            var observer = typeof observerOrCallback === "function" ? {
              // callback is not exectued on complete or unsubscribe
              // for backward compatibility
              next: observerOrCallback,
              error: observerOrCallback
            } : observerOrCallback || {};
            var query2 = getRequest(taggedNode);
            var operation = createOperationDescriptor(query2, fetchVariables, cacheConfig);
            _this.state.localVariables = fetchVariables;
            _this._refetchSubscription && _this._refetchSubscription.unsubscribe();
            var refetchSubscription;
            var storeSnapshot = _this._getQueryFetcher().lookupInStore(environment, operation, options === null || options === void 0 ? void 0 : options.fetchPolicy);
            if (storeSnapshot != null) {
              _this.state.resolver.setVariables(fragmentVariables, operation.request.node);
              _this.setState(function(latestState) {
                return {
                  data: latestState.resolver.resolve(),
                  contextForChildren: {
                    environment: _this.props.__relayContext.environment
                  }
                };
              }, function() {
                observer.next && observer.next();
                observer.complete && observer.complete();
              });
              return {
                dispose: function dispose2() {
                }
              };
            }
            _this._getQueryFetcher().execute({
              environment,
              operation,
              // TODO (T26430099): Cleanup old references
              preservePreviousReferences: true
            }).mergeMap(function(response) {
              _this.state.resolver.setVariables(fragmentVariables, operation.request.node);
              return Observable.create(function(sink) {
                return _this.setState(function(latestState) {
                  return {
                    data: latestState.resolver.resolve(),
                    contextForChildren: {
                      environment: _this.props.__relayContext.environment
                    }
                  };
                }, function() {
                  sink.next();
                  sink.complete();
                });
              });
            })["finally"](function() {
              if (_this._refetchSubscription === refetchSubscription) {
                _this._refetchSubscription = null;
              }
            }).subscribe((0, _objectSpread210["default"])((0, _objectSpread210["default"])({}, observer), {}, {
              start: function start(subscription2) {
                _this._refetchSubscription = refetchSubscription = subscription2;
                observer.start && observer.start(subscription2);
              }
            }));
            return {
              dispose: function dispose2() {
                refetchSubscription && refetchSubscription.unsubscribe();
              }
            };
          });
          var relayContext = assertRelayContext(props.__relayContext);
          var rootIsQueryRenderer = (_props$__rootIsQueryR = props.__rootIsQueryRenderer) !== null && _props$__rootIsQueryR !== void 0 ? _props$__rootIsQueryR : false;
          _this._refetchSubscription = null;
          var resolver = createFragmentSpecResolver(relayContext, containerName, fragments, props, rootIsQueryRenderer);
          _this.state = {
            data: resolver.resolve(),
            localVariables: null,
            prevProps: props,
            prevPropsContext: relayContext,
            contextForChildren: relayContext,
            relayProp: getRelayProp(relayContext.environment, _this._refetch),
            resolver
          };
          _this._isUnmounted = false;
          return _this;
        }
        var _proto = _class5.prototype;
        _proto.componentDidMount = function componentDidMount() {
          this._isUnmounted = false;
          this._subscribeToNewResolverAndRerenderIfStoreHasChanged();
        };
        _proto.componentDidUpdate = function componentDidUpdate(prevProps, prevState) {
          if (this.state.resolver !== prevState.resolver) {
            prevState.resolver.dispose();
            this._queryFetcher && this._queryFetcher.dispose();
            this._refetchSubscription && this._refetchSubscription.unsubscribe();
            this._subscribeToNewResolverAndRerenderIfStoreHasChanged();
          } else {
            this._rerenderIfStoreHasChanged();
          }
        };
        _class5.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, prevState) {
          var _nextProps$__rootIsQu;
          var prevProps = prevState.prevProps;
          var relayContext = assertRelayContext(nextProps.__relayContext);
          var rootIsQueryRenderer = (_nextProps$__rootIsQu = nextProps.__rootIsQueryRenderer) !== null && _nextProps$__rootIsQu !== void 0 ? _nextProps$__rootIsQu : false;
          var prevIDs = getDataIDsFromObject(fragments, prevProps);
          var nextIDs = getDataIDsFromObject(fragments, nextProps);
          var prevRootVariables = getRootVariablesForFragments(fragments, prevProps);
          var nextRootVariables = getRootVariablesForFragments(fragments, nextProps);
          var resolver = prevState.resolver;
          if (prevState.prevPropsContext.environment !== relayContext.environment || !areEqual2(prevRootVariables, nextRootVariables) || !areEqual2(prevIDs, nextIDs)) {
            resolver = createFragmentSpecResolver(relayContext, containerName, fragments, nextProps, rootIsQueryRenderer);
            return {
              data: resolver.resolve(),
              localVariables: null,
              prevProps: nextProps,
              prevPropsContext: relayContext,
              contextForChildren: relayContext,
              relayProp: getRelayProp(relayContext.environment, prevState.relayProp.refetch),
              resolver
            };
          } else if (!prevState.localVariables) {
            resolver.setProps(nextProps);
          }
          var data = resolver.resolve();
          if (data !== prevState.data) {
            return {
              data,
              prevProps: nextProps
            };
          }
          return null;
        };
        _proto.componentWillUnmount = function componentWillUnmount() {
          this._isUnmounted = true;
          this.state.resolver.dispose();
          this._queryFetcher && this._queryFetcher.dispose();
          this._refetchSubscription && this._refetchSubscription.unsubscribe();
        };
        _proto.shouldComponentUpdate = function shouldComponentUpdate(nextProps, nextState) {
          if (nextState.data !== this.state.data || nextState.relayProp !== this.state.relayProp) {
            return true;
          }
          var keys4 = Object.keys(nextProps);
          for (var ii = 0; ii < keys4.length; ii++) {
            var key = keys4[ii];
            if (key === "__relayContext") {
              if (this.state.prevPropsContext.environment !== nextState.prevPropsContext.environment) {
                return true;
              }
            } else {
              if (!fragments.hasOwnProperty(key) && !isScalarAndEqual(nextProps[key], this.props[key])) {
                return true;
              }
            }
          }
          return false;
        };
        _proto._rerenderIfStoreHasChanged = function _rerenderIfStoreHasChanged() {
          var _this$state = this.state, data = _this$state.data, resolver = _this$state.resolver;
          var maybeNewData = resolver.resolve();
          if (data !== maybeNewData) {
            this.setState({
              data: maybeNewData
            });
          }
        };
        _proto._subscribeToNewResolverAndRerenderIfStoreHasChanged = function _subscribeToNewResolverAndRerenderIfStoreHasChanged() {
          var _this$state2 = this.state, data = _this$state2.data, resolver = _this$state2.resolver;
          var maybeNewData = resolver.resolve();
          resolver.setCallback(this.props, this._handleFragmentDataUpdate);
          if (data !== maybeNewData) {
            this.setState({
              data: maybeNewData
            });
          }
        };
        _proto._getFragmentVariables = function _getFragmentVariables() {
          return getVariablesFromObject(fragments, this.props);
        };
        _proto._getQueryFetcher = function _getQueryFetcher() {
          if (!this._queryFetcher) {
            this._queryFetcher = new ReactRelayQueryFetcher();
          }
          return this._queryFetcher;
        };
        _proto.render = function render2() {
          var _this$props = this.props, componentRef = _this$props.componentRef, __relayContext = _this$props.__relayContext, __rootIsQueryRenderer = _this$props.__rootIsQueryRenderer, props = (0, _objectWithoutPropertiesLoose28["default"])(_this$props, _excluded36);
          var _this$state3 = this.state, relayProp = _this$state3.relayProp, contextForChildren = _this$state3.contextForChildren;
          return /* @__PURE__ */ React116.createElement(ReactRelayContext.Provider, {
            value: contextForChildren
          }, /* @__PURE__ */ React116.createElement(Component8, (0, _extends210["default"])({}, props, this.state.data, {
            ref: componentRef,
            relay: relayProp
          })));
        };
        return _class5;
      }(React116.Component), (0, _defineProperty210["default"])(_class4, "displayName", containerName), _class4;
    }
    function getRelayProp(environment, refetch) {
      return {
        environment,
        refetch
      };
    }
    function createContainer(Component8, fragmentSpec, taggedNode) {
      return buildReactRelayContainer(Component8, fragmentSpec, function(ComponentClass, fragments) {
        return createContainerWithFragments(ComponentClass, fragments, taggedNode);
      });
    }
    module.exports = {
      createContainer
    };
  }
});

// node_modules/react-relay/lib/relay-hooks/ProfilerContext.js
var require_ProfilerContext = __commonJS({
  "node_modules/react-relay/lib/relay-hooks/ProfilerContext.js"(exports, module) {
    "use strict";
    var React116 = require_react();
    var ProfilerContext = React116.createContext({
      wrapPrepareQueryResource: function wrapPrepareQueryResource(cb) {
        return cb();
      }
    });
    module.exports = ProfilerContext;
  }
});

// node_modules/react-relay/lib/relay-hooks/useRelayEnvironment.js
var require_useRelayEnvironment = __commonJS({
  "node_modules/react-relay/lib/relay-hooks/useRelayEnvironment.js"(exports, module) {
    "use strict";
    var ReactRelayContext = require_ReactRelayContext();
    var invariant3 = require_browser();
    var _require = require_react();
    var useContext17 = _require.useContext;
    function useRelayEnvironment() {
      var context2 = useContext17(ReactRelayContext);
      !(context2 != null) ? true ? invariant3(false, "useRelayEnvironment: Expected to have found a Relay environment provided by a `RelayEnvironmentProvider` component. This usually means that useRelayEnvironment was used in a component that is not a descendant of a `RelayEnvironmentProvider`. Please make sure a `RelayEnvironmentProvider` has been rendered somewhere as a parent or ancestor of your component.") : invariant3(false) : void 0;
      return context2.environment;
    }
    module.exports = useRelayEnvironment;
  }
});

// node_modules/react-relay/lib/relay-hooks/EntryPointContainer.react.js
var require_EntryPointContainer_react = __commonJS({
  "node_modules/react-relay/lib/relay-hooks/EntryPointContainer.react.js"(exports, module) {
    "use strict";
    var ProfilerContext = require_ProfilerContext();
    var useRelayEnvironment = require_useRelayEnvironment();
    var React116 = require_react();
    var _require = require_react();
    var useContext17 = _require.useContext;
    var useEffect30 = _require.useEffect;
    var warning2 = require_warning();
    function EntryPointContainer(_ref18) {
      var entryPointReference = _ref18.entryPointReference, props = _ref18.props;
      true ? warning2(entryPointReference.isDisposed === false, "<EntryPointContainer>: Expected entryPointReference to not be disposed yet. This is because disposing the entrypoint marks it for future garbage collection, and as such may no longer be present in the Relay store. In the future, this will become a hard error.") : void 0;
      var getComponent = entryPointReference.getComponent, queries = entryPointReference.queries, entryPoints = entryPointReference.entryPoints, extraProps = entryPointReference.extraProps, rootModuleID = entryPointReference.rootModuleID;
      var Component8 = getComponent();
      var profilerContext = useContext17(ProfilerContext);
      var environment = useRelayEnvironment();
      useEffect30(function() {
        environment.__log({
          name: "entrypoint.root.consume",
          profilerContext,
          rootModuleID
        });
      }, [environment, profilerContext, rootModuleID]);
      return /* @__PURE__ */ React116.createElement(Component8, {
        entryPoints,
        extraProps,
        props,
        queries
      });
    }
    module.exports = EntryPointContainer;
  }
});

// node_modules/react-relay/lib/relay-hooks/loadQuery.js
var require_loadQuery = __commonJS({
  "node_modules/react-relay/lib/relay-hooks/loadQuery.js"(exports, module) {
    "use strict";
    var _interopRequireDefault = require_interopRequireDefault()["default"];
    var _objectSpread210 = _interopRequireDefault(require_objectSpread2());
    var invariant3 = require_browser();
    var React116 = require_react();
    var _require = require_relay_runtime();
    var fetchQueryDeduped = _require.__internal.fetchQueryDeduped;
    var Observable = _require.Observable;
    var PreloadableQueryRegistry = _require.PreloadableQueryRegistry;
    var RelayFeatureFlags = _require.RelayFeatureFlags;
    var ReplaySubject = _require.ReplaySubject;
    var createOperationDescriptor = _require.createOperationDescriptor;
    var getRequest = _require.getRequest;
    var getRequestIdentifier = _require.getRequestIdentifier;
    var warning2 = require_warning();
    var RenderDispatcher = null;
    var fetchKey = 100001;
    function useTrackLoadQueryInRender() {
      if (RenderDispatcher === null) {
        var _React$__SECRET_INTER, _React$__SECRET_INTER2;
        RenderDispatcher = // $FlowFixMe[prop-missing]
        (_React$__SECRET_INTER = React116.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED) === null || _React$__SECRET_INTER === void 0 ? void 0 : (_React$__SECRET_INTER2 = _React$__SECRET_INTER.ReactCurrentDispatcher) === null || _React$__SECRET_INTER2 === void 0 ? void 0 : _React$__SECRET_INTER2.current;
      }
    }
    function loadQuery(environment, preloadableRequest, variables, options, environmentProviderOptions) {
      var _React$__SECRET_INTER3, _React$__SECRET_INTER4, _options$__nameForWar, _options$fetchPolicy;
      var CurrentDispatcher = (
        // $FlowFixMe[prop-missing]
        (_React$__SECRET_INTER3 = React116.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED) === null || _React$__SECRET_INTER3 === void 0 ? void 0 : (_React$__SECRET_INTER4 = _React$__SECRET_INTER3.ReactCurrentDispatcher) === null || _React$__SECRET_INTER4 === void 0 ? void 0 : _React$__SECRET_INTER4.current
      );
      true ? warning2(RenderDispatcher == null || CurrentDispatcher !== RenderDispatcher, "Relay: `%s` should not be called inside a React render function.", (_options$__nameForWar = options === null || options === void 0 ? void 0 : options.__nameForWarning) !== null && _options$__nameForWar !== void 0 ? _options$__nameForWar : "loadQuery") : void 0;
      fetchKey++;
      var fetchPolicy = (_options$fetchPolicy = options === null || options === void 0 ? void 0 : options.fetchPolicy) !== null && _options$fetchPolicy !== void 0 ? _options$fetchPolicy : "store-or-network";
      var networkCacheConfig = (0, _objectSpread210["default"])((0, _objectSpread210["default"])({}, options === null || options === void 0 ? void 0 : options.networkCacheConfig), {}, {
        force: true
      });
      var retainReference;
      var didExecuteNetworkSource = false;
      var executeWithNetworkSource = function executeWithNetworkSource2(operation, networkObservable2) {
        didExecuteNetworkSource = true;
        return environment.executeWithSource({
          operation,
          source: networkObservable2
        });
      };
      var executionSubject = new ReplaySubject();
      var returnedObservable = Observable.create(function(sink) {
        return executionSubject.subscribe(sink);
      });
      var unsubscribeFromNetworkRequest;
      var networkError = null;
      var didMakeNetworkRequest = false;
      var makeNetworkRequest = function makeNetworkRequest2(params2) {
        didMakeNetworkRequest = true;
        var observable;
        var subject = new ReplaySubject();
        if (RelayFeatureFlags.ENABLE_LOAD_QUERY_REQUEST_DEDUPING === true) {
          var identifier2 = "raw-network-request-" + getRequestIdentifier(params2, variables);
          observable = fetchQueryDeduped(environment, identifier2, function() {
            var network2 = environment.getNetwork();
            return network2.execute(params2, variables, networkCacheConfig);
          });
        } else {
          var network = environment.getNetwork();
          observable = network.execute(params2, variables, networkCacheConfig);
        }
        var _observable$subscribe = observable.subscribe({
          error: function error(err) {
            networkError = err;
            subject.error(err);
          },
          next: function next2(data) {
            subject.next(data);
          },
          complete: function complete() {
            subject.complete();
          }
        }), unsubscribe = _observable$subscribe.unsubscribe;
        unsubscribeFromNetworkRequest = unsubscribe;
        return Observable.create(function(sink) {
          var subjectSubscription = subject.subscribe(sink);
          return function() {
            subjectSubscription.unsubscribe();
            unsubscribeFromNetworkRequest();
          };
        });
      };
      var unsubscribeFromExecution;
      var executeDeduped = function executeDeduped2(operation, fetchFn) {
        if (RelayFeatureFlags.ENABLE_LOAD_QUERY_REQUEST_DEDUPING === true) {
          didMakeNetworkRequest = true;
        }
        var _fetchQueryDeduped$su = fetchQueryDeduped(environment, operation.request.identifier, fetchFn).subscribe({
          error: function error(err) {
            executionSubject.error(err);
          },
          next: function next2(data) {
            executionSubject.next(data);
          },
          complete: function complete() {
            executionSubject.complete();
          }
        });
        unsubscribeFromExecution = _fetchQueryDeduped$su.unsubscribe;
      };
      var checkAvailabilityAndExecute = function checkAvailabilityAndExecute2(concreteRequest) {
        var operation = createOperationDescriptor(concreteRequest, variables, networkCacheConfig);
        retainReference = environment.retain(operation);
        if (fetchPolicy === "store-only") {
          return;
        }
        var shouldFetch = fetchPolicy !== "store-or-network" || environment.check(operation).status !== "available";
        if (shouldFetch) {
          executeDeduped(operation, function() {
            var networkObservable2 = makeNetworkRequest(concreteRequest.params);
            var executeObservable = executeWithNetworkSource(operation, networkObservable2);
            return executeObservable;
          });
        }
      };
      var params;
      var cancelOnLoadCallback;
      var queryId;
      if (preloadableRequest.kind === "PreloadableConcreteRequest") {
        var preloadableConcreteRequest = preloadableRequest;
        params = preloadableConcreteRequest.params;
        var _params = params;
        queryId = _params.id;
        !(queryId !== null) ? true ? invariant3(false, "Relay: `loadQuery` requires that preloadable query `%s` has a persisted query id", params.name) : invariant3(false) : void 0;
        var _module = PreloadableQueryRegistry.get(queryId);
        if (_module != null) {
          checkAvailabilityAndExecute(_module);
        } else {
          var networkObservable = fetchPolicy === "store-only" ? null : makeNetworkRequest(params);
          var _PreloadableQueryRegi = PreloadableQueryRegistry.onLoad(queryId, function(preloadedModule) {
            cancelOnLoadCallback();
            var operation = createOperationDescriptor(preloadedModule, variables, networkCacheConfig);
            retainReference = environment.retain(operation);
            if (networkObservable != null) {
              executeDeduped(operation, function() {
                return executeWithNetworkSource(operation, networkObservable);
              });
            }
          });
          cancelOnLoadCallback = _PreloadableQueryRegi.dispose;
        }
      } else {
        var graphQlTaggedNode = preloadableRequest;
        var request = getRequest(graphQlTaggedNode);
        params = request.params;
        queryId = params.cacheID != null ? params.cacheID : params.id;
        checkAvailabilityAndExecute(request);
      }
      var isDisposed = false;
      var isReleased = false;
      var isNetworkRequestCancelled = false;
      var releaseQuery = function releaseQuery2() {
        if (isReleased) {
          return;
        }
        retainReference && retainReference.dispose();
        isReleased = true;
      };
      var cancelNetworkRequest = function cancelNetworkRequest2() {
        if (isNetworkRequestCancelled) {
          return;
        }
        if (didExecuteNetworkSource) {
          unsubscribeFromExecution && unsubscribeFromExecution();
        } else {
          unsubscribeFromNetworkRequest && unsubscribeFromNetworkRequest();
        }
        cancelOnLoadCallback && cancelOnLoadCallback();
        isNetworkRequestCancelled = true;
      };
      return {
        kind: "PreloadedQuery",
        environment,
        environmentProviderOptions,
        dispose: function dispose2() {
          if (isDisposed) {
            return;
          }
          releaseQuery();
          cancelNetworkRequest();
          isDisposed = true;
        },
        releaseQuery,
        cancelNetworkRequest,
        fetchKey,
        id: queryId,
        // $FlowFixMe[unsafe-getters-setters] - this has no side effects
        get isDisposed() {
          return isDisposed || isReleased;
        },
        // $FlowFixMe[unsafe-getters-setters] - this has no side effects
        get networkError() {
          return networkError;
        },
        name: params.name,
        networkCacheConfig,
        fetchPolicy,
        source: didMakeNetworkRequest ? returnedObservable : void 0,
        variables
      };
    }
    module.exports = {
      loadQuery,
      useTrackLoadQueryInRender
    };
  }
});

// node_modules/react-relay/lib/relay-hooks/loadEntryPoint.js
var require_loadEntryPoint = __commonJS({
  "node_modules/react-relay/lib/relay-hooks/loadEntryPoint.js"(exports, module) {
    "use strict";
    var _require = require_loadQuery();
    var loadQuery = _require.loadQuery;
    function loadEntryPoint(environmentProvider, entryPoint, entryPointParams) {
      var loadingPromise = null;
      if (entryPoint.root.getModuleIfRequired() == null) {
        loadingPromise = entryPoint.root.load();
      }
      var preloadProps = entryPoint.getPreloadProps(entryPointParams);
      var queries = preloadProps.queries, entryPoints = preloadProps.entryPoints, extraProps = preloadProps.extraProps;
      var preloadedQueries = {};
      var preloadedEntryPoints = {};
      if (queries != null) {
        var queriesPropNames = Object.keys(queries);
        queriesPropNames.forEach(function(queryPropName) {
          var _queries$queryPropNam = queries[queryPropName], environmentProviderOptions = _queries$queryPropNam.environmentProviderOptions, options = _queries$queryPropNam.options, parameters = _queries$queryPropNam.parameters, variables = _queries$queryPropNam.variables;
          var environment = environmentProvider.getEnvironment(environmentProviderOptions);
          preloadedQueries[queryPropName] = loadQuery(environment, parameters, variables, {
            fetchPolicy: options === null || options === void 0 ? void 0 : options.fetchPolicy,
            networkCacheConfig: options === null || options === void 0 ? void 0 : options.networkCacheConfig,
            __nameForWarning: "loadEntryPoint"
          }, environmentProviderOptions);
        });
      }
      if (entryPoints != null) {
        var entryPointPropNames = Object.keys(entryPoints);
        entryPointPropNames.forEach(function(entryPointPropName) {
          var entryPointDescription = entryPoints[entryPointPropName];
          if (entryPointDescription == null) {
            return;
          }
          var nestedEntryPoint = entryPointDescription.entryPoint, nestedParams = entryPointDescription.entryPointParams;
          preloadedEntryPoints[entryPointPropName] = loadEntryPoint(environmentProvider, nestedEntryPoint, nestedParams);
        });
      }
      var isDisposed = false;
      return {
        dispose: function dispose2() {
          if (isDisposed) {
            return;
          }
          if (preloadedQueries != null) {
            Object.values(preloadedQueries).forEach(function(_ref18) {
              var innerDispose = _ref18.dispose;
              innerDispose();
            });
          }
          if (preloadedEntryPoints != null) {
            Object.values(preloadedEntryPoints).forEach(function(_ref22) {
              var innerDispose = _ref22.dispose;
              innerDispose();
            });
          }
          isDisposed = true;
        },
        entryPoints: preloadedEntryPoints,
        extraProps: extraProps !== null && extraProps !== void 0 ? extraProps : null,
        getComponent: function getComponent() {
          var componentModule = entryPoint.root.getModuleIfRequired();
          if (componentModule == null) {
            var _loadingPromise;
            loadingPromise = (_loadingPromise = loadingPromise) !== null && _loadingPromise !== void 0 ? _loadingPromise : entryPoint.root.load();
            throw loadingPromise;
          }
          var component = (
            // $FlowIgnore[prop-missing]
            componentModule["default"] != null ? componentModule["default"] : componentModule
          );
          return component;
        },
        // $FlowFixMe[unsafe-getters-setters] - this has no side effects
        get isDisposed() {
          return isDisposed;
        },
        queries: preloadedQueries,
        rootModuleID: entryPoint.root.getModuleId()
      };
    }
    module.exports = loadEntryPoint;
  }
});

// node_modules/react-relay/lib/relay-hooks/RelayEnvironmentProvider.js
var require_RelayEnvironmentProvider = __commonJS({
  "node_modules/react-relay/lib/relay-hooks/RelayEnvironmentProvider.js"(exports, module) {
    "use strict";
    var ReactRelayContext = require_ReactRelayContext();
    var React116 = require_react();
    var useMemo47 = React116.useMemo;
    function RelayEnvironmentProvider2(props) {
      var children = props.children, environment = props.environment, getEnvironmentForActor = props.getEnvironmentForActor;
      var context2 = useMemo47(function() {
        return {
          environment,
          getEnvironmentForActor
        };
      }, [environment, getEnvironmentForActor]);
      return /* @__PURE__ */ React116.createElement(ReactRelayContext.Provider, {
        value: context2
      }, children);
    }
    module.exports = RelayEnvironmentProvider2;
  }
});

// node_modules/react-relay/lib/relay-hooks/LRUCache.js
var require_LRUCache = __commonJS({
  "node_modules/react-relay/lib/relay-hooks/LRUCache.js"(exports, module) {
    "use strict";
    var invariant3 = require_browser();
    var LRUCache = /* @__PURE__ */ function() {
      function LRUCache2(capacity) {
        this._capacity = capacity;
        !(this._capacity > 0) ? true ? invariant3(false, "LRUCache: Unable to create instance of cache with zero or negative capacity.") : invariant3(false) : void 0;
        this._map = /* @__PURE__ */ new Map();
      }
      var _proto = LRUCache2.prototype;
      _proto.set = function set3(key, value) {
        this._map["delete"](key);
        this._map.set(key, value);
        if (this._map.size > this._capacity) {
          var firstKey = this._map.keys().next();
          if (!firstKey.done) {
            this._map["delete"](firstKey.value);
          }
        }
      };
      _proto.get = function get3(key) {
        var value = this._map.get(key);
        if (value != null) {
          this._map["delete"](key);
          this._map.set(key, value);
        }
        return value;
      };
      _proto.has = function has2(key) {
        return this._map.has(key);
      };
      _proto["delete"] = function _delete(key) {
        this._map["delete"](key);
      };
      _proto.size = function size() {
        return this._map.size;
      };
      _proto.capacity = function capacity() {
        return this._capacity - this._map.size;
      };
      _proto.clear = function clear2() {
        this._map.clear();
      };
      return LRUCache2;
    }();
    function create4(capacity) {
      return new LRUCache(capacity);
    }
    module.exports = {
      create: create4
    };
  }
});

// node_modules/react-relay/lib/relay-hooks/SuspenseResource.js
var require_SuspenseResource = __commonJS({
  "node_modules/react-relay/lib/relay-hooks/SuspenseResource.js"(exports, module) {
    "use strict";
    var _interopRequireDefault = require_interopRequireDefault()["default"];
    var _defineProperty210 = _interopRequireDefault(require_defineProperty());
    var invariant3 = require_browser();
    var TEMPORARY_RETAIN_DURATION_MS = 5 * 60 * 1e3;
    var SuspenseResource = /* @__PURE__ */ function() {
      function SuspenseResource2(retain) {
        var _this = this;
        (0, _defineProperty210["default"])(this, "_retainCount", 0);
        (0, _defineProperty210["default"])(this, "_retainDisposable", null);
        (0, _defineProperty210["default"])(this, "_releaseTemporaryRetain", null);
        this._retain = function(environment) {
          _this._retainCount++;
          if (_this._retainCount === 1) {
            _this._retainDisposable = retain(environment);
          }
          return {
            dispose: function dispose2() {
              _this._retainCount = Math.max(0, _this._retainCount - 1);
              if (_this._retainCount === 0) {
                !(_this._retainDisposable != null) ? true ? invariant3(false, "Relay: Expected disposable to release query to be defined.If you're seeing this, this is likely a bug in Relay.") : invariant3(false) : void 0;
                _this._retainDisposable.dispose();
                _this._retainDisposable = null;
              }
            }
          };
        };
      }
      var _proto = SuspenseResource2.prototype;
      _proto.temporaryRetain = function temporaryRetain(environment) {
        var _this2 = this;
        var _this$_releaseTempora;
        if (environment.isServer()) {
          return {
            dispose: function dispose2() {
            }
          };
        }
        var retention = this._retain(environment);
        var releaseQueryTimeout = null;
        var releaseTemporaryRetain = function releaseTemporaryRetain2() {
          clearTimeout(releaseQueryTimeout);
          releaseQueryTimeout = null;
          _this2._releaseTemporaryRetain = null;
          retention.dispose();
        };
        releaseQueryTimeout = setTimeout(releaseTemporaryRetain, TEMPORARY_RETAIN_DURATION_MS);
        (_this$_releaseTempora = this._releaseTemporaryRetain) === null || _this$_releaseTempora === void 0 ? void 0 : _this$_releaseTempora.call(this);
        this._releaseTemporaryRetain = releaseTemporaryRetain;
        return {
          dispose: function dispose2() {
            var _this$_releaseTempora2;
            (_this$_releaseTempora2 = _this2._releaseTemporaryRetain) === null || _this$_releaseTempora2 === void 0 ? void 0 : _this$_releaseTempora2.call(_this2);
          }
        };
      };
      _proto.permanentRetain = function permanentRetain(environment) {
        var disposable = this._retain(environment);
        this.releaseTemporaryRetain();
        return disposable;
      };
      _proto.releaseTemporaryRetain = function releaseTemporaryRetain() {
        var _this$_releaseTempora3;
        (_this$_releaseTempora3 = this._releaseTemporaryRetain) === null || _this$_releaseTempora3 === void 0 ? void 0 : _this$_releaseTempora3.call(this);
        this._releaseTemporaryRetain = null;
      };
      _proto.getRetainCount = function getRetainCount() {
        return this._retainCount;
      };
      return SuspenseResource2;
    }();
    module.exports = SuspenseResource;
  }
});

// node_modules/react-relay/lib/relay-hooks/QueryResource.js
var require_QueryResource = __commonJS({
  "node_modules/react-relay/lib/relay-hooks/QueryResource.js"(exports, module) {
    "use strict";
    var _interopRequireDefault = require_interopRequireDefault()["default"];
    var _objectSpread210 = _interopRequireDefault(require_objectSpread2());
    var _defineProperty210 = _interopRequireDefault(require_defineProperty());
    var LRUCache = require_LRUCache();
    var SuspenseResource = require_SuspenseResource();
    var invariant3 = require_browser();
    var _require = require_relay_runtime();
    var isPromise = _require.isPromise;
    var warning2 = require_warning();
    var CACHE_CAPACITY = 1e3;
    var DEFAULT_FETCH_POLICY = "store-or-network";
    var DEFAULT_LIVE_FETCH_POLICY = "store-and-network";
    var WEAKMAP_SUPPORTED = typeof WeakMap === "function";
    function operationIsLiveQuery(operation) {
      return operation.request.node.params.metadata.live !== void 0;
    }
    function getQueryCacheIdentifier(environment, operation, maybeFetchPolicy, maybeRenderPolicy, cacheBreaker) {
      var fetchPolicy = maybeFetchPolicy !== null && maybeFetchPolicy !== void 0 ? maybeFetchPolicy : operationIsLiveQuery(operation) ? DEFAULT_LIVE_FETCH_POLICY : DEFAULT_FETCH_POLICY;
      var renderPolicy = maybeRenderPolicy !== null && maybeRenderPolicy !== void 0 ? maybeRenderPolicy : environment.UNSTABLE_getDefaultRenderPolicy();
      var cacheIdentifier = "".concat(fetchPolicy, "-").concat(renderPolicy, "-").concat(operation.request.identifier);
      if (cacheBreaker != null) {
        return "".concat(cacheIdentifier, "-").concat(cacheBreaker);
      }
      return cacheIdentifier;
    }
    function getQueryResult(operation, cacheIdentifier) {
      var rootFragmentRef = {
        __id: operation.fragment.dataID,
        __fragments: (0, _defineProperty210["default"])({}, operation.fragment.node.name, operation.request.variables),
        __fragmentOwner: operation.request
      };
      return {
        cacheIdentifier,
        fragmentNode: operation.request.node.fragment,
        fragmentRef: rootFragmentRef,
        operation
      };
    }
    var nextID2 = 2e5;
    function createCacheEntry(cacheIdentifier, operation, operationAvailability, value, networkSubscription, onDispose) {
      var isLiveQuery = operationIsLiveQuery(operation);
      var currentValue = value;
      var currentNetworkSubscription = networkSubscription;
      var suspenseResource = new SuspenseResource(function(environment) {
        var retention = environment.retain(operation);
        return {
          dispose: function dispose2() {
            if (isLiveQuery && currentNetworkSubscription != null) {
              currentNetworkSubscription.unsubscribe();
            }
            retention.dispose();
            onDispose(cacheEntry);
          }
        };
      });
      var cacheEntry = {
        cacheIdentifier,
        id: nextID2++,
        processedPayloadsCount: 0,
        operationAvailability,
        getValue: function getValue() {
          return currentValue;
        },
        setValue: function setValue(val) {
          currentValue = val;
        },
        setNetworkSubscription: function setNetworkSubscription(subscription2) {
          if (isLiveQuery && currentNetworkSubscription != null) {
            currentNetworkSubscription.unsubscribe();
          }
          currentNetworkSubscription = subscription2;
        },
        temporaryRetain: function temporaryRetain(environment) {
          return suspenseResource.temporaryRetain(environment);
        },
        permanentRetain: function permanentRetain(environment) {
          return suspenseResource.permanentRetain(environment);
        },
        releaseTemporaryRetain: function releaseTemporaryRetain() {
          suspenseResource.releaseTemporaryRetain();
        }
      };
      return cacheEntry;
    }
    var QueryResourceImpl = /* @__PURE__ */ function() {
      function QueryResourceImpl2(environment) {
        var _this = this;
        (0, _defineProperty210["default"])(this, "_clearCacheEntry", function(cacheEntry) {
          _this._cache["delete"](cacheEntry.cacheIdentifier);
        });
        this._environment = environment;
        this._cache = LRUCache.create(CACHE_CAPACITY);
      }
      var _proto = QueryResourceImpl2.prototype;
      _proto.prepare = function prepare2(operation, fetchObservable, maybeFetchPolicy, maybeRenderPolicy, observer, cacheBreaker, profilerContext) {
        var cacheIdentifier = getQueryCacheIdentifier(this._environment, operation, maybeFetchPolicy, maybeRenderPolicy, cacheBreaker);
        return this.prepareWithIdentifier(cacheIdentifier, operation, fetchObservable, maybeFetchPolicy, maybeRenderPolicy, observer, profilerContext);
      };
      _proto.prepareWithIdentifier = function prepareWithIdentifier(cacheIdentifier, operation, fetchObservable, maybeFetchPolicy, maybeRenderPolicy, observer, profilerContext) {
        var environment = this._environment;
        var fetchPolicy = maybeFetchPolicy !== null && maybeFetchPolicy !== void 0 ? maybeFetchPolicy : operationIsLiveQuery(operation) ? DEFAULT_LIVE_FETCH_POLICY : DEFAULT_FETCH_POLICY;
        var renderPolicy = maybeRenderPolicy !== null && maybeRenderPolicy !== void 0 ? maybeRenderPolicy : environment.UNSTABLE_getDefaultRenderPolicy();
        var cacheEntry = this._cache.get(cacheIdentifier);
        var temporaryRetainDisposable = null;
        var entryWasCached = cacheEntry != null;
        if (cacheEntry == null) {
          cacheEntry = this._fetchAndSaveQuery(cacheIdentifier, operation, fetchObservable, fetchPolicy, renderPolicy, profilerContext, (0, _objectSpread210["default"])((0, _objectSpread210["default"])({}, observer), {}, {
            unsubscribe: function unsubscribe(subscription2) {
              if (temporaryRetainDisposable != null) {
                temporaryRetainDisposable.dispose();
              }
              var observerUnsubscribe = observer === null || observer === void 0 ? void 0 : observer.unsubscribe;
              observerUnsubscribe && observerUnsubscribe(subscription2);
            }
          }));
        }
        temporaryRetainDisposable = cacheEntry.temporaryRetain(environment);
        var cachedValue = cacheEntry.getValue();
        if (isPromise(cachedValue)) {
          environment.__log({
            name: "suspense.query",
            fetchPolicy,
            isPromiseCached: entryWasCached,
            operation,
            queryAvailability: cacheEntry.operationAvailability,
            renderPolicy
          });
          throw cachedValue;
        }
        if (cachedValue instanceof Error) {
          throw cachedValue;
        }
        return cachedValue;
      };
      _proto.retain = function retain(queryResult, profilerContext) {
        var environment = this._environment;
        var cacheIdentifier = queryResult.cacheIdentifier, operation = queryResult.operation;
        var cacheEntry = this._getOrCreateCacheEntry(cacheIdentifier, operation, null, queryResult, null);
        var disposable = cacheEntry.permanentRetain(environment);
        environment.__log({
          name: "queryresource.retain",
          profilerContext,
          resourceID: cacheEntry.id
        });
        return {
          dispose: function dispose2() {
            disposable.dispose();
          }
        };
      };
      _proto.releaseTemporaryRetain = function releaseTemporaryRetain(queryResult) {
        var cacheEntry = this._cache.get(queryResult.cacheIdentifier);
        if (cacheEntry != null) {
          cacheEntry.releaseTemporaryRetain();
        }
      };
      _proto.TESTS_ONLY__getCacheEntry = function TESTS_ONLY__getCacheEntry(operation, maybeFetchPolicy, maybeRenderPolicy, cacheBreaker) {
        var environment = this._environment;
        var cacheIdentifier = getQueryCacheIdentifier(environment, operation, maybeFetchPolicy, maybeRenderPolicy, cacheBreaker);
        return this._cache.get(cacheIdentifier);
      };
      _proto._getOrCreateCacheEntry = function _getOrCreateCacheEntry(cacheIdentifier, operation, operationAvailability, value, networkSubscription) {
        var cacheEntry = this._cache.get(cacheIdentifier);
        if (cacheEntry == null) {
          cacheEntry = createCacheEntry(cacheIdentifier, operation, operationAvailability, value, networkSubscription, this._clearCacheEntry);
          this._cache.set(cacheIdentifier, cacheEntry);
        }
        return cacheEntry;
      };
      _proto._fetchAndSaveQuery = function _fetchAndSaveQuery(cacheIdentifier, operation, fetchObservable, fetchPolicy, renderPolicy, profilerContext, observer) {
        var _this2 = this;
        var environment = this._environment;
        var queryAvailability = environment.check(operation);
        var queryStatus = queryAvailability.status;
        var hasFullQuery = queryStatus === "available";
        var canPartialRender = hasFullQuery || renderPolicy === "partial" && queryStatus !== "stale";
        var shouldFetch;
        var shouldAllowRender;
        var resolveNetworkPromise = function resolveNetworkPromise2() {
        };
        switch (fetchPolicy) {
          case "store-only": {
            shouldFetch = false;
            shouldAllowRender = true;
            break;
          }
          case "store-or-network": {
            shouldFetch = !hasFullQuery;
            shouldAllowRender = canPartialRender;
            break;
          }
          case "store-and-network": {
            shouldFetch = true;
            shouldAllowRender = canPartialRender;
            break;
          }
          case "network-only":
          default: {
            shouldFetch = true;
            shouldAllowRender = false;
            break;
          }
        }
        if (shouldAllowRender) {
          var queryResult = getQueryResult(operation, cacheIdentifier);
          var _cacheEntry = createCacheEntry(cacheIdentifier, operation, queryAvailability, queryResult, null, this._clearCacheEntry);
          this._cache.set(cacheIdentifier, _cacheEntry);
        }
        if (shouldFetch) {
          var _queryResult = getQueryResult(operation, cacheIdentifier);
          var networkSubscription;
          fetchObservable.subscribe({
            start: function start(subscription2) {
              networkSubscription = subscription2;
              var cacheEntry2 = _this2._cache.get(cacheIdentifier);
              if (cacheEntry2) {
                cacheEntry2.setNetworkSubscription(networkSubscription);
              }
              var observerStart = observer === null || observer === void 0 ? void 0 : observer.start;
              if (observerStart) {
                var subscriptionWithConditionalCancelation = (0, _objectSpread210["default"])((0, _objectSpread210["default"])({}, subscription2), {}, {
                  unsubscribe: function unsubscribe() {
                    if (operationIsLiveQuery(operation)) {
                      subscription2.unsubscribe();
                    }
                  }
                });
                observerStart(subscriptionWithConditionalCancelation);
              }
            },
            next: function next2() {
              var cacheEntry2 = _this2._getOrCreateCacheEntry(cacheIdentifier, operation, queryAvailability, _queryResult, networkSubscription);
              cacheEntry2.processedPayloadsCount += 1;
              cacheEntry2.setValue(_queryResult);
              resolveNetworkPromise();
              var observerNext = observer === null || observer === void 0 ? void 0 : observer.next;
              if (observerNext != null) {
                var snapshot = environment.lookup(operation.fragment);
                observerNext(snapshot);
              }
            },
            error: function error(_error) {
              var cacheEntry2 = _this2._getOrCreateCacheEntry(cacheIdentifier, operation, queryAvailability, _error, networkSubscription);
              if (cacheEntry2.processedPayloadsCount === 0) {
                cacheEntry2.setValue(_error);
              } else {
                true ? warning2(false, "QueryResource: An incremental payload for query `%s` returned an error: `%s`.", operation.fragment.node.name, String(_error.message)) : void 0;
              }
              resolveNetworkPromise();
              networkSubscription = null;
              cacheEntry2.setNetworkSubscription(null);
              var observerError = observer === null || observer === void 0 ? void 0 : observer.error;
              observerError && observerError(_error);
            },
            complete: function complete() {
              resolveNetworkPromise();
              networkSubscription = null;
              var cacheEntry2 = _this2._cache.get(cacheIdentifier);
              if (cacheEntry2) {
                cacheEntry2.setNetworkSubscription(null);
              }
              var observerComplete2 = observer === null || observer === void 0 ? void 0 : observer.complete;
              observerComplete2 && observerComplete2();
            },
            unsubscribe: observer === null || observer === void 0 ? void 0 : observer.unsubscribe
          });
          var _cacheEntry2 = this._cache.get(cacheIdentifier);
          if (!_cacheEntry2) {
            var networkPromise = new Promise(function(resolve2) {
              resolveNetworkPromise = resolve2;
            });
            networkPromise.displayName = "Relay(" + operation.fragment.node.name + ")";
            _cacheEntry2 = createCacheEntry(cacheIdentifier, operation, queryAvailability, networkPromise, networkSubscription, this._clearCacheEntry);
            this._cache.set(cacheIdentifier, _cacheEntry2);
          }
        } else {
          var observerComplete = observer === null || observer === void 0 ? void 0 : observer.complete;
          observerComplete && observerComplete();
        }
        var cacheEntry = this._cache.get(cacheIdentifier);
        !(cacheEntry != null) ? true ? invariant3(false, "Relay: Expected to have cached a result when attempting to fetch query.If you're seeing this, this is likely a bug in Relay.") : invariant3(false) : void 0;
        environment.__log({
          name: "queryresource.fetch",
          resourceID: cacheEntry.id,
          operation,
          profilerContext,
          fetchPolicy,
          renderPolicy,
          queryAvailability,
          shouldFetch
        });
        return cacheEntry;
      };
      return QueryResourceImpl2;
    }();
    function createQueryResource(environment) {
      return new QueryResourceImpl(environment);
    }
    var dataResources = WEAKMAP_SUPPORTED ? /* @__PURE__ */ new WeakMap() : /* @__PURE__ */ new Map();
    function getQueryResourceForEnvironment(environment) {
      var cached = dataResources.get(environment);
      if (cached) {
        return cached;
      }
      var newDataResource = createQueryResource(environment);
      dataResources.set(environment, newDataResource);
      return newDataResource;
    }
    module.exports = {
      createQueryResource,
      getQueryResourceForEnvironment,
      getQueryCacheIdentifier
    };
  }
});

// node_modules/react-relay/lib/relay-hooks/useUnsafeRef_DEPRECATED.js
var require_useUnsafeRef_DEPRECATED = __commonJS({
  "node_modules/react-relay/lib/relay-hooks/useUnsafeRef_DEPRECATED.js"(exports, module) {
    "use strict";
    var _require = require_react();
    var useMemo47 = _require.useMemo;
    function useUnsafeRef_DEPRECATED(init) {
      return useMemo47(function() {
        return {
          current: init
        };
      }, []);
    }
    module.exports = useUnsafeRef_DEPRECATED;
  }
});

// node_modules/react-relay/lib/relay-hooks/useFetchTrackingRef.js
var require_useFetchTrackingRef = __commonJS({
  "node_modules/react-relay/lib/relay-hooks/useFetchTrackingRef.js"(exports, module) {
    "use strict";
    var useUnsafeRef_DEPRECATED = require_useUnsafeRef_DEPRECATED();
    var _require = require_react();
    var useCallback28 = _require.useCallback;
    var useEffect30 = _require.useEffect;
    function useFetchTrackingRef() {
      var subscriptionRef = useUnsafeRef_DEPRECATED(null);
      var isFetchingRef = useUnsafeRef_DEPRECATED(false);
      var disposeFetch = useCallback28(function() {
        if (subscriptionRef.current != null) {
          subscriptionRef.current.unsubscribe();
          subscriptionRef.current = null;
        }
        isFetchingRef.current = false;
      }, []);
      var startFetch = useCallback28(function(subscription2) {
        subscriptionRef.current = subscription2;
        isFetchingRef.current = true;
      }, []);
      var completeFetch = useCallback28(function() {
        subscriptionRef.current = null;
        isFetchingRef.current = false;
      }, []);
      useEffect30(function() {
        return disposeFetch;
      }, [disposeFetch]);
      return {
        isFetchingRef,
        startFetch,
        disposeFetch,
        completeFetch
      };
    }
    module.exports = useFetchTrackingRef;
  }
});

// node_modules/react-relay/lib/relay-hooks/FragmentResource.js
var require_FragmentResource = __commonJS({
  "node_modules/react-relay/lib/relay-hooks/FragmentResource.js"(exports, module) {
    "use strict";
    var _interopRequireDefault = require_interopRequireDefault()["default"];
    var _objectSpread210 = _interopRequireDefault(require_objectSpread2());
    var _defineProperty210 = _interopRequireDefault(require_defineProperty());
    var _toConsumableArray22 = _interopRequireDefault(require_toConsumableArray());
    var LRUCache = require_LRUCache();
    var _require = require_QueryResource();
    var getQueryResourceForEnvironment = _require.getQueryResourceForEnvironment;
    var SuspenseResource = require_SuspenseResource();
    var invariant3 = require_browser();
    var _require2 = require_relay_runtime();
    var _require2$__internal = _require2.__internal;
    var fetchQuery7 = _require2$__internal.fetchQuery;
    var getPromiseForActiveRequest = _require2$__internal.getPromiseForActiveRequest;
    var RelayFeatureFlags = _require2.RelayFeatureFlags;
    var createOperationDescriptor = _require2.createOperationDescriptor;
    var getFragmentIdentifier = _require2.getFragmentIdentifier;
    var getPendingOperationsForFragment = _require2.getPendingOperationsForFragment;
    var getSelector = _require2.getSelector;
    var getVariablesFromFragment = _require2.getVariablesFromFragment;
    var handlePotentialSnapshotErrors = _require2.handlePotentialSnapshotErrors;
    var isPromise = _require2.isPromise;
    var recycleNodesInto = _require2.recycleNodesInto;
    var WEAKMAP_SUPPORTED = typeof WeakMap === "function";
    var CACHE_CAPACITY = 1e6;
    var CONSTANT_READONLY_EMPTY_ARRAY = Object.freeze([]);
    function isMissingData(snapshot) {
      if (Array.isArray(snapshot)) {
        return snapshot.some(function(s2) {
          return s2.isMissingData;
        });
      }
      return snapshot.isMissingData;
    }
    function hasMissingClientEdges(snapshot) {
      var _snapshot$missingClie, _snapshot$missingClie2;
      if (Array.isArray(snapshot)) {
        return snapshot.some(function(s2) {
          var _s$missingClientEdges, _s$missingClientEdges2;
          return ((_s$missingClientEdges = (_s$missingClientEdges2 = s2.missingClientEdges) === null || _s$missingClientEdges2 === void 0 ? void 0 : _s$missingClientEdges2.length) !== null && _s$missingClientEdges !== void 0 ? _s$missingClientEdges : 0) > 0;
        });
      }
      return ((_snapshot$missingClie = (_snapshot$missingClie2 = snapshot.missingClientEdges) === null || _snapshot$missingClie2 === void 0 ? void 0 : _snapshot$missingClie2.length) !== null && _snapshot$missingClie !== void 0 ? _snapshot$missingClie : 0) > 0;
    }
    function missingLiveResolverFields(snapshot) {
      if (Array.isArray(snapshot)) {
        return snapshot.map(function(s2) {
          return s2.missingLiveResolverFields;
        }).filter(Boolean).flat();
      }
      return snapshot.missingLiveResolverFields;
    }
    function singularOrPluralForEach(snapshot, f) {
      if (Array.isArray(snapshot)) {
        snapshot.forEach(f);
      } else {
        f(snapshot);
      }
    }
    function getFragmentResult(cacheKey, snapshot, storeEpoch) {
      if (Array.isArray(snapshot)) {
        return {
          cacheKey,
          snapshot,
          data: snapshot.map(function(s2) {
            return s2.data;
          }),
          isMissingData: isMissingData(snapshot),
          storeEpoch
        };
      }
      return {
        cacheKey,
        snapshot,
        data: snapshot.data,
        isMissingData: isMissingData(snapshot),
        storeEpoch
      };
    }
    var ClientEdgeQueryResultsCache = /* @__PURE__ */ function() {
      function ClientEdgeQueryResultsCache2(environment) {
        (0, _defineProperty210["default"])(this, "_cache", /* @__PURE__ */ new Map());
        (0, _defineProperty210["default"])(this, "_retainCounts", /* @__PURE__ */ new Map());
        this._environment = environment;
      }
      var _proto = ClientEdgeQueryResultsCache2.prototype;
      _proto.get = function get3(fragmentIdentifier) {
        var _this$_cache$get$, _this$_cache$get;
        return (_this$_cache$get$ = (_this$_cache$get = this._cache.get(fragmentIdentifier)) === null || _this$_cache$get === void 0 ? void 0 : _this$_cache$get[0]) !== null && _this$_cache$get$ !== void 0 ? _this$_cache$get$ : void 0;
      };
      _proto.recordQueryResults = function recordQueryResults(fragmentIdentifier, value) {
        var _this = this;
        var existing = this._cache.get(fragmentIdentifier);
        if (!existing) {
          var suspenseResource = new SuspenseResource(function() {
            return _this._retain(fragmentIdentifier);
          });
          this._cache.set(fragmentIdentifier, [value, suspenseResource]);
          suspenseResource.temporaryRetain(this._environment);
        } else {
          var existingResults = existing[0], _suspenseResource = existing[1];
          value.forEach(function(queryResult) {
            existingResults.push(queryResult);
          });
          _suspenseResource.temporaryRetain(this._environment);
        }
      };
      _proto._retain = function _retain(id2) {
        var _this2 = this;
        var _this$_retainCounts$g;
        var retainCount = ((_this$_retainCounts$g = this._retainCounts.get(id2)) !== null && _this$_retainCounts$g !== void 0 ? _this$_retainCounts$g : 0) + 1;
        this._retainCounts.set(id2, retainCount);
        return {
          dispose: function dispose2() {
            var _this$_retainCounts$g2;
            var newRetainCount = ((_this$_retainCounts$g2 = _this2._retainCounts.get(id2)) !== null && _this$_retainCounts$g2 !== void 0 ? _this$_retainCounts$g2 : 0) - 1;
            if (newRetainCount > 0) {
              _this2._retainCounts.set(id2, newRetainCount);
            } else {
              _this2._retainCounts["delete"](id2);
              _this2._cache["delete"](id2);
            }
          }
        };
      };
      return ClientEdgeQueryResultsCache2;
    }();
    var FragmentResourceImpl = /* @__PURE__ */ function() {
      function FragmentResourceImpl2(environment) {
        this._environment = environment;
        this._cache = LRUCache.create(CACHE_CAPACITY);
        if (RelayFeatureFlags.ENABLE_CLIENT_EDGES) {
          this._clientEdgeQueryResultsCache = new ClientEdgeQueryResultsCache(environment);
        }
      }
      var _proto2 = FragmentResourceImpl2.prototype;
      _proto2.read = function read(fragmentNode, fragmentRef, componentDisplayName, fragmentKey) {
        return this.readWithIdentifier(fragmentNode, fragmentRef, getFragmentIdentifier(fragmentNode, fragmentRef), componentDisplayName, fragmentKey);
      };
      _proto2.readWithIdentifier = function readWithIdentifier(fragmentNode, fragmentRef, fragmentIdentifier, componentDisplayName, fragmentKey) {
        var _this3 = this;
        var _fragmentNode$metadat, _fragmentNode$metadat2, _missingLiveResolverF2, _missingLiveResolverF3;
        var environment = this._environment;
        if (fragmentRef == null) {
          return {
            cacheKey: fragmentIdentifier,
            data: null,
            isMissingData: false,
            snapshot: null,
            storeEpoch: 0
          };
        }
        var storeEpoch = environment.getStore().getEpoch();
        if ((fragmentNode === null || fragmentNode === void 0 ? void 0 : (_fragmentNode$metadat = fragmentNode.metadata) === null || _fragmentNode$metadat === void 0 ? void 0 : _fragmentNode$metadat.plural) === true) {
          !Array.isArray(fragmentRef) ? true ? invariant3(false, "Relay: Expected fragment pointer%s for fragment `%s` to be an array, instead got `%s`. Remove `@relay(plural: true)` from fragment `%s` to allow the prop to be an object.", fragmentKey != null ? " for key `".concat(fragmentKey, "`") : "", fragmentNode.name, typeof fragmentRef, fragmentNode.name) : invariant3(false) : void 0;
          if (fragmentRef.length === 0) {
            return {
              cacheKey: fragmentIdentifier,
              data: CONSTANT_READONLY_EMPTY_ARRAY,
              isMissingData: false,
              snapshot: CONSTANT_READONLY_EMPTY_ARRAY,
              storeEpoch
            };
          }
        }
        var cachedValue = this._cache.get(fragmentIdentifier);
        if (cachedValue != null) {
          var _missingLiveResolverF;
          if (cachedValue.kind === "pending" && isPromise(cachedValue.promise)) {
            environment.__log({
              name: "suspense.fragment",
              data: cachedValue.result.data,
              fragment: fragmentNode,
              isRelayHooks: true,
              isMissingData: cachedValue.result.isMissingData,
              isPromiseCached: true,
              pendingOperations: cachedValue.pendingOperations
            });
            throw cachedValue.promise;
          }
          if (cachedValue.kind === "done" && cachedValue.result.snapshot && !((_missingLiveResolverF = missingLiveResolverFields(cachedValue.result.snapshot)) !== null && _missingLiveResolverF !== void 0 && _missingLiveResolverF.length)) {
            this._throwOrLogErrorsInSnapshot(
              // $FlowFixMe[incompatible-call]
              cachedValue.result.snapshot
            );
            if (cachedValue.result.isMissingData) {
              environment.__log({
                name: "fragmentresource.missing_data",
                data: cachedValue.result.data,
                fragment: fragmentNode,
                isRelayHooks: true,
                cached: true
              });
            }
            return cachedValue.result;
          }
        }
        var fragmentSelector = getSelector(fragmentNode, fragmentRef);
        !(fragmentSelector != null) ? true ? invariant3(false, "Relay: Expected to receive an object where `...%s` was spread, but the fragment reference was not found`. This is most likely the result of:\n- Forgetting to spread `%s` in `%s`'s parent's fragment.\n- Conditionally fetching `%s` but unconditionally passing %s prop to `%s`. If the parent fragment only fetches the fragment conditionally - with e.g. `@include`, `@skip`, or inside a `... on SomeType { }` spread  - then the fragment reference will not exist. In this case, pass `null` if the conditions for evaluating the fragment are not met (e.g. if the `@include(if)` value is false.)", fragmentNode.name, fragmentNode.name, componentDisplayName, fragmentNode.name, fragmentKey == null ? "a fragment reference" : "the `".concat(fragmentKey, "`"), componentDisplayName) : invariant3(false) : void 0;
        var snapshot = fragmentSelector.kind === "PluralReaderSelector" ? fragmentSelector.selectors.map(function(s2) {
          return environment.lookup(s2);
        }) : environment.lookup(fragmentSelector);
        var fragmentResult = getFragmentResult(fragmentIdentifier, snapshot, storeEpoch);
        if (!fragmentResult.isMissingData) {
          this._throwOrLogErrorsInSnapshot(snapshot);
          this._cache.set(fragmentIdentifier, {
            kind: "done",
            result: fragmentResult
          });
          return fragmentResult;
        }
        var clientEdgeRequests = null;
        if (RelayFeatureFlags.ENABLE_CLIENT_EDGES && ((_fragmentNode$metadat2 = fragmentNode.metadata) === null || _fragmentNode$metadat2 === void 0 ? void 0 : _fragmentNode$metadat2.hasClientEdges) === true && hasMissingClientEdges(snapshot)) {
          clientEdgeRequests = [];
          var queryResource = getQueryResourceForEnvironment(this._environment);
          var queryResults = [];
          singularOrPluralForEach(snapshot, function(snap) {
            var _snap$missingClientEd;
            (_snap$missingClientEd = snap.missingClientEdges) === null || _snap$missingClientEd === void 0 ? void 0 : _snap$missingClientEd.forEach(function(_ref18) {
              var _clientEdgeRequests;
              var request = _ref18.request, clientEdgeDestinationID = _ref18.clientEdgeDestinationID;
              var _this3$_performClient = _this3._performClientEdgeQuery(queryResource, fragmentNode, fragmentRef, request, clientEdgeDestinationID), queryResult = _this3$_performClient.queryResult, requestDescriptor = _this3$_performClient.requestDescriptor;
              queryResults.push(queryResult);
              (_clientEdgeRequests = clientEdgeRequests) === null || _clientEdgeRequests === void 0 ? void 0 : _clientEdgeRequests.push(requestDescriptor);
            });
          });
          !(this._clientEdgeQueryResultsCache != null) ? true ? invariant3(false, "Client edge query result cache should exist when ENABLE_CLIENT_EDGES is on.") : invariant3(false) : void 0;
          this._clientEdgeQueryResultsCache.recordQueryResults(fragmentIdentifier, queryResults);
        }
        var clientEdgePromises = [];
        if (RelayFeatureFlags.ENABLE_CLIENT_EDGES && clientEdgeRequests) {
          clientEdgePromises = clientEdgeRequests.map(function(request) {
            return getPromiseForActiveRequest(_this3._environment, request);
          }).filter(Boolean);
        }
        var fragmentOwner = fragmentSelector.kind === "PluralReaderSelector" ? fragmentSelector.selectors[0].owner : fragmentSelector.owner;
        var parentQueryPromiseResult = this._getAndSavePromiseForFragmentRequestInFlight(fragmentIdentifier, fragmentNode, fragmentOwner, fragmentResult);
        var parentQueryPromiseResultPromise = parentQueryPromiseResult === null || parentQueryPromiseResult === void 0 ? void 0 : parentQueryPromiseResult.promise;
        var missingResolverFieldPromises = (_missingLiveResolverF2 = (_missingLiveResolverF3 = missingLiveResolverFields(snapshot)) === null || _missingLiveResolverF3 === void 0 ? void 0 : _missingLiveResolverF3.map(function(_ref22) {
          var liveStateID = _ref22.liveStateID;
          var store = environment.getStore();
          return store.getLiveResolverPromise(liveStateID);
        })) !== null && _missingLiveResolverF2 !== void 0 ? _missingLiveResolverF2 : [];
        if (clientEdgePromises.length || missingResolverFieldPromises.length || isPromise(parentQueryPromiseResultPromise)) {
          var _parentQueryPromiseRe, _clientEdgeRequests2;
          environment.__log({
            name: "suspense.fragment",
            data: fragmentResult.data,
            fragment: fragmentNode,
            isRelayHooks: true,
            isPromiseCached: false,
            isMissingData: fragmentResult.isMissingData,
            // TODO! Attach information here about missing live resolver fields
            pendingOperations: [].concat((0, _toConsumableArray22["default"])((_parentQueryPromiseRe = parentQueryPromiseResult === null || parentQueryPromiseResult === void 0 ? void 0 : parentQueryPromiseResult.pendingOperations) !== null && _parentQueryPromiseRe !== void 0 ? _parentQueryPromiseRe : []), (0, _toConsumableArray22["default"])((_clientEdgeRequests2 = clientEdgeRequests) !== null && _clientEdgeRequests2 !== void 0 ? _clientEdgeRequests2 : []))
          });
          var promises = [];
          if (clientEdgePromises.length > 0) {
            promises = promises.concat(clientEdgePromises);
          }
          if (missingResolverFieldPromises.length > 0) {
            promises = promises.concat(missingResolverFieldPromises);
          }
          if (promises.length > 0) {
            if (parentQueryPromiseResultPromise) {
              promises.push(parentQueryPromiseResultPromise);
            }
            throw Promise.all(promises);
          }
          if (parentQueryPromiseResultPromise) {
            throw parentQueryPromiseResultPromise;
          }
        }
        this._throwOrLogErrorsInSnapshot(snapshot);
        environment.__log({
          name: "fragmentresource.missing_data",
          data: fragmentResult.data,
          fragment: fragmentNode,
          isRelayHooks: true,
          cached: false
        });
        return getFragmentResult(fragmentIdentifier, snapshot, storeEpoch);
      };
      _proto2._performClientEdgeQuery = function _performClientEdgeQuery(queryResource, fragmentNode, fragmentRef, request, clientEdgeDestinationID) {
        var originalVariables = getVariablesFromFragment(fragmentNode, fragmentRef);
        var variables = (0, _objectSpread210["default"])((0, _objectSpread210["default"])({}, originalVariables), {}, {
          id: clientEdgeDestinationID
          // TODO should be a reserved name
        });
        var operation = createOperationDescriptor(
          request,
          variables,
          {}
          //  TODO cacheConfig should probably inherent from parent operation
        );
        var fetchObservable = fetchQuery7(this._environment, operation);
        var queryResult = queryResource.prepare(
          operation,
          fetchObservable
          // TODO should inherent render policy etc. from parent operation
        );
        return {
          requestDescriptor: operation.request,
          queryResult
        };
      };
      _proto2._throwOrLogErrorsInSnapshot = function _throwOrLogErrorsInSnapshot(snapshot) {
        var _this4 = this;
        if (Array.isArray(snapshot)) {
          snapshot.forEach(function(s2) {
            handlePotentialSnapshotErrors(_this4._environment, s2.missingRequiredFields, s2.relayResolverErrors);
          });
        } else {
          handlePotentialSnapshotErrors(this._environment, snapshot.missingRequiredFields, snapshot.relayResolverErrors);
        }
      };
      _proto2.readSpec = function readSpec(fragmentNodes, fragmentRefs, componentDisplayName) {
        var result = {};
        for (var key in fragmentNodes) {
          result[key] = this.read(fragmentNodes[key], fragmentRefs[key], componentDisplayName, key);
        }
        return result;
      };
      _proto2.subscribe = function subscribe(fragmentResult, callback) {
        var _this5 = this;
        var environment = this._environment;
        var cacheKey = fragmentResult.cacheKey;
        var renderedSnapshot = fragmentResult.snapshot;
        if (!renderedSnapshot) {
          return {
            dispose: function dispose2() {
            }
          };
        }
        var _this$checkMissedUpda = this.checkMissedUpdates(fragmentResult), didMissUpdates = _this$checkMissedUpda[0], currentSnapshot = _this$checkMissedUpda[1];
        if (didMissUpdates) {
          callback();
        }
        var disposables = [];
        if (Array.isArray(renderedSnapshot)) {
          !Array.isArray(currentSnapshot) ? true ? invariant3(false, "Relay: Expected snapshots to be plural. If you're seeing this, this is likely a bug in Relay.") : invariant3(false) : void 0;
          currentSnapshot.forEach(function(snapshot, idx) {
            disposables.push(environment.subscribe(snapshot, function(latestSnapshot) {
              var storeEpoch = environment.getStore().getEpoch();
              _this5._updatePluralSnapshot(cacheKey, currentSnapshot, latestSnapshot, idx, storeEpoch);
              callback();
            }));
          });
        } else {
          !(currentSnapshot != null && !Array.isArray(currentSnapshot)) ? true ? invariant3(false, "Relay: Expected snapshot to be singular. If you're seeing this, this is likely a bug in Relay.") : invariant3(false) : void 0;
          disposables.push(environment.subscribe(currentSnapshot, function(latestSnapshot) {
            var storeEpoch = environment.getStore().getEpoch();
            _this5._cache.set(cacheKey, {
              kind: "done",
              result: getFragmentResult(cacheKey, latestSnapshot, storeEpoch)
            });
            callback();
          }));
        }
        if (RelayFeatureFlags.ENABLE_CLIENT_EDGES) {
          var _this$_clientEdgeQuer, _this$_clientEdgeQuer2;
          var clientEdgeQueryResults = (_this$_clientEdgeQuer = (_this$_clientEdgeQuer2 = this._clientEdgeQueryResultsCache) === null || _this$_clientEdgeQuer2 === void 0 ? void 0 : _this$_clientEdgeQuer2.get(cacheKey)) !== null && _this$_clientEdgeQuer !== void 0 ? _this$_clientEdgeQuer : void 0;
          if (clientEdgeQueryResults !== null && clientEdgeQueryResults !== void 0 && clientEdgeQueryResults.length) {
            var queryResource = getQueryResourceForEnvironment(this._environment);
            clientEdgeQueryResults.forEach(function(queryResult) {
              disposables.push(queryResource.retain(queryResult));
            });
          }
        }
        return {
          dispose: function dispose2() {
            disposables.forEach(function(s2) {
              return s2.dispose();
            });
            _this5._cache["delete"](cacheKey);
          }
        };
      };
      _proto2.subscribeSpec = function subscribeSpec(fragmentResults, callback) {
        var _this6 = this;
        var disposables = Object.keys(fragmentResults).map(function(key) {
          return _this6.subscribe(fragmentResults[key], callback);
        });
        return {
          dispose: function dispose2() {
            disposables.forEach(function(disposable) {
              disposable.dispose();
            });
          }
        };
      };
      _proto2.checkMissedUpdates = function checkMissedUpdates(fragmentResult) {
        var environment = this._environment;
        var renderedSnapshot = fragmentResult.snapshot;
        if (!renderedSnapshot) {
          return [false, null];
        }
        var storeEpoch = null;
        storeEpoch = environment.getStore().getEpoch();
        if (fragmentResult.storeEpoch === storeEpoch) {
          return [false, fragmentResult.snapshot];
        }
        var cacheKey = fragmentResult.cacheKey;
        if (Array.isArray(renderedSnapshot)) {
          var didMissUpdates = false;
          var currentSnapshots = [];
          renderedSnapshot.forEach(function(snapshot, idx) {
            var currentSnapshot2 = environment.lookup(snapshot.selector);
            var renderData2 = snapshot.data;
            var currentData2 = currentSnapshot2.data;
            var updatedData2 = recycleNodesInto(renderData2, currentData2);
            if (updatedData2 !== renderData2) {
              currentSnapshot2 = (0, _objectSpread210["default"])((0, _objectSpread210["default"])({}, currentSnapshot2), {}, {
                data: updatedData2
              });
              didMissUpdates = true;
            }
            currentSnapshots[idx] = currentSnapshot2;
          });
          if (didMissUpdates) {
            this._cache.set(cacheKey, {
              kind: "done",
              result: getFragmentResult(cacheKey, currentSnapshots, storeEpoch)
            });
          }
          return [didMissUpdates, currentSnapshots];
        }
        var currentSnapshot = environment.lookup(renderedSnapshot.selector);
        var renderData = renderedSnapshot.data;
        var currentData = currentSnapshot.data;
        var updatedData = recycleNodesInto(renderData, currentData);
        var updatedCurrentSnapshot = {
          data: updatedData,
          isMissingData: currentSnapshot.isMissingData,
          missingClientEdges: currentSnapshot.missingClientEdges,
          missingLiveResolverFields: currentSnapshot.missingLiveResolverFields,
          seenRecords: currentSnapshot.seenRecords,
          selector: currentSnapshot.selector,
          missingRequiredFields: currentSnapshot.missingRequiredFields,
          relayResolverErrors: currentSnapshot.relayResolverErrors
        };
        if (updatedData !== renderData) {
          this._cache.set(cacheKey, {
            kind: "done",
            result: getFragmentResult(cacheKey, updatedCurrentSnapshot, storeEpoch)
          });
        }
        return [updatedData !== renderData, updatedCurrentSnapshot];
      };
      _proto2.checkMissedUpdatesSpec = function checkMissedUpdatesSpec(fragmentResults) {
        var _this7 = this;
        return Object.keys(fragmentResults).some(function(key) {
          return _this7.checkMissedUpdates(fragmentResults[key])[0];
        });
      };
      _proto2._getAndSavePromiseForFragmentRequestInFlight = function _getAndSavePromiseForFragmentRequestInFlight(cacheKey, fragmentNode, fragmentOwner, fragmentResult) {
        var _this8 = this;
        var pendingOperationsResult = getPendingOperationsForFragment(this._environment, fragmentNode, fragmentOwner);
        if (pendingOperationsResult == null) {
          return null;
        }
        var networkPromise = pendingOperationsResult.promise;
        var pendingOperations = pendingOperationsResult.pendingOperations;
        var promise = networkPromise.then(function() {
          _this8._cache["delete"](cacheKey);
        })["catch"](function(error) {
          _this8._cache["delete"](cacheKey);
        });
        promise.displayName = networkPromise.displayName;
        this._cache.set(cacheKey, {
          kind: "pending",
          pendingOperations,
          promise,
          result: fragmentResult
        });
        return {
          promise,
          pendingOperations
        };
      };
      _proto2._updatePluralSnapshot = function _updatePluralSnapshot(cacheKey, baseSnapshots, latestSnapshot, idx, storeEpoch) {
        var _currentFragmentResul;
        var currentFragmentResult = this._cache.get(cacheKey);
        if (isPromise(currentFragmentResult)) {
          reportInvalidCachedData(latestSnapshot.selector.node.name);
          return;
        }
        var currentSnapshot = currentFragmentResult === null || currentFragmentResult === void 0 ? void 0 : (_currentFragmentResul = currentFragmentResult.result) === null || _currentFragmentResul === void 0 ? void 0 : _currentFragmentResul.snapshot;
        if (currentSnapshot && !Array.isArray(currentSnapshot)) {
          reportInvalidCachedData(latestSnapshot.selector.node.name);
          return;
        }
        var nextSnapshots = currentSnapshot ? (0, _toConsumableArray22["default"])(currentSnapshot) : (0, _toConsumableArray22["default"])(baseSnapshots);
        nextSnapshots[idx] = latestSnapshot;
        this._cache.set(cacheKey, {
          kind: "done",
          result: getFragmentResult(cacheKey, nextSnapshots, storeEpoch)
        });
      };
      return FragmentResourceImpl2;
    }();
    function reportInvalidCachedData(nodeName) {
      true ? true ? invariant3(false, "Relay: Expected to find cached data for plural fragment `%s` when receiving a subscription. If you're seeing this, this is likely a bug in Relay.", nodeName) : invariant3(false) : void 0;
    }
    function createFragmentResource(environment) {
      return new FragmentResourceImpl(environment);
    }
    var dataResources = WEAKMAP_SUPPORTED ? /* @__PURE__ */ new WeakMap() : /* @__PURE__ */ new Map();
    function getFragmentResourceForEnvironment(environment) {
      var cached = dataResources.get(environment);
      if (cached) {
        return cached;
      }
      var newDataResource = createFragmentResource(environment);
      dataResources.set(environment, newDataResource);
      return newDataResource;
    }
    module.exports = {
      createFragmentResource,
      getFragmentResourceForEnvironment
    };
  }
});

// node_modules/react-relay/lib/relay-hooks/useFragmentNode.js
var require_useFragmentNode = __commonJS({
  "node_modules/react-relay/lib/relay-hooks/useFragmentNode.js"(exports, module) {
    "use strict";
    var _require = require_FragmentResource();
    var getFragmentResourceForEnvironment = _require.getFragmentResourceForEnvironment;
    var useRelayEnvironment = require_useRelayEnvironment();
    var useUnsafeRef_DEPRECATED = require_useUnsafeRef_DEPRECATED();
    var _require2 = require_react();
    var useEffect30 = _require2.useEffect;
    var useState33 = _require2.useState;
    var _require3 = require_relay_runtime();
    var getFragmentIdentifier = _require3.getFragmentIdentifier;
    var warning2 = require_warning();
    function useFragmentNode(fragmentNode, fragmentRef, componentDisplayName) {
      var environment = useRelayEnvironment();
      var FragmentResource = getFragmentResourceForEnvironment(environment);
      var isMountedRef = useUnsafeRef_DEPRECATED(false);
      var _useState = useState33(0), forceUpdate = _useState[1];
      var fragmentIdentifier = getFragmentIdentifier(fragmentNode, fragmentRef);
      var fragmentResult = FragmentResource.readWithIdentifier(fragmentNode, fragmentRef, fragmentIdentifier, componentDisplayName);
      var isListeningForUpdatesRef = useUnsafeRef_DEPRECATED(true);
      function enableStoreUpdates() {
        isListeningForUpdatesRef.current = true;
        var didMissUpdates = FragmentResource.checkMissedUpdates(fragmentResult)[0];
        if (didMissUpdates) {
          handleDataUpdate();
        }
      }
      function disableStoreUpdates() {
        isListeningForUpdatesRef.current = false;
      }
      function handleDataUpdate() {
        if (isMountedRef.current === false || isListeningForUpdatesRef.current === false) {
          return;
        }
        forceUpdate(function(count2) {
          return count2 + 1;
        });
      }
      useEffect30(function() {
        isMountedRef.current = true;
        var disposable = FragmentResource.subscribe(fragmentResult, handleDataUpdate);
        return function() {
          isMountedRef.current = false;
          disposable.dispose();
        };
      }, [environment, fragmentIdentifier]);
      if (true) {
        if (fragmentRef != null && (fragmentResult.data === void 0 || Array.isArray(fragmentResult.data) && fragmentResult.data.length > 0 && fragmentResult.data.every(function(data) {
          return data === void 0;
        }))) {
          true ? warning2(false, "Relay: Expected to have been able to read non-null data for fragment `%s` declared in `%s`, since fragment reference was non-null. Make sure that that `%s`'s parent isn't holding on to and/or passing a fragment reference for data that has been deleted.", fragmentNode.name, componentDisplayName, componentDisplayName) : void 0;
        }
      }
      return {
        // $FlowFixMe[incompatible-return]
        data: fragmentResult.data,
        disableStoreUpdates,
        enableStoreUpdates
      };
    }
    module.exports = useFragmentNode;
  }
});

// node_modules/react-relay/lib/relay-hooks/useLazyLoadQueryNode.js
var require_useLazyLoadQueryNode = __commonJS({
  "node_modules/react-relay/lib/relay-hooks/useLazyLoadQueryNode.js"(exports, module) {
    "use strict";
    var ProfilerContext = require_ProfilerContext();
    var _require = require_QueryResource();
    var getQueryCacheIdentifier = _require.getQueryCacheIdentifier;
    var getQueryResourceForEnvironment = _require.getQueryResourceForEnvironment;
    var useFetchTrackingRef = require_useFetchTrackingRef();
    var useFragmentNode = require_useFragmentNode();
    var useRelayEnvironment = require_useRelayEnvironment();
    var React116 = require_react();
    var useContext17 = React116.useContext;
    var useEffect30 = React116.useEffect;
    var useState33 = React116.useState;
    var useRef28 = React116.useRef;
    function useLazyLoadQueryNode(_ref18) {
      var query2 = _ref18.query, componentDisplayName = _ref18.componentDisplayName, fetchObservable = _ref18.fetchObservable, fetchPolicy = _ref18.fetchPolicy, fetchKey = _ref18.fetchKey, renderPolicy = _ref18.renderPolicy;
      var environment = useRelayEnvironment();
      var profilerContext = useContext17(ProfilerContext);
      var QueryResource = getQueryResourceForEnvironment(environment);
      var _useState = useState33(0), forceUpdateKey = _useState[0], forceUpdate = _useState[1];
      var _useFetchTrackingRef = useFetchTrackingRef(), startFetch = _useFetchTrackingRef.startFetch, completeFetch = _useFetchTrackingRef.completeFetch;
      var cacheBreaker = "".concat(forceUpdateKey, "-").concat(fetchKey !== null && fetchKey !== void 0 ? fetchKey : "");
      var cacheIdentifier = getQueryCacheIdentifier(environment, query2, fetchPolicy, renderPolicy, cacheBreaker);
      var preparedQueryResult = profilerContext.wrapPrepareQueryResource(function() {
        return QueryResource.prepareWithIdentifier(cacheIdentifier, query2, fetchObservable, fetchPolicy, renderPolicy, {
          start: startFetch,
          complete: completeFetch,
          error: completeFetch
        }, profilerContext);
      });
      var maybeHiddenOrFastRefresh = useRef28(false);
      useEffect30(function() {
        return function() {
          maybeHiddenOrFastRefresh.current = true;
        };
      }, []);
      useEffect30(function() {
        if (maybeHiddenOrFastRefresh.current === true) {
          maybeHiddenOrFastRefresh.current = false;
          forceUpdate(function(n2) {
            return n2 + 1;
          });
          return;
        }
        var disposable = QueryResource.retain(preparedQueryResult, profilerContext);
        return function() {
          disposable.dispose();
        };
      }, [environment, cacheIdentifier]);
      useEffect30(function() {
        QueryResource.releaseTemporaryRetain(preparedQueryResult);
      });
      var fragmentNode = preparedQueryResult.fragmentNode, fragmentRef = preparedQueryResult.fragmentRef;
      var _useFragmentNode = useFragmentNode(fragmentNode, fragmentRef, componentDisplayName), data = _useFragmentNode.data;
      return data;
    }
    module.exports = useLazyLoadQueryNode;
  }
});

// node_modules/react-relay/lib/relay-hooks/useMemoVariables.js
var require_useMemoVariables = __commonJS({
  "node_modules/react-relay/lib/relay-hooks/useMemoVariables.js"(exports, module) {
    "use strict";
    var areEqual2 = require_areEqual();
    var _require = require_react();
    var useState33 = _require.useState;
    function useMemoVariables(variables) {
      var _useState = useState33(variables), mirroredVariables = _useState[0], setMirroredVariables = _useState[1];
      if (areEqual2(variables, mirroredVariables)) {
        return mirroredVariables;
      } else {
        setMirroredVariables(variables);
        return variables;
      }
    }
    module.exports = useMemoVariables;
  }
});

// node_modules/react-relay/lib/relay-hooks/useMemoOperationDescriptor.js
var require_useMemoOperationDescriptor = __commonJS({
  "node_modules/react-relay/lib/relay-hooks/useMemoOperationDescriptor.js"(exports, module) {
    "use strict";
    var useMemoVariables = require_useMemoVariables();
    var React116 = require_react();
    var _require = require_relay_runtime();
    var createOperationDescriptor = _require.createOperationDescriptor;
    var getRequest = _require.getRequest;
    var useMemo47 = React116.useMemo;
    function useMemoOperationDescriptor(gqlQuery, variables, cacheConfig) {
      var memoVariables = useMemoVariables(variables);
      var memoCacheConfig = useMemoVariables(cacheConfig || {});
      return useMemo47(function() {
        return createOperationDescriptor(getRequest(gqlQuery), memoVariables, memoCacheConfig);
      }, [gqlQuery, memoVariables, memoCacheConfig]);
    }
    module.exports = useMemoOperationDescriptor;
  }
});

// node_modules/react-relay/lib/relay-hooks/useLazyLoadQuery.js
var require_useLazyLoadQuery = __commonJS({
  "node_modules/react-relay/lib/relay-hooks/useLazyLoadQuery.js"(exports, module) {
    "use strict";
    var _require = require_loadQuery();
    var useTrackLoadQueryInRender = _require.useTrackLoadQueryInRender;
    var useLazyLoadQueryNode = require_useLazyLoadQueryNode();
    var useMemoOperationDescriptor = require_useMemoOperationDescriptor();
    var useRelayEnvironment = require_useRelayEnvironment();
    var _require2 = require_relay_runtime();
    var fetchQuery7 = _require2.__internal.fetchQuery;
    function useLazyLoadQuery18(gqlQuery, variables, options) {
      useTrackLoadQueryInRender();
      var environment = useRelayEnvironment();
      var query2 = useMemoOperationDescriptor(gqlQuery, variables, options && options.networkCacheConfig ? options.networkCacheConfig : {
        force: true
      });
      var data = useLazyLoadQueryNode({
        componentDisplayName: "useLazyLoadQuery()",
        fetchKey: options === null || options === void 0 ? void 0 : options.fetchKey,
        fetchObservable: fetchQuery7(environment, query2),
        fetchPolicy: options === null || options === void 0 ? void 0 : options.fetchPolicy,
        query: query2,
        renderPolicy: options === null || options === void 0 ? void 0 : options.UNSTABLE_renderPolicy
      });
      return data;
    }
    module.exports = useLazyLoadQuery18;
  }
});

// node_modules/react-relay/lib/relay-hooks/useClientQuery.js
var require_useClientQuery = __commonJS({
  "node_modules/react-relay/lib/relay-hooks/useClientQuery.js"(exports, module) {
    "use strict";
    var _interopRequireDefault = require_interopRequireDefault()["default"];
    var _objectSpread210 = _interopRequireDefault(require_objectSpread2());
    var useLazyLoadQuery18 = require_useLazyLoadQuery();
    function useClientQuery(gqlQuery, variables, options) {
      var query2 = gqlQuery;
      return useLazyLoadQuery18(query2, variables, (0, _objectSpread210["default"])((0, _objectSpread210["default"])({}, options), {}, {
        fetchPolicy: "store-only"
      }));
    }
    module.exports = useClientQuery;
  }
});

// node_modules/react-relay/lib/relay-hooks/useIsMountedRef.js
var require_useIsMountedRef = __commonJS({
  "node_modules/react-relay/lib/relay-hooks/useIsMountedRef.js"(exports, module) {
    "use strict";
    var _require = require_react();
    var useEffect30 = _require.useEffect;
    var useRef28 = _require.useRef;
    function useIsMountedRef() {
      var isMountedRef = useRef28(true);
      useEffect30(function() {
        isMountedRef.current = true;
        return function() {
          isMountedRef.current = false;
        };
      }, []);
      return isMountedRef;
    }
    module.exports = useIsMountedRef;
  }
});

// node_modules/react-relay/lib/relay-hooks/useEntryPointLoader.js
var require_useEntryPointLoader = __commonJS({
  "node_modules/react-relay/lib/relay-hooks/useEntryPointLoader.js"(exports, module) {
    "use strict";
    var _interopRequireDefault = require_interopRequireDefault()["default"];
    var _createForOfIteratorHelper2 = _interopRequireDefault(require_createForOfIteratorHelper());
    var loadEntryPoint = require_loadEntryPoint();
    var _require = require_loadQuery();
    var useTrackLoadQueryInRender = _require.useTrackLoadQueryInRender;
    var useIsMountedRef = require_useIsMountedRef();
    var _require2 = require_react();
    var useCallback28 = _require2.useCallback;
    var useEffect30 = _require2.useEffect;
    var useRef28 = _require2.useRef;
    var useState33 = _require2.useState;
    var initialNullEntryPointReferenceState = {
      kind: "NullEntryPointReference"
    };
    function useLoadEntryPoint(environmentProvider, entryPoint, options) {
      var _options$TEST_ONLY__i, _options$TEST_ONLY__i2, _options$TEST_ONLY__i3, _options$TEST_ONLY__i4;
      useTrackLoadQueryInRender();
      var initialEntryPointReferenceInternal = (_options$TEST_ONLY__i = options === null || options === void 0 ? void 0 : (_options$TEST_ONLY__i2 = options.TEST_ONLY__initialEntryPointData) === null || _options$TEST_ONLY__i2 === void 0 ? void 0 : _options$TEST_ONLY__i2.entryPointReference) !== null && _options$TEST_ONLY__i !== void 0 ? _options$TEST_ONLY__i : initialNullEntryPointReferenceState;
      var initialEntryPointParamsInternal = (_options$TEST_ONLY__i3 = options === null || options === void 0 ? void 0 : (_options$TEST_ONLY__i4 = options.TEST_ONLY__initialEntryPointData) === null || _options$TEST_ONLY__i4 === void 0 ? void 0 : _options$TEST_ONLY__i4.entryPointParams) !== null && _options$TEST_ONLY__i3 !== void 0 ? _options$TEST_ONLY__i3 : null;
      var isMountedRef = useIsMountedRef();
      var undisposedEntryPointReferencesRef = useRef28(/* @__PURE__ */ new Set([initialEntryPointReferenceInternal]));
      var _useState = useState33(initialEntryPointReferenceInternal), entryPointReference = _useState[0], setEntryPointReference = _useState[1];
      var _useState2 = useState33(initialEntryPointParamsInternal), entryPointParams = _useState2[0], setEntryPointParams = _useState2[1];
      var disposeEntryPoint = useCallback28(function() {
        if (isMountedRef.current) {
          var nullEntryPointReference = {
            kind: "NullEntryPointReference"
          };
          undisposedEntryPointReferencesRef.current.add(nullEntryPointReference);
          setEntryPointReference(nullEntryPointReference);
        }
      }, [setEntryPointReference, isMountedRef]);
      var entryPointLoaderCallback = useCallback28(function(params) {
        if (isMountedRef.current) {
          var updatedEntryPointReference = loadEntryPoint(environmentProvider, entryPoint, params);
          undisposedEntryPointReferencesRef.current.add(updatedEntryPointReference);
          setEntryPointReference(updatedEntryPointReference);
          setEntryPointParams(params);
        }
      }, [environmentProvider, entryPoint, setEntryPointReference, isMountedRef]);
      var maybeHiddenOrFastRefresh = useRef28(false);
      useEffect30(function() {
        return function() {
          maybeHiddenOrFastRefresh.current = true;
        };
      }, []);
      useEffect30(function() {
        if (maybeHiddenOrFastRefresh.current === true) {
          maybeHiddenOrFastRefresh.current = false;
          if (entryPointReference.kind !== "NullEntryPointReference" && entryPointParams != null) {
            entryPointLoaderCallback(entryPointParams);
          }
          return;
        }
        var undisposedEntryPointReferences = undisposedEntryPointReferencesRef.current;
        if (isMountedRef.current) {
          var _iterator = (0, _createForOfIteratorHelper2["default"])(undisposedEntryPointReferences), _step;
          try {
            for (_iterator.s(); !(_step = _iterator.n()).done; ) {
              var undisposedEntryPointReference = _step.value;
              if (undisposedEntryPointReference === entryPointReference) {
                break;
              }
              undisposedEntryPointReferences["delete"](undisposedEntryPointReference);
              if (undisposedEntryPointReference.kind !== "NullEntryPointReference") {
                undisposedEntryPointReference.dispose();
              }
            }
          } catch (err) {
            _iterator.e(err);
          } finally {
            _iterator.f();
          }
        }
      }, [entryPointReference, entryPointParams, entryPointLoaderCallback, isMountedRef]);
      useEffect30(function() {
        return function disposeAllRemainingEntryPointReferences() {
          var _iterator2 = (0, _createForOfIteratorHelper2["default"])(undisposedEntryPointReferencesRef.current), _step2;
          try {
            for (_iterator2.s(); !(_step2 = _iterator2.n()).done; ) {
              var unhandledStateChange = _step2.value;
              if (unhandledStateChange.kind !== "NullEntryPointReference") {
                unhandledStateChange.dispose();
              }
            }
          } catch (err) {
            _iterator2.e(err);
          } finally {
            _iterator2.f();
          }
        };
      }, []);
      return [entryPointReference.kind === "NullEntryPointReference" ? null : entryPointReference, entryPointLoaderCallback, disposeEntryPoint];
    }
    module.exports = useLoadEntryPoint;
  }
});

// node_modules/react-relay/lib/relay-hooks/HooksImplementation.js
var require_HooksImplementation = __commonJS({
  "node_modules/react-relay/lib/relay-hooks/HooksImplementation.js"(exports, module) {
    "use strict";
    var warning2 = require_warning();
    var implementation = null;
    function inject(impl) {
      true ? warning2(implementation !== null, "Relay HooksImplementation was injected twice.") : void 0;
      implementation = impl;
    }
    function get3() {
      return implementation;
    }
    module.exports = {
      inject,
      get: get3
    };
  }
});

// node_modules/react-relay/lib/relay-hooks/useStaticFragmentNodeWarning.js
var require_useStaticFragmentNodeWarning = __commonJS({
  "node_modules/react-relay/lib/relay-hooks/useStaticFragmentNodeWarning.js"(exports, module) {
    "use strict";
    var useUnsafeRef_DEPRECATED = require_useUnsafeRef_DEPRECATED();
    var warning2 = require_warning();
    function useStaticFragmentNodeWarning(fragmentNode, warningContext) {
      if (true) {
        var initialPropRef = useUnsafeRef_DEPRECATED(fragmentNode.name);
        true ? warning2(initialPropRef.current === fragmentNode.name, "Relay: The %s has to remain the same over the lifetime of a component. Changing it is not supported and will result in unexpected behavior.", warningContext) : void 0;
      }
    }
    module.exports = useStaticFragmentNodeWarning;
  }
});

// node_modules/react-relay/lib/relay-hooks/useFragment.js
var require_useFragment = __commonJS({
  "node_modules/react-relay/lib/relay-hooks/useFragment.js"(exports, module) {
    "use strict";
    var HooksImplementation = require_HooksImplementation();
    var _require = require_loadQuery();
    var useTrackLoadQueryInRender = _require.useTrackLoadQueryInRender;
    var useFragmentNode = require_useFragmentNode();
    var useStaticFragmentNodeWarning = require_useStaticFragmentNodeWarning();
    var _require2 = require_react();
    var useDebugValue3 = _require2.useDebugValue;
    var _require3 = require_relay_runtime();
    var getFragment = _require3.getFragment;
    function useFragment_LEGACY(fragment2, key) {
      useTrackLoadQueryInRender();
      var fragmentNode = getFragment(fragment2);
      useStaticFragmentNodeWarning(fragmentNode, "first argument of useFragment()");
      var _useFragmentNode = useFragmentNode(fragmentNode, key, "useFragment()"), data = _useFragmentNode.data;
      if (true) {
        useDebugValue3({
          fragment: fragmentNode.name,
          data
        });
      }
      return data;
    }
    function useFragment10(fragment2, key) {
      var impl = HooksImplementation.get();
      if (impl) {
        return impl.useFragment(fragment2, key);
      } else {
        return useFragment_LEGACY(fragment2, key);
      }
    }
    module.exports = useFragment10;
  }
});

// node_modules/react-relay/lib/relay-hooks/useMutation.js
var require_useMutation = __commonJS({
  "node_modules/react-relay/lib/relay-hooks/useMutation.js"(exports, module) {
    "use strict";
    var _interopRequireDefault = require_interopRequireDefault()["default"];
    var _objectSpread210 = _interopRequireDefault(require_objectSpread2());
    var useIsMountedRef = require_useIsMountedRef();
    var useRelayEnvironment = require_useRelayEnvironment();
    var React116 = require_react();
    var _require = require_relay_runtime();
    var defaultCommitMutation = _require.commitMutation;
    var useState33 = React116.useState;
    var useEffect30 = React116.useEffect;
    var useRef28 = React116.useRef;
    var useCallback28 = React116.useCallback;
    function useMutation3(mutation) {
      var commitMutationFn = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : defaultCommitMutation;
      var environment = useRelayEnvironment();
      var isMountedRef = useIsMountedRef();
      var environmentRef = useRef28(environment);
      var mutationRef = useRef28(mutation);
      var inFlightMutationsRef = useRef28(/* @__PURE__ */ new Set());
      var _useState = useState33(false), isMutationInFlight = _useState[0], setMutationInFlight = _useState[1];
      var cleanup = useCallback28(function(disposable) {
        if (environmentRef.current === environment && mutationRef.current === mutation) {
          inFlightMutationsRef.current["delete"](disposable);
          if (isMountedRef.current) {
            setMutationInFlight(inFlightMutationsRef.current.size > 0);
          }
        }
      }, [environment, isMountedRef, mutation]);
      useEffect30(function() {
        if (environmentRef.current !== environment || mutationRef.current !== mutation) {
          inFlightMutationsRef.current = /* @__PURE__ */ new Set();
          if (isMountedRef.current) {
            setMutationInFlight(false);
          }
          environmentRef.current = environment;
          mutationRef.current = mutation;
        }
      }, [environment, isMountedRef, mutation]);
      var commit = useCallback28(function(config2) {
        if (isMountedRef.current) {
          setMutationInFlight(true);
        }
        var disposable = commitMutationFn(environment, (0, _objectSpread210["default"])((0, _objectSpread210["default"])({}, config2), {}, {
          mutation,
          onCompleted: function onCompleted(response, errors) {
            var _config$onCompleted;
            cleanup(disposable);
            (_config$onCompleted = config2.onCompleted) === null || _config$onCompleted === void 0 ? void 0 : _config$onCompleted.call(config2, response, errors);
          },
          onError: function onError(error) {
            var _config$onError;
            cleanup(disposable);
            (_config$onError = config2.onError) === null || _config$onError === void 0 ? void 0 : _config$onError.call(config2, error);
          },
          onUnsubscribe: function onUnsubscribe() {
            var _config$onUnsubscribe;
            cleanup(disposable);
            (_config$onUnsubscribe = config2.onUnsubscribe) === null || _config$onUnsubscribe === void 0 ? void 0 : _config$onUnsubscribe.call(config2);
          },
          onNext: function onNext() {
            var _config$onNext;
            (_config$onNext = config2.onNext) === null || _config$onNext === void 0 ? void 0 : _config$onNext.call(config2);
          }
        }));
        inFlightMutationsRef.current.add(disposable);
        return disposable;
      }, [cleanup, commitMutationFn, environment, isMountedRef, mutation]);
      return [commit, isMutationInFlight];
    }
    module.exports = useMutation3;
  }
});

// node_modules/react-relay/lib/relay-hooks/useIsOperationNodeActive.js
var require_useIsOperationNodeActive = __commonJS({
  "node_modules/react-relay/lib/relay-hooks/useIsOperationNodeActive.js"(exports, module) {
    "use strict";
    var useRelayEnvironment = require_useRelayEnvironment();
    var invariant3 = require_browser();
    var React116 = require_react();
    var _require = require_relay_runtime();
    var getObservableForActiveRequest = _require.__internal.getObservableForActiveRequest;
    var getSelector = _require.getSelector;
    var useEffect30 = React116.useEffect;
    var useState33 = React116.useState;
    var useMemo47 = React116.useMemo;
    function useIsOperationNodeActive(fragmentNode, fragmentRef) {
      var environment = useRelayEnvironment();
      var observable = useMemo47(function() {
        var selector = getSelector(fragmentNode, fragmentRef);
        if (selector == null) {
          return null;
        }
        !(selector.kind === "SingularReaderSelector") ? true ? invariant3(false, "useIsOperationNodeActive: Plural fragments are not supported.") : invariant3(false) : void 0;
        return getObservableForActiveRequest(environment, selector.owner);
      }, [environment, fragmentNode, fragmentRef]);
      var _useState = useState33(observable != null), isActive = _useState[0], setIsActive = _useState[1];
      useEffect30(function() {
        var subscription2;
        setIsActive(observable != null);
        if (observable != null) {
          var onCompleteOrError = function onCompleteOrError2() {
            setIsActive(false);
          };
          subscription2 = observable.subscribe({
            complete: onCompleteOrError,
            error: onCompleteOrError
          });
        }
        return function() {
          if (subscription2) {
            subscription2.unsubscribe();
          }
        };
      }, [observable]);
      return isActive;
    }
    module.exports = useIsOperationNodeActive;
  }
});

// node_modules/react-relay/lib/relay-hooks/useLoadMoreFunction.js
var require_useLoadMoreFunction = __commonJS({
  "node_modules/react-relay/lib/relay-hooks/useLoadMoreFunction.js"(exports, module) {
    "use strict";
    var _interopRequireDefault = require_interopRequireDefault()["default"];
    var _objectSpread210 = _interopRequireDefault(require_objectSpread2());
    var useFetchTrackingRef = require_useFetchTrackingRef();
    var useIsMountedRef = require_useIsMountedRef();
    var useIsOperationNodeActive = require_useIsOperationNodeActive();
    var useRelayEnvironment = require_useRelayEnvironment();
    var invariant3 = require_browser();
    var _require = require_react();
    var useCallback28 = _require.useCallback;
    var useEffect30 = _require.useEffect;
    var useState33 = _require.useState;
    var _require2 = require_relay_runtime();
    var fetchQuery7 = _require2.__internal.fetchQuery;
    var ConnectionInterface = _require2.ConnectionInterface;
    var createOperationDescriptor = _require2.createOperationDescriptor;
    var getPaginationVariables = _require2.getPaginationVariables;
    var getSelector = _require2.getSelector;
    var getValueAtPath = _require2.getValueAtPath;
    var warning2 = require_warning();
    function useLoadMoreFunction(args) {
      var direction = args.direction, fragmentNode = args.fragmentNode, fragmentRef = args.fragmentRef, fragmentIdentifier = args.fragmentIdentifier, fragmentData = args.fragmentData, connectionPathInFragmentData = args.connectionPathInFragmentData, paginationRequest = args.paginationRequest, paginationMetadata = args.paginationMetadata, componentDisplayName = args.componentDisplayName, observer = args.observer, onReset = args.onReset, identifierField = args.identifierField;
      var environment = useRelayEnvironment();
      var _useFetchTrackingRef = useFetchTrackingRef(), isFetchingRef = _useFetchTrackingRef.isFetchingRef, startFetch = _useFetchTrackingRef.startFetch, disposeFetch = _useFetchTrackingRef.disposeFetch, completeFetch = _useFetchTrackingRef.completeFetch;
      var identifierValue = identifierField != null && fragmentData != null && typeof fragmentData === "object" ? fragmentData[identifierField] : null;
      var isMountedRef = useIsMountedRef();
      var _useState = useState33(environment), mirroredEnvironment = _useState[0], setMirroredEnvironment = _useState[1];
      var _useState2 = useState33(fragmentIdentifier), mirroredFragmentIdentifier = _useState2[0], setMirroredFragmentIdentifier = _useState2[1];
      var isParentQueryActive = useIsOperationNodeActive(fragmentNode, fragmentRef);
      var shouldReset = environment !== mirroredEnvironment || fragmentIdentifier !== mirroredFragmentIdentifier;
      if (shouldReset) {
        disposeFetch();
        onReset();
        setMirroredEnvironment(environment);
        setMirroredFragmentIdentifier(fragmentIdentifier);
      }
      var _getConnectionState = getConnectionState(direction, fragmentNode, fragmentData, connectionPathInFragmentData), cursor3 = _getConnectionState.cursor, hasMore = _getConnectionState.hasMore;
      useEffect30(function() {
        return function() {
          disposeFetch();
        };
      }, [disposeFetch]);
      var loadMore = useCallback28(
        function(count2, options) {
          var onComplete = options === null || options === void 0 ? void 0 : options.onComplete;
          if (isMountedRef.current !== true) {
            true ? warning2(false, "Relay: Unexpected fetch on unmounted component for fragment `%s` in `%s`. It looks like some instances of your component are still trying to fetch data but they already unmounted. Please make sure you clear all timers, intervals, async calls, etc that may trigger a fetch.", fragmentNode.name, componentDisplayName) : void 0;
            return {
              dispose: function dispose2() {
              }
            };
          }
          var fragmentSelector = getSelector(fragmentNode, fragmentRef);
          if (isFetchingRef.current === true || fragmentData == null || isParentQueryActive) {
            if (fragmentSelector == null) {
              true ? warning2(false, "Relay: Unexpected fetch while using a null fragment ref for fragment `%s` in `%s`. When fetching more items, we expect initial fragment data to be non-null. Please make sure you're passing a valid fragment ref to `%s` before paginating.", fragmentNode.name, componentDisplayName, componentDisplayName) : void 0;
            }
            if (onComplete) {
              onComplete(null);
            }
            return {
              dispose: function dispose2() {
              }
            };
          }
          !(fragmentSelector != null && fragmentSelector.kind !== "PluralReaderSelector") ? true ? invariant3(false, "Relay: Expected to be able to find a non-plural fragment owner for fragment `%s` when using `%s`. If you're seeing this, this is likely a bug in Relay.", fragmentNode.name, componentDisplayName) : invariant3(false) : void 0;
          var parentVariables = fragmentSelector.owner.variables;
          var fragmentVariables = fragmentSelector.variables;
          var extraVariables = options === null || options === void 0 ? void 0 : options.UNSTABLE_extraVariables;
          var baseVariables = (0, _objectSpread210["default"])((0, _objectSpread210["default"])({}, parentVariables), fragmentVariables);
          var paginationVariables = getPaginationVariables(direction, count2, cursor3, baseVariables, (0, _objectSpread210["default"])({}, extraVariables), paginationMetadata);
          if (identifierField != null) {
            if (typeof identifierValue !== "string") {
              true ? warning2(false, "Relay: Expected result to have a string  `%s` in order to refetch, got `%s`.", identifierField, identifierValue) : void 0;
            }
            paginationVariables.id = identifierValue;
          }
          var paginationQuery = createOperationDescriptor(paginationRequest, paginationVariables, {
            force: true
          });
          fetchQuery7(environment, paginationQuery).subscribe((0, _objectSpread210["default"])((0, _objectSpread210["default"])({}, observer), {}, {
            start: function start(subscription2) {
              startFetch(subscription2);
              observer.start && observer.start(subscription2);
            },
            complete: function complete() {
              completeFetch();
              observer.complete && observer.complete();
              onComplete && onComplete(null);
            },
            error: function error(_error) {
              completeFetch();
              observer.error && observer.error(_error);
              onComplete && onComplete(_error);
            }
          }));
          return {
            dispose: disposeFetch
          };
        },
        // NOTE: We disable react-hooks-deps warning because all values
        // inside paginationMetadata are static
        // eslint-disable-next-line react-hooks/exhaustive-deps
        [environment, identifierValue, direction, cursor3, startFetch, disposeFetch, completeFetch, isFetchingRef, isParentQueryActive, fragmentData, fragmentNode.name, fragmentRef, componentDisplayName]
      );
      return [loadMore, hasMore, disposeFetch];
    }
    function getConnectionState(direction, fragmentNode, fragmentData, connectionPathInFragmentData) {
      var _pageInfo$END_CURSOR, _pageInfo$START_CURSO;
      var _ConnectionInterface$ = ConnectionInterface.get(), EDGES = _ConnectionInterface$.EDGES, PAGE_INFO = _ConnectionInterface$.PAGE_INFO, HAS_NEXT_PAGE = _ConnectionInterface$.HAS_NEXT_PAGE, HAS_PREV_PAGE = _ConnectionInterface$.HAS_PREV_PAGE, END_CURSOR = _ConnectionInterface$.END_CURSOR, START_CURSOR = _ConnectionInterface$.START_CURSOR;
      var connection = getValueAtPath(fragmentData, connectionPathInFragmentData);
      if (connection == null) {
        return {
          cursor: null,
          hasMore: false
        };
      }
      !(typeof connection === "object") ? true ? invariant3(false, "Relay: Expected connection in fragment `%s` to have been `null`, or a plain object with %s and %s properties. Instead got `%s`.", fragmentNode.name, EDGES, PAGE_INFO, connection) : invariant3(false) : void 0;
      var edges = connection[EDGES];
      var pageInfo2 = connection[PAGE_INFO];
      if (edges == null || pageInfo2 == null) {
        return {
          cursor: null,
          hasMore: false
        };
      }
      !Array.isArray(edges) ? true ? invariant3(false, "Relay: Expected connection in fragment `%s` to have a plural `%s` field. Instead got `%s`.", fragmentNode.name, EDGES, edges) : invariant3(false) : void 0;
      !(typeof pageInfo2 === "object") ? true ? invariant3(false, "Relay: Expected connection in fragment `%s` to have a `%s` field. Instead got `%s`.", fragmentNode.name, PAGE_INFO, pageInfo2) : invariant3(false) : void 0;
      var cursor3 = direction === "forward" ? (_pageInfo$END_CURSOR = pageInfo2[END_CURSOR]) !== null && _pageInfo$END_CURSOR !== void 0 ? _pageInfo$END_CURSOR : null : (_pageInfo$START_CURSO = pageInfo2[START_CURSOR]) !== null && _pageInfo$START_CURSO !== void 0 ? _pageInfo$START_CURSO : null;
      !(cursor3 === null || typeof cursor3 === "string") ? true ? invariant3(false, "Relay: Expected page info for connection in fragment `%s` to have a valid `%s`. Instead got `%s`.", fragmentNode.name, START_CURSOR, cursor3) : invariant3(false) : void 0;
      var hasMore;
      if (direction === "forward") {
        hasMore = cursor3 != null && pageInfo2[HAS_NEXT_PAGE] === true;
      } else {
        hasMore = cursor3 != null && pageInfo2[HAS_PREV_PAGE] === true;
      }
      return {
        cursor: cursor3,
        hasMore
      };
    }
    module.exports = useLoadMoreFunction;
  }
});

// node_modules/react-relay/lib/relay-hooks/useQueryLoader.js
var require_useQueryLoader = __commonJS({
  "node_modules/react-relay/lib/relay-hooks/useQueryLoader.js"(exports, module) {
    "use strict";
    var _interopRequireDefault = require_interopRequireDefault()["default"];
    var _createForOfIteratorHelper2 = _interopRequireDefault(require_createForOfIteratorHelper());
    var _require = require_loadQuery();
    var loadQuery = _require.loadQuery;
    var useTrackLoadQueryInRender = _require.useTrackLoadQueryInRender;
    var useIsMountedRef = require_useIsMountedRef();
    var useRelayEnvironment = require_useRelayEnvironment();
    var _require2 = require_react();
    var useCallback28 = _require2.useCallback;
    var useEffect30 = _require2.useEffect;
    var useRef28 = _require2.useRef;
    var useState33 = _require2.useState;
    var _require3 = require_relay_runtime();
    var getRequest = _require3.getRequest;
    var initialNullQueryReferenceState = {
      kind: "NullQueryReference"
    };
    function requestIsLiveQuery(preloadableRequest) {
      if (preloadableRequest.kind === "PreloadableConcreteRequest") {
        return preloadableRequest.params.metadata.live !== void 0;
      }
      var request = getRequest(preloadableRequest);
      return request.params.metadata.live !== void 0;
    }
    function useQueryLoader2(preloadableRequest, initialQueryReference) {
      var initialQueryReferenceInternal = initialQueryReference !== null && initialQueryReference !== void 0 ? initialQueryReference : initialNullQueryReferenceState;
      var environment = useRelayEnvironment();
      useTrackLoadQueryInRender();
      var isMountedRef = useIsMountedRef();
      var undisposedQueryReferencesRef = useRef28(/* @__PURE__ */ new Set([initialQueryReferenceInternal]));
      var _useState = useState33(function() {
        return initialQueryReferenceInternal;
      }), queryReference = _useState[0], setQueryReference = _useState[1];
      var _useState2 = useState33(function() {
        return initialQueryReferenceInternal;
      }), previousInitialQueryReference = _useState2[0], setPreviousInitialQueryReference = _useState2[1];
      if (initialQueryReferenceInternal !== previousInitialQueryReference) {
        undisposedQueryReferencesRef.current.add(initialQueryReferenceInternal);
        setPreviousInitialQueryReference(initialQueryReferenceInternal);
        setQueryReference(initialQueryReferenceInternal);
      }
      var disposeQuery = useCallback28(function() {
        if (isMountedRef.current) {
          undisposedQueryReferencesRef.current.add(initialNullQueryReferenceState);
          setQueryReference(initialNullQueryReferenceState);
        }
      }, [isMountedRef]);
      var queryLoaderCallback = useCallback28(function(variables, options) {
        var mergedOptions = options != null && options.hasOwnProperty("__environment") ? {
          fetchPolicy: options.fetchPolicy,
          networkCacheConfig: options.networkCacheConfig,
          __nameForWarning: options.__nameForWarning
        } : options;
        if (isMountedRef.current) {
          var _options$__environmen;
          var updatedQueryReference = loadQuery((_options$__environmen = options === null || options === void 0 ? void 0 : options.__environment) !== null && _options$__environmen !== void 0 ? _options$__environmen : environment, preloadableRequest, variables, mergedOptions);
          undisposedQueryReferencesRef.current.add(updatedQueryReference);
          setQueryReference(updatedQueryReference);
        }
      }, [environment, preloadableRequest, setQueryReference, isMountedRef]);
      var maybeHiddenOrFastRefresh = useRef28(false);
      useEffect30(function() {
        return function() {
          maybeHiddenOrFastRefresh.current = true;
        };
      }, []);
      useEffect30(function() {
        if (maybeHiddenOrFastRefresh.current === true) {
          maybeHiddenOrFastRefresh.current = false;
          if (queryReference.kind !== "NullQueryReference") {
            queryLoaderCallback(queryReference.variables, {
              fetchPolicy: queryReference.fetchPolicy,
              networkCacheConfig: queryReference.networkCacheConfig
            });
          }
          return;
        }
        var undisposedQueryReferences = undisposedQueryReferencesRef.current;
        if (isMountedRef.current) {
          var _iterator = (0, _createForOfIteratorHelper2["default"])(undisposedQueryReferences), _step;
          try {
            for (_iterator.s(); !(_step = _iterator.n()).done; ) {
              var undisposedQueryReference = _step.value;
              if (undisposedQueryReference === queryReference) {
                break;
              }
              undisposedQueryReferences["delete"](undisposedQueryReference);
              if (undisposedQueryReference.kind !== "NullQueryReference") {
                if (requestIsLiveQuery(preloadableRequest)) {
                  undisposedQueryReference.dispose && undisposedQueryReference.dispose();
                } else {
                  undisposedQueryReference.releaseQuery && undisposedQueryReference.releaseQuery();
                }
              }
            }
          } catch (err) {
            _iterator.e(err);
          } finally {
            _iterator.f();
          }
        }
      }, [queryReference, isMountedRef, queryLoaderCallback, preloadableRequest]);
      useEffect30(function() {
        return function disposeAllRemainingQueryReferences() {
          var _iterator2 = (0, _createForOfIteratorHelper2["default"])(undisposedQueryReferencesRef.current), _step2;
          try {
            for (_iterator2.s(); !(_step2 = _iterator2.n()).done; ) {
              var undisposedQueryReference = _step2.value;
              if (undisposedQueryReference.kind !== "NullQueryReference") {
                if (requestIsLiveQuery(preloadableRequest)) {
                  undisposedQueryReference.dispose && undisposedQueryReference.dispose();
                } else {
                  undisposedQueryReference.releaseQuery && undisposedQueryReference.releaseQuery();
                }
              }
            }
          } catch (err) {
            _iterator2.e(err);
          } finally {
            _iterator2.f();
          }
        };
      }, [preloadableRequest]);
      return [queryReference.kind === "NullQueryReference" ? null : queryReference, queryLoaderCallback, disposeQuery];
    }
    module.exports = useQueryLoader2;
  }
});

// node_modules/react-relay/lib/relay-hooks/useRefetchableFragmentNode.js
var require_useRefetchableFragmentNode = __commonJS({
  "node_modules/react-relay/lib/relay-hooks/useRefetchableFragmentNode.js"(exports, module) {
    "use strict";
    var _interopRequireDefault = require_interopRequireDefault()["default"];
    var _objectSpread210 = _interopRequireDefault(require_objectSpread2());
    var _require = require_FragmentResource();
    var getFragmentResourceForEnvironment = _require.getFragmentResourceForEnvironment;
    var ProfilerContext = require_ProfilerContext();
    var _require2 = require_QueryResource();
    var getQueryResourceForEnvironment = _require2.getQueryResourceForEnvironment;
    var useFragmentNode = require_useFragmentNode();
    var useIsMountedRef = require_useIsMountedRef();
    var useQueryLoader2 = require_useQueryLoader();
    var useRelayEnvironment = require_useRelayEnvironment();
    var invariant3 = require_browser();
    var _require3 = require_react();
    var useCallback28 = _require3.useCallback;
    var useContext17 = _require3.useContext;
    var useReducer2 = _require3.useReducer;
    var _require4 = require_relay_runtime();
    var fetchQuery7 = _require4.__internal.fetchQuery;
    var createOperationDescriptor = _require4.createOperationDescriptor;
    var getFragmentIdentifier = _require4.getFragmentIdentifier;
    var getRefetchMetadata = _require4.getRefetchMetadata;
    var getSelector = _require4.getSelector;
    var getValueAtPath = _require4.getValueAtPath;
    var warning2 = require_warning();
    function reducer(state, action) {
      switch (action.type) {
        case "refetch": {
          var _action$refetchEnviro;
          return (0, _objectSpread210["default"])((0, _objectSpread210["default"])({}, state), {}, {
            fetchPolicy: action.fetchPolicy,
            mirroredEnvironment: (_action$refetchEnviro = action.refetchEnvironment) !== null && _action$refetchEnviro !== void 0 ? _action$refetchEnviro : state.mirroredEnvironment,
            onComplete: action.onComplete,
            refetchEnvironment: action.refetchEnvironment,
            refetchQuery: action.refetchQuery,
            renderPolicy: action.renderPolicy
          });
        }
        case "reset": {
          return {
            fetchPolicy: void 0,
            mirroredEnvironment: action.environment,
            mirroredFragmentIdentifier: action.fragmentIdentifier,
            onComplete: void 0,
            refetchQuery: null,
            renderPolicy: void 0
          };
        }
        default: {
          action.type;
          throw new Error("useRefetchableFragmentNode: Unexpected action type");
        }
      }
    }
    function useRefetchableFragmentNode(fragmentNode, parentFragmentRef, componentDisplayName) {
      var parentEnvironment = useRelayEnvironment();
      var _getRefetchMetadata = getRefetchMetadata(fragmentNode, componentDisplayName), refetchableRequest = _getRefetchMetadata.refetchableRequest, fragmentRefPathInResponse = _getRefetchMetadata.fragmentRefPathInResponse, identifierField = _getRefetchMetadata.identifierField;
      var fragmentIdentifier = getFragmentIdentifier(fragmentNode, parentFragmentRef);
      var _useReducer = useReducer2(reducer, {
        fetchPolicy: void 0,
        mirroredEnvironment: parentEnvironment,
        mirroredFragmentIdentifier: fragmentIdentifier,
        onComplete: void 0,
        refetchEnvironment: null,
        refetchQuery: null,
        renderPolicy: void 0
      }), refetchState = _useReducer[0], dispatch = _useReducer[1];
      var fetchPolicy = refetchState.fetchPolicy, mirroredEnvironment = refetchState.mirroredEnvironment, mirroredFragmentIdentifier = refetchState.mirroredFragmentIdentifier, onComplete = refetchState.onComplete, refetchEnvironment = refetchState.refetchEnvironment, refetchQuery = refetchState.refetchQuery, renderPolicy = refetchState.renderPolicy;
      var environment = refetchEnvironment !== null && refetchEnvironment !== void 0 ? refetchEnvironment : parentEnvironment;
      var QueryResource = getQueryResourceForEnvironment(environment);
      var FragmentResource = getFragmentResourceForEnvironment(environment);
      var profilerContext = useContext17(ProfilerContext);
      var shouldReset = environment !== mirroredEnvironment || fragmentIdentifier !== mirroredFragmentIdentifier;
      var _useQueryLoader = useQueryLoader2(refetchableRequest), queryRef = _useQueryLoader[0], loadQuery = _useQueryLoader[1], disposeQuery = _useQueryLoader[2];
      var fragmentRef = parentFragmentRef;
      if (shouldReset) {
        dispatch({
          type: "reset",
          environment,
          fragmentIdentifier
        });
        disposeQuery();
      } else if (refetchQuery != null && queryRef != null) {
        var debugPreviousIDAndTypename;
        if (true) {
          debugPreviousIDAndTypename = debugFunctions.getInitialIDAndType(refetchQuery.request.variables, fragmentRefPathInResponse, environment);
        }
        var handleQueryCompleted = function handleQueryCompleted2(maybeError) {
          onComplete && onComplete(maybeError !== null && maybeError !== void 0 ? maybeError : null);
        };
        var fetchObservable = queryRef.source != null ? queryRef.source : fetchQuery7(environment, refetchQuery);
        var queryResult = profilerContext.wrapPrepareQueryResource(function() {
          return QueryResource.prepare(refetchQuery, fetchObservable, fetchPolicy, renderPolicy, {
            error: handleQueryCompleted,
            complete: function complete() {
              if (true) {
                debugFunctions.checkSameTypeAfterRefetch(debugPreviousIDAndTypename, environment, fragmentNode, componentDisplayName);
              }
              handleQueryCompleted();
            }
          }, queryRef.fetchKey, profilerContext);
        });
        var queryData = FragmentResource.read(queryResult.fragmentNode, queryResult.fragmentRef, componentDisplayName).data;
        !(queryData != null) ? true ? invariant3(false, "Relay: Expected to be able to read refetch query response. If you're seeing this, this is likely a bug in Relay.") : invariant3(false) : void 0;
        var refetchedFragmentRef = getValueAtPath(queryData, fragmentRefPathInResponse);
        fragmentRef = refetchedFragmentRef;
        if (true) {
          debugFunctions.checkSameIDAfterRefetch(debugPreviousIDAndTypename, fragmentRef, fragmentNode, componentDisplayName);
        }
      }
      var _useFragmentNode = useFragmentNode(fragmentNode, fragmentRef, componentDisplayName), fragmentData = _useFragmentNode.data, disableStoreUpdates = _useFragmentNode.disableStoreUpdates, enableStoreUpdates = _useFragmentNode.enableStoreUpdates;
      var refetch = useRefetchFunction(componentDisplayName, dispatch, disposeQuery, fragmentData, fragmentIdentifier, fragmentNode, fragmentRefPathInResponse, identifierField, loadQuery, parentFragmentRef, refetchableRequest);
      return {
        fragmentData,
        fragmentRef,
        refetch,
        disableStoreUpdates,
        enableStoreUpdates
      };
    }
    function useRefetchFunction(componentDisplayName, dispatch, disposeQuery, fragmentData, fragmentIdentifier, fragmentNode, fragmentRefPathInResponse, identifierField, loadQuery, parentFragmentRef, refetchableRequest) {
      var isMountedRef = useIsMountedRef();
      var identifierValue = identifierField != null && fragmentData != null && typeof fragmentData === "object" ? fragmentData[identifierField] : null;
      return useCallback28(
        function(providedRefetchVariables, options) {
          if (isMountedRef.current !== true) {
            true ? warning2(false, "Relay: Unexpected call to `refetch` on unmounted component for fragment `%s` in `%s`. It looks like some instances of your component are still trying to fetch data but they already unmounted. Please make sure you clear all timers, intervals, async calls, etc that may trigger a fetch.", fragmentNode.name, componentDisplayName) : void 0;
            return {
              dispose: function dispose2() {
              }
            };
          }
          if (parentFragmentRef == null) {
            true ? warning2(false, "Relay: Unexpected call to `refetch` while using a null fragment ref for fragment `%s` in `%s`. When calling `refetch`, we expect initial fragment data to be non-null. Please make sure you're passing a valid fragment ref to `%s` before calling `refetch`, or make sure you pass all required variables to `refetch`.", fragmentNode.name, componentDisplayName, componentDisplayName) : void 0;
          }
          var refetchEnvironment = options === null || options === void 0 ? void 0 : options.__environment;
          var fetchPolicy = options === null || options === void 0 ? void 0 : options.fetchPolicy;
          var renderPolicy = options === null || options === void 0 ? void 0 : options.UNSTABLE_renderPolicy;
          var onComplete = options === null || options === void 0 ? void 0 : options.onComplete;
          var fragmentSelector = getSelector(fragmentNode, parentFragmentRef);
          var parentVariables;
          var fragmentVariables;
          if (fragmentSelector == null) {
            parentVariables = {};
            fragmentVariables = {};
          } else if (fragmentSelector.kind === "PluralReaderSelector") {
            var _fragmentSelector$sel, _fragmentSelector$sel2, _fragmentSelector$sel3, _fragmentSelector$sel4;
            parentVariables = (_fragmentSelector$sel = (_fragmentSelector$sel2 = fragmentSelector.selectors[0]) === null || _fragmentSelector$sel2 === void 0 ? void 0 : _fragmentSelector$sel2.owner.variables) !== null && _fragmentSelector$sel !== void 0 ? _fragmentSelector$sel : {};
            fragmentVariables = (_fragmentSelector$sel3 = (_fragmentSelector$sel4 = fragmentSelector.selectors[0]) === null || _fragmentSelector$sel4 === void 0 ? void 0 : _fragmentSelector$sel4.variables) !== null && _fragmentSelector$sel3 !== void 0 ? _fragmentSelector$sel3 : {};
          } else {
            parentVariables = fragmentSelector.owner.variables;
            fragmentVariables = fragmentSelector.variables;
          }
          var refetchVariables = (0, _objectSpread210["default"])((0, _objectSpread210["default"])((0, _objectSpread210["default"])({}, parentVariables), fragmentVariables), providedRefetchVariables);
          if (identifierField != null && !providedRefetchVariables.hasOwnProperty("id")) {
            if (typeof identifierValue !== "string") {
              true ? warning2(false, "Relay: Expected result to have a string  `%s` in order to refetch, got `%s`.", identifierField, identifierValue) : void 0;
            }
            refetchVariables.id = identifierValue;
          }
          var refetchQuery = createOperationDescriptor(refetchableRequest, refetchVariables, {
            force: true
          });
          loadQuery(refetchQuery.request.variables, {
            fetchPolicy,
            __environment: refetchEnvironment,
            __nameForWarning: "refetch"
          });
          dispatch({
            type: "refetch",
            fetchPolicy,
            onComplete,
            refetchEnvironment,
            refetchQuery,
            renderPolicy
          });
          return {
            dispose: disposeQuery
          };
        },
        // NOTE: We disable react-hooks-deps warning because:
        //   - We know fragmentRefPathInResponse is static, so it can be omitted from
        //     deps
        //   - We know fragmentNode is static, so it can be omitted from deps.
        //   - fragmentNode and parentFragmentRef are also captured by including
        //     fragmentIdentifier
        // eslint-disable-next-line react-hooks/exhaustive-deps
        [fragmentIdentifier, dispatch, disposeQuery, identifierValue, loadQuery]
      );
    }
    var debugFunctions;
    if (true) {
      debugFunctions = {
        getInitialIDAndType: function getInitialIDAndType(memoRefetchVariables, fragmentRefPathInResponse, environment) {
          var _require5 = require_relay_runtime(), Record = _require5.Record;
          var id2 = memoRefetchVariables === null || memoRefetchVariables === void 0 ? void 0 : memoRefetchVariables.id;
          if (fragmentRefPathInResponse.length !== 1 || fragmentRefPathInResponse[0] !== "node" || id2 == null) {
            return null;
          }
          var recordSource = environment.getStore().getSource();
          var record = recordSource.get(id2);
          var typename = record && Record.getType(record);
          if (typename == null) {
            return null;
          }
          return {
            id: id2,
            typename
          };
        },
        checkSameTypeAfterRefetch: function checkSameTypeAfterRefetch(previousIDAndType, environment, fragmentNode, componentDisplayName) {
          var _require6 = require_relay_runtime(), Record = _require6.Record;
          if (!previousIDAndType) {
            return;
          }
          var recordSource = environment.getStore().getSource();
          var record = recordSource.get(previousIDAndType.id);
          var typename = record && Record.getType(record);
          if (typename !== previousIDAndType.typename) {
            true ? warning2(false, "Relay: Call to `refetch` returned data with a different __typename: was `%s`, now `%s`, on `%s` in `%s`. Please make sure the server correctly implementsunique id requirement.", previousIDAndType.typename, typename, fragmentNode.name, componentDisplayName) : void 0;
          }
        },
        checkSameIDAfterRefetch: function checkSameIDAfterRefetch(previousIDAndTypename, refetchedFragmentRef, fragmentNode, componentDisplayName) {
          if (previousIDAndTypename == null) {
            return;
          }
          var _require7 = require_relay_runtime(), ID_KEY = _require7.ID_KEY;
          var resultID = refetchedFragmentRef[ID_KEY];
          if (resultID != null && resultID !== previousIDAndTypename.id) {
            true ? warning2(false, "Relay: Call to `refetch` returned a different id, expected `%s`, got `%s`, on `%s` in `%s`. Please make sure the server correctly implements unique id requirement.", resultID, previousIDAndTypename.id, fragmentNode.name, componentDisplayName) : void 0;
          }
        }
      };
    }
    module.exports = useRefetchableFragmentNode;
  }
});

// node_modules/react-relay/lib/relay-hooks/usePaginationFragment.js
var require_usePaginationFragment = __commonJS({
  "node_modules/react-relay/lib/relay-hooks/usePaginationFragment.js"(exports, module) {
    "use strict";
    var _interopRequireDefault = require_interopRequireDefault()["default"];
    var _objectSpread210 = _interopRequireDefault(require_objectSpread2());
    var HooksImplementation = require_HooksImplementation();
    var useLoadMoreFunction = require_useLoadMoreFunction();
    var useRefetchableFragmentNode = require_useRefetchableFragmentNode();
    var useStaticFragmentNodeWarning = require_useStaticFragmentNodeWarning();
    var _require = require_react();
    var useCallback28 = _require.useCallback;
    var useDebugValue3 = _require.useDebugValue;
    var useState33 = _require.useState;
    var _require2 = require_relay_runtime();
    var getFragment = _require2.getFragment;
    var getFragmentIdentifier = _require2.getFragmentIdentifier;
    var getPaginationMetadata = _require2.getPaginationMetadata;
    function usePaginationFragment_LEGACY(fragmentInput, parentFragmentRef) {
      var fragmentNode = getFragment(fragmentInput);
      useStaticFragmentNodeWarning(fragmentNode, "first argument of usePaginationFragment()");
      var componentDisplayName = "usePaginationFragment()";
      var _getPaginationMetadat = getPaginationMetadata(fragmentNode, componentDisplayName), connectionPathInFragmentData = _getPaginationMetadat.connectionPathInFragmentData, paginationRequest = _getPaginationMetadat.paginationRequest, paginationMetadata = _getPaginationMetadat.paginationMetadata, identifierField = _getPaginationMetadat.identifierField;
      var _useRefetchableFragme = useRefetchableFragmentNode(fragmentNode, parentFragmentRef, componentDisplayName), fragmentData = _useRefetchableFragme.fragmentData, fragmentRef = _useRefetchableFragme.fragmentRef, refetch = _useRefetchableFragme.refetch;
      var fragmentIdentifier = getFragmentIdentifier(fragmentNode, fragmentRef);
      var _useLoadMore = useLoadMore({
        componentDisplayName,
        connectionPathInFragmentData,
        direction: "backward",
        fragmentData,
        fragmentIdentifier,
        fragmentNode,
        fragmentRef,
        identifierField,
        paginationMetadata,
        paginationRequest
      }), loadPrevious = _useLoadMore[0], hasPrevious = _useLoadMore[1], isLoadingPrevious = _useLoadMore[2], disposeFetchPrevious = _useLoadMore[3];
      var _useLoadMore2 = useLoadMore({
        componentDisplayName,
        connectionPathInFragmentData,
        direction: "forward",
        fragmentData,
        fragmentIdentifier,
        fragmentNode,
        fragmentRef,
        identifierField,
        paginationMetadata,
        paginationRequest
      }), loadNext = _useLoadMore2[0], hasNext = _useLoadMore2[1], isLoadingNext = _useLoadMore2[2], disposeFetchNext = _useLoadMore2[3];
      var refetchPagination = useCallback28(function(variables, options) {
        disposeFetchNext();
        disposeFetchPrevious();
        return refetch(variables, (0, _objectSpread210["default"])((0, _objectSpread210["default"])({}, options), {}, {
          __environment: void 0
        }));
      }, [disposeFetchNext, disposeFetchPrevious, refetch]);
      if (true) {
        useDebugValue3({
          fragment: fragmentNode.name,
          data: fragmentData,
          hasNext,
          isLoadingNext,
          hasPrevious,
          isLoadingPrevious
        });
      }
      return {
        data: fragmentData,
        loadNext,
        loadPrevious,
        hasNext,
        hasPrevious,
        isLoadingNext,
        isLoadingPrevious,
        refetch: refetchPagination
      };
    }
    function useLoadMore(args) {
      var _useState = useState33(false), isLoadingMore = _useState[0], setIsLoadingMore = _useState[1];
      var observer = {
        start: function start() {
          return setIsLoadingMore(true);
        },
        complete: function complete() {
          return setIsLoadingMore(false);
        },
        error: function error() {
          return setIsLoadingMore(false);
        }
      };
      var handleReset = function handleReset2() {
        return setIsLoadingMore(false);
      };
      var _useLoadMoreFunction = useLoadMoreFunction((0, _objectSpread210["default"])((0, _objectSpread210["default"])({}, args), {}, {
        observer,
        onReset: handleReset
      })), loadMore = _useLoadMoreFunction[0], hasMore = _useLoadMoreFunction[1], disposeFetch = _useLoadMoreFunction[2];
      return [loadMore, hasMore, isLoadingMore, disposeFetch];
    }
    function usePaginationFragment5(fragmentInput, parentFragmentRef) {
      var impl = HooksImplementation.get();
      if (impl) {
        return impl.usePaginationFragment(fragmentInput, parentFragmentRef);
      } else {
        return usePaginationFragment_LEGACY(fragmentInput, parentFragmentRef);
      }
    }
    module.exports = usePaginationFragment5;
  }
});

// node_modules/react-relay/lib/relay-hooks/usePreloadedQuery.js
var require_usePreloadedQuery = __commonJS({
  "node_modules/react-relay/lib/relay-hooks/usePreloadedQuery.js"(exports, module) {
    "use strict";
    var _require = require_loadQuery();
    var useTrackLoadQueryInRender = _require.useTrackLoadQueryInRender;
    var useLazyLoadQueryNode = require_useLazyLoadQueryNode();
    var useMemoOperationDescriptor = require_useMemoOperationDescriptor();
    var useRelayEnvironment = require_useRelayEnvironment();
    var invariant3 = require_browser();
    var _require2 = require_react();
    var useDebugValue3 = _require2.useDebugValue;
    var _require3 = require_relay_runtime();
    var _require3$__internal = _require3.__internal;
    var fetchQueryDeduped = _require3$__internal.fetchQueryDeduped;
    var fetchQuery7 = _require3$__internal.fetchQuery;
    var warning2 = require_warning();
    function usePreloadedQuery2(gqlQuery, preloadedQuery, options) {
      useTrackLoadQueryInRender();
      var environment = useRelayEnvironment();
      var fetchKey = preloadedQuery.fetchKey, fetchPolicy = preloadedQuery.fetchPolicy, source = preloadedQuery.source, variables = preloadedQuery.variables, networkCacheConfig = preloadedQuery.networkCacheConfig;
      var operation = useMemoOperationDescriptor(gqlQuery, variables, networkCacheConfig);
      var useLazyLoadQueryNodeParams;
      if (preloadedQuery.kind === "PreloadedQuery_DEPRECATED") {
        !(operation.request.node.params.name === preloadedQuery.name) ? true ? invariant3(false, "usePreloadedQuery(): Expected data to be prefetched for query `%s`, got prefetch results for query `%s`.", operation.request.node.params.name, preloadedQuery.name) : invariant3(false) : void 0;
        useLazyLoadQueryNodeParams = {
          componentDisplayName: "usePreloadedQuery()",
          fetchKey,
          fetchObservable: fetchQueryDeduped(environment, operation.request.identifier, function() {
            if (environment === preloadedQuery.environment && source != null) {
              return environment.executeWithSource({
                operation,
                source
              });
            } else {
              return environment.execute({
                operation
              });
            }
          }),
          fetchPolicy,
          query: operation,
          renderPolicy: options === null || options === void 0 ? void 0 : options.UNSTABLE_renderPolicy
        };
      } else {
        true ? warning2(preloadedQuery.isDisposed === false, "usePreloadedQuery(): Expected preloadedQuery to not be disposed yet. This is because disposing the query marks it for future garbage collection, and as such query results may no longer be present in the Relay store. In the future, this will become a hard error.") : void 0;
        var fallbackFetchObservable = fetchQuery7(environment, operation);
        var fetchObservable;
        if (source != null && environment === preloadedQuery.environment) {
          fetchObservable = source.ifEmpty(fallbackFetchObservable);
        } else if (environment !== preloadedQuery.environment) {
          true ? warning2(false, "usePreloadedQuery(): usePreloadedQuery was passed a preloaded query that was created with a different environment than the one that is currently in context. In the future, this will become a hard error.") : void 0;
          fetchObservable = fallbackFetchObservable;
        } else {
          fetchObservable = fallbackFetchObservable;
        }
        useLazyLoadQueryNodeParams = {
          componentDisplayName: "usePreloadedQuery()",
          fetchObservable,
          fetchKey,
          fetchPolicy,
          query: operation,
          renderPolicy: options === null || options === void 0 ? void 0 : options.UNSTABLE_renderPolicy
        };
      }
      var data = useLazyLoadQueryNode(useLazyLoadQueryNodeParams);
      if (true) {
        useDebugValue3({
          query: preloadedQuery.name,
          variables: preloadedQuery.variables,
          data,
          fetchKey,
          fetchPolicy,
          renderPolicy: options === null || options === void 0 ? void 0 : options.UNSTABLE_renderPolicy
        });
      }
      return data;
    }
    module.exports = usePreloadedQuery2;
  }
});

// node_modules/react-relay/lib/relay-hooks/useRefetchableFragment.js
var require_useRefetchableFragment = __commonJS({
  "node_modules/react-relay/lib/relay-hooks/useRefetchableFragment.js"(exports, module) {
    "use strict";
    var HooksImplementation = require_HooksImplementation();
    var useRefetchableFragmentNode = require_useRefetchableFragmentNode();
    var useStaticFragmentNodeWarning = require_useStaticFragmentNodeWarning();
    var _require = require_react();
    var useDebugValue3 = _require.useDebugValue;
    var _require2 = require_relay_runtime();
    var getFragment = _require2.getFragment;
    function useRefetchableFragment_LEGACY(fragmentInput, fragmentRef) {
      var fragmentNode = getFragment(fragmentInput);
      useStaticFragmentNodeWarning(fragmentNode, "first argument of useRefetchableFragment()");
      var _useRefetchableFragme = useRefetchableFragmentNode(fragmentNode, fragmentRef, "useRefetchableFragment()"), fragmentData = _useRefetchableFragme.fragmentData, refetch = _useRefetchableFragme.refetch;
      if (true) {
        useDebugValue3({
          fragment: fragmentNode.name,
          data: fragmentData
        });
      }
      return [fragmentData, refetch];
    }
    function useRefetchableFragment5(fragmentInput, parentFragmentRef) {
      var impl = HooksImplementation.get();
      if (impl) {
        return impl.useRefetchableFragment(fragmentInput, parentFragmentRef);
      } else {
        return useRefetchableFragment_LEGACY(fragmentInput, parentFragmentRef);
      }
    }
    module.exports = useRefetchableFragment5;
  }
});

// node_modules/react-relay/lib/relay-hooks/useSubscribeToInvalidationState.js
var require_useSubscribeToInvalidationState = __commonJS({
  "node_modules/react-relay/lib/relay-hooks/useSubscribeToInvalidationState.js"(exports, module) {
    "use strict";
    var useRelayEnvironment = require_useRelayEnvironment();
    var _require = require_react();
    var useEffect30 = _require.useEffect;
    var useRef28 = _require.useRef;
    function useSubscribeToInvalidationState(dataIDs, callback) {
      var environment = useRelayEnvironment();
      var disposableRef = useRef28(null);
      var stableDataIDs = Array.from(dataIDs).sort().join("");
      useEffect30(function() {
        var store = environment.getStore();
        var invalidationState = store.lookupInvalidationState(dataIDs);
        var disposable = store.subscribeToInvalidationState(invalidationState, callback);
        disposableRef.current = disposable;
        return function() {
          return disposable.dispose();
        };
      }, [stableDataIDs, callback, environment]);
      return {
        dispose: function dispose2() {
          if (disposableRef.current != null) {
            disposableRef.current.dispose();
          }
        }
      };
    }
    module.exports = useSubscribeToInvalidationState;
  }
});

// node_modules/react-relay/lib/relay-hooks/useSubscription.js
var require_useSubscription = __commonJS({
  "node_modules/react-relay/lib/relay-hooks/useSubscription.js"(exports, module) {
    "use strict";
    var useRelayEnvironment = require_useRelayEnvironment();
    var _require = require_react();
    var useEffect30 = _require.useEffect;
    var _require2 = require_relay_runtime();
    var requestSubscription = _require2.requestSubscription;
    function useSubscription(config2, requestSubscriptionFn) {
      var actualRequestSubscription = requestSubscriptionFn !== null && requestSubscriptionFn !== void 0 ? requestSubscriptionFn : requestSubscription;
      var environment = useRelayEnvironment();
      useEffect30(function() {
        var _actualRequestSubscri = actualRequestSubscription(environment, config2), dispose2 = _actualRequestSubscri.dispose;
        return dispose2;
      }, [environment, config2, actualRequestSubscription]);
    }
    module.exports = useSubscription;
  }
});

// node_modules/react-relay/lib/index.js
var require_lib2 = __commonJS({
  "node_modules/react-relay/lib/index.js"(exports, module) {
    "use strict";
    var ReactRelayContext = require_ReactRelayContext();
    var ReactRelayFragmentContainer = require_ReactRelayFragmentContainer();
    var ReactRelayLocalQueryRenderer = require_ReactRelayLocalQueryRenderer();
    var ReactRelayPaginationContainer = require_ReactRelayPaginationContainer();
    var ReactRelayQueryRenderer = require_ReactRelayQueryRenderer();
    var ReactRelayRefetchContainer = require_ReactRelayRefetchContainer();
    var EntryPointContainer = require_EntryPointContainer_react();
    var loadEntryPoint = require_loadEntryPoint();
    var _require = require_loadQuery();
    var loadQuery = _require.loadQuery;
    var ProfilerContext = require_ProfilerContext();
    var RelayEnvironmentProvider2 = require_RelayEnvironmentProvider();
    var useClientQuery = require_useClientQuery();
    var useEntryPointLoader = require_useEntryPointLoader();
    var useFragment10 = require_useFragment();
    var useLazyLoadQuery18 = require_useLazyLoadQuery();
    var useMutation3 = require_useMutation();
    var usePaginationFragment5 = require_usePaginationFragment();
    var usePreloadedQuery2 = require_usePreloadedQuery();
    var useQueryLoader2 = require_useQueryLoader();
    var useRefetchableFragment5 = require_useRefetchableFragment();
    var useRelayEnvironment = require_useRelayEnvironment();
    var useSubscribeToInvalidationState = require_useSubscribeToInvalidationState();
    var useSubscription = require_useSubscription();
    var RelayRuntime = require_relay_runtime();
    module.exports = {
      ConnectionHandler: RelayRuntime.ConnectionHandler,
      QueryRenderer: ReactRelayQueryRenderer,
      LocalQueryRenderer: ReactRelayLocalQueryRenderer,
      MutationTypes: RelayRuntime.MutationTypes,
      RangeOperations: RelayRuntime.RangeOperations,
      ReactRelayContext,
      applyOptimisticMutation: RelayRuntime.applyOptimisticMutation,
      commitLocalUpdate: RelayRuntime.commitLocalUpdate,
      commitMutation: RelayRuntime.commitMutation,
      createFragmentContainer: ReactRelayFragmentContainer.createContainer,
      createPaginationContainer: ReactRelayPaginationContainer.createContainer,
      createRefetchContainer: ReactRelayRefetchContainer.createContainer,
      fetchQuery_DEPRECATED: RelayRuntime.fetchQuery_DEPRECATED,
      graphql: RelayRuntime.graphql,
      readInlineData: RelayRuntime.readInlineData,
      requestSubscription: RelayRuntime.requestSubscription,
      // Relay Hooks
      EntryPointContainer,
      RelayEnvironmentProvider: RelayEnvironmentProvider2,
      ProfilerContext,
      fetchQuery: RelayRuntime.fetchQuery,
      loadQuery,
      loadEntryPoint,
      useClientQuery,
      useFragment: useFragment10,
      useLazyLoadQuery: useLazyLoadQuery18,
      useEntryPointLoader,
      useQueryLoader: useQueryLoader2,
      useMutation: useMutation3,
      usePaginationFragment: usePaginationFragment5,
      usePreloadedQuery: usePreloadedQuery2,
      useRefetchableFragment: useRefetchableFragment5,
      useRelayEnvironment,
      useSubscribeToInvalidationState,
      useSubscription
    };
  }
});

// node_modules/react-relay/index.js
var require_react_relay = __commonJS({
  "node_modules/react-relay/index.js"(exports, module) {
    module.exports = require_lib2();
  }
});

// node_modules/react-is/cjs/react-is.development.js
var require_react_is_development = __commonJS({
  "node_modules/react-is/cjs/react-is.development.js"(exports) {
    "use strict";
    if (true) {
      (function() {
        "use strict";
        var hasSymbol = typeof Symbol === "function" && Symbol.for;
        var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for("react.element") : 60103;
        var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for("react.portal") : 60106;
        var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for("react.fragment") : 60107;
        var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for("react.strict_mode") : 60108;
        var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for("react.profiler") : 60114;
        var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for("react.provider") : 60109;
        var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for("react.context") : 60110;
        var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for("react.async_mode") : 60111;
        var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for("react.concurrent_mode") : 60111;
        var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for("react.forward_ref") : 60112;
        var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for("react.suspense") : 60113;
        var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for("react.suspense_list") : 60120;
        var REACT_MEMO_TYPE = hasSymbol ? Symbol.for("react.memo") : 60115;
        var REACT_LAZY_TYPE = hasSymbol ? Symbol.for("react.lazy") : 60116;
        var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for("react.block") : 60121;
        var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for("react.fundamental") : 60117;
        var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for("react.responder") : 60118;
        var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for("react.scope") : 60119;
        function isValidElementType(type) {
          return typeof type === "string" || typeof type === "function" || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
          type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === "object" && type !== null && (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_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
        }
        function typeOf(object) {
          if (typeof object === "object" && object !== null) {
            var $$typeof = object.$$typeof;
            switch ($$typeof) {
              case REACT_ELEMENT_TYPE:
                var type = object.type;
                switch (type) {
                  case REACT_ASYNC_MODE_TYPE:
                  case REACT_CONCURRENT_MODE_TYPE:
                  case REACT_FRAGMENT_TYPE:
                  case REACT_PROFILER_TYPE:
                  case REACT_STRICT_MODE_TYPE:
                  case REACT_SUSPENSE_TYPE:
                    return type;
                  default:
                    var $$typeofType = type && type.$$typeof;
                    switch ($$typeofType) {
                      case REACT_CONTEXT_TYPE:
                      case REACT_FORWARD_REF_TYPE:
                      case REACT_LAZY_TYPE:
                      case REACT_MEMO_TYPE:
                      case REACT_PROVIDER_TYPE:
                        return $$typeofType;
                      default:
                        return $$typeof;
                    }
                }
              case REACT_PORTAL_TYPE:
                return $$typeof;
            }
          }
          return void 0;
        }
        var AsyncMode = REACT_ASYNC_MODE_TYPE;
        var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
        var ContextConsumer = REACT_CONTEXT_TYPE;
        var ContextProvider = REACT_PROVIDER_TYPE;
        var Element2 = REACT_ELEMENT_TYPE;
        var ForwardRef = REACT_FORWARD_REF_TYPE;
        var Fragment9 = REACT_FRAGMENT_TYPE;
        var Lazy = REACT_LAZY_TYPE;
        var Memo = REACT_MEMO_TYPE;
        var Portal = REACT_PORTAL_TYPE;
        var Profiler = REACT_PROFILER_TYPE;
        var StrictMode = REACT_STRICT_MODE_TYPE;
        var Suspense9 = REACT_SUSPENSE_TYPE;
        var hasWarnedAboutDeprecatedIsAsyncMode = false;
        function isAsyncMode(object) {
          {
            if (!hasWarnedAboutDeprecatedIsAsyncMode) {
              hasWarnedAboutDeprecatedIsAsyncMode = true;
              console["warn"]("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.");
            }
          }
          return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
        }
        function isConcurrentMode(object) {
          return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
        }
        function isContextConsumer(object) {
          return typeOf(object) === REACT_CONTEXT_TYPE;
        }
        function isContextProvider(object) {
          return typeOf(object) === REACT_PROVIDER_TYPE;
        }
        function isElement(object) {
          return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
        }
        function isForwardRef(object) {
          return typeOf(object) === REACT_FORWARD_REF_TYPE;
        }
        function isFragment2(object) {
          return typeOf(object) === REACT_FRAGMENT_TYPE;
        }
        function isLazy(object) {
          return typeOf(object) === REACT_LAZY_TYPE;
        }
        function isMemo(object) {
          return typeOf(object) === REACT_MEMO_TYPE;
        }
        function isPortal(object) {
          return typeOf(object) === REACT_PORTAL_TYPE;
        }
        function isProfiler(object) {
          return typeOf(object) === REACT_PROFILER_TYPE;
        }
        function isStrictMode(object) {
          return typeOf(object) === REACT_STRICT_MODE_TYPE;
        }
        function isSuspense(object) {
          return typeOf(object) === REACT_SUSPENSE_TYPE;
        }
        exports.AsyncMode = AsyncMode;
        exports.ConcurrentMode = ConcurrentMode;
        exports.ContextConsumer = ContextConsumer;
        exports.ContextProvider = ContextProvider;
        exports.Element = Element2;
        exports.ForwardRef = ForwardRef;
        exports.Fragment = Fragment9;
        exports.Lazy = Lazy;
        exports.Memo = Memo;
        exports.Portal = Portal;
        exports.Profiler = Profiler;
        exports.StrictMode = StrictMode;
        exports.Suspense = Suspense9;
        exports.isAsyncMode = isAsyncMode;
        exports.isConcurrentMode = isConcurrentMode;
        exports.isContextConsumer = isContextConsumer;
        exports.isContextProvider = isContextProvider;
        exports.isElement = isElement;
        exports.isForwardRef = isForwardRef;
        exports.isFragment = isFragment2;
        exports.isLazy = isLazy;
        exports.isMemo = isMemo;
        exports.isPortal = isPortal;
        exports.isProfiler = isProfiler;
        exports.isStrictMode = isStrictMode;
        exports.isSuspense = isSuspense;
        exports.isValidElementType = isValidElementType;
        exports.typeOf = typeOf;
      })();
    }
  }
});

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

// node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js
var require_hoist_non_react_statics_cjs = __commonJS({
  "node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js"(exports, module) {
    "use strict";
    var reactIs = require_react_is();
    var REACT_STATICS = {
      childContextTypes: true,
      contextType: true,
      contextTypes: true,
      defaultProps: true,
      displayName: true,
      getDefaultProps: true,
      getDerivedStateFromError: true,
      getDerivedStateFromProps: true,
      mixins: true,
      propTypes: true,
      type: true
    };
    var KNOWN_STATICS = {
      name: true,
      length: true,
      prototype: true,
      caller: true,
      callee: true,
      arguments: true,
      arity: true
    };
    var FORWARD_REF_STATICS = {
      "$$typeof": true,
      render: true,
      defaultProps: true,
      displayName: true,
      propTypes: true
    };
    var MEMO_STATICS = {
      "$$typeof": true,
      compare: true,
      defaultProps: true,
      displayName: true,
      propTypes: true,
      type: true
    };
    var TYPE_STATICS = {};
    TYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;
    TYPE_STATICS[reactIs.Memo] = MEMO_STATICS;
    function getStatics(component) {
      if (reactIs.isMemo(component)) {
        return MEMO_STATICS;
      }
      return TYPE_STATICS[component["$$typeof"]] || REACT_STATICS;
    }
    var defineProperty = Object.defineProperty;
    var getOwnPropertyNames2 = Object.getOwnPropertyNames;
    var getOwnPropertySymbols2 = Object.getOwnPropertySymbols;
    var getOwnPropertyDescriptor2 = Object.getOwnPropertyDescriptor;
    var getPrototypeOf = Object.getPrototypeOf;
    var objectPrototype = Object.prototype;
    function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {
      if (typeof sourceComponent !== "string") {
        if (objectPrototype) {
          var inheritedComponent = getPrototypeOf(sourceComponent);
          if (inheritedComponent && inheritedComponent !== objectPrototype) {
            hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);
          }
        }
        var keys4 = getOwnPropertyNames2(sourceComponent);
        if (getOwnPropertySymbols2) {
          keys4 = keys4.concat(getOwnPropertySymbols2(sourceComponent));
        }
        var targetStatics = getStatics(targetComponent);
        var sourceStatics = getStatics(sourceComponent);
        for (var i2 = 0; i2 < keys4.length; ++i2) {
          var key = keys4[i2];
          if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {
            var descriptor = getOwnPropertyDescriptor2(sourceComponent, key);
            try {
              defineProperty(targetComponent, key, descriptor);
            } catch (e3) {
            }
          }
        }
      }
      return targetComponent;
    }
    module.exports = hoistNonReactStatics;
  }
});

// node_modules/object-assign/index.js
var require_object_assign = __commonJS({
  "node_modules/object-assign/index.js"(exports, module) {
    "use strict";
    var getOwnPropertySymbols2 = Object.getOwnPropertySymbols;
    var hasOwnProperty3 = 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 i2 = 0; i2 < 10; i2++) {
          test2["_" + String.fromCharCode(i2)] = i2;
        }
        var order2 = Object.getOwnPropertyNames(test2).map(function(n2) {
          return test2[n2];
        });
        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 from2;
      var to = toObject(target);
      var symbols;
      for (var s2 = 1; s2 < arguments.length; s2++) {
        from2 = Object(arguments[s2]);
        for (var key in from2) {
          if (hasOwnProperty3.call(from2, key)) {
            to[key] = from2[key];
          }
        }
        if (getOwnPropertySymbols2) {
          symbols = getOwnPropertySymbols2(from2);
          for (var i2 = 0; i2 < symbols.length; i2++) {
            if (propIsEnumerable.call(from2, symbols[i2])) {
              to[symbols[i2]] = from2[symbols[i2]];
            }
          }
        }
      }
      return to;
    };
  }
});

// node_modules/prop-types/lib/ReactPropTypesSecret.js
var require_ReactPropTypesSecret = __commonJS({
  "node_modules/prop-types/lib/ReactPropTypesSecret.js"(exports, module) {
    "use strict";
    var ReactPropTypesSecret = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
    module.exports = ReactPropTypesSecret;
  }
});

// node_modules/prop-types/lib/has.js
var require_has = __commonJS({
  "node_modules/prop-types/lib/has.js"(exports, module) {
    module.exports = Function.call.bind(Object.prototype.hasOwnProperty);
  }
});

// node_modules/prop-types/checkPropTypes.js
var require_checkPropTypes = __commonJS({
  "node_modules/prop-types/checkPropTypes.js"(exports, module) {
    "use strict";
    var printWarning = function() {
    };
    if (true) {
      ReactPropTypesSecret = require_ReactPropTypesSecret();
      loggedTypeFailures = {};
      has2 = require_has();
      printWarning = function(text2) {
        var message = "Warning: " + text2;
        if (typeof console !== "undefined") {
          console.error(message);
        }
        try {
          throw new Error(message);
        } catch (x2) {
        }
      };
    }
    var ReactPropTypesSecret;
    var loggedTypeFailures;
    var has2;
    function checkPropTypes(typeSpecs, values2, location2, componentName, getStack) {
      if (true) {
        for (var typeSpecName in typeSpecs) {
          if (has2(typeSpecs, typeSpecName)) {
            var error;
            try {
              if (typeof typeSpecs[typeSpecName] !== "function") {
                var err = Error(
                  (componentName || "React class") + ": " + location2 + " 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 = typeSpecs[typeSpecName](values2, typeSpecName, componentName, location2, null, ReactPropTypesSecret);
            } catch (ex) {
              error = ex;
            }
            if (error && !(error instanceof Error)) {
              printWarning(
                (componentName || "React class") + ": type specification of " + location2 + " `" + typeSpecName + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof error + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."
              );
            }
            if (error instanceof Error && !(error.message in loggedTypeFailures)) {
              loggedTypeFailures[error.message] = true;
              var stack = getStack ? getStack() : "";
              printWarning(
                "Failed " + location2 + " type: " + error.message + (stack != null ? stack : "")
              );
            }
          }
        }
      }
    }
    checkPropTypes.resetWarningCache = function() {
      if (true) {
        loggedTypeFailures = {};
      }
    };
    module.exports = checkPropTypes;
  }
});

// node_modules/prop-types/factoryWithTypeCheckers.js
var require_factoryWithTypeCheckers = __commonJS({
  "node_modules/prop-types/factoryWithTypeCheckers.js"(exports, module) {
    "use strict";
    var ReactIs = require_react_is();
    var assign3 = require_object_assign();
    var ReactPropTypesSecret = require_ReactPropTypesSecret();
    var has2 = require_has();
    var checkPropTypes = require_checkPropTypes();
    var printWarning = function() {
    };
    if (true) {
      printWarning = function(text2) {
        var message = "Warning: " + text2;
        if (typeof console !== "undefined") {
          console.error(message);
        }
        try {
          throw new Error(message);
        } catch (x2) {
        }
      };
    }
    function emptyFunctionThatReturnsNull() {
      return null;
    }
    module.exports = function(isValidElement10, throwOnDirectAccess) {
      var ITERATOR_SYMBOL = typeof Symbol === "function" && Symbol.iterator;
      var FAUX_ITERATOR_SYMBOL = "@@iterator";
      function getIteratorFn(maybeIterable) {
        var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
        if (typeof iteratorFn === "function") {
          return iteratorFn;
        }
      }
      var ANONYMOUS = "<<anonymous>>";
      var ReactPropTypes = {
        array: createPrimitiveTypeChecker("array"),
        bigint: createPrimitiveTypeChecker("bigint"),
        bool: createPrimitiveTypeChecker("boolean"),
        func: createPrimitiveTypeChecker("function"),
        number: createPrimitiveTypeChecker("number"),
        object: createPrimitiveTypeChecker("object"),
        string: createPrimitiveTypeChecker("string"),
        symbol: createPrimitiveTypeChecker("symbol"),
        any: createAnyTypeChecker(),
        arrayOf: createArrayOfTypeChecker,
        element: createElementTypeChecker(),
        elementType: createElementTypeTypeChecker(),
        instanceOf: createInstanceTypeChecker,
        node: createNodeChecker(),
        objectOf: createObjectOfTypeChecker,
        oneOf: createEnumTypeChecker,
        oneOfType: createUnionTypeChecker,
        shape: createShapeTypeChecker,
        exact: createStrictShapeTypeChecker
      };
      function is2(x2, y2) {
        if (x2 === y2) {
          return x2 !== 0 || 1 / x2 === 1 / y2;
        } else {
          return x2 !== x2 && y2 !== y2;
        }
      }
      function PropTypeError(message, data) {
        this.message = message;
        this.data = data && typeof data === "object" ? data : {};
        this.stack = "";
      }
      PropTypeError.prototype = Error.prototype;
      function createChainableTypeChecker(validate) {
        if (true) {
          var manualPropTypeCallCache = {};
          var manualPropTypeWarningCount = 0;
        }
        function checkType(isRequired, props, propName, componentName, location2, propFullName, secret) {
          componentName = componentName || ANONYMOUS;
          propFullName = propFullName || propName;
          if (secret !== ReactPropTypesSecret) {
            if (throwOnDirectAccess) {
              var err = new Error(
                "Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types"
              );
              err.name = "Invariant Violation";
              throw err;
            } else if (typeof console !== "undefined") {
              var cacheKey = componentName + ":" + propName;
              if (!manualPropTypeCallCache[cacheKey] && // Avoid spamming the console because they are often not actionable except for lib authors
              manualPropTypeWarningCount < 3) {
                printWarning(
                  "You are manually calling a React.PropTypes validation function for the `" + propFullName + "` prop on `" + componentName + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."
                );
                manualPropTypeCallCache[cacheKey] = true;
                manualPropTypeWarningCount++;
              }
            }
          }
          if (props[propName] == null) {
            if (isRequired) {
              if (props[propName] === null) {
                return new PropTypeError("The " + location2 + " `" + propFullName + "` is marked as required " + ("in `" + componentName + "`, but its value is `null`."));
              }
              return new PropTypeError("The " + location2 + " `" + propFullName + "` is marked as required in " + ("`" + componentName + "`, but its value is `undefined`."));
            }
            return null;
          } else {
            return validate(props, propName, componentName, location2, propFullName);
          }
        }
        var chainedCheckType = checkType.bind(null, false);
        chainedCheckType.isRequired = checkType.bind(null, true);
        return chainedCheckType;
      }
      function createPrimitiveTypeChecker(expectedType) {
        function validate(props, propName, componentName, location2, propFullName, secret) {
          var propValue = props[propName];
          var propType = getPropType(propValue);
          if (propType !== expectedType) {
            var preciseType = getPreciseType(propValue);
            return new PropTypeError(
              "Invalid " + location2 + " `" + propFullName + "` of type " + ("`" + preciseType + "` supplied to `" + componentName + "`, expected ") + ("`" + expectedType + "`."),
              { expectedType }
            );
          }
          return null;
        }
        return createChainableTypeChecker(validate);
      }
      function createAnyTypeChecker() {
        return createChainableTypeChecker(emptyFunctionThatReturnsNull);
      }
      function createArrayOfTypeChecker(typeChecker) {
        function validate(props, propName, componentName, location2, propFullName) {
          if (typeof typeChecker !== "function") {
            return new PropTypeError("Property `" + propFullName + "` of component `" + componentName + "` has invalid PropType notation inside arrayOf.");
          }
          var propValue = props[propName];
          if (!Array.isArray(propValue)) {
            var propType = getPropType(propValue);
            return new PropTypeError("Invalid " + location2 + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected an array."));
          }
          for (var i2 = 0; i2 < propValue.length; i2++) {
            var error = typeChecker(propValue, i2, componentName, location2, propFullName + "[" + i2 + "]", ReactPropTypesSecret);
            if (error instanceof Error) {
              return error;
            }
          }
          return null;
        }
        return createChainableTypeChecker(validate);
      }
      function createElementTypeChecker() {
        function validate(props, propName, componentName, location2, propFullName) {
          var propValue = props[propName];
          if (!isValidElement10(propValue)) {
            var propType = getPropType(propValue);
            return new PropTypeError("Invalid " + location2 + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected a single ReactElement."));
          }
          return null;
        }
        return createChainableTypeChecker(validate);
      }
      function createElementTypeTypeChecker() {
        function validate(props, propName, componentName, location2, propFullName) {
          var propValue = props[propName];
          if (!ReactIs.isValidElementType(propValue)) {
            var propType = getPropType(propValue);
            return new PropTypeError("Invalid " + location2 + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected a single ReactElement type."));
          }
          return null;
        }
        return createChainableTypeChecker(validate);
      }
      function createInstanceTypeChecker(expectedClass) {
        function validate(props, propName, componentName, location2, propFullName) {
          if (!(props[propName] instanceof expectedClass)) {
            var expectedClassName = expectedClass.name || ANONYMOUS;
            var actualClassName = getClassName(props[propName]);
            return new PropTypeError("Invalid " + location2 + " `" + propFullName + "` of type " + ("`" + actualClassName + "` supplied to `" + componentName + "`, expected ") + ("instance of `" + expectedClassName + "`."));
          }
          return null;
        }
        return createChainableTypeChecker(validate);
      }
      function createEnumTypeChecker(expectedValues) {
        if (!Array.isArray(expectedValues)) {
          if (true) {
            if (arguments.length > 1) {
              printWarning(
                "Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."
              );
            } else {
              printWarning("Invalid argument supplied to oneOf, expected an array.");
            }
          }
          return emptyFunctionThatReturnsNull;
        }
        function validate(props, propName, componentName, location2, propFullName) {
          var propValue = props[propName];
          for (var i2 = 0; i2 < expectedValues.length; i2++) {
            if (is2(propValue, expectedValues[i2])) {
              return null;
            }
          }
          var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
            var type = getPreciseType(value);
            if (type === "symbol") {
              return String(value);
            }
            return value;
          });
          return new PropTypeError("Invalid " + location2 + " `" + propFullName + "` of value `" + String(propValue) + "` " + ("supplied to `" + componentName + "`, expected one of " + valuesString + "."));
        }
        return createChainableTypeChecker(validate);
      }
      function createObjectOfTypeChecker(typeChecker) {
        function validate(props, propName, componentName, location2, propFullName) {
          if (typeof typeChecker !== "function") {
            return new PropTypeError("Property `" + propFullName + "` of component `" + componentName + "` has invalid PropType notation inside objectOf.");
          }
          var propValue = props[propName];
          var propType = getPropType(propValue);
          if (propType !== "object") {
            return new PropTypeError("Invalid " + location2 + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected an object."));
          }
          for (var key in propValue) {
            if (has2(propValue, key)) {
              var error = typeChecker(propValue, key, componentName, location2, propFullName + "." + key, ReactPropTypesSecret);
              if (error instanceof Error) {
                return error;
              }
            }
          }
          return null;
        }
        return createChainableTypeChecker(validate);
      }
      function createUnionTypeChecker(arrayOfTypeCheckers) {
        if (!Array.isArray(arrayOfTypeCheckers)) {
          true ? printWarning("Invalid argument supplied to oneOfType, expected an instance of array.") : void 0;
          return emptyFunctionThatReturnsNull;
        }
        for (var i2 = 0; i2 < arrayOfTypeCheckers.length; i2++) {
          var checker = arrayOfTypeCheckers[i2];
          if (typeof checker !== "function") {
            printWarning(
              "Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + getPostfixForTypeWarning(checker) + " at index " + i2 + "."
            );
            return emptyFunctionThatReturnsNull;
          }
        }
        function validate(props, propName, componentName, location2, propFullName) {
          var expectedTypes = [];
          for (var i3 = 0; i3 < arrayOfTypeCheckers.length; i3++) {
            var checker2 = arrayOfTypeCheckers[i3];
            var checkerResult = checker2(props, propName, componentName, location2, propFullName, ReactPropTypesSecret);
            if (checkerResult == null) {
              return null;
            }
            if (checkerResult.data && has2(checkerResult.data, "expectedType")) {
              expectedTypes.push(checkerResult.data.expectedType);
            }
          }
          var expectedTypesMessage = expectedTypes.length > 0 ? ", expected one of type [" + expectedTypes.join(", ") + "]" : "";
          return new PropTypeError("Invalid " + location2 + " `" + propFullName + "` supplied to " + ("`" + componentName + "`" + expectedTypesMessage + "."));
        }
        return createChainableTypeChecker(validate);
      }
      function createNodeChecker() {
        function validate(props, propName, componentName, location2, propFullName) {
          if (!isNode(props[propName])) {
            return new PropTypeError("Invalid " + location2 + " `" + propFullName + "` supplied to " + ("`" + componentName + "`, expected a ReactNode."));
          }
          return null;
        }
        return createChainableTypeChecker(validate);
      }
      function invalidValidatorError(componentName, location2, propFullName, key, type) {
        return new PropTypeError(
          (componentName || "React class") + ": " + location2 + " type `" + propFullName + "." + key + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + type + "`."
        );
      }
      function createShapeTypeChecker(shapeTypes) {
        function validate(props, propName, componentName, location2, propFullName) {
          var propValue = props[propName];
          var propType = getPropType(propValue);
          if (propType !== "object") {
            return new PropTypeError("Invalid " + location2 + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected `object`."));
          }
          for (var key in shapeTypes) {
            var checker = shapeTypes[key];
            if (typeof checker !== "function") {
              return invalidValidatorError(componentName, location2, propFullName, key, getPreciseType(checker));
            }
            var error = checker(propValue, key, componentName, location2, propFullName + "." + key, ReactPropTypesSecret);
            if (error) {
              return error;
            }
          }
          return null;
        }
        return createChainableTypeChecker(validate);
      }
      function createStrictShapeTypeChecker(shapeTypes) {
        function validate(props, propName, componentName, location2, propFullName) {
          var propValue = props[propName];
          var propType = getPropType(propValue);
          if (propType !== "object") {
            return new PropTypeError("Invalid " + location2 + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected `object`."));
          }
          var allKeys = assign3({}, props[propName], shapeTypes);
          for (var key in allKeys) {
            var checker = shapeTypes[key];
            if (has2(shapeTypes, key) && typeof checker !== "function") {
              return invalidValidatorError(componentName, location2, propFullName, key, getPreciseType(checker));
            }
            if (!checker) {
              return new PropTypeError(
                "Invalid " + location2 + " `" + propFullName + "` key `" + key + "` supplied to `" + componentName + "`.\nBad object: " + JSON.stringify(props[propName], null, "  ") + "\nValid keys: " + JSON.stringify(Object.keys(shapeTypes), null, "  ")
              );
            }
            var error = checker(propValue, key, componentName, location2, propFullName + "." + key, ReactPropTypesSecret);
            if (error) {
              return error;
            }
          }
          return null;
        }
        return createChainableTypeChecker(validate);
      }
      function isNode(propValue) {
        switch (typeof propValue) {
          case "number":
          case "string":
          case "undefined":
            return true;
          case "boolean":
            return !propValue;
          case "object":
            if (Array.isArray(propValue)) {
              return propValue.every(isNode);
            }
            if (propValue === null || isValidElement10(propValue)) {
              return true;
            }
            var iteratorFn = getIteratorFn(propValue);
            if (iteratorFn) {
              var iterator = iteratorFn.call(propValue);
              var step;
              if (iteratorFn !== propValue.entries) {
                while (!(step = iterator.next()).done) {
                  if (!isNode(step.value)) {
                    return false;
                  }
                }
              } else {
                while (!(step = iterator.next()).done) {
                  var entry = step.value;
                  if (entry) {
                    if (!isNode(entry[1])) {
                      return false;
                    }
                  }
                }
              }
            } else {
              return false;
            }
            return true;
          default:
            return false;
        }
      }
      function isSymbol(propType, propValue) {
        if (propType === "symbol") {
          return true;
        }
        if (!propValue) {
          return false;
        }
        if (propValue["@@toStringTag"] === "Symbol") {
          return true;
        }
        if (typeof Symbol === "function" && propValue instanceof Symbol) {
          return true;
        }
        return false;
      }
      function getPropType(propValue) {
        var propType = typeof propValue;
        if (Array.isArray(propValue)) {
          return "array";
        }
        if (propValue instanceof RegExp) {
          return "object";
        }
        if (isSymbol(propType, propValue)) {
          return "symbol";
        }
        return propType;
      }
      function getPreciseType(propValue) {
        if (typeof propValue === "undefined" || propValue === null) {
          return "" + propValue;
        }
        var propType = getPropType(propValue);
        if (propType === "object") {
          if (propValue instanceof Date) {
            return "date";
          } else if (propValue instanceof RegExp) {
            return "regexp";
          }
        }
        return propType;
      }
      function getPostfixForTypeWarning(value) {
        var type = getPreciseType(value);
        switch (type) {
          case "array":
          case "object":
            return "an " + type;
          case "boolean":
          case "date":
          case "regexp":
            return "a " + type;
          default:
            return type;
        }
      }
      function getClassName(propValue) {
        if (!propValue.constructor || !propValue.constructor.name) {
          return ANONYMOUS;
        }
        return propValue.constructor.name;
      }
      ReactPropTypes.checkPropTypes = checkPropTypes;
      ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
      ReactPropTypes.PropTypes = ReactPropTypes;
      return ReactPropTypes;
    };
  }
});

// node_modules/prop-types/index.js
var require_prop_types = __commonJS({
  "node_modules/prop-types/index.js"(exports, module) {
    if (true) {
      ReactIs = require_react_is();
      throwOnDirectAccess = true;
      module.exports = require_factoryWithTypeCheckers()(ReactIs.isElement, throwOnDirectAccess);
    } else {
      module.exports = null();
    }
    var ReactIs;
    var throwOnDirectAccess;
  }
});

// node_modules/react/cjs/react-jsx-runtime.development.js
var require_react_jsx_runtime_development = __commonJS({
  "node_modules/react/cjs/react-jsx-runtime.development.js"(exports) {
    "use strict";
    if (true) {
      (function() {
        "use strict";
        var React116 = require_react();
        var REACT_ELEMENT_TYPE = Symbol.for("react.element");
        var REACT_PORTAL_TYPE = Symbol.for("react.portal");
        var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
        var REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode");
        var REACT_PROFILER_TYPE = Symbol.for("react.profiler");
        var REACT_PROVIDER_TYPE = Symbol.for("react.provider");
        var REACT_CONTEXT_TYPE = Symbol.for("react.context");
        var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref");
        var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense");
        var REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list");
        var REACT_MEMO_TYPE = Symbol.for("react.memo");
        var REACT_LAZY_TYPE = Symbol.for("react.lazy");
        var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen");
        var MAYBE_ITERATOR_SYMBOL = 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 ReactSharedInternals = React116.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
        function error(format3) {
          {
            {
              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", format3, args);
            }
          }
        }
        function printWarning(level, format3, args) {
          {
            var ReactDebugCurrentFrame2 = ReactSharedInternals.ReactDebugCurrentFrame;
            var stack = ReactDebugCurrentFrame2.getStackAddendum();
            if (stack !== "") {
              format3 += "%s";
              args = args.concat([stack]);
            }
            var argsWithFormat = args.map(function(item) {
              return String(item);
            });
            argsWithFormat.unshift("Warning: " + format3);
            Function.prototype.apply.call(console[level], console, argsWithFormat);
          }
        }
        var enableScopeAPI = false;
        var enableCacheElement = false;
        var enableTransitionTracing = false;
        var enableLegacyHidden = false;
        var enableDebugTracing = false;
        var REACT_MODULE_REFERENCE;
        {
          REACT_MODULE_REFERENCE = Symbol.for("react.module.reference");
        }
        function isValidElementType(type) {
          if (typeof type === "string" || typeof type === "function") {
            return true;
          }
          if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing) {
            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 || // This needs to include all possible module reference object
            // types supported by any Flight configuration anywhere since
            // we don't know which Flight build this will end up being used
            // with.
            type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== void 0) {
              return true;
            }
          }
          return false;
        }
        function getWrappedName(outerType, innerType, wrapperName) {
          var displayName = outerType.displayName;
          if (displayName) {
            return displayName;
          }
          var functionName = innerType.displayName || innerType.name || "";
          return functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName;
        }
        function getContextName(type) {
          return type.displayName || "Context";
        }
        function getComponentNameFromType(type) {
          if (type == null) {
            return null;
          }
          {
            if (typeof type.tag === "number") {
              error("Received an unexpected object in getComponentNameFromType(). 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 context2 = type;
                return getContextName(context2) + ".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:
                var outerName = type.displayName || null;
                if (outerName !== null) {
                  return outerName;
                }
                return getComponentNameFromType(type.type) || "Memo";
              case REACT_LAZY_TYPE: {
                var lazyComponent = type;
                var payload = lazyComponent._payload;
                var init = lazyComponent._init;
                try {
                  return getComponentNameFromType(init(payload));
                } catch (x2) {
                  return null;
                }
              }
            }
          }
          return null;
        }
        var assign3 = Object.assign;
        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: assign3({}, props, {
                  value: prevLog
                }),
                info: assign3({}, props, {
                  value: prevInfo
                }),
                warn: assign3({}, props, {
                  value: prevWarn
                }),
                error: assign3({}, props, {
                  value: prevError
                }),
                group: assign3({}, props, {
                  value: prevGroup
                }),
                groupCollapsed: assign3({}, props, {
                  value: prevGroupCollapsed
                }),
                groupEnd: assign3({}, 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 prefix3;
        function describeBuiltInComponentFrame(name2, source, ownerFn) {
          {
            if (prefix3 === void 0) {
              try {
                throw Error();
              } catch (x2) {
                var match2 = x2.stack.trim().match(/\n( *(at )?)/);
                prefix3 = match2 && match2[1] || "";
              }
            }
            return "\n" + prefix3 + name2;
          }
        }
        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 (x2) {
                  control = x2;
                }
                Reflect.construct(fn, [], Fake);
              } else {
                try {
                  Fake.call();
                } catch (x2) {
                  control = x2;
                }
                fn.call(Fake.prototype);
              }
            } else {
              try {
                throw Error();
              } catch (x2) {
                control = x2;
              }
              fn();
            }
          } catch (sample) {
            if (sample && control && typeof sample.stack === "string") {
              var sampleLines = sample.stack.split("\n");
              var controlLines = control.stack.split("\n");
              var s2 = sampleLines.length - 1;
              var c4 = controlLines.length - 1;
              while (s2 >= 1 && c4 >= 0 && sampleLines[s2] !== controlLines[c4]) {
                c4--;
              }
              for (; s2 >= 1 && c4 >= 0; s2--, c4--) {
                if (sampleLines[s2] !== controlLines[c4]) {
                  if (s2 !== 1 || c4 !== 1) {
                    do {
                      s2--;
                      c4--;
                      if (c4 < 0 || sampleLines[s2] !== controlLines[c4]) {
                        var _frame = "\n" + sampleLines[s2].replace(" at new ", " at ");
                        if (fn.displayName && _frame.includes("<anonymous>")) {
                          _frame = _frame.replace("<anonymous>", fn.displayName);
                        }
                        {
                          if (typeof fn === "function") {
                            componentFrameCache.set(fn, _frame);
                          }
                        }
                        return _frame;
                      }
                    } while (s2 >= 1 && c4 >= 0);
                  }
                  break;
                }
              }
            }
          } finally {
            reentry = false;
            {
              ReactCurrentDispatcher.current = previousDispatcher;
              reenableLogs();
            }
            Error.prepareStackTrace = previousPrepareStackTrace;
          }
          var name2 = fn ? fn.displayName || fn.name : "";
          var syntheticFrame = name2 ? describeBuiltInComponentFrame(name2) : "";
          {
            if (typeof fn === "function") {
              componentFrameCache.set(fn, syntheticFrame);
            }
          }
          return syntheticFrame;
        }
        function describeFunctionComponentFrame(fn, source, ownerFn) {
          {
            return describeNativeComponentFrame(fn, false);
          }
        }
        function shouldConstruct(Component8) {
          var prototype = Component8.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_LAZY_TYPE: {
                var lazyComponent = type;
                var payload = lazyComponent._payload;
                var init = lazyComponent._init;
                try {
                  return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
                } catch (x2) {
                }
              }
            }
          }
          return "";
        }
        var hasOwnProperty3 = Object.prototype.hasOwnProperty;
        var loggedTypeFailures = {};
        var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
        function setCurrentlyValidatingElement(element2) {
          {
            if (element2) {
              var owner = element2._owner;
              var stack = describeUnknownElementTypeFrameInDEV(element2.type, element2._source, owner ? owner.type : null);
              ReactDebugCurrentFrame.setExtraStackFrame(stack);
            } else {
              ReactDebugCurrentFrame.setExtraStackFrame(null);
            }
          }
        }
        function checkPropTypes(typeSpecs, values2, location2, componentName, element2) {
          {
            var has2 = Function.call.bind(hasOwnProperty3);
            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") + ": " + location2 + " 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](values2, typeSpecName, componentName, location2, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
                } catch (ex) {
                  error$1 = ex;
                }
                if (error$1 && !(error$1 instanceof Error)) {
                  setCurrentlyValidatingElement(element2);
                  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", location2, typeSpecName, typeof error$1);
                  setCurrentlyValidatingElement(null);
                }
                if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
                  loggedTypeFailures[error$1.message] = true;
                  setCurrentlyValidatingElement(element2);
                  error("Failed %s type: %s", location2, error$1.message);
                  setCurrentlyValidatingElement(null);
                }
              }
            }
          }
        }
        var isArrayImpl = Array.isArray;
        function isArray2(a2) {
          return isArrayImpl(a2);
        }
        function typeName2(value) {
          {
            var hasToStringTag = typeof Symbol === "function" && Symbol.toStringTag;
            var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
            return type;
          }
        }
        function willCoercionThrow(value) {
          {
            try {
              testStringCoercion(value);
              return false;
            } catch (e3) {
              return true;
            }
          }
        }
        function testStringCoercion(value) {
          return "" + value;
        }
        function checkKeyStringCoercion(value) {
          {
            if (willCoercionThrow(value)) {
              error("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", typeName2(value));
              return testStringCoercion(value);
            }
          }
        }
        var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
        var RESERVED_PROPS = {
          key: true,
          ref: true,
          __self: true,
          __source: true
        };
        var specialPropKeyWarningShown;
        var specialPropRefWarningShown;
        var didWarnAboutStringRefs;
        {
          didWarnAboutStringRefs = {};
        }
        function hasValidRef(config2) {
          {
            if (hasOwnProperty3.call(config2, "ref")) {
              var getter = Object.getOwnPropertyDescriptor(config2, "ref").get;
              if (getter && getter.isReactWarning) {
                return false;
              }
            }
          }
          return config2.ref !== void 0;
        }
        function hasValidKey(config2) {
          {
            if (hasOwnProperty3.call(config2, "key")) {
              var getter = Object.getOwnPropertyDescriptor(config2, "key").get;
              if (getter && getter.isReactWarning) {
                return false;
              }
            }
          }
          return config2.key !== void 0;
        }
        function warnIfStringRefCannotBeAutoConverted(config2, self2) {
          {
            if (typeof config2.ref === "string" && ReactCurrentOwner.current && self2 && ReactCurrentOwner.current.stateNode !== self2) {
              var componentName = getComponentNameFromType(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', getComponentNameFromType(ReactCurrentOwner.current.type), config2.ref);
                didWarnAboutStringRefs[componentName] = true;
              }
            }
          }
        }
        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
            });
          }
        }
        var ReactElement = function(type, key, ref, self2, source, owner, props) {
          var element2 = {
            // This tag allows us to uniquely identify this as a React Element
            $$typeof: REACT_ELEMENT_TYPE,
            // Built-in properties that belong on the element
            type,
            key,
            ref,
            props,
            // Record the component responsible for creating this element.
            _owner: owner
          };
          {
            element2._store = {};
            Object.defineProperty(element2._store, "validated", {
              configurable: false,
              enumerable: false,
              writable: true,
              value: false
            });
            Object.defineProperty(element2, "_self", {
              configurable: false,
              enumerable: false,
              writable: false,
              value: self2
            });
            Object.defineProperty(element2, "_source", {
              configurable: false,
              enumerable: false,
              writable: false,
              value: source
            });
            if (Object.freeze) {
              Object.freeze(element2.props);
              Object.freeze(element2);
            }
          }
          return element2;
        };
        function jsxDEV(type, config2, maybeKey, source, self2) {
          {
            var propName;
            var props = {};
            var key = null;
            var ref = null;
            if (maybeKey !== void 0) {
              {
                checkKeyStringCoercion(maybeKey);
              }
              key = "" + maybeKey;
            }
            if (hasValidKey(config2)) {
              {
                checkKeyStringCoercion(config2.key);
              }
              key = "" + config2.key;
            }
            if (hasValidRef(config2)) {
              ref = config2.ref;
              warnIfStringRefCannotBeAutoConverted(config2, self2);
            }
            for (propName in config2) {
              if (hasOwnProperty3.call(config2, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
                props[propName] = config2[propName];
              }
            }
            if (type && type.defaultProps) {
              var defaultProps5 = type.defaultProps;
              for (propName in defaultProps5) {
                if (props[propName] === void 0) {
                  props[propName] = defaultProps5[propName];
                }
              }
            }
            if (key || ref) {
              var displayName = typeof type === "function" ? type.displayName || type.name || "Unknown" : type;
              if (key) {
                defineKeyPropWarningGetter(props, displayName);
              }
              if (ref) {
                defineRefPropWarningGetter(props, displayName);
              }
            }
            return ReactElement(type, key, ref, self2, source, ReactCurrentOwner.current, props);
          }
        }
        var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;
        var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
        function setCurrentlyValidatingElement$1(element2) {
          {
            if (element2) {
              var owner = element2._owner;
              var stack = describeUnknownElementTypeFrameInDEV(element2.type, element2._source, owner ? owner.type : null);
              ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
            } else {
              ReactDebugCurrentFrame$1.setExtraStackFrame(null);
            }
          }
        }
        var propTypesMisspellWarningShown;
        {
          propTypesMisspellWarningShown = false;
        }
        function isValidElement10(object) {
          {
            return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
          }
        }
        function getDeclarationErrorAddendum() {
          {
            if (ReactCurrentOwner$1.current) {
              var name2 = getComponentNameFromType(ReactCurrentOwner$1.current.type);
              if (name2) {
                return "\n\nCheck the render method of `" + name2 + "`.";
              }
            }
            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 "";
          }
        }
        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(element2, parentType) {
          {
            if (!element2._store || element2._store.validated || element2.key != null) {
              return;
            }
            element2._store.validated = true;
            var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
            if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
              return;
            }
            ownerHasKeyUseWarning[currentComponentErrorInfo] = true;
            var childOwner = "";
            if (element2 && element2._owner && element2._owner !== ReactCurrentOwner$1.current) {
              childOwner = " It was passed a child from " + getComponentNameFromType(element2._owner.type) + ".";
            }
            setCurrentlyValidatingElement$1(element2);
            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(node56, parentType) {
          {
            if (typeof node56 !== "object") {
              return;
            }
            if (isArray2(node56)) {
              for (var i2 = 0; i2 < node56.length; i2++) {
                var child = node56[i2];
                if (isValidElement10(child)) {
                  validateExplicitKey(child, parentType);
                }
              }
            } else if (isValidElement10(node56)) {
              if (node56._store) {
                node56._store.validated = true;
              }
            } else if (node56) {
              var iteratorFn = getIteratorFn(node56);
              if (typeof iteratorFn === "function") {
                if (iteratorFn !== node56.entries) {
                  var iterator = iteratorFn.call(node56);
                  var step;
                  while (!(step = iterator.next()).done) {
                    if (isValidElement10(step.value)) {
                      validateExplicitKey(step.value, parentType);
                    }
                  }
                }
              }
            }
          }
        }
        function validatePropTypes(element2) {
          {
            var type = element2.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 || // Note: Memo only checks outer props here.
            // Inner props are checked in the reconciler.
            type.$$typeof === REACT_MEMO_TYPE)) {
              propTypes = type.propTypes;
            } else {
              return;
            }
            if (propTypes) {
              var name2 = getComponentNameFromType(type);
              checkPropTypes(propTypes, element2.props, "prop", name2, element2);
            } else if (type.PropTypes !== void 0 && !propTypesMisspellWarningShown) {
              propTypesMisspellWarningShown = true;
              var _name = getComponentNameFromType(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(fragment2) {
          {
            var keys4 = Object.keys(fragment2.props);
            for (var i2 = 0; i2 < keys4.length; i2++) {
              var key = keys4[i2];
              if (key !== "children" && key !== "key") {
                setCurrentlyValidatingElement$1(fragment2);
                error("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", key);
                setCurrentlyValidatingElement$1(null);
                break;
              }
            }
            if (fragment2.ref !== null) {
              setCurrentlyValidatingElement$1(fragment2);
              error("Invalid attribute `ref` supplied to `React.Fragment`.");
              setCurrentlyValidatingElement$1(null);
            }
          }
        }
        function jsxWithValidation(type, props, key, isStaticChildren, source, self2) {
          {
            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 = getSourceInfoErrorAddendum(source);
              if (sourceInfo) {
                info += sourceInfo;
              } else {
                info += getDeclarationErrorAddendum();
              }
              var typeString;
              if (type === null) {
                typeString = "null";
              } else if (isArray2(type)) {
                typeString = "array";
              } else if (type !== void 0 && type.$$typeof === REACT_ELEMENT_TYPE) {
                typeString = "<" + (getComponentNameFromType(type.type) || "Unknown") + " />";
                info = " Did you accidentally export a JSX literal instead of a component?";
              } else {
                typeString = typeof type;
              }
              error("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", typeString, info);
            }
            var element2 = jsxDEV(type, props, key, source, self2);
            if (element2 == null) {
              return element2;
            }
            if (validType) {
              var children = props.children;
              if (children !== void 0) {
                if (isStaticChildren) {
                  if (isArray2(children)) {
                    for (var i2 = 0; i2 < children.length; i2++) {
                      validateChildKeys(children[i2], type);
                    }
                    if (Object.freeze) {
                      Object.freeze(children);
                    }
                  } else {
                    error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
                  }
                } else {
                  validateChildKeys(children, type);
                }
              }
            }
            if (type === REACT_FRAGMENT_TYPE) {
              validateFragmentProps(element2);
            } else {
              validatePropTypes(element2);
            }
            return element2;
          }
        }
        function jsxWithValidationStatic(type, props, key) {
          {
            return jsxWithValidation(type, props, key, true);
          }
        }
        function jsxWithValidationDynamic(type, props, key) {
          {
            return jsxWithValidation(type, props, key, false);
          }
        }
        var jsx6 = jsxWithValidationDynamic;
        var jsxs3 = jsxWithValidationStatic;
        exports.Fragment = REACT_FRAGMENT_TYPE;
        exports.jsx = jsx6;
        exports.jsxs = jsxs3;
      })();
    }
  }
});

// node_modules/react/jsx-runtime.js
var require_jsx_runtime = __commonJS({
  "node_modules/react/jsx-runtime.js"(exports, module) {
    "use strict";
    if (false) {
      module.exports = null;
    } else {
      module.exports = require_react_jsx_runtime_development();
    }
  }
});

// node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js
var require_use_sync_external_store_shim_development = __commonJS({
  "node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js"(exports) {
    "use strict";
    if (true) {
      (function() {
        "use strict";
        if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === "function") {
          __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
        }
        var React116 = require_react();
        var ReactSharedInternals = React116.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
        function error(format3) {
          {
            {
              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", format3, args);
            }
          }
        }
        function printWarning(level, format3, args) {
          {
            var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
            var stack = ReactDebugCurrentFrame.getStackAddendum();
            if (stack !== "") {
              format3 += "%s";
              args = args.concat([stack]);
            }
            var argsWithFormat = args.map(function(item) {
              return String(item);
            });
            argsWithFormat.unshift("Warning: " + format3);
            Function.prototype.apply.call(console[level], console, argsWithFormat);
          }
        }
        function is2(x2, y2) {
          return x2 === y2 && (x2 !== 0 || 1 / x2 === 1 / y2) || x2 !== x2 && y2 !== y2;
        }
        var objectIs = typeof Object.is === "function" ? Object.is : is2;
        var useState33 = React116.useState, useEffect30 = React116.useEffect, useLayoutEffect12 = React116.useLayoutEffect, useDebugValue3 = React116.useDebugValue;
        var didWarnOld18Alpha = false;
        var didWarnUncachedGetSnapshot = false;
        function useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {
          {
            if (!didWarnOld18Alpha) {
              if (React116.startTransition !== void 0) {
                didWarnOld18Alpha = true;
                error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release.");
              }
            }
          }
          var value = getSnapshot();
          {
            if (!didWarnUncachedGetSnapshot) {
              var cachedValue = getSnapshot();
              if (!objectIs(value, cachedValue)) {
                error("The result of getSnapshot should be cached to avoid an infinite loop");
                didWarnUncachedGetSnapshot = true;
              }
            }
          }
          var _useState = useState33({
            inst: {
              value,
              getSnapshot
            }
          }), inst = _useState[0].inst, forceUpdate = _useState[1];
          useLayoutEffect12(function() {
            inst.value = value;
            inst.getSnapshot = getSnapshot;
            if (checkIfSnapshotChanged(inst)) {
              forceUpdate({
                inst
              });
            }
          }, [subscribe, value, getSnapshot]);
          useEffect30(function() {
            if (checkIfSnapshotChanged(inst)) {
              forceUpdate({
                inst
              });
            }
            var handleStoreChange = function() {
              if (checkIfSnapshotChanged(inst)) {
                forceUpdate({
                  inst
                });
              }
            };
            return subscribe(handleStoreChange);
          }, [subscribe]);
          useDebugValue3(value);
          return value;
        }
        function checkIfSnapshotChanged(inst) {
          var latestGetSnapshot = inst.getSnapshot;
          var prevValue = inst.value;
          try {
            var nextValue = latestGetSnapshot();
            return !objectIs(prevValue, nextValue);
          } catch (error2) {
            return true;
          }
        }
        function useSyncExternalStore$1(subscribe, getSnapshot, getServerSnapshot) {
          return getSnapshot();
        }
        var canUseDOM = !!(typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined");
        var isServerEnvironment = !canUseDOM;
        var shim = isServerEnvironment ? useSyncExternalStore$1 : useSyncExternalStore;
        var useSyncExternalStore$2 = React116.useSyncExternalStore !== void 0 ? React116.useSyncExternalStore : shim;
        exports.useSyncExternalStore = useSyncExternalStore$2;
        if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop === "function") {
          __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
        }
      })();
    }
  }
});

// node_modules/use-sync-external-store/shim/index.js
var require_shim = __commonJS({
  "node_modules/use-sync-external-store/shim/index.js"(exports, module) {
    "use strict";
    if (false) {
      module.exports = null;
    } else {
      module.exports = require_use_sync_external_store_shim_development();
    }
  }
});

// node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js
var require_with_selector_development = __commonJS({
  "node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js"(exports) {
    "use strict";
    if (true) {
      (function() {
        "use strict";
        if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === "function") {
          __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
        }
        var React116 = require_react();
        var shim = require_shim();
        function is2(x2, y2) {
          return x2 === y2 && (x2 !== 0 || 1 / x2 === 1 / y2) || x2 !== x2 && y2 !== y2;
        }
        var objectIs = typeof Object.is === "function" ? Object.is : is2;
        var useSyncExternalStore = shim.useSyncExternalStore;
        var useRef28 = React116.useRef, useEffect30 = React116.useEffect, useMemo47 = React116.useMemo, useDebugValue3 = React116.useDebugValue;
        function useSyncExternalStoreWithSelector2(subscribe, getSnapshot, getServerSnapshot, selector, isEqual) {
          var instRef = useRef28(null);
          var inst;
          if (instRef.current === null) {
            inst = {
              hasValue: false,
              value: null
            };
            instRef.current = inst;
          } else {
            inst = instRef.current;
          }
          var _useMemo = useMemo47(function() {
            var hasMemo = false;
            var memoizedSnapshot;
            var memoizedSelection;
            var memoizedSelector = function(nextSnapshot) {
              if (!hasMemo) {
                hasMemo = true;
                memoizedSnapshot = nextSnapshot;
                var _nextSelection = selector(nextSnapshot);
                if (isEqual !== void 0) {
                  if (inst.hasValue) {
                    var currentSelection = inst.value;
                    if (isEqual(currentSelection, _nextSelection)) {
                      memoizedSelection = currentSelection;
                      return currentSelection;
                    }
                  }
                }
                memoizedSelection = _nextSelection;
                return _nextSelection;
              }
              var prevSnapshot = memoizedSnapshot;
              var prevSelection = memoizedSelection;
              if (objectIs(prevSnapshot, nextSnapshot)) {
                return prevSelection;
              }
              var nextSelection = selector(nextSnapshot);
              if (isEqual !== void 0 && isEqual(prevSelection, nextSelection)) {
                return prevSelection;
              }
              memoizedSnapshot = nextSnapshot;
              memoizedSelection = nextSelection;
              return nextSelection;
            };
            var maybeGetServerSnapshot = getServerSnapshot === void 0 ? null : getServerSnapshot;
            var getSnapshotWithSelector = function() {
              return memoizedSelector(getSnapshot());
            };
            var getServerSnapshotWithSelector = maybeGetServerSnapshot === null ? void 0 : function() {
              return memoizedSelector(maybeGetServerSnapshot());
            };
            return [getSnapshotWithSelector, getServerSnapshotWithSelector];
          }, [getSnapshot, getServerSnapshot, selector, isEqual]), getSelection2 = _useMemo[0], getServerSelection = _useMemo[1];
          var value = useSyncExternalStore(subscribe, getSelection2, getServerSelection);
          useEffect30(function() {
            inst.hasValue = true;
            inst.value = value;
          }, [value]);
          useDebugValue3(value);
          return value;
        }
        exports.useSyncExternalStoreWithSelector = useSyncExternalStoreWithSelector2;
        if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop === "function") {
          __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
        }
      })();
    }
  }
});

// node_modules/use-sync-external-store/shim/with-selector.js
var require_with_selector = __commonJS({
  "node_modules/use-sync-external-store/shim/with-selector.js"(exports, module) {
    "use strict";
    if (false) {
      module.exports = null;
    } else {
      module.exports = require_with_selector_development();
    }
  }
});

// node_modules/react-reconciler/cjs/react-reconciler-constants.development.js
var require_react_reconciler_constants_development = __commonJS({
  "node_modules/react-reconciler/cjs/react-reconciler-constants.development.js"(exports) {
    "use strict";
    if (true) {
      (function() {
        "use strict";
        var SyncLane = (
          /*                        */
          1
        );
        var InputContinuousLane = (
          /*            */
          4
        );
        var DefaultLane = (
          /*                    */
          16
        );
        var IdleLane = (
          /*                       */
          536870912
        );
        var DiscreteEventPriority2 = SyncLane;
        var ContinuousEventPriority2 = InputContinuousLane;
        var DefaultEventPriority2 = DefaultLane;
        var IdleEventPriority = IdleLane;
        var LegacyRoot = 0;
        var ConcurrentRoot2 = 1;
        exports.ConcurrentRoot = ConcurrentRoot2;
        exports.ContinuousEventPriority = ContinuousEventPriority2;
        exports.DefaultEventPriority = DefaultEventPriority2;
        exports.DiscreteEventPriority = DiscreteEventPriority2;
        exports.IdleEventPriority = IdleEventPriority;
        exports.LegacyRoot = LegacyRoot;
      })();
    }
  }
});

// node_modules/react-reconciler/constants.js
var require_constants = __commonJS({
  "node_modules/react-reconciler/constants.js"(exports, module) {
    "use strict";
    if (false) {
      module.exports = null;
    } else {
      module.exports = require_react_reconciler_constants_development();
    }
  }
});

// node_modules/scheduler/cjs/scheduler.development.js
var require_scheduler_development2 = __commonJS({
  "node_modules/scheduler/cjs/scheduler.development.js"(exports) {
    "use strict";
    if (true) {
      (function() {
        "use strict";
        if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === "function") {
          __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
        }
        var enableSchedulerDebugging = false;
        var enableProfiling = false;
        var frameYieldMs = 5;
        function push(heap, node56) {
          var index = heap.length;
          heap.push(node56);
          siftUp(heap, node56, index);
        }
        function peek2(heap) {
          return heap.length === 0 ? null : heap[0];
        }
        function pop(heap) {
          if (heap.length === 0) {
            return null;
          }
          var first = heap[0];
          var last = heap.pop();
          if (last !== first) {
            heap[0] = last;
            siftDown(heap, last, 0);
          }
          return first;
        }
        function siftUp(heap, node56, i2) {
          var index = i2;
          while (index > 0) {
            var parentIndex = index - 1 >>> 1;
            var parent = heap[parentIndex];
            if (compare2(parent, node56) > 0) {
              heap[parentIndex] = node56;
              heap[index] = parent;
              index = parentIndex;
            } else {
              return;
            }
          }
        }
        function siftDown(heap, node56, i2) {
          var index = i2;
          var length2 = heap.length;
          var halfLength = length2 >>> 1;
          while (index < halfLength) {
            var leftIndex = (index + 1) * 2 - 1;
            var left = heap[leftIndex];
            var rightIndex = leftIndex + 1;
            var right = heap[rightIndex];
            if (compare2(left, node56) < 0) {
              if (rightIndex < length2 && compare2(right, left) < 0) {
                heap[index] = right;
                heap[rightIndex] = node56;
                index = rightIndex;
              } else {
                heap[index] = left;
                heap[leftIndex] = node56;
                index = leftIndex;
              }
            } else if (rightIndex < length2 && compare2(right, node56) < 0) {
              heap[index] = right;
              heap[rightIndex] = node56;
              index = rightIndex;
            } else {
              return;
            }
          }
        }
        function compare2(a2, b) {
          var diff = a2.sortIndex - b.sortIndex;
          return diff !== 0 ? diff : a2.id - b.id;
        }
        var ImmediatePriority = 1;
        var UserBlockingPriority = 2;
        var NormalPriority = 3;
        var LowPriority = 4;
        var IdlePriority = 5;
        function markTaskErrored(task, ms) {
        }
        var hasPerformanceNow = typeof performance === "object" && typeof performance.now === "function";
        if (hasPerformanceNow) {
          var localPerformance = performance;
          exports.unstable_now = function() {
            return localPerformance.now();
          };
        } else {
          var localDate2 = Date;
          var initialTime = localDate2.now();
          exports.unstable_now = function() {
            return localDate2.now() - initialTime;
          };
        }
        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;
        var localSetTimeout = typeof setTimeout === "function" ? setTimeout : null;
        var localClearTimeout = typeof clearTimeout === "function" ? clearTimeout : null;
        var localSetImmediate = typeof setImmediate !== "undefined" ? setImmediate : null;
        var isInputPending2 = typeof navigator !== "undefined" && navigator.scheduling !== void 0 && navigator.scheduling.isInputPending !== void 0 ? navigator.scheduling.isInputPending.bind(navigator.scheduling) : null;
        function advanceTimers(currentTime) {
          var timer = peek2(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 = peek2(timerQueue);
          }
        }
        function handleTimeout(currentTime) {
          isHostTimeoutScheduled = false;
          advanceTimers(currentTime);
          if (!isHostCallbackScheduled) {
            if (peek2(taskQueue) !== null) {
              isHostCallbackScheduled = true;
              requestHostCallback(flushWork);
            } else {
              var firstTimer = peek2(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 = peek2(taskQueue);
          while (currentTask !== null && !enableSchedulerDebugging) {
            if (currentTask.expirationTime > currentTime && (!hasTimeRemaining || shouldYieldToHost())) {
              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 === peek2(taskQueue)) {
                  pop(taskQueue);
                }
              }
              advanceTimers(currentTime);
            } else {
              pop(taskQueue);
            }
            currentTask = peek2(taskQueue);
          }
          if (currentTask !== null) {
            return true;
          } else {
            var firstTimer = peek2(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_scheduleCallback2(priorityLevel, callback, options) {
          var currentTime = exports.unstable_now();
          var startTime2;
          if (typeof options === "object" && options !== null) {
            var delay = options.delay;
            if (typeof delay === "number" && delay > 0) {
              startTime2 = currentTime + delay;
            } else {
              startTime2 = currentTime;
            }
          } else {
            startTime2 = currentTime;
          }
          var timeout2;
          switch (priorityLevel) {
            case ImmediatePriority:
              timeout2 = IMMEDIATE_PRIORITY_TIMEOUT;
              break;
            case UserBlockingPriority:
              timeout2 = USER_BLOCKING_PRIORITY_TIMEOUT;
              break;
            case IdlePriority:
              timeout2 = IDLE_PRIORITY_TIMEOUT;
              break;
            case LowPriority:
              timeout2 = LOW_PRIORITY_TIMEOUT;
              break;
            case NormalPriority:
            default:
              timeout2 = NORMAL_PRIORITY_TIMEOUT;
              break;
          }
          var expirationTime = startTime2 + timeout2;
          var newTask = {
            id: taskIdCounter++,
            callback,
            priorityLevel,
            startTime: startTime2,
            expirationTime,
            sortIndex: -1
          };
          if (startTime2 > currentTime) {
            newTask.sortIndex = startTime2;
            push(timerQueue, newTask);
            if (peek2(taskQueue) === null && newTask === peek2(timerQueue)) {
              if (isHostTimeoutScheduled) {
                cancelHostTimeout();
              } else {
                isHostTimeoutScheduled = true;
              }
              requestHostTimeout(handleTimeout, startTime2 - 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 peek2(taskQueue);
        }
        function unstable_cancelCallback(task) {
          task.callback = null;
        }
        function unstable_getCurrentPriorityLevel() {
          return currentPriorityLevel;
        }
        var isMessageLoopRunning = false;
        var scheduledHostCallback = null;
        var taskTimeoutID = -1;
        var frameInterval = frameYieldMs;
        var startTime = -1;
        function shouldYieldToHost() {
          var timeElapsed = exports.unstable_now() - startTime;
          if (timeElapsed < frameInterval) {
            return false;
          }
          return true;
        }
        function requestPaint() {
        }
        function forceFrameRate(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) {
            frameInterval = Math.floor(1e3 / fps);
          } else {
            frameInterval = frameYieldMs;
          }
        }
        var performWorkUntilDeadline = function() {
          if (scheduledHostCallback !== null) {
            var currentTime = exports.unstable_now();
            startTime = currentTime;
            var hasTimeRemaining = true;
            var hasMoreWork = true;
            try {
              hasMoreWork = scheduledHostCallback(hasTimeRemaining, currentTime);
            } finally {
              if (hasMoreWork) {
                schedulePerformWorkUntilDeadline();
              } else {
                isMessageLoopRunning = false;
                scheduledHostCallback = null;
              }
            }
          } else {
            isMessageLoopRunning = false;
          }
        };
        var schedulePerformWorkUntilDeadline;
        if (typeof localSetImmediate === "function") {
          schedulePerformWorkUntilDeadline = function() {
            localSetImmediate(performWorkUntilDeadline);
          };
        } else if (typeof MessageChannel !== "undefined") {
          var channel = new MessageChannel();
          var port = channel.port2;
          channel.port1.onmessage = performWorkUntilDeadline;
          schedulePerformWorkUntilDeadline = function() {
            port.postMessage(null);
          };
        } else {
          schedulePerformWorkUntilDeadline = function() {
            localSetTimeout(performWorkUntilDeadline, 0);
          };
        }
        function requestHostCallback(callback) {
          scheduledHostCallback = callback;
          if (!isMessageLoopRunning) {
            isMessageLoopRunning = true;
            schedulePerformWorkUntilDeadline();
          }
        }
        function requestHostTimeout(callback, ms) {
          taskTimeoutID = localSetTimeout(function() {
            callback(exports.unstable_now());
          }, ms);
        }
        function cancelHostTimeout() {
          localClearTimeout(taskTimeoutID);
          taskTimeoutID = -1;
        }
        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_forceFrameRate = forceFrameRate;
        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_scheduleCallback2;
        exports.unstable_shouldYield = shouldYieldToHost;
        exports.unstable_wrapCallback = unstable_wrapCallback;
        if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop === "function") {
          __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
        }
      })();
    }
  }
});

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

// node_modules/react-reconciler/cjs/react-reconciler.development.js
var require_react_reconciler_development = __commonJS({
  "node_modules/react-reconciler/cjs/react-reconciler.development.js"(exports, module) {
    "use strict";
    if (true) {
      module.exports = function $$$reconciler($$$hostConfig) {
        var exports2 = {};
        "use strict";
        var React116 = require_react();
        var Scheduler = require_scheduler2();
        var ReactSharedInternals = React116.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
        var suppressWarning = false;
        function setSuppressWarning(newSuppressWarning) {
          {
            suppressWarning = newSuppressWarning;
          }
        }
        function warn5(format3) {
          {
            if (!suppressWarning) {
              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", format3, args);
            }
          }
        }
        function error(format3) {
          {
            if (!suppressWarning) {
              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", format3, args);
            }
          }
        }
        function printWarning(level, format3, args) {
          {
            var ReactDebugCurrentFrame2 = ReactSharedInternals.ReactDebugCurrentFrame;
            var stack = ReactDebugCurrentFrame2.getStackAddendum();
            if (stack !== "") {
              format3 += "%s";
              args = args.concat([stack]);
            }
            var argsWithFormat = args.map(function(item) {
              return String(item);
            });
            argsWithFormat.unshift("Warning: " + format3);
            Function.prototype.apply.call(console[level], console, argsWithFormat);
          }
        }
        var assign3 = Object.assign;
        function get3(key) {
          return key._reactInternals;
        }
        function set3(key, value) {
          key._reactInternals = value;
        }
        var enablePersistentOffscreenHostContainer = false;
        var enableNewReconciler = false;
        var enableLazyContextPropagation = false;
        var enableLegacyHidden = false;
        var enableSuspenseAvoidThisFallback = false;
        var warnAboutStringRefs = false;
        var enableSchedulingProfiler = true;
        var enableProfilerTimer = true;
        var enableProfilerCommitHooks = true;
        var FunctionComponent = 0;
        var ClassComponent = 1;
        var IndeterminateComponent = 2;
        var HostRoot = 3;
        var HostPortal = 4;
        var HostComponent = 5;
        var HostText = 6;
        var Fragment9 = 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 ScopeComponent = 21;
        var OffscreenComponent = 22;
        var LegacyHiddenComponent = 23;
        var CacheComponent = 24;
        var TracingMarkerComponent = 25;
        var REACT_ELEMENT_TYPE = Symbol.for("react.element");
        var REACT_PORTAL_TYPE = Symbol.for("react.portal");
        var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
        var REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode");
        var REACT_PROFILER_TYPE = Symbol.for("react.profiler");
        var REACT_PROVIDER_TYPE = Symbol.for("react.provider");
        var REACT_CONTEXT_TYPE = Symbol.for("react.context");
        var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref");
        var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense");
        var REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list");
        var REACT_MEMO_TYPE = Symbol.for("react.memo");
        var REACT_LAZY_TYPE = Symbol.for("react.lazy");
        var REACT_SCOPE_TYPE = Symbol.for("react.scope");
        var REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for("react.debug_trace_mode");
        var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen");
        var REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden");
        var REACT_CACHE_TYPE = Symbol.for("react.cache");
        var REACT_TRACING_MARKER_TYPE = Symbol.for("react.tracing_marker");
        var MAYBE_ITERATOR_SYMBOL = 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;
        }
        function getWrappedName(outerType, innerType, wrapperName) {
          var displayName = outerType.displayName;
          if (displayName) {
            return displayName;
          }
          var functionName = innerType.displayName || innerType.name || "";
          return functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName;
        }
        function getContextName(type) {
          return type.displayName || "Context";
        }
        function getComponentNameFromType(type) {
          if (type == null) {
            return null;
          }
          {
            if (typeof type.tag === "number") {
              error("Received an unexpected object in getComponentNameFromType(). 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 context2 = type;
                return getContextName(context2) + ".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:
                var outerName = type.displayName || null;
                if (outerName !== null) {
                  return outerName;
                }
                return getComponentNameFromType(type.type) || "Memo";
              case REACT_LAZY_TYPE: {
                var lazyComponent = type;
                var payload = lazyComponent._payload;
                var init = lazyComponent._init;
                try {
                  return getComponentNameFromType(init(payload));
                } catch (x2) {
                  return null;
                }
              }
            }
          }
          return null;
        }
        function getWrappedName$1(outerType, innerType, wrapperName) {
          var functionName = innerType.displayName || innerType.name || "";
          return outerType.displayName || (functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName);
        }
        function getContextName$1(type) {
          return type.displayName || "Context";
        }
        function getComponentNameFromFiber(fiber) {
          var tag = fiber.tag, type = fiber.type;
          switch (tag) {
            case CacheComponent:
              return "Cache";
            case ContextConsumer:
              var context2 = type;
              return getContextName$1(context2) + ".Consumer";
            case ContextProvider:
              var provider = type;
              return getContextName$1(provider._context) + ".Provider";
            case DehydratedFragment:
              return "DehydratedFragment";
            case ForwardRef:
              return getWrappedName$1(type, type.render, "ForwardRef");
            case Fragment9:
              return "Fragment";
            case HostComponent:
              return type;
            case HostPortal:
              return "Portal";
            case HostRoot:
              return "Root";
            case HostText:
              return "Text";
            case LazyComponent:
              return getComponentNameFromType(type);
            case Mode:
              if (type === REACT_STRICT_MODE_TYPE) {
                return "StrictMode";
              }
              return "Mode";
            case OffscreenComponent:
              return "Offscreen";
            case Profiler:
              return "Profiler";
            case ScopeComponent:
              return "Scope";
            case SuspenseComponent:
              return "Suspense";
            case SuspenseListComponent:
              return "SuspenseList";
            case TracingMarkerComponent:
              return "TracingMarker";
            case ClassComponent:
            case FunctionComponent:
            case IncompleteClassComponent:
            case IndeterminateComponent:
            case MemoComponent:
            case SimpleMemoComponent:
              if (typeof type === "function") {
                return type.displayName || type.name || null;
              }
              if (typeof type === "string") {
                return type;
              }
              break;
          }
          return null;
        }
        var NoFlags = (
          /*                      */
          0
        );
        var PerformedWork = (
          /*                */
          1
        );
        var Placement = (
          /*                    */
          2
        );
        var Update = (
          /*                       */
          4
        );
        var PlacementAndUpdate = (
          /*           */
          Placement | Update
        );
        var ChildDeletion = (
          /*                */
          16
        );
        var ContentReset = (
          /*                 */
          32
        );
        var Callback = (
          /*                     */
          64
        );
        var DidCapture = (
          /*                   */
          128
        );
        var ForceClientRender = (
          /*            */
          256
        );
        var Ref = (
          /*                          */
          512
        );
        var Snapshot = (
          /*                     */
          1024
        );
        var Passive = (
          /*                      */
          2048
        );
        var Hydrating = (
          /*                    */
          4096
        );
        var HydratingAndUpdate = (
          /*           */
          Hydrating | Update
        );
        var Visibility2 = (
          /*                   */
          8192
        );
        var StoreConsistency = (
          /*             */
          16384
        );
        var LifecycleEffectMask = Passive | Update | Callback | Ref | Snapshot | StoreConsistency;
        var HostEffectMask = (
          /*               */
          32767
        );
        var Incomplete = (
          /*                   */
          32768
        );
        var ShouldCapture = (
          /*                */
          65536
        );
        var ForceUpdateForLegacySuspense = (
          /* */
          131072
        );
        var Forked = (
          /*                       */
          1048576
        );
        var RefStatic = (
          /*                    */
          2097152
        );
        var LayoutStatic = (
          /*                 */
          4194304
        );
        var PassiveStatic = (
          /*                */
          8388608
        );
        var MountLayoutDev = (
          /*               */
          16777216
        );
        var MountPassiveDev = (
          /*              */
          33554432
        );
        var BeforeMutationMask = (
          // TODO: Remove Update flag from before mutation phase by re-landing Visibility
          // flag logic (see #20043)
          Update | Snapshot | 0
        );
        var MutationMask = Placement | Update | ChildDeletion | ContentReset | Ref | Hydrating | Visibility2;
        var LayoutMask = Update | Callback | Ref | Visibility2;
        var PassiveMask = Passive | ChildDeletion;
        var StaticMask = LayoutStatic | PassiveStatic | RefStatic;
        var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
        function getNearestMountedFiber(fiber) {
          var node56 = fiber;
          var nearestMounted = fiber;
          if (!fiber.alternate) {
            var nextNode = node56;
            do {
              node56 = nextNode;
              if ((node56.flags & (Placement | Hydrating)) !== NoFlags) {
                nearestMounted = node56.return;
              }
              nextNode = node56.return;
            } while (nextNode);
          } else {
            while (node56.return) {
              node56 = node56.return;
            }
          }
          if (node56.tag === HostRoot) {
            return nearestMounted;
          }
          return 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.", getComponentNameFromFiber(ownerFiber) || "A component");
              }
              instance._warnedAboutRefsInRender = true;
            }
          }
          var fiber = get3(component);
          if (!fiber) {
            return false;
          }
          return getNearestMountedFiber(fiber) === fiber;
        }
        function assertIsMounted(fiber) {
          if (getNearestMountedFiber(fiber) !== fiber) {
            throw new 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 new Error("Unable to find node on an unmounted component.");
            }
            if (nearestMounted !== fiber) {
              return null;
            }
            return fiber;
          }
          var a2 = fiber;
          var b = alternate;
          while (true) {
            var parentA = a2.return;
            if (parentA === null) {
              break;
            }
            var parentB = parentA.alternate;
            if (parentB === null) {
              var nextParent = parentA.return;
              if (nextParent !== null) {
                a2 = b = nextParent;
                continue;
              }
              break;
            }
            if (parentA.child === parentB.child) {
              var child = parentA.child;
              while (child) {
                if (child === a2) {
                  assertIsMounted(parentA);
                  return fiber;
                }
                if (child === b) {
                  assertIsMounted(parentA);
                  return alternate;
                }
                child = child.sibling;
              }
              throw new Error("Unable to find node on an unmounted component.");
            }
            if (a2.return !== b.return) {
              a2 = parentA;
              b = parentB;
            } else {
              var didFindChild = false;
              var _child = parentA.child;
              while (_child) {
                if (_child === a2) {
                  didFindChild = true;
                  a2 = parentA;
                  b = parentB;
                  break;
                }
                if (_child === b) {
                  didFindChild = true;
                  b = parentA;
                  a2 = parentB;
                  break;
                }
                _child = _child.sibling;
              }
              if (!didFindChild) {
                _child = parentB.child;
                while (_child) {
                  if (_child === a2) {
                    didFindChild = true;
                    a2 = parentB;
                    b = parentA;
                    break;
                  }
                  if (_child === b) {
                    didFindChild = true;
                    b = parentB;
                    a2 = parentA;
                    break;
                  }
                  _child = _child.sibling;
                }
                if (!didFindChild) {
                  throw new 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 (a2.alternate !== b) {
              throw new Error("Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue.");
            }
          }
          if (a2.tag !== HostRoot) {
            throw new Error("Unable to find node on an unmounted component.");
          }
          if (a2.stateNode.current === a2) {
            return fiber;
          }
          return alternate;
        }
        function findCurrentHostFiber(parent) {
          var currentParent = findCurrentFiberUsingSlowPath(parent);
          return currentParent !== null ? findCurrentHostFiberImpl(currentParent) : null;
        }
        function findCurrentHostFiberImpl(node56) {
          if (node56.tag === HostComponent || node56.tag === HostText) {
            return node56;
          }
          var child = node56.child;
          while (child !== null) {
            var match2 = findCurrentHostFiberImpl(child);
            if (match2 !== null) {
              return match2;
            }
            child = child.sibling;
          }
          return null;
        }
        function findCurrentHostFiberWithNoPortals(parent) {
          var currentParent = findCurrentFiberUsingSlowPath(parent);
          return currentParent !== null ? findCurrentHostFiberWithNoPortalsImpl(currentParent) : null;
        }
        function findCurrentHostFiberWithNoPortalsImpl(node56) {
          if (node56.tag === HostComponent || node56.tag === HostText) {
            return node56;
          }
          var child = node56.child;
          while (child !== null) {
            if (child.tag !== HostPortal) {
              var match2 = findCurrentHostFiberWithNoPortalsImpl(child);
              if (match2 !== null) {
                return match2;
              }
            }
            child = child.sibling;
          }
          return null;
        }
        var isArrayImpl = Array.isArray;
        function isArray2(a2) {
          return isArrayImpl(a2);
        }
        var getPublicInstance = $$$hostConfig.getPublicInstance;
        var getRootHostContext = $$$hostConfig.getRootHostContext;
        var getChildHostContext = $$$hostConfig.getChildHostContext;
        var prepareForCommit = $$$hostConfig.prepareForCommit;
        var resetAfterCommit = $$$hostConfig.resetAfterCommit;
        var createInstance = $$$hostConfig.createInstance;
        var appendInitialChild = $$$hostConfig.appendInitialChild;
        var finalizeInitialChildren = $$$hostConfig.finalizeInitialChildren;
        var prepareUpdate = $$$hostConfig.prepareUpdate;
        var shouldSetTextContent = $$$hostConfig.shouldSetTextContent;
        var createTextInstance = $$$hostConfig.createTextInstance;
        var scheduleTimeout = $$$hostConfig.scheduleTimeout;
        var cancelTimeout = $$$hostConfig.cancelTimeout;
        var noTimeout = $$$hostConfig.noTimeout;
        var now2 = $$$hostConfig.now;
        var isPrimaryRenderer = $$$hostConfig.isPrimaryRenderer;
        var warnsIfNotActing = $$$hostConfig.warnsIfNotActing;
        var supportsMutation = $$$hostConfig.supportsMutation;
        var supportsPersistence = $$$hostConfig.supportsPersistence;
        var supportsHydration = $$$hostConfig.supportsHydration;
        var getInstanceFromNode = $$$hostConfig.getInstanceFromNode;
        var beforeActiveInstanceBlur = $$$hostConfig.beforeActiveInstanceBlur;
        var afterActiveInstanceBlur = $$$hostConfig.afterActiveInstanceBlur;
        var preparePortalMount = $$$hostConfig.preparePortalMount;
        var prepareScopeUpdate = $$$hostConfig.preparePortalMount;
        var getInstanceFromScope = $$$hostConfig.getInstanceFromScope;
        var getCurrentEventPriority = $$$hostConfig.getCurrentEventPriority;
        var detachDeletedInstance = $$$hostConfig.detachDeletedInstance;
        var supportsMicrotasks = $$$hostConfig.supportsMicrotasks;
        var scheduleMicrotask = $$$hostConfig.scheduleMicrotask;
        var supportsTestSelectors = $$$hostConfig.supportsTestSelectors;
        var findFiberRoot = $$$hostConfig.findFiberRoot;
        var getBoundingRect = $$$hostConfig.getBoundingRect;
        var getTextContent = $$$hostConfig.getTextContent;
        var isHiddenSubtree = $$$hostConfig.isHiddenSubtree;
        var matchAccessibilityRole = $$$hostConfig.matchAccessibilityRole;
        var setFocusIfFocusable = $$$hostConfig.setFocusIfFocusable;
        var setupIntersectionObserver = $$$hostConfig.setupIntersectionObserver;
        var appendChild = $$$hostConfig.appendChild;
        var appendChildToContainer = $$$hostConfig.appendChildToContainer;
        var commitTextUpdate = $$$hostConfig.commitTextUpdate;
        var commitMount = $$$hostConfig.commitMount;
        var commitUpdate = $$$hostConfig.commitUpdate;
        var insertBefore = $$$hostConfig.insertBefore;
        var insertInContainerBefore = $$$hostConfig.insertInContainerBefore;
        var removeChild = $$$hostConfig.removeChild;
        var removeChildFromContainer = $$$hostConfig.removeChildFromContainer;
        var resetTextContent = $$$hostConfig.resetTextContent;
        var hideInstance = $$$hostConfig.hideInstance;
        var hideTextInstance = $$$hostConfig.hideTextInstance;
        var unhideInstance = $$$hostConfig.unhideInstance;
        var unhideTextInstance = $$$hostConfig.unhideTextInstance;
        var clearContainer = $$$hostConfig.clearContainer;
        var cloneInstance = $$$hostConfig.cloneInstance;
        var createContainerChildSet = $$$hostConfig.createContainerChildSet;
        var appendChildToContainerChildSet = $$$hostConfig.appendChildToContainerChildSet;
        var finalizeContainerChildren = $$$hostConfig.finalizeContainerChildren;
        var replaceContainerChildren = $$$hostConfig.replaceContainerChildren;
        var getOffscreenContainerType = $$$hostConfig.getOffscreenContainerType;
        var getOffscreenContainerProps = $$$hostConfig.getOffscreenContainerProps;
        var cloneHiddenInstance = $$$hostConfig.cloneHiddenInstance;
        var cloneHiddenTextInstance = $$$hostConfig.cloneHiddenTextInstance;
        var canHydrateInstance = $$$hostConfig.canHydrateInstance;
        var canHydrateTextInstance = $$$hostConfig.canHydrateTextInstance;
        var canHydrateSuspenseInstance = $$$hostConfig.canHydrateSuspenseInstance;
        var isSuspenseInstancePending = $$$hostConfig.isSuspenseInstancePending;
        var isSuspenseInstanceFallback = $$$hostConfig.isSuspenseInstanceFallback;
        var registerSuspenseInstanceRetry = $$$hostConfig.registerSuspenseInstanceRetry;
        var getNextHydratableSibling = $$$hostConfig.getNextHydratableSibling;
        var getFirstHydratableChild = $$$hostConfig.getFirstHydratableChild;
        var getFirstHydratableChildWithinContainer = $$$hostConfig.getFirstHydratableChildWithinContainer;
        var getFirstHydratableChildWithinSuspenseInstance = $$$hostConfig.getFirstHydratableChildWithinSuspenseInstance;
        var hydrateInstance = $$$hostConfig.hydrateInstance;
        var hydrateTextInstance = $$$hostConfig.hydrateTextInstance;
        var hydrateSuspenseInstance = $$$hostConfig.hydrateSuspenseInstance;
        var getNextHydratableInstanceAfterSuspenseInstance = $$$hostConfig.getNextHydratableInstanceAfterSuspenseInstance;
        var commitHydratedContainer = $$$hostConfig.commitHydratedContainer;
        var commitHydratedSuspenseInstance = $$$hostConfig.commitHydratedSuspenseInstance;
        var clearSuspenseBoundary = $$$hostConfig.clearSuspenseBoundary;
        var clearSuspenseBoundaryFromContainer = $$$hostConfig.clearSuspenseBoundaryFromContainer;
        var shouldDeleteUnhydratedTailInstances = $$$hostConfig.shouldDeleteUnhydratedTailInstances;
        var didNotMatchHydratedContainerTextInstance = $$$hostConfig.didNotMatchHydratedContainerTextInstance;
        var didNotMatchHydratedTextInstance = $$$hostConfig.didNotMatchHydratedTextInstance;
        var didNotHydrateInstanceWithinContainer = $$$hostConfig.didNotHydrateInstanceWithinContainer;
        var didNotHydrateInstanceWithinSuspenseInstance = $$$hostConfig.didNotHydrateInstanceWithinSuspenseInstance;
        var didNotHydrateInstance = $$$hostConfig.didNotHydrateInstance;
        var didNotFindHydratableInstanceWithinContainer = $$$hostConfig.didNotFindHydratableInstanceWithinContainer;
        var didNotFindHydratableTextInstanceWithinContainer = $$$hostConfig.didNotFindHydratableTextInstanceWithinContainer;
        var didNotFindHydratableSuspenseInstanceWithinContainer = $$$hostConfig.didNotFindHydratableSuspenseInstanceWithinContainer;
        var didNotFindHydratableInstanceWithinSuspenseInstance = $$$hostConfig.didNotFindHydratableInstanceWithinSuspenseInstance;
        var didNotFindHydratableTextInstanceWithinSuspenseInstance = $$$hostConfig.didNotFindHydratableTextInstanceWithinSuspenseInstance;
        var didNotFindHydratableSuspenseInstanceWithinSuspenseInstance = $$$hostConfig.didNotFindHydratableSuspenseInstanceWithinSuspenseInstance;
        var didNotFindHydratableInstance = $$$hostConfig.didNotFindHydratableInstance;
        var didNotFindHydratableTextInstance = $$$hostConfig.didNotFindHydratableTextInstance;
        var didNotFindHydratableSuspenseInstance = $$$hostConfig.didNotFindHydratableSuspenseInstance;
        var errorHydratingContainer = $$$hostConfig.errorHydratingContainer;
        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: assign3({}, props, {
                  value: prevLog
                }),
                info: assign3({}, props, {
                  value: prevInfo
                }),
                warn: assign3({}, props, {
                  value: prevWarn
                }),
                error: assign3({}, props, {
                  value: prevError
                }),
                group: assign3({}, props, {
                  value: prevGroup
                }),
                groupCollapsed: assign3({}, props, {
                  value: prevGroupCollapsed
                }),
                groupEnd: assign3({}, 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 prefix3;
        function describeBuiltInComponentFrame(name2, source, ownerFn) {
          {
            if (prefix3 === void 0) {
              try {
                throw Error();
              } catch (x2) {
                var match2 = x2.stack.trim().match(/\n( *(at )?)/);
                prefix3 = match2 && match2[1] || "";
              }
            }
            return "\n" + prefix3 + name2;
          }
        }
        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 (x2) {
                  control = x2;
                }
                Reflect.construct(fn, [], Fake);
              } else {
                try {
                  Fake.call();
                } catch (x2) {
                  control = x2;
                }
                fn.call(Fake.prototype);
              }
            } else {
              try {
                throw Error();
              } catch (x2) {
                control = x2;
              }
              fn();
            }
          } catch (sample) {
            if (sample && control && typeof sample.stack === "string") {
              var sampleLines = sample.stack.split("\n");
              var controlLines = control.stack.split("\n");
              var s2 = sampleLines.length - 1;
              var c4 = controlLines.length - 1;
              while (s2 >= 1 && c4 >= 0 && sampleLines[s2] !== controlLines[c4]) {
                c4--;
              }
              for (; s2 >= 1 && c4 >= 0; s2--, c4--) {
                if (sampleLines[s2] !== controlLines[c4]) {
                  if (s2 !== 1 || c4 !== 1) {
                    do {
                      s2--;
                      c4--;
                      if (c4 < 0 || sampleLines[s2] !== controlLines[c4]) {
                        var _frame = "\n" + sampleLines[s2].replace(" at new ", " at ");
                        if (fn.displayName && _frame.includes("<anonymous>")) {
                          _frame = _frame.replace("<anonymous>", fn.displayName);
                        }
                        {
                          if (typeof fn === "function") {
                            componentFrameCache.set(fn, _frame);
                          }
                        }
                        return _frame;
                      }
                    } while (s2 >= 1 && c4 >= 0);
                  }
                  break;
                }
              }
            }
          } finally {
            reentry = false;
            {
              ReactCurrentDispatcher.current = previousDispatcher;
              reenableLogs();
            }
            Error.prepareStackTrace = previousPrepareStackTrace;
          }
          var name2 = fn ? fn.displayName || fn.name : "";
          var syntheticFrame = name2 ? describeBuiltInComponentFrame(name2) : "";
          {
            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(Component8) {
          var prototype = Component8.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_LAZY_TYPE: {
                var lazyComponent = type;
                var payload = lazyComponent._payload;
                var init = lazyComponent._init;
                try {
                  return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
                } catch (x2) {
                }
              }
            }
          }
          return "";
        }
        var hasOwnProperty3 = Object.prototype.hasOwnProperty;
        var loggedTypeFailures = {};
        var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
        function setCurrentlyValidatingElement(element2) {
          {
            if (element2) {
              var owner = element2._owner;
              var stack = describeUnknownElementTypeFrameInDEV(element2.type, element2._source, owner ? owner.type : null);
              ReactDebugCurrentFrame.setExtraStackFrame(stack);
            } else {
              ReactDebugCurrentFrame.setExtraStackFrame(null);
            }
          }
        }
        function checkPropTypes(typeSpecs, values2, location2, componentName, element2) {
          {
            var has2 = Function.call.bind(hasOwnProperty3);
            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") + ": " + location2 + " 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](values2, typeSpecName, componentName, location2, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
                } catch (ex) {
                  error$1 = ex;
                }
                if (error$1 && !(error$1 instanceof Error)) {
                  setCurrentlyValidatingElement(element2);
                  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", location2, typeSpecName, typeof error$1);
                  setCurrentlyValidatingElement(null);
                }
                if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
                  loggedTypeFailures[error$1.message] = true;
                  setCurrentlyValidatingElement(element2);
                  error("Failed %s type: %s", location2, error$1.message);
                  setCurrentlyValidatingElement(null);
                }
              }
            }
          }
        }
        var valueStack = [];
        var fiberStack;
        {
          fiberStack = [];
        }
        var index = -1;
        function createCursor(defaultValue) {
          return {
            current: defaultValue
          };
        }
        function pop(cursor3, fiber) {
          if (index < 0) {
            {
              error("Unexpected pop.");
            }
            return;
          }
          {
            if (fiber !== fiberStack[index]) {
              error("Unexpected Fiber popped.");
            }
          }
          cursor3.current = valueStack[index];
          valueStack[index] = null;
          {
            fiberStack[index] = null;
          }
          index--;
        }
        function push(cursor3, value, fiber) {
          index++;
          valueStack[index] = cursor3.current;
          {
            fiberStack[index] = fiber;
          }
          cursor3.current = value;
        }
        var warnedAboutMissingGetChildContext;
        {
          warnedAboutMissingGetChildContext = {};
        }
        var emptyContextObject = {};
        {
          Object.freeze(emptyContextObject);
        }
        var contextStackCursor = createCursor(emptyContextObject);
        var didPerformWorkStackCursor = createCursor(false);
        var previousContext = emptyContextObject;
        function getUnmaskedContext(workInProgress2, Component8, didPushOwnContextIfProvider) {
          {
            if (didPushOwnContextIfProvider && isContextProvider(Component8)) {
              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 context2 = {};
            for (var key in contextTypes) {
              context2[key] = unmaskedContext[key];
            }
            {
              var name2 = getComponentNameFromFiber(workInProgress2) || "Unknown";
              checkPropTypes(contextTypes, context2, "context", name2);
            }
            if (instance) {
              cacheContext(workInProgress2, unmaskedContext, context2);
            }
            return context2;
          }
        }
        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, context2, didChange) {
          {
            if (contextStackCursor.current !== emptyContextObject) {
              throw new Error("Unexpected context found on stack. This error is likely caused by a bug in React. Please file an issue.");
            }
            push(contextStackCursor, context2, 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 = getComponentNameFromFiber(fiber) || "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 new Error((getComponentNameFromFiber(fiber) || "Unknown") + '.getChildContext(): key "' + contextKey + '" is not defined in childContextTypes.');
              }
            }
            {
              var name2 = getComponentNameFromFiber(fiber) || "Unknown";
              checkPropTypes(childContextTypes, childContext, "child context", name2);
            }
            return assign3({}, 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 new 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 new 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 node56 = fiber;
            do {
              switch (node56.tag) {
                case HostRoot:
                  return node56.stateNode.context;
                case ClassComponent: {
                  var Component8 = node56.type;
                  if (isContextProvider(Component8)) {
                    return node56.stateNode.__reactInternalMemoizedMergedChildContext;
                  }
                  break;
                }
              }
              node56 = node56.return;
            } while (node56 !== null);
            throw new Error("Found unexpected detached subtree parent. This error is likely caused by a bug in React. Please file an issue.");
          }
        }
        var LegacyRoot = 0;
        var ConcurrentRoot2 = 1;
        var NoMode = (
          /*                         */
          0
        );
        var ConcurrentMode = (
          /*                 */
          1
        );
        var ProfileMode = (
          /*                    */
          2
        );
        var StrictLegacyMode = (
          /*               */
          8
        );
        var StrictEffectsMode = (
          /*              */
          16
        );
        var clz32 = Math.clz32 ? Math.clz32 : clz32Fallback;
        var log2 = Math.log;
        var LN2 = Math.LN2;
        function clz32Fallback(x2) {
          var asUint = x2 >>> 0;
          if (asUint === 0) {
            return 32;
          }
          return 31 - (log2(asUint) / LN2 | 0) | 0;
        }
        var TotalLanes = 31;
        var NoLanes = (
          /*                        */
          0
        );
        var NoLane = (
          /*                          */
          0
        );
        var SyncLane = (
          /*                        */
          1
        );
        var InputContinuousHydrationLane = (
          /*    */
          2
        );
        var InputContinuousLane = (
          /*            */
          4
        );
        var DefaultHydrationLane = (
          /*            */
          8
        );
        var DefaultLane = (
          /*                    */
          16
        );
        var TransitionHydrationLane = (
          /*                */
          32
        );
        var TransitionLanes = (
          /*                       */
          4194240
        );
        var TransitionLane1 = (
          /*                        */
          64
        );
        var TransitionLane2 = (
          /*                        */
          128
        );
        var TransitionLane3 = (
          /*                        */
          256
        );
        var TransitionLane4 = (
          /*                        */
          512
        );
        var TransitionLane5 = (
          /*                        */
          1024
        );
        var TransitionLane6 = (
          /*                        */
          2048
        );
        var TransitionLane7 = (
          /*                        */
          4096
        );
        var TransitionLane8 = (
          /*                        */
          8192
        );
        var TransitionLane9 = (
          /*                        */
          16384
        );
        var TransitionLane10 = (
          /*                       */
          32768
        );
        var TransitionLane11 = (
          /*                       */
          65536
        );
        var TransitionLane12 = (
          /*                       */
          131072
        );
        var TransitionLane13 = (
          /*                       */
          262144
        );
        var TransitionLane14 = (
          /*                       */
          524288
        );
        var TransitionLane15 = (
          /*                       */
          1048576
        );
        var TransitionLane16 = (
          /*                       */
          2097152
        );
        var RetryLanes = (
          /*                            */
          130023424
        );
        var RetryLane1 = (
          /*                             */
          4194304
        );
        var RetryLane2 = (
          /*                             */
          8388608
        );
        var RetryLane3 = (
          /*                             */
          16777216
        );
        var RetryLane4 = (
          /*                             */
          33554432
        );
        var RetryLane5 = (
          /*                             */
          67108864
        );
        var SomeRetryLane = RetryLane1;
        var SelectiveHydrationLane = (
          /*          */
          134217728
        );
        var NonIdleLanes = (
          /*                                 */
          268435455
        );
        var IdleHydrationLane = (
          /*               */
          268435456
        );
        var IdleLane = (
          /*                       */
          536870912
        );
        var OffscreenLane = (
          /*                   */
          1073741824
        );
        function getLabelForLane(lane) {
          {
            if (lane & SyncLane) {
              return "Sync";
            }
            if (lane & InputContinuousHydrationLane) {
              return "InputContinuousHydration";
            }
            if (lane & InputContinuousLane) {
              return "InputContinuous";
            }
            if (lane & DefaultHydrationLane) {
              return "DefaultHydration";
            }
            if (lane & DefaultLane) {
              return "Default";
            }
            if (lane & TransitionHydrationLane) {
              return "TransitionHydration";
            }
            if (lane & TransitionLanes) {
              return "Transition";
            }
            if (lane & RetryLanes) {
              return "Retry";
            }
            if (lane & SelectiveHydrationLane) {
              return "SelectiveHydration";
            }
            if (lane & IdleHydrationLane) {
              return "IdleHydration";
            }
            if (lane & IdleLane) {
              return "Idle";
            }
            if (lane & OffscreenLane) {
              return "Offscreen";
            }
          }
        }
        var NoTimestamp = -1;
        var nextTransitionLane = TransitionLane1;
        var nextRetryLane = RetryLane1;
        function getHighestPriorityLanes(lanes) {
          switch (getHighestPriorityLane(lanes)) {
            case SyncLane:
              return SyncLane;
            case InputContinuousHydrationLane:
              return InputContinuousHydrationLane;
            case InputContinuousLane:
              return InputContinuousLane;
            case DefaultHydrationLane:
              return DefaultHydrationLane;
            case DefaultLane:
              return DefaultLane;
            case TransitionHydrationLane:
              return TransitionHydrationLane;
            case TransitionLane1:
            case TransitionLane2:
            case TransitionLane3:
            case TransitionLane4:
            case TransitionLane5:
            case TransitionLane6:
            case TransitionLane7:
            case TransitionLane8:
            case TransitionLane9:
            case TransitionLane10:
            case TransitionLane11:
            case TransitionLane12:
            case TransitionLane13:
            case TransitionLane14:
            case TransitionLane15:
            case TransitionLane16:
              return lanes & TransitionLanes;
            case RetryLane1:
            case RetryLane2:
            case RetryLane3:
            case RetryLane4:
            case RetryLane5:
              return lanes & RetryLanes;
            case SelectiveHydrationLane:
              return SelectiveHydrationLane;
            case IdleHydrationLane:
              return IdleHydrationLane;
            case IdleLane:
              return IdleLane;
            case OffscreenLane:
              return OffscreenLane;
            default:
              {
                error("Should have found matching lanes. This is a bug in React.");
              }
              return lanes;
          }
        }
        function getNextLanes(root2, wipLanes) {
          var pendingLanes = root2.pendingLanes;
          if (pendingLanes === NoLanes) {
            return NoLanes;
          }
          var nextLanes = NoLanes;
          var suspendedLanes = root2.suspendedLanes;
          var pingedLanes = root2.pingedLanes;
          var nonIdlePendingLanes = pendingLanes & NonIdleLanes;
          if (nonIdlePendingLanes !== NoLanes) {
            var nonIdleUnblockedLanes = nonIdlePendingLanes & ~suspendedLanes;
            if (nonIdleUnblockedLanes !== NoLanes) {
              nextLanes = getHighestPriorityLanes(nonIdleUnblockedLanes);
            } else {
              var nonIdlePingedLanes = nonIdlePendingLanes & pingedLanes;
              if (nonIdlePingedLanes !== NoLanes) {
                nextLanes = getHighestPriorityLanes(nonIdlePingedLanes);
              }
            }
          } else {
            var unblockedLanes = pendingLanes & ~suspendedLanes;
            if (unblockedLanes !== NoLanes) {
              nextLanes = getHighestPriorityLanes(unblockedLanes);
            } else {
              if (pingedLanes !== NoLanes) {
                nextLanes = getHighestPriorityLanes(pingedLanes);
              }
            }
          }
          if (nextLanes === NoLanes) {
            return NoLanes;
          }
          if (wipLanes !== NoLanes && wipLanes !== nextLanes && // If we already suspended with a delay, then interrupting is fine. Don't
          // bother waiting until the root is complete.
          (wipLanes & suspendedLanes) === NoLanes) {
            var nextLane = getHighestPriorityLane(nextLanes);
            var wipLane = getHighestPriorityLane(wipLanes);
            if (
              // Tests whether the next lane is equal or lower priority than the wip
              // one. This works because the bits decrease in priority as you go left.
              nextLane >= wipLane || // Default priority updates should not interrupt transition updates. The
              // only difference between default updates and transition updates is that
              // default updates do not support refresh transitions.
              nextLane === DefaultLane && (wipLane & TransitionLanes) !== NoLanes
            ) {
              return wipLanes;
            }
          }
          if ((nextLanes & InputContinuousLane) !== NoLanes) {
            nextLanes |= pendingLanes & DefaultLane;
          }
          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) {
          switch (lane) {
            case SyncLane:
            case InputContinuousHydrationLane:
            case InputContinuousLane:
              return currentTime + 250;
            case DefaultHydrationLane:
            case DefaultLane:
            case TransitionHydrationLane:
            case TransitionLane1:
            case TransitionLane2:
            case TransitionLane3:
            case TransitionLane4:
            case TransitionLane5:
            case TransitionLane6:
            case TransitionLane7:
            case TransitionLane8:
            case TransitionLane9:
            case TransitionLane10:
            case TransitionLane11:
            case TransitionLane12:
            case TransitionLane13:
            case TransitionLane14:
            case TransitionLane15:
            case TransitionLane16:
              return currentTime + 5e3;
            case RetryLane1:
            case RetryLane2:
            case RetryLane3:
            case RetryLane4:
            case RetryLane5:
              return NoTimestamp;
            case SelectiveHydrationLane:
            case IdleHydrationLane:
            case IdleLane:
            case OffscreenLane:
              return NoTimestamp;
            default:
              {
                error("Should have found matching lanes. This is a bug in React.");
              }
              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 getHighestPriorityPendingLanes(root2) {
          return getHighestPriorityLanes(root2.pendingLanes);
        }
        function getLanesToRetrySynchronouslyOnError(root2) {
          var everythingButOffscreen = root2.pendingLanes & ~OffscreenLane;
          if (everythingButOffscreen !== NoLanes) {
            return everythingButOffscreen;
          }
          if (everythingButOffscreen & OffscreenLane) {
            return OffscreenLane;
          }
          return NoLanes;
        }
        function includesSyncLane(lanes) {
          return (lanes & SyncLane) !== NoLanes;
        }
        function includesNonIdleWork(lanes) {
          return (lanes & NonIdleLanes) !== NoLanes;
        }
        function includesOnlyRetries(lanes) {
          return (lanes & RetryLanes) === lanes;
        }
        function includesOnlyTransitions(lanes) {
          return (lanes & TransitionLanes) === lanes;
        }
        function includesBlockingLane(root2, lanes) {
          var SyncDefaultLanes = InputContinuousHydrationLane | InputContinuousLane | DefaultHydrationLane | DefaultLane;
          return (lanes & SyncDefaultLanes) !== NoLanes;
        }
        function includesExpiredLane(root2, lanes) {
          return (lanes & root2.expiredLanes) !== NoLanes;
        }
        function isTransitionLane(lane) {
          return (lane & TransitionLanes) !== 0;
        }
        function claimNextTransitionLane() {
          var lane = nextTransitionLane;
          nextTransitionLane <<= 1;
          if ((nextTransitionLane & TransitionLanes) === 0) {
            nextTransitionLane = TransitionLane1;
          }
          return lane;
        }
        function claimNextRetryLane() {
          var lane = nextRetryLane;
          nextRetryLane <<= 1;
          if ((nextRetryLane & RetryLanes) === 0) {
            nextRetryLane = RetryLane1;
          }
          return lane;
        }
        function getHighestPriorityLane(lanes) {
          return lanes & -lanes;
        }
        function pickArbitraryLane(lanes) {
          return getHighestPriorityLane(lanes);
        }
        function pickArbitraryLaneIndex(lanes) {
          return 31 - clz32(lanes);
        }
        function laneToIndex(lane) {
          return pickArbitraryLaneIndex(lane);
        }
        function includesSomeLane(a2, b) {
          return (a2 & b) !== NoLanes;
        }
        function isSubsetOfLanes(set4, subset) {
          return (set4 & subset) === subset;
        }
        function mergeLanes(a2, b) {
          return a2 | b;
        }
        function removeLanes(set4, subset) {
          return set4 & ~subset;
        }
        function intersectLanes(a2, b) {
          return a2 & b;
        }
        function laneToLanes(lane) {
          return lane;
        }
        function higherPriorityLane(a2, b) {
          return a2 !== NoLane && a2 < b ? a2 : b;
        }
        function createLaneMap(initial) {
          var laneMap = [];
          for (var i2 = 0; i2 < TotalLanes; i2++) {
            laneMap.push(initial);
          }
          return laneMap;
        }
        function markRootUpdated(root2, updateLane, eventTime) {
          root2.pendingLanes |= updateLane;
          if (updateLane !== IdleLane) {
            root2.suspendedLanes = NoLanes;
            root2.pingedLanes = NoLanes;
          }
          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 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) {
          var rootEntangledLanes = root2.entangledLanes |= entangledLanes;
          var entanglements = root2.entanglements;
          var lanes = rootEntangledLanes;
          while (lanes) {
            var index2 = pickArbitraryLaneIndex(lanes);
            var lane = 1 << index2;
            if (
              // Is this one of the newly entangled lanes?
              lane & entangledLanes | // Is this lane transitively entangled with the newly entangled lanes?
              entanglements[index2] & entangledLanes
            ) {
              entanglements[index2] |= entangledLanes;
            }
            lanes &= ~lane;
          }
        }
        function getBumpedLaneForHydration(root2, renderLanes2) {
          var renderLane = getHighestPriorityLane(renderLanes2);
          var lane;
          switch (renderLane) {
            case InputContinuousLane:
              lane = InputContinuousHydrationLane;
              break;
            case DefaultLane:
              lane = DefaultHydrationLane;
              break;
            case TransitionLane1:
            case TransitionLane2:
            case TransitionLane3:
            case TransitionLane4:
            case TransitionLane5:
            case TransitionLane6:
            case TransitionLane7:
            case TransitionLane8:
            case TransitionLane9:
            case TransitionLane10:
            case TransitionLane11:
            case TransitionLane12:
            case TransitionLane13:
            case TransitionLane14:
            case TransitionLane15:
            case TransitionLane16:
            case RetryLane1:
            case RetryLane2:
            case RetryLane3:
            case RetryLane4:
            case RetryLane5:
              lane = TransitionHydrationLane;
              break;
            case IdleLane:
              lane = IdleHydrationLane;
              break;
            default:
              lane = NoLane;
              break;
          }
          if ((lane & (root2.suspendedLanes | renderLanes2)) !== NoLane) {
            return NoLane;
          }
          return lane;
        }
        function addFiberToLanesMap(root2, fiber, lanes) {
          if (!isDevToolsPresent) {
            return;
          }
          var pendingUpdatersLaneMap = root2.pendingUpdatersLaneMap;
          while (lanes > 0) {
            var index2 = laneToIndex(lanes);
            var lane = 1 << index2;
            var updaters = pendingUpdatersLaneMap[index2];
            updaters.add(fiber);
            lanes &= ~lane;
          }
        }
        function movePendingFibersToMemoized(root2, lanes) {
          if (!isDevToolsPresent) {
            return;
          }
          var pendingUpdatersLaneMap = root2.pendingUpdatersLaneMap;
          var memoizedUpdaters = root2.memoizedUpdaters;
          while (lanes > 0) {
            var index2 = laneToIndex(lanes);
            var lane = 1 << index2;
            var updaters = pendingUpdatersLaneMap[index2];
            if (updaters.size > 0) {
              updaters.forEach(function(fiber) {
                var alternate = fiber.alternate;
                if (alternate === null || !memoizedUpdaters.has(alternate)) {
                  memoizedUpdaters.add(fiber);
                }
              });
              updaters.clear();
            }
            lanes &= ~lane;
          }
        }
        var DiscreteEventPriority2 = SyncLane;
        var ContinuousEventPriority2 = InputContinuousLane;
        var DefaultEventPriority2 = DefaultLane;
        var IdleEventPriority = IdleLane;
        var currentUpdatePriority = NoLane;
        function getCurrentUpdatePriority() {
          return currentUpdatePriority;
        }
        function setCurrentUpdatePriority(newPriority) {
          currentUpdatePriority = newPriority;
        }
        function runWithPriority(priority, fn) {
          var previousPriority = currentUpdatePriority;
          try {
            currentUpdatePriority = priority;
            return fn();
          } finally {
            currentUpdatePriority = previousPriority;
          }
        }
        function higherEventPriority(a2, b) {
          return a2 !== 0 && a2 < b ? a2 : b;
        }
        function lowerEventPriority(a2, b) {
          return a2 === 0 || a2 > b ? a2 : b;
        }
        function isHigherEventPriority(a2, b) {
          return a2 !== 0 && a2 < b;
        }
        function lanesToEventPriority(lanes) {
          var lane = getHighestPriorityLane(lanes);
          if (!isHigherEventPriority(DiscreteEventPriority2, lane)) {
            return DiscreteEventPriority2;
          }
          if (!isHigherEventPriority(ContinuousEventPriority2, lane)) {
            return ContinuousEventPriority2;
          }
          if (includesNonIdleWork(lane)) {
            return DefaultEventPriority2;
          }
          return IdleEventPriority;
        }
        var scheduleCallback = Scheduler.unstable_scheduleCallback;
        var cancelCallback = Scheduler.unstable_cancelCallback;
        var shouldYield = Scheduler.unstable_shouldYield;
        var requestPaint = Scheduler.unstable_requestPaint;
        var now$1 = Scheduler.unstable_now;
        var ImmediatePriority = Scheduler.unstable_ImmediatePriority;
        var UserBlockingPriority = Scheduler.unstable_UserBlockingPriority;
        var NormalPriority = Scheduler.unstable_NormalPriority;
        var IdlePriority = Scheduler.unstable_IdlePriority;
        var unstable_yieldValue = Scheduler.unstable_yieldValue;
        var unstable_setDisableYieldValue = Scheduler.unstable_setDisableYieldValue;
        var rendererID = null;
        var injectedHook = null;
        var injectedProfilingHooks = 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 {
            if (enableSchedulingProfiler) {
              internals = assign3({}, internals, {
                getLaneLabelMap,
                injectProfilingHooks
              });
            }
            rendererID = hook.inject(internals);
            injectedHook = hook;
          } catch (err) {
            {
              error("React instrumentation encountered an error: %s.", err);
            }
          }
          if (hook.checkDCE) {
            return true;
          } else {
            return false;
          }
        }
        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, eventPriority) {
          if (injectedHook && typeof injectedHook.onCommitFiberRoot === "function") {
            try {
              var didError = (root2.current.flags & DidCapture) === DidCapture;
              if (enableProfilerTimer) {
                var schedulerPriority;
                switch (eventPriority) {
                  case DiscreteEventPriority2:
                    schedulerPriority = ImmediatePriority;
                    break;
                  case ContinuousEventPriority2:
                    schedulerPriority = UserBlockingPriority;
                    break;
                  case DefaultEventPriority2:
                    schedulerPriority = NormalPriority;
                    break;
                  case IdleEventPriority:
                    schedulerPriority = IdlePriority;
                    break;
                  default:
                    schedulerPriority = NormalPriority;
                    break;
                }
                injectedHook.onCommitFiberRoot(rendererID, root2, schedulerPriority, didError);
              } else {
                injectedHook.onCommitFiberRoot(rendererID, root2, void 0, didError);
              }
            } catch (err) {
              {
                if (!hasLoggedError) {
                  hasLoggedError = true;
                  error("React instrumentation encountered an error: %s", err);
                }
              }
            }
          }
        }
        function onPostCommitRoot(root2) {
          if (injectedHook && typeof injectedHook.onPostCommitFiberRoot === "function") {
            try {
              injectedHook.onPostCommitFiberRoot(rendererID, root2);
            } 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);
                }
              }
            }
          }
        }
        function setIsStrictModeForDevtools(newIsStrictMode) {
          {
            if (typeof unstable_yieldValue === "function") {
              unstable_setDisableYieldValue(newIsStrictMode);
              setSuppressWarning(newIsStrictMode);
            }
            if (injectedHook && typeof injectedHook.setStrictMode === "function") {
              try {
                injectedHook.setStrictMode(rendererID, newIsStrictMode);
              } catch (err) {
                {
                  if (!hasLoggedError) {
                    hasLoggedError = true;
                    error("React instrumentation encountered an error: %s", err);
                  }
                }
              }
            }
          }
        }
        function injectProfilingHooks(profilingHooks) {
          injectedProfilingHooks = profilingHooks;
        }
        function getLaneLabelMap() {
          {
            var map3 = /* @__PURE__ */ new Map();
            var lane = 1;
            for (var index2 = 0; index2 < TotalLanes; index2++) {
              var label = getLabelForLane(lane);
              map3.set(lane, label);
              lane *= 2;
            }
            return map3;
          }
        }
        function markCommitStarted(lanes) {
          {
            if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markCommitStarted === "function") {
              injectedProfilingHooks.markCommitStarted(lanes);
            }
          }
        }
        function markCommitStopped() {
          {
            if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markCommitStopped === "function") {
              injectedProfilingHooks.markCommitStopped();
            }
          }
        }
        function markComponentRenderStarted(fiber) {
          {
            if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentRenderStarted === "function") {
              injectedProfilingHooks.markComponentRenderStarted(fiber);
            }
          }
        }
        function markComponentRenderStopped() {
          {
            if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentRenderStopped === "function") {
              injectedProfilingHooks.markComponentRenderStopped();
            }
          }
        }
        function markComponentPassiveEffectMountStarted(fiber) {
          {
            if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentPassiveEffectMountStarted === "function") {
              injectedProfilingHooks.markComponentPassiveEffectMountStarted(fiber);
            }
          }
        }
        function markComponentPassiveEffectMountStopped() {
          {
            if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentPassiveEffectMountStopped === "function") {
              injectedProfilingHooks.markComponentPassiveEffectMountStopped();
            }
          }
        }
        function markComponentPassiveEffectUnmountStarted(fiber) {
          {
            if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStarted === "function") {
              injectedProfilingHooks.markComponentPassiveEffectUnmountStarted(fiber);
            }
          }
        }
        function markComponentPassiveEffectUnmountStopped() {
          {
            if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStopped === "function") {
              injectedProfilingHooks.markComponentPassiveEffectUnmountStopped();
            }
          }
        }
        function markComponentLayoutEffectMountStarted(fiber) {
          {
            if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentLayoutEffectMountStarted === "function") {
              injectedProfilingHooks.markComponentLayoutEffectMountStarted(fiber);
            }
          }
        }
        function markComponentLayoutEffectMountStopped() {
          {
            if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentLayoutEffectMountStopped === "function") {
              injectedProfilingHooks.markComponentLayoutEffectMountStopped();
            }
          }
        }
        function markComponentLayoutEffectUnmountStarted(fiber) {
          {
            if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentLayoutEffectUnmountStarted === "function") {
              injectedProfilingHooks.markComponentLayoutEffectUnmountStarted(fiber);
            }
          }
        }
        function markComponentLayoutEffectUnmountStopped() {
          {
            if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentLayoutEffectUnmountStopped === "function") {
              injectedProfilingHooks.markComponentLayoutEffectUnmountStopped();
            }
          }
        }
        function markComponentErrored(fiber, thrownValue, lanes) {
          {
            if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentErrored === "function") {
              injectedProfilingHooks.markComponentErrored(fiber, thrownValue, lanes);
            }
          }
        }
        function markComponentSuspended(fiber, wakeable, lanes) {
          {
            if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentSuspended === "function") {
              injectedProfilingHooks.markComponentSuspended(fiber, wakeable, lanes);
            }
          }
        }
        function markLayoutEffectsStarted(lanes) {
          {
            if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markLayoutEffectsStarted === "function") {
              injectedProfilingHooks.markLayoutEffectsStarted(lanes);
            }
          }
        }
        function markLayoutEffectsStopped() {
          {
            if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markLayoutEffectsStopped === "function") {
              injectedProfilingHooks.markLayoutEffectsStopped();
            }
          }
        }
        function markPassiveEffectsStarted(lanes) {
          {
            if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markPassiveEffectsStarted === "function") {
              injectedProfilingHooks.markPassiveEffectsStarted(lanes);
            }
          }
        }
        function markPassiveEffectsStopped() {
          {
            if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markPassiveEffectsStopped === "function") {
              injectedProfilingHooks.markPassiveEffectsStopped();
            }
          }
        }
        function markRenderStarted(lanes) {
          {
            if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markRenderStarted === "function") {
              injectedProfilingHooks.markRenderStarted(lanes);
            }
          }
        }
        function markRenderYielded() {
          {
            if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markRenderYielded === "function") {
              injectedProfilingHooks.markRenderYielded();
            }
          }
        }
        function markRenderStopped() {
          {
            if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markRenderStopped === "function") {
              injectedProfilingHooks.markRenderStopped();
            }
          }
        }
        function markRenderScheduled(lane) {
          {
            if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markRenderScheduled === "function") {
              injectedProfilingHooks.markRenderScheduled(lane);
            }
          }
        }
        function markForceUpdateScheduled(fiber, lane) {
          {
            if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markForceUpdateScheduled === "function") {
              injectedProfilingHooks.markForceUpdateScheduled(fiber, lane);
            }
          }
        }
        function markStateUpdateScheduled(fiber, lane) {
          {
            if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markStateUpdateScheduled === "function") {
              injectedProfilingHooks.markStateUpdateScheduled(fiber, lane);
            }
          }
        }
        function is2(x2, y2) {
          return x2 === y2 && (x2 !== 0 || 1 / x2 === 1 / y2) || x2 !== x2 && y2 !== y2;
        }
        var objectIs = typeof Object.is === "function" ? Object.is : is2;
        var syncQueue = null;
        var includesLegacySyncCallbacks = false;
        var isFlushingSyncQueue = false;
        function scheduleSyncCallback(callback) {
          if (syncQueue === null) {
            syncQueue = [callback];
          } else {
            syncQueue.push(callback);
          }
        }
        function scheduleLegacySyncCallback(callback) {
          includesLegacySyncCallbacks = true;
          scheduleSyncCallback(callback);
        }
        function flushSyncCallbacksOnlyInLegacyMode() {
          if (includesLegacySyncCallbacks) {
            flushSyncCallbacks();
          }
        }
        function flushSyncCallbacks() {
          if (!isFlushingSyncQueue && syncQueue !== null) {
            isFlushingSyncQueue = true;
            var i2 = 0;
            var previousUpdatePriority = getCurrentUpdatePriority();
            try {
              var isSync = true;
              var queue = syncQueue;
              setCurrentUpdatePriority(DiscreteEventPriority2);
              for (; i2 < queue.length; i2++) {
                var callback = queue[i2];
                do {
                  callback = callback(isSync);
                } while (callback !== null);
              }
              syncQueue = null;
              includesLegacySyncCallbacks = false;
            } catch (error2) {
              if (syncQueue !== null) {
                syncQueue = syncQueue.slice(i2 + 1);
              }
              scheduleCallback(ImmediatePriority, flushSyncCallbacks);
              throw error2;
            } finally {
              setCurrentUpdatePriority(previousUpdatePriority);
              isFlushingSyncQueue = false;
            }
          }
          return null;
        }
        function isRootDehydrated(root2) {
          var currentState2 = root2.current.memoizedState;
          return currentState2.isDehydrated;
        }
        var ReactCurrentBatchConfig = ReactSharedInternals.ReactCurrentBatchConfig;
        var NoTransition = null;
        function requestCurrentTransition() {
          return ReactCurrentBatchConfig.transition;
        }
        function shallowEqual3(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 i2 = 0; i2 < keysA.length; i2++) {
            var currentKey = keysA[i2];
            if (!hasOwnProperty3.call(objB, currentKey) || !objectIs(objA[currentKey], objB[currentKey])) {
              return false;
            }
          }
          return true;
        }
        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 ClassComponent:
              return describeClassComponentFrame(fiber.type);
            default:
              return "";
          }
        }
        function getStackByFiberInDevAndProd(workInProgress2) {
          try {
            var info = "";
            var node56 = workInProgress2;
            do {
              info += describeFiber(node56);
              node56 = node56.return;
            } while (node56);
            return info;
          } catch (x2) {
            return "\nError generating stack: " + x2.message + "\n" + x2.stack;
          }
        }
        var ReactDebugCurrentFrame$1 = 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 getComponentNameFromFiber(owner);
            }
          }
          return null;
        }
        function getCurrentFiberStackInDev() {
          {
            if (current === null) {
              return "";
            }
            return getStackByFiberInDevAndProd(current);
          }
        }
        function resetCurrentFiber() {
          {
            ReactDebugCurrentFrame$1.getCurrentStack = null;
            current = null;
            isRendering = false;
          }
        }
        function setCurrentFiber(fiber) {
          {
            ReactDebugCurrentFrame$1.getCurrentStack = getCurrentFiberStackInDev;
            current = fiber;
            isRendering = false;
          }
        }
        function setIsRendering(rendering) {
          {
            isRendering = rendering;
          }
        }
        var ReactStrictModeWarnings = {
          recordUnsafeLifecycleWarnings: function(fiber, instance) {
          },
          flushPendingUnsafeLifecycleWarnings: function() {
          },
          recordLegacyContextWarning: function(fiber, instance) {
          },
          flushLegacyContextWarning: function() {
          },
          discardPendingWarnings: function() {
          }
        };
        {
          var findStrictRoot = function(fiber) {
            var maybeStrictRoot = null;
            var node56 = fiber;
            while (node56 !== null) {
              if (node56.mode & StrictLegacyMode) {
                maybeStrictRoot = node56;
              }
              node56 = node56.return;
            }
            return maybeStrictRoot;
          };
          var setToSortedString = function(set4) {
            var array = [];
            set4.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" && // Don't warn about react-lifecycles-compat polyfilled components.
            instance.componentWillMount.__suppressDeprecationWarning !== true) {
              pendingComponentWillMountWarnings.push(fiber);
            }
            if (fiber.mode & StrictLegacyMode && typeof instance.UNSAFE_componentWillMount === "function") {
              pendingUNSAFE_ComponentWillMountWarnings.push(fiber);
            }
            if (typeof instance.componentWillReceiveProps === "function" && instance.componentWillReceiveProps.__suppressDeprecationWarning !== true) {
              pendingComponentWillReceivePropsWarnings.push(fiber);
            }
            if (fiber.mode & StrictLegacyMode && typeof instance.UNSAFE_componentWillReceiveProps === "function") {
              pendingUNSAFE_ComponentWillReceivePropsWarnings.push(fiber);
            }
            if (typeof instance.componentWillUpdate === "function" && instance.componentWillUpdate.__suppressDeprecationWarning !== true) {
              pendingComponentWillUpdateWarnings.push(fiber);
            }
            if (fiber.mode & StrictLegacyMode && 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(getComponentNameFromFiber(fiber) || "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(getComponentNameFromFiber(fiber) || "Component");
                didWarnAboutUnsafeLifecycles.add(fiber.type);
              });
              pendingUNSAFE_ComponentWillMountWarnings = [];
            }
            var componentWillReceivePropsUniqueNames = /* @__PURE__ */ new Set();
            if (pendingComponentWillReceivePropsWarnings.length > 0) {
              pendingComponentWillReceivePropsWarnings.forEach(function(fiber) {
                componentWillReceivePropsUniqueNames.add(getComponentNameFromFiber(fiber) || "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(getComponentNameFromFiber(fiber) || "Component");
                didWarnAboutUnsafeLifecycles.add(fiber.type);
              });
              pendingUNSAFE_ComponentWillReceivePropsWarnings = [];
            }
            var componentWillUpdateUniqueNames = /* @__PURE__ */ new Set();
            if (pendingComponentWillUpdateWarnings.length > 0) {
              pendingComponentWillUpdateWarnings.forEach(function(fiber) {
                componentWillUpdateUniqueNames.add(getComponentNameFromFiber(fiber) || "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(getComponentNameFromFiber(fiber) || "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);
              warn5("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);
              warn5("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);
              warn5("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(getComponentNameFromFiber(fiber) || "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 typeName2(value) {
          {
            var hasToStringTag = typeof Symbol === "function" && Symbol.toStringTag;
            var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
            return type;
          }
        }
        function willCoercionThrow(value) {
          {
            try {
              testStringCoercion(value);
              return false;
            } catch (e3) {
              return true;
            }
          }
        }
        function testStringCoercion(value) {
          return "" + value;
        }
        function checkKeyStringCoercion(value) {
          {
            if (willCoercionThrow(value)) {
              error("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", typeName2(value));
              return testStringCoercion(value);
            }
          }
        }
        function checkPropStringCoercion(value, propName) {
          {
            if (willCoercionThrow(value)) {
              error("The provided `%s` prop is an unsupported type %s. This value must be coerced to a string before before using it here.", propName, typeName2(value));
              return testStringCoercion(value);
            }
          }
        }
        function resolveDefaultProps(Component8, baseProps) {
          if (Component8 && Component8.defaultProps) {
            var props = assign3({}, baseProps);
            var defaultProps5 = Component8.defaultProps;
            for (var propName in defaultProps5) {
              if (props[propName] === void 0) {
                props[propName] = defaultProps5[propName];
              }
            }
            return props;
          }
          return baseProps;
        }
        var valueCursor = createCursor(null);
        var rendererSigil;
        {
          rendererSigil = {};
        }
        var currentlyRenderingFiber = null;
        var lastContextDependency = null;
        var lastFullyObservedContext = null;
        var isDisallowedContextReadInDEV = false;
        function resetContextDependencies() {
          currentlyRenderingFiber = null;
          lastContextDependency = null;
          lastFullyObservedContext = null;
          {
            isDisallowedContextReadInDEV = false;
          }
        }
        function enterDisallowedContextReadInDEV() {
          {
            isDisallowedContextReadInDEV = true;
          }
        }
        function exitDisallowedContextReadInDEV() {
          {
            isDisallowedContextReadInDEV = false;
          }
        }
        function pushProvider(providerFiber, context2, nextValue) {
          if (isPrimaryRenderer) {
            push(valueCursor, context2._currentValue, providerFiber);
            context2._currentValue = nextValue;
            {
              if (context2._currentRenderer !== void 0 && context2._currentRenderer !== null && context2._currentRenderer !== rendererSigil) {
                error("Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported.");
              }
              context2._currentRenderer = rendererSigil;
            }
          } else {
            push(valueCursor, context2._currentValue2, providerFiber);
            context2._currentValue2 = nextValue;
            {
              if (context2._currentRenderer2 !== void 0 && context2._currentRenderer2 !== null && context2._currentRenderer2 !== rendererSigil) {
                error("Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported.");
              }
              context2._currentRenderer2 = rendererSigil;
            }
          }
        }
        function popProvider(context2, providerFiber) {
          var currentValue = valueCursor.current;
          pop(valueCursor, providerFiber);
          if (isPrimaryRenderer) {
            {
              context2._currentValue = currentValue;
            }
          } else {
            {
              context2._currentValue2 = currentValue;
            }
          }
        }
        function scheduleContextWorkOnParentPath(parent, renderLanes2, propagationRoot) {
          var node56 = parent;
          while (node56 !== null) {
            var alternate = node56.alternate;
            if (!isSubsetOfLanes(node56.childLanes, renderLanes2)) {
              node56.childLanes = mergeLanes(node56.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);
            }
            if (node56 === propagationRoot) {
              break;
            }
            node56 = node56.return;
          }
          {
            if (node56 !== propagationRoot) {
              error("Expected to find the propagation root when scheduling context work. This error is likely caused by a bug in React. Please file an issue.");
            }
          }
        }
        function propagateContextChange(workInProgress2, context2, renderLanes2) {
          {
            propagateContextChange_eager(workInProgress2, context2, renderLanes2);
          }
        }
        function propagateContextChange_eager(workInProgress2, context2, 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 === context2) {
                  if (fiber.tag === ClassComponent) {
                    var lane = pickArbitraryLane(renderLanes2);
                    var update = createUpdate(NoTimestamp, lane);
                    update.tag = ForceUpdate;
                    var updateQueue = fiber.updateQueue;
                    if (updateQueue === null)
                      ;
                    else {
                      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;
                    }
                  }
                  fiber.lanes = mergeLanes(fiber.lanes, renderLanes2);
                  var alternate = fiber.alternate;
                  if (alternate !== null) {
                    alternate.lanes = mergeLanes(alternate.lanes, renderLanes2);
                  }
                  scheduleContextWorkOnParentPath(fiber.return, renderLanes2, workInProgress2);
                  list.lanes = mergeLanes(list.lanes, renderLanes2);
                  break;
                }
                dependency = dependency.next;
              }
            } else if (fiber.tag === ContextProvider) {
              nextFiber = fiber.type === workInProgress2.type ? null : fiber.child;
            } else if (fiber.tag === DehydratedFragment) {
              var parentSuspense = fiber.return;
              if (parentSuspense === null) {
                throw new Error("We just came from a parent so we must have had a parent. This is a bug in React.");
              }
              parentSuspense.lanes = mergeLanes(parentSuspense.lanes, renderLanes2);
              var _alternate = parentSuspense.alternate;
              if (_alternate !== null) {
                _alternate.lanes = mergeLanes(_alternate.lanes, renderLanes2);
              }
              scheduleContextWorkOnParentPath(parentSuspense, renderLanes2, workInProgress2);
              nextFiber = fiber.sibling;
            } 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;
          lastFullyObservedContext = 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(context2) {
          {
            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().");
            }
          }
          var value = isPrimaryRenderer ? context2._currentValue : context2._currentValue2;
          if (lastFullyObservedContext === context2)
            ;
          else {
            var contextItem = {
              context: context2,
              memoizedValue: value,
              next: null
            };
            if (lastContextDependency === null) {
              if (currentlyRenderingFiber === null) {
                throw new 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
              };
            } else {
              lastContextDependency = lastContextDependency.next = contextItem;
            }
          }
          return value;
        }
        var interleavedQueues = null;
        function pushInterleavedQueue(queue) {
          if (interleavedQueues === null) {
            interleavedQueues = [queue];
          } else {
            interleavedQueues.push(queue);
          }
        }
        function enqueueInterleavedUpdates() {
          if (interleavedQueues !== null) {
            for (var i2 = 0; i2 < interleavedQueues.length; i2++) {
              var queue = interleavedQueues[i2];
              var lastInterleavedUpdate = queue.interleaved;
              if (lastInterleavedUpdate !== null) {
                queue.interleaved = null;
                var firstInterleavedUpdate = lastInterleavedUpdate.next;
                var lastPendingUpdate = queue.pending;
                if (lastPendingUpdate !== null) {
                  var firstPendingUpdate = lastPendingUpdate.next;
                  lastPendingUpdate.next = firstInterleavedUpdate;
                  lastInterleavedUpdate.next = firstPendingUpdate;
                }
                queue.pending = lastInterleavedUpdate;
              }
            }
            interleavedQueues = null;
          }
        }
        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,
              interleaved: null,
              lanes: NoLanes
            },
            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, lane) {
          var updateQueue = fiber.updateQueue;
          if (updateQueue === null) {
            return;
          }
          var sharedQueue = updateQueue.shared;
          if (isInterleavedUpdate(fiber)) {
            var interleaved = sharedQueue.interleaved;
            if (interleaved === null) {
              update.next = update;
              pushInterleavedQueue(sharedQueue);
            } else {
              update.next = interleaved.next;
              interleaved.next = update;
            }
            sharedQueue.interleaved = update;
          } else {
            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 entangleTransitions(root2, fiber, lane) {
          var updateQueue = fiber.updateQueue;
          if (updateQueue === null) {
            return;
          }
          var sharedQueue = updateQueue.shared;
          if (isTransitionLane(lane)) {
            var queueLanes = sharedQueue.lanes;
            queueLanes = intersectLanes(queueLanes, root2.pendingLanes);
            var newQueueLanes = mergeLanes(queueLanes, lane);
            sharedQueue.lanes = newQueueLanes;
            markRootEntangled(root2, newQueueLanes);
          }
        }
        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 & StrictLegacyMode) {
                    setIsStrictModeForDevtools(true);
                    try {
                      payload.call(instance, prevState, nextProps);
                    } finally {
                      setIsStrictModeForDevtools(false);
                    }
                  }
                  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 & StrictLegacyMode) {
                    setIsStrictModeForDevtools(true);
                    try {
                      _payload.call(instance, prevState, nextProps);
                    } finally {
                      setIsStrictModeForDevtools(false);
                    }
                  }
                  exitDisallowedContextReadInDEV();
                }
              } else {
                partialState = _payload;
              }
              if (partialState === null || partialState === void 0) {
                return prevState;
              }
              return assign3({}, 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,
                    // This update is going to be committed so we never want uncommit
                    // it. Using NoLane works because 0 is a subset of all bitmasks, so
                    // this will never be skipped by the check above.
                    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 && // If the update was already committed, we should not queue its
                // callback again.
                update.lane !== NoLane) {
                  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;
            var lastInterleaved = queue.shared.interleaved;
            if (lastInterleaved !== null) {
              var interleaved = lastInterleaved;
              do {
                newLanes = mergeLanes(newLanes, interleaved.lane);
                interleaved = interleaved.next;
              } while (interleaved !== lastInterleaved);
            } else if (firstBaseUpdate === null) {
              queue.shared.lanes = NoLanes;
            }
            markSkippedUpdateLanes(newLanes);
            workInProgress2.lanes = newLanes;
            workInProgress2.memoizedState = newState;
          }
          {
            currentlyProcessingQueue = null;
          }
        }
        function callCallback(callback, context2) {
          if (typeof callback !== "function") {
            throw new Error("Invalid argument passed as callback. Expected a function. Instead " + ("received: " + callback));
          }
          callback.call(context2);
        }
        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 i2 = 0; i2 < effects.length; i2++) {
              var effect = effects[i2];
              var callback = effect.callback;
              if (callback !== null) {
                effect.callback = null;
                callCallback(callback, instance);
              }
            }
          }
        }
        var fakeInternalInstance = {};
        var emptyRefsObject = new React116.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 key = callerName + "_" + callback;
            if (!didWarnOnInvalidCallback.has(key)) {
              didWarnOnInvalidCallback.add(key);
              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 = getComponentNameFromType(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 new 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;
          var partialState = getDerivedStateFromProps(nextProps, prevState);
          {
            if (workInProgress2.mode & StrictLegacyMode) {
              setIsStrictModeForDevtools(true);
              try {
                partialState = getDerivedStateFromProps(nextProps, prevState);
              } finally {
                setIsStrictModeForDevtools(false);
              }
            }
            warnOnUndefinedDerivedState(ctor, partialState);
          }
          var memoizedState = partialState === null || partialState === void 0 ? prevState : assign3({}, 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 = get3(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);
            var root2 = scheduleUpdateOnFiber(fiber, lane, eventTime);
            if (root2 !== null) {
              entangleTransitions(root2, fiber, lane);
            }
            {
              markStateUpdateScheduled(fiber, lane);
            }
          },
          enqueueReplaceState: function(inst, payload, callback) {
            var fiber = get3(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);
            var root2 = scheduleUpdateOnFiber(fiber, lane, eventTime);
            if (root2 !== null) {
              entangleTransitions(root2, fiber, lane);
            }
            {
              markStateUpdateScheduled(fiber, lane);
            }
          },
          enqueueForceUpdate: function(inst, callback) {
            var fiber = get3(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);
            var root2 = scheduleUpdateOnFiber(fiber, lane, eventTime);
            if (root2 !== null) {
              entangleTransitions(root2, fiber, lane);
            }
            {
              markForceUpdateScheduled(fiber, lane);
            }
          }
        };
        function checkShouldComponentUpdate(workInProgress2, ctor, oldProps, newProps, oldState, newState, nextContext) {
          var instance = workInProgress2.stateNode;
          if (typeof instance.shouldComponentUpdate === "function") {
            var shouldUpdate = instance.shouldComponentUpdate(newProps, newState, nextContext);
            {
              if (workInProgress2.mode & StrictLegacyMode) {
                setIsStrictModeForDevtools(true);
                try {
                  shouldUpdate = instance.shouldComponentUpdate(newProps, newState, nextContext);
                } finally {
                  setIsStrictModeForDevtools(false);
                }
              }
              if (shouldUpdate === void 0) {
                error("%s.shouldComponentUpdate(): Returned undefined instead of a boolean value. Make sure to return true or false.", getComponentNameFromType(ctor) || "Component");
              }
            }
            return shouldUpdate;
          }
          if (ctor.prototype && ctor.prototype.isPureReactComponent) {
            return !shallowEqual3(oldProps, newProps) || !shallowEqual3(oldState, newState);
          }
          return true;
        }
        function checkClassInstance(workInProgress2, ctor, newProps) {
          var instance = workInProgress2.stateNode;
          {
            var name2 = getComponentNameFromType(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?", name2);
              } else {
                error("%s(...): No `render` method found on the returned component instance: you may have forgotten to define `render`.", name2);
              }
            }
            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?", name2);
            }
            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.", name2);
            }
            if (instance.propTypes) {
              error("propTypes was defined as an instance property on %s. Use a static property to define propTypes instead.", name2);
            }
            if (instance.contextType) {
              error("contextType was defined as an instance property on %s. Use a static property to define contextType instead.", name2);
            }
            {
              if (instance.contextTypes) {
                error("contextTypes was defined as an instance property on %s. Use a static property to define contextTypes instead.", name2);
              }
              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.", name2);
              }
            }
            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.", name2);
            }
            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.", getComponentNameFromType(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()?", name2);
            }
            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().", name2);
            }
            if (typeof instance.componentWillRecieveProps === "function") {
              error("%s has a method called componentWillRecieveProps(). Did you mean componentWillReceiveProps()?", name2);
            }
            if (typeof instance.UNSAFE_componentWillRecieveProps === "function") {
              error("%s has a method called UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?", name2);
            }
            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.", name2, name2);
            }
            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.", name2, name2);
            }
            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.", getComponentNameFromType(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.", name2);
            }
            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.", name2);
            }
            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.", name2);
            }
            var _state = instance.state;
            if (_state && (typeof _state !== "object" || isArray2(_state))) {
              error("%s.state: must be set to an object or null", name2);
            }
            if (typeof instance.getChildContext === "function" && typeof ctor.childContextTypes !== "object") {
              error("%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().", name2);
            }
          }
        }
        function adoptClassInstance(workInProgress2, instance) {
          instance.updater = classComponentUpdater;
          workInProgress2.stateNode = instance;
          set3(instance, workInProgress2);
          {
            instance._reactInternalInstance = fakeInternalInstance;
          }
        }
        function constructClassInstance(workInProgress2, ctor, props) {
          var isLegacyContextConsumer = false;
          var unmaskedContext = emptyContextObject;
          var context2 = emptyContextObject;
          var contextType = ctor.contextType;
          {
            if ("contextType" in ctor) {
              var isValid = (
                // Allow null for conditional declaration
                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", getComponentNameFromType(ctor) || "Component", addendum);
              }
            }
          }
          if (typeof contextType === "object" && contextType !== null) {
            context2 = readContext(contextType);
          } else {
            unmaskedContext = getUnmaskedContext(workInProgress2, ctor, true);
            var contextTypes = ctor.contextTypes;
            isLegacyContextConsumer = contextTypes !== null && contextTypes !== void 0;
            context2 = isLegacyContextConsumer ? getMaskedContext(workInProgress2, unmaskedContext) : emptyContextObject;
          }
          var instance = new ctor(props, context2);
          {
            if (workInProgress2.mode & StrictLegacyMode) {
              setIsStrictModeForDevtools(true);
              try {
                instance = new ctor(props, context2);
              } finally {
                setIsStrictModeForDevtools(false);
              }
            }
          }
          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 = getComponentNameFromType(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 = getComponentNameFromType(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, context2);
          }
          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.", getComponentNameFromFiber(workInProgress2) || "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 = getComponentNameFromFiber(workInProgress2) || "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 = getComponentNameFromType(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 & StrictLegacyMode) {
              ReactStrictModeWarnings.recordLegacyContextWarning(workInProgress2, instance);
            }
            {
              ReactStrictModeWarnings.recordUnsafeLifecycleWarnings(workInProgress2, instance);
            }
          }
          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") {
            var fiberFlags = Update;
            {
              fiberFlags |= LayoutStatic;
            }
            if ((workInProgress2.mode & StrictEffectsMode) !== NoMode) {
              fiberFlags |= MountLayoutDev;
            }
            workInProgress2.flags |= fiberFlags;
          }
        }
        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") {
              var fiberFlags = Update;
              {
                fiberFlags |= LayoutStatic;
              }
              if ((workInProgress2.mode & StrictEffectsMode) !== NoMode) {
                fiberFlags |= MountLayoutDev;
              }
              workInProgress2.flags |= fiberFlags;
            }
            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") {
              var _fiberFlags = Update;
              {
                _fiberFlags |= LayoutStatic;
              }
              if ((workInProgress2.mode & StrictEffectsMode) !== NoMode) {
                _fiberFlags |= MountLayoutDev;
              }
              workInProgress2.flags |= _fiberFlags;
            }
          } else {
            if (typeof instance.componentDidMount === "function") {
              var _fiberFlags2 = Update;
              {
                _fiberFlags2 |= LayoutStatic;
              }
              if ((workInProgress2.mode & StrictEffectsMode) !== NoMode) {
                _fiberFlags2 |= MountLayoutDev;
              }
              workInProgress2.flags |= _fiberFlags2;
            }
            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() && !enableLazyContextPropagation) {
            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) || // TODO: In some cases, we'll end up checking if context has changed twice,
          // both before and after `shouldComponentUpdate` has been called. Not ideal,
          // but I'm loath to refactor this function. This only happens for memoized
          // components so it's not that common.
          enableLazyContextPropagation;
          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 forkStack = [];
        var forkStackIndex = 0;
        var treeForkProvider = null;
        var treeForkCount = 0;
        var idStack = [];
        var idStackIndex = 0;
        var treeContextProvider = null;
        var treeContextId = 1;
        var treeContextOverflow = "";
        function isForkedChild(workInProgress2) {
          warnIfNotHydrating();
          return (workInProgress2.flags & Forked) !== NoFlags;
        }
        function getForksAtLevel(workInProgress2) {
          warnIfNotHydrating();
          return treeForkCount;
        }
        function getTreeId() {
          var overflow = treeContextOverflow;
          var idWithLeadingBit = treeContextId;
          var id2 = idWithLeadingBit & ~getLeadingBit(idWithLeadingBit);
          return id2.toString(32) + overflow;
        }
        function pushTreeFork(workInProgress2, totalChildren) {
          warnIfNotHydrating();
          forkStack[forkStackIndex++] = treeForkCount;
          forkStack[forkStackIndex++] = treeForkProvider;
          treeForkProvider = workInProgress2;
          treeForkCount = totalChildren;
        }
        function pushTreeId(workInProgress2, totalChildren, index2) {
          warnIfNotHydrating();
          idStack[idStackIndex++] = treeContextId;
          idStack[idStackIndex++] = treeContextOverflow;
          idStack[idStackIndex++] = treeContextProvider;
          treeContextProvider = workInProgress2;
          var baseIdWithLeadingBit = treeContextId;
          var baseOverflow = treeContextOverflow;
          var baseLength = getBitLength(baseIdWithLeadingBit) - 1;
          var baseId = baseIdWithLeadingBit & ~(1 << baseLength);
          var slot = index2 + 1;
          var length2 = getBitLength(totalChildren) + baseLength;
          if (length2 > 30) {
            var numberOfOverflowBits = baseLength - baseLength % 5;
            var newOverflowBits = (1 << numberOfOverflowBits) - 1;
            var newOverflow = (baseId & newOverflowBits).toString(32);
            var restOfBaseId = baseId >> numberOfOverflowBits;
            var restOfBaseLength = baseLength - numberOfOverflowBits;
            var restOfLength = getBitLength(totalChildren) + restOfBaseLength;
            var restOfNewBits = slot << restOfBaseLength;
            var id2 = restOfNewBits | restOfBaseId;
            var overflow = newOverflow + baseOverflow;
            treeContextId = 1 << restOfLength | id2;
            treeContextOverflow = overflow;
          } else {
            var newBits = slot << baseLength;
            var _id2 = newBits | baseId;
            var _overflow = baseOverflow;
            treeContextId = 1 << length2 | _id2;
            treeContextOverflow = _overflow;
          }
        }
        function pushMaterializedTreeId(workInProgress2) {
          warnIfNotHydrating();
          var returnFiber = workInProgress2.return;
          if (returnFiber !== null) {
            var numberOfForks = 1;
            var slotIndex = 0;
            pushTreeFork(workInProgress2, numberOfForks);
            pushTreeId(workInProgress2, numberOfForks, slotIndex);
          }
        }
        function getBitLength(number5) {
          return 32 - clz32(number5);
        }
        function getLeadingBit(id2) {
          return 1 << getBitLength(id2) - 1;
        }
        function popTreeContext(workInProgress2) {
          while (workInProgress2 === treeForkProvider) {
            treeForkProvider = forkStack[--forkStackIndex];
            forkStack[forkStackIndex] = null;
            treeForkCount = forkStack[--forkStackIndex];
            forkStack[forkStackIndex] = null;
          }
          while (workInProgress2 === treeContextProvider) {
            treeContextProvider = idStack[--idStackIndex];
            idStack[idStackIndex] = null;
            treeContextOverflow = idStack[--idStackIndex];
            idStack[idStackIndex] = null;
            treeContextId = idStack[--idStackIndex];
            idStack[idStackIndex] = null;
          }
        }
        function getSuspendedTreeContext() {
          warnIfNotHydrating();
          if (treeContextProvider !== null) {
            return {
              id: treeContextId,
              overflow: treeContextOverflow
            };
          } else {
            return null;
          }
        }
        function restoreSuspendedTreeContext(workInProgress2, suspendedContext) {
          warnIfNotHydrating();
          idStack[idStackIndex++] = treeContextId;
          idStack[idStackIndex++] = treeContextOverflow;
          idStack[idStackIndex++] = treeContextProvider;
          treeContextId = suspendedContext.id;
          treeContextOverflow = suspendedContext.overflow;
          treeContextProvider = workInProgress2;
        }
        function warnIfNotHydrating() {
          {
            if (!getIsHydrating()) {
              error("Expected to be hydrating. This is a bug in React. Please file an issue.");
            }
          }
        }
        var hydrationParentFiber = null;
        var nextHydratableInstance = null;
        var isHydrating = false;
        var didSuspend = false;
        var hydrationErrors = null;
        function warnIfHydrating() {
          {
            if (isHydrating) {
              error("We should not be hydrating here. This is a bug in React. Please file a bug.");
            }
          }
        }
        function markDidSuspendWhileHydratingDEV() {
          {
            didSuspend = true;
          }
        }
        function enterHydrationState(fiber) {
          if (!supportsHydration) {
            return false;
          }
          var parentInstance = fiber.stateNode.containerInfo;
          nextHydratableInstance = getFirstHydratableChildWithinContainer(parentInstance);
          hydrationParentFiber = fiber;
          isHydrating = true;
          hydrationErrors = null;
          didSuspend = false;
          return true;
        }
        function reenterHydrationStateFromDehydratedSuspenseInstance(fiber, suspenseInstance, treeContext) {
          if (!supportsHydration) {
            return false;
          }
          nextHydratableInstance = getFirstHydratableChildWithinSuspenseInstance(suspenseInstance);
          hydrationParentFiber = fiber;
          isHydrating = true;
          hydrationErrors = null;
          didSuspend = false;
          if (treeContext !== null) {
            restoreSuspendedTreeContext(fiber, treeContext);
          }
          return true;
        }
        function warnUnhydratedInstance(returnFiber, instance) {
          {
            switch (returnFiber.tag) {
              case HostRoot:
                didNotHydrateInstanceWithinContainer(returnFiber.stateNode.containerInfo, instance);
                break;
              case HostComponent:
                didNotHydrateInstance(returnFiber.type, returnFiber.memoizedProps, returnFiber.stateNode, instance);
                break;
              case SuspenseComponent:
                var suspenseState = returnFiber.memoizedState;
                if (suspenseState.dehydrated !== null)
                  didNotHydrateInstanceWithinSuspenseInstance(suspenseState.dehydrated, instance);
                break;
            }
          }
        }
        function deleteHydratableInstance(returnFiber, instance) {
          warnUnhydratedInstance(returnFiber, instance);
          var childToDelete = createFiberFromHostInstanceForDeletion();
          childToDelete.stateNode = instance;
          childToDelete.return = returnFiber;
          var deletions = returnFiber.deletions;
          if (deletions === null) {
            returnFiber.deletions = [childToDelete];
            returnFiber.flags |= ChildDeletion;
          } else {
            deletions.push(childToDelete);
          }
        }
        function warnNonhydratedInstance(returnFiber, fiber) {
          {
            if (didSuspend) {
              return;
            }
            switch (returnFiber.tag) {
              case HostRoot: {
                var parentContainer = returnFiber.stateNode.containerInfo;
                switch (fiber.tag) {
                  case HostComponent:
                    var type = fiber.type;
                    var props = fiber.pendingProps;
                    didNotFindHydratableInstanceWithinContainer(parentContainer, type, props);
                    break;
                  case HostText:
                    var text2 = fiber.pendingProps;
                    didNotFindHydratableTextInstanceWithinContainer(parentContainer, text2);
                    break;
                  case SuspenseComponent:
                    didNotFindHydratableSuspenseInstanceWithinContainer(parentContainer);
                    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, _props);
                    break;
                  case HostText:
                    var _text = fiber.pendingProps;
                    didNotFindHydratableTextInstance(parentType, parentProps, parentInstance, _text);
                    break;
                  case SuspenseComponent:
                    didNotFindHydratableSuspenseInstance(parentType, parentProps, parentInstance);
                    break;
                }
                break;
              }
              case SuspenseComponent: {
                var suspenseState = returnFiber.memoizedState;
                var _parentInstance = suspenseState.dehydrated;
                if (_parentInstance !== null)
                  switch (fiber.tag) {
                    case HostComponent:
                      var _type2 = fiber.type;
                      var _props2 = fiber.pendingProps;
                      didNotFindHydratableInstanceWithinSuspenseInstance(_parentInstance, _type2, _props2);
                      break;
                    case HostText:
                      var _text2 = fiber.pendingProps;
                      didNotFindHydratableTextInstanceWithinSuspenseInstance(_parentInstance, _text2);
                      break;
                    case SuspenseComponent:
                      didNotFindHydratableSuspenseInstanceWithinSuspenseInstance(_parentInstance);
                      break;
                  }
                break;
              }
              default:
                return;
            }
          }
        }
        function insertNonHydratedInstance(returnFiber, fiber) {
          fiber.flags = fiber.flags & ~Hydrating | Placement;
          warnNonhydratedInstance(returnFiber, fiber);
        }
        function tryHydrate(fiber, nextInstance) {
          switch (fiber.tag) {
            case HostComponent: {
              var type = fiber.type;
              var props = fiber.pendingProps;
              var instance = canHydrateInstance(nextInstance, type, props);
              if (instance !== null) {
                fiber.stateNode = instance;
                hydrationParentFiber = fiber;
                nextHydratableInstance = getFirstHydratableChild(instance);
                return true;
              }
              return false;
            }
            case HostText: {
              var text2 = fiber.pendingProps;
              var textInstance = canHydrateTextInstance(nextInstance, text2);
              if (textInstance !== null) {
                fiber.stateNode = textInstance;
                hydrationParentFiber = fiber;
                nextHydratableInstance = null;
                return true;
              }
              return false;
            }
            case SuspenseComponent: {
              {
                var suspenseInstance = canHydrateSuspenseInstance(nextInstance);
                if (suspenseInstance !== null) {
                  var suspenseState = {
                    dehydrated: suspenseInstance,
                    treeContext: getSuspendedTreeContext(),
                    retryLane: OffscreenLane
                  };
                  fiber.memoizedState = suspenseState;
                  var dehydratedFragment = createFiberFromDehydratedFragment(suspenseInstance);
                  dehydratedFragment.return = fiber;
                  fiber.child = dehydratedFragment;
                  hydrationParentFiber = fiber;
                  nextHydratableInstance = null;
                  return true;
                }
              }
              return false;
            }
            default:
              return false;
          }
        }
        function shouldClientRenderOnMismatch(fiber) {
          return (fiber.mode & ConcurrentMode) !== NoMode && (fiber.flags & DidCapture) === NoFlags;
        }
        function throwOnHydrationMismatch(fiber) {
          throw new Error("Hydration failed because the initial UI does not match what was rendered on the server.");
        }
        function tryToClaimNextHydratableInstance(fiber) {
          if (!isHydrating) {
            return;
          }
          var nextInstance = nextHydratableInstance;
          if (!nextInstance) {
            if (shouldClientRenderOnMismatch(fiber)) {
              warnNonhydratedInstance(hydrationParentFiber, fiber);
              throwOnHydrationMismatch();
            }
            insertNonHydratedInstance(hydrationParentFiber, fiber);
            isHydrating = false;
            hydrationParentFiber = fiber;
            return;
          }
          var firstAttemptedInstance = nextInstance;
          if (!tryHydrate(fiber, nextInstance)) {
            if (shouldClientRenderOnMismatch(fiber)) {
              warnNonhydratedInstance(hydrationParentFiber, fiber);
              throwOnHydrationMismatch();
            }
            nextInstance = getNextHydratableSibling(firstAttemptedInstance);
            var prevHydrationParentFiber = hydrationParentFiber;
            if (!nextInstance || !tryHydrate(fiber, nextInstance)) {
              insertNonHydratedInstance(hydrationParentFiber, fiber);
              isHydrating = false;
              hydrationParentFiber = fiber;
              return;
            }
            deleteHydratableInstance(prevHydrationParentFiber, firstAttemptedInstance);
          }
        }
        function prepareToHydrateHostInstance(fiber, rootContainerInstance, hostContext) {
          if (!supportsHydration) {
            throw new Error("Expected prepareToHydrateHostInstance() to never be called. This error is likely caused by a bug in React. Please file an issue.");
          }
          var instance = fiber.stateNode;
          var shouldWarnIfMismatchDev = !didSuspend;
          var updatePayload = hydrateInstance(instance, fiber.type, fiber.memoizedProps, rootContainerInstance, hostContext, fiber, shouldWarnIfMismatchDev);
          fiber.updateQueue = updatePayload;
          if (updatePayload !== null) {
            return true;
          }
          return false;
        }
        function prepareToHydrateHostTextInstance(fiber) {
          if (!supportsHydration) {
            throw new Error("Expected prepareToHydrateHostTextInstance() to never be called. This error is likely caused by a bug in React. Please file an issue.");
          }
          var textInstance = fiber.stateNode;
          var textContent = fiber.memoizedProps;
          var shouldWarnIfMismatchDev = !didSuspend;
          var shouldUpdate = hydrateTextInstance(textInstance, textContent, fiber, shouldWarnIfMismatchDev);
          if (shouldUpdate) {
            var returnFiber = hydrationParentFiber;
            if (returnFiber !== null) {
              var isConcurrentMode = (returnFiber.mode & ConcurrentMode) !== NoMode;
              switch (returnFiber.tag) {
                case HostRoot: {
                  var parentContainer = returnFiber.stateNode.containerInfo;
                  didNotMatchHydratedContainerTextInstance(
                    parentContainer,
                    textInstance,
                    textContent,
                    // TODO: Delete this argument when we remove the legacy root API.
                    isConcurrentMode
                  );
                  break;
                }
                case HostComponent: {
                  var parentType = returnFiber.type;
                  var parentProps = returnFiber.memoizedProps;
                  var parentInstance = returnFiber.stateNode;
                  didNotMatchHydratedTextInstance(
                    parentType,
                    parentProps,
                    parentInstance,
                    textInstance,
                    textContent,
                    // TODO: Delete this argument when we remove the legacy root API.
                    isConcurrentMode
                  );
                  break;
                }
              }
            }
          }
          return shouldUpdate;
        }
        function prepareToHydrateHostSuspenseInstance(fiber) {
          if (!supportsHydration) {
            throw new Error("Expected prepareToHydrateHostSuspenseInstance() to never be called. This error is likely caused by a bug in React. Please file an issue.");
          }
          var suspenseState = fiber.memoizedState;
          var suspenseInstance = suspenseState !== null ? suspenseState.dehydrated : null;
          if (!suspenseInstance) {
            throw new Error("Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue.");
          }
          hydrateSuspenseInstance(suspenseInstance, fiber);
        }
        function skipPastDehydratedSuspenseInstance(fiber) {
          if (!supportsHydration) {
            throw new Error("Expected skipPastDehydratedSuspenseInstance() to never be called. This error is likely caused by a bug in React. Please file an issue.");
          }
          var suspenseState = fiber.memoizedState;
          var suspenseInstance = suspenseState !== null ? suspenseState.dehydrated : null;
          if (!suspenseInstance) {
            throw new 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 (!supportsHydration) {
            return false;
          }
          if (fiber !== hydrationParentFiber) {
            return false;
          }
          if (!isHydrating) {
            popToNextHostParent(fiber);
            isHydrating = true;
            return false;
          }
          if (fiber.tag !== HostRoot && (fiber.tag !== HostComponent || shouldDeleteUnhydratedTailInstances(fiber.type) && !shouldSetTextContent(fiber.type, fiber.memoizedProps))) {
            var nextInstance = nextHydratableInstance;
            if (nextInstance) {
              if (shouldClientRenderOnMismatch(fiber)) {
                warnIfUnhydratedTailNodes(fiber);
                throwOnHydrationMismatch();
              } else {
                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 hasUnhydratedTailNodes() {
          return isHydrating && nextHydratableInstance !== null;
        }
        function warnIfUnhydratedTailNodes(fiber) {
          var nextInstance = nextHydratableInstance;
          while (nextInstance) {
            warnUnhydratedInstance(fiber, nextInstance);
            nextInstance = getNextHydratableSibling(nextInstance);
          }
        }
        function resetHydrationState() {
          if (!supportsHydration) {
            return;
          }
          hydrationParentFiber = null;
          nextHydratableInstance = null;
          isHydrating = false;
          didSuspend = false;
        }
        function upgradeHydrationErrorsToRecoverable() {
          if (hydrationErrors !== null) {
            queueRecoverableErrors(hydrationErrors);
            hydrationErrors = null;
          }
        }
        function getIsHydrating() {
          return isHydrating;
        }
        function queueHydrationError(error2) {
          if (hydrationErrors === null) {
            hydrationErrors = [error2];
          } else {
            hydrationErrors.push(error2);
          }
        }
        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 new 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 = getComponentNameFromFiber(returnFiber) || "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.');
          };
        }
        function coerceRef(returnFiber, current2, element2) {
          var mixedRef = element2.ref;
          if (mixedRef !== null && typeof mixedRef !== "function" && typeof mixedRef !== "object") {
            {
              if ((returnFiber.mode & StrictLegacyMode || warnAboutStringRefs) && // We warn in ReactElement.js if owner and self are equal for string refs
              // because these cannot be automatically converted to an arrow function
              // using a codemod. Therefore, we don't have to warn about string refs again.
              !(element2._owner && element2._self && element2._owner.stateNode !== element2._self)) {
                var componentName = getComponentNameFromFiber(returnFiber) || "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 (element2._owner) {
              var owner = element2._owner;
              var inst;
              if (owner) {
                var ownerFiber = owner;
                if (ownerFiber.tag !== ClassComponent) {
                  throw new 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 new Error("Missing owner for string ref " + mixedRef + ". This error is likely caused by a bug in React. Please file an issue.");
              }
              var resolvedInst = inst;
              {
                checkPropStringCoercion(mixedRef, "ref");
              }
              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 = resolvedInst.refs;
                if (refs === emptyRefsObject) {
                  refs = resolvedInst.refs = {};
                }
                if (value === null) {
                  delete refs[stringRef];
                } else {
                  refs[stringRef] = value;
                }
              };
              ref._stringRef = stringRef;
              return ref;
            } else {
              if (typeof mixedRef !== "string") {
                throw new Error("Expected ref to be a function, a string, an object returned by React.createRef(), or null.");
              }
              if (!element2._owner) {
                throw new 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) {
          var childString = Object.prototype.toString.call(newChild);
          throw new Error("Objects are not valid as a React child (found: " + (childString === "[object Object]" ? "object with keys {" + Object.keys(newChild).join(", ") + "}" : childString) + "). If you meant to render a collection of children, use an array instead.");
        }
        function warnOnFunctionType(returnFiber) {
          {
            var componentName = getComponentNameFromFiber(returnFiber) || "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 resolveLazy(lazyType) {
          var payload = lazyType._payload;
          var init = lazyType._init;
          return init(payload);
        }
        function ChildReconciler(shouldTrackSideEffects) {
          function deleteChild(returnFiber, childToDelete) {
            if (!shouldTrackSideEffects) {
              return;
            }
            var deletions = returnFiber.deletions;
            if (deletions === null) {
              returnFiber.deletions = [childToDelete];
              returnFiber.flags |= ChildDeletion;
            } else {
              deletions.push(childToDelete);
            }
          }
          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) {
              newFiber.flags |= Forked;
              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, element2, lanes) {
            var elementType = element2.type;
            if (elementType === REACT_FRAGMENT_TYPE) {
              return updateFragment2(returnFiber, current2, element2.props.children, lanes, element2.key);
            }
            if (current2 !== null) {
              if (current2.elementType === elementType || // Keep this check inline so it only runs on the false path:
              isCompatibleFamilyForHotReloading(current2, element2) || // Lazy types should reconcile their resolved type.
              // We need to do this after the Hot Reloading check above,
              // because hot reloading has different semantics than prod because
              // it doesn't resuspend. So we can't let the call below suspend.
              typeof elementType === "object" && elementType !== null && elementType.$$typeof === REACT_LAZY_TYPE && resolveLazy(elementType) === current2.type) {
                var existing = useFiber(current2, element2.props);
                existing.ref = coerceRef(returnFiber, current2, element2);
                existing.return = returnFiber;
                {
                  existing._debugSource = element2._source;
                  existing._debugOwner = element2._owner;
                }
                return existing;
              }
            }
            var created = createFiberFromElement(element2, returnFiber.mode, lanes);
            created.ref = coerceRef(returnFiber, current2, element2);
            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, fragment2, lanes, key) {
            if (current2 === null || current2.tag !== Fragment9) {
              var created = createFiberFromFragment(fragment2, returnFiber.mode, lanes, key);
              created.return = returnFiber;
              return created;
            } else {
              var existing = useFiber(current2, fragment2);
              existing.return = returnFiber;
              return existing;
            }
          }
          function createChild(returnFiber, newChild, lanes) {
            if (typeof newChild === "string" && newChild !== "" || 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;
                }
                case REACT_LAZY_TYPE: {
                  {
                    var payload = newChild._payload;
                    var init = newChild._init;
                    return createChild(returnFiber, init(payload), lanes);
                  }
                }
              }
              if (isArray2(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 key = oldFiber !== null ? oldFiber.key : null;
            if (typeof newChild === "string" && newChild !== "" || typeof newChild === "number") {
              if (key !== 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 === key) {
                    return updateElement(returnFiber, oldFiber, newChild, lanes);
                  } else {
                    return null;
                  }
                }
                case REACT_PORTAL_TYPE: {
                  if (newChild.key === key) {
                    return updatePortal(returnFiber, oldFiber, newChild, lanes);
                  } else {
                    return null;
                  }
                }
                case REACT_LAZY_TYPE: {
                  {
                    var payload = newChild._payload;
                    var init = newChild._init;
                    return updateSlot(returnFiber, oldFiber, init(payload), lanes);
                  }
                }
              }
              if (isArray2(newChild) || getIteratorFn(newChild)) {
                if (key !== 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" && newChild !== "" || 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;
                  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);
                }
                case REACT_LAZY_TYPE: {
                  var payload = newChild._payload;
                  var init = newChild._init;
                  return updateFromMap(existingChildren, returnFiber, newIdx, init(payload), lanes);
                }
              }
              if (isArray2(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 key = child.key;
                  if (typeof key !== "string") {
                    break;
                  }
                  if (knownKeys === null) {
                    knownKeys = /* @__PURE__ */ new Set();
                    knownKeys.add(key);
                    break;
                  }
                  if (!knownKeys.has(key)) {
                    knownKeys.add(key);
                    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.", key);
                  break;
                case REACT_LAZY_TYPE: {
                  var payload = child._payload;
                  var init = child._init;
                  warnOnInvalidKey(init(payload), knownKeys, returnFiber);
                  break;
                }
              }
            }
            return knownKeys;
          }
          function reconcileChildrenArray(returnFiber, currentFirstChild, newChildren, lanes) {
            {
              var knownKeys = null;
              for (var i2 = 0; i2 < newChildren.length; i2++) {
                var child = newChildren[i2];
                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);
              if (getIsHydrating()) {
                var numberOfForks = newIdx;
                pushTreeFork(returnFiber, numberOfForks);
              }
              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;
              }
              if (getIsHydrating()) {
                var _numberOfForks = newIdx;
                pushTreeFork(returnFiber, _numberOfForks);
              }
              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);
              });
            }
            if (getIsHydrating()) {
              var _numberOfForks2 = newIdx;
              pushTreeFork(returnFiber, _numberOfForks2);
            }
            return resultingFirstChild;
          }
          function reconcileChildrenIterator(returnFiber, currentFirstChild, newChildrenIterable, lanes) {
            var iteratorFn = getIteratorFn(newChildrenIterable);
            if (typeof iteratorFn !== "function") {
              throw new 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" && // $FlowFixMe Flow doesn't know about toStringTag
              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 new 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);
              if (getIsHydrating()) {
                var numberOfForks = newIdx;
                pushTreeFork(returnFiber, numberOfForks);
              }
              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;
              }
              if (getIsHydrating()) {
                var _numberOfForks3 = newIdx;
                pushTreeFork(returnFiber, _numberOfForks3);
              }
              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);
              });
            }
            if (getIsHydrating()) {
              var _numberOfForks4 = newIdx;
              pushTreeFork(returnFiber, _numberOfForks4);
            }
            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, element2, lanes) {
            var key = element2.key;
            var child = currentFirstChild;
            while (child !== null) {
              if (child.key === key) {
                var elementType = element2.type;
                if (elementType === REACT_FRAGMENT_TYPE) {
                  if (child.tag === Fragment9) {
                    deleteRemainingChildren(returnFiber, child.sibling);
                    var existing = useFiber(child, element2.props.children);
                    existing.return = returnFiber;
                    {
                      existing._debugSource = element2._source;
                      existing._debugOwner = element2._owner;
                    }
                    return existing;
                  }
                } else {
                  if (child.elementType === elementType || // Keep this check inline so it only runs on the false path:
                  isCompatibleFamilyForHotReloading(child, element2) || // Lazy types should reconcile their resolved type.
                  // We need to do this after the Hot Reloading check above,
                  // because hot reloading has different semantics than prod because
                  // it doesn't resuspend. So we can't let the call below suspend.
                  typeof elementType === "object" && elementType !== null && elementType.$$typeof === REACT_LAZY_TYPE && resolveLazy(elementType) === child.type) {
                    deleteRemainingChildren(returnFiber, child.sibling);
                    var _existing = useFiber(child, element2.props);
                    _existing.ref = coerceRef(returnFiber, child, element2);
                    _existing.return = returnFiber;
                    {
                      _existing._debugSource = element2._source;
                      _existing._debugOwner = element2._owner;
                    }
                    return _existing;
                  }
                }
                deleteRemainingChildren(returnFiber, child);
                break;
              } else {
                deleteChild(returnFiber, child);
              }
              child = child.sibling;
            }
            if (element2.type === REACT_FRAGMENT_TYPE) {
              var created = createFiberFromFragment(element2.props.children, returnFiber.mode, lanes, element2.key);
              created.return = returnFiber;
              return created;
            } else {
              var _created4 = createFiberFromElement(element2, returnFiber.mode, lanes);
              _created4.ref = coerceRef(returnFiber, currentFirstChild, element2);
              _created4.return = returnFiber;
              return _created4;
            }
          }
          function reconcileSinglePortal(returnFiber, currentFirstChild, portal, lanes) {
            var key = portal.key;
            var child = currentFirstChild;
            while (child !== null) {
              if (child.key === key) {
                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;
            }
            if (typeof newChild === "object" && newChild !== null) {
              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));
                case REACT_LAZY_TYPE: {
                  var payload = newChild._payload;
                  var init = newChild._init;
                  return reconcileChildFibers2(returnFiber, currentFirstChild, init(payload), lanes);
                }
              }
              if (isArray2(newChild)) {
                return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, lanes);
              }
              if (getIteratorFn(newChild)) {
                return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, lanes);
              }
              throwOnInvalidObjectType(returnFiber, newChild);
            }
            if (typeof newChild === "string" && newChild !== "" || typeof newChild === "number") {
              return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, "" + newChild, lanes));
            }
            {
              if (typeof newChild === "function") {
                warnOnFunctionType(returnFiber);
              }
            }
            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 new 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(c4) {
          if (c4 === NO_CONTEXT) {
            throw new Error("Expected host context to exist. This error is likely caused by a bug in React. Please file an issue.");
          }
          return c4;
        }
        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 context2 = requiredContext(contextStackCursor$1.current);
          return context2;
        }
        function pushHostContext(fiber) {
          var rootInstance = requiredContext(rootInstanceStackCursor.current);
          var context2 = requiredContext(contextStackCursor$1.current);
          var nextContext = getChildHostContext(context2, fiber.type, rootInstance);
          if (context2 === 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;
          {
            return true;
          }
        }
        function findFirstSuspended(row) {
          var node56 = row;
          while (node56 !== null) {
            if (node56.tag === SuspenseComponent) {
              var state = node56.memoizedState;
              if (state !== null) {
                var dehydrated = state.dehydrated;
                if (dehydrated === null || isSuspenseInstancePending(dehydrated) || isSuspenseInstanceFallback(dehydrated)) {
                  return node56;
                }
              }
            } else if (node56.tag === SuspenseListComponent && // revealOrder undefined can't be trusted because it don't
            // keep track of whether it suspended or not.
            node56.memoizedProps.revealOrder !== void 0) {
              var didSuspend2 = (node56.flags & DidCapture) !== NoFlags;
              if (didSuspend2) {
                return node56;
              }
            } else if (node56.child !== null) {
              node56.child.return = node56;
              node56 = node56.child;
              continue;
            }
            if (node56 === row) {
              return null;
            }
            while (node56.sibling === null) {
              if (node56.return === null || node56.return === row) {
                return null;
              }
              node56 = node56.return;
            }
            node56.sibling.return = node56.return;
            node56 = node56.sibling;
          }
          return null;
        }
        var NoFlags$1 = (
          /*   */
          0
        );
        var HasEffect = (
          /* */
          1
        );
        var Insertion5 = (
          /*  */
          2
        );
        var Layout2 = (
          /*    */
          4
        );
        var Passive$1 = (
          /*   */
          8
        );
        var workInProgressSources = [];
        function resetWorkInProgressVersions() {
          for (var i2 = 0; i2 < workInProgressSources.length; i2++) {
            var mutableSource = workInProgressSources[i2];
            if (isPrimaryRenderer) {
              mutableSource._workInProgressVersionPrimary = null;
            } else {
              mutableSource._workInProgressVersionSecondary = null;
            }
          }
          workInProgressSources.length = 0;
        }
        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);
          }
        }
        var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher, ReactCurrentBatchConfig$1 = ReactSharedInternals.ReactCurrentBatchConfig;
        var didWarnAboutMismatchedHooksForComponent;
        var didWarnUncachedGetSnapshot;
        {
          didWarnAboutMismatchedHooksForComponent = /* @__PURE__ */ new Set();
        }
        var renderLanes = NoLanes;
        var currentlyRenderingFiber$1 = null;
        var currentHook = null;
        var workInProgressHook = null;
        var didScheduleRenderPhaseUpdate = false;
        var didScheduleRenderPhaseUpdateDuringThisPass = false;
        var localIdCounter = 0;
        var globalClientIdCounter = 0;
        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 && !isArray2(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 = getComponentNameFromFiber(currentlyRenderingFiber$1);
            if (!didWarnAboutMismatchedHooksForComponent.has(componentName)) {
              didWarnAboutMismatchedHooksForComponent.add(componentName);
              if (hookTypesDev !== null) {
                var table = "";
                var secondColumnStart = 30;
                for (var i2 = 0; i2 <= hookTypesUpdateIndexDev; i2++) {
                  var oldHookName = hookTypesDev[i2];
                  var newHookName = i2 === hookTypesUpdateIndexDev ? currentHookName : oldHookName;
                  var row = i2 + 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 new 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 i2 = 0; i2 < prevDeps.length && i2 < nextDeps.length; i2++) {
            if (objectIs(nextDeps[i2], prevDeps[i2])) {
              continue;
            }
            return false;
          }
          return true;
        }
        function renderWithHooks(current2, workInProgress2, Component8, 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 = Component8(props, secondArg);
          if (didScheduleRenderPhaseUpdateDuringThisPass) {
            var numberOfReRenders = 0;
            do {
              didScheduleRenderPhaseUpdateDuringThisPass = false;
              localIdCounter = 0;
              if (numberOfReRenders >= RE_RENDER_LIMIT) {
                throw new 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 = Component8(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;
            if (current2 !== null && (current2.flags & StaticMask) !== (workInProgress2.flags & StaticMask) && // Disable this warning in legacy mode, because legacy Suspense is weird
            // and creates false positives. To make this work in legacy mode, we'd
            // need to mark fibers that commit in an incomplete state, somehow. For
            // now I'll disable the warning that most of the bugs that would trigger
            // it are either exclusive to concurrent mode or exist in both.
            (current2.mode & ConcurrentMode) !== NoMode) {
              error("Internal React error: Expected static flag was missing. Please notify the React team.");
            }
          }
          didScheduleRenderPhaseUpdate = false;
          if (didRenderTooFewHooks) {
            throw new Error("Rendered fewer hooks than expected. This may be caused by an accidental early return statement.");
          }
          return children;
        }
        function checkDidRenderIdHook() {
          var didRenderIdHook = localIdCounter !== 0;
          localIdCounter = 0;
          return didRenderIdHook;
        }
        function bailoutHooks(current2, workInProgress2, lanes) {
          workInProgress2.updateQueue = current2.updateQueue;
          if ((workInProgress2.mode & StrictEffectsMode) !== NoMode) {
            workInProgress2.flags &= ~(MountPassiveDev | MountLayoutDev | Passive | Update);
          } else {
            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;
          localIdCounter = 0;
        }
        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 new 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,
            stores: 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 = {
            pending: null,
            interleaved: null,
            lanes: NoLanes,
            dispatch: null,
            lastRenderedReducer: reducer,
            lastRenderedState: initialState
          };
          hook.queue = queue;
          var dispatch = queue.dispatch = dispatchReducerAction.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 new 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,
                  hasEagerState: update.hasEagerState,
                  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 = {
                    // This update is going to be committed so we never want uncommit
                    // it. Using NoLane works because 0 is a subset of all bitmasks, so
                    // this will never be skipped by the check above.
                    lane: NoLane,
                    action: update.action,
                    hasEagerState: update.hasEagerState,
                    eagerState: update.eagerState,
                    next: null
                  };
                  newBaseQueueLast = newBaseQueueLast.next = _clone;
                }
                if (update.hasEagerState) {
                  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 lastInterleaved = queue.interleaved;
          if (lastInterleaved !== null) {
            var interleaved = lastInterleaved;
            do {
              var interleavedLane = interleaved.lane;
              currentlyRenderingFiber$1.lanes = mergeLanes(currentlyRenderingFiber$1.lanes, interleavedLane);
              markSkippedUpdateLanes(interleavedLane);
              interleaved = interleaved.next;
            } while (interleaved !== lastInterleaved);
          } else if (baseQueue === null) {
            queue.lanes = NoLanes;
          }
          var dispatch = queue.dispatch;
          return [hook.memoizedState, dispatch];
        }
        function rerenderReducer(reducer, initialArg, init) {
          var hook = updateWorkInProgressHook();
          var queue = hook.queue;
          if (queue === null) {
            throw new 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 mountMutableSource(source, getSnapshot, subscribe) {
          {
            return void 0;
          }
        }
        function updateMutableSource(source, getSnapshot, subscribe) {
          {
            return void 0;
          }
        }
        function mountSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {
          var fiber = currentlyRenderingFiber$1;
          var hook = mountWorkInProgressHook();
          var nextSnapshot;
          var isHydrating2 = getIsHydrating();
          if (isHydrating2) {
            if (getServerSnapshot === void 0) {
              throw new Error("Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering.");
            }
            nextSnapshot = getServerSnapshot();
            {
              if (!didWarnUncachedGetSnapshot) {
                if (nextSnapshot !== getServerSnapshot()) {
                  error("The result of getServerSnapshot should be cached to avoid an infinite loop");
                  didWarnUncachedGetSnapshot = true;
                }
              }
            }
          } else {
            nextSnapshot = getSnapshot();
            {
              if (!didWarnUncachedGetSnapshot) {
                var cachedSnapshot = getSnapshot();
                if (!objectIs(nextSnapshot, cachedSnapshot)) {
                  error("The result of getSnapshot should be cached to avoid an infinite loop");
                  didWarnUncachedGetSnapshot = true;
                }
              }
            }
            var root2 = getWorkInProgressRoot();
            if (root2 === null) {
              throw new Error("Expected a work-in-progress root. This is a bug in React. Please file an issue.");
            }
            if (!includesBlockingLane(root2, renderLanes)) {
              pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot);
            }
          }
          hook.memoizedState = nextSnapshot;
          var inst = {
            value: nextSnapshot,
            getSnapshot
          };
          hook.queue = inst;
          mountEffect(subscribeToStore.bind(null, fiber, inst, subscribe), [subscribe]);
          fiber.flags |= Passive;
          pushEffect(HasEffect | Passive$1, updateStoreInstance.bind(null, fiber, inst, nextSnapshot, getSnapshot), void 0, null);
          return nextSnapshot;
        }
        function updateSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {
          var fiber = currentlyRenderingFiber$1;
          var hook = updateWorkInProgressHook();
          var nextSnapshot = getSnapshot();
          {
            if (!didWarnUncachedGetSnapshot) {
              var cachedSnapshot = getSnapshot();
              if (!objectIs(nextSnapshot, cachedSnapshot)) {
                error("The result of getSnapshot should be cached to avoid an infinite loop");
                didWarnUncachedGetSnapshot = true;
              }
            }
          }
          var prevSnapshot = hook.memoizedState;
          var snapshotChanged = !objectIs(prevSnapshot, nextSnapshot);
          if (snapshotChanged) {
            hook.memoizedState = nextSnapshot;
            markWorkInProgressReceivedUpdate();
          }
          var inst = hook.queue;
          updateEffect(subscribeToStore.bind(null, fiber, inst, subscribe), [subscribe]);
          if (inst.getSnapshot !== getSnapshot || snapshotChanged || // Check if the susbcribe function changed. We can save some memory by
          // checking whether we scheduled a subscription effect above.
          workInProgressHook !== null && workInProgressHook.memoizedState.tag & HasEffect) {
            fiber.flags |= Passive;
            pushEffect(HasEffect | Passive$1, updateStoreInstance.bind(null, fiber, inst, nextSnapshot, getSnapshot), void 0, null);
            var root2 = getWorkInProgressRoot();
            if (root2 === null) {
              throw new Error("Expected a work-in-progress root. This is a bug in React. Please file an issue.");
            }
            if (!includesBlockingLane(root2, renderLanes)) {
              pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot);
            }
          }
          return nextSnapshot;
        }
        function pushStoreConsistencyCheck(fiber, getSnapshot, renderedSnapshot) {
          fiber.flags |= StoreConsistency;
          var check = {
            getSnapshot,
            value: renderedSnapshot
          };
          var componentUpdateQueue = currentlyRenderingFiber$1.updateQueue;
          if (componentUpdateQueue === null) {
            componentUpdateQueue = createFunctionComponentUpdateQueue();
            currentlyRenderingFiber$1.updateQueue = componentUpdateQueue;
            componentUpdateQueue.stores = [check];
          } else {
            var stores = componentUpdateQueue.stores;
            if (stores === null) {
              componentUpdateQueue.stores = [check];
            } else {
              stores.push(check);
            }
          }
        }
        function updateStoreInstance(fiber, inst, nextSnapshot, getSnapshot) {
          inst.value = nextSnapshot;
          inst.getSnapshot = getSnapshot;
          if (checkIfSnapshotChanged(inst)) {
            forceStoreRerender(fiber);
          }
        }
        function subscribeToStore(fiber, inst, subscribe) {
          var handleStoreChange = function() {
            if (checkIfSnapshotChanged(inst)) {
              forceStoreRerender(fiber);
            }
          };
          return subscribe(handleStoreChange);
        }
        function checkIfSnapshotChanged(inst) {
          var latestGetSnapshot = inst.getSnapshot;
          var prevValue = inst.value;
          try {
            var nextValue = latestGetSnapshot();
            return !objectIs(prevValue, nextValue);
          } catch (error2) {
            return true;
          }
        }
        function forceStoreRerender(fiber) {
          scheduleUpdateOnFiber(fiber, SyncLane, NoTimestamp);
        }
        function mountState(initialState) {
          var hook = mountWorkInProgressHook();
          if (typeof initialState === "function") {
            initialState = initialState();
          }
          hook.memoizedState = hook.baseState = initialState;
          var queue = {
            pending: null,
            interleaved: null,
            lanes: NoLanes,
            dispatch: null,
            lastRenderedReducer: basicStateReducer,
            lastRenderedState: initialState
          };
          hook.queue = queue;
          var dispatch = queue.dispatch = dispatchSetState.bind(null, currentlyRenderingFiber$1, queue);
          return [hook.memoizedState, dispatch];
        }
        function updateState(initialState) {
          return updateReducer(basicStateReducer);
        }
        function rerenderState(initialState) {
          return rerenderReducer(basicStateReducer);
        }
        function pushEffect(tag, create4, destroy, deps) {
          var effect = {
            tag,
            create: create4,
            destroy,
            deps,
            // Circular
            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 _ref22 = {
              current: initialValue
            };
            hook.memoizedState = _ref22;
            return _ref22;
          }
        }
        function updateRef(initialValue) {
          var hook = updateWorkInProgressHook();
          return hook.memoizedState;
        }
        function mountEffectImpl(fiberFlags, hookFlags, create4, deps) {
          var hook = mountWorkInProgressHook();
          var nextDeps = deps === void 0 ? null : deps;
          currentlyRenderingFiber$1.flags |= fiberFlags;
          hook.memoizedState = pushEffect(HasEffect | hookFlags, create4, void 0, nextDeps);
        }
        function updateEffectImpl(fiberFlags, hookFlags, create4, 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)) {
                hook.memoizedState = pushEffect(hookFlags, create4, destroy, nextDeps);
                return;
              }
            }
          }
          currentlyRenderingFiber$1.flags |= fiberFlags;
          hook.memoizedState = pushEffect(HasEffect | hookFlags, create4, destroy, nextDeps);
        }
        function mountEffect(create4, deps) {
          if ((currentlyRenderingFiber$1.mode & StrictEffectsMode) !== NoMode) {
            return mountEffectImpl(MountPassiveDev | Passive | PassiveStatic, Passive$1, create4, deps);
          } else {
            return mountEffectImpl(Passive | PassiveStatic, Passive$1, create4, deps);
          }
        }
        function updateEffect(create4, deps) {
          return updateEffectImpl(Passive, Passive$1, create4, deps);
        }
        function mountInsertionEffect(create4, deps) {
          return mountEffectImpl(Update, Insertion5, create4, deps);
        }
        function updateInsertionEffect(create4, deps) {
          return updateEffectImpl(Update, Insertion5, create4, deps);
        }
        function mountLayoutEffect(create4, deps) {
          var fiberFlags = Update;
          {
            fiberFlags |= LayoutStatic;
          }
          if ((currentlyRenderingFiber$1.mode & StrictEffectsMode) !== NoMode) {
            fiberFlags |= MountLayoutDev;
          }
          return mountEffectImpl(fiberFlags, Layout2, create4, deps);
        }
        function updateLayoutEffect(create4, deps) {
          return updateEffectImpl(Update, Layout2, create4, deps);
        }
        function imperativeHandleEffect(create4, ref) {
          if (typeof ref === "function") {
            var refCallback = ref;
            var _inst = create4();
            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 = create4();
            refObject.current = _inst2;
            return function() {
              refObject.current = null;
            };
          }
        }
        function mountImperativeHandle(ref, create4, deps) {
          {
            if (typeof create4 !== "function") {
              error("Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.", create4 !== null ? typeof create4 : "null");
            }
          }
          var effectDeps = deps !== null && deps !== void 0 ? deps.concat([ref]) : null;
          var fiberFlags = Update;
          {
            fiberFlags |= LayoutStatic;
          }
          if ((currentlyRenderingFiber$1.mode & StrictEffectsMode) !== NoMode) {
            fiberFlags |= MountLayoutDev;
          }
          return mountEffectImpl(fiberFlags, Layout2, imperativeHandleEffect.bind(null, create4, ref), effectDeps);
        }
        function updateImperativeHandle(ref, create4, deps) {
          {
            if (typeof create4 !== "function") {
              error("Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.", create4 !== null ? typeof create4 : "null");
            }
          }
          var effectDeps = deps !== null && deps !== void 0 ? deps.concat([ref]) : null;
          return updateEffectImpl(Update, Layout2, imperativeHandleEffect.bind(null, create4, 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 = {};
            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 = {};
            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 = {};
            try {
              setValue(value);
            } finally {
              ReactCurrentBatchConfig$1.transition = prevTransition;
            }
          }, [value]);
          return prevValue;
        }
        function startTransition13(setPending, callback, options) {
          var previousPriority = getCurrentUpdatePriority();
          setCurrentUpdatePriority(higherEventPriority(previousPriority, ContinuousEventPriority2));
          setPending(true);
          var prevTransition = ReactCurrentBatchConfig$1.transition;
          ReactCurrentBatchConfig$1.transition = {};
          var currentTransition = ReactCurrentBatchConfig$1.transition;
          {
            ReactCurrentBatchConfig$1.transition._updatedFibers = /* @__PURE__ */ new Set();
          }
          try {
            setPending(false);
            callback();
          } finally {
            setCurrentUpdatePriority(previousPriority);
            ReactCurrentBatchConfig$1.transition = prevTransition;
            {
              if (prevTransition === null && currentTransition._updatedFibers) {
                var updatedFibersCount = currentTransition._updatedFibers.size;
                if (updatedFibersCount > 10) {
                  warn5("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table.");
                }
                currentTransition._updatedFibers.clear();
              }
            }
          }
        }
        function mountTransition() {
          var _mountState2 = mountState(false), isPending = _mountState2[0], setPending = _mountState2[1];
          var start = startTransition13.bind(null, setPending);
          var hook = mountWorkInProgressHook();
          hook.memoizedState = start;
          return [isPending, start];
        }
        function updateTransition() {
          var _updateState2 = updateState(), isPending = _updateState2[0];
          var hook = updateWorkInProgressHook();
          var start = hook.memoizedState;
          return [isPending, start];
        }
        function rerenderTransition() {
          var _rerenderState2 = rerenderState(), isPending = _rerenderState2[0];
          var hook = updateWorkInProgressHook();
          var start = hook.memoizedState;
          return [isPending, start];
        }
        var isUpdatingOpaqueValueInRenderPhase = false;
        function getIsUpdatingOpaqueValueInRenderPhaseInDEV() {
          {
            return isUpdatingOpaqueValueInRenderPhase;
          }
        }
        function mountId() {
          var hook = mountWorkInProgressHook();
          var root2 = getWorkInProgressRoot();
          var identifierPrefix = root2.identifierPrefix;
          var id2;
          if (getIsHydrating()) {
            var treeId = getTreeId();
            id2 = ":" + identifierPrefix + "R" + treeId;
            var localId = localIdCounter++;
            if (localId > 0) {
              id2 += "H" + localId.toString(32);
            }
            id2 += ":";
          } else {
            var globalClientId = globalClientIdCounter++;
            id2 = ":" + identifierPrefix + "r" + globalClientId.toString(32) + ":";
          }
          hook.memoizedState = id2;
          return id2;
        }
        function updateId() {
          var hook = updateWorkInProgressHook();
          var id2 = hook.memoizedState;
          return id2;
        }
        function dispatchReducerAction(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 lane = requestUpdateLane(fiber);
          var update = {
            lane,
            action,
            hasEagerState: false,
            eagerState: null,
            next: null
          };
          if (isRenderPhaseUpdate(fiber)) {
            enqueueRenderPhaseUpdate(queue, update);
          } else {
            enqueueUpdate$1(fiber, queue, update);
            var eventTime = requestEventTime();
            var root2 = scheduleUpdateOnFiber(fiber, lane, eventTime);
            if (root2 !== null) {
              entangleTransitionUpdate(root2, queue, lane);
            }
          }
          markUpdateInDevTools(fiber, lane);
        }
        function dispatchSetState(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 lane = requestUpdateLane(fiber);
          var update = {
            lane,
            action,
            hasEagerState: false,
            eagerState: null,
            next: null
          };
          if (isRenderPhaseUpdate(fiber)) {
            enqueueRenderPhaseUpdate(queue, update);
          } else {
            enqueueUpdate$1(fiber, queue, update);
            var alternate = fiber.alternate;
            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 currentState2 = queue.lastRenderedState;
                  var eagerState = lastRenderedReducer(currentState2, action);
                  update.hasEagerState = true;
                  update.eagerState = eagerState;
                  if (objectIs(eagerState, currentState2)) {
                    return;
                  }
                } catch (error2) {
                } finally {
                  {
                    ReactCurrentDispatcher$1.current = prevDispatcher;
                  }
                }
              }
            }
            var eventTime = requestEventTime();
            var root2 = scheduleUpdateOnFiber(fiber, lane, eventTime);
            if (root2 !== null) {
              entangleTransitionUpdate(root2, queue, lane);
            }
          }
          markUpdateInDevTools(fiber, lane);
        }
        function isRenderPhaseUpdate(fiber) {
          var alternate = fiber.alternate;
          return fiber === currentlyRenderingFiber$1 || alternate !== null && alternate === currentlyRenderingFiber$1;
        }
        function enqueueRenderPhaseUpdate(queue, update) {
          didScheduleRenderPhaseUpdateDuringThisPass = didScheduleRenderPhaseUpdate = true;
          var pending = queue.pending;
          if (pending === null) {
            update.next = update;
          } else {
            update.next = pending.next;
            pending.next = update;
          }
          queue.pending = update;
        }
        function enqueueUpdate$1(fiber, queue, update, lane) {
          if (isInterleavedUpdate(fiber)) {
            var interleaved = queue.interleaved;
            if (interleaved === null) {
              update.next = update;
              pushInterleavedQueue(queue);
            } else {
              update.next = interleaved.next;
              interleaved.next = update;
            }
            queue.interleaved = update;
          } else {
            var pending = queue.pending;
            if (pending === null) {
              update.next = update;
            } else {
              update.next = pending.next;
              pending.next = update;
            }
            queue.pending = update;
          }
        }
        function entangleTransitionUpdate(root2, queue, lane) {
          if (isTransitionLane(lane)) {
            var queueLanes = queue.lanes;
            queueLanes = intersectLanes(queueLanes, root2.pendingLanes);
            var newQueueLanes = mergeLanes(queueLanes, lane);
            queue.lanes = newQueueLanes;
            markRootEntangled(root2, newQueueLanes);
          }
        }
        function markUpdateInDevTools(fiber, lane, action) {
          {
            markStateUpdateScheduled(fiber, lane);
          }
        }
        var ContextOnlyDispatcher = {
          readContext,
          useCallback: throwInvalidHookError,
          useContext: throwInvalidHookError,
          useEffect: throwInvalidHookError,
          useImperativeHandle: throwInvalidHookError,
          useInsertionEffect: throwInvalidHookError,
          useLayoutEffect: throwInvalidHookError,
          useMemo: throwInvalidHookError,
          useReducer: throwInvalidHookError,
          useRef: throwInvalidHookError,
          useState: throwInvalidHookError,
          useDebugValue: throwInvalidHookError,
          useDeferredValue: throwInvalidHookError,
          useTransition: throwInvalidHookError,
          useMutableSource: throwInvalidHookError,
          useSyncExternalStore: throwInvalidHookError,
          useId: 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(context2) {
              return readContext(context2);
            },
            useCallback: function(callback, deps) {
              currentHookNameInDev = "useCallback";
              mountHookTypesDev();
              checkDepsAreArrayDev(deps);
              return mountCallback(callback, deps);
            },
            useContext: function(context2) {
              currentHookNameInDev = "useContext";
              mountHookTypesDev();
              return readContext(context2);
            },
            useEffect: function(create4, deps) {
              currentHookNameInDev = "useEffect";
              mountHookTypesDev();
              checkDepsAreArrayDev(deps);
              return mountEffect(create4, deps);
            },
            useImperativeHandle: function(ref, create4, deps) {
              currentHookNameInDev = "useImperativeHandle";
              mountHookTypesDev();
              checkDepsAreArrayDev(deps);
              return mountImperativeHandle(ref, create4, deps);
            },
            useInsertionEffect: function(create4, deps) {
              currentHookNameInDev = "useInsertionEffect";
              mountHookTypesDev();
              checkDepsAreArrayDev(deps);
              return mountInsertionEffect(create4, deps);
            },
            useLayoutEffect: function(create4, deps) {
              currentHookNameInDev = "useLayoutEffect";
              mountHookTypesDev();
              checkDepsAreArrayDev(deps);
              return mountLayoutEffect(create4, deps);
            },
            useMemo: function(create4, deps) {
              currentHookNameInDev = "useMemo";
              mountHookTypesDev();
              checkDepsAreArrayDev(deps);
              var prevDispatcher = ReactCurrentDispatcher$1.current;
              ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
              try {
                return mountMemo(create4, 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();
            },
            useSyncExternalStore: function(subscribe, getSnapshot, getServerSnapshot) {
              currentHookNameInDev = "useSyncExternalStore";
              mountHookTypesDev();
              return mountSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
            },
            useId: function() {
              currentHookNameInDev = "useId";
              mountHookTypesDev();
              return mountId();
            },
            unstable_isNewReconciler: enableNewReconciler
          };
          HooksDispatcherOnMountWithHookTypesInDEV = {
            readContext: function(context2) {
              return readContext(context2);
            },
            useCallback: function(callback, deps) {
              currentHookNameInDev = "useCallback";
              updateHookTypesDev();
              return mountCallback(callback, deps);
            },
            useContext: function(context2) {
              currentHookNameInDev = "useContext";
              updateHookTypesDev();
              return readContext(context2);
            },
            useEffect: function(create4, deps) {
              currentHookNameInDev = "useEffect";
              updateHookTypesDev();
              return mountEffect(create4, deps);
            },
            useImperativeHandle: function(ref, create4, deps) {
              currentHookNameInDev = "useImperativeHandle";
              updateHookTypesDev();
              return mountImperativeHandle(ref, create4, deps);
            },
            useInsertionEffect: function(create4, deps) {
              currentHookNameInDev = "useInsertionEffect";
              updateHookTypesDev();
              return mountInsertionEffect(create4, deps);
            },
            useLayoutEffect: function(create4, deps) {
              currentHookNameInDev = "useLayoutEffect";
              updateHookTypesDev();
              return mountLayoutEffect(create4, deps);
            },
            useMemo: function(create4, deps) {
              currentHookNameInDev = "useMemo";
              updateHookTypesDev();
              var prevDispatcher = ReactCurrentDispatcher$1.current;
              ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
              try {
                return mountMemo(create4, 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();
            },
            useSyncExternalStore: function(subscribe, getSnapshot, getServerSnapshot) {
              currentHookNameInDev = "useSyncExternalStore";
              updateHookTypesDev();
              return mountSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
            },
            useId: function() {
              currentHookNameInDev = "useId";
              updateHookTypesDev();
              return mountId();
            },
            unstable_isNewReconciler: enableNewReconciler
          };
          HooksDispatcherOnUpdateInDEV = {
            readContext: function(context2) {
              return readContext(context2);
            },
            useCallback: function(callback, deps) {
              currentHookNameInDev = "useCallback";
              updateHookTypesDev();
              return updateCallback(callback, deps);
            },
            useContext: function(context2) {
              currentHookNameInDev = "useContext";
              updateHookTypesDev();
              return readContext(context2);
            },
            useEffect: function(create4, deps) {
              currentHookNameInDev = "useEffect";
              updateHookTypesDev();
              return updateEffect(create4, deps);
            },
            useImperativeHandle: function(ref, create4, deps) {
              currentHookNameInDev = "useImperativeHandle";
              updateHookTypesDev();
              return updateImperativeHandle(ref, create4, deps);
            },
            useInsertionEffect: function(create4, deps) {
              currentHookNameInDev = "useInsertionEffect";
              updateHookTypesDev();
              return updateInsertionEffect(create4, deps);
            },
            useLayoutEffect: function(create4, deps) {
              currentHookNameInDev = "useLayoutEffect";
              updateHookTypesDev();
              return updateLayoutEffect(create4, deps);
            },
            useMemo: function(create4, deps) {
              currentHookNameInDev = "useMemo";
              updateHookTypesDev();
              var prevDispatcher = ReactCurrentDispatcher$1.current;
              ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
              try {
                return updateMemo(create4, 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();
            },
            useSyncExternalStore: function(subscribe, getSnapshot, getServerSnapshot) {
              currentHookNameInDev = "useSyncExternalStore";
              updateHookTypesDev();
              return updateSyncExternalStore(subscribe, getSnapshot);
            },
            useId: function() {
              currentHookNameInDev = "useId";
              updateHookTypesDev();
              return updateId();
            },
            unstable_isNewReconciler: enableNewReconciler
          };
          HooksDispatcherOnRerenderInDEV = {
            readContext: function(context2) {
              return readContext(context2);
            },
            useCallback: function(callback, deps) {
              currentHookNameInDev = "useCallback";
              updateHookTypesDev();
              return updateCallback(callback, deps);
            },
            useContext: function(context2) {
              currentHookNameInDev = "useContext";
              updateHookTypesDev();
              return readContext(context2);
            },
            useEffect: function(create4, deps) {
              currentHookNameInDev = "useEffect";
              updateHookTypesDev();
              return updateEffect(create4, deps);
            },
            useImperativeHandle: function(ref, create4, deps) {
              currentHookNameInDev = "useImperativeHandle";
              updateHookTypesDev();
              return updateImperativeHandle(ref, create4, deps);
            },
            useInsertionEffect: function(create4, deps) {
              currentHookNameInDev = "useInsertionEffect";
              updateHookTypesDev();
              return updateInsertionEffect(create4, deps);
            },
            useLayoutEffect: function(create4, deps) {
              currentHookNameInDev = "useLayoutEffect";
              updateHookTypesDev();
              return updateLayoutEffect(create4, deps);
            },
            useMemo: function(create4, deps) {
              currentHookNameInDev = "useMemo";
              updateHookTypesDev();
              var prevDispatcher = ReactCurrentDispatcher$1.current;
              ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnRerenderInDEV;
              try {
                return updateMemo(create4, 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();
            },
            useSyncExternalStore: function(subscribe, getSnapshot, getServerSnapshot) {
              currentHookNameInDev = "useSyncExternalStore";
              updateHookTypesDev();
              return updateSyncExternalStore(subscribe, getSnapshot);
            },
            useId: function() {
              currentHookNameInDev = "useId";
              updateHookTypesDev();
              return updateId();
            },
            unstable_isNewReconciler: enableNewReconciler
          };
          InvalidNestedHooksDispatcherOnMountInDEV = {
            readContext: function(context2) {
              warnInvalidContextAccess();
              return readContext(context2);
            },
            useCallback: function(callback, deps) {
              currentHookNameInDev = "useCallback";
              warnInvalidHookAccess();
              mountHookTypesDev();
              return mountCallback(callback, deps);
            },
            useContext: function(context2) {
              currentHookNameInDev = "useContext";
              warnInvalidHookAccess();
              mountHookTypesDev();
              return readContext(context2);
            },
            useEffect: function(create4, deps) {
              currentHookNameInDev = "useEffect";
              warnInvalidHookAccess();
              mountHookTypesDev();
              return mountEffect(create4, deps);
            },
            useImperativeHandle: function(ref, create4, deps) {
              currentHookNameInDev = "useImperativeHandle";
              warnInvalidHookAccess();
              mountHookTypesDev();
              return mountImperativeHandle(ref, create4, deps);
            },
            useInsertionEffect: function(create4, deps) {
              currentHookNameInDev = "useInsertionEffect";
              warnInvalidHookAccess();
              mountHookTypesDev();
              return mountInsertionEffect(create4, deps);
            },
            useLayoutEffect: function(create4, deps) {
              currentHookNameInDev = "useLayoutEffect";
              warnInvalidHookAccess();
              mountHookTypesDev();
              return mountLayoutEffect(create4, deps);
            },
            useMemo: function(create4, deps) {
              currentHookNameInDev = "useMemo";
              warnInvalidHookAccess();
              mountHookTypesDev();
              var prevDispatcher = ReactCurrentDispatcher$1.current;
              ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
              try {
                return mountMemo(create4, 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();
            },
            useSyncExternalStore: function(subscribe, getSnapshot, getServerSnapshot) {
              currentHookNameInDev = "useSyncExternalStore";
              warnInvalidHookAccess();
              mountHookTypesDev();
              return mountSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
            },
            useId: function() {
              currentHookNameInDev = "useId";
              warnInvalidHookAccess();
              mountHookTypesDev();
              return mountId();
            },
            unstable_isNewReconciler: enableNewReconciler
          };
          InvalidNestedHooksDispatcherOnUpdateInDEV = {
            readContext: function(context2) {
              warnInvalidContextAccess();
              return readContext(context2);
            },
            useCallback: function(callback, deps) {
              currentHookNameInDev = "useCallback";
              warnInvalidHookAccess();
              updateHookTypesDev();
              return updateCallback(callback, deps);
            },
            useContext: function(context2) {
              currentHookNameInDev = "useContext";
              warnInvalidHookAccess();
              updateHookTypesDev();
              return readContext(context2);
            },
            useEffect: function(create4, deps) {
              currentHookNameInDev = "useEffect";
              warnInvalidHookAccess();
              updateHookTypesDev();
              return updateEffect(create4, deps);
            },
            useImperativeHandle: function(ref, create4, deps) {
              currentHookNameInDev = "useImperativeHandle";
              warnInvalidHookAccess();
              updateHookTypesDev();
              return updateImperativeHandle(ref, create4, deps);
            },
            useInsertionEffect: function(create4, deps) {
              currentHookNameInDev = "useInsertionEffect";
              warnInvalidHookAccess();
              updateHookTypesDev();
              return updateInsertionEffect(create4, deps);
            },
            useLayoutEffect: function(create4, deps) {
              currentHookNameInDev = "useLayoutEffect";
              warnInvalidHookAccess();
              updateHookTypesDev();
              return updateLayoutEffect(create4, deps);
            },
            useMemo: function(create4, deps) {
              currentHookNameInDev = "useMemo";
              warnInvalidHookAccess();
              updateHookTypesDev();
              var prevDispatcher = ReactCurrentDispatcher$1.current;
              ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
              try {
                return updateMemo(create4, 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();
            },
            useSyncExternalStore: function(subscribe, getSnapshot, getServerSnapshot) {
              currentHookNameInDev = "useSyncExternalStore";
              warnInvalidHookAccess();
              updateHookTypesDev();
              return updateSyncExternalStore(subscribe, getSnapshot);
            },
            useId: function() {
              currentHookNameInDev = "useId";
              warnInvalidHookAccess();
              updateHookTypesDev();
              return updateId();
            },
            unstable_isNewReconciler: enableNewReconciler
          };
          InvalidNestedHooksDispatcherOnRerenderInDEV = {
            readContext: function(context2) {
              warnInvalidContextAccess();
              return readContext(context2);
            },
            useCallback: function(callback, deps) {
              currentHookNameInDev = "useCallback";
              warnInvalidHookAccess();
              updateHookTypesDev();
              return updateCallback(callback, deps);
            },
            useContext: function(context2) {
              currentHookNameInDev = "useContext";
              warnInvalidHookAccess();
              updateHookTypesDev();
              return readContext(context2);
            },
            useEffect: function(create4, deps) {
              currentHookNameInDev = "useEffect";
              warnInvalidHookAccess();
              updateHookTypesDev();
              return updateEffect(create4, deps);
            },
            useImperativeHandle: function(ref, create4, deps) {
              currentHookNameInDev = "useImperativeHandle";
              warnInvalidHookAccess();
              updateHookTypesDev();
              return updateImperativeHandle(ref, create4, deps);
            },
            useInsertionEffect: function(create4, deps) {
              currentHookNameInDev = "useInsertionEffect";
              warnInvalidHookAccess();
              updateHookTypesDev();
              return updateInsertionEffect(create4, deps);
            },
            useLayoutEffect: function(create4, deps) {
              currentHookNameInDev = "useLayoutEffect";
              warnInvalidHookAccess();
              updateHookTypesDev();
              return updateLayoutEffect(create4, deps);
            },
            useMemo: function(create4, deps) {
              currentHookNameInDev = "useMemo";
              warnInvalidHookAccess();
              updateHookTypesDev();
              var prevDispatcher = ReactCurrentDispatcher$1.current;
              ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
              try {
                return updateMemo(create4, 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();
            },
            useSyncExternalStore: function(subscribe, getSnapshot, getServerSnapshot) {
              currentHookNameInDev = "useSyncExternalStore";
              warnInvalidHookAccess();
              updateHookTypesDev();
              return updateSyncExternalStore(subscribe, getSnapshot);
            },
            useId: function() {
              currentHookNameInDev = "useId";
              warnInvalidHookAccess();
              updateHookTypesDev();
              return updateId();
            },
            unstable_isNewReconciler: enableNewReconciler
          };
        }
        var now$2 = Scheduler.unstable_now;
        var commitTime = 0;
        var layoutEffectStartTime = -1;
        var profilerStartTime = -1;
        var passiveEffectStartTime = -1;
        var currentUpdateIsNested = false;
        var nestedUpdateScheduled = false;
        function isCurrentUpdateNested() {
          return currentUpdateIsNested;
        }
        function markNestedUpdateScheduled() {
          {
            nestedUpdateScheduled = true;
          }
        }
        function resetNestedUpdateFlag() {
          {
            currentUpdateIsNested = false;
            nestedUpdateScheduled = false;
          }
        }
        function syncNestedUpdateFlag() {
          {
            currentUpdateIsNested = nestedUpdateScheduled;
            nestedUpdateScheduled = false;
          }
        }
        function getCommitTime() {
          return commitTime;
        }
        function recordCommitTime() {
          commitTime = now$2();
        }
        function startProfilerTimer(fiber) {
          profilerStartTime = now$2();
          if (fiber.actualStartTime < 0) {
            fiber.actualStartTime = now$2();
          }
        }
        function stopProfilerTimerIfRunning(fiber) {
          profilerStartTime = -1;
        }
        function stopProfilerTimerIfRunningAndRecordDelta(fiber, overrideBaseTime) {
          if (profilerStartTime >= 0) {
            var elapsedTime = now$2() - profilerStartTime;
            fiber.actualDuration += elapsedTime;
            if (overrideBaseTime) {
              fiber.selfBaseDuration = elapsedTime;
            }
            profilerStartTime = -1;
          }
        }
        function recordLayoutEffectDuration(fiber) {
          if (layoutEffectStartTime >= 0) {
            var elapsedTime = now$2() - layoutEffectStartTime;
            layoutEffectStartTime = -1;
            var parentFiber = fiber.return;
            while (parentFiber !== null) {
              switch (parentFiber.tag) {
                case HostRoot:
                  var root2 = parentFiber.stateNode;
                  root2.effectDuration += elapsedTime;
                  return;
                case Profiler:
                  var parentStateNode = parentFiber.stateNode;
                  parentStateNode.effectDuration += elapsedTime;
                  return;
              }
              parentFiber = parentFiber.return;
            }
          }
        }
        function recordPassiveEffectDuration(fiber) {
          if (passiveEffectStartTime >= 0) {
            var elapsedTime = now$2() - passiveEffectStartTime;
            passiveEffectStartTime = -1;
            var parentFiber = fiber.return;
            while (parentFiber !== null) {
              switch (parentFiber.tag) {
                case HostRoot:
                  var root2 = parentFiber.stateNode;
                  if (root2 !== null) {
                    root2.passiveEffectDuration += elapsedTime;
                  }
                  return;
                case Profiler:
                  var parentStateNode = parentFiber.stateNode;
                  if (parentStateNode !== null) {
                    parentStateNode.passiveEffectDuration += elapsedTime;
                  }
                  return;
              }
              parentFiber = parentFiber.return;
            }
          }
        }
        function startLayoutEffectTimer() {
          layoutEffectStartTime = now$2();
        }
        function startPassiveEffectTimer() {
          passiveEffectStartTime = now$2();
        }
        function transferActualDuration(fiber) {
          var child = fiber.child;
          while (child) {
            fiber.actualDuration += child.actualDuration;
            child = child.sibling;
          }
        }
        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 ? getComponentNameFromFiber(source) : null;
              var componentNameMessage = componentName ? "The above error occurred in the <" + componentName + "> component:" : "The above error occurred in one of your React components:";
              var errorBoundaryMessage;
              if (boundary.tag === HostRoot) {
                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.";
              } else {
                var errorBoundaryName = getComponentNameFromFiber(boundary) || "Anonymous";
                errorBoundaryMessage = "React will try to recreate this component tree from scratch " + ("using the error boundary you provided, " + errorBoundaryName + ".");
              }
              var combinedMessage = componentNameMessage + "\n" + componentStack + "\n\n" + ("" + errorBoundaryMessage);
              console["error"](combinedMessage);
            } else {
              console["error"](error2);
            }
          } catch (e3) {
            setTimeout(function() {
              throw e3;
            });
          }
        }
        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() {
              return getDerivedStateFromError(error$1);
            };
            update.callback = function() {
              {
                markFailedErrorBoundaryForHotReloading(fiber);
              }
              logCapturedError(fiber, errorInfo);
            };
          }
          var inst = fiber.stateNode;
          if (inst !== null && typeof inst.componentDidCatch === "function") {
            update.callback = function callback() {
              {
                markFailedErrorBoundaryForHotReloading(fiber);
              }
              logCapturedError(fiber, errorInfo);
              if (typeof getDerivedStateFromError !== "function") {
                markLegacyErrorBoundaryAsFailed(this);
              }
              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.", getComponentNameFromFiber(fiber) || "Unknown");
                  }
                }
              }
            };
          }
          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);
            {
              if (isDevToolsPresent) {
                restorePendingUpdaters(root2, lanes);
              }
            }
            wakeable.then(ping, ping);
          }
        }
        function attachRetryListener(suspenseBoundary, root2, wakeable, lanes) {
          var wakeables = suspenseBoundary.updateQueue;
          if (wakeables === null) {
            var updateQueue = /* @__PURE__ */ new Set();
            updateQueue.add(wakeable);
            suspenseBoundary.updateQueue = updateQueue;
          } else {
            wakeables.add(wakeable);
          }
        }
        function resetSuspendedComponent(sourceFiber, rootRenderLanes) {
          var tag = sourceFiber.tag;
          if ((sourceFiber.mode & ConcurrentMode) === NoMode && (tag === FunctionComponent || tag === ForwardRef || tag === SimpleMemoComponent)) {
            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;
            }
          }
        }
        function getNearestSuspenseBoundaryToCapture(returnFiber) {
          var node56 = returnFiber;
          do {
            if (node56.tag === SuspenseComponent && shouldCaptureSuspense(node56)) {
              return node56;
            }
            node56 = node56.return;
          } while (node56 !== null);
          return null;
        }
        function markSuspenseBoundaryShouldCapture(suspenseBoundary, returnFiber, sourceFiber, root2, rootRenderLanes) {
          if ((suspenseBoundary.mode & ConcurrentMode) === NoMode) {
            if (suspenseBoundary === returnFiber) {
              suspenseBoundary.flags |= ShouldCapture;
            } else {
              suspenseBoundary.flags |= DidCapture;
              sourceFiber.flags |= ForceUpdateForLegacySuspense;
              sourceFiber.flags &= ~(LifecycleEffectMask | Incomplete);
              if (supportsPersistence && enablePersistentOffscreenHostContainer) {
                var currentSuspenseBoundary = suspenseBoundary.alternate;
                if (currentSuspenseBoundary === null) {
                  var offscreenFiber = suspenseBoundary.child;
                  var offscreenContainer = offscreenFiber.child;
                  if (offscreenContainer !== null) {
                    var children = offscreenContainer.memoizedProps.children;
                    var containerProps = getOffscreenContainerProps("hidden", children);
                    offscreenContainer.pendingProps = containerProps;
                    offscreenContainer.memoizedProps = containerProps;
                  }
                }
              }
              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 suspenseBoundary;
          }
          suspenseBoundary.flags |= ShouldCapture;
          suspenseBoundary.lanes = rootRenderLanes;
          return suspenseBoundary;
        }
        function throwException(root2, returnFiber, sourceFiber, value, rootRenderLanes) {
          sourceFiber.flags |= Incomplete;
          {
            if (isDevToolsPresent) {
              restorePendingUpdaters(root2, rootRenderLanes);
            }
          }
          if (value !== null && typeof value === "object" && typeof value.then === "function") {
            var wakeable = value;
            resetSuspendedComponent(sourceFiber);
            var suspenseBoundary = getNearestSuspenseBoundaryToCapture(returnFiber);
            if (suspenseBoundary !== null) {
              suspenseBoundary.flags &= ~ForceClientRender;
              markSuspenseBoundaryShouldCapture(suspenseBoundary, returnFiber, sourceFiber, root2, rootRenderLanes);
              if (suspenseBoundary.mode & ConcurrentMode) {
                attachPingListener(root2, wakeable, rootRenderLanes);
              }
              attachRetryListener(suspenseBoundary, root2, wakeable);
              return;
            } else {
              if (!includesSyncLane(rootRenderLanes)) {
                attachPingListener(root2, wakeable, rootRenderLanes);
                renderDidSuspendDelayIfPossible();
                return;
              }
              var uncaughtSuspenseError = new Error("A component suspended while responding to synchronous input. This will cause the UI to be replaced with a loading indicator. To fix, updates that suspend should be wrapped with startTransition.");
              value = uncaughtSuspenseError;
            }
          } else {
            if (getIsHydrating() && sourceFiber.mode & ConcurrentMode) {
              markDidSuspendWhileHydratingDEV();
              var _suspenseBoundary = getNearestSuspenseBoundaryToCapture(returnFiber);
              if (_suspenseBoundary !== null) {
                if ((_suspenseBoundary.flags & ShouldCapture) === NoFlags) {
                  _suspenseBoundary.flags |= ForceClientRender;
                }
                markSuspenseBoundaryShouldCapture(_suspenseBoundary, returnFiber, sourceFiber, root2, rootRenderLanes);
                queueHydrationError(value);
                return;
              }
            }
          }
          renderDidError(value);
          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 _update = createClassErrorUpdate(workInProgress2, errorInfo, _lane);
                  enqueueCapturedUpdate(workInProgress2, _update);
                  return;
                }
                break;
            }
            workInProgress2 = workInProgress2.return;
          } while (workInProgress2 !== null);
        }
        function getSuspendedCache() {
          {
            return null;
          }
        }
        function markUpdate(workInProgress2) {
          workInProgress2.flags |= Update;
        }
        function markRef(workInProgress2) {
          workInProgress2.flags |= Ref;
          {
            workInProgress2.flags |= RefStatic;
          }
        }
        function hadNoMutationsEffects(current2, completedWork) {
          var didBailout = current2 !== null && current2.child === completedWork.child;
          if (didBailout) {
            return true;
          }
          if ((completedWork.flags & ChildDeletion) !== NoFlags) {
            return false;
          }
          var child = completedWork.child;
          while (child !== null) {
            if ((child.flags & MutationMask) !== NoFlags || (child.subtreeFlags & MutationMask) !== NoFlags) {
              return false;
            }
            child = child.sibling;
          }
          return true;
        }
        var appendAllChildren;
        var updateHostContainer;
        var updateHostComponent;
        var updateHostText;
        if (supportsMutation) {
          appendAllChildren = function(parent, workInProgress2, needsVisibilityToggle, isHidden) {
            var node56 = workInProgress2.child;
            while (node56 !== null) {
              if (node56.tag === HostComponent || node56.tag === HostText) {
                appendInitialChild(parent, node56.stateNode);
              } else if (node56.tag === HostPortal)
                ;
              else if (node56.child !== null) {
                node56.child.return = node56;
                node56 = node56.child;
                continue;
              }
              if (node56 === workInProgress2) {
                return;
              }
              while (node56.sibling === null) {
                if (node56.return === null || node56.return === workInProgress2) {
                  return;
                }
                node56 = node56.return;
              }
              node56.sibling.return = node56.return;
              node56 = node56.sibling;
            }
          };
          updateHostContainer = function(current2, workInProgress2) {
          };
          updateHostComponent = 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 = function(current2, workInProgress2, oldText, newText) {
            if (oldText !== newText) {
              markUpdate(workInProgress2);
            }
          };
        } else if (supportsPersistence) {
          appendAllChildren = function(parent, workInProgress2, needsVisibilityToggle, isHidden) {
            var node56 = workInProgress2.child;
            while (node56 !== null) {
              if (node56.tag === HostComponent) {
                var instance = node56.stateNode;
                if (needsVisibilityToggle && isHidden) {
                  var props = node56.memoizedProps;
                  var type = node56.type;
                  instance = cloneHiddenInstance(instance, type, props, node56);
                }
                appendInitialChild(parent, instance);
              } else if (node56.tag === HostText) {
                var _instance = node56.stateNode;
                if (needsVisibilityToggle && isHidden) {
                  var text2 = node56.memoizedProps;
                  _instance = cloneHiddenTextInstance(_instance, text2, node56);
                }
                appendInitialChild(parent, _instance);
              } else if (node56.tag === HostPortal)
                ;
              else if (node56.tag === OffscreenComponent && node56.memoizedState !== null) {
                var child = node56.child;
                if (child !== null) {
                  child.return = node56;
                }
                {
                  appendAllChildren(parent, node56, true, true);
                }
              } else if (node56.child !== null) {
                node56.child.return = node56;
                node56 = node56.child;
                continue;
              }
              node56 = node56;
              if (node56 === workInProgress2) {
                return;
              }
              while (node56.sibling === null) {
                if (node56.return === null || node56.return === workInProgress2) {
                  return;
                }
                node56 = node56.return;
              }
              node56.sibling.return = node56.return;
              node56 = node56.sibling;
            }
          };
          var appendAllChildrenToContainer = function(containerChildSet, workInProgress2, needsVisibilityToggle, isHidden) {
            var node56 = workInProgress2.child;
            while (node56 !== null) {
              if (node56.tag === HostComponent) {
                var instance = node56.stateNode;
                if (needsVisibilityToggle && isHidden) {
                  var props = node56.memoizedProps;
                  var type = node56.type;
                  instance = cloneHiddenInstance(instance, type, props, node56);
                }
                appendChildToContainerChildSet(containerChildSet, instance);
              } else if (node56.tag === HostText) {
                var _instance2 = node56.stateNode;
                if (needsVisibilityToggle && isHidden) {
                  var text2 = node56.memoizedProps;
                  _instance2 = cloneHiddenTextInstance(_instance2, text2, node56);
                }
                appendChildToContainerChildSet(containerChildSet, _instance2);
              } else if (node56.tag === HostPortal)
                ;
              else if (node56.tag === OffscreenComponent && node56.memoizedState !== null) {
                var child = node56.child;
                if (child !== null) {
                  child.return = node56;
                }
                {
                  appendAllChildrenToContainer(containerChildSet, node56, true, true);
                }
              } else if (node56.child !== null) {
                node56.child.return = node56;
                node56 = node56.child;
                continue;
              }
              node56 = node56;
              if (node56 === workInProgress2) {
                return;
              }
              while (node56.sibling === null) {
                if (node56.return === null || node56.return === workInProgress2) {
                  return;
                }
                node56 = node56.return;
              }
              node56.sibling.return = node56.return;
              node56 = node56.sibling;
            }
          };
          updateHostContainer = function(current2, workInProgress2) {
            var portalOrRoot = workInProgress2.stateNode;
            var childrenUnchanged = hadNoMutationsEffects(current2, workInProgress2);
            if (childrenUnchanged)
              ;
            else {
              var container = portalOrRoot.containerInfo;
              var newChildSet = createContainerChildSet(container);
              appendAllChildrenToContainer(newChildSet, workInProgress2, false, false);
              portalOrRoot.pendingChildren = newChildSet;
              markUpdate(workInProgress2);
              finalizeContainerChildren(container, newChildSet);
            }
          };
          updateHostComponent = function(current2, workInProgress2, type, newProps, rootContainerInstance) {
            var currentInstance = current2.stateNode;
            var oldProps = current2.memoizedProps;
            var childrenUnchanged = hadNoMutationsEffects(current2, workInProgress2);
            if (childrenUnchanged && oldProps === newProps) {
              workInProgress2.stateNode = currentInstance;
              return;
            }
            var recyclableInstance = workInProgress2.stateNode;
            var currentHostContext = getHostContext();
            var updatePayload = null;
            if (oldProps !== newProps) {
              updatePayload = prepareUpdate(recyclableInstance, type, oldProps, newProps, rootContainerInstance, currentHostContext);
            }
            if (childrenUnchanged && updatePayload === null) {
              workInProgress2.stateNode = currentInstance;
              return;
            }
            var newInstance = cloneInstance(currentInstance, updatePayload, type, oldProps, newProps, workInProgress2, childrenUnchanged, recyclableInstance);
            if (finalizeInitialChildren(newInstance, type, newProps, rootContainerInstance, currentHostContext)) {
              markUpdate(workInProgress2);
            }
            workInProgress2.stateNode = newInstance;
            if (childrenUnchanged) {
              markUpdate(workInProgress2);
            } else {
              appendAllChildren(newInstance, workInProgress2, false, false);
            }
          };
          updateHostText = function(current2, workInProgress2, oldText, newText) {
            if (oldText !== newText) {
              var rootContainerInstance = getRootHostContainer();
              var currentHostContext = getHostContext();
              workInProgress2.stateNode = createTextInstance(newText, rootContainerInstance, currentHostContext, workInProgress2);
              markUpdate(workInProgress2);
            } else {
              workInProgress2.stateNode = current2.stateNode;
            }
          };
        } else {
          updateHostContainer = function(current2, workInProgress2) {
          };
          updateHostComponent = function(current2, workInProgress2, type, newProps, rootContainerInstance) {
          };
          updateHostText = function(current2, workInProgress2, oldText, newText) {
          };
        }
        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 bubbleProperties(completedWork) {
          var didBailout = completedWork.alternate !== null && completedWork.alternate.child === completedWork.child;
          var newChildLanes = NoLanes;
          var subtreeFlags = NoFlags;
          if (!didBailout) {
            if ((completedWork.mode & ProfileMode) !== NoMode) {
              var actualDuration = completedWork.actualDuration;
              var treeBaseDuration = completedWork.selfBaseDuration;
              var child = completedWork.child;
              while (child !== null) {
                newChildLanes = mergeLanes(newChildLanes, mergeLanes(child.lanes, child.childLanes));
                subtreeFlags |= child.subtreeFlags;
                subtreeFlags |= child.flags;
                actualDuration += child.actualDuration;
                treeBaseDuration += child.treeBaseDuration;
                child = child.sibling;
              }
              completedWork.actualDuration = actualDuration;
              completedWork.treeBaseDuration = treeBaseDuration;
            } else {
              var _child = completedWork.child;
              while (_child !== null) {
                newChildLanes = mergeLanes(newChildLanes, mergeLanes(_child.lanes, _child.childLanes));
                subtreeFlags |= _child.subtreeFlags;
                subtreeFlags |= _child.flags;
                _child.return = completedWork;
                _child = _child.sibling;
              }
            }
            completedWork.subtreeFlags |= subtreeFlags;
          } else {
            if ((completedWork.mode & ProfileMode) !== NoMode) {
              var _treeBaseDuration = completedWork.selfBaseDuration;
              var _child2 = completedWork.child;
              while (_child2 !== null) {
                newChildLanes = mergeLanes(newChildLanes, mergeLanes(_child2.lanes, _child2.childLanes));
                subtreeFlags |= _child2.subtreeFlags & StaticMask;
                subtreeFlags |= _child2.flags & StaticMask;
                _treeBaseDuration += _child2.treeBaseDuration;
                _child2 = _child2.sibling;
              }
              completedWork.treeBaseDuration = _treeBaseDuration;
            } else {
              var _child3 = completedWork.child;
              while (_child3 !== null) {
                newChildLanes = mergeLanes(newChildLanes, mergeLanes(_child3.lanes, _child3.childLanes));
                subtreeFlags |= _child3.subtreeFlags & StaticMask;
                subtreeFlags |= _child3.flags & StaticMask;
                _child3.return = completedWork;
                _child3 = _child3.sibling;
              }
            }
            completedWork.subtreeFlags |= subtreeFlags;
          }
          completedWork.childLanes = newChildLanes;
          return didBailout;
        }
        function completeWork(current2, workInProgress2, renderLanes2) {
          var newProps = workInProgress2.pendingProps;
          popTreeContext(workInProgress2);
          switch (workInProgress2.tag) {
            case IndeterminateComponent:
            case LazyComponent:
            case SimpleMemoComponent:
            case FunctionComponent:
            case ForwardRef:
            case Fragment9:
            case Mode:
            case Profiler:
            case ContextConsumer:
            case MemoComponent:
              bubbleProperties(workInProgress2);
              return null;
            case ClassComponent: {
              var Component8 = workInProgress2.type;
              if (isContextProvider(Component8)) {
                popContext(workInProgress2);
              }
              bubbleProperties(workInProgress2);
              return null;
            }
            case HostRoot: {
              var fiberRoot = workInProgress2.stateNode;
              popHostContainer(workInProgress2);
              popTopLevelContextObject(workInProgress2);
              resetWorkInProgressVersions();
              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 (current2 !== null) {
                    var prevState = current2.memoizedState;
                    if (
                      // Check if this is a client root
                      !prevState.isDehydrated || // Check if we reverted to client rendering (e.g. due to an error)
                      (workInProgress2.flags & ForceClientRender) !== NoFlags
                    ) {
                      workInProgress2.flags |= Snapshot;
                      upgradeHydrationErrorsToRecoverable();
                    }
                  }
                }
              }
              updateHostContainer(current2, workInProgress2);
              bubbleProperties(workInProgress2);
              return null;
            }
            case HostComponent: {
              popHostContext(workInProgress2);
              var rootContainerInstance = getRootHostContainer();
              var type = workInProgress2.type;
              if (current2 !== null && workInProgress2.stateNode != null) {
                updateHostComponent(current2, workInProgress2, type, newProps, rootContainerInstance);
                if (current2.ref !== workInProgress2.ref) {
                  markRef(workInProgress2);
                }
              } else {
                if (!newProps) {
                  if (workInProgress2.stateNode === null) {
                    throw new Error("We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.");
                  }
                  bubbleProperties(workInProgress2);
                  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, currentHostContext)) {
                    markUpdate(workInProgress2);
                  }
                }
                if (workInProgress2.ref !== null) {
                  markRef(workInProgress2);
                }
              }
              bubbleProperties(workInProgress2);
              return null;
            }
            case HostText: {
              var newText = newProps;
              if (current2 && workInProgress2.stateNode != null) {
                var oldText = current2.memoizedProps;
                updateHostText(current2, workInProgress2, oldText, newText);
              } else {
                if (typeof newText !== "string") {
                  if (workInProgress2.stateNode === null) {
                    throw new 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);
                }
              }
              bubbleProperties(workInProgress2);
              return null;
            }
            case SuspenseComponent: {
              popSuspenseContext(workInProgress2);
              var nextState = workInProgress2.memoizedState;
              {
                if (hasUnhydratedTailNodes() && (workInProgress2.mode & ConcurrentMode) !== NoMode && (workInProgress2.flags & DidCapture) === NoFlags) {
                  warnIfUnhydratedTailNodes(workInProgress2);
                  resetHydrationState();
                  workInProgress2.flags |= ForceClientRender | Incomplete | ShouldCapture;
                  return workInProgress2;
                }
                if (nextState !== null && nextState.dehydrated !== null) {
                  var _wasHydrated3 = popHydrationState(workInProgress2);
                  if (current2 === null) {
                    if (!_wasHydrated3) {
                      throw new Error("A dehydrated suspense component was completed without a hydrated node. This is probably a bug in React.");
                    }
                    prepareToHydrateHostSuspenseInstance(workInProgress2);
                    bubbleProperties(workInProgress2);
                    {
                      if ((workInProgress2.mode & ProfileMode) !== NoMode) {
                        var isTimedOutSuspense = nextState !== null;
                        if (isTimedOutSuspense) {
                          var primaryChildFragment = workInProgress2.child;
                          if (primaryChildFragment !== null) {
                            workInProgress2.treeBaseDuration -= primaryChildFragment.treeBaseDuration;
                          }
                        }
                      }
                    }
                    return null;
                  } else {
                    resetHydrationState();
                    if ((workInProgress2.flags & DidCapture) === NoFlags) {
                      workInProgress2.memoizedState = null;
                    }
                    workInProgress2.flags |= Update;
                    bubbleProperties(workInProgress2);
                    {
                      if ((workInProgress2.mode & ProfileMode) !== NoMode) {
                        var _isTimedOutSuspense = nextState !== null;
                        if (_isTimedOutSuspense) {
                          var _primaryChildFragment = workInProgress2.child;
                          if (_primaryChildFragment !== null) {
                            workInProgress2.treeBaseDuration -= _primaryChildFragment.treeBaseDuration;
                          }
                        }
                      }
                    }
                    return null;
                  }
                }
                upgradeHydrationErrorsToRecoverable();
              }
              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) {
                popHydrationState(workInProgress2);
              } else {
                var _prevState = current2.memoizedState;
                prevDidTimeout = _prevState !== null;
              }
              if (nextDidTimeout && !prevDidTimeout) {
                var _offscreenFiber = workInProgress2.child;
                _offscreenFiber.flags |= Visibility2;
                if ((workInProgress2.mode & ConcurrentMode) !== NoMode) {
                  var hasInvisibleChildContext = current2 === null && (workInProgress2.memoizedProps.unstable_avoidThisFallback !== true || !enableSuspenseAvoidThisFallback);
                  if (hasInvisibleChildContext || hasSuspenseContext(suspenseStackCursor.current, InvisibleParentSuspenseContext)) {
                    renderDidSuspend();
                  } else {
                    renderDidSuspendDelayIfPossible();
                  }
                }
              }
              var wakeables = workInProgress2.updateQueue;
              if (wakeables !== null) {
                workInProgress2.flags |= Update;
              }
              bubbleProperties(workInProgress2);
              {
                if ((workInProgress2.mode & ProfileMode) !== NoMode) {
                  if (nextDidTimeout) {
                    var _primaryChildFragment2 = workInProgress2.child;
                    if (_primaryChildFragment2 !== null) {
                      workInProgress2.treeBaseDuration -= _primaryChildFragment2.treeBaseDuration;
                    }
                  }
                }
              }
              return null;
            }
            case HostPortal:
              popHostContainer(workInProgress2);
              updateHostContainer(current2, workInProgress2);
              if (current2 === null) {
                preparePortalMount(workInProgress2.stateNode.containerInfo);
              }
              bubbleProperties(workInProgress2);
              return null;
            case ContextProvider:
              var context2 = workInProgress2.type._context;
              popProvider(context2, workInProgress2);
              bubbleProperties(workInProgress2);
              return null;
            case IncompleteClassComponent: {
              var _Component = workInProgress2.type;
              if (isContextProvider(_Component)) {
                popContext(workInProgress2);
              }
              bubbleProperties(workInProgress2);
              return null;
            }
            case SuspenseListComponent: {
              popSuspenseContext(workInProgress2);
              var renderState = workInProgress2.memoizedState;
              if (renderState === null) {
                bubbleProperties(workInProgress2);
                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 newThenables = suspended.updateQueue;
                        if (newThenables !== null) {
                          workInProgress2.updateQueue = newThenables;
                          workInProgress2.flags |= Update;
                        }
                        workInProgress2.subtreeFlags = NoFlags;
                        resetChildFibers(workInProgress2, renderLanes2);
                        pushSuspenseContext(workInProgress2, setShallowSuspenseContext(suspenseStackCursor.current, ForceSuspenseFallback));
                        return workInProgress2.child;
                      }
                      row = row.sibling;
                    }
                  }
                  if (renderState.tail !== null && now$1() > getRenderTargetTime()) {
                    workInProgress2.flags |= DidCapture;
                    didSuspendAlready = true;
                    cutOffTailIfNeeded(renderState, false);
                    workInProgress2.lanes = SomeRetryLane;
                  }
                } else {
                  cutOffTailIfNeeded(renderState, false);
                }
              } else {
                if (!didSuspendAlready) {
                  var _suspended = findFirstSuspended(renderedTail);
                  if (_suspended !== null) {
                    workInProgress2.flags |= DidCapture;
                    didSuspendAlready = true;
                    var _newThenables = _suspended.updateQueue;
                    if (_newThenables !== null) {
                      workInProgress2.updateQueue = _newThenables;
                      workInProgress2.flags |= Update;
                    }
                    cutOffTailIfNeeded(renderState, true);
                    if (renderState.tail === null && renderState.tailMode === "hidden" && !renderedTail.alternate && !getIsHydrating()) {
                      bubbleProperties(workInProgress2);
                      return null;
                    }
                  } else if (
                    // The time it took to render last row is greater than the remaining
                    // time we have to render. So rendering one more row would likely
                    // exceed it.
                    now$1() * 2 - renderState.renderingStartTime > getRenderTargetTime() && renderLanes2 !== OffscreenLane
                  ) {
                    workInProgress2.flags |= DidCapture;
                    didSuspendAlready = true;
                    cutOffTailIfNeeded(renderState, false);
                    workInProgress2.lanes = 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 next2 = renderState.tail;
                renderState.rendering = next2;
                renderState.tail = next2.sibling;
                renderState.renderingStartTime = now$1();
                next2.sibling = null;
                var suspenseContext = suspenseStackCursor.current;
                if (didSuspendAlready) {
                  suspenseContext = setShallowSuspenseContext(suspenseContext, ForceSuspenseFallback);
                } else {
                  suspenseContext = setDefaultShallowSuspenseContext(suspenseContext);
                }
                pushSuspenseContext(workInProgress2, suspenseContext);
                return next2;
              }
              bubbleProperties(workInProgress2);
              return null;
            }
            case ScopeComponent: {
              break;
            }
            case OffscreenComponent:
            case LegacyHiddenComponent: {
              popRenderLanes(workInProgress2);
              var _nextState = workInProgress2.memoizedState;
              var nextIsHidden = _nextState !== null;
              if (current2 !== null) {
                var _prevState2 = current2.memoizedState;
                var prevIsHidden = _prevState2 !== null;
                if (prevIsHidden !== nextIsHidden && // LegacyHidden doesn't do any hiding — it only pre-renders.
                !enableLegacyHidden) {
                  workInProgress2.flags |= Visibility2;
                }
              }
              if (!nextIsHidden || (workInProgress2.mode & ConcurrentMode) === NoMode) {
                bubbleProperties(workInProgress2);
              } else {
                if (includesSomeLane(subtreeRenderLanes, OffscreenLane)) {
                  bubbleProperties(workInProgress2);
                  if (supportsMutation) {
                    if (workInProgress2.subtreeFlags & (Placement | Update)) {
                      workInProgress2.flags |= Visibility2;
                    }
                  }
                }
              }
              return null;
            }
            case CacheComponent: {
              return null;
            }
            case TracingMarkerComponent: {
              return null;
            }
          }
          throw new Error("Unknown unit of work tag (" + workInProgress2.tag + "). This error is likely caused by a bug in React. Please file an issue.");
        }
        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, Component8, nextProps, renderLanes2) {
          {
            if (workInProgress2.type !== workInProgress2.elementType) {
              var innerPropTypes = Component8.propTypes;
              if (innerPropTypes) {
                checkPropTypes(
                  innerPropTypes,
                  nextProps,
                  // Resolved props
                  "prop",
                  getComponentNameFromType(Component8)
                );
              }
            }
          }
          var render2 = Component8.render;
          var ref = workInProgress2.ref;
          var nextChildren;
          var hasId;
          prepareToReadContext(workInProgress2, renderLanes2);
          {
            markComponentRenderStarted(workInProgress2);
          }
          {
            ReactCurrentOwner$1.current = workInProgress2;
            setIsRendering(true);
            nextChildren = renderWithHooks(current2, workInProgress2, render2, nextProps, ref, renderLanes2);
            hasId = checkDidRenderIdHook();
            if (workInProgress2.mode & StrictLegacyMode) {
              setIsStrictModeForDevtools(true);
              try {
                nextChildren = renderWithHooks(current2, workInProgress2, render2, nextProps, ref, renderLanes2);
                hasId = checkDidRenderIdHook();
              } finally {
                setIsStrictModeForDevtools(false);
              }
            }
            setIsRendering(false);
          }
          {
            markComponentRenderStopped();
          }
          if (current2 !== null && !didReceiveUpdate) {
            bailoutHooks(current2, workInProgress2, renderLanes2);
            return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
          }
          if (getIsHydrating() && hasId) {
            pushMaterializedTreeId(workInProgress2);
          }
          workInProgress2.flags |= PerformedWork;
          reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
          return workInProgress2.child;
        }
        function updateMemoComponent(current2, workInProgress2, Component8, nextProps, renderLanes2) {
          if (current2 === null) {
            var type = Component8.type;
            if (isSimpleFunctionComponent(type) && Component8.compare === null && // SimpleMemoComponent codepath doesn't resolve outer props either.
            Component8.defaultProps === void 0) {
              var resolvedType = type;
              {
                resolvedType = resolveFunctionForHotReloading(type);
              }
              workInProgress2.tag = SimpleMemoComponent;
              workInProgress2.type = resolvedType;
              {
                validateFunctionComponentInDev(workInProgress2, type);
              }
              return updateSimpleMemoComponent(current2, workInProgress2, resolvedType, nextProps, renderLanes2);
            }
            {
              var innerPropTypes = type.propTypes;
              if (innerPropTypes) {
                checkPropTypes(
                  innerPropTypes,
                  nextProps,
                  // Resolved props
                  "prop",
                  getComponentNameFromType(type)
                );
              }
            }
            var child = createFiberFromTypeAndProps(Component8.type, null, nextProps, workInProgress2, workInProgress2.mode, renderLanes2);
            child.ref = workInProgress2.ref;
            child.return = workInProgress2;
            workInProgress2.child = child;
            return child;
          }
          {
            var _type = Component8.type;
            var _innerPropTypes = _type.propTypes;
            if (_innerPropTypes) {
              checkPropTypes(
                _innerPropTypes,
                nextProps,
                // Resolved props
                "prop",
                getComponentNameFromType(_type)
              );
            }
          }
          var currentChild = current2.child;
          var hasScheduledUpdateOrContext = checkScheduledUpdateOrContext(current2, renderLanes2);
          if (!hasScheduledUpdateOrContext) {
            var prevProps = currentChild.memoizedProps;
            var compare2 = Component8.compare;
            compare2 = compare2 !== null ? compare2 : shallowEqual3;
            if (compare2(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, Component8, nextProps, 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 (x2) {
                  outerMemoType = null;
                }
                var outerPropTypes = outerMemoType && outerMemoType.propTypes;
                if (outerPropTypes) {
                  checkPropTypes(
                    outerPropTypes,
                    nextProps,
                    // Resolved (SimpleMemoComponent has no defaultProps)
                    "prop",
                    getComponentNameFromType(outerMemoType)
                  );
                }
              }
            }
          }
          if (current2 !== null) {
            var prevProps = current2.memoizedProps;
            if (shallowEqual3(prevProps, nextProps) && current2.ref === workInProgress2.ref && // Prevent bailout if the implementation changed due to hot reload.
            workInProgress2.type === current2.type) {
              didReceiveUpdate = false;
              if (!checkScheduledUpdateOrContext(current2, renderLanes2)) {
                workInProgress2.lanes = current2.lanes;
                return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
              } else if ((current2.flags & ForceUpdateForLegacySuspense) !== NoFlags) {
                didReceiveUpdate = true;
              }
            }
          }
          return updateFunctionComponent(current2, workInProgress2, Component8, 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" || enableLegacyHidden) {
            if ((workInProgress2.mode & ConcurrentMode) === NoMode) {
              var nextState = {
                baseLanes: NoLanes,
                cachePool: null
              };
              workInProgress2.memoizedState = nextState;
              pushRenderLanes(workInProgress2, renderLanes2);
            } else if (!includesSomeLane(renderLanes2, OffscreenLane)) {
              var spawnedCachePool = null;
              var nextBaseLanes;
              if (prevState !== null) {
                var prevBaseLanes = prevState.baseLanes;
                nextBaseLanes = mergeLanes(prevBaseLanes, renderLanes2);
              } else {
                nextBaseLanes = renderLanes2;
              }
              workInProgress2.lanes = workInProgress2.childLanes = laneToLanes(OffscreenLane);
              var _nextState = {
                baseLanes: nextBaseLanes,
                cachePool: spawnedCachePool
              };
              workInProgress2.memoizedState = _nextState;
              workInProgress2.updateQueue = null;
              pushRenderLanes(workInProgress2, nextBaseLanes);
              return null;
            } else {
              var _nextState2 = {
                baseLanes: NoLanes,
                cachePool: null
              };
              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;
          }
        }
        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$1(current2, workInProgress2) {
          var ref = workInProgress2.ref;
          if (current2 === null && ref !== null || current2 !== null && current2.ref !== ref) {
            workInProgress2.flags |= Ref;
            {
              workInProgress2.flags |= RefStatic;
            }
          }
        }
        function updateFunctionComponent(current2, workInProgress2, Component8, nextProps, renderLanes2) {
          {
            if (workInProgress2.type !== workInProgress2.elementType) {
              var innerPropTypes = Component8.propTypes;
              if (innerPropTypes) {
                checkPropTypes(
                  innerPropTypes,
                  nextProps,
                  // Resolved props
                  "prop",
                  getComponentNameFromType(Component8)
                );
              }
            }
          }
          var context2;
          {
            var unmaskedContext = getUnmaskedContext(workInProgress2, Component8, true);
            context2 = getMaskedContext(workInProgress2, unmaskedContext);
          }
          var nextChildren;
          var hasId;
          prepareToReadContext(workInProgress2, renderLanes2);
          {
            markComponentRenderStarted(workInProgress2);
          }
          {
            ReactCurrentOwner$1.current = workInProgress2;
            setIsRendering(true);
            nextChildren = renderWithHooks(current2, workInProgress2, Component8, nextProps, context2, renderLanes2);
            hasId = checkDidRenderIdHook();
            if (workInProgress2.mode & StrictLegacyMode) {
              setIsStrictModeForDevtools(true);
              try {
                nextChildren = renderWithHooks(current2, workInProgress2, Component8, nextProps, context2, renderLanes2);
                hasId = checkDidRenderIdHook();
              } finally {
                setIsStrictModeForDevtools(false);
              }
            }
            setIsRendering(false);
          }
          {
            markComponentRenderStopped();
          }
          if (current2 !== null && !didReceiveUpdate) {
            bailoutHooks(current2, workInProgress2, renderLanes2);
            return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
          }
          if (getIsHydrating() && hasId) {
            pushMaterializedTreeId(workInProgress2);
          }
          workInProgress2.flags |= PerformedWork;
          reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
          return workInProgress2.child;
        }
        function updateClassComponent(current2, workInProgress2, Component8, nextProps, renderLanes2) {
          {
            switch (shouldError(workInProgress2)) {
              case false: {
                var _instance = workInProgress2.stateNode;
                var ctor = workInProgress2.type;
                var tempInstance = new ctor(workInProgress2.memoizedProps, _instance.context);
                var state = tempInstance.state;
                _instance.updater.enqueueSetState(_instance, state, null);
                break;
              }
              case true: {
                workInProgress2.flags |= DidCapture;
                workInProgress2.flags |= ShouldCapture;
                var error$1 = new Error("Simulated error coming from DevTools");
                var lane = pickArbitraryLane(renderLanes2);
                workInProgress2.lanes = mergeLanes(workInProgress2.lanes, lane);
                var update = createClassErrorUpdate(workInProgress2, createCapturedValue(error$1, workInProgress2), lane);
                enqueueCapturedUpdate(workInProgress2, update);
                break;
              }
            }
            if (workInProgress2.type !== workInProgress2.elementType) {
              var innerPropTypes = Component8.propTypes;
              if (innerPropTypes) {
                checkPropTypes(
                  innerPropTypes,
                  nextProps,
                  // Resolved props
                  "prop",
                  getComponentNameFromType(Component8)
                );
              }
            }
          }
          var hasContext;
          if (isContextProvider(Component8)) {
            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, Component8, nextProps);
            mountClassInstance(workInProgress2, Component8, nextProps, renderLanes2);
            shouldUpdate = true;
          } else if (current2 === null) {
            shouldUpdate = resumeMountClassInstance(workInProgress2, Component8, nextProps, renderLanes2);
          } else {
            shouldUpdate = updateClassInstance(current2, workInProgress2, Component8, nextProps, renderLanes2);
          }
          var nextUnitOfWork = finishClassComponent(current2, workInProgress2, Component8, 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.", getComponentNameFromFiber(workInProgress2) || "a component");
              }
              didWarnAboutReassigningProps = true;
            }
          }
          return nextUnitOfWork;
        }
        function finishClassComponent(current2, workInProgress2, Component8, shouldUpdate, hasContext, renderLanes2) {
          markRef$1(current2, workInProgress2);
          var didCaptureError = (workInProgress2.flags & DidCapture) !== NoFlags;
          if (!shouldUpdate && !didCaptureError) {
            if (hasContext) {
              invalidateContextProvider(workInProgress2, Component8, false);
            }
            return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
          }
          var instance = workInProgress2.stateNode;
          ReactCurrentOwner$1.current = workInProgress2;
          var nextChildren;
          if (didCaptureError && typeof Component8.getDerivedStateFromError !== "function") {
            nextChildren = null;
            {
              stopProfilerTimerIfRunning();
            }
          } else {
            {
              markComponentRenderStarted(workInProgress2);
            }
            {
              setIsRendering(true);
              nextChildren = instance.render();
              if (workInProgress2.mode & StrictLegacyMode) {
                setIsStrictModeForDevtools(true);
                try {
                  instance.render();
                } finally {
                  setIsStrictModeForDevtools(false);
                }
              }
              setIsRendering(false);
            }
            {
              markComponentRenderStopped();
            }
          }
          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, Component8, 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);
          if (current2 === null) {
            throw new Error("Should have a current fiber. This is a bug in React.");
          }
          var nextProps = workInProgress2.pendingProps;
          var prevState = workInProgress2.memoizedState;
          var prevChildren = prevState.element;
          cloneUpdateQueue(current2, workInProgress2);
          processUpdateQueue(workInProgress2, nextProps, null, renderLanes2);
          var nextState = workInProgress2.memoizedState;
          var root2 = workInProgress2.stateNode;
          var nextChildren = nextState.element;
          if (supportsHydration && prevState.isDehydrated) {
            var overrideState = {
              element: nextChildren,
              isDehydrated: false,
              cache: nextState.cache,
              transitions: nextState.transitions
            };
            var updateQueue = workInProgress2.updateQueue;
            updateQueue.baseState = overrideState;
            workInProgress2.memoizedState = overrideState;
            if (workInProgress2.flags & ForceClientRender) {
              var recoverableError = new Error("There was an error while hydrating. Because the error happened outside of a Suspense boundary, the entire root will switch to client rendering.");
              return mountHostRootWithoutHydrating(current2, workInProgress2, nextChildren, renderLanes2, recoverableError);
            } else if (nextChildren !== prevChildren) {
              var _recoverableError = new Error("This root received an early update, before anything was able hydrate. Switched the entire root to client rendering.");
              return mountHostRootWithoutHydrating(current2, workInProgress2, nextChildren, renderLanes2, _recoverableError);
            } else {
              enterHydrationState(workInProgress2);
              var child = mountChildFibers(workInProgress2, null, nextChildren, renderLanes2);
              workInProgress2.child = child;
              var node56 = child;
              while (node56) {
                node56.flags = node56.flags & ~Placement | Hydrating;
                node56 = node56.sibling;
              }
            }
          } else {
            resetHydrationState();
            if (nextChildren === prevChildren) {
              return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
            }
            reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
          }
          return workInProgress2.child;
        }
        function mountHostRootWithoutHydrating(current2, workInProgress2, nextChildren, renderLanes2, recoverableError) {
          resetHydrationState();
          queueHydrationError(recoverableError);
          workInProgress2.flags |= ForceClientRender;
          reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
          return workInProgress2.child;
        }
        function updateHostComponent$1(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$1(current2, workInProgress2);
          reconcileChildren(current2, workInProgress2, nextChildren, renderLanes2);
          return workInProgress2.child;
        }
        function updateHostText$1(current2, workInProgress2) {
          if (current2 === null) {
            tryToClaimNextHydratableInstance(workInProgress2);
          }
          return null;
        }
        function mountLazyComponent(_current, workInProgress2, elementType, 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 Component8 = init(payload);
          workInProgress2.type = Component8;
          var resolvedTag = workInProgress2.tag = resolveLazyComponentTag(Component8);
          var resolvedProps = resolveDefaultProps(Component8, props);
          var child;
          switch (resolvedTag) {
            case FunctionComponent: {
              {
                validateFunctionComponentInDev(workInProgress2, Component8);
                workInProgress2.type = Component8 = resolveFunctionForHotReloading(Component8);
              }
              child = updateFunctionComponent(null, workInProgress2, Component8, resolvedProps, renderLanes2);
              return child;
            }
            case ClassComponent: {
              {
                workInProgress2.type = Component8 = resolveClassForHotReloading(Component8);
              }
              child = updateClassComponent(null, workInProgress2, Component8, resolvedProps, renderLanes2);
              return child;
            }
            case ForwardRef: {
              {
                workInProgress2.type = Component8 = resolveForwardRefForHotReloading(Component8);
              }
              child = updateForwardRef(null, workInProgress2, Component8, resolvedProps, renderLanes2);
              return child;
            }
            case MemoComponent: {
              {
                if (workInProgress2.type !== workInProgress2.elementType) {
                  var outerPropTypes = Component8.propTypes;
                  if (outerPropTypes) {
                    checkPropTypes(
                      outerPropTypes,
                      resolvedProps,
                      // Resolved for outer only
                      "prop",
                      getComponentNameFromType(Component8)
                    );
                  }
                }
              }
              child = updateMemoComponent(
                null,
                workInProgress2,
                Component8,
                resolveDefaultProps(Component8.type, resolvedProps),
                // The inner type can have defaults too
                renderLanes2
              );
              return child;
            }
          }
          var hint = "";
          {
            if (Component8 !== null && typeof Component8 === "object" && Component8.$$typeof === REACT_LAZY_TYPE) {
              hint = " Did you wrap a component in React.lazy() more than once?";
            }
          }
          throw new Error("Element type is invalid. Received a promise that resolves to: " + Component8 + ". " + ("Lazy element type must resolve to a class or function." + hint));
        }
        function mountIncompleteClassComponent(_current, workInProgress2, Component8, nextProps, renderLanes2) {
          if (_current !== null) {
            _current.alternate = null;
            workInProgress2.alternate = null;
            workInProgress2.flags |= Placement;
          }
          workInProgress2.tag = ClassComponent;
          var hasContext;
          if (isContextProvider(Component8)) {
            hasContext = true;
            pushContextProvider(workInProgress2);
          } else {
            hasContext = false;
          }
          prepareToReadContext(workInProgress2, renderLanes2);
          constructClassInstance(workInProgress2, Component8, nextProps);
          mountClassInstance(workInProgress2, Component8, nextProps, renderLanes2);
          return finishClassComponent(null, workInProgress2, Component8, true, hasContext, renderLanes2);
        }
        function mountIndeterminateComponent(_current, workInProgress2, Component8, renderLanes2) {
          if (_current !== null) {
            _current.alternate = null;
            workInProgress2.alternate = null;
            workInProgress2.flags |= Placement;
          }
          var props = workInProgress2.pendingProps;
          var context2;
          {
            var unmaskedContext = getUnmaskedContext(workInProgress2, Component8, false);
            context2 = getMaskedContext(workInProgress2, unmaskedContext);
          }
          prepareToReadContext(workInProgress2, renderLanes2);
          var value;
          var hasId;
          {
            markComponentRenderStarted(workInProgress2);
          }
          {
            if (Component8.prototype && typeof Component8.prototype.render === "function") {
              var componentName = getComponentNameFromType(Component8) || "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 & StrictLegacyMode) {
              ReactStrictModeWarnings.recordLegacyContextWarning(workInProgress2, null);
            }
            setIsRendering(true);
            ReactCurrentOwner$1.current = workInProgress2;
            value = renderWithHooks(null, workInProgress2, Component8, props, context2, renderLanes2);
            hasId = checkDidRenderIdHook();
            setIsRendering(false);
          }
          {
            markComponentRenderStopped();
          }
          workInProgress2.flags |= PerformedWork;
          {
            if (typeof value === "object" && value !== null && typeof value.render === "function" && value.$$typeof === void 0) {
              var _componentName = getComponentNameFromType(Component8) || "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 (
            // Run these checks in production only if the flag is off.
            // Eventually we'll delete this branch altogether.
            typeof value === "object" && value !== null && typeof value.render === "function" && value.$$typeof === void 0
          ) {
            {
              var _componentName2 = getComponentNameFromType(Component8) || "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(Component8)) {
              hasContext = true;
              pushContextProvider(workInProgress2);
            } else {
              hasContext = false;
            }
            workInProgress2.memoizedState = value.state !== null && value.state !== void 0 ? value.state : null;
            initializeUpdateQueue(workInProgress2);
            adoptClassInstance(workInProgress2, value);
            mountClassInstance(workInProgress2, Component8, props, renderLanes2);
            return finishClassComponent(null, workInProgress2, Component8, true, hasContext, renderLanes2);
          } else {
            workInProgress2.tag = FunctionComponent;
            {
              if (workInProgress2.mode & StrictLegacyMode) {
                setIsStrictModeForDevtools(true);
                try {
                  value = renderWithHooks(null, workInProgress2, Component8, props, context2, renderLanes2);
                  hasId = checkDidRenderIdHook();
                } finally {
                  setIsStrictModeForDevtools(false);
                }
              }
            }
            if (getIsHydrating() && hasId) {
              pushMaterializedTreeId(workInProgress2);
            }
            reconcileChildren(null, workInProgress2, value, renderLanes2);
            {
              validateFunctionComponentInDev(workInProgress2, Component8);
            }
            return workInProgress2.child;
          }
        }
        function validateFunctionComponentInDev(workInProgress2, Component8) {
          {
            if (Component8) {
              if (Component8.childContextTypes) {
                error("%s(...): childContextTypes cannot be defined on a function component.", Component8.displayName || Component8.name || "Component");
              }
            }
            if (workInProgress2.ref !== null) {
              var info = "";
              var ownerName = getCurrentFiberOwnerNameInDevOrNull();
              if (ownerName) {
                info += "\n\nCheck the render method of `" + ownerName + "`.";
              }
              var warningKey = ownerName || "";
              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 Component8.getDerivedStateFromProps === "function") {
              var _componentName3 = getComponentNameFromType(Component8) || "Unknown";
              if (!didWarnAboutGetDerivedStateOnFunctionComponent[_componentName3]) {
                error("%s: Function components do not support getDerivedStateFromProps.", _componentName3);
                didWarnAboutGetDerivedStateOnFunctionComponent[_componentName3] = true;
              }
            }
            if (typeof Component8.contextType === "object" && Component8.contextType !== null) {
              var _componentName4 = getComponentNameFromType(Component8) || "Unknown";
              if (!didWarnAboutContextTypeOnFunctionComponent[_componentName4]) {
                error("%s: Function components do not support contextType.", _componentName4);
                didWarnAboutContextTypeOnFunctionComponent[_componentName4] = true;
              }
            }
          }
        }
        var SUSPENDED_MARKER = {
          dehydrated: null,
          treeContext: null,
          retryLane: NoLane
        };
        function mountSuspenseOffscreenState(renderLanes2) {
          return {
            baseLanes: renderLanes2,
            cachePool: getSuspendedCache()
          };
        }
        function updateSuspenseOffscreenState(prevOffscreenState, renderLanes2) {
          var cachePool = null;
          return {
            baseLanes: mergeLanes(prevOffscreenState.baseLanes, renderLanes2),
            cachePool
          };
        }
        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 didSuspend2 = (workInProgress2.flags & DidCapture) !== NoFlags;
          if (didSuspend2 || shouldRemainOnFallback(suspenseContext, current2)) {
            showFallback = true;
            workInProgress2.flags &= ~DidCapture;
          } else {
            if (current2 === null || current2.memoizedState !== null) {
              {
                suspenseContext = addSubtreeSuspenseContext(suspenseContext, InvisibleParentSuspenseContext);
              }
            }
          }
          suspenseContext = setDefaultShallowSuspenseContext(suspenseContext);
          pushSuspenseContext(workInProgress2, suspenseContext);
          if (current2 === null) {
            tryToClaimNextHydratableInstance(workInProgress2);
            {
              var suspenseState = workInProgress2.memoizedState;
              if (suspenseState !== null) {
                var dehydrated = suspenseState.dehydrated;
                if (dehydrated !== null) {
                  return mountDehydratedSuspenseComponent(workInProgress2, dehydrated);
                }
              }
            }
            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 {
              return mountSuspensePrimaryChildren(workInProgress2, nextPrimaryChildren);
            }
          } else {
            var prevState = current2.memoizedState;
            if (prevState !== null) {
              {
                var _dehydrated = prevState.dehydrated;
                if (_dehydrated !== null) {
                  if (!didSuspend2) {
                    return updateDehydratedSuspenseComponent(current2, workInProgress2, _dehydrated, prevState, renderLanes2);
                  } else if (workInProgress2.flags & ForceClientRender) {
                    workInProgress2.flags &= ~ForceClientRender;
                    return retrySuspenseComponentWithoutHydrating(current2, workInProgress2, renderLanes2, new Error("There was an error while hydrating this Suspense boundary. Switched to client rendering."));
                  } else if (workInProgress2.memoizedState !== null) {
                    workInProgress2.child = current2.child;
                    workInProgress2.flags |= DidCapture;
                    return null;
                  } else {
                    var _nextPrimaryChildren = nextProps.children;
                    var _nextFallbackChildren = nextProps.fallback;
                    var fallbackChildFragment = mountSuspenseFallbackAfterRetryWithoutHydrating(current2, workInProgress2, _nextPrimaryChildren, _nextFallbackChildren, renderLanes2);
                    var _primaryChildFragment2 = workInProgress2.child;
                    _primaryChildFragment2.memoizedState = mountSuspenseOffscreenState(renderLanes2);
                    workInProgress2.memoizedState = SUSPENDED_MARKER;
                    return fallbackChildFragment;
                  }
                }
              }
              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 = mountWorkInProgressOffscreenFiber(primaryChildProps, mode);
          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 & ConcurrentMode) === 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 = mountWorkInProgressOffscreenFiber(primaryChildProps, mode);
            fallbackChildFragment = createFiberFromFragment(fallbackChildren, mode, renderLanes2, null);
          }
          primaryChildFragment.return = workInProgress2;
          fallbackChildFragment.return = workInProgress2;
          primaryChildFragment.sibling = fallbackChildFragment;
          workInProgress2.child = primaryChildFragment;
          return fallbackChildFragment;
        }
        function mountWorkInProgressOffscreenFiber(offscreenProps, mode, renderLanes2) {
          return createFiberFromOffscreen(offscreenProps, mode, NoLanes, null);
        }
        function updateWorkInProgressOffscreenFiber(current2, offscreenProps) {
          return createWorkInProgress(current2, offscreenProps);
        }
        function updateSuspensePrimaryChildren(current2, workInProgress2, primaryChildren, renderLanes2) {
          var currentPrimaryChildFragment = current2.child;
          var currentFallbackChildFragment = currentPrimaryChildFragment.sibling;
          var primaryChildFragment = updateWorkInProgressOffscreenFiber(currentPrimaryChildFragment, {
            mode: "visible",
            children: primaryChildren
          });
          if ((workInProgress2.mode & ConcurrentMode) === NoMode) {
            primaryChildFragment.lanes = renderLanes2;
          }
          primaryChildFragment.return = workInProgress2;
          primaryChildFragment.sibling = null;
          if (currentFallbackChildFragment !== null) {
            var deletions = workInProgress2.deletions;
            if (deletions === null) {
              workInProgress2.deletions = [currentFallbackChildFragment];
              workInProgress2.flags |= ChildDeletion;
            } else {
              deletions.push(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 (
            // In legacy mode, we commit the primary tree as if it successfully
            // completed, even though it's in an inconsistent state.
            (mode & ConcurrentMode) === NoMode && // Make sure we're on the second pass, i.e. the primary child fragment was
            // already cloned. In legacy mode, the only case where this isn't true is
            // when DevTools forces us to display a fallback; we skip the first render
            // pass entirely and go straight to rendering the fallback. (In Concurrent
            // Mode, SuspenseList can also trigger this scenario, but this is a legacy-
            // only codepath.)
            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;
            }
            workInProgress2.deletions = null;
          } else {
            primaryChildFragment = updateWorkInProgressOffscreenFiber(currentPrimaryChildFragment, primaryChildProps);
            primaryChildFragment.subtreeFlags = currentPrimaryChildFragment.subtreeFlags & StaticMask;
          }
          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 retrySuspenseComponentWithoutHydrating(current2, workInProgress2, renderLanes2, recoverableError) {
          if (recoverableError !== null) {
            queueHydrationError(recoverableError);
          }
          reconcileChildFibers(workInProgress2, current2.child, null, renderLanes2);
          var nextProps = workInProgress2.pendingProps;
          var primaryChildren = nextProps.children;
          var primaryChildFragment = mountSuspensePrimaryChildren(workInProgress2, primaryChildren);
          primaryChildFragment.flags |= Placement;
          workInProgress2.memoizedState = null;
          return primaryChildFragment;
        }
        function mountSuspenseFallbackAfterRetryWithoutHydrating(current2, workInProgress2, primaryChildren, fallbackChildren, renderLanes2) {
          var fiberMode = workInProgress2.mode;
          var primaryChildProps = {
            mode: "visible",
            children: primaryChildren
          };
          var primaryChildFragment = mountWorkInProgressOffscreenFiber(primaryChildProps, fiberMode);
          var fallbackChildFragment = createFiberFromFragment(fallbackChildren, fiberMode, renderLanes2, null);
          fallbackChildFragment.flags |= Placement;
          primaryChildFragment.return = workInProgress2;
          fallbackChildFragment.return = workInProgress2;
          primaryChildFragment.sibling = fallbackChildFragment;
          workInProgress2.child = primaryChildFragment;
          if ((workInProgress2.mode & ConcurrentMode) !== NoMode) {
            reconcileChildFibers(workInProgress2, current2.child, null, renderLanes2);
          }
          return fallbackChildFragment;
        }
        function mountDehydratedSuspenseComponent(workInProgress2, suspenseInstance, renderLanes2) {
          if ((workInProgress2.mode & ConcurrentMode) === NoMode) {
            {
              error("Cannot hydrate Suspense in legacy mode. Switch from ReactDOM.hydrate(element, container) to ReactDOMClient.hydrateRoot(container, <App />).render(element) or remove the Suspense components from the server rendered components.");
            }
            workInProgress2.lanes = laneToLanes(SyncLane);
          } else if (isSuspenseInstanceFallback(suspenseInstance)) {
            workInProgress2.lanes = laneToLanes(DefaultHydrationLane);
          } else {
            workInProgress2.lanes = laneToLanes(OffscreenLane);
          }
          return null;
        }
        function updateDehydratedSuspenseComponent(current2, workInProgress2, suspenseInstance, suspenseState, renderLanes2) {
          warnIfHydrating();
          if ((workInProgress2.mode & ConcurrentMode) === NoMode) {
            return retrySuspenseComponentWithoutHydrating(
              current2,
              workInProgress2,
              renderLanes2,
              // TODO: When we delete legacy mode, we should make this error argument
              // required — every concurrent mode path that causes hydration to
              // de-opt to client rendering should have an error message.
              null
            );
          }
          if (isSuspenseInstanceFallback(suspenseInstance)) {
            return retrySuspenseComponentWithoutHydrating(
              current2,
              workInProgress2,
              renderLanes2,
              // TODO: The server should serialize the error message so we can log it
              // here on the client. Or, in production, a hash/id that corresponds to
              // the error.
              new Error("The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering.")
            );
          }
          var hasContextChanged2 = includesSomeLane(renderLanes2, current2.childLanes);
          if (didReceiveUpdate || hasContextChanged2) {
            var root2 = getWorkInProgressRoot();
            if (root2 !== null) {
              var attemptHydrationAtLane = getBumpedLaneForHydration(root2, renderLanes2);
              if (attemptHydrationAtLane !== NoLane && attemptHydrationAtLane !== suspenseState.retryLane) {
                suspenseState.retryLane = attemptHydrationAtLane;
                var eventTime = NoTimestamp;
                scheduleUpdateOnFiber(current2, attemptHydrationAtLane, eventTime);
              }
            }
            renderDidSuspendDelayIfPossible();
            return retrySuspenseComponentWithoutHydrating(current2, workInProgress2, renderLanes2, new Error("This Suspense boundary received an update before it finished hydrating. This caused the boundary to switch to client rendering. The usual way to fix this is to wrap the original update in startTransition."));
          } else if (isSuspenseInstancePending(suspenseInstance)) {
            workInProgress2.flags |= DidCapture;
            workInProgress2.child = current2.child;
            var retry = retryDehydratedSuspenseBoundary.bind(null, current2);
            registerSuspenseInstanceRetry(suspenseInstance, retry);
            return null;
          } else {
            reenterHydrationStateFromDehydratedSuspenseInstance(workInProgress2, suspenseInstance, suspenseState.treeContext);
            var nextProps = workInProgress2.pendingProps;
            var primaryChildren = nextProps.children;
            var primaryChildFragment = mountSuspensePrimaryChildren(workInProgress2, primaryChildren);
            primaryChildFragment.flags |= Hydrating;
            return primaryChildFragment;
          }
        }
        function scheduleSuspenseWorkOnFiber(fiber, renderLanes2, propagationRoot) {
          fiber.lanes = mergeLanes(fiber.lanes, renderLanes2);
          var alternate = fiber.alternate;
          if (alternate !== null) {
            alternate.lanes = mergeLanes(alternate.lanes, renderLanes2);
          }
          scheduleContextWorkOnParentPath(fiber.return, renderLanes2, propagationRoot);
        }
        function propagateSuspenseContextChange(workInProgress2, firstChild, renderLanes2) {
          var node56 = firstChild;
          while (node56 !== null) {
            if (node56.tag === SuspenseComponent) {
              var state = node56.memoizedState;
              if (state !== null) {
                scheduleSuspenseWorkOnFiber(node56, renderLanes2, workInProgress2);
              }
            } else if (node56.tag === SuspenseListComponent) {
              scheduleSuspenseWorkOnFiber(node56, renderLanes2, workInProgress2);
            } else if (node56.child !== null) {
              node56.child.return = node56;
              node56 = node56.child;
              continue;
            }
            if (node56 === workInProgress2) {
              return;
            }
            while (node56.sibling === null) {
              if (node56.return === null || node56.return === workInProgress2) {
                return;
              }
              node56 = node56.return;
            }
            node56.sibling.return = node56.return;
            node56 = node56.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 isAnArray = isArray2(childSlot);
            var isIterable = !isAnArray && typeof getIteratorFn(childSlot) === "function";
            if (isAnArray || isIterable) {
              var type = isAnArray ? "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 (isArray2(children)) {
                for (var i2 = 0; i2 < children.length; i2++) {
                  if (!validateSuspenseListNestedChild(children[i2], i2)) {
                    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) {
          var renderState = workInProgress2.memoizedState;
          if (renderState === null) {
            workInProgress2.memoizedState = {
              isBackwards,
              rendering: null,
              renderingStartTime: 0,
              last: lastContentRow,
              tail,
              tailMode
            };
          } else {
            renderState.isBackwards = isBackwards;
            renderState.rendering = null;
            renderState.renderingStartTime = 0;
            renderState.last = lastContentRow;
            renderState.tail = tail;
            renderState.tailMode = tailMode;
          }
        }
        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 & ConcurrentMode) === 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,
                  // isBackwards
                  tail,
                  lastContentRow,
                  tailMode
                );
                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,
                  // isBackwards
                  _tail,
                  null,
                  // last
                  tailMode
                );
                break;
              }
              case "together": {
                initSuspenseListRenderState(
                  workInProgress2,
                  false,
                  // isBackwards
                  null,
                  // tail
                  null,
                  // last
                  void 0
                );
                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 context2 = 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, context2, newValue);
          {
            if (oldProps !== null) {
              var oldValue = oldProps.value;
              if (objectIs(oldValue, newValue)) {
                if (oldProps.children === newProps.children && !hasContextChanged()) {
                  return bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
                }
              } else {
                propagateContextChange(workInProgress2, context2, renderLanes2);
              }
            }
          }
          var newChildren = newProps.children;
          reconcileChildren(current2, workInProgress2, newChildren, renderLanes2);
          return workInProgress2.child;
        }
        var hasWarnedAboutUsingContextAsConsumer = false;
        function updateContextConsumer(current2, workInProgress2, renderLanes2) {
          var context2 = workInProgress2.type;
          {
            if (context2._context === void 0) {
              if (context2 !== context2.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 {
              context2 = context2._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(context2);
          {
            markComponentRenderStarted(workInProgress2);
          }
          var newChildren;
          {
            ReactCurrentOwner$1.current = workInProgress2;
            setIsRendering(true);
            newChildren = render2(newValue);
            setIsRendering(false);
          }
          {
            markComponentRenderStopped();
          }
          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;
            }
          }
          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 deletions = returnFiber.deletions;
            if (deletions === null) {
              returnFiber.deletions = [current2];
              returnFiber.flags |= ChildDeletion;
            } else {
              deletions.push(current2);
            }
            newWorkInProgress.flags |= Placement;
            return newWorkInProgress;
          }
        }
        function checkScheduledUpdateOrContext(current2, renderLanes2) {
          var updateLanes = current2.lanes;
          if (includesSomeLane(updateLanes, renderLanes2)) {
            return true;
          }
          return false;
        }
        function attemptEarlyBailoutIfNoScheduledUpdate(current2, workInProgress2, renderLanes2) {
          switch (workInProgress2.tag) {
            case HostRoot:
              pushHostRootContext(workInProgress2);
              var root2 = workInProgress2.stateNode;
              resetHydrationState();
              break;
            case HostComponent:
              pushHostContext(workInProgress2);
              break;
            case ClassComponent: {
              var Component8 = workInProgress2.type;
              if (isContextProvider(Component8)) {
                pushContextProvider(workInProgress2);
              }
              break;
            }
            case HostPortal:
              pushHostContainer(workInProgress2, workInProgress2.stateNode.containerInfo);
              break;
            case ContextProvider: {
              var newValue = workInProgress2.memoizedProps.value;
              var context2 = workInProgress2.type._context;
              pushProvider(workInProgress2, context2, 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) {
                {
                  if (state.dehydrated !== null) {
                    pushSuspenseContext(workInProgress2, setDefaultShallowSuspenseContext(suspenseStackCursor.current));
                    workInProgress2.flags |= DidCapture;
                    return 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);
        }
        function beginWork(current2, workInProgress2, renderLanes2) {
          {
            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() || // Force a re-render if the implementation changed due to hot reload:
            workInProgress2.type !== current2.type) {
              didReceiveUpdate = true;
            } else {
              var hasScheduledUpdateOrContext = checkScheduledUpdateOrContext(current2, renderLanes2);
              if (!hasScheduledUpdateOrContext && // If this is the second pass of an error or suspense boundary, there
              // may not be work scheduled on `current`, so we check for this flag.
              (workInProgress2.flags & DidCapture) === NoFlags) {
                didReceiveUpdate = false;
                return attemptEarlyBailoutIfNoScheduledUpdate(current2, workInProgress2, renderLanes2);
              }
              if ((current2.flags & ForceUpdateForLegacySuspense) !== NoFlags) {
                didReceiveUpdate = true;
              } else {
                didReceiveUpdate = false;
              }
            }
          } else {
            didReceiveUpdate = false;
            if (getIsHydrating() && isForkedChild(workInProgress2)) {
              var slotIndex = workInProgress2.index;
              var numberOfForks = getForksAtLevel();
              pushTreeId(workInProgress2, numberOfForks, slotIndex);
            }
          }
          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, renderLanes2);
            }
            case FunctionComponent: {
              var Component8 = workInProgress2.type;
              var unresolvedProps = workInProgress2.pendingProps;
              var resolvedProps = workInProgress2.elementType === Component8 ? unresolvedProps : resolveDefaultProps(Component8, unresolvedProps);
              return updateFunctionComponent(current2, workInProgress2, Component8, resolvedProps, renderLanes2);
            }
            case ClassComponent: {
              var _Component = workInProgress2.type;
              var _unresolvedProps = workInProgress2.pendingProps;
              var _resolvedProps = workInProgress2.elementType === _Component ? _unresolvedProps : resolveDefaultProps(_Component, _unresolvedProps);
              return updateClassComponent(current2, workInProgress2, _Component, _resolvedProps, renderLanes2);
            }
            case HostRoot:
              return updateHostRoot(current2, workInProgress2, renderLanes2);
            case HostComponent:
              return updateHostComponent$1(current2, workInProgress2, renderLanes2);
            case HostText:
              return updateHostText$1(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 Fragment9:
              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,
                      // Resolved for outer only
                      "prop",
                      getComponentNameFromType(_type2)
                    );
                  }
                }
              }
              _resolvedProps3 = resolveDefaultProps(_type2.type, _resolvedProps3);
              return updateMemoComponent(current2, workInProgress2, _type2, _resolvedProps3, renderLanes2);
            }
            case SimpleMemoComponent: {
              return updateSimpleMemoComponent(current2, workInProgress2, workInProgress2.type, workInProgress2.pendingProps, renderLanes2);
            }
            case IncompleteClassComponent: {
              var _Component2 = workInProgress2.type;
              var _unresolvedProps4 = workInProgress2.pendingProps;
              var _resolvedProps4 = workInProgress2.elementType === _Component2 ? _unresolvedProps4 : resolveDefaultProps(_Component2, _unresolvedProps4);
              return mountIncompleteClassComponent(current2, workInProgress2, _Component2, _resolvedProps4, renderLanes2);
            }
            case SuspenseListComponent: {
              return updateSuspenseListComponent(current2, workInProgress2, renderLanes2);
            }
            case ScopeComponent: {
              break;
            }
            case OffscreenComponent: {
              return updateOffscreenComponent(current2, workInProgress2, renderLanes2);
            }
          }
          throw new Error("Unknown unit of work tag (" + workInProgress2.tag + "). This error is likely caused by a bug in React. Please file an issue.");
        }
        function unwindWork(current2, workInProgress2, renderLanes2) {
          popTreeContext(workInProgress2);
          switch (workInProgress2.tag) {
            case ClassComponent: {
              var Component8 = workInProgress2.type;
              if (isContextProvider(Component8)) {
                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 & ShouldCapture) !== NoFlags && (_flags & DidCapture) === NoFlags) {
                workInProgress2.flags = _flags & ~ShouldCapture | DidCapture;
                return workInProgress2;
              }
              return null;
            }
            case HostComponent: {
              popHostContext(workInProgress2);
              return null;
            }
            case SuspenseComponent: {
              popSuspenseContext(workInProgress2);
              {
                var suspenseState = workInProgress2.memoizedState;
                if (suspenseState !== null && suspenseState.dehydrated !== null) {
                  if (workInProgress2.alternate === null) {
                    throw new Error("Threw in newly mounted dehydrated component. This is likely a bug in React. Please file an issue.");
                  }
                  resetHydrationState();
                }
              }
              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:
              var context2 = workInProgress2.type._context;
              popProvider(context2, workInProgress2);
              return null;
            case OffscreenComponent:
            case LegacyHiddenComponent:
              popRenderLanes(workInProgress2);
              return null;
            case CacheComponent:
              return null;
            default:
              return null;
          }
        }
        function unwindInterruptedWork(current2, interruptedWork, renderLanes2) {
          popTreeContext(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:
              var context2 = interruptedWork.type._context;
              popProvider(context2, interruptedWork);
              break;
            case OffscreenComponent:
            case LegacyHiddenComponent:
              popRenderLanes(interruptedWork);
              break;
          }
        }
        function invokeGuardedCallbackProd(name2, func, context2, a2, b, c4, d, e3, f) {
          var funcArgs = Array.prototype.slice.call(arguments, 3);
          try {
            func.apply(context2, 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(name2, func, context2, a2, b, c4, d, e3, f) {
              if (typeof document === "undefined" || document === null) {
                throw new 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(context2, 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-" + (name2 ? name2 : "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 reporter = {
          onError: function(error2) {
            hasError = true;
            caughtError = error2;
          }
        };
        function invokeGuardedCallback(name2, func, context2, a2, b, c4, d, e3, f) {
          hasError = false;
          caughtError = null;
          invokeGuardedCallbackImpl$1.apply(reporter, arguments);
        }
        function hasCaughtError() {
          return hasError;
        }
        function clearCaughtError() {
          if (hasError) {
            var error2 = caughtError;
            hasError = false;
            caughtError = null;
            return error2;
          } else {
            throw new Error("clearCaughtError was called but no error was captured. This error is likely caused by a bug in React. Please file an issue.");
          }
        }
        var didWarnAboutUndefinedSnapshotBeforeUpdate = null;
        {
          didWarnAboutUndefinedSnapshotBeforeUpdate = /* @__PURE__ */ new Set();
        }
        var offscreenSubtreeIsHidden = false;
        var offscreenSubtreeWasHidden = false;
        var PossiblyWeakSet = typeof WeakSet === "function" ? WeakSet : Set;
        var nextEffect = null;
        var inProgressLanes = null;
        var inProgressRoot = null;
        function reportUncaughtErrorInDEV(error2) {
          {
            invokeGuardedCallback(null, function() {
              throw error2;
            });
            clearCaughtError();
          }
        }
        var callComponentWillUnmountWithTimer = function(current2, instance) {
          instance.props = current2.memoizedProps;
          instance.state = current2.memoizedState;
          if (current2.mode & ProfileMode) {
            try {
              startLayoutEffectTimer();
              instance.componentWillUnmount();
            } finally {
              recordLayoutEffectDuration(current2);
            }
          } else {
            instance.componentWillUnmount();
          }
        };
        function safelyCallCommitHookLayoutEffectListMount(current2, nearestMountedAncestor) {
          try {
            commitHookEffectListMount(Layout2, current2);
          } catch (error2) {
            reportUncaughtErrorInDEV(error2);
            captureCommitPhaseError(current2, nearestMountedAncestor, error2);
          }
        }
        function safelyCallComponentWillUnmount(current2, nearestMountedAncestor, instance) {
          try {
            callComponentWillUnmountWithTimer(current2, instance);
          } catch (error2) {
            reportUncaughtErrorInDEV(error2);
            captureCommitPhaseError(current2, nearestMountedAncestor, error2);
          }
        }
        function safelyCallComponentDidMount(current2, nearestMountedAncestor, instance) {
          try {
            instance.componentDidMount();
          } catch (error2) {
            reportUncaughtErrorInDEV(error2);
            captureCommitPhaseError(current2, nearestMountedAncestor, error2);
          }
        }
        function safelyAttachRef(current2, nearestMountedAncestor) {
          try {
            commitAttachRef(current2);
          } catch (error2) {
            reportUncaughtErrorInDEV(error2);
            captureCommitPhaseError(current2, nearestMountedAncestor, error2);
          }
        }
        function safelyDetachRef(current2, nearestMountedAncestor) {
          var ref = current2.ref;
          if (ref !== null) {
            if (typeof ref === "function") {
              var retVal;
              try {
                if (enableProfilerTimer && enableProfilerCommitHooks && current2.mode & ProfileMode) {
                  try {
                    startLayoutEffectTimer();
                    retVal = ref(null);
                  } finally {
                    recordLayoutEffectDuration(current2);
                  }
                } else {
                  retVal = ref(null);
                }
              } catch (error2) {
                reportUncaughtErrorInDEV(error2);
                captureCommitPhaseError(current2, nearestMountedAncestor, error2);
              }
              {
                if (typeof retVal === "function") {
                  error("Unexpected return value from a callback ref in %s. A callback ref should not return a function.", getComponentNameFromFiber(current2));
                }
              }
            } else {
              ref.current = null;
            }
          }
        }
        function safelyCallDestroy(current2, nearestMountedAncestor, destroy) {
          try {
            destroy();
          } catch (error2) {
            reportUncaughtErrorInDEV(error2);
            captureCommitPhaseError(current2, nearestMountedAncestor, error2);
          }
        }
        var focusedInstanceHandle = null;
        var shouldFireAfterActiveInstanceBlur = false;
        function commitBeforeMutationEffects(root2, firstChild) {
          focusedInstanceHandle = prepareForCommit(root2.containerInfo);
          nextEffect = firstChild;
          commitBeforeMutationEffects_begin();
          var shouldFire = shouldFireAfterActiveInstanceBlur;
          shouldFireAfterActiveInstanceBlur = false;
          focusedInstanceHandle = null;
          return shouldFire;
        }
        function commitBeforeMutationEffects_begin() {
          while (nextEffect !== null) {
            var fiber = nextEffect;
            var child = fiber.child;
            if ((fiber.subtreeFlags & BeforeMutationMask) !== NoFlags && child !== null) {
              ensureCorrectReturnPointer(child, fiber);
              nextEffect = child;
            } else {
              commitBeforeMutationEffects_complete();
            }
          }
        }
        function commitBeforeMutationEffects_complete() {
          while (nextEffect !== null) {
            var fiber = nextEffect;
            setCurrentFiber(fiber);
            try {
              commitBeforeMutationEffectsOnFiber(fiber);
            } catch (error2) {
              reportUncaughtErrorInDEV(error2);
              captureCommitPhaseError(fiber, fiber.return, error2);
            }
            resetCurrentFiber();
            var sibling = fiber.sibling;
            if (sibling !== null) {
              ensureCorrectReturnPointer(sibling, fiber.return);
              nextEffect = sibling;
              return;
            }
            nextEffect = fiber.return;
          }
        }
        function commitBeforeMutationEffectsOnFiber(finishedWork) {
          var current2 = finishedWork.alternate;
          var flags = finishedWork.flags;
          if ((flags & Snapshot) !== NoFlags) {
            setCurrentFiber(finishedWork);
            switch (finishedWork.tag) {
              case FunctionComponent:
              case ForwardRef:
              case SimpleMemoComponent: {
                break;
              }
              case ClassComponent: {
                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.", getComponentNameFromFiber(finishedWork) || "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.", getComponentNameFromFiber(finishedWork) || "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.", getComponentNameFromFiber(finishedWork));
                    }
                  }
                  instance.__reactInternalSnapshotBeforeUpdate = snapshot;
                }
                break;
              }
              case HostRoot: {
                if (supportsMutation) {
                  var root2 = finishedWork.stateNode;
                  clearContainer(root2.containerInfo);
                }
                break;
              }
              case HostComponent:
              case HostText:
              case HostPortal:
              case IncompleteClassComponent:
                break;
              default: {
                throw new 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.");
              }
            }
            resetCurrentFiber();
          }
        }
        function commitHookEffectListUnmount(flags, finishedWork, nearestMountedAncestor) {
          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 & flags) === flags) {
                var destroy = effect.destroy;
                effect.destroy = void 0;
                if (destroy !== void 0) {
                  {
                    if ((flags & Passive$1) !== NoFlags$1) {
                      markComponentPassiveEffectUnmountStarted(finishedWork);
                    } else if ((flags & Layout2) !== NoFlags$1) {
                      markComponentLayoutEffectUnmountStarted(finishedWork);
                    }
                  }
                  safelyCallDestroy(finishedWork, nearestMountedAncestor, destroy);
                  {
                    if ((flags & Passive$1) !== NoFlags$1) {
                      markComponentPassiveEffectUnmountStopped();
                    } else if ((flags & Layout2) !== NoFlags$1) {
                      markComponentLayoutEffectUnmountStopped();
                    }
                  }
                }
              }
              effect = effect.next;
            } while (effect !== firstEffect);
          }
        }
        function commitHookEffectListMount(flags, 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 & flags) === flags) {
                {
                  if ((flags & Passive$1) !== NoFlags$1) {
                    markComponentPassiveEffectMountStarted(finishedWork);
                  } else if ((flags & Layout2) !== NoFlags$1) {
                    markComponentLayoutEffectMountStarted(finishedWork);
                  }
                }
                var create4 = effect.create;
                effect.destroy = create4();
                {
                  if ((flags & Passive$1) !== NoFlags$1) {
                    markComponentPassiveEffectMountStopped();
                  } else if ((flags & Layout2) !== NoFlags$1) {
                    markComponentLayoutEffectMountStopped();
                  }
                }
                {
                  var destroy = effect.destroy;
                  if (destroy !== void 0 && typeof destroy !== "function") {
                    var hookName = void 0;
                    if ((effect.tag & Layout2) !== NoFlags) {
                      hookName = "useLayoutEffect";
                    } else if ((effect.tag & Insertion5) !== NoFlags) {
                      hookName = "useInsertionEffect";
                    } else {
                      hookName = "useEffect";
                    }
                    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 " + hookName + "(async () => ...) or returned a Promise. Instead, write the async function inside your effect and call it immediately:\n\n" + hookName + "(() => {\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("%s must not return anything besides a function, which is used for clean-up.%s", hookName, addendum);
                  }
                }
              }
              effect = effect.next;
            } while (effect !== firstEffect);
          }
        }
        function commitPassiveEffectDurations(finishedRoot, finishedWork) {
          {
            if ((finishedWork.flags & Update) !== NoFlags) {
              switch (finishedWork.tag) {
                case Profiler: {
                  var passiveEffectDuration = finishedWork.stateNode.passiveEffectDuration;
                  var _finishedWork$memoize = finishedWork.memoizedProps, id2 = _finishedWork$memoize.id, onPostCommit = _finishedWork$memoize.onPostCommit;
                  var commitTime2 = getCommitTime();
                  var phase = finishedWork.alternate === null ? "mount" : "update";
                  {
                    if (isCurrentUpdateNested()) {
                      phase = "nested-update";
                    }
                  }
                  if (typeof onPostCommit === "function") {
                    onPostCommit(id2, phase, passiveEffectDuration, commitTime2);
                  }
                  var parentFiber = finishedWork.return;
                  outer:
                    while (parentFiber !== null) {
                      switch (parentFiber.tag) {
                        case HostRoot:
                          var root2 = parentFiber.stateNode;
                          root2.passiveEffectDuration += passiveEffectDuration;
                          break outer;
                        case Profiler:
                          var parentStateNode = parentFiber.stateNode;
                          parentStateNode.passiveEffectDuration += passiveEffectDuration;
                          break outer;
                      }
                      parentFiber = parentFiber.return;
                    }
                  break;
                }
              }
            }
          }
        }
        function commitLayoutEffectOnFiber(finishedRoot, current2, finishedWork, committedLanes) {
          if ((finishedWork.flags & LayoutMask) !== NoFlags) {
            switch (finishedWork.tag) {
              case FunctionComponent:
              case ForwardRef:
              case SimpleMemoComponent: {
                if (!offscreenSubtreeWasHidden) {
                  if (finishedWork.mode & ProfileMode) {
                    try {
                      startLayoutEffectTimer();
                      commitHookEffectListMount(Layout2 | HasEffect, finishedWork);
                    } finally {
                      recordLayoutEffectDuration(finishedWork);
                    }
                  } else {
                    commitHookEffectListMount(Layout2 | HasEffect, finishedWork);
                  }
                }
                break;
              }
              case ClassComponent: {
                var instance = finishedWork.stateNode;
                if (finishedWork.flags & Update) {
                  if (!offscreenSubtreeWasHidden) {
                    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.", getComponentNameFromFiber(finishedWork) || "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.", getComponentNameFromFiber(finishedWork) || "instance");
                          }
                        }
                      }
                      if (finishedWork.mode & ProfileMode) {
                        try {
                          startLayoutEffectTimer();
                          instance.componentDidMount();
                        } finally {
                          recordLayoutEffectDuration(finishedWork);
                        }
                      } else {
                        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.", getComponentNameFromFiber(finishedWork) || "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.", getComponentNameFromFiber(finishedWork) || "instance");
                          }
                        }
                      }
                      if (finishedWork.mode & ProfileMode) {
                        try {
                          startLayoutEffectTimer();
                          instance.componentDidUpdate(prevProps, prevState, instance.__reactInternalSnapshotBeforeUpdate);
                        } finally {
                          recordLayoutEffectDuration(finishedWork);
                        }
                      } else {
                        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.", getComponentNameFromFiber(finishedWork) || "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.", getComponentNameFromFiber(finishedWork) || "instance");
                      }
                    }
                  }
                  commitUpdateQueue(finishedWork, updateQueue, instance);
                }
                break;
              }
              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);
                }
                break;
              }
              case HostComponent: {
                var _instance2 = finishedWork.stateNode;
                if (current2 === null && finishedWork.flags & Update) {
                  var type = finishedWork.type;
                  var props = finishedWork.memoizedProps;
                  commitMount(_instance2, type, props, finishedWork);
                }
                break;
              }
              case HostText: {
                break;
              }
              case HostPortal: {
                break;
              }
              case Profiler: {
                {
                  var _finishedWork$memoize2 = finishedWork.memoizedProps, onCommit = _finishedWork$memoize2.onCommit, onRender = _finishedWork$memoize2.onRender;
                  var effectDuration = finishedWork.stateNode.effectDuration;
                  var commitTime2 = getCommitTime();
                  var phase = current2 === null ? "mount" : "update";
                  {
                    if (isCurrentUpdateNested()) {
                      phase = "nested-update";
                    }
                  }
                  if (typeof onRender === "function") {
                    onRender(finishedWork.memoizedProps.id, phase, finishedWork.actualDuration, finishedWork.treeBaseDuration, finishedWork.actualStartTime, commitTime2);
                  }
                  {
                    if (typeof onCommit === "function") {
                      onCommit(finishedWork.memoizedProps.id, phase, effectDuration, commitTime2);
                    }
                    enqueuePendingPassiveProfilerEffect(finishedWork);
                    var parentFiber = finishedWork.return;
                    outer:
                      while (parentFiber !== null) {
                        switch (parentFiber.tag) {
                          case HostRoot:
                            var root2 = parentFiber.stateNode;
                            root2.effectDuration += effectDuration;
                            break outer;
                          case Profiler:
                            var parentStateNode = parentFiber.stateNode;
                            parentStateNode.effectDuration += effectDuration;
                            break outer;
                        }
                        parentFiber = parentFiber.return;
                      }
                  }
                }
                break;
              }
              case SuspenseComponent: {
                commitSuspenseHydrationCallbacks(finishedRoot, finishedWork);
                break;
              }
              case SuspenseListComponent:
              case IncompleteClassComponent:
              case ScopeComponent:
              case OffscreenComponent:
              case LegacyHiddenComponent: {
                break;
              }
              default:
                throw new 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.");
            }
          }
          if (!offscreenSubtreeWasHidden) {
            {
              if (finishedWork.flags & Ref) {
                commitAttachRef(finishedWork);
              }
            }
          }
        }
        function reappearLayoutEffectsOnFiber(node56) {
          switch (node56.tag) {
            case FunctionComponent:
            case ForwardRef:
            case SimpleMemoComponent: {
              if (node56.mode & ProfileMode) {
                try {
                  startLayoutEffectTimer();
                  safelyCallCommitHookLayoutEffectListMount(node56, node56.return);
                } finally {
                  recordLayoutEffectDuration(node56);
                }
              } else {
                safelyCallCommitHookLayoutEffectListMount(node56, node56.return);
              }
              break;
            }
            case ClassComponent: {
              var instance = node56.stateNode;
              if (typeof instance.componentDidMount === "function") {
                safelyCallComponentDidMount(node56, node56.return, instance);
              }
              safelyAttachRef(node56, node56.return);
              break;
            }
            case HostComponent: {
              safelyAttachRef(node56, node56.return);
              break;
            }
          }
        }
        function hideOrUnhideAllChildren(finishedWork, isHidden) {
          var hostSubtreeRoot = null;
          if (supportsMutation) {
            var node56 = finishedWork;
            while (true) {
              if (node56.tag === HostComponent) {
                if (hostSubtreeRoot === null) {
                  hostSubtreeRoot = node56;
                  var instance = node56.stateNode;
                  if (isHidden) {
                    hideInstance(instance);
                  } else {
                    unhideInstance(node56.stateNode, node56.memoizedProps);
                  }
                }
              } else if (node56.tag === HostText) {
                if (hostSubtreeRoot === null) {
                  var _instance3 = node56.stateNode;
                  if (isHidden) {
                    hideTextInstance(_instance3);
                  } else {
                    unhideTextInstance(_instance3, node56.memoizedProps);
                  }
                }
              } else if ((node56.tag === OffscreenComponent || node56.tag === LegacyHiddenComponent) && node56.memoizedState !== null && node56 !== finishedWork)
                ;
              else if (node56.child !== null) {
                node56.child.return = node56;
                node56 = node56.child;
                continue;
              }
              if (node56 === finishedWork) {
                return;
              }
              while (node56.sibling === null) {
                if (node56.return === null || node56.return === finishedWork) {
                  return;
                }
                if (hostSubtreeRoot === node56) {
                  hostSubtreeRoot = null;
                }
                node56 = node56.return;
              }
              if (hostSubtreeRoot === node56) {
                hostSubtreeRoot = null;
              }
              node56.sibling.return = node56.return;
              node56 = node56.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") {
              var retVal;
              if (finishedWork.mode & ProfileMode) {
                try {
                  startLayoutEffectTimer();
                  retVal = ref(instanceToUse);
                } finally {
                  recordLayoutEffectDuration(finishedWork);
                }
              } else {
                retVal = ref(instanceToUse);
              }
              {
                if (typeof retVal === "function") {
                  error("Unexpected return value from a callback ref in %s. A callback ref should not return a function.", getComponentNameFromFiber(finishedWork));
                }
              }
            } else {
              {
                if (!ref.hasOwnProperty("current")) {
                  error("Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().", getComponentNameFromFiber(finishedWork));
                }
              }
              ref.current = instanceToUse;
            }
          }
        }
        function commitDetachRef(current2) {
          var currentRef = current2.ref;
          if (currentRef !== null) {
            if (typeof currentRef === "function") {
              if (current2.mode & ProfileMode) {
                try {
                  startLayoutEffectTimer();
                  currentRef(null);
                } finally {
                  recordLayoutEffectDuration(current2);
                }
              } else {
                currentRef(null);
              }
            } else {
              currentRef.current = null;
            }
          }
        }
        function commitUnmount(finishedRoot, current2, nearestMountedAncestor) {
          onCommitUnmount(current2);
          switch (current2.tag) {
            case FunctionComponent:
            case ForwardRef:
            case MemoComponent:
            case SimpleMemoComponent: {
              var updateQueue = current2.updateQueue;
              if (updateQueue !== null) {
                var lastEffect = updateQueue.lastEffect;
                if (lastEffect !== null) {
                  var firstEffect = lastEffect.next;
                  var effect = firstEffect;
                  do {
                    var _effect = effect, destroy = _effect.destroy, tag = _effect.tag;
                    if (destroy !== void 0) {
                      if ((tag & Insertion5) !== NoFlags$1) {
                        safelyCallDestroy(current2, nearestMountedAncestor, destroy);
                      } else if ((tag & Layout2) !== NoFlags$1) {
                        {
                          markComponentLayoutEffectUnmountStarted(current2);
                        }
                        if (current2.mode & ProfileMode) {
                          startLayoutEffectTimer();
                          safelyCallDestroy(current2, nearestMountedAncestor, destroy);
                          recordLayoutEffectDuration(current2);
                        } else {
                          safelyCallDestroy(current2, nearestMountedAncestor, destroy);
                        }
                        {
                          markComponentLayoutEffectUnmountStopped();
                        }
                      }
                    }
                    effect = effect.next;
                  } while (effect !== firstEffect);
                }
              }
              return;
            }
            case ClassComponent: {
              safelyDetachRef(current2, nearestMountedAncestor);
              var instance = current2.stateNode;
              if (typeof instance.componentWillUnmount === "function") {
                safelyCallComponentWillUnmount(current2, nearestMountedAncestor, instance);
              }
              return;
            }
            case HostComponent: {
              safelyDetachRef(current2, nearestMountedAncestor);
              return;
            }
            case HostPortal: {
              if (supportsMutation) {
                unmountHostComponents(finishedRoot, current2, nearestMountedAncestor);
              } else if (supportsPersistence) {
                emptyPortalContainer(current2);
              }
              return;
            }
            case DehydratedFragment: {
              return;
            }
            case ScopeComponent: {
              return;
            }
          }
        }
        function commitNestedUnmounts(finishedRoot, root2, nearestMountedAncestor) {
          var node56 = root2;
          while (true) {
            commitUnmount(finishedRoot, node56, nearestMountedAncestor);
            if (node56.child !== null && // If we use mutation we drill down into portals using commitUnmount above.
            // If we don't use mutation we drill down into portals here instead.
            (!supportsMutation || node56.tag !== HostPortal)) {
              node56.child.return = node56;
              node56 = node56.child;
              continue;
            }
            if (node56 === root2) {
              return;
            }
            while (node56.sibling === null) {
              if (node56.return === null || node56.return === root2) {
                return;
              }
              node56 = node56.return;
            }
            node56.sibling.return = node56.return;
            node56 = node56.sibling;
          }
        }
        function detachFiberMutation(fiber) {
          var alternate = fiber.alternate;
          if (alternate !== null) {
            alternate.return = null;
          }
          fiber.return = null;
        }
        function detachFiberAfterEffects(fiber) {
          var alternate = fiber.alternate;
          if (alternate !== null) {
            fiber.alternate = null;
            detachFiberAfterEffects(alternate);
          }
          {
            fiber.child = null;
            fiber.deletions = null;
            fiber.sibling = null;
            if (fiber.tag === HostComponent) {
              var hostInstance = fiber.stateNode;
              if (hostInstance !== null) {
                detachDeletedInstance(hostInstance);
              }
            }
            fiber.stateNode = null;
            {
              fiber._debugOwner = null;
            }
            {
              fiber.return = null;
              fiber.dependencies = null;
              fiber.memoizedProps = null;
              fiber.memoizedState = null;
              fiber.pendingProps = null;
              fiber.stateNode = null;
              fiber.updateQueue = null;
            }
          }
        }
        function emptyPortalContainer(current2) {
          if (!supportsPersistence) {
            return;
          }
          var portal = current2.stateNode;
          var containerInfo = portal.containerInfo;
          var emptyChildSet = createContainerChildSet(containerInfo);
          replaceContainerChildren(containerInfo, emptyChildSet);
        }
        function commitContainer(finishedWork) {
          if (!supportsPersistence) {
            return;
          }
          switch (finishedWork.tag) {
            case ClassComponent:
            case HostComponent:
            case HostText: {
              return;
            }
            case HostRoot:
            case HostPortal: {
              var portalOrRoot = finishedWork.stateNode;
              var containerInfo = portalOrRoot.containerInfo, pendingChildren = portalOrRoot.pendingChildren;
              replaceContainerChildren(containerInfo, pendingChildren);
              return;
            }
          }
          throw new 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 getHostParentFiber(fiber) {
          var parent = fiber.return;
          while (parent !== null) {
            if (isHostParent(parent)) {
              return parent;
            }
            parent = parent.return;
          }
          throw new 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 node56 = fiber;
          siblings:
            while (true) {
              while (node56.sibling === null) {
                if (node56.return === null || isHostParent(node56.return)) {
                  return null;
                }
                node56 = node56.return;
              }
              node56.sibling.return = node56.return;
              node56 = node56.sibling;
              while (node56.tag !== HostComponent && node56.tag !== HostText && node56.tag !== DehydratedFragment) {
                if (node56.flags & Placement) {
                  continue siblings;
                }
                if (node56.child === null || node56.tag === HostPortal) {
                  continue siblings;
                } else {
                  node56.child.return = node56;
                  node56 = node56.child;
                }
              }
              if (!(node56.flags & Placement)) {
                return node56.stateNode;
              }
            }
        }
        function commitPlacement(finishedWork) {
          if (!supportsMutation) {
            return;
          }
          var parentFiber = getHostParentFiber(finishedWork);
          switch (parentFiber.tag) {
            case HostComponent: {
              var parent = parentFiber.stateNode;
              if (parentFiber.flags & ContentReset) {
                resetTextContent(parent);
                parentFiber.flags &= ~ContentReset;
              }
              var before = getHostSibling(finishedWork);
              insertOrAppendPlacementNode(finishedWork, before, parent);
              break;
            }
            case HostRoot:
            case HostPortal: {
              var _parent = parentFiber.stateNode.containerInfo;
              var _before = getHostSibling(finishedWork);
              insertOrAppendPlacementNodeIntoContainer(finishedWork, _before, _parent);
              break;
            }
            default:
              throw new Error("Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue.");
          }
        }
        function insertOrAppendPlacementNodeIntoContainer(node56, before, parent) {
          var tag = node56.tag;
          var isHost = tag === HostComponent || tag === HostText;
          if (isHost) {
            var stateNode = node56.stateNode;
            if (before) {
              insertInContainerBefore(parent, stateNode, before);
            } else {
              appendChildToContainer(parent, stateNode);
            }
          } else if (tag === HostPortal)
            ;
          else {
            var child = node56.child;
            if (child !== null) {
              insertOrAppendPlacementNodeIntoContainer(child, before, parent);
              var sibling = child.sibling;
              while (sibling !== null) {
                insertOrAppendPlacementNodeIntoContainer(sibling, before, parent);
                sibling = sibling.sibling;
              }
            }
          }
        }
        function insertOrAppendPlacementNode(node56, before, parent) {
          var tag = node56.tag;
          var isHost = tag === HostComponent || tag === HostText;
          if (isHost) {
            var stateNode = node56.stateNode;
            if (before) {
              insertBefore(parent, stateNode, before);
            } else {
              appendChild(parent, stateNode);
            }
          } else if (tag === HostPortal)
            ;
          else {
            var child = node56.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, nearestMountedAncestor) {
          var node56 = current2;
          var currentParentIsValid = false;
          var currentParent;
          var currentParentIsContainer;
          while (true) {
            if (!currentParentIsValid) {
              var parent = node56.return;
              findParent:
                while (true) {
                  if (parent === null) {
                    throw new 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 (node56.tag === HostComponent || node56.tag === HostText) {
              commitNestedUnmounts(finishedRoot, node56, nearestMountedAncestor);
              if (currentParentIsContainer) {
                removeChildFromContainer(currentParent, node56.stateNode);
              } else {
                removeChild(currentParent, node56.stateNode);
              }
            } else if (node56.tag === DehydratedFragment) {
              if (currentParentIsContainer) {
                clearSuspenseBoundaryFromContainer(currentParent, node56.stateNode);
              } else {
                clearSuspenseBoundary(currentParent, node56.stateNode);
              }
            } else if (node56.tag === HostPortal) {
              if (node56.child !== null) {
                currentParent = node56.stateNode.containerInfo;
                currentParentIsContainer = true;
                node56.child.return = node56;
                node56 = node56.child;
                continue;
              }
            } else {
              commitUnmount(finishedRoot, node56, nearestMountedAncestor);
              if (node56.child !== null) {
                node56.child.return = node56;
                node56 = node56.child;
                continue;
              }
            }
            if (node56 === current2) {
              return;
            }
            while (node56.sibling === null) {
              if (node56.return === null || node56.return === current2) {
                return;
              }
              node56 = node56.return;
              if (node56.tag === HostPortal) {
                currentParentIsValid = false;
              }
            }
            node56.sibling.return = node56.return;
            node56 = node56.sibling;
          }
        }
        function commitDeletion(finishedRoot, current2, nearestMountedAncestor) {
          if (supportsMutation) {
            unmountHostComponents(finishedRoot, current2, nearestMountedAncestor);
          } else {
            commitNestedUnmounts(finishedRoot, current2, nearestMountedAncestor);
          }
          detachFiberMutation(current2);
        }
        function commitWork(current2, finishedWork) {
          if (!supportsMutation) {
            switch (finishedWork.tag) {
              case FunctionComponent:
              case ForwardRef:
              case MemoComponent:
              case SimpleMemoComponent: {
                commitHookEffectListUnmount(Insertion5 | HasEffect, finishedWork, finishedWork.return);
                commitHookEffectListMount(Insertion5 | HasEffect, finishedWork);
                if (finishedWork.mode & ProfileMode) {
                  try {
                    startLayoutEffectTimer();
                    commitHookEffectListUnmount(Layout2 | HasEffect, finishedWork, finishedWork.return);
                  } finally {
                    recordLayoutEffectDuration(finishedWork);
                  }
                } else {
                  commitHookEffectListUnmount(Layout2 | HasEffect, finishedWork, finishedWork.return);
                }
                return;
              }
              case Profiler: {
                return;
              }
              case SuspenseComponent: {
                commitSuspenseCallback(finishedWork);
                attachSuspenseRetryListeners(finishedWork);
                return;
              }
              case SuspenseListComponent: {
                attachSuspenseRetryListeners(finishedWork);
                return;
              }
              case HostRoot: {
                if (supportsHydration) {
                  if (current2 !== null) {
                    var prevRootState = current2.memoizedState;
                    if (prevRootState.isDehydrated) {
                      var root2 = finishedWork.stateNode;
                      commitHydratedContainer(root2.containerInfo);
                    }
                  }
                }
                break;
              }
              case OffscreenComponent:
              case LegacyHiddenComponent: {
                return;
              }
            }
            commitContainer(finishedWork);
            return;
          }
          switch (finishedWork.tag) {
            case FunctionComponent:
            case ForwardRef:
            case MemoComponent:
            case SimpleMemoComponent: {
              commitHookEffectListUnmount(Insertion5 | HasEffect, finishedWork, finishedWork.return);
              commitHookEffectListMount(Insertion5 | HasEffect, finishedWork);
              if (finishedWork.mode & ProfileMode) {
                try {
                  startLayoutEffectTimer();
                  commitHookEffectListUnmount(Layout2 | HasEffect, finishedWork, finishedWork.return);
                } finally {
                  recordLayoutEffectDuration(finishedWork);
                }
              } else {
                commitHookEffectListUnmount(Layout2 | HasEffect, finishedWork, finishedWork.return);
              }
              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, finishedWork);
                }
              }
              return;
            }
            case HostText: {
              if (finishedWork.stateNode === null) {
                throw new 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: {
              if (supportsHydration) {
                if (current2 !== null) {
                  var _prevRootState = current2.memoizedState;
                  if (_prevRootState.isDehydrated) {
                    var _root = finishedWork.stateNode;
                    commitHydratedContainer(_root.containerInfo);
                  }
                }
              }
              return;
            }
            case Profiler: {
              return;
            }
            case SuspenseComponent: {
              commitSuspenseCallback(finishedWork);
              attachSuspenseRetryListeners(finishedWork);
              return;
            }
            case SuspenseListComponent: {
              attachSuspenseRetryListeners(finishedWork);
              return;
            }
            case IncompleteClassComponent: {
              return;
            }
          }
          throw new 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 commitSuspenseCallback(finishedWork) {
          var newState = finishedWork.memoizedState;
        }
        function commitSuspenseHydrationCallbacks(finishedRoot, finishedWork) {
          if (!supportsHydration) {
            return;
          }
          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)) {
                retryCache.add(wakeable);
                {
                  if (isDevToolsPresent) {
                    if (inProgressLanes !== null && inProgressRoot !== null) {
                      restorePendingUpdaters(inProgressRoot, inProgressLanes);
                    } else {
                      throw Error("Expected finished root and lanes to be set. This is a bug in React.");
                    }
                  }
                }
                wakeable.then(retry, retry);
              }
            });
          }
        }
        function commitResetTextContent(current2) {
          if (!supportsMutation) {
            return;
          }
          resetTextContent(current2.stateNode);
        }
        function commitMutationEffects(root2, firstChild, committedLanes) {
          inProgressLanes = committedLanes;
          inProgressRoot = root2;
          nextEffect = firstChild;
          commitMutationEffects_begin(root2, committedLanes);
          inProgressLanes = null;
          inProgressRoot = null;
        }
        function commitMutationEffects_begin(root2, lanes) {
          while (nextEffect !== null) {
            var fiber = nextEffect;
            var deletions = fiber.deletions;
            if (deletions !== null) {
              for (var i2 = 0; i2 < deletions.length; i2++) {
                var childToDelete = deletions[i2];
                try {
                  commitDeletion(root2, childToDelete, fiber);
                } catch (error2) {
                  reportUncaughtErrorInDEV(error2);
                  captureCommitPhaseError(childToDelete, fiber, error2);
                }
              }
            }
            var child = fiber.child;
            if ((fiber.subtreeFlags & MutationMask) !== NoFlags && child !== null) {
              ensureCorrectReturnPointer(child, fiber);
              nextEffect = child;
            } else {
              commitMutationEffects_complete(root2, lanes);
            }
          }
        }
        function commitMutationEffects_complete(root2, lanes) {
          while (nextEffect !== null) {
            var fiber = nextEffect;
            setCurrentFiber(fiber);
            try {
              commitMutationEffectsOnFiber(fiber, root2, lanes);
            } catch (error2) {
              reportUncaughtErrorInDEV(error2);
              captureCommitPhaseError(fiber, fiber.return, error2);
            }
            resetCurrentFiber();
            var sibling = fiber.sibling;
            if (sibling !== null) {
              ensureCorrectReturnPointer(sibling, fiber.return);
              nextEffect = sibling;
              return;
            }
            nextEffect = fiber.return;
          }
        }
        function commitMutationEffectsOnFiber(finishedWork, root2, lanes) {
          var flags = finishedWork.flags;
          if (flags & ContentReset) {
            commitResetTextContent(finishedWork);
          }
          if (flags & Ref) {
            var current2 = finishedWork.alternate;
            if (current2 !== null) {
              commitDetachRef(current2);
            }
          }
          if (flags & Visibility2) {
            switch (finishedWork.tag) {
              case SuspenseComponent: {
                var newState = finishedWork.memoizedState;
                var isHidden = newState !== null;
                if (isHidden) {
                  var _current = finishedWork.alternate;
                  var wasHidden = _current !== null && _current.memoizedState !== null;
                  if (!wasHidden) {
                    markCommitTimeOfFallback();
                  }
                }
                break;
              }
              case OffscreenComponent: {
                var _newState = finishedWork.memoizedState;
                var _isHidden = _newState !== null;
                var _current2 = finishedWork.alternate;
                var _wasHidden = _current2 !== null && _current2.memoizedState !== null;
                var offscreenBoundary = finishedWork;
                if (supportsMutation) {
                  hideOrUnhideAllChildren(offscreenBoundary, _isHidden);
                }
                {
                  if (_isHidden) {
                    if (!_wasHidden) {
                      if ((offscreenBoundary.mode & ConcurrentMode) !== NoMode) {
                        nextEffect = offscreenBoundary;
                        var offscreenChild = offscreenBoundary.child;
                        while (offscreenChild !== null) {
                          nextEffect = offscreenChild;
                          disappearLayoutEffects_begin(offscreenChild);
                          offscreenChild = offscreenChild.sibling;
                        }
                      }
                    }
                  }
                  break;
                }
              }
            }
          }
          var primaryFlags = flags & (Placement | Update | Hydrating);
          switch (primaryFlags) {
            case Placement: {
              commitPlacement(finishedWork);
              finishedWork.flags &= ~Placement;
              break;
            }
            case PlacementAndUpdate: {
              commitPlacement(finishedWork);
              finishedWork.flags &= ~Placement;
              var _current3 = finishedWork.alternate;
              commitWork(_current3, finishedWork);
              break;
            }
            case Hydrating: {
              finishedWork.flags &= ~Hydrating;
              break;
            }
            case HydratingAndUpdate: {
              finishedWork.flags &= ~Hydrating;
              var _current4 = finishedWork.alternate;
              commitWork(_current4, finishedWork);
              break;
            }
            case Update: {
              var _current5 = finishedWork.alternate;
              commitWork(_current5, finishedWork);
              break;
            }
          }
        }
        function commitLayoutEffects(finishedWork, root2, committedLanes) {
          inProgressLanes = committedLanes;
          inProgressRoot = root2;
          nextEffect = finishedWork;
          commitLayoutEffects_begin(finishedWork, root2, committedLanes);
          inProgressLanes = null;
          inProgressRoot = null;
        }
        function commitLayoutEffects_begin(subtreeRoot, root2, committedLanes) {
          var isModernRoot = (subtreeRoot.mode & ConcurrentMode) !== NoMode;
          while (nextEffect !== null) {
            var fiber = nextEffect;
            var firstChild = fiber.child;
            if (fiber.tag === OffscreenComponent && isModernRoot) {
              var isHidden = fiber.memoizedState !== null;
              var newOffscreenSubtreeIsHidden = isHidden || offscreenSubtreeIsHidden;
              if (newOffscreenSubtreeIsHidden) {
                commitLayoutMountEffects_complete(subtreeRoot, root2, committedLanes);
                continue;
              } else {
                var current2 = fiber.alternate;
                var wasHidden = current2 !== null && current2.memoizedState !== null;
                var newOffscreenSubtreeWasHidden = wasHidden || offscreenSubtreeWasHidden;
                var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden;
                var prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden;
                offscreenSubtreeIsHidden = newOffscreenSubtreeIsHidden;
                offscreenSubtreeWasHidden = newOffscreenSubtreeWasHidden;
                if (offscreenSubtreeWasHidden && !prevOffscreenSubtreeWasHidden) {
                  nextEffect = fiber;
                  reappearLayoutEffects_begin(fiber);
                }
                var child = firstChild;
                while (child !== null) {
                  nextEffect = child;
                  commitLayoutEffects_begin(
                    child,
                    // New root; bubble back up to here and stop.
                    root2,
                    committedLanes
                  );
                  child = child.sibling;
                }
                nextEffect = fiber;
                offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden;
                offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden;
                commitLayoutMountEffects_complete(subtreeRoot, root2, committedLanes);
                continue;
              }
            }
            if ((fiber.subtreeFlags & LayoutMask) !== NoFlags && firstChild !== null) {
              ensureCorrectReturnPointer(firstChild, fiber);
              nextEffect = firstChild;
            } else {
              commitLayoutMountEffects_complete(subtreeRoot, root2, committedLanes);
            }
          }
        }
        function commitLayoutMountEffects_complete(subtreeRoot, root2, committedLanes) {
          while (nextEffect !== null) {
            var fiber = nextEffect;
            if ((fiber.flags & LayoutMask) !== NoFlags) {
              var current2 = fiber.alternate;
              setCurrentFiber(fiber);
              try {
                commitLayoutEffectOnFiber(root2, current2, fiber, committedLanes);
              } catch (error2) {
                reportUncaughtErrorInDEV(error2);
                captureCommitPhaseError(fiber, fiber.return, error2);
              }
              resetCurrentFiber();
            }
            if (fiber === subtreeRoot) {
              nextEffect = null;
              return;
            }
            var sibling = fiber.sibling;
            if (sibling !== null) {
              ensureCorrectReturnPointer(sibling, fiber.return);
              nextEffect = sibling;
              return;
            }
            nextEffect = fiber.return;
          }
        }
        function disappearLayoutEffects_begin(subtreeRoot) {
          while (nextEffect !== null) {
            var fiber = nextEffect;
            var firstChild = fiber.child;
            switch (fiber.tag) {
              case FunctionComponent:
              case ForwardRef:
              case MemoComponent:
              case SimpleMemoComponent: {
                if (fiber.mode & ProfileMode) {
                  try {
                    startLayoutEffectTimer();
                    commitHookEffectListUnmount(Layout2, fiber, fiber.return);
                  } finally {
                    recordLayoutEffectDuration(fiber);
                  }
                } else {
                  commitHookEffectListUnmount(Layout2, fiber, fiber.return);
                }
                break;
              }
              case ClassComponent: {
                safelyDetachRef(fiber, fiber.return);
                var instance = fiber.stateNode;
                if (typeof instance.componentWillUnmount === "function") {
                  safelyCallComponentWillUnmount(fiber, fiber.return, instance);
                }
                break;
              }
              case HostComponent: {
                safelyDetachRef(fiber, fiber.return);
                break;
              }
              case OffscreenComponent: {
                var isHidden = fiber.memoizedState !== null;
                if (isHidden) {
                  disappearLayoutEffects_complete(subtreeRoot);
                  continue;
                }
                break;
              }
            }
            if (firstChild !== null) {
              firstChild.return = fiber;
              nextEffect = firstChild;
            } else {
              disappearLayoutEffects_complete(subtreeRoot);
            }
          }
        }
        function disappearLayoutEffects_complete(subtreeRoot) {
          while (nextEffect !== null) {
            var fiber = nextEffect;
            if (fiber === subtreeRoot) {
              nextEffect = null;
              return;
            }
            var sibling = fiber.sibling;
            if (sibling !== null) {
              sibling.return = fiber.return;
              nextEffect = sibling;
              return;
            }
            nextEffect = fiber.return;
          }
        }
        function reappearLayoutEffects_begin(subtreeRoot) {
          while (nextEffect !== null) {
            var fiber = nextEffect;
            var firstChild = fiber.child;
            if (fiber.tag === OffscreenComponent) {
              var isHidden = fiber.memoizedState !== null;
              if (isHidden) {
                reappearLayoutEffects_complete(subtreeRoot);
                continue;
              }
            }
            if (firstChild !== null) {
              firstChild.return = fiber;
              nextEffect = firstChild;
            } else {
              reappearLayoutEffects_complete(subtreeRoot);
            }
          }
        }
        function reappearLayoutEffects_complete(subtreeRoot) {
          while (nextEffect !== null) {
            var fiber = nextEffect;
            setCurrentFiber(fiber);
            try {
              reappearLayoutEffectsOnFiber(fiber);
            } catch (error2) {
              reportUncaughtErrorInDEV(error2);
              captureCommitPhaseError(fiber, fiber.return, error2);
            }
            resetCurrentFiber();
            if (fiber === subtreeRoot) {
              nextEffect = null;
              return;
            }
            var sibling = fiber.sibling;
            if (sibling !== null) {
              sibling.return = fiber.return;
              nextEffect = sibling;
              return;
            }
            nextEffect = fiber.return;
          }
        }
        function commitPassiveMountEffects(root2, finishedWork) {
          nextEffect = finishedWork;
          commitPassiveMountEffects_begin(finishedWork, root2);
        }
        function commitPassiveMountEffects_begin(subtreeRoot, root2) {
          while (nextEffect !== null) {
            var fiber = nextEffect;
            var firstChild = fiber.child;
            if ((fiber.subtreeFlags & PassiveMask) !== NoFlags && firstChild !== null) {
              ensureCorrectReturnPointer(firstChild, fiber);
              nextEffect = firstChild;
            } else {
              commitPassiveMountEffects_complete(subtreeRoot, root2);
            }
          }
        }
        function commitPassiveMountEffects_complete(subtreeRoot, root2) {
          while (nextEffect !== null) {
            var fiber = nextEffect;
            if ((fiber.flags & Passive) !== NoFlags) {
              setCurrentFiber(fiber);
              try {
                commitPassiveMountOnFiber(root2, fiber);
              } catch (error2) {
                reportUncaughtErrorInDEV(error2);
                captureCommitPhaseError(fiber, fiber.return, error2);
              }
              resetCurrentFiber();
            }
            if (fiber === subtreeRoot) {
              nextEffect = null;
              return;
            }
            var sibling = fiber.sibling;
            if (sibling !== null) {
              ensureCorrectReturnPointer(sibling, fiber.return);
              nextEffect = sibling;
              return;
            }
            nextEffect = fiber.return;
          }
        }
        function commitPassiveMountOnFiber(finishedRoot, finishedWork) {
          switch (finishedWork.tag) {
            case FunctionComponent:
            case ForwardRef:
            case SimpleMemoComponent: {
              if (finishedWork.mode & ProfileMode) {
                startPassiveEffectTimer();
                try {
                  commitHookEffectListMount(Passive$1 | HasEffect, finishedWork);
                } finally {
                  recordPassiveEffectDuration(finishedWork);
                }
              } else {
                commitHookEffectListMount(Passive$1 | HasEffect, finishedWork);
              }
              break;
            }
          }
        }
        function commitPassiveUnmountEffects(firstChild) {
          nextEffect = firstChild;
          commitPassiveUnmountEffects_begin();
        }
        function commitPassiveUnmountEffects_begin() {
          while (nextEffect !== null) {
            var fiber = nextEffect;
            var child = fiber.child;
            if ((nextEffect.flags & ChildDeletion) !== NoFlags) {
              var deletions = fiber.deletions;
              if (deletions !== null) {
                for (var i2 = 0; i2 < deletions.length; i2++) {
                  var fiberToDelete = deletions[i2];
                  nextEffect = fiberToDelete;
                  commitPassiveUnmountEffectsInsideOfDeletedTree_begin(fiberToDelete, fiber);
                }
                {
                  var previousFiber = fiber.alternate;
                  if (previousFiber !== null) {
                    var detachedChild = previousFiber.child;
                    if (detachedChild !== null) {
                      previousFiber.child = null;
                      do {
                        var detachedSibling = detachedChild.sibling;
                        detachedChild.sibling = null;
                        detachedChild = detachedSibling;
                      } while (detachedChild !== null);
                    }
                  }
                }
                nextEffect = fiber;
              }
            }
            if ((fiber.subtreeFlags & PassiveMask) !== NoFlags && child !== null) {
              ensureCorrectReturnPointer(child, fiber);
              nextEffect = child;
            } else {
              commitPassiveUnmountEffects_complete();
            }
          }
        }
        function commitPassiveUnmountEffects_complete() {
          while (nextEffect !== null) {
            var fiber = nextEffect;
            if ((fiber.flags & Passive) !== NoFlags) {
              setCurrentFiber(fiber);
              commitPassiveUnmountOnFiber(fiber);
              resetCurrentFiber();
            }
            var sibling = fiber.sibling;
            if (sibling !== null) {
              ensureCorrectReturnPointer(sibling, fiber.return);
              nextEffect = sibling;
              return;
            }
            nextEffect = fiber.return;
          }
        }
        function commitPassiveUnmountOnFiber(finishedWork) {
          switch (finishedWork.tag) {
            case FunctionComponent:
            case ForwardRef:
            case SimpleMemoComponent: {
              if (finishedWork.mode & ProfileMode) {
                startPassiveEffectTimer();
                commitHookEffectListUnmount(Passive$1 | HasEffect, finishedWork, finishedWork.return);
                recordPassiveEffectDuration(finishedWork);
              } else {
                commitHookEffectListUnmount(Passive$1 | HasEffect, finishedWork, finishedWork.return);
              }
              break;
            }
          }
        }
        function commitPassiveUnmountEffectsInsideOfDeletedTree_begin(deletedSubtreeRoot, nearestMountedAncestor) {
          while (nextEffect !== null) {
            var fiber = nextEffect;
            setCurrentFiber(fiber);
            commitPassiveUnmountInsideDeletedTreeOnFiber(fiber, nearestMountedAncestor);
            resetCurrentFiber();
            var child = fiber.child;
            if (child !== null) {
              ensureCorrectReturnPointer(child, fiber);
              nextEffect = child;
            } else {
              commitPassiveUnmountEffectsInsideOfDeletedTree_complete(deletedSubtreeRoot);
            }
          }
        }
        function commitPassiveUnmountEffectsInsideOfDeletedTree_complete(deletedSubtreeRoot) {
          while (nextEffect !== null) {
            var fiber = nextEffect;
            var sibling = fiber.sibling;
            var returnFiber = fiber.return;
            {
              detachFiberAfterEffects(fiber);
              if (fiber === deletedSubtreeRoot) {
                nextEffect = null;
                return;
              }
            }
            if (sibling !== null) {
              ensureCorrectReturnPointer(sibling, returnFiber);
              nextEffect = sibling;
              return;
            }
            nextEffect = returnFiber;
          }
        }
        function commitPassiveUnmountInsideDeletedTreeOnFiber(current2, nearestMountedAncestor) {
          switch (current2.tag) {
            case FunctionComponent:
            case ForwardRef:
            case SimpleMemoComponent: {
              if (current2.mode & ProfileMode) {
                startPassiveEffectTimer();
                commitHookEffectListUnmount(Passive$1, current2, nearestMountedAncestor);
                recordPassiveEffectDuration(current2);
              } else {
                commitHookEffectListUnmount(Passive$1, current2, nearestMountedAncestor);
              }
              break;
            }
          }
        }
        var didWarnWrongReturnPointer = false;
        function ensureCorrectReturnPointer(fiber, expectedReturnFiber) {
          {
            if (!didWarnWrongReturnPointer && fiber.return !== expectedReturnFiber) {
              didWarnWrongReturnPointer = true;
              error("Internal React error: Return pointer is inconsistent with parent.");
            }
          }
          fiber.return = expectedReturnFiber;
        }
        function invokeLayoutEffectMountInDEV(fiber) {
          {
            switch (fiber.tag) {
              case FunctionComponent:
              case ForwardRef:
              case SimpleMemoComponent: {
                try {
                  commitHookEffectListMount(Layout2 | HasEffect, fiber);
                } catch (error2) {
                  reportUncaughtErrorInDEV(error2);
                  captureCommitPhaseError(fiber, fiber.return, error2);
                }
                break;
              }
              case ClassComponent: {
                var instance = fiber.stateNode;
                try {
                  instance.componentDidMount();
                } catch (error2) {
                  reportUncaughtErrorInDEV(error2);
                  captureCommitPhaseError(fiber, fiber.return, error2);
                }
                break;
              }
            }
          }
        }
        function invokePassiveEffectMountInDEV(fiber) {
          {
            switch (fiber.tag) {
              case FunctionComponent:
              case ForwardRef:
              case SimpleMemoComponent: {
                try {
                  commitHookEffectListMount(Passive$1 | HasEffect, fiber);
                } catch (error2) {
                  reportUncaughtErrorInDEV(error2);
                  captureCommitPhaseError(fiber, fiber.return, error2);
                }
                break;
              }
            }
          }
        }
        function invokeLayoutEffectUnmountInDEV(fiber) {
          {
            switch (fiber.tag) {
              case FunctionComponent:
              case ForwardRef:
              case SimpleMemoComponent: {
                try {
                  commitHookEffectListUnmount(Layout2 | HasEffect, fiber, fiber.return);
                } catch (error2) {
                  reportUncaughtErrorInDEV(error2);
                  captureCommitPhaseError(fiber, fiber.return, error2);
                }
                break;
              }
              case ClassComponent: {
                var instance = fiber.stateNode;
                if (typeof instance.componentWillUnmount === "function") {
                  safelyCallComponentWillUnmount(fiber, fiber.return, instance);
                }
                break;
              }
            }
          }
        }
        function invokePassiveEffectUnmountInDEV(fiber) {
          {
            switch (fiber.tag) {
              case FunctionComponent:
              case ForwardRef:
              case SimpleMemoComponent: {
                try {
                  commitHookEffectListUnmount(Passive$1 | HasEffect, fiber, fiber.return);
                } catch (error2) {
                  reportUncaughtErrorInDEV(error2);
                  captureCommitPhaseError(fiber, fiber.return, error2);
                }
              }
            }
          }
        }
        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 = Symbol.for;
          COMPONENT_TYPE = symbolFor("selector.component");
          HAS_PSEUDO_CLASS_TYPE = symbolFor("selector.has_pseudo_class");
          ROLE_TYPE = symbolFor("selector.role");
          TEST_NAME_TYPE = symbolFor("selector.test_id");
          TEXT_TYPE = symbolFor("selector.text");
        }
        function createComponentSelector(component) {
          return {
            $$typeof: COMPONENT_TYPE,
            value: component
          };
        }
        function createHasPseudoClassSelector(selectors) {
          return {
            $$typeof: HAS_PSEUDO_CLASS_TYPE,
            value: selectors
          };
        }
        function createRoleSelector(role) {
          return {
            $$typeof: ROLE_TYPE,
            value: role
          };
        }
        function createTextSelector(text2) {
          return {
            $$typeof: TEXT_TYPE,
            value: text2
          };
        }
        function createTestNameSelector(id2) {
          return {
            $$typeof: TEST_NAME_TYPE,
            value: id2
          };
        }
        function findFiberRootForHostRoot(hostRoot) {
          var maybeFiber = getInstanceFromNode(hostRoot);
          if (maybeFiber != null) {
            if (typeof maybeFiber.memoizedProps["data-testname"] !== "string") {
              throw new Error("Invalid host root specified. Should be either a React container or a node with a testname attribute.");
            }
            return maybeFiber;
          } else {
            var fiberRoot = findFiberRoot(hostRoot);
            if (fiberRoot === null) {
              throw new Error("Could not find React container within specified host subtree.");
            }
            return fiberRoot.stateNode.current;
          }
        }
        function matchSelector(fiber, selector) {
          switch (selector.$$typeof) {
            case COMPONENT_TYPE:
              if (fiber.type === selector.value) {
                return true;
              }
              break;
            case HAS_PSEUDO_CLASS_TYPE:
              return hasMatchingPaths(fiber, selector.value);
            case ROLE_TYPE:
              if (fiber.tag === HostComponent) {
                var node56 = fiber.stateNode;
                if (matchAccessibilityRole(node56, selector.value)) {
                  return true;
                }
              }
              break;
            case TEXT_TYPE:
              if (fiber.tag === HostComponent || fiber.tag === HostText) {
                var textContent = getTextContent(fiber);
                if (textContent !== null && textContent.indexOf(selector.value) >= 0) {
                  return true;
                }
              }
              break;
            case TEST_NAME_TYPE:
              if (fiber.tag === HostComponent) {
                var dataTestID = fiber.memoizedProps["data-testname"];
                if (typeof dataTestID === "string" && dataTestID.toLowerCase() === selector.value.toLowerCase()) {
                  return true;
                }
              }
              break;
            default:
              throw new Error("Invalid selector type specified.");
          }
          return false;
        }
        function selectorToString(selector) {
          switch (selector.$$typeof) {
            case COMPONENT_TYPE:
              var displayName = getComponentNameFromType(selector.value) || "Unknown";
              return "<" + displayName + ">";
            case HAS_PSEUDO_CLASS_TYPE:
              return ":has(" + (selectorToString(selector) || "") + ")";
            case ROLE_TYPE:
              return '[role="' + selector.value + '"]';
            case TEXT_TYPE:
              return '"' + selector.value + '"';
            case TEST_NAME_TYPE:
              return '[data-testname="' + selector.value + '"]';
            default:
              throw new Error("Invalid selector type specified.");
          }
        }
        function findPaths(root2, selectors) {
          var matchingFibers = [];
          var stack = [root2, 0];
          var index2 = 0;
          while (index2 < stack.length) {
            var fiber = stack[index2++];
            var selectorIndex = stack[index2++];
            var selector = selectors[selectorIndex];
            if (fiber.tag === HostComponent && isHiddenSubtree(fiber)) {
              continue;
            } else {
              while (selector != null && matchSelector(fiber, selector)) {
                selectorIndex++;
                selector = selectors[selectorIndex];
              }
            }
            if (selectorIndex === selectors.length) {
              matchingFibers.push(fiber);
            } else {
              var child = fiber.child;
              while (child !== null) {
                stack.push(child, selectorIndex);
                child = child.sibling;
              }
            }
          }
          return matchingFibers;
        }
        function hasMatchingPaths(root2, selectors) {
          var stack = [root2, 0];
          var index2 = 0;
          while (index2 < stack.length) {
            var fiber = stack[index2++];
            var selectorIndex = stack[index2++];
            var selector = selectors[selectorIndex];
            if (fiber.tag === HostComponent && isHiddenSubtree(fiber)) {
              continue;
            } else {
              while (selector != null && matchSelector(fiber, selector)) {
                selectorIndex++;
                selector = selectors[selectorIndex];
              }
            }
            if (selectorIndex === selectors.length) {
              return true;
            } else {
              var child = fiber.child;
              while (child !== null) {
                stack.push(child, selectorIndex);
                child = child.sibling;
              }
            }
          }
          return false;
        }
        function findAllNodes(hostRoot, selectors) {
          if (!supportsTestSelectors) {
            throw new Error("Test selector API is not supported by this renderer.");
          }
          var root2 = findFiberRootForHostRoot(hostRoot);
          var matchingFibers = findPaths(root2, selectors);
          var instanceRoots = [];
          var stack = Array.from(matchingFibers);
          var index2 = 0;
          while (index2 < stack.length) {
            var node56 = stack[index2++];
            if (node56.tag === HostComponent) {
              if (isHiddenSubtree(node56)) {
                continue;
              }
              instanceRoots.push(node56.stateNode);
            } else {
              var child = node56.child;
              while (child !== null) {
                stack.push(child);
                child = child.sibling;
              }
            }
          }
          return instanceRoots;
        }
        function getFindAllNodesFailureDescription(hostRoot, selectors) {
          if (!supportsTestSelectors) {
            throw new Error("Test selector API is not supported by this renderer.");
          }
          var root2 = findFiberRootForHostRoot(hostRoot);
          var maxSelectorIndex = 0;
          var matchedNames = [];
          var stack = [root2, 0];
          var index2 = 0;
          while (index2 < stack.length) {
            var fiber = stack[index2++];
            var selectorIndex = stack[index2++];
            var selector = selectors[selectorIndex];
            if (fiber.tag === HostComponent && isHiddenSubtree(fiber)) {
              continue;
            } else if (matchSelector(fiber, selector)) {
              matchedNames.push(selectorToString(selector));
              selectorIndex++;
              if (selectorIndex > maxSelectorIndex) {
                maxSelectorIndex = selectorIndex;
              }
            }
            if (selectorIndex < selectors.length) {
              var child = fiber.child;
              while (child !== null) {
                stack.push(child, selectorIndex);
                child = child.sibling;
              }
            }
          }
          if (maxSelectorIndex < selectors.length) {
            var unmatchedNames = [];
            for (var i2 = maxSelectorIndex; i2 < selectors.length; i2++) {
              unmatchedNames.push(selectorToString(selectors[i2]));
            }
            return "findAllNodes was able to match part of the selector:\n" + ("  " + matchedNames.join(" > ") + "\n\n") + "No matching component was found for:\n" + ("  " + unmatchedNames.join(" > "));
          }
          return null;
        }
        function findBoundingRects(hostRoot, selectors) {
          if (!supportsTestSelectors) {
            throw new Error("Test selector API is not supported by this renderer.");
          }
          var instanceRoots = findAllNodes(hostRoot, selectors);
          var boundingRects = [];
          for (var i2 = 0; i2 < instanceRoots.length; i2++) {
            boundingRects.push(getBoundingRect(instanceRoots[i2]));
          }
          for (var _i = boundingRects.length - 1; _i > 0; _i--) {
            var targetRect = boundingRects[_i];
            var targetLeft = targetRect.x;
            var targetRight = targetLeft + targetRect.width;
            var targetTop = targetRect.y;
            var targetBottom = targetTop + targetRect.height;
            for (var j = _i - 1; j >= 0; j--) {
              if (_i !== j) {
                var otherRect = boundingRects[j];
                var otherLeft = otherRect.x;
                var otherRight = otherLeft + otherRect.width;
                var otherTop = otherRect.y;
                var otherBottom = otherTop + otherRect.height;
                if (targetLeft >= otherLeft && targetTop >= otherTop && targetRight <= otherRight && targetBottom <= otherBottom) {
                  boundingRects.splice(_i, 1);
                  break;
                } else if (targetLeft === otherLeft && targetRect.width === otherRect.width && !(otherBottom < targetTop) && !(otherTop > targetBottom)) {
                  if (otherTop > targetTop) {
                    otherRect.height += otherTop - targetTop;
                    otherRect.y = targetTop;
                  }
                  if (otherBottom < targetBottom) {
                    otherRect.height = targetBottom - otherTop;
                  }
                  boundingRects.splice(_i, 1);
                  break;
                } else if (targetTop === otherTop && targetRect.height === otherRect.height && !(otherRight < targetLeft) && !(otherLeft > targetRight)) {
                  if (otherLeft > targetLeft) {
                    otherRect.width += otherLeft - targetLeft;
                    otherRect.x = targetLeft;
                  }
                  if (otherRight < targetRight) {
                    otherRect.width = targetRight - otherLeft;
                  }
                  boundingRects.splice(_i, 1);
                  break;
                }
              }
            }
          }
          return boundingRects;
        }
        function focusWithin(hostRoot, selectors) {
          if (!supportsTestSelectors) {
            throw new Error("Test selector API is not supported by this renderer.");
          }
          var root2 = findFiberRootForHostRoot(hostRoot);
          var matchingFibers = findPaths(root2, selectors);
          var stack = Array.from(matchingFibers);
          var index2 = 0;
          while (index2 < stack.length) {
            var fiber = stack[index2++];
            if (isHiddenSubtree(fiber)) {
              continue;
            }
            if (fiber.tag === HostComponent) {
              var node56 = fiber.stateNode;
              if (setFocusIfFocusable(node56)) {
                return true;
              }
            }
            var child = fiber.child;
            while (child !== null) {
              stack.push(child);
              child = child.sibling;
            }
          }
          return false;
        }
        var commitHooks = [];
        function onCommitRoot$1() {
          if (supportsTestSelectors) {
            commitHooks.forEach(function(commitHook) {
              return commitHook();
            });
          }
        }
        function observeVisibleRects(hostRoot, selectors, callback, options) {
          if (!supportsTestSelectors) {
            throw new Error("Test selector API is not supported by this renderer.");
          }
          var instanceRoots = findAllNodes(hostRoot, selectors);
          var _setupIntersectionObs = setupIntersectionObserver(instanceRoots, callback, options), disconnect = _setupIntersectionObs.disconnect, observe = _setupIntersectionObs.observe, unobserve = _setupIntersectionObs.unobserve;
          var commitHook = function() {
            var nextInstanceRoots = findAllNodes(hostRoot, selectors);
            instanceRoots.forEach(function(target) {
              if (nextInstanceRoots.indexOf(target) < 0) {
                unobserve(target);
              }
            });
            nextInstanceRoots.forEach(function(target) {
              if (instanceRoots.indexOf(target) < 0) {
                observe(target);
              }
            });
          };
          commitHooks.push(commitHook);
          return {
            disconnect: function() {
              var index2 = commitHooks.indexOf(commitHook);
              if (index2 >= 0) {
                commitHooks.splice(index2, 1);
              }
              disconnect();
            }
          };
        }
        var ReactCurrentActQueue = ReactSharedInternals.ReactCurrentActQueue;
        function isLegacyActEnvironment(fiber) {
          {
            var isReactActEnvironmentGlobal = (
              // $FlowExpectedError – Flow doesn't know about IS_REACT_ACT_ENVIRONMENT global
              typeof IS_REACT_ACT_ENVIRONMENT !== "undefined" ? IS_REACT_ACT_ENVIRONMENT : void 0
            );
            var jestIsDefined = typeof jest !== "undefined";
            return warnsIfNotActing && jestIsDefined && isReactActEnvironmentGlobal !== false;
          }
        }
        function isConcurrentActEnvironment() {
          {
            var isReactActEnvironmentGlobal = (
              // $FlowExpectedError – Flow doesn't know about IS_REACT_ACT_ENVIRONMENT global
              typeof IS_REACT_ACT_ENVIRONMENT !== "undefined" ? IS_REACT_ACT_ENVIRONMENT : void 0
            );
            if (!isReactActEnvironmentGlobal && ReactCurrentActQueue.current !== null) {
              error("The current testing environment is not configured to support act(...)");
            }
            return isReactActEnvironmentGlobal;
          }
        }
        var ceil = Math.ceil;
        var ReactCurrentDispatcher$2 = ReactSharedInternals.ReactCurrentDispatcher, ReactCurrentOwner$2 = ReactSharedInternals.ReactCurrentOwner, ReactCurrentBatchConfig$2 = ReactSharedInternals.ReactCurrentBatchConfig, ReactCurrentActQueue$1 = ReactSharedInternals.ReactCurrentActQueue;
        var NoContext = (
          /*             */
          0
        );
        var BatchedContext = (
          /*               */
          1
        );
        var RenderContext = (
          /*                */
          2
        );
        var CommitContext = (
          /*                */
          4
        );
        var RootInProgress = 0;
        var RootFatalErrored = 1;
        var RootErrored = 2;
        var RootSuspended = 3;
        var RootSuspendedWithDelay = 4;
        var RootCompleted = 5;
        var RootDidNotComplete = 6;
        var executionContext = NoContext;
        var workInProgressRoot = null;
        var workInProgress = null;
        var workInProgressRootRenderLanes = NoLanes;
        var subtreeRenderLanes = NoLanes;
        var subtreeRenderLanesCursor = createCursor(NoLanes);
        var workInProgressRootExitStatus = RootInProgress;
        var workInProgressRootFatalError = null;
        var workInProgressRootIncludedLanes = NoLanes;
        var workInProgressRootSkippedLanes = NoLanes;
        var workInProgressRootInterleavedUpdatedLanes = NoLanes;
        var workInProgressRootPingedLanes = NoLanes;
        var workInProgressRootConcurrentErrors = null;
        var workInProgressRootRecoverableErrors = null;
        var globalMostRecentFallbackTime = 0;
        var FALLBACK_THROTTLE_MS = 500;
        var workInProgressRootRenderTargetTime = Infinity;
        var RENDER_TIMEOUT_MS = 500;
        function resetRenderTimer() {
          workInProgressRootRenderTargetTime = now$1() + RENDER_TIMEOUT_MS;
        }
        function getRenderTargetTime() {
          return workInProgressRootRenderTargetTime;
        }
        var hasUncaughtError = false;
        var firstUncaughtError = null;
        var legacyErrorBoundariesThatAlreadyFailed = null;
        var rootDoesHavePassiveEffects = false;
        var rootWithPendingPassiveEffects = null;
        var pendingPassiveEffectsLanes = NoLanes;
        var pendingPassiveProfilerEffects = [];
        var NESTED_UPDATE_LIMIT = 50;
        var nestedUpdateCount = 0;
        var rootWithNestedUpdates = null;
        var NESTED_PASSIVE_UPDATE_LIMIT = 50;
        var nestedPassiveUpdateCount = 0;
        var currentEventTime = NoTimestamp;
        var currentEventTransitionLane = NoLanes;
        function getWorkInProgressRoot() {
          return workInProgressRoot;
        }
        function requestEventTime() {
          if ((executionContext & (RenderContext | CommitContext)) !== NoContext) {
            return now$1();
          }
          if (currentEventTime !== NoTimestamp) {
            return currentEventTime;
          }
          currentEventTime = now$1();
          return currentEventTime;
        }
        function requestUpdateLane(fiber) {
          var mode = fiber.mode;
          if ((mode & ConcurrentMode) === NoMode) {
            return SyncLane;
          } else if ((executionContext & RenderContext) !== NoContext && workInProgressRootRenderLanes !== NoLanes) {
            return pickArbitraryLane(workInProgressRootRenderLanes);
          }
          var isTransition = requestCurrentTransition() !== NoTransition;
          if (isTransition) {
            if (ReactCurrentBatchConfig$2.transition !== null) {
              var transition = ReactCurrentBatchConfig$2.transition;
              if (!transition._updatedFibers) {
                transition._updatedFibers = /* @__PURE__ */ new Set();
              }
              transition._updatedFibers.add(fiber);
            }
            if (currentEventTransitionLane === NoLane) {
              currentEventTransitionLane = claimNextTransitionLane();
            }
            return currentEventTransitionLane;
          }
          var updateLane = getCurrentUpdatePriority();
          if (updateLane !== NoLane) {
            return updateLane;
          }
          var eventLane = getCurrentEventPriority();
          return eventLane;
        }
        function requestRetryLane(fiber) {
          var mode = fiber.mode;
          if ((mode & ConcurrentMode) === NoMode) {
            return SyncLane;
          }
          return claimNextRetryLane();
        }
        function scheduleUpdateOnFiber(fiber, lane, eventTime) {
          checkForNestedUpdates();
          var root2 = markUpdateLaneFromFiberToRoot(fiber, lane);
          if (root2 === null) {
            return null;
          }
          markRootUpdated(root2, lane, eventTime);
          if ((executionContext & RenderContext) !== NoLanes && root2 === workInProgressRoot) {
            warnAboutRenderPhaseUpdatesInDEV(fiber);
          } else {
            {
              if (isDevToolsPresent) {
                addFiberToLanesMap(root2, fiber, lane);
              }
            }
            warnIfUpdatesNotWrappedWithActDEV(fiber);
            if (root2 === workInProgressRoot) {
              if ((executionContext & RenderContext) === NoContext) {
                workInProgressRootInterleavedUpdatedLanes = mergeLanes(workInProgressRootInterleavedUpdatedLanes, lane);
              }
              if (workInProgressRootExitStatus === RootSuspendedWithDelay) {
                markRootSuspended$1(root2, workInProgressRootRenderLanes);
              }
            }
            ensureRootIsScheduled(root2, eventTime);
            if (lane === SyncLane && executionContext === NoContext && (fiber.mode & ConcurrentMode) === NoMode && // Treat `act` as if it's inside `batchedUpdates`, even in legacy mode.
            !ReactCurrentActQueue$1.isBatchingLegacy) {
              resetRenderTimer();
              flushSyncCallbacksOnlyInLegacyMode();
            }
          }
          return root2;
        }
        function scheduleInitialHydrationOnRoot(root2, lane, eventTime) {
          var current2 = root2.current;
          current2.lanes = lane;
          markRootUpdated(root2, lane, eventTime);
          ensureRootIsScheduled(root2, eventTime);
        }
        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 node56 = 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);
                }
              }
            }
            node56 = parent;
            parent = parent.return;
          }
          if (node56.tag === HostRoot) {
            var root2 = node56.stateNode;
            return root2;
          } else {
            return null;
          }
        }
        function isInterleavedUpdate(fiber, lane) {
          return (
            // TODO: Optimize slightly by comparing to root that fiber belongs to.
            // Requires some refactoring. Not a big deal though since it's rare for
            // concurrent apps to have more than a single root.
            workInProgressRoot !== null && (fiber.mode & ConcurrentMode) !== NoMode && // If this is a render phase update (i.e. UNSAFE_componentWillReceiveProps),
            // then don't treat this as an interleaved update. This pattern is
            // accompanied by a warning but we haven't fully deprecated it yet. We can
            // remove once the deferRenderPhaseUpdateToNextBatch flag is enabled.
            (executionContext & RenderContext) === NoContext
          );
        }
        function ensureRootIsScheduled(root2, currentTime) {
          var existingCallbackNode = root2.callbackNode;
          markStarvedLanesAsExpired(root2, currentTime);
          var nextLanes = getNextLanes(root2, root2 === workInProgressRoot ? workInProgressRootRenderLanes : NoLanes);
          if (nextLanes === NoLanes) {
            if (existingCallbackNode !== null) {
              cancelCallback$1(existingCallbackNode);
            }
            root2.callbackNode = null;
            root2.callbackPriority = NoLane;
            return;
          }
          var newCallbackPriority = getHighestPriorityLane(nextLanes);
          var existingCallbackPriority = root2.callbackPriority;
          if (existingCallbackPriority === newCallbackPriority && // Special case related to `act`. If the currently scheduled task is a
          // Scheduler task, rather than an `act` task, cancel it and re-scheduled
          // on the `act` queue.
          !(ReactCurrentActQueue$1.current !== null && existingCallbackNode !== fakeActCallbackNode)) {
            {
              if (existingCallbackNode == null && existingCallbackPriority !== SyncLane) {
                error("Expected scheduled callback to exist. This error is likely caused by a bug in React. Please file an issue.");
              }
            }
            return;
          }
          if (existingCallbackNode != null) {
            cancelCallback$1(existingCallbackNode);
          }
          var newCallbackNode;
          if (newCallbackPriority === SyncLane) {
            if (root2.tag === LegacyRoot) {
              if (ReactCurrentActQueue$1.isBatchingLegacy !== null) {
                ReactCurrentActQueue$1.didScheduleLegacyUpdate = true;
              }
              scheduleLegacySyncCallback(performSyncWorkOnRoot.bind(null, root2));
            } else {
              scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root2));
            }
            if (supportsMicrotasks) {
              if (ReactCurrentActQueue$1.current !== null) {
                ReactCurrentActQueue$1.current.push(flushSyncCallbacks);
              } else {
                scheduleMicrotask(function() {
                  if (executionContext === NoContext) {
                    flushSyncCallbacks();
                  }
                });
              }
            } else {
              scheduleCallback$1(ImmediatePriority, flushSyncCallbacks);
            }
            newCallbackNode = null;
          } else {
            var schedulerPriorityLevel;
            switch (lanesToEventPriority(nextLanes)) {
              case DiscreteEventPriority2:
                schedulerPriorityLevel = ImmediatePriority;
                break;
              case ContinuousEventPriority2:
                schedulerPriorityLevel = UserBlockingPriority;
                break;
              case DefaultEventPriority2:
                schedulerPriorityLevel = NormalPriority;
                break;
              case IdleEventPriority:
                schedulerPriorityLevel = IdlePriority;
                break;
              default:
                schedulerPriorityLevel = NormalPriority;
                break;
            }
            newCallbackNode = scheduleCallback$1(schedulerPriorityLevel, performConcurrentWorkOnRoot.bind(null, root2));
          }
          root2.callbackPriority = newCallbackPriority;
          root2.callbackNode = newCallbackNode;
        }
        function performConcurrentWorkOnRoot(root2, didTimeout) {
          {
            resetNestedUpdateFlag();
          }
          currentEventTime = NoTimestamp;
          currentEventTransitionLane = NoLanes;
          if ((executionContext & (RenderContext | CommitContext)) !== NoContext) {
            throw new 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 shouldTimeSlice = !includesBlockingLane(root2, lanes) && !includesExpiredLane(root2, lanes) && !didTimeout;
          var exitStatus = shouldTimeSlice ? renderRootConcurrent(root2, lanes) : renderRootSync(root2, lanes);
          if (exitStatus !== RootInProgress) {
            if (exitStatus === RootErrored) {
              var errorRetryLanes = getLanesToRetrySynchronouslyOnError(root2);
              if (errorRetryLanes !== NoLanes) {
                lanes = errorRetryLanes;
                exitStatus = recoverFromConcurrentError(root2, errorRetryLanes);
              }
            }
            if (exitStatus === RootFatalErrored) {
              var fatalError = workInProgressRootFatalError;
              prepareFreshStack(root2, NoLanes);
              markRootSuspended$1(root2, lanes);
              ensureRootIsScheduled(root2, now$1());
              throw fatalError;
            }
            if (exitStatus === RootDidNotComplete) {
              markRootSuspended$1(root2, lanes);
            } else {
              var renderWasConcurrent = !includesBlockingLane(root2, lanes);
              var finishedWork = root2.current.alternate;
              if (renderWasConcurrent && !isRenderConsistentWithExternalStores(finishedWork)) {
                exitStatus = renderRootSync(root2, lanes);
                if (exitStatus === RootErrored) {
                  var _errorRetryLanes = getLanesToRetrySynchronouslyOnError(root2);
                  if (_errorRetryLanes !== NoLanes) {
                    lanes = _errorRetryLanes;
                    exitStatus = recoverFromConcurrentError(root2, _errorRetryLanes);
                  }
                }
                if (exitStatus === RootFatalErrored) {
                  var _fatalError = workInProgressRootFatalError;
                  prepareFreshStack(root2, NoLanes);
                  markRootSuspended$1(root2, lanes);
                  ensureRootIsScheduled(root2, now$1());
                  throw _fatalError;
                }
              }
              root2.finishedWork = finishedWork;
              root2.finishedLanes = lanes;
              finishConcurrentRender(root2, exitStatus, lanes);
            }
          }
          ensureRootIsScheduled(root2, now$1());
          if (root2.callbackNode === originalCallbackNode) {
            return performConcurrentWorkOnRoot.bind(null, root2);
          }
          return null;
        }
        function recoverFromConcurrentError(root2, errorRetryLanes) {
          var errorsFromFirstAttempt = workInProgressRootConcurrentErrors;
          if (isRootDehydrated(root2)) {
            var rootWorkInProgress = prepareFreshStack(root2, errorRetryLanes);
            rootWorkInProgress.flags |= ForceClientRender;
            {
              errorHydratingContainer(root2.containerInfo);
            }
          }
          var exitStatus = renderRootSync(root2, errorRetryLanes);
          if (exitStatus !== RootErrored) {
            var errorsFromSecondAttempt = workInProgressRootRecoverableErrors;
            workInProgressRootRecoverableErrors = errorsFromFirstAttempt;
            if (errorsFromSecondAttempt !== null) {
              queueRecoverableErrors(errorsFromSecondAttempt);
            }
          }
          return exitStatus;
        }
        function queueRecoverableErrors(errors) {
          if (workInProgressRootRecoverableErrors === null) {
            workInProgressRootRecoverableErrors = errors;
          } else {
            workInProgressRootRecoverableErrors.push.apply(workInProgressRootRecoverableErrors, errors);
          }
        }
        function finishConcurrentRender(root2, exitStatus, lanes) {
          switch (exitStatus) {
            case RootInProgress:
            case RootFatalErrored: {
              throw new Error("Root did not complete. This is a bug in React.");
            }
            case RootErrored: {
              commitRoot(root2, workInProgressRootRecoverableErrors);
              break;
            }
            case RootSuspended: {
              markRootSuspended$1(root2, lanes);
              if (includesOnlyRetries(lanes) && // do not delay if we're inside an act() scope
              !shouldForceFlushFallbacksInDEV()) {
                var msUntilTimeout = globalMostRecentFallbackTime + FALLBACK_THROTTLE_MS - now$1();
                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, workInProgressRootRecoverableErrors), msUntilTimeout);
                  break;
                }
              }
              commitRoot(root2, workInProgressRootRecoverableErrors);
              break;
            }
            case RootSuspendedWithDelay: {
              markRootSuspended$1(root2, lanes);
              if (includesOnlyTransitions(lanes)) {
                break;
              }
              if (!shouldForceFlushFallbacksInDEV()) {
                var mostRecentEventTime = getMostRecentEventTime(root2, lanes);
                var eventTimeMs = mostRecentEventTime;
                var timeElapsedMs = now$1() - eventTimeMs;
                var _msUntilTimeout = jnd(timeElapsedMs) - timeElapsedMs;
                if (_msUntilTimeout > 10) {
                  root2.timeoutHandle = scheduleTimeout(commitRoot.bind(null, root2, workInProgressRootRecoverableErrors), _msUntilTimeout);
                  break;
                }
              }
              commitRoot(root2, workInProgressRootRecoverableErrors);
              break;
            }
            case RootCompleted: {
              commitRoot(root2, workInProgressRootRecoverableErrors);
              break;
            }
            default: {
              throw new Error("Unknown root exit status.");
            }
          }
        }
        function isRenderConsistentWithExternalStores(finishedWork) {
          var node56 = finishedWork;
          while (true) {
            if (node56.flags & StoreConsistency) {
              var updateQueue = node56.updateQueue;
              if (updateQueue !== null) {
                var checks = updateQueue.stores;
                if (checks !== null) {
                  for (var i2 = 0; i2 < checks.length; i2++) {
                    var check = checks[i2];
                    var getSnapshot = check.getSnapshot;
                    var renderedValue = check.value;
                    try {
                      if (!objectIs(getSnapshot(), renderedValue)) {
                        return false;
                      }
                    } catch (error2) {
                      return false;
                    }
                  }
                }
              }
            }
            var child = node56.child;
            if (node56.subtreeFlags & StoreConsistency && child !== null) {
              child.return = node56;
              node56 = child;
              continue;
            }
            if (node56 === finishedWork) {
              return true;
            }
            while (node56.sibling === null) {
              if (node56.return === null || node56.return === finishedWork) {
                return true;
              }
              node56 = node56.return;
            }
            node56.sibling.return = node56.return;
            node56 = node56.sibling;
          }
          return true;
        }
        function markRootSuspended$1(root2, suspendedLanes) {
          suspendedLanes = removeLanes(suspendedLanes, workInProgressRootPingedLanes);
          suspendedLanes = removeLanes(suspendedLanes, workInProgressRootInterleavedUpdatedLanes);
          markRootSuspended(root2, suspendedLanes);
        }
        function performSyncWorkOnRoot(root2) {
          {
            syncNestedUpdateFlag();
          }
          if ((executionContext & (RenderContext | CommitContext)) !== NoContext) {
            throw new Error("Should not already be working.");
          }
          flushPassiveEffects();
          var lanes = getNextLanes(root2, NoLanes);
          if (!includesSomeLane(lanes, SyncLane)) {
            ensureRootIsScheduled(root2, now$1());
            return null;
          }
          var exitStatus = renderRootSync(root2, lanes);
          if (root2.tag !== LegacyRoot && exitStatus === RootErrored) {
            var errorRetryLanes = getLanesToRetrySynchronouslyOnError(root2);
            if (errorRetryLanes !== NoLanes) {
              lanes = errorRetryLanes;
              exitStatus = recoverFromConcurrentError(root2, errorRetryLanes);
            }
          }
          if (exitStatus === RootFatalErrored) {
            var fatalError = workInProgressRootFatalError;
            prepareFreshStack(root2, NoLanes);
            markRootSuspended$1(root2, lanes);
            ensureRootIsScheduled(root2, now$1());
            throw fatalError;
          }
          if (exitStatus === RootDidNotComplete) {
            throw new Error("Root did not complete. This is a bug in React.");
          }
          var finishedWork = root2.current.alternate;
          root2.finishedWork = finishedWork;
          root2.finishedLanes = lanes;
          commitRoot(root2, workInProgressRootRecoverableErrors);
          ensureRootIsScheduled(root2, now$1());
          return null;
        }
        function flushRoot(root2, lanes) {
          if (lanes !== NoLanes) {
            markRootEntangled(root2, mergeLanes(lanes, SyncLane));
            ensureRootIsScheduled(root2, now$1());
            if ((executionContext & (RenderContext | CommitContext)) === NoContext) {
              resetRenderTimer();
              flushSyncCallbacks();
            }
          }
        }
        function deferredUpdates(fn) {
          var previousPriority = getCurrentUpdatePriority();
          var prevTransition = ReactCurrentBatchConfig$2.transition;
          try {
            ReactCurrentBatchConfig$2.transition = null;
            setCurrentUpdatePriority(DefaultEventPriority2);
            return fn();
          } finally {
            setCurrentUpdatePriority(previousPriority);
            ReactCurrentBatchConfig$2.transition = prevTransition;
          }
        }
        function batchedUpdates(fn, a2) {
          var prevExecutionContext = executionContext;
          executionContext |= BatchedContext;
          try {
            return fn(a2);
          } finally {
            executionContext = prevExecutionContext;
            if (executionContext === NoContext && // Treat `act` as if it's inside `batchedUpdates`, even in legacy mode.
            !ReactCurrentActQueue$1.isBatchingLegacy) {
              resetRenderTimer();
              flushSyncCallbacksOnlyInLegacyMode();
            }
          }
        }
        function discreteUpdates(fn, a2, b, c4, d) {
          var previousPriority = getCurrentUpdatePriority();
          var prevTransition = ReactCurrentBatchConfig$2.transition;
          try {
            ReactCurrentBatchConfig$2.transition = null;
            setCurrentUpdatePriority(DiscreteEventPriority2);
            return fn(a2, b, c4, d);
          } finally {
            setCurrentUpdatePriority(previousPriority);
            ReactCurrentBatchConfig$2.transition = prevTransition;
            if (executionContext === NoContext) {
              resetRenderTimer();
            }
          }
        }
        function flushSync(fn) {
          if (rootWithPendingPassiveEffects !== null && rootWithPendingPassiveEffects.tag === LegacyRoot && (executionContext & (RenderContext | CommitContext)) === NoContext) {
            flushPassiveEffects();
          }
          var prevExecutionContext = executionContext;
          executionContext |= BatchedContext;
          var prevTransition = ReactCurrentBatchConfig$2.transition;
          var previousPriority = getCurrentUpdatePriority();
          try {
            ReactCurrentBatchConfig$2.transition = null;
            setCurrentUpdatePriority(DiscreteEventPriority2);
            if (fn) {
              return fn();
            } else {
              return void 0;
            }
          } finally {
            setCurrentUpdatePriority(previousPriority);
            ReactCurrentBatchConfig$2.transition = prevTransition;
            executionContext = prevExecutionContext;
            if ((executionContext & (RenderContext | CommitContext)) === NoContext) {
              flushSyncCallbacks();
            }
          }
        }
        function isAlreadyRendering() {
          return (executionContext & (RenderContext | CommitContext)) !== NoContext;
        }
        function flushControlled(fn) {
          var prevExecutionContext = executionContext;
          executionContext |= BatchedContext;
          var prevTransition = ReactCurrentBatchConfig$2.transition;
          var previousPriority = getCurrentUpdatePriority();
          try {
            ReactCurrentBatchConfig$2.transition = null;
            setCurrentUpdatePriority(DiscreteEventPriority2);
            fn();
          } finally {
            setCurrentUpdatePriority(previousPriority);
            ReactCurrentBatchConfig$2.transition = prevTransition;
            executionContext = prevExecutionContext;
            if (executionContext === NoContext) {
              resetRenderTimer();
              flushSyncCallbacks();
            }
          }
        }
        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) {
              var current2 = interruptedWork.alternate;
              unwindInterruptedWork(current2, interruptedWork);
              interruptedWork = interruptedWork.return;
            }
          }
          workInProgressRoot = root2;
          var rootWorkInProgress = createWorkInProgress(root2.current, null);
          workInProgress = rootWorkInProgress;
          workInProgressRootRenderLanes = subtreeRenderLanes = workInProgressRootIncludedLanes = lanes;
          workInProgressRootExitStatus = RootInProgress;
          workInProgressRootFatalError = null;
          workInProgressRootSkippedLanes = NoLanes;
          workInProgressRootInterleavedUpdatedLanes = NoLanes;
          workInProgressRootPingedLanes = NoLanes;
          workInProgressRootConcurrentErrors = null;
          workInProgressRootRecoverableErrors = null;
          enqueueInterleavedUpdates();
          {
            ReactStrictModeWarnings.discardPendingWarnings();
          }
          return rootWorkInProgress;
        }
        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);
              }
              if (enableSchedulingProfiler) {
                markComponentRenderStopped();
                if (thrownValue !== null && typeof thrownValue === "object" && typeof thrownValue.then === "function") {
                  var wakeable = thrownValue;
                  markComponentSuspended(erroredWork, wakeable, workInProgressRootRenderLanes);
                } else {
                  markComponentErrored(erroredWork, thrownValue, workInProgressRootRenderLanes);
                }
              }
              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 markCommitTimeOfFallback() {
          globalMostRecentFallbackTime = now$1();
        }
        function markSkippedUpdateLanes(lane) {
          workInProgressRootSkippedLanes = mergeLanes(lane, workInProgressRootSkippedLanes);
        }
        function renderDidSuspend() {
          if (workInProgressRootExitStatus === RootInProgress) {
            workInProgressRootExitStatus = RootSuspended;
          }
        }
        function renderDidSuspendDelayIfPossible() {
          if (workInProgressRootExitStatus === RootInProgress || workInProgressRootExitStatus === RootSuspended || workInProgressRootExitStatus === RootErrored) {
            workInProgressRootExitStatus = RootSuspendedWithDelay;
          }
          if (workInProgressRoot !== null && (includesNonIdleWork(workInProgressRootSkippedLanes) || includesNonIdleWork(workInProgressRootInterleavedUpdatedLanes))) {
            markRootSuspended$1(workInProgressRoot, workInProgressRootRenderLanes);
          }
        }
        function renderDidError(error2) {
          if (workInProgressRootExitStatus !== RootSuspendedWithDelay) {
            workInProgressRootExitStatus = RootErrored;
          }
          if (workInProgressRootConcurrentErrors === null) {
            workInProgressRootConcurrentErrors = [error2];
          } else {
            workInProgressRootConcurrentErrors.push(error2);
          }
        }
        function renderHasNotSuspendedYet() {
          return workInProgressRootExitStatus === RootInProgress;
        }
        function renderRootSync(root2, lanes) {
          var prevExecutionContext = executionContext;
          executionContext |= RenderContext;
          var prevDispatcher = pushDispatcher();
          if (workInProgressRoot !== root2 || workInProgressRootRenderLanes !== lanes) {
            {
              if (isDevToolsPresent) {
                var memoizedUpdaters = root2.memoizedUpdaters;
                if (memoizedUpdaters.size > 0) {
                  restorePendingUpdaters(root2, workInProgressRootRenderLanes);
                  memoizedUpdaters.clear();
                }
                movePendingFibersToMemoized(root2, lanes);
              }
            }
            prepareFreshStack(root2, lanes);
          }
          {
            markRenderStarted(lanes);
          }
          do {
            try {
              workLoopSync();
              break;
            } catch (thrownValue) {
              handleError(root2, thrownValue);
            }
          } while (true);
          resetContextDependencies();
          executionContext = prevExecutionContext;
          popDispatcher(prevDispatcher);
          if (workInProgress !== null) {
            throw new Error("Cannot commit an incomplete root. This error is likely caused by a bug in React. Please file an issue.");
          }
          {
            markRenderStopped();
          }
          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) {
            {
              if (isDevToolsPresent) {
                var memoizedUpdaters = root2.memoizedUpdaters;
                if (memoizedUpdaters.size > 0) {
                  restorePendingUpdaters(root2, workInProgressRootRenderLanes);
                  memoizedUpdaters.clear();
                }
                movePendingFibersToMemoized(root2, lanes);
              }
            }
            resetRenderTimer();
            prepareFreshStack(root2, lanes);
          }
          {
            markRenderStarted(lanes);
          }
          do {
            try {
              workLoopConcurrent();
              break;
            } catch (thrownValue) {
              handleError(root2, thrownValue);
            }
          } while (true);
          resetContextDependencies();
          popDispatcher(prevDispatcher);
          executionContext = prevExecutionContext;
          if (workInProgress !== null) {
            {
              markRenderYielded();
            }
            return RootInProgress;
          } else {
            {
              markRenderStopped();
            }
            workInProgressRoot = null;
            workInProgressRootRenderLanes = NoLanes;
            return workInProgressRootExitStatus;
          }
        }
        function workLoopConcurrent() {
          while (workInProgress !== null && !shouldYield()) {
            performUnitOfWork(workInProgress);
          }
        }
        function performUnitOfWork(unitOfWork) {
          var current2 = unitOfWork.alternate;
          setCurrentFiber(unitOfWork);
          var next2;
          if ((unitOfWork.mode & ProfileMode) !== NoMode) {
            startProfilerTimer(unitOfWork);
            next2 = beginWork$1(current2, unitOfWork, subtreeRenderLanes);
            stopProfilerTimerIfRunningAndRecordDelta(unitOfWork, true);
          } else {
            next2 = beginWork$1(current2, unitOfWork, subtreeRenderLanes);
          }
          resetCurrentFiber();
          unitOfWork.memoizedProps = unitOfWork.pendingProps;
          if (next2 === null) {
            completeUnitOfWork(unitOfWork);
          } else {
            workInProgress = next2;
          }
          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 next2 = void 0;
              if ((completedWork.mode & ProfileMode) === NoMode) {
                next2 = completeWork(current2, completedWork, subtreeRenderLanes);
              } else {
                startProfilerTimer(completedWork);
                next2 = completeWork(current2, completedWork, subtreeRenderLanes);
                stopProfilerTimerIfRunningAndRecordDelta(completedWork, false);
              }
              resetCurrentFiber();
              if (next2 !== null) {
                workInProgress = next2;
                return;
              }
            } else {
              var _next = unwindWork(current2, 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.flags |= Incomplete;
                returnFiber.subtreeFlags = NoFlags;
                returnFiber.deletions = null;
              } else {
                workInProgressRootExitStatus = RootDidNotComplete;
                workInProgress = null;
                return;
              }
            }
            var siblingFiber = completedWork.sibling;
            if (siblingFiber !== null) {
              workInProgress = siblingFiber;
              return;
            }
            completedWork = returnFiber;
            workInProgress = completedWork;
          } while (completedWork !== null);
          if (workInProgressRootExitStatus === RootInProgress) {
            workInProgressRootExitStatus = RootCompleted;
          }
        }
        function commitRoot(root2, recoverableErrors) {
          var previousUpdateLanePriority = getCurrentUpdatePriority();
          var prevTransition = ReactCurrentBatchConfig$2.transition;
          try {
            ReactCurrentBatchConfig$2.transition = null;
            setCurrentUpdatePriority(DiscreteEventPriority2);
            commitRootImpl(root2, recoverableErrors, previousUpdateLanePriority);
          } finally {
            ReactCurrentBatchConfig$2.transition = prevTransition;
            setCurrentUpdatePriority(previousUpdateLanePriority);
          }
          return null;
        }
        function commitRootImpl(root2, recoverableErrors, renderPriorityLevel) {
          do {
            flushPassiveEffects();
          } while (rootWithPendingPassiveEffects !== null);
          flushRenderPhaseStrictModeWarningsInDEV();
          if ((executionContext & (RenderContext | CommitContext)) !== NoContext) {
            throw new Error("Should not already be working.");
          }
          var finishedWork = root2.finishedWork;
          var lanes = root2.finishedLanes;
          {
            markCommitStarted(lanes);
          }
          if (finishedWork === null) {
            {
              markCommitStopped();
            }
            return null;
          } else {
            {
              if (lanes === NoLanes) {
                error("root.finishedLanes should not be empty during a commit. This is a bug in React.");
              }
            }
          }
          root2.finishedWork = null;
          root2.finishedLanes = NoLanes;
          if (finishedWork === root2.current) {
            throw new 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;
          root2.callbackPriority = NoLane;
          var remainingLanes = mergeLanes(finishedWork.lanes, finishedWork.childLanes);
          markRootFinished(root2, remainingLanes);
          if (root2 === workInProgressRoot) {
            workInProgressRoot = null;
            workInProgress = null;
            workInProgressRootRenderLanes = NoLanes;
          }
          if ((finishedWork.subtreeFlags & PassiveMask) !== NoFlags || (finishedWork.flags & PassiveMask) !== NoFlags) {
            if (!rootDoesHavePassiveEffects) {
              rootDoesHavePassiveEffects = true;
              scheduleCallback$1(NormalPriority, function() {
                flushPassiveEffects();
                return null;
              });
            }
          }
          var subtreeHasEffects = (finishedWork.subtreeFlags & (BeforeMutationMask | MutationMask | LayoutMask | PassiveMask)) !== NoFlags;
          var rootHasEffect = (finishedWork.flags & (BeforeMutationMask | MutationMask | LayoutMask | PassiveMask)) !== NoFlags;
          if (subtreeHasEffects || rootHasEffect) {
            var prevTransition = ReactCurrentBatchConfig$2.transition;
            ReactCurrentBatchConfig$2.transition = null;
            var previousPriority = getCurrentUpdatePriority();
            setCurrentUpdatePriority(DiscreteEventPriority2);
            var prevExecutionContext = executionContext;
            executionContext |= CommitContext;
            ReactCurrentOwner$2.current = null;
            var shouldFireAfterActiveInstanceBlur2 = commitBeforeMutationEffects(root2, finishedWork);
            {
              recordCommitTime();
            }
            commitMutationEffects(root2, finishedWork, lanes);
            resetAfterCommit(root2.containerInfo);
            root2.current = finishedWork;
            {
              markLayoutEffectsStarted(lanes);
            }
            commitLayoutEffects(finishedWork, root2, lanes);
            {
              markLayoutEffectsStopped();
            }
            requestPaint();
            executionContext = prevExecutionContext;
            setCurrentUpdatePriority(previousPriority);
            ReactCurrentBatchConfig$2.transition = prevTransition;
          } else {
            root2.current = finishedWork;
            {
              recordCommitTime();
            }
          }
          var rootDidHavePassiveEffects = rootDoesHavePassiveEffects;
          if (rootDoesHavePassiveEffects) {
            rootDoesHavePassiveEffects = false;
            rootWithPendingPassiveEffects = root2;
            pendingPassiveEffectsLanes = lanes;
          }
          remainingLanes = root2.pendingLanes;
          if (remainingLanes === NoLanes) {
            legacyErrorBoundariesThatAlreadyFailed = null;
          }
          {
            if (!rootDidHavePassiveEffects) {
              commitDoubleInvokeEffectsInDEV(root2.current, false);
            }
          }
          onCommitRoot(finishedWork.stateNode, renderPriorityLevel);
          {
            if (isDevToolsPresent) {
              root2.memoizedUpdaters.clear();
            }
          }
          {
            onCommitRoot$1();
          }
          ensureRootIsScheduled(root2, now$1());
          if (recoverableErrors !== null) {
            var onRecoverableError = root2.onRecoverableError;
            for (var i2 = 0; i2 < recoverableErrors.length; i2++) {
              var recoverableError = recoverableErrors[i2];
              onRecoverableError(recoverableError);
            }
          }
          if (hasUncaughtError) {
            hasUncaughtError = false;
            var error$1 = firstUncaughtError;
            firstUncaughtError = null;
            throw error$1;
          }
          if (includesSomeLane(pendingPassiveEffectsLanes, SyncLane) && root2.tag !== LegacyRoot) {
            flushPassiveEffects();
          }
          remainingLanes = root2.pendingLanes;
          if (includesSomeLane(remainingLanes, SyncLane)) {
            {
              markNestedUpdateScheduled();
            }
            if (root2 === rootWithNestedUpdates) {
              nestedUpdateCount++;
            } else {
              nestedUpdateCount = 0;
              rootWithNestedUpdates = root2;
            }
          } else {
            nestedUpdateCount = 0;
          }
          flushSyncCallbacks();
          {
            markCommitStopped();
          }
          return null;
        }
        function flushPassiveEffects() {
          if (rootWithPendingPassiveEffects !== null) {
            var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes);
            var priority = lowerEventPriority(DefaultEventPriority2, renderPriority);
            var prevTransition = ReactCurrentBatchConfig$2.transition;
            var previousPriority = getCurrentUpdatePriority();
            try {
              ReactCurrentBatchConfig$2.transition = null;
              setCurrentUpdatePriority(priority);
              return flushPassiveEffectsImpl();
            } finally {
              setCurrentUpdatePriority(previousPriority);
              ReactCurrentBatchConfig$2.transition = prevTransition;
            }
          }
          return false;
        }
        function enqueuePendingPassiveProfilerEffect(fiber) {
          {
            pendingPassiveProfilerEffects.push(fiber);
            if (!rootDoesHavePassiveEffects) {
              rootDoesHavePassiveEffects = true;
              scheduleCallback$1(NormalPriority, function() {
                flushPassiveEffects();
                return null;
              });
            }
          }
        }
        function flushPassiveEffectsImpl() {
          if (rootWithPendingPassiveEffects === null) {
            return false;
          }
          var root2 = rootWithPendingPassiveEffects;
          var lanes = pendingPassiveEffectsLanes;
          rootWithPendingPassiveEffects = null;
          pendingPassiveEffectsLanes = NoLanes;
          if ((executionContext & (RenderContext | CommitContext)) !== NoContext) {
            throw new Error("Cannot flush passive effects while already rendering.");
          }
          {
            markPassiveEffectsStarted(lanes);
          }
          var prevExecutionContext = executionContext;
          executionContext |= CommitContext;
          commitPassiveUnmountEffects(root2.current);
          commitPassiveMountEffects(root2, root2.current);
          {
            var profilerEffects = pendingPassiveProfilerEffects;
            pendingPassiveProfilerEffects = [];
            for (var i2 = 0; i2 < profilerEffects.length; i2++) {
              var _fiber = profilerEffects[i2];
              commitPassiveEffectDurations(root2, _fiber);
            }
          }
          {
            markPassiveEffectsStopped();
          }
          {
            commitDoubleInvokeEffectsInDEV(root2.current, true);
          }
          executionContext = prevExecutionContext;
          flushSyncCallbacks();
          nestedPassiveUpdateCount = rootWithPendingPassiveEffects === null ? 0 : nestedPassiveUpdateCount + 1;
          onPostCommitRoot(root2);
          {
            var stateNode = root2.current.stateNode;
            stateNode.effectDuration = 0;
            stateNode.passiveEffectDuration = 0;
          }
          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);
          }
        }
        function captureCommitPhaseError(sourceFiber, nearestMountedAncestor, error$1) {
          if (sourceFiber.tag === HostRoot) {
            captureCommitPhaseErrorOnRoot(sourceFiber, sourceFiber, error$1);
            return;
          }
          var fiber = null;
          {
            fiber = nearestMountedAncestor;
          }
          while (fiber !== null) {
            if (fiber.tag === HostRoot) {
              captureCommitPhaseErrorOnRoot(fiber, sourceFiber, error$1);
              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(error$1, 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);
                }
                return;
              }
            }
            fiber = fiber.return;
          }
          {
            error("Internal React error: Attempted to capture a commit phase error inside a detached tree. This indicates a bug in React. Likely causes include deleting the same fiber more than once, committing an already-finished tree, or an inconsistent return pointer.\n\nError message:\n\n%s", error$1);
          }
        }
        function pingSuspendedRoot(root2, wakeable, pingedLanes) {
          var pingCache = root2.pingCache;
          if (pingCache !== null) {
            pingCache.delete(wakeable);
          }
          var eventTime = requestEventTime();
          markRootPinged(root2, pingedLanes);
          warnIfSuspenseResolutionNotWrappedWithActDEV(root2);
          if (workInProgressRoot === root2 && isSubsetOfLanes(workInProgressRootRenderLanes, pingedLanes)) {
            if (workInProgressRootExitStatus === RootSuspendedWithDelay || workInProgressRootExitStatus === RootSuspended && includesOnlyRetries(workInProgressRootRenderLanes) && now$1() - globalMostRecentFallbackTime < FALLBACK_THROTTLE_MS) {
              prepareFreshStack(root2, NoLanes);
            } else {
              workInProgressRootPingedLanes = mergeLanes(workInProgressRootPingedLanes, pingedLanes);
            }
          }
          ensureRootIsScheduled(root2, eventTime);
        }
        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);
          }
        }
        function retryDehydratedSuspenseBoundary(boundaryFiber) {
          var suspenseState = boundaryFiber.memoizedState;
          var retryLane = NoLane;
          if (suspenseState !== null) {
            retryLane = suspenseState.retryLane;
          }
          retryTimedOutBoundary(boundaryFiber, retryLane);
        }
        function resolveRetryWakeable(boundaryFiber, wakeable) {
          var retryLane = NoLane;
          var retryCache;
          {
            switch (boundaryFiber.tag) {
              case SuspenseComponent:
                retryCache = boundaryFiber.stateNode;
                var suspenseState = boundaryFiber.memoizedState;
                if (suspenseState !== null) {
                  retryLane = suspenseState.retryLane;
                }
                break;
              case SuspenseListComponent:
                retryCache = boundaryFiber.stateNode;
                break;
              default:
                throw new Error("Pinged unknown suspense boundary type. This is probably a bug in React.");
            }
          }
          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 new 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();
            }
          }
        }
        function commitDoubleInvokeEffectsInDEV(fiber, hasPassiveEffects) {
          {
            setCurrentFiber(fiber);
            invokeEffectsInDev(fiber, MountLayoutDev, invokeLayoutEffectUnmountInDEV);
            if (hasPassiveEffects) {
              invokeEffectsInDev(fiber, MountPassiveDev, invokePassiveEffectUnmountInDEV);
            }
            invokeEffectsInDev(fiber, MountLayoutDev, invokeLayoutEffectMountInDEV);
            if (hasPassiveEffects) {
              invokeEffectsInDev(fiber, MountPassiveDev, invokePassiveEffectMountInDEV);
            }
            resetCurrentFiber();
          }
        }
        function invokeEffectsInDev(firstChild, fiberFlags, invokeEffectFn) {
          {
            var current2 = firstChild;
            var subtreeRoot = null;
            while (current2 !== null) {
              var primarySubtreeFlag = current2.subtreeFlags & fiberFlags;
              if (current2 !== subtreeRoot && current2.child !== null && primarySubtreeFlag !== NoFlags) {
                current2 = current2.child;
              } else {
                if ((current2.flags & fiberFlags) !== NoFlags) {
                  invokeEffectFn(current2);
                }
                if (current2.sibling !== null) {
                  current2 = current2.sibling;
                } else {
                  current2 = subtreeRoot = current2.return;
                }
              }
            }
          }
        }
        var didWarnStateUpdateForNotYetMountedComponent = null;
        function warnAboutUpdateOnNotYetMountedFiberInDEV(fiber) {
          {
            if ((executionContext & RenderContext) !== NoContext) {
              return;
            }
            if (!(fiber.mode & ConcurrentMode)) {
              return;
            }
            var tag = fiber.tag;
            if (tag !== IndeterminateComponent && tag !== HostRoot && tag !== ClassComponent && tag !== FunctionComponent && tag !== ForwardRef && tag !== MemoComponent && tag !== SimpleMemoComponent) {
              return;
            }
            var componentName = getComponentNameFromFiber(fiber) || "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 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(current2, unitOfWork);
              assignFiberPropertiesInDEV(unitOfWork, originalWorkInProgressCopy);
              if (unitOfWork.mode & ProfileMode) {
                startProfilerTimer(unitOfWork);
              }
              invokeGuardedCallback(null, beginWork, null, current2, unitOfWork, lanes);
              if (hasCaughtError()) {
                var replayError = clearCaughtError();
                if (typeof replayError === "object" && replayError !== null && replayError._suppressLogging && typeof originalError === "object" && originalError !== null && !originalError._suppressLogging) {
                  originalError._suppressLogging = true;
                }
              }
              throw originalError;
            }
          };
        }
        var didWarnAboutUpdateInRender = false;
        var didWarnAboutUpdateInRenderForAnotherComponent;
        {
          didWarnAboutUpdateInRenderForAnotherComponent = /* @__PURE__ */ new Set();
        }
        function warnAboutRenderPhaseUpdatesInDEV(fiber) {
          {
            if (isRendering && !getIsUpdatingOpaqueValueInRenderPhaseInDEV()) {
              switch (fiber.tag) {
                case FunctionComponent:
                case ForwardRef:
                case SimpleMemoComponent: {
                  var renderingComponentName = workInProgress && getComponentNameFromFiber(workInProgress) || "Unknown";
                  var dedupeKey = renderingComponentName;
                  if (!didWarnAboutUpdateInRenderForAnotherComponent.has(dedupeKey)) {
                    didWarnAboutUpdateInRenderForAnotherComponent.add(dedupeKey);
                    var setStateComponentName = getComponentNameFromFiber(fiber) || "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;
                }
              }
            }
          }
        }
        function restorePendingUpdaters(root2, lanes) {
          {
            if (isDevToolsPresent) {
              var memoizedUpdaters = root2.memoizedUpdaters;
              memoizedUpdaters.forEach(function(schedulingFiber) {
                addFiberToLanesMap(root2, schedulingFiber, lanes);
              });
            }
          }
        }
        var fakeActCallbackNode = {};
        function scheduleCallback$1(priorityLevel, callback) {
          {
            var actQueue = ReactCurrentActQueue$1.current;
            if (actQueue !== null) {
              actQueue.push(callback);
              return fakeActCallbackNode;
            } else {
              return scheduleCallback(priorityLevel, callback);
            }
          }
        }
        function cancelCallback$1(callbackNode) {
          if (callbackNode === fakeActCallbackNode) {
            return;
          }
          return cancelCallback(callbackNode);
        }
        function shouldForceFlushFallbacksInDEV() {
          return ReactCurrentActQueue$1.current !== null;
        }
        function warnIfUpdatesNotWrappedWithActDEV(fiber) {
          {
            if (fiber.mode & ConcurrentMode) {
              if (!isConcurrentActEnvironment()) {
                return;
              }
            } else {
              if (!isLegacyActEnvironment()) {
                return;
              }
              if (executionContext !== NoContext) {
                return;
              }
              if (fiber.tag !== FunctionComponent && fiber.tag !== ForwardRef && fiber.tag !== SimpleMemoComponent) {
                return;
              }
            }
            if (ReactCurrentActQueue$1.current === null) {
              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", getComponentNameFromFiber(fiber));
              } finally {
                if (previousFiber) {
                  setCurrentFiber(fiber);
                } else {
                  resetCurrentFiber();
                }
              }
            }
          }
        }
        function warnIfSuspenseResolutionNotWrappedWithActDEV(root2) {
          {
            if (root2.tag !== LegacyRoot && isConcurrentActEnvironment() && ReactCurrentActQueue$1.current === null) {
              error("A suspended resource finished loading inside a test, but the event was not wrapped in act(...).\n\nWhen testing, code that resolves suspended data should be wrapped into act(...):\n\nact(() => {\n  /* finish loading suspended data */\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");
            }
          }
        }
        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, element2) {
          {
            if (resolveFamily === null) {
              return false;
            }
            var prevType = fiber.elementType;
            var nextType = element2.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, element2) {
          {
            if (root2.context !== emptyContextObject) {
              return;
            }
            flushPassiveEffects();
            flushSync(function() {
              updateContainer(element2, 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 types2 = new Set(families.map(function(family) {
              return family.current;
            }));
            findHostInstancesForMatchingFibersRecursively(root2.current, types2, hostInstances);
            return hostInstances;
          }
        };
        function findHostInstancesForMatchingFibersRecursively(fiber, types2, 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 (types2.has(candidateType)) {
                didMatch = true;
              }
            }
            if (didMatch) {
              findHostInstancesForFiberShallowly(fiber, hostInstances);
            } else {
              if (child !== null) {
                findHostInstancesForMatchingFibersRecursively(child, types2, hostInstances);
              }
            }
            if (sibling !== null) {
              findHostInstancesForMatchingFibersRecursively(sibling, types2, hostInstances);
            }
          }
        }
        function findHostInstancesForFiberShallowly(fiber, hostInstances) {
          {
            var foundHostInstances = findChildHostInstancesForFiberShallowly(fiber, hostInstances);
            if (foundHostInstances) {
              return;
            }
            var node56 = fiber;
            while (true) {
              switch (node56.tag) {
                case HostComponent:
                  hostInstances.add(node56.stateNode);
                  return;
                case HostPortal:
                  hostInstances.add(node56.stateNode.containerInfo);
                  return;
                case HostRoot:
                  hostInstances.add(node56.stateNode.containerInfo);
                  return;
              }
              if (node56.return === null) {
                throw new Error("Expected to reach root first.");
              }
              node56 = node56.return;
            }
          }
        }
        function findChildHostInstancesForFiberShallowly(fiber, hostInstances) {
          {
            var node56 = fiber;
            var foundHostInstances = false;
            while (true) {
              if (node56.tag === HostComponent) {
                foundHostInstances = true;
                hostInstances.add(node56.stateNode);
              } else if (node56.child !== null) {
                node56.child.return = node56;
                node56 = node56.child;
                continue;
              }
              if (node56 === fiber) {
                return foundHostInstances;
              }
              while (node56.sibling === null) {
                if (node56.return === null || node56.return === fiber) {
                  return foundHostInstances;
                }
                node56 = node56.return;
              }
              node56.sibling.return = node56.return;
              node56 = node56.sibling;
            }
          }
          return false;
        }
        var hasBadMapPolyfill;
        {
          hasBadMapPolyfill = false;
          try {
            var nonExtensibleObject = Object.preventExtensions({});
            /* @__PURE__ */ new Map([[nonExtensibleObject, null]]);
            /* @__PURE__ */ new Set([nonExtensibleObject]);
          } catch (e3) {
            hasBadMapPolyfill = true;
          }
        }
        function FiberNode(tag, pendingProps, key, mode) {
          this.tag = tag;
          this.key = key;
          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.subtreeFlags = NoFlags;
          this.deletions = 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._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, key, mode) {
          return new FiberNode(tag, pendingProps, key, mode);
        };
        function shouldConstruct$1(Component8) {
          var prototype = Component8.prototype;
          return !!(prototype && prototype.isReactComponent);
        }
        function isSimpleFunctionComponent(type) {
          return typeof type === "function" && !shouldConstruct$1(type) && type.defaultProps === void 0;
        }
        function resolveLazyComponentTag(Component8) {
          if (typeof Component8 === "function") {
            return shouldConstruct$1(Component8) ? ClassComponent : FunctionComponent;
          } else if (Component8 !== void 0 && Component8 !== null) {
            var $$typeof = Component8.$$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._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.subtreeFlags = NoFlags;
            workInProgress2.deletions = null;
            {
              workInProgress2.actualDuration = 0;
              workInProgress2.actualStartTime = -1;
            }
          }
          workInProgress2.flags = current2.flags & StaticMask;
          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 &= StaticMask | Placement;
          var current2 = workInProgress2.alternate;
          if (current2 === null) {
            workInProgress2.childLanes = NoLanes;
            workInProgress2.lanes = renderLanes2;
            workInProgress2.child = null;
            workInProgress2.subtreeFlags = NoFlags;
            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.subtreeFlags = NoFlags;
            workInProgress2.deletions = null;
            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, isStrictMode, concurrentUpdatesByDefaultOverride) {
          var mode;
          if (tag === ConcurrentRoot2) {
            mode = ConcurrentMode;
            if (isStrictMode === true) {
              mode |= StrictLegacyMode;
              {
                mode |= StrictEffectsMode;
              }
            }
          } else {
            mode = NoMode;
          }
          if (isDevToolsPresent) {
            mode |= ProfileMode;
          }
          return createFiber(HostRoot, null, null, mode);
        }
        function createFiberFromTypeAndProps(type, key, 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, key);
                case REACT_STRICT_MODE_TYPE:
                  fiberTag = Mode;
                  mode |= StrictLegacyMode;
                  if ((mode & ConcurrentMode) !== NoMode) {
                    mode |= StrictEffectsMode;
                  }
                  break;
                case REACT_PROFILER_TYPE:
                  return createFiberFromProfiler(pendingProps, mode, lanes, key);
                case REACT_SUSPENSE_TYPE:
                  return createFiberFromSuspense(pendingProps, mode, lanes, key);
                case REACT_SUSPENSE_LIST_TYPE:
                  return createFiberFromSuspenseList(pendingProps, mode, lanes, key);
                case REACT_OFFSCREEN_TYPE:
                  return createFiberFromOffscreen(pendingProps, mode, lanes, key);
                case REACT_LEGACY_HIDDEN_TYPE:
                case REACT_SCOPE_TYPE:
                case REACT_CACHE_TYPE:
                case REACT_TRACING_MARKER_TYPE:
                case REACT_DEBUG_TRACING_MODE_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;
                    }
                  }
                  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 ? getComponentNameFromFiber(owner) : null;
                    if (ownerName) {
                      info += "\n\nCheck the render method of `" + ownerName + "`.";
                    }
                  }
                  throw new 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, key, mode);
          fiber.elementType = type;
          fiber.type = resolvedType;
          fiber.lanes = lanes;
          {
            fiber._debugOwner = owner;
          }
          return fiber;
        }
        function createFiberFromElement(element2, mode, lanes) {
          var owner = null;
          {
            owner = element2._owner;
          }
          var type = element2.type;
          var key = element2.key;
          var pendingProps = element2.props;
          var fiber = createFiberFromTypeAndProps(type, key, pendingProps, owner, mode, lanes);
          {
            fiber._debugSource = element2._source;
            fiber._debugOwner = element2._owner;
          }
          return fiber;
        }
        function createFiberFromFragment(elements, mode, lanes, key) {
          var fiber = createFiber(Fragment9, elements, key, mode);
          fiber.lanes = lanes;
          return fiber;
        }
        function createFiberFromProfiler(pendingProps, mode, lanes, key) {
          {
            if (typeof pendingProps.id !== "string") {
              error('Profiler must specify an "id" of type `string` as a prop. Received the type `%s` instead.', typeof pendingProps.id);
            }
          }
          var fiber = createFiber(Profiler, pendingProps, key, mode | ProfileMode);
          fiber.elementType = REACT_PROFILER_TYPE;
          fiber.lanes = lanes;
          {
            fiber.stateNode = {
              effectDuration: 0,
              passiveEffectDuration: 0
            };
          }
          return fiber;
        }
        function createFiberFromSuspense(pendingProps, mode, lanes, key) {
          var fiber = createFiber(SuspenseComponent, pendingProps, key, mode);
          fiber.elementType = REACT_SUSPENSE_TYPE;
          fiber.lanes = lanes;
          return fiber;
        }
        function createFiberFromSuspenseList(pendingProps, mode, lanes, key) {
          var fiber = createFiber(SuspenseListComponent, pendingProps, key, mode);
          fiber.elementType = REACT_SUSPENSE_LIST_TYPE;
          fiber.lanes = lanes;
          return fiber;
        }
        function createFiberFromOffscreen(pendingProps, mode, lanes, key) {
          var fiber = createFiber(OffscreenComponent, pendingProps, key, mode);
          fiber.elementType = REACT_OFFSCREEN_TYPE;
          fiber.lanes = lanes;
          var primaryChildInstance = {};
          fiber.stateNode = primaryChildInstance;
          return fiber;
        }
        function createFiberFromText(content2, mode, lanes) {
          var fiber = createFiber(HostText, content2, null, mode);
          fiber.lanes = lanes;
          return fiber;
        }
        function createFiberFromHostInstanceForDeletion() {
          var fiber = createFiber(HostComponent, null, null, NoMode);
          fiber.elementType = "DELETED";
          return fiber;
        }
        function createFiberFromDehydratedFragment(dehydratedNode) {
          var fiber = createFiber(DehydratedFragment, null, null, NoMode);
          fiber.stateNode = dehydratedNode;
          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,
            // Used by persistent updates
            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.subtreeFlags = source.subtreeFlags;
          target.deletions = source.deletions;
          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._debugSource = source._debugSource;
          target._debugOwner = source._debugOwner;
          target._debugNeedsRemount = source._debugNeedsRemount;
          target._debugHookTypes = source._debugHookTypes;
          return target;
        }
        function FiberRootNode(containerInfo, tag, hydrate, identifierPrefix, onRecoverableError) {
          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.callbackNode = null;
          this.callbackPriority = NoLane;
          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.identifierPrefix = identifierPrefix;
          this.onRecoverableError = onRecoverableError;
          if (supportsHydration) {
            this.mutableSourceEagerHydrationData = null;
          }
          {
            this.effectDuration = 0;
            this.passiveEffectDuration = 0;
          }
          {
            this.memoizedUpdaters = /* @__PURE__ */ new Set();
            var pendingUpdatersLaneMap = this.pendingUpdatersLaneMap = [];
            for (var _i = 0; _i < TotalLanes; _i++) {
              pendingUpdatersLaneMap.push(/* @__PURE__ */ new Set());
            }
          }
          {
            switch (tag) {
              case ConcurrentRoot2:
                this._debugRootType = hydrate ? "hydrateRoot()" : "createRoot()";
                break;
              case LegacyRoot:
                this._debugRootType = hydrate ? "hydrate()" : "render()";
                break;
            }
          }
        }
        function createFiberRoot(containerInfo, tag, hydrate, initialChildren, hydrationCallbacks, isStrictMode, concurrentUpdatesByDefaultOverride, identifierPrefix, onRecoverableError, transitionCallbacks) {
          var root2 = new FiberRootNode(containerInfo, tag, hydrate, identifierPrefix, onRecoverableError);
          var uninitializedFiber = createHostRootFiber(tag, isStrictMode);
          root2.current = uninitializedFiber;
          uninitializedFiber.stateNode = root2;
          {
            var _initialState = {
              element: initialChildren,
              isDehydrated: hydrate,
              cache: null,
              // not enabled yet
              transitions: null
            };
            uninitializedFiber.memoizedState = _initialState;
          }
          initializeUpdateQueue(uninitializedFiber);
          return root2;
        }
        var ReactVersion = "18.0.0-fc46dba67-20220329";
        function createPortal2(children, containerInfo, implementation) {
          var key = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : null;
          {
            checkKeyStringCoercion(key);
          }
          return {
            // This tag allow us to uniquely identify this as a React Portal
            $$typeof: REACT_PORTAL_TYPE,
            key: key == null ? null : "" + key,
            children,
            containerInfo,
            implementation
          };
        }
        var didWarnAboutNestedUpdates;
        var didWarnAboutFindNodeInStrictMode;
        {
          didWarnAboutNestedUpdates = false;
          didWarnAboutFindNodeInStrictMode = {};
        }
        function getContextForSubtree(parentComponent) {
          if (!parentComponent) {
            return emptyContextObject;
          }
          var fiber = get3(parentComponent);
          var parentContext = findCurrentUnmaskedContext(fiber);
          if (fiber.tag === ClassComponent) {
            var Component8 = fiber.type;
            if (isContextProvider(Component8)) {
              return processChildContext(fiber, Component8, parentContext);
            }
          }
          return parentContext;
        }
        function findHostInstance(component) {
          var fiber = get3(component);
          if (fiber === void 0) {
            if (typeof component.render === "function") {
              throw new Error("Unable to find node on an unmounted component.");
            } else {
              var keys4 = Object.keys(component).join(",");
              throw new Error("Argument appears to not be a ReactComponent. Keys: " + keys4);
            }
          }
          var hostFiber = findCurrentHostFiber(fiber);
          if (hostFiber === null) {
            return null;
          }
          return hostFiber.stateNode;
        }
        function findHostInstanceWithWarning(component, methodName) {
          {
            var fiber = get3(component);
            if (fiber === void 0) {
              if (typeof component.render === "function") {
                throw new Error("Unable to find node on an unmounted component.");
              } else {
                var keys4 = Object.keys(component).join(",");
                throw new Error("Argument appears to not be a ReactComponent. Keys: " + keys4);
              }
            }
            var hostFiber = findCurrentHostFiber(fiber);
            if (hostFiber === null) {
              return null;
            }
            if (hostFiber.mode & StrictLegacyMode) {
              var componentName = getComponentNameFromFiber(fiber) || "Component";
              if (!didWarnAboutFindNodeInStrictMode[componentName]) {
                didWarnAboutFindNodeInStrictMode[componentName] = true;
                var previousFiber = current;
                try {
                  setCurrentFiber(hostFiber);
                  if (fiber.mode & StrictLegacyMode) {
                    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, hydrationCallbacks, isStrictMode, concurrentUpdatesByDefaultOverride, identifierPrefix, onRecoverableError, transitionCallbacks) {
          var hydrate = false;
          var initialChildren = null;
          return createFiberRoot(containerInfo, tag, hydrate, initialChildren, hydrationCallbacks, isStrictMode, concurrentUpdatesByDefaultOverride, identifierPrefix, onRecoverableError);
        }
        function createHydrationContainer(initialChildren, callback, containerInfo, tag, hydrationCallbacks, isStrictMode, concurrentUpdatesByDefaultOverride, identifierPrefix, onRecoverableError, transitionCallbacks) {
          var hydrate = true;
          var root2 = createFiberRoot(containerInfo, tag, hydrate, initialChildren, hydrationCallbacks, isStrictMode, concurrentUpdatesByDefaultOverride, identifierPrefix, onRecoverableError);
          root2.context = getContextForSubtree(null);
          var current2 = root2.current;
          var eventTime = requestEventTime();
          var lane = requestUpdateLane(current2);
          var update = createUpdate(eventTime, lane);
          update.callback = callback !== void 0 && callback !== null ? callback : null;
          enqueueUpdate(current2, update);
          scheduleInitialHydrationOnRoot(root2, lane, eventTime);
          return root2;
        }
        function updateContainer(element2, container, parentComponent, callback) {
          {
            onScheduleRoot(container, element2);
          }
          var current$1 = container.current;
          var eventTime = requestEventTime();
          var lane = requestUpdateLane(current$1);
          {
            markRenderScheduled(lane);
          }
          var context2 = getContextForSubtree(parentComponent);
          if (container.context === null) {
            container.context = context2;
          } else {
            container.pendingContext = context2;
          }
          {
            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.", getComponentNameFromFiber(current) || "Unknown");
            }
          }
          var update = createUpdate(eventTime, lane);
          update.payload = {
            element: element2
          };
          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);
          var root2 = scheduleUpdateOnFiber(current$1, lane, eventTime);
          if (root2 !== null) {
            entangleTransitions(root2, current$1, lane);
          }
          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 attemptSynchronousHydration(fiber) {
          switch (fiber.tag) {
            case HostRoot:
              var root2 = fiber.stateNode;
              if (isRootDehydrated(root2)) {
                var lanes = getHighestPriorityPendingLanes(root2);
                flushRoot(root2, lanes);
              }
              break;
            case SuspenseComponent:
              var eventTime = requestEventTime();
              flushSync(function() {
                return scheduleUpdateOnFiber(fiber, SyncLane, eventTime);
              });
              var retryLane = SyncLane;
              markRetryLaneIfNotHydrated(fiber, retryLane);
              break;
          }
        }
        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 attemptContinuousHydration(fiber) {
          if (fiber.tag !== SuspenseComponent) {
            return;
          }
          var eventTime = requestEventTime();
          var lane = SelectiveHydrationLane;
          scheduleUpdateOnFiber(fiber, lane, eventTime);
          markRetryLaneIfNotHydrated(fiber, lane);
        }
        function attemptHydrationAtCurrentPriority(fiber) {
          if (fiber.tag !== SuspenseComponent) {
            return;
          }
          var eventTime = requestEventTime();
          var lane = requestUpdateLane(fiber);
          scheduleUpdateOnFiber(fiber, lane, eventTime);
          markRetryLaneIfNotHydrated(fiber, lane);
        }
        function findHostInstanceWithNoPortals(fiber) {
          var hostFiber = findCurrentHostFiberWithNoPortals(fiber);
          if (hostFiber === null) {
            return null;
          }
          return hostFiber.stateNode;
        }
        var shouldErrorImpl = function(fiber) {
          return null;
        };
        function shouldError(fiber) {
          return shouldErrorImpl(fiber);
        }
        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 setErrorHandler = null;
        var setSuspenseHandler = null;
        {
          var copyWithDeleteImpl = function(obj, path2, index2) {
            var key = path2[index2];
            var updated = isArray2(obj) ? obj.slice() : assign3({}, obj);
            if (index2 + 1 === path2.length) {
              if (isArray2(updated)) {
                updated.splice(key, 1);
              } else {
                delete updated[key];
              }
              return updated;
            }
            updated[key] = copyWithDeleteImpl(obj[key], path2, index2 + 1);
            return updated;
          };
          var copyWithDelete = function(obj, path2) {
            return copyWithDeleteImpl(obj, path2, 0);
          };
          var copyWithRenameImpl = function(obj, oldPath, newPath, index2) {
            var oldKey = oldPath[index2];
            var updated = isArray2(obj) ? obj.slice() : assign3({}, obj);
            if (index2 + 1 === oldPath.length) {
              var newKey = newPath[index2];
              updated[newKey] = updated[oldKey];
              if (isArray2(updated)) {
                updated.splice(oldKey, 1);
              } else {
                delete updated[oldKey];
              }
            } else {
              updated[oldKey] = copyWithRenameImpl(
                // $FlowFixMe number or string is fine here
                obj[oldKey],
                oldPath,
                newPath,
                index2 + 1
              );
            }
            return updated;
          };
          var copyWithRename = function(obj, oldPath, newPath) {
            if (oldPath.length !== newPath.length) {
              warn5("copyWithRename() expects paths of the same length");
              return;
            } else {
              for (var i2 = 0; i2 < newPath.length - 1; i2++) {
                if (oldPath[i2] !== newPath[i2]) {
                  warn5("copyWithRename() expects paths to be the same except for the deepest key");
                  return;
                }
              }
            }
            return copyWithRenameImpl(obj, oldPath, newPath, 0);
          };
          var copyWithSetImpl = function(obj, path2, index2, value) {
            if (index2 >= path2.length) {
              return value;
            }
            var key = path2[index2];
            var updated = isArray2(obj) ? obj.slice() : assign3({}, obj);
            updated[key] = copyWithSetImpl(obj[key], path2, index2 + 1, value);
            return updated;
          };
          var copyWithSet = function(obj, path2, value) {
            return copyWithSetImpl(obj, path2, 0, value);
          };
          var findHook = function(fiber, id2) {
            var currentHook2 = fiber.memoizedState;
            while (currentHook2 !== null && id2 > 0) {
              currentHook2 = currentHook2.next;
              id2--;
            }
            return currentHook2;
          };
          overrideHookState = function(fiber, id2, path2, value) {
            var hook = findHook(fiber, id2);
            if (hook !== null) {
              var newState = copyWithSet(hook.memoizedState, path2, value);
              hook.memoizedState = newState;
              hook.baseState = newState;
              fiber.memoizedProps = assign3({}, fiber.memoizedProps);
              scheduleUpdateOnFiber(fiber, SyncLane, NoTimestamp);
            }
          };
          overrideHookStateDeletePath = function(fiber, id2, path2) {
            var hook = findHook(fiber, id2);
            if (hook !== null) {
              var newState = copyWithDelete(hook.memoizedState, path2);
              hook.memoizedState = newState;
              hook.baseState = newState;
              fiber.memoizedProps = assign3({}, fiber.memoizedProps);
              scheduleUpdateOnFiber(fiber, SyncLane, NoTimestamp);
            }
          };
          overrideHookStateRenamePath = function(fiber, id2, oldPath, newPath) {
            var hook = findHook(fiber, id2);
            if (hook !== null) {
              var newState = copyWithRename(hook.memoizedState, oldPath, newPath);
              hook.memoizedState = newState;
              hook.baseState = newState;
              fiber.memoizedProps = assign3({}, fiber.memoizedProps);
              scheduleUpdateOnFiber(fiber, SyncLane, NoTimestamp);
            }
          };
          overrideProps = function(fiber, path2, value) {
            fiber.pendingProps = copyWithSet(fiber.memoizedProps, path2, value);
            if (fiber.alternate) {
              fiber.alternate.pendingProps = fiber.pendingProps;
            }
            scheduleUpdateOnFiber(fiber, SyncLane, NoTimestamp);
          };
          overridePropsDeletePath = function(fiber, path2) {
            fiber.pendingProps = copyWithDelete(fiber.memoizedProps, path2);
            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);
          };
          setErrorHandler = function(newShouldErrorImpl) {
            shouldErrorImpl = newShouldErrorImpl;
          };
          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,
            setErrorHandler,
            setSuspenseHandler,
            scheduleUpdate,
            currentDispatcherRef: ReactCurrentDispatcher2,
            findHostInstanceByFiber,
            findFiberByHostInstance: findFiberByHostInstance || emptyFindFiberByHostInstance,
            // React Refresh
            findHostInstancesForRefresh,
            scheduleRefresh,
            scheduleRoot,
            setRefreshHandler,
            // Enables DevTools to append owner stacks to error messages in DEV mode.
            getCurrentFiber: getCurrentFiberForDevTools,
            // Enables DevTools to detect reconciler version rather than renderer version
            // which may not match for third party renderers.
            reconcilerVersion: ReactVersion
          });
        }
        exports2.attemptContinuousHydration = attemptContinuousHydration;
        exports2.attemptHydrationAtCurrentPriority = attemptHydrationAtCurrentPriority;
        exports2.attemptSynchronousHydration = attemptSynchronousHydration;
        exports2.batchedUpdates = batchedUpdates;
        exports2.createComponentSelector = createComponentSelector;
        exports2.createContainer = createContainer;
        exports2.createHasPseudoClassSelector = createHasPseudoClassSelector;
        exports2.createHydrationContainer = createHydrationContainer;
        exports2.createPortal = createPortal2;
        exports2.createRoleSelector = createRoleSelector;
        exports2.createTestNameSelector = createTestNameSelector;
        exports2.createTextSelector = createTextSelector;
        exports2.deferredUpdates = deferredUpdates;
        exports2.discreteUpdates = discreteUpdates;
        exports2.findAllNodes = findAllNodes;
        exports2.findBoundingRects = findBoundingRects;
        exports2.findHostInstance = findHostInstance;
        exports2.findHostInstanceWithNoPortals = findHostInstanceWithNoPortals;
        exports2.findHostInstanceWithWarning = findHostInstanceWithWarning;
        exports2.flushControlled = flushControlled;
        exports2.flushPassiveEffects = flushPassiveEffects;
        exports2.flushSync = flushSync;
        exports2.focusWithin = focusWithin;
        exports2.getCurrentUpdatePriority = getCurrentUpdatePriority;
        exports2.getFindAllNodesFailureDescription = getFindAllNodesFailureDescription;
        exports2.getPublicRootInstance = getPublicRootInstance;
        exports2.injectIntoDevTools = injectIntoDevTools;
        exports2.isAlreadyRendering = isAlreadyRendering;
        exports2.observeVisibleRects = observeVisibleRects;
        exports2.registerMutableSourceForHydration = registerMutableSourceForHydration;
        exports2.runWithPriority = runWithPriority;
        exports2.shouldError = shouldError;
        exports2.shouldSuspend = shouldSuspend;
        exports2.updateContainer = updateContainer;
        return exports2;
      };
    }
  }
});

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

// node_modules/debounce/index.js
var require_debounce = __commonJS({
  "node_modules/debounce/index.js"(exports, module) {
    function debounce4(func, wait, immediate) {
      var timeout2, args, context2, timestamp, result;
      if (null == wait)
        wait = 100;
      function later() {
        var last = Date.now() - timestamp;
        if (last < wait && last >= 0) {
          timeout2 = setTimeout(later, wait - last);
        } else {
          timeout2 = null;
          if (!immediate) {
            result = func.apply(context2, args);
            context2 = args = null;
          }
        }
      }
      ;
      var debounced = function() {
        context2 = this;
        args = arguments;
        timestamp = Date.now();
        var callNow = immediate && !timeout2;
        if (!timeout2)
          timeout2 = setTimeout(later, wait);
        if (callNow) {
          result = func.apply(context2, args);
          context2 = args = null;
        }
        return result;
      };
      debounced.clear = function() {
        if (timeout2) {
          clearTimeout(timeout2);
          timeout2 = null;
        }
      };
      debounced.flush = function() {
        if (timeout2) {
          result = func.apply(context2, args);
          context2 = args = null;
          clearTimeout(timeout2);
          timeout2 = null;
        }
      };
      return debounced;
    }
    debounce4.debounce = debounce4;
    module.exports = debounce4;
  }
});

// node_modules/relay-runtime/lib/util/RelayFeatureFlags.js
var require_RelayFeatureFlags2 = __commonJS({
  "node_modules/relay-runtime/lib/util/RelayFeatureFlags.js"(exports, module) {
    "use strict";
    var RelayFeatureFlags = {
      ENABLE_CLIENT_EDGES: false,
      ENABLE_VARIABLE_CONNECTION_KEY: false,
      ENABLE_PARTIAL_RENDERING_DEFAULT: true,
      ENABLE_REACT_FLIGHT_COMPONENT_FIELD: false,
      ENABLE_RELAY_RESOLVERS: false,
      ENABLE_GETFRAGMENTIDENTIFIER_OPTIMIZATION: false,
      ENABLE_FRIENDLY_QUERY_NAME_GQL_URL: false,
      ENABLE_LOAD_QUERY_REQUEST_DEDUPING: true,
      ENABLE_DO_NOT_WRAP_LIVE_QUERY: false,
      ENABLE_NOTIFY_SUBSCRIPTION: false,
      BATCH_ASYNC_MODULE_UPDATES_FN: null,
      ENABLE_CONTAINERS_SUBSCRIBE_ON_COMMIT: false,
      MAX_DATA_ID_LENGTH: null,
      STRING_INTERN_LEVEL: 0,
      USE_REACT_CACHE: false,
      USE_REACT_CACHE_LEGACY_TIMEOUTS: true
    };
    module.exports = RelayFeatureFlags;
  }
});

// node_modules/relay-runtime/lib/util/StringInterner.js
var require_StringInterner2 = __commonJS({
  "node_modules/relay-runtime/lib/util/StringInterner.js"(exports, module) {
    "use strict";
    var internTable = /* @__PURE__ */ new Map();
    var nextIndex = 1;
    var digits = initDigitTable();
    var INTERN_PREFIX = "	";
    var ESCAPE_PREFIX = "\v";
    function initDigitTable() {
      var digits2 = /* @__PURE__ */ new Set();
      for (var i2 = 0; i2 < 10; ++i2) {
        digits2.add(i2.toString());
      }
      return digits2;
    }
    function escape2(str) {
      if (
        // "\t<digit>..." -> "\v\t<digit>..."
        str[0] === INTERN_PREFIX && digits.has(str[1]) || // "\v..." -> "\v\v..."
        str[0] === ESCAPE_PREFIX
      ) {
        return ESCAPE_PREFIX + str;
      }
      return str;
    }
    function intern(str, limit) {
      if (limit == null || str.length < limit) {
        return escape2(str);
      }
      var internedString = internTable.get(str);
      if (internedString != null) {
        return internedString;
      }
      internedString = INTERN_PREFIX + nextIndex++;
      internTable.set(str, internedString);
      return internedString;
    }
    module.exports = {
      intern
    };
  }
});

// node_modules/relay-runtime/lib/store/ClientID.js
var require_ClientID2 = __commonJS({
  "node_modules/relay-runtime/lib/store/ClientID.js"(exports, module) {
    "use strict";
    var RelayFeatureFlags = require_RelayFeatureFlags2();
    var _require = require_StringInterner2();
    var intern = _require.intern;
    var PREFIX = "client:";
    function generateClientID(id2, storageKey, index) {
      var internedId = RelayFeatureFlags.STRING_INTERN_LEVEL <= 0 ? id2 : intern(id2, RelayFeatureFlags.MAX_DATA_ID_LENGTH);
      var key = internedId + ":" + storageKey;
      if (index != null) {
        key += ":" + index;
      }
      if (key.indexOf(PREFIX) !== 0) {
        key = PREFIX + key;
      }
      return key;
    }
    function isClientID(id2) {
      return id2.indexOf(PREFIX) === 0;
    }
    var localID = 0;
    function generateUniqueClientID() {
      return "".concat(PREFIX, "local:").concat(localID++);
    }
    function generateClientObjectClientID(typename, localId) {
      return "".concat(PREFIX).concat(typename, ":").concat(localId);
    }
    module.exports = {
      generateClientID,
      generateClientObjectClientID,
      generateUniqueClientID,
      isClientID
    };
  }
});

// node_modules/relay-runtime/lib/util/RelayDefaultHandleKey.js
var require_RelayDefaultHandleKey2 = __commonJS({
  "node_modules/relay-runtime/lib/util/RelayDefaultHandleKey.js"(exports, module) {
    "use strict";
    module.exports = {
      DEFAULT_HANDLE_KEY: ""
    };
  }
});

// node_modules/relay-runtime/lib/util/getRelayHandleKey.js
var require_getRelayHandleKey2 = __commonJS({
  "node_modules/relay-runtime/lib/util/getRelayHandleKey.js"(exports, module) {
    "use strict";
    var _require = require_RelayDefaultHandleKey2();
    var DEFAULT_HANDLE_KEY = _require.DEFAULT_HANDLE_KEY;
    var invariant3 = require_browser();
    function getRelayHandleKey(handleName, key, fieldName) {
      if (key && key !== DEFAULT_HANDLE_KEY) {
        return "__".concat(key, "_").concat(handleName);
      }
      !(fieldName != null) ? true ? invariant3(false, "getRelayHandleKey: Expected either `fieldName` or `key` in `handle` to be provided") : invariant3(false) : void 0;
      return "__".concat(fieldName, "_").concat(handleName);
    }
    module.exports = getRelayHandleKey;
  }
});

// node_modules/relay-runtime/lib/util/RelayConcreteNode.js
var require_RelayConcreteNode2 = __commonJS({
  "node_modules/relay-runtime/lib/util/RelayConcreteNode.js"(exports, module) {
    "use strict";
    var RelayConcreteNode = {
      ACTOR_CHANGE: "ActorChange",
      CONDITION: "Condition",
      CLIENT_COMPONENT: "ClientComponent",
      CLIENT_EDGE_TO_SERVER_OBJECT: "ClientEdgeToServerObject",
      CLIENT_EDGE_TO_CLIENT_OBJECT: "ClientEdgeToClientObject",
      CLIENT_EXTENSION: "ClientExtension",
      DEFER: "Defer",
      CONNECTION: "Connection",
      FLIGHT_FIELD: "FlightField",
      FRAGMENT: "Fragment",
      FRAGMENT_SPREAD: "FragmentSpread",
      INLINE_DATA_FRAGMENT_SPREAD: "InlineDataFragmentSpread",
      INLINE_DATA_FRAGMENT: "InlineDataFragment",
      INLINE_FRAGMENT: "InlineFragment",
      LINKED_FIELD: "LinkedField",
      LINKED_HANDLE: "LinkedHandle",
      LITERAL: "Literal",
      LIST_VALUE: "ListValue",
      LOCAL_ARGUMENT: "LocalArgument",
      MODULE_IMPORT: "ModuleImport",
      ALIASED_FRAGMENT_SPREAD: "AliasedFragmentSpread",
      ALIASED_INLINE_FRAGMENT_SPREAD: "AliasedInlineFragmentSpread",
      RELAY_RESOLVER: "RelayResolver",
      RELAY_LIVE_RESOLVER: "RelayLiveResolver",
      REQUIRED_FIELD: "RequiredField",
      OBJECT_VALUE: "ObjectValue",
      OPERATION: "Operation",
      REQUEST: "Request",
      ROOT_ARGUMENT: "RootArgument",
      SCALAR_FIELD: "ScalarField",
      SCALAR_HANDLE: "ScalarHandle",
      SPLIT_OPERATION: "SplitOperation",
      STREAM: "Stream",
      TYPE_DISCRIMINATOR: "TypeDiscriminator",
      UPDATABLE_QUERY: "UpdatableQuery",
      VARIABLE: "Variable"
    };
    module.exports = RelayConcreteNode;
  }
});

// node_modules/relay-runtime/lib/util/stableCopy.js
var require_stableCopy2 = __commonJS({
  "node_modules/relay-runtime/lib/util/stableCopy.js"(exports, module) {
    "use strict";
    function stableCopy(value) {
      if (!value || typeof value !== "object") {
        return value;
      }
      if (Array.isArray(value)) {
        return value.map(stableCopy);
      }
      var keys4 = Object.keys(value).sort();
      var stable = {};
      for (var i2 = 0; i2 < keys4.length; i2++) {
        stable[keys4[i2]] = stableCopy(value[keys4[i2]]);
      }
      return stable;
    }
    module.exports = stableCopy;
  }
});

// node_modules/relay-runtime/lib/store/RelayStoreUtils.js
var require_RelayStoreUtils2 = __commonJS({
  "node_modules/relay-runtime/lib/store/RelayStoreUtils.js"(exports, module) {
    "use strict";
    var _interopRequireDefault = require_interopRequireDefault()["default"];
    var _toConsumableArray22 = _interopRequireDefault(require_toConsumableArray());
    var getRelayHandleKey = require_getRelayHandleKey2();
    var RelayConcreteNode = require_RelayConcreteNode2();
    var stableCopy = require_stableCopy2();
    var invariant3 = require_browser();
    var VARIABLE = RelayConcreteNode.VARIABLE;
    var LITERAL = RelayConcreteNode.LITERAL;
    var OBJECT_VALUE = RelayConcreteNode.OBJECT_VALUE;
    var LIST_VALUE = RelayConcreteNode.LIST_VALUE;
    var MODULE_COMPONENT_KEY_PREFIX = "__module_component_";
    var MODULE_OPERATION_KEY_PREFIX = "__module_operation_";
    function getArgumentValue(arg, variables) {
      if (arg.kind === VARIABLE) {
        return getStableVariableValue(arg.variableName, variables);
      } else if (arg.kind === LITERAL) {
        return arg.value;
      } else if (arg.kind === OBJECT_VALUE) {
        var value = {};
        arg.fields.forEach(function(field) {
          value[field.name] = getArgumentValue(field, variables);
        });
        return value;
      } else if (arg.kind === LIST_VALUE) {
        var _value = [];
        arg.items.forEach(function(item) {
          item != null ? _value.push(getArgumentValue(item, variables)) : null;
        });
        return _value;
      }
    }
    function getArgumentValues(args, variables) {
      var values2 = {};
      args.forEach(function(arg) {
        values2[arg.name] = getArgumentValue(arg, variables);
      });
      return values2;
    }
    function getHandleStorageKey(handleField, variables) {
      var dynamicKey = handleField.dynamicKey, handle = handleField.handle, key = handleField.key, name2 = handleField.name, args = handleField.args, filters = handleField.filters;
      var handleName = getRelayHandleKey(handle, key, name2);
      var filterArgs = null;
      if (args && filters && args.length !== 0 && filters.length !== 0) {
        filterArgs = args.filter(function(arg) {
          return filters.indexOf(arg.name) > -1;
        });
      }
      if (dynamicKey) {
        filterArgs = filterArgs != null ? [dynamicKey].concat((0, _toConsumableArray22["default"])(filterArgs)) : [dynamicKey];
      }
      if (filterArgs === null) {
        return handleName;
      } else {
        return formatStorageKey(handleName, getArgumentValues(filterArgs, variables));
      }
    }
    function getStorageKey(field, variables) {
      if (field.storageKey) {
        return field.storageKey;
      }
      var args = getArguments(field);
      var name2 = field.name;
      return args && args.length !== 0 ? formatStorageKey(name2, getArgumentValues(args, variables)) : name2;
    }
    function getArguments(field) {
      if (field.kind === "RelayResolver" || field.kind === "RelayLiveResolver") {
        var _field$fragment2;
        if (field.args == null) {
          var _field$fragment;
          return (_field$fragment = field.fragment) === null || _field$fragment === void 0 ? void 0 : _field$fragment.args;
        }
        if (((_field$fragment2 = field.fragment) === null || _field$fragment2 === void 0 ? void 0 : _field$fragment2.args) == null) {
          return field.args;
        }
        return field.args.concat(field.fragment.args);
      }
      var args = typeof field.args === "undefined" ? void 0 : field.args;
      return args;
    }
    function getStableStorageKey(name2, args) {
      return formatStorageKey(name2, stableCopy(args));
    }
    function formatStorageKey(name2, argValues) {
      if (!argValues) {
        return name2;
      }
      var values2 = [];
      for (var argName in argValues) {
        if (argValues.hasOwnProperty(argName)) {
          var value = argValues[argName];
          if (value != null) {
            var _JSON$stringify;
            values2.push(argName + ":" + ((_JSON$stringify = JSON.stringify(value)) !== null && _JSON$stringify !== void 0 ? _JSON$stringify : "undefined"));
          }
        }
      }
      return values2.length === 0 ? name2 : name2 + "(".concat(values2.join(","), ")");
    }
    function getStableVariableValue(name2, variables) {
      !variables.hasOwnProperty(name2) ? true ? invariant3(false, "getVariableValue(): Undefined variable `%s`.", name2) : invariant3(false) : void 0;
      return stableCopy(variables[name2]);
    }
    function getModuleComponentKey(documentName) {
      return "".concat(MODULE_COMPONENT_KEY_PREFIX).concat(documentName);
    }
    function getModuleOperationKey(documentName) {
      return "".concat(MODULE_OPERATION_KEY_PREFIX).concat(documentName);
    }
    var RelayStoreUtils = {
      ACTOR_IDENTIFIER_KEY: "__actorIdentifier",
      CLIENT_EDGE_TRAVERSAL_PATH: "__clientEdgeTraversalPath",
      FRAGMENTS_KEY: "__fragments",
      FRAGMENT_OWNER_KEY: "__fragmentOwner",
      FRAGMENT_PROP_NAME_KEY: "__fragmentPropName",
      MODULE_COMPONENT_KEY: "__module_component",
      // alias returned by Reader
      ID_KEY: "__id",
      REF_KEY: "__ref",
      REFS_KEY: "__refs",
      ROOT_ID: "client:root",
      ROOT_TYPE: "__Root",
      TYPENAME_KEY: "__typename",
      INVALIDATED_AT_KEY: "__invalidated_at",
      IS_WITHIN_UNMATCHED_TYPE_REFINEMENT: "__isWithinUnmatchedTypeRefinement",
      RELAY_RESOLVER_VALUE_KEY: "__resolverValue",
      RELAY_RESOLVER_INVALIDATION_KEY: "__resolverValueMayBeInvalid",
      RELAY_RESOLVER_SNAPSHOT_KEY: "__resolverSnapshot",
      RELAY_RESOLVER_ERROR_KEY: "__resolverError",
      formatStorageKey,
      getArgumentValue,
      getArgumentValues,
      getHandleStorageKey,
      getStorageKey,
      getStableStorageKey,
      getModuleComponentKey,
      getModuleOperationKey
    };
    module.exports = RelayStoreUtils;
  }
});

// node_modules/relay-runtime/lib/handlers/connection/ConnectionInterface.js
var require_ConnectionInterface2 = __commonJS({
  "node_modules/relay-runtime/lib/handlers/connection/ConnectionInterface.js"(exports, module) {
    "use strict";
    var CONNECTION_CALLS = {
      after: true,
      before: true,
      find: true,
      first: true,
      last: true,
      surrounds: true
    };
    var config2 = {
      CURSOR: "cursor",
      EDGES: "edges",
      END_CURSOR: "endCursor",
      HAS_NEXT_PAGE: "hasNextPage",
      HAS_PREV_PAGE: "hasPreviousPage",
      NODE: "node",
      PAGE_INFO_TYPE: "PageInfo",
      PAGE_INFO: "pageInfo",
      START_CURSOR: "startCursor"
    };
    var ConnectionInterface = {
      inject: function inject(newConfig) {
        config2 = newConfig;
      },
      get: function get3() {
        return config2;
      },
      /**
       * Checks whether a call exists strictly to encode which parts of a connection
       * to fetch. Fields that only differ by connection call values should have the
       * same identity.
       */
      isConnectionCall: function isConnectionCall(call) {
        return CONNECTION_CALLS.hasOwnProperty(call.name);
      }
    };
    module.exports = ConnectionInterface;
  }
});

// node_modules/relay-runtime/lib/handlers/connection/ConnectionHandler.js
var require_ConnectionHandler2 = __commonJS({
  "node_modules/relay-runtime/lib/handlers/connection/ConnectionHandler.js"(exports, module) {
    "use strict";
    var _require = require_ClientID2();
    var generateClientID = _require.generateClientID;
    var _require2 = require_RelayStoreUtils2();
    var getStableStorageKey = _require2.getStableStorageKey;
    var getRelayHandleKey = require_getRelayHandleKey2();
    var ConnectionInterface = require_ConnectionInterface2();
    var invariant3 = require_browser();
    var warning2 = require_warning();
    var CONNECTION = "connection";
    var NEXT_EDGE_INDEX = "__connection_next_edge_index";
    function update(store, payload) {
      var record = store.get(payload.dataID);
      if (!record) {
        return;
      }
      var _ConnectionInterface$ = ConnectionInterface.get(), EDGES = _ConnectionInterface$.EDGES, END_CURSOR = _ConnectionInterface$.END_CURSOR, HAS_NEXT_PAGE = _ConnectionInterface$.HAS_NEXT_PAGE, HAS_PREV_PAGE = _ConnectionInterface$.HAS_PREV_PAGE, PAGE_INFO = _ConnectionInterface$.PAGE_INFO, PAGE_INFO_TYPE = _ConnectionInterface$.PAGE_INFO_TYPE, START_CURSOR = _ConnectionInterface$.START_CURSOR;
      var serverConnection = record.getLinkedRecord(payload.fieldKey);
      var serverPageInfo = serverConnection && serverConnection.getLinkedRecord(PAGE_INFO);
      if (!serverConnection) {
        record.setValue(null, payload.handleKey);
        return;
      }
      var clientConnectionID = generateClientID(record.getDataID(), payload.handleKey);
      var clientConnectionField = record.getLinkedRecord(payload.handleKey);
      var clientConnection = clientConnectionField !== null && clientConnectionField !== void 0 ? clientConnectionField : store.get(clientConnectionID);
      var clientPageInfo = clientConnection && clientConnection.getLinkedRecord(PAGE_INFO);
      if (!clientConnection) {
        var connection = store.create(clientConnectionID, serverConnection.getType());
        connection.setValue(0, NEXT_EDGE_INDEX);
        connection.copyFieldsFrom(serverConnection);
        var serverEdges = serverConnection.getLinkedRecords(EDGES);
        if (serverEdges) {
          serverEdges = serverEdges.map(function(edge) {
            return buildConnectionEdge(store, connection, edge);
          });
          connection.setLinkedRecords(serverEdges, EDGES);
        }
        record.setLinkedRecord(connection, payload.handleKey);
        clientPageInfo = store.create(generateClientID(connection.getDataID(), PAGE_INFO), PAGE_INFO_TYPE);
        clientPageInfo.setValue(false, HAS_NEXT_PAGE);
        clientPageInfo.setValue(false, HAS_PREV_PAGE);
        clientPageInfo.setValue(null, END_CURSOR);
        clientPageInfo.setValue(null, START_CURSOR);
        if (serverPageInfo) {
          clientPageInfo.copyFieldsFrom(serverPageInfo);
        }
        connection.setLinkedRecord(clientPageInfo, PAGE_INFO);
      } else {
        if (clientConnectionField == null) {
          record.setLinkedRecord(clientConnection, payload.handleKey);
        }
        var _connection = clientConnection;
        var _serverEdges = serverConnection.getLinkedRecords(EDGES);
        if (_serverEdges) {
          _serverEdges = _serverEdges.map(function(edge) {
            return buildConnectionEdge(store, _connection, edge);
          });
        }
        var prevEdges = _connection.getLinkedRecords(EDGES);
        var prevPageInfo = _connection.getLinkedRecord(PAGE_INFO);
        _connection.copyFieldsFrom(serverConnection);
        if (prevEdges) {
          _connection.setLinkedRecords(prevEdges, EDGES);
        }
        if (prevPageInfo) {
          _connection.setLinkedRecord(prevPageInfo, PAGE_INFO);
        }
        var nextEdges = [];
        var args = payload.args;
        if (prevEdges && _serverEdges) {
          if (args.after != null) {
            if (clientPageInfo && args.after === clientPageInfo.getValue(END_CURSOR)) {
              var nodeIDs = /* @__PURE__ */ new Set();
              mergeEdges(prevEdges, nextEdges, nodeIDs);
              mergeEdges(_serverEdges, nextEdges, nodeIDs);
            } else {
              true ? warning2(false, "Relay: Unexpected after cursor `%s`, edges must be fetched from the end of the list (`%s`).", args.after, clientPageInfo && clientPageInfo.getValue(END_CURSOR)) : void 0;
              return;
            }
          } else if (args.before != null) {
            if (clientPageInfo && args.before === clientPageInfo.getValue(START_CURSOR)) {
              var _nodeIDs = /* @__PURE__ */ new Set();
              mergeEdges(_serverEdges, nextEdges, _nodeIDs);
              mergeEdges(prevEdges, nextEdges, _nodeIDs);
            } else {
              true ? warning2(false, "Relay: Unexpected before cursor `%s`, edges must be fetched from the beginning of the list (`%s`).", args.before, clientPageInfo && clientPageInfo.getValue(START_CURSOR)) : void 0;
              return;
            }
          } else {
            nextEdges = _serverEdges;
          }
        } else if (_serverEdges) {
          nextEdges = _serverEdges;
        } else {
          nextEdges = prevEdges;
        }
        if (nextEdges != null && nextEdges !== prevEdges) {
          _connection.setLinkedRecords(nextEdges, EDGES);
        }
        if (clientPageInfo && serverPageInfo) {
          if (args.after == null && args.before == null) {
            clientPageInfo.copyFieldsFrom(serverPageInfo);
          } else if (args.before != null || args.after == null && args.last) {
            clientPageInfo.setValue(!!serverPageInfo.getValue(HAS_PREV_PAGE), HAS_PREV_PAGE);
            var startCursor = serverPageInfo.getValue(START_CURSOR);
            if (typeof startCursor === "string") {
              clientPageInfo.setValue(startCursor, START_CURSOR);
            }
          } else if (args.after != null || args.before == null && args.first) {
            clientPageInfo.setValue(!!serverPageInfo.getValue(HAS_NEXT_PAGE), HAS_NEXT_PAGE);
            var endCursor = serverPageInfo.getValue(END_CURSOR);
            if (typeof endCursor === "string") {
              clientPageInfo.setValue(endCursor, END_CURSOR);
            }
          }
        }
      }
    }
    function getConnection(record, key, filters) {
      var handleKey = getRelayHandleKey(CONNECTION, key, null);
      return record.getLinkedRecord(handleKey, filters);
    }
    function getConnectionID(recordID, key, filters) {
      var handleKey = getRelayHandleKey(CONNECTION, key, null);
      var storageKey = getStableStorageKey(handleKey, filters);
      return generateClientID(recordID, storageKey);
    }
    function insertEdgeAfter(record, newEdge, cursor3) {
      var _ConnectionInterface$2 = ConnectionInterface.get(), CURSOR = _ConnectionInterface$2.CURSOR, EDGES = _ConnectionInterface$2.EDGES;
      var edges = record.getLinkedRecords(EDGES);
      if (!edges) {
        record.setLinkedRecords([newEdge], EDGES);
        return;
      }
      var nextEdges;
      if (cursor3 == null) {
        nextEdges = edges.concat(newEdge);
      } else {
        nextEdges = [];
        var foundCursor = false;
        for (var ii = 0; ii < edges.length; ii++) {
          var edge = edges[ii];
          nextEdges.push(edge);
          if (edge == null) {
            continue;
          }
          var edgeCursor = edge.getValue(CURSOR);
          if (cursor3 === edgeCursor) {
            nextEdges.push(newEdge);
            foundCursor = true;
          }
        }
        if (!foundCursor) {
          nextEdges.push(newEdge);
        }
      }
      record.setLinkedRecords(nextEdges, EDGES);
    }
    function createEdge(store, record, node56, edgeType) {
      var _ConnectionInterface$3 = ConnectionInterface.get(), NODE = _ConnectionInterface$3.NODE;
      var edgeID = generateClientID(record.getDataID(), node56.getDataID());
      var edge = store.get(edgeID);
      if (!edge) {
        edge = store.create(edgeID, edgeType);
      }
      edge.setLinkedRecord(node56, NODE);
      if (edge.getValue("cursor") == null) {
        edge.setValue(null, "cursor");
      }
      return edge;
    }
    function insertEdgeBefore(record, newEdge, cursor3) {
      var _ConnectionInterface$4 = ConnectionInterface.get(), CURSOR = _ConnectionInterface$4.CURSOR, EDGES = _ConnectionInterface$4.EDGES;
      var edges = record.getLinkedRecords(EDGES);
      if (!edges) {
        record.setLinkedRecords([newEdge], EDGES);
        return;
      }
      var nextEdges;
      if (cursor3 == null) {
        nextEdges = [newEdge].concat(edges);
      } else {
        nextEdges = [];
        var foundCursor = false;
        for (var ii = 0; ii < edges.length; ii++) {
          var edge = edges[ii];
          if (edge != null) {
            var edgeCursor = edge.getValue(CURSOR);
            if (cursor3 === edgeCursor) {
              nextEdges.push(newEdge);
              foundCursor = true;
            }
          }
          nextEdges.push(edge);
        }
        if (!foundCursor) {
          nextEdges.unshift(newEdge);
        }
      }
      record.setLinkedRecords(nextEdges, EDGES);
    }
    function deleteNode(record, nodeID) {
      var _ConnectionInterface$5 = ConnectionInterface.get(), EDGES = _ConnectionInterface$5.EDGES, NODE = _ConnectionInterface$5.NODE;
      var edges = record.getLinkedRecords(EDGES);
      if (!edges) {
        return;
      }
      var nextEdges;
      for (var ii = 0; ii < edges.length; ii++) {
        var edge = edges[ii];
        var node56 = edge && edge.getLinkedRecord(NODE);
        if (node56 != null && node56.getDataID() === nodeID) {
          if (nextEdges === void 0) {
            nextEdges = edges.slice(0, ii);
          }
        } else if (nextEdges !== void 0) {
          nextEdges.push(edge);
        }
      }
      if (nextEdges !== void 0) {
        record.setLinkedRecords(nextEdges, EDGES);
      }
    }
    function buildConnectionEdge(store, connection, edge) {
      if (edge == null) {
        return edge;
      }
      var _ConnectionInterface$6 = ConnectionInterface.get(), EDGES = _ConnectionInterface$6.EDGES;
      var edgeIndex = connection.getValue(NEXT_EDGE_INDEX);
      !(typeof edgeIndex === "number") ? true ? invariant3(false, "ConnectionHandler: Expected %s to be a number, got `%s`.", NEXT_EDGE_INDEX, edgeIndex) : invariant3(false) : void 0;
      var edgeID = generateClientID(connection.getDataID(), EDGES, edgeIndex);
      var connectionEdge = store.create(edgeID, edge.getType());
      connectionEdge.copyFieldsFrom(edge);
      if (connectionEdge.getValue("cursor") == null) {
        connectionEdge.setValue(null, "cursor");
      }
      connection.setValue(edgeIndex + 1, NEXT_EDGE_INDEX);
      return connectionEdge;
    }
    function mergeEdges(sourceEdges, targetEdges, nodeIDs) {
      var _ConnectionInterface$7 = ConnectionInterface.get(), NODE = _ConnectionInterface$7.NODE;
      for (var ii = 0; ii < sourceEdges.length; ii++) {
        var edge = sourceEdges[ii];
        if (!edge) {
          continue;
        }
        var node56 = edge.getLinkedRecord(NODE);
        var nodeID = node56 && node56.getDataID();
        if (nodeID) {
          if (nodeIDs.has(nodeID)) {
            continue;
          }
          nodeIDs.add(nodeID);
        }
        targetEdges.push(edge);
      }
    }
    module.exports = {
      buildConnectionEdge,
      createEdge,
      deleteNode,
      getConnection,
      getConnectionID,
      insertEdgeAfter,
      insertEdgeBefore,
      update
    };
  }
});

// node_modules/relay-runtime/lib/handlers/connection/MutationHandlers.js
var require_MutationHandlers2 = __commonJS({
  "node_modules/relay-runtime/lib/handlers/connection/MutationHandlers.js"(exports, module) {
    "use strict";
    var _interopRequireDefault = require_interopRequireDefault()["default"];
    var _createForOfIteratorHelper2 = _interopRequireDefault(require_createForOfIteratorHelper());
    var ConnectionHandler = require_ConnectionHandler2();
    var ConnectionInterface = require_ConnectionInterface2();
    var invariant3 = require_browser();
    var warning2 = require_warning();
    var DeleteRecordHandler = {
      update: function update(store, payload) {
        var record = store.get(payload.dataID);
        if (record != null) {
          var idOrIds = record.getValue(payload.fieldKey);
          if (typeof idOrIds === "string") {
            store["delete"](idOrIds);
          } else if (Array.isArray(idOrIds)) {
            idOrIds.forEach(function(id2) {
              if (typeof id2 === "string") {
                store["delete"](id2);
              }
            });
          }
        }
      }
    };
    var DeleteEdgeHandler = {
      update: function update(store, payload) {
        var record = store.get(payload.dataID);
        if (record == null) {
          return;
        }
        var connections = payload.handleArgs.connections;
        !(connections != null) ? true ? invariant3(false, "MutationHandlers: Expected connection IDs to be specified.") : invariant3(false) : void 0;
        var idOrIds = record.getValue(payload.fieldKey);
        var idList = Array.isArray(idOrIds) ? idOrIds : [idOrIds];
        idList.forEach(function(id2) {
          if (typeof id2 === "string") {
            var _iterator = (0, _createForOfIteratorHelper2["default"])(connections), _step;
            try {
              for (_iterator.s(); !(_step = _iterator.n()).done; ) {
                var connectionID = _step.value;
                var connection = store.get(connectionID);
                if (connection == null) {
                  true ? warning2(false, "[Relay][Mutation] The connection with id '".concat(connectionID, "' doesn't exist.")) : void 0;
                  continue;
                }
                ConnectionHandler.deleteNode(connection, id2);
              }
            } catch (err) {
              _iterator.e(err);
            } finally {
              _iterator.f();
            }
          }
        });
      }
    };
    var AppendEdgeHandler = {
      update: edgeUpdater(ConnectionHandler.insertEdgeAfter)
    };
    var PrependEdgeHandler = {
      update: edgeUpdater(ConnectionHandler.insertEdgeBefore)
    };
    var AppendNodeHandler = {
      update: nodeUpdater(ConnectionHandler.insertEdgeAfter)
    };
    var PrependNodeHandler = {
      update: nodeUpdater(ConnectionHandler.insertEdgeBefore)
    };
    function edgeUpdater(insertFn) {
      return function(store, payload) {
        var _serverEdges;
        var record = store.get(payload.dataID);
        if (record == null) {
          return;
        }
        var connections = payload.handleArgs.connections;
        !(connections != null) ? true ? invariant3(false, "MutationHandlers: Expected connection IDs to be specified.") : invariant3(false) : void 0;
        var singleServerEdge, serverEdges;
        try {
          singleServerEdge = record.getLinkedRecord(payload.fieldKey);
        } catch (_unused) {
        }
        if (!singleServerEdge) {
          try {
            serverEdges = record.getLinkedRecords(payload.fieldKey);
          } catch (_unused2) {
          }
        }
        if (singleServerEdge == null && serverEdges == null) {
          true ? warning2(false, "MutationHandlers: Expected the server edge to be non-null.") : void 0;
          return;
        }
        var _ConnectionInterface$ = ConnectionInterface.get(), NODE = _ConnectionInterface$.NODE, EDGES = _ConnectionInterface$.EDGES;
        var serverEdgeList = (_serverEdges = serverEdges) !== null && _serverEdges !== void 0 ? _serverEdges : [singleServerEdge];
        var _iterator2 = (0, _createForOfIteratorHelper2["default"])(serverEdgeList), _step2;
        try {
          var _loop = function _loop2() {
            var serverEdge = _step2.value;
            if (serverEdge == null) {
              return "continue";
            }
            var serverNode = serverEdge.getLinkedRecord("node");
            if (!serverNode) {
              return "continue";
            }
            var serverNodeId = serverNode.getDataID();
            var _iterator3 = (0, _createForOfIteratorHelper2["default"])(connections), _step3;
            try {
              for (_iterator3.s(); !(_step3 = _iterator3.n()).done; ) {
                var connectionID = _step3.value;
                var connection = store.get(connectionID);
                if (connection == null) {
                  true ? warning2(false, "[Relay][Mutation] The connection with id '".concat(connectionID, "' doesn't exist.")) : void 0;
                  continue;
                }
                var nodeAlreadyExistsInConnection = (_connection$getLinked = connection.getLinkedRecords(EDGES)) === null || _connection$getLinked === void 0 ? void 0 : _connection$getLinked.some(function(edge) {
                  var _edge$getLinkedRecord;
                  return (edge === null || edge === void 0 ? void 0 : (_edge$getLinkedRecord = edge.getLinkedRecord(NODE)) === null || _edge$getLinkedRecord === void 0 ? void 0 : _edge$getLinkedRecord.getDataID()) === serverNodeId;
                });
                if (nodeAlreadyExistsInConnection) {
                  continue;
                }
                var clientEdge = ConnectionHandler.buildConnectionEdge(store, connection, serverEdge);
                !(clientEdge != null) ? true ? invariant3(false, "MutationHandlers: Failed to build the edge.") : invariant3(false) : void 0;
                insertFn(connection, clientEdge);
              }
            } catch (err) {
              _iterator3.e(err);
            } finally {
              _iterator3.f();
            }
          };
          for (_iterator2.s(); !(_step2 = _iterator2.n()).done; ) {
            var _connection$getLinked;
            var _ret = _loop();
            if (_ret === "continue")
              continue;
          }
        } catch (err) {
          _iterator2.e(err);
        } finally {
          _iterator2.f();
        }
      };
    }
    function nodeUpdater(insertFn) {
      return function(store, payload) {
        var _serverNodes;
        var record = store.get(payload.dataID);
        if (record == null) {
          return;
        }
        var _payload$handleArgs = payload.handleArgs, connections = _payload$handleArgs.connections, edgeTypeName = _payload$handleArgs.edgeTypeName;
        !(connections != null) ? true ? invariant3(false, "MutationHandlers: Expected connection IDs to be specified.") : invariant3(false) : void 0;
        !(edgeTypeName != null) ? true ? invariant3(false, "MutationHandlers: Expected edge typename to be specified.") : invariant3(false) : void 0;
        var singleServerNode;
        var serverNodes;
        try {
          singleServerNode = record.getLinkedRecord(payload.fieldKey);
        } catch (_unused3) {
        }
        if (!singleServerNode) {
          try {
            serverNodes = record.getLinkedRecords(payload.fieldKey);
          } catch (_unused4) {
          }
        }
        if (singleServerNode == null && serverNodes == null) {
          true ? warning2(false, "MutationHandlers: Expected target node to exist.") : void 0;
          return;
        }
        var _ConnectionInterface$2 = ConnectionInterface.get(), NODE = _ConnectionInterface$2.NODE, EDGES = _ConnectionInterface$2.EDGES;
        var serverNodeList = (_serverNodes = serverNodes) !== null && _serverNodes !== void 0 ? _serverNodes : [singleServerNode];
        var _iterator4 = (0, _createForOfIteratorHelper2["default"])(serverNodeList), _step4;
        try {
          var _loop2 = function _loop22() {
            var serverNode = _step4.value;
            if (serverNode == null) {
              return "continue";
            }
            var serverNodeId = serverNode.getDataID();
            var _iterator5 = (0, _createForOfIteratorHelper2["default"])(connections), _step5;
            try {
              for (_iterator5.s(); !(_step5 = _iterator5.n()).done; ) {
                var connectionID = _step5.value;
                var connection = store.get(connectionID);
                if (connection == null) {
                  true ? warning2(false, "[Relay][Mutation] The connection with id '".concat(connectionID, "' doesn't exist.")) : void 0;
                  continue;
                }
                var nodeAlreadyExistsInConnection = (_connection$getLinked2 = connection.getLinkedRecords(EDGES)) === null || _connection$getLinked2 === void 0 ? void 0 : _connection$getLinked2.some(function(edge) {
                  var _edge$getLinkedRecord2;
                  return (edge === null || edge === void 0 ? void 0 : (_edge$getLinkedRecord2 = edge.getLinkedRecord(NODE)) === null || _edge$getLinkedRecord2 === void 0 ? void 0 : _edge$getLinkedRecord2.getDataID()) === serverNodeId;
                });
                if (nodeAlreadyExistsInConnection) {
                  continue;
                }
                var clientEdge = ConnectionHandler.createEdge(store, connection, serverNode, edgeTypeName);
                !(clientEdge != null) ? true ? invariant3(false, "MutationHandlers: Failed to build the edge.") : invariant3(false) : void 0;
                insertFn(connection, clientEdge);
              }
            } catch (err) {
              _iterator5.e(err);
            } finally {
              _iterator5.f();
            }
          };
          for (_iterator4.s(); !(_step4 = _iterator4.n()).done; ) {
            var _connection$getLinked2;
            var _ret2 = _loop2();
            if (_ret2 === "continue")
              continue;
          }
        } catch (err) {
          _iterator4.e(err);
        } finally {
          _iterator4.f();
        }
      };
    }
    module.exports = {
      AppendEdgeHandler,
      DeleteRecordHandler,
      PrependEdgeHandler,
      AppendNodeHandler,
      PrependNodeHandler,
      DeleteEdgeHandler
    };
  }
});

// node_modules/relay-runtime/lib/handlers/RelayDefaultHandlerProvider.js
var require_RelayDefaultHandlerProvider2 = __commonJS({
  "node_modules/relay-runtime/lib/handlers/RelayDefaultHandlerProvider.js"(exports, module) {
    "use strict";
    var ConnectionHandler = require_ConnectionHandler2();
    var MutationHandlers = require_MutationHandlers2();
    var invariant3 = require_browser();
    function RelayDefaultHandlerProvider(handle) {
      switch (handle) {
        case "connection":
          return ConnectionHandler;
        case "deleteRecord":
          return MutationHandlers.DeleteRecordHandler;
        case "deleteEdge":
          return MutationHandlers.DeleteEdgeHandler;
        case "appendEdge":
          return MutationHandlers.AppendEdgeHandler;
        case "prependEdge":
          return MutationHandlers.PrependEdgeHandler;
        case "appendNode":
          return MutationHandlers.AppendNodeHandler;
        case "prependNode":
          return MutationHandlers.PrependNodeHandler;
      }
      true ? true ? invariant3(false, "RelayDefaultHandlerProvider: No handler provided for `%s`.", handle) : invariant3(false) : void 0;
    }
    module.exports = RelayDefaultHandlerProvider;
  }
});

// node_modules/relay-runtime/lib/query/GraphQLTag.js
var require_GraphQLTag2 = __commonJS({
  "node_modules/relay-runtime/lib/query/GraphQLTag.js"(exports, module) {
    "use strict";
    var RelayConcreteNode = require_RelayConcreteNode2();
    var invariant3 = require_browser();
    var warning2 = require_warning();
    function graphql40(strings) {
      true ? true ? invariant3(false, "graphql: Unexpected invocation at runtime. Either the Babel transform was not set up, or it failed to identify this call site. Make sure it is being used verbatim as `graphql`. Note also that there cannot be a space between graphql and the backtick that follows.") : invariant3(false) : void 0;
    }
    function getNode(taggedNode) {
      var node56 = taggedNode;
      if (typeof node56 === "function") {
        node56 = node56();
        true ? warning2(false, "RelayGraphQLTag: node `%s` unexpectedly wrapped in a function.", node56.kind === "Fragment" ? node56.name : node56.operation.name) : void 0;
      } else if (node56["default"]) {
        node56 = node56["default"];
      }
      return node56;
    }
    function isFragment2(node56) {
      var fragment2 = getNode(node56);
      return typeof fragment2 === "object" && fragment2 !== null && fragment2.kind === RelayConcreteNode.FRAGMENT;
    }
    function isRequest(node56) {
      var request = getNode(node56);
      return typeof request === "object" && request !== null && request.kind === RelayConcreteNode.REQUEST;
    }
    function isUpdatableQuery(node56) {
      var updatableQuery = getNode(node56);
      return typeof updatableQuery === "object" && updatableQuery !== null && updatableQuery.kind === RelayConcreteNode.UPDATABLE_QUERY;
    }
    function isInlineDataFragment(node56) {
      var fragment2 = getNode(node56);
      return typeof fragment2 === "object" && fragment2 !== null && fragment2.kind === RelayConcreteNode.INLINE_DATA_FRAGMENT;
    }
    function getFragment(taggedNode) {
      var fragment2 = getNode(taggedNode);
      !isFragment2(fragment2) ? true ? invariant3(false, "GraphQLTag: Expected a fragment, got `%s`.", JSON.stringify(fragment2)) : invariant3(false) : void 0;
      return fragment2;
    }
    function getPaginationFragment(taggedNode) {
      var _fragment$metadata;
      var fragment2 = getFragment(taggedNode);
      var refetch = (_fragment$metadata = fragment2.metadata) === null || _fragment$metadata === void 0 ? void 0 : _fragment$metadata.refetch;
      var connection = refetch === null || refetch === void 0 ? void 0 : refetch.connection;
      if (refetch === null || typeof refetch !== "object" || connection === null || typeof connection !== "object") {
        return null;
      }
      return fragment2;
    }
    function getRefetchableFragment(taggedNode) {
      var _fragment$metadata2;
      var fragment2 = getFragment(taggedNode);
      var refetch = (_fragment$metadata2 = fragment2.metadata) === null || _fragment$metadata2 === void 0 ? void 0 : _fragment$metadata2.refetch;
      if (refetch === null || typeof refetch !== "object") {
        return null;
      }
      return fragment2;
    }
    function getRequest(taggedNode) {
      var request = getNode(taggedNode);
      !isRequest(request) ? true ? invariant3(false, "GraphQLTag: Expected a request, got `%s`.", JSON.stringify(request)) : invariant3(false) : void 0;
      return request;
    }
    function getUpdatableQuery(taggedNode) {
      var updatableQuery = getNode(taggedNode);
      !isUpdatableQuery(updatableQuery) ? true ? invariant3(false, "GraphQLTag: Expected a request, got `%s`.", JSON.stringify(updatableQuery)) : invariant3(false) : void 0;
      return updatableQuery;
    }
    function getInlineDataFragment(taggedNode) {
      var fragment2 = getNode(taggedNode);
      !isInlineDataFragment(fragment2) ? true ? invariant3(false, "GraphQLTag: Expected an inline data fragment, got `%s`.", JSON.stringify(fragment2)) : invariant3(false) : void 0;
      return fragment2;
    }
    module.exports = {
      getFragment,
      getNode,
      getPaginationFragment,
      getRefetchableFragment,
      getRequest,
      getUpdatableQuery,
      getInlineDataFragment,
      graphql: graphql40,
      isFragment: isFragment2,
      isRequest,
      isUpdatableQuery,
      isInlineDataFragment
    };
  }
});

// node_modules/relay-runtime/lib/store/isRelayModernEnvironment.js
var require_isRelayModernEnvironment2 = __commonJS({
  "node_modules/relay-runtime/lib/store/isRelayModernEnvironment.js"(exports, module) {
    "use strict";
    function isRelayModernEnvironment(environment) {
      return Boolean(environment && environment["@@RelayModernEnvironment"]);
    }
    module.exports = isRelayModernEnvironment;
  }
});

// node_modules/relay-runtime/lib/util/deepFreeze.js
var require_deepFreeze2 = __commonJS({
  "node_modules/relay-runtime/lib/util/deepFreeze.js"(exports, module) {
    "use strict";
    function deepFreeze(object) {
      Object.freeze(object);
      Object.getOwnPropertyNames(object).forEach(function(name2) {
        var property = object[name2];
        if (property && typeof property === "object" && !Object.isFrozen(property)) {
          deepFreeze(property);
        }
      });
      return object;
    }
    module.exports = deepFreeze;
  }
});

// node_modules/relay-runtime/lib/util/getRequestIdentifier.js
var require_getRequestIdentifier2 = __commonJS({
  "node_modules/relay-runtime/lib/util/getRequestIdentifier.js"(exports, module) {
    "use strict";
    var stableCopy = require_stableCopy2();
    var invariant3 = require_browser();
    function getRequestIdentifier(parameters, variables) {
      var requestID = parameters.cacheID != null ? parameters.cacheID : parameters.id;
      !(requestID != null) ? true ? invariant3(false, "getRequestIdentifier: Expected request `%s` to have either a valid `id` or `cacheID` property", parameters.name) : invariant3(false) : void 0;
      return requestID + JSON.stringify(stableCopy(variables));
    }
    module.exports = getRequestIdentifier;
  }
});

// node_modules/relay-runtime/lib/store/RelayConcreteVariables.js
var require_RelayConcreteVariables2 = __commonJS({
  "node_modules/relay-runtime/lib/store/RelayConcreteVariables.js"(exports, module) {
    "use strict";
    var _interopRequireDefault = require_interopRequireDefault()["default"];
    var _objectSpread210 = _interopRequireDefault(require_objectSpread2());
    var _require = require_RelayStoreUtils2();
    var getArgumentValues = _require.getArgumentValues;
    var invariant3 = require_browser();
    function getFragmentVariables(fragment2, rootVariables, argumentVariables) {
      if (fragment2.argumentDefinitions == null) {
        return argumentVariables;
      }
      var variables;
      fragment2.argumentDefinitions.forEach(function(definition) {
        if (argumentVariables.hasOwnProperty(definition.name)) {
          return;
        }
        variables = variables || (0, _objectSpread210["default"])({}, argumentVariables);
        switch (definition.kind) {
          case "LocalArgument":
            variables[definition.name] = definition.defaultValue;
            break;
          case "RootArgument":
            if (!rootVariables.hasOwnProperty(definition.name)) {
              variables[definition.name] = void 0;
              break;
            }
            variables[definition.name] = rootVariables[definition.name];
            break;
          default:
            definition;
            true ? true ? invariant3(false, "RelayConcreteVariables: Unexpected node kind `%s` in fragment `%s`.", definition.kind, fragment2.name) : invariant3(false) : void 0;
        }
      });
      return variables || argumentVariables;
    }
    function getOperationVariables(operation, providedVariables, variables) {
      var operationVariables = {};
      operation.argumentDefinitions.forEach(function(def) {
        var value = def.defaultValue;
        if (variables[def.name] != null) {
          value = variables[def.name];
        }
        operationVariables[def.name] = value;
      });
      if (providedVariables != null) {
        Object.keys(providedVariables).forEach(function(varName) {
          operationVariables[varName] = providedVariables[varName].get();
        });
      }
      return operationVariables;
    }
    function getLocalVariables(currentVariables, argumentDefinitions, args) {
      if (argumentDefinitions == null) {
        return currentVariables;
      }
      var nextVariables = (0, _objectSpread210["default"])({}, currentVariables);
      var nextArgs = args ? getArgumentValues(args, currentVariables) : {};
      argumentDefinitions.forEach(function(def) {
        var _nextArgs$def$name;
        var value = (_nextArgs$def$name = nextArgs[def.name]) !== null && _nextArgs$def$name !== void 0 ? _nextArgs$def$name : def.defaultValue;
        nextVariables[def.name] = value;
      });
      return nextVariables;
    }
    module.exports = {
      getLocalVariables,
      getFragmentVariables,
      getOperationVariables
    };
  }
});

// node_modules/relay-runtime/lib/store/RelayModernSelector.js
var require_RelayModernSelector2 = __commonJS({
  "node_modules/relay-runtime/lib/store/RelayModernSelector.js"(exports, module) {
    "use strict";
    var _require = require_RelayConcreteVariables2();
    var getFragmentVariables = _require.getFragmentVariables;
    var _require2 = require_RelayStoreUtils2();
    var CLIENT_EDGE_TRAVERSAL_PATH = _require2.CLIENT_EDGE_TRAVERSAL_PATH;
    var FRAGMENT_OWNER_KEY = _require2.FRAGMENT_OWNER_KEY;
    var FRAGMENTS_KEY = _require2.FRAGMENTS_KEY;
    var ID_KEY = _require2.ID_KEY;
    var IS_WITHIN_UNMATCHED_TYPE_REFINEMENT = _require2.IS_WITHIN_UNMATCHED_TYPE_REFINEMENT;
    var areEqual2 = require_areEqual();
    var invariant3 = require_browser();
    var warning2 = require_warning();
    function getSingularSelector(fragment2, item) {
      !(typeof item === "object" && item !== null && !Array.isArray(item)) ? true ? invariant3(false, "RelayModernSelector: Expected value for fragment `%s` to be an object, got `%s`.", fragment2.name, JSON.stringify(item)) : invariant3(false) : void 0;
      var dataID = item[ID_KEY];
      var fragments = item[FRAGMENTS_KEY];
      var mixedOwner = item[FRAGMENT_OWNER_KEY];
      var isWithinUnmatchedTypeRefinement = item[IS_WITHIN_UNMATCHED_TYPE_REFINEMENT] === true;
      var mixedClientEdgeTraversalPath = item[CLIENT_EDGE_TRAVERSAL_PATH];
      if (typeof dataID === "string" && typeof fragments === "object" && fragments !== null && typeof fragments[fragment2.name] === "object" && fragments[fragment2.name] !== null && typeof mixedOwner === "object" && mixedOwner !== null && (mixedClientEdgeTraversalPath == null || Array.isArray(mixedClientEdgeTraversalPath))) {
        var owner = mixedOwner;
        var clientEdgeTraversalPath = mixedClientEdgeTraversalPath;
        var argumentVariables = fragments[fragment2.name];
        var fragmentVariables = getFragmentVariables(fragment2, owner.variables, argumentVariables);
        return createReaderSelector(fragment2, dataID, fragmentVariables, owner, isWithinUnmatchedTypeRefinement, clientEdgeTraversalPath);
      }
      if (true) {
        var stringifiedItem = JSON.stringify(item);
        if (stringifiedItem.length > 499) {
          stringifiedItem = stringifiedItem.substr(0, 498) + "\u2026";
        }
        true ? warning2(false, "RelayModernSelector: Expected object to contain data for fragment `%s`, got `%s`. Make sure that the parent operation/fragment included fragment `...%s` without `@relay(mask: false)`.", fragment2.name, stringifiedItem, fragment2.name) : void 0;
      }
      return null;
    }
    function getPluralSelector(fragment2, items) {
      var selectors = null;
      items.forEach(function(item, ii) {
        var selector = item != null ? getSingularSelector(fragment2, item) : null;
        if (selector != null) {
          selectors = selectors || [];
          selectors.push(selector);
        }
      });
      if (selectors == null) {
        return null;
      } else {
        return {
          kind: "PluralReaderSelector",
          selectors
        };
      }
    }
    function getSelector(fragment2, item) {
      if (item == null) {
        return item;
      } else if (fragment2.metadata && fragment2.metadata.plural === true) {
        !Array.isArray(item) ? true ? invariant3(false, "RelayModernSelector: Expected value for fragment `%s` to be an array, got `%s`. Remove `@relay(plural: true)` from fragment `%s` to allow the prop to be an object.", fragment2.name, JSON.stringify(item), fragment2.name) : invariant3(false) : void 0;
        return getPluralSelector(fragment2, item);
      } else {
        !!Array.isArray(item) ? true ? invariant3(false, "RelayModernSelector: Expected value for fragment `%s` to be an object, got `%s`. Add `@relay(plural: true)` to fragment `%s` to allow the prop to be an array of items.", fragment2.name, JSON.stringify(item), fragment2.name) : invariant3(false) : void 0;
        return getSingularSelector(fragment2, item);
      }
    }
    function getSelectorsFromObject(fragments, object) {
      var selectors = {};
      for (var key in fragments) {
        if (fragments.hasOwnProperty(key)) {
          var fragment2 = fragments[key];
          var item = object[key];
          selectors[key] = getSelector(fragment2, item);
        }
      }
      return selectors;
    }
    function getDataIDsFromObject(fragments, object) {
      var ids = {};
      for (var key in fragments) {
        if (fragments.hasOwnProperty(key)) {
          var fragment2 = fragments[key];
          var item = object[key];
          ids[key] = getDataIDsFromFragment(fragment2, item);
        }
      }
      return ids;
    }
    function getDataIDsFromFragment(fragment2, item) {
      if (item == null) {
        return item;
      } else if (fragment2.metadata && fragment2.metadata.plural === true) {
        !Array.isArray(item) ? true ? invariant3(false, "RelayModernSelector: Expected value for fragment `%s` to be an array, got `%s`. Remove `@relay(plural: true)` from fragment `%s` to allow the prop to be an object.", fragment2.name, JSON.stringify(item), fragment2.name) : invariant3(false) : void 0;
        return getDataIDs(fragment2, item);
      } else {
        !!Array.isArray(item) ? true ? invariant3(false, "RelayModernFragmentSpecResolver: Expected value for fragment `%s` to be an object, got `%s`. Add `@relay(plural: true)` to fragment `%s` to allow the prop to be an array of items.", fragment2.name, JSON.stringify(item), fragment2.name) : invariant3(false) : void 0;
        return getDataID(fragment2, item);
      }
    }
    function getDataIDs(fragment2, items) {
      var ids = null;
      items.forEach(function(item) {
        var id2 = item != null ? getDataID(fragment2, item) : null;
        if (id2 != null) {
          ids = ids || [];
          ids.push(id2);
        }
      });
      return ids;
    }
    function getDataID(fragment2, item) {
      !(typeof item === "object" && item !== null && !Array.isArray(item)) ? true ? invariant3(false, "RelayModernSelector: Expected value for fragment `%s` to be an object, got `%s`.", fragment2.name, JSON.stringify(item)) : invariant3(false) : void 0;
      var dataID = item[ID_KEY];
      if (typeof dataID === "string") {
        return dataID;
      }
      true ? warning2(false, "RelayModernSelector: Expected object to contain data for fragment `%s`, got `%s`. Make sure that the parent operation/fragment included fragment `...%s` without `@relay(mask: false)`, or `null` is passed as the fragment reference for `%s` if it's conditonally included and the condition isn't met.", fragment2.name, JSON.stringify(item), fragment2.name, fragment2.name) : void 0;
      return null;
    }
    function getVariablesFromObject(fragments, object) {
      var variables = {};
      for (var key in fragments) {
        if (fragments.hasOwnProperty(key)) {
          var fragment2 = fragments[key];
          var item = object[key];
          var itemVariables = getVariablesFromFragment(fragment2, item);
          Object.assign(variables, itemVariables);
        }
      }
      return variables;
    }
    function getVariablesFromFragment(fragment2, item) {
      var _fragment$metadata;
      if (item == null) {
        return {};
      } else if (((_fragment$metadata = fragment2.metadata) === null || _fragment$metadata === void 0 ? void 0 : _fragment$metadata.plural) === true) {
        !Array.isArray(item) ? true ? invariant3(false, "RelayModernSelector: Expected value for fragment `%s` to be an array, got `%s`. Remove `@relay(plural: true)` from fragment `%s` to allow the prop to be an object.", fragment2.name, JSON.stringify(item), fragment2.name) : invariant3(false) : void 0;
        return getVariablesFromPluralFragment(fragment2, item);
      } else {
        !!Array.isArray(item) ? true ? invariant3(false, "RelayModernFragmentSpecResolver: Expected value for fragment `%s` to be an object, got `%s`. Add `@relay(plural: true)` to fragment `%s` to allow the prop to be an array of items.", fragment2.name, JSON.stringify(item), fragment2.name) : invariant3(false) : void 0;
        return getVariablesFromSingularFragment(fragment2, item) || {};
      }
    }
    function getVariablesFromSingularFragment(fragment2, item) {
      var selector = getSingularSelector(fragment2, item);
      if (!selector) {
        return null;
      }
      return selector.variables;
    }
    function getVariablesFromPluralFragment(fragment2, items) {
      var variables = {};
      items.forEach(function(value, ii) {
        if (value != null) {
          var itemVariables = getVariablesFromSingularFragment(fragment2, value);
          if (itemVariables != null) {
            Object.assign(variables, itemVariables);
          }
        }
      });
      return variables;
    }
    function areEqualSingularSelectors(thisSelector, thatSelector) {
      return thisSelector.owner === thatSelector.owner && thisSelector.dataID === thatSelector.dataID && thisSelector.node === thatSelector.node && areEqual2(thisSelector.variables, thatSelector.variables);
    }
    function areEqualSelectors(a2, b) {
      if (a2 === b) {
        return true;
      } else if (a2 == null) {
        return b == null;
      } else if (b == null) {
        return a2 == null;
      } else if (a2.kind === "SingularReaderSelector" && b.kind === "SingularReaderSelector") {
        return areEqualSingularSelectors(a2, b);
      } else if (a2.kind === "PluralReaderSelector" && b.kind === "PluralReaderSelector") {
        return a2.selectors.length === b.selectors.length && a2.selectors.every(function(s2, i2) {
          return areEqualSingularSelectors(s2, b.selectors[i2]);
        });
      } else {
        return false;
      }
    }
    function createReaderSelector(fragment2, dataID, variables, request) {
      var isWithinUnmatchedTypeRefinement = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : false;
      var clientEdgeTraversalPath = arguments.length > 5 ? arguments[5] : void 0;
      return {
        kind: "SingularReaderSelector",
        dataID,
        isWithinUnmatchedTypeRefinement,
        clientEdgeTraversalPath: clientEdgeTraversalPath !== null && clientEdgeTraversalPath !== void 0 ? clientEdgeTraversalPath : null,
        node: fragment2,
        variables,
        owner: request
      };
    }
    function createNormalizationSelector(node56, dataID, variables) {
      return {
        dataID,
        node: node56,
        variables
      };
    }
    module.exports = {
      areEqualSelectors,
      createReaderSelector,
      createNormalizationSelector,
      getDataIDsFromFragment,
      getDataIDsFromObject,
      getSingularSelector,
      getPluralSelector,
      getSelector,
      getSelectorsFromObject,
      getVariablesFromSingularFragment,
      getVariablesFromPluralFragment,
      getVariablesFromFragment,
      getVariablesFromObject
    };
  }
});

// node_modules/relay-runtime/lib/store/RelayModernOperationDescriptor.js
var require_RelayModernOperationDescriptor2 = __commonJS({
  "node_modules/relay-runtime/lib/store/RelayModernOperationDescriptor.js"(exports, module) {
    "use strict";
    var deepFreeze = require_deepFreeze2();
    var getRequestIdentifier = require_getRequestIdentifier2();
    var _require = require_RelayConcreteVariables2();
    var getOperationVariables = _require.getOperationVariables;
    var _require2 = require_RelayModernSelector2();
    var createNormalizationSelector = _require2.createNormalizationSelector;
    var createReaderSelector = _require2.createReaderSelector;
    var _require3 = require_RelayStoreUtils2();
    var ROOT_ID = _require3.ROOT_ID;
    function createOperationDescriptor(request, variables, cacheConfig) {
      var dataID = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : ROOT_ID;
      var operation = request.operation;
      var operationVariables = getOperationVariables(operation, request.params.providedVariables, variables);
      var requestDescriptor = createRequestDescriptor(request, operationVariables, cacheConfig);
      var operationDescriptor = {
        fragment: createReaderSelector(request.fragment, dataID, operationVariables, requestDescriptor),
        request: requestDescriptor,
        root: createNormalizationSelector(operation, dataID, operationVariables)
      };
      if (true) {
        Object.freeze(operationDescriptor.fragment);
        Object.freeze(operationDescriptor.root);
        Object.freeze(operationDescriptor);
      }
      return operationDescriptor;
    }
    function createRequestDescriptor(request, variables, cacheConfig) {
      var requestDescriptor = {
        identifier: getRequestIdentifier(request.params, variables),
        node: request,
        variables,
        cacheConfig
      };
      if (true) {
        deepFreeze(variables);
        Object.freeze(request);
        Object.freeze(requestDescriptor);
      }
      return requestDescriptor;
    }
    module.exports = {
      createOperationDescriptor,
      createRequestDescriptor
    };
  }
});

// node_modules/relay-runtime/lib/mutations/RelayDeclarativeMutationConfig.js
var require_RelayDeclarativeMutationConfig2 = __commonJS({
  "node_modules/relay-runtime/lib/mutations/RelayDeclarativeMutationConfig.js"(exports, module) {
    "use strict";
    var _interopRequireDefault = require_interopRequireDefault()["default"];
    var _createForOfIteratorHelper2 = _interopRequireDefault(require_createForOfIteratorHelper());
    var ConnectionHandler = require_ConnectionHandler2();
    var warning2 = require_warning();
    var MutationTypes = Object.freeze({
      RANGE_ADD: "RANGE_ADD",
      RANGE_DELETE: "RANGE_DELETE",
      NODE_DELETE: "NODE_DELETE"
    });
    var RangeOperations = Object.freeze({
      APPEND: "append",
      PREPEND: "prepend"
    });
    function convert(configs, request, optimisticUpdater, updater) {
      var configOptimisticUpdates = optimisticUpdater ? [optimisticUpdater] : [];
      var configUpdates = updater ? [updater] : [];
      configs.forEach(function(config2) {
        switch (config2.type) {
          case "NODE_DELETE":
            var nodeDeleteResult = nodeDelete(config2, request);
            if (nodeDeleteResult) {
              configOptimisticUpdates.push(nodeDeleteResult);
              configUpdates.push(nodeDeleteResult);
            }
            break;
          case "RANGE_ADD":
            var rangeAddResult = rangeAdd(config2, request);
            if (rangeAddResult) {
              configOptimisticUpdates.push(rangeAddResult);
              configUpdates.push(rangeAddResult);
            }
            break;
          case "RANGE_DELETE":
            var rangeDeleteResult = rangeDelete(config2, request);
            if (rangeDeleteResult) {
              configOptimisticUpdates.push(rangeDeleteResult);
              configUpdates.push(rangeDeleteResult);
            }
            break;
        }
      });
      return {
        optimisticUpdater: function optimisticUpdater2(store, data) {
          configOptimisticUpdates.forEach(function(eachOptimisticUpdater) {
            eachOptimisticUpdater(store, data);
          });
        },
        updater: function updater2(store, data) {
          configUpdates.forEach(function(eachUpdater) {
            eachUpdater(store, data);
          });
        }
      };
    }
    function nodeDelete(config2, request) {
      var deletedIDFieldName = config2.deletedIDFieldName;
      var rootField = getRootField(request);
      if (!rootField) {
        return null;
      }
      return function(store, data) {
        var payload = store.getRootField(rootField);
        if (!payload) {
          return;
        }
        var deleteID = payload.getValue(deletedIDFieldName);
        var deleteIDs = Array.isArray(deleteID) ? deleteID : [deleteID];
        deleteIDs.forEach(function(id2) {
          if (id2 && typeof id2 === "string") {
            store["delete"](id2);
          }
        });
      };
    }
    function rangeAdd(config2, request) {
      var parentID = config2.parentID, connectionInfo = config2.connectionInfo, edgeName = config2.edgeName;
      if (!parentID) {
        true ? warning2(false, "RelayDeclarativeMutationConfig: For mutation config RANGE_ADD to work you must include a parentID") : void 0;
        return null;
      }
      var rootField = getRootField(request);
      if (!connectionInfo || !rootField) {
        return null;
      }
      return function(store, data) {
        var parent = store.get(parentID);
        if (!parent) {
          return;
        }
        var payload = store.getRootField(rootField);
        if (!payload) {
          return;
        }
        var serverEdge = payload.getLinkedRecord(edgeName);
        var _iterator = (0, _createForOfIteratorHelper2["default"])(connectionInfo), _step;
        try {
          for (_iterator.s(); !(_step = _iterator.n()).done; ) {
            var info = _step.value;
            if (!serverEdge) {
              continue;
            }
            var connection = ConnectionHandler.getConnection(parent, info.key, info.filters);
            if (!connection) {
              continue;
            }
            var clientEdge = ConnectionHandler.buildConnectionEdge(store, connection, serverEdge);
            if (!clientEdge) {
              continue;
            }
            switch (info.rangeBehavior) {
              case "append":
                ConnectionHandler.insertEdgeAfter(connection, clientEdge);
                break;
              case "prepend":
                ConnectionHandler.insertEdgeBefore(connection, clientEdge);
                break;
              default:
                true ? warning2(false, "RelayDeclarativeMutationConfig: RANGE_ADD range behavior `%s` will not work as expected in RelayModern, supported range behaviors are 'append', 'prepend'.", info.rangeBehavior) : void 0;
                break;
            }
          }
        } catch (err) {
          _iterator.e(err);
        } finally {
          _iterator.f();
        }
      };
    }
    function rangeDelete(config2, request) {
      var parentID = config2.parentID, connectionKeys = config2.connectionKeys, pathToConnection = config2.pathToConnection, deletedIDFieldName = config2.deletedIDFieldName;
      if (!parentID) {
        true ? warning2(false, "RelayDeclarativeMutationConfig: For mutation config RANGE_DELETE to work you must include a parentID") : void 0;
        return null;
      }
      var rootField = getRootField(request);
      if (!rootField) {
        return null;
      }
      return function(store, data) {
        if (!data) {
          return;
        }
        var deleteIDs = [];
        var deletedIDField = data[rootField];
        if (deletedIDField && Array.isArray(deletedIDFieldName)) {
          var _iterator2 = (0, _createForOfIteratorHelper2["default"])(deletedIDFieldName), _step2;
          try {
            for (_iterator2.s(); !(_step2 = _iterator2.n()).done; ) {
              var eachField = _step2.value;
              if (deletedIDField && typeof deletedIDField === "object") {
                deletedIDField = deletedIDField[eachField];
              }
            }
          } catch (err) {
            _iterator2.e(err);
          } finally {
            _iterator2.f();
          }
          if (Array.isArray(deletedIDField)) {
            deletedIDField.forEach(function(idObject) {
              if (idObject && idObject.id && typeof idObject === "object" && typeof idObject.id === "string") {
                deleteIDs.push(idObject.id);
              }
            });
          } else if (deletedIDField && deletedIDField.id && typeof deletedIDField.id === "string") {
            deleteIDs.push(deletedIDField.id);
          }
        } else if (deletedIDField && typeof deletedIDFieldName === "string" && typeof deletedIDField === "object") {
          deletedIDField = deletedIDField[deletedIDFieldName];
          if (typeof deletedIDField === "string") {
            deleteIDs.push(deletedIDField);
          } else if (Array.isArray(deletedIDField)) {
            deletedIDField.forEach(function(id2) {
              if (typeof id2 === "string") {
                deleteIDs.push(id2);
              }
            });
          }
        }
        deleteNode(parentID, connectionKeys, pathToConnection, store, deleteIDs);
      };
    }
    function deleteNode(parentID, connectionKeys, pathToConnection, store, deleteIDs) {
      true ? warning2(connectionKeys != null, "RelayDeclarativeMutationConfig: RANGE_DELETE must provide a connectionKeys") : void 0;
      var parent = store.get(parentID);
      if (!parent) {
        return;
      }
      if (pathToConnection.length < 2) {
        true ? warning2(false, "RelayDeclarativeMutationConfig: RANGE_DELETE pathToConnection must include at least parent and connection") : void 0;
        return;
      }
      var recordProxy = parent;
      for (var i2 = 1; i2 < pathToConnection.length - 1; i2++) {
        if (recordProxy) {
          recordProxy = recordProxy.getLinkedRecord(pathToConnection[i2]);
        }
      }
      if (!connectionKeys || !recordProxy) {
        true ? warning2(false, "RelayDeclarativeMutationConfig: RANGE_DELETE pathToConnection is incorrect. Unable to find connection with parentID: %s and path: %s", parentID, pathToConnection.toString()) : void 0;
        return;
      }
      var _iterator3 = (0, _createForOfIteratorHelper2["default"])(connectionKeys), _step3;
      try {
        var _loop = function _loop2() {
          var key = _step3.value;
          var connection = ConnectionHandler.getConnection(recordProxy, key.key, key.filters);
          if (connection) {
            deleteIDs.forEach(function(deleteID) {
              ConnectionHandler.deleteNode(connection, deleteID);
            });
          }
        };
        for (_iterator3.s(); !(_step3 = _iterator3.n()).done; ) {
          _loop();
        }
      } catch (err) {
        _iterator3.e(err);
      } finally {
        _iterator3.f();
      }
    }
    function getRootField(request) {
      if (request.fragment.selections && request.fragment.selections.length > 0 && request.fragment.selections[0].kind === "LinkedField") {
        return request.fragment.selections[0].name;
      }
      return null;
    }
    module.exports = {
      MutationTypes,
      RangeOperations,
      convert
    };
  }
});

// node_modules/relay-runtime/lib/mutations/applyOptimisticMutation.js
var require_applyOptimisticMutation2 = __commonJS({
  "node_modules/relay-runtime/lib/mutations/applyOptimisticMutation.js"(exports, module) {
    "use strict";
    var _require = require_GraphQLTag2();
    var getRequest = _require.getRequest;
    var isRelayModernEnvironment = require_isRelayModernEnvironment2();
    var _require2 = require_RelayModernOperationDescriptor2();
    var createOperationDescriptor = _require2.createOperationDescriptor;
    var RelayDeclarativeMutationConfig = require_RelayDeclarativeMutationConfig2();
    var invariant3 = require_browser();
    function applyOptimisticMutation(environment, config2) {
      !isRelayModernEnvironment(environment) ? true ? invariant3(false, "commitMutation: expected `environment` to be an instance of `RelayModernEnvironment`.") : invariant3(false) : void 0;
      var mutation = getRequest(config2.mutation);
      if (mutation.params.operationKind !== "mutation") {
        throw new Error("commitMutation: Expected mutation operation");
      }
      var optimisticUpdater = config2.optimisticUpdater;
      var configs = config2.configs, optimisticResponse = config2.optimisticResponse, variables = config2.variables;
      var operation = createOperationDescriptor(mutation, variables);
      if (configs) {
        var _RelayDeclarativeMuta = RelayDeclarativeMutationConfig.convert(configs, mutation, optimisticUpdater);
        optimisticUpdater = _RelayDeclarativeMuta.optimisticUpdater;
      }
      return environment.applyMutation({
        operation,
        response: optimisticResponse,
        updater: optimisticUpdater
      });
    }
    module.exports = applyOptimisticMutation;
  }
});

// node_modules/relay-runtime/lib/mutations/commitLocalUpdate.js
var require_commitLocalUpdate2 = __commonJS({
  "node_modules/relay-runtime/lib/mutations/commitLocalUpdate.js"(exports, module) {
    "use strict";
    function commitLocalUpdate(environment, updater) {
      environment.commitUpdate(updater);
    }
    module.exports = commitLocalUpdate;
  }
});

// node_modules/relay-runtime/lib/mutations/validateMutation.js
var require_validateMutation2 = __commonJS({
  "node_modules/relay-runtime/lib/mutations/validateMutation.js"(exports, module) {
    "use strict";
    var _interopRequireDefault = require_interopRequireDefault()["default"];
    var _objectSpread210 = _interopRequireDefault(require_objectSpread2());
    var _require = require_RelayConcreteNode2();
    var ACTOR_CHANGE = _require.ACTOR_CHANGE;
    var CLIENT_COMPONENT = _require.CLIENT_COMPONENT;
    var CLIENT_EXTENSION = _require.CLIENT_EXTENSION;
    var CONDITION = _require.CONDITION;
    var DEFER = _require.DEFER;
    var FLIGHT_FIELD = _require.FLIGHT_FIELD;
    var FRAGMENT_SPREAD = _require.FRAGMENT_SPREAD;
    var INLINE_FRAGMENT = _require.INLINE_FRAGMENT;
    var LINKED_FIELD = _require.LINKED_FIELD;
    var LINKED_HANDLE = _require.LINKED_HANDLE;
    var MODULE_IMPORT = _require.MODULE_IMPORT;
    var SCALAR_FIELD = _require.SCALAR_FIELD;
    var SCALAR_HANDLE = _require.SCALAR_HANDLE;
    var STREAM = _require.STREAM;
    var TYPE_DISCRIMINATOR = _require.TYPE_DISCRIMINATOR;
    var warning2 = require_warning();
    var hasOwnProperty3 = Object.prototype.hasOwnProperty;
    var validateMutation = function validateMutation2() {
    };
    if (true) {
      addFieldToDiff = function addFieldToDiff2(path2, diff, isScalar) {
        var deepLoc = diff;
        path2.split(".").forEach(function(key, index, arr) {
          if (deepLoc[key] == null) {
            deepLoc[key] = {};
          }
          if (isScalar && index === arr.length - 1) {
            deepLoc[key] = "<scalar>";
          }
          deepLoc = deepLoc[key];
        });
      };
      validateMutation = function validateMutation2(optimisticResponse, mutation, variables) {
        var operationName = mutation.operation.name;
        var context2 = {
          path: "ROOT",
          visitedPaths: /* @__PURE__ */ new Set(),
          variables: variables || {},
          missingDiff: {},
          extraDiff: {},
          moduleImportPaths: /* @__PURE__ */ new Set()
        };
        validateSelections(optimisticResponse, mutation.operation.selections, context2);
        validateOptimisticResponse(optimisticResponse, context2);
        true ? warning2(context2.missingDiff.ROOT == null, "Expected `optimisticResponse` to match structure of server response for mutation `%s`, please define fields for all of\n%s", operationName, JSON.stringify(context2.missingDiff.ROOT, null, 2)) : void 0;
        true ? warning2(context2.extraDiff.ROOT == null, "Expected `optimisticResponse` to match structure of server response for mutation `%s`, please remove all fields of\n%s", operationName, JSON.stringify(context2.extraDiff.ROOT, null, 2)) : void 0;
      };
      validateSelections = function validateSelections2(optimisticResponse, selections, context2) {
        selections.forEach(function(selection2) {
          return validateSelection(optimisticResponse, selection2, context2);
        });
      };
      validateSelection = function validateSelection2(optimisticResponse, selection2, context2) {
        switch (selection2.kind) {
          case CONDITION:
            validateSelections(optimisticResponse, selection2.selections, context2);
            return;
          case CLIENT_COMPONENT:
          case FRAGMENT_SPREAD:
            validateSelections(optimisticResponse, selection2.fragment.selections, context2);
            return;
          case SCALAR_FIELD:
          case LINKED_FIELD:
          case FLIGHT_FIELD:
            return validateField2(optimisticResponse, selection2, context2);
          case ACTOR_CHANGE:
            return validateField2(optimisticResponse, selection2.linkedField, context2);
          case INLINE_FRAGMENT:
            var type = selection2.type;
            var isConcreteType = selection2.abstractKey == null;
            validateAbstractKey(context2, selection2.abstractKey);
            selection2.selections.forEach(function(subselection) {
              if (isConcreteType && optimisticResponse.__typename !== type) {
                return;
              }
              validateSelection2(optimisticResponse, subselection, context2);
            });
            return;
          case CLIENT_EXTENSION:
            selection2.selections.forEach(function(subselection) {
              validateSelection2(optimisticResponse, subselection, context2);
            });
            return;
          case MODULE_IMPORT:
            return validateModuleImport(context2);
          case TYPE_DISCRIMINATOR:
            return validateAbstractKey(context2, selection2.abstractKey);
          case LINKED_HANDLE:
          case SCALAR_HANDLE:
          case DEFER:
          case STREAM: {
            return;
          }
          default:
            selection2;
            return;
        }
      };
      validateModuleImport = function validateModuleImport2(context2) {
        context2.moduleImportPaths.add(context2.path);
      };
      validateAbstractKey = function validateAbstractKey2(context2, abstractKey) {
        if (abstractKey != null) {
          var path2 = "".concat(context2.path, ".").concat(abstractKey);
          context2.visitedPaths.add(path2);
        }
      };
      validateField2 = function validateField3(optimisticResponse, field, context2) {
        var fieldName = field.alias || field.name;
        var path2 = "".concat(context2.path, ".").concat(fieldName);
        context2.visitedPaths.add(path2);
        switch (field.kind) {
          case SCALAR_FIELD:
            if (hasOwnProperty3.call(optimisticResponse, fieldName) === false) {
              addFieldToDiff(path2, context2.missingDiff, true);
            }
            return;
          case LINKED_FIELD:
            var selections = field.selections;
            if (optimisticResponse[fieldName] === null || hasOwnProperty3.call(optimisticResponse, fieldName) && optimisticResponse[fieldName] === void 0) {
              return;
            }
            if (field.plural) {
              if (Array.isArray(optimisticResponse[fieldName])) {
                optimisticResponse[fieldName].forEach(function(r3) {
                  if (r3 !== null) {
                    validateSelections(r3, selections, (0, _objectSpread210["default"])((0, _objectSpread210["default"])({}, context2), {}, {
                      path: path2
                    }));
                  }
                });
                return;
              } else {
                addFieldToDiff(path2, context2.missingDiff);
                return;
              }
            } else {
              if (optimisticResponse[fieldName] instanceof Object) {
                validateSelections(optimisticResponse[fieldName], selections, (0, _objectSpread210["default"])((0, _objectSpread210["default"])({}, context2), {}, {
                  path: path2
                }));
                return;
              } else {
                addFieldToDiff(path2, context2.missingDiff);
                return;
              }
            }
          case FLIGHT_FIELD:
            if (optimisticResponse[fieldName] === null || hasOwnProperty3.call(optimisticResponse, fieldName) && optimisticResponse[fieldName] === void 0) {
              return;
            }
            throw new Error("validateMutation: Flight fields are not compatible with optimistic updates, as React does not have the component code necessary to process new data on the client. Instead, you should update your code to require a full refetch of the Flight field so your UI can be updated.");
        }
      };
      validateOptimisticResponse = function validateOptimisticResponse2(optimisticResponse, context2) {
        if (Array.isArray(optimisticResponse)) {
          optimisticResponse.forEach(function(r3) {
            if (r3 instanceof Object) {
              validateOptimisticResponse2(r3, context2);
            }
          });
          return;
        }
        Object.keys(optimisticResponse).forEach(function(key) {
          var value = optimisticResponse[key];
          var path2 = "".concat(context2.path, ".").concat(key);
          if (context2.moduleImportPaths.has(path2)) {
            return;
          }
          if (!context2.visitedPaths.has(path2)) {
            addFieldToDiff(path2, context2.extraDiff);
            return;
          }
          if (value instanceof Object) {
            validateOptimisticResponse2(value, (0, _objectSpread210["default"])((0, _objectSpread210["default"])({}, context2), {}, {
              path: path2
            }));
          }
        });
      };
    }
    var addFieldToDiff;
    var validateSelections;
    var validateSelection;
    var validateModuleImport;
    var validateAbstractKey;
    var validateField2;
    var validateOptimisticResponse;
    module.exports = validateMutation;
  }
});

// node_modules/relay-runtime/lib/mutations/commitMutation.js
var require_commitMutation2 = __commonJS({
  "node_modules/relay-runtime/lib/mutations/commitMutation.js"(exports, module) {
    "use strict";
    var _interopRequireDefault = require_interopRequireDefault()["default"];
    var _toConsumableArray22 = _interopRequireDefault(require_toConsumableArray());
    var _require = require_GraphQLTag2();
    var getRequest = _require.getRequest;
    var _require2 = require_ClientID2();
    var generateUniqueClientID = _require2.generateUniqueClientID;
    var isRelayModernEnvironment = require_isRelayModernEnvironment2();
    var _require3 = require_RelayModernOperationDescriptor2();
    var createOperationDescriptor = _require3.createOperationDescriptor;
    var RelayDeclarativeMutationConfig = require_RelayDeclarativeMutationConfig2();
    var validateMutation = require_validateMutation2();
    var invariant3 = require_browser();
    var warning2 = require_warning();
    function commitMutation(environment, config2) {
      !isRelayModernEnvironment(environment) ? true ? invariant3(false, "commitMutation: expected `environment` to be an instance of `RelayModernEnvironment`.") : invariant3(false) : void 0;
      var mutation = getRequest(config2.mutation);
      if (mutation.params.operationKind !== "mutation") {
        throw new Error("commitMutation: Expected mutation operation");
      }
      if (mutation.kind !== "Request") {
        throw new Error("commitMutation: Expected mutation to be of type request");
      }
      var optimisticResponse = config2.optimisticResponse, optimisticUpdater = config2.optimisticUpdater, updater = config2.updater;
      var configs = config2.configs, cacheConfig = config2.cacheConfig, onError = config2.onError, onUnsubscribe = config2.onUnsubscribe, variables = config2.variables, uploadables = config2.uploadables;
      var operation = createOperationDescriptor(mutation, variables, cacheConfig, generateUniqueClientID());
      if (typeof optimisticResponse === "function") {
        optimisticResponse = optimisticResponse();
        true ? warning2(false, "commitMutation: Expected `optimisticResponse` to be an object, received a function.") : void 0;
      }
      if (true) {
        if (optimisticResponse instanceof Object) {
          validateMutation(optimisticResponse, mutation, variables);
        }
      }
      if (configs) {
        var _RelayDeclarativeMuta = RelayDeclarativeMutationConfig.convert(configs, mutation, optimisticUpdater, updater);
        optimisticUpdater = _RelayDeclarativeMuta.optimisticUpdater;
        updater = _RelayDeclarativeMuta.updater;
      }
      var errors = [];
      var subscription2 = environment.executeMutation({
        operation,
        optimisticResponse,
        optimisticUpdater,
        updater,
        uploadables
      }).subscribe({
        next: function next2(payload) {
          var _config$onNext;
          if (Array.isArray(payload)) {
            payload.forEach(function(item) {
              if (item.errors) {
                errors.push.apply(errors, (0, _toConsumableArray22["default"])(item.errors));
              }
            });
          } else {
            if (payload.errors) {
              errors.push.apply(errors, (0, _toConsumableArray22["default"])(payload.errors));
            }
          }
          (_config$onNext = config2.onNext) === null || _config$onNext === void 0 ? void 0 : _config$onNext.call(config2);
        },
        complete: function complete() {
          var onCompleted = config2.onCompleted;
          if (onCompleted) {
            var snapshot = environment.lookup(operation.fragment);
            onCompleted(snapshot.data, errors.length !== 0 ? errors : null);
          }
        },
        error: onError,
        unsubscribe: onUnsubscribe
      });
      return {
        dispose: subscription2.unsubscribe
      };
    }
    module.exports = commitMutation;
  }
});

// node_modules/relay-runtime/lib/util/withProvidedVariables.js
var require_withProvidedVariables2 = __commonJS({
  "node_modules/relay-runtime/lib/util/withProvidedVariables.js"(exports, module) {
    "use strict";
    var areEqual2 = require_areEqual();
    var warning2 = require_warning();
    var WEAKMAP_SUPPORTED = typeof WeakMap === "function";
    var debugCache = WEAKMAP_SUPPORTED ? /* @__PURE__ */ new WeakMap() : /* @__PURE__ */ new Map();
    function withProvidedVariables(userSuppliedVariables, providedVariables) {
      if (providedVariables != null) {
        var operationVariables = {};
        Object.assign(operationVariables, userSuppliedVariables);
        Object.keys(providedVariables).forEach(function(varName) {
          var providerFunction = providedVariables[varName].get;
          var providerResult = providerFunction();
          if (!debugCache.has(providerFunction)) {
            debugCache.set(providerFunction, providerResult);
            operationVariables[varName] = providerResult;
          } else {
            var cachedResult = debugCache.get(providerFunction);
            if (true) {
              true ? warning2(areEqual2(providerResult, cachedResult), "Relay: Expected function `%s` for provider `%s` to be a pure function, but got conflicting return values `%s` and `%s`", providerFunction.name, varName, providerResult, cachedResult) : void 0;
            }
            operationVariables[varName] = cachedResult;
          }
        });
        return operationVariables;
      } else {
        return userSuppliedVariables;
      }
    }
    if (true) {
      withProvidedVariables.tests_only_resetDebugCache = function() {
        debugCache = WEAKMAP_SUPPORTED ? /* @__PURE__ */ new WeakMap() : /* @__PURE__ */ new Map();
      };
    }
    module.exports = withProvidedVariables;
  }
});

// node_modules/relay-runtime/lib/util/isPromise.js
var require_isPromise2 = __commonJS({
  "node_modules/relay-runtime/lib/util/isPromise.js"(exports, module) {
    "use strict";
    function isPromise(p) {
      return !!p && typeof p.then === "function";
    }
    module.exports = isPromise;
  }
});

// node_modules/relay-runtime/lib/network/RelayObservable.js
var require_RelayObservable2 = __commonJS({
  "node_modules/relay-runtime/lib/network/RelayObservable.js"(exports, module) {
    "use strict";
    var isPromise = require_isPromise2();
    var hostReportError = swallowError;
    var RelayObservable = /* @__PURE__ */ function() {
      RelayObservable2.create = function create4(source) {
        return new RelayObservable2(source);
      };
      function RelayObservable2(source) {
        if (true) {
          if (!source || typeof source !== "function") {
            throw new Error("Source must be a Function: " + String(source));
          }
        }
        this._source = source;
      }
      RelayObservable2.onUnhandledError = function onUnhandledError(callback) {
        hostReportError = callback;
      };
      RelayObservable2.from = function from2(obj) {
        return isObservable(obj) ? fromObservable(obj) : isPromise(obj) ? fromPromise(obj) : fromValue(obj);
      };
      var _proto = RelayObservable2.prototype;
      _proto["catch"] = function _catch(fn) {
        var _this = this;
        return RelayObservable2.create(function(sink) {
          var subscription2;
          _this.subscribe({
            start: function start(sub) {
              subscription2 = sub;
            },
            next: sink.next,
            complete: sink.complete,
            error: function error(_error2) {
              try {
                fn(_error2).subscribe({
                  start: function start(sub) {
                    subscription2 = sub;
                  },
                  next: sink.next,
                  complete: sink.complete,
                  error: sink.error
                });
              } catch (error2) {
                sink.error(
                  error2,
                  true
                  /* isUncaughtThrownError */
                );
              }
            }
          });
          return function() {
            return subscription2.unsubscribe();
          };
        });
      };
      _proto.concat = function concat(next2) {
        var _this2 = this;
        return RelayObservable2.create(function(sink) {
          var current;
          _this2.subscribe({
            start: function start(subscription2) {
              current = subscription2;
            },
            next: sink.next,
            error: sink.error,
            complete: function complete() {
              current = next2.subscribe(sink);
            }
          });
          return function() {
            current && current.unsubscribe();
          };
        });
      };
      _proto["do"] = function _do(observer) {
        var _this3 = this;
        return RelayObservable2.create(function(sink) {
          var both = function both2(action) {
            return function() {
              try {
                observer[action] && observer[action].apply(observer, arguments);
              } catch (error) {
                hostReportError(
                  error,
                  true
                  /* isUncaughtThrownError */
                );
              }
              sink[action] && sink[action].apply(sink, arguments);
            };
          };
          return _this3.subscribe({
            start: both("start"),
            next: both("next"),
            error: both("error"),
            complete: both("complete"),
            unsubscribe: both("unsubscribe")
          });
        });
      };
      _proto["finally"] = function _finally(fn) {
        var _this4 = this;
        return RelayObservable2.create(function(sink) {
          var subscription2 = _this4.subscribe(sink);
          return function() {
            subscription2.unsubscribe();
            fn();
          };
        });
      };
      _proto.ifEmpty = function ifEmpty(alternate) {
        var _this5 = this;
        return RelayObservable2.create(function(sink) {
          var hasValue = false;
          var current = _this5.subscribe({
            next: function next2(value) {
              hasValue = true;
              sink.next(value);
            },
            error: sink.error,
            complete: function complete() {
              if (hasValue) {
                sink.complete();
              } else {
                current = alternate.subscribe(sink);
              }
            }
          });
          return function() {
            current.unsubscribe();
          };
        });
      };
      _proto.subscribe = function subscribe(observer) {
        if (true) {
          if (!observer || typeof observer !== "object") {
            throw new Error("Observer must be an Object with callbacks: " + String(observer));
          }
        }
        return _subscribe(this._source, observer);
      };
      _proto.map = function map3(fn) {
        var _this6 = this;
        return RelayObservable2.create(function(sink) {
          var subscription2 = _this6.subscribe({
            complete: sink.complete,
            error: sink.error,
            next: function next2(value) {
              try {
                var mapValue = fn(value);
                sink.next(mapValue);
              } catch (error) {
                sink.error(
                  error,
                  true
                  /* isUncaughtThrownError */
                );
              }
            }
          });
          return function() {
            subscription2.unsubscribe();
          };
        });
      };
      _proto.mergeMap = function mergeMap(fn) {
        var _this7 = this;
        return RelayObservable2.create(function(sink) {
          var subscriptions = [];
          function start(subscription2) {
            this._sub = subscription2;
            subscriptions.push(subscription2);
          }
          function complete() {
            subscriptions.splice(subscriptions.indexOf(this._sub), 1);
            if (subscriptions.length === 0) {
              sink.complete();
            }
          }
          _this7.subscribe({
            start,
            next: function next2(value) {
              try {
                if (!sink.closed) {
                  RelayObservable2.from(fn(value)).subscribe({
                    start,
                    next: sink.next,
                    error: sink.error,
                    complete
                  });
                }
              } catch (error) {
                sink.error(
                  error,
                  true
                  /* isUncaughtThrownError */
                );
              }
            },
            error: sink.error,
            complete
          });
          return function() {
            subscriptions.forEach(function(sub) {
              return sub.unsubscribe();
            });
            subscriptions.length = 0;
          };
        });
      };
      _proto.poll = function poll(pollInterval) {
        var _this8 = this;
        if (true) {
          if (typeof pollInterval !== "number" || pollInterval <= 0) {
            throw new Error("RelayObservable: Expected pollInterval to be positive, got: " + pollInterval);
          }
        }
        return RelayObservable2.create(function(sink) {
          var subscription2;
          var timeout2;
          var poll2 = function poll3() {
            subscription2 = _this8.subscribe({
              next: sink.next,
              error: sink.error,
              complete: function complete() {
                timeout2 = setTimeout(poll3, pollInterval);
              }
            });
          };
          poll2();
          return function() {
            clearTimeout(timeout2);
            subscription2.unsubscribe();
          };
        });
      };
      _proto.toPromise = function toPromise() {
        var _this9 = this;
        return new Promise(function(resolve2, reject) {
          var resolved = false;
          _this9.subscribe({
            next: function next2(val) {
              if (!resolved) {
                resolved = true;
                resolve2(val);
              }
            },
            error: reject,
            complete: resolve2
          });
        });
      };
      return RelayObservable2;
    }();
    function isObservable(obj) {
      return typeof obj === "object" && obj !== null && typeof obj.subscribe === "function";
    }
    function fromObservable(obj) {
      return obj instanceof RelayObservable ? obj : RelayObservable.create(function(sink) {
        return obj.subscribe(sink);
      });
    }
    function fromPromise(promise) {
      return RelayObservable.create(function(sink) {
        promise.then(function(value) {
          sink.next(value);
          sink.complete();
        }, sink.error);
      });
    }
    function fromValue(value) {
      return RelayObservable.create(function(sink) {
        sink.next(value);
        sink.complete();
      });
    }
    function _subscribe(source, observer) {
      var closed = false;
      var cleanup;
      var withClosed = function withClosed2(obj) {
        return Object.defineProperty(obj, "closed", {
          get: function get3() {
            return closed;
          }
        });
      };
      function doCleanup() {
        if (cleanup) {
          if (cleanup.unsubscribe) {
            cleanup.unsubscribe();
          } else {
            try {
              cleanup();
            } catch (error) {
              hostReportError(
                error,
                true
                /* isUncaughtThrownError */
              );
            }
          }
          cleanup = void 0;
        }
      }
      var subscription2 = withClosed({
        unsubscribe: function unsubscribe() {
          if (!closed) {
            closed = true;
            try {
              observer.unsubscribe && observer.unsubscribe(subscription2);
            } catch (error) {
              hostReportError(
                error,
                true
                /* isUncaughtThrownError */
              );
            } finally {
              doCleanup();
            }
          }
        }
      });
      try {
        observer.start && observer.start(subscription2);
      } catch (error) {
        hostReportError(
          error,
          true
          /* isUncaughtThrownError */
        );
      }
      if (closed) {
        return subscription2;
      }
      var sink = withClosed({
        next: function next2(value) {
          if (!closed && observer.next) {
            try {
              observer.next(value);
            } catch (error) {
              hostReportError(
                error,
                true
                /* isUncaughtThrownError */
              );
            }
          }
        },
        error: function error(_error3, isUncaughtThrownError) {
          if (closed || !observer.error) {
            closed = true;
            hostReportError(_error3, isUncaughtThrownError || false);
            doCleanup();
          } else {
            closed = true;
            try {
              observer.error(_error3);
            } catch (error2) {
              hostReportError(
                error2,
                true
                /* isUncaughtThrownError */
              );
            } finally {
              doCleanup();
            }
          }
        },
        complete: function complete() {
          if (!closed) {
            closed = true;
            try {
              observer.complete && observer.complete();
            } catch (error) {
              hostReportError(
                error,
                true
                /* isUncaughtThrownError */
              );
            } finally {
              doCleanup();
            }
          }
        }
      });
      try {
        cleanup = source(sink);
      } catch (error) {
        sink.error(
          error,
          true
          /* isUncaughtThrownError */
        );
      }
      if (true) {
        if (cleanup !== void 0 && typeof cleanup !== "function" && (!cleanup || typeof cleanup.unsubscribe !== "function")) {
          throw new Error("Returned cleanup function which cannot be called: " + String(cleanup));
        }
      }
      if (closed) {
        doCleanup();
      }
      return subscription2;
    }
    function swallowError(_error, _isUncaughtThrownError) {
    }
    if (true) {
      RelayObservable.onUnhandledError(function(error, isUncaughtThrownError) {
        if (typeof fail === "function") {
          fail(String(error));
        } else if (isUncaughtThrownError) {
          setTimeout(function() {
            throw error;
          });
        } else if (typeof console !== "undefined") {
          console.error("RelayObservable: Unhandled Error", error);
        }
      });
    }
    module.exports = RelayObservable;
  }
});

// node_modules/relay-runtime/lib/network/ConvertToExecuteFunction.js
var require_ConvertToExecuteFunction2 = __commonJS({
  "node_modules/relay-runtime/lib/network/ConvertToExecuteFunction.js"(exports, module) {
    "use strict";
    var RelayObservable = require_RelayObservable2();
    function convertFetch(fn) {
      return function fetch2(request, variables, cacheConfig, uploadables, logRequestInfo) {
        var result = fn(request, variables, cacheConfig, uploadables, logRequestInfo);
        if (result instanceof Error) {
          return RelayObservable.create(function(sink) {
            return sink.error(result);
          });
        }
        return RelayObservable.from(result);
      };
    }
    module.exports = {
      convertFetch
    };
  }
});

// node_modules/relay-runtime/lib/network/RelayNetwork.js
var require_RelayNetwork2 = __commonJS({
  "node_modules/relay-runtime/lib/network/RelayNetwork.js"(exports, module) {
    "use strict";
    var withProvidedVariables = require_withProvidedVariables2();
    var _require = require_ConvertToExecuteFunction2();
    var convertFetch = _require.convertFetch;
    var invariant3 = require_browser();
    function create4(fetchFn, subscribe) {
      var observeFetch = convertFetch(fetchFn);
      function execute(request, variables, cacheConfig, uploadables, logRequestInfo) {
        var operationVariables = withProvidedVariables(variables, request.providedVariables);
        if (request.operationKind === "subscription") {
          !subscribe ? true ? invariant3(false, "RelayNetwork: This network layer does not support Subscriptions. To use Subscriptions, provide a custom network layer.") : invariant3(false) : void 0;
          !!uploadables ? true ? invariant3(false, "RelayNetwork: Cannot provide uploadables while subscribing.") : invariant3(false) : void 0;
          return subscribe(request, operationVariables, cacheConfig);
        }
        var pollInterval = cacheConfig.poll;
        if (pollInterval != null) {
          !!uploadables ? true ? invariant3(false, "RelayNetwork: Cannot provide uploadables while polling.") : invariant3(false) : void 0;
          return observeFetch(request, operationVariables, {
            force: true
          }).poll(pollInterval);
        }
        return observeFetch(request, operationVariables, cacheConfig, uploadables, logRequestInfo);
      }
      return {
        execute
      };
    }
    module.exports = {
      create: create4
    };
  }
});

// node_modules/relay-runtime/lib/network/RelayQueryResponseCache.js
var require_RelayQueryResponseCache2 = __commonJS({
  "node_modules/relay-runtime/lib/network/RelayQueryResponseCache.js"(exports, module) {
    "use strict";
    var _interopRequireDefault = require_interopRequireDefault()["default"];
    var _objectSpread210 = _interopRequireDefault(require_objectSpread2());
    var stableCopy = require_stableCopy2();
    var invariant3 = require_browser();
    var RelayQueryResponseCache = /* @__PURE__ */ function() {
      function RelayQueryResponseCache2(_ref18) {
        var size = _ref18.size, ttl = _ref18.ttl;
        !(size > 0) ? true ? invariant3(false, "RelayQueryResponseCache: Expected the max cache size to be > 0, got `%s`.", size) : invariant3(false) : void 0;
        !(ttl > 0) ? true ? invariant3(false, "RelayQueryResponseCache: Expected the max ttl to be > 0, got `%s`.", ttl) : invariant3(false) : void 0;
        this._responses = /* @__PURE__ */ new Map();
        this._size = size;
        this._ttl = ttl;
      }
      var _proto = RelayQueryResponseCache2.prototype;
      _proto.clear = function clear2() {
        this._responses.clear();
      };
      _proto.get = function get3(queryID, variables) {
        var _this = this;
        var cacheKey = getCacheKey(queryID, variables);
        this._responses.forEach(function(response2, key) {
          if (!isCurrent(response2.fetchTime, _this._ttl)) {
            _this._responses["delete"](key);
          }
        });
        var response = this._responses.get(cacheKey);
        if (response == null) {
          return null;
        }
        if (Array.isArray(response.payload)) {
          return response.payload.map(function(payload) {
            return (
              // $FlowFixMe[incompatible-cast]
              (0, _objectSpread210["default"])((0, _objectSpread210["default"])({}, payload), {}, {
                extensions: (0, _objectSpread210["default"])((0, _objectSpread210["default"])({}, payload.extensions), {}, {
                  cacheTimestamp: response.fetchTime
                })
              })
            );
          });
        }
        return (0, _objectSpread210["default"])((0, _objectSpread210["default"])({}, response.payload), {}, {
          extensions: (0, _objectSpread210["default"])((0, _objectSpread210["default"])({}, response.payload.extensions), {}, {
            cacheTimestamp: response.fetchTime
          })
        });
      };
      _proto.set = function set3(queryID, variables, payload) {
        var fetchTime = Date.now();
        var cacheKey = getCacheKey(queryID, variables);
        this._responses["delete"](cacheKey);
        this._responses.set(cacheKey, {
          fetchTime,
          payload
        });
        if (this._responses.size > this._size) {
          var firstKey = this._responses.keys().next();
          if (!firstKey.done) {
            this._responses["delete"](firstKey.value);
          }
        }
      };
      return RelayQueryResponseCache2;
    }();
    function getCacheKey(queryID, variables) {
      return JSON.stringify(stableCopy({
        queryID,
        variables
      }));
    }
    function isCurrent(fetchTime, ttl) {
      return fetchTime + ttl >= Date.now();
    }
    module.exports = RelayQueryResponseCache;
  }
});

// node_modules/relay-runtime/lib/util/handlePotentialSnapshotErrors.js
var require_handlePotentialSnapshotErrors2 = __commonJS({
  "node_modules/relay-runtime/lib/util/handlePotentialSnapshotErrors.js"(exports, module) {
    "use strict";
    var _interopRequireDefault = require_interopRequireDefault()["default"];
    var _createForOfIteratorHelper2 = _interopRequireDefault(require_createForOfIteratorHelper());
    function handlePotentialSnapshotErrors(environment, missingRequiredFields, relayResolverErrors) {
      var _iterator = (0, _createForOfIteratorHelper2["default"])(relayResolverErrors), _step;
      try {
        for (_iterator.s(); !(_step = _iterator.n()).done; ) {
          var resolverError = _step.value;
          environment.requiredFieldLogger({
            kind: "relay_resolver.error",
            owner: resolverError.field.owner,
            fieldPath: resolverError.field.path,
            error: resolverError.error
          });
        }
      } catch (err) {
        _iterator.e(err);
      } finally {
        _iterator.f();
      }
      if (missingRequiredFields != null) {
        switch (missingRequiredFields.action) {
          case "THROW": {
            var _missingRequiredField = missingRequiredFields.field, path2 = _missingRequiredField.path, owner = _missingRequiredField.owner;
            environment.requiredFieldLogger({
              kind: "missing_field.throw",
              owner,
              fieldPath: path2
            });
            throw new Error("Relay: Missing @required value at path '".concat(path2, "' in '").concat(owner, "'."));
          }
          case "LOG":
            missingRequiredFields.fields.forEach(function(_ref18) {
              var path3 = _ref18.path, owner2 = _ref18.owner;
              environment.requiredFieldLogger({
                kind: "missing_field.log",
                owner: owner2,
                fieldPath: path3
              });
            });
            break;
          default: {
            missingRequiredFields.action;
          }
        }
      }
    }
    module.exports = handlePotentialSnapshotErrors;
  }
});

// node_modules/relay-runtime/lib/util/RelayReplaySubject.js
var require_RelayReplaySubject2 = __commonJS({
  "node_modules/relay-runtime/lib/util/RelayReplaySubject.js"(exports, module) {
    "use strict";
    var _interopRequireDefault = require_interopRequireDefault()["default"];
    var _createForOfIteratorHelper2 = _interopRequireDefault(require_createForOfIteratorHelper());
    var _defineProperty210 = _interopRequireDefault(require_defineProperty());
    var RelayObservable = require_RelayObservable2();
    var invariant3 = require_browser();
    var RelayReplaySubject = /* @__PURE__ */ function() {
      function RelayReplaySubject2() {
        var _this = this;
        (0, _defineProperty210["default"])(this, "_complete", false);
        (0, _defineProperty210["default"])(this, "_events", []);
        (0, _defineProperty210["default"])(this, "_sinks", /* @__PURE__ */ new Set());
        (0, _defineProperty210["default"])(this, "_subscription", []);
        this._observable = RelayObservable.create(function(sink) {
          _this._sinks.add(sink);
          var events = _this._events;
          for (var i2 = 0; i2 < events.length; i2++) {
            if (sink.closed) {
              break;
            }
            var event = events[i2];
            switch (event.kind) {
              case "complete":
                sink.complete();
                break;
              case "error":
                sink.error(event.error);
                break;
              case "next":
                sink.next(event.data);
                break;
              default:
                event.kind;
                true ? true ? invariant3(false, "RelayReplaySubject: Unknown event kind `%s`.", event.kind) : invariant3(false) : void 0;
            }
          }
          return function() {
            _this._sinks["delete"](sink);
          };
        });
      }
      var _proto = RelayReplaySubject2.prototype;
      _proto.complete = function complete() {
        if (this._complete === true) {
          return;
        }
        this._complete = true;
        this._events.push({
          kind: "complete"
        });
        this._sinks.forEach(function(sink) {
          return sink.complete();
        });
      };
      _proto.error = function error(_error) {
        if (this._complete === true) {
          return;
        }
        this._complete = true;
        this._events.push({
          kind: "error",
          error: _error
        });
        this._sinks.forEach(function(sink) {
          return sink.error(_error);
        });
      };
      _proto.next = function next2(data) {
        if (this._complete === true) {
          return;
        }
        this._events.push({
          kind: "next",
          data
        });
        this._sinks.forEach(function(sink) {
          return sink.next(data);
        });
      };
      _proto.subscribe = function subscribe(observer) {
        var subscription2 = this._observable.subscribe(observer);
        this._subscription.push(subscription2);
        return subscription2;
      };
      _proto.unsubscribe = function unsubscribe() {
        var _iterator = (0, _createForOfIteratorHelper2["default"])(this._subscription), _step;
        try {
          for (_iterator.s(); !(_step = _iterator.n()).done; ) {
            var subscription2 = _step.value;
            subscription2.unsubscribe();
          }
        } catch (err) {
          _iterator.e(err);
        } finally {
          _iterator.f();
        }
        this._subscription = [];
      };
      _proto.getObserverCount = function getObserverCount() {
        return this._sinks.size;
      };
      return RelayReplaySubject2;
    }();
    module.exports = RelayReplaySubject;
  }
});

// node_modules/relay-runtime/lib/query/fetchQueryInternal.js
var require_fetchQueryInternal2 = __commonJS({
  "node_modules/relay-runtime/lib/query/fetchQueryInternal.js"(exports, module) {
    "use strict";
    var Observable = require_RelayObservable2();
    var RelayFeatureFlags = require_RelayFeatureFlags2();
    var RelayReplaySubject = require_RelayReplaySubject2();
    var invariant3 = require_browser();
    var WEAKMAP_SUPPORTED = typeof WeakMap === "function";
    var requestCachesByEnvironment = WEAKMAP_SUPPORTED ? /* @__PURE__ */ new WeakMap() : /* @__PURE__ */ new Map();
    function fetchQuery7(environment, operation) {
      return fetchQueryDeduped(environment, operation.request.identifier, function() {
        return environment.execute({
          operation
        });
      });
    }
    function fetchQueryDeduped(environment, identifier2, fetchFn) {
      return Observable.create(function(sink) {
        var requestCache = getRequestCache(environment);
        var cachedRequest = requestCache.get(identifier2);
        if (!cachedRequest) {
          fetchFn()["finally"](function() {
            return requestCache["delete"](identifier2);
          }).subscribe({
            start: function start(subscription2) {
              cachedRequest = {
                identifier: identifier2,
                subject: new RelayReplaySubject(),
                subjectForInFlightStatus: new RelayReplaySubject(),
                subscription: subscription2,
                promise: null
              };
              requestCache.set(identifier2, cachedRequest);
            },
            next: function next2(response) {
              var cachedReq = getCachedRequest(requestCache, identifier2);
              cachedReq.subject.next(response);
              cachedReq.subjectForInFlightStatus.next(response);
            },
            error: function error(_error) {
              var cachedReq = getCachedRequest(requestCache, identifier2);
              cachedReq.subject.error(_error);
              cachedReq.subjectForInFlightStatus.error(_error);
            },
            complete: function complete() {
              var cachedReq = getCachedRequest(requestCache, identifier2);
              cachedReq.subject.complete();
              cachedReq.subjectForInFlightStatus.complete();
            },
            unsubscribe: function unsubscribe(subscription2) {
              var cachedReq = getCachedRequest(requestCache, identifier2);
              cachedReq.subject.unsubscribe();
              cachedReq.subjectForInFlightStatus.unsubscribe();
            }
          });
        }
        !(cachedRequest != null) ? true ? invariant3(false, "[fetchQueryInternal] fetchQueryDeduped: Expected `start` to be called synchronously") : invariant3(false) : void 0;
        return getObservableForCachedRequest(requestCache, cachedRequest).subscribe(sink);
      });
    }
    function getObservableForCachedRequest(requestCache, cachedRequest) {
      return Observable.create(function(sink) {
        var subscription2 = cachedRequest.subject.subscribe(sink);
        return function() {
          subscription2.unsubscribe();
          var cachedRequestInstance = requestCache.get(cachedRequest.identifier);
          if (cachedRequestInstance) {
            var requestSubscription = cachedRequestInstance.subscription;
            if (requestSubscription != null && cachedRequestInstance.subject.getObserverCount() === 0) {
              requestSubscription.unsubscribe();
              requestCache["delete"](cachedRequest.identifier);
            }
          }
        };
      });
    }
    function getActiveStatusObservableForCachedRequest(environment, requestCache, cachedRequest) {
      return Observable.create(function(sink) {
        var subscription2 = cachedRequest.subjectForInFlightStatus.subscribe({
          error: sink.error,
          next: function next2(response) {
            if (!environment.isRequestActive(cachedRequest.identifier)) {
              sink.complete();
              return;
            }
            sink.next();
          },
          complete: sink.complete,
          unsubscribe: sink.complete
        });
        return function() {
          subscription2.unsubscribe();
        };
      });
    }
    function getPromiseForActiveRequest(environment, request) {
      var requestCache = getRequestCache(environment);
      var cachedRequest = requestCache.get(request.identifier);
      if (!cachedRequest) {
        return null;
      }
      if (!environment.isRequestActive(cachedRequest.identifier)) {
        return null;
      }
      if (RelayFeatureFlags.USE_REACT_CACHE) {
        var existing = cachedRequest.promise;
        if (existing) {
          return existing;
        }
      }
      var promise = new Promise(function(resolve2, reject) {
        var resolveOnNext = false;
        getActiveStatusObservableForCachedRequest(environment, requestCache, cachedRequest).subscribe({
          complete: resolve2,
          error: reject,
          next: function next2(response) {
            if (resolveOnNext) {
              resolve2(response);
            }
          }
        });
        resolveOnNext = true;
      });
      if (RelayFeatureFlags.USE_REACT_CACHE) {
        cachedRequest.promise = promise;
      }
      return promise;
    }
    function getObservableForActiveRequest(environment, request) {
      var requestCache = getRequestCache(environment);
      var cachedRequest = requestCache.get(request.identifier);
      if (!cachedRequest) {
        return null;
      }
      if (!environment.isRequestActive(cachedRequest.identifier)) {
        return null;
      }
      return getActiveStatusObservableForCachedRequest(environment, requestCache, cachedRequest);
    }
    function getRequestCache(environment) {
      var cached = requestCachesByEnvironment.get(environment);
      if (cached != null) {
        return cached;
      }
      var requestCache = /* @__PURE__ */ new Map();
      requestCachesByEnvironment.set(environment, requestCache);
      return requestCache;
    }
    function getCachedRequest(requestCache, identifier2) {
      var cached = requestCache.get(identifier2);
      !(cached != null) ? true ? invariant3(false, "[fetchQueryInternal] getCachedRequest: Expected request to be cached") : invariant3(false) : void 0;
      return cached;
    }
    module.exports = {
      fetchQuery: fetchQuery7,
      fetchQueryDeduped,
      getPromiseForActiveRequest,
      getObservableForActiveRequest
    };
  }
});

// node_modules/relay-runtime/lib/query/fetchQuery.js
var require_fetchQuery2 = __commonJS({
  "node_modules/relay-runtime/lib/query/fetchQuery.js"(exports, module) {
    "use strict";
    var _interopRequireDefault = require_interopRequireDefault()["default"];
    var _objectSpread210 = _interopRequireDefault(require_objectSpread2());
    var RelayObservable = require_RelayObservable2();
    var _require = require_RelayModernOperationDescriptor2();
    var createOperationDescriptor = _require.createOperationDescriptor;
    var handlePotentialSnapshotErrors = require_handlePotentialSnapshotErrors2();
    var fetchQueryInternal = require_fetchQueryInternal2();
    var _require2 = require_GraphQLTag2();
    var getRequest = _require2.getRequest;
    var invariant3 = require_browser();
    function fetchQuery7(environment, query2, variables, options) {
      var _options$fetchPolicy;
      var queryNode = getRequest(query2);
      !(queryNode.params.operationKind === "query") ? true ? invariant3(false, "fetchQuery: Expected query operation") : invariant3(false) : void 0;
      var networkCacheConfig = (0, _objectSpread210["default"])({
        force: true
      }, options === null || options === void 0 ? void 0 : options.networkCacheConfig);
      var operation = createOperationDescriptor(queryNode, variables, networkCacheConfig);
      var fetchPolicy = (_options$fetchPolicy = options === null || options === void 0 ? void 0 : options.fetchPolicy) !== null && _options$fetchPolicy !== void 0 ? _options$fetchPolicy : "network-only";
      function readData(snapshot) {
        handlePotentialSnapshotErrors(environment, snapshot.missingRequiredFields, snapshot.relayResolverErrors);
        return snapshot.data;
      }
      switch (fetchPolicy) {
        case "network-only": {
          return getNetworkObservable(environment, operation).map(readData);
        }
        case "store-or-network": {
          if (environment.check(operation).status === "available") {
            return RelayObservable.from(environment.lookup(operation.fragment)).map(readData);
          }
          return getNetworkObservable(environment, operation).map(readData);
        }
        default:
          fetchPolicy;
          throw new Error("fetchQuery: Invalid fetchPolicy " + fetchPolicy);
      }
    }
    function getNetworkObservable(environment, operation) {
      return fetchQueryInternal.fetchQuery(environment, operation).map(function() {
        return environment.lookup(operation.fragment);
      });
    }
    module.exports = fetchQuery7;
  }
});

// node_modules/relay-runtime/lib/query/fetchQuery_DEPRECATED.js
var require_fetchQuery_DEPRECATED2 = __commonJS({
  "node_modules/relay-runtime/lib/query/fetchQuery_DEPRECATED.js"(exports, module) {
    "use strict";
    var _require = require_RelayModernOperationDescriptor2();
    var createOperationDescriptor = _require.createOperationDescriptor;
    var _require2 = require_GraphQLTag2();
    var getRequest = _require2.getRequest;
    function fetchQuery_DEPRECATED(environment, taggedNode, variables, cacheConfig) {
      var query2 = getRequest(taggedNode);
      if (query2.params.operationKind !== "query") {
        throw new Error("fetchQuery: Expected query operation");
      }
      var operation = createOperationDescriptor(query2, variables, cacheConfig);
      return environment.execute({
        operation
      }).map(function() {
        return environment.lookup(operation.fragment).data;
      }).toPromise();
    }
    module.exports = fetchQuery_DEPRECATED;
  }
});

// node_modules/relay-runtime/lib/query/PreloadableQueryRegistry.js
var require_PreloadableQueryRegistry2 = __commonJS({
  "node_modules/relay-runtime/lib/query/PreloadableQueryRegistry.js"(exports, module) {
    "use strict";
    var PreloadableQueryRegistry = /* @__PURE__ */ function() {
      function PreloadableQueryRegistry2() {
        this._preloadableQueries = /* @__PURE__ */ new Map();
        this._callbacks = /* @__PURE__ */ new Map();
      }
      var _proto = PreloadableQueryRegistry2.prototype;
      _proto.set = function set3(key, value) {
        this._preloadableQueries.set(key, value);
        var callbacks = this._callbacks.get(key);
        if (callbacks != null) {
          callbacks.forEach(function(cb) {
            try {
              cb(value);
            } catch (e3) {
              setTimeout(function() {
                throw e3;
              }, 0);
            }
          });
        }
      };
      _proto.get = function get3(key) {
        return this._preloadableQueries.get(key);
      };
      _proto.onLoad = function onLoad(key, callback) {
        var _this$_callbacks$get;
        var callbacks = (_this$_callbacks$get = this._callbacks.get(key)) !== null && _this$_callbacks$get !== void 0 ? _this$_callbacks$get : /* @__PURE__ */ new Set();
        callbacks.add(callback);
        var dispose2 = function dispose3() {
          callbacks["delete"](callback);
        };
        this._callbacks.set(key, callbacks);
        return {
          dispose: dispose2
        };
      };
      _proto.clear = function clear2() {
        this._preloadableQueries.clear();
      };
      return PreloadableQueryRegistry2;
    }();
    var preloadableQueryRegistry = new PreloadableQueryRegistry();
    module.exports = preloadableQueryRegistry;
  }
});

// node_modules/relay-runtime/lib/util/getPendingOperationsForFragment.js
var require_getPendingOperationsForFragment2 = __commonJS({
  "node_modules/relay-runtime/lib/util/getPendingOperationsForFragment.js"(exports, module) {
    "use strict";
    var _require = require_fetchQueryInternal2();
    var getPromiseForActiveRequest = _require.getPromiseForActiveRequest;
    function getPendingOperationsForFragment(environment, fragmentNode, fragmentOwner) {
      var _pendingOperations$ma, _pendingOperations;
      var pendingOperations = [];
      var promise = getPromiseForActiveRequest(environment, fragmentOwner);
      if (promise != null) {
        pendingOperations = [fragmentOwner];
      } else {
        var _result$pendingOperat, _result$promise;
        var result = environment.getOperationTracker().getPendingOperationsAffectingOwner(fragmentOwner);
        pendingOperations = (_result$pendingOperat = result === null || result === void 0 ? void 0 : result.pendingOperations) !== null && _result$pendingOperat !== void 0 ? _result$pendingOperat : [];
        promise = (_result$promise = result === null || result === void 0 ? void 0 : result.promise) !== null && _result$promise !== void 0 ? _result$promise : null;
      }
      if (!promise) {
        return null;
      }
      var pendingOperationName = (_pendingOperations$ma = (_pendingOperations = pendingOperations) === null || _pendingOperations === void 0 ? void 0 : _pendingOperations.map(function(op) {
        return op.node.params.name;
      }).join(",")) !== null && _pendingOperations$ma !== void 0 ? _pendingOperations$ma : null;
      if (pendingOperationName == null || pendingOperationName.length === 0) {
        pendingOperationName = "Unknown pending operation";
      }
      var fragmentName = fragmentNode.name;
      var promiseDisplayName = pendingOperationName === fragmentName ? "Relay(".concat(pendingOperationName, ")") : "Relay(".concat(pendingOperationName, ":").concat(fragmentName, ")");
      promise.displayName = promiseDisplayName;
      return {
        promise,
        pendingOperations
      };
    }
    module.exports = getPendingOperationsForFragment;
  }
});

// node_modules/relay-runtime/lib/util/isScalarAndEqual.js
var require_isScalarAndEqual2 = __commonJS({
  "node_modules/relay-runtime/lib/util/isScalarAndEqual.js"(exports, module) {
    "use strict";
    function isScalarAndEqual(valueA, valueB) {
      return valueA === valueB && (valueA === null || typeof valueA !== "object");
    }
    module.exports = isScalarAndEqual;
  }
});

// node_modules/relay-runtime/lib/util/recycleNodesInto.js
var require_recycleNodesInto2 = __commonJS({
  "node_modules/relay-runtime/lib/util/recycleNodesInto.js"(exports, module) {
    "use strict";
    var hasWeakSetDefined = typeof WeakSet !== "undefined";
    var hasWeakMapDefined = typeof WeakMap !== "undefined";
    function recycleNodesInto(prevData, nextData) {
      if (prevData === nextData || typeof prevData !== "object" || prevData instanceof Set || prevData instanceof Map || hasWeakSetDefined && prevData instanceof WeakSet || hasWeakMapDefined && prevData instanceof WeakMap || !prevData || typeof nextData !== "object" || nextData instanceof Set || nextData instanceof Map || hasWeakSetDefined && nextData instanceof WeakSet || hasWeakMapDefined && nextData instanceof WeakMap || !nextData) {
        return nextData;
      }
      var canRecycle = false;
      var prevArray = Array.isArray(prevData) ? prevData : null;
      var nextArray = Array.isArray(nextData) ? nextData : null;
      if (prevArray && nextArray) {
        canRecycle = nextArray.reduce(function(wasEqual, nextItem, ii) {
          var prevValue = prevArray[ii];
          var nextValue = recycleNodesInto(prevValue, nextItem);
          if (nextValue !== nextArray[ii]) {
            if (true) {
              if (!Object.isFrozen(nextArray)) {
                nextArray[ii] = nextValue;
              }
            } else {
              nextArray[ii] = nextValue;
            }
          }
          return wasEqual && nextValue === prevArray[ii];
        }, true) && prevArray.length === nextArray.length;
      } else if (!prevArray && !nextArray) {
        var prevObject = prevData;
        var nextObject = nextData;
        var prevKeys = Object.keys(prevObject);
        var nextKeys = Object.keys(nextObject);
        canRecycle = nextKeys.reduce(function(wasEqual, key) {
          var prevValue = prevObject[key];
          var nextValue = recycleNodesInto(prevValue, nextObject[key]);
          if (nextValue !== nextObject[key]) {
            if (true) {
              if (!Object.isFrozen(nextObject)) {
                nextObject[key] = nextValue;
              }
            } else {
              nextObject[key] = nextValue;
            }
          }
          return wasEqual && nextValue === prevObject[key];
        }, true) && prevKeys.length === nextKeys.length;
      }
      return canRecycle ? prevData : nextData;
    }
    module.exports = recycleNodesInto;
  }
});

// node_modules/relay-runtime/lib/store/RelayModernFragmentSpecResolver.js
var require_RelayModernFragmentSpecResolver2 = __commonJS({
  "node_modules/relay-runtime/lib/store/RelayModernFragmentSpecResolver.js"(exports, module) {
    "use strict";
    var _interopRequireDefault = require_interopRequireDefault()["default"];
    var _objectSpread210 = _interopRequireDefault(require_objectSpread2());
    var _defineProperty210 = _interopRequireDefault(require_defineProperty());
    var getPendingOperationsForFragment = require_getPendingOperationsForFragment2();
    var handlePotentialSnapshotErrors = require_handlePotentialSnapshotErrors2();
    var isScalarAndEqual = require_isScalarAndEqual2();
    var recycleNodesInto = require_recycleNodesInto2();
    var RelayFeatureFlags = require_RelayFeatureFlags2();
    var _require = require_RelayModernOperationDescriptor2();
    var createRequestDescriptor = _require.createRequestDescriptor;
    var _require2 = require_RelayModernSelector2();
    var areEqualSelectors = _require2.areEqualSelectors;
    var createReaderSelector = _require2.createReaderSelector;
    var getSelectorsFromObject = _require2.getSelectorsFromObject;
    var areEqual2 = require_areEqual();
    var invariant3 = require_browser();
    var warning2 = require_warning();
    var RelayModernFragmentSpecResolver = /* @__PURE__ */ function() {
      function RelayModernFragmentSpecResolver2(context2, fragments, props, callback, rootIsQueryRenderer) {
        var _this = this;
        (0, _defineProperty210["default"])(this, "_onChange", function() {
          _this._stale = true;
          if (typeof _this._callback === "function") {
            _this._callback();
          }
        });
        this._callback = callback;
        this._context = context2;
        this._data = {};
        this._fragments = fragments;
        this._props = {};
        this._resolvers = {};
        this._stale = false;
        this._rootIsQueryRenderer = rootIsQueryRenderer;
        this.setProps(props);
      }
      var _proto = RelayModernFragmentSpecResolver2.prototype;
      _proto.dispose = function dispose2() {
        for (var key in this._resolvers) {
          if (this._resolvers.hasOwnProperty(key)) {
            disposeCallback(this._resolvers[key]);
          }
        }
      };
      _proto.resolve = function resolve2() {
        if (this._stale) {
          var prevData = this._data;
          var nextData;
          for (var key in this._resolvers) {
            if (this._resolvers.hasOwnProperty(key)) {
              var resolver = this._resolvers[key];
              var prevItem = prevData[key];
              if (resolver) {
                var nextItem = resolver.resolve();
                if (nextData || nextItem !== prevItem) {
                  nextData = nextData || (0, _objectSpread210["default"])({}, prevData);
                  nextData[key] = nextItem;
                }
              } else {
                var prop = this._props[key];
                var _nextItem = prop !== void 0 ? prop : null;
                if (nextData || !isScalarAndEqual(_nextItem, prevItem)) {
                  nextData = nextData || (0, _objectSpread210["default"])({}, prevData);
                  nextData[key] = _nextItem;
                }
              }
            }
          }
          this._data = nextData || prevData;
          this._stale = false;
        }
        return this._data;
      };
      _proto.setCallback = function setCallback(props, callback) {
        this._callback = callback;
        if (RelayFeatureFlags.ENABLE_CONTAINERS_SUBSCRIBE_ON_COMMIT === true) {
          this.setProps(props);
        }
      };
      _proto.setProps = function setProps(props) {
        this._props = {};
        var ownedSelectors = getSelectorsFromObject(this._fragments, props);
        for (var key in ownedSelectors) {
          if (ownedSelectors.hasOwnProperty(key)) {
            var ownedSelector = ownedSelectors[key];
            var resolver = this._resolvers[key];
            if (ownedSelector == null) {
              if (resolver != null) {
                resolver.dispose();
              }
              resolver = null;
            } else if (ownedSelector.kind === "PluralReaderSelector") {
              if (resolver == null) {
                resolver = new SelectorListResolver(this._context.environment, this._rootIsQueryRenderer, ownedSelector, this._callback != null, this._onChange);
              } else {
                !(resolver instanceof SelectorListResolver) ? true ? invariant3(false, "RelayModernFragmentSpecResolver: Expected prop `%s` to always be an array.", key) : invariant3(false) : void 0;
                resolver.setSelector(ownedSelector);
              }
            } else {
              if (resolver == null) {
                resolver = new SelectorResolver(this._context.environment, this._rootIsQueryRenderer, ownedSelector, this._callback != null, this._onChange);
              } else {
                !(resolver instanceof SelectorResolver) ? true ? invariant3(false, "RelayModernFragmentSpecResolver: Expected prop `%s` to always be an object.", key) : invariant3(false) : void 0;
                resolver.setSelector(ownedSelector);
              }
            }
            this._props[key] = props[key];
            this._resolvers[key] = resolver;
          }
        }
        this._stale = true;
      };
      _proto.setVariables = function setVariables(variables, request) {
        for (var key in this._resolvers) {
          if (this._resolvers.hasOwnProperty(key)) {
            var resolver = this._resolvers[key];
            if (resolver) {
              resolver.setVariables(variables, request);
            }
          }
        }
        this._stale = true;
      };
      return RelayModernFragmentSpecResolver2;
    }();
    var SelectorResolver = /* @__PURE__ */ function() {
      function SelectorResolver2(environment, rootIsQueryRenderer, selector, subscribeOnConstruction, callback) {
        var _this2 = this;
        (0, _defineProperty210["default"])(this, "_onChange", function(snapshot) {
          _this2._data = snapshot.data;
          _this2._isMissingData = snapshot.isMissingData;
          _this2._missingRequiredFields = snapshot.missingRequiredFields;
          _this2._relayResolverErrors = snapshot.relayResolverErrors;
          _this2._callback();
        });
        var _snapshot = environment.lookup(selector);
        this._callback = callback;
        this._data = _snapshot.data;
        this._isMissingData = _snapshot.isMissingData;
        this._missingRequiredFields = _snapshot.missingRequiredFields;
        this._relayResolverErrors = _snapshot.relayResolverErrors;
        this._environment = environment;
        this._rootIsQueryRenderer = rootIsQueryRenderer;
        this._selector = selector;
        if (RelayFeatureFlags.ENABLE_CONTAINERS_SUBSCRIBE_ON_COMMIT === true) {
          if (subscribeOnConstruction) {
            this._subscription = environment.subscribe(_snapshot, this._onChange);
          }
        } else {
          this._subscription = environment.subscribe(_snapshot, this._onChange);
        }
      }
      var _proto2 = SelectorResolver2.prototype;
      _proto2.dispose = function dispose2() {
        if (this._subscription) {
          this._subscription.dispose();
          this._subscription = null;
        }
      };
      _proto2.resolve = function resolve2() {
        if (this._isMissingData === true) {
          var pendingOperationsResult = getPendingOperationsForFragment(this._environment, this._selector.node, this._selector.owner);
          var promise = pendingOperationsResult === null || pendingOperationsResult === void 0 ? void 0 : pendingOperationsResult.promise;
          if (promise != null) {
            if (this._rootIsQueryRenderer) {
              true ? warning2(false, "Relay: Relay Container for fragment `%s` has missing data and would suspend. When using features such as @defer or @module, use `useFragment` instead of a Relay Container.", this._selector.node.name) : void 0;
            } else {
              var _pendingOperationsRes;
              var pendingOperations = (_pendingOperationsRes = pendingOperationsResult === null || pendingOperationsResult === void 0 ? void 0 : pendingOperationsResult.pendingOperations) !== null && _pendingOperationsRes !== void 0 ? _pendingOperationsRes : [];
              true ? warning2(false, "Relay: Relay Container for fragment `%s` suspended. When using features such as @defer or @module, use `useFragment` instead of a Relay Container.", this._selector.node.name) : void 0;
              this._environment.__log({
                name: "suspense.fragment",
                data: this._data,
                fragment: this._selector.node,
                isRelayHooks: false,
                isMissingData: this._isMissingData,
                isPromiseCached: false,
                pendingOperations
              });
              throw promise;
            }
          }
        }
        handlePotentialSnapshotErrors(this._environment, this._missingRequiredFields, this._relayResolverErrors);
        return this._data;
      };
      _proto2.setSelector = function setSelector(selector) {
        if (this._subscription != null && areEqualSelectors(selector, this._selector)) {
          return;
        }
        this.dispose();
        var snapshot = this._environment.lookup(selector);
        this._data = recycleNodesInto(this._data, snapshot.data);
        this._isMissingData = snapshot.isMissingData;
        this._missingRequiredFields = snapshot.missingRequiredFields;
        this._relayResolverErrors = snapshot.relayResolverErrors;
        this._selector = selector;
        this._subscription = this._environment.subscribe(snapshot, this._onChange);
      };
      _proto2.setVariables = function setVariables(variables, request) {
        if (areEqual2(variables, this._selector.variables)) {
          return;
        }
        var requestDescriptor = createRequestDescriptor(request, variables);
        var selector = createReaderSelector(this._selector.node, this._selector.dataID, variables, requestDescriptor);
        this.setSelector(selector);
      };
      return SelectorResolver2;
    }();
    var SelectorListResolver = /* @__PURE__ */ function() {
      function SelectorListResolver2(environment, rootIsQueryRenderer, selector, subscribeOnConstruction, callback) {
        var _this3 = this;
        (0, _defineProperty210["default"])(this, "_onChange", function(data) {
          _this3._stale = true;
          _this3._callback();
        });
        this._callback = callback;
        this._data = [];
        this._environment = environment;
        this._resolvers = [];
        this._stale = true;
        this._rootIsQueryRenderer = rootIsQueryRenderer;
        this._subscribeOnConstruction = subscribeOnConstruction;
        this.setSelector(selector);
      }
      var _proto3 = SelectorListResolver2.prototype;
      _proto3.dispose = function dispose2() {
        this._resolvers.forEach(disposeCallback);
      };
      _proto3.resolve = function resolve2() {
        if (this._stale) {
          var prevData = this._data;
          var nextData;
          for (var ii = 0; ii < this._resolvers.length; ii++) {
            var prevItem = prevData[ii];
            var nextItem = this._resolvers[ii].resolve();
            if (nextData || nextItem !== prevItem) {
              nextData = nextData || prevData.slice(0, ii);
              nextData.push(nextItem);
            }
          }
          if (!nextData && this._resolvers.length !== prevData.length) {
            nextData = prevData.slice(0, this._resolvers.length);
          }
          this._data = nextData || prevData;
          this._stale = false;
        }
        return this._data;
      };
      _proto3.setSelector = function setSelector(selector) {
        var selectors = selector.selectors;
        while (this._resolvers.length > selectors.length) {
          var resolver = this._resolvers.pop();
          resolver.dispose();
        }
        for (var ii = 0; ii < selectors.length; ii++) {
          if (ii < this._resolvers.length) {
            this._resolvers[ii].setSelector(selectors[ii]);
          } else {
            this._resolvers[ii] = new SelectorResolver(this._environment, this._rootIsQueryRenderer, selectors[ii], this._subscribeOnConstruction, this._onChange);
          }
        }
        this._stale = true;
      };
      _proto3.setVariables = function setVariables(variables, request) {
        this._resolvers.forEach(function(resolver) {
          return resolver.setVariables(variables, request);
        });
        this._stale = true;
      };
      return SelectorListResolver2;
    }();
    function disposeCallback(disposable) {
      disposable && disposable.dispose();
    }
    module.exports = RelayModernFragmentSpecResolver;
  }
});

// node_modules/relay-runtime/lib/store/createFragmentSpecResolver.js
var require_createFragmentSpecResolver2 = __commonJS({
  "node_modules/relay-runtime/lib/store/createFragmentSpecResolver.js"(exports, module) {
    "use strict";
    var RelayModernFragmentSpecResolver = require_RelayModernFragmentSpecResolver2();
    var warning2 = require_warning();
    function createFragmentSpecResolver(context2, containerName, fragments, props, rootIsQueryRenderer, callback) {
      if (true) {
        var fragmentNames = Object.keys(fragments);
        fragmentNames.forEach(function(fragmentName) {
          var propValue = props[fragmentName];
          true ? warning2(propValue !== void 0, "createFragmentSpecResolver: Expected prop `%s` to be supplied to `%s`, but got `undefined`. Pass an explicit `null` if this is intentional.", fragmentName, containerName) : void 0;
        });
      }
      return new RelayModernFragmentSpecResolver(context2, fragments, props, callback, rootIsQueryRenderer);
    }
    module.exports = createFragmentSpecResolver;
  }
});

// node_modules/relay-runtime/lib/store/createRelayContext.js
var require_createRelayContext2 = __commonJS({
  "node_modules/relay-runtime/lib/store/createRelayContext.js"(exports, module) {
    "use strict";
    var invariant3 = require_browser();
    var relayContext;
    var firstReact;
    function createRelayContext(react) {
      if (!relayContext) {
        relayContext = react.createContext(null);
        if (true) {
          relayContext.displayName = "RelayContext";
        }
        firstReact = react;
      }
      !(react === firstReact) ? true ? invariant3(false, "[createRelayContext]: You are passing a different instance of React", react.version) : invariant3(false) : void 0;
      return relayContext;
    }
    module.exports = createRelayContext;
  }
});

// node_modules/relay-runtime/lib/store/readInlineData.js
var require_readInlineData2 = __commonJS({
  "node_modules/relay-runtime/lib/store/readInlineData.js"(exports, module) {
    "use strict";
    var _require = require_GraphQLTag2();
    var getInlineDataFragment = _require.getInlineDataFragment;
    var _require2 = require_RelayStoreUtils2();
    var FRAGMENTS_KEY = _require2.FRAGMENTS_KEY;
    var invariant3 = require_browser();
    function readInlineData(fragment2, fragmentRef) {
      var _fragmentRef$FRAGMENT;
      var inlineDataFragment = getInlineDataFragment(fragment2);
      if (fragmentRef == null) {
        return fragmentRef;
      }
      !(typeof fragmentRef === "object") ? true ? invariant3(false, "readInlineData(): Expected an object, got `%s`.", typeof fragmentRef) : invariant3(false) : void 0;
      var inlineData = (_fragmentRef$FRAGMENT = fragmentRef[FRAGMENTS_KEY]) === null || _fragmentRef$FRAGMENT === void 0 ? void 0 : _fragmentRef$FRAGMENT[inlineDataFragment.name];
      !(inlineData != null) ? true ? invariant3(false, "readInlineData(): Expected fragment `%s` to be spread in the parent fragment.", inlineDataFragment.name) : invariant3(false) : void 0;
      return inlineData;
    }
    module.exports = readInlineData;
  }
});

// node_modules/relay-runtime/lib/multi-actor-environment/ActorIdentifier.js
var require_ActorIdentifier2 = __commonJS({
  "node_modules/relay-runtime/lib/multi-actor-environment/ActorIdentifier.js"(exports, module) {
    "use strict";
    var invariant3 = require_browser();
    var INTERNAL_ACTOR_IDENTIFIER_DO_NOT_USE = "INTERNAL_ACTOR_IDENTIFIER_DO_NOT_USE";
    function assertInternalActorIndentifier(actorIdentifier) {
      !(actorIdentifier === INTERNAL_ACTOR_IDENTIFIER_DO_NOT_USE) ? true ? invariant3(false, 'Expected to use only internal version of the `actorIdentifier`. "%s" was provided.', actorIdentifier) : invariant3(false) : void 0;
    }
    module.exports = {
      assertInternalActorIndentifier,
      getActorIdentifier: function getActorIdentifier(actorID) {
        return actorID;
      },
      getDefaultActorIdentifier: function getDefaultActorIdentifier() {
        throw new Error("Not Implemented");
      },
      INTERNAL_ACTOR_IDENTIFIER_DO_NOT_USE
    };
  }
});

// node_modules/relay-runtime/lib/util/generateID.js
var require_generateID2 = __commonJS({
  "node_modules/relay-runtime/lib/util/generateID.js"(exports, module) {
    "use strict";
    var id2 = 1e5;
    function generateID() {
      return id2++;
    }
    module.exports = generateID;
  }
});

// node_modules/relay-runtime/lib/network/wrapNetworkWithLogObserver.js
var require_wrapNetworkWithLogObserver2 = __commonJS({
  "node_modules/relay-runtime/lib/network/wrapNetworkWithLogObserver.js"(exports, module) {
    "use strict";
    var generateID = require_generateID2();
    function wrapNetworkWithLogObserver(env, network) {
      return {
        execute: function execute(params, variables, cacheConfig, uploadables) {
          var networkRequestId = generateID();
          var logObserver = {
            start: function start(subscription2) {
              env.__log({
                name: "network.start",
                networkRequestId,
                params,
                variables,
                cacheConfig
              });
            },
            next: function next2(response) {
              env.__log({
                name: "network.next",
                networkRequestId,
                response
              });
            },
            error: function error(_error) {
              env.__log({
                name: "network.error",
                networkRequestId,
                error: _error
              });
            },
            complete: function complete() {
              env.__log({
                name: "network.complete",
                networkRequestId
              });
            },
            unsubscribe: function unsubscribe() {
              env.__log({
                name: "network.unsubscribe",
                networkRequestId
              });
            }
          };
          var logRequestInfo = function logRequestInfo2(info) {
            env.__log({
              name: "network.info",
              networkRequestId,
              info
            });
          };
          return network.execute(params, variables, cacheConfig, uploadables, logRequestInfo)["do"](logObserver);
        }
      };
    }
    module.exports = wrapNetworkWithLogObserver;
  }
});

// node_modules/relay-runtime/lib/store/RelayOperationTracker.js
var require_RelayOperationTracker2 = __commonJS({
  "node_modules/relay-runtime/lib/store/RelayOperationTracker.js"(exports, module) {
    "use strict";
    var _interopRequireDefault = require_interopRequireDefault()["default"];
    var _createForOfIteratorHelper2 = _interopRequireDefault(require_createForOfIteratorHelper());
    var invariant3 = require_browser();
    var RelayOperationTracker = /* @__PURE__ */ function() {
      function RelayOperationTracker2() {
        this._ownersToPendingOperations = /* @__PURE__ */ new Map();
        this._pendingOperationsToOwners = /* @__PURE__ */ new Map();
        this._ownersToPendingPromise = /* @__PURE__ */ new Map();
      }
      var _proto = RelayOperationTracker2.prototype;
      _proto.update = function update(pendingOperation, affectedOwners) {
        if (affectedOwners.size === 0) {
          return;
        }
        var pendingOperationIdentifier = pendingOperation.identifier;
        var newlyAffectedOwnersIdentifier = /* @__PURE__ */ new Set();
        var _iterator = (0, _createForOfIteratorHelper2["default"])(affectedOwners), _step;
        try {
          for (_iterator.s(); !(_step = _iterator.n()).done; ) {
            var owner = _step.value;
            var ownerIdentifier = owner.identifier;
            var pendingOperationsAffectingOwner = this._ownersToPendingOperations.get(ownerIdentifier);
            if (pendingOperationsAffectingOwner != null) {
              if (!pendingOperationsAffectingOwner.has(pendingOperationIdentifier)) {
                pendingOperationsAffectingOwner.set(pendingOperationIdentifier, pendingOperation);
                newlyAffectedOwnersIdentifier.add(ownerIdentifier);
              }
            } else {
              this._ownersToPendingOperations.set(ownerIdentifier, /* @__PURE__ */ new Map([[pendingOperationIdentifier, pendingOperation]]));
              newlyAffectedOwnersIdentifier.add(ownerIdentifier);
            }
          }
        } catch (err) {
          _iterator.e(err);
        } finally {
          _iterator.f();
        }
        if (newlyAffectedOwnersIdentifier.size === 0) {
          return;
        }
        var ownersAffectedByPendingOperation = this._pendingOperationsToOwners.get(pendingOperationIdentifier) || /* @__PURE__ */ new Set();
        var _iterator2 = (0, _createForOfIteratorHelper2["default"])(newlyAffectedOwnersIdentifier), _step2;
        try {
          for (_iterator2.s(); !(_step2 = _iterator2.n()).done; ) {
            var _ownerIdentifier = _step2.value;
            this._resolveOwnerResolvers(_ownerIdentifier);
            ownersAffectedByPendingOperation.add(_ownerIdentifier);
          }
        } catch (err) {
          _iterator2.e(err);
        } finally {
          _iterator2.f();
        }
        this._pendingOperationsToOwners.set(pendingOperationIdentifier, ownersAffectedByPendingOperation);
      };
      _proto.complete = function complete(pendingOperation) {
        var pendingOperationIdentifier = pendingOperation.identifier;
        var affectedOwnersIdentifier = this._pendingOperationsToOwners.get(pendingOperationIdentifier);
        if (affectedOwnersIdentifier == null) {
          return;
        }
        var completedOwnersIdentifier = /* @__PURE__ */ new Set();
        var updatedOwnersIdentifier = /* @__PURE__ */ new Set();
        var _iterator3 = (0, _createForOfIteratorHelper2["default"])(affectedOwnersIdentifier), _step3;
        try {
          for (_iterator3.s(); !(_step3 = _iterator3.n()).done; ) {
            var ownerIdentifier = _step3.value;
            var pendingOperationsAffectingOwner = this._ownersToPendingOperations.get(ownerIdentifier);
            if (!pendingOperationsAffectingOwner) {
              continue;
            }
            pendingOperationsAffectingOwner["delete"](pendingOperationIdentifier);
            if (pendingOperationsAffectingOwner.size > 0) {
              updatedOwnersIdentifier.add(ownerIdentifier);
            } else {
              completedOwnersIdentifier.add(ownerIdentifier);
            }
          }
        } catch (err) {
          _iterator3.e(err);
        } finally {
          _iterator3.f();
        }
        var _iterator4 = (0, _createForOfIteratorHelper2["default"])(completedOwnersIdentifier), _step4;
        try {
          for (_iterator4.s(); !(_step4 = _iterator4.n()).done; ) {
            var _ownerIdentifier2 = _step4.value;
            this._resolveOwnerResolvers(_ownerIdentifier2);
            this._ownersToPendingOperations["delete"](_ownerIdentifier2);
          }
        } catch (err) {
          _iterator4.e(err);
        } finally {
          _iterator4.f();
        }
        var _iterator5 = (0, _createForOfIteratorHelper2["default"])(updatedOwnersIdentifier), _step5;
        try {
          for (_iterator5.s(); !(_step5 = _iterator5.n()).done; ) {
            var _ownerIdentifier3 = _step5.value;
            this._resolveOwnerResolvers(_ownerIdentifier3);
          }
        } catch (err) {
          _iterator5.e(err);
        } finally {
          _iterator5.f();
        }
        this._pendingOperationsToOwners["delete"](pendingOperationIdentifier);
      };
      _proto._resolveOwnerResolvers = function _resolveOwnerResolvers(ownerIdentifier) {
        var promiseEntry = this._ownersToPendingPromise.get(ownerIdentifier);
        if (promiseEntry != null) {
          promiseEntry.resolve();
        }
        this._ownersToPendingPromise["delete"](ownerIdentifier);
      };
      _proto.getPendingOperationsAffectingOwner = function getPendingOperationsAffectingOwner(owner) {
        var ownerIdentifier = owner.identifier;
        var pendingOperationsForOwner = this._ownersToPendingOperations.get(ownerIdentifier);
        if (pendingOperationsForOwner == null || pendingOperationsForOwner.size === 0) {
          return null;
        }
        var cachedPromiseEntry = this._ownersToPendingPromise.get(ownerIdentifier);
        if (cachedPromiseEntry != null) {
          return {
            promise: cachedPromiseEntry.promise,
            pendingOperations: cachedPromiseEntry.pendingOperations
          };
        }
        var resolve2;
        var promise = new Promise(function(r3) {
          resolve2 = r3;
        });
        !(resolve2 != null) ? true ? invariant3(false, "RelayOperationTracker: Expected resolver to be defined. If youare seeing this, it is likely a bug in Relay.") : invariant3(false) : void 0;
        var pendingOperations = Array.from(pendingOperationsForOwner.values());
        this._ownersToPendingPromise.set(ownerIdentifier, {
          promise,
          resolve: resolve2,
          pendingOperations
        });
        return {
          promise,
          pendingOperations
        };
      };
      return RelayOperationTracker2;
    }();
    module.exports = RelayOperationTracker;
  }
});

// node_modules/relay-runtime/lib/util/registerEnvironmentWithDevTools.js
var require_registerEnvironmentWithDevTools2 = __commonJS({
  "node_modules/relay-runtime/lib/util/registerEnvironmentWithDevTools.js"(exports, module) {
    "use strict";
    function registerEnvironmentWithDevTools(environment) {
      var _global = typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : void 0;
      var devToolsHook = _global && _global.__RELAY_DEVTOOLS_HOOK__;
      if (devToolsHook) {
        devToolsHook.registerEnvironment(environment);
      }
    }
    module.exports = registerEnvironmentWithDevTools;
  }
});

// node_modules/relay-runtime/lib/store/ViewerPattern.js
var require_ViewerPattern2 = __commonJS({
  "node_modules/relay-runtime/lib/store/ViewerPattern.js"(exports, module) {
    "use strict";
    var _require = require_ClientID2();
    var generateClientID = _require.generateClientID;
    var _require2 = require_RelayStoreUtils2();
    var ROOT_ID = _require2.ROOT_ID;
    var VIEWER_ID = generateClientID(ROOT_ID, "viewer");
    var VIEWER_TYPE = "Viewer";
    module.exports = {
      VIEWER_ID,
      VIEWER_TYPE
    };
  }
});

// node_modules/relay-runtime/lib/store/defaultGetDataID.js
var require_defaultGetDataID2 = __commonJS({
  "node_modules/relay-runtime/lib/store/defaultGetDataID.js"(exports, module) {
    "use strict";
    var _require = require_ViewerPattern2();
    var VIEWER_ID = _require.VIEWER_ID;
    var VIEWER_TYPE = _require.VIEWER_TYPE;
    function defaultGetDataID(fieldValue, typeName2) {
      if (typeName2 === VIEWER_TYPE) {
        return fieldValue.id == null ? VIEWER_ID : fieldValue.id;
      }
      return fieldValue.id;
    }
    module.exports = defaultGetDataID;
  }
});

// node_modules/relay-runtime/lib/store/defaultRequiredFieldLogger.js
var require_defaultRequiredFieldLogger2 = __commonJS({
  "node_modules/relay-runtime/lib/store/defaultRequiredFieldLogger.js"(exports, module) {
    "use strict";
    var defaultRequiredFieldLogger = function defaultRequiredFieldLogger2(event) {
      if (event.kind === "missing_field.log") {
        throw new Error("Relay Environment Configuration Error (dev only): `@required(action: LOG)` requires that the Relay Environment be configured with a `requiredFieldLogger`.");
      }
    };
    module.exports = defaultRequiredFieldLogger;
  }
});

// node_modules/relay-runtime/lib/util/getOperation.js
var require_getOperation2 = __commonJS({
  "node_modules/relay-runtime/lib/util/getOperation.js"(exports, module) {
    "use strict";
    var _require = require_RelayConcreteNode2();
    var REQUEST = _require.REQUEST;
    var SPLIT_OPERATION = _require.SPLIT_OPERATION;
    function getOperation(node56) {
      switch (node56.kind) {
        case REQUEST:
          return node56.operation;
        case SPLIT_OPERATION:
        default:
          return node56;
      }
    }
    module.exports = getOperation;
  }
});

// node_modules/relay-runtime/lib/util/RelayError.js
var require_RelayError2 = __commonJS({
  "node_modules/relay-runtime/lib/util/RelayError.js"(exports, module) {
    "use strict";
    function createError(type, name2, messageFormat) {
      for (var _len = arguments.length, messageParams = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
        messageParams[_key - 3] = arguments[_key];
      }
      var index = 0;
      var message = messageFormat.replace(/%s/g, function() {
        return String(messageParams[index++]);
      });
      var err = new Error(message);
      var error = Object.assign(err, {
        name: name2,
        messageFormat,
        messageParams,
        type,
        taalOpcodes: [2, 2]
        // skip frame (code=2) twice
      });
      if (error.stack === void 0) {
        try {
          throw error;
        } catch (_unused) {
        }
      }
      return error;
    }
    module.exports = {
      create: function create4(name2, messageFormat) {
        for (var _len2 = arguments.length, messageParams = new Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
          messageParams[_key2 - 2] = arguments[_key2];
        }
        return createError.apply(void 0, ["error", name2, messageFormat].concat(messageParams));
      },
      createWarning: function createWarning(name2, messageFormat) {
        for (var _len3 = arguments.length, messageParams = new Array(_len3 > 2 ? _len3 - 2 : 0), _key3 = 2; _key3 < _len3; _key3++) {
          messageParams[_key3 - 2] = arguments[_key3];
        }
        return createError.apply(void 0, ["warn", name2, messageFormat].concat(messageParams));
      }
    };
  }
});

// node_modules/relay-runtime/lib/util/withDuration.js
var require_withDuration2 = __commonJS({
  "node_modules/relay-runtime/lib/util/withDuration.js"(exports, module) {
    "use strict";
    var _window;
    var _window$performance;
    var isPerformanceNowAvailable = typeof window !== "undefined" && typeof ((_window = window) === null || _window === void 0 ? void 0 : (_window$performance = _window.performance) === null || _window$performance === void 0 ? void 0 : _window$performance.now) === "function";
    function currentTimestamp() {
      if (isPerformanceNowAvailable) {
        return window.performance.now();
      }
      return Date.now();
    }
    function withDuration(cb) {
      var startTime = currentTimestamp();
      var result = cb();
      return [currentTimestamp() - startTime, result];
    }
    module.exports = withDuration;
  }
});

// node_modules/relay-runtime/lib/store/RelayModernRecord.js
var require_RelayModernRecord2 = __commonJS({
  "node_modules/relay-runtime/lib/store/RelayModernRecord.js"(exports, module) {
    "use strict";
    var _interopRequireDefault = require_interopRequireDefault()["default"];
    var _objectSpread210 = _interopRequireDefault(require_objectSpread2());
    var deepFreeze = require_deepFreeze2();
    var _require = require_ClientID2();
    var isClientID = _require.isClientID;
    var _require2 = require_RelayStoreUtils2();
    var ACTOR_IDENTIFIER_KEY = _require2.ACTOR_IDENTIFIER_KEY;
    var ID_KEY = _require2.ID_KEY;
    var INVALIDATED_AT_KEY = _require2.INVALIDATED_AT_KEY;
    var REF_KEY = _require2.REF_KEY;
    var REFS_KEY = _require2.REFS_KEY;
    var ROOT_ID = _require2.ROOT_ID;
    var TYPENAME_KEY = _require2.TYPENAME_KEY;
    var areEqual2 = require_areEqual();
    var invariant3 = require_browser();
    var warning2 = require_warning();
    function clone(record) {
      return (0, _objectSpread210["default"])({}, record);
    }
    function copyFields(source, sink) {
      for (var key in source) {
        if (source.hasOwnProperty(key)) {
          if (key !== ID_KEY && key !== TYPENAME_KEY) {
            sink[key] = source[key];
          }
        }
      }
    }
    function create4(dataID, typeName2) {
      var record = {};
      record[ID_KEY] = dataID;
      record[TYPENAME_KEY] = typeName2;
      return record;
    }
    function getDataID(record) {
      return record[ID_KEY];
    }
    function getType(record) {
      return record[TYPENAME_KEY];
    }
    function getValue(record, storageKey) {
      var value = record[storageKey];
      if (value && typeof value === "object") {
        !(!value.hasOwnProperty(REF_KEY) && !value.hasOwnProperty(REFS_KEY)) ? true ? invariant3(false, "RelayModernRecord.getValue(): Expected a scalar (non-link) value for `%s.%s` but found %s.", record[ID_KEY], storageKey, value.hasOwnProperty(REF_KEY) ? "a linked record" : "plural linked records") : invariant3(false) : void 0;
      }
      return value;
    }
    function getLinkedRecordID(record, storageKey) {
      var maybeLink = record[storageKey];
      if (maybeLink == null) {
        return maybeLink;
      }
      var link = maybeLink;
      !(typeof link === "object" && link && typeof link[REF_KEY] === "string") ? true ? invariant3(false, "RelayModernRecord.getLinkedRecordID(): Expected `%s.%s` to be a linked ID, was `%s`.%s", record[ID_KEY], storageKey, JSON.stringify(link), typeof link === "object" && link[REFS_KEY] !== void 0 ? " It appears to be a plural linked record: did you mean to call getLinkedRecords() instead of getLinkedRecord()?" : "") : invariant3(false) : void 0;
      return link[REF_KEY];
    }
    function getLinkedRecordIDs(record, storageKey) {
      var links = record[storageKey];
      if (links == null) {
        return links;
      }
      !(typeof links === "object" && Array.isArray(links[REFS_KEY])) ? true ? invariant3(false, "RelayModernRecord.getLinkedRecordIDs(): Expected `%s.%s` to contain an array of linked IDs, got `%s`.%s", record[ID_KEY], storageKey, JSON.stringify(links), typeof links === "object" && links[REF_KEY] !== void 0 ? " It appears to be a singular linked record: did you mean to call getLinkedRecord() instead of getLinkedRecords()?" : "") : invariant3(false) : void 0;
      return links[REFS_KEY];
    }
    function getInvalidationEpoch(record) {
      if (record == null) {
        return null;
      }
      var invalidatedAt = record[INVALIDATED_AT_KEY];
      if (typeof invalidatedAt !== "number") {
        return null;
      }
      return invalidatedAt;
    }
    function update(prevRecord, nextRecord) {
      if (true) {
        var _getType, _getType2;
        var prevID = getDataID(prevRecord);
        var nextID2 = getDataID(nextRecord);
        true ? warning2(prevID === nextID2, "RelayModernRecord: Invalid record update, expected both versions of the record to have the same id, got `%s` and `%s`.", prevID, nextID2) : void 0;
        var prevType = (_getType = getType(prevRecord)) !== null && _getType !== void 0 ? _getType : null;
        var nextType = (_getType2 = getType(nextRecord)) !== null && _getType2 !== void 0 ? _getType2 : null;
        true ? warning2(isClientID(nextID2) && nextID2 !== ROOT_ID || prevType === nextType, "RelayModernRecord: Invalid record update, expected both versions of record `%s` to have the same `%s` but got conflicting types `%s` and `%s`. The GraphQL server likely violated the globally unique id requirement by returning the same id for different objects.", prevID, TYPENAME_KEY, prevType, nextType) : void 0;
      }
      var updated = null;
      var keys4 = Object.keys(nextRecord);
      for (var ii = 0; ii < keys4.length; ii++) {
        var key = keys4[ii];
        if (updated || !areEqual2(prevRecord[key], nextRecord[key])) {
          updated = updated !== null ? updated : (0, _objectSpread210["default"])({}, prevRecord);
          updated[key] = nextRecord[key];
        }
      }
      return updated !== null ? updated : prevRecord;
    }
    function merge2(record1, record2) {
      if (true) {
        var _getType3, _getType4;
        var prevID = getDataID(record1);
        var nextID2 = getDataID(record2);
        true ? warning2(prevID === nextID2, "RelayModernRecord: Invalid record merge, expected both versions of the record to have the same id, got `%s` and `%s`.", prevID, nextID2) : void 0;
        var prevType = (_getType3 = getType(record1)) !== null && _getType3 !== void 0 ? _getType3 : null;
        var nextType = (_getType4 = getType(record2)) !== null && _getType4 !== void 0 ? _getType4 : null;
        true ? warning2(isClientID(nextID2) && nextID2 !== ROOT_ID || prevType === nextType, "RelayModernRecord: Invalid record merge, expected both versions of record `%s` to have the same `%s` but got conflicting types `%s` and `%s`. The GraphQL server likely violated the globally unique id requirement by returning the same id for different objects.", prevID, TYPENAME_KEY, prevType, nextType) : void 0;
      }
      return (0, _objectSpread210["default"])((0, _objectSpread210["default"])({}, record1), record2);
    }
    function freeze(record) {
      deepFreeze(record);
    }
    function setValue(record, storageKey, value) {
      if (true) {
        var prevID = getDataID(record);
        if (storageKey === ID_KEY) {
          true ? warning2(prevID === value, "RelayModernRecord: Invalid field update, expected both versions of the record to have the same id, got `%s` and `%s`.", prevID, value) : void 0;
        } else if (storageKey === TYPENAME_KEY) {
          var _getType5;
          var prevType = (_getType5 = getType(record)) !== null && _getType5 !== void 0 ? _getType5 : null;
          var nextType = value !== null && value !== void 0 ? value : null;
          true ? warning2(isClientID(getDataID(record)) && getDataID(record) !== ROOT_ID || prevType === nextType, "RelayModernRecord: Invalid field update, expected both versions of record `%s` to have the same `%s` but got conflicting types `%s` and `%s`. The GraphQL server likely violated the globally unique id requirement by returning the same id for different objects.", prevID, TYPENAME_KEY, prevType, nextType) : void 0;
        }
      }
      record[storageKey] = value;
    }
    function setLinkedRecordID(record, storageKey, linkedID) {
      var link = {};
      link[REF_KEY] = linkedID;
      record[storageKey] = link;
    }
    function setLinkedRecordIDs(record, storageKey, linkedIDs) {
      var links = {};
      links[REFS_KEY] = linkedIDs;
      record[storageKey] = links;
    }
    function setActorLinkedRecordID(record, storageKey, actorIdentifier, linkedID) {
      var link = {};
      link[REF_KEY] = linkedID;
      link[ACTOR_IDENTIFIER_KEY] = actorIdentifier;
      record[storageKey] = link;
    }
    function getActorLinkedRecordID(record, storageKey) {
      var link = record[storageKey];
      if (link == null) {
        return link;
      }
      !(typeof link === "object" && typeof link[REF_KEY] === "string" && link[ACTOR_IDENTIFIER_KEY] != null) ? true ? invariant3(false, "RelayModernRecord.getActorLinkedRecordID(): Expected `%s.%s` to be an actor specific linked ID, was `%s`.", record[ID_KEY], storageKey, JSON.stringify(link)) : invariant3(false) : void 0;
      return [link[ACTOR_IDENTIFIER_KEY], link[REF_KEY]];
    }
    module.exports = {
      clone,
      copyFields,
      create: create4,
      freeze,
      getDataID,
      getInvalidationEpoch,
      getLinkedRecordID,
      getLinkedRecordIDs,
      getType,
      getValue,
      merge: merge2,
      setValue,
      setLinkedRecordID,
      setLinkedRecordIDs,
      update,
      getActorLinkedRecordID,
      setActorLinkedRecordID
    };
  }
});

// node_modules/relay-runtime/lib/store/RelayRecordState.js
var require_RelayRecordState2 = __commonJS({
  "node_modules/relay-runtime/lib/store/RelayRecordState.js"(exports, module) {
    "use strict";
    var RelayRecordState = {
      /**
       * Record exists (either fetched from the server or produced by a local,
       * optimistic update).
       */
      EXISTENT: "EXISTENT",
      /**
       * Record is known not to exist (either as the result of a mutation, or
       * because the server returned `null` when queried for the record).
       */
      NONEXISTENT: "NONEXISTENT",
      /**
       * Record State is unknown because it has not yet been fetched from the
       * server.
       */
      UNKNOWN: "UNKNOWN"
    };
    module.exports = RelayRecordState;
  }
});

// node_modules/relay-runtime/lib/store/RelayRecordSource.js
var require_RelayRecordSource2 = __commonJS({
  "node_modules/relay-runtime/lib/store/RelayRecordSource.js"(exports, module) {
    "use strict";
    var _interopRequireDefault = require_interopRequireDefault()["default"];
    var _createForOfIteratorHelper2 = _interopRequireDefault(require_createForOfIteratorHelper());
    var RelayRecordState = require_RelayRecordState2();
    var EXISTENT = RelayRecordState.EXISTENT;
    var NONEXISTENT = RelayRecordState.NONEXISTENT;
    var UNKNOWN = RelayRecordState.UNKNOWN;
    var RelayRecordSource = /* @__PURE__ */ function() {
      function RelayRecordSource2(records) {
        var _this = this;
        this._records = /* @__PURE__ */ new Map();
        if (records != null) {
          Object.keys(records).forEach(function(key) {
            _this._records.set(key, records[key]);
          });
        }
      }
      RelayRecordSource2.create = function create4(records) {
        return new RelayRecordSource2(records);
      };
      var _proto = RelayRecordSource2.prototype;
      _proto.clear = function clear2() {
        this._records = /* @__PURE__ */ new Map();
      };
      _proto["delete"] = function _delete(dataID) {
        this._records.set(dataID, null);
      };
      _proto.get = function get3(dataID) {
        return this._records.get(dataID);
      };
      _proto.getRecordIDs = function getRecordIDs() {
        return Array.from(this._records.keys());
      };
      _proto.getStatus = function getStatus(dataID) {
        if (!this._records.has(dataID)) {
          return UNKNOWN;
        }
        return this._records.get(dataID) == null ? NONEXISTENT : EXISTENT;
      };
      _proto.has = function has2(dataID) {
        return this._records.has(dataID);
      };
      _proto.remove = function remove2(dataID) {
        this._records["delete"](dataID);
      };
      _proto.set = function set3(dataID, record) {
        this._records.set(dataID, record);
      };
      _proto.size = function size() {
        return this._records.size;
      };
      _proto.toJSON = function toJSON2() {
        var obj = {};
        var _iterator = (0, _createForOfIteratorHelper2["default"])(this._records), _step;
        try {
          for (_iterator.s(); !(_step = _iterator.n()).done; ) {
            var _step$value = _step.value, key = _step$value[0], value = _step$value[1];
            obj[key] = value;
          }
        } catch (err) {
          _iterator.e(err);
        } finally {
          _iterator.f();
        }
        return obj;
      };
      return RelayRecordSource2;
    }();
    module.exports = RelayRecordSource;
  }
});

// node_modules/relay-runtime/lib/multi-actor-environment/ActorUtils.js
var require_ActorUtils2 = __commonJS({
  "node_modules/relay-runtime/lib/multi-actor-environment/ActorUtils.js"(exports, module) {
    "use strict";
    var ACTOR_IDENTIFIER_FIELD_NAME = "actor_key";
    var _require = require_ActorIdentifier2();
    var getActorIdentifier = _require.getActorIdentifier;
    function getActorIdentifierFromPayload(payload) {
      if (payload != null && typeof payload === "object" && typeof payload[ACTOR_IDENTIFIER_FIELD_NAME] === "string") {
        return getActorIdentifier(payload[ACTOR_IDENTIFIER_FIELD_NAME]);
      }
    }
    module.exports = {
      ACTOR_IDENTIFIER_FIELD_NAME,
      getActorIdentifierFromPayload
    };
  }
});

// node_modules/relay-runtime/lib/store/RelayStoreReactFlightUtils.js
var require_RelayStoreReactFlightUtils2 = __commonJS({
  "node_modules/relay-runtime/lib/store/RelayStoreReactFlightUtils.js"(exports, module) {
    "use strict";
    var _require = require_RelayModernRecord2();
    var getType = _require.getType;
    var invariant3 = require_browser();
    var REACT_FLIGHT_EXECUTABLE_DEFINITIONS_STORAGE_KEY = "executableDefinitions";
    var REACT_FLIGHT_TREE_STORAGE_KEY = "tree";
    var REACT_FLIGHT_TYPE_NAME = "ReactFlightComponent";
    function refineToReactFlightPayloadData(payload) {
      if (payload == null || typeof payload !== "object" || typeof payload.status !== "string" || !Array.isArray(payload.tree) && payload.tree !== null || !Array.isArray(payload.queries) || !Array.isArray(payload.fragments) || !Array.isArray(payload.errors)) {
        return null;
      }
      return payload;
    }
    function getReactFlightClientResponse(record) {
      !(getType(record) === REACT_FLIGHT_TYPE_NAME) ? true ? invariant3(false, "getReactFlightClientResponse(): Expected a ReactFlightComponentRecord, got %s.", record) : invariant3(false) : void 0;
      return record[REACT_FLIGHT_TREE_STORAGE_KEY];
    }
    module.exports = {
      REACT_FLIGHT_EXECUTABLE_DEFINITIONS_STORAGE_KEY,
      REACT_FLIGHT_TREE_STORAGE_KEY,
      REACT_FLIGHT_TYPE_NAME,
      getReactFlightClientResponse,
      refineToReactFlightPayloadData
    };
  }
});

// node_modules/relay-runtime/lib/store/TypeID.js
var require_TypeID2 = __commonJS({
  "node_modules/relay-runtime/lib/store/TypeID.js"(exports, module) {
    "use strict";
    var PREFIX = "client:__type:";
    var TYPE_SCHEMA_TYPE = "__TypeSchema";
    function generateTypeID(typeName2) {
      return PREFIX + typeName2;
    }
    function isTypeID(id2) {
      return id2.indexOf(PREFIX) === 0;
    }
    module.exports = {
      generateTypeID,
      isTypeID,
      TYPE_SCHEMA_TYPE
    };
  }
});

// node_modules/relay-runtime/lib/store/RelayResponseNormalizer.js
var require_RelayResponseNormalizer2 = __commonJS({
  "node_modules/relay-runtime/lib/store/RelayResponseNormalizer.js"(exports, module) {
    "use strict";
    var _interopRequireDefault = require_interopRequireDefault()["default"];
    var _createForOfIteratorHelper2 = _interopRequireDefault(require_createForOfIteratorHelper());
    var _toConsumableArray22 = _interopRequireDefault(require_toConsumableArray());
    var _require = require_ActorUtils2();
    var ACTOR_IDENTIFIER_FIELD_NAME = _require.ACTOR_IDENTIFIER_FIELD_NAME;
    var getActorIdentifierFromPayload = _require.getActorIdentifierFromPayload;
    var _require2 = require_RelayConcreteNode2();
    var ACTOR_CHANGE = _require2.ACTOR_CHANGE;
    var CLIENT_COMPONENT = _require2.CLIENT_COMPONENT;
    var CLIENT_EXTENSION = _require2.CLIENT_EXTENSION;
    var CONDITION = _require2.CONDITION;
    var DEFER = _require2.DEFER;
    var FLIGHT_FIELD = _require2.FLIGHT_FIELD;
    var FRAGMENT_SPREAD = _require2.FRAGMENT_SPREAD;
    var INLINE_FRAGMENT = _require2.INLINE_FRAGMENT;
    var LINKED_FIELD = _require2.LINKED_FIELD;
    var LINKED_HANDLE = _require2.LINKED_HANDLE;
    var MODULE_IMPORT = _require2.MODULE_IMPORT;
    var SCALAR_FIELD = _require2.SCALAR_FIELD;
    var SCALAR_HANDLE = _require2.SCALAR_HANDLE;
    var STREAM = _require2.STREAM;
    var TYPE_DISCRIMINATOR = _require2.TYPE_DISCRIMINATOR;
    var RelayFeatureFlags = require_RelayFeatureFlags2();
    var _require3 = require_ClientID2();
    var generateClientID = _require3.generateClientID;
    var isClientID = _require3.isClientID;
    var _require4 = require_RelayConcreteVariables2();
    var getLocalVariables = _require4.getLocalVariables;
    var RelayModernRecord = require_RelayModernRecord2();
    var _require5 = require_RelayModernSelector2();
    var createNormalizationSelector = _require5.createNormalizationSelector;
    var _require6 = require_RelayStoreReactFlightUtils2();
    var REACT_FLIGHT_EXECUTABLE_DEFINITIONS_STORAGE_KEY = _require6.REACT_FLIGHT_EXECUTABLE_DEFINITIONS_STORAGE_KEY;
    var REACT_FLIGHT_TREE_STORAGE_KEY = _require6.REACT_FLIGHT_TREE_STORAGE_KEY;
    var REACT_FLIGHT_TYPE_NAME = _require6.REACT_FLIGHT_TYPE_NAME;
    var refineToReactFlightPayloadData = _require6.refineToReactFlightPayloadData;
    var _require7 = require_RelayStoreUtils2();
    var ROOT_ID = _require7.ROOT_ID;
    var ROOT_TYPE = _require7.ROOT_TYPE;
    var TYPENAME_KEY = _require7.TYPENAME_KEY;
    var getArgumentValues = _require7.getArgumentValues;
    var getHandleStorageKey = _require7.getHandleStorageKey;
    var getModuleComponentKey = _require7.getModuleComponentKey;
    var getModuleOperationKey = _require7.getModuleOperationKey;
    var getStorageKey = _require7.getStorageKey;
    var _require8 = require_TypeID2();
    var TYPE_SCHEMA_TYPE = _require8.TYPE_SCHEMA_TYPE;
    var generateTypeID = _require8.generateTypeID;
    var areEqual2 = require_areEqual();
    var invariant3 = require_browser();
    var warning2 = require_warning();
    function normalize3(recordSource, selector, response, options) {
      var dataID = selector.dataID, node56 = selector.node, variables = selector.variables;
      var normalizer = new RelayResponseNormalizer(recordSource, variables, options);
      return normalizer.normalizeResponse(node56, dataID, response);
    }
    var RelayResponseNormalizer = /* @__PURE__ */ function() {
      function RelayResponseNormalizer2(recordSource, variables, options) {
        this._actorIdentifier = options.actorIdentifier;
        this._getDataId = options.getDataID;
        this._handleFieldPayloads = [];
        this._treatMissingFieldsAsNull = options.treatMissingFieldsAsNull;
        this._incrementalPlaceholders = [];
        this._isClientExtension = false;
        this._isUnmatchedAbstractType = false;
        this._followupPayloads = [];
        this._path = options.path ? (0, _toConsumableArray22["default"])(options.path) : [];
        this._recordSource = recordSource;
        this._variables = variables;
        this._reactFlightPayloadDeserializer = options.reactFlightPayloadDeserializer;
        this._reactFlightServerErrorHandler = options.reactFlightServerErrorHandler;
        this._shouldProcessClientComponents = options.shouldProcessClientComponents;
      }
      var _proto = RelayResponseNormalizer2.prototype;
      _proto.normalizeResponse = function normalizeResponse(node56, dataID, data) {
        var record = this._recordSource.get(dataID);
        !record ? true ? invariant3(false, "RelayResponseNormalizer(): Expected root record `%s` to exist.", dataID) : invariant3(false) : void 0;
        this._assignClientAbstractTypes(node56);
        this._traverseSelections(node56, record, data);
        return {
          errors: null,
          fieldPayloads: this._handleFieldPayloads,
          incrementalPlaceholders: this._incrementalPlaceholders,
          followupPayloads: this._followupPayloads,
          source: this._recordSource,
          isFinal: false
        };
      };
      _proto._assignClientAbstractTypes = function _assignClientAbstractTypes(node56) {
        var clientAbstractTypes = node56.clientAbstractTypes;
        if (clientAbstractTypes != null) {
          for (var _i = 0, _Object$keys = Object.keys(clientAbstractTypes); _i < _Object$keys.length; _i++) {
            var abstractType = _Object$keys[_i];
            var _iterator = (0, _createForOfIteratorHelper2["default"])(clientAbstractTypes[abstractType]), _step;
            try {
              for (_iterator.s(); !(_step = _iterator.n()).done; ) {
                var concreteType = _step.value;
                var typeID = generateTypeID(concreteType);
                var typeRecord = this._recordSource.get(typeID);
                if (typeRecord == null) {
                  typeRecord = RelayModernRecord.create(typeID, TYPE_SCHEMA_TYPE);
                  this._recordSource.set(typeID, typeRecord);
                }
                RelayModernRecord.setValue(typeRecord, abstractType, true);
              }
            } catch (err) {
              _iterator.e(err);
            } finally {
              _iterator.f();
            }
          }
        }
      };
      _proto._getVariableValue = function _getVariableValue(name2) {
        !this._variables.hasOwnProperty(name2) ? true ? invariant3(false, "RelayResponseNormalizer(): Undefined variable `%s`.", name2) : invariant3(false) : void 0;
        return this._variables[name2];
      };
      _proto._getRecordType = function _getRecordType(data) {
        var typeName2 = data[TYPENAME_KEY];
        !(typeName2 != null) ? true ? invariant3(false, "RelayResponseNormalizer(): Expected a typename for record `%s`.", JSON.stringify(data, null, 2)) : invariant3(false) : void 0;
        return typeName2;
      };
      _proto._traverseSelections = function _traverseSelections(node56, record, data) {
        for (var i2 = 0; i2 < node56.selections.length; i2++) {
          var selection2 = node56.selections[i2];
          switch (selection2.kind) {
            case SCALAR_FIELD:
            case LINKED_FIELD:
              this._normalizeField(node56, selection2, record, data);
              break;
            case CONDITION:
              var conditionValue = Boolean(this._getVariableValue(selection2.condition));
              if (conditionValue === selection2.passingValue) {
                this._traverseSelections(selection2, record, data);
              }
              break;
            case FRAGMENT_SPREAD: {
              var prevVariables = this._variables;
              this._variables = getLocalVariables(this._variables, selection2.fragment.argumentDefinitions, selection2.args);
              this._traverseSelections(selection2.fragment, record, data);
              this._variables = prevVariables;
              break;
            }
            case INLINE_FRAGMENT: {
              var abstractKey = selection2.abstractKey;
              if (abstractKey == null) {
                var typeName2 = RelayModernRecord.getType(record);
                if (typeName2 === selection2.type) {
                  this._traverseSelections(selection2, record, data);
                }
              } else {
                var implementsInterface = data.hasOwnProperty(abstractKey);
                var _typeName = RelayModernRecord.getType(record);
                var typeID = generateTypeID(_typeName);
                var typeRecord = this._recordSource.get(typeID);
                if (typeRecord == null) {
                  typeRecord = RelayModernRecord.create(typeID, TYPE_SCHEMA_TYPE);
                  this._recordSource.set(typeID, typeRecord);
                }
                RelayModernRecord.setValue(typeRecord, abstractKey, implementsInterface);
                if (implementsInterface) {
                  this._traverseSelections(selection2, record, data);
                }
              }
              break;
            }
            case TYPE_DISCRIMINATOR: {
              var _abstractKey = selection2.abstractKey;
              var _implementsInterface = data.hasOwnProperty(_abstractKey);
              var _typeName2 = RelayModernRecord.getType(record);
              var _typeID = generateTypeID(_typeName2);
              var _typeRecord = this._recordSource.get(_typeID);
              if (_typeRecord == null) {
                _typeRecord = RelayModernRecord.create(_typeID, TYPE_SCHEMA_TYPE);
                this._recordSource.set(_typeID, _typeRecord);
              }
              RelayModernRecord.setValue(_typeRecord, _abstractKey, _implementsInterface);
              break;
            }
            case LINKED_HANDLE:
            case SCALAR_HANDLE:
              var args = selection2.args ? getArgumentValues(selection2.args, this._variables) : {};
              var fieldKey = getStorageKey(selection2, this._variables);
              var handleKey = getHandleStorageKey(selection2, this._variables);
              this._handleFieldPayloads.push({
                /* $FlowFixMe[class-object-subtyping] added when improving typing
                 * for this parameters */
                args,
                dataID: RelayModernRecord.getDataID(record),
                fieldKey,
                handle: selection2.handle,
                handleKey,
                handleArgs: selection2.handleArgs ? (
                  /* $FlowFixMe[class-object-subtyping] added when improving typing
                   * for this parameters */
                  getArgumentValues(selection2.handleArgs, this._variables)
                ) : {}
              });
              break;
            case MODULE_IMPORT:
              this._normalizeModuleImport(node56, selection2, record, data);
              break;
            case DEFER:
              this._normalizeDefer(selection2, record, data);
              break;
            case STREAM:
              this._normalizeStream(selection2, record, data);
              break;
            case CLIENT_EXTENSION:
              var isClientExtension = this._isClientExtension;
              this._isClientExtension = true;
              this._traverseSelections(selection2, record, data);
              this._isClientExtension = isClientExtension;
              break;
            case CLIENT_COMPONENT:
              if (this._shouldProcessClientComponents === false) {
                break;
              }
              this._traverseSelections(selection2.fragment, record, data);
              break;
            case FLIGHT_FIELD:
              if (RelayFeatureFlags.ENABLE_REACT_FLIGHT_COMPONENT_FIELD) {
                this._normalizeFlightField(node56, selection2, record, data);
              } else {
                throw new Error("Flight fields are not yet supported.");
              }
              break;
            case ACTOR_CHANGE:
              this._normalizeActorChange(node56, selection2, record, data);
              break;
            default:
              selection2;
              true ? true ? invariant3(false, "RelayResponseNormalizer(): Unexpected ast kind `%s`.", selection2.kind) : invariant3(false) : void 0;
          }
        }
      };
      _proto._normalizeDefer = function _normalizeDefer(defer2, record, data) {
        var isDeferred = defer2["if"] === null || this._getVariableValue(defer2["if"]);
        if (true) {
          true ? warning2(typeof isDeferred === "boolean", "RelayResponseNormalizer: Expected value for @defer `if` argument to be a boolean, got `%s`.", isDeferred) : void 0;
        }
        if (isDeferred === false) {
          this._traverseSelections(defer2, record, data);
        } else {
          this._incrementalPlaceholders.push({
            kind: "defer",
            data,
            label: defer2.label,
            path: (0, _toConsumableArray22["default"])(this._path),
            selector: createNormalizationSelector(defer2, RelayModernRecord.getDataID(record), this._variables),
            typeName: RelayModernRecord.getType(record),
            actorIdentifier: this._actorIdentifier
          });
        }
      };
      _proto._normalizeStream = function _normalizeStream(stream, record, data) {
        this._traverseSelections(stream, record, data);
        var isStreamed = stream["if"] === null || this._getVariableValue(stream["if"]);
        if (true) {
          true ? warning2(typeof isStreamed === "boolean", "RelayResponseNormalizer: Expected value for @stream `if` argument to be a boolean, got `%s`.", isStreamed) : void 0;
        }
        if (isStreamed === true) {
          this._incrementalPlaceholders.push({
            kind: "stream",
            label: stream.label,
            path: (0, _toConsumableArray22["default"])(this._path),
            parentID: RelayModernRecord.getDataID(record),
            node: stream,
            variables: this._variables,
            actorIdentifier: this._actorIdentifier
          });
        }
      };
      _proto._normalizeModuleImport = function _normalizeModuleImport(parent, moduleImport, record, data) {
        !(typeof data === "object" && data) ? true ? invariant3(false, "RelayResponseNormalizer: Expected data for @module to be an object.") : invariant3(false) : void 0;
        var typeName2 = RelayModernRecord.getType(record);
        var componentKey = getModuleComponentKey(moduleImport.documentName);
        var componentReference = moduleImport.componentModuleProvider || data[componentKey];
        RelayModernRecord.setValue(record, componentKey, componentReference !== null && componentReference !== void 0 ? componentReference : null);
        var operationKey = getModuleOperationKey(moduleImport.documentName);
        var operationReference = moduleImport.operationModuleProvider || data[operationKey];
        RelayModernRecord.setValue(record, operationKey, operationReference !== null && operationReference !== void 0 ? operationReference : null);
        if (operationReference != null) {
          this._followupPayloads.push({
            kind: "ModuleImportPayload",
            args: moduleImport.args,
            data,
            dataID: RelayModernRecord.getDataID(record),
            operationReference,
            path: (0, _toConsumableArray22["default"])(this._path),
            typeName: typeName2,
            variables: this._variables,
            actorIdentifier: this._actorIdentifier
          });
        }
      };
      _proto._normalizeField = function _normalizeField(parent, selection2, record, data) {
        !(typeof data === "object" && data) ? true ? invariant3(false, "writeField(): Expected data for field `%s` to be an object.", selection2.name) : invariant3(false) : void 0;
        var responseKey = selection2.alias || selection2.name;
        var storageKey = getStorageKey(selection2, this._variables);
        var fieldValue = data[responseKey];
        if (fieldValue == null) {
          if (fieldValue === void 0) {
            var isOptionalField = this._isClientExtension || this._isUnmatchedAbstractType;
            if (isOptionalField) {
              return;
            } else if (!this._treatMissingFieldsAsNull) {
              if (true) {
                true ? warning2(false, "RelayResponseNormalizer: Payload did not contain a value for field `%s: %s`. Check that you are parsing with the same query that was used to fetch the payload.", responseKey, storageKey) : void 0;
              }
              return;
            }
          }
          if (true) {
            if (selection2.kind === SCALAR_FIELD) {
              this._validateConflictingFieldsWithIdenticalId(
                record,
                storageKey,
                // When using `treatMissingFieldsAsNull` the conflicting validation raises a false positive
                // because the value is set using `null` but validated using `fieldValue` which at this point
                // will be `undefined`.
                // Setting this to `null` matches the value that we actually set to the `fieldValue`.
                null
              );
            }
          }
          RelayModernRecord.setValue(record, storageKey, null);
          return;
        }
        if (selection2.kind === SCALAR_FIELD) {
          if (true) {
            this._validateConflictingFieldsWithIdenticalId(record, storageKey, fieldValue);
          }
          RelayModernRecord.setValue(record, storageKey, fieldValue);
        } else if (selection2.kind === LINKED_FIELD) {
          this._path.push(responseKey);
          if (selection2.plural) {
            this._normalizePluralLink(selection2, record, storageKey, fieldValue);
          } else {
            this._normalizeLink(selection2, record, storageKey, fieldValue);
          }
          this._path.pop();
        } else {
          selection2;
          true ? true ? invariant3(false, "RelayResponseNormalizer(): Unexpected ast kind `%s` during normalization.", selection2.kind) : invariant3(false) : void 0;
        }
      };
      _proto._normalizeActorChange = function _normalizeActorChange(parent, selection2, record, data) {
        var _field$concreteType;
        var field = selection2.linkedField;
        !(typeof data === "object" && data) ? true ? invariant3(false, "_normalizeActorChange(): Expected data for field `%s` to be an object.", field.name) : invariant3(false) : void 0;
        var responseKey = field.alias || field.name;
        var storageKey = getStorageKey(field, this._variables);
        var fieldValue = data[responseKey];
        if (fieldValue == null) {
          if (fieldValue === void 0) {
            var isOptionalField = this._isClientExtension || this._isUnmatchedAbstractType;
            if (isOptionalField) {
              return;
            } else if (!this._treatMissingFieldsAsNull) {
              if (true) {
                true ? warning2(false, "RelayResponseNormalizer: Payload did not contain a value for field `%s: %s`. Check that you are parsing with the same query that was used to fetch the payload.", responseKey, storageKey) : void 0;
              }
              return;
            }
          }
          RelayModernRecord.setValue(record, storageKey, null);
          return;
        }
        var actorIdentifier = getActorIdentifierFromPayload(fieldValue);
        if (actorIdentifier == null) {
          if (true) {
            true ? warning2(false, "RelayResponseNormalizer: Payload did not contain a value for field `%s`. Check that you are parsing with the same query that was used to fetch the payload. Payload is `%s`.", ACTOR_IDENTIFIER_FIELD_NAME, JSON.stringify(fieldValue, null, 2)) : void 0;
          }
          RelayModernRecord.setValue(record, storageKey, null);
          return;
        }
        var typeName2 = (_field$concreteType = field.concreteType) !== null && _field$concreteType !== void 0 ? _field$concreteType : this._getRecordType(fieldValue);
        var nextID2 = this._getDataId(
          // $FlowFixMe[incompatible-call]
          fieldValue,
          typeName2
        ) || RelayModernRecord.getLinkedRecordID(record, storageKey) || generateClientID(RelayModernRecord.getDataID(record), storageKey);
        !(typeof nextID2 === "string") ? true ? invariant3(false, "RelayResponseNormalizer: Expected id on field `%s` to be a string.", storageKey) : invariant3(false) : void 0;
        RelayModernRecord.setActorLinkedRecordID(record, storageKey, actorIdentifier, nextID2);
        this._followupPayloads.push({
          kind: "ActorPayload",
          data: fieldValue,
          dataID: nextID2,
          path: [].concat((0, _toConsumableArray22["default"])(this._path), [responseKey]),
          typeName: typeName2,
          variables: this._variables,
          node: field,
          actorIdentifier
        });
      };
      _proto._normalizeFlightField = function _normalizeFlightField(parent, selection2, record, data) {
        var responseKey = selection2.alias || selection2.name;
        var storageKey = getStorageKey(selection2, this._variables);
        var fieldValue = data[responseKey];
        if (fieldValue == null) {
          if (fieldValue === void 0) {
            if (this._isUnmatchedAbstractType) {
              return;
            } else {
              !this._treatMissingFieldsAsNull ? true ? invariant3(false, "RelayResponseNormalizer: Payload did not contain a value for field `%s: %s`. Check that you are parsing with the same query that was used to fetch the payload.", responseKey, storageKey) : invariant3(false) : void 0;
            }
          }
          RelayModernRecord.setValue(record, storageKey, null);
          return;
        }
        var reactFlightPayload = refineToReactFlightPayloadData(fieldValue);
        var reactFlightPayloadDeserializer = this._reactFlightPayloadDeserializer;
        !(reactFlightPayload != null) ? true ? invariant3(false, "RelayResponseNormalizer: Expected React Flight payload data to be an object with `status`, tree`, `queries` and `errors` properties, got `%s`.", fieldValue) : invariant3(false) : void 0;
        !(typeof reactFlightPayloadDeserializer === "function") ? true ? invariant3(false, "RelayResponseNormalizer: Expected reactFlightPayloadDeserializer to be a function, got `%s`.", reactFlightPayloadDeserializer) : invariant3(false) : void 0;
        if (reactFlightPayload.errors.length > 0) {
          if (typeof this._reactFlightServerErrorHandler === "function") {
            this._reactFlightServerErrorHandler(reactFlightPayload.status, reactFlightPayload.errors);
          } else {
            true ? warning2(false, "RelayResponseNormalizer: Received server errors for field `%s`.\n\n%s\n%s", responseKey, reactFlightPayload.errors[0].message, reactFlightPayload.errors[0].stack) : void 0;
          }
        }
        var reactFlightID = generateClientID(RelayModernRecord.getDataID(record), getStorageKey(selection2, this._variables));
        var reactFlightClientResponseRecord = this._recordSource.get(reactFlightID);
        if (reactFlightClientResponseRecord == null) {
          reactFlightClientResponseRecord = RelayModernRecord.create(reactFlightID, REACT_FLIGHT_TYPE_NAME);
          this._recordSource.set(reactFlightID, reactFlightClientResponseRecord);
        }
        if (reactFlightPayload.tree == null) {
          true ? warning2(false, "RelayResponseNormalizer: Expected `tree` not to be null. This typically indicates that a fatal server error prevented any Server Component rows from being written.") : void 0;
          RelayModernRecord.setValue(reactFlightClientResponseRecord, REACT_FLIGHT_TREE_STORAGE_KEY, null);
          RelayModernRecord.setValue(reactFlightClientResponseRecord, REACT_FLIGHT_EXECUTABLE_DEFINITIONS_STORAGE_KEY, []);
          RelayModernRecord.setLinkedRecordID(record, storageKey, reactFlightID);
          return;
        }
        var reactFlightClientResponse = reactFlightPayloadDeserializer(reactFlightPayload.tree);
        RelayModernRecord.setValue(reactFlightClientResponseRecord, REACT_FLIGHT_TREE_STORAGE_KEY, reactFlightClientResponse);
        var reachableExecutableDefinitions = [];
        var _iterator2 = (0, _createForOfIteratorHelper2["default"])(reactFlightPayload.queries), _step2;
        try {
          for (_iterator2.s(); !(_step2 = _iterator2.n()).done; ) {
            var query2 = _step2.value;
            if (query2.response.data != null) {
              this._followupPayloads.push({
                kind: "ModuleImportPayload",
                args: null,
                data: query2.response.data,
                dataID: ROOT_ID,
                operationReference: query2.module,
                path: [],
                typeName: ROOT_TYPE,
                variables: query2.variables,
                actorIdentifier: this._actorIdentifier
              });
            }
            reachableExecutableDefinitions.push({
              module: query2.module,
              variables: query2.variables
            });
          }
        } catch (err) {
          _iterator2.e(err);
        } finally {
          _iterator2.f();
        }
        var _iterator3 = (0, _createForOfIteratorHelper2["default"])(reactFlightPayload.fragments), _step3;
        try {
          for (_iterator3.s(); !(_step3 = _iterator3.n()).done; ) {
            var fragment2 = _step3.value;
            if (fragment2.response.data != null) {
              this._followupPayloads.push({
                kind: "ModuleImportPayload",
                args: null,
                data: fragment2.response.data,
                dataID: fragment2.__id,
                operationReference: fragment2.module,
                path: [],
                typeName: fragment2.__typename,
                variables: fragment2.variables,
                actorIdentifier: this._actorIdentifier
              });
            }
            reachableExecutableDefinitions.push({
              module: fragment2.module,
              variables: fragment2.variables
            });
          }
        } catch (err) {
          _iterator3.e(err);
        } finally {
          _iterator3.f();
        }
        RelayModernRecord.setValue(reactFlightClientResponseRecord, REACT_FLIGHT_EXECUTABLE_DEFINITIONS_STORAGE_KEY, reachableExecutableDefinitions);
        RelayModernRecord.setLinkedRecordID(record, storageKey, reactFlightID);
      };
      _proto._normalizeLink = function _normalizeLink(field, record, storageKey, fieldValue) {
        var _field$concreteType2;
        !(typeof fieldValue === "object" && fieldValue) ? true ? invariant3(false, "RelayResponseNormalizer: Expected data for field `%s` to be an object.", storageKey) : invariant3(false) : void 0;
        var nextID2 = this._getDataId(
          // $FlowFixMe[incompatible-variance]
          fieldValue,
          // $FlowFixMe[incompatible-variance]
          (_field$concreteType2 = field.concreteType) !== null && _field$concreteType2 !== void 0 ? _field$concreteType2 : this._getRecordType(fieldValue)
        ) || // Reuse previously generated client IDs
        RelayModernRecord.getLinkedRecordID(record, storageKey) || generateClientID(RelayModernRecord.getDataID(record), storageKey);
        !(typeof nextID2 === "string") ? true ? invariant3(false, "RelayResponseNormalizer: Expected id on field `%s` to be a string.", storageKey) : invariant3(false) : void 0;
        if (true) {
          this._validateConflictingLinkedFieldsWithIdenticalId(record, RelayModernRecord.getLinkedRecordID(record, storageKey), nextID2, storageKey);
        }
        RelayModernRecord.setLinkedRecordID(record, storageKey, nextID2);
        var nextRecord = this._recordSource.get(nextID2);
        if (!nextRecord) {
          var typeName2 = field.concreteType || this._getRecordType(fieldValue);
          nextRecord = RelayModernRecord.create(nextID2, typeName2);
          this._recordSource.set(nextID2, nextRecord);
        } else if (true) {
          this._validateRecordType(nextRecord, field, fieldValue);
        }
        this._traverseSelections(field, nextRecord, fieldValue);
      };
      _proto._normalizePluralLink = function _normalizePluralLink(field, record, storageKey, fieldValue) {
        var _this = this;
        !Array.isArray(fieldValue) ? true ? invariant3(false, "RelayResponseNormalizer: Expected data for field `%s` to be an array of objects.", storageKey) : invariant3(false) : void 0;
        var prevIDs = RelayModernRecord.getLinkedRecordIDs(record, storageKey);
        var nextIDs = [];
        fieldValue.forEach(function(item, nextIndex) {
          var _field$concreteType3;
          if (item == null) {
            nextIDs.push(item);
            return;
          }
          _this._path.push(String(nextIndex));
          !(typeof item === "object") ? true ? invariant3(false, "RelayResponseNormalizer: Expected elements for field `%s` to be objects.", storageKey) : invariant3(false) : void 0;
          var nextID2 = _this._getDataId(
            // $FlowFixMe[incompatible-variance]
            item,
            // $FlowFixMe[incompatible-variance]
            (_field$concreteType3 = field.concreteType) !== null && _field$concreteType3 !== void 0 ? _field$concreteType3 : _this._getRecordType(item)
          ) || prevIDs && prevIDs[nextIndex] || // Reuse previously generated client IDs:
          generateClientID(RelayModernRecord.getDataID(record), storageKey, nextIndex);
          !(typeof nextID2 === "string") ? true ? invariant3(false, "RelayResponseNormalizer: Expected id of elements of field `%s` to be strings.", storageKey) : invariant3(false) : void 0;
          nextIDs.push(nextID2);
          var nextRecord = _this._recordSource.get(nextID2);
          if (!nextRecord) {
            var typeName2 = field.concreteType || _this._getRecordType(item);
            nextRecord = RelayModernRecord.create(nextID2, typeName2);
            _this._recordSource.set(nextID2, nextRecord);
          } else if (true) {
            _this._validateRecordType(nextRecord, field, item);
          }
          if (true) {
            if (prevIDs) {
              _this._validateConflictingLinkedFieldsWithIdenticalId(record, prevIDs[nextIndex], nextID2, storageKey);
            }
          }
          _this._traverseSelections(field, nextRecord, item);
          _this._path.pop();
        });
        RelayModernRecord.setLinkedRecordIDs(record, storageKey, nextIDs);
      };
      _proto._validateRecordType = function _validateRecordType(record, field, payload) {
        var _field$concreteType4;
        var typeName2 = (_field$concreteType4 = field.concreteType) !== null && _field$concreteType4 !== void 0 ? _field$concreteType4 : this._getRecordType(payload);
        var dataID = RelayModernRecord.getDataID(record);
        true ? warning2(isClientID(dataID) && dataID !== ROOT_ID || RelayModernRecord.getType(record) === typeName2, "RelayResponseNormalizer: Invalid record `%s`. Expected %s to be consistent, but the record was assigned conflicting types `%s` and `%s`. The GraphQL server likely violated the globally unique id requirement by returning the same id for different objects.", dataID, TYPENAME_KEY, RelayModernRecord.getType(record), typeName2) : void 0;
      };
      _proto._validateConflictingFieldsWithIdenticalId = function _validateConflictingFieldsWithIdenticalId(record, storageKey, fieldValue) {
        if (true) {
          var dataID = RelayModernRecord.getDataID(record);
          var previousValue = RelayModernRecord.getValue(record, storageKey);
          true ? warning2(storageKey === TYPENAME_KEY || previousValue === void 0 || areEqual2(previousValue, fieldValue), "RelayResponseNormalizer: Invalid record. The record contains two instances of the same id: `%s` with conflicting field, %s and its values: %s and %s. If two fields are different but share the same id, one field will overwrite the other.", dataID, storageKey, previousValue, fieldValue) : void 0;
        }
      };
      _proto._validateConflictingLinkedFieldsWithIdenticalId = function _validateConflictingLinkedFieldsWithIdenticalId(record, prevID, nextID2, storageKey) {
        if (true) {
          true ? warning2(prevID === void 0 || prevID === nextID2, "RelayResponseNormalizer: Invalid record. The record contains references to the conflicting field, %s and its id values: %s and %s. We need to make sure that the record the field points to remains consistent or one field will overwrite the other.", storageKey, prevID, nextID2) : void 0;
        }
      };
      return RelayResponseNormalizer2;
    }();
    module.exports = {
      normalize: normalize3
    };
  }
});

// node_modules/relay-runtime/lib/store/OperationExecutor.js
var require_OperationExecutor2 = __commonJS({
  "node_modules/relay-runtime/lib/store/OperationExecutor.js"(exports, module) {
    "use strict";
    var _interopRequireDefault = require_interopRequireDefault()["default"];
    var _objectSpread210 = _interopRequireDefault(require_objectSpread2());
    var _createForOfIteratorHelper2 = _interopRequireDefault(require_createForOfIteratorHelper());
    var _defineProperty210 = _interopRequireDefault(require_defineProperty());
    var _toConsumableArray22 = _interopRequireDefault(require_toConsumableArray());
    var RelayObservable = require_RelayObservable2();
    var generateID = require_generateID2();
    var getOperation = require_getOperation2();
    var RelayError = require_RelayError2();
    var RelayFeatureFlags = require_RelayFeatureFlags2();
    var stableCopy = require_stableCopy2();
    var withDuration = require_withDuration2();
    var _require = require_ClientID2();
    var generateClientID = _require.generateClientID;
    var generateUniqueClientID = _require.generateUniqueClientID;
    var _require2 = require_RelayConcreteVariables2();
    var getLocalVariables = _require2.getLocalVariables;
    var RelayModernRecord = require_RelayModernRecord2();
    var _require3 = require_RelayModernSelector2();
    var createNormalizationSelector = _require3.createNormalizationSelector;
    var createReaderSelector = _require3.createReaderSelector;
    var RelayRecordSource = require_RelayRecordSource2();
    var RelayResponseNormalizer = require_RelayResponseNormalizer2();
    var _require4 = require_RelayStoreUtils2();
    var ROOT_TYPE = _require4.ROOT_TYPE;
    var TYPENAME_KEY = _require4.TYPENAME_KEY;
    var getStorageKey = _require4.getStorageKey;
    var invariant3 = require_browser();
    var warning2 = require_warning();
    function execute(config2) {
      return new Executor(config2);
    }
    var Executor = /* @__PURE__ */ function() {
      function Executor2(_ref22) {
        var _this = this;
        var actorIdentifier = _ref22.actorIdentifier, getDataID = _ref22.getDataID, getPublishQueue = _ref22.getPublishQueue, getStore = _ref22.getStore, isClientPayload = _ref22.isClientPayload, operation = _ref22.operation, operationExecutions = _ref22.operationExecutions, operationLoader = _ref22.operationLoader, operationTracker = _ref22.operationTracker, optimisticConfig = _ref22.optimisticConfig, _reactFlightPayloadDeserializer = _ref22.reactFlightPayloadDeserializer, reactFlightServerErrorHandler = _ref22.reactFlightServerErrorHandler, scheduler = _ref22.scheduler, shouldProcessClientComponents = _ref22.shouldProcessClientComponents, sink = _ref22.sink, source = _ref22.source, treatMissingFieldsAsNull = _ref22.treatMissingFieldsAsNull, updater = _ref22.updater, log2 = _ref22.log;
        (0, _defineProperty210["default"])(this, "_deserializeReactFlightPayloadWithLogging", function(tree) {
          var reactFlightPayloadDeserializer = _this._reactFlightPayloadDeserializer;
          !(typeof reactFlightPayloadDeserializer === "function") ? true ? invariant3(false, "OperationExecutor: Expected reactFlightPayloadDeserializer to be available when calling _deserializeReactFlightPayloadWithLogging.") : invariant3(false) : void 0;
          var _withDuration = withDuration(function() {
            return reactFlightPayloadDeserializer(tree);
          }), duration = _withDuration[0], result = _withDuration[1];
          _this._log({
            name: "execute.flight.payload_deserialize",
            executeId: _this._executeId,
            operationName: _this._operation.request.node.params.name,
            duration
          });
          return result;
        });
        this._actorIdentifier = actorIdentifier;
        this._getDataID = getDataID;
        this._treatMissingFieldsAsNull = treatMissingFieldsAsNull;
        this._incrementalPayloadsPending = false;
        this._incrementalResults = /* @__PURE__ */ new Map();
        this._log = log2;
        this._executeId = generateID();
        this._nextSubscriptionId = 0;
        this._operation = operation;
        this._operationExecutions = operationExecutions;
        this._operationLoader = operationLoader;
        this._operationTracker = operationTracker;
        this._operationUpdateEpochs = /* @__PURE__ */ new Map();
        this._optimisticUpdates = null;
        this._pendingModulePayloadsCount = 0;
        this._getPublishQueue = getPublishQueue;
        this._scheduler = scheduler;
        this._sink = sink;
        this._source = /* @__PURE__ */ new Map();
        this._state = "started";
        this._getStore = getStore;
        this._subscriptions = /* @__PURE__ */ new Map();
        this._updater = updater;
        this._isClientPayload = isClientPayload === true;
        this._reactFlightPayloadDeserializer = _reactFlightPayloadDeserializer;
        this._reactFlightServerErrorHandler = reactFlightServerErrorHandler;
        this._isSubscriptionOperation = this._operation.request.node.params.operationKind === "subscription";
        this._shouldProcessClientComponents = shouldProcessClientComponents;
        this._retainDisposables = /* @__PURE__ */ new Map();
        this._seenActors = /* @__PURE__ */ new Set();
        this._completeFns = [];
        var id2 = this._nextSubscriptionId++;
        source.subscribe({
          complete: function complete() {
            return _this._complete(id2);
          },
          error: function error(_error2) {
            return _this._error(_error2);
          },
          next: function next2(response) {
            try {
              _this._next(id2, response);
            } catch (error) {
              sink.error(error);
            }
          },
          start: function start(subscription2) {
            var _this$_operation$requ;
            _this._start(id2, subscription2);
            _this._log({
              name: "execute.start",
              executeId: _this._executeId,
              params: _this._operation.request.node.params,
              variables: _this._operation.request.variables,
              cacheConfig: (_this$_operation$requ = _this._operation.request.cacheConfig) !== null && _this$_operation$requ !== void 0 ? _this$_operation$requ : {}
            });
          }
        });
        if (optimisticConfig != null) {
          this._processOptimisticResponse(optimisticConfig.response != null ? {
            data: optimisticConfig.response
          } : null, optimisticConfig.updater, false);
        }
      }
      var _proto = Executor2.prototype;
      _proto.cancel = function cancel() {
        var _this2 = this;
        if (this._state === "completed") {
          return;
        }
        this._state = "completed";
        this._operationExecutions["delete"](this._operation.request.identifier);
        if (this._subscriptions.size !== 0) {
          this._subscriptions.forEach(function(sub) {
            return sub.unsubscribe();
          });
          this._subscriptions.clear();
        }
        var optimisticUpdates = this._optimisticUpdates;
        if (optimisticUpdates !== null) {
          this._optimisticUpdates = null;
          optimisticUpdates.forEach(function(update) {
            return _this2._getPublishQueueAndSaveActor().revertUpdate(update);
          });
          this._runPublishQueue();
        }
        this._incrementalResults.clear();
        if (this._asyncStoreUpdateDisposable != null) {
          this._asyncStoreUpdateDisposable.dispose();
          this._asyncStoreUpdateDisposable = null;
        }
        this._completeFns = [];
        this._completeOperationTracker();
        this._disposeRetainedData();
      };
      _proto._updateActiveState = function _updateActiveState() {
        var activeState;
        switch (this._state) {
          case "started": {
            activeState = "active";
            break;
          }
          case "loading_incremental": {
            activeState = "active";
            break;
          }
          case "completed": {
            activeState = "inactive";
            break;
          }
          case "loading_final": {
            activeState = this._pendingModulePayloadsCount > 0 ? "active" : "inactive";
            break;
          }
          default:
            this._state;
            true ? true ? invariant3(false, "OperationExecutor: invalid executor state.") : invariant3(false) : void 0;
        }
        this._operationExecutions.set(this._operation.request.identifier, activeState);
      };
      _proto._schedule = function _schedule(task) {
        var _this3 = this;
        var scheduler = this._scheduler;
        if (scheduler != null) {
          var id2 = this._nextSubscriptionId++;
          RelayObservable.create(function(sink) {
            var cancellationToken = scheduler.schedule(function() {
              try {
                task();
                sink.complete();
              } catch (error) {
                sink.error(error);
              }
            });
            return function() {
              return scheduler.cancel(cancellationToken);
            };
          }).subscribe({
            complete: function complete() {
              return _this3._complete(id2);
            },
            error: function error(_error3) {
              return _this3._error(_error3);
            },
            start: function start(subscription2) {
              return _this3._start(id2, subscription2);
            }
          });
        } else {
          task();
        }
      };
      _proto._complete = function _complete(id2) {
        this._subscriptions["delete"](id2);
        if (this._subscriptions.size === 0) {
          this.cancel();
          this._sink.complete();
          this._log({
            name: "execute.complete",
            executeId: this._executeId
          });
        }
      };
      _proto._error = function _error(error) {
        this.cancel();
        this._sink.error(error);
        this._log({
          name: "execute.error",
          executeId: this._executeId,
          error
        });
      };
      _proto._start = function _start3(id2, subscription2) {
        this._subscriptions.set(id2, subscription2);
        this._updateActiveState();
      };
      _proto._next = function _next(_id2, response) {
        var _this4 = this;
        this._schedule(function() {
          var _withDuration2 = withDuration(function() {
            _this4._handleNext(response);
            _this4._maybeCompleteSubscriptionOperationTracking();
          }), duration = _withDuration2[0];
          _this4._log({
            name: "execute.next",
            executeId: _this4._executeId,
            response,
            duration
          });
        });
      };
      _proto._handleErrorResponse = function _handleErrorResponse(responses) {
        var _this5 = this;
        var results = [];
        responses.forEach(function(response) {
          if (response.data === null && response.extensions != null && !response.hasOwnProperty("errors")) {
            return;
          } else if (response.data == null) {
            var errors = response.hasOwnProperty("errors") && response.errors != null ? response.errors : null;
            var messages = errors ? errors.map(function(_ref32) {
              var message = _ref32.message;
              return message;
            }).join("\n") : "(No errors)";
            var error = RelayError.create("RelayNetwork", "No data returned for operation `" + _this5._operation.request.node.params.name + "`, got error(s):\n" + messages + "\n\nSee the error `source` property for more information.");
            error.source = {
              errors,
              operation: _this5._operation.request.node,
              variables: _this5._operation.request.variables
            };
            error.stack;
            throw error;
          } else {
            var responseWithData = response;
            results.push(responseWithData);
          }
        });
        return results;
      };
      _proto._handleOptimisticResponses = function _handleOptimisticResponses(responses) {
        var _response$extensions;
        if (responses.length > 1) {
          if (responses.some(function(responsePart) {
            var _responsePart$extensi;
            return ((_responsePart$extensi = responsePart.extensions) === null || _responsePart$extensi === void 0 ? void 0 : _responsePart$extensi.isOptimistic) === true;
          })) {
            true ? true ? invariant3(false, "OperationExecutor: Optimistic responses cannot be batched.") : invariant3(false) : void 0;
          }
          return false;
        }
        var response = responses[0];
        var isOptimistic = ((_response$extensions = response.extensions) === null || _response$extensions === void 0 ? void 0 : _response$extensions.isOptimistic) === true;
        if (isOptimistic && this._state !== "started") {
          true ? true ? invariant3(false, "OperationExecutor: optimistic payload received after server payload.") : invariant3(false) : void 0;
        }
        if (isOptimistic) {
          this._processOptimisticResponse(response, null, this._treatMissingFieldsAsNull);
          this._sink.next(response);
          return true;
        }
        return false;
      };
      _proto._handleNext = function _handleNext(response) {
        if (this._state === "completed") {
          return;
        }
        this._seenActors.clear();
        var responses = Array.isArray(response) ? response : [response];
        var responsesWithData = this._handleErrorResponse(responses);
        if (responsesWithData.length === 0) {
          var isFinal = responses.some(function(x2) {
            var _x$extensions;
            return ((_x$extensions = x2.extensions) === null || _x$extensions === void 0 ? void 0 : _x$extensions.is_final) === true;
          });
          if (isFinal) {
            this._state = "loading_final";
            this._updateActiveState();
            this._incrementalPayloadsPending = false;
          }
          this._sink.next(response);
          return;
        }
        var isOptimistic = this._handleOptimisticResponses(responsesWithData);
        if (isOptimistic) {
          return;
        }
        var _partitionGraphQLResp = partitionGraphQLResponses(responsesWithData), nonIncrementalResponses = _partitionGraphQLResp[0], incrementalResponses = _partitionGraphQLResp[1];
        var hasNonIncrementalResponses = nonIncrementalResponses.length > 0;
        if (hasNonIncrementalResponses) {
          if (this._isSubscriptionOperation) {
            var nextID2 = generateUniqueClientID();
            this._operation = {
              request: this._operation.request,
              fragment: createReaderSelector(this._operation.fragment.node, nextID2, this._operation.fragment.variables, this._operation.fragment.owner),
              root: createNormalizationSelector(this._operation.root.node, nextID2, this._operation.root.variables)
            };
          }
          var payloadFollowups = this._processResponses(nonIncrementalResponses);
          this._processPayloadFollowups(payloadFollowups);
        }
        if (incrementalResponses.length > 0) {
          var _payloadFollowups = this._processIncrementalResponses(incrementalResponses);
          this._processPayloadFollowups(_payloadFollowups);
        }
        if (this._isSubscriptionOperation) {
          if (responsesWithData[0].extensions == null) {
            responsesWithData[0].extensions = {
              __relay_subscription_root_id: this._operation.fragment.dataID
            };
          } else {
            responsesWithData[0].extensions.__relay_subscription_root_id = this._operation.fragment.dataID;
          }
        }
        var updatedOwners = this._runPublishQueue(hasNonIncrementalResponses ? this._operation : void 0);
        if (hasNonIncrementalResponses) {
          if (this._incrementalPayloadsPending) {
            this._retainData();
          }
        }
        this._updateOperationTracker(updatedOwners);
        this._sink.next(response);
      };
      _proto._processOptimisticResponse = function _processOptimisticResponse(response, updater, treatMissingFieldsAsNull) {
        var _this6 = this;
        !(this._optimisticUpdates === null) ? true ? invariant3(false, "OperationExecutor: environment.execute: only support one optimistic response per execute.") : invariant3(false) : void 0;
        if (response == null && updater == null) {
          return;
        }
        var optimisticUpdates = [];
        if (response) {
          var payload = normalizeResponse(response, this._operation.root, ROOT_TYPE, {
            actorIdentifier: this._actorIdentifier,
            getDataID: this._getDataID,
            path: [],
            reactFlightPayloadDeserializer: this._reactFlightPayloadDeserializer != null ? this._deserializeReactFlightPayloadWithLogging : null,
            reactFlightServerErrorHandler: this._reactFlightServerErrorHandler,
            shouldProcessClientComponents: this._shouldProcessClientComponents,
            treatMissingFieldsAsNull
          });
          validateOptimisticResponsePayload(payload);
          optimisticUpdates.push({
            operation: this._operation,
            payload,
            updater
          });
          this._processOptimisticFollowups(payload, optimisticUpdates);
        } else if (updater) {
          optimisticUpdates.push({
            operation: this._operation,
            payload: {
              errors: null,
              fieldPayloads: null,
              incrementalPlaceholders: null,
              followupPayloads: null,
              source: RelayRecordSource.create(),
              isFinal: false
            },
            updater
          });
        }
        this._optimisticUpdates = optimisticUpdates;
        optimisticUpdates.forEach(function(update) {
          return _this6._getPublishQueueAndSaveActor().applyUpdate(update);
        });
        this._runPublishQueue();
      };
      _proto._processOptimisticFollowups = function _processOptimisticFollowups(payload, optimisticUpdates) {
        if (payload.followupPayloads && payload.followupPayloads.length) {
          var followupPayloads = payload.followupPayloads;
          var _iterator = (0, _createForOfIteratorHelper2["default"])(followupPayloads), _step;
          try {
            for (_iterator.s(); !(_step = _iterator.n()).done; ) {
              var followupPayload = _step.value;
              switch (followupPayload.kind) {
                case "ModuleImportPayload":
                  var operationLoader = this._expectOperationLoader();
                  var operation = operationLoader.get(followupPayload.operationReference);
                  if (operation == null) {
                    this._processAsyncOptimisticModuleImport(followupPayload);
                  } else {
                    var moduleImportOptimisticUpdates = this._processOptimisticModuleImport(operation, followupPayload);
                    optimisticUpdates.push.apply(optimisticUpdates, (0, _toConsumableArray22["default"])(moduleImportOptimisticUpdates));
                  }
                  break;
                case "ActorPayload":
                  true ? warning2(false, "OperationExecutor: Unexpected optimistic ActorPayload. These updates are not supported.") : void 0;
                  break;
                default:
                  followupPayload;
                  true ? true ? invariant3(false, "OperationExecutor: Unexpected followup kind `%s`. when processing optimistic updates.", followupPayload.kind) : invariant3(false) : void 0;
              }
            }
          } catch (err) {
            _iterator.e(err);
          } finally {
            _iterator.f();
          }
        }
      };
      _proto._normalizeFollowupPayload = function _normalizeFollowupPayload(followupPayload, normalizationNode) {
        var variables;
        if (normalizationNode.kind === "SplitOperation" && followupPayload.kind === "ModuleImportPayload") {
          variables = getLocalVariables(followupPayload.variables, normalizationNode.argumentDefinitions, followupPayload.args);
        } else {
          variables = followupPayload.variables;
        }
        var selector = createNormalizationSelector(normalizationNode, followupPayload.dataID, variables);
        return normalizeResponse({
          data: followupPayload.data
        }, selector, followupPayload.typeName, {
          actorIdentifier: this._actorIdentifier,
          getDataID: this._getDataID,
          path: followupPayload.path,
          reactFlightPayloadDeserializer: this._reactFlightPayloadDeserializer != null ? this._deserializeReactFlightPayloadWithLogging : null,
          reactFlightServerErrorHandler: this._reactFlightServerErrorHandler,
          treatMissingFieldsAsNull: this._treatMissingFieldsAsNull,
          shouldProcessClientComponents: this._shouldProcessClientComponents
        });
      };
      _proto._processOptimisticModuleImport = function _processOptimisticModuleImport(normalizationRootNode, moduleImportPayload) {
        var operation = getOperation(normalizationRootNode);
        var optimisticUpdates = [];
        var modulePayload = this._normalizeFollowupPayload(moduleImportPayload, operation);
        validateOptimisticResponsePayload(modulePayload);
        optimisticUpdates.push({
          operation: this._operation,
          payload: modulePayload,
          updater: null
        });
        this._processOptimisticFollowups(modulePayload, optimisticUpdates);
        return optimisticUpdates;
      };
      _proto._processAsyncOptimisticModuleImport = function _processAsyncOptimisticModuleImport(moduleImportPayload) {
        var _this7 = this;
        this._expectOperationLoader().load(moduleImportPayload.operationReference).then(function(operation) {
          if (operation == null || _this7._state !== "started") {
            return;
          }
          var moduleImportOptimisticUpdates = _this7._processOptimisticModuleImport(operation, moduleImportPayload);
          moduleImportOptimisticUpdates.forEach(function(update) {
            return _this7._getPublishQueueAndSaveActor().applyUpdate(update);
          });
          if (_this7._optimisticUpdates == null) {
            true ? warning2(false, "OperationExecutor: Unexpected ModuleImport optimistic update in operation %s." + _this7._operation.request.node.params.name) : void 0;
          } else {
            var _this$_optimisticUpda;
            (_this$_optimisticUpda = _this7._optimisticUpdates).push.apply(_this$_optimisticUpda, (0, _toConsumableArray22["default"])(moduleImportOptimisticUpdates));
            _this7._runPublishQueue();
          }
        });
      };
      _proto._processResponses = function _processResponses(responses) {
        var _this8 = this;
        if (this._optimisticUpdates !== null) {
          this._optimisticUpdates.forEach(function(update) {
            _this8._getPublishQueueAndSaveActor().revertUpdate(update);
          });
          this._optimisticUpdates = null;
        }
        this._incrementalPayloadsPending = false;
        this._incrementalResults.clear();
        this._source.clear();
        return responses.map(function(payloadPart) {
          var relayPayload = normalizeResponse(payloadPart, _this8._operation.root, ROOT_TYPE, {
            actorIdentifier: _this8._actorIdentifier,
            getDataID: _this8._getDataID,
            path: [],
            reactFlightPayloadDeserializer: _this8._reactFlightPayloadDeserializer != null ? _this8._deserializeReactFlightPayloadWithLogging : null,
            reactFlightServerErrorHandler: _this8._reactFlightServerErrorHandler,
            treatMissingFieldsAsNull: _this8._treatMissingFieldsAsNull,
            shouldProcessClientComponents: _this8._shouldProcessClientComponents
          });
          _this8._getPublishQueueAndSaveActor().commitPayload(_this8._operation, relayPayload, _this8._updater);
          return relayPayload;
        });
      };
      _proto._processPayloadFollowups = function _processPayloadFollowups(payloads) {
        var _this9 = this;
        if (this._state === "completed") {
          return;
        }
        payloads.forEach(function(payload) {
          var incrementalPlaceholders = payload.incrementalPlaceholders, followupPayloads = payload.followupPayloads, isFinal = payload.isFinal;
          _this9._state = isFinal ? "loading_final" : "loading_incremental";
          _this9._updateActiveState();
          if (isFinal) {
            _this9._incrementalPayloadsPending = false;
          }
          if (followupPayloads && followupPayloads.length !== 0) {
            followupPayloads.forEach(function(followupPayload) {
              var _followupPayload$acto;
              var prevActorIdentifier = _this9._actorIdentifier;
              _this9._actorIdentifier = (_followupPayload$acto = followupPayload.actorIdentifier) !== null && _followupPayload$acto !== void 0 ? _followupPayload$acto : _this9._actorIdentifier;
              _this9._processFollowupPayload(followupPayload);
              _this9._actorIdentifier = prevActorIdentifier;
            });
          }
          if (incrementalPlaceholders && incrementalPlaceholders.length !== 0) {
            _this9._incrementalPayloadsPending = _this9._state !== "loading_final";
            incrementalPlaceholders.forEach(function(incrementalPlaceholder) {
              var _incrementalPlacehold;
              var prevActorIdentifier = _this9._actorIdentifier;
              _this9._actorIdentifier = (_incrementalPlacehold = incrementalPlaceholder.actorIdentifier) !== null && _incrementalPlacehold !== void 0 ? _incrementalPlacehold : _this9._actorIdentifier;
              _this9._processIncrementalPlaceholder(payload, incrementalPlaceholder);
              _this9._actorIdentifier = prevActorIdentifier;
            });
            if (_this9._isClientPayload || _this9._state === "loading_final") {
              true ? warning2(_this9._isClientPayload, "RelayModernEnvironment: Operation `%s` contains @defer/@stream directives but was executed in non-streaming mode. See https://fburl.com/relay-incremental-delivery-non-streaming-warning.", _this9._operation.request.node.params.name) : void 0;
              var relayPayloads = [];
              incrementalPlaceholders.forEach(function(placeholder2) {
                if (placeholder2.kind === "defer") {
                  relayPayloads.push(_this9._processDeferResponse(placeholder2.label, placeholder2.path, placeholder2, {
                    data: placeholder2.data
                  }));
                }
              });
              if (relayPayloads.length > 0) {
                _this9._processPayloadFollowups(relayPayloads);
              }
            }
          }
        });
      };
      _proto._maybeCompleteSubscriptionOperationTracking = function _maybeCompleteSubscriptionOperationTracking() {
        if (!this._isSubscriptionOperation) {
          return;
        }
        if (this._pendingModulePayloadsCount === 0 && this._incrementalPayloadsPending === false) {
          this._completeOperationTracker();
        }
      };
      _proto._processFollowupPayload = function _processFollowupPayload(followupPayload) {
        var _this10 = this;
        switch (followupPayload.kind) {
          case "ModuleImportPayload":
            var operationLoader = this._expectOperationLoader();
            var node56 = operationLoader.get(followupPayload.operationReference);
            if (node56 != null) {
              this._processFollowupPayloadWithNormalizationNode(followupPayload, getOperation(node56));
            } else {
              var id2 = this._nextSubscriptionId++;
              this._pendingModulePayloadsCount++;
              var decrementPendingCount = function decrementPendingCount2() {
                _this10._pendingModulePayloadsCount--;
                _this10._maybeCompleteSubscriptionOperationTracking();
              };
              var networkObservable = RelayObservable.from(new Promise(function(resolve2, reject) {
                operationLoader.load(followupPayload.operationReference).then(resolve2, reject);
              }));
              RelayObservable.create(function(sink) {
                var cancellationToken;
                var subscription2 = networkObservable.subscribe({
                  next: function next2(loadedNode) {
                    if (loadedNode != null) {
                      var publishModuleImportPayload = function publishModuleImportPayload2() {
                        try {
                          var operation = getOperation(loadedNode);
                          var batchAsyncModuleUpdatesFN = RelayFeatureFlags.BATCH_ASYNC_MODULE_UPDATES_FN;
                          var shouldScheduleAsyncStoreUpdate = batchAsyncModuleUpdatesFN != null && _this10._pendingModulePayloadsCount > 1;
                          var _withDuration3 = withDuration(function() {
                            _this10._handleFollowupPayload(followupPayload, operation);
                            if (shouldScheduleAsyncStoreUpdate) {
                              _this10._scheduleAsyncStoreUpdate(
                                // $FlowFixMe[incompatible-call] `shouldScheduleAsyncStoreUpdate` check should cover `null` case
                                batchAsyncModuleUpdatesFN,
                                sink.complete
                              );
                            } else {
                              var updatedOwners = _this10._runPublishQueue();
                              _this10._updateOperationTracker(updatedOwners);
                            }
                          }), duration = _withDuration3[0];
                          _this10._log({
                            name: "execute.async.module",
                            executeId: _this10._executeId,
                            operationName: operation.name,
                            duration
                          });
                          if (!shouldScheduleAsyncStoreUpdate) {
                            sink.complete();
                          }
                        } catch (error) {
                          sink.error(error);
                        }
                      };
                      var scheduler = _this10._scheduler;
                      if (scheduler == null) {
                        publishModuleImportPayload();
                      } else {
                        cancellationToken = scheduler.schedule(publishModuleImportPayload);
                      }
                    } else {
                      sink.complete();
                    }
                  },
                  error: sink.error
                });
                return function() {
                  subscription2.unsubscribe();
                  if (_this10._scheduler != null && cancellationToken != null) {
                    _this10._scheduler.cancel(cancellationToken);
                  }
                };
              }).subscribe({
                complete: function complete() {
                  _this10._complete(id2);
                  decrementPendingCount();
                },
                error: function error(_error4) {
                  _this10._error(_error4);
                  decrementPendingCount();
                },
                start: function start(subscription2) {
                  return _this10._start(id2, subscription2);
                }
              });
            }
            break;
          case "ActorPayload":
            this._processFollowupPayloadWithNormalizationNode(followupPayload, followupPayload.node);
            break;
          default:
            followupPayload;
            true ? true ? invariant3(false, "OperationExecutor: Unexpected followup kind `%s`.", followupPayload.kind) : invariant3(false) : void 0;
        }
      };
      _proto._processFollowupPayloadWithNormalizationNode = function _processFollowupPayloadWithNormalizationNode(followupPayload, normalizationNode) {
        this._handleFollowupPayload(followupPayload, normalizationNode);
        this._maybeCompleteSubscriptionOperationTracking();
      };
      _proto._handleFollowupPayload = function _handleFollowupPayload(followupPayload, normalizationNode) {
        var relayPayload = this._normalizeFollowupPayload(followupPayload, normalizationNode);
        this._getPublishQueueAndSaveActor().commitPayload(this._operation, relayPayload);
        this._processPayloadFollowups([relayPayload]);
      };
      _proto._processIncrementalPlaceholder = function _processIncrementalPlaceholder(relayPayload, placeholder2) {
        var _relayPayload$fieldPa;
        var label = placeholder2.label, path2 = placeholder2.path;
        var pathKey = path2.map(String).join(".");
        var resultForLabel = this._incrementalResults.get(label);
        if (resultForLabel == null) {
          resultForLabel = /* @__PURE__ */ new Map();
          this._incrementalResults.set(label, resultForLabel);
        }
        var resultForPath = resultForLabel.get(pathKey);
        var pendingResponses = resultForPath != null && resultForPath.kind === "response" ? resultForPath.responses : null;
        resultForLabel.set(pathKey, {
          kind: "placeholder",
          placeholder: placeholder2
        });
        var parentID;
        if (placeholder2.kind === "stream") {
          parentID = placeholder2.parentID;
        } else if (placeholder2.kind === "defer") {
          parentID = placeholder2.selector.dataID;
        } else {
          placeholder2;
          true ? true ? invariant3(false, "OperationExecutor: Unsupported incremental placeholder kind `%s`.", placeholder2.kind) : invariant3(false) : void 0;
        }
        var parentRecord = relayPayload.source.get(parentID);
        var parentPayloads = ((_relayPayload$fieldPa = relayPayload.fieldPayloads) !== null && _relayPayload$fieldPa !== void 0 ? _relayPayload$fieldPa : []).filter(function(fieldPayload) {
          var fieldID = generateClientID(fieldPayload.dataID, fieldPayload.fieldKey);
          return (
            // handlers applied to the streamed field itself
            fieldPayload.dataID === parentID || // handlers applied to a field on an ancestor object, where
            // ancestor.field links to the parent record (example: connections)
            fieldID === parentID
          );
        });
        !(parentRecord != null) ? true ? invariant3(false, "OperationExecutor: Expected record `%s` to exist.", parentID) : invariant3(false) : void 0;
        var nextParentRecord;
        var nextParentPayloads;
        var previousParentEntry = this._source.get(parentID);
        if (previousParentEntry != null) {
          nextParentRecord = RelayModernRecord.update(previousParentEntry.record, parentRecord);
          var handlePayloads = /* @__PURE__ */ new Map();
          var dedupePayload = function dedupePayload2(payload) {
            var key = stableStringify(payload);
            handlePayloads.set(key, payload);
          };
          previousParentEntry.fieldPayloads.forEach(dedupePayload);
          parentPayloads.forEach(dedupePayload);
          nextParentPayloads = Array.from(handlePayloads.values());
        } else {
          nextParentRecord = parentRecord;
          nextParentPayloads = parentPayloads;
        }
        this._source.set(parentID, {
          record: nextParentRecord,
          fieldPayloads: nextParentPayloads
        });
        if (pendingResponses != null) {
          var payloadFollowups = this._processIncrementalResponses(pendingResponses);
          this._processPayloadFollowups(payloadFollowups);
        }
      };
      _proto._processIncrementalResponses = function _processIncrementalResponses(incrementalResponses) {
        var _this11 = this;
        var relayPayloads = [];
        incrementalResponses.forEach(function(incrementalResponse) {
          var label = incrementalResponse.label, path2 = incrementalResponse.path, response = incrementalResponse.response;
          var resultForLabel = _this11._incrementalResults.get(label);
          if (resultForLabel == null) {
            resultForLabel = /* @__PURE__ */ new Map();
            _this11._incrementalResults.set(label, resultForLabel);
          }
          if (label.indexOf("$defer$") !== -1) {
            var pathKey = path2.map(String).join(".");
            var resultForPath = resultForLabel.get(pathKey);
            if (resultForPath == null) {
              resultForPath = {
                kind: "response",
                responses: [incrementalResponse]
              };
              resultForLabel.set(pathKey, resultForPath);
              return;
            } else if (resultForPath.kind === "response") {
              resultForPath.responses.push(incrementalResponse);
              return;
            }
            var placeholder2 = resultForPath.placeholder;
            !(placeholder2.kind === "defer") ? true ? invariant3(false, "OperationExecutor: Expected data for path `%s` for label `%s` to be data for @defer, was `@%s`.", pathKey, label, placeholder2.kind) : invariant3(false) : void 0;
            relayPayloads.push(_this11._processDeferResponse(label, path2, placeholder2, response));
          } else {
            var _pathKey = path2.slice(0, -2).map(String).join(".");
            var _resultForPath = resultForLabel.get(_pathKey);
            if (_resultForPath == null) {
              _resultForPath = {
                kind: "response",
                responses: [incrementalResponse]
              };
              resultForLabel.set(_pathKey, _resultForPath);
              return;
            } else if (_resultForPath.kind === "response") {
              _resultForPath.responses.push(incrementalResponse);
              return;
            }
            var _placeholder = _resultForPath.placeholder;
            !(_placeholder.kind === "stream") ? true ? invariant3(false, "OperationExecutor: Expected data for path `%s` for label `%s` to be data for @stream, was `@%s`.", _pathKey, label, _placeholder.kind) : invariant3(false) : void 0;
            relayPayloads.push(_this11._processStreamResponse(label, path2, _placeholder, response));
          }
        });
        return relayPayloads;
      };
      _proto._processDeferResponse = function _processDeferResponse(label, path2, placeholder2, response) {
        var _placeholder$actorIde;
        var parentID = placeholder2.selector.dataID;
        var prevActorIdentifier = this._actorIdentifier;
        this._actorIdentifier = (_placeholder$actorIde = placeholder2.actorIdentifier) !== null && _placeholder$actorIde !== void 0 ? _placeholder$actorIde : this._actorIdentifier;
        var relayPayload = normalizeResponse(response, placeholder2.selector, placeholder2.typeName, {
          actorIdentifier: this._actorIdentifier,
          getDataID: this._getDataID,
          path: placeholder2.path,
          reactFlightPayloadDeserializer: this._reactFlightPayloadDeserializer != null ? this._deserializeReactFlightPayloadWithLogging : null,
          reactFlightServerErrorHandler: this._reactFlightServerErrorHandler,
          treatMissingFieldsAsNull: this._treatMissingFieldsAsNull,
          shouldProcessClientComponents: this._shouldProcessClientComponents
        });
        this._getPublishQueueAndSaveActor().commitPayload(this._operation, relayPayload);
        var parentEntry = this._source.get(parentID);
        !(parentEntry != null) ? true ? invariant3(false, "OperationExecutor: Expected the parent record `%s` for @defer data to exist.", parentID) : invariant3(false) : void 0;
        var fieldPayloads = parentEntry.fieldPayloads;
        if (fieldPayloads.length !== 0) {
          var _response$extensions2;
          var handleFieldsRelayPayload = {
            errors: null,
            fieldPayloads,
            incrementalPlaceholders: null,
            followupPayloads: null,
            source: RelayRecordSource.create(),
            isFinal: ((_response$extensions2 = response.extensions) === null || _response$extensions2 === void 0 ? void 0 : _response$extensions2.is_final) === true
          };
          this._getPublishQueueAndSaveActor().commitPayload(this._operation, handleFieldsRelayPayload);
        }
        this._actorIdentifier = prevActorIdentifier;
        return relayPayload;
      };
      _proto._processStreamResponse = function _processStreamResponse(label, path2, placeholder2, response) {
        var parentID = placeholder2.parentID, node56 = placeholder2.node, variables = placeholder2.variables, actorIdentifier = placeholder2.actorIdentifier;
        var prevActorIdentifier = this._actorIdentifier;
        this._actorIdentifier = actorIdentifier !== null && actorIdentifier !== void 0 ? actorIdentifier : this._actorIdentifier;
        var field = node56.selections[0];
        !(field != null && field.kind === "LinkedField" && field.plural === true) ? true ? invariant3(false, "OperationExecutor: Expected @stream to be used on a plural field.") : invariant3(false) : void 0;
        var _this$_normalizeStrea = this._normalizeStreamItem(response, parentID, field, variables, path2, placeholder2.path), fieldPayloads = _this$_normalizeStrea.fieldPayloads, itemID = _this$_normalizeStrea.itemID, itemIndex = _this$_normalizeStrea.itemIndex, prevIDs = _this$_normalizeStrea.prevIDs, relayPayload = _this$_normalizeStrea.relayPayload, storageKey = _this$_normalizeStrea.storageKey;
        this._getPublishQueueAndSaveActor().commitPayload(this._operation, relayPayload, function(store) {
          var currentParentRecord = store.get(parentID);
          if (currentParentRecord == null) {
            return;
          }
          var currentItems = currentParentRecord.getLinkedRecords(storageKey);
          if (currentItems == null) {
            return;
          }
          if (currentItems.length !== prevIDs.length || currentItems.some(function(currentItem, index) {
            return prevIDs[index] !== (currentItem && currentItem.getDataID());
          })) {
            return;
          }
          var nextItems = (0, _toConsumableArray22["default"])(currentItems);
          nextItems[itemIndex] = store.get(itemID);
          currentParentRecord.setLinkedRecords(nextItems, storageKey);
        });
        if (fieldPayloads.length !== 0) {
          var handleFieldsRelayPayload = {
            errors: null,
            fieldPayloads,
            incrementalPlaceholders: null,
            followupPayloads: null,
            source: RelayRecordSource.create(),
            isFinal: false
          };
          this._getPublishQueueAndSaveActor().commitPayload(this._operation, handleFieldsRelayPayload);
        }
        this._actorIdentifier = prevActorIdentifier;
        return relayPayload;
      };
      _proto._normalizeStreamItem = function _normalizeStreamItem(response, parentID, field, variables, path2, normalizationPath) {
        var _field$alias, _field$concreteType, _ref18, _this$_getDataID;
        var data = response.data;
        !(typeof data === "object") ? true ? invariant3(false, "OperationExecutor: Expected the GraphQL @stream payload `data` value to be an object.") : invariant3(false) : void 0;
        var responseKey = (_field$alias = field.alias) !== null && _field$alias !== void 0 ? _field$alias : field.name;
        var storageKey = getStorageKey(field, variables);
        var parentEntry = this._source.get(parentID);
        !(parentEntry != null) ? true ? invariant3(false, "OperationExecutor: Expected the parent record `%s` for @stream data to exist.", parentID) : invariant3(false) : void 0;
        var parentRecord = parentEntry.record, fieldPayloads = parentEntry.fieldPayloads;
        var prevIDs = RelayModernRecord.getLinkedRecordIDs(parentRecord, storageKey);
        !(prevIDs != null) ? true ? invariant3(false, "OperationExecutor: Expected record `%s` to have fetched field `%s` with @stream.", parentID, field.name) : invariant3(false) : void 0;
        var finalPathEntry = path2[path2.length - 1];
        var itemIndex = parseInt(finalPathEntry, 10);
        !(itemIndex === finalPathEntry && itemIndex >= 0) ? true ? invariant3(false, "OperationExecutor: Expected path for @stream to end in a positive integer index, got `%s`", finalPathEntry) : invariant3(false) : void 0;
        var typeName2 = (_field$concreteType = field.concreteType) !== null && _field$concreteType !== void 0 ? _field$concreteType : data[TYPENAME_KEY];
        !(typeof typeName2 === "string") ? true ? invariant3(false, "OperationExecutor: Expected @stream field `%s` to have a __typename.", field.name) : invariant3(false) : void 0;
        var itemID = (_ref18 = (_this$_getDataID = this._getDataID(data, typeName2)) !== null && _this$_getDataID !== void 0 ? _this$_getDataID : prevIDs === null || prevIDs === void 0 ? void 0 : prevIDs[itemIndex]) !== null && _ref18 !== void 0 ? _ref18 : (
          // Reuse previously generated client IDs
          generateClientID(parentID, storageKey, itemIndex)
        );
        !(typeof itemID === "string") ? true ? invariant3(false, "OperationExecutor: Expected id of elements of field `%s` to be strings.", storageKey) : invariant3(false) : void 0;
        var selector = createNormalizationSelector(field, itemID, variables);
        var nextParentRecord = RelayModernRecord.clone(parentRecord);
        var nextIDs = (0, _toConsumableArray22["default"])(prevIDs);
        nextIDs[itemIndex] = itemID;
        RelayModernRecord.setLinkedRecordIDs(nextParentRecord, storageKey, nextIDs);
        this._source.set(parentID, {
          record: nextParentRecord,
          fieldPayloads
        });
        var relayPayload = normalizeResponse(response, selector, typeName2, {
          actorIdentifier: this._actorIdentifier,
          getDataID: this._getDataID,
          path: [].concat((0, _toConsumableArray22["default"])(normalizationPath), [responseKey, String(itemIndex)]),
          reactFlightPayloadDeserializer: this._reactFlightPayloadDeserializer != null ? this._deserializeReactFlightPayloadWithLogging : null,
          reactFlightServerErrorHandler: this._reactFlightServerErrorHandler,
          treatMissingFieldsAsNull: this._treatMissingFieldsAsNull,
          shouldProcessClientComponents: this._shouldProcessClientComponents
        });
        return {
          fieldPayloads,
          itemID,
          itemIndex,
          prevIDs,
          relayPayload,
          storageKey
        };
      };
      _proto._scheduleAsyncStoreUpdate = function _scheduleAsyncStoreUpdate(scheduleFn, completeFn) {
        var _this12 = this;
        this._completeFns.push(completeFn);
        if (this._asyncStoreUpdateDisposable != null) {
          return;
        }
        this._asyncStoreUpdateDisposable = scheduleFn(function() {
          _this12._asyncStoreUpdateDisposable = null;
          var updatedOwners = _this12._runPublishQueue();
          _this12._updateOperationTracker(updatedOwners);
          var _iterator2 = (0, _createForOfIteratorHelper2["default"])(_this12._completeFns), _step2;
          try {
            for (_iterator2.s(); !(_step2 = _iterator2.n()).done; ) {
              var complete = _step2.value;
              complete();
            }
          } catch (err) {
            _iterator2.e(err);
          } finally {
            _iterator2.f();
          }
          _this12._completeFns = [];
        });
      };
      _proto._updateOperationTracker = function _updateOperationTracker(updatedOwners) {
        if (updatedOwners != null && updatedOwners.length > 0) {
          this._operationTracker.update(this._operation.request, new Set(updatedOwners));
        }
      };
      _proto._completeOperationTracker = function _completeOperationTracker() {
        this._operationTracker.complete(this._operation.request);
      };
      _proto._getPublishQueueAndSaveActor = function _getPublishQueueAndSaveActor() {
        this._seenActors.add(this._actorIdentifier);
        return this._getPublishQueue(this._actorIdentifier);
      };
      _proto._getActorsToVisit = function _getActorsToVisit() {
        if (this._seenActors.size === 0) {
          return /* @__PURE__ */ new Set([this._actorIdentifier]);
        } else {
          return this._seenActors;
        }
      };
      _proto._runPublishQueue = function _runPublishQueue(operation) {
        var updatedOwners = /* @__PURE__ */ new Set();
        var _iterator3 = (0, _createForOfIteratorHelper2["default"])(this._getActorsToVisit()), _step3;
        try {
          for (_iterator3.s(); !(_step3 = _iterator3.n()).done; ) {
            var actorIdentifier = _step3.value;
            var owners = this._getPublishQueue(actorIdentifier).run(operation);
            owners.forEach(function(owner) {
              return updatedOwners.add(owner);
            });
          }
        } catch (err) {
          _iterator3.e(err);
        } finally {
          _iterator3.f();
        }
        return Array.from(updatedOwners);
      };
      _proto._retainData = function _retainData() {
        var _iterator4 = (0, _createForOfIteratorHelper2["default"])(this._getActorsToVisit()), _step4;
        try {
          for (_iterator4.s(); !(_step4 = _iterator4.n()).done; ) {
            var actorIdentifier = _step4.value;
            if (!this._retainDisposables.has(actorIdentifier)) {
              this._retainDisposables.set(actorIdentifier, this._getStore(actorIdentifier).retain(this._operation));
            }
          }
        } catch (err) {
          _iterator4.e(err);
        } finally {
          _iterator4.f();
        }
      };
      _proto._disposeRetainedData = function _disposeRetainedData() {
        var _iterator5 = (0, _createForOfIteratorHelper2["default"])(this._retainDisposables.values()), _step5;
        try {
          for (_iterator5.s(); !(_step5 = _iterator5.n()).done; ) {
            var disposable = _step5.value;
            disposable.dispose();
          }
        } catch (err) {
          _iterator5.e(err);
        } finally {
          _iterator5.f();
        }
        this._retainDisposables.clear();
      };
      _proto._expectOperationLoader = function _expectOperationLoader() {
        var operationLoader = this._operationLoader;
        !operationLoader ? true ? invariant3(false, "OperationExecutor: Expected an operationLoader to be configured when using `@match`.") : invariant3(false) : void 0;
        return operationLoader;
      };
      return Executor2;
    }();
    function partitionGraphQLResponses(responses) {
      var nonIncrementalResponses = [];
      var incrementalResponses = [];
      responses.forEach(function(response) {
        if (response.path != null || response.label != null) {
          var label = response.label, path2 = response.path;
          if (label == null || path2 == null) {
            true ? true ? invariant3(false, "OperationExecutor: invalid incremental payload, expected `path` and `label` to either both be null/undefined, or `path` to be an `Array<string | number>` and `label` to be a `string`.") : invariant3(false) : void 0;
          }
          incrementalResponses.push({
            label,
            path: path2,
            response
          });
        } else {
          nonIncrementalResponses.push(response);
        }
      });
      return [nonIncrementalResponses, incrementalResponses];
    }
    function normalizeResponse(response, selector, typeName2, options) {
      var _response$extensions3;
      var data = response.data, errors = response.errors;
      var source = RelayRecordSource.create();
      var record = RelayModernRecord.create(selector.dataID, typeName2);
      source.set(selector.dataID, record);
      var relayPayload = RelayResponseNormalizer.normalize(source, selector, data, options);
      return (0, _objectSpread210["default"])((0, _objectSpread210["default"])({}, relayPayload), {}, {
        errors,
        isFinal: ((_response$extensions3 = response.extensions) === null || _response$extensions3 === void 0 ? void 0 : _response$extensions3.is_final) === true
      });
    }
    function stableStringify(value) {
      var _JSON$stringify;
      return (_JSON$stringify = JSON.stringify(stableCopy(value))) !== null && _JSON$stringify !== void 0 ? _JSON$stringify : "";
    }
    function validateOptimisticResponsePayload(payload) {
      var incrementalPlaceholders = payload.incrementalPlaceholders;
      if (incrementalPlaceholders != null && incrementalPlaceholders.length !== 0) {
        true ? true ? invariant3(false, "OperationExecutor: optimistic responses cannot be returned for operations that use incremental data delivery (@defer, @stream, and @stream_connection).") : invariant3(false) : void 0;
      }
    }
    module.exports = {
      execute
    };
  }
});

// node_modules/relay-runtime/lib/mutations/RelayRecordSourceMutator.js
var require_RelayRecordSourceMutator2 = __commonJS({
  "node_modules/relay-runtime/lib/mutations/RelayRecordSourceMutator.js"(exports, module) {
    "use strict";
    var RelayModernRecord = require_RelayModernRecord2();
    var _require = require_RelayRecordState2();
    var EXISTENT = _require.EXISTENT;
    var invariant3 = require_browser();
    var RelayRecordSourceMutator = /* @__PURE__ */ function() {
      function RelayRecordSourceMutator2(base2, sink) {
        this.__sources = [sink, base2];
        this._base = base2;
        this._sink = sink;
      }
      var _proto = RelayRecordSourceMutator2.prototype;
      _proto.unstable_getRawRecordWithChanges = function unstable_getRawRecordWithChanges(dataID) {
        var baseRecord = this._base.get(dataID);
        var sinkRecord = this._sink.get(dataID);
        if (sinkRecord === void 0) {
          if (baseRecord == null) {
            return baseRecord;
          }
          var nextRecord = RelayModernRecord.clone(baseRecord);
          if (true) {
            RelayModernRecord.freeze(nextRecord);
          }
          return nextRecord;
        } else if (sinkRecord === null) {
          return null;
        } else if (baseRecord != null) {
          var _nextRecord = RelayModernRecord.update(baseRecord, sinkRecord);
          if (true) {
            if (_nextRecord !== baseRecord) {
              RelayModernRecord.freeze(_nextRecord);
            }
          }
          return _nextRecord;
        } else {
          var _nextRecord2 = RelayModernRecord.clone(sinkRecord);
          if (true) {
            RelayModernRecord.freeze(_nextRecord2);
          }
          return _nextRecord2;
        }
      };
      _proto._getSinkRecord = function _getSinkRecord(dataID) {
        var sinkRecord = this._sink.get(dataID);
        if (!sinkRecord) {
          var baseRecord = this._base.get(dataID);
          !baseRecord ? true ? invariant3(false, "RelayRecordSourceMutator: Cannot modify non-existent record `%s`.", dataID) : invariant3(false) : void 0;
          sinkRecord = RelayModernRecord.create(dataID, RelayModernRecord.getType(baseRecord));
          this._sink.set(dataID, sinkRecord);
        }
        return sinkRecord;
      };
      _proto.copyFields = function copyFields(sourceID, sinkID) {
        var sinkSource = this._sink.get(sourceID);
        var baseSource = this._base.get(sourceID);
        !(sinkSource || baseSource) ? true ? invariant3(false, "RelayRecordSourceMutator#copyFields(): Cannot copy fields from non-existent record `%s`.", sourceID) : invariant3(false) : void 0;
        var sink = this._getSinkRecord(sinkID);
        if (baseSource) {
          RelayModernRecord.copyFields(baseSource, sink);
        }
        if (sinkSource) {
          RelayModernRecord.copyFields(sinkSource, sink);
        }
      };
      _proto.copyFieldsFromRecord = function copyFieldsFromRecord(record, sinkID) {
        var sink = this._getSinkRecord(sinkID);
        RelayModernRecord.copyFields(record, sink);
      };
      _proto.create = function create4(dataID, typeName2) {
        !(this._base.getStatus(dataID) !== EXISTENT && this._sink.getStatus(dataID) !== EXISTENT) ? true ? invariant3(false, "RelayRecordSourceMutator#create(): Cannot create a record with id `%s`, this record already exists.", dataID) : invariant3(false) : void 0;
        var record = RelayModernRecord.create(dataID, typeName2);
        this._sink.set(dataID, record);
      };
      _proto["delete"] = function _delete(dataID) {
        this._sink["delete"](dataID);
      };
      _proto.getStatus = function getStatus(dataID) {
        return this._sink.has(dataID) ? this._sink.getStatus(dataID) : this._base.getStatus(dataID);
      };
      _proto.getType = function getType(dataID) {
        for (var ii = 0; ii < this.__sources.length; ii++) {
          var record = this.__sources[ii].get(dataID);
          if (record) {
            return RelayModernRecord.getType(record);
          } else if (record === null) {
            return null;
          }
        }
      };
      _proto.getValue = function getValue(dataID, storageKey) {
        for (var ii = 0; ii < this.__sources.length; ii++) {
          var record = this.__sources[ii].get(dataID);
          if (record) {
            var value = RelayModernRecord.getValue(record, storageKey);
            if (value !== void 0) {
              return value;
            }
          } else if (record === null) {
            return null;
          }
        }
      };
      _proto.setValue = function setValue(dataID, storageKey, value) {
        var sinkRecord = this._getSinkRecord(dataID);
        RelayModernRecord.setValue(sinkRecord, storageKey, value);
      };
      _proto.getLinkedRecordID = function getLinkedRecordID(dataID, storageKey) {
        for (var ii = 0; ii < this.__sources.length; ii++) {
          var record = this.__sources[ii].get(dataID);
          if (record) {
            var linkedID = RelayModernRecord.getLinkedRecordID(record, storageKey);
            if (linkedID !== void 0) {
              return linkedID;
            }
          } else if (record === null) {
            return null;
          }
        }
      };
      _proto.setLinkedRecordID = function setLinkedRecordID(dataID, storageKey, linkedID) {
        var sinkRecord = this._getSinkRecord(dataID);
        RelayModernRecord.setLinkedRecordID(sinkRecord, storageKey, linkedID);
      };
      _proto.getLinkedRecordIDs = function getLinkedRecordIDs(dataID, storageKey) {
        for (var ii = 0; ii < this.__sources.length; ii++) {
          var record = this.__sources[ii].get(dataID);
          if (record) {
            var linkedIDs = RelayModernRecord.getLinkedRecordIDs(record, storageKey);
            if (linkedIDs !== void 0) {
              return linkedIDs;
            }
          } else if (record === null) {
            return null;
          }
        }
      };
      _proto.setLinkedRecordIDs = function setLinkedRecordIDs(dataID, storageKey, linkedIDs) {
        var sinkRecord = this._getSinkRecord(dataID);
        RelayModernRecord.setLinkedRecordIDs(sinkRecord, storageKey, linkedIDs);
      };
      return RelayRecordSourceMutator2;
    }();
    module.exports = RelayRecordSourceMutator;
  }
});

// node_modules/relay-runtime/lib/mutations/createUpdatableProxy.js
var require_createUpdatableProxy2 = __commonJS({
  "node_modules/relay-runtime/lib/mutations/createUpdatableProxy.js"(exports, module) {
    "use strict";
    var _interopRequireDefault = require_interopRequireDefault()["default"];
    var _createForOfIteratorHelper2 = _interopRequireDefault(require_createForOfIteratorHelper());
    var _require = require_RelayStoreUtils2();
    var getArgumentValues = _require.getArgumentValues;
    var _require2 = require_RelayConcreteNode2();
    var ACTOR_CHANGE = _require2.ACTOR_CHANGE;
    var ALIASED_FRAGMENT_SPREAD = _require2.ALIASED_FRAGMENT_SPREAD;
    var ALIASED_INLINE_FRAGMENT_SPREAD = _require2.ALIASED_INLINE_FRAGMENT_SPREAD;
    var CLIENT_EDGE_TO_CLIENT_OBJECT = _require2.CLIENT_EDGE_TO_CLIENT_OBJECT;
    var CLIENT_EDGE_TO_SERVER_OBJECT = _require2.CLIENT_EDGE_TO_SERVER_OBJECT;
    var CLIENT_EXTENSION = _require2.CLIENT_EXTENSION;
    var CONDITION = _require2.CONDITION;
    var DEFER = _require2.DEFER;
    var FLIGHT_FIELD = _require2.FLIGHT_FIELD;
    var FRAGMENT_SPREAD = _require2.FRAGMENT_SPREAD;
    var INLINE_DATA_FRAGMENT_SPREAD = _require2.INLINE_DATA_FRAGMENT_SPREAD;
    var INLINE_FRAGMENT = _require2.INLINE_FRAGMENT;
    var LINKED_FIELD = _require2.LINKED_FIELD;
    var MODULE_IMPORT = _require2.MODULE_IMPORT;
    var RELAY_LIVE_RESOLVER = _require2.RELAY_LIVE_RESOLVER;
    var RELAY_RESOLVER = _require2.RELAY_RESOLVER;
    var REQUIRED_FIELD = _require2.REQUIRED_FIELD;
    var SCALAR_FIELD = _require2.SCALAR_FIELD;
    var STREAM = _require2.STREAM;
    var nonUpdatableKeys = ["id", "__id", "__typename", "js"];
    function createUpdatableProxy(updatableProxyRootRecord, variables, selections, recordSourceProxy) {
      var mutableUpdatableProxy = {};
      updateProxyFromSelections(mutableUpdatableProxy, updatableProxyRootRecord, variables, selections, recordSourceProxy);
      if (true) {
        Object.freeze(mutableUpdatableProxy);
      }
      return mutableUpdatableProxy;
    }
    function updateProxyFromSelections(mutableUpdatableProxy, updatableProxyRootRecord, variables, selections, recordSourceProxy) {
      var _selection$alias3;
      var _iterator = (0, _createForOfIteratorHelper2["default"])(selections), _step;
      try {
        var _loop = function _loop2() {
          var selection2 = _step.value;
          switch (selection2.kind) {
            case LINKED_FIELD:
              if (selection2.plural) {
                Object.defineProperty(mutableUpdatableProxy, (_selection$alias = selection2.alias) !== null && _selection$alias !== void 0 ? _selection$alias : selection2.name, {
                  // $FlowFixMe[incompatible-call] these getters and setters have different types on purpose
                  get: createGetterForPluralLinkedField(selection2, variables, updatableProxyRootRecord, recordSourceProxy),
                  set: createSetterForPluralLinkedField(selection2, variables, updatableProxyRootRecord, recordSourceProxy)
                });
              } else {
                Object.defineProperty(mutableUpdatableProxy, (_selection$alias2 = selection2.alias) !== null && _selection$alias2 !== void 0 ? _selection$alias2 : selection2.name, {
                  get: createGetterForSingularLinkedField(selection2, variables, updatableProxyRootRecord, recordSourceProxy),
                  set: createSetterForSingularLinkedField(selection2, variables, updatableProxyRootRecord, recordSourceProxy)
                });
              }
              break;
            case SCALAR_FIELD:
              var scalarFieldName = (_selection$alias3 = selection2.alias) !== null && _selection$alias3 !== void 0 ? _selection$alias3 : selection2.name;
              Object.defineProperty(mutableUpdatableProxy, scalarFieldName, {
                get: function get3() {
                  var _selection$args;
                  var newVariables = getArgumentValues((_selection$args = selection2.args) !== null && _selection$args !== void 0 ? _selection$args : [], variables);
                  return updatableProxyRootRecord.getValue(
                    selection2.name,
                    newVariables
                    // $FlowFixMe[unclear-type] Typed by the generated updatable query flow type
                  );
                },
                set: nonUpdatableKeys.includes(selection2.name) ? void 0 : (
                  // $FlowFixMe[unclear-type] Typed by the generated updatable query flow type
                  function(newValue) {
                    var _selection$args2;
                    var newVariables = getArgumentValues((_selection$args2 = selection2.args) !== null && _selection$args2 !== void 0 ? _selection$args2 : [], variables);
                    updatableProxyRootRecord.setValue__UNSAFE(newValue, selection2.name, newVariables);
                  }
                )
              });
              break;
            case INLINE_FRAGMENT:
              if (updatableProxyRootRecord.getType() === selection2.type) {
                updateProxyFromSelections(mutableUpdatableProxy, updatableProxyRootRecord, variables, selection2.selections, recordSourceProxy);
              }
              break;
            case CLIENT_EXTENSION:
              updateProxyFromSelections(mutableUpdatableProxy, updatableProxyRootRecord, variables, selection2.selections, recordSourceProxy);
              break;
            case FRAGMENT_SPREAD:
              break;
            case CONDITION:
            case ACTOR_CHANGE:
            case ALIASED_FRAGMENT_SPREAD:
            case INLINE_DATA_FRAGMENT_SPREAD:
            case ALIASED_INLINE_FRAGMENT_SPREAD:
            case CLIENT_EDGE_TO_CLIENT_OBJECT:
            case CLIENT_EDGE_TO_SERVER_OBJECT:
            case DEFER:
            case FLIGHT_FIELD:
            case MODULE_IMPORT:
            case RELAY_LIVE_RESOLVER:
            case REQUIRED_FIELD:
            case STREAM:
            case RELAY_RESOLVER:
              throw new Error("Encountered an unexpected ReaderSelection variant in RelayRecordSourceProxy. This indicates a bug in Relay.");
            default:
              selection2.kind;
              throw new Error("Encountered an unexpected ReaderSelection variant in RelayRecordSourceProxy. This indicates a bug in Relay.");
          }
        };
        for (_iterator.s(); !(_step = _iterator.n()).done; ) {
          var _selection$alias;
          var _selection$alias2;
          _loop();
        }
      } catch (err) {
        _iterator.e(err);
      } finally {
        _iterator.f();
      }
    }
    function createSetterForPluralLinkedField(selection2, variables, updatableProxyRootRecord, recordSourceProxy) {
      return function set3(newValue) {
        var _selection$args3;
        var newVariables = getArgumentValues((_selection$args3 = selection2.args) !== null && _selection$args3 !== void 0 ? _selection$args3 : [], variables);
        if (newValue == null) {
          throw new Error("Do not assign null to plural linked fields; assign an empty array instead.");
        } else {
          var recordProxies = newValue.map(function(item) {
            if (item == null) {
              throw new Error("When assigning an array of items, none of the items should be null or undefined.");
            }
            var __id = item.__id;
            if (__id == null) {
              throw new Error("The __id field must be present on each item passed to the setter. This indicates a bug in Relay.");
            }
            var newValueRecord = recordSourceProxy.get(__id);
            if (newValueRecord == null) {
              throw new Error("Did not find item with data id ".concat(__id, " in the store."));
            }
            return newValueRecord;
          });
          updatableProxyRootRecord.setLinkedRecords(recordProxies, selection2.name, newVariables);
        }
      };
    }
    function createSetterForSingularLinkedField(selection2, variables, updatableProxyRootRecord, recordSourceProxy) {
      return function set3(newValue) {
        var _selection$args4;
        var newVariables = getArgumentValues((_selection$args4 = selection2.args) !== null && _selection$args4 !== void 0 ? _selection$args4 : [], variables);
        if (newValue == null) {
          updatableProxyRootRecord.setValue(newValue, selection2.name, newVariables);
        } else {
          var __id = newValue.__id;
          if (__id == null) {
            throw new Error("The __id field must be present on the argument. This indicates a bug in Relay.");
          }
          var newValueRecord = recordSourceProxy.get(__id);
          if (newValueRecord == null) {
            throw new Error("Did not find item with data id ".concat(__id, " in the store."));
          }
          updatableProxyRootRecord.setLinkedRecord(newValueRecord, selection2.name, newVariables);
        }
      };
    }
    function createGetterForPluralLinkedField(selection2, variables, updatableProxyRootRecord, recordSourceProxy) {
      return function() {
        var _selection$args5;
        var newVariables = getArgumentValues((_selection$args5 = selection2.args) !== null && _selection$args5 !== void 0 ? _selection$args5 : [], variables);
        var linkedRecords = updatableProxyRootRecord.getLinkedRecords(selection2.name, newVariables);
        if (linkedRecords != null) {
          return linkedRecords.map(function(linkedRecord) {
            if (linkedRecord != null) {
              var updatableProxy = {};
              updateProxyFromSelections(updatableProxy, linkedRecord, variables, selection2.selections, recordSourceProxy);
              if (true) {
                Object.freeze(updatableProxy);
              }
              return updatableProxy;
            } else {
              return linkedRecord;
            }
          });
        } else {
          return linkedRecords;
        }
      };
    }
    function createGetterForSingularLinkedField(selection2, variables, updatableProxyRootRecord, recordSourceProxy) {
      return function() {
        var _selection$args6;
        var newVariables = getArgumentValues((_selection$args6 = selection2.args) !== null && _selection$args6 !== void 0 ? _selection$args6 : [], variables);
        var linkedRecord = updatableProxyRootRecord.getLinkedRecord(selection2.name, newVariables);
        if (linkedRecord != null) {
          var updatableProxy = {};
          updateProxyFromSelections(updatableProxy, linkedRecord, variables, selection2.selections, recordSourceProxy);
          if (true) {
            Object.freeze(updatableProxy);
          }
          return updatableProxy;
        } else {
          return linkedRecord;
        }
      };
    }
    module.exports = {
      createUpdatableProxy
    };
  }
});

// node_modules/relay-runtime/lib/mutations/readUpdatableFragment_EXPERIMENTAL.js
var require_readUpdatableFragment_EXPERIMENTAL = __commonJS({
  "node_modules/relay-runtime/lib/mutations/readUpdatableFragment_EXPERIMENTAL.js"(exports, module) {
    "use strict";
    var _require = require_GraphQLTag2();
    var getFragment = _require.getFragment;
    var _require2 = require_RelayModernSelector2();
    var getVariablesFromFragment = _require2.getVariablesFromFragment;
    var _require3 = require_RelayStoreUtils2();
    var ID_KEY = _require3.ID_KEY;
    var _require4 = require_createUpdatableProxy2();
    var createUpdatableProxy = _require4.createUpdatableProxy;
    var invariant3 = require_browser();
    function readUpdatableFragment_EXPERIMENTAL(fragment2, fragmentReference, proxy) {
      var updatableFragment = getFragment(fragment2);
      var fragmentVariables = getVariablesFromFragment(updatableFragment, fragmentReference);
      var id2 = fragmentReference[ID_KEY];
      var fragmentRoot = proxy.get(id2);
      !(fragmentRoot != null) ? true ? invariant3(false, "No record with ".concat(id2, " was found. This likely indicates a problem with Relay.")) : invariant3(false) : void 0;
      return {
        updatableData: createUpdatableProxy(fragmentRoot, fragmentVariables, updatableFragment.selections, proxy)
      };
    }
    module.exports = {
      readUpdatableFragment_EXPERIMENTAL
    };
  }
});

// node_modules/relay-runtime/lib/mutations/readUpdatableQuery_EXPERIMENTAL.js
var require_readUpdatableQuery_EXPERIMENTAL = __commonJS({
  "node_modules/relay-runtime/lib/mutations/readUpdatableQuery_EXPERIMENTAL.js"(exports, module) {
    "use strict";
    var _require = require_GraphQLTag2();
    var getUpdatableQuery = _require.getUpdatableQuery;
    var _require2 = require_createUpdatableProxy2();
    var createUpdatableProxy = _require2.createUpdatableProxy;
    function readUpdatableQuery_EXPERIMENTAL(query2, variables, proxy) {
      var updatableQuery = getUpdatableQuery(query2);
      return {
        updatableData: createUpdatableProxy(proxy.getRoot(), variables, updatableQuery.fragment.selections, proxy)
      };
    }
    module.exports = {
      readUpdatableQuery_EXPERIMENTAL
    };
  }
});

// node_modules/relay-runtime/lib/mutations/RelayRecordProxy.js
var require_RelayRecordProxy2 = __commonJS({
  "node_modules/relay-runtime/lib/mutations/RelayRecordProxy.js"(exports, module) {
    "use strict";
    var _require = require_ClientID2();
    var generateClientID = _require.generateClientID;
    var _require2 = require_RelayStoreUtils2();
    var getStableStorageKey = _require2.getStableStorageKey;
    var invariant3 = require_browser();
    var RelayRecordProxy = /* @__PURE__ */ function() {
      function RelayRecordProxy2(source, mutator, dataID) {
        this._dataID = dataID;
        this._mutator = mutator;
        this._source = source;
      }
      var _proto = RelayRecordProxy2.prototype;
      _proto.copyFieldsFrom = function copyFieldsFrom(source) {
        this._mutator.copyFields(source.getDataID(), this._dataID);
      };
      _proto.getDataID = function getDataID() {
        return this._dataID;
      };
      _proto.getType = function getType() {
        var type = this._mutator.getType(this._dataID);
        !(type != null) ? true ? invariant3(false, "RelayRecordProxy: Cannot get the type of deleted record `%s`.", this._dataID) : invariant3(false) : void 0;
        return type;
      };
      _proto.getValue = function getValue(name2, args) {
        var storageKey = getStableStorageKey(name2, args);
        return this._mutator.getValue(this._dataID, storageKey);
      };
      _proto.setValue = function setValue(value, name2, args) {
        !isValidLeafValue(value) ? true ? invariant3(false, "RelayRecordProxy#setValue(): Expected a scalar or array of scalars, got `%s`.", JSON.stringify(value)) : invariant3(false) : void 0;
        return this.setValue__UNSAFE(value, name2, args);
      };
      _proto.setValue__UNSAFE = function setValue__UNSAFE(value, name2, args) {
        var storageKey = getStableStorageKey(name2, args);
        this._mutator.setValue(this._dataID, storageKey, value);
        return this;
      };
      _proto.getLinkedRecord = function getLinkedRecord(name2, args) {
        var storageKey = getStableStorageKey(name2, args);
        var linkedID = this._mutator.getLinkedRecordID(this._dataID, storageKey);
        return linkedID != null ? this._source.get(linkedID) : linkedID;
      };
      _proto.setLinkedRecord = function setLinkedRecord(record, name2, args) {
        !(record instanceof RelayRecordProxy2) ? true ? invariant3(false, "RelayRecordProxy#setLinkedRecord(): Expected a record, got `%s`.", record) : invariant3(false) : void 0;
        var storageKey = getStableStorageKey(name2, args);
        var linkedID = record.getDataID();
        this._mutator.setLinkedRecordID(this._dataID, storageKey, linkedID);
        return this;
      };
      _proto.getOrCreateLinkedRecord = function getOrCreateLinkedRecord(name2, typeName2, args) {
        var linkedRecord = this.getLinkedRecord(name2, args);
        if (!linkedRecord) {
          var _this$_source$get;
          var storageKey = getStableStorageKey(name2, args);
          var clientID = generateClientID(this.getDataID(), storageKey);
          linkedRecord = (_this$_source$get = this._source.get(clientID)) !== null && _this$_source$get !== void 0 ? _this$_source$get : this._source.create(clientID, typeName2);
          this.setLinkedRecord(linkedRecord, name2, args);
        }
        return linkedRecord;
      };
      _proto.getLinkedRecords = function getLinkedRecords(name2, args) {
        var _this = this;
        var storageKey = getStableStorageKey(name2, args);
        var linkedIDs = this._mutator.getLinkedRecordIDs(this._dataID, storageKey);
        if (linkedIDs == null) {
          return linkedIDs;
        }
        return linkedIDs.map(function(linkedID) {
          return linkedID != null ? _this._source.get(linkedID) : linkedID;
        });
      };
      _proto.setLinkedRecords = function setLinkedRecords(records, name2, args) {
        !Array.isArray(records) ? true ? invariant3(false, "RelayRecordProxy#setLinkedRecords(): Expected records to be an array, got `%s`.", records) : invariant3(false) : void 0;
        var storageKey = getStableStorageKey(name2, args);
        var linkedIDs = records.map(function(record) {
          return record && record.getDataID();
        });
        this._mutator.setLinkedRecordIDs(this._dataID, storageKey, linkedIDs);
        return this;
      };
      _proto.invalidateRecord = function invalidateRecord() {
        this._source.markIDForInvalidation(this._dataID);
      };
      return RelayRecordProxy2;
    }();
    function isValidLeafValue(value) {
      return value == null || typeof value !== "object" || Array.isArray(value) && value.every(isValidLeafValue);
    }
    module.exports = RelayRecordProxy;
  }
});

// node_modules/relay-runtime/lib/mutations/RelayRecordSourceProxy.js
var require_RelayRecordSourceProxy2 = __commonJS({
  "node_modules/relay-runtime/lib/mutations/RelayRecordSourceProxy.js"(exports, module) {
    "use strict";
    var RelayModernRecord = require_RelayModernRecord2();
    var _require = require_RelayRecordState2();
    var EXISTENT = _require.EXISTENT;
    var NONEXISTENT = _require.NONEXISTENT;
    var _require2 = require_RelayStoreUtils2();
    var ROOT_ID = _require2.ROOT_ID;
    var ROOT_TYPE = _require2.ROOT_TYPE;
    var _require3 = require_readUpdatableFragment_EXPERIMENTAL();
    var _readUpdatableFragment_EXPERIMENTAL = _require3.readUpdatableFragment_EXPERIMENTAL;
    var _require4 = require_readUpdatableQuery_EXPERIMENTAL();
    var _readUpdatableQuery_EXPERIMENTAL = _require4.readUpdatableQuery_EXPERIMENTAL;
    var RelayRecordProxy = require_RelayRecordProxy2();
    var invariant3 = require_browser();
    var RelayRecordSourceProxy = /* @__PURE__ */ function() {
      function RelayRecordSourceProxy2(mutator, getDataID, handlerProvider) {
        this.__mutator = mutator;
        this._handlerProvider = handlerProvider || null;
        this._proxies = {};
        this._getDataID = getDataID;
        this._invalidatedStore = false;
        this._idsMarkedForInvalidation = /* @__PURE__ */ new Set();
      }
      var _proto = RelayRecordSourceProxy2.prototype;
      _proto.publishSource = function publishSource(source, fieldPayloads) {
        var _this = this;
        var dataIDs = source.getRecordIDs();
        dataIDs.forEach(function(dataID) {
          var status = source.getStatus(dataID);
          if (status === EXISTENT) {
            var sourceRecord = source.get(dataID);
            if (sourceRecord) {
              if (_this.__mutator.getStatus(dataID) !== EXISTENT) {
                _this.create(dataID, RelayModernRecord.getType(sourceRecord));
              }
              _this.__mutator.copyFieldsFromRecord(sourceRecord, dataID);
            }
          } else if (status === NONEXISTENT) {
            _this["delete"](dataID);
          }
        });
        if (fieldPayloads && fieldPayloads.length) {
          fieldPayloads.forEach(function(fieldPayload) {
            var handler = _this._handlerProvider && _this._handlerProvider(fieldPayload.handle);
            !handler ? true ? invariant3(false, "RelayModernEnvironment: Expected a handler to be provided for handle `%s`.", fieldPayload.handle) : invariant3(false) : void 0;
            handler.update(_this, fieldPayload);
          });
        }
      };
      _proto.create = function create4(dataID, typeName2) {
        this.__mutator.create(dataID, typeName2);
        delete this._proxies[dataID];
        var record = this.get(dataID);
        !record ? true ? invariant3(false, "RelayRecordSourceProxy#create(): Expected the created record to exist.") : invariant3(false) : void 0;
        return record;
      };
      _proto["delete"] = function _delete(dataID) {
        !(dataID !== ROOT_ID) ? true ? invariant3(false, "RelayRecordSourceProxy#delete(): Cannot delete the root record.") : invariant3(false) : void 0;
        delete this._proxies[dataID];
        this.__mutator["delete"](dataID);
      };
      _proto.get = function get3(dataID) {
        if (!this._proxies.hasOwnProperty(dataID)) {
          var status = this.__mutator.getStatus(dataID);
          if (status === EXISTENT) {
            this._proxies[dataID] = new RelayRecordProxy(this, this.__mutator, dataID);
          } else {
            this._proxies[dataID] = status === NONEXISTENT ? null : void 0;
          }
        }
        return this._proxies[dataID];
      };
      _proto.getRoot = function getRoot2() {
        var root2 = this.get(ROOT_ID);
        if (!root2) {
          root2 = this.create(ROOT_ID, ROOT_TYPE);
        }
        !(root2 && root2.getType() === ROOT_TYPE) ? true ? invariant3(false, "RelayRecordSourceProxy#getRoot(): Expected the source to contain a root record, %s.", root2 == null ? "no root record found" : "found a root record of type `".concat(root2.getType(), "`")) : invariant3(false) : void 0;
        return root2;
      };
      _proto.invalidateStore = function invalidateStore() {
        this._invalidatedStore = true;
      };
      _proto.isStoreMarkedForInvalidation = function isStoreMarkedForInvalidation() {
        return this._invalidatedStore;
      };
      _proto.markIDForInvalidation = function markIDForInvalidation(dataID) {
        this._idsMarkedForInvalidation.add(dataID);
      };
      _proto.getIDsMarkedForInvalidation = function getIDsMarkedForInvalidation() {
        return this._idsMarkedForInvalidation;
      };
      _proto.readUpdatableQuery_EXPERIMENTAL = function readUpdatableQuery_EXPERIMENTAL(query2, variables) {
        return _readUpdatableQuery_EXPERIMENTAL(query2, variables, this);
      };
      _proto.readUpdatableFragment_EXPERIMENTAL = function readUpdatableFragment_EXPERIMENTAL(fragment2, fragmentReference) {
        return _readUpdatableFragment_EXPERIMENTAL(fragment2, fragmentReference, this);
      };
      return RelayRecordSourceProxy2;
    }();
    module.exports = RelayRecordSourceProxy;
  }
});

// node_modules/relay-runtime/lib/mutations/RelayRecordSourceSelectorProxy.js
var require_RelayRecordSourceSelectorProxy2 = __commonJS({
  "node_modules/relay-runtime/lib/mutations/RelayRecordSourceSelectorProxy.js"(exports, module) {
    "use strict";
    var _require = require_RelayStoreUtils2();
    var ROOT_TYPE = _require.ROOT_TYPE;
    var getStorageKey = _require.getStorageKey;
    var _require2 = require_readUpdatableFragment_EXPERIMENTAL();
    var _readUpdatableFragment_EXPERIMENTAL = _require2.readUpdatableFragment_EXPERIMENTAL;
    var _require3 = require_readUpdatableQuery_EXPERIMENTAL();
    var _readUpdatableQuery_EXPERIMENTAL = _require3.readUpdatableQuery_EXPERIMENTAL;
    var invariant3 = require_browser();
    var RelayRecordSourceSelectorProxy = /* @__PURE__ */ function() {
      function RelayRecordSourceSelectorProxy2(mutator, recordSource, readSelector) {
        this.__mutator = mutator;
        this.__recordSource = recordSource;
        this._readSelector = readSelector;
      }
      var _proto = RelayRecordSourceSelectorProxy2.prototype;
      _proto.create = function create4(dataID, typeName2) {
        return this.__recordSource.create(dataID, typeName2);
      };
      _proto["delete"] = function _delete(dataID) {
        this.__recordSource["delete"](dataID);
      };
      _proto.get = function get3(dataID) {
        return this.__recordSource.get(dataID);
      };
      _proto.getRoot = function getRoot2() {
        return this.__recordSource.getRoot();
      };
      _proto.getOperationRoot = function getOperationRoot() {
        var root2 = this.__recordSource.get(this._readSelector.dataID);
        if (!root2) {
          root2 = this.__recordSource.create(this._readSelector.dataID, ROOT_TYPE);
        }
        return root2;
      };
      _proto._getRootField = function _getRootField(selector, fieldName, plural) {
        var field = selector.node.selections.find(function(selection2) {
          return selection2.kind === "LinkedField" && selection2.name === fieldName || selection2.kind === "RequiredField" && selection2.field.name === fieldName;
        });
        if (field && field.kind === "RequiredField") {
          field = field.field;
        }
        !(field && field.kind === "LinkedField") ? true ? invariant3(false, "RelayRecordSourceSelectorProxy#getRootField(): Cannot find root field `%s`, no such field is defined on GraphQL document `%s`.", fieldName, selector.node.name) : invariant3(false) : void 0;
        !(field.plural === plural) ? true ? invariant3(false, "RelayRecordSourceSelectorProxy#getRootField(): Expected root field `%s` to be %s.", fieldName, plural ? "plural" : "singular") : invariant3(false) : void 0;
        return field;
      };
      _proto.getRootField = function getRootField(fieldName) {
        var field = this._getRootField(this._readSelector, fieldName, false);
        var storageKey = getStorageKey(field, this._readSelector.variables);
        return this.getOperationRoot().getLinkedRecord(storageKey);
      };
      _proto.getPluralRootField = function getPluralRootField(fieldName) {
        var field = this._getRootField(this._readSelector, fieldName, true);
        var storageKey = getStorageKey(field, this._readSelector.variables);
        return this.getOperationRoot().getLinkedRecords(storageKey);
      };
      _proto.invalidateStore = function invalidateStore() {
        this.__recordSource.invalidateStore();
      };
      _proto.readUpdatableQuery_EXPERIMENTAL = function readUpdatableQuery_EXPERIMENTAL(query2, variables) {
        return _readUpdatableQuery_EXPERIMENTAL(query2, variables, this);
      };
      _proto.readUpdatableFragment_EXPERIMENTAL = function readUpdatableFragment_EXPERIMENTAL(fragment2, fragmentReference) {
        return _readUpdatableFragment_EXPERIMENTAL(fragment2, fragmentReference, this);
      };
      return RelayRecordSourceSelectorProxy2;
    }();
    module.exports = RelayRecordSourceSelectorProxy;
  }
});

// node_modules/relay-runtime/lib/store/experimental-live-resolvers/LiveResolverSuspenseSentinel.js
var require_LiveResolverSuspenseSentinel2 = __commonJS({
  "node_modules/relay-runtime/lib/store/experimental-live-resolvers/LiveResolverSuspenseSentinel.js"(exports, module) {
    "use strict";
    var LIVE_RESOLVER_SUSPENSE_SENTINEL = Object.freeze({
      __LIVE_RESOLVER_SUSPENSE_SENTINEL: true
    });
    function suspenseSentinel() {
      return LIVE_RESOLVER_SUSPENSE_SENTINEL;
    }
    function isSuspenseSentinel(value) {
      return value === LIVE_RESOLVER_SUSPENSE_SENTINEL;
    }
    module.exports = {
      isSuspenseSentinel,
      suspenseSentinel
    };
  }
});

// node_modules/relay-runtime/lib/store/ResolverCache.js
var require_ResolverCache2 = __commonJS({
  "node_modules/relay-runtime/lib/store/ResolverCache.js"(exports, module) {
    "use strict";
    var _interopRequireDefault = require_interopRequireDefault()["default"];
    var _createForOfIteratorHelper2 = _interopRequireDefault(require_createForOfIteratorHelper());
    var recycleNodesInto = require_recycleNodesInto2();
    var _require = require_RelayConcreteNode2();
    var RELAY_LIVE_RESOLVER = _require.RELAY_LIVE_RESOLVER;
    var _require2 = require_ClientID2();
    var generateClientID = _require2.generateClientID;
    var RelayModernRecord = require_RelayModernRecord2();
    var _require3 = require_RelayStoreUtils2();
    var RELAY_RESOLVER_ERROR_KEY = _require3.RELAY_RESOLVER_ERROR_KEY;
    var RELAY_RESOLVER_INVALIDATION_KEY = _require3.RELAY_RESOLVER_INVALIDATION_KEY;
    var RELAY_RESOLVER_SNAPSHOT_KEY = _require3.RELAY_RESOLVER_SNAPSHOT_KEY;
    var RELAY_RESOLVER_VALUE_KEY = _require3.RELAY_RESOLVER_VALUE_KEY;
    var getStorageKey = _require3.getStorageKey;
    var invariant3 = require_browser();
    var warning2 = require_warning();
    var emptySet = /* @__PURE__ */ new Set();
    var NoopResolverCache = /* @__PURE__ */ function() {
      function NoopResolverCache2() {
      }
      var _proto = NoopResolverCache2.prototype;
      _proto.readFromCacheOrEvaluate = function readFromCacheOrEvaluate(record, field, variables, evaluate, getDataForResolverFragment) {
        !(field.kind !== RELAY_LIVE_RESOLVER) ? true ? invariant3(false, "This store does not support Live Resolvers") : invariant3(false) : void 0;
        var _evaluate = evaluate(), resolverResult = _evaluate.resolverResult, snapshot = _evaluate.snapshot, error = _evaluate.error;
        return [resolverResult, void 0, error, snapshot, void 0];
      };
      _proto.invalidateDataIDs = function invalidateDataIDs(updatedDataIDs) {
      };
      _proto.ensureClientRecord = function ensureClientRecord(id2, typeName2) {
        true ? true ? invariant3(false, "Client Edges to Client Objects are not supported in this version of Relay Store") : invariant3(false) : void 0;
      };
      return NoopResolverCache2;
    }();
    function addDependencyEdge(edges, from2, to) {
      var set3 = edges.get(from2);
      if (!set3) {
        set3 = /* @__PURE__ */ new Set();
        edges.set(from2, set3);
      }
      set3.add(to);
    }
    var RecordResolverCache = /* @__PURE__ */ function() {
      function RecordResolverCache2(getRecordSource) {
        this._resolverIDToRecordIDs = /* @__PURE__ */ new Map();
        this._recordIDToResolverIDs = /* @__PURE__ */ new Map();
        this._getRecordSource = getRecordSource;
      }
      var _proto2 = RecordResolverCache2.prototype;
      _proto2.readFromCacheOrEvaluate = function readFromCacheOrEvaluate(record, field, variables, evaluate, getDataForResolverFragment) {
        var recordSource = this._getRecordSource();
        var recordID = RelayModernRecord.getDataID(record);
        var storageKey = getStorageKey(field, variables);
        var linkedID = RelayModernRecord.getLinkedRecordID(record, storageKey);
        var linkedRecord = linkedID == null ? null : recordSource.get(linkedID);
        if (linkedRecord == null || this._isInvalid(linkedRecord, getDataForResolverFragment)) {
          var _linkedID, _evaluationResult$sna;
          linkedID = (_linkedID = linkedID) !== null && _linkedID !== void 0 ? _linkedID : generateClientID(recordID, storageKey);
          linkedRecord = RelayModernRecord.create(linkedID, "__RELAY_RESOLVER__");
          var evaluationResult = evaluate();
          RelayModernRecord.setValue(linkedRecord, RELAY_RESOLVER_VALUE_KEY, evaluationResult.resolverResult);
          RelayModernRecord.setValue(linkedRecord, RELAY_RESOLVER_SNAPSHOT_KEY, evaluationResult.snapshot);
          RelayModernRecord.setValue(linkedRecord, RELAY_RESOLVER_ERROR_KEY, evaluationResult.error);
          recordSource.set(linkedID, linkedRecord);
          var nextRecord = RelayModernRecord.clone(record);
          RelayModernRecord.setLinkedRecordID(nextRecord, storageKey, linkedID);
          recordSource.set(RelayModernRecord.getDataID(nextRecord), nextRecord);
          var resolverID = evaluationResult.resolverID;
          addDependencyEdge(this._resolverIDToRecordIDs, resolverID, linkedID);
          addDependencyEdge(this._recordIDToResolverIDs, recordID, resolverID);
          var seenRecordIds = (_evaluationResult$sna = evaluationResult.snapshot) === null || _evaluationResult$sna === void 0 ? void 0 : _evaluationResult$sna.seenRecords;
          if (seenRecordIds != null) {
            var _iterator = (0, _createForOfIteratorHelper2["default"])(seenRecordIds), _step;
            try {
              for (_iterator.s(); !(_step = _iterator.n()).done; ) {
                var seenRecordID = _step.value;
                addDependencyEdge(this._recordIDToResolverIDs, seenRecordID, resolverID);
              }
            } catch (err) {
              _iterator.e(err);
            } finally {
              _iterator.f();
            }
          }
        }
        var answer = linkedRecord[RELAY_RESOLVER_VALUE_KEY];
        var snapshot = linkedRecord[RELAY_RESOLVER_SNAPSHOT_KEY];
        var error = linkedRecord[RELAY_RESOLVER_ERROR_KEY];
        return [answer, linkedID, error, snapshot, void 0];
      };
      _proto2.invalidateDataIDs = function invalidateDataIDs(updatedDataIDs) {
        var recordSource = this._getRecordSource();
        var visited = /* @__PURE__ */ new Set();
        var recordsToVisit = Array.from(updatedDataIDs);
        while (recordsToVisit.length) {
          var recordID = recordsToVisit.pop();
          updatedDataIDs.add(recordID);
          var _iterator2 = (0, _createForOfIteratorHelper2["default"])((_this$_recordIDToReso = this._recordIDToResolverIDs.get(recordID)) !== null && _this$_recordIDToReso !== void 0 ? _this$_recordIDToReso : emptySet), _step2;
          try {
            for (_iterator2.s(); !(_step2 = _iterator2.n()).done; ) {
              var _this$_recordIDToReso;
              var fragment2 = _step2.value;
              if (!visited.has(fragment2)) {
                var _iterator3 = (0, _createForOfIteratorHelper2["default"])((_this$_resolverIDToRe = this._resolverIDToRecordIDs.get(fragment2)) !== null && _this$_resolverIDToRe !== void 0 ? _this$_resolverIDToRe : emptySet), _step3;
                try {
                  for (_iterator3.s(); !(_step3 = _iterator3.n()).done; ) {
                    var _this$_resolverIDToRe;
                    var anotherRecordID = _step3.value;
                    this._markInvalidatedResolverRecord(anotherRecordID, recordSource, updatedDataIDs);
                    if (!visited.has(anotherRecordID)) {
                      recordsToVisit.push(anotherRecordID);
                    }
                  }
                } catch (err) {
                  _iterator3.e(err);
                } finally {
                  _iterator3.f();
                }
              }
            }
          } catch (err) {
            _iterator2.e(err);
          } finally {
            _iterator2.f();
          }
        }
      };
      _proto2._markInvalidatedResolverRecord = function _markInvalidatedResolverRecord(dataID, recordSource, updatedDataIDs) {
        var record = recordSource.get(dataID);
        if (!record) {
          true ? warning2(false, "Expected a resolver record with ID %s, but it was missing.", dataID) : void 0;
          return;
        }
        var nextRecord = RelayModernRecord.clone(record);
        RelayModernRecord.setValue(nextRecord, RELAY_RESOLVER_INVALIDATION_KEY, true);
        recordSource.set(dataID, nextRecord);
      };
      _proto2._isInvalid = function _isInvalid(record, getDataForResolverFragment) {
        if (!RelayModernRecord.getValue(record, RELAY_RESOLVER_INVALIDATION_KEY)) {
          return false;
        }
        var snapshot = RelayModernRecord.getValue(record, RELAY_RESOLVER_SNAPSHOT_KEY);
        var originalInputs = snapshot === null || snapshot === void 0 ? void 0 : snapshot.data;
        var readerSelector = snapshot === null || snapshot === void 0 ? void 0 : snapshot.selector;
        if (originalInputs == null || readerSelector == null) {
          true ? warning2(false, "Expected previous inputs and reader selector on resolver record with ID %s, but they were missing.", RelayModernRecord.getDataID(record)) : void 0;
          return true;
        }
        var _getDataForResolverFr = getDataForResolverFragment(readerSelector), latestValues = _getDataForResolverFr.data;
        var recycled = recycleNodesInto(originalInputs, latestValues);
        if (recycled !== originalInputs) {
          return true;
        }
        return false;
      };
      _proto2.ensureClientRecord = function ensureClientRecord(id2, typename) {
        true ? true ? invariant3(false, "Client Edges to Client Objects are not supported in this version of Relay Store") : invariant3(false) : void 0;
      };
      return RecordResolverCache2;
    }();
    module.exports = {
      NoopResolverCache,
      RecordResolverCache
    };
  }
});

// node_modules/relay-runtime/lib/store/ResolverFragments.js
var require_ResolverFragments2 = __commonJS({
  "node_modules/relay-runtime/lib/store/ResolverFragments.js"(exports, module) {
    "use strict";
    var _require = require_GraphQLTag2();
    var getFragment = _require.getFragment;
    var _require2 = require_RelayModernSelector2();
    var getSelector = _require2.getSelector;
    var invariant3 = require_browser();
    var contextStack = [];
    function withResolverContext(context2, cb) {
      contextStack.push(context2);
      try {
        return cb();
      } finally {
        contextStack.pop();
      }
    }
    function readFragment(fragmentInput, fragmentKey) {
      if (!contextStack.length) {
        throw new Error("readFragment should be called only from within a Relay Resolver function.");
      }
      var context2 = contextStack[contextStack.length - 1];
      var fragmentNode = getFragment(fragmentInput);
      var fragmentSelector = getSelector(fragmentNode, fragmentKey);
      !(fragmentSelector != null) ? true ? invariant3(false, "Expected a selector for the fragment of the resolver ".concat(fragmentNode.name, ", but got null.")) : invariant3(false) : void 0;
      !(fragmentSelector.kind === "SingularReaderSelector") ? true ? invariant3(false, "Expected a singular reader selector for the fragment of the resolver ".concat(fragmentNode.name, ", but it was plural.")) : invariant3(false) : void 0;
      var _context$getDataForRe = context2.getDataForResolverFragment(fragmentSelector, fragmentKey), data = _context$getDataForRe.data, isMissingData = _context$getDataForRe.isMissingData;
      if (isMissingData) {
        throw RESOLVER_FRAGMENT_MISSING_DATA_SENTINEL;
      }
      return data;
    }
    var RESOLVER_FRAGMENT_MISSING_DATA_SENTINEL = {};
    module.exports = {
      readFragment,
      withResolverContext,
      RESOLVER_FRAGMENT_MISSING_DATA_SENTINEL
    };
  }
});

// node_modules/relay-runtime/lib/store/RelayReader.js
var require_RelayReader2 = __commonJS({
  "node_modules/relay-runtime/lib/store/RelayReader.js"(exports, module) {
    "use strict";
    var _interopRequireDefault = require_interopRequireDefault()["default"];
    var _createForOfIteratorHelper2 = _interopRequireDefault(require_createForOfIteratorHelper());
    var _defineProperty210 = _interopRequireDefault(require_defineProperty());
    var _toConsumableArray22 = _interopRequireDefault(require_toConsumableArray());
    var _require = require_RelayConcreteNode2();
    var ACTOR_CHANGE = _require.ACTOR_CHANGE;
    var ALIASED_FRAGMENT_SPREAD = _require.ALIASED_FRAGMENT_SPREAD;
    var ALIASED_INLINE_FRAGMENT_SPREAD = _require.ALIASED_INLINE_FRAGMENT_SPREAD;
    var CLIENT_EDGE_TO_CLIENT_OBJECT = _require.CLIENT_EDGE_TO_CLIENT_OBJECT;
    var CLIENT_EDGE_TO_SERVER_OBJECT = _require.CLIENT_EDGE_TO_SERVER_OBJECT;
    var CLIENT_EXTENSION = _require.CLIENT_EXTENSION;
    var CONDITION = _require.CONDITION;
    var DEFER = _require.DEFER;
    var FLIGHT_FIELD = _require.FLIGHT_FIELD;
    var FRAGMENT_SPREAD = _require.FRAGMENT_SPREAD;
    var INLINE_DATA_FRAGMENT_SPREAD = _require.INLINE_DATA_FRAGMENT_SPREAD;
    var INLINE_FRAGMENT = _require.INLINE_FRAGMENT;
    var LINKED_FIELD = _require.LINKED_FIELD;
    var MODULE_IMPORT = _require.MODULE_IMPORT;
    var RELAY_LIVE_RESOLVER = _require.RELAY_LIVE_RESOLVER;
    var RELAY_RESOLVER = _require.RELAY_RESOLVER;
    var REQUIRED_FIELD = _require.REQUIRED_FIELD;
    var SCALAR_FIELD = _require.SCALAR_FIELD;
    var STREAM = _require.STREAM;
    var RelayFeatureFlags = require_RelayFeatureFlags2();
    var ClientID = require_ClientID2();
    var _require2 = require_LiveResolverSuspenseSentinel2();
    var isSuspenseSentinel = _require2.isSuspenseSentinel;
    var RelayConcreteVariables = require_RelayConcreteVariables2();
    var RelayModernRecord = require_RelayModernRecord2();
    var _require3 = require_RelayStoreReactFlightUtils2();
    var getReactFlightClientResponse = _require3.getReactFlightClientResponse;
    var _require4 = require_RelayStoreUtils2();
    var CLIENT_EDGE_TRAVERSAL_PATH = _require4.CLIENT_EDGE_TRAVERSAL_PATH;
    var FRAGMENT_OWNER_KEY = _require4.FRAGMENT_OWNER_KEY;
    var FRAGMENT_PROP_NAME_KEY = _require4.FRAGMENT_PROP_NAME_KEY;
    var FRAGMENTS_KEY = _require4.FRAGMENTS_KEY;
    var ID_KEY = _require4.ID_KEY;
    var IS_WITHIN_UNMATCHED_TYPE_REFINEMENT = _require4.IS_WITHIN_UNMATCHED_TYPE_REFINEMENT;
    var MODULE_COMPONENT_KEY = _require4.MODULE_COMPONENT_KEY;
    var ROOT_ID = _require4.ROOT_ID;
    var getArgumentValues = _require4.getArgumentValues;
    var getModuleComponentKey = _require4.getModuleComponentKey;
    var getStorageKey = _require4.getStorageKey;
    var _require5 = require_ResolverCache2();
    var NoopResolverCache = _require5.NoopResolverCache;
    var _require6 = require_ResolverFragments2();
    var RESOLVER_FRAGMENT_MISSING_DATA_SENTINEL = _require6.RESOLVER_FRAGMENT_MISSING_DATA_SENTINEL;
    var withResolverContext = _require6.withResolverContext;
    var _require7 = require_TypeID2();
    var generateTypeID = _require7.generateTypeID;
    var invariant3 = require_browser();
    function read(recordSource, selector, resolverCache) {
      var reader = new RelayReader(recordSource, selector, resolverCache !== null && resolverCache !== void 0 ? resolverCache : new NoopResolverCache());
      return reader.read();
    }
    var RelayReader = /* @__PURE__ */ function() {
      function RelayReader2(recordSource, selector, resolverCache) {
        var _selector$clientEdgeT;
        this._clientEdgeTraversalPath = RelayFeatureFlags.ENABLE_CLIENT_EDGES && (_selector$clientEdgeT = selector.clientEdgeTraversalPath) !== null && _selector$clientEdgeT !== void 0 && _selector$clientEdgeT.length ? (0, _toConsumableArray22["default"])(selector.clientEdgeTraversalPath) : [];
        this._missingClientEdges = [];
        this._missingLiveResolverFields = [];
        this._isMissingData = false;
        this._isWithinUnmatchedTypeRefinement = false;
        this._missingRequiredFields = null;
        this._owner = selector.owner;
        this._recordSource = recordSource;
        this._seenRecords = /* @__PURE__ */ new Set();
        this._selector = selector;
        this._variables = selector.variables;
        this._resolverCache = resolverCache;
        this._resolverErrors = [];
        this._fragmentName = selector.node.name;
      }
      var _proto = RelayReader2.prototype;
      _proto.read = function read2() {
        var _this$_selector = this._selector, node56 = _this$_selector.node, dataID = _this$_selector.dataID, isWithinUnmatchedTypeRefinement = _this$_selector.isWithinUnmatchedTypeRefinement;
        var abstractKey = node56.abstractKey;
        var record = this._recordSource.get(dataID);
        var isDataExpectedToBePresent = !isWithinUnmatchedTypeRefinement;
        if (isDataExpectedToBePresent && abstractKey == null && record != null) {
          var recordType = RelayModernRecord.getType(record);
          if (recordType !== node56.type && // The root record type is a special `__Root` type and may not match the
          // type on the ast, so ignore type mismatches at the root.
          // We currently detect whether we're at the root by checking against ROOT_ID,
          // but this does not work for mutations/subscriptions which generate unique
          // root ids. This is acceptable in practice as we don't read data for mutations/
          // subscriptions in a situation where we would use isMissingData to decide whether
          // to suspend or not.
          // TODO T96653810: Correctly detect reading from root of mutation/subscription
          dataID !== ROOT_ID) {
            isDataExpectedToBePresent = false;
          }
        }
        if (isDataExpectedToBePresent && abstractKey != null && record != null) {
          var implementsInterface = this._implementsInterface(record, abstractKey);
          if (implementsInterface === false) {
            isDataExpectedToBePresent = false;
          } else if (implementsInterface == null) {
            this._isMissingData = true;
          }
        }
        this._isWithinUnmatchedTypeRefinement = !isDataExpectedToBePresent;
        var data = this._traverse(node56, dataID, null);
        return {
          data,
          isMissingData: this._isMissingData && isDataExpectedToBePresent,
          missingClientEdges: RelayFeatureFlags.ENABLE_CLIENT_EDGES && this._missingClientEdges.length ? this._missingClientEdges : null,
          missingLiveResolverFields: this._missingLiveResolverFields,
          seenRecords: this._seenRecords,
          selector: this._selector,
          missingRequiredFields: this._missingRequiredFields,
          relayResolverErrors: this._resolverErrors
        };
      };
      _proto._markDataAsMissing = function _markDataAsMissing() {
        this._isMissingData = true;
        if (RelayFeatureFlags.ENABLE_CLIENT_EDGES && this._clientEdgeTraversalPath.length) {
          var top2 = this._clientEdgeTraversalPath[this._clientEdgeTraversalPath.length - 1];
          if (top2 !== null) {
            this._missingClientEdges.push({
              request: top2.readerClientEdge.operation,
              clientEdgeDestinationID: top2.clientEdgeDestinationID
            });
          }
        }
      };
      _proto._traverse = function _traverse(node56, dataID, prevData) {
        var record = this._recordSource.get(dataID);
        this._seenRecords.add(dataID);
        if (record == null) {
          if (record === void 0) {
            this._markDataAsMissing();
          }
          return record;
        }
        var data = prevData || {};
        var hadRequiredData = this._traverseSelections(node56.selections, record, data);
        return hadRequiredData ? data : null;
      };
      _proto._getVariableValue = function _getVariableValue(name2) {
        !this._variables.hasOwnProperty(name2) ? true ? invariant3(false, "RelayReader(): Undefined variable `%s`.", name2) : invariant3(false) : void 0;
        return this._variables[name2];
      };
      _proto._maybeReportUnexpectedNull = function _maybeReportUnexpectedNull(fieldPath, action, record) {
        var _this$_missingRequire;
        if (((_this$_missingRequire = this._missingRequiredFields) === null || _this$_missingRequire === void 0 ? void 0 : _this$_missingRequire.action) === "THROW") {
          return;
        }
        var owner = this._fragmentName;
        switch (action) {
          case "THROW":
            this._missingRequiredFields = {
              action,
              field: {
                path: fieldPath,
                owner
              }
            };
            return;
          case "LOG":
            if (this._missingRequiredFields == null) {
              this._missingRequiredFields = {
                action,
                fields: [{
                  path: fieldPath,
                  owner
                }]
              };
            } else {
              this._missingRequiredFields = {
                action,
                fields: [].concat((0, _toConsumableArray22["default"])(this._missingRequiredFields.fields), [{
                  path: fieldPath,
                  owner
                }])
              };
            }
            return;
          default:
            action;
        }
      };
      _proto._traverseSelections = function _traverseSelections(selections, record, data) {
        for (var i2 = 0; i2 < selections.length; i2++) {
          var selection2 = selections[i2];
          switch (selection2.kind) {
            case REQUIRED_FIELD: {
              var fieldValue = this._readRequiredField(selection2, record, data);
              if (fieldValue == null) {
                var action = selection2.action;
                if (action !== "NONE") {
                  this._maybeReportUnexpectedNull(selection2.path, action, record);
                }
                return false;
              }
              break;
            }
            case SCALAR_FIELD:
              this._readScalar(selection2, record, data);
              break;
            case LINKED_FIELD:
              if (selection2.plural) {
                this._readPluralLink(selection2, record, data);
              } else {
                this._readLink(selection2, record, data);
              }
              break;
            case CONDITION:
              var conditionValue = Boolean(this._getVariableValue(selection2.condition));
              if (conditionValue === selection2.passingValue) {
                var hasExpectedData = this._traverseSelections(selection2.selections, record, data);
                if (!hasExpectedData) {
                  return false;
                }
              }
              break;
            case INLINE_FRAGMENT: {
              if (this._readInlineFragment(selection2, record, data) === false) {
                return false;
              }
              break;
            }
            case RELAY_LIVE_RESOLVER:
            case RELAY_RESOLVER: {
              if (!RelayFeatureFlags.ENABLE_RELAY_RESOLVERS) {
                throw new Error("Relay Resolver fields are not yet supported.");
              }
              this._readResolverField(selection2, record, data);
              break;
            }
            case FRAGMENT_SPREAD:
              this._createFragmentPointer(selection2, record, data);
              break;
            case ALIASED_FRAGMENT_SPREAD:
              data[selection2.name] = this._createAliasedFragmentSpread(selection2, record);
              break;
            case ALIASED_INLINE_FRAGMENT_SPREAD: {
              var _fieldValue = this._readInlineFragment(selection2.fragment, record, {});
              if (_fieldValue === false) {
                _fieldValue = null;
              }
              data[selection2.name] = _fieldValue;
              break;
            }
            case MODULE_IMPORT:
              this._readModuleImport(selection2, record, data);
              break;
            case INLINE_DATA_FRAGMENT_SPREAD:
              this._createInlineDataOrResolverFragmentPointer(selection2, record, data);
              break;
            case DEFER:
            case CLIENT_EXTENSION: {
              var isMissingData = this._isMissingData;
              var alreadyMissingClientEdges = this._missingClientEdges.length;
              if (RelayFeatureFlags.ENABLE_CLIENT_EDGES) {
                this._clientEdgeTraversalPath.push(null);
              }
              var _hasExpectedData = this._traverseSelections(selection2.selections, record, data);
              this._isMissingData = isMissingData || this._missingClientEdges.length > alreadyMissingClientEdges;
              if (RelayFeatureFlags.ENABLE_CLIENT_EDGES) {
                this._clientEdgeTraversalPath.pop();
              }
              if (!_hasExpectedData) {
                return false;
              }
              break;
            }
            case STREAM: {
              var _hasExpectedData2 = this._traverseSelections(selection2.selections, record, data);
              if (!_hasExpectedData2) {
                return false;
              }
              break;
            }
            case FLIGHT_FIELD:
              if (RelayFeatureFlags.ENABLE_REACT_FLIGHT_COMPONENT_FIELD) {
                this._readFlightField(selection2, record, data);
              } else {
                throw new Error("Flight fields are not yet supported.");
              }
              break;
            case ACTOR_CHANGE:
              this._readActorChange(selection2, record, data);
              break;
            case CLIENT_EDGE_TO_CLIENT_OBJECT:
            case CLIENT_EDGE_TO_SERVER_OBJECT:
              if (RelayFeatureFlags.ENABLE_CLIENT_EDGES) {
                this._readClientEdge(selection2, record, data);
              } else {
                throw new Error("Client edges are not yet supported.");
              }
              break;
            default:
              selection2;
              true ? true ? invariant3(false, "RelayReader(): Unexpected ast kind `%s`.", selection2.kind) : invariant3(false) : void 0;
          }
        }
        return true;
      };
      _proto._readRequiredField = function _readRequiredField(selection2, record, data) {
        switch (selection2.field.kind) {
          case SCALAR_FIELD:
            return this._readScalar(selection2.field, record, data);
          case LINKED_FIELD:
            if (selection2.field.plural) {
              return this._readPluralLink(selection2.field, record, data);
            } else {
              return this._readLink(selection2.field, record, data);
            }
          case RELAY_RESOLVER:
            if (!RelayFeatureFlags.ENABLE_RELAY_RESOLVERS) {
              throw new Error("Relay Resolver fields are not yet supported.");
            }
            return this._readResolverField(selection2.field, record, data);
          case RELAY_LIVE_RESOLVER:
            if (!RelayFeatureFlags.ENABLE_RELAY_RESOLVERS) {
              throw new Error("Relay Resolver fields are not yet supported.");
            }
            return this._readResolverField(selection2.field, record, data);
          case CLIENT_EDGE_TO_CLIENT_OBJECT:
          case CLIENT_EDGE_TO_SERVER_OBJECT:
            if (!RelayFeatureFlags.ENABLE_RELAY_RESOLVERS) {
              throw new Error("Relay Resolver fields are not yet supported.");
            }
            return this._readClientEdge(selection2.field, record, data);
          default:
            selection2.field.kind;
            true ? true ? invariant3(false, "RelayReader(): Unexpected ast kind `%s`.", selection2.kind) : invariant3(false) : void 0;
        }
      };
      _proto._readResolverField = function _readResolverField(field, record, data) {
        var _this = this;
        var _field$alias;
        var fragment2 = field.fragment;
        var storageKey = getStorageKey(fragment2 !== null && fragment2 !== void 0 ? fragment2 : field, this._variables);
        var resolverID = ClientID.generateClientID(RelayModernRecord.getDataID(record), storageKey);
        var snapshot;
        var getDataForResolverFragment = function getDataForResolverFragment2(singularReaderSelector) {
          if (snapshot != null) {
            return {
              data: snapshot.data,
              isMissingData: snapshot.isMissingData
            };
          }
          snapshot = read(_this._recordSource, singularReaderSelector, _this._resolverCache);
          return {
            data: snapshot.data,
            isMissingData: snapshot.isMissingData
          };
        };
        var resolverContext = {
          getDataForResolverFragment
        };
        var evaluate = function evaluate2() {
          if (fragment2 != null) {
            var key = {
              __id: RelayModernRecord.getDataID(record),
              __fragmentOwner: _this._owner,
              __fragments: (0, _defineProperty210["default"])({}, fragment2.name, fragment2.args ? getArgumentValues(fragment2.args, _this._variables) : {})
            };
            return withResolverContext(resolverContext, function() {
              var _getResolverValue = getResolverValue(field, _this._variables, key, _this._fragmentName), resolverResult2 = _getResolverValue[0], resolverError2 = _getResolverValue[1];
              return {
                resolverResult: resolverResult2,
                snapshot,
                resolverID,
                error: resolverError2
              };
            });
          } else {
            var _getResolverValue2 = getResolverValue(field, _this._variables, null, _this._fragmentName), resolverResult = _getResolverValue2[0], _resolverError = _getResolverValue2[1];
            return {
              resolverResult,
              snapshot: void 0,
              resolverID,
              error: _resolverError
            };
          }
        };
        var _this$_resolverCache$ = this._resolverCache.readFromCacheOrEvaluate(record, field, this._variables, evaluate, getDataForResolverFragment), result = _this$_resolverCache$[0], seenRecord = _this$_resolverCache$[1], resolverError = _this$_resolverCache$[2], cachedSnapshot = _this$_resolverCache$[3], suspenseID = _this$_resolverCache$[4];
        if (cachedSnapshot != null) {
          if (cachedSnapshot.missingRequiredFields != null) {
            this._addMissingRequiredFields(cachedSnapshot.missingRequiredFields);
          }
          if (cachedSnapshot.missingClientEdges != null) {
            var _iterator = (0, _createForOfIteratorHelper2["default"])(cachedSnapshot.missingClientEdges), _step;
            try {
              for (_iterator.s(); !(_step = _iterator.n()).done; ) {
                var missing = _step.value;
                this._missingClientEdges.push(missing);
              }
            } catch (err) {
              _iterator.e(err);
            } finally {
              _iterator.f();
            }
          }
          if (cachedSnapshot.missingLiveResolverFields != null) {
            this._isMissingData = this._isMissingData || cachedSnapshot.missingLiveResolverFields.length > 0;
            var _iterator2 = (0, _createForOfIteratorHelper2["default"])(cachedSnapshot.missingLiveResolverFields), _step2;
            try {
              for (_iterator2.s(); !(_step2 = _iterator2.n()).done; ) {
                var missingResolverField = _step2.value;
                this._missingLiveResolverFields.push(missingResolverField);
              }
            } catch (err) {
              _iterator2.e(err);
            } finally {
              _iterator2.f();
            }
          }
          var _iterator3 = (0, _createForOfIteratorHelper2["default"])(cachedSnapshot.relayResolverErrors), _step3;
          try {
            for (_iterator3.s(); !(_step3 = _iterator3.n()).done; ) {
              var error = _step3.value;
              this._resolverErrors.push(error);
            }
          } catch (err) {
            _iterator3.e(err);
          } finally {
            _iterator3.f();
          }
          this._isMissingData = this._isMissingData || cachedSnapshot.isMissingData;
        }
        if (resolverError) {
          this._resolverErrors.push(resolverError);
        }
        if (seenRecord != null) {
          this._seenRecords.add(seenRecord);
        }
        if (suspenseID != null) {
          this._isMissingData = true;
          this._missingLiveResolverFields.push({
            path: "".concat(this._fragmentName, ".").concat(field.path),
            liveStateID: suspenseID
          });
        }
        var applicationName = (_field$alias = field.alias) !== null && _field$alias !== void 0 ? _field$alias : field.name;
        data[applicationName] = result;
        return result;
      };
      _proto._readClientEdge = function _readClientEdge(field, record, data) {
        var _this2 = this;
        var _backingField$alias;
        var backingField = field.backingField;
        !(backingField.kind !== "ClientExtension") ? true ? invariant3(false, "Client extension client edges are not yet implemented.") : invariant3(false) : void 0;
        var applicationName = (_backingField$alias = backingField.alias) !== null && _backingField$alias !== void 0 ? _backingField$alias : backingField.name;
        var backingFieldData = {};
        this._traverseSelections([backingField], record, backingFieldData);
        var destinationDataID = backingFieldData[applicationName];
        if (destinationDataID == null || isSuspenseSentinel(destinationDataID)) {
          data[applicationName] = destinationDataID;
          return;
        }
        if (field.linkedField.plural) {
          !Array.isArray(destinationDataID) ? true ? invariant3(false, "Expected plural Client Edge Relay Resolver to return an array of IDs.") : invariant3(false) : void 0;
        } else {
          !(typeof destinationDataID === "string") ? true ? invariant3(false, "Expected a Client Edge Relay Resolver to return an ID of type `string`.") : invariant3(false) : void 0;
        }
        if (field.kind === CLIENT_EDGE_TO_CLIENT_OBJECT) {
          if (field.linkedField.plural) {
            destinationDataID = destinationDataID.map(function(id2) {
              return _this2._resolverCache.ensureClientRecord(id2, field.concreteType);
            });
          } else {
            destinationDataID = this._resolverCache.ensureClientRecord(destinationDataID, field.concreteType);
          }
          this._clientEdgeTraversalPath.push(null);
        } else {
          !!field.linkedField.plural ? true ? invariant3(false, "Unexpected Client Edge to plural server type. This should be prevented by the compiler.") : invariant3(false) : void 0;
          this._clientEdgeTraversalPath.push({
            readerClientEdge: field,
            clientEdgeDestinationID: destinationDataID
          });
        }
        if (field.linkedField.plural) {
          data[applicationName] = this._readLinkedIds(
            field.linkedField,
            // $FlowFixMe[incompatible-call]
            destinationDataID,
            record,
            data
          );
        } else {
          var prevData = data[applicationName];
          !(prevData == null || typeof prevData === "object") ? true ? invariant3(false, "RelayReader(): Expected data for field `%s` on record `%s` to be an object, got `%s`.", applicationName, RelayModernRecord.getDataID(record), prevData) : invariant3(false) : void 0;
          data[applicationName] = this._traverse(
            field.linkedField,
            destinationDataID,
            // $FlowFixMe[incompatible-variance]
            prevData
          );
        }
        this._clientEdgeTraversalPath.pop();
      };
      _proto._readFlightField = function _readFlightField(field, record, data) {
        var _field$alias2;
        var applicationName = (_field$alias2 = field.alias) !== null && _field$alias2 !== void 0 ? _field$alias2 : field.name;
        var storageKey = getStorageKey(field, this._variables);
        var reactFlightClientResponseRecordID = RelayModernRecord.getLinkedRecordID(record, storageKey);
        if (reactFlightClientResponseRecordID == null) {
          data[applicationName] = reactFlightClientResponseRecordID;
          if (reactFlightClientResponseRecordID === void 0) {
            this._markDataAsMissing();
          }
          return reactFlightClientResponseRecordID;
        }
        var reactFlightClientResponseRecord = this._recordSource.get(reactFlightClientResponseRecordID);
        this._seenRecords.add(reactFlightClientResponseRecordID);
        if (reactFlightClientResponseRecord == null) {
          data[applicationName] = reactFlightClientResponseRecord;
          if (reactFlightClientResponseRecord === void 0) {
            this._markDataAsMissing();
          }
          return reactFlightClientResponseRecord;
        }
        var clientResponse = getReactFlightClientResponse(reactFlightClientResponseRecord);
        data[applicationName] = clientResponse;
        return clientResponse;
      };
      _proto._readScalar = function _readScalar(field, record, data) {
        var _field$alias3;
        var applicationName = (_field$alias3 = field.alias) !== null && _field$alias3 !== void 0 ? _field$alias3 : field.name;
        var storageKey = getStorageKey(field, this._variables);
        var value = RelayModernRecord.getValue(record, storageKey);
        if (value === void 0) {
          this._markDataAsMissing();
        }
        data[applicationName] = value;
        return value;
      };
      _proto._readLink = function _readLink(field, record, data) {
        var _field$alias4;
        var applicationName = (_field$alias4 = field.alias) !== null && _field$alias4 !== void 0 ? _field$alias4 : field.name;
        var storageKey = getStorageKey(field, this._variables);
        var linkedID = RelayModernRecord.getLinkedRecordID(record, storageKey);
        if (linkedID == null) {
          data[applicationName] = linkedID;
          if (linkedID === void 0) {
            this._markDataAsMissing();
          }
          return linkedID;
        }
        var prevData = data[applicationName];
        !(prevData == null || typeof prevData === "object") ? true ? invariant3(false, "RelayReader(): Expected data for field `%s` on record `%s` to be an object, got `%s`.", applicationName, RelayModernRecord.getDataID(record), prevData) : invariant3(false) : void 0;
        var value = this._traverse(field, linkedID, prevData);
        data[applicationName] = value;
        return value;
      };
      _proto._readActorChange = function _readActorChange(field, record, data) {
        var _field$alias5;
        var applicationName = (_field$alias5 = field.alias) !== null && _field$alias5 !== void 0 ? _field$alias5 : field.name;
        var storageKey = getStorageKey(field, this._variables);
        var externalRef = RelayModernRecord.getActorLinkedRecordID(record, storageKey);
        if (externalRef == null) {
          data[applicationName] = externalRef;
          if (externalRef === void 0) {
            this._markDataAsMissing();
          }
          return data[applicationName];
        }
        var actorIdentifier = externalRef[0], dataID = externalRef[1];
        var fragmentRef = {};
        this._createFragmentPointer(field.fragmentSpread, {
          __id: dataID
        }, fragmentRef);
        data[applicationName] = {
          __fragmentRef: fragmentRef,
          __viewer: actorIdentifier
        };
        return data[applicationName];
      };
      _proto._readPluralLink = function _readPluralLink(field, record, data) {
        var storageKey = getStorageKey(field, this._variables);
        var linkedIDs = RelayModernRecord.getLinkedRecordIDs(record, storageKey);
        return this._readLinkedIds(field, linkedIDs, record, data);
      };
      _proto._readLinkedIds = function _readLinkedIds(field, linkedIDs, record, data) {
        var _this3 = this;
        var _field$alias6;
        var applicationName = (_field$alias6 = field.alias) !== null && _field$alias6 !== void 0 ? _field$alias6 : field.name;
        if (linkedIDs == null) {
          data[applicationName] = linkedIDs;
          if (linkedIDs === void 0) {
            this._markDataAsMissing();
          }
          return linkedIDs;
        }
        var prevData = data[applicationName];
        !(prevData == null || Array.isArray(prevData)) ? true ? invariant3(false, "RelayReader(): Expected data for field `%s` on record `%s` to be an array, got `%s`.", applicationName, RelayModernRecord.getDataID(record), prevData) : invariant3(false) : void 0;
        var linkedArray = prevData || [];
        linkedIDs.forEach(function(linkedID, nextIndex) {
          if (linkedID == null) {
            if (linkedID === void 0) {
              _this3._markDataAsMissing();
            }
            linkedArray[nextIndex] = linkedID;
            return;
          }
          var prevItem = linkedArray[nextIndex];
          !(prevItem == null || typeof prevItem === "object") ? true ? invariant3(false, "RelayReader(): Expected data for field `%s` on record `%s` to be an object, got `%s`.", applicationName, RelayModernRecord.getDataID(record), prevItem) : invariant3(false) : void 0;
          linkedArray[nextIndex] = _this3._traverse(field, linkedID, prevItem);
        });
        data[applicationName] = linkedArray;
        return linkedArray;
      };
      _proto._readModuleImport = function _readModuleImport(moduleImport, record, data) {
        var componentKey = getModuleComponentKey(moduleImport.documentName);
        var component = RelayModernRecord.getValue(record, componentKey);
        if (component == null) {
          if (component === void 0) {
            this._markDataAsMissing();
          }
          return;
        }
        this._createFragmentPointer({
          kind: "FragmentSpread",
          name: moduleImport.fragmentName,
          args: moduleImport.args
        }, record, data);
        data[FRAGMENT_PROP_NAME_KEY] = moduleImport.fragmentPropName;
        data[MODULE_COMPONENT_KEY] = component;
      };
      _proto._createAliasedFragmentSpread = function _createAliasedFragmentSpread(namedFragmentSpread, record) {
        var abstractKey = namedFragmentSpread.abstractKey;
        if (abstractKey == null) {
          var typeName2 = RelayModernRecord.getType(record);
          if (typeName2 == null || typeName2 !== namedFragmentSpread.type) {
            return null;
          }
        } else {
          var implementsInterface = this._implementsInterface(record, abstractKey);
          if (implementsInterface === false) {
            return null;
          } else if (implementsInterface == null) {
            this._markDataAsMissing();
            return void 0;
          }
        }
        var fieldData = {};
        this._createFragmentPointer(namedFragmentSpread.fragment, record, fieldData);
        return fieldData;
      };
      _proto._readInlineFragment = function _readInlineFragment(inlineFragment, record, data) {
        var abstractKey = inlineFragment.abstractKey;
        if (abstractKey == null) {
          var typeName2 = RelayModernRecord.getType(record);
          if (typeName2 == null || typeName2 !== inlineFragment.type) {
            return null;
          } else {
            var hasExpectedData = this._traverseSelections(inlineFragment.selections, record, data);
            if (!hasExpectedData) {
              return false;
            }
          }
        } else {
          var implementsInterface = this._implementsInterface(record, abstractKey);
          var parentIsMissingData = this._isMissingData;
          var parentIsWithinUnmatchedTypeRefinement = this._isWithinUnmatchedTypeRefinement;
          this._isWithinUnmatchedTypeRefinement = parentIsWithinUnmatchedTypeRefinement || implementsInterface === false;
          this._traverseSelections(inlineFragment.selections, record, data);
          this._isWithinUnmatchedTypeRefinement = parentIsWithinUnmatchedTypeRefinement;
          if (implementsInterface === false) {
            this._isMissingData = parentIsMissingData;
            return void 0;
          } else if (implementsInterface == null) {
            this._markDataAsMissing();
            return null;
          }
        }
        return data;
      };
      _proto._createFragmentPointer = function _createFragmentPointer(fragmentSpread, record, data) {
        var fragmentPointers = data[FRAGMENTS_KEY];
        if (fragmentPointers == null) {
          fragmentPointers = data[FRAGMENTS_KEY] = {};
        }
        !(typeof fragmentPointers === "object" && fragmentPointers != null) ? true ? invariant3(false, "RelayReader: Expected fragment spread data to be an object, got `%s`.", fragmentPointers) : invariant3(false) : void 0;
        if (data[ID_KEY] == null) {
          data[ID_KEY] = RelayModernRecord.getDataID(record);
        }
        fragmentPointers[fragmentSpread.name] = fragmentSpread.args ? getArgumentValues(fragmentSpread.args, this._variables) : {};
        data[FRAGMENT_OWNER_KEY] = this._owner;
        data[IS_WITHIN_UNMATCHED_TYPE_REFINEMENT] = this._isWithinUnmatchedTypeRefinement;
        if (RelayFeatureFlags.ENABLE_CLIENT_EDGES) {
          if (this._clientEdgeTraversalPath.length > 0 && this._clientEdgeTraversalPath[this._clientEdgeTraversalPath.length - 1] !== null) {
            data[CLIENT_EDGE_TRAVERSAL_PATH] = (0, _toConsumableArray22["default"])(this._clientEdgeTraversalPath);
          }
        }
      };
      _proto._createInlineDataOrResolverFragmentPointer = function _createInlineDataOrResolverFragmentPointer(fragmentSpreadOrFragment, record, data) {
        var fragmentPointers = data[FRAGMENTS_KEY];
        if (fragmentPointers == null) {
          fragmentPointers = data[FRAGMENTS_KEY] = {};
        }
        !(typeof fragmentPointers === "object" && fragmentPointers != null) ? true ? invariant3(false, "RelayReader: Expected fragment spread data to be an object, got `%s`.", fragmentPointers) : invariant3(false) : void 0;
        if (data[ID_KEY] == null) {
          data[ID_KEY] = RelayModernRecord.getDataID(record);
        }
        var inlineData = {};
        var parentFragmentName = this._fragmentName;
        this._fragmentName = fragmentSpreadOrFragment.name;
        var parentVariables = this._variables;
        var argumentVariables = fragmentSpreadOrFragment.args ? getArgumentValues(fragmentSpreadOrFragment.args, this._variables) : {};
        this._variables = RelayConcreteVariables.getFragmentVariables(fragmentSpreadOrFragment, this._owner.variables, argumentVariables);
        this._traverseSelections(fragmentSpreadOrFragment.selections, record, inlineData);
        this._variables = parentVariables;
        this._fragmentName = parentFragmentName;
        fragmentPointers[fragmentSpreadOrFragment.name] = inlineData;
      };
      _proto._addMissingRequiredFields = function _addMissingRequiredFields(additional) {
        if (this._missingRequiredFields == null) {
          this._missingRequiredFields = additional;
          return;
        }
        if (this._missingRequiredFields.action === "THROW") {
          return;
        }
        if (additional.action === "THROW") {
          this._missingRequiredFields = additional;
          return;
        }
        this._missingRequiredFields = {
          action: "LOG",
          fields: [].concat((0, _toConsumableArray22["default"])(this._missingRequiredFields.fields), (0, _toConsumableArray22["default"])(additional.fields))
        };
      };
      _proto._implementsInterface = function _implementsInterface(record, abstractKey) {
        var typeName2 = RelayModernRecord.getType(record);
        var typeRecord = this._recordSource.get(generateTypeID(typeName2));
        var implementsInterface = typeRecord != null ? RelayModernRecord.getValue(typeRecord, abstractKey) : null;
        return implementsInterface;
      };
      return RelayReader2;
    }();
    function getResolverValue(field, variables, fragmentKey, ownerName) {
      var resolverFunction = typeof field.resolverModule === "function" ? field.resolverModule : field.resolverModule["default"];
      var resolverResult = null;
      var resolverError = null;
      try {
        var resolverFunctionArgs = [];
        if (field.fragment != null) {
          resolverFunctionArgs.push(fragmentKey);
        }
        var args = field.args ? getArgumentValues(field.args, variables) : void 0;
        resolverFunctionArgs.push(args);
        resolverResult = resolverFunction.apply(null, resolverFunctionArgs);
      } catch (e3) {
        if (e3 === RESOLVER_FRAGMENT_MISSING_DATA_SENTINEL) {
          resolverResult = void 0;
        } else {
          var _field$path;
          var path2 = (_field$path = field.path) !== null && _field$path !== void 0 ? _field$path : "[UNKNOWN]";
          resolverError = {
            field: {
              path: path2,
              owner: ownerName
            },
            error: e3
          };
        }
      }
      return [resolverResult, resolverError];
    }
    module.exports = {
      read
    };
  }
});

// node_modules/relay-runtime/lib/store/RelayPublishQueue.js
var require_RelayPublishQueue2 = __commonJS({
  "node_modules/relay-runtime/lib/store/RelayPublishQueue.js"(exports, module) {
    "use strict";
    var _global$ErrorUtils$ap;
    var _global$ErrorUtils;
    var RelayRecordSourceMutator = require_RelayRecordSourceMutator2();
    var RelayRecordSourceProxy = require_RelayRecordSourceProxy2();
    var RelayRecordSourceSelectorProxy = require_RelayRecordSourceSelectorProxy2();
    var RelayReader = require_RelayReader2();
    var RelayRecordSource = require_RelayRecordSource2();
    var invariant3 = require_browser();
    var warning2 = require_warning();
    var _global = typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : void 0;
    var applyWithGuard = (_global$ErrorUtils$ap = _global === null || _global === void 0 ? void 0 : (_global$ErrorUtils = _global.ErrorUtils) === null || _global$ErrorUtils === void 0 ? void 0 : _global$ErrorUtils.applyWithGuard) !== null && _global$ErrorUtils$ap !== void 0 ? _global$ErrorUtils$ap : function(callback, context2, args, onError, name2) {
      return callback.apply(context2, args);
    };
    var RelayPublishQueue = /* @__PURE__ */ function() {
      function RelayPublishQueue2(store, handlerProvider, getDataID) {
        this._hasStoreSnapshot = false;
        this._handlerProvider = handlerProvider || null;
        this._pendingBackupRebase = false;
        this._pendingData = /* @__PURE__ */ new Set();
        this._pendingOptimisticUpdates = /* @__PURE__ */ new Set();
        this._store = store;
        this._appliedOptimisticUpdates = /* @__PURE__ */ new Set();
        this._gcHold = null;
        this._getDataID = getDataID;
      }
      var _proto = RelayPublishQueue2.prototype;
      _proto.applyUpdate = function applyUpdate(updater) {
        !(!this._appliedOptimisticUpdates.has(updater) && !this._pendingOptimisticUpdates.has(updater)) ? true ? invariant3(false, "RelayPublishQueue: Cannot apply the same update function more than once concurrently.") : invariant3(false) : void 0;
        this._pendingOptimisticUpdates.add(updater);
      };
      _proto.revertUpdate = function revertUpdate(updater) {
        if (this._pendingOptimisticUpdates.has(updater)) {
          this._pendingOptimisticUpdates["delete"](updater);
        } else if (this._appliedOptimisticUpdates.has(updater)) {
          this._pendingBackupRebase = true;
          this._appliedOptimisticUpdates["delete"](updater);
        }
      };
      _proto.revertAll = function revertAll() {
        this._pendingBackupRebase = true;
        this._pendingOptimisticUpdates.clear();
        this._appliedOptimisticUpdates.clear();
      };
      _proto.commitPayload = function commitPayload(operation, payload, updater) {
        this._pendingBackupRebase = true;
        this._pendingData.add({
          kind: "payload",
          operation,
          payload,
          updater
        });
      };
      _proto.commitUpdate = function commitUpdate(updater) {
        this._pendingBackupRebase = true;
        this._pendingData.add({
          kind: "updater",
          updater
        });
      };
      _proto.commitSource = function commitSource(source) {
        this._pendingBackupRebase = true;
        this._pendingData.add({
          kind: "source",
          source
        });
      };
      _proto.run = function run2(sourceOperation) {
        var runWillClearGcHold = (
          // $FlowFixMe[incompatible-type]
          this._appliedOptimisticUpdates === 0 && !!this._gcHold
        );
        var runIsANoop = (
          // this._pendingBackupRebase is true if an applied optimistic
          // update has potentially been reverted or if this._pendingData is not empty.
          !this._pendingBackupRebase && this._pendingOptimisticUpdates.size === 0 && !runWillClearGcHold
        );
        if (true) {
          true ? warning2(!runIsANoop, "RelayPublishQueue.run was called, but the call would have been a noop.") : void 0;
          true ? warning2(this._isRunning !== true, "A store update was detected within another store update. Please make sure new store updates aren't being executed within an updater function for a different update.") : void 0;
          this._isRunning = true;
        }
        if (runIsANoop) {
          if (true) {
            this._isRunning = false;
          }
          return [];
        }
        if (this._pendingBackupRebase) {
          if (this._hasStoreSnapshot) {
            this._store.restore();
            this._hasStoreSnapshot = false;
          }
        }
        var invalidatedStore = this._commitData();
        if (this._pendingOptimisticUpdates.size || this._pendingBackupRebase && this._appliedOptimisticUpdates.size) {
          if (!this._hasStoreSnapshot) {
            this._store.snapshot();
            this._hasStoreSnapshot = true;
          }
          this._applyUpdates();
        }
        this._pendingBackupRebase = false;
        if (this._appliedOptimisticUpdates.size > 0) {
          if (!this._gcHold) {
            this._gcHold = this._store.holdGC();
          }
        } else {
          if (this._gcHold) {
            this._gcHold.dispose();
            this._gcHold = null;
          }
        }
        if (true) {
          this._isRunning = false;
        }
        return this._store.notify(sourceOperation, invalidatedStore);
      };
      _proto._publishSourceFromPayload = function _publishSourceFromPayload(pendingPayload) {
        var _this = this;
        var payload = pendingPayload.payload, operation = pendingPayload.operation, updater = pendingPayload.updater;
        var source = payload.source, fieldPayloads = payload.fieldPayloads;
        var mutator = new RelayRecordSourceMutator(this._store.getSource(), source);
        var recordSourceProxy = new RelayRecordSourceProxy(mutator, this._getDataID);
        if (fieldPayloads && fieldPayloads.length) {
          fieldPayloads.forEach(function(fieldPayload) {
            var handler = _this._handlerProvider && _this._handlerProvider(fieldPayload.handle);
            !handler ? true ? invariant3(false, "RelayModernEnvironment: Expected a handler to be provided for handle `%s`.", fieldPayload.handle) : invariant3(false) : void 0;
            handler.update(recordSourceProxy, fieldPayload);
          });
        }
        if (updater) {
          var selector = operation.fragment;
          !(selector != null) ? true ? invariant3(false, "RelayModernEnvironment: Expected a selector to be provided with updater function.") : invariant3(false) : void 0;
          var recordSourceSelectorProxy = new RelayRecordSourceSelectorProxy(mutator, recordSourceProxy, selector);
          var selectorData = lookupSelector(source, selector);
          updater(recordSourceSelectorProxy, selectorData);
        }
        var idsMarkedForInvalidation = recordSourceProxy.getIDsMarkedForInvalidation();
        this._store.publish(source, idsMarkedForInvalidation);
        return recordSourceProxy.isStoreMarkedForInvalidation();
      };
      _proto._commitData = function _commitData() {
        var _this2 = this;
        if (!this._pendingData.size) {
          return false;
        }
        var invalidatedStore = false;
        this._pendingData.forEach(function(data) {
          if (data.kind === "payload") {
            var payloadInvalidatedStore = _this2._publishSourceFromPayload(data);
            invalidatedStore = invalidatedStore || payloadInvalidatedStore;
          } else if (data.kind === "source") {
            var source = data.source;
            _this2._store.publish(source);
          } else {
            var updater = data.updater;
            var sink = RelayRecordSource.create();
            var mutator = new RelayRecordSourceMutator(_this2._store.getSource(), sink);
            var recordSourceProxy = new RelayRecordSourceProxy(mutator, _this2._getDataID);
            applyWithGuard(updater, null, [recordSourceProxy], null, "RelayPublishQueue:commitData");
            invalidatedStore = invalidatedStore || recordSourceProxy.isStoreMarkedForInvalidation();
            var idsMarkedForInvalidation = recordSourceProxy.getIDsMarkedForInvalidation();
            _this2._store.publish(sink, idsMarkedForInvalidation);
          }
        });
        this._pendingData.clear();
        return invalidatedStore;
      };
      _proto._applyUpdates = function _applyUpdates() {
        var _this3 = this;
        var sink = RelayRecordSource.create();
        var mutator = new RelayRecordSourceMutator(this._store.getSource(), sink);
        var recordSourceProxy = new RelayRecordSourceProxy(mutator, this._getDataID, this._handlerProvider);
        var processUpdate = function processUpdate2(optimisticUpdate) {
          if (optimisticUpdate.storeUpdater) {
            var storeUpdater = optimisticUpdate.storeUpdater;
            applyWithGuard(storeUpdater, null, [recordSourceProxy], null, "RelayPublishQueue:applyUpdates");
          } else {
            var operation = optimisticUpdate.operation, payload = optimisticUpdate.payload, updater = optimisticUpdate.updater;
            var source = payload.source, fieldPayloads = payload.fieldPayloads;
            if (source) {
              recordSourceProxy.publishSource(source, fieldPayloads);
            }
            if (updater) {
              var selectorData;
              if (source) {
                selectorData = lookupSelector(source, operation.fragment);
              }
              var recordSourceSelectorProxy = new RelayRecordSourceSelectorProxy(mutator, recordSourceProxy, operation.fragment);
              applyWithGuard(updater, null, [recordSourceSelectorProxy, selectorData], null, "RelayPublishQueue:applyUpdates");
            }
          }
        };
        if (this._pendingBackupRebase && this._appliedOptimisticUpdates.size) {
          this._appliedOptimisticUpdates.forEach(processUpdate);
        }
        if (this._pendingOptimisticUpdates.size) {
          this._pendingOptimisticUpdates.forEach(function(optimisticUpdate) {
            processUpdate(optimisticUpdate);
            _this3._appliedOptimisticUpdates.add(optimisticUpdate);
          });
          this._pendingOptimisticUpdates.clear();
        }
        this._store.publish(sink);
      };
      return RelayPublishQueue2;
    }();
    function lookupSelector(source, selector) {
      var selectorData = RelayReader.read(source, selector).data;
      if (true) {
        var deepFreeze = require_deepFreeze2();
        if (selectorData) {
          deepFreeze(selectorData);
        }
      }
      return selectorData;
    }
    module.exports = RelayPublishQueue;
  }
});

// node_modules/relay-runtime/lib/store/StoreInspector.js
var require_StoreInspector2 = __commonJS({
  "node_modules/relay-runtime/lib/store/StoreInspector.js"(exports, module) {
    "use strict";
    var _interopRequireDefault = require_interopRequireDefault()["default"];
    var _objectSpread210 = _interopRequireDefault(require_objectSpread2());
    var _toConsumableArray22 = _interopRequireDefault(require_toConsumableArray());
    var inspect = function inspect2() {
    };
    if (true) {
      formattersInstalled = false;
      installDevtoolFormatters = function installDevtoolFormatters2() {
        var _window$devtoolsForma;
        if (formattersInstalled) {
          return;
        }
        formattersInstalled = true;
        if (window.devtoolsFormatters == null) {
          window.devtoolsFormatters = [];
        }
        if (!Array.isArray(window.devtoolsFormatters)) {
          return;
        }
        console.info('Make sure to select "Enable custom formatters" in the Chrome Developer Tools settings, tab "Preferences" under the "Console" section.');
        (_window$devtoolsForma = window.devtoolsFormatters).push.apply(_window$devtoolsForma, (0, _toConsumableArray22["default"])(createFormatters()));
      };
      createFormatters = function createFormatters2() {
        var listStyle = {
          style: "list-style-type: none; padding: 0; margin: 0 0 0 12px; font-style: normal"
        };
        var keyStyle = {
          style: "rgb(136, 19, 145)"
        };
        var nullStyle = {
          style: "color: #777"
        };
        var reference = function reference2(object, config2) {
          return object == null ? ["span", nullStyle, "undefined"] : ["object", {
            object,
            config: config2
          }];
        };
        var renderRecordHeader = function renderRecordHeader2(record) {
          return ["span", {
            style: "font-style: italic"
          }, record.__typename, ["span", nullStyle, ' {id: "', record.__id, '", \u2026}']];
        };
        var isRecord = function isRecord2(o) {
          return o != null && typeof o.__id === "string";
        };
        var RecordEntry = function RecordEntry2(key, value) {
          this.key = key;
          this.value = value;
        };
        var renderRecordEntries = function renderRecordEntries2(record) {
          var children = Object.keys(record).map(function(key) {
            return ["li", {}, ["object", {
              object: new RecordEntry(key, record[key])
            }]];
          });
          return ["ol", listStyle].concat((0, _toConsumableArray22["default"])(children));
        };
        var recordFormatter = {
          header: function header(obj) {
            if (!isRecord(obj)) {
              return null;
            }
            return renderRecordHeader(obj);
          },
          hasBody: function hasBody(obj) {
            return true;
          },
          body: function body(obj) {
            return renderRecordEntries(obj);
          }
        };
        var recordEntryFormatter = {
          header: function header(obj) {
            if (obj instanceof RecordEntry) {
              var value = isRecord(obj.value) ? renderRecordHeader(obj.value) : reference(obj.value);
              return ["span", keyStyle, obj.key, ": ", value];
            }
            return null;
          },
          hasBody: function hasBody(obj) {
            return isRecord(obj.value);
          },
          body: function body(obj) {
            return renderRecordEntries(obj.value);
          }
        };
        return [recordFormatter, recordEntryFormatter];
      };
      getWrappedRecord = function getWrappedRecord2(source, dataID) {
        var record = source.get(dataID);
        if (record == null) {
          return record;
        }
        return new Proxy((0, _objectSpread210["default"])({}, record), {
          get: function get3(target, prop) {
            var value = target[prop];
            if (value == null) {
              return value;
            }
            if (typeof value === "object") {
              if (typeof value.__ref === "string") {
                return getWrappedRecord2(source, value.__ref);
              }
              if (Array.isArray(value.__refs)) {
                return value.__refs.map(function(ref) {
                  return getWrappedRecord2(source, ref);
                });
              }
            }
            return value;
          }
        });
      };
      inspect = function inspect2(environment, dataID) {
        installDevtoolFormatters();
        return getWrappedRecord(environment.getStore().getSource(), dataID !== null && dataID !== void 0 ? dataID : "client:root");
      };
    }
    var formattersInstalled;
    var installDevtoolFormatters;
    var createFormatters;
    var getWrappedRecord;
    module.exports = {
      inspect
    };
  }
});

// node_modules/relay-runtime/lib/store/RelayModernEnvironment.js
var require_RelayModernEnvironment2 = __commonJS({
  "node_modules/relay-runtime/lib/store/RelayModernEnvironment.js"(exports, module) {
    "use strict";
    var _interopRequireDefault = require_interopRequireDefault()["default"];
    var _objectSpread210 = _interopRequireDefault(require_objectSpread2());
    var RelayDefaultHandlerProvider = require_RelayDefaultHandlerProvider2();
    var _require = require_ActorIdentifier2();
    var INTERNAL_ACTOR_IDENTIFIER_DO_NOT_USE = _require.INTERNAL_ACTOR_IDENTIFIER_DO_NOT_USE;
    var assertInternalActorIndentifier = _require.assertInternalActorIndentifier;
    var RelayObservable = require_RelayObservable2();
    var wrapNetworkWithLogObserver = require_wrapNetworkWithLogObserver2();
    var RelayOperationTracker = require_RelayOperationTracker2();
    var registerEnvironmentWithDevTools = require_registerEnvironmentWithDevTools2();
    var RelayFeatureFlags = require_RelayFeatureFlags2();
    var defaultGetDataID = require_defaultGetDataID2();
    var defaultRequiredFieldLogger = require_defaultRequiredFieldLogger2();
    var OperationExecutor = require_OperationExecutor2();
    var RelayPublishQueue = require_RelayPublishQueue2();
    var RelayRecordSource = require_RelayRecordSource2();
    var invariant3 = require_browser();
    var RelayModernEnvironment = /* @__PURE__ */ function() {
      function RelayModernEnvironment2(config2) {
        var _this = this;
        var _config$log, _config$requiredField, _config$UNSTABLE_defa, _config$getDataID, _config$handlerProvid, _config$scheduler, _config$isServer, _config$operationTrac;
        this.configName = config2.configName;
        this._treatMissingFieldsAsNull = config2.treatMissingFieldsAsNull === true;
        var operationLoader = config2.operationLoader;
        var reactFlightPayloadDeserializer = config2.reactFlightPayloadDeserializer;
        var reactFlightServerErrorHandler = config2.reactFlightServerErrorHandler;
        if (true) {
          if (operationLoader != null) {
            !(typeof operationLoader === "object" && typeof operationLoader.get === "function" && typeof operationLoader.load === "function") ? true ? invariant3(false, "RelayModernEnvironment: Expected `operationLoader` to be an object with get() and load() functions, got `%s`.", operationLoader) : invariant3(false) : void 0;
          }
          if (reactFlightPayloadDeserializer != null) {
            !(typeof reactFlightPayloadDeserializer === "function") ? true ? invariant3(false, "RelayModernEnvironment: Expected `reactFlightPayloadDeserializer`  to be a function, got `%s`.", reactFlightPayloadDeserializer) : invariant3(false) : void 0;
          }
        }
        this.__log = (_config$log = config2.log) !== null && _config$log !== void 0 ? _config$log : emptyFunction;
        this.requiredFieldLogger = (_config$requiredField = config2.requiredFieldLogger) !== null && _config$requiredField !== void 0 ? _config$requiredField : defaultRequiredFieldLogger;
        this._defaultRenderPolicy = ((_config$UNSTABLE_defa = config2.UNSTABLE_defaultRenderPolicy) !== null && _config$UNSTABLE_defa !== void 0 ? _config$UNSTABLE_defa : RelayFeatureFlags.ENABLE_PARTIAL_RENDERING_DEFAULT === true) ? "partial" : "full";
        this._operationLoader = operationLoader;
        this._operationExecutions = /* @__PURE__ */ new Map();
        this._network = wrapNetworkWithLogObserver(this, config2.network);
        this._getDataID = (_config$getDataID = config2.getDataID) !== null && _config$getDataID !== void 0 ? _config$getDataID : defaultGetDataID;
        this._publishQueue = new RelayPublishQueue(config2.store, (_config$handlerProvid = config2.handlerProvider) !== null && _config$handlerProvid !== void 0 ? _config$handlerProvid : RelayDefaultHandlerProvider, this._getDataID);
        this._scheduler = (_config$scheduler = config2.scheduler) !== null && _config$scheduler !== void 0 ? _config$scheduler : null;
        this._store = config2.store;
        this.options = config2.options;
        this._isServer = (_config$isServer = config2.isServer) !== null && _config$isServer !== void 0 ? _config$isServer : false;
        this.__setNet = function(newNet) {
          return _this._network = wrapNetworkWithLogObserver(_this, newNet);
        };
        if (true) {
          var _require2 = require_StoreInspector2(), inspect = _require2.inspect;
          this.DEBUG_inspect = function(dataID) {
            return inspect(_this, dataID);
          };
        }
        this._missingFieldHandlers = config2.missingFieldHandlers;
        this._operationTracker = (_config$operationTrac = config2.operationTracker) !== null && _config$operationTrac !== void 0 ? _config$operationTrac : new RelayOperationTracker();
        this._reactFlightPayloadDeserializer = reactFlightPayloadDeserializer;
        this._reactFlightServerErrorHandler = reactFlightServerErrorHandler;
        this._shouldProcessClientComponents = config2.shouldProcessClientComponents;
        registerEnvironmentWithDevTools(this);
      }
      var _proto = RelayModernEnvironment2.prototype;
      _proto.getStore = function getStore() {
        return this._store;
      };
      _proto.getNetwork = function getNetwork() {
        return this._network;
      };
      _proto.getOperationTracker = function getOperationTracker() {
        return this._operationTracker;
      };
      _proto.isRequestActive = function isRequestActive(requestIdentifier) {
        var activeState = this._operationExecutions.get(requestIdentifier);
        return activeState === "active";
      };
      _proto.UNSTABLE_getDefaultRenderPolicy = function UNSTABLE_getDefaultRenderPolicy() {
        return this._defaultRenderPolicy;
      };
      _proto.applyUpdate = function applyUpdate(optimisticUpdate) {
        var _this2 = this;
        var dispose2 = function dispose3() {
          _this2._scheduleUpdates(function() {
            _this2._publishQueue.revertUpdate(optimisticUpdate);
            _this2._publishQueue.run();
          });
        };
        this._scheduleUpdates(function() {
          _this2._publishQueue.applyUpdate(optimisticUpdate);
          _this2._publishQueue.run();
        });
        return {
          dispose: dispose2
        };
      };
      _proto.revertUpdate = function revertUpdate(update) {
        var _this3 = this;
        this._scheduleUpdates(function() {
          _this3._publishQueue.revertUpdate(update);
          _this3._publishQueue.run();
        });
      };
      _proto.replaceUpdate = function replaceUpdate(update, newUpdate) {
        var _this4 = this;
        this._scheduleUpdates(function() {
          _this4._publishQueue.revertUpdate(update);
          _this4._publishQueue.applyUpdate(newUpdate);
          _this4._publishQueue.run();
        });
      };
      _proto.applyMutation = function applyMutation(optimisticConfig) {
        var subscription2 = this._execute({
          createSource: function createSource() {
            return RelayObservable.create(function(_sink) {
            });
          },
          isClientPayload: false,
          operation: optimisticConfig.operation,
          optimisticConfig,
          updater: null
        }).subscribe({});
        return {
          dispose: function dispose2() {
            return subscription2.unsubscribe();
          }
        };
      };
      _proto.check = function check(operation) {
        if (this._missingFieldHandlers == null || this._missingFieldHandlers.length === 0) {
          return this._store.check(operation);
        }
        return this._checkSelectorAndHandleMissingFields(operation, this._missingFieldHandlers);
      };
      _proto.commitPayload = function commitPayload(operation, payload) {
        this._execute({
          createSource: function createSource() {
            return RelayObservable.from({
              data: payload
            });
          },
          isClientPayload: true,
          operation,
          optimisticConfig: null,
          updater: null
        }).subscribe({});
      };
      _proto.commitUpdate = function commitUpdate(updater) {
        var _this5 = this;
        this._scheduleUpdates(function() {
          _this5._publishQueue.commitUpdate(updater);
          _this5._publishQueue.run();
        });
      };
      _proto.lookup = function lookup(readSelector) {
        return this._store.lookup(readSelector);
      };
      _proto.subscribe = function subscribe(snapshot, callback) {
        return this._store.subscribe(snapshot, callback);
      };
      _proto.retain = function retain(operation) {
        return this._store.retain(operation);
      };
      _proto.isServer = function isServer() {
        return this._isServer;
      };
      _proto._checkSelectorAndHandleMissingFields = function _checkSelectorAndHandleMissingFields(operation, handlers2) {
        var _this6 = this;
        var target = RelayRecordSource.create();
        var source = this._store.getSource();
        var result = this._store.check(operation, {
          handlers: handlers2,
          defaultActorIdentifier: INTERNAL_ACTOR_IDENTIFIER_DO_NOT_USE,
          getSourceForActor: function getSourceForActor(actorIdentifier) {
            assertInternalActorIndentifier(actorIdentifier);
            return source;
          },
          getTargetForActor: function getTargetForActor(actorIdentifier) {
            assertInternalActorIndentifier(actorIdentifier);
            return target;
          }
        });
        if (target.size() > 0) {
          this._scheduleUpdates(function() {
            _this6._publishQueue.commitSource(target);
            _this6._publishQueue.run();
          });
        }
        return result;
      };
      _proto._scheduleUpdates = function _scheduleUpdates(task) {
        var scheduler = this._scheduler;
        if (scheduler != null) {
          scheduler.schedule(task);
        } else {
          task();
        }
      };
      _proto.execute = function execute(_ref18) {
        var _this7 = this;
        var operation = _ref18.operation;
        return this._execute({
          createSource: function createSource() {
            return _this7.getNetwork().execute(operation.request.node.params, operation.request.variables, operation.request.cacheConfig || {}, null);
          },
          isClientPayload: false,
          operation,
          optimisticConfig: null,
          updater: null
        });
      };
      _proto.executeSubscription = function executeSubscription(_ref22) {
        var _this8 = this;
        var operation = _ref22.operation, updater = _ref22.updater;
        return this._execute({
          createSource: function createSource() {
            return _this8.getNetwork().execute(operation.request.node.params, operation.request.variables, operation.request.cacheConfig || {}, null);
          },
          isClientPayload: false,
          operation,
          optimisticConfig: null,
          updater
        });
      };
      _proto.executeMutation = function executeMutation(_ref32) {
        var _this9 = this;
        var operation = _ref32.operation, optimisticResponse = _ref32.optimisticResponse, optimisticUpdater = _ref32.optimisticUpdater, updater = _ref32.updater, uploadables = _ref32.uploadables;
        var optimisticConfig;
        if (optimisticResponse || optimisticUpdater) {
          optimisticConfig = {
            operation,
            response: optimisticResponse,
            updater: optimisticUpdater
          };
        }
        return this._execute({
          createSource: function createSource() {
            return _this9.getNetwork().execute(operation.request.node.params, operation.request.variables, (0, _objectSpread210["default"])((0, _objectSpread210["default"])({}, operation.request.cacheConfig), {}, {
              force: true
            }), uploadables);
          },
          isClientPayload: false,
          operation,
          optimisticConfig,
          updater
        });
      };
      _proto.executeWithSource = function executeWithSource(_ref42) {
        var operation = _ref42.operation, source = _ref42.source;
        return this._execute({
          createSource: function createSource() {
            return source;
          },
          isClientPayload: false,
          operation,
          optimisticConfig: null,
          updater: null
        });
      };
      _proto.toJSON = function toJSON2() {
        var _this$configName;
        return "RelayModernEnvironment(".concat((_this$configName = this.configName) !== null && _this$configName !== void 0 ? _this$configName : "", ")");
      };
      _proto._execute = function _execute(_ref52) {
        var _this10 = this;
        var createSource = _ref52.createSource, isClientPayload = _ref52.isClientPayload, operation = _ref52.operation, optimisticConfig = _ref52.optimisticConfig, updater = _ref52.updater;
        var publishQueue = this._publishQueue;
        var store = this._store;
        return RelayObservable.create(function(sink) {
          var executor = OperationExecutor.execute({
            actorIdentifier: INTERNAL_ACTOR_IDENTIFIER_DO_NOT_USE,
            getDataID: _this10._getDataID,
            isClientPayload,
            log: _this10.__log,
            operation,
            operationExecutions: _this10._operationExecutions,
            operationLoader: _this10._operationLoader,
            operationTracker: _this10._operationTracker,
            optimisticConfig,
            getPublishQueue: function getPublishQueue(actorIdentifier) {
              assertInternalActorIndentifier(actorIdentifier);
              return publishQueue;
            },
            reactFlightPayloadDeserializer: _this10._reactFlightPayloadDeserializer,
            reactFlightServerErrorHandler: _this10._reactFlightServerErrorHandler,
            scheduler: _this10._scheduler,
            shouldProcessClientComponents: _this10._shouldProcessClientComponents,
            sink,
            // NOTE: Some product tests expect `Network.execute` to be called only
            //       when the Observable is executed.
            source: createSource(),
            getStore: function getStore(actorIdentifier) {
              assertInternalActorIndentifier(actorIdentifier);
              return store;
            },
            treatMissingFieldsAsNull: _this10._treatMissingFieldsAsNull,
            updater
          });
          return function() {
            return executor.cancel();
          };
        });
      };
      return RelayModernEnvironment2;
    }();
    RelayModernEnvironment.prototype["@@RelayModernEnvironment"] = true;
    function emptyFunction() {
    }
    module.exports = RelayModernEnvironment;
  }
});

// node_modules/relay-runtime/lib/util/resolveImmediate.js
var require_resolveImmediate2 = __commonJS({
  "node_modules/relay-runtime/lib/util/resolveImmediate.js"(exports, module) {
    "use strict";
    var resolvedPromise = Promise.resolve();
    function resolveImmediate(callback) {
      resolvedPromise.then(callback)["catch"](throwNext);
    }
    function throwNext(error) {
      setTimeout(function() {
        throw error;
      }, 0);
    }
    module.exports = resolveImmediate;
  }
});

// node_modules/relay-runtime/lib/store/cloneRelayHandleSourceField.js
var require_cloneRelayHandleSourceField2 = __commonJS({
  "node_modules/relay-runtime/lib/store/cloneRelayHandleSourceField.js"(exports, module) {
    "use strict";
    var _require = require_RelayConcreteNode2();
    var LINKED_FIELD = _require.LINKED_FIELD;
    var _require2 = require_RelayStoreUtils2();
    var getHandleStorageKey = _require2.getHandleStorageKey;
    var areEqual2 = require_areEqual();
    var invariant3 = require_browser();
    function cloneRelayHandleSourceField(handleField, selections, variables) {
      var sourceField = selections.find(function(source) {
        return source.kind === LINKED_FIELD && source.name === handleField.name && source.alias === handleField.alias && areEqual2(source.args, handleField.args);
      });
      !(sourceField && sourceField.kind === LINKED_FIELD) ? true ? invariant3(false, "cloneRelayHandleSourceField: Expected a corresponding source field for handle `%s`.", handleField.handle) : invariant3(false) : void 0;
      var handleKey = getHandleStorageKey(handleField, variables);
      return {
        kind: "LinkedField",
        alias: sourceField.alias,
        name: handleKey,
        storageKey: handleKey,
        args: null,
        concreteType: sourceField.concreteType,
        plural: sourceField.plural,
        selections: sourceField.selections
      };
    }
    module.exports = cloneRelayHandleSourceField;
  }
});

// node_modules/relay-runtime/lib/store/cloneRelayScalarHandleSourceField.js
var require_cloneRelayScalarHandleSourceField2 = __commonJS({
  "node_modules/relay-runtime/lib/store/cloneRelayScalarHandleSourceField.js"(exports, module) {
    "use strict";
    var _require = require_RelayConcreteNode2();
    var SCALAR_FIELD = _require.SCALAR_FIELD;
    var _require2 = require_RelayStoreUtils2();
    var getHandleStorageKey = _require2.getHandleStorageKey;
    var areEqual2 = require_areEqual();
    var invariant3 = require_browser();
    function cloneRelayScalarHandleSourceField(handleField, selections, variables) {
      var sourceField = selections.find(function(source) {
        return source.kind === SCALAR_FIELD && source.name === handleField.name && source.alias === handleField.alias && areEqual2(source.args, handleField.args);
      });
      !(sourceField && sourceField.kind === SCALAR_FIELD) ? true ? invariant3(false, "cloneRelayScalarHandleSourceField: Expected a corresponding source field for handle `%s`.", handleField.handle) : invariant3(false) : void 0;
      var handleKey = getHandleStorageKey(handleField, variables);
      return {
        kind: "ScalarField",
        alias: sourceField.alias,
        name: handleKey,
        storageKey: handleKey,
        args: null
      };
    }
    module.exports = cloneRelayScalarHandleSourceField;
  }
});

// node_modules/relay-runtime/lib/store/DataChecker.js
var require_DataChecker2 = __commonJS({
  "node_modules/relay-runtime/lib/store/DataChecker.js"(exports, module) {
    "use strict";
    var _interopRequireDefault = require_interopRequireDefault()["default"];
    var _createForOfIteratorHelper2 = _interopRequireDefault(require_createForOfIteratorHelper());
    var RelayRecordSourceMutator = require_RelayRecordSourceMutator2();
    var RelayRecordSourceProxy = require_RelayRecordSourceProxy2();
    var getOperation = require_getOperation2();
    var RelayConcreteNode = require_RelayConcreteNode2();
    var RelayFeatureFlags = require_RelayFeatureFlags2();
    var _require = require_ClientID2();
    var isClientID = _require.isClientID;
    var cloneRelayHandleSourceField = require_cloneRelayHandleSourceField2();
    var cloneRelayScalarHandleSourceField = require_cloneRelayScalarHandleSourceField2();
    var _require2 = require_RelayConcreteVariables2();
    var getLocalVariables = _require2.getLocalVariables;
    var RelayModernRecord = require_RelayModernRecord2();
    var _require3 = require_RelayRecordState2();
    var EXISTENT = _require3.EXISTENT;
    var UNKNOWN = _require3.UNKNOWN;
    var RelayStoreReactFlightUtils = require_RelayStoreReactFlightUtils2();
    var RelayStoreUtils = require_RelayStoreUtils2();
    var _require4 = require_TypeID2();
    var generateTypeID = _require4.generateTypeID;
    var invariant3 = require_browser();
    var ACTOR_CHANGE = RelayConcreteNode.ACTOR_CHANGE;
    var CONDITION = RelayConcreteNode.CONDITION;
    var CLIENT_COMPONENT = RelayConcreteNode.CLIENT_COMPONENT;
    var CLIENT_EXTENSION = RelayConcreteNode.CLIENT_EXTENSION;
    var DEFER = RelayConcreteNode.DEFER;
    var FLIGHT_FIELD = RelayConcreteNode.FLIGHT_FIELD;
    var FRAGMENT_SPREAD = RelayConcreteNode.FRAGMENT_SPREAD;
    var INLINE_FRAGMENT = RelayConcreteNode.INLINE_FRAGMENT;
    var LINKED_FIELD = RelayConcreteNode.LINKED_FIELD;
    var LINKED_HANDLE = RelayConcreteNode.LINKED_HANDLE;
    var MODULE_IMPORT = RelayConcreteNode.MODULE_IMPORT;
    var SCALAR_FIELD = RelayConcreteNode.SCALAR_FIELD;
    var SCALAR_HANDLE = RelayConcreteNode.SCALAR_HANDLE;
    var STREAM = RelayConcreteNode.STREAM;
    var TYPE_DISCRIMINATOR = RelayConcreteNode.TYPE_DISCRIMINATOR;
    var ROOT_ID = RelayStoreUtils.ROOT_ID;
    var getModuleOperationKey = RelayStoreUtils.getModuleOperationKey;
    var getStorageKey = RelayStoreUtils.getStorageKey;
    var getArgumentValues = RelayStoreUtils.getArgumentValues;
    function check(getSourceForActor, getTargetForActor, defaultActorIdentifier, selector, handlers2, operationLoader, getDataID, shouldProcessClientComponents) {
      var dataID = selector.dataID, node56 = selector.node, variables = selector.variables;
      var checker = new DataChecker(getSourceForActor, getTargetForActor, defaultActorIdentifier, variables, handlers2, operationLoader, getDataID, shouldProcessClientComponents);
      return checker.check(node56, dataID);
    }
    var DataChecker = /* @__PURE__ */ function() {
      function DataChecker2(getSourceForActor, getTargetForActor, defaultActorIdentifier, variables, handlers2, operationLoader, getDataID, shouldProcessClientComponents) {
        this._getSourceForActor = getSourceForActor;
        this._getTargetForActor = getTargetForActor;
        this._getDataID = getDataID;
        this._source = getSourceForActor(defaultActorIdentifier);
        this._mutatorRecordSourceProxyCache = /* @__PURE__ */ new Map();
        var _this$_getMutatorAndR = this._getMutatorAndRecordProxyForActor(defaultActorIdentifier), mutator = _this$_getMutatorAndR[0], recordSourceProxy = _this$_getMutatorAndR[1];
        this._mostRecentlyInvalidatedAt = null;
        this._handlers = handlers2;
        this._mutator = mutator;
        this._operationLoader = operationLoader !== null && operationLoader !== void 0 ? operationLoader : null;
        this._recordSourceProxy = recordSourceProxy;
        this._recordWasMissing = false;
        this._variables = variables;
        this._shouldProcessClientComponents = shouldProcessClientComponents;
      }
      var _proto = DataChecker2.prototype;
      _proto._getMutatorAndRecordProxyForActor = function _getMutatorAndRecordProxyForActor(actorIdentifier) {
        var tuple = this._mutatorRecordSourceProxyCache.get(actorIdentifier);
        if (tuple == null) {
          var target = this._getTargetForActor(actorIdentifier);
          var mutator = new RelayRecordSourceMutator(this._getSourceForActor(actorIdentifier), target);
          var recordSourceProxy = new RelayRecordSourceProxy(mutator, this._getDataID);
          tuple = [mutator, recordSourceProxy];
          this._mutatorRecordSourceProxyCache.set(actorIdentifier, tuple);
        }
        return tuple;
      };
      _proto.check = function check2(node56, dataID) {
        this._traverse(node56, dataID);
        return this._recordWasMissing === true ? {
          status: "missing",
          mostRecentlyInvalidatedAt: this._mostRecentlyInvalidatedAt
        } : {
          status: "available",
          mostRecentlyInvalidatedAt: this._mostRecentlyInvalidatedAt
        };
      };
      _proto._getVariableValue = function _getVariableValue(name2) {
        !this._variables.hasOwnProperty(name2) ? true ? invariant3(false, "RelayAsyncLoader(): Undefined variable `%s`.", name2) : invariant3(false) : void 0;
        return this._variables[name2];
      };
      _proto._handleMissing = function _handleMissing() {
        this._recordWasMissing = true;
      };
      _proto._getDataForHandlers = function _getDataForHandlers(field, dataID) {
        return {
          /* $FlowFixMe[class-object-subtyping] added when improving typing for
           * this parameters */
          args: field.args ? getArgumentValues(field.args, this._variables) : {},
          // Getting a snapshot of the record state is potentially expensive since
          // we will need to merge the sink and source records. Since we do not create
          // any new records in this process, it is probably reasonable to provide
          // handlers with a copy of the source record.
          // The only thing that the provided record will not contain is fields
          // added by previous handlers.
          record: this._source.get(dataID)
        };
      };
      _proto._handleMissingScalarField = function _handleMissingScalarField(field, dataID) {
        if (field.name === "id" && field.alias == null && isClientID(dataID)) {
          return void 0;
        }
        var _this$_getDataForHand = this._getDataForHandlers(field, dataID), args = _this$_getDataForHand.args, record = _this$_getDataForHand.record;
        var _iterator = (0, _createForOfIteratorHelper2["default"])(this._handlers), _step;
        try {
          for (_iterator.s(); !(_step = _iterator.n()).done; ) {
            var handler = _step.value;
            if (handler.kind === "scalar") {
              var newValue = handler.handle(field, record, args, this._recordSourceProxy);
              if (newValue !== void 0) {
                return newValue;
              }
            }
          }
        } catch (err) {
          _iterator.e(err);
        } finally {
          _iterator.f();
        }
        this._handleMissing();
      };
      _proto._handleMissingLinkField = function _handleMissingLinkField(field, dataID) {
        var _this$_getDataForHand2 = this._getDataForHandlers(field, dataID), args = _this$_getDataForHand2.args, record = _this$_getDataForHand2.record;
        var _iterator2 = (0, _createForOfIteratorHelper2["default"])(this._handlers), _step2;
        try {
          for (_iterator2.s(); !(_step2 = _iterator2.n()).done; ) {
            var handler = _step2.value;
            if (handler.kind === "linked") {
              var newValue = handler.handle(field, record, args, this._recordSourceProxy);
              if (newValue !== void 0 && (newValue === null || this._mutator.getStatus(newValue) === EXISTENT)) {
                return newValue;
              }
            }
          }
        } catch (err) {
          _iterator2.e(err);
        } finally {
          _iterator2.f();
        }
        this._handleMissing();
      };
      _proto._handleMissingPluralLinkField = function _handleMissingPluralLinkField(field, dataID) {
        var _this = this;
        var _this$_getDataForHand3 = this._getDataForHandlers(field, dataID), args = _this$_getDataForHand3.args, record = _this$_getDataForHand3.record;
        var _iterator3 = (0, _createForOfIteratorHelper2["default"])(this._handlers), _step3;
        try {
          for (_iterator3.s(); !(_step3 = _iterator3.n()).done; ) {
            var handler = _step3.value;
            if (handler.kind === "pluralLinked") {
              var newValue = handler.handle(field, record, args, this._recordSourceProxy);
              if (newValue != null) {
                var allItemsKnown = newValue.every(function(linkedID) {
                  return linkedID != null && _this._mutator.getStatus(linkedID) === EXISTENT;
                });
                if (allItemsKnown) {
                  return newValue;
                }
              } else if (newValue === null) {
                return null;
              }
            }
          }
        } catch (err) {
          _iterator3.e(err);
        } finally {
          _iterator3.f();
        }
        this._handleMissing();
      };
      _proto._traverse = function _traverse(node56, dataID) {
        var status = this._mutator.getStatus(dataID);
        if (status === UNKNOWN) {
          this._handleMissing();
        }
        if (status === EXISTENT) {
          var record = this._source.get(dataID);
          var invalidatedAt = RelayModernRecord.getInvalidationEpoch(record);
          if (invalidatedAt != null) {
            this._mostRecentlyInvalidatedAt = this._mostRecentlyInvalidatedAt != null ? Math.max(this._mostRecentlyInvalidatedAt, invalidatedAt) : invalidatedAt;
          }
          this._traverseSelections(node56.selections, dataID);
        }
      };
      _proto._traverseSelections = function _traverseSelections(selections, dataID) {
        var _this2 = this;
        selections.forEach(function(selection2) {
          switch (selection2.kind) {
            case SCALAR_FIELD:
              _this2._checkScalar(selection2, dataID);
              break;
            case LINKED_FIELD:
              if (selection2.plural) {
                _this2._checkPluralLink(selection2, dataID);
              } else {
                _this2._checkLink(selection2, dataID);
              }
              break;
            case ACTOR_CHANGE:
              _this2._checkActorChange(selection2.linkedField, dataID);
              break;
            case CONDITION:
              var conditionValue = Boolean(_this2._getVariableValue(selection2.condition));
              if (conditionValue === selection2.passingValue) {
                _this2._traverseSelections(selection2.selections, dataID);
              }
              break;
            case INLINE_FRAGMENT: {
              var _abstractKey = selection2.abstractKey;
              if (_abstractKey == null) {
                var typeName2 = _this2._mutator.getType(dataID);
                if (typeName2 === selection2.type) {
                  _this2._traverseSelections(selection2.selections, dataID);
                }
              } else {
                var _recordType = _this2._mutator.getType(dataID);
                !(_recordType != null) ? true ? invariant3(false, "DataChecker: Expected record `%s` to have a known type", dataID) : invariant3(false) : void 0;
                var _typeID = generateTypeID(_recordType);
                var _implementsInterface = _this2._mutator.getValue(_typeID, _abstractKey);
                if (_implementsInterface === true) {
                  _this2._traverseSelections(selection2.selections, dataID);
                } else if (_implementsInterface == null) {
                  _this2._handleMissing();
                }
              }
              break;
            }
            case LINKED_HANDLE: {
              var handleField = cloneRelayHandleSourceField(selection2, selections, _this2._variables);
              if (handleField.plural) {
                _this2._checkPluralLink(handleField, dataID);
              } else {
                _this2._checkLink(handleField, dataID);
              }
              break;
            }
            case SCALAR_HANDLE: {
              var _handleField = cloneRelayScalarHandleSourceField(selection2, selections, _this2._variables);
              _this2._checkScalar(_handleField, dataID);
              break;
            }
            case MODULE_IMPORT:
              _this2._checkModuleImport(selection2, dataID);
              break;
            case DEFER:
            case STREAM:
              _this2._traverseSelections(selection2.selections, dataID);
              break;
            case FRAGMENT_SPREAD:
              var prevVariables = _this2._variables;
              _this2._variables = getLocalVariables(_this2._variables, selection2.fragment.argumentDefinitions, selection2.args);
              _this2._traverseSelections(selection2.fragment.selections, dataID);
              _this2._variables = prevVariables;
              break;
            case CLIENT_EXTENSION:
              var recordWasMissing = _this2._recordWasMissing;
              _this2._traverseSelections(selection2.selections, dataID);
              _this2._recordWasMissing = recordWasMissing;
              break;
            case TYPE_DISCRIMINATOR:
              var abstractKey = selection2.abstractKey;
              var recordType = _this2._mutator.getType(dataID);
              !(recordType != null) ? true ? invariant3(false, "DataChecker: Expected record `%s` to have a known type", dataID) : invariant3(false) : void 0;
              var typeID = generateTypeID(recordType);
              var implementsInterface = _this2._mutator.getValue(typeID, abstractKey);
              if (implementsInterface == null) {
                _this2._handleMissing();
              }
              break;
            case FLIGHT_FIELD:
              if (RelayFeatureFlags.ENABLE_REACT_FLIGHT_COMPONENT_FIELD) {
                _this2._checkFlightField(selection2, dataID);
              } else {
                throw new Error("Flight fields are not yet supported.");
              }
              break;
            case CLIENT_COMPONENT:
              if (_this2._shouldProcessClientComponents === false) {
                break;
              }
              _this2._traverseSelections(selection2.fragment.selections, dataID);
              break;
            default:
              selection2;
              true ? true ? invariant3(false, "RelayAsyncLoader(): Unexpected ast kind `%s`.", selection2.kind) : invariant3(false) : void 0;
          }
        });
      };
      _proto._checkModuleImport = function _checkModuleImport(moduleImport, dataID) {
        var operationLoader = this._operationLoader;
        !(operationLoader !== null) ? true ? invariant3(false, "DataChecker: Expected an operationLoader to be configured when using `@module`.") : invariant3(false) : void 0;
        var operationKey = getModuleOperationKey(moduleImport.documentName);
        var operationReference = this._mutator.getValue(dataID, operationKey);
        if (operationReference == null) {
          if (operationReference === void 0) {
            this._handleMissing();
          }
          return;
        }
        var normalizationRootNode = operationLoader.get(operationReference);
        if (normalizationRootNode != null) {
          var operation = getOperation(normalizationRootNode);
          var prevVariables = this._variables;
          this._variables = getLocalVariables(this._variables, operation.argumentDefinitions, moduleImport.args);
          this._traverse(operation, dataID);
          this._variables = prevVariables;
        } else {
          this._handleMissing();
        }
      };
      _proto._checkScalar = function _checkScalar(field, dataID) {
        var storageKey = getStorageKey(field, this._variables);
        var fieldValue = this._mutator.getValue(dataID, storageKey);
        if (fieldValue === void 0) {
          fieldValue = this._handleMissingScalarField(field, dataID);
          if (fieldValue !== void 0) {
            this._mutator.setValue(dataID, storageKey, fieldValue);
          }
        }
      };
      _proto._checkLink = function _checkLink(field, dataID) {
        var storageKey = getStorageKey(field, this._variables);
        var linkedID = this._mutator.getLinkedRecordID(dataID, storageKey);
        if (linkedID === void 0) {
          linkedID = this._handleMissingLinkField(field, dataID);
          if (linkedID != null) {
            this._mutator.setLinkedRecordID(dataID, storageKey, linkedID);
          } else if (linkedID === null) {
            this._mutator.setValue(dataID, storageKey, null);
          }
        }
        if (linkedID != null) {
          this._traverse(field, linkedID);
        }
      };
      _proto._checkPluralLink = function _checkPluralLink(field, dataID) {
        var _this3 = this;
        var storageKey = getStorageKey(field, this._variables);
        var linkedIDs = this._mutator.getLinkedRecordIDs(dataID, storageKey);
        if (linkedIDs === void 0) {
          linkedIDs = this._handleMissingPluralLinkField(field, dataID);
          if (linkedIDs != null) {
            this._mutator.setLinkedRecordIDs(dataID, storageKey, linkedIDs);
          } else if (linkedIDs === null) {
            this._mutator.setValue(dataID, storageKey, null);
          }
        }
        if (linkedIDs) {
          linkedIDs.forEach(function(linkedID) {
            if (linkedID != null) {
              _this3._traverse(field, linkedID);
            }
          });
        }
      };
      _proto._checkActorChange = function _checkActorChange(field, dataID) {
        var storageKey = getStorageKey(field, this._variables);
        var record = this._source.get(dataID);
        var tuple = record != null ? RelayModernRecord.getActorLinkedRecordID(record, storageKey) : record;
        if (tuple == null) {
          if (tuple === void 0) {
            this._handleMissing();
          }
        } else {
          var actorIdentifier = tuple[0], linkedID = tuple[1];
          var prevSource = this._source;
          var prevMutator = this._mutator;
          var prevRecordSourceProxy = this._recordSourceProxy;
          var _this$_getMutatorAndR2 = this._getMutatorAndRecordProxyForActor(actorIdentifier), mutator = _this$_getMutatorAndR2[0], recordSourceProxy = _this$_getMutatorAndR2[1];
          this._source = this._getSourceForActor(actorIdentifier);
          this._mutator = mutator;
          this._recordSourceProxy = recordSourceProxy;
          this._traverse(field, linkedID);
          this._source = prevSource;
          this._mutator = prevMutator;
          this._recordSourceProxy = prevRecordSourceProxy;
        }
      };
      _proto._checkFlightField = function _checkFlightField(field, dataID) {
        var storageKey = getStorageKey(field, this._variables);
        var linkedID = this._mutator.getLinkedRecordID(dataID, storageKey);
        if (linkedID == null) {
          if (linkedID === void 0) {
            this._handleMissing();
            return;
          }
          return;
        }
        var tree = this._mutator.getValue(linkedID, RelayStoreReactFlightUtils.REACT_FLIGHT_TREE_STORAGE_KEY);
        var reachableExecutableDefinitions = this._mutator.getValue(linkedID, RelayStoreReactFlightUtils.REACT_FLIGHT_EXECUTABLE_DEFINITIONS_STORAGE_KEY);
        if (tree == null || !Array.isArray(reachableExecutableDefinitions)) {
          this._handleMissing();
          return;
        }
        var operationLoader = this._operationLoader;
        !(operationLoader !== null) ? true ? invariant3(false, "DataChecker: Expected an operationLoader to be configured when using React Flight.") : invariant3(false) : void 0;
        var prevVariables = this._variables;
        var _iterator4 = (0, _createForOfIteratorHelper2["default"])(reachableExecutableDefinitions), _step4;
        try {
          for (_iterator4.s(); !(_step4 = _iterator4.n()).done; ) {
            var definition = _step4.value;
            this._variables = definition.variables;
            var normalizationRootNode = operationLoader.get(definition.module);
            if (normalizationRootNode != null) {
              var operation = getOperation(normalizationRootNode);
              this._traverseSelections(operation.selections, ROOT_ID);
            } else {
              this._handleMissing();
            }
          }
        } catch (err) {
          _iterator4.e(err);
        } finally {
          _iterator4.f();
        }
        this._variables = prevVariables;
      };
      return DataChecker2;
    }();
    module.exports = {
      check
    };
  }
});

// node_modules/relay-runtime/lib/store/RelayOptimisticRecordSource.js
var require_RelayOptimisticRecordSource2 = __commonJS({
  "node_modules/relay-runtime/lib/store/RelayOptimisticRecordSource.js"(exports, module) {
    "use strict";
    var _interopRequireDefault = require_interopRequireDefault()["default"];
    var _objectSpread210 = _interopRequireDefault(require_objectSpread2());
    var RelayRecordSource = require_RelayRecordSource2();
    var invariant3 = require_browser();
    var UNPUBLISH_RECORD_SENTINEL = Object.freeze({
      __UNPUBLISH_RECORD_SENTINEL: true
    });
    var RelayOptimisticRecordSource = /* @__PURE__ */ function() {
      function RelayOptimisticRecordSource2(base2) {
        this._base = base2;
        this._sink = RelayRecordSource.create();
      }
      var _proto = RelayOptimisticRecordSource2.prototype;
      _proto.has = function has2(dataID) {
        if (this._sink.has(dataID)) {
          var sinkRecord = this._sink.get(dataID);
          return sinkRecord !== UNPUBLISH_RECORD_SENTINEL;
        } else {
          return this._base.has(dataID);
        }
      };
      _proto.get = function get3(dataID) {
        if (this._sink.has(dataID)) {
          var sinkRecord = this._sink.get(dataID);
          if (sinkRecord === UNPUBLISH_RECORD_SENTINEL) {
            return void 0;
          } else {
            return sinkRecord;
          }
        } else {
          return this._base.get(dataID);
        }
      };
      _proto.getStatus = function getStatus(dataID) {
        var record = this.get(dataID);
        if (record === void 0) {
          return "UNKNOWN";
        } else if (record === null) {
          return "NONEXISTENT";
        } else {
          return "EXISTENT";
        }
      };
      _proto.clear = function clear2() {
        this._base = RelayRecordSource.create();
        this._sink.clear();
      };
      _proto["delete"] = function _delete(dataID) {
        this._sink["delete"](dataID);
      };
      _proto.remove = function remove2(dataID) {
        this._sink.set(dataID, UNPUBLISH_RECORD_SENTINEL);
      };
      _proto.set = function set3(dataID, record) {
        this._sink.set(dataID, record);
      };
      _proto.getRecordIDs = function getRecordIDs() {
        return Object.keys(this.toJSON());
      };
      _proto.size = function size() {
        return Object.keys(this.toJSON()).length;
      };
      _proto.toJSON = function toJSON2() {
        var _this = this;
        var merged = (0, _objectSpread210["default"])({}, this._base.toJSON());
        this._sink.getRecordIDs().forEach(function(dataID) {
          var record = _this.get(dataID);
          if (record === void 0) {
            delete merged[dataID];
          } else {
            merged[dataID] = record;
          }
        });
        return merged;
      };
      _proto.getOptimisticRecordIDs = function getOptimisticRecordIDs2() {
        return new Set(this._sink.getRecordIDs());
      };
      return RelayOptimisticRecordSource2;
    }();
    function create4(base2) {
      return new RelayOptimisticRecordSource(base2);
    }
    function getOptimisticRecordIDs(source) {
      !(source instanceof RelayOptimisticRecordSource) ? true ? invariant3(false, "getOptimisticRecordIDs: Instance of RelayOptimisticRecordSource is expected") : invariant3(false) : void 0;
      return source.getOptimisticRecordIDs();
    }
    module.exports = {
      create: create4,
      getOptimisticRecordIDs
    };
  }
});

// node_modules/relay-runtime/lib/store/RelayReferenceMarker.js
var require_RelayReferenceMarker2 = __commonJS({
  "node_modules/relay-runtime/lib/store/RelayReferenceMarker.js"(exports, module) {
    "use strict";
    var _interopRequireDefault = require_interopRequireDefault()["default"];
    var _createForOfIteratorHelper2 = _interopRequireDefault(require_createForOfIteratorHelper());
    var getOperation = require_getOperation2();
    var RelayConcreteNode = require_RelayConcreteNode2();
    var RelayFeatureFlags = require_RelayFeatureFlags2();
    var cloneRelayHandleSourceField = require_cloneRelayHandleSourceField2();
    var _require = require_RelayConcreteVariables2();
    var getLocalVariables = _require.getLocalVariables;
    var RelayModernRecord = require_RelayModernRecord2();
    var RelayStoreReactFlightUtils = require_RelayStoreReactFlightUtils2();
    var RelayStoreUtils = require_RelayStoreUtils2();
    var _require2 = require_TypeID2();
    var generateTypeID = _require2.generateTypeID;
    var invariant3 = require_browser();
    var ACTOR_CHANGE = RelayConcreteNode.ACTOR_CHANGE;
    var CONDITION = RelayConcreteNode.CONDITION;
    var CLIENT_COMPONENT = RelayConcreteNode.CLIENT_COMPONENT;
    var CLIENT_EXTENSION = RelayConcreteNode.CLIENT_EXTENSION;
    var DEFER = RelayConcreteNode.DEFER;
    var FLIGHT_FIELD = RelayConcreteNode.FLIGHT_FIELD;
    var FRAGMENT_SPREAD = RelayConcreteNode.FRAGMENT_SPREAD;
    var INLINE_FRAGMENT = RelayConcreteNode.INLINE_FRAGMENT;
    var LINKED_FIELD = RelayConcreteNode.LINKED_FIELD;
    var MODULE_IMPORT = RelayConcreteNode.MODULE_IMPORT;
    var LINKED_HANDLE = RelayConcreteNode.LINKED_HANDLE;
    var SCALAR_FIELD = RelayConcreteNode.SCALAR_FIELD;
    var SCALAR_HANDLE = RelayConcreteNode.SCALAR_HANDLE;
    var STREAM = RelayConcreteNode.STREAM;
    var TYPE_DISCRIMINATOR = RelayConcreteNode.TYPE_DISCRIMINATOR;
    var ROOT_ID = RelayStoreUtils.ROOT_ID;
    var getStorageKey = RelayStoreUtils.getStorageKey;
    var getModuleOperationKey = RelayStoreUtils.getModuleOperationKey;
    function mark(recordSource, selector, references, operationLoader, shouldProcessClientComponents) {
      var dataID = selector.dataID, node56 = selector.node, variables = selector.variables;
      var marker = new RelayReferenceMarker(recordSource, variables, references, operationLoader, shouldProcessClientComponents);
      marker.mark(node56, dataID);
    }
    var RelayReferenceMarker = /* @__PURE__ */ function() {
      function RelayReferenceMarker2(recordSource, variables, references, operationLoader, shouldProcessClientComponents) {
        this._operationLoader = operationLoader !== null && operationLoader !== void 0 ? operationLoader : null;
        this._operationName = null;
        this._recordSource = recordSource;
        this._references = references;
        this._variables = variables;
        this._shouldProcessClientComponents = shouldProcessClientComponents;
      }
      var _proto = RelayReferenceMarker2.prototype;
      _proto.mark = function mark2(node56, dataID) {
        if (node56.kind === "Operation" || node56.kind === "SplitOperation") {
          this._operationName = node56.name;
        }
        this._traverse(node56, dataID);
      };
      _proto._traverse = function _traverse(node56, dataID) {
        this._references.add(dataID);
        var record = this._recordSource.get(dataID);
        if (record == null) {
          return;
        }
        this._traverseSelections(node56.selections, record);
      };
      _proto._getVariableValue = function _getVariableValue(name2) {
        !this._variables.hasOwnProperty(name2) ? true ? invariant3(false, "RelayReferenceMarker(): Undefined variable `%s`.", name2) : invariant3(false) : void 0;
        return this._variables[name2];
      };
      _proto._traverseSelections = function _traverseSelections(selections, record) {
        var _this = this;
        selections.forEach(function(selection2) {
          switch (selection2.kind) {
            case ACTOR_CHANGE:
              _this._traverseLink(selection2.linkedField, record);
              break;
            case LINKED_FIELD:
              if (selection2.plural) {
                _this._traversePluralLink(selection2, record);
              } else {
                _this._traverseLink(selection2, record);
              }
              break;
            case CONDITION:
              var conditionValue = Boolean(_this._getVariableValue(selection2.condition));
              if (conditionValue === selection2.passingValue) {
                _this._traverseSelections(selection2.selections, record);
              }
              break;
            case INLINE_FRAGMENT:
              if (selection2.abstractKey == null) {
                var typeName2 = RelayModernRecord.getType(record);
                if (typeName2 != null && typeName2 === selection2.type) {
                  _this._traverseSelections(selection2.selections, record);
                }
              } else {
                var _typeName = RelayModernRecord.getType(record);
                var typeID = generateTypeID(_typeName);
                _this._references.add(typeID);
                _this._traverseSelections(selection2.selections, record);
              }
              break;
            case FRAGMENT_SPREAD:
              var prevVariables = _this._variables;
              _this._variables = getLocalVariables(_this._variables, selection2.fragment.argumentDefinitions, selection2.args);
              _this._traverseSelections(selection2.fragment.selections, record);
              _this._variables = prevVariables;
              break;
            case LINKED_HANDLE:
              var handleField = cloneRelayHandleSourceField(selection2, selections, _this._variables);
              if (handleField.plural) {
                _this._traversePluralLink(handleField, record);
              } else {
                _this._traverseLink(handleField, record);
              }
              break;
            case DEFER:
            case STREAM:
              _this._traverseSelections(selection2.selections, record);
              break;
            case SCALAR_FIELD:
            case SCALAR_HANDLE:
              break;
            case TYPE_DISCRIMINATOR: {
              var _typeName2 = RelayModernRecord.getType(record);
              var _typeID = generateTypeID(_typeName2);
              _this._references.add(_typeID);
              break;
            }
            case MODULE_IMPORT:
              _this._traverseModuleImport(selection2, record);
              break;
            case CLIENT_EXTENSION:
              _this._traverseSelections(selection2.selections, record);
              break;
            case FLIGHT_FIELD:
              if (RelayFeatureFlags.ENABLE_REACT_FLIGHT_COMPONENT_FIELD) {
                _this._traverseFlightField(selection2, record);
              } else {
                throw new Error("Flight fields are not yet supported.");
              }
              break;
            case CLIENT_COMPONENT:
              if (_this._shouldProcessClientComponents === false) {
                break;
              }
              _this._traverseSelections(selection2.fragment.selections, record);
              break;
            default:
              selection2;
              true ? true ? invariant3(false, "RelayReferenceMarker: Unknown AST node `%s`.", selection2) : invariant3(false) : void 0;
          }
        });
      };
      _proto._traverseModuleImport = function _traverseModuleImport(moduleImport, record) {
        var _this$_operationName;
        var operationLoader = this._operationLoader;
        !(operationLoader !== null) ? true ? invariant3(false, "RelayReferenceMarker: Expected an operationLoader to be configured when using `@module`. Could not load fragment `%s` in operation `%s`.", moduleImport.fragmentName, (_this$_operationName = this._operationName) !== null && _this$_operationName !== void 0 ? _this$_operationName : "(unknown)") : invariant3(false) : void 0;
        var operationKey = getModuleOperationKey(moduleImport.documentName);
        var operationReference = RelayModernRecord.getValue(record, operationKey);
        if (operationReference == null) {
          return;
        }
        var normalizationRootNode = operationLoader.get(operationReference);
        if (normalizationRootNode != null) {
          var operation = getOperation(normalizationRootNode);
          var prevVariables = this._variables;
          this._variables = getLocalVariables(this._variables, operation.argumentDefinitions, moduleImport.args);
          this._traverseSelections(operation.selections, record);
          this._variables = prevVariables;
        }
      };
      _proto._traverseLink = function _traverseLink(field, record) {
        var storageKey = getStorageKey(field, this._variables);
        var linkedID = RelayModernRecord.getLinkedRecordID(record, storageKey);
        if (linkedID == null) {
          return;
        }
        this._traverse(field, linkedID);
      };
      _proto._traversePluralLink = function _traversePluralLink(field, record) {
        var _this2 = this;
        var storageKey = getStorageKey(field, this._variables);
        var linkedIDs = RelayModernRecord.getLinkedRecordIDs(record, storageKey);
        if (linkedIDs == null) {
          return;
        }
        linkedIDs.forEach(function(linkedID) {
          if (linkedID != null) {
            _this2._traverse(field, linkedID);
          }
        });
      };
      _proto._traverseFlightField = function _traverseFlightField(field, record) {
        var storageKey = getStorageKey(field, this._variables);
        var linkedID = RelayModernRecord.getLinkedRecordID(record, storageKey);
        if (linkedID == null) {
          return;
        }
        this._references.add(linkedID);
        var reactFlightClientResponseRecord = this._recordSource.get(linkedID);
        if (reactFlightClientResponseRecord == null) {
          return;
        }
        var reachableExecutableDefinitions = RelayModernRecord.getValue(reactFlightClientResponseRecord, RelayStoreReactFlightUtils.REACT_FLIGHT_EXECUTABLE_DEFINITIONS_STORAGE_KEY);
        if (!Array.isArray(reachableExecutableDefinitions)) {
          return;
        }
        var operationLoader = this._operationLoader;
        !(operationLoader !== null) ? true ? invariant3(false, "DataChecker: Expected an operationLoader to be configured when using React Flight") : invariant3(false) : void 0;
        var prevVariables = this._variables;
        var _iterator = (0, _createForOfIteratorHelper2["default"])(reachableExecutableDefinitions), _step;
        try {
          for (_iterator.s(); !(_step = _iterator.n()).done; ) {
            var definition = _step.value;
            this._variables = definition.variables;
            var operationReference = definition.module;
            var normalizationRootNode = operationLoader.get(operationReference);
            if (normalizationRootNode != null) {
              var operation = getOperation(normalizationRootNode);
              this._traverse(operation, ROOT_ID);
            }
          }
        } catch (err) {
          _iterator.e(err);
        } finally {
          _iterator.f();
        }
        this._variables = prevVariables;
      };
      return RelayReferenceMarker2;
    }();
    module.exports = {
      mark
    };
  }
});

// node_modules/relay-runtime/lib/store/hasOverlappingIDs.js
var require_hasOverlappingIDs2 = __commonJS({
  "node_modules/relay-runtime/lib/store/hasOverlappingIDs.js"(exports, module) {
    "use strict";
    var ITERATOR_KEY = Symbol.iterator;
    function hasOverlappingIDs(seenRecords, updatedRecordIDs) {
      var iterator = seenRecords[ITERATOR_KEY]();
      var next2 = iterator.next();
      while (!next2.done) {
        var key = next2.value;
        if (updatedRecordIDs.has(key)) {
          return true;
        }
        next2 = iterator.next();
      }
      return false;
    }
    module.exports = hasOverlappingIDs;
  }
});

// node_modules/relay-runtime/lib/store/RelayStoreSubscriptions.js
var require_RelayStoreSubscriptions2 = __commonJS({
  "node_modules/relay-runtime/lib/store/RelayStoreSubscriptions.js"(exports, module) {
    "use strict";
    var deepFreeze = require_deepFreeze2();
    var recycleNodesInto = require_recycleNodesInto2();
    var RelayFeatureFlags = require_RelayFeatureFlags2();
    var hasOverlappingIDs = require_hasOverlappingIDs2();
    var RelayReader = require_RelayReader2();
    var RelayStoreSubscriptions = /* @__PURE__ */ function() {
      function RelayStoreSubscriptions2(log2, resolverCache) {
        this._subscriptions = /* @__PURE__ */ new Set();
        this.__log = log2;
        this._resolverCache = resolverCache;
      }
      var _proto = RelayStoreSubscriptions2.prototype;
      _proto.subscribe = function subscribe(snapshot, callback) {
        var _this = this;
        var subscription2 = {
          backup: null,
          callback,
          snapshot,
          stale: false
        };
        var dispose2 = function dispose3() {
          _this._subscriptions["delete"](subscription2);
        };
        this._subscriptions.add(subscription2);
        return {
          dispose: dispose2
        };
      };
      _proto.snapshotSubscriptions = function snapshotSubscriptions(source) {
        var _this2 = this;
        this._subscriptions.forEach(function(subscription2) {
          if (!subscription2.stale) {
            subscription2.backup = subscription2.snapshot;
            return;
          }
          var snapshot = subscription2.snapshot;
          var backup = RelayReader.read(source, snapshot.selector, _this2._resolverCache);
          var nextData = recycleNodesInto(snapshot.data, backup.data);
          backup.data = nextData;
          subscription2.backup = backup;
        });
      };
      _proto.restoreSubscriptions = function restoreSubscriptions() {
        this._subscriptions.forEach(function(subscription2) {
          var backup = subscription2.backup;
          subscription2.backup = null;
          if (backup) {
            if (backup.data !== subscription2.snapshot.data) {
              subscription2.stale = true;
            }
            subscription2.snapshot = {
              data: subscription2.snapshot.data,
              isMissingData: backup.isMissingData,
              missingClientEdges: backup.missingClientEdges,
              missingLiveResolverFields: backup.missingLiveResolverFields,
              seenRecords: backup.seenRecords,
              selector: backup.selector,
              missingRequiredFields: backup.missingRequiredFields,
              relayResolverErrors: backup.relayResolverErrors
            };
          } else {
            subscription2.stale = true;
          }
        });
      };
      _proto.updateSubscriptions = function updateSubscriptions(source, updatedRecordIDs, updatedOwners, sourceOperation) {
        var _this3 = this;
        var hasUpdatedRecords = updatedRecordIDs.size !== 0;
        this._subscriptions.forEach(function(subscription2) {
          var owner = _this3._updateSubscription(source, subscription2, updatedRecordIDs, hasUpdatedRecords, sourceOperation);
          if (owner != null) {
            updatedOwners.push(owner);
          }
        });
      };
      _proto._updateSubscription = function _updateSubscription(source, subscription2, updatedRecordIDs, hasUpdatedRecords, sourceOperation) {
        var backup = subscription2.backup, callback = subscription2.callback, snapshot = subscription2.snapshot, stale = subscription2.stale;
        var hasOverlappingUpdates = hasUpdatedRecords && hasOverlappingIDs(snapshot.seenRecords, updatedRecordIDs);
        if (!stale && !hasOverlappingUpdates) {
          return;
        }
        var nextSnapshot = hasOverlappingUpdates || !backup ? RelayReader.read(source, snapshot.selector, this._resolverCache) : backup;
        var nextData = recycleNodesInto(snapshot.data, nextSnapshot.data);
        nextSnapshot = {
          data: nextData,
          isMissingData: nextSnapshot.isMissingData,
          missingClientEdges: nextSnapshot.missingClientEdges,
          missingLiveResolverFields: nextSnapshot.missingLiveResolverFields,
          seenRecords: nextSnapshot.seenRecords,
          selector: nextSnapshot.selector,
          missingRequiredFields: nextSnapshot.missingRequiredFields,
          relayResolverErrors: nextSnapshot.relayResolverErrors
        };
        if (true) {
          deepFreeze(nextSnapshot);
        }
        subscription2.snapshot = nextSnapshot;
        subscription2.stale = false;
        if (nextSnapshot.data !== snapshot.data) {
          if (this.__log && RelayFeatureFlags.ENABLE_NOTIFY_SUBSCRIPTION) {
            this.__log({
              name: "store.notify.subscription",
              sourceOperation,
              snapshot,
              nextSnapshot
            });
          }
          callback(nextSnapshot);
          return snapshot.selector.owner;
        }
      };
      return RelayStoreSubscriptions2;
    }();
    module.exports = RelayStoreSubscriptions;
  }
});

// node_modules/relay-runtime/lib/store/RelayModernStore.js
var require_RelayModernStore2 = __commonJS({
  "node_modules/relay-runtime/lib/store/RelayModernStore.js"(exports, module) {
    "use strict";
    var _interopRequireDefault = require_interopRequireDefault()["default"];
    var _createForOfIteratorHelper2 = _interopRequireDefault(require_createForOfIteratorHelper());
    var _defineProperty210 = _interopRequireDefault(require_defineProperty());
    var _require = require_ActorIdentifier2();
    var INTERNAL_ACTOR_IDENTIFIER_DO_NOT_USE = _require.INTERNAL_ACTOR_IDENTIFIER_DO_NOT_USE;
    var assertInternalActorIndentifier = _require.assertInternalActorIndentifier;
    var deepFreeze = require_deepFreeze2();
    var RelayFeatureFlags = require_RelayFeatureFlags2();
    var resolveImmediate = require_resolveImmediate2();
    var DataChecker = require_DataChecker2();
    var defaultGetDataID = require_defaultGetDataID2();
    var RelayModernRecord = require_RelayModernRecord2();
    var RelayOptimisticRecordSource = require_RelayOptimisticRecordSource2();
    var RelayReader = require_RelayReader2();
    var RelayReferenceMarker = require_RelayReferenceMarker2();
    var RelayStoreReactFlightUtils = require_RelayStoreReactFlightUtils2();
    var RelayStoreSubscriptions = require_RelayStoreSubscriptions2();
    var RelayStoreUtils = require_RelayStoreUtils2();
    var _require2 = require_RelayStoreUtils2();
    var ROOT_ID = _require2.ROOT_ID;
    var ROOT_TYPE = _require2.ROOT_TYPE;
    var _require3 = require_ResolverCache2();
    var RecordResolverCache = _require3.RecordResolverCache;
    var invariant3 = require_browser();
    var DEFAULT_RELEASE_BUFFER_SIZE = 10;
    var RelayModernStore = /* @__PURE__ */ function() {
      function RelayModernStore2(source, options) {
        var _this = this;
        var _options$gcReleaseBuf, _options$gcScheduler, _options$getDataID, _options$log, _options$operationLoa;
        (0, _defineProperty210["default"])(this, "_gcStep", function() {
          if (_this._gcRun) {
            if (_this._gcRun.next().done) {
              _this._gcRun = null;
            } else {
              _this._gcScheduler(_this._gcStep);
            }
          }
        });
        if (true) {
          var storeIDs = source.getRecordIDs();
          for (var ii = 0; ii < storeIDs.length; ii++) {
            var record = source.get(storeIDs[ii]);
            if (record) {
              RelayModernRecord.freeze(record);
            }
          }
        }
        this._currentWriteEpoch = 0;
        this._gcHoldCounter = 0;
        this._gcReleaseBufferSize = (_options$gcReleaseBuf = options === null || options === void 0 ? void 0 : options.gcReleaseBufferSize) !== null && _options$gcReleaseBuf !== void 0 ? _options$gcReleaseBuf : DEFAULT_RELEASE_BUFFER_SIZE;
        this._gcRun = null;
        this._gcScheduler = (_options$gcScheduler = options === null || options === void 0 ? void 0 : options.gcScheduler) !== null && _options$gcScheduler !== void 0 ? _options$gcScheduler : resolveImmediate;
        this._getDataID = (_options$getDataID = options === null || options === void 0 ? void 0 : options.getDataID) !== null && _options$getDataID !== void 0 ? _options$getDataID : defaultGetDataID;
        this._globalInvalidationEpoch = null;
        this._invalidationSubscriptions = /* @__PURE__ */ new Set();
        this._invalidatedRecordIDs = /* @__PURE__ */ new Set();
        this.__log = (_options$log = options === null || options === void 0 ? void 0 : options.log) !== null && _options$log !== void 0 ? _options$log : null;
        this._queryCacheExpirationTime = options === null || options === void 0 ? void 0 : options.queryCacheExpirationTime;
        this._operationLoader = (_options$operationLoa = options === null || options === void 0 ? void 0 : options.operationLoader) !== null && _options$operationLoa !== void 0 ? _options$operationLoa : null;
        this._optimisticSource = null;
        this._recordSource = source;
        this._releaseBuffer = [];
        this._roots = /* @__PURE__ */ new Map();
        this._shouldScheduleGC = false;
        this._resolverCache = new RecordResolverCache(function() {
          return _this._getMutableRecordSource();
        });
        this._storeSubscriptions = new RelayStoreSubscriptions(options === null || options === void 0 ? void 0 : options.log, this._resolverCache);
        this._updatedRecordIDs = /* @__PURE__ */ new Set();
        this._shouldProcessClientComponents = options === null || options === void 0 ? void 0 : options.shouldProcessClientComponents;
        initializeRecordSource(this._recordSource);
      }
      var _proto = RelayModernStore2.prototype;
      _proto.getSource = function getSource() {
        var _this$_optimisticSour;
        return (_this$_optimisticSour = this._optimisticSource) !== null && _this$_optimisticSour !== void 0 ? _this$_optimisticSour : this._recordSource;
      };
      _proto._getMutableRecordSource = function _getMutableRecordSource() {
        var _this$_optimisticSour2;
        return (_this$_optimisticSour2 = this._optimisticSource) !== null && _this$_optimisticSour2 !== void 0 ? _this$_optimisticSour2 : this._recordSource;
      };
      _proto.check = function check(operation, options) {
        var _options$handlers, _options$getSourceFor, _options$getTargetFor, _options$defaultActor;
        var selector = operation.root;
        var source = this._getMutableRecordSource();
        var globalInvalidationEpoch = this._globalInvalidationEpoch;
        var rootEntry = this._roots.get(operation.request.identifier);
        var operationLastWrittenAt = rootEntry != null ? rootEntry.epoch : null;
        if (globalInvalidationEpoch != null) {
          if (operationLastWrittenAt == null || operationLastWrittenAt <= globalInvalidationEpoch) {
            return {
              status: "stale"
            };
          }
        }
        var handlers2 = (_options$handlers = options === null || options === void 0 ? void 0 : options.handlers) !== null && _options$handlers !== void 0 ? _options$handlers : [];
        var getSourceForActor = (_options$getSourceFor = options === null || options === void 0 ? void 0 : options.getSourceForActor) !== null && _options$getSourceFor !== void 0 ? _options$getSourceFor : function(actorIdentifier) {
          assertInternalActorIndentifier(actorIdentifier);
          return source;
        };
        var getTargetForActor = (_options$getTargetFor = options === null || options === void 0 ? void 0 : options.getTargetForActor) !== null && _options$getTargetFor !== void 0 ? _options$getTargetFor : function(actorIdentifier) {
          assertInternalActorIndentifier(actorIdentifier);
          return source;
        };
        var operationAvailability = DataChecker.check(getSourceForActor, getTargetForActor, (_options$defaultActor = options === null || options === void 0 ? void 0 : options.defaultActorIdentifier) !== null && _options$defaultActor !== void 0 ? _options$defaultActor : INTERNAL_ACTOR_IDENTIFIER_DO_NOT_USE, selector, handlers2, this._operationLoader, this._getDataID, this._shouldProcessClientComponents);
        return getAvailabilityStatus(operationAvailability, operationLastWrittenAt, rootEntry === null || rootEntry === void 0 ? void 0 : rootEntry.fetchTime, this._queryCacheExpirationTime);
      };
      _proto.retain = function retain(operation) {
        var _this2 = this;
        var id2 = operation.request.identifier;
        var disposed = false;
        var dispose2 = function dispose3() {
          if (disposed) {
            return;
          }
          disposed = true;
          var rootEntry2 = _this2._roots.get(id2);
          if (rootEntry2 == null) {
            return;
          }
          rootEntry2.refCount--;
          if (rootEntry2.refCount === 0) {
            var _queryCacheExpirationTime = _this2._queryCacheExpirationTime;
            var rootEntryIsStale = rootEntry2.fetchTime != null && _queryCacheExpirationTime != null && rootEntry2.fetchTime <= Date.now() - _queryCacheExpirationTime;
            if (rootEntryIsStale) {
              _this2._roots["delete"](id2);
              _this2.scheduleGC();
            } else {
              _this2._releaseBuffer.push(id2);
              if (_this2._releaseBuffer.length > _this2._gcReleaseBufferSize) {
                var _id2 = _this2._releaseBuffer.shift();
                _this2._roots["delete"](_id2);
                _this2.scheduleGC();
              }
            }
          }
        };
        var rootEntry = this._roots.get(id2);
        if (rootEntry != null) {
          if (rootEntry.refCount === 0) {
            this._releaseBuffer = this._releaseBuffer.filter(function(_id2) {
              return _id2 !== id2;
            });
          }
          rootEntry.refCount += 1;
        } else {
          this._roots.set(id2, {
            operation,
            refCount: 1,
            epoch: null,
            fetchTime: null
          });
        }
        return {
          dispose: dispose2
        };
      };
      _proto.lookup = function lookup(selector) {
        var source = this.getSource();
        var snapshot = RelayReader.read(source, selector, this._resolverCache);
        if (true) {
          deepFreeze(snapshot);
        }
        return snapshot;
      };
      _proto.notify = function notify(sourceOperation, invalidateStore) {
        var _this3 = this;
        var log2 = this.__log;
        if (log2 != null) {
          log2({
            name: "store.notify.start",
            sourceOperation
          });
        }
        this._currentWriteEpoch++;
        if (invalidateStore === true) {
          this._globalInvalidationEpoch = this._currentWriteEpoch;
        }
        if (RelayFeatureFlags.ENABLE_RELAY_RESOLVERS) {
          this._resolverCache.invalidateDataIDs(this._updatedRecordIDs);
        }
        var source = this.getSource();
        var updatedOwners = [];
        this._storeSubscriptions.updateSubscriptions(source, this._updatedRecordIDs, updatedOwners, sourceOperation);
        this._invalidationSubscriptions.forEach(function(subscription2) {
          _this3._updateInvalidationSubscription(subscription2, invalidateStore === true);
        });
        if (log2 != null) {
          log2({
            name: "store.notify.complete",
            sourceOperation,
            updatedRecordIDs: this._updatedRecordIDs,
            invalidatedRecordIDs: this._invalidatedRecordIDs
          });
        }
        this._updatedRecordIDs.clear();
        this._invalidatedRecordIDs.clear();
        if (sourceOperation != null) {
          var id2 = sourceOperation.request.identifier;
          var rootEntry = this._roots.get(id2);
          if (rootEntry != null) {
            rootEntry.epoch = this._currentWriteEpoch;
            rootEntry.fetchTime = Date.now();
          } else if (sourceOperation.request.node.params.operationKind === "query" && this._gcReleaseBufferSize > 0 && this._releaseBuffer.length < this._gcReleaseBufferSize) {
            var temporaryRootEntry = {
              operation: sourceOperation,
              refCount: 0,
              epoch: this._currentWriteEpoch,
              fetchTime: Date.now()
            };
            this._releaseBuffer.push(id2);
            this._roots.set(id2, temporaryRootEntry);
          }
        }
        return updatedOwners;
      };
      _proto.publish = function publish(source, idsMarkedForInvalidation) {
        var target = this._getMutableRecordSource();
        updateTargetFromSource(
          target,
          source,
          // We increment the current epoch at the end of the set of updates,
          // in notify(). Here, we pass what will be the incremented value of
          // the epoch to use to write to invalidated records.
          this._currentWriteEpoch + 1,
          idsMarkedForInvalidation,
          this._updatedRecordIDs,
          this._invalidatedRecordIDs
        );
        var log2 = this.__log;
        if (log2 != null) {
          log2({
            name: "store.publish",
            source,
            optimistic: target === this._optimisticSource
          });
        }
      };
      _proto.subscribe = function subscribe(snapshot, callback) {
        return this._storeSubscriptions.subscribe(snapshot, callback);
      };
      _proto.holdGC = function holdGC() {
        var _this4 = this;
        if (this._gcRun) {
          this._gcRun = null;
          this._shouldScheduleGC = true;
        }
        this._gcHoldCounter++;
        var dispose2 = function dispose3() {
          if (_this4._gcHoldCounter > 0) {
            _this4._gcHoldCounter--;
            if (_this4._gcHoldCounter === 0 && _this4._shouldScheduleGC) {
              _this4.scheduleGC();
              _this4._shouldScheduleGC = false;
            }
          }
        };
        return {
          dispose: dispose2
        };
      };
      _proto.toJSON = function toJSON2() {
        return "RelayModernStore()";
      };
      _proto.getEpoch = function getEpoch() {
        return this._currentWriteEpoch;
      };
      _proto.__getUpdatedRecordIDs = function __getUpdatedRecordIDs() {
        return this._updatedRecordIDs;
      };
      _proto.lookupInvalidationState = function lookupInvalidationState(dataIDs) {
        var _this5 = this;
        var invalidations = /* @__PURE__ */ new Map();
        dataIDs.forEach(function(dataID) {
          var _RelayModernRecord$ge;
          var record = _this5.getSource().get(dataID);
          invalidations.set(dataID, (_RelayModernRecord$ge = RelayModernRecord.getInvalidationEpoch(record)) !== null && _RelayModernRecord$ge !== void 0 ? _RelayModernRecord$ge : null);
        });
        invalidations.set("global", this._globalInvalidationEpoch);
        return {
          dataIDs,
          invalidations
        };
      };
      _proto.checkInvalidationState = function checkInvalidationState(prevInvalidationState) {
        var latestInvalidationState = this.lookupInvalidationState(prevInvalidationState.dataIDs);
        var currentInvalidations = latestInvalidationState.invalidations;
        var prevInvalidations = prevInvalidationState.invalidations;
        if (currentInvalidations.get("global") !== prevInvalidations.get("global")) {
          return true;
        }
        var _iterator = (0, _createForOfIteratorHelper2["default"])(prevInvalidationState.dataIDs), _step;
        try {
          for (_iterator.s(); !(_step = _iterator.n()).done; ) {
            var dataID = _step.value;
            if (currentInvalidations.get(dataID) !== prevInvalidations.get(dataID)) {
              return true;
            }
          }
        } catch (err) {
          _iterator.e(err);
        } finally {
          _iterator.f();
        }
        return false;
      };
      _proto.subscribeToInvalidationState = function subscribeToInvalidationState(invalidationState, callback) {
        var _this6 = this;
        var subscription2 = {
          callback,
          invalidationState
        };
        var dispose2 = function dispose3() {
          _this6._invalidationSubscriptions["delete"](subscription2);
        };
        this._invalidationSubscriptions.add(subscription2);
        return {
          dispose: dispose2
        };
      };
      _proto._updateInvalidationSubscription = function _updateInvalidationSubscription(subscription2, invalidatedStore) {
        var _this7 = this;
        var callback = subscription2.callback, invalidationState = subscription2.invalidationState;
        var dataIDs = invalidationState.dataIDs;
        var isSubscribedToInvalidatedIDs = invalidatedStore || dataIDs.some(function(dataID) {
          return _this7._invalidatedRecordIDs.has(dataID);
        });
        if (!isSubscribedToInvalidatedIDs) {
          return;
        }
        callback();
      };
      _proto.snapshot = function snapshot() {
        !(this._optimisticSource == null) ? true ? invariant3(false, "RelayModernStore: Unexpected call to snapshot() while a previous snapshot exists.") : invariant3(false) : void 0;
        var log2 = this.__log;
        if (log2 != null) {
          log2({
            name: "store.snapshot"
          });
        }
        this._storeSubscriptions.snapshotSubscriptions(this.getSource());
        if (this._gcRun) {
          this._gcRun = null;
          this._shouldScheduleGC = true;
        }
        this._optimisticSource = RelayOptimisticRecordSource.create(this.getSource());
      };
      _proto.restore = function restore() {
        !(this._optimisticSource != null) ? true ? invariant3(false, "RelayModernStore: Unexpected call to restore(), expected a snapshot to exist (make sure to call snapshot()).") : invariant3(false) : void 0;
        var log2 = this.__log;
        if (log2 != null) {
          log2({
            name: "store.restore"
          });
        }
        this._optimisticSource = null;
        if (this._shouldScheduleGC) {
          this.scheduleGC();
        }
        this._storeSubscriptions.restoreSubscriptions();
      };
      _proto.scheduleGC = function scheduleGC() {
        if (this._gcHoldCounter > 0) {
          this._shouldScheduleGC = true;
          return;
        }
        if (this._gcRun) {
          return;
        }
        this._gcRun = this._collect();
        this._gcScheduler(this._gcStep);
      };
      _proto.__gc = function __gc() {
        if (this._optimisticSource != null) {
          return;
        }
        var gcRun = this._collect();
        while (!gcRun.next().done) {
        }
      };
      _proto._collect = function* _collect() {
        top:
          while (true) {
            var startEpoch = this._currentWriteEpoch;
            var references = /* @__PURE__ */ new Set();
            var _iterator2 = (0, _createForOfIteratorHelper2["default"])(this._roots.values()), _step2;
            try {
              for (_iterator2.s(); !(_step2 = _iterator2.n()).done; ) {
                var operation = _step2.value.operation;
                var selector = operation.root;
                RelayReferenceMarker.mark(this._recordSource, selector, references, this._operationLoader, this._shouldProcessClientComponents);
                yield;
                if (startEpoch !== this._currentWriteEpoch) {
                  continue top;
                }
              }
            } catch (err) {
              _iterator2.e(err);
            } finally {
              _iterator2.f();
            }
            var log2 = this.__log;
            if (log2 != null) {
              log2({
                name: "store.gc",
                references
              });
            }
            if (references.size === 0) {
              this._recordSource.clear();
            } else {
              var storeIDs = this._recordSource.getRecordIDs();
              for (var ii = 0; ii < storeIDs.length; ii++) {
                var dataID = storeIDs[ii];
                if (!references.has(dataID)) {
                  this._recordSource.remove(dataID);
                }
              }
            }
            return;
          }
      };
      return RelayModernStore2;
    }();
    function initializeRecordSource(target) {
      if (!target.has(ROOT_ID)) {
        var rootRecord = RelayModernRecord.create(ROOT_ID, ROOT_TYPE);
        target.set(ROOT_ID, rootRecord);
      }
    }
    function updateTargetFromSource(target, source, currentWriteEpoch, idsMarkedForInvalidation, updatedRecordIDs, invalidatedRecordIDs) {
      if (idsMarkedForInvalidation) {
        idsMarkedForInvalidation.forEach(function(dataID2) {
          var targetRecord2 = target.get(dataID2);
          var sourceRecord2 = source.get(dataID2);
          if (sourceRecord2 === null) {
            return;
          }
          var nextRecord2;
          if (targetRecord2 != null) {
            nextRecord2 = RelayModernRecord.clone(targetRecord2);
          } else {
            nextRecord2 = sourceRecord2 != null ? RelayModernRecord.clone(sourceRecord2) : null;
          }
          if (!nextRecord2) {
            return;
          }
          RelayModernRecord.setValue(nextRecord2, RelayStoreUtils.INVALIDATED_AT_KEY, currentWriteEpoch);
          invalidatedRecordIDs.add(dataID2);
          target.set(dataID2, nextRecord2);
        });
      }
      var dataIDs = source.getRecordIDs();
      for (var ii = 0; ii < dataIDs.length; ii++) {
        var dataID = dataIDs[ii];
        var sourceRecord = source.get(dataID);
        var targetRecord = target.get(dataID);
        if (true) {
          if (sourceRecord) {
            RelayModernRecord.freeze(sourceRecord);
          }
        }
        if (sourceRecord && targetRecord) {
          var nextRecord = RelayModernRecord.getType(targetRecord) === RelayStoreReactFlightUtils.REACT_FLIGHT_TYPE_NAME ? sourceRecord : RelayModernRecord.update(targetRecord, sourceRecord);
          if (nextRecord !== targetRecord) {
            if (true) {
              RelayModernRecord.freeze(nextRecord);
            }
            updatedRecordIDs.add(dataID);
            target.set(dataID, nextRecord);
          }
        } else if (sourceRecord === null) {
          target["delete"](dataID);
          if (targetRecord !== null) {
            updatedRecordIDs.add(dataID);
          }
        } else if (sourceRecord) {
          target.set(dataID, sourceRecord);
          updatedRecordIDs.add(dataID);
        }
      }
    }
    function getAvailabilityStatus(operationAvailability, operationLastWrittenAt, operationFetchTime, queryCacheExpirationTime) {
      var mostRecentlyInvalidatedAt = operationAvailability.mostRecentlyInvalidatedAt, status = operationAvailability.status;
      if (typeof mostRecentlyInvalidatedAt === "number") {
        if (operationLastWrittenAt == null || mostRecentlyInvalidatedAt > operationLastWrittenAt) {
          return {
            status: "stale"
          };
        }
      }
      if (status === "missing") {
        return {
          status: "missing"
        };
      }
      if (operationFetchTime != null && queryCacheExpirationTime != null) {
        var isStale = operationFetchTime <= Date.now() - queryCacheExpirationTime;
        if (isStale) {
          return {
            status: "stale"
          };
        }
      }
      return {
        status: "available",
        fetchTime: operationFetchTime !== null && operationFetchTime !== void 0 ? operationFetchTime : null
      };
    }
    module.exports = RelayModernStore;
  }
});

// node_modules/relay-runtime/lib/subscription/requestSubscription.js
var require_requestSubscription2 = __commonJS({
  "node_modules/relay-runtime/lib/subscription/requestSubscription.js"(exports, module) {
    "use strict";
    var RelayDeclarativeMutationConfig = require_RelayDeclarativeMutationConfig2();
    var _require = require_GraphQLTag2();
    var getRequest = _require.getRequest;
    var _require2 = require_RelayModernOperationDescriptor2();
    var createOperationDescriptor = _require2.createOperationDescriptor;
    var _require3 = require_RelayModernSelector2();
    var createReaderSelector = _require3.createReaderSelector;
    var warning2 = require_warning();
    function requestSubscription(environment, config2) {
      var subscription2 = getRequest(config2.subscription);
      if (subscription2.params.operationKind !== "subscription") {
        throw new Error("requestSubscription: Must use Subscription operation");
      }
      var configs = config2.configs, onCompleted = config2.onCompleted, onError = config2.onError, onNext = config2.onNext, variables = config2.variables, cacheConfig = config2.cacheConfig;
      var operation = createOperationDescriptor(subscription2, variables, cacheConfig);
      true ? warning2(!(config2.updater && configs), "requestSubscription: Expected only one of `updater` and `configs` to be provided") : void 0;
      var _ref18 = configs ? RelayDeclarativeMutationConfig.convert(
        configs,
        subscription2,
        null,
        config2.updater
      ) : config2, updater = _ref18.updater;
      var sub = environment.executeSubscription({
        operation,
        updater
      }).subscribe({
        next: function next2(responses) {
          if (onNext != null) {
            var selector = operation.fragment;
            var nextID2;
            if (Array.isArray(responses)) {
              var _responses$, _responses$$extension;
              nextID2 = (_responses$ = responses[0]) === null || _responses$ === void 0 ? void 0 : (_responses$$extension = _responses$.extensions) === null || _responses$$extension === void 0 ? void 0 : _responses$$extension.__relay_subscription_root_id;
            } else {
              var _responses$extensions;
              nextID2 = (_responses$extensions = responses.extensions) === null || _responses$extensions === void 0 ? void 0 : _responses$extensions.__relay_subscription_root_id;
            }
            if (typeof nextID2 === "string") {
              selector = createReaderSelector(selector.node, nextID2, selector.variables, selector.owner);
            }
            var data = environment.lookup(selector).data;
            onNext(data);
          }
        },
        error: onError,
        complete: onCompleted
      });
      return {
        dispose: sub.unsubscribe
      };
    }
    module.exports = requestSubscription;
  }
});

// node_modules/relay-runtime/lib/util/createPayloadFor3DField.js
var require_createPayloadFor3DField2 = __commonJS({
  "node_modules/relay-runtime/lib/util/createPayloadFor3DField.js"(exports, module) {
    "use strict";
    var _interopRequireDefault = require_interopRequireDefault()["default"];
    var _objectSpread210 = _interopRequireDefault(require_objectSpread2());
    var _require = require_RelayStoreUtils2();
    var getModuleComponentKey = _require.getModuleComponentKey;
    var getModuleOperationKey = _require.getModuleOperationKey;
    function createPayloadFor3DField(name2, operation, component, response) {
      var data = (0, _objectSpread210["default"])({}, response);
      data[getModuleComponentKey(name2)] = component;
      data[getModuleOperationKey(name2)] = operation;
      return data;
    }
    module.exports = createPayloadFor3DField;
  }
});

// node_modules/relay-runtime/lib/util/isEmptyObject.js
var require_isEmptyObject2 = __commonJS({
  "node_modules/relay-runtime/lib/util/isEmptyObject.js"(exports, module) {
    "use strict";
    var hasOwnProperty3 = Object.prototype.hasOwnProperty;
    function isEmptyObject2(obj) {
      for (var _key in obj) {
        if (hasOwnProperty3.call(obj, _key)) {
          return false;
        }
      }
      return true;
    }
    module.exports = isEmptyObject2;
  }
});

// node_modules/relay-runtime/lib/util/getFragmentIdentifier.js
var require_getFragmentIdentifier2 = __commonJS({
  "node_modules/relay-runtime/lib/util/getFragmentIdentifier.js"(exports, module) {
    "use strict";
    var _require = require_RelayModernSelector2();
    var getDataIDsFromFragment = _require.getDataIDsFromFragment;
    var getSelector = _require.getSelector;
    var getVariablesFromFragment = _require.getVariablesFromFragment;
    var isEmptyObject2 = require_isEmptyObject2();
    var RelayFeatureFlags = require_RelayFeatureFlags2();
    var stableCopy = require_stableCopy2();
    var _require2 = require_StringInterner2();
    var intern = _require2.intern;
    function getFragmentIdentifier(fragmentNode, fragmentRef) {
      var selector = getSelector(fragmentNode, fragmentRef);
      var fragmentOwnerIdentifier = selector == null ? "null" : selector.kind === "SingularReaderSelector" ? selector.owner.identifier : "[" + selector.selectors.map(function(sel) {
        return sel.owner.identifier;
      }).join(",") + "]";
      var fragmentVariables = getVariablesFromFragment(fragmentNode, fragmentRef);
      var dataIDs = getDataIDsFromFragment(fragmentNode, fragmentRef);
      if (RelayFeatureFlags.ENABLE_GETFRAGMENTIDENTIFIER_OPTIMIZATION) {
        var ids = typeof dataIDs === "undefined" ? "missing" : dataIDs == null ? "null" : Array.isArray(dataIDs) ? "[" + dataIDs.join(",") + "]" : dataIDs;
        ids = RelayFeatureFlags.STRING_INTERN_LEVEL <= 1 ? ids : intern(ids, RelayFeatureFlags.MAX_DATA_ID_LENGTH);
        return fragmentOwnerIdentifier + "/" + fragmentNode.name + "/" + (fragmentVariables == null || isEmptyObject2(fragmentVariables) ? "{}" : JSON.stringify(stableCopy(fragmentVariables))) + "/" + ids;
      } else {
        var _JSON$stringify;
        var _ids = (_JSON$stringify = JSON.stringify(dataIDs)) !== null && _JSON$stringify !== void 0 ? _JSON$stringify : "missing";
        _ids = RelayFeatureFlags.STRING_INTERN_LEVEL <= 1 ? _ids : intern(_ids, RelayFeatureFlags.MAX_DATA_ID_LENGTH);
        return fragmentOwnerIdentifier + "/" + fragmentNode.name + "/" + JSON.stringify(stableCopy(fragmentVariables)) + "/" + _ids;
      }
    }
    module.exports = getFragmentIdentifier;
  }
});

// node_modules/relay-runtime/lib/util/getRefetchMetadata.js
var require_getRefetchMetadata2 = __commonJS({
  "node_modules/relay-runtime/lib/util/getRefetchMetadata.js"(exports, module) {
    "use strict";
    var invariant3 = require_browser();
    function getRefetchMetadata(fragmentNode, componentDisplayName) {
      var _fragmentNode$metadat, _fragmentNode$metadat2;
      !(((_fragmentNode$metadat = fragmentNode.metadata) === null || _fragmentNode$metadat === void 0 ? void 0 : _fragmentNode$metadat.plural) !== true) ? true ? invariant3(false, "Relay: getRefetchMetadata(): Expected fragment `%s` not to be plural when using `%s`. Remove `@relay(plural: true)` from fragment `%s` in order to use it with `%s`.", fragmentNode.name, componentDisplayName, fragmentNode.name, componentDisplayName) : invariant3(false) : void 0;
      var refetchMetadata = (_fragmentNode$metadat2 = fragmentNode.metadata) === null || _fragmentNode$metadat2 === void 0 ? void 0 : _fragmentNode$metadat2.refetch;
      !(refetchMetadata != null) ? true ? invariant3(false, "Relay: getRefetchMetadata(): Expected fragment `%s` to be refetchable when using `%s`. Did you forget to add a @refetchable directive to the fragment?", componentDisplayName, fragmentNode.name) : invariant3(false) : void 0;
      var refetchableRequest = refetchMetadata.operation["default"] ? refetchMetadata.operation["default"] : refetchMetadata.operation;
      var fragmentRefPathInResponse = refetchMetadata.fragmentPathInResult;
      !(typeof refetchableRequest !== "string") ? true ? invariant3(false, "Relay: getRefetchMetadata(): Expected refetch query to be an operation and not a string when using `%s`. If you're seeing this, this is likely a bug in Relay.", componentDisplayName) : invariant3(false) : void 0;
      var identifierField = refetchMetadata.identifierField;
      !(identifierField == null || typeof identifierField === "string") ? true ? invariant3(false, "Relay: getRefetchMetadata(): Expected `identifierField` to be a string.") : invariant3(false) : void 0;
      return {
        fragmentRefPathInResponse,
        identifierField,
        refetchableRequest,
        refetchMetadata
      };
    }
    module.exports = getRefetchMetadata;
  }
});

// node_modules/relay-runtime/lib/util/getPaginationMetadata.js
var require_getPaginationMetadata2 = __commonJS({
  "node_modules/relay-runtime/lib/util/getPaginationMetadata.js"(exports, module) {
    "use strict";
    var getRefetchMetadata = require_getRefetchMetadata2();
    var invariant3 = require_browser();
    function getPaginationMetadata(fragmentNode, componentDisplayName) {
      var _fragmentNode$metadat, _fragmentNode$metadat2;
      var _getRefetchMetadata = getRefetchMetadata(fragmentNode, componentDisplayName), paginationRequest = _getRefetchMetadata.refetchableRequest, refetchMetadata = _getRefetchMetadata.refetchMetadata;
      var paginationMetadata = refetchMetadata.connection;
      !(paginationMetadata != null) ? true ? invariant3(false, "Relay: getPaginationMetadata(): Expected fragment `%s` to include a connection when using `%s`. Did you forget to add a @connection directive to the connection field in the fragment?", componentDisplayName, fragmentNode.name) : invariant3(false) : void 0;
      var connectionPathInFragmentData = paginationMetadata.path;
      var connectionMetadata = ((_fragmentNode$metadat = (_fragmentNode$metadat2 = fragmentNode.metadata) === null || _fragmentNode$metadat2 === void 0 ? void 0 : _fragmentNode$metadat2.connection) !== null && _fragmentNode$metadat !== void 0 ? _fragmentNode$metadat : [])[0];
      !(connectionMetadata != null) ? true ? invariant3(false, "Relay: getPaginationMetadata(): Expected fragment `%s` to include a connection when using `%s`. Did you forget to add a @connection directive to the connection field in the fragment?", componentDisplayName, fragmentNode.name) : invariant3(false) : void 0;
      var identifierField = refetchMetadata.identifierField;
      !(identifierField == null || typeof identifierField === "string") ? true ? invariant3(false, "Relay: getRefetchMetadata(): Expected `identifierField` to be a string.") : invariant3(false) : void 0;
      return {
        connectionPathInFragmentData,
        identifierField,
        paginationRequest,
        paginationMetadata,
        stream: connectionMetadata.stream === true
      };
    }
    module.exports = getPaginationMetadata;
  }
});

// node_modules/relay-runtime/lib/util/getPaginationVariables.js
var require_getPaginationVariables2 = __commonJS({
  "node_modules/relay-runtime/lib/util/getPaginationVariables.js"(exports, module) {
    "use strict";
    var _interopRequireDefault = require_interopRequireDefault()["default"];
    var _defineProperty210 = _interopRequireDefault(require_defineProperty());
    var _objectSpread42 = _interopRequireDefault(require_objectSpread2());
    var invariant3 = require_browser();
    var warning2 = require_warning();
    function getPaginationVariables(direction, count2, cursor3, baseVariables, extraVariables, paginationMetadata) {
      var _objectSpread310;
      var backwardMetadata = paginationMetadata.backward, forwardMetadata = paginationMetadata.forward;
      if (direction === "backward") {
        var _objectSpread210;
        !(backwardMetadata != null && backwardMetadata.count != null && backwardMetadata.cursor != null) ? true ? invariant3(false, "Relay: Expected backward pagination metadata to be available. If you're seeing this, this is likely a bug in Relay.") : invariant3(false) : void 0;
        true ? warning2(!extraVariables.hasOwnProperty(backwardMetadata.cursor), "Relay: `UNSTABLE_extraVariables` provided by caller should not contain cursor variable `%s`. This variable is automatically determined by Relay.", backwardMetadata.cursor) : void 0;
        true ? warning2(!extraVariables.hasOwnProperty(backwardMetadata.count), "Relay: `UNSTABLE_extraVariables` provided by caller should not contain count variable `%s`. This variable is automatically determined by Relay.", backwardMetadata.count) : void 0;
        var _paginationVariables = (0, _objectSpread42["default"])((0, _objectSpread42["default"])((0, _objectSpread42["default"])({}, baseVariables), extraVariables), {}, (_objectSpread210 = {}, (0, _defineProperty210["default"])(_objectSpread210, backwardMetadata.cursor, cursor3), (0, _defineProperty210["default"])(_objectSpread210, backwardMetadata.count, count2), _objectSpread210));
        if (forwardMetadata && forwardMetadata.cursor) {
          _paginationVariables[forwardMetadata.cursor] = null;
        }
        if (forwardMetadata && forwardMetadata.count) {
          _paginationVariables[forwardMetadata.count] = null;
        }
        return _paginationVariables;
      }
      !(forwardMetadata != null && forwardMetadata.count != null && forwardMetadata.cursor != null) ? true ? invariant3(false, "Relay: Expected forward pagination metadata to be available. If you're seeing this, this is likely a bug in Relay.") : invariant3(false) : void 0;
      true ? warning2(!extraVariables.hasOwnProperty(forwardMetadata.cursor), "Relay: `UNSTABLE_extraVariables` provided by caller should not contain cursor variable `%s`. This variable is automatically determined by Relay.", forwardMetadata.cursor) : void 0;
      true ? warning2(!extraVariables.hasOwnProperty(forwardMetadata.count), "Relay: `UNSTABLE_extraVariables` provided by caller should not contain count variable `%s`. This variable is automatically determined by Relay.", forwardMetadata.count) : void 0;
      var paginationVariables = (0, _objectSpread42["default"])((0, _objectSpread42["default"])((0, _objectSpread42["default"])({}, baseVariables), extraVariables), {}, (_objectSpread310 = {}, (0, _defineProperty210["default"])(_objectSpread310, forwardMetadata.cursor, cursor3), (0, _defineProperty210["default"])(_objectSpread310, forwardMetadata.count, count2), _objectSpread310));
      if (backwardMetadata && backwardMetadata.cursor) {
        paginationVariables[backwardMetadata.cursor] = null;
      }
      if (backwardMetadata && backwardMetadata.count) {
        paginationVariables[backwardMetadata.count] = null;
      }
      return paginationVariables;
    }
    module.exports = getPaginationVariables;
  }
});

// node_modules/relay-runtime/lib/util/getValueAtPath.js
var require_getValueAtPath2 = __commonJS({
  "node_modules/relay-runtime/lib/util/getValueAtPath.js"(exports, module) {
    "use strict";
    var _interopRequireDefault = require_interopRequireDefault()["default"];
    var _createForOfIteratorHelper2 = _interopRequireDefault(require_createForOfIteratorHelper());
    var invariant3 = require_browser();
    function getValueAtPath(data, path2) {
      var result = data;
      var _iterator = (0, _createForOfIteratorHelper2["default"])(path2), _step;
      try {
        for (_iterator.s(); !(_step = _iterator.n()).done; ) {
          var key = _step.value;
          if (result == null) {
            return null;
          }
          if (typeof key === "number") {
            !Array.isArray(result) ? true ? invariant3(false, "Relay: Expected an array when extracting value at path. If you're seeing this, this is likely a bug in Relay.") : invariant3(false) : void 0;
            result = result[key];
          } else {
            !(typeof result === "object" && !Array.isArray(result)) ? true ? invariant3(false, "Relay: Expected an object when extracting value at path. If you're seeing this, this is likely a bug in Relay.") : invariant3(false) : void 0;
            result = result[key];
          }
        }
      } catch (err) {
        _iterator.e(err);
      } finally {
        _iterator.f();
      }
      return result;
    }
    module.exports = getValueAtPath;
  }
});

// node_modules/relay-runtime/lib/util/RelayProfiler.js
var require_RelayProfiler2 = __commonJS({
  "node_modules/relay-runtime/lib/util/RelayProfiler.js"(exports, module) {
    "use strict";
    var profileHandlersByName = {};
    var defaultProfiler = {
      stop: function stop() {
      }
    };
    var RelayProfiler = {
      /**
       * Instruments profiling for arbitrarily asynchronous code by a name.
       *
       *   const timerProfiler = RelayProfiler.profile('timeout');
       *   setTimeout(function() {
       *     timerProfiler.stop();
       *   }, 1000);
       *
       *   RelayProfiler.attachProfileHandler('timeout', ...);
       *
       * Arbitrary state can also be passed into `profile` as a second argument. The
       * attached profile handlers will receive this as the second argument.
       */
      profile: function profile(name2, state) {
        var handlers2 = profileHandlersByName[name2];
        if (handlers2 && handlers2.length > 0) {
          var stopHandlers = [];
          for (var ii = handlers2.length - 1; ii >= 0; ii--) {
            var stopHandler = handlers2[ii](name2, state);
            stopHandlers.unshift(stopHandler);
          }
          return {
            stop: function stop(error) {
              stopHandlers.forEach(function(stopHandler2) {
                return stopHandler2(error);
              });
            }
          };
        }
        return defaultProfiler;
      },
      /**
       * Attaches a handler to profiles with the supplied name.
       */
      attachProfileHandler: function attachProfileHandler(name2, handler) {
        if (!profileHandlersByName.hasOwnProperty(name2)) {
          profileHandlersByName[name2] = [];
        }
        profileHandlersByName[name2].push(handler);
      },
      /**
       * Detaches a handler attached via `attachProfileHandler`.
       */
      detachProfileHandler: function detachProfileHandler(name2, handler) {
        if (profileHandlersByName.hasOwnProperty(name2)) {
          removeFromArray(profileHandlersByName[name2], handler);
        }
      }
    };
    function removeFromArray(array, element2) {
      var index = array.indexOf(element2);
      if (index !== -1) {
        array.splice(index, 1);
      }
    }
    module.exports = RelayProfiler;
  }
});

// node_modules/relay-runtime/lib/index.js
var require_lib3 = __commonJS({
  "node_modules/relay-runtime/lib/index.js"(exports, module) {
    "use strict";
    var ConnectionHandler = require_ConnectionHandler2();
    var ConnectionInterface = require_ConnectionInterface2();
    var MutationHandlers = require_MutationHandlers2();
    var RelayDefaultHandlerProvider = require_RelayDefaultHandlerProvider2();
    var applyOptimisticMutation = require_applyOptimisticMutation2();
    var commitLocalUpdate = require_commitLocalUpdate2();
    var commitMutation = require_commitMutation2();
    var RelayDeclarativeMutationConfig = require_RelayDeclarativeMutationConfig2();
    var RelayNetwork = require_RelayNetwork2();
    var RelayObservable = require_RelayObservable2();
    var RelayQueryResponseCache = require_RelayQueryResponseCache2();
    var fetchQuery7 = require_fetchQuery2();
    var fetchQuery_DEPRECATED = require_fetchQuery_DEPRECATED2();
    var fetchQueryInternal = require_fetchQueryInternal2();
    var GraphQLTag = require_GraphQLTag2();
    var PreloadableQueryRegistry = require_PreloadableQueryRegistry2();
    var _require = require_ClientID2();
    var generateClientID = _require.generateClientID;
    var generateUniqueClientID = _require.generateUniqueClientID;
    var isClientID = _require.isClientID;
    var createFragmentSpecResolver = require_createFragmentSpecResolver2();
    var createRelayContext = require_createRelayContext2();
    var isRelayModernEnvironment = require_isRelayModernEnvironment2();
    var readInlineData = require_readInlineData2();
    var RelayConcreteVariables = require_RelayConcreteVariables2();
    var RelayModernEnvironment = require_RelayModernEnvironment2();
    var RelayModernOperationDescriptor = require_RelayModernOperationDescriptor2();
    var RelayModernRecord = require_RelayModernRecord2();
    var RelayModernSelector = require_RelayModernSelector2();
    var RelayModernStore = require_RelayModernStore2();
    var RelayOperationTracker = require_RelayOperationTracker2();
    var RelayRecordSource = require_RelayRecordSource2();
    var RelayStoreUtils = require_RelayStoreUtils2();
    var ResolverFragments = require_ResolverFragments2();
    var ViewerPattern = require_ViewerPattern2();
    var requestSubscription = require_requestSubscription2();
    var createPayloadFor3DField = require_createPayloadFor3DField2();
    var deepFreeze = require_deepFreeze2();
    var getFragmentIdentifier = require_getFragmentIdentifier2();
    var getPaginationMetadata = require_getPaginationMetadata2();
    var getPaginationVariables = require_getPaginationVariables2();
    var getPendingOperationsForFragment = require_getPendingOperationsForFragment2();
    var getRefetchMetadata = require_getRefetchMetadata2();
    var getRelayHandleKey = require_getRelayHandleKey2();
    var getRequestIdentifier = require_getRequestIdentifier2();
    var getValueAtPath = require_getValueAtPath2();
    var handlePotentialSnapshotErrors = require_handlePotentialSnapshotErrors2();
    var isPromise = require_isPromise2();
    var isScalarAndEqual = require_isScalarAndEqual2();
    var recycleNodesInto = require_recycleNodesInto2();
    var RelayConcreteNode = require_RelayConcreteNode2();
    var RelayDefaultHandleKey = require_RelayDefaultHandleKey2();
    var RelayError = require_RelayError2();
    var RelayFeatureFlags = require_RelayFeatureFlags2();
    var RelayProfiler = require_RelayProfiler2();
    var RelayReplaySubject = require_RelayReplaySubject2();
    var stableCopy = require_stableCopy2();
    var withProvidedVariables = require_withProvidedVariables2();
    if (true) {
      mapStr = typeof Map !== "function" ? "Map" : null;
      setStr = typeof Set !== "function" ? "Set" : null;
      promiseStr = typeof Promise !== "function" ? "Promise" : null;
      objStr = typeof Object.assign !== "function" ? "Object.assign" : null;
      if (mapStr || setStr || promiseStr || objStr) {
        throw new Error("relay-runtime requires ".concat([mapStr, setStr, promiseStr, objStr].filter(Boolean).join(", and "), " to exist. ") + "Use a polyfill to provide these for older browsers.");
      }
    }
    var mapStr;
    var setStr;
    var promiseStr;
    var objStr;
    module.exports = {
      // Core API
      Environment: RelayModernEnvironment,
      Network: RelayNetwork,
      Observable: RelayObservable,
      QueryResponseCache: RelayQueryResponseCache,
      RecordSource: RelayRecordSource,
      Record: RelayModernRecord,
      ReplaySubject: RelayReplaySubject,
      Store: RelayModernStore,
      areEqualSelectors: RelayModernSelector.areEqualSelectors,
      createFragmentSpecResolver,
      createNormalizationSelector: RelayModernSelector.createNormalizationSelector,
      createOperationDescriptor: RelayModernOperationDescriptor.createOperationDescriptor,
      createReaderSelector: RelayModernSelector.createReaderSelector,
      createRequestDescriptor: RelayModernOperationDescriptor.createRequestDescriptor,
      getDataIDsFromFragment: RelayModernSelector.getDataIDsFromFragment,
      getDataIDsFromObject: RelayModernSelector.getDataIDsFromObject,
      getNode: GraphQLTag.getNode,
      getFragment: GraphQLTag.getFragment,
      getInlineDataFragment: GraphQLTag.getInlineDataFragment,
      getModuleComponentKey: RelayStoreUtils.getModuleComponentKey,
      getModuleOperationKey: RelayStoreUtils.getModuleOperationKey,
      getPaginationFragment: GraphQLTag.getPaginationFragment,
      getPluralSelector: RelayModernSelector.getPluralSelector,
      getRefetchableFragment: GraphQLTag.getRefetchableFragment,
      getRequest: GraphQLTag.getRequest,
      getRequestIdentifier,
      getSelector: RelayModernSelector.getSelector,
      getSelectorsFromObject: RelayModernSelector.getSelectorsFromObject,
      getSingularSelector: RelayModernSelector.getSingularSelector,
      getStorageKey: RelayStoreUtils.getStorageKey,
      getVariablesFromFragment: RelayModernSelector.getVariablesFromFragment,
      getVariablesFromObject: RelayModernSelector.getVariablesFromObject,
      getVariablesFromPluralFragment: RelayModernSelector.getVariablesFromPluralFragment,
      getVariablesFromSingularFragment: RelayModernSelector.getVariablesFromSingularFragment,
      handlePotentialSnapshotErrors,
      graphql: GraphQLTag.graphql,
      isFragment: GraphQLTag.isFragment,
      isInlineDataFragment: GraphQLTag.isInlineDataFragment,
      isRequest: GraphQLTag.isRequest,
      readInlineData,
      // Declarative mutation API
      MutationTypes: RelayDeclarativeMutationConfig.MutationTypes,
      RangeOperations: RelayDeclarativeMutationConfig.RangeOperations,
      // Extensions
      DefaultHandlerProvider: RelayDefaultHandlerProvider,
      ConnectionHandler,
      MutationHandlers,
      VIEWER_ID: ViewerPattern.VIEWER_ID,
      VIEWER_TYPE: ViewerPattern.VIEWER_TYPE,
      // Helpers (can be implemented via the above API)
      applyOptimisticMutation,
      commitLocalUpdate,
      commitMutation,
      fetchQuery: fetchQuery7,
      fetchQuery_DEPRECATED,
      isRelayModernEnvironment,
      requestSubscription,
      // Configuration interface for legacy or special uses
      ConnectionInterface,
      // Utilities
      PreloadableQueryRegistry,
      RelayProfiler,
      createPayloadFor3DField,
      // INTERNAL-ONLY: These exports might be removed at any point.
      RelayConcreteNode,
      RelayError,
      RelayFeatureFlags,
      DEFAULT_HANDLE_KEY: RelayDefaultHandleKey.DEFAULT_HANDLE_KEY,
      FRAGMENTS_KEY: RelayStoreUtils.FRAGMENTS_KEY,
      FRAGMENT_OWNER_KEY: RelayStoreUtils.FRAGMENT_OWNER_KEY,
      ID_KEY: RelayStoreUtils.ID_KEY,
      REF_KEY: RelayStoreUtils.REF_KEY,
      REFS_KEY: RelayStoreUtils.REFS_KEY,
      ROOT_ID: RelayStoreUtils.ROOT_ID,
      ROOT_TYPE: RelayStoreUtils.ROOT_TYPE,
      TYPENAME_KEY: RelayStoreUtils.TYPENAME_KEY,
      deepFreeze,
      generateClientID,
      generateUniqueClientID,
      getRelayHandleKey,
      isClientID,
      isPromise,
      isScalarAndEqual,
      recycleNodesInto,
      stableCopy,
      getFragmentIdentifier,
      getRefetchMetadata,
      getPaginationMetadata,
      getPaginationVariables,
      getPendingOperationsForFragment,
      getValueAtPath,
      __internal: {
        ResolverFragments,
        OperationTracker: RelayOperationTracker,
        createRelayContext,
        getOperationVariables: RelayConcreteVariables.getOperationVariables,
        fetchQuery: fetchQueryInternal.fetchQuery,
        fetchQueryDeduped: fetchQueryInternal.fetchQueryDeduped,
        getPromiseForActiveRequest: fetchQueryInternal.getPromiseForActiveRequest,
        getObservableForActiveRequest: fetchQueryInternal.getObservableForActiveRequest,
        withProvidedVariables
      }
    };
  }
});

// node_modules/relay-runtime/index.js
var require_relay_runtime2 = __commonJS({
  "node_modules/relay-runtime/index.js"(exports, module) {
    module.exports = require_lib3();
  }
});

// src/pages/tracing/__generated__/SpansTableSpansQuery.graphql.ts
var SpansTableSpansQuery_graphql_exports = {};
__export(SpansTableSpansQuery_graphql_exports, {
  default: () => SpansTableSpansQuery_graphql_default
});
var node7, SpansTableSpansQuery_graphql_default;
var init_SpansTableSpansQuery_graphql = __esm({
  "src/pages/tracing/__generated__/SpansTableSpansQuery.graphql.ts"() {
    "use strict";
    node7 = function() {
      var v0 = [
        {
          "defaultValue": null,
          "kind": "LocalArgument",
          "name": "after"
        },
        {
          "defaultValue": null,
          "kind": "LocalArgument",
          "name": "filterCondition"
        },
        {
          "defaultValue": 100,
          "kind": "LocalArgument",
          "name": "first"
        },
        {
          "defaultValue": {
            "col": "startTime",
            "dir": "desc"
          },
          "kind": "LocalArgument",
          "name": "sort"
        }
      ], v12 = [
        {
          "kind": "Variable",
          "name": "after",
          "variableName": "after"
        },
        {
          "kind": "Variable",
          "name": "filterCondition",
          "variableName": "filterCondition"
        },
        {
          "kind": "Variable",
          "name": "first",
          "variableName": "first"
        },
        {
          "kind": "Variable",
          "name": "sort",
          "variableName": "sort"
        }
      ], v22 = {
        "alias": null,
        "args": null,
        "kind": "ScalarField",
        "name": "name",
        "storageKey": null
      }, v32 = [
        {
          "alias": null,
          "args": null,
          "kind": "ScalarField",
          "name": "value",
          "storageKey": null
        },
        {
          "alias": null,
          "args": null,
          "kind": "ScalarField",
          "name": "mimeType",
          "storageKey": null
        }
      ];
      return {
        "fragment": {
          "argumentDefinitions": v0,
          "kind": "Fragment",
          "metadata": null,
          "name": "SpansTableSpansQuery",
          "selections": [
            {
              "args": v12,
              "kind": "FragmentSpread",
              "name": "SpansTable_spans"
            }
          ],
          "type": "Query",
          "abstractKey": null
        },
        "kind": "Request",
        "operation": {
          "argumentDefinitions": v0,
          "kind": "Operation",
          "name": "SpansTableSpansQuery",
          "selections": [
            {
              "alias": null,
              "args": null,
              "kind": "ScalarField",
              "name": "spanEvaluationNames",
              "storageKey": null
            },
            {
              "alias": null,
              "args": v12,
              "concreteType": "SpanConnection",
              "kind": "LinkedField",
              "name": "spans",
              "plural": false,
              "selections": [
                {
                  "alias": null,
                  "args": null,
                  "concreteType": "SpanEdge",
                  "kind": "LinkedField",
                  "name": "edges",
                  "plural": true,
                  "selections": [
                    {
                      "alias": "span",
                      "args": null,
                      "concreteType": "Span",
                      "kind": "LinkedField",
                      "name": "node",
                      "plural": false,
                      "selections": [
                        {
                          "alias": null,
                          "args": null,
                          "kind": "ScalarField",
                          "name": "spanKind",
                          "storageKey": null
                        },
                        v22,
                        {
                          "alias": null,
                          "args": null,
                          "kind": "ScalarField",
                          "name": "statusCode",
                          "storageKey": null
                        },
                        {
                          "alias": null,
                          "args": null,
                          "kind": "ScalarField",
                          "name": "startTime",
                          "storageKey": null
                        },
                        {
                          "alias": null,
                          "args": null,
                          "kind": "ScalarField",
                          "name": "latencyMs",
                          "storageKey": null
                        },
                        {
                          "alias": null,
                          "args": null,
                          "kind": "ScalarField",
                          "name": "tokenCountTotal",
                          "storageKey": null
                        },
                        {
                          "alias": null,
                          "args": null,
                          "kind": "ScalarField",
                          "name": "tokenCountPrompt",
                          "storageKey": null
                        },
                        {
                          "alias": null,
                          "args": null,
                          "kind": "ScalarField",
                          "name": "tokenCountCompletion",
                          "storageKey": null
                        },
                        {
                          "alias": null,
                          "args": null,
                          "concreteType": "SpanContext",
                          "kind": "LinkedField",
                          "name": "context",
                          "plural": false,
                          "selections": [
                            {
                              "alias": null,
                              "args": null,
                              "kind": "ScalarField",
                              "name": "spanId",
                              "storageKey": null
                            },
                            {
                              "alias": null,
                              "args": null,
                              "kind": "ScalarField",
                              "name": "traceId",
                              "storageKey": null
                            }
                          ],
                          "storageKey": null
                        },
                        {
                          "alias": null,
                          "args": null,
                          "concreteType": "SpanIOValue",
                          "kind": "LinkedField",
                          "name": "input",
                          "plural": false,
                          "selections": v32,
                          "storageKey": null
                        },
                        {
                          "alias": null,
                          "args": null,
                          "concreteType": "SpanIOValue",
                          "kind": "LinkedField",
                          "name": "output",
                          "plural": false,
                          "selections": v32,
                          "storageKey": null
                        },
                        {
                          "alias": null,
                          "args": null,
                          "concreteType": "SpanEvaluation",
                          "kind": "LinkedField",
                          "name": "spanEvaluations",
                          "plural": true,
                          "selections": [
                            v22,
                            {
                              "alias": null,
                              "args": null,
                              "kind": "ScalarField",
                              "name": "label",
                              "storageKey": null
                            },
                            {
                              "alias": null,
                              "args": null,
                              "kind": "ScalarField",
                              "name": "score",
                              "storageKey": null
                            }
                          ],
                          "storageKey": null
                        },
                        {
                          "alias": null,
                          "args": null,
                          "concreteType": "DocumentRetrievalMetrics",
                          "kind": "LinkedField",
                          "name": "documentRetrievalMetrics",
                          "plural": true,
                          "selections": [
                            {
                              "alias": null,
                              "args": null,
                              "kind": "ScalarField",
                              "name": "evaluationName",
                              "storageKey": null
                            },
                            {
                              "alias": null,
                              "args": null,
                              "kind": "ScalarField",
                              "name": "ndcg",
                              "storageKey": null
                            },
                            {
                              "alias": null,
                              "args": null,
                              "kind": "ScalarField",
                              "name": "precision",
                              "storageKey": null
                            },
                            {
                              "alias": null,
                              "args": null,
                              "kind": "ScalarField",
                              "name": "hit",
                              "storageKey": null
                            }
                          ],
                          "storageKey": null
                        }
                      ],
                      "storageKey": null
                    },
                    {
                      "alias": null,
                      "args": null,
                      "kind": "ScalarField",
                      "name": "cursor",
                      "storageKey": null
                    },
                    {
                      "alias": null,
                      "args": null,
                      "concreteType": "Span",
                      "kind": "LinkedField",
                      "name": "node",
                      "plural": false,
                      "selections": [
                        {
                          "alias": null,
                          "args": null,
                          "kind": "ScalarField",
                          "name": "__typename",
                          "storageKey": null
                        }
                      ],
                      "storageKey": null
                    }
                  ],
                  "storageKey": null
                },
                {
                  "alias": null,
                  "args": null,
                  "concreteType": "PageInfo",
                  "kind": "LinkedField",
                  "name": "pageInfo",
                  "plural": false,
                  "selections": [
                    {
                      "alias": null,
                      "args": null,
                      "kind": "ScalarField",
                      "name": "endCursor",
                      "storageKey": null
                    },
                    {
                      "alias": null,
                      "args": null,
                      "kind": "ScalarField",
                      "name": "hasNextPage",
                      "storageKey": null
                    }
                  ],
                  "storageKey": null
                }
              ],
              "storageKey": null
            },
            {
              "alias": null,
              "args": v12,
              "filters": [
                "sort",
                "filterCondition"
              ],
              "handle": "connection",
              "key": "SpansTable_spans",
              "kind": "LinkedHandle",
              "name": "spans"
            }
          ]
        },
        "params": {
          "cacheID": "7f0c0725ede73b9b9a0b699c79366f99",
          "id": null,
          "metadata": {},
          "name": "SpansTableSpansQuery",
          "operationKind": "query",
          "text": "query SpansTableSpansQuery(\n  $after: String = null\n  $filterCondition: String = null\n  $first: Int = 100\n  $sort: SpanSort = {col: startTime, dir: desc}\n) {\n  ...SpansTable_spans_1XEuU\n}\n\nfragment SpanColumnSelector_evaluations on Query {\n  spanEvaluationNames\n}\n\nfragment SpansTable_spans_1XEuU on Query {\n  ...SpanColumnSelector_evaluations\n  spans(first: $first, after: $after, sort: $sort, filterCondition: $filterCondition) {\n    edges {\n      span: node {\n        spanKind\n        name\n        statusCode\n        startTime\n        latencyMs\n        tokenCountTotal\n        tokenCountPrompt\n        tokenCountCompletion\n        context {\n          spanId\n          traceId\n        }\n        input {\n          value\n          mimeType\n        }\n        output {\n          value\n          mimeType\n        }\n        spanEvaluations {\n          name\n          label\n          score\n        }\n        documentRetrievalMetrics {\n          evaluationName\n          ndcg\n          precision\n          hit\n        }\n      }\n      cursor\n      node {\n        __typename\n      }\n    }\n    pageInfo {\n      endCursor\n      hasNextPage\n    }\n  }\n}\n"
        }
      };
    }();
    node7.hash = "8d3fa17cdca050881d99ff36537ac42b";
    SpansTableSpansQuery_graphql_default = node7;
  }
});

// src/pages/tracing/__generated__/StreamToggleRefetchQuery.graphql.ts
var StreamToggleRefetchQuery_graphql_exports = {};
__export(StreamToggleRefetchQuery_graphql_exports, {
  default: () => StreamToggleRefetchQuery_graphql_default
});
var node11, StreamToggleRefetchQuery_graphql_default;
var init_StreamToggleRefetchQuery_graphql = __esm({
  "src/pages/tracing/__generated__/StreamToggleRefetchQuery.graphql.ts"() {
    "use strict";
    node11 = {
      "fragment": {
        "argumentDefinitions": [],
        "kind": "Fragment",
        "metadata": null,
        "name": "StreamToggleRefetchQuery",
        "selections": [
          {
            "args": null,
            "kind": "FragmentSpread",
            "name": "StreamToggle_data"
          }
        ],
        "type": "Query",
        "abstractKey": null
      },
      "kind": "Request",
      "operation": {
        "argumentDefinitions": [],
        "kind": "Operation",
        "name": "StreamToggleRefetchQuery",
        "selections": [
          {
            "alias": null,
            "args": null,
            "kind": "ScalarField",
            "name": "streamingLastUpdatedAt",
            "storageKey": null
          }
        ]
      },
      "params": {
        "cacheID": "5572910398dea8c13b54fae773bdef69",
        "id": null,
        "metadata": {},
        "name": "StreamToggleRefetchQuery",
        "operationKind": "query",
        "text": "query StreamToggleRefetchQuery {\n  ...StreamToggle_data\n}\n\nfragment StreamToggle_data on Query {\n  streamingLastUpdatedAt\n}\n"
      }
    };
    node11.hash = "5a87fc2da6f4964259d4eaaaed28e26a";
    StreamToggleRefetchQuery_graphql_default = node11;
  }
});

// src/pages/tracing/__generated__/TracesTableQuery.graphql.ts
var TracesTableQuery_graphql_exports = {};
__export(TracesTableQuery_graphql_exports, {
  default: () => TracesTableQuery_graphql_default
});
var node13, TracesTableQuery_graphql_default;
var init_TracesTableQuery_graphql = __esm({
  "src/pages/tracing/__generated__/TracesTableQuery.graphql.ts"() {
    "use strict";
    node13 = function() {
      var v0 = [
        {
          "defaultValue": null,
          "kind": "LocalArgument",
          "name": "after"
        },
        {
          "defaultValue": null,
          "kind": "LocalArgument",
          "name": "filterCondition"
        },
        {
          "defaultValue": 100,
          "kind": "LocalArgument",
          "name": "first"
        },
        {
          "defaultValue": {
            "col": "startTime",
            "dir": "desc"
          },
          "kind": "LocalArgument",
          "name": "sort"
        }
      ], v12 = {
        "kind": "Variable",
        "name": "after",
        "variableName": "after"
      }, v22 = {
        "kind": "Variable",
        "name": "filterCondition",
        "variableName": "filterCondition"
      }, v32 = {
        "kind": "Variable",
        "name": "first",
        "variableName": "first"
      }, v4 = {
        "kind": "Variable",
        "name": "sort",
        "variableName": "sort"
      }, v5 = [
        v12,
        v22,
        v32,
        {
          "kind": "Literal",
          "name": "rootSpansOnly",
          "value": true
        },
        v4
      ], v6 = {
        "alias": null,
        "args": null,
        "kind": "ScalarField",
        "name": "spanKind",
        "storageKey": null
      }, v7 = {
        "alias": null,
        "args": null,
        "kind": "ScalarField",
        "name": "name",
        "storageKey": null
      }, v8 = {
        "alias": "statusCode",
        "args": null,
        "kind": "ScalarField",
        "name": "propagatedStatusCode",
        "storageKey": null
      }, v9 = {
        "alias": null,
        "args": null,
        "kind": "ScalarField",
        "name": "startTime",
        "storageKey": null
      }, v10 = {
        "alias": null,
        "args": null,
        "kind": "ScalarField",
        "name": "latencyMs",
        "storageKey": null
      }, v11 = {
        "alias": null,
        "args": null,
        "kind": "ScalarField",
        "name": "parentId",
        "storageKey": null
      }, v122 = [
        {
          "alias": null,
          "args": null,
          "kind": "ScalarField",
          "name": "value",
          "storageKey": null
        }
      ], v13 = {
        "alias": null,
        "args": null,
        "concreteType": "SpanIOValue",
        "kind": "LinkedField",
        "name": "input",
        "plural": false,
        "selections": v122,
        "storageKey": null
      }, v14 = {
        "alias": null,
        "args": null,
        "concreteType": "SpanIOValue",
        "kind": "LinkedField",
        "name": "output",
        "plural": false,
        "selections": v122,
        "storageKey": null
      }, v15 = {
        "alias": null,
        "args": null,
        "concreteType": "SpanContext",
        "kind": "LinkedField",
        "name": "context",
        "plural": false,
        "selections": [
          {
            "alias": null,
            "args": null,
            "kind": "ScalarField",
            "name": "spanId",
            "storageKey": null
          },
          {
            "alias": null,
            "args": null,
            "kind": "ScalarField",
            "name": "traceId",
            "storageKey": null
          }
        ],
        "storageKey": null
      }, v16 = {
        "alias": null,
        "args": null,
        "concreteType": "SpanEvaluation",
        "kind": "LinkedField",
        "name": "spanEvaluations",
        "plural": true,
        "selections": [
          v7,
          {
            "alias": null,
            "args": null,
            "kind": "ScalarField",
            "name": "label",
            "storageKey": null
          },
          {
            "alias": null,
            "args": null,
            "kind": "ScalarField",
            "name": "score",
            "storageKey": null
          }
        ],
        "storageKey": null
      }, v17 = {
        "alias": null,
        "args": null,
        "concreteType": "DocumentRetrievalMetrics",
        "kind": "LinkedField",
        "name": "documentRetrievalMetrics",
        "plural": true,
        "selections": [
          {
            "alias": null,
            "args": null,
            "kind": "ScalarField",
            "name": "evaluationName",
            "storageKey": null
          },
          {
            "alias": null,
            "args": null,
            "kind": "ScalarField",
            "name": "ndcg",
            "storageKey": null
          },
          {
            "alias": null,
            "args": null,
            "kind": "ScalarField",
            "name": "precision",
            "storageKey": null
          },
          {
            "alias": null,
            "args": null,
            "kind": "ScalarField",
            "name": "hit",
            "storageKey": null
          }
        ],
        "storageKey": null
      };
      return {
        "fragment": {
          "argumentDefinitions": v0,
          "kind": "Fragment",
          "metadata": null,
          "name": "TracesTableQuery",
          "selections": [
            {
              "args": [
                v12,
                v22,
                v32,
                v4
              ],
              "kind": "FragmentSpread",
              "name": "TracesTable_spans"
            }
          ],
          "type": "Query",
          "abstractKey": null
        },
        "kind": "Request",
        "operation": {
          "argumentDefinitions": v0,
          "kind": "Operation",
          "name": "TracesTableQuery",
          "selections": [
            {
              "alias": null,
              "args": null,
              "kind": "ScalarField",
              "name": "spanEvaluationNames",
              "storageKey": null
            },
            {
              "alias": "rootSpans",
              "args": v5,
              "concreteType": "SpanConnection",
              "kind": "LinkedField",
              "name": "spans",
              "plural": false,
              "selections": [
                {
                  "alias": null,
                  "args": null,
                  "concreteType": "SpanEdge",
                  "kind": "LinkedField",
                  "name": "edges",
                  "plural": true,
                  "selections": [
                    {
                      "alias": "rootSpan",
                      "args": null,
                      "concreteType": "Span",
                      "kind": "LinkedField",
                      "name": "node",
                      "plural": false,
                      "selections": [
                        v6,
                        v7,
                        v8,
                        v9,
                        v10,
                        {
                          "alias": "tokenCountTotal",
                          "args": null,
                          "kind": "ScalarField",
                          "name": "cumulativeTokenCountTotal",
                          "storageKey": null
                        },
                        {
                          "alias": "tokenCountPrompt",
                          "args": null,
                          "kind": "ScalarField",
                          "name": "cumulativeTokenCountPrompt",
                          "storageKey": null
                        },
                        {
                          "alias": "tokenCountCompletion",
                          "args": null,
                          "kind": "ScalarField",
                          "name": "cumulativeTokenCountCompletion",
                          "storageKey": null
                        },
                        v11,
                        v13,
                        v14,
                        v15,
                        v16,
                        v17,
                        {
                          "alias": null,
                          "args": null,
                          "concreteType": "Span",
                          "kind": "LinkedField",
                          "name": "descendants",
                          "plural": true,
                          "selections": [
                            v6,
                            v7,
                            v8,
                            v9,
                            v10,
                            v11,
                            {
                              "alias": null,
                              "args": null,
                              "kind": "ScalarField",
                              "name": "tokenCountTotal",
                              "storageKey": null
                            },
                            {
                              "alias": null,
                              "args": null,
                              "kind": "ScalarField",
                              "name": "tokenCountPrompt",
                              "storageKey": null
                            },
                            {
                              "alias": null,
                              "args": null,
                              "kind": "ScalarField",
                              "name": "tokenCountCompletion",
                              "storageKey": null
                            },
                            v13,
                            v14,
                            v15,
                            v16,
                            v17
                          ],
                          "storageKey": null
                        }
                      ],
                      "storageKey": null
                    },
                    {
                      "alias": null,
                      "args": null,
                      "kind": "ScalarField",
                      "name": "cursor",
                      "storageKey": null
                    },
                    {
                      "alias": null,
                      "args": null,
                      "concreteType": "Span",
                      "kind": "LinkedField",
                      "name": "node",
                      "plural": false,
                      "selections": [
                        {
                          "alias": null,
                          "args": null,
                          "kind": "ScalarField",
                          "name": "__typename",
                          "storageKey": null
                        }
                      ],
                      "storageKey": null
                    }
                  ],
                  "storageKey": null
                },
                {
                  "alias": null,
                  "args": null,
                  "concreteType": "PageInfo",
                  "kind": "LinkedField",
                  "name": "pageInfo",
                  "plural": false,
                  "selections": [
                    {
                      "alias": null,
                      "args": null,
                      "kind": "ScalarField",
                      "name": "endCursor",
                      "storageKey": null
                    },
                    {
                      "alias": null,
                      "args": null,
                      "kind": "ScalarField",
                      "name": "hasNextPage",
                      "storageKey": null
                    }
                  ],
                  "storageKey": null
                }
              ],
              "storageKey": null
            },
            {
              "alias": "rootSpans",
              "args": v5,
              "filters": [
                "sort",
                "rootSpansOnly",
                "filterCondition"
              ],
              "handle": "connection",
              "key": "TracesTable_rootSpans",
              "kind": "LinkedHandle",
              "name": "spans"
            }
          ]
        },
        "params": {
          "cacheID": "5b820fa418f2a0b91ab03621c9a0f963",
          "id": null,
          "metadata": {},
          "name": "TracesTableQuery",
          "operationKind": "query",
          "text": "query TracesTableQuery(\n  $after: String = null\n  $filterCondition: String = null\n  $first: Int = 100\n  $sort: SpanSort = {col: startTime, dir: desc}\n) {\n  ...TracesTable_spans_1XEuU\n}\n\nfragment SpanColumnSelector_evaluations on Query {\n  spanEvaluationNames\n}\n\nfragment TracesTable_spans_1XEuU on Query {\n  ...SpanColumnSelector_evaluations\n  rootSpans: spans(first: $first, after: $after, sort: $sort, rootSpansOnly: true, filterCondition: $filterCondition) {\n    edges {\n      rootSpan: node {\n        spanKind\n        name\n        statusCode: propagatedStatusCode\n        startTime\n        latencyMs\n        tokenCountTotal: cumulativeTokenCountTotal\n        tokenCountPrompt: cumulativeTokenCountPrompt\n        tokenCountCompletion: cumulativeTokenCountCompletion\n        parentId\n        input {\n          value\n        }\n        output {\n          value\n        }\n        context {\n          spanId\n          traceId\n        }\n        spanEvaluations {\n          name\n          label\n          score\n        }\n        documentRetrievalMetrics {\n          evaluationName\n          ndcg\n          precision\n          hit\n        }\n        descendants {\n          spanKind\n          name\n          statusCode: propagatedStatusCode\n          startTime\n          latencyMs\n          parentId\n          tokenCountTotal\n          tokenCountPrompt\n          tokenCountCompletion\n          input {\n            value\n          }\n          output {\n            value\n          }\n          context {\n            spanId\n            traceId\n          }\n          spanEvaluations {\n            name\n            label\n            score\n          }\n          documentRetrievalMetrics {\n            evaluationName\n            ndcg\n            precision\n            hit\n          }\n        }\n      }\n      cursor\n      node {\n        __typename\n      }\n    }\n    pageInfo {\n      endCursor\n      hasNextPage\n    }\n  }\n}\n"
        }
      };
    }();
    node13.hash = "0d9c0b6da977229d4c340f577a02c55d";
    TracesTableQuery_graphql_default = node13;
  }
});

// src/pages/tracing/__generated__/TracingHomePageHeaderQuery.graphql.ts
var TracingHomePageHeaderQuery_graphql_exports = {};
__export(TracingHomePageHeaderQuery_graphql_exports, {
  default: () => TracingHomePageHeaderQuery_graphql_default
});
var node15, TracingHomePageHeaderQuery_graphql_default;
var init_TracingHomePageHeaderQuery_graphql = __esm({
  "src/pages/tracing/__generated__/TracingHomePageHeaderQuery.graphql.ts"() {
    "use strict";
    node15 = {
      "fragment": {
        "argumentDefinitions": [],
        "kind": "Fragment",
        "metadata": null,
        "name": "TracingHomePageHeaderQuery",
        "selections": [
          {
            "args": null,
            "kind": "FragmentSpread",
            "name": "TracingHomePageHeader_stats"
          }
        ],
        "type": "Query",
        "abstractKey": null
      },
      "kind": "Request",
      "operation": {
        "argumentDefinitions": [],
        "kind": "Operation",
        "name": "TracingHomePageHeaderQuery",
        "selections": [
          {
            "alias": "totalTraces",
            "args": [
              {
                "kind": "Literal",
                "name": "rootSpansOnly",
                "value": true
              }
            ],
            "concreteType": "SpanConnection",
            "kind": "LinkedField",
            "name": "spans",
            "plural": false,
            "selections": [
              {
                "alias": null,
                "args": null,
                "concreteType": "PageInfo",
                "kind": "LinkedField",
                "name": "pageInfo",
                "plural": false,
                "selections": [
                  {
                    "alias": null,
                    "args": null,
                    "kind": "ScalarField",
                    "name": "totalCount",
                    "storageKey": null
                  }
                ],
                "storageKey": null
              }
            ],
            "storageKey": "spans(rootSpansOnly:true)"
          },
          {
            "alias": null,
            "args": null,
            "concreteType": "TraceDatasetInfo",
            "kind": "LinkedField",
            "name": "traceDatasetInfo",
            "plural": false,
            "selections": [
              {
                "alias": null,
                "args": null,
                "kind": "ScalarField",
                "name": "startTime",
                "storageKey": null
              },
              {
                "alias": null,
                "args": null,
                "kind": "ScalarField",
                "name": "endTime",
                "storageKey": null
              },
              {
                "alias": null,
                "args": null,
                "kind": "ScalarField",
                "name": "tokenCountTotal",
                "storageKey": null
              },
              {
                "alias": null,
                "args": null,
                "kind": "ScalarField",
                "name": "latencyMsP50",
                "storageKey": null
              },
              {
                "alias": null,
                "args": null,
                "kind": "ScalarField",
                "name": "latencyMsP99",
                "storageKey": null
              }
            ],
            "storageKey": null
          },
          {
            "alias": null,
            "args": null,
            "kind": "ScalarField",
            "name": "spanEvaluationNames",
            "storageKey": null
          },
          {
            "alias": null,
            "args": null,
            "kind": "ScalarField",
            "name": "documentEvaluationNames",
            "storageKey": null
          }
        ]
      },
      "params": {
        "cacheID": "776446b6c16605a140c7f3fca1073bfa",
        "id": null,
        "metadata": {},
        "name": "TracingHomePageHeaderQuery",
        "operationKind": "query",
        "text": "query TracingHomePageHeaderQuery {\n  ...TracingHomePageHeader_stats\n}\n\nfragment TracingHomePageHeader_stats on Query {\n  totalTraces: spans(rootSpansOnly: true) {\n    pageInfo {\n      totalCount\n    }\n  }\n  traceDatasetInfo {\n    startTime\n    endTime\n    tokenCountTotal\n    latencyMsP50\n    latencyMsP99\n  }\n  spanEvaluationNames\n  documentEvaluationNames\n}\n"
      }
    };
    node15.hash = "631360b4ed0a5a26238d4c2aea1bd759";
    TracingHomePageHeaderQuery_graphql_default = node15;
  }
});

// src/pages/tracing/__generated__/DocumentEvaluationSummaryValueQuery.graphql.ts
var DocumentEvaluationSummaryValueQuery_graphql_exports = {};
__export(DocumentEvaluationSummaryValueQuery_graphql_exports, {
  default: () => DocumentEvaluationSummaryValueQuery_graphql_default
});
var node18, DocumentEvaluationSummaryValueQuery_graphql_default;
var init_DocumentEvaluationSummaryValueQuery_graphql = __esm({
  "src/pages/tracing/__generated__/DocumentEvaluationSummaryValueQuery.graphql.ts"() {
    "use strict";
    node18 = function() {
      var v0 = [
        {
          "defaultValue": null,
          "kind": "LocalArgument",
          "name": "evaluationName"
        }
      ], v12 = [
        {
          "kind": "Variable",
          "name": "evaluationName",
          "variableName": "evaluationName"
        }
      ];
      return {
        "fragment": {
          "argumentDefinitions": v0,
          "kind": "Fragment",
          "metadata": null,
          "name": "DocumentEvaluationSummaryValueQuery",
          "selections": [
            {
              "args": v12,
              "kind": "FragmentSpread",
              "name": "DocumentEvaluationSummaryValueFragment"
            }
          ],
          "type": "Query",
          "abstractKey": null
        },
        "kind": "Request",
        "operation": {
          "argumentDefinitions": v0,
          "kind": "Operation",
          "name": "DocumentEvaluationSummaryValueQuery",
          "selections": [
            {
              "alias": null,
              "args": v12,
              "concreteType": "DocumentEvaluationSummary",
              "kind": "LinkedField",
              "name": "documentEvaluationSummary",
              "plural": false,
              "selections": [
                {
                  "alias": null,
                  "args": null,
                  "kind": "ScalarField",
                  "name": "averageNdcg",
                  "storageKey": null
                },
                {
                  "alias": null,
                  "args": null,
                  "kind": "ScalarField",
                  "name": "averagePrecision",
                  "storageKey": null
                },
                {
                  "alias": null,
                  "args": null,
                  "kind": "ScalarField",
                  "name": "meanReciprocalRank",
                  "storageKey": null
                },
                {
                  "alias": null,
                  "args": null,
                  "kind": "ScalarField",
                  "name": "hitRate",
                  "storageKey": null
                }
              ],
              "storageKey": null
            }
          ]
        },
        "params": {
          "cacheID": "79dc69d99e298401be94245f1e607353",
          "id": null,
          "metadata": {},
          "name": "DocumentEvaluationSummaryValueQuery",
          "operationKind": "query",
          "text": "query DocumentEvaluationSummaryValueQuery(\n  $evaluationName: String!\n) {\n  ...DocumentEvaluationSummaryValueFragment_qsFcK\n}\n\nfragment DocumentEvaluationSummaryValueFragment_qsFcK on Query {\n  documentEvaluationSummary(evaluationName: $evaluationName) {\n    averageNdcg\n    averagePrecision\n    meanReciprocalRank\n    hitRate\n  }\n}\n"
        }
      };
    }();
    node18.hash = "2713c6e621dbac0dec917c29a08fff7b";
    DocumentEvaluationSummaryValueQuery_graphql_default = node18;
  }
});

// src/pages/tracing/__generated__/EvaluationSummaryValueQuery.graphql.ts
var EvaluationSummaryValueQuery_graphql_exports = {};
__export(EvaluationSummaryValueQuery_graphql_exports, {
  default: () => EvaluationSummaryValueQuery_graphql_default
});
var node21, EvaluationSummaryValueQuery_graphql_default;
var init_EvaluationSummaryValueQuery_graphql = __esm({
  "src/pages/tracing/__generated__/EvaluationSummaryValueQuery.graphql.ts"() {
    "use strict";
    node21 = function() {
      var v0 = [
        {
          "defaultValue": null,
          "kind": "LocalArgument",
          "name": "evaluationName"
        }
      ], v12 = [
        {
          "kind": "Variable",
          "name": "evaluationName",
          "variableName": "evaluationName"
        }
      ];
      return {
        "fragment": {
          "argumentDefinitions": v0,
          "kind": "Fragment",
          "metadata": null,
          "name": "EvaluationSummaryValueQuery",
          "selections": [
            {
              "args": v12,
              "kind": "FragmentSpread",
              "name": "EvaluationSummaryValueFragment"
            }
          ],
          "type": "Query",
          "abstractKey": null
        },
        "kind": "Request",
        "operation": {
          "argumentDefinitions": v0,
          "kind": "Operation",
          "name": "EvaluationSummaryValueQuery",
          "selections": [
            {
              "alias": null,
              "args": v12,
              "concreteType": "EvaluationSummary",
              "kind": "LinkedField",
              "name": "spanEvaluationSummary",
              "plural": false,
              "selections": [
                {
                  "alias": null,
                  "args": null,
                  "concreteType": "LabelFraction",
                  "kind": "LinkedField",
                  "name": "labelFractions",
                  "plural": true,
                  "selections": [
                    {
                      "alias": null,
                      "args": null,
                      "kind": "ScalarField",
                      "name": "label",
                      "storageKey": null
                    },
                    {
                      "alias": null,
                      "args": null,
                      "kind": "ScalarField",
                      "name": "fraction",
                      "storageKey": null
                    }
                  ],
                  "storageKey": null
                },
                {
                  "alias": null,
                  "args": null,
                  "kind": "ScalarField",
                  "name": "meanScore",
                  "storageKey": null
                }
              ],
              "storageKey": null
            }
          ]
        },
        "params": {
          "cacheID": "d00b543e90ed3ac9800b3fa441e1c496",
          "id": null,
          "metadata": {},
          "name": "EvaluationSummaryValueQuery",
          "operationKind": "query",
          "text": "query EvaluationSummaryValueQuery(\n  $evaluationName: String!\n) {\n  ...EvaluationSummaryValueFragment_qsFcK\n}\n\nfragment EvaluationSummaryValueFragment_qsFcK on Query {\n  spanEvaluationSummary(evaluationName: $evaluationName) {\n    labelFractions {\n      label\n      fraction\n    }\n    meanScore\n  }\n}\n"
        }
      };
    }();
    node21.hash = "f014d6fd36312661220d2f080f257f1d";
    EvaluationSummaryValueQuery_graphql_default = node21;
  }
});

// node_modules/classnames/index.js
var require_classnames = __commonJS({
  "node_modules/classnames/index.js"(exports, module) {
    (function() {
      "use strict";
      var hasOwn2 = {}.hasOwnProperty;
      var nativeCodeString = "[native code]";
      function classNames28() {
        var classes = [];
        for (var i2 = 0; i2 < arguments.length; i2++) {
          var arg = arguments[i2];
          if (!arg)
            continue;
          var argType = typeof arg;
          if (argType === "string" || argType === "number") {
            classes.push(arg);
          } else if (Array.isArray(arg)) {
            if (arg.length) {
              var inner = classNames28.apply(null, arg);
              if (inner) {
                classes.push(inner);
              }
            }
          } else if (argType === "object") {
            if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes("[native code]")) {
              classes.push(arg.toString());
              continue;
            }
            for (var key in arg) {
              if (hasOwn2.call(arg, key) && arg[key]) {
                classes.push(key);
              }
            }
          }
        }
        return classes.join(" ");
      }
      if (typeof module !== "undefined" && module.exports) {
        classNames28.default = classNames28;
        module.exports = classNames28;
      } else if (typeof define === "function" && typeof define.amd === "object" && define.amd) {
        define("classnames", [], function() {
          return classNames28;
        });
      } else {
        window.classNames = classNames28;
      }
    })();
  }
});

// node_modules/lodash/isObject.js
var require_isObject = __commonJS({
  "node_modules/lodash/isObject.js"(exports, module) {
    function isObject2(value) {
      var type = typeof value;
      return value != null && (type == "object" || type == "function");
    }
    module.exports = isObject2;
  }
});

// node_modules/lodash/_freeGlobal.js
var require_freeGlobal = __commonJS({
  "node_modules/lodash/_freeGlobal.js"(exports, module) {
    var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
    module.exports = freeGlobal;
  }
});

// node_modules/lodash/_root.js
var require_root = __commonJS({
  "node_modules/lodash/_root.js"(exports, module) {
    var freeGlobal = require_freeGlobal();
    var freeSelf = typeof self == "object" && self && self.Object === Object && self;
    var root2 = freeGlobal || freeSelf || Function("return this")();
    module.exports = root2;
  }
});

// node_modules/lodash/_Symbol.js
var require_Symbol = __commonJS({
  "node_modules/lodash/_Symbol.js"(exports, module) {
    var root2 = require_root();
    var Symbol3 = root2.Symbol;
    module.exports = Symbol3;
  }
});

// node_modules/lodash/_getRawTag.js
var require_getRawTag = __commonJS({
  "node_modules/lodash/_getRawTag.js"(exports, module) {
    var Symbol3 = require_Symbol();
    var objectProto = Object.prototype;
    var hasOwnProperty3 = objectProto.hasOwnProperty;
    var nativeObjectToString = objectProto.toString;
    var symToStringTag = Symbol3 ? Symbol3.toStringTag : void 0;
    function getRawTag(value) {
      var isOwn = hasOwnProperty3.call(value, symToStringTag), tag = value[symToStringTag];
      try {
        value[symToStringTag] = void 0;
        var unmasked = true;
      } catch (e3) {
      }
      var result = nativeObjectToString.call(value);
      if (unmasked) {
        if (isOwn) {
          value[symToStringTag] = tag;
        } else {
          delete value[symToStringTag];
        }
      }
      return result;
    }
    module.exports = getRawTag;
  }
});

// node_modules/lodash/_objectToString.js
var require_objectToString = __commonJS({
  "node_modules/lodash/_objectToString.js"(exports, module) {
    var objectProto = Object.prototype;
    var nativeObjectToString = objectProto.toString;
    function objectToString(value) {
      return nativeObjectToString.call(value);
    }
    module.exports = objectToString;
  }
});

// node_modules/lodash/_baseGetTag.js
var require_baseGetTag = __commonJS({
  "node_modules/lodash/_baseGetTag.js"(exports, module) {
    var Symbol3 = require_Symbol();
    var getRawTag = require_getRawTag();
    var objectToString = require_objectToString();
    var nullTag = "[object Null]";
    var undefinedTag = "[object Undefined]";
    var symToStringTag = Symbol3 ? Symbol3.toStringTag : void 0;
    function baseGetTag(value) {
      if (value == null) {
        return value === void 0 ? undefinedTag : nullTag;
      }
      return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
    }
    module.exports = baseGetTag;
  }
});

// node_modules/lodash/isFunction.js
var require_isFunction = __commonJS({
  "node_modules/lodash/isFunction.js"(exports, module) {
    var baseGetTag = require_baseGetTag();
    var isObject2 = require_isObject();
    var asyncTag = "[object AsyncFunction]";
    var funcTag = "[object Function]";
    var genTag = "[object GeneratorFunction]";
    var proxyTag = "[object Proxy]";
    function isFunction4(value) {
      if (!isObject2(value)) {
        return false;
      }
      var tag = baseGetTag(value);
      return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
    }
    module.exports = isFunction4;
  }
});

// node_modules/lodash/isArray.js
var require_isArray = __commonJS({
  "node_modules/lodash/isArray.js"(exports, module) {
    var isArray2 = Array.isArray;
    module.exports = isArray2;
  }
});

// node_modules/lodash/isObjectLike.js
var require_isObjectLike = __commonJS({
  "node_modules/lodash/isObjectLike.js"(exports, module) {
    function isObjectLike(value) {
      return value != null && typeof value == "object";
    }
    module.exports = isObjectLike;
  }
});

// node_modules/lodash/isString.js
var require_isString = __commonJS({
  "node_modules/lodash/isString.js"(exports, module) {
    var baseGetTag = require_baseGetTag();
    var isArray2 = require_isArray();
    var isObjectLike = require_isObjectLike();
    var stringTag = "[object String]";
    function isString2(value) {
      return typeof value == "string" || !isArray2(value) && isObjectLike(value) && baseGetTag(value) == stringTag;
    }
    module.exports = isString2;
  }
});

// node_modules/lodash/isSymbol.js
var require_isSymbol = __commonJS({
  "node_modules/lodash/isSymbol.js"(exports, module) {
    var baseGetTag = require_baseGetTag();
    var isObjectLike = require_isObjectLike();
    var symbolTag = "[object Symbol]";
    function isSymbol(value) {
      return typeof value == "symbol" || isObjectLike(value) && baseGetTag(value) == symbolTag;
    }
    module.exports = isSymbol;
  }
});

// node_modules/lodash/_isKey.js
var require_isKey = __commonJS({
  "node_modules/lodash/_isKey.js"(exports, module) {
    var isArray2 = require_isArray();
    var isSymbol = require_isSymbol();
    var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/;
    var reIsPlainProp = /^\w*$/;
    function isKey2(value, object) {
      if (isArray2(value)) {
        return false;
      }
      var type = typeof value;
      if (type == "number" || type == "symbol" || type == "boolean" || value == null || isSymbol(value)) {
        return true;
      }
      return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object(object);
    }
    module.exports = isKey2;
  }
});

// node_modules/lodash/_coreJsData.js
var require_coreJsData = __commonJS({
  "node_modules/lodash/_coreJsData.js"(exports, module) {
    var root2 = require_root();
    var coreJsData = root2["__core-js_shared__"];
    module.exports = coreJsData;
  }
});

// node_modules/lodash/_isMasked.js
var require_isMasked = __commonJS({
  "node_modules/lodash/_isMasked.js"(exports, module) {
    var coreJsData = require_coreJsData();
    var maskSrcKey = function() {
      var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
      return uid ? "Symbol(src)_1." + uid : "";
    }();
    function isMasked(func) {
      return !!maskSrcKey && maskSrcKey in func;
    }
    module.exports = isMasked;
  }
});

// node_modules/lodash/_toSource.js
var require_toSource = __commonJS({
  "node_modules/lodash/_toSource.js"(exports, module) {
    var funcProto = Function.prototype;
    var funcToString = funcProto.toString;
    function toSource(func) {
      if (func != null) {
        try {
          return funcToString.call(func);
        } catch (e3) {
        }
        try {
          return func + "";
        } catch (e3) {
        }
      }
      return "";
    }
    module.exports = toSource;
  }
});

// node_modules/lodash/_baseIsNative.js
var require_baseIsNative = __commonJS({
  "node_modules/lodash/_baseIsNative.js"(exports, module) {
    var isFunction4 = require_isFunction();
    var isMasked = require_isMasked();
    var isObject2 = require_isObject();
    var toSource = require_toSource();
    var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
    var reIsHostCtor = /^\[object .+?Constructor\]$/;
    var funcProto = Function.prototype;
    var objectProto = Object.prototype;
    var funcToString = funcProto.toString;
    var hasOwnProperty3 = objectProto.hasOwnProperty;
    var reIsNative = RegExp(
      "^" + funcToString.call(hasOwnProperty3).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
    );
    function baseIsNative(value) {
      if (!isObject2(value) || isMasked(value)) {
        return false;
      }
      var pattern = isFunction4(value) ? reIsNative : reIsHostCtor;
      return pattern.test(toSource(value));
    }
    module.exports = baseIsNative;
  }
});

// node_modules/lodash/_getValue.js
var require_getValue = __commonJS({
  "node_modules/lodash/_getValue.js"(exports, module) {
    function getValue(object, key) {
      return object == null ? void 0 : object[key];
    }
    module.exports = getValue;
  }
});

// node_modules/lodash/_getNative.js
var require_getNative = __commonJS({
  "node_modules/lodash/_getNative.js"(exports, module) {
    var baseIsNative = require_baseIsNative();
    var getValue = require_getValue();
    function getNative(object, key) {
      var value = getValue(object, key);
      return baseIsNative(value) ? value : void 0;
    }
    module.exports = getNative;
  }
});

// node_modules/lodash/_nativeCreate.js
var require_nativeCreate = __commonJS({
  "node_modules/lodash/_nativeCreate.js"(exports, module) {
    var getNative = require_getNative();
    var nativeCreate = getNative(Object, "create");
    module.exports = nativeCreate;
  }
});

// node_modules/lodash/_hashClear.js
var require_hashClear = __commonJS({
  "node_modules/lodash/_hashClear.js"(exports, module) {
    var nativeCreate = require_nativeCreate();
    function hashClear() {
      this.__data__ = nativeCreate ? nativeCreate(null) : {};
      this.size = 0;
    }
    module.exports = hashClear;
  }
});

// node_modules/lodash/_hashDelete.js
var require_hashDelete = __commonJS({
  "node_modules/lodash/_hashDelete.js"(exports, module) {
    function hashDelete(key) {
      var result = this.has(key) && delete this.__data__[key];
      this.size -= result ? 1 : 0;
      return result;
    }
    module.exports = hashDelete;
  }
});

// node_modules/lodash/_hashGet.js
var require_hashGet = __commonJS({
  "node_modules/lodash/_hashGet.js"(exports, module) {
    var nativeCreate = require_nativeCreate();
    var HASH_UNDEFINED = "__lodash_hash_undefined__";
    var objectProto = Object.prototype;
    var hasOwnProperty3 = objectProto.hasOwnProperty;
    function hashGet(key) {
      var data = this.__data__;
      if (nativeCreate) {
        var result = data[key];
        return result === HASH_UNDEFINED ? void 0 : result;
      }
      return hasOwnProperty3.call(data, key) ? data[key] : void 0;
    }
    module.exports = hashGet;
  }
});

// node_modules/lodash/_hashHas.js
var require_hashHas = __commonJS({
  "node_modules/lodash/_hashHas.js"(exports, module) {
    var nativeCreate = require_nativeCreate();
    var objectProto = Object.prototype;
    var hasOwnProperty3 = objectProto.hasOwnProperty;
    function hashHas(key) {
      var data = this.__data__;
      return nativeCreate ? data[key] !== void 0 : hasOwnProperty3.call(data, key);
    }
    module.exports = hashHas;
  }
});

// node_modules/lodash/_hashSet.js
var require_hashSet = __commonJS({
  "node_modules/lodash/_hashSet.js"(exports, module) {
    var nativeCreate = require_nativeCreate();
    var HASH_UNDEFINED = "__lodash_hash_undefined__";
    function hashSet(key, value) {
      var data = this.__data__;
      this.size += this.has(key) ? 0 : 1;
      data[key] = nativeCreate && value === void 0 ? HASH_UNDEFINED : value;
      return this;
    }
    module.exports = hashSet;
  }
});

// node_modules/lodash/_Hash.js
var require_Hash = __commonJS({
  "node_modules/lodash/_Hash.js"(exports, module) {
    var hashClear = require_hashClear();
    var hashDelete = require_hashDelete();
    var hashGet = require_hashGet();
    var hashHas = require_hashHas();
    var hashSet = require_hashSet();
    function Hash(entries) {
      var index = -1, length2 = entries == null ? 0 : entries.length;
      this.clear();
      while (++index < length2) {
        var entry = entries[index];
        this.set(entry[0], entry[1]);
      }
    }
    Hash.prototype.clear = hashClear;
    Hash.prototype["delete"] = hashDelete;
    Hash.prototype.get = hashGet;
    Hash.prototype.has = hashHas;
    Hash.prototype.set = hashSet;
    module.exports = Hash;
  }
});

// node_modules/lodash/_listCacheClear.js
var require_listCacheClear = __commonJS({
  "node_modules/lodash/_listCacheClear.js"(exports, module) {
    function listCacheClear() {
      this.__data__ = [];
      this.size = 0;
    }
    module.exports = listCacheClear;
  }
});

// node_modules/lodash/eq.js
var require_eq = __commonJS({
  "node_modules/lodash/eq.js"(exports, module) {
    function eq(value, other) {
      return value === other || value !== value && other !== other;
    }
    module.exports = eq;
  }
});

// node_modules/lodash/_assocIndexOf.js
var require_assocIndexOf = __commonJS({
  "node_modules/lodash/_assocIndexOf.js"(exports, module) {
    var eq = require_eq();
    function assocIndexOf(array, key) {
      var length2 = array.length;
      while (length2--) {
        if (eq(array[length2][0], key)) {
          return length2;
        }
      }
      return -1;
    }
    module.exports = assocIndexOf;
  }
});

// node_modules/lodash/_listCacheDelete.js
var require_listCacheDelete = __commonJS({
  "node_modules/lodash/_listCacheDelete.js"(exports, module) {
    var assocIndexOf = require_assocIndexOf();
    var arrayProto = Array.prototype;
    var splice = arrayProto.splice;
    function listCacheDelete(key) {
      var data = this.__data__, index = assocIndexOf(data, key);
      if (index < 0) {
        return false;
      }
      var lastIndex = data.length - 1;
      if (index == lastIndex) {
        data.pop();
      } else {
        splice.call(data, index, 1);
      }
      --this.size;
      return true;
    }
    module.exports = listCacheDelete;
  }
});

// node_modules/lodash/_listCacheGet.js
var require_listCacheGet = __commonJS({
  "node_modules/lodash/_listCacheGet.js"(exports, module) {
    var assocIndexOf = require_assocIndexOf();
    function listCacheGet(key) {
      var data = this.__data__, index = assocIndexOf(data, key);
      return index < 0 ? void 0 : data[index][1];
    }
    module.exports = listCacheGet;
  }
});

// node_modules/lodash/_listCacheHas.js
var require_listCacheHas = __commonJS({
  "node_modules/lodash/_listCacheHas.js"(exports, module) {
    var assocIndexOf = require_assocIndexOf();
    function listCacheHas(key) {
      return assocIndexOf(this.__data__, key) > -1;
    }
    module.exports = listCacheHas;
  }
});

// node_modules/lodash/_listCacheSet.js
var require_listCacheSet = __commonJS({
  "node_modules/lodash/_listCacheSet.js"(exports, module) {
    var assocIndexOf = require_assocIndexOf();
    function listCacheSet(key, value) {
      var data = this.__data__, index = assocIndexOf(data, key);
      if (index < 0) {
        ++this.size;
        data.push([key, value]);
      } else {
        data[index][1] = value;
      }
      return this;
    }
    module.exports = listCacheSet;
  }
});

// node_modules/lodash/_ListCache.js
var require_ListCache = __commonJS({
  "node_modules/lodash/_ListCache.js"(exports, module) {
    var listCacheClear = require_listCacheClear();
    var listCacheDelete = require_listCacheDelete();
    var listCacheGet = require_listCacheGet();
    var listCacheHas = require_listCacheHas();
    var listCacheSet = require_listCacheSet();
    function ListCache(entries) {
      var index = -1, length2 = entries == null ? 0 : entries.length;
      this.clear();
      while (++index < length2) {
        var entry = entries[index];
        this.set(entry[0], entry[1]);
      }
    }
    ListCache.prototype.clear = listCacheClear;
    ListCache.prototype["delete"] = listCacheDelete;
    ListCache.prototype.get = listCacheGet;
    ListCache.prototype.has = listCacheHas;
    ListCache.prototype.set = listCacheSet;
    module.exports = ListCache;
  }
});

// node_modules/lodash/_Map.js
var require_Map = __commonJS({
  "node_modules/lodash/_Map.js"(exports, module) {
    var getNative = require_getNative();
    var root2 = require_root();
    var Map2 = getNative(root2, "Map");
    module.exports = Map2;
  }
});

// node_modules/lodash/_mapCacheClear.js
var require_mapCacheClear = __commonJS({
  "node_modules/lodash/_mapCacheClear.js"(exports, module) {
    var Hash = require_Hash();
    var ListCache = require_ListCache();
    var Map2 = require_Map();
    function mapCacheClear() {
      this.size = 0;
      this.__data__ = {
        "hash": new Hash(),
        "map": new (Map2 || ListCache)(),
        "string": new Hash()
      };
    }
    module.exports = mapCacheClear;
  }
});

// node_modules/lodash/_isKeyable.js
var require_isKeyable = __commonJS({
  "node_modules/lodash/_isKeyable.js"(exports, module) {
    function isKeyable(value) {
      var type = typeof value;
      return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
    }
    module.exports = isKeyable;
  }
});

// node_modules/lodash/_getMapData.js
var require_getMapData = __commonJS({
  "node_modules/lodash/_getMapData.js"(exports, module) {
    var isKeyable = require_isKeyable();
    function getMapData(map3, key) {
      var data = map3.__data__;
      return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
    }
    module.exports = getMapData;
  }
});

// node_modules/lodash/_mapCacheDelete.js
var require_mapCacheDelete = __commonJS({
  "node_modules/lodash/_mapCacheDelete.js"(exports, module) {
    var getMapData = require_getMapData();
    function mapCacheDelete(key) {
      var result = getMapData(this, key)["delete"](key);
      this.size -= result ? 1 : 0;
      return result;
    }
    module.exports = mapCacheDelete;
  }
});

// node_modules/lodash/_mapCacheGet.js
var require_mapCacheGet = __commonJS({
  "node_modules/lodash/_mapCacheGet.js"(exports, module) {
    var getMapData = require_getMapData();
    function mapCacheGet(key) {
      return getMapData(this, key).get(key);
    }
    module.exports = mapCacheGet;
  }
});

// node_modules/lodash/_mapCacheHas.js
var require_mapCacheHas = __commonJS({
  "node_modules/lodash/_mapCacheHas.js"(exports, module) {
    var getMapData = require_getMapData();
    function mapCacheHas(key) {
      return getMapData(this, key).has(key);
    }
    module.exports = mapCacheHas;
  }
});

// node_modules/lodash/_mapCacheSet.js
var require_mapCacheSet = __commonJS({
  "node_modules/lodash/_mapCacheSet.js"(exports, module) {
    var getMapData = require_getMapData();
    function mapCacheSet(key, value) {
      var data = getMapData(this, key), size = data.size;
      data.set(key, value);
      this.size += data.size == size ? 0 : 1;
      return this;
    }
    module.exports = mapCacheSet;
  }
});

// node_modules/lodash/_MapCache.js
var require_MapCache = __commonJS({
  "node_modules/lodash/_MapCache.js"(exports, module) {
    var mapCacheClear = require_mapCacheClear();
    var mapCacheDelete = require_mapCacheDelete();
    var mapCacheGet = require_mapCacheGet();
    var mapCacheHas = require_mapCacheHas();
    var mapCacheSet = require_mapCacheSet();
    function MapCache(entries) {
      var index = -1, length2 = entries == null ? 0 : entries.length;
      this.clear();
      while (++index < length2) {
        var entry = entries[index];
        this.set(entry[0], entry[1]);
      }
    }
    MapCache.prototype.clear = mapCacheClear;
    MapCache.prototype["delete"] = mapCacheDelete;
    MapCache.prototype.get = mapCacheGet;
    MapCache.prototype.has = mapCacheHas;
    MapCache.prototype.set = mapCacheSet;
    module.exports = MapCache;
  }
});

// node_modules/lodash/memoize.js
var require_memoize = __commonJS({
  "node_modules/lodash/memoize.js"(exports, module) {
    var MapCache = require_MapCache();
    var FUNC_ERROR_TEXT = "Expected a function";
    function memoize4(func, resolver) {
      if (typeof func != "function" || resolver != null && typeof resolver != "function") {
        throw new TypeError(FUNC_ERROR_TEXT);
      }
      var memoized = function() {
        var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache2 = memoized.cache;
        if (cache2.has(key)) {
          return cache2.get(key);
        }
        var result = func.apply(this, args);
        memoized.cache = cache2.set(key, result) || cache2;
        return result;
      };
      memoized.cache = new (memoize4.Cache || MapCache)();
      return memoized;
    }
    memoize4.Cache = MapCache;
    module.exports = memoize4;
  }
});

// node_modules/lodash/_memoizeCapped.js
var require_memoizeCapped = __commonJS({
  "node_modules/lodash/_memoizeCapped.js"(exports, module) {
    var memoize4 = require_memoize();
    var MAX_MEMOIZE_SIZE = 500;
    function memoizeCapped(func) {
      var result = memoize4(func, function(key) {
        if (cache2.size === MAX_MEMOIZE_SIZE) {
          cache2.clear();
        }
        return key;
      });
      var cache2 = result.cache;
      return result;
    }
    module.exports = memoizeCapped;
  }
});

// node_modules/lodash/_stringToPath.js
var require_stringToPath = __commonJS({
  "node_modules/lodash/_stringToPath.js"(exports, module) {
    var memoizeCapped = require_memoizeCapped();
    var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
    var reEscapeChar = /\\(\\)?/g;
    var stringToPath2 = memoizeCapped(function(string2) {
      var result = [];
      if (string2.charCodeAt(0) === 46) {
        result.push("");
      }
      string2.replace(rePropName, function(match2, number5, quote, subString) {
        result.push(quote ? subString.replace(reEscapeChar, "$1") : number5 || match2);
      });
      return result;
    });
    module.exports = stringToPath2;
  }
});

// node_modules/lodash/_arrayMap.js
var require_arrayMap = __commonJS({
  "node_modules/lodash/_arrayMap.js"(exports, module) {
    function arrayMap(array, iteratee) {
      var index = -1, length2 = array == null ? 0 : array.length, result = Array(length2);
      while (++index < length2) {
        result[index] = iteratee(array[index], index, array);
      }
      return result;
    }
    module.exports = arrayMap;
  }
});

// node_modules/lodash/_baseToString.js
var require_baseToString = __commonJS({
  "node_modules/lodash/_baseToString.js"(exports, module) {
    var Symbol3 = require_Symbol();
    var arrayMap = require_arrayMap();
    var isArray2 = require_isArray();
    var isSymbol = require_isSymbol();
    var INFINITY = 1 / 0;
    var symbolProto = Symbol3 ? Symbol3.prototype : void 0;
    var symbolToString = symbolProto ? symbolProto.toString : void 0;
    function baseToString(value) {
      if (typeof value == "string") {
        return value;
      }
      if (isArray2(value)) {
        return arrayMap(value, baseToString) + "";
      }
      if (isSymbol(value)) {
        return symbolToString ? symbolToString.call(value) : "";
      }
      var result = value + "";
      return result == "0" && 1 / value == -INFINITY ? "-0" : result;
    }
    module.exports = baseToString;
  }
});

// node_modules/lodash/toString.js
var require_toString = __commonJS({
  "node_modules/lodash/toString.js"(exports, module) {
    var baseToString = require_baseToString();
    function toString2(value) {
      return value == null ? "" : baseToString(value);
    }
    module.exports = toString2;
  }
});

// node_modules/lodash/_castPath.js
var require_castPath = __commonJS({
  "node_modules/lodash/_castPath.js"(exports, module) {
    var isArray2 = require_isArray();
    var isKey2 = require_isKey();
    var stringToPath2 = require_stringToPath();
    var toString2 = require_toString();
    function castPath(value, object) {
      if (isArray2(value)) {
        return value;
      }
      return isKey2(value, object) ? [value] : stringToPath2(toString2(value));
    }
    module.exports = castPath;
  }
});

// node_modules/lodash/_toKey.js
var require_toKey = __commonJS({
  "node_modules/lodash/_toKey.js"(exports, module) {
    var isSymbol = require_isSymbol();
    var INFINITY = 1 / 0;
    function toKey(value) {
      if (typeof value == "string" || isSymbol(value)) {
        return value;
      }
      var result = value + "";
      return result == "0" && 1 / value == -INFINITY ? "-0" : result;
    }
    module.exports = toKey;
  }
});

// node_modules/lodash/_baseGet.js
var require_baseGet = __commonJS({
  "node_modules/lodash/_baseGet.js"(exports, module) {
    var castPath = require_castPath();
    var toKey = require_toKey();
    function baseGet2(object, path2) {
      path2 = castPath(path2, object);
      var index = 0, length2 = path2.length;
      while (object != null && index < length2) {
        object = object[toKey(path2[index++])];
      }
      return index && index == length2 ? object : void 0;
    }
    module.exports = baseGet2;
  }
});

// node_modules/lodash/get.js
var require_get = __commonJS({
  "node_modules/lodash/get.js"(exports, module) {
    var baseGet2 = require_baseGet();
    function get3(object, path2, defaultValue) {
      var result = object == null ? void 0 : baseGet2(object, path2);
      return result === void 0 ? defaultValue : result;
    }
    module.exports = get3;
  }
});

// node_modules/lodash/isNil.js
var require_isNil = __commonJS({
  "node_modules/lodash/isNil.js"(exports, module) {
    function isNil(value) {
      return value == null;
    }
    module.exports = isNil;
  }
});

// node_modules/lodash/isNumber.js
var require_isNumber = __commonJS({
  "node_modules/lodash/isNumber.js"(exports, module) {
    var baseGetTag = require_baseGetTag();
    var isObjectLike = require_isObjectLike();
    var numberTag = "[object Number]";
    function isNumber3(value) {
      return typeof value == "number" || isObjectLike(value) && baseGetTag(value) == numberTag;
    }
    module.exports = isNumber3;
  }
});

// node_modules/lodash/isNaN.js
var require_isNaN = __commonJS({
  "node_modules/lodash/isNaN.js"(exports, module) {
    var isNumber3 = require_isNumber();
    function isNaN2(value) {
      return isNumber3(value) && value != +value;
    }
    module.exports = isNaN2;
  }
});

// node_modules/lodash/_stackClear.js
var require_stackClear = __commonJS({
  "node_modules/lodash/_stackClear.js"(exports, module) {
    var ListCache = require_ListCache();
    function stackClear() {
      this.__data__ = new ListCache();
      this.size = 0;
    }
    module.exports = stackClear;
  }
});

// node_modules/lodash/_stackDelete.js
var require_stackDelete = __commonJS({
  "node_modules/lodash/_stackDelete.js"(exports, module) {
    function stackDelete(key) {
      var data = this.__data__, result = data["delete"](key);
      this.size = data.size;
      return result;
    }
    module.exports = stackDelete;
  }
});

// node_modules/lodash/_stackGet.js
var require_stackGet = __commonJS({
  "node_modules/lodash/_stackGet.js"(exports, module) {
    function stackGet(key) {
      return this.__data__.get(key);
    }
    module.exports = stackGet;
  }
});

// node_modules/lodash/_stackHas.js
var require_stackHas = __commonJS({
  "node_modules/lodash/_stackHas.js"(exports, module) {
    function stackHas(key) {
      return this.__data__.has(key);
    }
    module.exports = stackHas;
  }
});

// node_modules/lodash/_stackSet.js
var require_stackSet = __commonJS({
  "node_modules/lodash/_stackSet.js"(exports, module) {
    var ListCache = require_ListCache();
    var Map2 = require_Map();
    var MapCache = require_MapCache();
    var LARGE_ARRAY_SIZE = 200;
    function stackSet(key, value) {
      var data = this.__data__;
      if (data instanceof ListCache) {
        var pairs = data.__data__;
        if (!Map2 || pairs.length < LARGE_ARRAY_SIZE - 1) {
          pairs.push([key, value]);
          this.size = ++data.size;
          return this;
        }
        data = this.__data__ = new MapCache(pairs);
      }
      data.set(key, value);
      this.size = data.size;
      return this;
    }
    module.exports = stackSet;
  }
});

// node_modules/lodash/_Stack.js
var require_Stack = __commonJS({
  "node_modules/lodash/_Stack.js"(exports, module) {
    var ListCache = require_ListCache();
    var stackClear = require_stackClear();
    var stackDelete = require_stackDelete();
    var stackGet = require_stackGet();
    var stackHas = require_stackHas();
    var stackSet = require_stackSet();
    function Stack2(entries) {
      var data = this.__data__ = new ListCache(entries);
      this.size = data.size;
    }
    Stack2.prototype.clear = stackClear;
    Stack2.prototype["delete"] = stackDelete;
    Stack2.prototype.get = stackGet;
    Stack2.prototype.has = stackHas;
    Stack2.prototype.set = stackSet;
    module.exports = Stack2;
  }
});

// node_modules/lodash/_setCacheAdd.js
var require_setCacheAdd = __commonJS({
  "node_modules/lodash/_setCacheAdd.js"(exports, module) {
    var HASH_UNDEFINED = "__lodash_hash_undefined__";
    function setCacheAdd(value) {
      this.__data__.set(value, HASH_UNDEFINED);
      return this;
    }
    module.exports = setCacheAdd;
  }
});

// node_modules/lodash/_setCacheHas.js
var require_setCacheHas = __commonJS({
  "node_modules/lodash/_setCacheHas.js"(exports, module) {
    function setCacheHas(value) {
      return this.__data__.has(value);
    }
    module.exports = setCacheHas;
  }
});

// node_modules/lodash/_SetCache.js
var require_SetCache = __commonJS({
  "node_modules/lodash/_SetCache.js"(exports, module) {
    var MapCache = require_MapCache();
    var setCacheAdd = require_setCacheAdd();
    var setCacheHas = require_setCacheHas();
    function SetCache(values2) {
      var index = -1, length2 = values2 == null ? 0 : values2.length;
      this.__data__ = new MapCache();
      while (++index < length2) {
        this.add(values2[index]);
      }
    }
    SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
    SetCache.prototype.has = setCacheHas;
    module.exports = SetCache;
  }
});

// node_modules/lodash/_arraySome.js
var require_arraySome = __commonJS({
  "node_modules/lodash/_arraySome.js"(exports, module) {
    function arraySome(array, predicate) {
      var index = -1, length2 = array == null ? 0 : array.length;
      while (++index < length2) {
        if (predicate(array[index], index, array)) {
          return true;
        }
      }
      return false;
    }
    module.exports = arraySome;
  }
});

// node_modules/lodash/_cacheHas.js
var require_cacheHas = __commonJS({
  "node_modules/lodash/_cacheHas.js"(exports, module) {
    function cacheHas(cache2, key) {
      return cache2.has(key);
    }
    module.exports = cacheHas;
  }
});

// node_modules/lodash/_equalArrays.js
var require_equalArrays = __commonJS({
  "node_modules/lodash/_equalArrays.js"(exports, module) {
    var SetCache = require_SetCache();
    var arraySome = require_arraySome();
    var cacheHas = require_cacheHas();
    var COMPARE_PARTIAL_FLAG = 1;
    var COMPARE_UNORDERED_FLAG = 2;
    function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
      var isPartial = bitmask & COMPARE_PARTIAL_FLAG, arrLength = array.length, othLength = other.length;
      if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
        return false;
      }
      var arrStacked = stack.get(array);
      var othStacked = stack.get(other);
      if (arrStacked && othStacked) {
        return arrStacked == other && othStacked == array;
      }
      var index = -1, result = true, seen = bitmask & COMPARE_UNORDERED_FLAG ? new SetCache() : void 0;
      stack.set(array, other);
      stack.set(other, array);
      while (++index < arrLength) {
        var arrValue = array[index], othValue = other[index];
        if (customizer) {
          var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack);
        }
        if (compared !== void 0) {
          if (compared) {
            continue;
          }
          result = false;
          break;
        }
        if (seen) {
          if (!arraySome(other, function(othValue2, othIndex) {
            if (!cacheHas(seen, othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, bitmask, customizer, stack))) {
              return seen.push(othIndex);
            }
          })) {
            result = false;
            break;
          }
        } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
          result = false;
          break;
        }
      }
      stack["delete"](array);
      stack["delete"](other);
      return result;
    }
    module.exports = equalArrays;
  }
});

// node_modules/lodash/_Uint8Array.js
var require_Uint8Array = __commonJS({
  "node_modules/lodash/_Uint8Array.js"(exports, module) {
    var root2 = require_root();
    var Uint8Array2 = root2.Uint8Array;
    module.exports = Uint8Array2;
  }
});

// node_modules/lodash/_mapToArray.js
var require_mapToArray = __commonJS({
  "node_modules/lodash/_mapToArray.js"(exports, module) {
    function mapToArray(map3) {
      var index = -1, result = Array(map3.size);
      map3.forEach(function(value, key) {
        result[++index] = [key, value];
      });
      return result;
    }
    module.exports = mapToArray;
  }
});

// node_modules/lodash/_setToArray.js
var require_setToArray = __commonJS({
  "node_modules/lodash/_setToArray.js"(exports, module) {
    function setToArray(set3) {
      var index = -1, result = Array(set3.size);
      set3.forEach(function(value) {
        result[++index] = value;
      });
      return result;
    }
    module.exports = setToArray;
  }
});

// node_modules/lodash/_equalByTag.js
var require_equalByTag = __commonJS({
  "node_modules/lodash/_equalByTag.js"(exports, module) {
    var Symbol3 = require_Symbol();
    var Uint8Array2 = require_Uint8Array();
    var eq = require_eq();
    var equalArrays = require_equalArrays();
    var mapToArray = require_mapToArray();
    var setToArray = require_setToArray();
    var COMPARE_PARTIAL_FLAG = 1;
    var COMPARE_UNORDERED_FLAG = 2;
    var boolTag = "[object Boolean]";
    var dateTag = "[object Date]";
    var errorTag = "[object Error]";
    var mapTag = "[object Map]";
    var numberTag = "[object Number]";
    var regexpTag = "[object RegExp]";
    var setTag = "[object Set]";
    var stringTag = "[object String]";
    var symbolTag = "[object Symbol]";
    var arrayBufferTag = "[object ArrayBuffer]";
    var dataViewTag = "[object DataView]";
    var symbolProto = Symbol3 ? Symbol3.prototype : void 0;
    var symbolValueOf = symbolProto ? symbolProto.valueOf : void 0;
    function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
      switch (tag) {
        case dataViewTag:
          if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) {
            return false;
          }
          object = object.buffer;
          other = other.buffer;
        case arrayBufferTag:
          if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array2(object), new Uint8Array2(other))) {
            return false;
          }
          return true;
        case boolTag:
        case dateTag:
        case numberTag:
          return eq(+object, +other);
        case errorTag:
          return object.name == other.name && object.message == other.message;
        case regexpTag:
        case stringTag:
          return object == other + "";
        case mapTag:
          var convert = mapToArray;
        case setTag:
          var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
          convert || (convert = setToArray);
          if (object.size != other.size && !isPartial) {
            return false;
          }
          var stacked = stack.get(object);
          if (stacked) {
            return stacked == other;
          }
          bitmask |= COMPARE_UNORDERED_FLAG;
          stack.set(object, other);
          var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
          stack["delete"](object);
          return result;
        case symbolTag:
          if (symbolValueOf) {
            return symbolValueOf.call(object) == symbolValueOf.call(other);
          }
      }
      return false;
    }
    module.exports = equalByTag;
  }
});

// node_modules/lodash/_arrayPush.js
var require_arrayPush = __commonJS({
  "node_modules/lodash/_arrayPush.js"(exports, module) {
    function arrayPush(array, values2) {
      var index = -1, length2 = values2.length, offset = array.length;
      while (++index < length2) {
        array[offset + index] = values2[index];
      }
      return array;
    }
    module.exports = arrayPush;
  }
});

// node_modules/lodash/_baseGetAllKeys.js
var require_baseGetAllKeys = __commonJS({
  "node_modules/lodash/_baseGetAllKeys.js"(exports, module) {
    var arrayPush = require_arrayPush();
    var isArray2 = require_isArray();
    function baseGetAllKeys(object, keysFunc, symbolsFunc) {
      var result = keysFunc(object);
      return isArray2(object) ? result : arrayPush(result, symbolsFunc(object));
    }
    module.exports = baseGetAllKeys;
  }
});

// node_modules/lodash/_arrayFilter.js
var require_arrayFilter = __commonJS({
  "node_modules/lodash/_arrayFilter.js"(exports, module) {
    function arrayFilter(array, predicate) {
      var index = -1, length2 = array == null ? 0 : array.length, resIndex = 0, result = [];
      while (++index < length2) {
        var value = array[index];
        if (predicate(value, index, array)) {
          result[resIndex++] = value;
        }
      }
      return result;
    }
    module.exports = arrayFilter;
  }
});

// node_modules/lodash/stubArray.js
var require_stubArray = __commonJS({
  "node_modules/lodash/stubArray.js"(exports, module) {
    function stubArray() {
      return [];
    }
    module.exports = stubArray;
  }
});

// node_modules/lodash/_getSymbols.js
var require_getSymbols = __commonJS({
  "node_modules/lodash/_getSymbols.js"(exports, module) {
    var arrayFilter = require_arrayFilter();
    var stubArray = require_stubArray();
    var objectProto = Object.prototype;
    var propertyIsEnumerable = objectProto.propertyIsEnumerable;
    var nativeGetSymbols = Object.getOwnPropertySymbols;
    var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
      if (object == null) {
        return [];
      }
      object = Object(object);
      return arrayFilter(nativeGetSymbols(object), function(symbol) {
        return propertyIsEnumerable.call(object, symbol);
      });
    };
    module.exports = getSymbols;
  }
});

// node_modules/lodash/_baseTimes.js
var require_baseTimes = __commonJS({
  "node_modules/lodash/_baseTimes.js"(exports, module) {
    function baseTimes(n2, iteratee) {
      var index = -1, result = Array(n2);
      while (++index < n2) {
        result[index] = iteratee(index);
      }
      return result;
    }
    module.exports = baseTimes;
  }
});

// node_modules/lodash/_baseIsArguments.js
var require_baseIsArguments = __commonJS({
  "node_modules/lodash/_baseIsArguments.js"(exports, module) {
    var baseGetTag = require_baseGetTag();
    var isObjectLike = require_isObjectLike();
    var argsTag = "[object Arguments]";
    function baseIsArguments(value) {
      return isObjectLike(value) && baseGetTag(value) == argsTag;
    }
    module.exports = baseIsArguments;
  }
});

// node_modules/lodash/isArguments.js
var require_isArguments = __commonJS({
  "node_modules/lodash/isArguments.js"(exports, module) {
    var baseIsArguments = require_baseIsArguments();
    var isObjectLike = require_isObjectLike();
    var objectProto = Object.prototype;
    var hasOwnProperty3 = objectProto.hasOwnProperty;
    var propertyIsEnumerable = objectProto.propertyIsEnumerable;
    var isArguments = baseIsArguments(function() {
      return arguments;
    }()) ? baseIsArguments : function(value) {
      return isObjectLike(value) && hasOwnProperty3.call(value, "callee") && !propertyIsEnumerable.call(value, "callee");
    };
    module.exports = isArguments;
  }
});

// node_modules/lodash/stubFalse.js
var require_stubFalse = __commonJS({
  "node_modules/lodash/stubFalse.js"(exports, module) {
    function stubFalse() {
      return false;
    }
    module.exports = stubFalse;
  }
});

// node_modules/lodash/isBuffer.js
var require_isBuffer = __commonJS({
  "node_modules/lodash/isBuffer.js"(exports, module) {
    var root2 = require_root();
    var stubFalse = require_stubFalse();
    var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports;
    var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module;
    var moduleExports = freeModule && freeModule.exports === freeExports;
    var Buffer2 = moduleExports ? root2.Buffer : void 0;
    var nativeIsBuffer = Buffer2 ? Buffer2.isBuffer : void 0;
    var isBuffer = nativeIsBuffer || stubFalse;
    module.exports = isBuffer;
  }
});

// node_modules/lodash/_isIndex.js
var require_isIndex = __commonJS({
  "node_modules/lodash/_isIndex.js"(exports, module) {
    var MAX_SAFE_INTEGER = 9007199254740991;
    var reIsUint = /^(?:0|[1-9]\d*)$/;
    function isIndex(value, length2) {
      var type = typeof value;
      length2 = length2 == null ? MAX_SAFE_INTEGER : length2;
      return !!length2 && (type == "number" || type != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length2);
    }
    module.exports = isIndex;
  }
});

// node_modules/lodash/isLength.js
var require_isLength = __commonJS({
  "node_modules/lodash/isLength.js"(exports, module) {
    var MAX_SAFE_INTEGER = 9007199254740991;
    function isLength(value) {
      return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
    }
    module.exports = isLength;
  }
});

// node_modules/lodash/_baseIsTypedArray.js
var require_baseIsTypedArray = __commonJS({
  "node_modules/lodash/_baseIsTypedArray.js"(exports, module) {
    var baseGetTag = require_baseGetTag();
    var isLength = require_isLength();
    var isObjectLike = require_isObjectLike();
    var argsTag = "[object Arguments]";
    var arrayTag = "[object Array]";
    var boolTag = "[object Boolean]";
    var dateTag = "[object Date]";
    var errorTag = "[object Error]";
    var funcTag = "[object Function]";
    var mapTag = "[object Map]";
    var numberTag = "[object Number]";
    var objectTag = "[object Object]";
    var regexpTag = "[object RegExp]";
    var setTag = "[object Set]";
    var stringTag = "[object String]";
    var weakMapTag = "[object WeakMap]";
    var arrayBufferTag = "[object ArrayBuffer]";
    var dataViewTag = "[object DataView]";
    var float32Tag = "[object Float32Array]";
    var float64Tag = "[object Float64Array]";
    var int8Tag = "[object Int8Array]";
    var int16Tag = "[object Int16Array]";
    var int32Tag = "[object Int32Array]";
    var uint8Tag = "[object Uint8Array]";
    var uint8ClampedTag = "[object Uint8ClampedArray]";
    var uint16Tag = "[object Uint16Array]";
    var uint32Tag = "[object Uint32Array]";
    var typedArrayTags = {};
    typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
    typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
    function baseIsTypedArray(value) {
      return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
    }
    module.exports = baseIsTypedArray;
  }
});

// node_modules/lodash/_baseUnary.js
var require_baseUnary = __commonJS({
  "node_modules/lodash/_baseUnary.js"(exports, module) {
    function baseUnary(func) {
      return function(value) {
        return func(value);
      };
    }
    module.exports = baseUnary;
  }
});

// node_modules/lodash/_nodeUtil.js
var require_nodeUtil = __commonJS({
  "node_modules/lodash/_nodeUtil.js"(exports, module) {
    var freeGlobal = require_freeGlobal();
    var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports;
    var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module;
    var moduleExports = freeModule && freeModule.exports === freeExports;
    var freeProcess = moduleExports && freeGlobal.process;
    var nodeUtil = function() {
      try {
        var types2 = freeModule && freeModule.require && freeModule.require("util").types;
        if (types2) {
          return types2;
        }
        return freeProcess && freeProcess.binding && freeProcess.binding("util");
      } catch (e3) {
      }
    }();
    module.exports = nodeUtil;
  }
});

// node_modules/lodash/isTypedArray.js
var require_isTypedArray = __commonJS({
  "node_modules/lodash/isTypedArray.js"(exports, module) {
    var baseIsTypedArray = require_baseIsTypedArray();
    var baseUnary = require_baseUnary();
    var nodeUtil = require_nodeUtil();
    var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
    var isTypedArray2 = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
    module.exports = isTypedArray2;
  }
});

// node_modules/lodash/_arrayLikeKeys.js
var require_arrayLikeKeys = __commonJS({
  "node_modules/lodash/_arrayLikeKeys.js"(exports, module) {
    var baseTimes = require_baseTimes();
    var isArguments = require_isArguments();
    var isArray2 = require_isArray();
    var isBuffer = require_isBuffer();
    var isIndex = require_isIndex();
    var isTypedArray2 = require_isTypedArray();
    var objectProto = Object.prototype;
    var hasOwnProperty3 = objectProto.hasOwnProperty;
    function arrayLikeKeys(value, inherited) {
      var isArr = isArray2(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer(value), isType = !isArr && !isArg && !isBuff && isTypedArray2(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length2 = result.length;
      for (var key in value) {
        if ((inherited || hasOwnProperty3.call(value, key)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
        (key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
        isBuff && (key == "offset" || key == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
        isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties.
        isIndex(key, length2)))) {
          result.push(key);
        }
      }
      return result;
    }
    module.exports = arrayLikeKeys;
  }
});

// node_modules/lodash/_isPrototype.js
var require_isPrototype = __commonJS({
  "node_modules/lodash/_isPrototype.js"(exports, module) {
    var objectProto = Object.prototype;
    function isPrototype(value) {
      var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto;
      return value === proto;
    }
    module.exports = isPrototype;
  }
});

// node_modules/lodash/_overArg.js
var require_overArg = __commonJS({
  "node_modules/lodash/_overArg.js"(exports, module) {
    function overArg(func, transform) {
      return function(arg) {
        return func(transform(arg));
      };
    }
    module.exports = overArg;
  }
});

// node_modules/lodash/_nativeKeys.js
var require_nativeKeys = __commonJS({
  "node_modules/lodash/_nativeKeys.js"(exports, module) {
    var overArg = require_overArg();
    var nativeKeys = overArg(Object.keys, Object);
    module.exports = nativeKeys;
  }
});

// node_modules/lodash/_baseKeys.js
var require_baseKeys = __commonJS({
  "node_modules/lodash/_baseKeys.js"(exports, module) {
    var isPrototype = require_isPrototype();
    var nativeKeys = require_nativeKeys();
    var objectProto = Object.prototype;
    var hasOwnProperty3 = objectProto.hasOwnProperty;
    function baseKeys(object) {
      if (!isPrototype(object)) {
        return nativeKeys(object);
      }
      var result = [];
      for (var key in Object(object)) {
        if (hasOwnProperty3.call(object, key) && key != "constructor") {
          result.push(key);
        }
      }
      return result;
    }
    module.exports = baseKeys;
  }
});

// node_modules/lodash/isArrayLike.js
var require_isArrayLike = __commonJS({
  "node_modules/lodash/isArrayLike.js"(exports, module) {
    var isFunction4 = require_isFunction();
    var isLength = require_isLength();
    function isArrayLike(value) {
      return value != null && isLength(value.length) && !isFunction4(value);
    }
    module.exports = isArrayLike;
  }
});

// node_modules/lodash/keys.js
var require_keys = __commonJS({
  "node_modules/lodash/keys.js"(exports, module) {
    var arrayLikeKeys = require_arrayLikeKeys();
    var baseKeys = require_baseKeys();
    var isArrayLike = require_isArrayLike();
    function keys4(object) {
      return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
    }
    module.exports = keys4;
  }
});

// node_modules/lodash/_getAllKeys.js
var require_getAllKeys = __commonJS({
  "node_modules/lodash/_getAllKeys.js"(exports, module) {
    var baseGetAllKeys = require_baseGetAllKeys();
    var getSymbols = require_getSymbols();
    var keys4 = require_keys();
    function getAllKeys(object) {
      return baseGetAllKeys(object, keys4, getSymbols);
    }
    module.exports = getAllKeys;
  }
});

// node_modules/lodash/_equalObjects.js
var require_equalObjects = __commonJS({
  "node_modules/lodash/_equalObjects.js"(exports, module) {
    var getAllKeys = require_getAllKeys();
    var COMPARE_PARTIAL_FLAG = 1;
    var objectProto = Object.prototype;
    var hasOwnProperty3 = objectProto.hasOwnProperty;
    function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
      var isPartial = bitmask & COMPARE_PARTIAL_FLAG, objProps = getAllKeys(object), objLength = objProps.length, othProps = getAllKeys(other), othLength = othProps.length;
      if (objLength != othLength && !isPartial) {
        return false;
      }
      var index = objLength;
      while (index--) {
        var key = objProps[index];
        if (!(isPartial ? key in other : hasOwnProperty3.call(other, key))) {
          return false;
        }
      }
      var objStacked = stack.get(object);
      var othStacked = stack.get(other);
      if (objStacked && othStacked) {
        return objStacked == other && othStacked == object;
      }
      var result = true;
      stack.set(object, other);
      stack.set(other, object);
      var skipCtor = isPartial;
      while (++index < objLength) {
        key = objProps[index];
        var objValue = object[key], othValue = other[key];
        if (customizer) {
          var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack);
        }
        if (!(compared === void 0 ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) {
          result = false;
          break;
        }
        skipCtor || (skipCtor = key == "constructor");
      }
      if (result && !skipCtor) {
        var objCtor = object.constructor, othCtor = other.constructor;
        if (objCtor != othCtor && ("constructor" in object && "constructor" in other) && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) {
          result = false;
        }
      }
      stack["delete"](object);
      stack["delete"](other);
      return result;
    }
    module.exports = equalObjects;
  }
});

// node_modules/lodash/_DataView.js
var require_DataView = __commonJS({
  "node_modules/lodash/_DataView.js"(exports, module) {
    var getNative = require_getNative();
    var root2 = require_root();
    var DataView2 = getNative(root2, "DataView");
    module.exports = DataView2;
  }
});

// node_modules/lodash/_Promise.js
var require_Promise = __commonJS({
  "node_modules/lodash/_Promise.js"(exports, module) {
    var getNative = require_getNative();
    var root2 = require_root();
    var Promise2 = getNative(root2, "Promise");
    module.exports = Promise2;
  }
});

// node_modules/lodash/_Set.js
var require_Set = __commonJS({
  "node_modules/lodash/_Set.js"(exports, module) {
    var getNative = require_getNative();
    var root2 = require_root();
    var Set2 = getNative(root2, "Set");
    module.exports = Set2;
  }
});

// node_modules/lodash/_WeakMap.js
var require_WeakMap = __commonJS({
  "node_modules/lodash/_WeakMap.js"(exports, module) {
    var getNative = require_getNative();
    var root2 = require_root();
    var WeakMap2 = getNative(root2, "WeakMap");
    module.exports = WeakMap2;
  }
});

// node_modules/lodash/_getTag.js
var require_getTag = __commonJS({
  "node_modules/lodash/_getTag.js"(exports, module) {
    var DataView2 = require_DataView();
    var Map2 = require_Map();
    var Promise2 = require_Promise();
    var Set2 = require_Set();
    var WeakMap2 = require_WeakMap();
    var baseGetTag = require_baseGetTag();
    var toSource = require_toSource();
    var mapTag = "[object Map]";
    var objectTag = "[object Object]";
    var promiseTag = "[object Promise]";
    var setTag = "[object Set]";
    var weakMapTag = "[object WeakMap]";
    var dataViewTag = "[object DataView]";
    var dataViewCtorString = toSource(DataView2);
    var mapCtorString = toSource(Map2);
    var promiseCtorString = toSource(Promise2);
    var setCtorString = toSource(Set2);
    var weakMapCtorString = toSource(WeakMap2);
    var getTag2 = baseGetTag;
    if (DataView2 && getTag2(new DataView2(new ArrayBuffer(1))) != dataViewTag || Map2 && getTag2(new Map2()) != mapTag || Promise2 && getTag2(Promise2.resolve()) != promiseTag || Set2 && getTag2(new Set2()) != setTag || WeakMap2 && getTag2(new WeakMap2()) != weakMapTag) {
      getTag2 = function(value) {
        var result = baseGetTag(value), Ctor = result == objectTag ? value.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : "";
        if (ctorString) {
          switch (ctorString) {
            case dataViewCtorString:
              return dataViewTag;
            case mapCtorString:
              return mapTag;
            case promiseCtorString:
              return promiseTag;
            case setCtorString:
              return setTag;
            case weakMapCtorString:
              return weakMapTag;
          }
        }
        return result;
      };
    }
    module.exports = getTag2;
  }
});

// node_modules/lodash/_baseIsEqualDeep.js
var require_baseIsEqualDeep = __commonJS({
  "node_modules/lodash/_baseIsEqualDeep.js"(exports, module) {
    var Stack2 = require_Stack();
    var equalArrays = require_equalArrays();
    var equalByTag = require_equalByTag();
    var equalObjects = require_equalObjects();
    var getTag2 = require_getTag();
    var isArray2 = require_isArray();
    var isBuffer = require_isBuffer();
    var isTypedArray2 = require_isTypedArray();
    var COMPARE_PARTIAL_FLAG = 1;
    var argsTag = "[object Arguments]";
    var arrayTag = "[object Array]";
    var objectTag = "[object Object]";
    var objectProto = Object.prototype;
    var hasOwnProperty3 = objectProto.hasOwnProperty;
    function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
      var objIsArr = isArray2(object), othIsArr = isArray2(other), objTag = objIsArr ? arrayTag : getTag2(object), othTag = othIsArr ? arrayTag : getTag2(other);
      objTag = objTag == argsTag ? objectTag : objTag;
      othTag = othTag == argsTag ? objectTag : othTag;
      var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag;
      if (isSameTag && isBuffer(object)) {
        if (!isBuffer(other)) {
          return false;
        }
        objIsArr = true;
        objIsObj = false;
      }
      if (isSameTag && !objIsObj) {
        stack || (stack = new Stack2());
        return objIsArr || isTypedArray2(object) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
      }
      if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
        var objIsWrapped = objIsObj && hasOwnProperty3.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty3.call(other, "__wrapped__");
        if (objIsWrapped || othIsWrapped) {
          var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other;
          stack || (stack = new Stack2());
          return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
        }
      }
      if (!isSameTag) {
        return false;
      }
      stack || (stack = new Stack2());
      return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
    }
    module.exports = baseIsEqualDeep;
  }
});

// node_modules/lodash/_baseIsEqual.js
var require_baseIsEqual = __commonJS({
  "node_modules/lodash/_baseIsEqual.js"(exports, module) {
    var baseIsEqualDeep = require_baseIsEqualDeep();
    var isObjectLike = require_isObjectLike();
    function baseIsEqual(value, other, bitmask, customizer, stack) {
      if (value === other) {
        return true;
      }
      if (value == null || other == null || !isObjectLike(value) && !isObjectLike(other)) {
        return value !== value && other !== other;
      }
      return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
    }
    module.exports = baseIsEqual;
  }
});

// node_modules/lodash/_baseIsMatch.js
var require_baseIsMatch = __commonJS({
  "node_modules/lodash/_baseIsMatch.js"(exports, module) {
    var Stack2 = require_Stack();
    var baseIsEqual = require_baseIsEqual();
    var COMPARE_PARTIAL_FLAG = 1;
    var COMPARE_UNORDERED_FLAG = 2;
    function baseIsMatch(object, source, matchData, customizer) {
      var index = matchData.length, length2 = index, noCustomizer = !customizer;
      if (object == null) {
        return !length2;
      }
      object = Object(object);
      while (index--) {
        var data = matchData[index];
        if (noCustomizer && data[2] ? data[1] !== object[data[0]] : !(data[0] in object)) {
          return false;
        }
      }
      while (++index < length2) {
        data = matchData[index];
        var key = data[0], objValue = object[key], srcValue = data[1];
        if (noCustomizer && data[2]) {
          if (objValue === void 0 && !(key in object)) {
            return false;
          }
        } else {
          var stack = new Stack2();
          if (customizer) {
            var result = customizer(objValue, srcValue, key, object, source, stack);
          }
          if (!(result === void 0 ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack) : result)) {
            return false;
          }
        }
      }
      return true;
    }
    module.exports = baseIsMatch;
  }
});

// node_modules/lodash/_isStrictComparable.js
var require_isStrictComparable = __commonJS({
  "node_modules/lodash/_isStrictComparable.js"(exports, module) {
    var isObject2 = require_isObject();
    function isStrictComparable(value) {
      return value === value && !isObject2(value);
    }
    module.exports = isStrictComparable;
  }
});

// node_modules/lodash/_getMatchData.js
var require_getMatchData = __commonJS({
  "node_modules/lodash/_getMatchData.js"(exports, module) {
    var isStrictComparable = require_isStrictComparable();
    var keys4 = require_keys();
    function getMatchData(object) {
      var result = keys4(object), length2 = result.length;
      while (length2--) {
        var key = result[length2], value = object[key];
        result[length2] = [key, value, isStrictComparable(value)];
      }
      return result;
    }
    module.exports = getMatchData;
  }
});

// node_modules/lodash/_matchesStrictComparable.js
var require_matchesStrictComparable = __commonJS({
  "node_modules/lodash/_matchesStrictComparable.js"(exports, module) {
    function matchesStrictComparable(key, srcValue) {
      return function(object) {
        if (object == null) {
          return false;
        }
        return object[key] === srcValue && (srcValue !== void 0 || key in Object(object));
      };
    }
    module.exports = matchesStrictComparable;
  }
});

// node_modules/lodash/_baseMatches.js
var require_baseMatches = __commonJS({
  "node_modules/lodash/_baseMatches.js"(exports, module) {
    var baseIsMatch = require_baseIsMatch();
    var getMatchData = require_getMatchData();
    var matchesStrictComparable = require_matchesStrictComparable();
    function baseMatches(source) {
      var matchData = getMatchData(source);
      if (matchData.length == 1 && matchData[0][2]) {
        return matchesStrictComparable(matchData[0][0], matchData[0][1]);
      }
      return function(object) {
        return object === source || baseIsMatch(object, source, matchData);
      };
    }
    module.exports = baseMatches;
  }
});

// node_modules/lodash/_baseHasIn.js
var require_baseHasIn = __commonJS({
  "node_modules/lodash/_baseHasIn.js"(exports, module) {
    function baseHasIn(object, key) {
      return object != null && key in Object(object);
    }
    module.exports = baseHasIn;
  }
});

// node_modules/lodash/_hasPath.js
var require_hasPath = __commonJS({
  "node_modules/lodash/_hasPath.js"(exports, module) {
    var castPath = require_castPath();
    var isArguments = require_isArguments();
    var isArray2 = require_isArray();
    var isIndex = require_isIndex();
    var isLength = require_isLength();
    var toKey = require_toKey();
    function hasPath(object, path2, hasFunc) {
      path2 = castPath(path2, object);
      var index = -1, length2 = path2.length, result = false;
      while (++index < length2) {
        var key = toKey(path2[index]);
        if (!(result = object != null && hasFunc(object, key))) {
          break;
        }
        object = object[key];
      }
      if (result || ++index != length2) {
        return result;
      }
      length2 = object == null ? 0 : object.length;
      return !!length2 && isLength(length2) && isIndex(key, length2) && (isArray2(object) || isArguments(object));
    }
    module.exports = hasPath;
  }
});

// node_modules/lodash/hasIn.js
var require_hasIn = __commonJS({
  "node_modules/lodash/hasIn.js"(exports, module) {
    var baseHasIn = require_baseHasIn();
    var hasPath = require_hasPath();
    function hasIn(object, path2) {
      return object != null && hasPath(object, path2, baseHasIn);
    }
    module.exports = hasIn;
  }
});

// node_modules/lodash/_baseMatchesProperty.js
var require_baseMatchesProperty = __commonJS({
  "node_modules/lodash/_baseMatchesProperty.js"(exports, module) {
    var baseIsEqual = require_baseIsEqual();
    var get3 = require_get();
    var hasIn = require_hasIn();
    var isKey2 = require_isKey();
    var isStrictComparable = require_isStrictComparable();
    var matchesStrictComparable = require_matchesStrictComparable();
    var toKey = require_toKey();
    var COMPARE_PARTIAL_FLAG = 1;
    var COMPARE_UNORDERED_FLAG = 2;
    function baseMatchesProperty(path2, srcValue) {
      if (isKey2(path2) && isStrictComparable(srcValue)) {
        return matchesStrictComparable(toKey(path2), srcValue);
      }
      return function(object) {
        var objValue = get3(object, path2);
        return objValue === void 0 && objValue === srcValue ? hasIn(object, path2) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
      };
    }
    module.exports = baseMatchesProperty;
  }
});

// node_modules/lodash/identity.js
var require_identity = __commonJS({
  "node_modules/lodash/identity.js"(exports, module) {
    function identity7(value) {
      return value;
    }
    module.exports = identity7;
  }
});

// node_modules/lodash/_baseProperty.js
var require_baseProperty = __commonJS({
  "node_modules/lodash/_baseProperty.js"(exports, module) {
    function baseProperty(key) {
      return function(object) {
        return object == null ? void 0 : object[key];
      };
    }
    module.exports = baseProperty;
  }
});

// node_modules/lodash/_basePropertyDeep.js
var require_basePropertyDeep = __commonJS({
  "node_modules/lodash/_basePropertyDeep.js"(exports, module) {
    var baseGet2 = require_baseGet();
    function basePropertyDeep(path2) {
      return function(object) {
        return baseGet2(object, path2);
      };
    }
    module.exports = basePropertyDeep;
  }
});

// node_modules/lodash/property.js
var require_property = __commonJS({
  "node_modules/lodash/property.js"(exports, module) {
    var baseProperty = require_baseProperty();
    var basePropertyDeep = require_basePropertyDeep();
    var isKey2 = require_isKey();
    var toKey = require_toKey();
    function property(path2) {
      return isKey2(path2) ? baseProperty(toKey(path2)) : basePropertyDeep(path2);
    }
    module.exports = property;
  }
});

// node_modules/lodash/_baseIteratee.js
var require_baseIteratee = __commonJS({
  "node_modules/lodash/_baseIteratee.js"(exports, module) {
    var baseMatches = require_baseMatches();
    var baseMatchesProperty = require_baseMatchesProperty();
    var identity7 = require_identity();
    var isArray2 = require_isArray();
    var property = require_property();
    function baseIteratee(value) {
      if (typeof value == "function") {
        return value;
      }
      if (value == null) {
        return identity7;
      }
      if (typeof value == "object") {
        return isArray2(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value);
      }
      return property(value);
    }
    module.exports = baseIteratee;
  }
});

// node_modules/lodash/_baseFindIndex.js
var require_baseFindIndex = __commonJS({
  "node_modules/lodash/_baseFindIndex.js"(exports, module) {
    function baseFindIndex(array, predicate, fromIndex, fromRight) {
      var length2 = array.length, index = fromIndex + (fromRight ? 1 : -1);
      while (fromRight ? index-- : ++index < length2) {
        if (predicate(array[index], index, array)) {
          return index;
        }
      }
      return -1;
    }
    module.exports = baseFindIndex;
  }
});

// node_modules/lodash/_baseIsNaN.js
var require_baseIsNaN = __commonJS({
  "node_modules/lodash/_baseIsNaN.js"(exports, module) {
    function baseIsNaN(value) {
      return value !== value;
    }
    module.exports = baseIsNaN;
  }
});

// node_modules/lodash/_strictIndexOf.js
var require_strictIndexOf = __commonJS({
  "node_modules/lodash/_strictIndexOf.js"(exports, module) {
    function strictIndexOf(array, value, fromIndex) {
      var index = fromIndex - 1, length2 = array.length;
      while (++index < length2) {
        if (array[index] === value) {
          return index;
        }
      }
      return -1;
    }
    module.exports = strictIndexOf;
  }
});

// node_modules/lodash/_baseIndexOf.js
var require_baseIndexOf = __commonJS({
  "node_modules/lodash/_baseIndexOf.js"(exports, module) {
    var baseFindIndex = require_baseFindIndex();
    var baseIsNaN = require_baseIsNaN();
    var strictIndexOf = require_strictIndexOf();
    function baseIndexOf(array, value, fromIndex) {
      return value === value ? strictIndexOf(array, value, fromIndex) : baseFindIndex(array, baseIsNaN, fromIndex);
    }
    module.exports = baseIndexOf;
  }
});

// node_modules/lodash/_arrayIncludes.js
var require_arrayIncludes = __commonJS({
  "node_modules/lodash/_arrayIncludes.js"(exports, module) {
    var baseIndexOf = require_baseIndexOf();
    function arrayIncludes(array, value) {
      var length2 = array == null ? 0 : array.length;
      return !!length2 && baseIndexOf(array, value, 0) > -1;
    }
    module.exports = arrayIncludes;
  }
});

// node_modules/lodash/_arrayIncludesWith.js
var require_arrayIncludesWith = __commonJS({
  "node_modules/lodash/_arrayIncludesWith.js"(exports, module) {
    function arrayIncludesWith(array, value, comparator) {
      var index = -1, length2 = array == null ? 0 : array.length;
      while (++index < length2) {
        if (comparator(value, array[index])) {
          return true;
        }
      }
      return false;
    }
    module.exports = arrayIncludesWith;
  }
});

// node_modules/lodash/noop.js
var require_noop = __commonJS({
  "node_modules/lodash/noop.js"(exports, module) {
    function noop2() {
    }
    module.exports = noop2;
  }
});

// node_modules/lodash/_createSet.js
var require_createSet = __commonJS({
  "node_modules/lodash/_createSet.js"(exports, module) {
    var Set2 = require_Set();
    var noop2 = require_noop();
    var setToArray = require_setToArray();
    var INFINITY = 1 / 0;
    var createSet = !(Set2 && 1 / setToArray(new Set2([, -0]))[1] == INFINITY) ? noop2 : function(values2) {
      return new Set2(values2);
    };
    module.exports = createSet;
  }
});

// node_modules/lodash/_baseUniq.js
var require_baseUniq = __commonJS({
  "node_modules/lodash/_baseUniq.js"(exports, module) {
    var SetCache = require_SetCache();
    var arrayIncludes = require_arrayIncludes();
    var arrayIncludesWith = require_arrayIncludesWith();
    var cacheHas = require_cacheHas();
    var createSet = require_createSet();
    var setToArray = require_setToArray();
    var LARGE_ARRAY_SIZE = 200;
    function baseUniq(array, iteratee, comparator) {
      var index = -1, includes = arrayIncludes, length2 = array.length, isCommon = true, result = [], seen = result;
      if (comparator) {
        isCommon = false;
        includes = arrayIncludesWith;
      } else if (length2 >= LARGE_ARRAY_SIZE) {
        var set3 = iteratee ? null : createSet(array);
        if (set3) {
          return setToArray(set3);
        }
        isCommon = false;
        includes = cacheHas;
        seen = new SetCache();
      } else {
        seen = iteratee ? [] : result;
      }
      outer:
        while (++index < length2) {
          var value = array[index], computed = iteratee ? iteratee(value) : value;
          value = comparator || value !== 0 ? value : 0;
          if (isCommon && computed === computed) {
            var seenIndex = seen.length;
            while (seenIndex--) {
              if (seen[seenIndex] === computed) {
                continue outer;
              }
            }
            if (iteratee) {
              seen.push(computed);
            }
            result.push(value);
          } else if (!includes(seen, computed, comparator)) {
            if (seen !== result) {
              seen.push(computed);
            }
            result.push(value);
          }
        }
      return result;
    }
    module.exports = baseUniq;
  }
});

// node_modules/lodash/uniqBy.js
var require_uniqBy = __commonJS({
  "node_modules/lodash/uniqBy.js"(exports, module) {
    var baseIteratee = require_baseIteratee();
    var baseUniq = require_baseUniq();
    function uniqBy(array, iteratee) {
      return array && array.length ? baseUniq(array, baseIteratee(iteratee, 2)) : [];
    }
    module.exports = uniqBy;
  }
});

// node_modules/lodash/_baseSlice.js
var require_baseSlice = __commonJS({
  "node_modules/lodash/_baseSlice.js"(exports, module) {
    function baseSlice(array, start, end) {
      var index = -1, length2 = array.length;
      if (start < 0) {
        start = -start > length2 ? 0 : length2 + start;
      }
      end = end > length2 ? length2 : end;
      if (end < 0) {
        end += length2;
      }
      length2 = start > end ? 0 : end - start >>> 0;
      start >>>= 0;
      var result = Array(length2);
      while (++index < length2) {
        result[index] = array[index + start];
      }
      return result;
    }
    module.exports = baseSlice;
  }
});

// node_modules/lodash/_castSlice.js
var require_castSlice = __commonJS({
  "node_modules/lodash/_castSlice.js"(exports, module) {
    var baseSlice = require_baseSlice();
    function castSlice(array, start, end) {
      var length2 = array.length;
      end = end === void 0 ? length2 : end;
      return !start && end >= length2 ? array : baseSlice(array, start, end);
    }
    module.exports = castSlice;
  }
});

// node_modules/lodash/_hasUnicode.js
var require_hasUnicode = __commonJS({
  "node_modules/lodash/_hasUnicode.js"(exports, module) {
    var rsAstralRange = "\\ud800-\\udfff";
    var rsComboMarksRange = "\\u0300-\\u036f";
    var reComboHalfMarksRange = "\\ufe20-\\ufe2f";
    var rsComboSymbolsRange = "\\u20d0-\\u20ff";
    var rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange;
    var rsVarRange = "\\ufe0e\\ufe0f";
    var rsZWJ = "\\u200d";
    var reHasUnicode = RegExp("[" + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + "]");
    function hasUnicode(string2) {
      return reHasUnicode.test(string2);
    }
    module.exports = hasUnicode;
  }
});

// node_modules/lodash/_asciiToArray.js
var require_asciiToArray = __commonJS({
  "node_modules/lodash/_asciiToArray.js"(exports, module) {
    function asciiToArray(string2) {
      return string2.split("");
    }
    module.exports = asciiToArray;
  }
});

// node_modules/lodash/_unicodeToArray.js
var require_unicodeToArray = __commonJS({
  "node_modules/lodash/_unicodeToArray.js"(exports, module) {
    var rsAstralRange = "\\ud800-\\udfff";
    var rsComboMarksRange = "\\u0300-\\u036f";
    var reComboHalfMarksRange = "\\ufe20-\\ufe2f";
    var rsComboSymbolsRange = "\\u20d0-\\u20ff";
    var rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange;
    var rsVarRange = "\\ufe0e\\ufe0f";
    var rsAstral = "[" + rsAstralRange + "]";
    var rsCombo = "[" + rsComboRange + "]";
    var rsFitz = "\\ud83c[\\udffb-\\udfff]";
    var rsModifier = "(?:" + rsCombo + "|" + rsFitz + ")";
    var rsNonAstral = "[^" + rsAstralRange + "]";
    var rsRegional = "(?:\\ud83c[\\udde6-\\uddff]){2}";
    var rsSurrPair = "[\\ud800-\\udbff][\\udc00-\\udfff]";
    var rsZWJ = "\\u200d";
    var reOptMod = rsModifier + "?";
    var rsOptVar = "[" + rsVarRange + "]?";
    var rsOptJoin = "(?:" + rsZWJ + "(?:" + [rsNonAstral, rsRegional, rsSurrPair].join("|") + ")" + rsOptVar + reOptMod + ")*";
    var rsSeq = rsOptVar + reOptMod + rsOptJoin;
    var rsSymbol = "(?:" + [rsNonAstral + rsCombo + "?", rsCombo, rsRegional, rsSurrPair, rsAstral].join("|") + ")";
    var reUnicode = RegExp(rsFitz + "(?=" + rsFitz + ")|" + rsSymbol + rsSeq, "g");
    function unicodeToArray(string2) {
      return string2.match(reUnicode) || [];
    }
    module.exports = unicodeToArray;
  }
});

// node_modules/lodash/_stringToArray.js
var require_stringToArray = __commonJS({
  "node_modules/lodash/_stringToArray.js"(exports, module) {
    var asciiToArray = require_asciiToArray();
    var hasUnicode = require_hasUnicode();
    var unicodeToArray = require_unicodeToArray();
    function stringToArray(string2) {
      return hasUnicode(string2) ? unicodeToArray(string2) : asciiToArray(string2);
    }
    module.exports = stringToArray;
  }
});

// node_modules/lodash/_createCaseFirst.js
var require_createCaseFirst = __commonJS({
  "node_modules/lodash/_createCaseFirst.js"(exports, module) {
    var castSlice = require_castSlice();
    var hasUnicode = require_hasUnicode();
    var stringToArray = require_stringToArray();
    var toString2 = require_toString();
    function createCaseFirst(methodName) {
      return function(string2) {
        string2 = toString2(string2);
        var strSymbols = hasUnicode(string2) ? stringToArray(string2) : void 0;
        var chr = strSymbols ? strSymbols[0] : string2.charAt(0);
        var trailing = strSymbols ? castSlice(strSymbols, 1).join("") : string2.slice(1);
        return chr[methodName]() + trailing;
      };
    }
    module.exports = createCaseFirst;
  }
});

// node_modules/lodash/upperFirst.js
var require_upperFirst = __commonJS({
  "node_modules/lodash/upperFirst.js"(exports, module) {
    var createCaseFirst = require_createCaseFirst();
    var upperFirst = createCaseFirst("toUpperCase");
    module.exports = upperFirst;
  }
});

// node_modules/react-smooth/node_modules/dom-helpers/class/hasClass.js
var require_hasClass = __commonJS({
  "node_modules/react-smooth/node_modules/dom-helpers/class/hasClass.js"(exports, module) {
    "use strict";
    exports.__esModule = true;
    exports.default = hasClass2;
    function hasClass2(element2, className) {
      if (element2.classList)
        return !!className && element2.classList.contains(className);
      else
        return (" " + (element2.className.baseVal || element2.className) + " ").indexOf(" " + className + " ") !== -1;
    }
    module.exports = exports["default"];
  }
});

// node_modules/react-smooth/node_modules/dom-helpers/class/addClass.js
var require_addClass = __commonJS({
  "node_modules/react-smooth/node_modules/dom-helpers/class/addClass.js"(exports, module) {
    "use strict";
    var _interopRequireDefault = require_interopRequireDefault();
    exports.__esModule = true;
    exports.default = addClass3;
    var _hasClass = _interopRequireDefault(require_hasClass());
    function addClass3(element2, className) {
      if (element2.classList)
        element2.classList.add(className);
      else if (!(0, _hasClass.default)(element2, className))
        if (typeof element2.className === "string")
          element2.className = element2.className + " " + className;
        else
          element2.setAttribute("class", (element2.className && element2.className.baseVal || "") + " " + className);
    }
    module.exports = exports["default"];
  }
});

// node_modules/react-smooth/node_modules/dom-helpers/class/removeClass.js
var require_removeClass = __commonJS({
  "node_modules/react-smooth/node_modules/dom-helpers/class/removeClass.js"(exports, module) {
    "use strict";
    function replaceClassName2(origClass, classToRemove) {
      return origClass.replace(new RegExp("(^|\\s)" + classToRemove + "(?:\\s|$)", "g"), "$1").replace(/\s+/g, " ").replace(/^\s*|\s*$/g, "");
    }
    module.exports = function removeClass4(element2, className) {
      if (element2.classList)
        element2.classList.remove(className);
      else if (typeof element2.className === "string")
        element2.className = replaceClassName2(element2.className, className);
      else
        element2.setAttribute("class", replaceClassName2(element2.className && element2.className.baseVal || "", className));
    };
  }
});

// node_modules/react-lifecycles-compat/react-lifecycles-compat.cjs.js
var require_react_lifecycles_compat_cjs = __commonJS({
  "node_modules/react-lifecycles-compat/react-lifecycles-compat.cjs.js"(exports) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    function componentWillMount() {
      var state = this.constructor.getDerivedStateFromProps(this.props, this.state);
      if (state !== null && state !== void 0) {
        this.setState(state);
      }
    }
    function componentWillReceiveProps(nextProps) {
      function updater(prevState) {
        var state = this.constructor.getDerivedStateFromProps(nextProps, prevState);
        return state !== null && state !== void 0 ? state : null;
      }
      this.setState(updater.bind(this));
    }
    function componentWillUpdate(nextProps, nextState) {
      try {
        var prevProps = this.props;
        var prevState = this.state;
        this.props = nextProps;
        this.state = nextState;
        this.__reactInternalSnapshotFlag = true;
        this.__reactInternalSnapshot = this.getSnapshotBeforeUpdate(
          prevProps,
          prevState
        );
      } finally {
        this.props = prevProps;
        this.state = prevState;
      }
    }
    componentWillMount.__suppressDeprecationWarning = true;
    componentWillReceiveProps.__suppressDeprecationWarning = true;
    componentWillUpdate.__suppressDeprecationWarning = true;
    function polyfill(Component8) {
      var prototype = Component8.prototype;
      if (!prototype || !prototype.isReactComponent) {
        throw new Error("Can only polyfill class components");
      }
      if (typeof Component8.getDerivedStateFromProps !== "function" && typeof prototype.getSnapshotBeforeUpdate !== "function") {
        return Component8;
      }
      var foundWillMountName = null;
      var foundWillReceivePropsName = null;
      var foundWillUpdateName = null;
      if (typeof prototype.componentWillMount === "function") {
        foundWillMountName = "componentWillMount";
      } else if (typeof prototype.UNSAFE_componentWillMount === "function") {
        foundWillMountName = "UNSAFE_componentWillMount";
      }
      if (typeof prototype.componentWillReceiveProps === "function") {
        foundWillReceivePropsName = "componentWillReceiveProps";
      } else if (typeof prototype.UNSAFE_componentWillReceiveProps === "function") {
        foundWillReceivePropsName = "UNSAFE_componentWillReceiveProps";
      }
      if (typeof prototype.componentWillUpdate === "function") {
        foundWillUpdateName = "componentWillUpdate";
      } else if (typeof prototype.UNSAFE_componentWillUpdate === "function") {
        foundWillUpdateName = "UNSAFE_componentWillUpdate";
      }
      if (foundWillMountName !== null || foundWillReceivePropsName !== null || foundWillUpdateName !== null) {
        var componentName = Component8.displayName || Component8.name;
        var newApiName = typeof Component8.getDerivedStateFromProps === "function" ? "getDerivedStateFromProps()" : "getSnapshotBeforeUpdate()";
        throw Error(
          "Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n" + componentName + " uses " + newApiName + " but also contains the following legacy lifecycles:" + (foundWillMountName !== null ? "\n  " + foundWillMountName : "") + (foundWillReceivePropsName !== null ? "\n  " + foundWillReceivePropsName : "") + (foundWillUpdateName !== null ? "\n  " + foundWillUpdateName : "") + "\n\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://fb.me/react-async-component-lifecycle-hooks"
        );
      }
      if (typeof Component8.getDerivedStateFromProps === "function") {
        prototype.componentWillMount = componentWillMount;
        prototype.componentWillReceiveProps = componentWillReceiveProps;
      }
      if (typeof prototype.getSnapshotBeforeUpdate === "function") {
        if (typeof prototype.componentDidUpdate !== "function") {
          throw new Error(
            "Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype"
          );
        }
        prototype.componentWillUpdate = componentWillUpdate;
        var componentDidUpdate = prototype.componentDidUpdate;
        prototype.componentDidUpdate = function componentDidUpdatePolyfill(prevProps, prevState, maybeSnapshot) {
          var snapshot = this.__reactInternalSnapshotFlag ? this.__reactInternalSnapshot : maybeSnapshot;
          componentDidUpdate.call(this, prevProps, prevState, snapshot);
        };
      }
      return Component8;
    }
    exports.polyfill = polyfill;
  }
});

// node_modules/react-smooth/node_modules/react-transition-group/utils/PropTypes.js
var require_PropTypes = __commonJS({
  "node_modules/react-smooth/node_modules/react-transition-group/utils/PropTypes.js"(exports) {
    "use strict";
    exports.__esModule = true;
    exports.classNamesShape = exports.timeoutsShape = void 0;
    var _propTypes = _interopRequireDefault(require_prop_types());
    function _interopRequireDefault(obj) {
      return obj && obj.__esModule ? obj : { default: obj };
    }
    var timeoutsShape2 = true ? _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.shape({
      enter: _propTypes.default.number,
      exit: _propTypes.default.number,
      appear: _propTypes.default.number
    }).isRequired]) : null;
    exports.timeoutsShape = timeoutsShape2;
    var classNamesShape2 = true ? _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.shape({
      enter: _propTypes.default.string,
      exit: _propTypes.default.string,
      active: _propTypes.default.string
    }), _propTypes.default.shape({
      enter: _propTypes.default.string,
      enterDone: _propTypes.default.string,
      enterActive: _propTypes.default.string,
      exit: _propTypes.default.string,
      exitDone: _propTypes.default.string,
      exitActive: _propTypes.default.string
    })]) : null;
    exports.classNamesShape = classNamesShape2;
  }
});

// node_modules/react-smooth/node_modules/react-transition-group/Transition.js
var require_Transition = __commonJS({
  "node_modules/react-smooth/node_modules/react-transition-group/Transition.js"(exports) {
    "use strict";
    exports.__esModule = true;
    exports.default = exports.EXITING = exports.ENTERED = exports.ENTERING = exports.EXITED = exports.UNMOUNTED = void 0;
    var PropTypes8 = _interopRequireWildcard(require_prop_types());
    var _react = _interopRequireDefault(require_react());
    var _reactDom = _interopRequireDefault(require_react_dom());
    var _reactLifecyclesCompat = require_react_lifecycles_compat_cjs();
    var _PropTypes = require_PropTypes();
    function _interopRequireDefault(obj) {
      return obj && obj.__esModule ? obj : { default: obj };
    }
    function _interopRequireWildcard(obj) {
      if (obj && obj.__esModule) {
        return obj;
      } else {
        var newObj = {};
        if (obj != null) {
          for (var key in obj) {
            if (Object.prototype.hasOwnProperty.call(obj, key)) {
              var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};
              if (desc.get || desc.set) {
                Object.defineProperty(newObj, key, desc);
              } else {
                newObj[key] = obj[key];
              }
            }
          }
        }
        newObj.default = obj;
        return newObj;
      }
    }
    function _objectWithoutPropertiesLoose28(source, excluded) {
      if (source == null)
        return {};
      var target = {};
      var sourceKeys = Object.keys(source);
      var key, i2;
      for (i2 = 0; i2 < sourceKeys.length; i2++) {
        key = sourceKeys[i2];
        if (excluded.indexOf(key) >= 0)
          continue;
        target[key] = source[key];
      }
      return target;
    }
    function _inheritsLoose3(subClass, superClass) {
      subClass.prototype = Object.create(superClass.prototype);
      subClass.prototype.constructor = subClass;
      subClass.__proto__ = superClass;
    }
    var UNMOUNTED2 = "unmounted";
    exports.UNMOUNTED = UNMOUNTED2;
    var EXITED2 = "exited";
    exports.EXITED = EXITED2;
    var ENTERING2 = "entering";
    exports.ENTERING = ENTERING2;
    var ENTERED2 = "entered";
    exports.ENTERED = ENTERED2;
    var EXITING2 = "exiting";
    exports.EXITING = EXITING2;
    var Transition3 = /* @__PURE__ */ function(_React$Component) {
      _inheritsLoose3(Transition4, _React$Component);
      function Transition4(props, context2) {
        var _this;
        _this = _React$Component.call(this, props, context2) || this;
        var parentGroup = context2.transitionGroup;
        var appear = parentGroup && !parentGroup.isMounting ? props.enter : props.appear;
        var initialStatus;
        _this.appearStatus = null;
        if (props.in) {
          if (appear) {
            initialStatus = EXITED2;
            _this.appearStatus = ENTERING2;
          } else {
            initialStatus = ENTERED2;
          }
        } else {
          if (props.unmountOnExit || props.mountOnEnter) {
            initialStatus = UNMOUNTED2;
          } else {
            initialStatus = EXITED2;
          }
        }
        _this.state = {
          status: initialStatus
        };
        _this.nextCallback = null;
        return _this;
      }
      var _proto = Transition4.prototype;
      _proto.getChildContext = function getChildContext() {
        return {
          transitionGroup: null
          // allows for nested Transitions
        };
      };
      Transition4.getDerivedStateFromProps = function getDerivedStateFromProps(_ref18, prevState) {
        var nextIn = _ref18.in;
        if (nextIn && prevState.status === UNMOUNTED2) {
          return {
            status: EXITED2
          };
        }
        return null;
      };
      _proto.componentDidMount = function componentDidMount() {
        this.updateStatus(true, this.appearStatus);
      };
      _proto.componentDidUpdate = function componentDidUpdate(prevProps) {
        var nextStatus = null;
        if (prevProps !== this.props) {
          var status = this.state.status;
          if (this.props.in) {
            if (status !== ENTERING2 && status !== ENTERED2) {
              nextStatus = ENTERING2;
            }
          } else {
            if (status === ENTERING2 || status === ENTERED2) {
              nextStatus = EXITING2;
            }
          }
        }
        this.updateStatus(false, nextStatus);
      };
      _proto.componentWillUnmount = function componentWillUnmount() {
        this.cancelNextCallback();
      };
      _proto.getTimeouts = function getTimeouts() {
        var timeout2 = this.props.timeout;
        var exit, enter, appear;
        exit = enter = appear = timeout2;
        if (timeout2 != null && typeof timeout2 !== "number") {
          exit = timeout2.exit;
          enter = timeout2.enter;
          appear = timeout2.appear !== void 0 ? timeout2.appear : enter;
        }
        return {
          exit,
          enter,
          appear
        };
      };
      _proto.updateStatus = function updateStatus(mounting, nextStatus) {
        if (mounting === void 0) {
          mounting = false;
        }
        if (nextStatus !== null) {
          this.cancelNextCallback();
          var node56 = _reactDom.default.findDOMNode(this);
          if (nextStatus === ENTERING2) {
            this.performEnter(node56, mounting);
          } else {
            this.performExit(node56);
          }
        } else if (this.props.unmountOnExit && this.state.status === EXITED2) {
          this.setState({
            status: UNMOUNTED2
          });
        }
      };
      _proto.performEnter = function performEnter(node56, mounting) {
        var _this2 = this;
        var enter = this.props.enter;
        var appearing = this.context.transitionGroup ? this.context.transitionGroup.isMounting : mounting;
        var timeouts = this.getTimeouts();
        var enterTimeout = appearing ? timeouts.appear : timeouts.enter;
        if (!mounting && !enter) {
          this.safeSetState({
            status: ENTERED2
          }, function() {
            _this2.props.onEntered(node56);
          });
          return;
        }
        this.props.onEnter(node56, appearing);
        this.safeSetState({
          status: ENTERING2
        }, function() {
          _this2.props.onEntering(node56, appearing);
          _this2.onTransitionEnd(node56, enterTimeout, function() {
            _this2.safeSetState({
              status: ENTERED2
            }, function() {
              _this2.props.onEntered(node56, appearing);
            });
          });
        });
      };
      _proto.performExit = function performExit(node56) {
        var _this3 = this;
        var exit = this.props.exit;
        var timeouts = this.getTimeouts();
        if (!exit) {
          this.safeSetState({
            status: EXITED2
          }, function() {
            _this3.props.onExited(node56);
          });
          return;
        }
        this.props.onExit(node56);
        this.safeSetState({
          status: EXITING2
        }, function() {
          _this3.props.onExiting(node56);
          _this3.onTransitionEnd(node56, timeouts.exit, function() {
            _this3.safeSetState({
              status: EXITED2
            }, function() {
              _this3.props.onExited(node56);
            });
          });
        });
      };
      _proto.cancelNextCallback = function cancelNextCallback() {
        if (this.nextCallback !== null) {
          this.nextCallback.cancel();
          this.nextCallback = null;
        }
      };
      _proto.safeSetState = function safeSetState(nextState, callback) {
        callback = this.setNextCallback(callback);
        this.setState(nextState, callback);
      };
      _proto.setNextCallback = function setNextCallback(callback) {
        var _this4 = this;
        var active = true;
        this.nextCallback = function(event) {
          if (active) {
            active = false;
            _this4.nextCallback = null;
            callback(event);
          }
        };
        this.nextCallback.cancel = function() {
          active = false;
        };
        return this.nextCallback;
      };
      _proto.onTransitionEnd = function onTransitionEnd(node56, timeout2, handler) {
        this.setNextCallback(handler);
        var doesNotHaveTimeoutOrListener = timeout2 == null && !this.props.addEndListener;
        if (!node56 || doesNotHaveTimeoutOrListener) {
          setTimeout(this.nextCallback, 0);
          return;
        }
        if (this.props.addEndListener) {
          this.props.addEndListener(node56, this.nextCallback);
        }
        if (timeout2 != null) {
          setTimeout(this.nextCallback, timeout2);
        }
      };
      _proto.render = function render2() {
        var status = this.state.status;
        if (status === UNMOUNTED2) {
          return null;
        }
        var _this$props = this.props, children = _this$props.children, childProps = _objectWithoutPropertiesLoose28(_this$props, ["children"]);
        delete childProps.in;
        delete childProps.mountOnEnter;
        delete childProps.unmountOnExit;
        delete childProps.appear;
        delete childProps.enter;
        delete childProps.exit;
        delete childProps.timeout;
        delete childProps.addEndListener;
        delete childProps.onEnter;
        delete childProps.onEntering;
        delete childProps.onEntered;
        delete childProps.onExit;
        delete childProps.onExiting;
        delete childProps.onExited;
        if (typeof children === "function") {
          return children(status, childProps);
        }
        var child = _react.default.Children.only(children);
        return _react.default.cloneElement(child, childProps);
      };
      return Transition4;
    }(_react.default.Component);
    Transition3.contextTypes = {
      transitionGroup: PropTypes8.object
    };
    Transition3.childContextTypes = {
      transitionGroup: function transitionGroup() {
      }
    };
    Transition3.propTypes = true ? {
      /**
       * A `function` child can be used instead of a React element. This function is
       * called with the current transition status (`'entering'`, `'entered'`,
       * `'exiting'`, `'exited'`, `'unmounted'`), which can be used to apply context
       * specific props to a component.
       *
       * ```jsx
       * <Transition in={this.state.in} timeout={150}>
       *   {state => (
       *     <MyComponent className={`fade fade-${state}`} />
       *   )}
       * </Transition>
       * ```
       */
      children: PropTypes8.oneOfType([PropTypes8.func.isRequired, PropTypes8.element.isRequired]).isRequired,
      /**
       * Show the component; triggers the enter or exit states
       */
      in: PropTypes8.bool,
      /**
       * By default the child component is mounted immediately along with
       * the parent `Transition` component. If you want to "lazy mount" the component on the
       * first `in={true}` you can set `mountOnEnter`. After the first enter transition the component will stay
       * mounted, even on "exited", unless you also specify `unmountOnExit`.
       */
      mountOnEnter: PropTypes8.bool,
      /**
       * By default the child component stays mounted after it reaches the `'exited'` state.
       * Set `unmountOnExit` if you'd prefer to unmount the component after it finishes exiting.
       */
      unmountOnExit: PropTypes8.bool,
      /**
       * Normally a component is not transitioned if it is shown when the `<Transition>` component mounts.
       * If you want to transition on the first mount set `appear` to `true`, and the
       * component will transition in as soon as the `<Transition>` mounts.
       *
       * > Note: there are no specific "appear" states. `appear` only adds an additional `enter` transition.
       */
      appear: PropTypes8.bool,
      /**
       * Enable or disable enter transitions.
       */
      enter: PropTypes8.bool,
      /**
       * Enable or disable exit transitions.
       */
      exit: PropTypes8.bool,
      /**
       * The duration of the transition, in milliseconds.
       * Required unless `addEndListener` is provided.
       *
       * You may specify a single timeout for all transitions:
       *
       * ```jsx
       * timeout={500}
       * ```
       *
       * or individually:
       *
       * ```jsx
       * timeout={{
       *  appear: 500,
       *  enter: 300,
       *  exit: 500,
       * }}
       * ```
       *
       * - `appear` defaults to the value of `enter`
       * - `enter` defaults to `0`
       * - `exit` defaults to `0`
       *
       * @type {number | { enter?: number, exit?: number, appear?: number }}
       */
      timeout: function timeout2(props) {
        var pt = _PropTypes.timeoutsShape;
        if (!props.addEndListener)
          pt = pt.isRequired;
        for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
          args[_key - 1] = arguments[_key];
        }
        return pt.apply(void 0, [props].concat(args));
      },
      /**
       * Add a custom transition end trigger. Called with the transitioning
       * DOM node and a `done` callback. Allows for more fine grained transition end
       * logic. **Note:** Timeouts are still used as a fallback if provided.
       *
       * ```jsx
       * addEndListener={(node, done) => {
       *   // use the css transitionend event to mark the finish of a transition
       *   node.addEventListener('transitionend', done, false);
       * }}
       * ```
       */
      addEndListener: PropTypes8.func,
      /**
       * Callback fired before the "entering" status is applied. An extra parameter
       * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount
       *
       * @type Function(node: HtmlElement, isAppearing: bool) -> void
       */
      onEnter: PropTypes8.func,
      /**
       * Callback fired after the "entering" status is applied. An extra parameter
       * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount
       *
       * @type Function(node: HtmlElement, isAppearing: bool)
       */
      onEntering: PropTypes8.func,
      /**
       * Callback fired after the "entered" status is applied. An extra parameter
       * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount
       *
       * @type Function(node: HtmlElement, isAppearing: bool) -> void
       */
      onEntered: PropTypes8.func,
      /**
       * Callback fired before the "exiting" status is applied.
       *
       * @type Function(node: HtmlElement) -> void
       */
      onExit: PropTypes8.func,
      /**
       * Callback fired after the "exiting" status is applied.
       *
       * @type Function(node: HtmlElement) -> void
       */
      onExiting: PropTypes8.func,
      /**
       * Callback fired after the "exited" status is applied.
       *
       * @type Function(node: HtmlElement) -> void
       */
      onExited: PropTypes8.func
      // Name the function so it is clearer in the documentation
    } : {};
    function noop2() {
    }
    Transition3.defaultProps = {
      in: false,
      mountOnEnter: false,
      unmountOnExit: false,
      appear: false,
      enter: true,
      exit: true,
      onEnter: noop2,
      onEntering: noop2,
      onEntered: noop2,
      onExit: noop2,
      onExiting: noop2,
      onExited: noop2
    };
    Transition3.UNMOUNTED = 0;
    Transition3.EXITED = 1;
    Transition3.ENTERING = 2;
    Transition3.ENTERED = 3;
    Transition3.EXITING = 4;
    var _default = (0, _reactLifecyclesCompat.polyfill)(Transition3);
    exports.default = _default;
  }
});

// node_modules/react-smooth/node_modules/react-transition-group/CSSTransition.js
var require_CSSTransition = __commonJS({
  "node_modules/react-smooth/node_modules/react-transition-group/CSSTransition.js"(exports, module) {
    "use strict";
    exports.__esModule = true;
    exports.default = void 0;
    var PropTypes8 = _interopRequireWildcard(require_prop_types());
    var _addClass2 = _interopRequireDefault(require_addClass());
    var _removeClass = _interopRequireDefault(require_removeClass());
    var _react = _interopRequireDefault(require_react());
    var _Transition = _interopRequireDefault(require_Transition());
    var _PropTypes = require_PropTypes();
    function _interopRequireDefault(obj) {
      return obj && obj.__esModule ? obj : { default: obj };
    }
    function _interopRequireWildcard(obj) {
      if (obj && obj.__esModule) {
        return obj;
      } else {
        var newObj = {};
        if (obj != null) {
          for (var key in obj) {
            if (Object.prototype.hasOwnProperty.call(obj, key)) {
              var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};
              if (desc.get || desc.set) {
                Object.defineProperty(newObj, key, desc);
              } else {
                newObj[key] = obj[key];
              }
            }
          }
        }
        newObj.default = obj;
        return newObj;
      }
    }
    function _extends41() {
      _extends41 = Object.assign || function(target) {
        for (var i2 = 1; i2 < arguments.length; i2++) {
          var source = arguments[i2];
          for (var key in source) {
            if (Object.prototype.hasOwnProperty.call(source, key)) {
              target[key] = source[key];
            }
          }
        }
        return target;
      };
      return _extends41.apply(this, arguments);
    }
    function _inheritsLoose3(subClass, superClass) {
      subClass.prototype = Object.create(superClass.prototype);
      subClass.prototype.constructor = subClass;
      subClass.__proto__ = superClass;
    }
    var addClass3 = function addClass4(node56, classes) {
      return node56 && classes && classes.split(" ").forEach(function(c4) {
        return (0, _addClass2.default)(node56, c4);
      });
    };
    var removeClass4 = function removeClass5(node56, classes) {
      return node56 && classes && classes.split(" ").forEach(function(c4) {
        return (0, _removeClass.default)(node56, c4);
      });
    };
    var CSSTransition2 = /* @__PURE__ */ function(_React$Component) {
      _inheritsLoose3(CSSTransition3, _React$Component);
      function CSSTransition3() {
        var _this;
        for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
          args[_key] = arguments[_key];
        }
        _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
        _this.onEnter = function(node56, appearing) {
          var _this$getClassNames = _this.getClassNames(appearing ? "appear" : "enter"), className = _this$getClassNames.className;
          _this.removeClasses(node56, "exit");
          addClass3(node56, className);
          if (_this.props.onEnter) {
            _this.props.onEnter(node56, appearing);
          }
        };
        _this.onEntering = function(node56, appearing) {
          var _this$getClassNames2 = _this.getClassNames(appearing ? "appear" : "enter"), activeClassName = _this$getClassNames2.activeClassName;
          _this.reflowAndAddClass(node56, activeClassName);
          if (_this.props.onEntering) {
            _this.props.onEntering(node56, appearing);
          }
        };
        _this.onEntered = function(node56, appearing) {
          var appearClassName = _this.getClassNames("appear").doneClassName;
          var enterClassName = _this.getClassNames("enter").doneClassName;
          var doneClassName = appearing ? appearClassName + " " + enterClassName : enterClassName;
          _this.removeClasses(node56, appearing ? "appear" : "enter");
          addClass3(node56, doneClassName);
          if (_this.props.onEntered) {
            _this.props.onEntered(node56, appearing);
          }
        };
        _this.onExit = function(node56) {
          var _this$getClassNames3 = _this.getClassNames("exit"), className = _this$getClassNames3.className;
          _this.removeClasses(node56, "appear");
          _this.removeClasses(node56, "enter");
          addClass3(node56, className);
          if (_this.props.onExit) {
            _this.props.onExit(node56);
          }
        };
        _this.onExiting = function(node56) {
          var _this$getClassNames4 = _this.getClassNames("exit"), activeClassName = _this$getClassNames4.activeClassName;
          _this.reflowAndAddClass(node56, activeClassName);
          if (_this.props.onExiting) {
            _this.props.onExiting(node56);
          }
        };
        _this.onExited = function(node56) {
          var _this$getClassNames5 = _this.getClassNames("exit"), doneClassName = _this$getClassNames5.doneClassName;
          _this.removeClasses(node56, "exit");
          addClass3(node56, doneClassName);
          if (_this.props.onExited) {
            _this.props.onExited(node56);
          }
        };
        _this.getClassNames = function(type) {
          var classNames28 = _this.props.classNames;
          var isStringClassNames = typeof classNames28 === "string";
          var prefix3 = isStringClassNames && classNames28 ? classNames28 + "-" : "";
          var className = isStringClassNames ? prefix3 + type : classNames28[type];
          var activeClassName = isStringClassNames ? className + "-active" : classNames28[type + "Active"];
          var doneClassName = isStringClassNames ? className + "-done" : classNames28[type + "Done"];
          return {
            className,
            activeClassName,
            doneClassName
          };
        };
        return _this;
      }
      var _proto = CSSTransition3.prototype;
      _proto.removeClasses = function removeClasses(node56, type) {
        var _this$getClassNames6 = this.getClassNames(type), className = _this$getClassNames6.className, activeClassName = _this$getClassNames6.activeClassName, doneClassName = _this$getClassNames6.doneClassName;
        className && removeClass4(node56, className);
        activeClassName && removeClass4(node56, activeClassName);
        doneClassName && removeClass4(node56, doneClassName);
      };
      _proto.reflowAndAddClass = function reflowAndAddClass(node56, className) {
        if (className) {
          node56 && node56.scrollTop;
          addClass3(node56, className);
        }
      };
      _proto.render = function render2() {
        var props = _extends41({}, this.props);
        delete props.classNames;
        return _react.default.createElement(_Transition.default, _extends41({}, props, {
          onEnter: this.onEnter,
          onEntered: this.onEntered,
          onEntering: this.onEntering,
          onExit: this.onExit,
          onExiting: this.onExiting,
          onExited: this.onExited
        }));
      };
      return CSSTransition3;
    }(_react.default.Component);
    CSSTransition2.defaultProps = {
      classNames: ""
    };
    CSSTransition2.propTypes = true ? _extends41({}, _Transition.default.propTypes, {
      /**
       * The animation classNames applied to the component as it enters, exits or
       * has finished the transition. A single name can be provided and it will be
       * suffixed for each stage: e.g.
       *
       * `classNames="fade"` applies `fade-enter`, `fade-enter-active`,
       * `fade-enter-done`, `fade-exit`, `fade-exit-active`, `fade-exit-done`,
       * `fade-appear`, `fade-appear-active`, and `fade-appear-done`.
       *
       * **Note**: `fade-appear-done` and `fade-enter-done` will _both_ be applied.
       * This allows you to define different behavior for when appearing is done and
       * when regular entering is done, using selectors like
       * `.fade-enter-done:not(.fade-appear-done)`. For example, you could apply an
       * epic entrance animation when element first appears in the DOM using
       * [Animate.css](https://daneden.github.io/animate.css/). Otherwise you can
       * simply use `fade-enter-done` for defining both cases.
       *
       * Each individual classNames can also be specified independently like:
       *
       * ```js
       * classNames={{
       *  appear: 'my-appear',
       *  appearActive: 'my-active-appear',
       *  appearDone: 'my-done-appear',
       *  enter: 'my-enter',
       *  enterActive: 'my-active-enter',
       *  enterDone: 'my-done-enter',
       *  exit: 'my-exit',
       *  exitActive: 'my-active-exit',
       *  exitDone: 'my-done-exit',
       * }}
       * ```
       *
       * If you want to set these classes using CSS Modules:
       *
       * ```js
       * import styles from './styles.css';
       * ```
       *
       * you might want to use camelCase in your CSS file, that way could simply
       * spread them instead of listing them one by one:
       *
       * ```js
       * classNames={{ ...styles }}
       * ```
       *
       * @type {string | {
       *  appear?: string,
       *  appearActive?: string,
       *  appearDone?: string,
       *  enter?: string,
       *  enterActive?: string,
       *  enterDone?: string,
       *  exit?: string,
       *  exitActive?: string,
       *  exitDone?: string,
       * }}
       */
      classNames: _PropTypes.classNamesShape,
      /**
       * A `<Transition>` callback fired immediately after the 'enter' or 'appear' class is
       * applied.
       *
       * @type Function(node: HtmlElement, isAppearing: bool)
       */
      onEnter: PropTypes8.func,
      /**
       * A `<Transition>` callback fired immediately after the 'enter-active' or
       * 'appear-active' class is applied.
       *
       * @type Function(node: HtmlElement, isAppearing: bool)
       */
      onEntering: PropTypes8.func,
      /**
       * A `<Transition>` callback fired immediately after the 'enter' or
       * 'appear' classes are **removed** and the `done` class is added to the DOM node.
       *
       * @type Function(node: HtmlElement, isAppearing: bool)
       */
      onEntered: PropTypes8.func,
      /**
       * A `<Transition>` callback fired immediately after the 'exit' class is
       * applied.
       *
       * @type Function(node: HtmlElement)
       */
      onExit: PropTypes8.func,
      /**
       * A `<Transition>` callback fired immediately after the 'exit-active' is applied.
       *
       * @type Function(node: HtmlElement)
       */
      onExiting: PropTypes8.func,
      /**
       * A `<Transition>` callback fired immediately after the 'exit' classes
       * are **removed** and the `exit-done` class is added to the DOM node.
       *
       * @type Function(node: HtmlElement)
       */
      onExited: PropTypes8.func
    }) : {};
    var _default = CSSTransition2;
    exports.default = _default;
    module.exports = exports["default"];
  }
});

// node_modules/react-smooth/node_modules/react-transition-group/utils/ChildMapping.js
var require_ChildMapping = __commonJS({
  "node_modules/react-smooth/node_modules/react-transition-group/utils/ChildMapping.js"(exports) {
    "use strict";
    exports.__esModule = true;
    exports.getChildMapping = getChildMapping2;
    exports.mergeChildMappings = mergeChildMappings2;
    exports.getInitialChildMapping = getInitialChildMapping2;
    exports.getNextChildMapping = getNextChildMapping2;
    var _react = require_react();
    function getChildMapping2(children, mapFn) {
      var mapper = function mapper2(child) {
        return mapFn && (0, _react.isValidElement)(child) ? mapFn(child) : child;
      };
      var result = /* @__PURE__ */ Object.create(null);
      if (children)
        _react.Children.map(children, function(c4) {
          return c4;
        }).forEach(function(child) {
          result[child.key] = mapper(child);
        });
      return result;
    }
    function mergeChildMappings2(prev2, next2) {
      prev2 = prev2 || {};
      next2 = next2 || {};
      function getValueForKey(key) {
        return key in next2 ? next2[key] : prev2[key];
      }
      var nextKeysPending = /* @__PURE__ */ Object.create(null);
      var pendingKeys = [];
      for (var prevKey in prev2) {
        if (prevKey in next2) {
          if (pendingKeys.length) {
            nextKeysPending[prevKey] = pendingKeys;
            pendingKeys = [];
          }
        } else {
          pendingKeys.push(prevKey);
        }
      }
      var i2;
      var childMapping = {};
      for (var nextKey in next2) {
        if (nextKeysPending[nextKey]) {
          for (i2 = 0; i2 < nextKeysPending[nextKey].length; i2++) {
            var pendingNextKey = nextKeysPending[nextKey][i2];
            childMapping[nextKeysPending[nextKey][i2]] = getValueForKey(pendingNextKey);
          }
        }
        childMapping[nextKey] = getValueForKey(nextKey);
      }
      for (i2 = 0; i2 < pendingKeys.length; i2++) {
        childMapping[pendingKeys[i2]] = getValueForKey(pendingKeys[i2]);
      }
      return childMapping;
    }
    function getProp2(child, prop, props) {
      return props[prop] != null ? props[prop] : child.props[prop];
    }
    function getInitialChildMapping2(props, onExited) {
      return getChildMapping2(props.children, function(child) {
        return (0, _react.cloneElement)(child, {
          onExited: onExited.bind(null, child),
          in: true,
          appear: getProp2(child, "appear", props),
          enter: getProp2(child, "enter", props),
          exit: getProp2(child, "exit", props)
        });
      });
    }
    function getNextChildMapping2(nextProps, prevChildMapping, onExited) {
      var nextChildMapping = getChildMapping2(nextProps.children);
      var children = mergeChildMappings2(prevChildMapping, nextChildMapping);
      Object.keys(children).forEach(function(key) {
        var child = children[key];
        if (!(0, _react.isValidElement)(child))
          return;
        var hasPrev = key in prevChildMapping;
        var hasNext = key in nextChildMapping;
        var prevChild = prevChildMapping[key];
        var isLeaving = (0, _react.isValidElement)(prevChild) && !prevChild.props.in;
        if (hasNext && (!hasPrev || isLeaving)) {
          children[key] = (0, _react.cloneElement)(child, {
            onExited: onExited.bind(null, child),
            in: true,
            exit: getProp2(child, "exit", nextProps),
            enter: getProp2(child, "enter", nextProps)
          });
        } else if (!hasNext && hasPrev && !isLeaving) {
          children[key] = (0, _react.cloneElement)(child, {
            in: false
          });
        } else if (hasNext && hasPrev && (0, _react.isValidElement)(prevChild)) {
          children[key] = (0, _react.cloneElement)(child, {
            onExited: onExited.bind(null, child),
            in: prevChild.props.in,
            exit: getProp2(child, "exit", nextProps),
            enter: getProp2(child, "enter", nextProps)
          });
        }
      });
      return children;
    }
  }
});

// node_modules/react-smooth/node_modules/react-transition-group/TransitionGroup.js
var require_TransitionGroup = __commonJS({
  "node_modules/react-smooth/node_modules/react-transition-group/TransitionGroup.js"(exports, module) {
    "use strict";
    exports.__esModule = true;
    exports.default = void 0;
    var _propTypes = _interopRequireDefault(require_prop_types());
    var _react = _interopRequireDefault(require_react());
    var _reactLifecyclesCompat = require_react_lifecycles_compat_cjs();
    var _ChildMapping = require_ChildMapping();
    function _interopRequireDefault(obj) {
      return obj && obj.__esModule ? obj : { default: obj };
    }
    function _objectWithoutPropertiesLoose28(source, excluded) {
      if (source == null)
        return {};
      var target = {};
      var sourceKeys = Object.keys(source);
      var key, i2;
      for (i2 = 0; i2 < sourceKeys.length; i2++) {
        key = sourceKeys[i2];
        if (excluded.indexOf(key) >= 0)
          continue;
        target[key] = source[key];
      }
      return target;
    }
    function _extends41() {
      _extends41 = Object.assign || function(target) {
        for (var i2 = 1; i2 < arguments.length; i2++) {
          var source = arguments[i2];
          for (var key in source) {
            if (Object.prototype.hasOwnProperty.call(source, key)) {
              target[key] = source[key];
            }
          }
        }
        return target;
      };
      return _extends41.apply(this, arguments);
    }
    function _inheritsLoose3(subClass, superClass) {
      subClass.prototype = Object.create(superClass.prototype);
      subClass.prototype.constructor = subClass;
      subClass.__proto__ = superClass;
    }
    function _assertThisInitialized19(self2) {
      if (self2 === void 0) {
        throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
      }
      return self2;
    }
    var values2 = Object.values || function(obj) {
      return Object.keys(obj).map(function(k2) {
        return obj[k2];
      });
    };
    var defaultProps5 = {
      component: "div",
      childFactory: function childFactory2(child) {
        return child;
      }
      /**
       * The `<TransitionGroup>` component manages a set of transition components
       * (`<Transition>` and `<CSSTransition>`) in a list. Like with the transition
       * components, `<TransitionGroup>` is a state machine for managing the mounting
       * and unmounting of components over time.
       *
       * Consider the example below. As items are removed or added to the TodoList the
       * `in` prop is toggled automatically by the `<TransitionGroup>`.
       *
       * Note that `<TransitionGroup>`  does not define any animation behavior!
       * Exactly _how_ a list item animates is up to the individual transition
       * component. This means you can mix and match animations across different list
       * items.
       */
    };
    var TransitionGroup3 = /* @__PURE__ */ function(_React$Component) {
      _inheritsLoose3(TransitionGroup4, _React$Component);
      function TransitionGroup4(props, context2) {
        var _this;
        _this = _React$Component.call(this, props, context2) || this;
        var handleExited = _this.handleExited.bind(_assertThisInitialized19(_assertThisInitialized19(_this)));
        _this.state = {
          handleExited,
          firstRender: true
        };
        return _this;
      }
      var _proto = TransitionGroup4.prototype;
      _proto.getChildContext = function getChildContext() {
        return {
          transitionGroup: {
            isMounting: !this.appeared
          }
        };
      };
      _proto.componentDidMount = function componentDidMount() {
        this.appeared = true;
        this.mounted = true;
      };
      _proto.componentWillUnmount = function componentWillUnmount() {
        this.mounted = false;
      };
      TransitionGroup4.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, _ref18) {
        var prevChildMapping = _ref18.children, handleExited = _ref18.handleExited, firstRender = _ref18.firstRender;
        return {
          children: firstRender ? (0, _ChildMapping.getInitialChildMapping)(nextProps, handleExited) : (0, _ChildMapping.getNextChildMapping)(nextProps, prevChildMapping, handleExited),
          firstRender: false
        };
      };
      _proto.handleExited = function handleExited(child, node56) {
        var currentChildMapping = (0, _ChildMapping.getChildMapping)(this.props.children);
        if (child.key in currentChildMapping)
          return;
        if (child.props.onExited) {
          child.props.onExited(node56);
        }
        if (this.mounted) {
          this.setState(function(state) {
            var children = _extends41({}, state.children);
            delete children[child.key];
            return {
              children
            };
          });
        }
      };
      _proto.render = function render2() {
        var _this$props = this.props, Component8 = _this$props.component, childFactory2 = _this$props.childFactory, props = _objectWithoutPropertiesLoose28(_this$props, ["component", "childFactory"]);
        var children = values2(this.state.children).map(childFactory2);
        delete props.appear;
        delete props.enter;
        delete props.exit;
        if (Component8 === null) {
          return children;
        }
        return _react.default.createElement(Component8, props, children);
      };
      return TransitionGroup4;
    }(_react.default.Component);
    TransitionGroup3.childContextTypes = {
      transitionGroup: _propTypes.default.object.isRequired
    };
    TransitionGroup3.propTypes = true ? {
      /**
       * `<TransitionGroup>` renders a `<div>` by default. You can change this
       * behavior by providing a `component` prop.
       * If you use React v16+ and would like to avoid a wrapping `<div>` element
       * you can pass in `component={null}`. This is useful if the wrapping div
       * borks your css styles.
       */
      component: _propTypes.default.any,
      /**
       * A set of `<Transition>` components, that are toggled `in` and out as they
       * leave. the `<TransitionGroup>` will inject specific transition props, so
       * remember to spread them through if you are wrapping the `<Transition>` as
       * with our `<Fade>` example.
       *
       * While this component is meant for multiple `Transition` or `CSSTransition`
       * children, sometimes you may want to have a single transition child with
       * content that you want to be transitioned out and in when you change it
       * (e.g. routes, images etc.) In that case you can change the `key` prop of
       * the transition child as you change its content, this will cause
       * `TransitionGroup` to transition the child out and back in.
       */
      children: _propTypes.default.node,
      /**
       * A convenience prop that enables or disables appear animations
       * for all children. Note that specifying this will override any defaults set
       * on individual children Transitions.
       */
      appear: _propTypes.default.bool,
      /**
       * A convenience prop that enables or disables enter animations
       * for all children. Note that specifying this will override any defaults set
       * on individual children Transitions.
       */
      enter: _propTypes.default.bool,
      /**
       * A convenience prop that enables or disables exit animations
       * for all children. Note that specifying this will override any defaults set
       * on individual children Transitions.
       */
      exit: _propTypes.default.bool,
      /**
       * You may need to apply reactive updates to a child as it is exiting.
       * This is generally done by using `cloneElement` however in the case of an exiting
       * child the element has already been removed and not accessible to the consumer.
       *
       * If you do need to update a child as it leaves you can provide a `childFactory`
       * to wrap every child, even the ones that are leaving.
       *
       * @type Function(child: ReactElement) -> ReactElement
       */
      childFactory: _propTypes.default.func
    } : {};
    TransitionGroup3.defaultProps = defaultProps5;
    var _default = (0, _reactLifecyclesCompat.polyfill)(TransitionGroup3);
    exports.default = _default;
    module.exports = exports["default"];
  }
});

// node_modules/react-smooth/node_modules/react-transition-group/ReplaceTransition.js
var require_ReplaceTransition = __commonJS({
  "node_modules/react-smooth/node_modules/react-transition-group/ReplaceTransition.js"(exports, module) {
    "use strict";
    exports.__esModule = true;
    exports.default = void 0;
    var _propTypes = _interopRequireDefault(require_prop_types());
    var _react = _interopRequireDefault(require_react());
    var _reactDom = require_react_dom();
    var _TransitionGroup = _interopRequireDefault(require_TransitionGroup());
    function _interopRequireDefault(obj) {
      return obj && obj.__esModule ? obj : { default: obj };
    }
    function _objectWithoutPropertiesLoose28(source, excluded) {
      if (source == null)
        return {};
      var target = {};
      var sourceKeys = Object.keys(source);
      var key, i2;
      for (i2 = 0; i2 < sourceKeys.length; i2++) {
        key = sourceKeys[i2];
        if (excluded.indexOf(key) >= 0)
          continue;
        target[key] = source[key];
      }
      return target;
    }
    function _inheritsLoose3(subClass, superClass) {
      subClass.prototype = Object.create(superClass.prototype);
      subClass.prototype.constructor = subClass;
      subClass.__proto__ = superClass;
    }
    var ReplaceTransition = /* @__PURE__ */ function(_React$Component) {
      _inheritsLoose3(ReplaceTransition2, _React$Component);
      function ReplaceTransition2() {
        var _this;
        for (var _len = arguments.length, _args = new Array(_len), _key = 0; _key < _len; _key++) {
          _args[_key] = arguments[_key];
        }
        _this = _React$Component.call.apply(_React$Component, [this].concat(_args)) || this;
        _this.handleEnter = function() {
          for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
            args[_key2] = arguments[_key2];
          }
          return _this.handleLifecycle("onEnter", 0, args);
        };
        _this.handleEntering = function() {
          for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
            args[_key3] = arguments[_key3];
          }
          return _this.handleLifecycle("onEntering", 0, args);
        };
        _this.handleEntered = function() {
          for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
            args[_key4] = arguments[_key4];
          }
          return _this.handleLifecycle("onEntered", 0, args);
        };
        _this.handleExit = function() {
          for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
            args[_key5] = arguments[_key5];
          }
          return _this.handleLifecycle("onExit", 1, args);
        };
        _this.handleExiting = function() {
          for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
            args[_key6] = arguments[_key6];
          }
          return _this.handleLifecycle("onExiting", 1, args);
        };
        _this.handleExited = function() {
          for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
            args[_key7] = arguments[_key7];
          }
          return _this.handleLifecycle("onExited", 1, args);
        };
        return _this;
      }
      var _proto = ReplaceTransition2.prototype;
      _proto.handleLifecycle = function handleLifecycle(handler, idx, originalArgs) {
        var _child$props;
        var children = this.props.children;
        var child = _react.default.Children.toArray(children)[idx];
        if (child.props[handler])
          (_child$props = child.props)[handler].apply(_child$props, originalArgs);
        if (this.props[handler])
          this.props[handler]((0, _reactDom.findDOMNode)(this));
      };
      _proto.render = function render2() {
        var _this$props = this.props, children = _this$props.children, inProp = _this$props.in, props = _objectWithoutPropertiesLoose28(_this$props, ["children", "in"]);
        var _React$Children$toArr = _react.default.Children.toArray(children), first = _React$Children$toArr[0], second2 = _React$Children$toArr[1];
        delete props.onEnter;
        delete props.onEntering;
        delete props.onEntered;
        delete props.onExit;
        delete props.onExiting;
        delete props.onExited;
        return _react.default.createElement(_TransitionGroup.default, props, inProp ? _react.default.cloneElement(first, {
          key: "first",
          onEnter: this.handleEnter,
          onEntering: this.handleEntering,
          onEntered: this.handleEntered
        }) : _react.default.cloneElement(second2, {
          key: "second",
          onEnter: this.handleExit,
          onEntering: this.handleExiting,
          onEntered: this.handleExited
        }));
      };
      return ReplaceTransition2;
    }(_react.default.Component);
    ReplaceTransition.propTypes = true ? {
      in: _propTypes.default.bool.isRequired,
      children: function children(props, propName) {
        if (_react.default.Children.count(props[propName]) !== 2)
          return new Error('"' + propName + '" must be exactly two transition components.');
        return null;
      }
    } : {};
    var _default = ReplaceTransition;
    exports.default = _default;
    module.exports = exports["default"];
  }
});

// node_modules/react-smooth/node_modules/react-transition-group/index.js
var require_react_transition_group = __commonJS({
  "node_modules/react-smooth/node_modules/react-transition-group/index.js"(exports, module) {
    "use strict";
    var _CSSTransition = _interopRequireDefault(require_CSSTransition());
    var _ReplaceTransition = _interopRequireDefault(require_ReplaceTransition());
    var _TransitionGroup = _interopRequireDefault(require_TransitionGroup());
    var _Transition = _interopRequireDefault(require_Transition());
    function _interopRequireDefault(obj) {
      return obj && obj.__esModule ? obj : { default: obj };
    }
    module.exports = {
      Transition: _Transition.default,
      TransitionGroup: _TransitionGroup.default,
      ReplaceTransition: _ReplaceTransition.default,
      CSSTransition: _CSSTransition.default
    };
  }
});

// node_modules/lodash/_isFlattenable.js
var require_isFlattenable = __commonJS({
  "node_modules/lodash/_isFlattenable.js"(exports, module) {
    var Symbol3 = require_Symbol();
    var isArguments = require_isArguments();
    var isArray2 = require_isArray();
    var spreadableSymbol = Symbol3 ? Symbol3.isConcatSpreadable : void 0;
    function isFlattenable(value) {
      return isArray2(value) || isArguments(value) || !!(spreadableSymbol && value && value[spreadableSymbol]);
    }
    module.exports = isFlattenable;
  }
});

// node_modules/lodash/_baseFlatten.js
var require_baseFlatten = __commonJS({
  "node_modules/lodash/_baseFlatten.js"(exports, module) {
    var arrayPush = require_arrayPush();
    var isFlattenable = require_isFlattenable();
    function baseFlatten(array, depth, predicate, isStrict, result) {
      var index = -1, length2 = array.length;
      predicate || (predicate = isFlattenable);
      result || (result = []);
      while (++index < length2) {
        var value = array[index];
        if (depth > 0 && predicate(value)) {
          if (depth > 1) {
            baseFlatten(value, depth - 1, predicate, isStrict, result);
          } else {
            arrayPush(result, value);
          }
        } else if (!isStrict) {
          result[result.length] = value;
        }
      }
      return result;
    }
    module.exports = baseFlatten;
  }
});

// node_modules/lodash/_createBaseFor.js
var require_createBaseFor = __commonJS({
  "node_modules/lodash/_createBaseFor.js"(exports, module) {
    function createBaseFor(fromRight) {
      return function(object, iteratee, keysFunc) {
        var index = -1, iterable = Object(object), props = keysFunc(object), length2 = props.length;
        while (length2--) {
          var key = props[fromRight ? length2 : ++index];
          if (iteratee(iterable[key], key, iterable) === false) {
            break;
          }
        }
        return object;
      };
    }
    module.exports = createBaseFor;
  }
});

// node_modules/lodash/_baseFor.js
var require_baseFor = __commonJS({
  "node_modules/lodash/_baseFor.js"(exports, module) {
    var createBaseFor = require_createBaseFor();
    var baseFor = createBaseFor();
    module.exports = baseFor;
  }
});

// node_modules/lodash/_baseForOwn.js
var require_baseForOwn = __commonJS({
  "node_modules/lodash/_baseForOwn.js"(exports, module) {
    var baseFor = require_baseFor();
    var keys4 = require_keys();
    function baseForOwn(object, iteratee) {
      return object && baseFor(object, iteratee, keys4);
    }
    module.exports = baseForOwn;
  }
});

// node_modules/lodash/_createBaseEach.js
var require_createBaseEach = __commonJS({
  "node_modules/lodash/_createBaseEach.js"(exports, module) {
    var isArrayLike = require_isArrayLike();
    function createBaseEach(eachFunc, fromRight) {
      return function(collection, iteratee) {
        if (collection == null) {
          return collection;
        }
        if (!isArrayLike(collection)) {
          return eachFunc(collection, iteratee);
        }
        var length2 = collection.length, index = fromRight ? length2 : -1, iterable = Object(collection);
        while (fromRight ? index-- : ++index < length2) {
          if (iteratee(iterable[index], index, iterable) === false) {
            break;
          }
        }
        return collection;
      };
    }
    module.exports = createBaseEach;
  }
});

// node_modules/lodash/_baseEach.js
var require_baseEach = __commonJS({
  "node_modules/lodash/_baseEach.js"(exports, module) {
    var baseForOwn = require_baseForOwn();
    var createBaseEach = require_createBaseEach();
    var baseEach = createBaseEach(baseForOwn);
    module.exports = baseEach;
  }
});

// node_modules/lodash/_baseMap.js
var require_baseMap = __commonJS({
  "node_modules/lodash/_baseMap.js"(exports, module) {
    var baseEach = require_baseEach();
    var isArrayLike = require_isArrayLike();
    function baseMap(collection, iteratee) {
      var index = -1, result = isArrayLike(collection) ? Array(collection.length) : [];
      baseEach(collection, function(value, key, collection2) {
        result[++index] = iteratee(value, key, collection2);
      });
      return result;
    }
    module.exports = baseMap;
  }
});

// node_modules/lodash/_baseSortBy.js
var require_baseSortBy = __commonJS({
  "node_modules/lodash/_baseSortBy.js"(exports, module) {
    function baseSortBy(array, comparer) {
      var length2 = array.length;
      array.sort(comparer);
      while (length2--) {
        array[length2] = array[length2].value;
      }
      return array;
    }
    module.exports = baseSortBy;
  }
});

// node_modules/lodash/_compareAscending.js
var require_compareAscending = __commonJS({
  "node_modules/lodash/_compareAscending.js"(exports, module) {
    var isSymbol = require_isSymbol();
    function compareAscending(value, other) {
      if (value !== other) {
        var valIsDefined = value !== void 0, valIsNull = value === null, valIsReflexive = value === value, valIsSymbol = isSymbol(value);
        var othIsDefined = other !== void 0, othIsNull = other === null, othIsReflexive = other === other, othIsSymbol = isSymbol(other);
        if (!othIsNull && !othIsSymbol && !valIsSymbol && value > other || valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol || valIsNull && othIsDefined && othIsReflexive || !valIsDefined && othIsReflexive || !valIsReflexive) {
          return 1;
        }
        if (!valIsNull && !valIsSymbol && !othIsSymbol && value < other || othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol || othIsNull && valIsDefined && valIsReflexive || !othIsDefined && valIsReflexive || !othIsReflexive) {
          return -1;
        }
      }
      return 0;
    }
    module.exports = compareAscending;
  }
});

// node_modules/lodash/_compareMultiple.js
var require_compareMultiple = __commonJS({
  "node_modules/lodash/_compareMultiple.js"(exports, module) {
    var compareAscending = require_compareAscending();
    function compareMultiple(object, other, orders) {
      var index = -1, objCriteria = object.criteria, othCriteria = other.criteria, length2 = objCriteria.length, ordersLength = orders.length;
      while (++index < length2) {
        var result = compareAscending(objCriteria[index], othCriteria[index]);
        if (result) {
          if (index >= ordersLength) {
            return result;
          }
          var order = orders[index];
          return result * (order == "desc" ? -1 : 1);
        }
      }
      return object.index - other.index;
    }
    module.exports = compareMultiple;
  }
});

// node_modules/lodash/_baseOrderBy.js
var require_baseOrderBy = __commonJS({
  "node_modules/lodash/_baseOrderBy.js"(exports, module) {
    var arrayMap = require_arrayMap();
    var baseGet2 = require_baseGet();
    var baseIteratee = require_baseIteratee();
    var baseMap = require_baseMap();
    var baseSortBy = require_baseSortBy();
    var baseUnary = require_baseUnary();
    var compareMultiple = require_compareMultiple();
    var identity7 = require_identity();
    var isArray2 = require_isArray();
    function baseOrderBy(collection, iteratees, orders) {
      if (iteratees.length) {
        iteratees = arrayMap(iteratees, function(iteratee) {
          if (isArray2(iteratee)) {
            return function(value) {
              return baseGet2(value, iteratee.length === 1 ? iteratee[0] : iteratee);
            };
          }
          return iteratee;
        });
      } else {
        iteratees = [identity7];
      }
      var index = -1;
      iteratees = arrayMap(iteratees, baseUnary(baseIteratee));
      var result = baseMap(collection, function(value, key, collection2) {
        var criteria = arrayMap(iteratees, function(iteratee) {
          return iteratee(value);
        });
        return { "criteria": criteria, "index": ++index, "value": value };
      });
      return baseSortBy(result, function(object, other) {
        return compareMultiple(object, other, orders);
      });
    }
    module.exports = baseOrderBy;
  }
});

// node_modules/lodash/_apply.js
var require_apply = __commonJS({
  "node_modules/lodash/_apply.js"(exports, module) {
    function apply(func, thisArg, args) {
      switch (args.length) {
        case 0:
          return func.call(thisArg);
        case 1:
          return func.call(thisArg, args[0]);
        case 2:
          return func.call(thisArg, args[0], args[1]);
        case 3:
          return func.call(thisArg, args[0], args[1], args[2]);
      }
      return func.apply(thisArg, args);
    }
    module.exports = apply;
  }
});

// node_modules/lodash/_overRest.js
var require_overRest = __commonJS({
  "node_modules/lodash/_overRest.js"(exports, module) {
    var apply = require_apply();
    var nativeMax = Math.max;
    function overRest(func, start, transform) {
      start = nativeMax(start === void 0 ? func.length - 1 : start, 0);
      return function() {
        var args = arguments, index = -1, length2 = nativeMax(args.length - start, 0), array = Array(length2);
        while (++index < length2) {
          array[index] = args[start + index];
        }
        index = -1;
        var otherArgs = Array(start + 1);
        while (++index < start) {
          otherArgs[index] = args[index];
        }
        otherArgs[start] = transform(array);
        return apply(func, this, otherArgs);
      };
    }
    module.exports = overRest;
  }
});

// node_modules/lodash/constant.js
var require_constant = __commonJS({
  "node_modules/lodash/constant.js"(exports, module) {
    function constant(value) {
      return function() {
        return value;
      };
    }
    module.exports = constant;
  }
});

// node_modules/lodash/_defineProperty.js
var require_defineProperty2 = __commonJS({
  "node_modules/lodash/_defineProperty.js"(exports, module) {
    var getNative = require_getNative();
    var defineProperty = function() {
      try {
        var func = getNative(Object, "defineProperty");
        func({}, "", {});
        return func;
      } catch (e3) {
      }
    }();
    module.exports = defineProperty;
  }
});

// node_modules/lodash/_baseSetToString.js
var require_baseSetToString = __commonJS({
  "node_modules/lodash/_baseSetToString.js"(exports, module) {
    var constant = require_constant();
    var defineProperty = require_defineProperty2();
    var identity7 = require_identity();
    var baseSetToString = !defineProperty ? identity7 : function(func, string2) {
      return defineProperty(func, "toString", {
        "configurable": true,
        "enumerable": false,
        "value": constant(string2),
        "writable": true
      });
    };
    module.exports = baseSetToString;
  }
});

// node_modules/lodash/_shortOut.js
var require_shortOut = __commonJS({
  "node_modules/lodash/_shortOut.js"(exports, module) {
    var HOT_COUNT = 800;
    var HOT_SPAN = 16;
    var nativeNow = Date.now;
    function shortOut(func) {
      var count2 = 0, lastCalled = 0;
      return function() {
        var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled);
        lastCalled = stamp;
        if (remaining > 0) {
          if (++count2 >= HOT_COUNT) {
            return arguments[0];
          }
        } else {
          count2 = 0;
        }
        return func.apply(void 0, arguments);
      };
    }
    module.exports = shortOut;
  }
});

// node_modules/lodash/_setToString.js
var require_setToString = __commonJS({
  "node_modules/lodash/_setToString.js"(exports, module) {
    var baseSetToString = require_baseSetToString();
    var shortOut = require_shortOut();
    var setToString = shortOut(baseSetToString);
    module.exports = setToString;
  }
});

// node_modules/lodash/_baseRest.js
var require_baseRest = __commonJS({
  "node_modules/lodash/_baseRest.js"(exports, module) {
    var identity7 = require_identity();
    var overRest = require_overRest();
    var setToString = require_setToString();
    function baseRest(func, start) {
      return setToString(overRest(func, start, identity7), func + "");
    }
    module.exports = baseRest;
  }
});

// node_modules/lodash/_isIterateeCall.js
var require_isIterateeCall = __commonJS({
  "node_modules/lodash/_isIterateeCall.js"(exports, module) {
    var eq = require_eq();
    var isArrayLike = require_isArrayLike();
    var isIndex = require_isIndex();
    var isObject2 = require_isObject();
    function isIterateeCall(value, index, object) {
      if (!isObject2(object)) {
        return false;
      }
      var type = typeof index;
      if (type == "number" ? isArrayLike(object) && isIndex(index, object.length) : type == "string" && index in object) {
        return eq(object[index], value);
      }
      return false;
    }
    module.exports = isIterateeCall;
  }
});

// node_modules/lodash/sortBy.js
var require_sortBy = __commonJS({
  "node_modules/lodash/sortBy.js"(exports, module) {
    var baseFlatten = require_baseFlatten();
    var baseOrderBy = require_baseOrderBy();
    var baseRest = require_baseRest();
    var isIterateeCall = require_isIterateeCall();
    var sortBy = baseRest(function(collection, iteratees) {
      if (collection == null) {
        return [];
      }
      var length2 = iteratees.length;
      if (length2 > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
        iteratees = [];
      } else if (length2 > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
        iteratees = [iteratees[0]];
      }
      return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
    });
    module.exports = sortBy;
  }
});

// node_modules/lodash/now.js
var require_now = __commonJS({
  "node_modules/lodash/now.js"(exports, module) {
    var root2 = require_root();
    var now2 = function() {
      return root2.Date.now();
    };
    module.exports = now2;
  }
});

// node_modules/lodash/_trimmedEndIndex.js
var require_trimmedEndIndex = __commonJS({
  "node_modules/lodash/_trimmedEndIndex.js"(exports, module) {
    var reWhitespace = /\s/;
    function trimmedEndIndex(string2) {
      var index = string2.length;
      while (index-- && reWhitespace.test(string2.charAt(index))) {
      }
      return index;
    }
    module.exports = trimmedEndIndex;
  }
});

// node_modules/lodash/_baseTrim.js
var require_baseTrim = __commonJS({
  "node_modules/lodash/_baseTrim.js"(exports, module) {
    var trimmedEndIndex = require_trimmedEndIndex();
    var reTrimStart = /^\s+/;
    function baseTrim(string2) {
      return string2 ? string2.slice(0, trimmedEndIndex(string2) + 1).replace(reTrimStart, "") : string2;
    }
    module.exports = baseTrim;
  }
});

// node_modules/lodash/toNumber.js
var require_toNumber = __commonJS({
  "node_modules/lodash/toNumber.js"(exports, module) {
    var baseTrim = require_baseTrim();
    var isObject2 = require_isObject();
    var isSymbol = require_isSymbol();
    var NAN = 0 / 0;
    var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
    var reIsBinary = /^0b[01]+$/i;
    var reIsOctal = /^0o[0-7]+$/i;
    var freeParseInt = parseInt;
    function toNumber(value) {
      if (typeof value == "number") {
        return value;
      }
      if (isSymbol(value)) {
        return NAN;
      }
      if (isObject2(value)) {
        var other = typeof value.valueOf == "function" ? value.valueOf() : value;
        value = isObject2(other) ? other + "" : other;
      }
      if (typeof value != "string") {
        return value === 0 ? value : +value;
      }
      value = baseTrim(value);
      var isBinary = reIsBinary.test(value);
      return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
    }
    module.exports = toNumber;
  }
});

// node_modules/lodash/debounce.js
var require_debounce2 = __commonJS({
  "node_modules/lodash/debounce.js"(exports, module) {
    var isObject2 = require_isObject();
    var now2 = require_now();
    var toNumber = require_toNumber();
    var FUNC_ERROR_TEXT = "Expected a function";
    var nativeMax = Math.max;
    var nativeMin = Math.min;
    function debounce4(func, wait, options) {
      var lastArgs, lastThis, maxWait, result, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true;
      if (typeof func != "function") {
        throw new TypeError(FUNC_ERROR_TEXT);
      }
      wait = toNumber(wait) || 0;
      if (isObject2(options)) {
        leading = !!options.leading;
        maxing = "maxWait" in options;
        maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
        trailing = "trailing" in options ? !!options.trailing : trailing;
      }
      function invokeFunc(time2) {
        var args = lastArgs, thisArg = lastThis;
        lastArgs = lastThis = void 0;
        lastInvokeTime = time2;
        result = func.apply(thisArg, args);
        return result;
      }
      function leadingEdge(time2) {
        lastInvokeTime = time2;
        timerId = setTimeout(timerExpired, wait);
        return leading ? invokeFunc(time2) : result;
      }
      function remainingWait(time2) {
        var timeSinceLastCall = time2 - lastCallTime, timeSinceLastInvoke = time2 - lastInvokeTime, timeWaiting = wait - timeSinceLastCall;
        return maxing ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting;
      }
      function shouldInvoke(time2) {
        var timeSinceLastCall = time2 - lastCallTime, timeSinceLastInvoke = time2 - lastInvokeTime;
        return lastCallTime === void 0 || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;
      }
      function timerExpired() {
        var time2 = now2();
        if (shouldInvoke(time2)) {
          return trailingEdge(time2);
        }
        timerId = setTimeout(timerExpired, remainingWait(time2));
      }
      function trailingEdge(time2) {
        timerId = void 0;
        if (trailing && lastArgs) {
          return invokeFunc(time2);
        }
        lastArgs = lastThis = void 0;
        return result;
      }
      function cancel() {
        if (timerId !== void 0) {
          clearTimeout(timerId);
        }
        lastInvokeTime = 0;
        lastArgs = lastCallTime = lastThis = timerId = void 0;
      }
      function flush() {
        return timerId === void 0 ? result : trailingEdge(now2());
      }
      function debounced() {
        var time2 = now2(), isInvoking = shouldInvoke(time2);
        lastArgs = arguments;
        lastThis = this;
        lastCallTime = time2;
        if (isInvoking) {
          if (timerId === void 0) {
            return leadingEdge(lastCallTime);
          }
          if (maxing) {
            clearTimeout(timerId);
            timerId = setTimeout(timerExpired, wait);
            return invokeFunc(lastCallTime);
          }
        }
        if (timerId === void 0) {
          timerId = setTimeout(timerExpired, wait);
        }
        return result;
      }
      debounced.cancel = cancel;
      debounced.flush = flush;
      return debounced;
    }
    module.exports = debounce4;
  }
});

// node_modules/lodash/throttle.js
var require_throttle = __commonJS({
  "node_modules/lodash/throttle.js"(exports, module) {
    var debounce4 = require_debounce2();
    var isObject2 = require_isObject();
    var FUNC_ERROR_TEXT = "Expected a function";
    function throttle2(func, wait, options) {
      var leading = true, trailing = true;
      if (typeof func != "function") {
        throw new TypeError(FUNC_ERROR_TEXT);
      }
      if (isObject2(options)) {
        leading = "leading" in options ? !!options.leading : leading;
        trailing = "trailing" in options ? !!options.trailing : trailing;
      }
      return debounce4(func, wait, {
        "leading": leading,
        "maxWait": wait,
        "trailing": trailing
      });
    }
    module.exports = throttle2;
  }
});

// node_modules/lodash/isEqual.js
var require_isEqual = __commonJS({
  "node_modules/lodash/isEqual.js"(exports, module) {
    var baseIsEqual = require_baseIsEqual();
    function isEqual(value, other) {
      return baseIsEqual(value, other);
    }
    module.exports = isEqual;
  }
});

// node_modules/lodash/_baseExtremum.js
var require_baseExtremum = __commonJS({
  "node_modules/lodash/_baseExtremum.js"(exports, module) {
    var isSymbol = require_isSymbol();
    function baseExtremum(array, iteratee, comparator) {
      var index = -1, length2 = array.length;
      while (++index < length2) {
        var value = array[index], current = iteratee(value);
        if (current != null && (computed === void 0 ? current === current && !isSymbol(current) : comparator(current, computed))) {
          var computed = current, result = value;
        }
      }
      return result;
    }
    module.exports = baseExtremum;
  }
});

// node_modules/lodash/_baseGt.js
var require_baseGt = __commonJS({
  "node_modules/lodash/_baseGt.js"(exports, module) {
    function baseGt(value, other) {
      return value > other;
    }
    module.exports = baseGt;
  }
});

// node_modules/lodash/max.js
var require_max = __commonJS({
  "node_modules/lodash/max.js"(exports, module) {
    var baseExtremum = require_baseExtremum();
    var baseGt = require_baseGt();
    var identity7 = require_identity();
    function max3(array) {
      return array && array.length ? baseExtremum(array, identity7, baseGt) : void 0;
    }
    module.exports = max3;
  }
});

// node_modules/lodash/_baseLt.js
var require_baseLt = __commonJS({
  "node_modules/lodash/_baseLt.js"(exports, module) {
    function baseLt(value, other) {
      return value < other;
    }
    module.exports = baseLt;
  }
});

// node_modules/lodash/min.js
var require_min = __commonJS({
  "node_modules/lodash/min.js"(exports, module) {
    var baseExtremum = require_baseExtremum();
    var baseLt = require_baseLt();
    var identity7 = require_identity();
    function min3(array) {
      return array && array.length ? baseExtremum(array, identity7, baseLt) : void 0;
    }
    module.exports = min3;
  }
});

// node_modules/lodash/map.js
var require_map = __commonJS({
  "node_modules/lodash/map.js"(exports, module) {
    var arrayMap = require_arrayMap();
    var baseIteratee = require_baseIteratee();
    var baseMap = require_baseMap();
    var isArray2 = require_isArray();
    function map3(collection, iteratee) {
      var func = isArray2(collection) ? arrayMap : baseMap;
      return func(collection, baseIteratee(iteratee, 3));
    }
    module.exports = map3;
  }
});

// node_modules/lodash/flatMap.js
var require_flatMap = __commonJS({
  "node_modules/lodash/flatMap.js"(exports, module) {
    var baseFlatten = require_baseFlatten();
    var map3 = require_map();
    function flatMap(collection, iteratee) {
      return baseFlatten(map3(collection, iteratee), 1);
    }
    module.exports = flatMap;
  }
});

// node_modules/decimal.js-light/decimal.js
var require_decimal = __commonJS({
  "node_modules/decimal.js-light/decimal.js"(exports, module) {
    (function(globalScope) {
      "use strict";
      var MAX_DIGITS = 1e9, Decimal3 = {
        // These values must be integers within the stated ranges (inclusive).
        // Most of these values can be changed during run-time using `Decimal.config`.
        // The maximum number of significant digits of the result of a calculation or base conversion.
        // E.g. `Decimal.config({ precision: 20 });`
        precision: 20,
        // 1 to MAX_DIGITS
        // The rounding mode used by default by `toInteger`, `toDecimalPlaces`, `toExponential`,
        // `toFixed`, `toPrecision` and `toSignificantDigits`.
        //
        // ROUND_UP         0 Away from zero.
        // ROUND_DOWN       1 Towards zero.
        // ROUND_CEIL       2 Towards +Infinity.
        // ROUND_FLOOR      3 Towards -Infinity.
        // ROUND_HALF_UP    4 Towards nearest neighbour. If equidistant, up.
        // ROUND_HALF_DOWN  5 Towards nearest neighbour. If equidistant, down.
        // ROUND_HALF_EVEN  6 Towards nearest neighbour. If equidistant, towards even neighbour.
        // ROUND_HALF_CEIL  7 Towards nearest neighbour. If equidistant, towards +Infinity.
        // ROUND_HALF_FLOOR 8 Towards nearest neighbour. If equidistant, towards -Infinity.
        //
        // E.g.
        // `Decimal.rounding = 4;`
        // `Decimal.rounding = Decimal.ROUND_HALF_UP;`
        rounding: 4,
        // 0 to 8
        // The exponent value at and beneath which `toString` returns exponential notation.
        // JavaScript numbers: -7
        toExpNeg: -7,
        // 0 to -MAX_E
        // The exponent value at and above which `toString` returns exponential notation.
        // JavaScript numbers: 21
        toExpPos: 21,
        // 0 to MAX_E
        // The natural logarithm of 10.
        // 115 digits
        LN10: "2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"
      }, external = true, decimalError = "[DecimalError] ", invalidArgument = decimalError + "Invalid argument: ", exponentOutOfRange = decimalError + "Exponent out of range: ", mathfloor = Math.floor, mathpow = Math.pow, isDecimal = /^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i, ONE, BASE = 1e7, LOG_BASE = 7, MAX_SAFE_INTEGER = 9007199254740991, MAX_E = mathfloor(MAX_SAFE_INTEGER / LOG_BASE), P = {};
      P.absoluteValue = P.abs = function() {
        var x2 = new this.constructor(this);
        if (x2.s)
          x2.s = 1;
        return x2;
      };
      P.comparedTo = P.cmp = function(y2) {
        var i2, j, xdL, ydL, x2 = this;
        y2 = new x2.constructor(y2);
        if (x2.s !== y2.s)
          return x2.s || -y2.s;
        if (x2.e !== y2.e)
          return x2.e > y2.e ^ x2.s < 0 ? 1 : -1;
        xdL = x2.d.length;
        ydL = y2.d.length;
        for (i2 = 0, j = xdL < ydL ? xdL : ydL; i2 < j; ++i2) {
          if (x2.d[i2] !== y2.d[i2])
            return x2.d[i2] > y2.d[i2] ^ x2.s < 0 ? 1 : -1;
        }
        return xdL === ydL ? 0 : xdL > ydL ^ x2.s < 0 ? 1 : -1;
      };
      P.decimalPlaces = P.dp = function() {
        var x2 = this, w = x2.d.length - 1, dp = (w - x2.e) * LOG_BASE;
        w = x2.d[w];
        if (w)
          for (; w % 10 == 0; w /= 10)
            dp--;
        return dp < 0 ? 0 : dp;
      };
      P.dividedBy = P.div = function(y2) {
        return divide(this, new this.constructor(y2));
      };
      P.dividedToIntegerBy = P.idiv = function(y2) {
        var x2 = this, Ctor = x2.constructor;
        return round(divide(x2, new Ctor(y2), 0, 1), Ctor.precision);
      };
      P.equals = P.eq = function(y2) {
        return !this.cmp(y2);
      };
      P.exponent = function() {
        return getBase10Exponent(this);
      };
      P.greaterThan = P.gt = function(y2) {
        return this.cmp(y2) > 0;
      };
      P.greaterThanOrEqualTo = P.gte = function(y2) {
        return this.cmp(y2) >= 0;
      };
      P.isInteger = P.isint = function() {
        return this.e > this.d.length - 2;
      };
      P.isNegative = P.isneg = function() {
        return this.s < 0;
      };
      P.isPositive = P.ispos = function() {
        return this.s > 0;
      };
      P.isZero = function() {
        return this.s === 0;
      };
      P.lessThan = P.lt = function(y2) {
        return this.cmp(y2) < 0;
      };
      P.lessThanOrEqualTo = P.lte = function(y2) {
        return this.cmp(y2) < 1;
      };
      P.logarithm = P.log = function(base2) {
        var r3, x2 = this, Ctor = x2.constructor, pr = Ctor.precision, wpr = pr + 5;
        if (base2 === void 0) {
          base2 = new Ctor(10);
        } else {
          base2 = new Ctor(base2);
          if (base2.s < 1 || base2.eq(ONE))
            throw Error(decimalError + "NaN");
        }
        if (x2.s < 1)
          throw Error(decimalError + (x2.s ? "NaN" : "-Infinity"));
        if (x2.eq(ONE))
          return new Ctor(0);
        external = false;
        r3 = divide(ln(x2, wpr), ln(base2, wpr), wpr);
        external = true;
        return round(r3, pr);
      };
      P.minus = P.sub = function(y2) {
        var x2 = this;
        y2 = new x2.constructor(y2);
        return x2.s == y2.s ? subtract(x2, y2) : add2(x2, (y2.s = -y2.s, y2));
      };
      P.modulo = P.mod = function(y2) {
        var q, x2 = this, Ctor = x2.constructor, pr = Ctor.precision;
        y2 = new Ctor(y2);
        if (!y2.s)
          throw Error(decimalError + "NaN");
        if (!x2.s)
          return round(new Ctor(x2), pr);
        external = false;
        q = divide(x2, y2, 0, 1).times(y2);
        external = true;
        return x2.minus(q);
      };
      P.naturalExponential = P.exp = function() {
        return exp(this);
      };
      P.naturalLogarithm = P.ln = function() {
        return ln(this);
      };
      P.negated = P.neg = function() {
        var x2 = new this.constructor(this);
        x2.s = -x2.s || 0;
        return x2;
      };
      P.plus = P.add = function(y2) {
        var x2 = this;
        y2 = new x2.constructor(y2);
        return x2.s == y2.s ? add2(x2, y2) : subtract(x2, (y2.s = -y2.s, y2));
      };
      P.precision = P.sd = function(z) {
        var e3, sd, w, x2 = this;
        if (z !== void 0 && z !== !!z && z !== 1 && z !== 0)
          throw Error(invalidArgument + z);
        e3 = getBase10Exponent(x2) + 1;
        w = x2.d.length - 1;
        sd = w * LOG_BASE + 1;
        w = x2.d[w];
        if (w) {
          for (; w % 10 == 0; w /= 10)
            sd--;
          for (w = x2.d[0]; w >= 10; w /= 10)
            sd++;
        }
        return z && e3 > sd ? e3 : sd;
      };
      P.squareRoot = P.sqrt = function() {
        var e3, n2, pr, r3, s2, t3, wpr, x2 = this, Ctor = x2.constructor;
        if (x2.s < 1) {
          if (!x2.s)
            return new Ctor(0);
          throw Error(decimalError + "NaN");
        }
        e3 = getBase10Exponent(x2);
        external = false;
        s2 = Math.sqrt(+x2);
        if (s2 == 0 || s2 == 1 / 0) {
          n2 = digitsToString(x2.d);
          if ((n2.length + e3) % 2 == 0)
            n2 += "0";
          s2 = Math.sqrt(n2);
          e3 = mathfloor((e3 + 1) / 2) - (e3 < 0 || e3 % 2);
          if (s2 == 1 / 0) {
            n2 = "5e" + e3;
          } else {
            n2 = s2.toExponential();
            n2 = n2.slice(0, n2.indexOf("e") + 1) + e3;
          }
          r3 = new Ctor(n2);
        } else {
          r3 = new Ctor(s2.toString());
        }
        pr = Ctor.precision;
        s2 = wpr = pr + 3;
        for (; ; ) {
          t3 = r3;
          r3 = t3.plus(divide(x2, t3, wpr + 2)).times(0.5);
          if (digitsToString(t3.d).slice(0, wpr) === (n2 = digitsToString(r3.d)).slice(0, wpr)) {
            n2 = n2.slice(wpr - 3, wpr + 1);
            if (s2 == wpr && n2 == "4999") {
              round(t3, pr + 1, 0);
              if (t3.times(t3).eq(x2)) {
                r3 = t3;
                break;
              }
            } else if (n2 != "9999") {
              break;
            }
            wpr += 4;
          }
        }
        external = true;
        return round(r3, pr);
      };
      P.times = P.mul = function(y2) {
        var carry, e3, i2, k2, r3, rL, t3, xdL, ydL, x2 = this, Ctor = x2.constructor, xd = x2.d, yd = (y2 = new Ctor(y2)).d;
        if (!x2.s || !y2.s)
          return new Ctor(0);
        y2.s *= x2.s;
        e3 = x2.e + y2.e;
        xdL = xd.length;
        ydL = yd.length;
        if (xdL < ydL) {
          r3 = xd;
          xd = yd;
          yd = r3;
          rL = xdL;
          xdL = ydL;
          ydL = rL;
        }
        r3 = [];
        rL = xdL + ydL;
        for (i2 = rL; i2--; )
          r3.push(0);
        for (i2 = ydL; --i2 >= 0; ) {
          carry = 0;
          for (k2 = xdL + i2; k2 > i2; ) {
            t3 = r3[k2] + yd[i2] * xd[k2 - i2 - 1] + carry;
            r3[k2--] = t3 % BASE | 0;
            carry = t3 / BASE | 0;
          }
          r3[k2] = (r3[k2] + carry) % BASE | 0;
        }
        for (; !r3[--rL]; )
          r3.pop();
        if (carry)
          ++e3;
        else
          r3.shift();
        y2.d = r3;
        y2.e = e3;
        return external ? round(y2, Ctor.precision) : y2;
      };
      P.toDecimalPlaces = P.todp = function(dp, rm2) {
        var x2 = this, Ctor = x2.constructor;
        x2 = new Ctor(x2);
        if (dp === void 0)
          return x2;
        checkInt32(dp, 0, MAX_DIGITS);
        if (rm2 === void 0)
          rm2 = Ctor.rounding;
        else
          checkInt32(rm2, 0, 8);
        return round(x2, dp + getBase10Exponent(x2) + 1, rm2);
      };
      P.toExponential = function(dp, rm2) {
        var str, x2 = this, Ctor = x2.constructor;
        if (dp === void 0) {
          str = toString2(x2, true);
        } else {
          checkInt32(dp, 0, MAX_DIGITS);
          if (rm2 === void 0)
            rm2 = Ctor.rounding;
          else
            checkInt32(rm2, 0, 8);
          x2 = round(new Ctor(x2), dp + 1, rm2);
          str = toString2(x2, true, dp + 1);
        }
        return str;
      };
      P.toFixed = function(dp, rm2) {
        var str, y2, x2 = this, Ctor = x2.constructor;
        if (dp === void 0)
          return toString2(x2);
        checkInt32(dp, 0, MAX_DIGITS);
        if (rm2 === void 0)
          rm2 = Ctor.rounding;
        else
          checkInt32(rm2, 0, 8);
        y2 = round(new Ctor(x2), dp + getBase10Exponent(x2) + 1, rm2);
        str = toString2(y2.abs(), false, dp + getBase10Exponent(y2) + 1);
        return x2.isneg() && !x2.isZero() ? "-" + str : str;
      };
      P.toInteger = P.toint = function() {
        var x2 = this, Ctor = x2.constructor;
        return round(new Ctor(x2), getBase10Exponent(x2) + 1, Ctor.rounding);
      };
      P.toNumber = function() {
        return +this;
      };
      P.toPower = P.pow = function(y2) {
        var e3, k2, pr, r3, sign3, yIsInt, x2 = this, Ctor = x2.constructor, guard2 = 12, yn = +(y2 = new Ctor(y2));
        if (!y2.s)
          return new Ctor(ONE);
        x2 = new Ctor(x2);
        if (!x2.s) {
          if (y2.s < 1)
            throw Error(decimalError + "Infinity");
          return x2;
        }
        if (x2.eq(ONE))
          return x2;
        pr = Ctor.precision;
        if (y2.eq(ONE))
          return round(x2, pr);
        e3 = y2.e;
        k2 = y2.d.length - 1;
        yIsInt = e3 >= k2;
        sign3 = x2.s;
        if (!yIsInt) {
          if (sign3 < 0)
            throw Error(decimalError + "NaN");
        } else if ((k2 = yn < 0 ? -yn : yn) <= MAX_SAFE_INTEGER) {
          r3 = new Ctor(ONE);
          e3 = Math.ceil(pr / LOG_BASE + 4);
          external = false;
          for (; ; ) {
            if (k2 % 2) {
              r3 = r3.times(x2);
              truncate(r3.d, e3);
            }
            k2 = mathfloor(k2 / 2);
            if (k2 === 0)
              break;
            x2 = x2.times(x2);
            truncate(x2.d, e3);
          }
          external = true;
          return y2.s < 0 ? new Ctor(ONE).div(r3) : round(r3, pr);
        }
        sign3 = sign3 < 0 && y2.d[Math.max(e3, k2)] & 1 ? -1 : 1;
        x2.s = 1;
        external = false;
        r3 = y2.times(ln(x2, pr + guard2));
        external = true;
        r3 = exp(r3);
        r3.s = sign3;
        return r3;
      };
      P.toPrecision = function(sd, rm2) {
        var e3, str, x2 = this, Ctor = x2.constructor;
        if (sd === void 0) {
          e3 = getBase10Exponent(x2);
          str = toString2(x2, e3 <= Ctor.toExpNeg || e3 >= Ctor.toExpPos);
        } else {
          checkInt32(sd, 1, MAX_DIGITS);
          if (rm2 === void 0)
            rm2 = Ctor.rounding;
          else
            checkInt32(rm2, 0, 8);
          x2 = round(new Ctor(x2), sd, rm2);
          e3 = getBase10Exponent(x2);
          str = toString2(x2, sd <= e3 || e3 <= Ctor.toExpNeg, sd);
        }
        return str;
      };
      P.toSignificantDigits = P.tosd = function(sd, rm2) {
        var x2 = this, Ctor = x2.constructor;
        if (sd === void 0) {
          sd = Ctor.precision;
          rm2 = Ctor.rounding;
        } else {
          checkInt32(sd, 1, MAX_DIGITS);
          if (rm2 === void 0)
            rm2 = Ctor.rounding;
          else
            checkInt32(rm2, 0, 8);
        }
        return round(new Ctor(x2), sd, rm2);
      };
      P.toString = P.valueOf = P.val = P.toJSON = function() {
        var x2 = this, e3 = getBase10Exponent(x2), Ctor = x2.constructor;
        return toString2(x2, e3 <= Ctor.toExpNeg || e3 >= Ctor.toExpPos);
      };
      function add2(x2, y2) {
        var carry, d, e3, i2, k2, len, xd, yd, Ctor = x2.constructor, pr = Ctor.precision;
        if (!x2.s || !y2.s) {
          if (!y2.s)
            y2 = new Ctor(x2);
          return external ? round(y2, pr) : y2;
        }
        xd = x2.d;
        yd = y2.d;
        k2 = x2.e;
        e3 = y2.e;
        xd = xd.slice();
        i2 = k2 - e3;
        if (i2) {
          if (i2 < 0) {
            d = xd;
            i2 = -i2;
            len = yd.length;
          } else {
            d = yd;
            e3 = k2;
            len = xd.length;
          }
          k2 = Math.ceil(pr / LOG_BASE);
          len = k2 > len ? k2 + 1 : len + 1;
          if (i2 > len) {
            i2 = len;
            d.length = 1;
          }
          d.reverse();
          for (; i2--; )
            d.push(0);
          d.reverse();
        }
        len = xd.length;
        i2 = yd.length;
        if (len - i2 < 0) {
          i2 = len;
          d = yd;
          yd = xd;
          xd = d;
        }
        for (carry = 0; i2; ) {
          carry = (xd[--i2] = xd[i2] + yd[i2] + carry) / BASE | 0;
          xd[i2] %= BASE;
        }
        if (carry) {
          xd.unshift(carry);
          ++e3;
        }
        for (len = xd.length; xd[--len] == 0; )
          xd.pop();
        y2.d = xd;
        y2.e = e3;
        return external ? round(y2, pr) : y2;
      }
      function checkInt32(i2, min3, max3) {
        if (i2 !== ~~i2 || i2 < min3 || i2 > max3) {
          throw Error(invalidArgument + i2);
        }
      }
      function digitsToString(d) {
        var i2, k2, ws, indexOfLastWord = d.length - 1, str = "", w = d[0];
        if (indexOfLastWord > 0) {
          str += w;
          for (i2 = 1; i2 < indexOfLastWord; i2++) {
            ws = d[i2] + "";
            k2 = LOG_BASE - ws.length;
            if (k2)
              str += getZeroString(k2);
            str += ws;
          }
          w = d[i2];
          ws = w + "";
          k2 = LOG_BASE - ws.length;
          if (k2)
            str += getZeroString(k2);
        } else if (w === 0) {
          return "0";
        }
        for (; w % 10 === 0; )
          w /= 10;
        return str + w;
      }
      var divide = function() {
        function multiplyInteger(x2, k2) {
          var temp, carry = 0, i2 = x2.length;
          for (x2 = x2.slice(); i2--; ) {
            temp = x2[i2] * k2 + carry;
            x2[i2] = temp % BASE | 0;
            carry = temp / BASE | 0;
          }
          if (carry)
            x2.unshift(carry);
          return x2;
        }
        function compare2(a2, b, aL, bL) {
          var i2, r3;
          if (aL != bL) {
            r3 = aL > bL ? 1 : -1;
          } else {
            for (i2 = r3 = 0; i2 < aL; i2++) {
              if (a2[i2] != b[i2]) {
                r3 = a2[i2] > b[i2] ? 1 : -1;
                break;
              }
            }
          }
          return r3;
        }
        function subtract2(a2, b, aL) {
          var i2 = 0;
          for (; aL--; ) {
            a2[aL] -= i2;
            i2 = a2[aL] < b[aL] ? 1 : 0;
            a2[aL] = i2 * BASE + a2[aL] - b[aL];
          }
          for (; !a2[0] && a2.length > 1; )
            a2.shift();
        }
        return function(x2, y2, pr, dp) {
          var cmp, e3, i2, k2, prod, prodL, q, qd, rem, remL, rem0, sd, t3, xi, xL, yd0, yL, yz, Ctor = x2.constructor, sign3 = x2.s == y2.s ? 1 : -1, xd = x2.d, yd = y2.d;
          if (!x2.s)
            return new Ctor(x2);
          if (!y2.s)
            throw Error(decimalError + "Division by zero");
          e3 = x2.e - y2.e;
          yL = yd.length;
          xL = xd.length;
          q = new Ctor(sign3);
          qd = q.d = [];
          for (i2 = 0; yd[i2] == (xd[i2] || 0); )
            ++i2;
          if (yd[i2] > (xd[i2] || 0))
            --e3;
          if (pr == null) {
            sd = pr = Ctor.precision;
          } else if (dp) {
            sd = pr + (getBase10Exponent(x2) - getBase10Exponent(y2)) + 1;
          } else {
            sd = pr;
          }
          if (sd < 0)
            return new Ctor(0);
          sd = sd / LOG_BASE + 2 | 0;
          i2 = 0;
          if (yL == 1) {
            k2 = 0;
            yd = yd[0];
            sd++;
            for (; (i2 < xL || k2) && sd--; i2++) {
              t3 = k2 * BASE + (xd[i2] || 0);
              qd[i2] = t3 / yd | 0;
              k2 = t3 % yd | 0;
            }
          } else {
            k2 = BASE / (yd[0] + 1) | 0;
            if (k2 > 1) {
              yd = multiplyInteger(yd, k2);
              xd = multiplyInteger(xd, k2);
              yL = yd.length;
              xL = xd.length;
            }
            xi = yL;
            rem = xd.slice(0, yL);
            remL = rem.length;
            for (; remL < yL; )
              rem[remL++] = 0;
            yz = yd.slice();
            yz.unshift(0);
            yd0 = yd[0];
            if (yd[1] >= BASE / 2)
              ++yd0;
            do {
              k2 = 0;
              cmp = compare2(yd, rem, yL, remL);
              if (cmp < 0) {
                rem0 = rem[0];
                if (yL != remL)
                  rem0 = rem0 * BASE + (rem[1] || 0);
                k2 = rem0 / yd0 | 0;
                if (k2 > 1) {
                  if (k2 >= BASE)
                    k2 = BASE - 1;
                  prod = multiplyInteger(yd, k2);
                  prodL = prod.length;
                  remL = rem.length;
                  cmp = compare2(prod, rem, prodL, remL);
                  if (cmp == 1) {
                    k2--;
                    subtract2(prod, yL < prodL ? yz : yd, prodL);
                  }
                } else {
                  if (k2 == 0)
                    cmp = k2 = 1;
                  prod = yd.slice();
                }
                prodL = prod.length;
                if (prodL < remL)
                  prod.unshift(0);
                subtract2(rem, prod, remL);
                if (cmp == -1) {
                  remL = rem.length;
                  cmp = compare2(yd, rem, yL, remL);
                  if (cmp < 1) {
                    k2++;
                    subtract2(rem, yL < remL ? yz : yd, remL);
                  }
                }
                remL = rem.length;
              } else if (cmp === 0) {
                k2++;
                rem = [0];
              }
              qd[i2++] = k2;
              if (cmp && rem[0]) {
                rem[remL++] = xd[xi] || 0;
              } else {
                rem = [xd[xi]];
                remL = 1;
              }
            } while ((xi++ < xL || rem[0] !== void 0) && sd--);
          }
          if (!qd[0])
            qd.shift();
          q.e = e3;
          return round(q, dp ? pr + getBase10Exponent(q) + 1 : pr);
        };
      }();
      function exp(x2, sd) {
        var denominator, guard2, pow2, sum2, t3, wpr, i2 = 0, k2 = 0, Ctor = x2.constructor, pr = Ctor.precision;
        if (getBase10Exponent(x2) > 16)
          throw Error(exponentOutOfRange + getBase10Exponent(x2));
        if (!x2.s)
          return new Ctor(ONE);
        if (sd == null) {
          external = false;
          wpr = pr;
        } else {
          wpr = sd;
        }
        t3 = new Ctor(0.03125);
        while (x2.abs().gte(0.1)) {
          x2 = x2.times(t3);
          k2 += 5;
        }
        guard2 = Math.log(mathpow(2, k2)) / Math.LN10 * 2 + 5 | 0;
        wpr += guard2;
        denominator = pow2 = sum2 = new Ctor(ONE);
        Ctor.precision = wpr;
        for (; ; ) {
          pow2 = round(pow2.times(x2), wpr);
          denominator = denominator.times(++i2);
          t3 = sum2.plus(divide(pow2, denominator, wpr));
          if (digitsToString(t3.d).slice(0, wpr) === digitsToString(sum2.d).slice(0, wpr)) {
            while (k2--)
              sum2 = round(sum2.times(sum2), wpr);
            Ctor.precision = pr;
            return sd == null ? (external = true, round(sum2, pr)) : sum2;
          }
          sum2 = t3;
        }
      }
      function getBase10Exponent(x2) {
        var e3 = x2.e * LOG_BASE, w = x2.d[0];
        for (; w >= 10; w /= 10)
          e3++;
        return e3;
      }
      function getLn10(Ctor, sd, pr) {
        if (sd > Ctor.LN10.sd()) {
          external = true;
          if (pr)
            Ctor.precision = pr;
          throw Error(decimalError + "LN10 precision limit exceeded");
        }
        return round(new Ctor(Ctor.LN10), sd);
      }
      function getZeroString(k2) {
        var zs = "";
        for (; k2--; )
          zs += "0";
        return zs;
      }
      function ln(y2, sd) {
        var c4, c0, denominator, e3, numerator, sum2, t3, wpr, x2, n2 = 1, guard2 = 10, x3 = y2, xd = x3.d, Ctor = x3.constructor, pr = Ctor.precision;
        if (x3.s < 1)
          throw Error(decimalError + (x3.s ? "NaN" : "-Infinity"));
        if (x3.eq(ONE))
          return new Ctor(0);
        if (sd == null) {
          external = false;
          wpr = pr;
        } else {
          wpr = sd;
        }
        if (x3.eq(10)) {
          if (sd == null)
            external = true;
          return getLn10(Ctor, wpr);
        }
        wpr += guard2;
        Ctor.precision = wpr;
        c4 = digitsToString(xd);
        c0 = c4.charAt(0);
        e3 = getBase10Exponent(x3);
        if (Math.abs(e3) < 15e14) {
          while (c0 < 7 && c0 != 1 || c0 == 1 && c4.charAt(1) > 3) {
            x3 = x3.times(y2);
            c4 = digitsToString(x3.d);
            c0 = c4.charAt(0);
            n2++;
          }
          e3 = getBase10Exponent(x3);
          if (c0 > 1) {
            x3 = new Ctor("0." + c4);
            e3++;
          } else {
            x3 = new Ctor(c0 + "." + c4.slice(1));
          }
        } else {
          t3 = getLn10(Ctor, wpr + 2, pr).times(e3 + "");
          x3 = ln(new Ctor(c0 + "." + c4.slice(1)), wpr - guard2).plus(t3);
          Ctor.precision = pr;
          return sd == null ? (external = true, round(x3, pr)) : x3;
        }
        sum2 = numerator = x3 = divide(x3.minus(ONE), x3.plus(ONE), wpr);
        x2 = round(x3.times(x3), wpr);
        denominator = 3;
        for (; ; ) {
          numerator = round(numerator.times(x2), wpr);
          t3 = sum2.plus(divide(numerator, new Ctor(denominator), wpr));
          if (digitsToString(t3.d).slice(0, wpr) === digitsToString(sum2.d).slice(0, wpr)) {
            sum2 = sum2.times(2);
            if (e3 !== 0)
              sum2 = sum2.plus(getLn10(Ctor, wpr + 2, pr).times(e3 + ""));
            sum2 = divide(sum2, new Ctor(n2), wpr);
            Ctor.precision = pr;
            return sd == null ? (external = true, round(sum2, pr)) : sum2;
          }
          sum2 = t3;
          denominator += 2;
        }
      }
      function parseDecimal(x2, str) {
        var e3, i2, len;
        if ((e3 = str.indexOf(".")) > -1)
          str = str.replace(".", "");
        if ((i2 = str.search(/e/i)) > 0) {
          if (e3 < 0)
            e3 = i2;
          e3 += +str.slice(i2 + 1);
          str = str.substring(0, i2);
        } else if (e3 < 0) {
          e3 = str.length;
        }
        for (i2 = 0; str.charCodeAt(i2) === 48; )
          ++i2;
        for (len = str.length; str.charCodeAt(len - 1) === 48; )
          --len;
        str = str.slice(i2, len);
        if (str) {
          len -= i2;
          e3 = e3 - i2 - 1;
          x2.e = mathfloor(e3 / LOG_BASE);
          x2.d = [];
          i2 = (e3 + 1) % LOG_BASE;
          if (e3 < 0)
            i2 += LOG_BASE;
          if (i2 < len) {
            if (i2)
              x2.d.push(+str.slice(0, i2));
            for (len -= LOG_BASE; i2 < len; )
              x2.d.push(+str.slice(i2, i2 += LOG_BASE));
            str = str.slice(i2);
            i2 = LOG_BASE - str.length;
          } else {
            i2 -= len;
          }
          for (; i2--; )
            str += "0";
          x2.d.push(+str);
          if (external && (x2.e > MAX_E || x2.e < -MAX_E))
            throw Error(exponentOutOfRange + e3);
        } else {
          x2.s = 0;
          x2.e = 0;
          x2.d = [0];
        }
        return x2;
      }
      function round(x2, sd, rm2) {
        var i2, j, k2, n2, rd, doRound, w, xdi, xd = x2.d;
        for (n2 = 1, k2 = xd[0]; k2 >= 10; k2 /= 10)
          n2++;
        i2 = sd - n2;
        if (i2 < 0) {
          i2 += LOG_BASE;
          j = sd;
          w = xd[xdi = 0];
        } else {
          xdi = Math.ceil((i2 + 1) / LOG_BASE);
          k2 = xd.length;
          if (xdi >= k2)
            return x2;
          w = k2 = xd[xdi];
          for (n2 = 1; k2 >= 10; k2 /= 10)
            n2++;
          i2 %= LOG_BASE;
          j = i2 - LOG_BASE + n2;
        }
        if (rm2 !== void 0) {
          k2 = mathpow(10, n2 - j - 1);
          rd = w / k2 % 10 | 0;
          doRound = sd < 0 || xd[xdi + 1] !== void 0 || w % k2;
          doRound = rm2 < 4 ? (rd || doRound) && (rm2 == 0 || rm2 == (x2.s < 0 ? 3 : 2)) : rd > 5 || rd == 5 && (rm2 == 4 || doRound || rm2 == 6 && // Check whether the digit to the left of the rounding digit is odd.
          (i2 > 0 ? j > 0 ? w / mathpow(10, n2 - j) : 0 : xd[xdi - 1]) % 10 & 1 || rm2 == (x2.s < 0 ? 8 : 7));
        }
        if (sd < 1 || !xd[0]) {
          if (doRound) {
            k2 = getBase10Exponent(x2);
            xd.length = 1;
            sd = sd - k2 - 1;
            xd[0] = mathpow(10, (LOG_BASE - sd % LOG_BASE) % LOG_BASE);
            x2.e = mathfloor(-sd / LOG_BASE) || 0;
          } else {
            xd.length = 1;
            xd[0] = x2.e = x2.s = 0;
          }
          return x2;
        }
        if (i2 == 0) {
          xd.length = xdi;
          k2 = 1;
          xdi--;
        } else {
          xd.length = xdi + 1;
          k2 = mathpow(10, LOG_BASE - i2);
          xd[xdi] = j > 0 ? (w / mathpow(10, n2 - j) % mathpow(10, j) | 0) * k2 : 0;
        }
        if (doRound) {
          for (; ; ) {
            if (xdi == 0) {
              if ((xd[0] += k2) == BASE) {
                xd[0] = 1;
                ++x2.e;
              }
              break;
            } else {
              xd[xdi] += k2;
              if (xd[xdi] != BASE)
                break;
              xd[xdi--] = 0;
              k2 = 1;
            }
          }
        }
        for (i2 = xd.length; xd[--i2] === 0; )
          xd.pop();
        if (external && (x2.e > MAX_E || x2.e < -MAX_E)) {
          throw Error(exponentOutOfRange + getBase10Exponent(x2));
        }
        return x2;
      }
      function subtract(x2, y2) {
        var d, e3, i2, j, k2, len, xd, xe, xLTy, yd, Ctor = x2.constructor, pr = Ctor.precision;
        if (!x2.s || !y2.s) {
          if (y2.s)
            y2.s = -y2.s;
          else
            y2 = new Ctor(x2);
          return external ? round(y2, pr) : y2;
        }
        xd = x2.d;
        yd = y2.d;
        e3 = y2.e;
        xe = x2.e;
        xd = xd.slice();
        k2 = xe - e3;
        if (k2) {
          xLTy = k2 < 0;
          if (xLTy) {
            d = xd;
            k2 = -k2;
            len = yd.length;
          } else {
            d = yd;
            e3 = xe;
            len = xd.length;
          }
          i2 = Math.max(Math.ceil(pr / LOG_BASE), len) + 2;
          if (k2 > i2) {
            k2 = i2;
            d.length = 1;
          }
          d.reverse();
          for (i2 = k2; i2--; )
            d.push(0);
          d.reverse();
        } else {
          i2 = xd.length;
          len = yd.length;
          xLTy = i2 < len;
          if (xLTy)
            len = i2;
          for (i2 = 0; i2 < len; i2++) {
            if (xd[i2] != yd[i2]) {
              xLTy = xd[i2] < yd[i2];
              break;
            }
          }
          k2 = 0;
        }
        if (xLTy) {
          d = xd;
          xd = yd;
          yd = d;
          y2.s = -y2.s;
        }
        len = xd.length;
        for (i2 = yd.length - len; i2 > 0; --i2)
          xd[len++] = 0;
        for (i2 = yd.length; i2 > k2; ) {
          if (xd[--i2] < yd[i2]) {
            for (j = i2; j && xd[--j] === 0; )
              xd[j] = BASE - 1;
            --xd[j];
            xd[i2] += BASE;
          }
          xd[i2] -= yd[i2];
        }
        for (; xd[--len] === 0; )
          xd.pop();
        for (; xd[0] === 0; xd.shift())
          --e3;
        if (!xd[0])
          return new Ctor(0);
        y2.d = xd;
        y2.e = e3;
        return external ? round(y2, pr) : y2;
      }
      function toString2(x2, isExp, sd) {
        var k2, e3 = getBase10Exponent(x2), str = digitsToString(x2.d), len = str.length;
        if (isExp) {
          if (sd && (k2 = sd - len) > 0) {
            str = str.charAt(0) + "." + str.slice(1) + getZeroString(k2);
          } else if (len > 1) {
            str = str.charAt(0) + "." + str.slice(1);
          }
          str = str + (e3 < 0 ? "e" : "e+") + e3;
        } else if (e3 < 0) {
          str = "0." + getZeroString(-e3 - 1) + str;
          if (sd && (k2 = sd - len) > 0)
            str += getZeroString(k2);
        } else if (e3 >= len) {
          str += getZeroString(e3 + 1 - len);
          if (sd && (k2 = sd - e3 - 1) > 0)
            str = str + "." + getZeroString(k2);
        } else {
          if ((k2 = e3 + 1) < len)
            str = str.slice(0, k2) + "." + str.slice(k2);
          if (sd && (k2 = sd - len) > 0) {
            if (e3 + 1 === len)
              str += ".";
            str += getZeroString(k2);
          }
        }
        return x2.s < 0 ? "-" + str : str;
      }
      function truncate(arr, len) {
        if (arr.length > len) {
          arr.length = len;
          return true;
        }
      }
      function clone(obj) {
        var i2, p, ps;
        function Decimal4(value) {
          var x2 = this;
          if (!(x2 instanceof Decimal4))
            return new Decimal4(value);
          x2.constructor = Decimal4;
          if (value instanceof Decimal4) {
            x2.s = value.s;
            x2.e = value.e;
            x2.d = (value = value.d) ? value.slice() : value;
            return;
          }
          if (typeof value === "number") {
            if (value * 0 !== 0) {
              throw Error(invalidArgument + value);
            }
            if (value > 0) {
              x2.s = 1;
            } else if (value < 0) {
              value = -value;
              x2.s = -1;
            } else {
              x2.s = 0;
              x2.e = 0;
              x2.d = [0];
              return;
            }
            if (value === ~~value && value < 1e7) {
              x2.e = 0;
              x2.d = [value];
              return;
            }
            return parseDecimal(x2, value.toString());
          } else if (typeof value !== "string") {
            throw Error(invalidArgument + value);
          }
          if (value.charCodeAt(0) === 45) {
            value = value.slice(1);
            x2.s = -1;
          } else {
            x2.s = 1;
          }
          if (isDecimal.test(value))
            parseDecimal(x2, value);
          else
            throw Error(invalidArgument + value);
        }
        Decimal4.prototype = P;
        Decimal4.ROUND_UP = 0;
        Decimal4.ROUND_DOWN = 1;
        Decimal4.ROUND_CEIL = 2;
        Decimal4.ROUND_FLOOR = 3;
        Decimal4.ROUND_HALF_UP = 4;
        Decimal4.ROUND_HALF_DOWN = 5;
        Decimal4.ROUND_HALF_EVEN = 6;
        Decimal4.ROUND_HALF_CEIL = 7;
        Decimal4.ROUND_HALF_FLOOR = 8;
        Decimal4.clone = clone;
        Decimal4.config = Decimal4.set = config2;
        if (obj === void 0)
          obj = {};
        if (obj) {
          ps = ["precision", "rounding", "toExpNeg", "toExpPos", "LN10"];
          for (i2 = 0; i2 < ps.length; )
            if (!obj.hasOwnProperty(p = ps[i2++]))
              obj[p] = this[p];
        }
        Decimal4.config(obj);
        return Decimal4;
      }
      function config2(obj) {
        if (!obj || typeof obj !== "object") {
          throw Error(decimalError + "Object expected");
        }
        var i2, p, v4, ps = [
          "precision",
          1,
          MAX_DIGITS,
          "rounding",
          0,
          8,
          "toExpNeg",
          -1 / 0,
          0,
          "toExpPos",
          0,
          1 / 0
        ];
        for (i2 = 0; i2 < ps.length; i2 += 3) {
          if ((v4 = obj[p = ps[i2]]) !== void 0) {
            if (mathfloor(v4) === v4 && v4 >= ps[i2 + 1] && v4 <= ps[i2 + 2])
              this[p] = v4;
            else
              throw Error(invalidArgument + p + ": " + v4);
          }
        }
        if ((v4 = obj[p = "LN10"]) !== void 0) {
          if (v4 == Math.LN10)
            this[p] = new this(v4);
          else
            throw Error(invalidArgument + p + ": " + v4);
        }
        return this;
      }
      Decimal3 = clone(Decimal3);
      Decimal3["default"] = Decimal3.Decimal = Decimal3;
      ONE = new Decimal3(1);
      if (typeof define == "function" && define.amd) {
        define(function() {
          return Decimal3;
        });
      } else if (typeof module != "undefined" && module.exports) {
        module.exports = Decimal3;
      } else {
        if (!globalScope) {
          globalScope = typeof self != "undefined" && self && self.self == self ? self : Function("return this")();
        }
        globalScope.Decimal = Decimal3;
      }
    })(exports);
  }
});

// node_modules/lodash/last.js
var require_last = __commonJS({
  "node_modules/lodash/last.js"(exports, module) {
    function last(array) {
      var length2 = array == null ? 0 : array.length;
      return length2 ? array[length2 - 1] : void 0;
    }
    module.exports = last;
  }
});

// node_modules/lodash/minBy.js
var require_minBy = __commonJS({
  "node_modules/lodash/minBy.js"(exports, module) {
    var baseExtremum = require_baseExtremum();
    var baseIteratee = require_baseIteratee();
    var baseLt = require_baseLt();
    function minBy(array, iteratee) {
      return array && array.length ? baseExtremum(array, baseIteratee(iteratee, 2), baseLt) : void 0;
    }
    module.exports = minBy;
  }
});

// node_modules/lodash/maxBy.js
var require_maxBy = __commonJS({
  "node_modules/lodash/maxBy.js"(exports, module) {
    var baseExtremum = require_baseExtremum();
    var baseGt = require_baseGt();
    var baseIteratee = require_baseIteratee();
    function maxBy(array, iteratee) {
      return array && array.length ? baseExtremum(array, baseIteratee(iteratee, 2), baseGt) : void 0;
    }
    module.exports = maxBy;
  }
});

// node_modules/lodash/isBoolean.js
var require_isBoolean = __commonJS({
  "node_modules/lodash/isBoolean.js"(exports, module) {
    var baseGetTag = require_baseGetTag();
    var isObjectLike = require_isObjectLike();
    var boolTag = "[object Boolean]";
    function isBoolean2(value) {
      return value === true || value === false || isObjectLike(value) && baseGetTag(value) == boolTag;
    }
    module.exports = isBoolean2;
  }
});

// node_modules/lodash/_getPrototype.js
var require_getPrototype = __commonJS({
  "node_modules/lodash/_getPrototype.js"(exports, module) {
    var overArg = require_overArg();
    var getPrototype = overArg(Object.getPrototypeOf, Object);
    module.exports = getPrototype;
  }
});

// node_modules/lodash/isPlainObject.js
var require_isPlainObject = __commonJS({
  "node_modules/lodash/isPlainObject.js"(exports, module) {
    var baseGetTag = require_baseGetTag();
    var getPrototype = require_getPrototype();
    var isObjectLike = require_isObjectLike();
    var objectTag = "[object Object]";
    var funcProto = Function.prototype;
    var objectProto = Object.prototype;
    var funcToString = funcProto.toString;
    var hasOwnProperty3 = objectProto.hasOwnProperty;
    var objectCtorString = funcToString.call(Object);
    function isPlainObject2(value) {
      if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
        return false;
      }
      var proto = getPrototype(value);
      if (proto === null) {
        return true;
      }
      var Ctor = hasOwnProperty3.call(proto, "constructor") && proto.constructor;
      return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString;
    }
    module.exports = isPlainObject2;
  }
});

// node_modules/lodash/_baseRange.js
var require_baseRange = __commonJS({
  "node_modules/lodash/_baseRange.js"(exports, module) {
    var nativeCeil = Math.ceil;
    var nativeMax = Math.max;
    function baseRange(start, end, step, fromRight) {
      var index = -1, length2 = nativeMax(nativeCeil((end - start) / (step || 1)), 0), result = Array(length2);
      while (length2--) {
        result[fromRight ? length2 : ++index] = start;
        start += step;
      }
      return result;
    }
    module.exports = baseRange;
  }
});

// node_modules/lodash/toFinite.js
var require_toFinite = __commonJS({
  "node_modules/lodash/toFinite.js"(exports, module) {
    var toNumber = require_toNumber();
    var INFINITY = 1 / 0;
    var MAX_INTEGER = 17976931348623157e292;
    function toFinite(value) {
      if (!value) {
        return value === 0 ? value : 0;
      }
      value = toNumber(value);
      if (value === INFINITY || value === -INFINITY) {
        var sign3 = value < 0 ? -1 : 1;
        return sign3 * MAX_INTEGER;
      }
      return value === value ? value : 0;
    }
    module.exports = toFinite;
  }
});

// node_modules/lodash/_createRange.js
var require_createRange = __commonJS({
  "node_modules/lodash/_createRange.js"(exports, module) {
    var baseRange = require_baseRange();
    var isIterateeCall = require_isIterateeCall();
    var toFinite = require_toFinite();
    function createRange(fromRight) {
      return function(start, end, step) {
        if (step && typeof step != "number" && isIterateeCall(start, end, step)) {
          end = step = void 0;
        }
        start = toFinite(start);
        if (end === void 0) {
          end = start;
          start = 0;
        } else {
          end = toFinite(end);
        }
        step = step === void 0 ? start < end ? 1 : -1 : toFinite(step);
        return baseRange(start, end, step, fromRight);
      };
    }
    module.exports = createRange;
  }
});

// node_modules/lodash/range.js
var require_range = __commonJS({
  "node_modules/lodash/range.js"(exports, module) {
    var createRange = require_createRange();
    var range4 = createRange();
    module.exports = range4;
  }
});

// node_modules/lodash/_baseSome.js
var require_baseSome = __commonJS({
  "node_modules/lodash/_baseSome.js"(exports, module) {
    var baseEach = require_baseEach();
    function baseSome(collection, predicate) {
      var result;
      baseEach(collection, function(value, index, collection2) {
        result = predicate(value, index, collection2);
        return !result;
      });
      return !!result;
    }
    module.exports = baseSome;
  }
});

// node_modules/lodash/some.js
var require_some = __commonJS({
  "node_modules/lodash/some.js"(exports, module) {
    var arraySome = require_arraySome();
    var baseIteratee = require_baseIteratee();
    var baseSome = require_baseSome();
    var isArray2 = require_isArray();
    var isIterateeCall = require_isIterateeCall();
    function some(collection, predicate, guard2) {
      var func = isArray2(collection) ? arraySome : baseSome;
      if (guard2 && isIterateeCall(collection, predicate, guard2)) {
        predicate = void 0;
      }
      return func(collection, baseIteratee(predicate, 3));
    }
    module.exports = some;
  }
});

// node_modules/lodash/_arrayEvery.js
var require_arrayEvery = __commonJS({
  "node_modules/lodash/_arrayEvery.js"(exports, module) {
    function arrayEvery(array, predicate) {
      var index = -1, length2 = array == null ? 0 : array.length;
      while (++index < length2) {
        if (!predicate(array[index], index, array)) {
          return false;
        }
      }
      return true;
    }
    module.exports = arrayEvery;
  }
});

// node_modules/lodash/_baseEvery.js
var require_baseEvery = __commonJS({
  "node_modules/lodash/_baseEvery.js"(exports, module) {
    var baseEach = require_baseEach();
    function baseEvery(collection, predicate) {
      var result = true;
      baseEach(collection, function(value, index, collection2) {
        result = !!predicate(value, index, collection2);
        return result;
      });
      return result;
    }
    module.exports = baseEvery;
  }
});

// node_modules/lodash/every.js
var require_every = __commonJS({
  "node_modules/lodash/every.js"(exports, module) {
    var arrayEvery = require_arrayEvery();
    var baseEvery = require_baseEvery();
    var baseIteratee = require_baseIteratee();
    var isArray2 = require_isArray();
    var isIterateeCall = require_isIterateeCall();
    function every(collection, predicate, guard2) {
      var func = isArray2(collection) ? arrayEvery : baseEvery;
      if (guard2 && isIterateeCall(collection, predicate, guard2)) {
        predicate = void 0;
      }
      return func(collection, baseIteratee(predicate, 3));
    }
    module.exports = every;
  }
});

// node_modules/lodash/_baseAssignValue.js
var require_baseAssignValue = __commonJS({
  "node_modules/lodash/_baseAssignValue.js"(exports, module) {
    var defineProperty = require_defineProperty2();
    function baseAssignValue(object, key, value) {
      if (key == "__proto__" && defineProperty) {
        defineProperty(object, key, {
          "configurable": true,
          "enumerable": true,
          "value": value,
          "writable": true
        });
      } else {
        object[key] = value;
      }
    }
    module.exports = baseAssignValue;
  }
});

// node_modules/lodash/mapValues.js
var require_mapValues = __commonJS({
  "node_modules/lodash/mapValues.js"(exports, module) {
    var baseAssignValue = require_baseAssignValue();
    var baseForOwn = require_baseForOwn();
    var baseIteratee = require_baseIteratee();
    function mapValues(object, iteratee) {
      var result = {};
      iteratee = baseIteratee(iteratee, 3);
      baseForOwn(object, function(value, key, object2) {
        baseAssignValue(result, key, iteratee(value, key, object2));
      });
      return result;
    }
    module.exports = mapValues;
  }
});

// node_modules/lodash/_createFind.js
var require_createFind = __commonJS({
  "node_modules/lodash/_createFind.js"(exports, module) {
    var baseIteratee = require_baseIteratee();
    var isArrayLike = require_isArrayLike();
    var keys4 = require_keys();
    function createFind(findIndexFunc) {
      return function(collection, predicate, fromIndex) {
        var iterable = Object(collection);
        if (!isArrayLike(collection)) {
          var iteratee = baseIteratee(predicate, 3);
          collection = keys4(collection);
          predicate = function(key) {
            return iteratee(iterable[key], key, iterable);
          };
        }
        var index = findIndexFunc(collection, predicate, fromIndex);
        return index > -1 ? iterable[iteratee ? collection[index] : index] : void 0;
      };
    }
    module.exports = createFind;
  }
});

// node_modules/lodash/toInteger.js
var require_toInteger = __commonJS({
  "node_modules/lodash/toInteger.js"(exports, module) {
    var toFinite = require_toFinite();
    function toInteger2(value) {
      var result = toFinite(value), remainder = result % 1;
      return result === result ? remainder ? result - remainder : result : 0;
    }
    module.exports = toInteger2;
  }
});

// node_modules/lodash/findIndex.js
var require_findIndex = __commonJS({
  "node_modules/lodash/findIndex.js"(exports, module) {
    var baseFindIndex = require_baseFindIndex();
    var baseIteratee = require_baseIteratee();
    var toInteger2 = require_toInteger();
    var nativeMax = Math.max;
    function findIndex(array, predicate, fromIndex) {
      var length2 = array == null ? 0 : array.length;
      if (!length2) {
        return -1;
      }
      var index = fromIndex == null ? 0 : toInteger2(fromIndex);
      if (index < 0) {
        index = nativeMax(length2 + index, 0);
      }
      return baseFindIndex(array, baseIteratee(predicate, 3), index);
    }
    module.exports = findIndex;
  }
});

// node_modules/lodash/find.js
var require_find = __commonJS({
  "node_modules/lodash/find.js"(exports, module) {
    var createFind = require_createFind();
    var findIndex = require_findIndex();
    var find3 = createFind(findIndex);
    module.exports = find3;
  }
});

// node_modules/eventemitter3/index.js
var require_eventemitter3 = __commonJS({
  "node_modules/eventemitter3/index.js"(exports, module) {
    "use strict";
    var has2 = Object.prototype.hasOwnProperty;
    var prefix3 = "~";
    function Events() {
    }
    if (Object.create) {
      Events.prototype = /* @__PURE__ */ Object.create(null);
      if (!new Events().__proto__)
        prefix3 = false;
    }
    function EE(fn, context2, once) {
      this.fn = fn;
      this.context = context2;
      this.once = once || false;
    }
    function addListener(emitter, event, fn, context2, once) {
      if (typeof fn !== "function") {
        throw new TypeError("The listener must be a function");
      }
      var listener = new EE(fn, context2 || emitter, once), evt = prefix3 ? prefix3 + event : event;
      if (!emitter._events[evt])
        emitter._events[evt] = listener, emitter._eventsCount++;
      else if (!emitter._events[evt].fn)
        emitter._events[evt].push(listener);
      else
        emitter._events[evt] = [emitter._events[evt], listener];
      return emitter;
    }
    function clearEvent(emitter, evt) {
      if (--emitter._eventsCount === 0)
        emitter._events = new Events();
      else
        delete emitter._events[evt];
    }
    function EventEmitter2() {
      this._events = new Events();
      this._eventsCount = 0;
    }
    EventEmitter2.prototype.eventNames = function eventNames() {
      var names = [], events, name2;
      if (this._eventsCount === 0)
        return names;
      for (name2 in events = this._events) {
        if (has2.call(events, name2))
          names.push(prefix3 ? name2.slice(1) : name2);
      }
      if (Object.getOwnPropertySymbols) {
        return names.concat(Object.getOwnPropertySymbols(events));
      }
      return names;
    };
    EventEmitter2.prototype.listeners = function listeners(event) {
      var evt = prefix3 ? prefix3 + event : event, handlers2 = this._events[evt];
      if (!handlers2)
        return [];
      if (handlers2.fn)
        return [handlers2.fn];
      for (var i2 = 0, l = handlers2.length, ee = new Array(l); i2 < l; i2++) {
        ee[i2] = handlers2[i2].fn;
      }
      return ee;
    };
    EventEmitter2.prototype.listenerCount = function listenerCount(event) {
      var evt = prefix3 ? prefix3 + event : event, listeners = this._events[evt];
      if (!listeners)
        return 0;
      if (listeners.fn)
        return 1;
      return listeners.length;
    };
    EventEmitter2.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {
      var evt = prefix3 ? prefix3 + event : event;
      if (!this._events[evt])
        return false;
      var listeners = this._events[evt], len = arguments.length, args, i2;
      if (listeners.fn) {
        if (listeners.once)
          this.removeListener(event, listeners.fn, void 0, true);
        switch (len) {
          case 1:
            return listeners.fn.call(listeners.context), true;
          case 2:
            return listeners.fn.call(listeners.context, a1), true;
          case 3:
            return listeners.fn.call(listeners.context, a1, a2), true;
          case 4:
            return listeners.fn.call(listeners.context, a1, a2, a3), true;
          case 5:
            return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;
          case 6:
            return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;
        }
        for (i2 = 1, args = new Array(len - 1); i2 < len; i2++) {
          args[i2 - 1] = arguments[i2];
        }
        listeners.fn.apply(listeners.context, args);
      } else {
        var length2 = listeners.length, j;
        for (i2 = 0; i2 < length2; i2++) {
          if (listeners[i2].once)
            this.removeListener(event, listeners[i2].fn, void 0, true);
          switch (len) {
            case 1:
              listeners[i2].fn.call(listeners[i2].context);
              break;
            case 2:
              listeners[i2].fn.call(listeners[i2].context, a1);
              break;
            case 3:
              listeners[i2].fn.call(listeners[i2].context, a1, a2);
              break;
            case 4:
              listeners[i2].fn.call(listeners[i2].context, a1, a2, a3);
              break;
            default:
              if (!args)
                for (j = 1, args = new Array(len - 1); j < len; j++) {
                  args[j - 1] = arguments[j];
                }
              listeners[i2].fn.apply(listeners[i2].context, args);
          }
        }
      }
      return true;
    };
    EventEmitter2.prototype.on = function on(event, fn, context2) {
      return addListener(this, event, fn, context2, false);
    };
    EventEmitter2.prototype.once = function once(event, fn, context2) {
      return addListener(this, event, fn, context2, true);
    };
    EventEmitter2.prototype.removeListener = function removeListener(event, fn, context2, once) {
      var evt = prefix3 ? prefix3 + event : event;
      if (!this._events[evt])
        return this;
      if (!fn) {
        clearEvent(this, evt);
        return this;
      }
      var listeners = this._events[evt];
      if (listeners.fn) {
        if (listeners.fn === fn && (!once || listeners.once) && (!context2 || listeners.context === context2)) {
          clearEvent(this, evt);
        }
      } else {
        for (var i2 = 0, events = [], length2 = listeners.length; i2 < length2; i2++) {
          if (listeners[i2].fn !== fn || once && !listeners[i2].once || context2 && listeners[i2].context !== context2) {
            events.push(listeners[i2]);
          }
        }
        if (events.length)
          this._events[evt] = events.length === 1 ? events[0] : events;
        else
          clearEvent(this, evt);
      }
      return this;
    };
    EventEmitter2.prototype.removeAllListeners = function removeAllListeners(event) {
      var evt;
      if (event) {
        evt = prefix3 ? prefix3 + event : event;
        if (this._events[evt])
          clearEvent(this, evt);
      } else {
        this._events = new Events();
        this._eventsCount = 0;
      }
      return this;
    };
    EventEmitter2.prototype.off = EventEmitter2.prototype.removeListener;
    EventEmitter2.prototype.addListener = EventEmitter2.prototype.on;
    EventEmitter2.prefixed = prefix3;
    EventEmitter2.EventEmitter = EventEmitter2;
    if ("undefined" !== typeof module) {
      module.exports = EventEmitter2;
    }
  }
});

// src/components/model/__generated__/ModelSchemaTableDimensionsQuery.graphql.ts
var ModelSchemaTableDimensionsQuery_graphql_exports = {};
__export(ModelSchemaTableDimensionsQuery_graphql_exports, {
  default: () => ModelSchemaTableDimensionsQuery_graphql_default
});
var node25, ModelSchemaTableDimensionsQuery_graphql_default;
var init_ModelSchemaTableDimensionsQuery_graphql = __esm({
  "src/components/model/__generated__/ModelSchemaTableDimensionsQuery.graphql.ts"() {
    "use strict";
    node25 = function() {
      var v0 = [
        {
          "defaultValue": 50,
          "kind": "LocalArgument",
          "name": "count"
        },
        {
          "defaultValue": null,
          "kind": "LocalArgument",
          "name": "cursor"
        },
        {
          "defaultValue": null,
          "kind": "LocalArgument",
          "name": "endTime"
        },
        {
          "defaultValue": null,
          "kind": "LocalArgument",
          "name": "startTime"
        }
      ], v12 = [
        {
          "kind": "Variable",
          "name": "after",
          "variableName": "cursor"
        },
        {
          "kind": "Variable",
          "name": "first",
          "variableName": "count"
        }
      ], v22 = {
        "fields": [
          {
            "kind": "Variable",
            "name": "end",
            "variableName": "endTime"
          },
          {
            "kind": "Variable",
            "name": "start",
            "variableName": "startTime"
          }
        ],
        "kind": "ObjectValue",
        "name": "timeRange"
      };
      return {
        "fragment": {
          "argumentDefinitions": v0,
          "kind": "Fragment",
          "metadata": null,
          "name": "ModelSchemaTableDimensionsQuery",
          "selections": [
            {
              "args": [
                {
                  "kind": "Variable",
                  "name": "count",
                  "variableName": "count"
                },
                {
                  "kind": "Variable",
                  "name": "cursor",
                  "variableName": "cursor"
                },
                {
                  "kind": "Variable",
                  "name": "endTime",
                  "variableName": "endTime"
                },
                {
                  "kind": "Variable",
                  "name": "startTime",
                  "variableName": "startTime"
                }
              ],
              "kind": "FragmentSpread",
              "name": "ModelSchemaTable_dimensions"
            }
          ],
          "type": "Query",
          "abstractKey": null
        },
        "kind": "Request",
        "operation": {
          "argumentDefinitions": v0,
          "kind": "Operation",
          "name": "ModelSchemaTableDimensionsQuery",
          "selections": [
            {
              "alias": null,
              "args": null,
              "concreteType": "Model",
              "kind": "LinkedField",
              "name": "model",
              "plural": false,
              "selections": [
                {
                  "alias": null,
                  "args": v12,
                  "concreteType": "DimensionConnection",
                  "kind": "LinkedField",
                  "name": "dimensions",
                  "plural": false,
                  "selections": [
                    {
                      "alias": null,
                      "args": null,
                      "concreteType": "DimensionEdge",
                      "kind": "LinkedField",
                      "name": "edges",
                      "plural": true,
                      "selections": [
                        {
                          "alias": "dimension",
                          "args": null,
                          "concreteType": "Dimension",
                          "kind": "LinkedField",
                          "name": "node",
                          "plural": false,
                          "selections": [
                            {
                              "alias": null,
                              "args": null,
                              "kind": "ScalarField",
                              "name": "id",
                              "storageKey": null
                            },
                            {
                              "alias": null,
                              "args": null,
                              "kind": "ScalarField",
                              "name": "name",
                              "storageKey": null
                            },
                            {
                              "alias": null,
                              "args": null,
                              "kind": "ScalarField",
                              "name": "type",
                              "storageKey": null
                            },
                            {
                              "alias": null,
                              "args": null,
                              "kind": "ScalarField",
                              "name": "dataType",
                              "storageKey": null
                            },
                            {
                              "alias": "cardinality",
                              "args": [
                                {
                                  "kind": "Literal",
                                  "name": "metric",
                                  "value": "cardinality"
                                },
                                v22
                              ],
                              "kind": "ScalarField",
                              "name": "dataQualityMetric",
                              "storageKey": null
                            },
                            {
                              "alias": "percentEmpty",
                              "args": [
                                {
                                  "kind": "Literal",
                                  "name": "metric",
                                  "value": "percentEmpty"
                                },
                                v22
                              ],
                              "kind": "ScalarField",
                              "name": "dataQualityMetric",
                              "storageKey": null
                            },
                            {
                              "alias": "min",
                              "args": [
                                {
                                  "kind": "Literal",
                                  "name": "metric",
                                  "value": "min"
                                },
                                v22
                              ],
                              "kind": "ScalarField",
                              "name": "dataQualityMetric",
                              "storageKey": null
                            },
                            {
                              "alias": "mean",
                              "args": [
                                {
                                  "kind": "Literal",
                                  "name": "metric",
                                  "value": "mean"
                                },
                                v22
                              ],
                              "kind": "ScalarField",
                              "name": "dataQualityMetric",
                              "storageKey": null
                            },
                            {
                              "alias": "max",
                              "args": [
                                {
                                  "kind": "Literal",
                                  "name": "metric",
                                  "value": "max"
                                },
                                v22
                              ],
                              "kind": "ScalarField",
                              "name": "dataQualityMetric",
                              "storageKey": null
                            },
                            {
                              "alias": "psi",
                              "args": [
                                {
                                  "kind": "Literal",
                                  "name": "metric",
                                  "value": "psi"
                                },
                                v22
                              ],
                              "kind": "ScalarField",
                              "name": "driftMetric",
                              "storageKey": null
                            }
                          ],
                          "storageKey": null
                        },
                        {
                          "alias": null,
                          "args": null,
                          "kind": "ScalarField",
                          "name": "cursor",
                          "storageKey": null
                        },
                        {
                          "alias": null,
                          "args": null,
                          "concreteType": "Dimension",
                          "kind": "LinkedField",
                          "name": "node",
                          "plural": false,
                          "selections": [
                            {
                              "alias": null,
                              "args": null,
                              "kind": "ScalarField",
                              "name": "__typename",
                              "storageKey": null
                            }
                          ],
                          "storageKey": null
                        }
                      ],
                      "storageKey": null
                    },
                    {
                      "alias": null,
                      "args": null,
                      "concreteType": "PageInfo",
                      "kind": "LinkedField",
                      "name": "pageInfo",
                      "plural": false,
                      "selections": [
                        {
                          "alias": null,
                          "args": null,
                          "kind": "ScalarField",
                          "name": "endCursor",
                          "storageKey": null
                        },
                        {
                          "alias": null,
                          "args": null,
                          "kind": "ScalarField",
                          "name": "hasNextPage",
                          "storageKey": null
                        }
                      ],
                      "storageKey": null
                    }
                  ],
                  "storageKey": null
                },
                {
                  "alias": null,
                  "args": v12,
                  "filters": null,
                  "handle": "connection",
                  "key": "ModelSchemaTable_dimensions",
                  "kind": "LinkedHandle",
                  "name": "dimensions"
                }
              ],
              "storageKey": null
            }
          ]
        },
        "params": {
          "cacheID": "0f5ec2a75c6234eefab01cbd1181c564",
          "id": null,
          "metadata": {},
          "name": "ModelSchemaTableDimensionsQuery",
          "operationKind": "query",
          "text": "query ModelSchemaTableDimensionsQuery(\n  $count: Int = 50\n  $cursor: String = null\n  $endTime: DateTime!\n  $startTime: DateTime!\n) {\n  ...ModelSchemaTable_dimensions_4sIU9C\n}\n\nfragment ModelSchemaTable_dimensions_4sIU9C on Query {\n  model {\n    dimensions(first: $count, after: $cursor) {\n      edges {\n        dimension: node {\n          id\n          name\n          type\n          dataType\n          cardinality: dataQualityMetric(metric: cardinality, timeRange: {start: $startTime, end: $endTime})\n          percentEmpty: dataQualityMetric(metric: percentEmpty, timeRange: {start: $startTime, end: $endTime})\n          min: dataQualityMetric(metric: min, timeRange: {start: $startTime, end: $endTime})\n          mean: dataQualityMetric(metric: mean, timeRange: {start: $startTime, end: $endTime})\n          max: dataQualityMetric(metric: max, timeRange: {start: $startTime, end: $endTime})\n          psi: driftMetric(metric: psi, timeRange: {start: $startTime, end: $endTime})\n        }\n        cursor\n        node {\n          __typename\n        }\n      }\n      pageInfo {\n        endCursor\n        hasNextPage\n      }\n    }\n  }\n}\n"
        }
      };
    }();
    node25.hash = "fb4c57e0ea77548c4e96ceb418e06614";
    ModelSchemaTableDimensionsQuery_graphql_default = node25;
  }
});

// src/components/model/__generated__/ModelEmbeddingsTableEmbeddingDimensionsQuery.graphql.ts
var ModelEmbeddingsTableEmbeddingDimensionsQuery_graphql_exports = {};
__export(ModelEmbeddingsTableEmbeddingDimensionsQuery_graphql_exports, {
  default: () => ModelEmbeddingsTableEmbeddingDimensionsQuery_graphql_default
});
var node27, ModelEmbeddingsTableEmbeddingDimensionsQuery_graphql_default;
var init_ModelEmbeddingsTableEmbeddingDimensionsQuery_graphql = __esm({
  "src/components/model/__generated__/ModelEmbeddingsTableEmbeddingDimensionsQuery.graphql.ts"() {
    "use strict";
    node27 = function() {
      var v0 = [
        {
          "defaultValue": 50,
          "kind": "LocalArgument",
          "name": "count"
        },
        {
          "defaultValue": null,
          "kind": "LocalArgument",
          "name": "cursor"
        },
        {
          "defaultValue": null,
          "kind": "LocalArgument",
          "name": "endTime"
        },
        {
          "defaultValue": null,
          "kind": "LocalArgument",
          "name": "startTime"
        }
      ], v12 = [
        {
          "kind": "Variable",
          "name": "after",
          "variableName": "cursor"
        },
        {
          "kind": "Variable",
          "name": "first",
          "variableName": "count"
        }
      ];
      return {
        "fragment": {
          "argumentDefinitions": v0,
          "kind": "Fragment",
          "metadata": null,
          "name": "ModelEmbeddingsTableEmbeddingDimensionsQuery",
          "selections": [
            {
              "args": [
                {
                  "kind": "Variable",
                  "name": "count",
                  "variableName": "count"
                },
                {
                  "kind": "Variable",
                  "name": "cursor",
                  "variableName": "cursor"
                },
                {
                  "kind": "Variable",
                  "name": "endTime",
                  "variableName": "endTime"
                },
                {
                  "kind": "Variable",
                  "name": "startTime",
                  "variableName": "startTime"
                }
              ],
              "kind": "FragmentSpread",
              "name": "ModelEmbeddingsTable_embeddingDimensions"
            }
          ],
          "type": "Query",
          "abstractKey": null
        },
        "kind": "Request",
        "operation": {
          "argumentDefinitions": v0,
          "kind": "Operation",
          "name": "ModelEmbeddingsTableEmbeddingDimensionsQuery",
          "selections": [
            {
              "alias": null,
              "args": null,
              "concreteType": "Model",
              "kind": "LinkedField",
              "name": "model",
              "plural": false,
              "selections": [
                {
                  "alias": null,
                  "args": v12,
                  "concreteType": "EmbeddingDimensionConnection",
                  "kind": "LinkedField",
                  "name": "embeddingDimensions",
                  "plural": false,
                  "selections": [
                    {
                      "alias": null,
                      "args": null,
                      "concreteType": "EmbeddingDimensionEdge",
                      "kind": "LinkedField",
                      "name": "edges",
                      "plural": true,
                      "selections": [
                        {
                          "alias": "embedding",
                          "args": null,
                          "concreteType": "EmbeddingDimension",
                          "kind": "LinkedField",
                          "name": "node",
                          "plural": false,
                          "selections": [
                            {
                              "alias": null,
                              "args": null,
                              "kind": "ScalarField",
                              "name": "id",
                              "storageKey": null
                            },
                            {
                              "alias": null,
                              "args": null,
                              "kind": "ScalarField",
                              "name": "name",
                              "storageKey": null
                            },
                            {
                              "alias": "euclideanDistance",
                              "args": [
                                {
                                  "kind": "Literal",
                                  "name": "metric",
                                  "value": "euclideanDistance"
                                },
                                {
                                  "fields": [
                                    {
                                      "kind": "Variable",
                                      "name": "end",
                                      "variableName": "endTime"
                                    },
                                    {
                                      "kind": "Variable",
                                      "name": "start",
                                      "variableName": "startTime"
                                    }
                                  ],
                                  "kind": "ObjectValue",
                                  "name": "timeRange"
                                }
                              ],
                              "kind": "ScalarField",
                              "name": "driftMetric",
                              "storageKey": null
                            }
                          ],
                          "storageKey": null
                        },
                        {
                          "alias": null,
                          "args": null,
                          "kind": "ScalarField",
                          "name": "cursor",
                          "storageKey": null
                        },
                        {
                          "alias": null,
                          "args": null,
                          "concreteType": "EmbeddingDimension",
                          "kind": "LinkedField",
                          "name": "node",
                          "plural": false,
                          "selections": [
                            {
                              "alias": null,
                              "args": null,
                              "kind": "ScalarField",
                              "name": "__typename",
                              "storageKey": null
                            }
                          ],
                          "storageKey": null
                        }
                      ],
                      "storageKey": null
                    },
                    {
                      "alias": null,
                      "args": null,
                      "concreteType": "PageInfo",
                      "kind": "LinkedField",
                      "name": "pageInfo",
                      "plural": false,
                      "selections": [
                        {
                          "alias": null,
                          "args": null,
                          "kind": "ScalarField",
                          "name": "endCursor",
                          "storageKey": null
                        },
                        {
                          "alias": null,
                          "args": null,
                          "kind": "ScalarField",
                          "name": "hasNextPage",
                          "storageKey": null
                        }
                      ],
                      "storageKey": null
                    }
                  ],
                  "storageKey": null
                },
                {
                  "alias": null,
                  "args": v12,
                  "filters": null,
                  "handle": "connection",
                  "key": "ModelEmbeddingsTable_embeddingDimensions",
                  "kind": "LinkedHandle",
                  "name": "embeddingDimensions"
                }
              ],
              "storageKey": null
            }
          ]
        },
        "params": {
          "cacheID": "d0057a41a1d9795383a58de89e72ad76",
          "id": null,
          "metadata": {},
          "name": "ModelEmbeddingsTableEmbeddingDimensionsQuery",
          "operationKind": "query",
          "text": "query ModelEmbeddingsTableEmbeddingDimensionsQuery(\n  $count: Int = 50\n  $cursor: String = null\n  $endTime: DateTime!\n  $startTime: DateTime!\n) {\n  ...ModelEmbeddingsTable_embeddingDimensions_4sIU9C\n}\n\nfragment ModelEmbeddingsTable_embeddingDimensions_4sIU9C on Query {\n  model {\n    embeddingDimensions(first: $count, after: $cursor) {\n      edges {\n        embedding: node {\n          id\n          name\n          euclideanDistance: driftMetric(metric: euclideanDistance, timeRange: {start: $startTime, end: $endTime})\n        }\n        cursor\n        node {\n          __typename\n        }\n      }\n      pageInfo {\n        endCursor\n        hasNextPage\n      }\n    }\n  }\n}\n"
        }
      };
    }();
    node27.hash = "fb7f125f75d1d33a555c16e198dbcbf8";
    ModelEmbeddingsTableEmbeddingDimensionsQuery_graphql_default = node27;
  }
});

// src/index.tsx
var import_client = __toESM(require_client());

// src/App.tsx
var import_react201 = __toESM(require_react());
var import_react_relay39 = __toESM(require_react_relay());

// node_modules/@emotion/react/dist/emotion-element-c39617d8.browser.esm.js
var React2 = __toESM(require_react());
var import_react = __toESM(require_react());

// node_modules/@emotion/sheet/dist/emotion-sheet.browser.esm.js
function sheetForTag(tag) {
  if (tag.sheet) {
    return tag.sheet;
  }
  for (var i2 = 0; i2 < document.styleSheets.length; i2++) {
    if (document.styleSheets[i2].ownerNode === tag) {
      return document.styleSheets[i2];
    }
  }
}
function createStyleElement(options) {
  var tag = document.createElement("style");
  tag.setAttribute("data-emotion", options.key);
  if (options.nonce !== void 0) {
    tag.setAttribute("nonce", options.nonce);
  }
  tag.appendChild(document.createTextNode(""));
  tag.setAttribute("data-s", "");
  return tag;
}
var StyleSheet = /* @__PURE__ */ function() {
  function StyleSheet2(options) {
    var _this = this;
    this._insertTag = function(tag) {
      var before;
      if (_this.tags.length === 0) {
        if (_this.insertionPoint) {
          before = _this.insertionPoint.nextSibling;
        } else if (_this.prepend) {
          before = _this.container.firstChild;
        } else {
          before = _this.before;
        }
      } else {
        before = _this.tags[_this.tags.length - 1].nextSibling;
      }
      _this.container.insertBefore(tag, before);
      _this.tags.push(tag);
    };
    this.isSpeedy = options.speedy === void 0 ? false : options.speedy;
    this.tags = [];
    this.ctr = 0;
    this.nonce = options.nonce;
    this.key = options.key;
    this.container = options.container;
    this.prepend = options.prepend;
    this.insertionPoint = options.insertionPoint;
    this.before = null;
  }
  var _proto = StyleSheet2.prototype;
  _proto.hydrate = function hydrate(nodes) {
    nodes.forEach(this._insertTag);
  };
  _proto.insert = function insert2(rule) {
    if (this.ctr % (this.isSpeedy ? 65e3 : 1) === 0) {
      this._insertTag(createStyleElement(this));
    }
    var tag = this.tags[this.tags.length - 1];
    if (true) {
      var isImportRule3 = rule.charCodeAt(0) === 64 && rule.charCodeAt(1) === 105;
      if (isImportRule3 && this._alreadyInsertedOrderInsensitiveRule) {
        console.error("You're attempting to insert the following rule:\n" + rule + "\n\n`@import` rules must be before all other types of rules in a stylesheet but other rules have already been inserted. Please ensure that `@import` rules are before all other rules.");
      }
      this._alreadyInsertedOrderInsensitiveRule = this._alreadyInsertedOrderInsensitiveRule || !isImportRule3;
    }
    if (this.isSpeedy) {
      var sheet = sheetForTag(tag);
      try {
        sheet.insertRule(rule, sheet.cssRules.length);
      } catch (e3) {
        if (!/:(-moz-placeholder|-moz-focus-inner|-moz-focusring|-ms-input-placeholder|-moz-read-write|-moz-read-only|-ms-clear|-ms-expand|-ms-reveal){/.test(rule)) {
          console.error('There was a problem inserting the following rule: "' + rule + '"', e3);
        }
      }
    } else {
      tag.appendChild(document.createTextNode(rule));
    }
    this.ctr++;
  };
  _proto.flush = function flush() {
    this.tags.forEach(function(tag) {
      return tag.parentNode && tag.parentNode.removeChild(tag);
    });
    this.tags = [];
    this.ctr = 0;
    if (true) {
      this._alreadyInsertedOrderInsensitiveRule = false;
    }
  };
  return StyleSheet2;
}();

// node_modules/stylis/src/Enum.js
var MS = "-ms-";
var MOZ = "-moz-";
var WEBKIT = "-webkit-";
var COMMENT = "comm";
var RULESET = "rule";
var DECLARATION = "decl";
var IMPORT = "@import";
var KEYFRAMES = "@keyframes";
var LAYER = "@layer";

// node_modules/stylis/src/Utility.js
var abs = Math.abs;
var from = String.fromCharCode;
var assign = Object.assign;
function hash(value, length2) {
  return charat(value, 0) ^ 45 ? (((length2 << 2 ^ charat(value, 0)) << 2 ^ charat(value, 1)) << 2 ^ charat(value, 2)) << 2 ^ charat(value, 3) : 0;
}
function trim(value) {
  return value.trim();
}
function match(value, pattern) {
  return (value = pattern.exec(value)) ? value[0] : value;
}
function replace(value, pattern, replacement) {
  return value.replace(pattern, replacement);
}
function indexof(value, search) {
  return value.indexOf(search);
}
function charat(value, index) {
  return value.charCodeAt(index) | 0;
}
function substr(value, begin, end) {
  return value.slice(begin, end);
}
function strlen(value) {
  return value.length;
}
function sizeof(value) {
  return value.length;
}
function append(value, array) {
  return array.push(value), value;
}
function combine(array, callback) {
  return array.map(callback).join("");
}

// node_modules/stylis/src/Tokenizer.js
var line = 1;
var column = 1;
var length = 0;
var position = 0;
var character = 0;
var characters = "";
function node(value, root2, parent, type, props, children, length2) {
  return { value, root: root2, parent, type, props, children, line, column, length: length2, return: "" };
}
function copy(root2, props) {
  return assign(node("", null, null, "", null, null, 0), root2, { length: -root2.length }, props);
}
function char() {
  return character;
}
function prev() {
  character = position > 0 ? charat(characters, --position) : 0;
  if (column--, character === 10)
    column = 1, line--;
  return character;
}
function next() {
  character = position < length ? charat(characters, position++) : 0;
  if (column++, character === 10)
    column = 1, line++;
  return character;
}
function peek() {
  return charat(characters, position);
}
function caret() {
  return position;
}
function slice(begin, end) {
  return substr(characters, begin, end);
}
function token(type) {
  switch (type) {
    case 0:
    case 9:
    case 10:
    case 13:
    case 32:
      return 5;
    case 33:
    case 43:
    case 44:
    case 47:
    case 62:
    case 64:
    case 126:
    case 59:
    case 123:
    case 125:
      return 4;
    case 58:
      return 3;
    case 34:
    case 39:
    case 40:
    case 91:
      return 2;
    case 41:
    case 93:
      return 1;
  }
  return 0;
}
function alloc(value) {
  return line = column = 1, length = strlen(characters = value), position = 0, [];
}
function dealloc(value) {
  return characters = "", value;
}
function delimit(type) {
  return trim(slice(position - 1, delimiter(type === 91 ? type + 2 : type === 40 ? type + 1 : type)));
}
function whitespace(type) {
  while (character = peek())
    if (character < 33)
      next();
    else
      break;
  return token(type) > 2 || token(character) > 3 ? "" : " ";
}
function escaping(index, count2) {
  while (--count2 && next())
    if (character < 48 || character > 102 || character > 57 && character < 65 || character > 70 && character < 97)
      break;
  return slice(index, caret() + (count2 < 6 && peek() == 32 && next() == 32));
}
function delimiter(type) {
  while (next())
    switch (character) {
      case type:
        return position;
      case 34:
      case 39:
        if (type !== 34 && type !== 39)
          delimiter(character);
        break;
      case 40:
        if (type === 41)
          delimiter(type);
        break;
      case 92:
        next();
        break;
    }
  return position;
}
function commenter(type, index) {
  while (next())
    if (type + character === 47 + 10)
      break;
    else if (type + character === 42 + 42 && peek() === 47)
      break;
  return "/*" + slice(index, position - 1) + "*" + from(type === 47 ? type : next());
}
function identifier(index) {
  while (!token(peek()))
    next();
  return slice(index, position);
}

// node_modules/stylis/src/Parser.js
function compile(value) {
  return dealloc(parse("", null, null, null, [""], value = alloc(value), 0, [0], value));
}
function parse(value, root2, parent, rule, rules, rulesets, pseudo, points, declarations) {
  var index = 0;
  var offset = 0;
  var length2 = pseudo;
  var atrule = 0;
  var property = 0;
  var previous = 0;
  var variable = 1;
  var scanning = 1;
  var ampersand = 1;
  var character2 = 0;
  var type = "";
  var props = rules;
  var children = rulesets;
  var reference = rule;
  var characters2 = type;
  while (scanning)
    switch (previous = character2, character2 = next()) {
      case 40:
        if (previous != 108 && charat(characters2, length2 - 1) == 58) {
          if (indexof(characters2 += replace(delimit(character2), "&", "&\f"), "&\f") != -1)
            ampersand = -1;
          break;
        }
      case 34:
      case 39:
      case 91:
        characters2 += delimit(character2);
        break;
      case 9:
      case 10:
      case 13:
      case 32:
        characters2 += whitespace(previous);
        break;
      case 92:
        characters2 += escaping(caret() - 1, 7);
        continue;
      case 47:
        switch (peek()) {
          case 42:
          case 47:
            append(comment(commenter(next(), caret()), root2, parent), declarations);
            break;
          default:
            characters2 += "/";
        }
        break;
      case 123 * variable:
        points[index++] = strlen(characters2) * ampersand;
      case 125 * variable:
      case 59:
      case 0:
        switch (character2) {
          case 0:
          case 125:
            scanning = 0;
          case 59 + offset:
            if (ampersand == -1)
              characters2 = replace(characters2, /\f/g, "");
            if (property > 0 && strlen(characters2) - length2)
              append(property > 32 ? declaration(characters2 + ";", rule, parent, length2 - 1) : declaration(replace(characters2, " ", "") + ";", rule, parent, length2 - 2), declarations);
            break;
          case 59:
            characters2 += ";";
          default:
            append(reference = ruleset(characters2, root2, parent, index, offset, rules, points, type, props = [], children = [], length2), rulesets);
            if (character2 === 123)
              if (offset === 0)
                parse(characters2, root2, reference, reference, props, rulesets, length2, points, children);
              else
                switch (atrule === 99 && charat(characters2, 3) === 110 ? 100 : atrule) {
                  case 100:
                  case 108:
                  case 109:
                  case 115:
                    parse(value, reference, reference, rule && append(ruleset(value, reference, reference, 0, 0, rules, points, type, rules, props = [], length2), children), rules, children, length2, points, rule ? props : children);
                    break;
                  default:
                    parse(characters2, reference, reference, reference, [""], children, 0, points, children);
                }
        }
        index = offset = property = 0, variable = ampersand = 1, type = characters2 = "", length2 = pseudo;
        break;
      case 58:
        length2 = 1 + strlen(characters2), property = previous;
      default:
        if (variable < 1) {
          if (character2 == 123)
            --variable;
          else if (character2 == 125 && variable++ == 0 && prev() == 125)
            continue;
        }
        switch (characters2 += from(character2), character2 * variable) {
          case 38:
            ampersand = offset > 0 ? 1 : (characters2 += "\f", -1);
            break;
          case 44:
            points[index++] = (strlen(characters2) - 1) * ampersand, ampersand = 1;
            break;
          case 64:
            if (peek() === 45)
              characters2 += delimit(next());
            atrule = peek(), offset = length2 = strlen(type = characters2 += identifier(caret())), character2++;
            break;
          case 45:
            if (previous === 45 && strlen(characters2) == 2)
              variable = 0;
        }
    }
  return rulesets;
}
function ruleset(value, root2, parent, index, offset, rules, points, type, props, children, length2) {
  var post = offset - 1;
  var rule = offset === 0 ? rules : [""];
  var size = sizeof(rule);
  for (var i2 = 0, j = 0, k2 = 0; i2 < index; ++i2)
    for (var x2 = 0, y2 = substr(value, post + 1, post = abs(j = points[i2])), z = value; x2 < size; ++x2)
      if (z = trim(j > 0 ? rule[x2] + " " + y2 : replace(y2, /&\f/g, rule[x2])))
        props[k2++] = z;
  return node(value, root2, parent, offset === 0 ? RULESET : type, props, children, length2);
}
function comment(value, root2, parent) {
  return node(value, root2, parent, COMMENT, from(char()), substr(value, 2, -2), 0);
}
function declaration(value, root2, parent, length2) {
  return node(value, root2, parent, DECLARATION, substr(value, 0, length2), substr(value, length2 + 1, -1), length2);
}

// node_modules/stylis/src/Serializer.js
function serialize(children, callback) {
  var output = "";
  var length2 = sizeof(children);
  for (var i2 = 0; i2 < length2; i2++)
    output += callback(children[i2], i2, children, callback) || "";
  return output;
}
function stringify(element2, index, children, callback) {
  switch (element2.type) {
    case LAYER:
      if (element2.children.length)
        break;
    case IMPORT:
    case DECLARATION:
      return element2.return = element2.return || element2.value;
    case COMMENT:
      return "";
    case KEYFRAMES:
      return element2.return = element2.value + "{" + serialize(element2.children, callback) + "}";
    case RULESET:
      element2.value = element2.props.join(",");
  }
  return strlen(children = serialize(element2.children, callback)) ? element2.return = element2.value + "{" + children + "}" : "";
}

// node_modules/stylis/src/Middleware.js
function middleware(collection) {
  var length2 = sizeof(collection);
  return function(element2, index, children, callback) {
    var output = "";
    for (var i2 = 0; i2 < length2; i2++)
      output += collection[i2](element2, index, children, callback) || "";
    return output;
  };
}

// node_modules/@emotion/weak-memoize/dist/emotion-weak-memoize.esm.js
var weakMemoize = function weakMemoize2(func) {
  var cache2 = /* @__PURE__ */ new WeakMap();
  return function(arg) {
    if (cache2.has(arg)) {
      return cache2.get(arg);
    }
    var ret = func(arg);
    cache2.set(arg, ret);
    return ret;
  };
};

// node_modules/@emotion/memoize/dist/emotion-memoize.esm.js
function memoize(fn) {
  var cache2 = /* @__PURE__ */ Object.create(null);
  return function(arg) {
    if (cache2[arg] === void 0)
      cache2[arg] = fn(arg);
    return cache2[arg];
  };
}

// node_modules/@emotion/cache/dist/emotion-cache.browser.esm.js
var identifierWithPointTracking = function identifierWithPointTracking2(begin, points, index) {
  var previous = 0;
  var character2 = 0;
  while (true) {
    previous = character2;
    character2 = peek();
    if (previous === 38 && character2 === 12) {
      points[index] = 1;
    }
    if (token(character2)) {
      break;
    }
    next();
  }
  return slice(begin, position);
};
var toRules = function toRules2(parsed, points) {
  var index = -1;
  var character2 = 44;
  do {
    switch (token(character2)) {
      case 0:
        if (character2 === 38 && peek() === 12) {
          points[index] = 1;
        }
        parsed[index] += identifierWithPointTracking(position - 1, points, index);
        break;
      case 2:
        parsed[index] += delimit(character2);
        break;
      case 4:
        if (character2 === 44) {
          parsed[++index] = peek() === 58 ? "&\f" : "";
          points[index] = parsed[index].length;
          break;
        }
      default:
        parsed[index] += from(character2);
    }
  } while (character2 = next());
  return parsed;
};
var getRules = function getRules2(value, points) {
  return dealloc(toRules(alloc(value), points));
};
var fixedElements = /* @__PURE__ */ new WeakMap();
var compat = function compat2(element2) {
  if (element2.type !== "rule" || !element2.parent || // positive .length indicates that this rule contains pseudo
  // negative .length indicates that this rule has been already prefixed
  element2.length < 1) {
    return;
  }
  var value = element2.value, parent = element2.parent;
  var isImplicitRule = element2.column === parent.column && element2.line === parent.line;
  while (parent.type !== "rule") {
    parent = parent.parent;
    if (!parent)
      return;
  }
  if (element2.props.length === 1 && value.charCodeAt(0) !== 58 && !fixedElements.get(parent)) {
    return;
  }
  if (isImplicitRule) {
    return;
  }
  fixedElements.set(element2, true);
  var points = [];
  var rules = getRules(value, points);
  var parentRules = parent.props;
  for (var i2 = 0, k2 = 0; i2 < rules.length; i2++) {
    for (var j = 0; j < parentRules.length; j++, k2++) {
      element2.props[k2] = points[i2] ? rules[i2].replace(/&\f/g, parentRules[j]) : parentRules[j] + " " + rules[i2];
    }
  }
};
var removeLabel = function removeLabel2(element2) {
  if (element2.type === "decl") {
    var value = element2.value;
    if (
      // charcode for l
      value.charCodeAt(0) === 108 && // charcode for b
      value.charCodeAt(2) === 98
    ) {
      element2["return"] = "";
      element2.value = "";
    }
  }
};
var ignoreFlag = "emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason";
var isIgnoringComment = function isIgnoringComment2(element2) {
  return element2.type === "comm" && element2.children.indexOf(ignoreFlag) > -1;
};
var createUnsafeSelectorsAlarm = function createUnsafeSelectorsAlarm2(cache2) {
  return function(element2, index, children) {
    if (element2.type !== "rule" || cache2.compat)
      return;
    var unsafePseudoClasses = element2.value.match(/(:first|:nth|:nth-last)-child/g);
    if (unsafePseudoClasses) {
      var isNested = !!element2.parent;
      var commentContainer = isNested ? element2.parent.children : (
        // global rule at the root level
        children
      );
      for (var i2 = commentContainer.length - 1; i2 >= 0; i2--) {
        var node56 = commentContainer[i2];
        if (node56.line < element2.line) {
          break;
        }
        if (node56.column < element2.column) {
          if (isIgnoringComment(node56)) {
            return;
          }
          break;
        }
      }
      unsafePseudoClasses.forEach(function(unsafePseudoClass) {
        console.error('The pseudo class "' + unsafePseudoClass + '" is potentially unsafe when doing server-side rendering. Try changing it to "' + unsafePseudoClass.split("-child")[0] + '-of-type".');
      });
    }
  };
};
var isImportRule = function isImportRule2(element2) {
  return element2.type.charCodeAt(1) === 105 && element2.type.charCodeAt(0) === 64;
};
var isPrependedWithRegularRules = function isPrependedWithRegularRules2(index, children) {
  for (var i2 = index - 1; i2 >= 0; i2--) {
    if (!isImportRule(children[i2])) {
      return true;
    }
  }
  return false;
};
var nullifyElement = function nullifyElement2(element2) {
  element2.type = "";
  element2.value = "";
  element2["return"] = "";
  element2.children = "";
  element2.props = "";
};
var incorrectImportAlarm = function incorrectImportAlarm2(element2, index, children) {
  if (!isImportRule(element2)) {
    return;
  }
  if (element2.parent) {
    console.error("`@import` rules can't be nested inside other rules. Please move it to the top level and put it before regular rules. Keep in mind that they can only be used within global styles.");
    nullifyElement(element2);
  } else if (isPrependedWithRegularRules(index, children)) {
    console.error("`@import` rules can't be after other rules. Please put your `@import` rules before your other rules.");
    nullifyElement(element2);
  }
};
function prefix(value, length2) {
  switch (hash(value, length2)) {
    case 5103:
      return WEBKIT + "print-" + value + value;
    case 5737:
    case 4201:
    case 3177:
    case 3433:
    case 1641:
    case 4457:
    case 2921:
    case 5572:
    case 6356:
    case 5844:
    case 3191:
    case 6645:
    case 3005:
    case 6391:
    case 5879:
    case 5623:
    case 6135:
    case 4599:
    case 4855:
    case 4215:
    case 6389:
    case 5109:
    case 5365:
    case 5621:
    case 3829:
      return WEBKIT + value + value;
    case 5349:
    case 4246:
    case 4810:
    case 6968:
    case 2756:
      return WEBKIT + value + MOZ + value + MS + value + value;
    case 6828:
    case 4268:
      return WEBKIT + value + MS + value + value;
    case 6165:
      return WEBKIT + value + MS + "flex-" + value + value;
    case 5187:
      return WEBKIT + value + replace(value, /(\w+).+(:[^]+)/, WEBKIT + "box-$1$2" + MS + "flex-$1$2") + value;
    case 5443:
      return WEBKIT + value + MS + "flex-item-" + replace(value, /flex-|-self/, "") + value;
    case 4675:
      return WEBKIT + value + MS + "flex-line-pack" + replace(value, /align-content|flex-|-self/, "") + value;
    case 5548:
      return WEBKIT + value + MS + replace(value, "shrink", "negative") + value;
    case 5292:
      return WEBKIT + value + MS + replace(value, "basis", "preferred-size") + value;
    case 6060:
      return WEBKIT + "box-" + replace(value, "-grow", "") + WEBKIT + value + MS + replace(value, "grow", "positive") + value;
    case 4554:
      return WEBKIT + replace(value, /([^-])(transform)/g, "$1" + WEBKIT + "$2") + value;
    case 6187:
      return replace(replace(replace(value, /(zoom-|grab)/, WEBKIT + "$1"), /(image-set)/, WEBKIT + "$1"), value, "") + value;
    case 5495:
    case 3959:
      return replace(value, /(image-set\([^]*)/, WEBKIT + "$1$`$1");
    case 4968:
      return replace(replace(value, /(.+:)(flex-)?(.*)/, WEBKIT + "box-pack:$3" + MS + "flex-pack:$3"), /s.+-b[^;]+/, "justify") + WEBKIT + value + value;
    case 4095:
    case 3583:
    case 4068:
    case 2532:
      return replace(value, /(.+)-inline(.+)/, WEBKIT + "$1$2") + value;
    case 8116:
    case 7059:
    case 5753:
    case 5535:
    case 5445:
    case 5701:
    case 4933:
    case 4677:
    case 5533:
    case 5789:
    case 5021:
    case 4765:
      if (strlen(value) - 1 - length2 > 6)
        switch (charat(value, length2 + 1)) {
          case 109:
            if (charat(value, length2 + 4) !== 45)
              break;
          case 102:
            return replace(value, /(.+:)(.+)-([^]+)/, "$1" + WEBKIT + "$2-$3$1" + MOZ + (charat(value, length2 + 3) == 108 ? "$3" : "$2-$3")) + value;
          case 115:
            return ~indexof(value, "stretch") ? prefix(replace(value, "stretch", "fill-available"), length2) + value : value;
        }
      break;
    case 4949:
      if (charat(value, length2 + 1) !== 115)
        break;
    case 6444:
      switch (charat(value, strlen(value) - 3 - (~indexof(value, "!important") && 10))) {
        case 107:
          return replace(value, ":", ":" + WEBKIT) + value;
        case 101:
          return replace(value, /(.+:)([^;!]+)(;|!.+)?/, "$1" + WEBKIT + (charat(value, 14) === 45 ? "inline-" : "") + "box$3$1" + WEBKIT + "$2$3$1" + MS + "$2box$3") + value;
      }
      break;
    case 5936:
      switch (charat(value, length2 + 11)) {
        case 114:
          return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, "tb") + value;
        case 108:
          return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, "tb-rl") + value;
        case 45:
          return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, "lr") + value;
      }
      return WEBKIT + value + MS + value + value;
  }
  return value;
}
var prefixer = function prefixer2(element2, index, children, callback) {
  if (element2.length > -1) {
    if (!element2["return"])
      switch (element2.type) {
        case DECLARATION:
          element2["return"] = prefix(element2.value, element2.length);
          break;
        case KEYFRAMES:
          return serialize([copy(element2, {
            value: replace(element2.value, "@", "@" + WEBKIT)
          })], callback);
        case RULESET:
          if (element2.length)
            return combine(element2.props, function(value) {
              switch (match(value, /(::plac\w+|:read-\w+)/)) {
                case ":read-only":
                case ":read-write":
                  return serialize([copy(element2, {
                    props: [replace(value, /:(read-\w+)/, ":" + MOZ + "$1")]
                  })], callback);
                case "::placeholder":
                  return serialize([copy(element2, {
                    props: [replace(value, /:(plac\w+)/, ":" + WEBKIT + "input-$1")]
                  }), copy(element2, {
                    props: [replace(value, /:(plac\w+)/, ":" + MOZ + "$1")]
                  }), copy(element2, {
                    props: [replace(value, /:(plac\w+)/, MS + "input-$1")]
                  })], callback);
              }
              return "";
            });
      }
  }
};
var defaultStylisPlugins = [prefixer];
var createCache = function createCache2(options) {
  var key = options.key;
  if (!key) {
    throw new Error("You have to configure `key` for your cache. Please make sure it's unique (and not equal to 'css') as it's used for linking styles to your cache.\nIf multiple caches share the same key they might \"fight\" for each other's style elements.");
  }
  if (key === "css") {
    var ssrStyles = document.querySelectorAll("style[data-emotion]:not([data-s])");
    Array.prototype.forEach.call(ssrStyles, function(node56) {
      var dataEmotionAttribute = node56.getAttribute("data-emotion");
      if (dataEmotionAttribute.indexOf(" ") === -1) {
        return;
      }
      document.head.appendChild(node56);
      node56.setAttribute("data-s", "");
    });
  }
  var stylisPlugins = options.stylisPlugins || defaultStylisPlugins;
  if (true) {
    if (/[^a-z-]/.test(key)) {
      throw new Error('Emotion key must only contain lower case alphabetical characters and - but "' + key + '" was passed');
    }
  }
  var inserted = {};
  var container;
  var nodesToHydrate = [];
  {
    container = options.container || document.head;
    Array.prototype.forEach.call(
      // this means we will ignore elements which don't have a space in them which
      // means that the style elements we're looking at are only Emotion 11 server-rendered style elements
      document.querySelectorAll('style[data-emotion^="' + key + ' "]'),
      function(node56) {
        var attrib = node56.getAttribute("data-emotion").split(" ");
        for (var i2 = 1; i2 < attrib.length; i2++) {
          inserted[attrib[i2]] = true;
        }
        nodesToHydrate.push(node56);
      }
    );
  }
  var _insert;
  var omnipresentPlugins = [compat, removeLabel];
  if (true) {
    omnipresentPlugins.push(createUnsafeSelectorsAlarm({
      get compat() {
        return cache2.compat;
      }
    }), incorrectImportAlarm);
  }
  {
    var currentSheet;
    var finalizingPlugins = [stringify, true ? function(element2) {
      if (!element2.root) {
        if (element2["return"]) {
          currentSheet.insert(element2["return"]);
        } else if (element2.value && element2.type !== COMMENT) {
          currentSheet.insert(element2.value + "{}");
        }
      }
    } : rulesheet(function(rule) {
      currentSheet.insert(rule);
    })];
    var serializer = middleware(omnipresentPlugins.concat(stylisPlugins, finalizingPlugins));
    var stylis = function stylis2(styles) {
      return serialize(compile(styles), serializer);
    };
    _insert = function insert2(selector, serialized, sheet, shouldCache) {
      currentSheet = sheet;
      if (serialized.map !== void 0) {
        currentSheet = {
          insert: function insert3(rule) {
            sheet.insert(rule + serialized.map);
          }
        };
      }
      stylis(selector ? selector + "{" + serialized.styles + "}" : serialized.styles);
      if (shouldCache) {
        cache2.inserted[serialized.name] = true;
      }
    };
  }
  var cache2 = {
    key,
    sheet: new StyleSheet({
      key,
      container,
      nonce: options.nonce,
      speedy: options.speedy,
      prepend: options.prepend,
      insertionPoint: options.insertionPoint
    }),
    nonce: options.nonce,
    inserted,
    registered: {},
    insert: _insert
  };
  cache2.sheet.hydrate(nodesToHydrate);
  return cache2;
};

// node_modules/@babel/runtime/helpers/esm/extends.js
function _extends() {
  _extends = Object.assign ? Object.assign.bind() : function(target) {
    for (var i2 = 1; i2 < arguments.length; i2++) {
      var source = arguments[i2];
      for (var key in source) {
        if (Object.prototype.hasOwnProperty.call(source, key)) {
          target[key] = source[key];
        }
      }
    }
    return target;
  };
  return _extends.apply(this, arguments);
}

// node_modules/@emotion/utils/dist/emotion-utils.browser.esm.js
var isBrowser = true;
function getRegisteredStyles(registered, registeredStyles, classNames28) {
  var rawClassName = "";
  classNames28.split(" ").forEach(function(className) {
    if (registered[className] !== void 0) {
      registeredStyles.push(registered[className] + ";");
    } else {
      rawClassName += className + " ";
    }
  });
  return rawClassName;
}
var registerStyles = function registerStyles2(cache2, serialized, isStringTag) {
  var className = cache2.key + "-" + serialized.name;
  if (
    // we only need to add the styles to the registered cache if the
    // class name could be used further down
    // the tree but if it's a string tag, we know it won't
    // so we don't have to add it to registered cache.
    // this improves memory usage since we can avoid storing the whole style string
    (isStringTag === false || // we need to always store it if we're in compat mode and
    // in node since emotion-server relies on whether a style is in
    // the registered cache to know whether a style is global or not
    // also, note that this check will be dead code eliminated in the browser
    isBrowser === false) && cache2.registered[className] === void 0
  ) {
    cache2.registered[className] = serialized.styles;
  }
};
var insertStyles = function insertStyles2(cache2, serialized, isStringTag) {
  registerStyles(cache2, serialized, isStringTag);
  var className = cache2.key + "-" + serialized.name;
  if (cache2.inserted[serialized.name] === void 0) {
    var current = serialized;
    do {
      cache2.insert(serialized === current ? "." + className : "", current, cache2.sheet, true);
      current = current.next;
    } while (current !== void 0);
  }
};

// node_modules/@emotion/hash/dist/emotion-hash.esm.js
function murmur2(str) {
  var h = 0;
  var k2, i2 = 0, len = str.length;
  for (; len >= 4; ++i2, len -= 4) {
    k2 = str.charCodeAt(i2) & 255 | (str.charCodeAt(++i2) & 255) << 8 | (str.charCodeAt(++i2) & 255) << 16 | (str.charCodeAt(++i2) & 255) << 24;
    k2 = /* Math.imul(k, m): */
    (k2 & 65535) * 1540483477 + ((k2 >>> 16) * 59797 << 16);
    k2 ^= /* k >>> r: */
    k2 >>> 24;
    h = /* Math.imul(k, m): */
    (k2 & 65535) * 1540483477 + ((k2 >>> 16) * 59797 << 16) ^ /* Math.imul(h, m): */
    (h & 65535) * 1540483477 + ((h >>> 16) * 59797 << 16);
  }
  switch (len) {
    case 3:
      h ^= (str.charCodeAt(i2 + 2) & 255) << 16;
    case 2:
      h ^= (str.charCodeAt(i2 + 1) & 255) << 8;
    case 1:
      h ^= str.charCodeAt(i2) & 255;
      h = /* Math.imul(h, m): */
      (h & 65535) * 1540483477 + ((h >>> 16) * 59797 << 16);
  }
  h ^= h >>> 13;
  h = /* Math.imul(h, m): */
  (h & 65535) * 1540483477 + ((h >>> 16) * 59797 << 16);
  return ((h ^ h >>> 15) >>> 0).toString(36);
}

// node_modules/@emotion/unitless/dist/emotion-unitless.esm.js
var unitlessKeys = {
  animationIterationCount: 1,
  aspectRatio: 1,
  borderImageOutset: 1,
  borderImageSlice: 1,
  borderImageWidth: 1,
  boxFlex: 1,
  boxFlexGroup: 1,
  boxOrdinalGroup: 1,
  columnCount: 1,
  columns: 1,
  flex: 1,
  flexGrow: 1,
  flexPositive: 1,
  flexShrink: 1,
  flexNegative: 1,
  flexOrder: 1,
  gridRow: 1,
  gridRowEnd: 1,
  gridRowSpan: 1,
  gridRowStart: 1,
  gridColumn: 1,
  gridColumnEnd: 1,
  gridColumnSpan: 1,
  gridColumnStart: 1,
  msGridRow: 1,
  msGridRowSpan: 1,
  msGridColumn: 1,
  msGridColumnSpan: 1,
  fontWeight: 1,
  lineHeight: 1,
  opacity: 1,
  order: 1,
  orphans: 1,
  tabSize: 1,
  widows: 1,
  zIndex: 1,
  zoom: 1,
  WebkitLineClamp: 1,
  // SVG-related properties
  fillOpacity: 1,
  floodOpacity: 1,
  stopOpacity: 1,
  strokeDasharray: 1,
  strokeDashoffset: 1,
  strokeMiterlimit: 1,
  strokeOpacity: 1,
  strokeWidth: 1
};

// node_modules/@emotion/serialize/dist/emotion-serialize.browser.esm.js
var ILLEGAL_ESCAPE_SEQUENCE_ERROR = `You have illegal escape sequence in your template literal, most likely inside content's property value.
Because you write your CSS inside a JavaScript string you actually have to do double escaping, so for example "content: '\\00d7';" should become "content: '\\\\00d7';".
You can read more about this here:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences`;
var UNDEFINED_AS_OBJECT_KEY_ERROR = "You have passed in falsy value as style object's key (can happen when in example you pass unexported component as computed key).";
var hyphenateRegex = /[A-Z]|^ms/g;
var animationRegex = /_EMO_([^_]+?)_([^]*?)_EMO_/g;
var isCustomProperty = function isCustomProperty2(property) {
  return property.charCodeAt(1) === 45;
};
var isProcessableValue = function isProcessableValue2(value) {
  return value != null && typeof value !== "boolean";
};
var processStyleName = /* @__PURE__ */ memoize(function(styleName) {
  return isCustomProperty(styleName) ? styleName : styleName.replace(hyphenateRegex, "-$&").toLowerCase();
});
var processStyleValue = function processStyleValue2(key, value) {
  switch (key) {
    case "animation":
    case "animationName": {
      if (typeof value === "string") {
        return value.replace(animationRegex, function(match2, p1, p2) {
          cursor = {
            name: p1,
            styles: p2,
            next: cursor
          };
          return p1;
        });
      }
    }
  }
  if (unitlessKeys[key] !== 1 && !isCustomProperty(key) && typeof value === "number" && value !== 0) {
    return value + "px";
  }
  return value;
};
if (true) {
  contentValuePattern = /(var|attr|counters?|url|element|(((repeating-)?(linear|radial))|conic)-gradient)\(|(no-)?(open|close)-quote/;
  contentValues = ["normal", "none", "initial", "inherit", "unset"];
  oldProcessStyleValue = processStyleValue;
  msPattern = /^-ms-/;
  hyphenPattern = /-(.)/g;
  hyphenatedCache = {};
  processStyleValue = function processStyleValue3(key, value) {
    if (key === "content") {
      if (typeof value !== "string" || contentValues.indexOf(value) === -1 && !contentValuePattern.test(value) && (value.charAt(0) !== value.charAt(value.length - 1) || value.charAt(0) !== '"' && value.charAt(0) !== "'")) {
        throw new Error("You seem to be using a value for 'content' without quotes, try replacing it with `content: '\"" + value + "\"'`");
      }
    }
    var processed = oldProcessStyleValue(key, value);
    if (processed !== "" && !isCustomProperty(key) && key.indexOf("-") !== -1 && hyphenatedCache[key] === void 0) {
      hyphenatedCache[key] = true;
      console.error("Using kebab-case for css properties in objects is not supported. Did you mean " + key.replace(msPattern, "ms-").replace(hyphenPattern, function(str, _char) {
        return _char.toUpperCase();
      }) + "?");
    }
    return processed;
  };
}
var contentValuePattern;
var contentValues;
var oldProcessStyleValue;
var msPattern;
var hyphenPattern;
var hyphenatedCache;
var noComponentSelectorMessage = "Component selectors can only be used in conjunction with @emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware compiler transform.";
function handleInterpolation(mergedProps, registered, interpolation) {
  if (interpolation == null) {
    return "";
  }
  if (interpolation.__emotion_styles !== void 0) {
    if (interpolation.toString() === "NO_COMPONENT_SELECTOR") {
      throw new Error(noComponentSelectorMessage);
    }
    return interpolation;
  }
  switch (typeof interpolation) {
    case "boolean": {
      return "";
    }
    case "object": {
      if (interpolation.anim === 1) {
        cursor = {
          name: interpolation.name,
          styles: interpolation.styles,
          next: cursor
        };
        return interpolation.name;
      }
      if (interpolation.styles !== void 0) {
        var next2 = interpolation.next;
        if (next2 !== void 0) {
          while (next2 !== void 0) {
            cursor = {
              name: next2.name,
              styles: next2.styles,
              next: cursor
            };
            next2 = next2.next;
          }
        }
        var styles = interpolation.styles + ";";
        if (interpolation.map !== void 0) {
          styles += interpolation.map;
        }
        return styles;
      }
      return createStringFromObject(mergedProps, registered, interpolation);
    }
    case "function": {
      if (mergedProps !== void 0) {
        var previousCursor = cursor;
        var result = interpolation(mergedProps);
        cursor = previousCursor;
        return handleInterpolation(mergedProps, registered, result);
      } else if (true) {
        console.error("Functions that are interpolated in css calls will be stringified.\nIf you want to have a css call based on props, create a function that returns a css call like this\nlet dynamicStyle = (props) => css`color: ${props.color}`\nIt can be called directly with props or interpolated in a styled call like this\nlet SomeComponent = styled('div')`${dynamicStyle}`");
      }
      break;
    }
    case "string":
      if (true) {
        var matched = [];
        var replaced = interpolation.replace(animationRegex, function(match2, p1, p2) {
          var fakeVarName = "animation" + matched.length;
          matched.push("const " + fakeVarName + " = keyframes`" + p2.replace(/^@keyframes animation-\w+/, "") + "`");
          return "${" + fakeVarName + "}";
        });
        if (matched.length) {
          console.error("`keyframes` output got interpolated into plain string, please wrap it with `css`.\n\nInstead of doing this:\n\n" + [].concat(matched, ["`" + replaced + "`"]).join("\n") + "\n\nYou should wrap it with `css` like this:\n\n" + ("css`" + replaced + "`"));
        }
      }
      break;
  }
  if (registered == null) {
    return interpolation;
  }
  var cached = registered[interpolation];
  return cached !== void 0 ? cached : interpolation;
}
function createStringFromObject(mergedProps, registered, obj) {
  var string2 = "";
  if (Array.isArray(obj)) {
    for (var i2 = 0; i2 < obj.length; i2++) {
      string2 += handleInterpolation(mergedProps, registered, obj[i2]) + ";";
    }
  } else {
    for (var _key in obj) {
      var value = obj[_key];
      if (typeof value !== "object") {
        if (registered != null && registered[value] !== void 0) {
          string2 += _key + "{" + registered[value] + "}";
        } else if (isProcessableValue(value)) {
          string2 += processStyleName(_key) + ":" + processStyleValue(_key, value) + ";";
        }
      } else {
        if (_key === "NO_COMPONENT_SELECTOR" && true) {
          throw new Error(noComponentSelectorMessage);
        }
        if (Array.isArray(value) && typeof value[0] === "string" && (registered == null || registered[value[0]] === void 0)) {
          for (var _i = 0; _i < value.length; _i++) {
            if (isProcessableValue(value[_i])) {
              string2 += processStyleName(_key) + ":" + processStyleValue(_key, value[_i]) + ";";
            }
          }
        } else {
          var interpolated = handleInterpolation(mergedProps, registered, value);
          switch (_key) {
            case "animation":
            case "animationName": {
              string2 += processStyleName(_key) + ":" + interpolated + ";";
              break;
            }
            default: {
              if (_key === "undefined") {
                console.error(UNDEFINED_AS_OBJECT_KEY_ERROR);
              }
              string2 += _key + "{" + interpolated + "}";
            }
          }
        }
      }
    }
  }
  return string2;
}
var labelPattern = /label:\s*([^\s;\n{]+)\s*(;|$)/g;
var sourceMapPattern;
if (true) {
  sourceMapPattern = /\/\*#\ssourceMappingURL=data:application\/json;\S+\s+\*\//g;
}
var cursor;
var serializeStyles = function serializeStyles2(args, registered, mergedProps) {
  if (args.length === 1 && typeof args[0] === "object" && args[0] !== null && args[0].styles !== void 0) {
    return args[0];
  }
  var stringMode = true;
  var styles = "";
  cursor = void 0;
  var strings = args[0];
  if (strings == null || strings.raw === void 0) {
    stringMode = false;
    styles += handleInterpolation(mergedProps, registered, strings);
  } else {
    if (strings[0] === void 0) {
      console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);
    }
    styles += strings[0];
  }
  for (var i2 = 1; i2 < args.length; i2++) {
    styles += handleInterpolation(mergedProps, registered, args[i2]);
    if (stringMode) {
      if (strings[i2] === void 0) {
        console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);
      }
      styles += strings[i2];
    }
  }
  var sourceMap;
  if (true) {
    styles = styles.replace(sourceMapPattern, function(match3) {
      sourceMap = match3;
      return "";
    });
  }
  labelPattern.lastIndex = 0;
  var identifierName = "";
  var match2;
  while ((match2 = labelPattern.exec(styles)) !== null) {
    identifierName += "-" + // $FlowFixMe we know it's not null
    match2[1];
  }
  var name2 = murmur2(styles) + identifierName;
  if (true) {
    return {
      name: name2,
      styles,
      map: sourceMap,
      next: cursor,
      toString: function toString2() {
        return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
      }
    };
  }
  return {
    name: name2,
    styles,
    next: cursor
  };
};

// node_modules/@emotion/use-insertion-effect-with-fallbacks/dist/emotion-use-insertion-effect-with-fallbacks.browser.esm.js
var React = __toESM(require_react());
var syncFallback = function syncFallback2(create4) {
  return create4();
};
var useInsertionEffect2 = React["useInsertionEffect"] ? React["useInsertionEffect"] : false;
var useInsertionEffectAlwaysWithSyncFallback = useInsertionEffect2 || syncFallback;
var useInsertionEffectWithLayoutFallback = useInsertionEffect2 || React.useLayoutEffect;

// node_modules/@emotion/react/dist/emotion-element-c39617d8.browser.esm.js
var isBrowser2 = true;
var hasOwnProperty = {}.hasOwnProperty;
var EmotionCacheContext = /* @__PURE__ */ React2.createContext(
  // we're doing this to avoid preconstruct's dead code elimination in this one case
  // because this module is primarily intended for the browser and node
  // but it's also required in react native and similar environments sometimes
  // and we could have a special build just for that
  // but this is much easier and the native packages
  // might use a different theme context in the future anyway
  typeof HTMLElement !== "undefined" ? /* @__PURE__ */ createCache({
    key: "css"
  }) : null
);
if (true) {
  EmotionCacheContext.displayName = "EmotionCacheContext";
}
var CacheProvider = EmotionCacheContext.Provider;
var withEmotionCache = function withEmotionCache2(func) {
  return /* @__PURE__ */ (0, import_react.forwardRef)(function(props, ref) {
    var cache2 = (0, import_react.useContext)(EmotionCacheContext);
    return func(props, cache2, ref);
  });
};
if (!isBrowser2) {
  withEmotionCache = function withEmotionCache3(func) {
    return function(props) {
      var cache2 = (0, import_react.useContext)(EmotionCacheContext);
      if (cache2 === null) {
        cache2 = createCache({
          key: "css"
        });
        return /* @__PURE__ */ React2.createElement(EmotionCacheContext.Provider, {
          value: cache2
        }, func(props, cache2));
      } else {
        return func(props, cache2);
      }
    };
  };
}
var ThemeContext = /* @__PURE__ */ React2.createContext({});
if (true) {
  ThemeContext.displayName = "EmotionThemeContext";
}
var getTheme = function getTheme2(outerTheme, theme3) {
  if (typeof theme3 === "function") {
    var mergedTheme = theme3(outerTheme);
    if (mergedTheme == null || typeof mergedTheme !== "object" || Array.isArray(mergedTheme)) {
      throw new Error("[ThemeProvider] Please return an object from your theme function, i.e. theme={() => ({})}!");
    }
    return mergedTheme;
  }
  if (theme3 == null || typeof theme3 !== "object" || Array.isArray(theme3)) {
    throw new Error("[ThemeProvider] Please make your theme prop a plain object");
  }
  return _extends({}, outerTheme, theme3);
};
var createCacheWithTheme = /* @__PURE__ */ weakMemoize(function(outerTheme) {
  return weakMemoize(function(theme3) {
    return getTheme(outerTheme, theme3);
  });
});
var ThemeProvider = function ThemeProvider2(props) {
  var theme3 = React2.useContext(ThemeContext);
  if (props.theme !== theme3) {
    theme3 = createCacheWithTheme(theme3)(props.theme);
  }
  return /* @__PURE__ */ React2.createElement(ThemeContext.Provider, {
    value: theme3
  }, props.children);
};
var getLastPart = function getLastPart2(functionName) {
  var parts = functionName.split(".");
  return parts[parts.length - 1];
};
var getFunctionNameFromStackTraceLine = function getFunctionNameFromStackTraceLine2(line2) {
  var match2 = /^\s+at\s+([A-Za-z0-9$.]+)\s/.exec(line2);
  if (match2)
    return getLastPart(match2[1]);
  match2 = /^([A-Za-z0-9$.]+)@/.exec(line2);
  if (match2)
    return getLastPart(match2[1]);
  return void 0;
};
var internalReactFunctionNames = /* @__PURE__ */ new Set(["renderWithHooks", "processChild", "finishClassComponent", "renderToString"]);
var sanitizeIdentifier = function sanitizeIdentifier2(identifier2) {
  return identifier2.replace(/\$/g, "-");
};
var getLabelFromStackTrace = function getLabelFromStackTrace2(stackTrace) {
  if (!stackTrace)
    return void 0;
  var lines = stackTrace.split("\n");
  for (var i2 = 0; i2 < lines.length; i2++) {
    var functionName = getFunctionNameFromStackTraceLine(lines[i2]);
    if (!functionName)
      continue;
    if (internalReactFunctionNames.has(functionName))
      break;
    if (/^[A-Z]/.test(functionName))
      return sanitizeIdentifier(functionName);
  }
  return void 0;
};
var typePropName = "__EMOTION_TYPE_PLEASE_DO_NOT_USE__";
var labelPropName = "__EMOTION_LABEL_PLEASE_DO_NOT_USE__";
var createEmotionProps = function createEmotionProps2(type, props) {
  if (typeof props.css === "string" && // check if there is a css declaration
  props.css.indexOf(":") !== -1) {
    throw new Error("Strings are not allowed as css prop values, please wrap it in a css template literal from '@emotion/react' like this: css`" + props.css + "`");
  }
  var newProps = {};
  for (var key in props) {
    if (hasOwnProperty.call(props, key)) {
      newProps[key] = props[key];
    }
  }
  newProps[typePropName] = type;
  if (!!props.css && (typeof props.css !== "object" || typeof props.css.name !== "string" || props.css.name.indexOf("-") === -1)) {
    var label = getLabelFromStackTrace(new Error().stack);
    if (label)
      newProps[labelPropName] = label;
  }
  return newProps;
};
var Insertion = function Insertion2(_ref18) {
  var cache2 = _ref18.cache, serialized = _ref18.serialized, isStringTag = _ref18.isStringTag;
  registerStyles(cache2, serialized, isStringTag);
  useInsertionEffectAlwaysWithSyncFallback(function() {
    return insertStyles(cache2, serialized, isStringTag);
  });
  return null;
};
var Emotion = /* @__PURE__ */ withEmotionCache(function(props, cache2, ref) {
  var cssProp = props.css;
  if (typeof cssProp === "string" && cache2.registered[cssProp] !== void 0) {
    cssProp = cache2.registered[cssProp];
  }
  var WrappedComponent = props[typePropName];
  var registeredStyles = [cssProp];
  var className = "";
  if (typeof props.className === "string") {
    className = getRegisteredStyles(cache2.registered, registeredStyles, props.className);
  } else if (props.className != null) {
    className = props.className + " ";
  }
  var serialized = serializeStyles(registeredStyles, void 0, React2.useContext(ThemeContext));
  if (serialized.name.indexOf("-") === -1) {
    var labelFromStack = props[labelPropName];
    if (labelFromStack) {
      serialized = serializeStyles([serialized, "label:" + labelFromStack + ";"]);
    }
  }
  className += cache2.key + "-" + serialized.name;
  var newProps = {};
  for (var key in props) {
    if (hasOwnProperty.call(props, key) && key !== "css" && key !== typePropName && key !== labelPropName) {
      newProps[key] = props[key];
    }
  }
  newProps.ref = ref;
  newProps.className = className;
  return /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(Insertion, {
    cache: cache2,
    serialized,
    isStringTag: typeof WrappedComponent === "string"
  }), /* @__PURE__ */ React2.createElement(WrappedComponent, newProps));
});
if (true) {
  Emotion.displayName = "EmotionCssPropInternal";
}
var Emotion$1 = Emotion;

// node_modules/@emotion/react/dist/emotion-react.browser.esm.js
var React3 = __toESM(require_react());
var import_hoist_non_react_statics = __toESM(require_hoist_non_react_statics_cjs());
var pkg = {
  name: "@emotion/react",
  version: "11.11.1",
  main: "dist/emotion-react.cjs.js",
  module: "dist/emotion-react.esm.js",
  browser: {
    "./dist/emotion-react.esm.js": "./dist/emotion-react.browser.esm.js"
  },
  exports: {
    ".": {
      module: {
        worker: "./dist/emotion-react.worker.esm.js",
        browser: "./dist/emotion-react.browser.esm.js",
        "default": "./dist/emotion-react.esm.js"
      },
      "import": "./dist/emotion-react.cjs.mjs",
      "default": "./dist/emotion-react.cjs.js"
    },
    "./jsx-runtime": {
      module: {
        worker: "./jsx-runtime/dist/emotion-react-jsx-runtime.worker.esm.js",
        browser: "./jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js",
        "default": "./jsx-runtime/dist/emotion-react-jsx-runtime.esm.js"
      },
      "import": "./jsx-runtime/dist/emotion-react-jsx-runtime.cjs.mjs",
      "default": "./jsx-runtime/dist/emotion-react-jsx-runtime.cjs.js"
    },
    "./_isolated-hnrs": {
      module: {
        worker: "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.worker.esm.js",
        browser: "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.esm.js",
        "default": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.esm.js"
      },
      "import": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.cjs.mjs",
      "default": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.cjs.js"
    },
    "./jsx-dev-runtime": {
      module: {
        worker: "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.worker.esm.js",
        browser: "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.browser.esm.js",
        "default": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.esm.js"
      },
      "import": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.cjs.mjs",
      "default": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.cjs.js"
    },
    "./package.json": "./package.json",
    "./types/css-prop": "./types/css-prop.d.ts",
    "./macro": {
      types: {
        "import": "./macro.d.mts",
        "default": "./macro.d.ts"
      },
      "default": "./macro.js"
    }
  },
  types: "types/index.d.ts",
  files: [
    "src",
    "dist",
    "jsx-runtime",
    "jsx-dev-runtime",
    "_isolated-hnrs",
    "types/*.d.ts",
    "macro.*"
  ],
  sideEffects: false,
  author: "Emotion Contributors",
  license: "MIT",
  scripts: {
    "test:typescript": "dtslint types"
  },
  dependencies: {
    "@babel/runtime": "^7.18.3",
    "@emotion/babel-plugin": "^11.11.0",
    "@emotion/cache": "^11.11.0",
    "@emotion/serialize": "^1.1.2",
    "@emotion/use-insertion-effect-with-fallbacks": "^1.0.1",
    "@emotion/utils": "^1.2.1",
    "@emotion/weak-memoize": "^0.3.1",
    "hoist-non-react-statics": "^3.3.1"
  },
  peerDependencies: {
    react: ">=16.8.0"
  },
  peerDependenciesMeta: {
    "@types/react": {
      optional: true
    }
  },
  devDependencies: {
    "@definitelytyped/dtslint": "0.0.112",
    "@emotion/css": "11.11.0",
    "@emotion/css-prettifier": "1.1.3",
    "@emotion/server": "11.11.0",
    "@emotion/styled": "11.11.0",
    "html-tag-names": "^1.1.2",
    react: "16.14.0",
    "svg-tag-names": "^1.1.1",
    typescript: "^4.5.5"
  },
  repository: "https://github.com/emotion-js/emotion/tree/main/packages/react",
  publishConfig: {
    access: "public"
  },
  "umd:main": "dist/emotion-react.umd.min.js",
  preconstruct: {
    entrypoints: [
      "./index.js",
      "./jsx-runtime.js",
      "./jsx-dev-runtime.js",
      "./_isolated-hnrs.js"
    ],
    umdName: "emotionReact",
    exports: {
      envConditions: [
        "browser",
        "worker"
      ],
      extra: {
        "./types/css-prop": "./types/css-prop.d.ts",
        "./macro": {
          types: {
            "import": "./macro.d.mts",
            "default": "./macro.d.ts"
          },
          "default": "./macro.js"
        }
      }
    }
  }
};
var jsx = function jsx2(type, props) {
  var args = arguments;
  if (props == null || !hasOwnProperty.call(props, "css")) {
    return React3.createElement.apply(void 0, args);
  }
  var argsLength = args.length;
  var createElementArgArray = new Array(argsLength);
  createElementArgArray[0] = Emotion$1;
  createElementArgArray[1] = createEmotionProps(type, props);
  for (var i2 = 2; i2 < argsLength; i2++) {
    createElementArgArray[i2] = args[i2];
  }
  return React3.createElement.apply(null, createElementArgArray);
};
var warnedAboutCssPropForGlobal = false;
var Global = /* @__PURE__ */ withEmotionCache(function(props, cache2) {
  if (!warnedAboutCssPropForGlobal && // check for className as well since the user is
  // probably using the custom createElement which
  // means it will be turned into a className prop
  // $FlowFixMe I don't really want to add it to the type since it shouldn't be used
  (props.className || props.css)) {
    console.error("It looks like you're using the css prop on Global, did you mean to use the styles prop instead?");
    warnedAboutCssPropForGlobal = true;
  }
  var styles = props.styles;
  var serialized = serializeStyles([styles], void 0, React3.useContext(ThemeContext));
  if (!isBrowser2) {
    var _ref18;
    var serializedNames = serialized.name;
    var serializedStyles = serialized.styles;
    var next2 = serialized.next;
    while (next2 !== void 0) {
      serializedNames += " " + next2.name;
      serializedStyles += next2.styles;
      next2 = next2.next;
    }
    var shouldCache = cache2.compat === true;
    var rules = cache2.insert("", {
      name: serializedNames,
      styles: serializedStyles
    }, cache2.sheet, shouldCache);
    if (shouldCache) {
      return null;
    }
    return /* @__PURE__ */ React3.createElement("style", (_ref18 = {}, _ref18["data-emotion"] = cache2.key + "-global " + serializedNames, _ref18.dangerouslySetInnerHTML = {
      __html: rules
    }, _ref18.nonce = cache2.sheet.nonce, _ref18));
  }
  var sheetRef = React3.useRef();
  useInsertionEffectWithLayoutFallback(function() {
    var key = cache2.key + "-global";
    var sheet = new cache2.sheet.constructor({
      key,
      nonce: cache2.sheet.nonce,
      container: cache2.sheet.container,
      speedy: cache2.sheet.isSpeedy
    });
    var rehydrating = false;
    var node56 = document.querySelector('style[data-emotion="' + key + " " + serialized.name + '"]');
    if (cache2.sheet.tags.length) {
      sheet.before = cache2.sheet.tags[0];
    }
    if (node56 !== null) {
      rehydrating = true;
      node56.setAttribute("data-emotion", key);
      sheet.hydrate([node56]);
    }
    sheetRef.current = [sheet, rehydrating];
    return function() {
      sheet.flush();
    };
  }, [cache2]);
  useInsertionEffectWithLayoutFallback(function() {
    var sheetRefCurrent = sheetRef.current;
    var sheet = sheetRefCurrent[0], rehydrating = sheetRefCurrent[1];
    if (rehydrating) {
      sheetRefCurrent[1] = false;
      return;
    }
    if (serialized.next !== void 0) {
      insertStyles(cache2, serialized.next, true);
    }
    if (sheet.tags.length) {
      var element2 = sheet.tags[sheet.tags.length - 1].nextElementSibling;
      sheet.before = element2;
      sheet.flush();
    }
    cache2.insert("", serialized, sheet, false);
  }, [cache2, serialized.name]);
  return null;
});
if (true) {
  Global.displayName = "EmotionGlobal";
}
function css() {
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
    args[_key] = arguments[_key];
  }
  return serializeStyles(args);
}
var keyframes = function keyframes2() {
  var insertable = css.apply(void 0, arguments);
  var name2 = "animation-" + insertable.name;
  return {
    name: name2,
    styles: "@keyframes " + name2 + "{" + insertable.styles + "}",
    anim: 1,
    toString: function toString2() {
      return "_EMO_" + this.name + "_" + this.styles + "_EMO_";
    }
  };
};
var classnames = function classnames2(args) {
  var len = args.length;
  var i2 = 0;
  var cls = "";
  for (; i2 < len; i2++) {
    var arg = args[i2];
    if (arg == null)
      continue;
    var toAdd = void 0;
    switch (typeof arg) {
      case "boolean":
        break;
      case "object": {
        if (Array.isArray(arg)) {
          toAdd = classnames2(arg);
        } else {
          if (arg.styles !== void 0 && arg.name !== void 0) {
            console.error("You have passed styles created with `css` from `@emotion/react` package to the `cx`.\n`cx` is meant to compose class names (strings) so you should convert those styles to a class name by passing them to the `css` received from <ClassNames/> component.");
          }
          toAdd = "";
          for (var k2 in arg) {
            if (arg[k2] && k2) {
              toAdd && (toAdd += " ");
              toAdd += k2;
            }
          }
        }
        break;
      }
      default: {
        toAdd = arg;
      }
    }
    if (toAdd) {
      cls && (cls += " ");
      cls += toAdd;
    }
  }
  return cls;
};
function merge(registered, css2, className) {
  var registeredStyles = [];
  var rawClassName = getRegisteredStyles(registered, registeredStyles, className);
  if (registeredStyles.length < 2) {
    return className;
  }
  return rawClassName + css2(registeredStyles);
}
var Insertion3 = function Insertion4(_ref18) {
  var cache2 = _ref18.cache, serializedArr = _ref18.serializedArr;
  useInsertionEffectAlwaysWithSyncFallback(function() {
    for (var i2 = 0; i2 < serializedArr.length; i2++) {
      insertStyles(cache2, serializedArr[i2], false);
    }
  });
  return null;
};
var ClassNames = /* @__PURE__ */ withEmotionCache(function(props, cache2) {
  var hasRendered = false;
  var serializedArr = [];
  var css2 = function css3() {
    if (hasRendered && true) {
      throw new Error("css can only be used during render");
    }
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    var serialized = serializeStyles(args, cache2.registered);
    serializedArr.push(serialized);
    registerStyles(cache2, serialized, false);
    return cache2.key + "-" + serialized.name;
  };
  var cx = function cx2() {
    if (hasRendered && true) {
      throw new Error("cx can only be used during render");
    }
    for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
      args[_key2] = arguments[_key2];
    }
    return merge(cache2.registered, css2, classnames(args));
  };
  var content2 = {
    css: css2,
    cx,
    theme: React3.useContext(ThemeContext)
  };
  var ele = props.children(content2);
  hasRendered = true;
  return /* @__PURE__ */ React3.createElement(React3.Fragment, null, /* @__PURE__ */ React3.createElement(Insertion3, {
    cache: cache2,
    serializedArr
  }), ele);
});
if (true) {
  ClassNames.displayName = "EmotionClassNames";
}
if (true) {
  isBrowser4 = true;
  isTestEnv = typeof jest !== "undefined" || typeof vi !== "undefined";
  if (isBrowser4 && !isTestEnv) {
    globalContext = // $FlowIgnore
    typeof globalThis !== "undefined" ? globalThis : isBrowser4 ? window : global;
    globalKey = "__EMOTION_REACT_" + pkg.version.split(".")[0] + "__";
    if (globalContext[globalKey]) {
      console.warn("You are loading @emotion/react when it is already loaded. Running multiple instances may cause problems. This can happen if multiple versions are used, or if multiple builds of the same version are used.");
    }
    globalContext[globalKey] = true;
  }
}
var isBrowser4;
var isTestEnv;
var globalContext;
var globalKey;

// node_modules/@arizeai/components/dist/components.esm.js
var import_react35 = __toESM(require_react());

// node_modules/@react-aria/overlays/dist/import.mjs
var import_react9 = __toESM(require_react(), 1);

// node_modules/@react-stately/utils/dist/import.mjs
var import_react2 = __toESM(require_react(), 1);
function $458b0a5536c1a7cf$export$40bfa8c7b0832715(value, defaultValue, onChange) {
  let [stateValue, setStateValue] = (0, import_react2.useState)(value || defaultValue);
  let isControlledRef = (0, import_react2.useRef)(value !== void 0);
  let isControlled = value !== void 0;
  (0, import_react2.useEffect)(() => {
    let wasControlled = isControlledRef.current;
    if (wasControlled !== isControlled)
      console.warn(`WARN: A component changed from ${wasControlled ? "controlled" : "uncontrolled"} to ${isControlled ? "controlled" : "uncontrolled"}.`);
    isControlledRef.current = isControlled;
  }, [
    isControlled
  ]);
  let currentValue = isControlled ? value : stateValue;
  let setValue = (0, import_react2.useCallback)((value2, ...args) => {
    let onChangeCaller = (value3, ...onChangeArgs) => {
      if (onChange) {
        if (!Object.is(currentValue, value3))
          onChange(value3, ...onChangeArgs);
      }
      if (!isControlled)
        currentValue = value3;
    };
    if (typeof value2 === "function") {
      console.warn("We can not support a function callback. See Github Issues for details https://github.com/adobe/react-spectrum/issues/2320");
      let updateFunction = (oldValue, ...functionArgs) => {
        let interceptedValue = value2(isControlled ? currentValue : oldValue, ...functionArgs);
        onChangeCaller(interceptedValue, ...args);
        if (!isControlled)
          return interceptedValue;
        return oldValue;
      };
      setStateValue(updateFunction);
    } else {
      if (!isControlled)
        setStateValue(value2);
      onChangeCaller(value2, ...args);
    }
  }, [
    isControlled,
    currentValue,
    onChange
  ]);
  return [
    currentValue,
    setValue
  ];
}
function $9446cca9a3875146$export$7d15b64cf5a3a4c4(value, min3 = -Infinity, max3 = Infinity) {
  let newValue = Math.min(Math.max(value, min3), max3);
  return newValue;
}
function $9446cca9a3875146$export$cb6e0bb50bc19463(value, min3, max3, step) {
  min3 = Number(min3);
  max3 = Number(max3);
  let remainder = (value - (isNaN(min3) ? 0 : min3)) % step;
  let snappedValue = Math.abs(remainder) * 2 >= step ? value + Math.sign(remainder) * (step - Math.abs(remainder)) : value - remainder;
  if (!isNaN(min3)) {
    if (snappedValue < min3)
      snappedValue = min3;
    else if (!isNaN(max3) && snappedValue > max3)
      snappedValue = min3 + Math.floor((max3 - min3) / step) * step;
  } else if (!isNaN(max3) && snappedValue > max3)
    snappedValue = Math.floor(max3 / step) * step;
  let string2 = step.toString();
  let index = string2.indexOf(".");
  let precision = index >= 0 ? string2.length - index : 0;
  if (precision > 0) {
    let pow2 = Math.pow(10, precision);
    snappedValue = Math.round(snappedValue * pow2) / pow2;
  }
  return snappedValue;
}

// node_modules/@react-aria/utils/dist/import.mjs
var import_react4 = __toESM(require_react(), 1);

// node_modules/@react-aria/ssr/dist/import.mjs
var import_react3 = __toESM(require_react(), 1);
var $b5e257d569688ac6$var$defaultContext = {
  prefix: String(Math.round(Math.random() * 1e10)),
  current: 0
};
var $b5e257d569688ac6$var$SSRContext = /* @__PURE__ */ (0, import_react3.default).createContext($b5e257d569688ac6$var$defaultContext);
var $b5e257d569688ac6$var$IsSSRContext = /* @__PURE__ */ (0, import_react3.default).createContext(false);
var $b5e257d569688ac6$var$canUseDOM = Boolean(typeof window !== "undefined" && window.document && window.document.createElement);
var $b5e257d569688ac6$var$componentIds = /* @__PURE__ */ new WeakMap();
function $b5e257d569688ac6$var$useCounter(isDisabled = false) {
  let ctx = (0, import_react3.useContext)($b5e257d569688ac6$var$SSRContext);
  let ref = (0, import_react3.useRef)(null);
  if (ref.current === null && !isDisabled) {
    var _React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, _React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED_ReactCurrentOwner;
    let currentOwner = (_React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = (0, import_react3.default).__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED) === null || _React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED === void 0 ? void 0 : (_React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED_ReactCurrentOwner = _React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner) === null || _React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED_ReactCurrentOwner === void 0 ? void 0 : _React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED_ReactCurrentOwner.current;
    if (currentOwner) {
      let prevComponentValue = $b5e257d569688ac6$var$componentIds.get(currentOwner);
      if (prevComponentValue == null)
        $b5e257d569688ac6$var$componentIds.set(currentOwner, {
          id: ctx.current,
          state: currentOwner.memoizedState
        });
      else if (currentOwner.memoizedState !== prevComponentValue.state) {
        ctx.current = prevComponentValue.id;
        $b5e257d569688ac6$var$componentIds.delete(currentOwner);
      }
    }
    ref.current = ++ctx.current;
  }
  return ref.current;
}
function $b5e257d569688ac6$var$useLegacySSRSafeId(defaultId) {
  let ctx = (0, import_react3.useContext)($b5e257d569688ac6$var$SSRContext);
  if (ctx === $b5e257d569688ac6$var$defaultContext && !$b5e257d569688ac6$var$canUseDOM)
    console.warn("When server rendering, you must wrap your application in an <SSRProvider> to ensure consistent ids are generated between the client and server.");
  let counter2 = $b5e257d569688ac6$var$useCounter(!!defaultId);
  let prefix3 = ctx === $b5e257d569688ac6$var$defaultContext && false ? "react-aria" : `react-aria${ctx.prefix}`;
  return defaultId || `${prefix3}-${counter2}`;
}
function $b5e257d569688ac6$var$useModernSSRSafeId(defaultId) {
  let id2 = (0, import_react3.default).useId();
  let [didSSR] = (0, import_react3.useState)($b5e257d569688ac6$export$535bd6ca7f90a273());
  let prefix3 = didSSR || false ? "react-aria" : `react-aria${$b5e257d569688ac6$var$defaultContext.prefix}`;
  return defaultId || `${prefix3}-${id2}`;
}
var $b5e257d569688ac6$export$619500959fc48b26 = typeof (0, import_react3.default)["useId"] === "function" ? $b5e257d569688ac6$var$useModernSSRSafeId : $b5e257d569688ac6$var$useLegacySSRSafeId;
function $b5e257d569688ac6$var$getSnapshot() {
  return false;
}
function $b5e257d569688ac6$var$getServerSnapshot() {
  return true;
}
function $b5e257d569688ac6$var$subscribe(onStoreChange) {
  return () => {
  };
}
function $b5e257d569688ac6$export$535bd6ca7f90a273() {
  if (typeof (0, import_react3.default)["useSyncExternalStore"] === "function")
    return (0, import_react3.default)["useSyncExternalStore"]($b5e257d569688ac6$var$subscribe, $b5e257d569688ac6$var$getSnapshot, $b5e257d569688ac6$var$getServerSnapshot);
  return (0, import_react3.useContext)($b5e257d569688ac6$var$IsSSRContext);
}

// node_modules/clsx/dist/clsx.m.js
function r(e3) {
  var t3, f, n2 = "";
  if ("string" == typeof e3 || "number" == typeof e3)
    n2 += e3;
  else if ("object" == typeof e3)
    if (Array.isArray(e3))
      for (t3 = 0; t3 < e3.length; t3++)
        e3[t3] && (f = r(e3[t3])) && (n2 && (n2 += " "), n2 += f);
    else
      for (t3 in e3)
        e3[t3] && (n2 && (n2 += " "), n2 += t3);
  return n2;
}
function clsx() {
  for (var e3, t3, f = 0, n2 = ""; f < arguments.length; )
    (e3 = arguments[f++]) && (t3 = r(e3)) && (n2 && (n2 += " "), n2 += t3);
  return n2;
}
var clsx_m_default = clsx;

// node_modules/@react-aria/utils/dist/import.mjs
var $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c = typeof document !== "undefined" ? (0, import_react4.default).useLayoutEffect : () => {
};
function $8ae05eaa5c114e9c$export$7f54fc3180508a52(fn) {
  const ref = (0, import_react4.useRef)(null);
  (0, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(() => {
    ref.current = fn;
  }, [
    fn
  ]);
  return (0, import_react4.useCallback)((...args) => {
    const f = ref.current;
    return f(...args);
  }, []);
}
function $1dbecbe27a04f9af$export$14d238f342723f25(defaultValue) {
  let [value, setValue] = (0, import_react4.useState)(defaultValue);
  let effect = (0, import_react4.useRef)(null);
  let nextRef = (0, $8ae05eaa5c114e9c$export$7f54fc3180508a52)(() => {
    let newValue = effect.current.next();
    if (newValue.done) {
      effect.current = null;
      return;
    }
    if (value === newValue.value)
      nextRef();
    else
      setValue(newValue.value);
  });
  (0, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(() => {
    if (effect.current)
      nextRef();
  });
  let queue = (0, $8ae05eaa5c114e9c$export$7f54fc3180508a52)((fn) => {
    effect.current = fn(value);
    nextRef();
  });
  return [
    value,
    queue
  ];
}
var $bdb11010cef70236$var$idsUpdaterMap = /* @__PURE__ */ new Map();
function $bdb11010cef70236$export$f680877a34711e37(defaultId) {
  let [value, setValue] = (0, import_react4.useState)(defaultId);
  let nextId = (0, import_react4.useRef)(null);
  let res = (0, $b5e257d569688ac6$export$619500959fc48b26)(value);
  let updateValue = (0, import_react4.useCallback)((val) => {
    nextId.current = val;
  }, []);
  $bdb11010cef70236$var$idsUpdaterMap.set(res, updateValue);
  (0, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(() => {
    let r3 = res;
    return () => {
      $bdb11010cef70236$var$idsUpdaterMap.delete(r3);
    };
  }, [
    res
  ]);
  (0, import_react4.useEffect)(() => {
    let newId = nextId.current;
    if (newId) {
      nextId.current = null;
      setValue(newId);
    }
  });
  return res;
}
function $bdb11010cef70236$export$cd8c9cb68f842629(idA, idB) {
  if (idA === idB)
    return idA;
  let setIdA = $bdb11010cef70236$var$idsUpdaterMap.get(idA);
  if (setIdA) {
    setIdA(idB);
    return idB;
  }
  let setIdB = $bdb11010cef70236$var$idsUpdaterMap.get(idB);
  if (setIdB) {
    setIdB(idA);
    return idA;
  }
  return idB;
}
function $bdb11010cef70236$export$b4cc09c592e8fdb8(depArray = []) {
  let id2 = $bdb11010cef70236$export$f680877a34711e37();
  let [resolvedId, setResolvedId] = (0, $1dbecbe27a04f9af$export$14d238f342723f25)(id2);
  let updateId = (0, import_react4.useCallback)(() => {
    setResolvedId(function* () {
      yield id2;
      yield document.getElementById(id2) ? id2 : void 0;
    });
  }, [
    id2,
    setResolvedId
  ]);
  (0, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(updateId, [
    id2,
    updateId,
    ...depArray
  ]);
  return resolvedId;
}
function $ff5963eb1fccf552$export$e08e3b67e392101e(...callbacks) {
  return (...args) => {
    for (let callback of callbacks)
      if (typeof callback === "function")
        callback(...args);
  };
}
function $3ef42575df84b30b$export$9d1611c77c2fe928(...args) {
  let result = {
    ...args[0]
  };
  for (let i2 = 1; i2 < args.length; i2++) {
    let props = args[i2];
    for (let key in props) {
      let a2 = result[key];
      let b = props[key];
      if (typeof a2 === "function" && typeof b === "function" && // This is a lot faster than a regex.
      key[0] === "o" && key[1] === "n" && key.charCodeAt(2) >= /* 'A' */
      65 && key.charCodeAt(2) <= /* 'Z' */
      90)
        result[key] = (0, $ff5963eb1fccf552$export$e08e3b67e392101e)(a2, b);
      else if ((key === "className" || key === "UNSAFE_className") && typeof a2 === "string" && typeof b === "string")
        result[key] = (0, clsx_m_default)(a2, b);
      else if (key === "id" && a2 && b)
        result.id = (0, $bdb11010cef70236$export$cd8c9cb68f842629)(a2, b);
      else
        result[key] = b !== void 0 ? b : a2;
    }
  }
  return result;
}
var $65484d02dcb7eb3e$var$DOMPropNames = /* @__PURE__ */ new Set([
  "id"
]);
var $65484d02dcb7eb3e$var$labelablePropNames = /* @__PURE__ */ new Set([
  "aria-label",
  "aria-labelledby",
  "aria-describedby",
  "aria-details"
]);
var $65484d02dcb7eb3e$var$linkPropNames = /* @__PURE__ */ new Set([
  "href",
  "target",
  "rel",
  "download",
  "ping",
  "referrerPolicy"
]);
var $65484d02dcb7eb3e$var$propRe = /^(data-.*)$/;
function $65484d02dcb7eb3e$export$457c3d6518dd4c6f(props, opts = {}) {
  let { labelable, isLink, propNames } = opts;
  let filteredProps = {};
  for (const prop in props)
    if (Object.prototype.hasOwnProperty.call(props, prop) && ($65484d02dcb7eb3e$var$DOMPropNames.has(prop) || labelable && $65484d02dcb7eb3e$var$labelablePropNames.has(prop) || isLink && $65484d02dcb7eb3e$var$linkPropNames.has(prop) || (propNames === null || propNames === void 0 ? void 0 : propNames.has(prop)) || $65484d02dcb7eb3e$var$propRe.test(prop)))
      filteredProps[prop] = props[prop];
  return filteredProps;
}
function $7215afc6de606d6b$export$de79e2c695e052f3(element2) {
  if ($7215afc6de606d6b$var$supportsPreventScroll())
    element2.focus({
      preventScroll: true
    });
  else {
    let scrollableElements = $7215afc6de606d6b$var$getScrollableElements(element2);
    element2.focus();
    $7215afc6de606d6b$var$restoreScrollPosition(scrollableElements);
  }
}
var $7215afc6de606d6b$var$supportsPreventScrollCached = null;
function $7215afc6de606d6b$var$supportsPreventScroll() {
  if ($7215afc6de606d6b$var$supportsPreventScrollCached == null) {
    $7215afc6de606d6b$var$supportsPreventScrollCached = false;
    try {
      var focusElem = document.createElement("div");
      focusElem.focus({
        get preventScroll() {
          $7215afc6de606d6b$var$supportsPreventScrollCached = true;
          return true;
        }
      });
    } catch (e3) {
    }
  }
  return $7215afc6de606d6b$var$supportsPreventScrollCached;
}
function $7215afc6de606d6b$var$getScrollableElements(element2) {
  var parent = element2.parentNode;
  var scrollableElements = [];
  var rootScrollingElement = document.scrollingElement || document.documentElement;
  while (parent instanceof HTMLElement && parent !== rootScrollingElement) {
    if (parent.offsetHeight < parent.scrollHeight || parent.offsetWidth < parent.scrollWidth)
      scrollableElements.push({
        element: parent,
        scrollTop: parent.scrollTop,
        scrollLeft: parent.scrollLeft
      });
    parent = parent.parentNode;
  }
  if (rootScrollingElement instanceof HTMLElement)
    scrollableElements.push({
      element: rootScrollingElement,
      scrollTop: rootScrollingElement.scrollTop,
      scrollLeft: rootScrollingElement.scrollLeft
    });
  return scrollableElements;
}
function $7215afc6de606d6b$var$restoreScrollPosition(scrollableElements) {
  for (let { element: element2, scrollTop, scrollLeft } of scrollableElements) {
    element2.scrollTop = scrollTop;
    element2.scrollLeft = scrollLeft;
  }
}
function $c87311424ea30a05$var$testUserAgent(re2) {
  var _window_navigator_userAgentData;
  if (typeof window === "undefined" || window.navigator == null)
    return false;
  return ((_window_navigator_userAgentData = window.navigator["userAgentData"]) === null || _window_navigator_userAgentData === void 0 ? void 0 : _window_navigator_userAgentData.brands.some((brand) => re2.test(brand.brand))) || re2.test(window.navigator.userAgent);
}
function $c87311424ea30a05$var$testPlatform(re2) {
  var _window_navigator_userAgentData;
  return typeof window !== "undefined" && window.navigator != null ? re2.test(((_window_navigator_userAgentData = window.navigator["userAgentData"]) === null || _window_navigator_userAgentData === void 0 ? void 0 : _window_navigator_userAgentData.platform) || window.navigator.platform) : false;
}
function $c87311424ea30a05$export$9ac100e40613ea10() {
  return $c87311424ea30a05$var$testPlatform(/^Mac/i);
}
function $c87311424ea30a05$export$186c6964ca17d99() {
  return $c87311424ea30a05$var$testPlatform(/^iPhone/i);
}
function $c87311424ea30a05$export$7bef049ce92e4224() {
  return $c87311424ea30a05$var$testPlatform(/^iPad/i) || // iPadOS 13 lies and says it's a Mac, but we can distinguish by detecting touch support.
  $c87311424ea30a05$export$9ac100e40613ea10() && navigator.maxTouchPoints > 1;
}
function $c87311424ea30a05$export$fedb369cb70207f1() {
  return $c87311424ea30a05$export$186c6964ca17d99() || $c87311424ea30a05$export$7bef049ce92e4224();
}
function $c87311424ea30a05$export$e1865c3bedcd822b() {
  return $c87311424ea30a05$export$9ac100e40613ea10() || $c87311424ea30a05$export$fedb369cb70207f1();
}
function $c87311424ea30a05$export$78551043582a6a98() {
  return $c87311424ea30a05$var$testUserAgent(/AppleWebKit/i) && !$c87311424ea30a05$export$6446a186d09e379e();
}
function $c87311424ea30a05$export$6446a186d09e379e() {
  return $c87311424ea30a05$var$testUserAgent(/Chrome/i);
}
function $c87311424ea30a05$export$a11b0059900ceec8() {
  return $c87311424ea30a05$var$testUserAgent(/Android/i);
}
function $c87311424ea30a05$export$b7d78993b74f766d() {
  return $c87311424ea30a05$var$testUserAgent(/Firefox/i);
}
var $ea8dcbcb9ea1b556$var$RouterContext = /* @__PURE__ */ (0, import_react4.createContext)({
  isNative: true,
  open: $ea8dcbcb9ea1b556$var$openSyntheticLink
});
function $ea8dcbcb9ea1b556$export$9a302a45f65d0572() {
  return (0, import_react4.useContext)($ea8dcbcb9ea1b556$var$RouterContext);
}
function $ea8dcbcb9ea1b556$export$efa8c9099e530235(link, modifiers2) {
  let target = link.getAttribute("target");
  return (!target || target === "_self") && link.origin === location.origin && !link.hasAttribute("download") && !modifiers2.metaKey && // open in new tab (mac)
  !modifiers2.ctrlKey && // open in new tab (windows)
  !modifiers2.altKey && // download
  !modifiers2.shiftKey;
}
function $ea8dcbcb9ea1b556$export$95185d699e05d4d7(target, modifiers2, setOpening = true) {
  var _window_event, _window_event_type;
  let { metaKey, ctrlKey, altKey, shiftKey } = modifiers2;
  if ((0, $c87311424ea30a05$export$b7d78993b74f766d)() && ((_window_event = window.event) === null || _window_event === void 0 ? void 0 : (_window_event_type = _window_event.type) === null || _window_event_type === void 0 ? void 0 : _window_event_type.startsWith("key")) && target.target === "_blank") {
    if ((0, $c87311424ea30a05$export$9ac100e40613ea10)())
      metaKey = true;
    else
      ctrlKey = true;
  }
  let event = (0, $c87311424ea30a05$export$78551043582a6a98)() && (0, $c87311424ea30a05$export$9ac100e40613ea10)() && !(0, $c87311424ea30a05$export$7bef049ce92e4224)() && true ? new KeyboardEvent("keydown", {
    keyIdentifier: "Enter",
    metaKey,
    ctrlKey,
    altKey,
    shiftKey
  }) : new MouseEvent("click", {
    metaKey,
    ctrlKey,
    altKey,
    shiftKey,
    bubbles: true,
    cancelable: true
  });
  $ea8dcbcb9ea1b556$export$95185d699e05d4d7.isOpening = setOpening;
  (0, $7215afc6de606d6b$export$de79e2c695e052f3)(target);
  target.dispatchEvent(event);
  $ea8dcbcb9ea1b556$export$95185d699e05d4d7.isOpening = false;
}
$ea8dcbcb9ea1b556$export$95185d699e05d4d7.isOpening = false;
function $ea8dcbcb9ea1b556$var$getSyntheticLink(target, open) {
  if (target instanceof HTMLAnchorElement)
    open(target);
  else if (target.hasAttribute("data-href")) {
    let link = document.createElement("a");
    link.href = target.getAttribute("data-href");
    if (target.hasAttribute("data-target"))
      link.target = target.getAttribute("data-target");
    if (target.hasAttribute("data-rel"))
      link.rel = target.getAttribute("data-rel");
    if (target.hasAttribute("data-download"))
      link.download = target.getAttribute("data-download");
    if (target.hasAttribute("data-ping"))
      link.ping = target.getAttribute("data-ping");
    if (target.hasAttribute("data-referrer-policy"))
      link.referrerPolicy = target.getAttribute("data-referrer-policy");
    target.appendChild(link);
    open(link);
    target.removeChild(link);
  }
}
function $ea8dcbcb9ea1b556$var$openSyntheticLink(target, modifiers2) {
  $ea8dcbcb9ea1b556$var$getSyntheticLink(target, (link) => $ea8dcbcb9ea1b556$export$95185d699e05d4d7(link, modifiers2));
}
var $bbed8b41f857bcc0$var$transitionsByElement = /* @__PURE__ */ new Map();
var $bbed8b41f857bcc0$var$transitionCallbacks = /* @__PURE__ */ new Set();
function $bbed8b41f857bcc0$var$setupGlobalEvents() {
  if (typeof window === "undefined")
    return;
  let onTransitionStart = (e3) => {
    let transitions = $bbed8b41f857bcc0$var$transitionsByElement.get(e3.target);
    if (!transitions) {
      transitions = /* @__PURE__ */ new Set();
      $bbed8b41f857bcc0$var$transitionsByElement.set(e3.target, transitions);
      e3.target.addEventListener("transitioncancel", onTransitionEnd);
    }
    transitions.add(e3.propertyName);
  };
  let onTransitionEnd = (e3) => {
    let properties = $bbed8b41f857bcc0$var$transitionsByElement.get(e3.target);
    if (!properties)
      return;
    properties.delete(e3.propertyName);
    if (properties.size === 0) {
      e3.target.removeEventListener("transitioncancel", onTransitionEnd);
      $bbed8b41f857bcc0$var$transitionsByElement.delete(e3.target);
    }
    if ($bbed8b41f857bcc0$var$transitionsByElement.size === 0) {
      for (let cb of $bbed8b41f857bcc0$var$transitionCallbacks)
        cb();
      $bbed8b41f857bcc0$var$transitionCallbacks.clear();
    }
  };
  document.body.addEventListener("transitionrun", onTransitionStart);
  document.body.addEventListener("transitionend", onTransitionEnd);
}
if (typeof document !== "undefined") {
  if (document.readyState !== "loading")
    $bbed8b41f857bcc0$var$setupGlobalEvents();
  else
    document.addEventListener("DOMContentLoaded", $bbed8b41f857bcc0$var$setupGlobalEvents);
}
function $bbed8b41f857bcc0$export$24490316f764c430(fn) {
  requestAnimationFrame(() => {
    if ($bbed8b41f857bcc0$var$transitionsByElement.size === 0)
      fn();
    else
      $bbed8b41f857bcc0$var$transitionCallbacks.add(fn);
  });
}
function $03deb23ff14920c4$export$4eaf04e54aa8eed6() {
  let globalListeners = (0, import_react4.useRef)(/* @__PURE__ */ new Map());
  let addGlobalListener = (0, import_react4.useCallback)((eventTarget, type, listener, options) => {
    let fn = (options === null || options === void 0 ? void 0 : options.once) ? (...args) => {
      globalListeners.current.delete(listener);
      listener(...args);
    } : listener;
    globalListeners.current.set(listener, {
      type,
      eventTarget,
      fn,
      options
    });
    eventTarget.addEventListener(type, listener, options);
  }, []);
  let removeGlobalListener = (0, import_react4.useCallback)((eventTarget, type, listener, options) => {
    var _globalListeners_current_get;
    let fn = ((_globalListeners_current_get = globalListeners.current.get(listener)) === null || _globalListeners_current_get === void 0 ? void 0 : _globalListeners_current_get.fn) || listener;
    eventTarget.removeEventListener(type, fn, options);
    globalListeners.current.delete(listener);
  }, []);
  let removeAllGlobalListeners = (0, import_react4.useCallback)(() => {
    globalListeners.current.forEach((value, key) => {
      removeGlobalListener(value.eventTarget, value.type, key, value.options);
    });
  }, [
    removeGlobalListener
  ]);
  (0, import_react4.useEffect)(() => {
    return removeAllGlobalListeners;
  }, [
    removeAllGlobalListeners
  ]);
  return {
    addGlobalListener,
    removeGlobalListener,
    removeAllGlobalListeners
  };
}
function $313b98861ee5dd6c$export$d6875122194c7b44(props, defaultLabel) {
  let { id: id2, "aria-label": label, "aria-labelledby": labelledBy } = props;
  id2 = (0, $bdb11010cef70236$export$f680877a34711e37)(id2);
  if (labelledBy && label) {
    let ids = /* @__PURE__ */ new Set([
      id2,
      ...labelledBy.trim().split(/\s+/)
    ]);
    labelledBy = [
      ...ids
    ].join(" ");
  } else if (labelledBy)
    labelledBy = labelledBy.trim().split(/\s+/).join(" ");
  if (!label && !labelledBy && defaultLabel)
    label = defaultLabel;
  return {
    id: id2,
    "aria-label": label,
    "aria-labelledby": labelledBy
  };
}
function $9daab02d461809db$var$hasResizeObserver() {
  return typeof window.ResizeObserver !== "undefined";
}
function $9daab02d461809db$export$683480f191c0e3ea(options) {
  const { ref, onResize } = options;
  (0, import_react4.useEffect)(() => {
    let element2 = ref === null || ref === void 0 ? void 0 : ref.current;
    if (!element2)
      return;
    if (!$9daab02d461809db$var$hasResizeObserver()) {
      window.addEventListener("resize", onResize, false);
      return () => {
        window.removeEventListener("resize", onResize, false);
      };
    } else {
      const resizeObserverInstance = new window.ResizeObserver((entries) => {
        if (!entries.length)
          return;
        onResize();
      });
      resizeObserverInstance.observe(element2);
      return () => {
        if (element2)
          resizeObserverInstance.unobserve(element2);
      };
    }
  }, [
    onResize,
    ref
  ]);
}
function $e7801be82b4b2a53$export$4debdb1a3f0fa79e(context2, ref) {
  (0, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(() => {
    if (context2 && context2.ref && ref) {
      context2.ref.current = ref.current;
      return () => {
        context2.ref.current = null;
      };
    }
  });
}
function $62d8ded9296f3872$export$cfa2225e87938781(node56) {
  if ($62d8ded9296f3872$export$2bb74740c4e19def(node56))
    node56 = node56.parentElement;
  while (node56 && !$62d8ded9296f3872$export$2bb74740c4e19def(node56))
    node56 = node56.parentElement;
  return node56 || document.scrollingElement || document.documentElement;
}
function $62d8ded9296f3872$export$2bb74740c4e19def(node56) {
  let style = window.getComputedStyle(node56);
  return /(auto|scroll)/.test(style.overflow + style.overflowX + style.overflowY);
}
var $5df64b3807dc15ee$var$visualViewport = typeof document !== "undefined" && window.visualViewport;
var $ef06256079686ba0$var$descriptionId = 0;
var $ef06256079686ba0$var$descriptionNodes = /* @__PURE__ */ new Map();
function $ef06256079686ba0$export$f8aeda7b10753fa1(description) {
  let [id2, setId] = (0, import_react4.useState)(void 0);
  (0, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(() => {
    if (!description)
      return;
    let desc = $ef06256079686ba0$var$descriptionNodes.get(description);
    if (!desc) {
      let id3 = `react-aria-description-${$ef06256079686ba0$var$descriptionId++}`;
      setId(id3);
      let node56 = document.createElement("div");
      node56.id = id3;
      node56.style.display = "none";
      node56.textContent = description;
      document.body.appendChild(node56);
      desc = {
        refCount: 0,
        element: node56
      };
      $ef06256079686ba0$var$descriptionNodes.set(description, desc);
    } else
      setId(desc.element.id);
    desc.refCount++;
    return () => {
      if (--desc.refCount === 0) {
        desc.element.remove();
        $ef06256079686ba0$var$descriptionNodes.delete(description);
      }
    };
  }, [
    description
  ]);
  return {
    "aria-describedby": description ? id2 : void 0
  };
}
function $e9faafb641e167db$export$90fc3a17d93f704c(ref, event, handler, options) {
  let handleEvent = (0, $8ae05eaa5c114e9c$export$7f54fc3180508a52)(handler);
  let isDisabled = handler == null;
  (0, import_react4.useEffect)(() => {
    if (isDisabled)
      return;
    let element2 = ref.current;
    element2.addEventListener(event, handleEvent, options);
    return () => {
      element2.removeEventListener(event, handleEvent, options);
    };
  }, [
    ref,
    event,
    options,
    isDisabled,
    handleEvent
  ]);
}
function $2f04cbc44ee30ce0$export$53a0910f038337bd(scrollView, element2) {
  let offsetX = $2f04cbc44ee30ce0$var$relativeOffset(scrollView, element2, "left");
  let offsetY = $2f04cbc44ee30ce0$var$relativeOffset(scrollView, element2, "top");
  let width = element2.offsetWidth;
  let height = element2.offsetHeight;
  let x2 = scrollView.scrollLeft;
  let y2 = scrollView.scrollTop;
  let { borderTopWidth, borderLeftWidth } = getComputedStyle(scrollView);
  let borderAdjustedX = scrollView.scrollLeft + parseInt(borderLeftWidth, 10);
  let borderAdjustedY = scrollView.scrollTop + parseInt(borderTopWidth, 10);
  let maxX = borderAdjustedX + scrollView.clientWidth;
  let maxY = borderAdjustedY + scrollView.clientHeight;
  if (offsetX <= x2)
    x2 = offsetX - parseInt(borderLeftWidth, 10);
  else if (offsetX + width > maxX)
    x2 += offsetX + width - maxX;
  if (offsetY <= borderAdjustedY)
    y2 = offsetY - parseInt(borderTopWidth, 10);
  else if (offsetY + height > maxY)
    y2 += offsetY + height - maxY;
  scrollView.scrollLeft = x2;
  scrollView.scrollTop = y2;
}
function $2f04cbc44ee30ce0$var$relativeOffset(ancestor, child, axis) {
  const prop = axis === "left" ? "offsetLeft" : "offsetTop";
  let sum2 = 0;
  while (child.offsetParent) {
    sum2 += child[prop];
    if (child.offsetParent === ancestor)
      break;
    else if (child.offsetParent.contains(ancestor)) {
      sum2 -= ancestor[prop];
      break;
    }
    child = child.offsetParent;
  }
  return sum2;
}
function $2f04cbc44ee30ce0$export$c826860796309d1b(targetElement, opts) {
  if (document.contains(targetElement)) {
    let root2 = document.scrollingElement || document.documentElement;
    let isScrollPrevented = window.getComputedStyle(root2).overflow === "hidden";
    if (!isScrollPrevented) {
      var _targetElement_scrollIntoView;
      let { left: originalLeft, top: originalTop } = targetElement.getBoundingClientRect();
      targetElement === null || targetElement === void 0 ? void 0 : (_targetElement_scrollIntoView = targetElement.scrollIntoView) === null || _targetElement_scrollIntoView === void 0 ? void 0 : _targetElement_scrollIntoView.call(targetElement, {
        block: "nearest"
      });
      let { left: newLeft, top: newTop } = targetElement.getBoundingClientRect();
      if (Math.abs(originalLeft - newLeft) > 1 || Math.abs(originalTop - newTop) > 1) {
        var _opts_containingElement, _opts_containingElement_scrollIntoView, _targetElement_scrollIntoView1;
        opts === null || opts === void 0 ? void 0 : (_opts_containingElement = opts.containingElement) === null || _opts_containingElement === void 0 ? void 0 : (_opts_containingElement_scrollIntoView = _opts_containingElement.scrollIntoView) === null || _opts_containingElement_scrollIntoView === void 0 ? void 0 : _opts_containingElement_scrollIntoView.call(_opts_containingElement, {
          block: "center",
          inline: "center"
        });
        (_targetElement_scrollIntoView1 = targetElement.scrollIntoView) === null || _targetElement_scrollIntoView1 === void 0 ? void 0 : _targetElement_scrollIntoView1.call(targetElement, {
          block: "nearest"
        });
      }
    } else {
      let scrollParent = (0, $62d8ded9296f3872$export$cfa2225e87938781)(targetElement);
      while (targetElement && scrollParent && targetElement !== root2 && scrollParent !== root2) {
        $2f04cbc44ee30ce0$export$53a0910f038337bd(scrollParent, targetElement);
        targetElement = scrollParent;
        scrollParent = (0, $62d8ded9296f3872$export$cfa2225e87938781)(targetElement);
      }
    }
  }
}
function $6a7db85432448f7f$export$60278871457622de(event) {
  if (event.mozInputSource === 0 && event.isTrusted)
    return true;
  if ((0, $c87311424ea30a05$export$a11b0059900ceec8)() && event.pointerType)
    return event.type === "click" && event.buttons === 1;
  return event.detail === 0 && !event.pointerType;
}
function $6a7db85432448f7f$export$29bf1b5f2c56cf63(event) {
  return !(0, $c87311424ea30a05$export$a11b0059900ceec8)() && event.width === 0 && event.height === 0 || event.width === 1 && event.height === 1 && event.pressure === 0 && event.detail === 0 && event.pointerType === "mouse";
}
function $99facab73266f662$export$5add1d006293d136(ref, initialValue, onReset) {
  let resetValue = (0, import_react4.useRef)(initialValue);
  let handleReset = (0, $8ae05eaa5c114e9c$export$7f54fc3180508a52)(() => {
    if (onReset)
      onReset(resetValue.current);
  });
  (0, import_react4.useEffect)(() => {
    var _ref_current;
    let form = ref === null || ref === void 0 ? void 0 : (_ref_current = ref.current) === null || _ref_current === void 0 ? void 0 : _ref_current.form;
    form === null || form === void 0 ? void 0 : form.addEventListener("reset", handleReset);
    return () => {
      form === null || form === void 0 ? void 0 : form.removeEventListener("reset", handleReset);
    };
  }, [
    ref,
    handleReset
  ]);
}

// node_modules/@react-aria/i18n/dist/real-module.mjs
var import_react5 = __toESM(require_react(), 1);

// node_modules/@internationalized/string/dist/import.mjs
var $5b160d28a433310d$export$c17fa47878dc55b6 = class {
  /** Returns a localized string for the given key and locale. */
  getStringForLocale(key, locale3) {
    let strings = this.strings[locale3];
    if (!strings) {
      strings = $5b160d28a433310d$var$getStringsForLocale(locale3, this.strings, this.defaultLocale);
      this.strings[locale3] = strings;
    }
    let string2 = strings[key];
    if (!string2)
      throw new Error(`Could not find intl message ${key} in ${locale3} locale`);
    return string2;
  }
  constructor(messages, defaultLocale3 = "en-US") {
    this.strings = {
      ...messages
    };
    this.defaultLocale = defaultLocale3;
  }
};
function $5b160d28a433310d$var$getStringsForLocale(locale3, strings, defaultLocale3 = "en-US") {
  if (strings[locale3])
    return strings[locale3];
  let language2 = $5b160d28a433310d$var$getLanguage(locale3);
  if (strings[language2])
    return strings[language2];
  for (let key in strings) {
    if (key.startsWith(language2 + "-"))
      return strings[key];
  }
  return strings[defaultLocale3];
}
function $5b160d28a433310d$var$getLanguage(locale3) {
  if (Intl.Locale)
    return new Intl.Locale(locale3).language;
  return locale3.split("-")[0];
}
var $6db58dc88e78b024$var$pluralRulesCache = /* @__PURE__ */ new Map();
var $6db58dc88e78b024$var$numberFormatCache = /* @__PURE__ */ new Map();
var $6db58dc88e78b024$export$2f817fcdc4b89ae0 = class {
  /** Formats a localized string for the given key with the provided variables. */
  format(key, variables) {
    let message = this.strings.getStringForLocale(key, this.locale);
    return typeof message === "function" ? message(variables, this) : message;
  }
  plural(count2, options, type = "cardinal") {
    let opt = options["=" + count2];
    if (opt)
      return typeof opt === "function" ? opt() : opt;
    let key = this.locale + ":" + type;
    let pluralRules = $6db58dc88e78b024$var$pluralRulesCache.get(key);
    if (!pluralRules) {
      pluralRules = new Intl.PluralRules(this.locale, {
        type
      });
      $6db58dc88e78b024$var$pluralRulesCache.set(key, pluralRules);
    }
    let selected = pluralRules.select(count2);
    opt = options[selected] || options.other;
    return typeof opt === "function" ? opt() : opt;
  }
  number(value) {
    let numberFormat = $6db58dc88e78b024$var$numberFormatCache.get(this.locale);
    if (!numberFormat) {
      numberFormat = new Intl.NumberFormat(this.locale);
      $6db58dc88e78b024$var$numberFormatCache.set(this.locale, numberFormat);
    }
    return numberFormat.format(value);
  }
  select(options, value) {
    let opt = options[value] || options.other;
    return typeof opt === "function" ? opt() : opt;
  }
  constructor(locale3, strings) {
    this.locale = locale3;
    this.strings = strings;
  }
};

// node_modules/@swc/helpers/esm/_check_private_redeclaration.js
function _check_private_redeclaration(obj, privateCollection) {
  if (privateCollection.has(obj)) {
    throw new TypeError("Cannot initialize the same private elements twice on an object");
  }
}

// node_modules/@swc/helpers/esm/_class_private_field_init.js
function _class_private_field_init(obj, privateMap, value) {
  _check_private_redeclaration(obj, privateMap);
  privateMap.set(obj, value);
}

// node_modules/@internationalized/number/dist/import.mjs
var $488c6ddbf4ef74c2$var$formatterCache = /* @__PURE__ */ new Map();
var $488c6ddbf4ef74c2$var$supportsSignDisplay = false;
try {
  $488c6ddbf4ef74c2$var$supportsSignDisplay = new Intl.NumberFormat("de-DE", {
    signDisplay: "exceptZero"
  }).resolvedOptions().signDisplay === "exceptZero";
} catch (e3) {
}
var $488c6ddbf4ef74c2$var$supportsUnit = false;
try {
  $488c6ddbf4ef74c2$var$supportsUnit = new Intl.NumberFormat("de-DE", {
    style: "unit",
    unit: "degree"
  }).resolvedOptions().style === "unit";
} catch (e3) {
}
var $488c6ddbf4ef74c2$var$UNITS = {
  degree: {
    narrow: {
      default: "\xB0",
      "ja-JP": " \u5EA6",
      "zh-TW": "\u5EA6",
      "sl-SI": " \xB0"
    }
  }
};
var $488c6ddbf4ef74c2$export$cc77c4ff7e8673c5 = class {
  /** Formats a number value as a string, according to the locale and options provided to the constructor. */
  format(value) {
    let res = "";
    if (!$488c6ddbf4ef74c2$var$supportsSignDisplay && this.options.signDisplay != null)
      res = $488c6ddbf4ef74c2$export$711b50b3c525e0f2(this.numberFormatter, this.options.signDisplay, value);
    else
      res = this.numberFormatter.format(value);
    if (this.options.style === "unit" && !$488c6ddbf4ef74c2$var$supportsUnit) {
      var _UNITS_unit;
      let { unit: unit2, unitDisplay = "short", locale: locale3 } = this.resolvedOptions();
      let values2 = (_UNITS_unit = $488c6ddbf4ef74c2$var$UNITS[unit2]) === null || _UNITS_unit === void 0 ? void 0 : _UNITS_unit[unitDisplay];
      res += values2[locale3] || values2.default;
    }
    return res;
  }
  /** Formats a number to an array of parts such as separators, digits, punctuation, and more. */
  formatToParts(value) {
    return this.numberFormatter.formatToParts(value);
  }
  /** Formats a number range as a string. */
  formatRange(start, end) {
    if (typeof this.numberFormatter.formatRange === "function")
      return this.numberFormatter.formatRange(start, end);
    if (end < start)
      throw new RangeError("End date must be >= start date");
    return `${this.format(start)} \u2013 ${this.format(end)}`;
  }
  /** Formats a number range as an array of parts. */
  formatRangeToParts(start, end) {
    if (typeof this.numberFormatter.formatRangeToParts === "function")
      return this.numberFormatter.formatRangeToParts(start, end);
    if (end < start)
      throw new RangeError("End date must be >= start date");
    let startParts = this.numberFormatter.formatToParts(start);
    let endParts = this.numberFormatter.formatToParts(end);
    return [
      ...startParts.map((p) => ({
        ...p,
        source: "startRange"
      })),
      {
        type: "literal",
        value: " \u2013 ",
        source: "shared"
      },
      ...endParts.map((p) => ({
        ...p,
        source: "endRange"
      }))
    ];
  }
  /** Returns the resolved formatting options based on the values passed to the constructor. */
  resolvedOptions() {
    let options = this.numberFormatter.resolvedOptions();
    if (!$488c6ddbf4ef74c2$var$supportsSignDisplay && this.options.signDisplay != null)
      options = {
        ...options,
        signDisplay: this.options.signDisplay
      };
    if (!$488c6ddbf4ef74c2$var$supportsUnit && this.options.style === "unit")
      options = {
        ...options,
        style: "unit",
        unit: this.options.unit,
        unitDisplay: this.options.unitDisplay
      };
    return options;
  }
  constructor(locale3, options = {}) {
    this.numberFormatter = $488c6ddbf4ef74c2$var$getCachedNumberFormatter(locale3, options);
    this.options = options;
  }
};
function $488c6ddbf4ef74c2$var$getCachedNumberFormatter(locale3, options = {}) {
  let { numberingSystem } = options;
  if (numberingSystem && locale3.indexOf("-u-nu-") === -1)
    locale3 = `${locale3}-u-nu-${numberingSystem}`;
  if (options.style === "unit" && !$488c6ddbf4ef74c2$var$supportsUnit) {
    var _UNITS_unit;
    let { unit: unit2, unitDisplay = "short" } = options;
    if (!unit2)
      throw new Error('unit option must be provided with style: "unit"');
    if (!((_UNITS_unit = $488c6ddbf4ef74c2$var$UNITS[unit2]) === null || _UNITS_unit === void 0 ? void 0 : _UNITS_unit[unitDisplay]))
      throw new Error(`Unsupported unit ${unit2} with unitDisplay = ${unitDisplay}`);
    options = {
      ...options,
      style: "decimal"
    };
  }
  let cacheKey = locale3 + (options ? Object.entries(options).sort((a2, b) => a2[0] < b[0] ? -1 : 1).join() : "");
  if ($488c6ddbf4ef74c2$var$formatterCache.has(cacheKey))
    return $488c6ddbf4ef74c2$var$formatterCache.get(cacheKey);
  let numberFormatter8 = new Intl.NumberFormat(locale3, options);
  $488c6ddbf4ef74c2$var$formatterCache.set(cacheKey, numberFormatter8);
  return numberFormatter8;
}
function $488c6ddbf4ef74c2$export$711b50b3c525e0f2(numberFormat, signDisplay, num) {
  if (signDisplay === "auto")
    return numberFormat.format(num);
  else if (signDisplay === "never")
    return numberFormat.format(Math.abs(num));
  else {
    let needsPositiveSign = false;
    if (signDisplay === "always")
      needsPositiveSign = num > 0 || Object.is(num, 0);
    else if (signDisplay === "exceptZero") {
      if (Object.is(num, -0) || Object.is(num, 0))
        num = Math.abs(num);
      else
        needsPositiveSign = num > 0;
    }
    if (needsPositiveSign) {
      let negative = numberFormat.format(-num);
      let noSign = numberFormat.format(num);
      let minus = negative.replace(noSign, "").replace(/\u200e|\u061C/, "");
      if ([
        ...minus
      ].length !== 1)
        console.warn("@react-aria/i18n polyfill for NumberFormat signDisplay: Unsupported case");
      let positive = negative.replace(noSign, "!!!").replace(minus, "+").replace("!!!", noSign);
      return positive;
    } else
      return numberFormat.format(num);
  }
}
var $6c7bd7858deea686$var$CURRENCY_SIGN_REGEX = new RegExp("^.*\\(.*\\).*$");

// node_modules/@react-aria/i18n/dist/real-module.mjs
var $148a7a147e38ea7f$var$RTL_SCRIPTS = /* @__PURE__ */ new Set([
  "Arab",
  "Syrc",
  "Samr",
  "Mand",
  "Thaa",
  "Mend",
  "Nkoo",
  "Adlm",
  "Rohg",
  "Hebr"
]);
var $148a7a147e38ea7f$var$RTL_LANGS = /* @__PURE__ */ new Set([
  "ae",
  "ar",
  "arc",
  "bcc",
  "bqi",
  "ckb",
  "dv",
  "fa",
  "glk",
  "he",
  "ku",
  "mzn",
  "nqo",
  "pnb",
  "ps",
  "sd",
  "ug",
  "ur",
  "yi"
]);
function $148a7a147e38ea7f$export$702d680b21cbd764(locale3) {
  if (Intl.Locale) {
    let script = new Intl.Locale(locale3).maximize().script;
    return $148a7a147e38ea7f$var$RTL_SCRIPTS.has(script);
  }
  let lang = locale3.split("-")[0];
  return $148a7a147e38ea7f$var$RTL_LANGS.has(lang);
}
function $1e5a04cdaf7d1af8$export$f09106e7c6677ec5() {
  let locale3 = typeof navigator !== "undefined" && (navigator.language || navigator.userLanguage) || "en-US";
  try {
    Intl.DateTimeFormat.supportedLocalesOf([
      locale3
    ]);
  } catch (_err) {
    locale3 = "en-US";
  }
  return {
    locale: locale3,
    direction: (0, $148a7a147e38ea7f$export$702d680b21cbd764)(locale3) ? "rtl" : "ltr"
  };
}
var $1e5a04cdaf7d1af8$var$currentLocale = $1e5a04cdaf7d1af8$export$f09106e7c6677ec5();
var $1e5a04cdaf7d1af8$var$listeners = /* @__PURE__ */ new Set();
function $1e5a04cdaf7d1af8$var$updateLocale() {
  $1e5a04cdaf7d1af8$var$currentLocale = $1e5a04cdaf7d1af8$export$f09106e7c6677ec5();
  for (let listener of $1e5a04cdaf7d1af8$var$listeners)
    listener($1e5a04cdaf7d1af8$var$currentLocale);
}
function $1e5a04cdaf7d1af8$export$188ec29ebc2bdc3a() {
  let isSSR4 = (0, $b5e257d569688ac6$export$535bd6ca7f90a273)();
  let [defaultLocale3, setDefaultLocale] = (0, import_react5.useState)($1e5a04cdaf7d1af8$var$currentLocale);
  (0, import_react5.useEffect)(() => {
    if ($1e5a04cdaf7d1af8$var$listeners.size === 0)
      window.addEventListener("languagechange", $1e5a04cdaf7d1af8$var$updateLocale);
    $1e5a04cdaf7d1af8$var$listeners.add(setDefaultLocale);
    return () => {
      $1e5a04cdaf7d1af8$var$listeners.delete(setDefaultLocale);
      if ($1e5a04cdaf7d1af8$var$listeners.size === 0)
        window.removeEventListener("languagechange", $1e5a04cdaf7d1af8$var$updateLocale);
    };
  }, []);
  if (isSSR4)
    return {
      locale: "en-US",
      direction: "ltr"
    };
  return defaultLocale3;
}
var $18f2051aff69b9bf$var$I18nContext = /* @__PURE__ */ (0, import_react5.default).createContext(null);
function $18f2051aff69b9bf$export$43bb16f9c6d9e3f7() {
  let defaultLocale3 = (0, $1e5a04cdaf7d1af8$export$188ec29ebc2bdc3a)();
  let context2 = (0, import_react5.useContext)($18f2051aff69b9bf$var$I18nContext);
  return context2 || defaultLocale3;
}
var $fca6afa0e843324b$var$cache = /* @__PURE__ */ new WeakMap();
function $fca6afa0e843324b$var$getCachedDictionary(strings) {
  let dictionary = $fca6afa0e843324b$var$cache.get(strings);
  if (!dictionary) {
    dictionary = new (0, $5b160d28a433310d$export$c17fa47878dc55b6)(strings);
    $fca6afa0e843324b$var$cache.set(strings, dictionary);
  }
  return dictionary;
}
function $fca6afa0e843324b$export$f12b703ca79dfbb1(strings) {
  let { locale: locale3 } = (0, $18f2051aff69b9bf$export$43bb16f9c6d9e3f7)();
  let dictionary = (0, import_react5.useMemo)(() => $fca6afa0e843324b$var$getCachedDictionary(strings), [
    strings
  ]);
  return (0, import_react5.useMemo)(() => new (0, $6db58dc88e78b024$export$2f817fcdc4b89ae0)(locale3, dictionary), [
    locale3,
    dictionary
  ]);
}
function $a916eb452884faea$export$b7a616150fdb9f44(options = {}) {
  let { locale: locale3 } = (0, $18f2051aff69b9bf$export$43bb16f9c6d9e3f7)();
  return (0, import_react5.useMemo)(() => new (0, $488c6ddbf4ef74c2$export$cc77c4ff7e8673c5)(locale3, options), [
    locale3,
    options
  ]);
}
var $325a3faab7a68acd$var$cache = /* @__PURE__ */ new Map();
function $325a3faab7a68acd$export$a16aca283550c30d(options) {
  let { locale: locale3 } = (0, $18f2051aff69b9bf$export$43bb16f9c6d9e3f7)();
  let cacheKey = locale3 + (options ? Object.entries(options).sort((a2, b) => a2[0] < b[0] ? -1 : 1).join() : "");
  if ($325a3faab7a68acd$var$cache.has(cacheKey))
    return $325a3faab7a68acd$var$cache.get(cacheKey);
  let formatter3 = new Intl.Collator(locale3, options);
  $325a3faab7a68acd$var$cache.set(cacheKey, formatter3);
  return formatter3;
}

// node_modules/@react-aria/focus/dist/import.mjs
var import_react7 = __toESM(require_react(), 1);

// node_modules/@react-aria/interactions/dist/import.mjs
var import_react6 = __toESM(require_react(), 1);

// node_modules/@swc/helpers/esm/_class_apply_descriptor_get.js
function _class_apply_descriptor_get(receiver, descriptor) {
  if (descriptor.get)
    return descriptor.get.call(receiver);
  return descriptor.value;
}

// node_modules/@swc/helpers/esm/_class_extract_field_descriptor.js
function _class_extract_field_descriptor(receiver, privateMap, action) {
  if (!privateMap.has(receiver))
    throw new TypeError("attempted to " + action + " private field on non-instance");
  return privateMap.get(receiver);
}

// node_modules/@swc/helpers/esm/_class_private_field_get.js
function _class_private_field_get(receiver, privateMap) {
  var descriptor = _class_extract_field_descriptor(receiver, privateMap, "get");
  return _class_apply_descriptor_get(receiver, descriptor);
}

// node_modules/@swc/helpers/esm/_class_apply_descriptor_set.js
function _class_apply_descriptor_set(receiver, descriptor, value) {
  if (descriptor.set)
    descriptor.set.call(receiver, value);
  else {
    if (!descriptor.writable) {
      throw new TypeError("attempted to set read only private field");
    }
    descriptor.value = value;
  }
}

// node_modules/@swc/helpers/esm/_class_private_field_set.js
function _class_private_field_set(receiver, privateMap, value) {
  var descriptor = _class_extract_field_descriptor(receiver, privateMap, "set");
  _class_apply_descriptor_set(receiver, descriptor, value);
  return value;
}

// node_modules/@react-aria/interactions/dist/import.mjs
var $14c0b72509d70225$var$state = "default";
var $14c0b72509d70225$var$savedUserSelect = "";
var $14c0b72509d70225$var$modifiedElementMap = /* @__PURE__ */ new WeakMap();
function $14c0b72509d70225$export$16a4697467175487(target) {
  if ((0, $c87311424ea30a05$export$fedb369cb70207f1)()) {
    if ($14c0b72509d70225$var$state === "default") {
      $14c0b72509d70225$var$savedUserSelect = document.documentElement.style.webkitUserSelect;
      document.documentElement.style.webkitUserSelect = "none";
    }
    $14c0b72509d70225$var$state = "disabled";
  } else if (target instanceof HTMLElement || target instanceof SVGElement) {
    $14c0b72509d70225$var$modifiedElementMap.set(target, target.style.userSelect);
    target.style.userSelect = "none";
  }
}
function $14c0b72509d70225$export$b0d6fa1ab32e3295(target) {
  if ((0, $c87311424ea30a05$export$fedb369cb70207f1)()) {
    if ($14c0b72509d70225$var$state !== "disabled")
      return;
    $14c0b72509d70225$var$state = "restoring";
    setTimeout(() => {
      (0, $bbed8b41f857bcc0$export$24490316f764c430)(() => {
        if ($14c0b72509d70225$var$state === "restoring") {
          if (document.documentElement.style.webkitUserSelect === "none")
            document.documentElement.style.webkitUserSelect = $14c0b72509d70225$var$savedUserSelect || "";
          $14c0b72509d70225$var$savedUserSelect = "";
          $14c0b72509d70225$var$state = "default";
        }
      });
    }, 300);
  } else if (target instanceof HTMLElement || target instanceof SVGElement) {
    if (target && $14c0b72509d70225$var$modifiedElementMap.has(target)) {
      let targetOldUserSelect = $14c0b72509d70225$var$modifiedElementMap.get(target);
      if (target.style.userSelect === "none")
        target.style.userSelect = targetOldUserSelect;
      if (target.getAttribute("style") === "")
        target.removeAttribute("style");
      $14c0b72509d70225$var$modifiedElementMap.delete(target);
    }
  }
}
var $ae1eeba8b9eafd08$export$5165eccb35aaadb5 = (0, import_react6.default).createContext(null);
$ae1eeba8b9eafd08$export$5165eccb35aaadb5.displayName = "PressResponderContext";
function $f6c31cce2adf654f$var$usePressResponderContext(props) {
  let context2 = (0, import_react6.useContext)((0, $ae1eeba8b9eafd08$export$5165eccb35aaadb5));
  if (context2) {
    let { register, ...contextProps } = context2;
    props = (0, $3ef42575df84b30b$export$9d1611c77c2fe928)(contextProps, props);
    register();
  }
  (0, $e7801be82b4b2a53$export$4debdb1a3f0fa79e)(context2, props.ref);
  return props;
}
var $f6c31cce2adf654f$var$_shouldStopPropagation = /* @__PURE__ */ new WeakMap();
var $f6c31cce2adf654f$var$PressEvent = class {
  continuePropagation() {
    (0, _class_private_field_set)(this, $f6c31cce2adf654f$var$_shouldStopPropagation, false);
  }
  get shouldStopPropagation() {
    return (0, _class_private_field_get)(this, $f6c31cce2adf654f$var$_shouldStopPropagation);
  }
  constructor(type, pointerType, originalEvent) {
    (0, _class_private_field_init)(this, $f6c31cce2adf654f$var$_shouldStopPropagation, {
      writable: true,
      value: void 0
    });
    (0, _class_private_field_set)(this, $f6c31cce2adf654f$var$_shouldStopPropagation, true);
    this.type = type;
    this.pointerType = pointerType;
    this.target = originalEvent.currentTarget;
    this.shiftKey = originalEvent.shiftKey;
    this.metaKey = originalEvent.metaKey;
    this.ctrlKey = originalEvent.ctrlKey;
    this.altKey = originalEvent.altKey;
  }
};
var $f6c31cce2adf654f$var$LINK_CLICKED = Symbol("linkClicked");
function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
  let {
    onPress,
    onPressChange,
    onPressStart,
    onPressEnd,
    onPressUp,
    isDisabled,
    isPressed: isPressedProp,
    preventFocusOnPress,
    shouldCancelOnPointerExit,
    allowTextSelectionOnPress,
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    ref: _,
    ...domProps
  } = $f6c31cce2adf654f$var$usePressResponderContext(props);
  let [isPressed, setPressed] = (0, import_react6.useState)(false);
  let ref = (0, import_react6.useRef)({
    isPressed: false,
    ignoreEmulatedMouseEvents: false,
    ignoreClickAfterPress: false,
    didFirePressStart: false,
    isTriggeringEvent: false,
    activePointerId: null,
    target: null,
    isOverTarget: false,
    pointerType: null
  });
  let { addGlobalListener, removeAllGlobalListeners } = (0, $03deb23ff14920c4$export$4eaf04e54aa8eed6)();
  let triggerPressStart = (0, $8ae05eaa5c114e9c$export$7f54fc3180508a52)((originalEvent, pointerType) => {
    let state = ref.current;
    if (isDisabled || state.didFirePressStart)
      return;
    let shouldStopPropagation = true;
    state.isTriggeringEvent = true;
    if (onPressStart) {
      let event = new $f6c31cce2adf654f$var$PressEvent("pressstart", pointerType, originalEvent);
      onPressStart(event);
      shouldStopPropagation = event.shouldStopPropagation;
    }
    if (onPressChange)
      onPressChange(true);
    state.isTriggeringEvent = false;
    state.didFirePressStart = true;
    setPressed(true);
    return shouldStopPropagation;
  });
  let triggerPressEnd = (0, $8ae05eaa5c114e9c$export$7f54fc3180508a52)((originalEvent, pointerType, wasPressed = true) => {
    let state = ref.current;
    if (!state.didFirePressStart)
      return;
    state.ignoreClickAfterPress = true;
    state.didFirePressStart = false;
    state.isTriggeringEvent = true;
    let shouldStopPropagation = true;
    if (onPressEnd) {
      let event = new $f6c31cce2adf654f$var$PressEvent("pressend", pointerType, originalEvent);
      onPressEnd(event);
      shouldStopPropagation = event.shouldStopPropagation;
    }
    if (onPressChange)
      onPressChange(false);
    setPressed(false);
    if (onPress && wasPressed && !isDisabled) {
      let event = new $f6c31cce2adf654f$var$PressEvent("press", pointerType, originalEvent);
      onPress(event);
      shouldStopPropagation && (shouldStopPropagation = event.shouldStopPropagation);
    }
    state.isTriggeringEvent = false;
    return shouldStopPropagation;
  });
  let triggerPressUp = (0, $8ae05eaa5c114e9c$export$7f54fc3180508a52)((originalEvent, pointerType) => {
    let state = ref.current;
    if (isDisabled)
      return;
    if (onPressUp) {
      state.isTriggeringEvent = true;
      let event = new $f6c31cce2adf654f$var$PressEvent("pressup", pointerType, originalEvent);
      onPressUp(event);
      state.isTriggeringEvent = false;
      return event.shouldStopPropagation;
    }
    return true;
  });
  let cancel = (0, $8ae05eaa5c114e9c$export$7f54fc3180508a52)((e3) => {
    let state = ref.current;
    if (state.isPressed) {
      if (state.isOverTarget)
        triggerPressEnd($f6c31cce2adf654f$var$createEvent(state.target, e3), state.pointerType, false);
      state.isPressed = false;
      state.isOverTarget = false;
      state.activePointerId = null;
      state.pointerType = null;
      removeAllGlobalListeners();
      if (!allowTextSelectionOnPress)
        (0, $14c0b72509d70225$export$b0d6fa1ab32e3295)(state.target);
    }
  });
  let cancelOnPointerExit = (0, $8ae05eaa5c114e9c$export$7f54fc3180508a52)((e3) => {
    if (shouldCancelOnPointerExit)
      cancel(e3);
  });
  let pressProps = (0, import_react6.useMemo)(() => {
    let state = ref.current;
    let pressProps2 = {
      onKeyDown(e3) {
        if ($f6c31cce2adf654f$var$isValidKeyboardEvent(e3.nativeEvent, e3.currentTarget) && e3.currentTarget.contains(e3.target)) {
          if ($f6c31cce2adf654f$var$shouldPreventDefaultKeyboard(e3.target, e3.key))
            e3.preventDefault();
          let shouldStopPropagation = true;
          if (!state.isPressed && !e3.repeat) {
            state.target = e3.currentTarget;
            state.isPressed = true;
            shouldStopPropagation = triggerPressStart(e3, "keyboard");
            addGlobalListener(document, "keyup", onKeyUp, false);
          }
          if (shouldStopPropagation)
            e3.stopPropagation();
          if (e3.metaKey && (0, $c87311424ea30a05$export$9ac100e40613ea10)())
            state.metaKeyEvents.set(e3.key, e3.nativeEvent);
        } else if (e3.key === "Meta")
          state.metaKeyEvents = /* @__PURE__ */ new Map();
      },
      onKeyUp(e3) {
        if ($f6c31cce2adf654f$var$isValidKeyboardEvent(e3.nativeEvent, e3.currentTarget) && !e3.repeat && e3.currentTarget.contains(e3.target))
          triggerPressUp($f6c31cce2adf654f$var$createEvent(state.target, e3), "keyboard");
      },
      onClick(e3) {
        if (e3 && !e3.currentTarget.contains(e3.target))
          return;
        if (e3 && e3.button === 0 && !state.isTriggeringEvent && !(0, $ea8dcbcb9ea1b556$export$95185d699e05d4d7).isOpening) {
          let shouldStopPropagation = true;
          if (isDisabled)
            e3.preventDefault();
          if (!state.ignoreClickAfterPress && !state.ignoreEmulatedMouseEvents && !state.isPressed && (state.pointerType === "virtual" || (0, $6a7db85432448f7f$export$60278871457622de)(e3.nativeEvent))) {
            if (!isDisabled && !preventFocusOnPress)
              (0, $7215afc6de606d6b$export$de79e2c695e052f3)(e3.currentTarget);
            let stopPressStart = triggerPressStart(e3, "virtual");
            let stopPressUp = triggerPressUp(e3, "virtual");
            let stopPressEnd = triggerPressEnd(e3, "virtual");
            shouldStopPropagation = stopPressStart && stopPressUp && stopPressEnd;
          }
          state.ignoreEmulatedMouseEvents = false;
          state.ignoreClickAfterPress = false;
          if (shouldStopPropagation)
            e3.stopPropagation();
        }
      }
    };
    let onKeyUp = (e3) => {
      var _state_metaKeyEvents;
      if (state.isPressed && $f6c31cce2adf654f$var$isValidKeyboardEvent(e3, state.target)) {
        var _state_metaKeyEvents1;
        if ($f6c31cce2adf654f$var$shouldPreventDefaultKeyboard(e3.target, e3.key))
          e3.preventDefault();
        let target = e3.target;
        let shouldStopPropagation = triggerPressEnd($f6c31cce2adf654f$var$createEvent(state.target, e3), "keyboard", state.target.contains(target));
        removeAllGlobalListeners();
        if (shouldStopPropagation)
          e3.stopPropagation();
        if (e3.key !== "Enter" && $f6c31cce2adf654f$var$isHTMLAnchorLink(state.target) && state.target.contains(target) && !e3[$f6c31cce2adf654f$var$LINK_CLICKED]) {
          e3[$f6c31cce2adf654f$var$LINK_CLICKED] = true;
          (0, $ea8dcbcb9ea1b556$export$95185d699e05d4d7)(state.target, e3, false);
        }
        state.isPressed = false;
        (_state_metaKeyEvents1 = state.metaKeyEvents) === null || _state_metaKeyEvents1 === void 0 ? void 0 : _state_metaKeyEvents1.delete(e3.key);
      } else if (e3.key === "Meta" && ((_state_metaKeyEvents = state.metaKeyEvents) === null || _state_metaKeyEvents === void 0 ? void 0 : _state_metaKeyEvents.size)) {
        let events = state.metaKeyEvents;
        state.metaKeyEvents = null;
        for (let event of events.values())
          state.target.dispatchEvent(new KeyboardEvent("keyup", event));
      }
    };
    if (typeof PointerEvent !== "undefined") {
      pressProps2.onPointerDown = (e3) => {
        if (e3.button !== 0 || !e3.currentTarget.contains(e3.target))
          return;
        if ((0, $6a7db85432448f7f$export$29bf1b5f2c56cf63)(e3.nativeEvent)) {
          state.pointerType = "virtual";
          return;
        }
        if ($f6c31cce2adf654f$var$shouldPreventDefault(e3.currentTarget))
          e3.preventDefault();
        state.pointerType = e3.pointerType;
        let shouldStopPropagation = true;
        if (!state.isPressed) {
          state.isPressed = true;
          state.isOverTarget = true;
          state.activePointerId = e3.pointerId;
          state.target = e3.currentTarget;
          if (!isDisabled && !preventFocusOnPress)
            (0, $7215afc6de606d6b$export$de79e2c695e052f3)(e3.currentTarget);
          if (!allowTextSelectionOnPress)
            (0, $14c0b72509d70225$export$16a4697467175487)(state.target);
          shouldStopPropagation = triggerPressStart(e3, state.pointerType);
          addGlobalListener(document, "pointermove", onPointerMove, false);
          addGlobalListener(document, "pointerup", onPointerUp, false);
          addGlobalListener(document, "pointercancel", onPointerCancel, false);
        }
        if (shouldStopPropagation)
          e3.stopPropagation();
      };
      pressProps2.onMouseDown = (e3) => {
        if (!e3.currentTarget.contains(e3.target))
          return;
        if (e3.button === 0) {
          if ($f6c31cce2adf654f$var$shouldPreventDefault(e3.currentTarget))
            e3.preventDefault();
          e3.stopPropagation();
        }
      };
      pressProps2.onPointerUp = (e3) => {
        if (!e3.currentTarget.contains(e3.target) || state.pointerType === "virtual")
          return;
        if (e3.button === 0 && $f6c31cce2adf654f$var$isOverTarget(e3, e3.currentTarget))
          triggerPressUp(e3, state.pointerType || e3.pointerType);
      };
      let onPointerMove = (e3) => {
        if (e3.pointerId !== state.activePointerId)
          return;
        if ($f6c31cce2adf654f$var$isOverTarget(e3, state.target)) {
          if (!state.isOverTarget) {
            state.isOverTarget = true;
            triggerPressStart($f6c31cce2adf654f$var$createEvent(state.target, e3), state.pointerType);
          }
        } else if (state.isOverTarget) {
          state.isOverTarget = false;
          triggerPressEnd($f6c31cce2adf654f$var$createEvent(state.target, e3), state.pointerType, false);
          cancelOnPointerExit(e3);
        }
      };
      let onPointerUp = (e3) => {
        if (e3.pointerId === state.activePointerId && state.isPressed && e3.button === 0) {
          if ($f6c31cce2adf654f$var$isOverTarget(e3, state.target))
            triggerPressEnd($f6c31cce2adf654f$var$createEvent(state.target, e3), state.pointerType);
          else if (state.isOverTarget)
            triggerPressEnd($f6c31cce2adf654f$var$createEvent(state.target, e3), state.pointerType, false);
          state.isPressed = false;
          state.isOverTarget = false;
          state.activePointerId = null;
          state.pointerType = null;
          removeAllGlobalListeners();
          if (!allowTextSelectionOnPress)
            (0, $14c0b72509d70225$export$b0d6fa1ab32e3295)(state.target);
        }
      };
      let onPointerCancel = (e3) => {
        cancel(e3);
      };
      pressProps2.onDragStart = (e3) => {
        if (!e3.currentTarget.contains(e3.target))
          return;
        cancel(e3);
      };
    } else {
      pressProps2.onMouseDown = (e3) => {
        if (e3.button !== 0 || !e3.currentTarget.contains(e3.target))
          return;
        if ($f6c31cce2adf654f$var$shouldPreventDefault(e3.currentTarget))
          e3.preventDefault();
        if (state.ignoreEmulatedMouseEvents) {
          e3.stopPropagation();
          return;
        }
        state.isPressed = true;
        state.isOverTarget = true;
        state.target = e3.currentTarget;
        state.pointerType = (0, $6a7db85432448f7f$export$60278871457622de)(e3.nativeEvent) ? "virtual" : "mouse";
        if (!isDisabled && !preventFocusOnPress)
          (0, $7215afc6de606d6b$export$de79e2c695e052f3)(e3.currentTarget);
        let shouldStopPropagation = triggerPressStart(e3, state.pointerType);
        if (shouldStopPropagation)
          e3.stopPropagation();
        addGlobalListener(document, "mouseup", onMouseUp, false);
      };
      pressProps2.onMouseEnter = (e3) => {
        if (!e3.currentTarget.contains(e3.target))
          return;
        let shouldStopPropagation = true;
        if (state.isPressed && !state.ignoreEmulatedMouseEvents) {
          state.isOverTarget = true;
          shouldStopPropagation = triggerPressStart(e3, state.pointerType);
        }
        if (shouldStopPropagation)
          e3.stopPropagation();
      };
      pressProps2.onMouseLeave = (e3) => {
        if (!e3.currentTarget.contains(e3.target))
          return;
        let shouldStopPropagation = true;
        if (state.isPressed && !state.ignoreEmulatedMouseEvents) {
          state.isOverTarget = false;
          shouldStopPropagation = triggerPressEnd(e3, state.pointerType, false);
          cancelOnPointerExit(e3);
        }
        if (shouldStopPropagation)
          e3.stopPropagation();
      };
      pressProps2.onMouseUp = (e3) => {
        if (!e3.currentTarget.contains(e3.target))
          return;
        if (!state.ignoreEmulatedMouseEvents && e3.button === 0)
          triggerPressUp(e3, state.pointerType || "mouse");
      };
      let onMouseUp = (e3) => {
        if (e3.button !== 0)
          return;
        state.isPressed = false;
        removeAllGlobalListeners();
        if (state.ignoreEmulatedMouseEvents) {
          state.ignoreEmulatedMouseEvents = false;
          return;
        }
        if ($f6c31cce2adf654f$var$isOverTarget(e3, state.target))
          triggerPressEnd($f6c31cce2adf654f$var$createEvent(state.target, e3), state.pointerType);
        else if (state.isOverTarget)
          triggerPressEnd($f6c31cce2adf654f$var$createEvent(state.target, e3), state.pointerType, false);
        state.isOverTarget = false;
      };
      pressProps2.onTouchStart = (e3) => {
        if (!e3.currentTarget.contains(e3.target))
          return;
        let touch = $f6c31cce2adf654f$var$getTouchFromEvent(e3.nativeEvent);
        if (!touch)
          return;
        state.activePointerId = touch.identifier;
        state.ignoreEmulatedMouseEvents = true;
        state.isOverTarget = true;
        state.isPressed = true;
        state.target = e3.currentTarget;
        state.pointerType = "touch";
        if (!isDisabled && !preventFocusOnPress)
          (0, $7215afc6de606d6b$export$de79e2c695e052f3)(e3.currentTarget);
        if (!allowTextSelectionOnPress)
          (0, $14c0b72509d70225$export$16a4697467175487)(state.target);
        let shouldStopPropagation = triggerPressStart(e3, state.pointerType);
        if (shouldStopPropagation)
          e3.stopPropagation();
        addGlobalListener(window, "scroll", onScroll, true);
      };
      pressProps2.onTouchMove = (e3) => {
        if (!e3.currentTarget.contains(e3.target))
          return;
        if (!state.isPressed) {
          e3.stopPropagation();
          return;
        }
        let touch = $f6c31cce2adf654f$var$getTouchById(e3.nativeEvent, state.activePointerId);
        let shouldStopPropagation = true;
        if (touch && $f6c31cce2adf654f$var$isOverTarget(touch, e3.currentTarget)) {
          if (!state.isOverTarget) {
            state.isOverTarget = true;
            shouldStopPropagation = triggerPressStart(e3, state.pointerType);
          }
        } else if (state.isOverTarget) {
          state.isOverTarget = false;
          shouldStopPropagation = triggerPressEnd(e3, state.pointerType, false);
          cancelOnPointerExit(e3);
        }
        if (shouldStopPropagation)
          e3.stopPropagation();
      };
      pressProps2.onTouchEnd = (e3) => {
        if (!e3.currentTarget.contains(e3.target))
          return;
        if (!state.isPressed) {
          e3.stopPropagation();
          return;
        }
        let touch = $f6c31cce2adf654f$var$getTouchById(e3.nativeEvent, state.activePointerId);
        let shouldStopPropagation = true;
        if (touch && $f6c31cce2adf654f$var$isOverTarget(touch, e3.currentTarget)) {
          triggerPressUp(e3, state.pointerType);
          shouldStopPropagation = triggerPressEnd(e3, state.pointerType);
        } else if (state.isOverTarget)
          shouldStopPropagation = triggerPressEnd(e3, state.pointerType, false);
        if (shouldStopPropagation)
          e3.stopPropagation();
        state.isPressed = false;
        state.activePointerId = null;
        state.isOverTarget = false;
        state.ignoreEmulatedMouseEvents = true;
        if (!allowTextSelectionOnPress)
          (0, $14c0b72509d70225$export$b0d6fa1ab32e3295)(state.target);
        removeAllGlobalListeners();
      };
      pressProps2.onTouchCancel = (e3) => {
        if (!e3.currentTarget.contains(e3.target))
          return;
        e3.stopPropagation();
        if (state.isPressed)
          cancel(e3);
      };
      let onScroll = (e3) => {
        if (state.isPressed && e3.target.contains(state.target))
          cancel({
            currentTarget: state.target,
            shiftKey: false,
            ctrlKey: false,
            metaKey: false,
            altKey: false
          });
      };
      pressProps2.onDragStart = (e3) => {
        if (!e3.currentTarget.contains(e3.target))
          return;
        cancel(e3);
      };
    }
    return pressProps2;
  }, [
    addGlobalListener,
    isDisabled,
    preventFocusOnPress,
    removeAllGlobalListeners,
    allowTextSelectionOnPress,
    cancel,
    cancelOnPointerExit,
    triggerPressEnd,
    triggerPressStart,
    triggerPressUp
  ]);
  (0, import_react6.useEffect)(() => {
    return () => {
      if (!allowTextSelectionOnPress)
        (0, $14c0b72509d70225$export$b0d6fa1ab32e3295)(ref.current.target);
    };
  }, [
    allowTextSelectionOnPress
  ]);
  return {
    isPressed: isPressedProp || isPressed,
    pressProps: (0, $3ef42575df84b30b$export$9d1611c77c2fe928)(domProps, pressProps)
  };
}
function $f6c31cce2adf654f$var$isHTMLAnchorLink(target) {
  return target.tagName === "A" && target.hasAttribute("href");
}
function $f6c31cce2adf654f$var$isValidKeyboardEvent(event, currentTarget) {
  const { key, code } = event;
  const element2 = currentTarget;
  const role = element2.getAttribute("role");
  return (key === "Enter" || key === " " || key === "Spacebar" || code === "Space") && !(element2 instanceof HTMLInputElement && !$f6c31cce2adf654f$var$isValidInputKey(element2, key) || element2 instanceof HTMLTextAreaElement || element2.isContentEditable) && // Links should only trigger with Enter key
  !((role === "link" || !role && $f6c31cce2adf654f$var$isHTMLAnchorLink(element2)) && key !== "Enter");
}
function $f6c31cce2adf654f$var$getTouchFromEvent(event) {
  const { targetTouches } = event;
  if (targetTouches.length > 0)
    return targetTouches[0];
  return null;
}
function $f6c31cce2adf654f$var$getTouchById(event, pointerId) {
  const changedTouches = event.changedTouches;
  for (let i2 = 0; i2 < changedTouches.length; i2++) {
    const touch = changedTouches[i2];
    if (touch.identifier === pointerId)
      return touch;
  }
  return null;
}
function $f6c31cce2adf654f$var$createEvent(target, e3) {
  return {
    currentTarget: target,
    shiftKey: e3.shiftKey,
    ctrlKey: e3.ctrlKey,
    metaKey: e3.metaKey,
    altKey: e3.altKey
  };
}
function $f6c31cce2adf654f$var$getPointClientRect(point4) {
  let offsetX = point4.width / 2 || point4.radiusX || 0;
  let offsetY = point4.height / 2 || point4.radiusY || 0;
  return {
    top: point4.clientY - offsetY,
    right: point4.clientX + offsetX,
    bottom: point4.clientY + offsetY,
    left: point4.clientX - offsetX
  };
}
function $f6c31cce2adf654f$var$areRectanglesOverlapping(a2, b) {
  if (a2.left > b.right || b.left > a2.right)
    return false;
  if (a2.top > b.bottom || b.top > a2.bottom)
    return false;
  return true;
}
function $f6c31cce2adf654f$var$isOverTarget(point4, target) {
  let rect = target.getBoundingClientRect();
  let pointRect = $f6c31cce2adf654f$var$getPointClientRect(point4);
  return $f6c31cce2adf654f$var$areRectanglesOverlapping(rect, pointRect);
}
function $f6c31cce2adf654f$var$shouldPreventDefault(target) {
  return !(target instanceof HTMLElement) || !target.hasAttribute("draggable");
}
function $f6c31cce2adf654f$var$shouldPreventDefaultKeyboard(target, key) {
  if (target instanceof HTMLInputElement)
    return !$f6c31cce2adf654f$var$isValidInputKey(target, key);
  if (target instanceof HTMLButtonElement)
    return target.type !== "submit" && target.type !== "reset";
  if ($f6c31cce2adf654f$var$isHTMLAnchorLink(target))
    return false;
  return true;
}
var $f6c31cce2adf654f$var$nonTextInputTypes = /* @__PURE__ */ new Set([
  "checkbox",
  "radio",
  "range",
  "color",
  "file",
  "image",
  "button",
  "submit",
  "reset"
]);
function $f6c31cce2adf654f$var$isValidInputKey(target, key) {
  return target.type === "checkbox" || target.type === "radio" ? key === " " : $f6c31cce2adf654f$var$nonTextInputTypes.has(target.type);
}
var $f1ab8c75478c6f73$export$3351871ee4b288b8 = /* @__PURE__ */ (0, import_react6.default).forwardRef(({ children, ...props }, ref) => {
  let isRegistered = (0, import_react6.useRef)(false);
  let prevContext = (0, import_react6.useContext)((0, $ae1eeba8b9eafd08$export$5165eccb35aaadb5));
  let context2 = (0, $3ef42575df84b30b$export$9d1611c77c2fe928)(prevContext || {}, {
    ...props,
    ref: ref || (prevContext === null || prevContext === void 0 ? void 0 : prevContext.ref),
    register() {
      isRegistered.current = true;
      if (prevContext)
        prevContext.register();
    }
  });
  (0, $e7801be82b4b2a53$export$4debdb1a3f0fa79e)(prevContext, ref);
  (0, import_react6.useEffect)(() => {
    if (!isRegistered.current) {
      console.warn("A PressResponder was rendered without a pressable child. Either call the usePress hook, or wrap your DOM node with <Pressable> component.");
      isRegistered.current = true;
    }
  }, []);
  return /* @__PURE__ */ (0, import_react6.default).createElement((0, $ae1eeba8b9eafd08$export$5165eccb35aaadb5).Provider, {
    value: context2
  }, children);
});
var $8a9cb279dc87e130$export$905e7fc544a71f36 = class {
  isDefaultPrevented() {
    return this.nativeEvent.defaultPrevented;
  }
  preventDefault() {
    this.defaultPrevented = true;
    this.nativeEvent.preventDefault();
  }
  stopPropagation() {
    this.nativeEvent.stopPropagation();
    this.isPropagationStopped = () => true;
  }
  isPropagationStopped() {
    return false;
  }
  persist() {
  }
  constructor(type, nativeEvent) {
    this.nativeEvent = nativeEvent;
    this.target = nativeEvent.target;
    this.currentTarget = nativeEvent.currentTarget;
    this.relatedTarget = nativeEvent.relatedTarget;
    this.bubbles = nativeEvent.bubbles;
    this.cancelable = nativeEvent.cancelable;
    this.defaultPrevented = nativeEvent.defaultPrevented;
    this.eventPhase = nativeEvent.eventPhase;
    this.isTrusted = nativeEvent.isTrusted;
    this.timeStamp = nativeEvent.timeStamp;
    this.type = type;
  }
};
function $8a9cb279dc87e130$export$715c682d09d639cc(onBlur) {
  let stateRef = (0, import_react6.useRef)({
    isFocused: false,
    observer: null
  });
  (0, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(() => {
    const state = stateRef.current;
    return () => {
      if (state.observer) {
        state.observer.disconnect();
        state.observer = null;
      }
    };
  }, []);
  let dispatchBlur = (0, $8ae05eaa5c114e9c$export$7f54fc3180508a52)((e3) => {
    onBlur === null || onBlur === void 0 ? void 0 : onBlur(e3);
  });
  return (0, import_react6.useCallback)((e3) => {
    if (e3.target instanceof HTMLButtonElement || e3.target instanceof HTMLInputElement || e3.target instanceof HTMLTextAreaElement || e3.target instanceof HTMLSelectElement) {
      stateRef.current.isFocused = true;
      let target = e3.target;
      let onBlurHandler = (e4) => {
        stateRef.current.isFocused = false;
        if (target.disabled)
          dispatchBlur(new $8a9cb279dc87e130$export$905e7fc544a71f36("blur", e4));
        if (stateRef.current.observer) {
          stateRef.current.observer.disconnect();
          stateRef.current.observer = null;
        }
      };
      target.addEventListener("focusout", onBlurHandler, {
        once: true
      });
      stateRef.current.observer = new MutationObserver(() => {
        if (stateRef.current.isFocused && target.disabled) {
          stateRef.current.observer.disconnect();
          let relatedTargetEl = target === document.activeElement ? null : document.activeElement;
          target.dispatchEvent(new FocusEvent("blur", {
            relatedTarget: relatedTargetEl
          }));
          target.dispatchEvent(new FocusEvent("focusout", {
            bubbles: true,
            relatedTarget: relatedTargetEl
          }));
        }
      });
      stateRef.current.observer.observe(target, {
        attributes: true,
        attributeFilter: [
          "disabled"
        ]
      });
    }
  }, [
    dispatchBlur
  ]);
}
function $a1ea59d68270f0dd$export$f8168d8dd8fd66e6(props) {
  let { isDisabled, onFocus: onFocusProp, onBlur: onBlurProp, onFocusChange } = props;
  const onBlur = (0, import_react6.useCallback)((e3) => {
    if (e3.target === e3.currentTarget) {
      if (onBlurProp)
        onBlurProp(e3);
      if (onFocusChange)
        onFocusChange(false);
      return true;
    }
  }, [
    onBlurProp,
    onFocusChange
  ]);
  const onSyntheticFocus = (0, $8a9cb279dc87e130$export$715c682d09d639cc)(onBlur);
  const onFocus = (0, import_react6.useCallback)((e3) => {
    if (e3.target === e3.currentTarget && document.activeElement === e3.target) {
      if (onFocusProp)
        onFocusProp(e3);
      if (onFocusChange)
        onFocusChange(true);
      onSyntheticFocus(e3);
    }
  }, [
    onFocusChange,
    onFocusProp,
    onSyntheticFocus
  ]);
  return {
    focusProps: {
      onFocus: !isDisabled && (onFocusProp || onFocusChange || onBlurProp) ? onFocus : void 0,
      onBlur: !isDisabled && (onBlurProp || onFocusChange) ? onBlur : void 0
    }
  };
}
var $507fabe10e71c6fb$var$currentModality = null;
var $507fabe10e71c6fb$var$changeHandlers = /* @__PURE__ */ new Set();
var $507fabe10e71c6fb$var$hasSetupGlobalListeners = false;
var $507fabe10e71c6fb$var$hasEventBeforeFocus = false;
var $507fabe10e71c6fb$var$hasBlurredWindowRecently = false;
var $507fabe10e71c6fb$var$FOCUS_VISIBLE_INPUT_KEYS = {
  Tab: true,
  Escape: true
};
function $507fabe10e71c6fb$var$triggerChangeHandlers(modality, e3) {
  for (let handler of $507fabe10e71c6fb$var$changeHandlers)
    handler(modality, e3);
}
function $507fabe10e71c6fb$var$isValidKey(e3) {
  return !(e3.metaKey || !(0, $c87311424ea30a05$export$9ac100e40613ea10)() && e3.altKey || e3.ctrlKey || e3.key === "Control" || e3.key === "Shift" || e3.key === "Meta");
}
function $507fabe10e71c6fb$var$handleKeyboardEvent(e3) {
  $507fabe10e71c6fb$var$hasEventBeforeFocus = true;
  if ($507fabe10e71c6fb$var$isValidKey(e3)) {
    $507fabe10e71c6fb$var$currentModality = "keyboard";
    $507fabe10e71c6fb$var$triggerChangeHandlers("keyboard", e3);
  }
}
function $507fabe10e71c6fb$var$handlePointerEvent(e3) {
  $507fabe10e71c6fb$var$currentModality = "pointer";
  if (e3.type === "mousedown" || e3.type === "pointerdown") {
    $507fabe10e71c6fb$var$hasEventBeforeFocus = true;
    $507fabe10e71c6fb$var$triggerChangeHandlers("pointer", e3);
  }
}
function $507fabe10e71c6fb$var$handleClickEvent(e3) {
  if ((0, $6a7db85432448f7f$export$60278871457622de)(e3)) {
    $507fabe10e71c6fb$var$hasEventBeforeFocus = true;
    $507fabe10e71c6fb$var$currentModality = "virtual";
  }
}
function $507fabe10e71c6fb$var$handleFocusEvent(e3) {
  if (e3.target === window || e3.target === document)
    return;
  if (!$507fabe10e71c6fb$var$hasEventBeforeFocus && !$507fabe10e71c6fb$var$hasBlurredWindowRecently) {
    $507fabe10e71c6fb$var$currentModality = "virtual";
    $507fabe10e71c6fb$var$triggerChangeHandlers("virtual", e3);
  }
  $507fabe10e71c6fb$var$hasEventBeforeFocus = false;
  $507fabe10e71c6fb$var$hasBlurredWindowRecently = false;
}
function $507fabe10e71c6fb$var$handleWindowBlur() {
  $507fabe10e71c6fb$var$hasEventBeforeFocus = false;
  $507fabe10e71c6fb$var$hasBlurredWindowRecently = true;
}
function $507fabe10e71c6fb$var$setupGlobalFocusEvents() {
  if (typeof window === "undefined" || $507fabe10e71c6fb$var$hasSetupGlobalListeners)
    return;
  let focus = HTMLElement.prototype.focus;
  HTMLElement.prototype.focus = function() {
    $507fabe10e71c6fb$var$hasEventBeforeFocus = true;
    focus.apply(this, arguments);
  };
  document.addEventListener("keydown", $507fabe10e71c6fb$var$handleKeyboardEvent, true);
  document.addEventListener("keyup", $507fabe10e71c6fb$var$handleKeyboardEvent, true);
  document.addEventListener("click", $507fabe10e71c6fb$var$handleClickEvent, true);
  window.addEventListener("focus", $507fabe10e71c6fb$var$handleFocusEvent, true);
  window.addEventListener("blur", $507fabe10e71c6fb$var$handleWindowBlur, false);
  if (typeof PointerEvent !== "undefined") {
    document.addEventListener("pointerdown", $507fabe10e71c6fb$var$handlePointerEvent, true);
    document.addEventListener("pointermove", $507fabe10e71c6fb$var$handlePointerEvent, true);
    document.addEventListener("pointerup", $507fabe10e71c6fb$var$handlePointerEvent, true);
  } else {
    document.addEventListener("mousedown", $507fabe10e71c6fb$var$handlePointerEvent, true);
    document.addEventListener("mousemove", $507fabe10e71c6fb$var$handlePointerEvent, true);
    document.addEventListener("mouseup", $507fabe10e71c6fb$var$handlePointerEvent, true);
  }
  $507fabe10e71c6fb$var$hasSetupGlobalListeners = true;
}
if (typeof document !== "undefined") {
  if (document.readyState !== "loading")
    $507fabe10e71c6fb$var$setupGlobalFocusEvents();
  else
    document.addEventListener("DOMContentLoaded", $507fabe10e71c6fb$var$setupGlobalFocusEvents);
}
function $507fabe10e71c6fb$export$b9b3dfddab17db27() {
  return $507fabe10e71c6fb$var$currentModality !== "pointer";
}
function $507fabe10e71c6fb$export$630ff653c5ada6a9() {
  return $507fabe10e71c6fb$var$currentModality;
}
function $507fabe10e71c6fb$export$8397ddfc504fdb9a(modality) {
  $507fabe10e71c6fb$var$currentModality = modality;
  $507fabe10e71c6fb$var$triggerChangeHandlers(modality, null);
}
function $507fabe10e71c6fb$export$98e20ec92f614cfe() {
  $507fabe10e71c6fb$var$setupGlobalFocusEvents();
  let [modality, setModality] = (0, import_react6.useState)($507fabe10e71c6fb$var$currentModality);
  (0, import_react6.useEffect)(() => {
    let handler = () => {
      setModality($507fabe10e71c6fb$var$currentModality);
    };
    $507fabe10e71c6fb$var$changeHandlers.add(handler);
    return () => {
      $507fabe10e71c6fb$var$changeHandlers.delete(handler);
    };
  }, []);
  return (0, $b5e257d569688ac6$export$535bd6ca7f90a273)() ? null : modality;
}
function $507fabe10e71c6fb$var$isKeyboardFocusEvent(isTextInput, modality, e3) {
  return !(isTextInput && modality === "keyboard" && e3 instanceof KeyboardEvent && !$507fabe10e71c6fb$var$FOCUS_VISIBLE_INPUT_KEYS[e3.key]);
}
function $507fabe10e71c6fb$export$ec71b4b83ac08ec3(fn, deps, opts) {
  $507fabe10e71c6fb$var$setupGlobalFocusEvents();
  (0, import_react6.useEffect)(() => {
    let handler = (modality, e3) => {
      if (!$507fabe10e71c6fb$var$isKeyboardFocusEvent(opts === null || opts === void 0 ? void 0 : opts.isTextInput, modality, e3))
        return;
      fn($507fabe10e71c6fb$export$b9b3dfddab17db27());
    };
    $507fabe10e71c6fb$var$changeHandlers.add(handler);
    return () => {
      $507fabe10e71c6fb$var$changeHandlers.delete(handler);
    };
  }, deps);
}
function $9ab94262bd0047c7$export$420e68273165f4ec(props) {
  let { isDisabled, onBlurWithin, onFocusWithin, onFocusWithinChange } = props;
  let state = (0, import_react6.useRef)({
    isFocusWithin: false
  });
  let onBlur = (0, import_react6.useCallback)((e3) => {
    if (state.current.isFocusWithin && !e3.currentTarget.contains(e3.relatedTarget)) {
      state.current.isFocusWithin = false;
      if (onBlurWithin)
        onBlurWithin(e3);
      if (onFocusWithinChange)
        onFocusWithinChange(false);
    }
  }, [
    onBlurWithin,
    onFocusWithinChange,
    state
  ]);
  let onSyntheticFocus = (0, $8a9cb279dc87e130$export$715c682d09d639cc)(onBlur);
  let onFocus = (0, import_react6.useCallback)((e3) => {
    if (!state.current.isFocusWithin && document.activeElement === e3.target) {
      if (onFocusWithin)
        onFocusWithin(e3);
      if (onFocusWithinChange)
        onFocusWithinChange(true);
      state.current.isFocusWithin = true;
      onSyntheticFocus(e3);
    }
  }, [
    onFocusWithin,
    onFocusWithinChange,
    onSyntheticFocus
  ]);
  if (isDisabled)
    return {
      focusWithinProps: {
        onFocus: null,
        onBlur: null
      }
    };
  return {
    focusWithinProps: {
      onFocus,
      onBlur
    }
  };
}
var $6179b936705e76d3$var$globalIgnoreEmulatedMouseEvents = false;
var $6179b936705e76d3$var$hoverCount = 0;
function $6179b936705e76d3$var$setGlobalIgnoreEmulatedMouseEvents() {
  $6179b936705e76d3$var$globalIgnoreEmulatedMouseEvents = true;
  setTimeout(() => {
    $6179b936705e76d3$var$globalIgnoreEmulatedMouseEvents = false;
  }, 50);
}
function $6179b936705e76d3$var$handleGlobalPointerEvent(e3) {
  if (e3.pointerType === "touch")
    $6179b936705e76d3$var$setGlobalIgnoreEmulatedMouseEvents();
}
function $6179b936705e76d3$var$setupGlobalTouchEvents() {
  if (typeof document === "undefined")
    return;
  if (typeof PointerEvent !== "undefined")
    document.addEventListener("pointerup", $6179b936705e76d3$var$handleGlobalPointerEvent);
  else
    document.addEventListener("touchend", $6179b936705e76d3$var$setGlobalIgnoreEmulatedMouseEvents);
  $6179b936705e76d3$var$hoverCount++;
  return () => {
    $6179b936705e76d3$var$hoverCount--;
    if ($6179b936705e76d3$var$hoverCount > 0)
      return;
    if (typeof PointerEvent !== "undefined")
      document.removeEventListener("pointerup", $6179b936705e76d3$var$handleGlobalPointerEvent);
    else
      document.removeEventListener("touchend", $6179b936705e76d3$var$setGlobalIgnoreEmulatedMouseEvents);
  };
}
function $6179b936705e76d3$export$ae780daf29e6d456(props) {
  let { onHoverStart, onHoverChange, onHoverEnd, isDisabled } = props;
  let [isHovered, setHovered] = (0, import_react6.useState)(false);
  let state = (0, import_react6.useRef)({
    isHovered: false,
    ignoreEmulatedMouseEvents: false,
    pointerType: "",
    target: null
  }).current;
  (0, import_react6.useEffect)($6179b936705e76d3$var$setupGlobalTouchEvents, []);
  let { hoverProps, triggerHoverEnd } = (0, import_react6.useMemo)(() => {
    let triggerHoverStart = (event, pointerType) => {
      state.pointerType = pointerType;
      if (isDisabled || pointerType === "touch" || state.isHovered || !event.currentTarget.contains(event.target))
        return;
      state.isHovered = true;
      let target = event.currentTarget;
      state.target = target;
      if (onHoverStart)
        onHoverStart({
          type: "hoverstart",
          target,
          pointerType
        });
      if (onHoverChange)
        onHoverChange(true);
      setHovered(true);
    };
    let triggerHoverEnd2 = (event, pointerType) => {
      state.pointerType = "";
      state.target = null;
      if (pointerType === "touch" || !state.isHovered)
        return;
      state.isHovered = false;
      let target = event.currentTarget;
      if (onHoverEnd)
        onHoverEnd({
          type: "hoverend",
          target,
          pointerType
        });
      if (onHoverChange)
        onHoverChange(false);
      setHovered(false);
    };
    let hoverProps2 = {};
    if (typeof PointerEvent !== "undefined") {
      hoverProps2.onPointerEnter = (e3) => {
        if ($6179b936705e76d3$var$globalIgnoreEmulatedMouseEvents && e3.pointerType === "mouse")
          return;
        triggerHoverStart(e3, e3.pointerType);
      };
      hoverProps2.onPointerLeave = (e3) => {
        if (!isDisabled && e3.currentTarget.contains(e3.target))
          triggerHoverEnd2(e3, e3.pointerType);
      };
    } else {
      hoverProps2.onTouchStart = () => {
        state.ignoreEmulatedMouseEvents = true;
      };
      hoverProps2.onMouseEnter = (e3) => {
        if (!state.ignoreEmulatedMouseEvents && !$6179b936705e76d3$var$globalIgnoreEmulatedMouseEvents)
          triggerHoverStart(e3, "mouse");
        state.ignoreEmulatedMouseEvents = false;
      };
      hoverProps2.onMouseLeave = (e3) => {
        if (!isDisabled && e3.currentTarget.contains(e3.target))
          triggerHoverEnd2(e3, "mouse");
      };
    }
    return {
      hoverProps: hoverProps2,
      triggerHoverEnd: triggerHoverEnd2
    };
  }, [
    onHoverStart,
    onHoverChange,
    onHoverEnd,
    isDisabled,
    state
  ]);
  (0, import_react6.useEffect)(() => {
    if (isDisabled)
      triggerHoverEnd({
        currentTarget: state.target
      }, state.pointerType);
  }, [
    isDisabled
  ]);
  return {
    hoverProps,
    isHovered
  };
}
function $e0b6e0b68ec7f50f$export$872b660ac5a1ff98(props) {
  let { ref, onInteractOutside, isDisabled, onInteractOutsideStart } = props;
  let stateRef = (0, import_react6.useRef)({
    isPointerDown: false,
    ignoreEmulatedMouseEvents: false
  });
  let onPointerDown = (0, $8ae05eaa5c114e9c$export$7f54fc3180508a52)((e3) => {
    if (onInteractOutside && $e0b6e0b68ec7f50f$var$isValidEvent(e3, ref)) {
      if (onInteractOutsideStart)
        onInteractOutsideStart(e3);
      stateRef.current.isPointerDown = true;
    }
  });
  let triggerInteractOutside = (0, $8ae05eaa5c114e9c$export$7f54fc3180508a52)((e3) => {
    if (onInteractOutside)
      onInteractOutside(e3);
  });
  (0, import_react6.useEffect)(() => {
    let state = stateRef.current;
    if (isDisabled)
      return;
    if (typeof PointerEvent !== "undefined") {
      let onPointerUp = (e3) => {
        if (state.isPointerDown && $e0b6e0b68ec7f50f$var$isValidEvent(e3, ref))
          triggerInteractOutside(e3);
        state.isPointerDown = false;
      };
      document.addEventListener("pointerdown", onPointerDown, true);
      document.addEventListener("pointerup", onPointerUp, true);
      return () => {
        document.removeEventListener("pointerdown", onPointerDown, true);
        document.removeEventListener("pointerup", onPointerUp, true);
      };
    } else {
      let onMouseUp = (e3) => {
        if (state.ignoreEmulatedMouseEvents)
          state.ignoreEmulatedMouseEvents = false;
        else if (state.isPointerDown && $e0b6e0b68ec7f50f$var$isValidEvent(e3, ref))
          triggerInteractOutside(e3);
        state.isPointerDown = false;
      };
      let onTouchEnd = (e3) => {
        state.ignoreEmulatedMouseEvents = true;
        if (state.isPointerDown && $e0b6e0b68ec7f50f$var$isValidEvent(e3, ref))
          triggerInteractOutside(e3);
        state.isPointerDown = false;
      };
      document.addEventListener("mousedown", onPointerDown, true);
      document.addEventListener("mouseup", onMouseUp, true);
      document.addEventListener("touchstart", onPointerDown, true);
      document.addEventListener("touchend", onTouchEnd, true);
      return () => {
        document.removeEventListener("mousedown", onPointerDown, true);
        document.removeEventListener("mouseup", onMouseUp, true);
        document.removeEventListener("touchstart", onPointerDown, true);
        document.removeEventListener("touchend", onTouchEnd, true);
      };
    }
  }, [
    ref,
    isDisabled,
    onPointerDown,
    triggerInteractOutside
  ]);
}
function $e0b6e0b68ec7f50f$var$isValidEvent(event, ref) {
  if (event.button > 0)
    return false;
  if (event.target) {
    const ownerDocument = event.target.ownerDocument;
    if (!ownerDocument || !ownerDocument.documentElement.contains(event.target))
      return false;
    if (event.target.closest("[data-react-aria-top-layer]"))
      return false;
  }
  return ref.current && !ref.current.contains(event.target);
}
function $93925083ecbb358c$export$48d1ea6320830260(handler) {
  if (!handler)
    return;
  let shouldStopPropagation = true;
  return (e3) => {
    let event = {
      ...e3,
      preventDefault() {
        e3.preventDefault();
      },
      isDefaultPrevented() {
        return e3.isDefaultPrevented();
      },
      stopPropagation() {
        console.error("stopPropagation is now the default behavior for events in React Spectrum. You can use continuePropagation() to revert this behavior.");
      },
      continuePropagation() {
        shouldStopPropagation = false;
      }
    };
    handler(event);
    if (shouldStopPropagation)
      e3.stopPropagation();
  };
}
function $46d819fcbaf35654$export$8f71654801c2f7cd(props) {
  return {
    keyboardProps: props.isDisabled ? {} : {
      onKeyDown: (0, $93925083ecbb358c$export$48d1ea6320830260)(props.onKeyDown),
      onKeyUp: (0, $93925083ecbb358c$export$48d1ea6320830260)(props.onKeyUp)
    }
  };
}
function $e8a7022cf87cba2a$export$36da96379f79f245(props) {
  let { onMoveStart, onMove, onMoveEnd } = props;
  let state = (0, import_react6.useRef)({
    didMove: false,
    lastPosition: null,
    id: null
  });
  let { addGlobalListener, removeGlobalListener } = (0, $03deb23ff14920c4$export$4eaf04e54aa8eed6)();
  let move = (0, $8ae05eaa5c114e9c$export$7f54fc3180508a52)((originalEvent, pointerType, deltaX, deltaY) => {
    if (deltaX === 0 && deltaY === 0)
      return;
    if (!state.current.didMove) {
      state.current.didMove = true;
      onMoveStart === null || onMoveStart === void 0 ? void 0 : onMoveStart({
        type: "movestart",
        pointerType,
        shiftKey: originalEvent.shiftKey,
        metaKey: originalEvent.metaKey,
        ctrlKey: originalEvent.ctrlKey,
        altKey: originalEvent.altKey
      });
    }
    onMove({
      type: "move",
      pointerType,
      deltaX,
      deltaY,
      shiftKey: originalEvent.shiftKey,
      metaKey: originalEvent.metaKey,
      ctrlKey: originalEvent.ctrlKey,
      altKey: originalEvent.altKey
    });
  });
  let end = (0, $8ae05eaa5c114e9c$export$7f54fc3180508a52)((originalEvent, pointerType) => {
    (0, $14c0b72509d70225$export$b0d6fa1ab32e3295)();
    if (state.current.didMove)
      onMoveEnd === null || onMoveEnd === void 0 ? void 0 : onMoveEnd({
        type: "moveend",
        pointerType,
        shiftKey: originalEvent.shiftKey,
        metaKey: originalEvent.metaKey,
        ctrlKey: originalEvent.ctrlKey,
        altKey: originalEvent.altKey
      });
  });
  let moveProps = (0, import_react6.useMemo)(() => {
    let moveProps2 = {};
    let start = () => {
      (0, $14c0b72509d70225$export$16a4697467175487)();
      state.current.didMove = false;
    };
    if (typeof PointerEvent === "undefined") {
      let onMouseMove = (e3) => {
        if (e3.button === 0) {
          move(e3, "mouse", e3.pageX - state.current.lastPosition.pageX, e3.pageY - state.current.lastPosition.pageY);
          state.current.lastPosition = {
            pageX: e3.pageX,
            pageY: e3.pageY
          };
        }
      };
      let onMouseUp = (e3) => {
        if (e3.button === 0) {
          end(e3, "mouse");
          removeGlobalListener(window, "mousemove", onMouseMove, false);
          removeGlobalListener(window, "mouseup", onMouseUp, false);
        }
      };
      moveProps2.onMouseDown = (e3) => {
        if (e3.button === 0) {
          start();
          e3.stopPropagation();
          e3.preventDefault();
          state.current.lastPosition = {
            pageX: e3.pageX,
            pageY: e3.pageY
          };
          addGlobalListener(window, "mousemove", onMouseMove, false);
          addGlobalListener(window, "mouseup", onMouseUp, false);
        }
      };
      let onTouchMove = (e3) => {
        let touch = [
          ...e3.changedTouches
        ].findIndex(({ identifier: identifier2 }) => identifier2 === state.current.id);
        if (touch >= 0) {
          let { pageX, pageY } = e3.changedTouches[touch];
          move(e3, "touch", pageX - state.current.lastPosition.pageX, pageY - state.current.lastPosition.pageY);
          state.current.lastPosition = {
            pageX,
            pageY
          };
        }
      };
      let onTouchEnd = (e3) => {
        let touch = [
          ...e3.changedTouches
        ].findIndex(({ identifier: identifier2 }) => identifier2 === state.current.id);
        if (touch >= 0) {
          end(e3, "touch");
          state.current.id = null;
          removeGlobalListener(window, "touchmove", onTouchMove);
          removeGlobalListener(window, "touchend", onTouchEnd);
          removeGlobalListener(window, "touchcancel", onTouchEnd);
        }
      };
      moveProps2.onTouchStart = (e3) => {
        if (e3.changedTouches.length === 0 || state.current.id != null)
          return;
        let { pageX, pageY, identifier: identifier2 } = e3.changedTouches[0];
        start();
        e3.stopPropagation();
        e3.preventDefault();
        state.current.lastPosition = {
          pageX,
          pageY
        };
        state.current.id = identifier2;
        addGlobalListener(window, "touchmove", onTouchMove, false);
        addGlobalListener(window, "touchend", onTouchEnd, false);
        addGlobalListener(window, "touchcancel", onTouchEnd, false);
      };
    } else {
      let onPointerMove = (e3) => {
        if (e3.pointerId === state.current.id) {
          let pointerType = e3.pointerType || "mouse";
          move(e3, pointerType, e3.pageX - state.current.lastPosition.pageX, e3.pageY - state.current.lastPosition.pageY);
          state.current.lastPosition = {
            pageX: e3.pageX,
            pageY: e3.pageY
          };
        }
      };
      let onPointerUp = (e3) => {
        if (e3.pointerId === state.current.id) {
          let pointerType = e3.pointerType || "mouse";
          end(e3, pointerType);
          state.current.id = null;
          removeGlobalListener(window, "pointermove", onPointerMove, false);
          removeGlobalListener(window, "pointerup", onPointerUp, false);
          removeGlobalListener(window, "pointercancel", onPointerUp, false);
        }
      };
      moveProps2.onPointerDown = (e3) => {
        if (e3.button === 0 && state.current.id == null) {
          start();
          e3.stopPropagation();
          e3.preventDefault();
          state.current.lastPosition = {
            pageX: e3.pageX,
            pageY: e3.pageY
          };
          state.current.id = e3.pointerId;
          addGlobalListener(window, "pointermove", onPointerMove, false);
          addGlobalListener(window, "pointerup", onPointerUp, false);
          addGlobalListener(window, "pointercancel", onPointerUp, false);
        }
      };
    }
    let triggerKeyboardMove = (e3, deltaX, deltaY) => {
      start();
      move(e3, "keyboard", deltaX, deltaY);
      end(e3, "keyboard");
    };
    moveProps2.onKeyDown = (e3) => {
      switch (e3.key) {
        case "Left":
        case "ArrowLeft":
          e3.preventDefault();
          e3.stopPropagation();
          triggerKeyboardMove(e3, -1, 0);
          break;
        case "Right":
        case "ArrowRight":
          e3.preventDefault();
          e3.stopPropagation();
          triggerKeyboardMove(e3, 1, 0);
          break;
        case "Up":
        case "ArrowUp":
          e3.preventDefault();
          e3.stopPropagation();
          triggerKeyboardMove(e3, 0, -1);
          break;
        case "Down":
        case "ArrowDown":
          e3.preventDefault();
          e3.stopPropagation();
          triggerKeyboardMove(e3, 0, 1);
          break;
      }
    };
    return moveProps2;
  }, [
    state,
    addGlobalListener,
    removeGlobalListener,
    move,
    end
  ]);
  return {
    moveProps
  };
}
var $8a26561d2877236e$var$DEFAULT_THRESHOLD = 500;
function $8a26561d2877236e$export$c24ed0104d07eab9(props) {
  let { isDisabled, onLongPressStart, onLongPressEnd, onLongPress, threshold: threshold2 = $8a26561d2877236e$var$DEFAULT_THRESHOLD, accessibilityDescription } = props;
  const timeRef = (0, import_react6.useRef)(null);
  let { addGlobalListener, removeGlobalListener } = (0, $03deb23ff14920c4$export$4eaf04e54aa8eed6)();
  let { pressProps } = (0, $f6c31cce2adf654f$export$45712eceda6fad21)({
    isDisabled,
    onPressStart(e3) {
      e3.continuePropagation();
      if (e3.pointerType === "mouse" || e3.pointerType === "touch") {
        if (onLongPressStart)
          onLongPressStart({
            ...e3,
            type: "longpressstart"
          });
        timeRef.current = setTimeout(() => {
          e3.target.dispatchEvent(new PointerEvent("pointercancel", {
            bubbles: true
          }));
          if (onLongPress)
            onLongPress({
              ...e3,
              type: "longpress"
            });
          timeRef.current = null;
        }, threshold2);
        if (e3.pointerType === "touch") {
          let onContextMenu = (e4) => {
            e4.preventDefault();
          };
          addGlobalListener(e3.target, "contextmenu", onContextMenu, {
            once: true
          });
          addGlobalListener(window, "pointerup", () => {
            setTimeout(() => {
              removeGlobalListener(e3.target, "contextmenu", onContextMenu);
            }, 30);
          }, {
            once: true
          });
        }
      }
    },
    onPressEnd(e3) {
      if (timeRef.current)
        clearTimeout(timeRef.current);
      if (onLongPressEnd && (e3.pointerType === "mouse" || e3.pointerType === "touch"))
        onLongPressEnd({
          ...e3,
          type: "longpressend"
        });
    }
  });
  let descriptionProps = (0, $ef06256079686ba0$export$f8aeda7b10753fa1)(onLongPress && !isDisabled ? accessibilityDescription : null);
  return {
    longPressProps: (0, $3ef42575df84b30b$export$9d1611c77c2fe928)(pressProps, descriptionProps)
  };
}

// node_modules/@react-aria/focus/dist/import.mjs
function $6a99195332edec8b$export$80f3e147d781571c(element2) {
  if ((0, $507fabe10e71c6fb$export$630ff653c5ada6a9)() === "virtual") {
    let lastFocusedElement = document.activeElement;
    (0, $bbed8b41f857bcc0$export$24490316f764c430)(() => {
      if (document.activeElement === lastFocusedElement && document.contains(element2))
        (0, $7215afc6de606d6b$export$de79e2c695e052f3)(element2);
    });
  } else
    (0, $7215afc6de606d6b$export$de79e2c695e052f3)(element2);
}
function $645f2e67b85a24c9$var$isStyleVisible(element2) {
  if (!(element2 instanceof HTMLElement) && !(element2 instanceof SVGElement))
    return false;
  let { display, visibility } = element2.style;
  let isVisible2 = display !== "none" && visibility !== "hidden" && visibility !== "collapse";
  if (isVisible2) {
    const { getComputedStyle: getComputedStyle2 } = element2.ownerDocument.defaultView;
    let { display: computedDisplay, visibility: computedVisibility } = getComputedStyle2(element2);
    isVisible2 = computedDisplay !== "none" && computedVisibility !== "hidden" && computedVisibility !== "collapse";
  }
  return isVisible2;
}
function $645f2e67b85a24c9$var$isAttributeVisible(element2, childElement) {
  return !element2.hasAttribute("hidden") && (element2.nodeName === "DETAILS" && childElement && childElement.nodeName !== "SUMMARY" ? element2.hasAttribute("open") : true);
}
function $645f2e67b85a24c9$export$e989c0fffaa6b27a(element2, childElement) {
  return element2.nodeName !== "#comment" && $645f2e67b85a24c9$var$isStyleVisible(element2) && $645f2e67b85a24c9$var$isAttributeVisible(element2, childElement) && (!element2.parentElement || $645f2e67b85a24c9$export$e989c0fffaa6b27a(element2.parentElement, element2));
}
var $9bf71ea28793e738$var$FocusContext = /* @__PURE__ */ (0, import_react7.default).createContext(null);
var $9bf71ea28793e738$var$activeScope = null;
function $9bf71ea28793e738$export$20e40289641fbbb6(props) {
  let { children, contain, restoreFocus, autoFocus } = props;
  let startRef = (0, import_react7.useRef)();
  let endRef = (0, import_react7.useRef)();
  let scopeRef = (0, import_react7.useRef)([]);
  let { parentNode } = (0, import_react7.useContext)($9bf71ea28793e738$var$FocusContext) || {};
  let node56 = (0, import_react7.useMemo)(() => new $9bf71ea28793e738$var$TreeNode({
    scopeRef
  }), [
    scopeRef
  ]);
  (0, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(() => {
    let parent = parentNode || $9bf71ea28793e738$export$d06fae2ee68b101e.root;
    if ($9bf71ea28793e738$export$d06fae2ee68b101e.getTreeNode(parent.scopeRef) && $9bf71ea28793e738$var$activeScope && !$9bf71ea28793e738$var$isAncestorScope($9bf71ea28793e738$var$activeScope, parent.scopeRef)) {
      let activeNode = $9bf71ea28793e738$export$d06fae2ee68b101e.getTreeNode($9bf71ea28793e738$var$activeScope);
      if (activeNode)
        parent = activeNode;
    }
    parent.addChild(node56);
    $9bf71ea28793e738$export$d06fae2ee68b101e.addNode(node56);
  }, [
    node56,
    parentNode
  ]);
  (0, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(() => {
    let node57 = $9bf71ea28793e738$export$d06fae2ee68b101e.getTreeNode(scopeRef);
    node57.contain = contain;
  }, [
    contain
  ]);
  (0, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(() => {
    let node57 = startRef.current.nextSibling;
    let nodes = [];
    while (node57 && node57 !== endRef.current) {
      nodes.push(node57);
      node57 = node57.nextSibling;
    }
    scopeRef.current = nodes;
  }, [
    children
  ]);
  $9bf71ea28793e738$var$useActiveScopeTracker(scopeRef, restoreFocus, contain);
  $9bf71ea28793e738$var$useFocusContainment(scopeRef, contain);
  $9bf71ea28793e738$var$useRestoreFocus(scopeRef, restoreFocus, contain);
  $9bf71ea28793e738$var$useAutoFocus(scopeRef, autoFocus);
  (0, import_react7.useEffect)(() => {
    if (scopeRef) {
      let activeElement = document.activeElement;
      let scope = null;
      if ($9bf71ea28793e738$var$isElementInScope(activeElement, scopeRef.current)) {
        for (let node57 of $9bf71ea28793e738$export$d06fae2ee68b101e.traverse())
          if ($9bf71ea28793e738$var$isElementInScope(activeElement, node57.scopeRef.current))
            scope = node57;
        if (scope === $9bf71ea28793e738$export$d06fae2ee68b101e.getTreeNode(scopeRef))
          $9bf71ea28793e738$var$activeScope = scope.scopeRef;
      }
      return () => {
        let parentScope = $9bf71ea28793e738$export$d06fae2ee68b101e.getTreeNode(scopeRef).parent.scopeRef;
        if ((scopeRef === $9bf71ea28793e738$var$activeScope || $9bf71ea28793e738$var$isAncestorScope(scopeRef, $9bf71ea28793e738$var$activeScope)) && (!parentScope || $9bf71ea28793e738$export$d06fae2ee68b101e.getTreeNode(parentScope)))
          $9bf71ea28793e738$var$activeScope = parentScope;
        $9bf71ea28793e738$export$d06fae2ee68b101e.removeTreeNode(scopeRef);
      };
    }
  }, [
    scopeRef
  ]);
  let focusManager = (0, import_react7.useMemo)(() => $9bf71ea28793e738$var$createFocusManagerForScope(scopeRef), []);
  let value = (0, import_react7.useMemo)(() => ({
    focusManager,
    parentNode: node56
  }), [
    node56,
    focusManager
  ]);
  return /* @__PURE__ */ (0, import_react7.default).createElement($9bf71ea28793e738$var$FocusContext.Provider, {
    value
  }, /* @__PURE__ */ (0, import_react7.default).createElement("span", {
    "data-focus-scope-start": true,
    hidden: true,
    ref: startRef
  }), children, /* @__PURE__ */ (0, import_react7.default).createElement("span", {
    "data-focus-scope-end": true,
    hidden: true,
    ref: endRef
  }));
}
function $9bf71ea28793e738$var$createFocusManagerForScope(scopeRef) {
  return {
    focusNext(opts = {}) {
      let scope = scopeRef.current;
      let { from: from2, tabbable, wrap, accept } = opts;
      let node56 = from2 || document.activeElement;
      let sentinel = scope[0].previousElementSibling;
      let walker = $9bf71ea28793e738$export$2d6ec8fc375ceafa($9bf71ea28793e738$var$getScopeRoot(scope), {
        tabbable,
        accept
      }, scope);
      walker.currentNode = $9bf71ea28793e738$var$isElementInScope(node56, scope) ? node56 : sentinel;
      let nextNode = walker.nextNode();
      if (!nextNode && wrap) {
        walker.currentNode = sentinel;
        nextNode = walker.nextNode();
      }
      if (nextNode)
        $9bf71ea28793e738$var$focusElement(nextNode, true);
      return nextNode;
    },
    focusPrevious(opts = {}) {
      let scope = scopeRef.current;
      let { from: from2, tabbable, wrap, accept } = opts;
      let node56 = from2 || document.activeElement;
      let sentinel = scope[scope.length - 1].nextElementSibling;
      let walker = $9bf71ea28793e738$export$2d6ec8fc375ceafa($9bf71ea28793e738$var$getScopeRoot(scope), {
        tabbable,
        accept
      }, scope);
      walker.currentNode = $9bf71ea28793e738$var$isElementInScope(node56, scope) ? node56 : sentinel;
      let previousNode = walker.previousNode();
      if (!previousNode && wrap) {
        walker.currentNode = sentinel;
        previousNode = walker.previousNode();
      }
      if (previousNode)
        $9bf71ea28793e738$var$focusElement(previousNode, true);
      return previousNode;
    },
    focusFirst(opts = {}) {
      let scope = scopeRef.current;
      let { tabbable, accept } = opts;
      let walker = $9bf71ea28793e738$export$2d6ec8fc375ceafa($9bf71ea28793e738$var$getScopeRoot(scope), {
        tabbable,
        accept
      }, scope);
      walker.currentNode = scope[0].previousElementSibling;
      let nextNode = walker.nextNode();
      if (nextNode)
        $9bf71ea28793e738$var$focusElement(nextNode, true);
      return nextNode;
    },
    focusLast(opts = {}) {
      let scope = scopeRef.current;
      let { tabbable, accept } = opts;
      let walker = $9bf71ea28793e738$export$2d6ec8fc375ceafa($9bf71ea28793e738$var$getScopeRoot(scope), {
        tabbable,
        accept
      }, scope);
      walker.currentNode = scope[scope.length - 1].nextElementSibling;
      let previousNode = walker.previousNode();
      if (previousNode)
        $9bf71ea28793e738$var$focusElement(previousNode, true);
      return previousNode;
    }
  };
}
var $9bf71ea28793e738$var$focusableElements = [
  "input:not([disabled]):not([type=hidden])",
  "select:not([disabled])",
  "textarea:not([disabled])",
  "button:not([disabled])",
  "a[href]",
  "area[href]",
  "summary",
  "iframe",
  "object",
  "embed",
  "audio[controls]",
  "video[controls]",
  "[contenteditable]"
];
var $9bf71ea28793e738$var$FOCUSABLE_ELEMENT_SELECTOR = $9bf71ea28793e738$var$focusableElements.join(":not([hidden]),") + ",[tabindex]:not([disabled]):not([hidden])";
$9bf71ea28793e738$var$focusableElements.push('[tabindex]:not([tabindex="-1"]):not([disabled])');
var $9bf71ea28793e738$var$TABBABLE_ELEMENT_SELECTOR = $9bf71ea28793e738$var$focusableElements.join(':not([hidden]):not([tabindex="-1"]),');
function $9bf71ea28793e738$var$getScopeRoot(scope) {
  return scope[0].parentElement;
}
function $9bf71ea28793e738$var$shouldContainFocus(scopeRef) {
  let scope = $9bf71ea28793e738$export$d06fae2ee68b101e.getTreeNode($9bf71ea28793e738$var$activeScope);
  while (scope && scope.scopeRef !== scopeRef) {
    if (scope.contain)
      return false;
    scope = scope.parent;
  }
  return true;
}
function $9bf71ea28793e738$var$useFocusContainment(scopeRef, contain) {
  let focusedNode = (0, import_react7.useRef)();
  let raf = (0, import_react7.useRef)(null);
  (0, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(() => {
    let scope = scopeRef.current;
    if (!contain) {
      if (raf.current) {
        cancelAnimationFrame(raf.current);
        raf.current = null;
      }
      return;
    }
    let onKeyDown = (e3) => {
      if (e3.key !== "Tab" || e3.altKey || e3.ctrlKey || e3.metaKey || !$9bf71ea28793e738$var$shouldContainFocus(scopeRef))
        return;
      let focusedElement = document.activeElement;
      let scope2 = scopeRef.current;
      if (!$9bf71ea28793e738$var$isElementInScope(focusedElement, scope2))
        return;
      let walker = $9bf71ea28793e738$export$2d6ec8fc375ceafa($9bf71ea28793e738$var$getScopeRoot(scope2), {
        tabbable: true
      }, scope2);
      walker.currentNode = focusedElement;
      let nextElement = e3.shiftKey ? walker.previousNode() : walker.nextNode();
      if (!nextElement) {
        walker.currentNode = e3.shiftKey ? scope2[scope2.length - 1].nextElementSibling : scope2[0].previousElementSibling;
        nextElement = e3.shiftKey ? walker.previousNode() : walker.nextNode();
      }
      e3.preventDefault();
      if (nextElement)
        $9bf71ea28793e738$var$focusElement(nextElement, true);
    };
    let onFocus = (e3) => {
      if ((!$9bf71ea28793e738$var$activeScope || $9bf71ea28793e738$var$isAncestorScope($9bf71ea28793e738$var$activeScope, scopeRef)) && $9bf71ea28793e738$var$isElementInScope(e3.target, scopeRef.current)) {
        $9bf71ea28793e738$var$activeScope = scopeRef;
        focusedNode.current = e3.target;
      } else if ($9bf71ea28793e738$var$shouldContainFocus(scopeRef) && !$9bf71ea28793e738$var$isElementInChildScope(e3.target, scopeRef)) {
        if (focusedNode.current)
          focusedNode.current.focus();
        else if ($9bf71ea28793e738$var$activeScope)
          $9bf71ea28793e738$var$focusFirstInScope($9bf71ea28793e738$var$activeScope.current);
      } else if ($9bf71ea28793e738$var$shouldContainFocus(scopeRef))
        focusedNode.current = e3.target;
    };
    let onBlur = (e3) => {
      if (raf.current)
        cancelAnimationFrame(raf.current);
      raf.current = requestAnimationFrame(() => {
        if ($9bf71ea28793e738$var$shouldContainFocus(scopeRef) && !$9bf71ea28793e738$var$isElementInChildScope(document.activeElement, scopeRef)) {
          $9bf71ea28793e738$var$activeScope = scopeRef;
          if (document.body.contains(e3.target)) {
            focusedNode.current = e3.target;
            focusedNode.current.focus();
          } else if ($9bf71ea28793e738$var$activeScope)
            $9bf71ea28793e738$var$focusFirstInScope($9bf71ea28793e738$var$activeScope.current);
        }
      });
    };
    document.addEventListener("keydown", onKeyDown, false);
    document.addEventListener("focusin", onFocus, false);
    scope.forEach((element2) => element2.addEventListener("focusin", onFocus, false));
    scope.forEach((element2) => element2.addEventListener("focusout", onBlur, false));
    return () => {
      document.removeEventListener("keydown", onKeyDown, false);
      document.removeEventListener("focusin", onFocus, false);
      scope.forEach((element2) => element2.removeEventListener("focusin", onFocus, false));
      scope.forEach((element2) => element2.removeEventListener("focusout", onBlur, false));
    };
  }, [
    scopeRef,
    contain
  ]);
  (0, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(() => {
    return () => {
      if (raf.current)
        cancelAnimationFrame(raf.current);
    };
  }, [
    raf
  ]);
}
function $9bf71ea28793e738$var$isElementInAnyScope(element2) {
  return $9bf71ea28793e738$var$isElementInChildScope(element2);
}
function $9bf71ea28793e738$var$isElementInScope(element2, scope) {
  return scope.some((node56) => node56.contains(element2));
}
function $9bf71ea28793e738$var$isElementInChildScope(element2, scope = null) {
  if (element2 instanceof Element && element2.closest("[data-react-aria-top-layer]"))
    return true;
  for (let { scopeRef: s2 } of $9bf71ea28793e738$export$d06fae2ee68b101e.traverse($9bf71ea28793e738$export$d06fae2ee68b101e.getTreeNode(scope))) {
    if ($9bf71ea28793e738$var$isElementInScope(element2, s2.current))
      return true;
  }
  return false;
}
function $9bf71ea28793e738$export$1258395f99bf9cbf(element2) {
  return $9bf71ea28793e738$var$isElementInChildScope(element2, $9bf71ea28793e738$var$activeScope);
}
function $9bf71ea28793e738$var$isAncestorScope(ancestor, scope) {
  var _focusScopeTree_getTreeNode;
  let parent = (_focusScopeTree_getTreeNode = $9bf71ea28793e738$export$d06fae2ee68b101e.getTreeNode(scope)) === null || _focusScopeTree_getTreeNode === void 0 ? void 0 : _focusScopeTree_getTreeNode.parent;
  while (parent) {
    if (parent.scopeRef === ancestor)
      return true;
    parent = parent.parent;
  }
  return false;
}
function $9bf71ea28793e738$var$focusElement(element2, scroll = false) {
  if (element2 != null && !scroll)
    try {
      (0, $6a99195332edec8b$export$80f3e147d781571c)(element2);
    } catch (err) {
    }
  else if (element2 != null)
    try {
      element2.focus();
    } catch (err) {
    }
}
function $9bf71ea28793e738$var$focusFirstInScope(scope, tabbable = true) {
  let sentinel = scope[0].previousElementSibling;
  let walker = $9bf71ea28793e738$export$2d6ec8fc375ceafa($9bf71ea28793e738$var$getScopeRoot(scope), {
    tabbable
  }, scope);
  walker.currentNode = sentinel;
  let nextNode = walker.nextNode();
  if (tabbable && !nextNode) {
    walker = $9bf71ea28793e738$export$2d6ec8fc375ceafa($9bf71ea28793e738$var$getScopeRoot(scope), {
      tabbable: false
    }, scope);
    walker.currentNode = sentinel;
    nextNode = walker.nextNode();
  }
  $9bf71ea28793e738$var$focusElement(nextNode);
}
function $9bf71ea28793e738$var$useAutoFocus(scopeRef, autoFocus) {
  const autoFocusRef = (0, import_react7.default).useRef(autoFocus);
  (0, import_react7.useEffect)(() => {
    if (autoFocusRef.current) {
      $9bf71ea28793e738$var$activeScope = scopeRef;
      if (!$9bf71ea28793e738$var$isElementInScope(document.activeElement, $9bf71ea28793e738$var$activeScope.current))
        $9bf71ea28793e738$var$focusFirstInScope(scopeRef.current);
    }
    autoFocusRef.current = false;
  }, [
    scopeRef
  ]);
}
function $9bf71ea28793e738$var$useActiveScopeTracker(scopeRef, restore, contain) {
  (0, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(() => {
    if (restore || contain)
      return;
    let scope = scopeRef.current;
    let onFocus = (e3) => {
      let target = e3.target;
      if ($9bf71ea28793e738$var$isElementInScope(target, scopeRef.current))
        $9bf71ea28793e738$var$activeScope = scopeRef;
      else if (!$9bf71ea28793e738$var$isElementInAnyScope(target))
        $9bf71ea28793e738$var$activeScope = null;
    };
    document.addEventListener("focusin", onFocus, false);
    scope.forEach((element2) => element2.addEventListener("focusin", onFocus, false));
    return () => {
      document.removeEventListener("focusin", onFocus, false);
      scope.forEach((element2) => element2.removeEventListener("focusin", onFocus, false));
    };
  }, [
    scopeRef,
    restore,
    contain
  ]);
}
function $9bf71ea28793e738$var$shouldRestoreFocus(scopeRef) {
  let scope = $9bf71ea28793e738$export$d06fae2ee68b101e.getTreeNode($9bf71ea28793e738$var$activeScope);
  while (scope && scope.scopeRef !== scopeRef) {
    if (scope.nodeToRestore)
      return false;
    scope = scope.parent;
  }
  return (scope === null || scope === void 0 ? void 0 : scope.scopeRef) === scopeRef;
}
function $9bf71ea28793e738$var$useRestoreFocus(scopeRef, restoreFocus, contain) {
  const nodeToRestoreRef = (0, import_react7.useRef)(typeof document !== "undefined" ? document.activeElement : null);
  (0, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(() => {
    let scope = scopeRef.current;
    if (!restoreFocus || contain)
      return;
    let onFocus = () => {
      if ((!$9bf71ea28793e738$var$activeScope || $9bf71ea28793e738$var$isAncestorScope($9bf71ea28793e738$var$activeScope, scopeRef)) && $9bf71ea28793e738$var$isElementInScope(document.activeElement, scopeRef.current))
        $9bf71ea28793e738$var$activeScope = scopeRef;
    };
    document.addEventListener("focusin", onFocus, false);
    scope.forEach((element2) => element2.addEventListener("focusin", onFocus, false));
    return () => {
      document.removeEventListener("focusin", onFocus, false);
      scope.forEach((element2) => element2.removeEventListener("focusin", onFocus, false));
    };
  }, [
    scopeRef,
    contain
  ]);
  (0, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(() => {
    if (!restoreFocus)
      return;
    let onKeyDown = (e3) => {
      if (e3.key !== "Tab" || e3.altKey || e3.ctrlKey || e3.metaKey || !$9bf71ea28793e738$var$shouldContainFocus(scopeRef))
        return;
      let focusedElement = document.activeElement;
      if (!$9bf71ea28793e738$var$isElementInScope(focusedElement, scopeRef.current))
        return;
      let nodeToRestore = $9bf71ea28793e738$export$d06fae2ee68b101e.getTreeNode(scopeRef).nodeToRestore;
      let walker = $9bf71ea28793e738$export$2d6ec8fc375ceafa(document.body, {
        tabbable: true
      });
      walker.currentNode = focusedElement;
      let nextElement = e3.shiftKey ? walker.previousNode() : walker.nextNode();
      if (!document.body.contains(nodeToRestore) || nodeToRestore === document.body) {
        nodeToRestore = null;
        $9bf71ea28793e738$export$d06fae2ee68b101e.getTreeNode(scopeRef).nodeToRestore = null;
      }
      if ((!nextElement || !$9bf71ea28793e738$var$isElementInScope(nextElement, scopeRef.current)) && nodeToRestore) {
        walker.currentNode = nodeToRestore;
        do
          nextElement = e3.shiftKey ? walker.previousNode() : walker.nextNode();
        while ($9bf71ea28793e738$var$isElementInScope(nextElement, scopeRef.current));
        e3.preventDefault();
        e3.stopPropagation();
        if (nextElement)
          $9bf71ea28793e738$var$focusElement(nextElement, true);
        else if (!$9bf71ea28793e738$var$isElementInAnyScope(nodeToRestore))
          focusedElement.blur();
        else
          $9bf71ea28793e738$var$focusElement(nodeToRestore, true);
      }
    };
    if (!contain)
      document.addEventListener("keydown", onKeyDown, true);
    return () => {
      if (!contain)
        document.removeEventListener("keydown", onKeyDown, true);
    };
  }, [
    scopeRef,
    restoreFocus,
    contain
  ]);
  (0, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(() => {
    if (!restoreFocus)
      return;
    $9bf71ea28793e738$export$d06fae2ee68b101e.getTreeNode(scopeRef).nodeToRestore = nodeToRestoreRef.current;
    return () => {
      let nodeToRestore = $9bf71ea28793e738$export$d06fae2ee68b101e.getTreeNode(scopeRef).nodeToRestore;
      if (restoreFocus && nodeToRestore && // eslint-disable-next-line react-hooks/exhaustive-deps
      ($9bf71ea28793e738$var$isElementInScope(document.activeElement, scopeRef.current) || document.activeElement === document.body && $9bf71ea28793e738$var$shouldRestoreFocus(scopeRef))) {
        let clonedTree = $9bf71ea28793e738$export$d06fae2ee68b101e.clone();
        requestAnimationFrame(() => {
          if (document.activeElement === document.body) {
            let treeNode = clonedTree.getTreeNode(scopeRef);
            while (treeNode) {
              if (treeNode.nodeToRestore && document.body.contains(treeNode.nodeToRestore)) {
                $9bf71ea28793e738$var$focusElement(treeNode.nodeToRestore);
                return;
              }
              treeNode = treeNode.parent;
            }
            treeNode = clonedTree.getTreeNode(scopeRef);
            while (treeNode) {
              if (treeNode.scopeRef && $9bf71ea28793e738$export$d06fae2ee68b101e.getTreeNode(treeNode.scopeRef)) {
                $9bf71ea28793e738$var$focusFirstInScope(treeNode.scopeRef.current, true);
                return;
              }
              treeNode = treeNode.parent;
            }
          }
        });
      }
    };
  }, [
    scopeRef,
    restoreFocus
  ]);
}
function $9bf71ea28793e738$export$2d6ec8fc375ceafa(root2, opts, scope) {
  let selector = (opts === null || opts === void 0 ? void 0 : opts.tabbable) ? $9bf71ea28793e738$var$TABBABLE_ELEMENT_SELECTOR : $9bf71ea28793e738$var$FOCUSABLE_ELEMENT_SELECTOR;
  let walker = document.createTreeWalker(root2, NodeFilter.SHOW_ELEMENT, {
    acceptNode(node56) {
      var _opts_from;
      if (opts === null || opts === void 0 ? void 0 : (_opts_from = opts.from) === null || _opts_from === void 0 ? void 0 : _opts_from.contains(node56))
        return NodeFilter.FILTER_REJECT;
      if (node56.matches(selector) && (0, $645f2e67b85a24c9$export$e989c0fffaa6b27a)(node56) && (!scope || $9bf71ea28793e738$var$isElementInScope(node56, scope)) && (!(opts === null || opts === void 0 ? void 0 : opts.accept) || opts.accept(node56)))
        return NodeFilter.FILTER_ACCEPT;
      return NodeFilter.FILTER_SKIP;
    }
  });
  if (opts === null || opts === void 0 ? void 0 : opts.from)
    walker.currentNode = opts.from;
  return walker;
}
var $9bf71ea28793e738$var$Tree = class _$9bf71ea28793e738$var$Tree {
  get size() {
    return this.fastMap.size;
  }
  getTreeNode(data) {
    return this.fastMap.get(data);
  }
  addTreeNode(scopeRef, parent, nodeToRestore) {
    let parentNode = this.fastMap.get(parent !== null && parent !== void 0 ? parent : null);
    let node56 = new $9bf71ea28793e738$var$TreeNode({
      scopeRef
    });
    parentNode.addChild(node56);
    node56.parent = parentNode;
    this.fastMap.set(scopeRef, node56);
    if (nodeToRestore)
      node56.nodeToRestore = nodeToRestore;
  }
  addNode(node56) {
    this.fastMap.set(node56.scopeRef, node56);
  }
  removeTreeNode(scopeRef) {
    if (scopeRef === null)
      return;
    let node56 = this.fastMap.get(scopeRef);
    let parentNode = node56.parent;
    for (let current of this.traverse())
      if (current !== node56 && node56.nodeToRestore && current.nodeToRestore && node56.scopeRef.current && $9bf71ea28793e738$var$isElementInScope(current.nodeToRestore, node56.scopeRef.current))
        current.nodeToRestore = node56.nodeToRestore;
    let children = node56.children;
    parentNode.removeChild(node56);
    if (children.size > 0)
      children.forEach((child) => parentNode.addChild(child));
    this.fastMap.delete(node56.scopeRef);
  }
  // Pre Order Depth First
  *traverse(node56 = this.root) {
    if (node56.scopeRef != null)
      yield node56;
    if (node56.children.size > 0)
      for (let child of node56.children)
        yield* this.traverse(child);
  }
  clone() {
    let newTree = new _$9bf71ea28793e738$var$Tree();
    for (let node56 of this.traverse())
      newTree.addTreeNode(node56.scopeRef, node56.parent.scopeRef, node56.nodeToRestore);
    return newTree;
  }
  constructor() {
    this.fastMap = /* @__PURE__ */ new Map();
    this.root = new $9bf71ea28793e738$var$TreeNode({
      scopeRef: null
    });
    this.fastMap.set(null, this.root);
  }
};
var $9bf71ea28793e738$var$TreeNode = class {
  addChild(node56) {
    this.children.add(node56);
    node56.parent = this;
  }
  removeChild(node56) {
    this.children.delete(node56);
    node56.parent = void 0;
  }
  constructor(props) {
    this.children = /* @__PURE__ */ new Set();
    this.contain = false;
    this.scopeRef = props.scopeRef;
  }
};
var $9bf71ea28793e738$export$d06fae2ee68b101e = new $9bf71ea28793e738$var$Tree();
function $f7dceffc5ad7768b$export$4e328f61c538687f(props = {}) {
  let { autoFocus = false, isTextInput, within } = props;
  let state = (0, import_react7.useRef)({
    isFocused: false,
    isFocusVisible: autoFocus || (0, $507fabe10e71c6fb$export$b9b3dfddab17db27)()
  });
  let [isFocused, setFocused] = (0, import_react7.useState)(false);
  let [isFocusVisibleState, setFocusVisible] = (0, import_react7.useState)(() => state.current.isFocused && state.current.isFocusVisible);
  let updateState = (0, import_react7.useCallback)(() => setFocusVisible(state.current.isFocused && state.current.isFocusVisible), []);
  let onFocusChange = (0, import_react7.useCallback)((isFocused2) => {
    state.current.isFocused = isFocused2;
    setFocused(isFocused2);
    updateState();
  }, [
    updateState
  ]);
  (0, $507fabe10e71c6fb$export$ec71b4b83ac08ec3)((isFocusVisible) => {
    state.current.isFocusVisible = isFocusVisible;
    updateState();
  }, [], {
    isTextInput
  });
  let { focusProps } = (0, $a1ea59d68270f0dd$export$f8168d8dd8fd66e6)({
    isDisabled: within,
    onFocusChange
  });
  let { focusWithinProps } = (0, $9ab94262bd0047c7$export$420e68273165f4ec)({
    isDisabled: !within,
    onFocusWithinChange: onFocusChange
  });
  return {
    isFocused,
    isFocusVisible: isFocusVisibleState,
    focusProps: within ? focusWithinProps : focusProps
  };
}
function $907718708eab68af$export$1a38b4ad7f578e1d(props) {
  let { children, focusClass, focusRingClass } = props;
  let { isFocused, isFocusVisible, focusProps } = (0, $f7dceffc5ad7768b$export$4e328f61c538687f)(props);
  let child = (0, import_react7.default).Children.only(children);
  return /* @__PURE__ */ (0, import_react7.default).cloneElement(child, (0, $3ef42575df84b30b$export$9d1611c77c2fe928)(child.props, {
    ...focusProps,
    className: (0, clsx_m_default)({
      [focusClass || ""]: isFocused,
      [focusRingClass || ""]: isFocusVisible
    })
  }));
}
var $e6afbd83fe6ebbd2$var$FocusableContext = /* @__PURE__ */ (0, import_react7.default).createContext(null);
function $e6afbd83fe6ebbd2$var$useFocusableContext(ref) {
  let context2 = (0, import_react7.useContext)($e6afbd83fe6ebbd2$var$FocusableContext) || {};
  (0, $e7801be82b4b2a53$export$4debdb1a3f0fa79e)(context2, ref);
  let { ref: _, ...otherProps } = context2;
  return otherProps;
}
function $e6afbd83fe6ebbd2$var$FocusableProvider(props, ref) {
  let { children, ...otherProps } = props;
  let context2 = {
    ...otherProps,
    ref
  };
  return /* @__PURE__ */ (0, import_react7.default).createElement($e6afbd83fe6ebbd2$var$FocusableContext.Provider, {
    value: context2
  }, children);
}
var $e6afbd83fe6ebbd2$export$13f3202a3e5ddd5 = /* @__PURE__ */ (0, import_react7.default).forwardRef($e6afbd83fe6ebbd2$var$FocusableProvider);
function $e6afbd83fe6ebbd2$export$4c014de7c8940b4c(props, domRef) {
  let { focusProps } = (0, $a1ea59d68270f0dd$export$f8168d8dd8fd66e6)(props);
  let { keyboardProps } = (0, $46d819fcbaf35654$export$8f71654801c2f7cd)(props);
  let interactions = (0, $3ef42575df84b30b$export$9d1611c77c2fe928)(focusProps, keyboardProps);
  let domProps = $e6afbd83fe6ebbd2$var$useFocusableContext(domRef);
  let interactionProps = props.isDisabled ? {} : domProps;
  let autoFocusRef = (0, import_react7.useRef)(props.autoFocus);
  (0, import_react7.useEffect)(() => {
    if (autoFocusRef.current && domRef.current)
      (0, $6a99195332edec8b$export$80f3e147d781571c)(domRef.current);
    autoFocusRef.current = false;
  }, [
    domRef
  ]);
  return {
    focusableProps: (0, $3ef42575df84b30b$export$9d1611c77c2fe928)({
      ...interactions,
      tabIndex: props.excludeFromTabOrder && !props.isDisabled ? -1 : void 0
    }, interactionProps)
  };
}

// node_modules/@react-aria/overlays/dist/import.mjs
var import_react_dom = __toESM(require_react_dom(), 1);

// node_modules/@react-aria/visually-hidden/dist/import.mjs
var import_react8 = __toESM(require_react(), 1);
var $5c3e21d68f1c4674$var$styles = {
  border: 0,
  clip: "rect(0 0 0 0)",
  clipPath: "inset(50%)",
  height: "1px",
  margin: "-1px",
  overflow: "hidden",
  padding: 0,
  position: "absolute",
  width: "1px",
  whiteSpace: "nowrap"
};
function $5c3e21d68f1c4674$export$a966af930f325cab(props = {}) {
  let { style, isFocusable } = props;
  let [isFocused, setFocused] = (0, import_react8.useState)(false);
  let { focusWithinProps } = (0, $9ab94262bd0047c7$export$420e68273165f4ec)({
    isDisabled: !isFocusable,
    onFocusWithinChange: (val) => setFocused(val)
  });
  let combinedStyles = (0, import_react8.useMemo)(() => {
    if (isFocused)
      return style;
    else if (style)
      return {
        ...$5c3e21d68f1c4674$var$styles,
        ...style
      };
    else
      return $5c3e21d68f1c4674$var$styles;
  }, [
    isFocused
  ]);
  return {
    visuallyHiddenProps: {
      ...focusWithinProps,
      style: combinedStyles
    }
  };
}
function $5c3e21d68f1c4674$export$439d29a4e110a164(props) {
  let { children, elementType: Element2 = "div", isFocusable, style, ...otherProps } = props;
  let { visuallyHiddenProps } = $5c3e21d68f1c4674$export$a966af930f325cab(props);
  return /* @__PURE__ */ (0, import_react8.default).createElement(Element2, (0, $3ef42575df84b30b$export$9d1611c77c2fe928)(otherProps, visuallyHiddenProps), children);
}

// node_modules/@react-aria/overlays/dist/import.mjs
function $parcel$interopDefault(a2) {
  return a2 && a2.__esModule ? a2.default : a2;
}
var $edcf132a9284368a$var$AXIS = {
  top: "top",
  bottom: "top",
  left: "left",
  right: "left"
};
var $edcf132a9284368a$var$FLIPPED_DIRECTION = {
  top: "bottom",
  bottom: "top",
  left: "right",
  right: "left"
};
var $edcf132a9284368a$var$CROSS_AXIS = {
  top: "left",
  left: "top"
};
var $edcf132a9284368a$var$AXIS_SIZE = {
  top: "height",
  left: "width"
};
var $edcf132a9284368a$var$TOTAL_SIZE = {
  width: "totalWidth",
  height: "totalHeight"
};
var $edcf132a9284368a$var$PARSED_PLACEMENT_CACHE = {};
var $edcf132a9284368a$var$visualViewport = typeof document !== "undefined" && window.visualViewport;
function $edcf132a9284368a$var$getContainerDimensions(containerNode) {
  let width = 0, height = 0, totalWidth = 0, totalHeight = 0, top2 = 0, left = 0;
  let scroll = {};
  if (containerNode.tagName === "BODY") {
    let documentElement = document.documentElement;
    totalWidth = documentElement.clientWidth;
    totalHeight = documentElement.clientHeight;
    var _visualViewport_width;
    width = (_visualViewport_width = $edcf132a9284368a$var$visualViewport === null || $edcf132a9284368a$var$visualViewport === void 0 ? void 0 : $edcf132a9284368a$var$visualViewport.width) !== null && _visualViewport_width !== void 0 ? _visualViewport_width : totalWidth;
    var _visualViewport_height;
    height = (_visualViewport_height = $edcf132a9284368a$var$visualViewport === null || $edcf132a9284368a$var$visualViewport === void 0 ? void 0 : $edcf132a9284368a$var$visualViewport.height) !== null && _visualViewport_height !== void 0 ? _visualViewport_height : totalHeight;
    scroll.top = documentElement.scrollTop || containerNode.scrollTop;
    scroll.left = documentElement.scrollLeft || containerNode.scrollLeft;
  } else {
    ({ width, height, top: top2, left } = $edcf132a9284368a$var$getOffset(containerNode));
    scroll.top = containerNode.scrollTop;
    scroll.left = containerNode.scrollLeft;
    totalWidth = width;
    totalHeight = height;
  }
  return {
    width,
    height,
    totalWidth,
    totalHeight,
    scroll,
    top: top2,
    left
  };
}
function $edcf132a9284368a$var$getScroll(node56) {
  return {
    top: node56.scrollTop,
    left: node56.scrollLeft,
    width: node56.scrollWidth,
    height: node56.scrollHeight
  };
}
function $edcf132a9284368a$var$getDelta(axis, offset, size, boundaryDimensions, containerDimensions, padding) {
  let containerScroll = containerDimensions.scroll[axis];
  let boundaryHeight = boundaryDimensions[$edcf132a9284368a$var$AXIS_SIZE[axis]];
  let startEdgeOffset = offset - padding - containerScroll;
  let endEdgeOffset = offset + padding - containerScroll + size;
  if (startEdgeOffset < 0)
    return -startEdgeOffset;
  else if (endEdgeOffset > boundaryHeight)
    return Math.max(boundaryHeight - endEdgeOffset, -startEdgeOffset);
  else
    return 0;
}
function $edcf132a9284368a$var$getMargins(node56) {
  let style = window.getComputedStyle(node56);
  return {
    top: parseInt(style.marginTop, 10) || 0,
    bottom: parseInt(style.marginBottom, 10) || 0,
    left: parseInt(style.marginLeft, 10) || 0,
    right: parseInt(style.marginRight, 10) || 0
  };
}
function $edcf132a9284368a$var$parsePlacement(input) {
  if ($edcf132a9284368a$var$PARSED_PLACEMENT_CACHE[input])
    return $edcf132a9284368a$var$PARSED_PLACEMENT_CACHE[input];
  let [placement, crossPlacement] = input.split(" ");
  let axis = $edcf132a9284368a$var$AXIS[placement] || "right";
  let crossAxis = $edcf132a9284368a$var$CROSS_AXIS[axis];
  if (!$edcf132a9284368a$var$AXIS[crossPlacement])
    crossPlacement = "center";
  let size = $edcf132a9284368a$var$AXIS_SIZE[axis];
  let crossSize = $edcf132a9284368a$var$AXIS_SIZE[crossAxis];
  $edcf132a9284368a$var$PARSED_PLACEMENT_CACHE[input] = {
    placement,
    crossPlacement,
    axis,
    crossAxis,
    size,
    crossSize
  };
  return $edcf132a9284368a$var$PARSED_PLACEMENT_CACHE[input];
}
function $edcf132a9284368a$var$computePosition(childOffset, boundaryDimensions, overlaySize, placementInfo, offset, crossOffset, containerOffsetWithBoundary, isContainerPositioned, arrowSize, arrowBoundaryOffset) {
  let { placement, crossPlacement, axis, crossAxis, size, crossSize } = placementInfo;
  let position2 = {};
  position2[crossAxis] = childOffset[crossAxis];
  if (crossPlacement === "center")
    position2[crossAxis] += (childOffset[crossSize] - overlaySize[crossSize]) / 2;
  else if (crossPlacement !== crossAxis)
    position2[crossAxis] += childOffset[crossSize] - overlaySize[crossSize];
  position2[crossAxis] += crossOffset;
  const minPosition = childOffset[crossAxis] - overlaySize[crossSize] + arrowSize + arrowBoundaryOffset;
  const maxPosition = childOffset[crossAxis] + childOffset[crossSize] - arrowSize - arrowBoundaryOffset;
  position2[crossAxis] = (0, $9446cca9a3875146$export$7d15b64cf5a3a4c4)(position2[crossAxis], minPosition, maxPosition);
  if (placement === axis) {
    const containerHeight = isContainerPositioned ? containerOffsetWithBoundary[size] : boundaryDimensions[$edcf132a9284368a$var$TOTAL_SIZE[size]];
    position2[$edcf132a9284368a$var$FLIPPED_DIRECTION[axis]] = Math.floor(containerHeight - childOffset[axis] + offset);
  } else
    position2[axis] = Math.floor(childOffset[axis] + childOffset[size] + offset);
  return position2;
}
function $edcf132a9284368a$var$getMaxHeight(position2, boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding) {
  return position2.top != null ? Math.max(0, boundaryDimensions.height + boundaryDimensions.top + boundaryDimensions.scroll.top - (containerOffsetWithBoundary.top + position2.top) - (margins.top + margins.bottom + padding)) : Math.max(0, childOffset.top + containerOffsetWithBoundary.top - (boundaryDimensions.top + boundaryDimensions.scroll.top) - (margins.top + margins.bottom + padding));
}
function $edcf132a9284368a$var$getAvailableSpace(boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding, placementInfo) {
  let { placement, axis, size } = placementInfo;
  if (placement === axis)
    return Math.max(0, childOffset[axis] - boundaryDimensions[axis] - boundaryDimensions.scroll[axis] + containerOffsetWithBoundary[axis] - margins[axis] - margins[$edcf132a9284368a$var$FLIPPED_DIRECTION[axis]] - padding);
  return Math.max(0, boundaryDimensions[size] + boundaryDimensions[axis] + boundaryDimensions.scroll[axis] - containerOffsetWithBoundary[axis] - childOffset[axis] - childOffset[size] - margins[axis] - margins[$edcf132a9284368a$var$FLIPPED_DIRECTION[axis]] - padding);
}
function $edcf132a9284368a$export$6839422d1f33cee9(placementInput, childOffset, overlaySize, scrollSize, margins, padding, flip, boundaryDimensions, containerDimensions, containerOffsetWithBoundary, offset, crossOffset, isContainerPositioned, userSetMaxHeight, arrowSize, arrowBoundaryOffset) {
  let placementInfo = $edcf132a9284368a$var$parsePlacement(placementInput);
  let { size, crossAxis, crossSize, placement, crossPlacement } = placementInfo;
  let position2 = $edcf132a9284368a$var$computePosition(childOffset, boundaryDimensions, overlaySize, placementInfo, offset, crossOffset, containerOffsetWithBoundary, isContainerPositioned, arrowSize, arrowBoundaryOffset);
  let normalizedOffset = offset;
  let space2 = $edcf132a9284368a$var$getAvailableSpace(boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding + offset, placementInfo);
  if (flip && scrollSize[size] > space2) {
    let flippedPlacementInfo = $edcf132a9284368a$var$parsePlacement(`${$edcf132a9284368a$var$FLIPPED_DIRECTION[placement]} ${crossPlacement}`);
    let flippedPosition = $edcf132a9284368a$var$computePosition(childOffset, boundaryDimensions, overlaySize, flippedPlacementInfo, offset, crossOffset, containerOffsetWithBoundary, isContainerPositioned, arrowSize, arrowBoundaryOffset);
    let flippedSpace = $edcf132a9284368a$var$getAvailableSpace(boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding + offset, flippedPlacementInfo);
    if (flippedSpace > space2) {
      placementInfo = flippedPlacementInfo;
      position2 = flippedPosition;
      normalizedOffset = offset;
    }
  }
  let delta = $edcf132a9284368a$var$getDelta(crossAxis, position2[crossAxis], overlaySize[crossSize], boundaryDimensions, containerDimensions, padding);
  position2[crossAxis] += delta;
  let maxHeight = $edcf132a9284368a$var$getMaxHeight(position2, boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding);
  if (userSetMaxHeight && userSetMaxHeight < maxHeight)
    maxHeight = userSetMaxHeight;
  overlaySize.height = Math.min(overlaySize.height, maxHeight);
  position2 = $edcf132a9284368a$var$computePosition(childOffset, boundaryDimensions, overlaySize, placementInfo, normalizedOffset, crossOffset, containerOffsetWithBoundary, isContainerPositioned, arrowSize, arrowBoundaryOffset);
  delta = $edcf132a9284368a$var$getDelta(crossAxis, position2[crossAxis], overlaySize[crossSize], boundaryDimensions, containerDimensions, padding);
  position2[crossAxis] += delta;
  let arrowPosition = {};
  let preferredArrowPosition = childOffset[crossAxis] + 0.5 * childOffset[crossSize] - overlaySize[crossAxis];
  const arrowMinPosition = arrowSize / 2 + arrowBoundaryOffset;
  const arrowMaxPosition = overlaySize[crossSize] - arrowSize / 2 - arrowBoundaryOffset;
  const arrowOverlappingChildMinEdge = childOffset[crossAxis] - overlaySize[crossAxis] + arrowSize / 2;
  const arrowOverlappingChildMaxEdge = childOffset[crossAxis] + childOffset[crossSize] - overlaySize[crossAxis] - arrowSize / 2;
  const arrowPositionOverlappingChild = (0, $9446cca9a3875146$export$7d15b64cf5a3a4c4)(preferredArrowPosition, arrowOverlappingChildMinEdge, arrowOverlappingChildMaxEdge);
  arrowPosition[crossAxis] = (0, $9446cca9a3875146$export$7d15b64cf5a3a4c4)(arrowPositionOverlappingChild, arrowMinPosition, arrowMaxPosition);
  return {
    position: position2,
    maxHeight,
    arrowOffsetLeft: arrowPosition.left,
    arrowOffsetTop: arrowPosition.top,
    placement: placementInfo.placement
  };
}
function $edcf132a9284368a$export$b3ceb0cbf1056d98(opts) {
  let { placement, targetNode, overlayNode, scrollNode, padding, shouldFlip, boundaryElement, offset, crossOffset, maxHeight, arrowSize = 0, arrowBoundaryOffset = 0 } = opts;
  let container = overlayNode instanceof HTMLElement ? $edcf132a9284368a$var$getContainingBlock(overlayNode) : document.documentElement;
  let isViewportContainer = container === document.documentElement;
  const containerPositionStyle = window.getComputedStyle(container).position;
  let isContainerPositioned = !!containerPositionStyle && containerPositionStyle !== "static";
  let childOffset = isViewportContainer ? $edcf132a9284368a$var$getOffset(targetNode) : $edcf132a9284368a$var$getPosition(targetNode, container);
  if (!isViewportContainer) {
    let { marginTop, marginLeft } = window.getComputedStyle(targetNode);
    childOffset.top += parseInt(marginTop, 10) || 0;
    childOffset.left += parseInt(marginLeft, 10) || 0;
  }
  let overlaySize = $edcf132a9284368a$var$getOffset(overlayNode);
  let margins = $edcf132a9284368a$var$getMargins(overlayNode);
  overlaySize.width += margins.left + margins.right;
  overlaySize.height += margins.top + margins.bottom;
  let scrollSize = $edcf132a9284368a$var$getScroll(scrollNode);
  let boundaryDimensions = $edcf132a9284368a$var$getContainerDimensions(boundaryElement);
  let containerDimensions = $edcf132a9284368a$var$getContainerDimensions(container);
  let containerOffsetWithBoundary = boundaryElement.tagName === "BODY" ? $edcf132a9284368a$var$getOffset(container) : $edcf132a9284368a$var$getPosition(container, boundaryElement);
  return $edcf132a9284368a$export$6839422d1f33cee9(placement, childOffset, overlaySize, scrollSize, margins, padding, shouldFlip, boundaryDimensions, containerDimensions, containerOffsetWithBoundary, offset, crossOffset, isContainerPositioned, maxHeight, arrowSize, arrowBoundaryOffset);
}
function $edcf132a9284368a$var$getOffset(node56) {
  let { top: top2, left, width, height } = node56.getBoundingClientRect();
  let { scrollTop, scrollLeft, clientTop, clientLeft } = document.documentElement;
  return {
    top: top2 + scrollTop - clientTop,
    left: left + scrollLeft - clientLeft,
    width,
    height
  };
}
function $edcf132a9284368a$var$getPosition(node56, parent) {
  let style = window.getComputedStyle(node56);
  let offset;
  if (style.position === "fixed") {
    let { top: top2, left, width, height } = node56.getBoundingClientRect();
    offset = {
      top: top2,
      left,
      width,
      height
    };
  } else {
    offset = $edcf132a9284368a$var$getOffset(node56);
    let parentOffset = $edcf132a9284368a$var$getOffset(parent);
    let parentStyle = window.getComputedStyle(parent);
    parentOffset.top += (parseInt(parentStyle.borderTopWidth, 10) || 0) - parent.scrollTop;
    parentOffset.left += (parseInt(parentStyle.borderLeftWidth, 10) || 0) - parent.scrollLeft;
    offset.top -= parentOffset.top;
    offset.left -= parentOffset.left;
  }
  offset.top -= parseInt(style.marginTop, 10) || 0;
  offset.left -= parseInt(style.marginLeft, 10) || 0;
  return offset;
}
function $edcf132a9284368a$var$getContainingBlock(node56) {
  let offsetParent = node56.offsetParent;
  if (offsetParent && offsetParent === document.body && window.getComputedStyle(offsetParent).position === "static" && !$edcf132a9284368a$var$isContainingBlock(offsetParent))
    offsetParent = document.documentElement;
  if (offsetParent == null) {
    offsetParent = node56.parentElement;
    while (offsetParent && !$edcf132a9284368a$var$isContainingBlock(offsetParent))
      offsetParent = offsetParent.parentElement;
  }
  return offsetParent || document.documentElement;
}
function $edcf132a9284368a$var$isContainingBlock(node56) {
  let style = window.getComputedStyle(node56);
  return style.transform !== "none" || /transform|perspective/.test(style.willChange) || style.filter !== "none" || style.contain === "paint" || // @ts-ignore
  "backdropFilter" in style && style.backdropFilter !== "none" || // @ts-ignore
  "WebkitBackdropFilter" in style && style.WebkitBackdropFilter !== "none";
}
var $dd149f63282afbbf$export$f6211563215e3b37 = /* @__PURE__ */ new WeakMap();
function $dd149f63282afbbf$export$18fc8428861184da(opts) {
  let { triggerRef, isOpen, onClose } = opts;
  (0, import_react9.useEffect)(() => {
    if (!isOpen || onClose === null)
      return;
    let onScroll = (e3) => {
      let target = e3.target;
      if (!triggerRef.current || target instanceof Node && !target.contains(triggerRef.current))
        return;
      let onCloseHandler = onClose || $dd149f63282afbbf$export$f6211563215e3b37.get(triggerRef.current);
      if (onCloseHandler)
        onCloseHandler();
    };
    window.addEventListener("scroll", onScroll, true);
    return () => {
      window.removeEventListener("scroll", onScroll, true);
    };
  }, [
    isOpen,
    onClose,
    triggerRef
  ]);
}
var $2a41e45df1593e64$var$visualViewport = typeof document !== "undefined" && window.visualViewport;
function $2a41e45df1593e64$export$d39e1813b3bdd0e1(props) {
  let { direction } = (0, $18f2051aff69b9bf$export$43bb16f9c6d9e3f7)();
  let { arrowSize = 0, targetRef, overlayRef, scrollRef = overlayRef, placement = "bottom", containerPadding = 12, shouldFlip = true, boundaryElement = typeof document !== "undefined" ? document.body : null, offset = 0, crossOffset = 0, shouldUpdatePosition = true, isOpen = true, onClose, maxHeight, arrowBoundaryOffset = 0 } = props;
  let [position2, setPosition] = (0, import_react9.useState)({
    position: {},
    arrowOffsetLeft: void 0,
    arrowOffsetTop: void 0,
    maxHeight: void 0,
    placement: void 0
  });
  let deps = [
    shouldUpdatePosition,
    placement,
    overlayRef.current,
    targetRef.current,
    scrollRef.current,
    containerPadding,
    shouldFlip,
    boundaryElement,
    offset,
    crossOffset,
    isOpen,
    direction,
    maxHeight,
    arrowBoundaryOffset,
    arrowSize
  ];
  let updatePosition = (0, import_react9.useCallback)(() => {
    if (shouldUpdatePosition === false || !isOpen || !overlayRef.current || !targetRef.current || !scrollRef.current || !boundaryElement)
      return;
    let position3 = (0, $edcf132a9284368a$export$b3ceb0cbf1056d98)({
      placement: $2a41e45df1593e64$var$translateRTL(placement, direction),
      overlayNode: overlayRef.current,
      targetNode: targetRef.current,
      scrollNode: scrollRef.current,
      padding: containerPadding,
      shouldFlip,
      boundaryElement,
      offset,
      crossOffset,
      maxHeight,
      arrowSize,
      arrowBoundaryOffset
    });
    Object.keys(position3.position).forEach((key) => overlayRef.current.style[key] = position3.position[key] + "px");
    overlayRef.current.style.maxHeight = position3.maxHeight != null ? position3.maxHeight + "px" : void 0;
    setPosition(position3);
  }, deps);
  (0, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(updatePosition, deps);
  $2a41e45df1593e64$var$useResize(updatePosition);
  (0, $9daab02d461809db$export$683480f191c0e3ea)({
    ref: overlayRef,
    onResize: updatePosition
  });
  let isResizing = (0, import_react9.useRef)(false);
  (0, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(() => {
    let timeout2;
    let onResize = () => {
      isResizing.current = true;
      clearTimeout(timeout2);
      timeout2 = setTimeout(() => {
        isResizing.current = false;
      }, 500);
      updatePosition();
    };
    $2a41e45df1593e64$var$visualViewport === null || $2a41e45df1593e64$var$visualViewport === void 0 ? void 0 : $2a41e45df1593e64$var$visualViewport.addEventListener("resize", onResize);
    $2a41e45df1593e64$var$visualViewport === null || $2a41e45df1593e64$var$visualViewport === void 0 ? void 0 : $2a41e45df1593e64$var$visualViewport.addEventListener("scroll", onResize);
    return () => {
      $2a41e45df1593e64$var$visualViewport === null || $2a41e45df1593e64$var$visualViewport === void 0 ? void 0 : $2a41e45df1593e64$var$visualViewport.removeEventListener("resize", onResize);
      $2a41e45df1593e64$var$visualViewport === null || $2a41e45df1593e64$var$visualViewport === void 0 ? void 0 : $2a41e45df1593e64$var$visualViewport.removeEventListener("scroll", onResize);
    };
  }, [
    updatePosition
  ]);
  let close = (0, import_react9.useCallback)(() => {
    if (!isResizing.current)
      onClose();
  }, [
    onClose,
    isResizing
  ]);
  (0, $dd149f63282afbbf$export$18fc8428861184da)({
    triggerRef: targetRef,
    isOpen,
    onClose: onClose && close
  });
  return {
    overlayProps: {
      style: {
        position: "absolute",
        zIndex: 1e5,
        ...position2.position,
        maxHeight: position2.maxHeight
      }
    },
    placement: position2.placement,
    arrowProps: {
      "aria-hidden": "true",
      role: "presentation",
      style: {
        left: position2.arrowOffsetLeft,
        top: position2.arrowOffsetTop
      }
    },
    updatePosition
  };
}
function $2a41e45df1593e64$var$useResize(onResize) {
  (0, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(() => {
    window.addEventListener("resize", onResize, false);
    return () => {
      window.removeEventListener("resize", onResize, false);
    };
  }, [
    onResize
  ]);
}
function $2a41e45df1593e64$var$translateRTL(position2, direction) {
  if (direction === "rtl")
    return position2.replace("start", "right").replace("end", "left");
  return position2.replace("start", "left").replace("end", "right");
}
var $a11501f3d1d39e6c$var$visibleOverlays = [];
function $a11501f3d1d39e6c$export$ea8f71083e90600f(props, ref) {
  let { onClose, shouldCloseOnBlur, isOpen, isDismissable = false, isKeyboardDismissDisabled = false, shouldCloseOnInteractOutside } = props;
  (0, import_react9.useEffect)(() => {
    if (isOpen)
      $a11501f3d1d39e6c$var$visibleOverlays.push(ref);
    return () => {
      let index = $a11501f3d1d39e6c$var$visibleOverlays.indexOf(ref);
      if (index >= 0)
        $a11501f3d1d39e6c$var$visibleOverlays.splice(index, 1);
    };
  }, [
    isOpen,
    ref
  ]);
  let onHide = () => {
    if ($a11501f3d1d39e6c$var$visibleOverlays[$a11501f3d1d39e6c$var$visibleOverlays.length - 1] === ref && onClose)
      onClose();
  };
  let onInteractOutsideStart = (e3) => {
    if (!shouldCloseOnInteractOutside || shouldCloseOnInteractOutside(e3.target)) {
      if ($a11501f3d1d39e6c$var$visibleOverlays[$a11501f3d1d39e6c$var$visibleOverlays.length - 1] === ref) {
        e3.stopPropagation();
        e3.preventDefault();
      }
    }
  };
  let onInteractOutside = (e3) => {
    if (!shouldCloseOnInteractOutside || shouldCloseOnInteractOutside(e3.target)) {
      if ($a11501f3d1d39e6c$var$visibleOverlays[$a11501f3d1d39e6c$var$visibleOverlays.length - 1] === ref) {
        e3.stopPropagation();
        e3.preventDefault();
      }
      onHide();
    }
  };
  let onKeyDown = (e3) => {
    if (e3.key === "Escape" && !isKeyboardDismissDisabled) {
      e3.stopPropagation();
      e3.preventDefault();
      onHide();
    }
  };
  (0, $e0b6e0b68ec7f50f$export$872b660ac5a1ff98)({
    ref,
    onInteractOutside: isDismissable ? onInteractOutside : null,
    onInteractOutsideStart
  });
  let { focusWithinProps } = (0, $9ab94262bd0047c7$export$420e68273165f4ec)({
    isDisabled: !shouldCloseOnBlur,
    onBlurWithin: (e3) => {
      if (!e3.relatedTarget || (0, $9bf71ea28793e738$export$1258395f99bf9cbf)(e3.relatedTarget))
        return;
      if (!shouldCloseOnInteractOutside || shouldCloseOnInteractOutside(e3.relatedTarget))
        onClose();
    }
  });
  let onPointerDownUnderlay = (e3) => {
    if (e3.target === e3.currentTarget)
      e3.preventDefault();
  };
  return {
    overlayProps: {
      onKeyDown,
      ...focusWithinProps
    },
    underlayProps: {
      onPointerDown: onPointerDownUnderlay
    }
  };
}
function $628037886ba31236$export$f9d5c8beee7d008d(props, state, ref) {
  let { type } = props;
  let { isOpen } = state;
  (0, import_react9.useEffect)(() => {
    if (ref && ref.current)
      (0, $dd149f63282afbbf$export$f6211563215e3b37).set(ref.current, state.close);
  });
  let ariaHasPopup = void 0;
  if (type === "menu")
    ariaHasPopup = true;
  else if (type === "listbox")
    ariaHasPopup = "listbox";
  let overlayId = (0, $bdb11010cef70236$export$f680877a34711e37)();
  return {
    triggerProps: {
      "aria-haspopup": ariaHasPopup,
      "aria-expanded": isOpen,
      "aria-controls": isOpen ? overlayId : null,
      onPress: state.toggle
    },
    overlayProps: {
      id: overlayId
    }
  };
}
var $49c51c25361d4cd2$var$visualViewport = typeof document !== "undefined" && window.visualViewport;
var $49c51c25361d4cd2$var$nonTextInputTypes = /* @__PURE__ */ new Set([
  "checkbox",
  "radio",
  "range",
  "color",
  "file",
  "image",
  "button",
  "submit",
  "reset"
]);
var $49c51c25361d4cd2$var$preventScrollCount = 0;
var $49c51c25361d4cd2$var$restore;
function $49c51c25361d4cd2$export$ee0f7cc6afcd1c18(options = {}) {
  let { isDisabled } = options;
  (0, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(() => {
    if (isDisabled)
      return;
    $49c51c25361d4cd2$var$preventScrollCount++;
    if ($49c51c25361d4cd2$var$preventScrollCount === 1) {
      if ((0, $c87311424ea30a05$export$fedb369cb70207f1)())
        $49c51c25361d4cd2$var$restore = $49c51c25361d4cd2$var$preventScrollMobileSafari();
      else
        $49c51c25361d4cd2$var$restore = $49c51c25361d4cd2$var$preventScrollStandard();
    }
    return () => {
      $49c51c25361d4cd2$var$preventScrollCount--;
      if ($49c51c25361d4cd2$var$preventScrollCount === 0)
        $49c51c25361d4cd2$var$restore();
    };
  }, [
    isDisabled
  ]);
}
function $49c51c25361d4cd2$var$preventScrollStandard() {
  return (0, $ff5963eb1fccf552$export$e08e3b67e392101e)($49c51c25361d4cd2$var$setStyle(document.documentElement, "paddingRight", `${window.innerWidth - document.documentElement.clientWidth}px`), $49c51c25361d4cd2$var$setStyle(document.documentElement, "overflow", "hidden"));
}
function $49c51c25361d4cd2$var$preventScrollMobileSafari() {
  let scrollable;
  let lastY = 0;
  let onTouchStart = (e3) => {
    scrollable = (0, $62d8ded9296f3872$export$cfa2225e87938781)(e3.target);
    if (scrollable === document.documentElement && scrollable === document.body)
      return;
    lastY = e3.changedTouches[0].pageY;
  };
  let onTouchMove = (e3) => {
    if (!scrollable || scrollable === document.documentElement || scrollable === document.body) {
      e3.preventDefault();
      return;
    }
    let y2 = e3.changedTouches[0].pageY;
    let scrollTop = scrollable.scrollTop;
    let bottom = scrollable.scrollHeight - scrollable.clientHeight;
    if (bottom === 0)
      return;
    if (scrollTop <= 0 && y2 > lastY || scrollTop >= bottom && y2 < lastY)
      e3.preventDefault();
    lastY = y2;
  };
  let onTouchEnd = (e3) => {
    let target = e3.target;
    if ($49c51c25361d4cd2$var$willOpenKeyboard(target) && target !== document.activeElement) {
      e3.preventDefault();
      target.style.transform = "translateY(-2000px)";
      target.focus();
      requestAnimationFrame(() => {
        target.style.transform = "";
      });
    }
  };
  let onFocus = (e3) => {
    let target = e3.target;
    if ($49c51c25361d4cd2$var$willOpenKeyboard(target)) {
      target.style.transform = "translateY(-2000px)";
      requestAnimationFrame(() => {
        target.style.transform = "";
        if ($49c51c25361d4cd2$var$visualViewport) {
          if ($49c51c25361d4cd2$var$visualViewport.height < window.innerHeight)
            requestAnimationFrame(() => {
              $49c51c25361d4cd2$var$scrollIntoView(target);
            });
          else
            $49c51c25361d4cd2$var$visualViewport.addEventListener("resize", () => $49c51c25361d4cd2$var$scrollIntoView(target), {
              once: true
            });
        }
      });
    }
  };
  let onWindowScroll = () => {
    window.scrollTo(0, 0);
  };
  let scrollX = window.pageXOffset;
  let scrollY = window.pageYOffset;
  let restoreStyles = (0, $ff5963eb1fccf552$export$e08e3b67e392101e)($49c51c25361d4cd2$var$setStyle(document.documentElement, "paddingRight", `${window.innerWidth - document.documentElement.clientWidth}px`), $49c51c25361d4cd2$var$setStyle(document.documentElement, "overflow", "hidden"), $49c51c25361d4cd2$var$setStyle(document.body, "marginTop", `-${scrollY}px`));
  window.scrollTo(0, 0);
  let removeEvents = (0, $ff5963eb1fccf552$export$e08e3b67e392101e)($49c51c25361d4cd2$var$addEvent(document, "touchstart", onTouchStart, {
    passive: false,
    capture: true
  }), $49c51c25361d4cd2$var$addEvent(document, "touchmove", onTouchMove, {
    passive: false,
    capture: true
  }), $49c51c25361d4cd2$var$addEvent(document, "touchend", onTouchEnd, {
    passive: false,
    capture: true
  }), $49c51c25361d4cd2$var$addEvent(document, "focus", onFocus, true), $49c51c25361d4cd2$var$addEvent(window, "scroll", onWindowScroll));
  return () => {
    restoreStyles();
    removeEvents();
    window.scrollTo(scrollX, scrollY);
  };
}
function $49c51c25361d4cd2$var$setStyle(element2, style, value) {
  let cur2 = element2.style[style];
  element2.style[style] = value;
  return () => {
    element2.style[style] = cur2;
  };
}
function $49c51c25361d4cd2$var$addEvent(target, event, handler, options) {
  target.addEventListener(event, handler, options);
  return () => {
    target.removeEventListener(event, handler, options);
  };
}
function $49c51c25361d4cd2$var$scrollIntoView(target) {
  let root2 = document.scrollingElement || document.documentElement;
  while (target && target !== root2) {
    let scrollable = (0, $62d8ded9296f3872$export$cfa2225e87938781)(target);
    if (scrollable !== document.documentElement && scrollable !== document.body && scrollable !== target) {
      let scrollableTop = scrollable.getBoundingClientRect().top;
      let targetTop = target.getBoundingClientRect().top;
      if (targetTop > scrollableTop + target.clientHeight)
        scrollable.scrollTop += targetTop - scrollableTop;
    }
    target = scrollable.parentElement;
  }
}
function $49c51c25361d4cd2$var$willOpenKeyboard(target) {
  return target instanceof HTMLInputElement && !$49c51c25361d4cd2$var$nonTextInputTypes.has(target.type) || target instanceof HTMLTextAreaElement || target instanceof HTMLElement && target.isContentEditable;
}
var $f57aed4a881a3485$var$Context = /* @__PURE__ */ (0, import_react9.default).createContext(null);
function $f57aed4a881a3485$export$178405afcd8c5eb(props) {
  let { children } = props;
  let parent = (0, import_react9.useContext)($f57aed4a881a3485$var$Context);
  let [modalCount, setModalCount] = (0, import_react9.useState)(0);
  let context2 = (0, import_react9.useMemo)(() => ({
    parent,
    modalCount,
    addModal() {
      setModalCount((count2) => count2 + 1);
      if (parent)
        parent.addModal();
    },
    removeModal() {
      setModalCount((count2) => count2 - 1);
      if (parent)
        parent.removeModal();
    }
  }), [
    parent,
    modalCount
  ]);
  return /* @__PURE__ */ (0, import_react9.default).createElement($f57aed4a881a3485$var$Context.Provider, {
    value: context2
  }, children);
}
function $f57aed4a881a3485$export$d9aaed4c3ece1bc0() {
  let context2 = (0, import_react9.useContext)($f57aed4a881a3485$var$Context);
  return {
    modalProviderProps: {
      "aria-hidden": context2 && context2.modalCount > 0 ? true : null
    }
  };
}
function $f57aed4a881a3485$var$OverlayContainerDOM(props) {
  let { modalProviderProps } = $f57aed4a881a3485$export$d9aaed4c3ece1bc0();
  return /* @__PURE__ */ (0, import_react9.default).createElement("div", {
    "data-overlay-container": true,
    ...props,
    ...modalProviderProps
  });
}
function $f57aed4a881a3485$export$bf688221f59024e5(props) {
  return /* @__PURE__ */ (0, import_react9.default).createElement($f57aed4a881a3485$export$178405afcd8c5eb, null, /* @__PURE__ */ (0, import_react9.default).createElement($f57aed4a881a3485$var$OverlayContainerDOM, props));
}
function $f57aed4a881a3485$export$33ffd74ebf07f060(options) {
  let context2 = (0, import_react9.useContext)($f57aed4a881a3485$var$Context);
  if (!context2)
    throw new Error("Modal is not contained within a provider");
  (0, import_react9.useEffect)(() => {
    if ((options === null || options === void 0 ? void 0 : options.isDisabled) || !context2 || !context2.parent)
      return;
    context2.parent.addModal();
    return () => {
      if (context2 && context2.parent)
        context2.parent.removeModal();
    };
  }, [
    context2,
    context2.parent,
    options === null || options === void 0 ? void 0 : options.isDisabled
  ]);
  return {
    modalProps: {
      "data-ismodal": !(options === null || options === void 0 ? void 0 : options.isDisabled)
    }
  };
}
var $a2f21f5f14f60553$exports = {};
var $773d5888b972f1cf$exports = {};
$773d5888b972f1cf$exports = {
  "dismiss": `\u062A\u062C\u0627\u0647\u0644`
};
var $d11f19852b941573$exports = {};
$d11f19852b941573$exports = {
  "dismiss": `\u041E\u0442\u0445\u0432\u044A\u0440\u043B\u044F\u043D\u0435`
};
var $b983974c2ee1efb3$exports = {};
$b983974c2ee1efb3$exports = {
  "dismiss": `Odstranit`
};
var $5809cc9d4e92de73$exports = {};
$5809cc9d4e92de73$exports = {
  "dismiss": `Luk`
};
var $c68c2e4fc74398d1$exports = {};
$c68c2e4fc74398d1$exports = {
  "dismiss": `Schlie\xDFen`
};
var $0898b4c153db2b77$exports = {};
$0898b4c153db2b77$exports = {
  "dismiss": `\u0391\u03C0\u03CC\u03C1\u03C1\u03B9\u03C8\u03B7`
};
var $6d74810286a15183$exports = {};
$6d74810286a15183$exports = {
  "dismiss": `Dismiss`
};
var $309d73dc65f78055$exports = {};
$309d73dc65f78055$exports = {
  "dismiss": `Descartar`
};
var $44ad94f7205cf593$exports = {};
$44ad94f7205cf593$exports = {
  "dismiss": `L\xF5peta`
};
var $7c28f5687f0779a9$exports = {};
$7c28f5687f0779a9$exports = {
  "dismiss": `Hylk\xE4\xE4`
};
var $e6d75df4b68bd73a$exports = {};
$e6d75df4b68bd73a$exports = {
  "dismiss": `Rejeter`
};
var $87505c9dab186d0f$exports = {};
$87505c9dab186d0f$exports = {
  "dismiss": `\u05D4\u05EA\u05E2\u05DC\u05DD`
};
var $553439c3ffb3e492$exports = {};
$553439c3ffb3e492$exports = {
  "dismiss": `Odbaci`
};
var $74cf411061b983a2$exports = {};
$74cf411061b983a2$exports = {
  "dismiss": `Elutas\xEDt\xE1s`
};
var $e933f298574dc435$exports = {};
$e933f298574dc435$exports = {
  "dismiss": `Ignora`
};
var $ac91fc9fe02f71f6$exports = {};
$ac91fc9fe02f71f6$exports = {
  "dismiss": `\u9589\u3058\u308B`
};
var $52b96f86422025af$exports = {};
$52b96f86422025af$exports = {
  "dismiss": `\uBB34\uC2DC`
};
var $c0d724c3e51dafa6$exports = {};
$c0d724c3e51dafa6$exports = {
  "dismiss": `Atmesti`
};
var $c92899672a3fe72e$exports = {};
$c92899672a3fe72e$exports = {
  "dismiss": `Ner\u0101d\u012Bt`
};
var $9f576b39d8e7a9d6$exports = {};
$9f576b39d8e7a9d6$exports = {
  "dismiss": `Lukk`
};
var $9d025808aeec81a7$exports = {};
$9d025808aeec81a7$exports = {
  "dismiss": `Negeren`
};
var $fce709921e2c0fa6$exports = {};
$fce709921e2c0fa6$exports = {
  "dismiss": `Zignoruj`
};
var $2599cf0c4ab37f59$exports = {};
$2599cf0c4ab37f59$exports = {
  "dismiss": `Descartar`
};
var $3c220ae7ef8a35fd$exports = {};
$3c220ae7ef8a35fd$exports = {
  "dismiss": `Dispensar`
};
var $93562b5094072f54$exports = {};
$93562b5094072f54$exports = {
  "dismiss": `Revocare`
};
var $cd9e2abd0d06c7b4$exports = {};
$cd9e2abd0d06c7b4$exports = {
  "dismiss": `\u041F\u0440\u043E\u043F\u0443\u0441\u0442\u0438\u0442\u044C`
};
var $45375701f409adf1$exports = {};
$45375701f409adf1$exports = {
  "dismiss": `Zru\u0161i\u0165`
};
var $27fab53a576de9dd$exports = {};
$27fab53a576de9dd$exports = {
  "dismiss": `Opusti`
};
var $4438748d9952e7c7$exports = {};
$4438748d9952e7c7$exports = {
  "dismiss": `Odbaci`
};
var $0936d7347ef4da4c$exports = {};
$0936d7347ef4da4c$exports = {
  "dismiss": `Avvisa`
};
var $29700c92185d38f8$exports = {};
$29700c92185d38f8$exports = {
  "dismiss": `Kapat`
};
var $662ccaf2be4c25b3$exports = {};
$662ccaf2be4c25b3$exports = {
  "dismiss": `\u0421\u043A\u0430\u0441\u0443\u0432\u0430\u0442\u0438`
};
var $d80a27deda7cdb3c$exports = {};
$d80a27deda7cdb3c$exports = {
  "dismiss": `\u53D6\u6D88`
};
var $2b2734393847c884$exports = {};
$2b2734393847c884$exports = {
  "dismiss": `\u95DC\u9589`
};
$a2f21f5f14f60553$exports = {
  "ar-AE": $773d5888b972f1cf$exports,
  "bg-BG": $d11f19852b941573$exports,
  "cs-CZ": $b983974c2ee1efb3$exports,
  "da-DK": $5809cc9d4e92de73$exports,
  "de-DE": $c68c2e4fc74398d1$exports,
  "el-GR": $0898b4c153db2b77$exports,
  "en-US": $6d74810286a15183$exports,
  "es-ES": $309d73dc65f78055$exports,
  "et-EE": $44ad94f7205cf593$exports,
  "fi-FI": $7c28f5687f0779a9$exports,
  "fr-FR": $e6d75df4b68bd73a$exports,
  "he-IL": $87505c9dab186d0f$exports,
  "hr-HR": $553439c3ffb3e492$exports,
  "hu-HU": $74cf411061b983a2$exports,
  "it-IT": $e933f298574dc435$exports,
  "ja-JP": $ac91fc9fe02f71f6$exports,
  "ko-KR": $52b96f86422025af$exports,
  "lt-LT": $c0d724c3e51dafa6$exports,
  "lv-LV": $c92899672a3fe72e$exports,
  "nb-NO": $9f576b39d8e7a9d6$exports,
  "nl-NL": $9d025808aeec81a7$exports,
  "pl-PL": $fce709921e2c0fa6$exports,
  "pt-BR": $2599cf0c4ab37f59$exports,
  "pt-PT": $3c220ae7ef8a35fd$exports,
  "ro-RO": $93562b5094072f54$exports,
  "ru-RU": $cd9e2abd0d06c7b4$exports,
  "sk-SK": $45375701f409adf1$exports,
  "sl-SI": $27fab53a576de9dd$exports,
  "sr-SP": $4438748d9952e7c7$exports,
  "sv-SE": $0936d7347ef4da4c$exports,
  "tr-TR": $29700c92185d38f8$exports,
  "uk-UA": $662ccaf2be4c25b3$exports,
  "zh-CN": $d80a27deda7cdb3c$exports,
  "zh-TW": $2b2734393847c884$exports
};
function $86ea4cb521eb2e37$export$2317d149ed6f78c4(props) {
  let { onDismiss, ...otherProps } = props;
  let stringFormatter = (0, $fca6afa0e843324b$export$f12b703ca79dfbb1)((0, /* @__PURE__ */ $parcel$interopDefault($a2f21f5f14f60553$exports)));
  let labels = (0, $313b98861ee5dd6c$export$d6875122194c7b44)(otherProps, stringFormatter.format("dismiss"));
  let onClick = () => {
    if (onDismiss)
      onDismiss();
  };
  return /* @__PURE__ */ (0, import_react9.default).createElement((0, $5c3e21d68f1c4674$export$439d29a4e110a164), null, /* @__PURE__ */ (0, import_react9.default).createElement("button", {
    ...labels,
    tabIndex: -1,
    onClick
  }));
}
var $337b884510726a0d$export$a2200b96afd16271 = /* @__PURE__ */ (0, import_react9.default).createContext(null);
function $337b884510726a0d$export$14c98a7594375490() {
  let ctx = (0, import_react9.useContext)($337b884510726a0d$export$a2200b96afd16271);
  let setContain = ctx === null || ctx === void 0 ? void 0 : ctx.setContain;
  (0, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(() => {
    setContain === null || setContain === void 0 ? void 0 : setContain(true);
  }, [
    setContain
  ]);
}

// node_modules/@arizeai/components/dist/components.esm.js
var import_react_dom5 = __toESM(require_react_dom());

// node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js
function _objectWithoutPropertiesLoose(source, excluded) {
  if (source == null)
    return {};
  var target = {};
  var sourceKeys = Object.keys(source);
  var key, i2;
  for (i2 = 0; i2 < sourceKeys.length; i2++) {
    key = sourceKeys[i2];
    if (excluded.indexOf(key) >= 0)
      continue;
    target[key] = source[key];
  }
  return target;
}

// node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js
function _setPrototypeOf(o, p) {
  _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf19(o2, p2) {
    o2.__proto__ = p2;
    return o2;
  };
  return _setPrototypeOf(o, p);
}

// node_modules/@babel/runtime/helpers/esm/inheritsLoose.js
function _inheritsLoose(subClass, superClass) {
  subClass.prototype = Object.create(superClass.prototype);
  subClass.prototype.constructor = subClass;
  _setPrototypeOf(subClass, superClass);
}

// node_modules/react-transition-group/esm/Transition.js
var import_prop_types2 = __toESM(require_prop_types());
var import_react11 = __toESM(require_react());
var import_react_dom2 = __toESM(require_react_dom());

// node_modules/react-transition-group/esm/config.js
var config_default = {
  disabled: false
};

// node_modules/react-transition-group/esm/utils/PropTypes.js
var import_prop_types = __toESM(require_prop_types());
var timeoutsShape = true ? import_prop_types.default.oneOfType([import_prop_types.default.number, import_prop_types.default.shape({
  enter: import_prop_types.default.number,
  exit: import_prop_types.default.number,
  appear: import_prop_types.default.number
}).isRequired]) : null;
var classNamesShape = true ? import_prop_types.default.oneOfType([import_prop_types.default.string, import_prop_types.default.shape({
  enter: import_prop_types.default.string,
  exit: import_prop_types.default.string,
  active: import_prop_types.default.string
}), import_prop_types.default.shape({
  enter: import_prop_types.default.string,
  enterDone: import_prop_types.default.string,
  enterActive: import_prop_types.default.string,
  exit: import_prop_types.default.string,
  exitDone: import_prop_types.default.string,
  exitActive: import_prop_types.default.string
})]) : null;

// node_modules/react-transition-group/esm/TransitionGroupContext.js
var import_react10 = __toESM(require_react());
var TransitionGroupContext_default = import_react10.default.createContext(null);

// node_modules/react-transition-group/esm/utils/reflow.js
var forceReflow = function forceReflow2(node56) {
  return node56.scrollTop;
};

// node_modules/react-transition-group/esm/Transition.js
var UNMOUNTED = "unmounted";
var EXITED = "exited";
var ENTERING = "entering";
var ENTERED = "entered";
var EXITING = "exiting";
var Transition = /* @__PURE__ */ function(_React$Component) {
  _inheritsLoose(Transition3, _React$Component);
  function Transition3(props, context2) {
    var _this;
    _this = _React$Component.call(this, props, context2) || this;
    var parentGroup = context2;
    var appear = parentGroup && !parentGroup.isMounting ? props.enter : props.appear;
    var initialStatus;
    _this.appearStatus = null;
    if (props.in) {
      if (appear) {
        initialStatus = EXITED;
        _this.appearStatus = ENTERING;
      } else {
        initialStatus = ENTERED;
      }
    } else {
      if (props.unmountOnExit || props.mountOnEnter) {
        initialStatus = UNMOUNTED;
      } else {
        initialStatus = EXITED;
      }
    }
    _this.state = {
      status: initialStatus
    };
    _this.nextCallback = null;
    return _this;
  }
  Transition3.getDerivedStateFromProps = function getDerivedStateFromProps(_ref18, prevState) {
    var nextIn = _ref18.in;
    if (nextIn && prevState.status === UNMOUNTED) {
      return {
        status: EXITED
      };
    }
    return null;
  };
  var _proto = Transition3.prototype;
  _proto.componentDidMount = function componentDidMount() {
    this.updateStatus(true, this.appearStatus);
  };
  _proto.componentDidUpdate = function componentDidUpdate(prevProps) {
    var nextStatus = null;
    if (prevProps !== this.props) {
      var status = this.state.status;
      if (this.props.in) {
        if (status !== ENTERING && status !== ENTERED) {
          nextStatus = ENTERING;
        }
      } else {
        if (status === ENTERING || status === ENTERED) {
          nextStatus = EXITING;
        }
      }
    }
    this.updateStatus(false, nextStatus);
  };
  _proto.componentWillUnmount = function componentWillUnmount() {
    this.cancelNextCallback();
  };
  _proto.getTimeouts = function getTimeouts() {
    var timeout2 = this.props.timeout;
    var exit, enter, appear;
    exit = enter = appear = timeout2;
    if (timeout2 != null && typeof timeout2 !== "number") {
      exit = timeout2.exit;
      enter = timeout2.enter;
      appear = timeout2.appear !== void 0 ? timeout2.appear : enter;
    }
    return {
      exit,
      enter,
      appear
    };
  };
  _proto.updateStatus = function updateStatus(mounting, nextStatus) {
    if (mounting === void 0) {
      mounting = false;
    }
    if (nextStatus !== null) {
      this.cancelNextCallback();
      if (nextStatus === ENTERING) {
        if (this.props.unmountOnExit || this.props.mountOnEnter) {
          var node56 = this.props.nodeRef ? this.props.nodeRef.current : import_react_dom2.default.findDOMNode(this);
          if (node56)
            forceReflow(node56);
        }
        this.performEnter(mounting);
      } else {
        this.performExit();
      }
    } else if (this.props.unmountOnExit && this.state.status === EXITED) {
      this.setState({
        status: UNMOUNTED
      });
    }
  };
  _proto.performEnter = function performEnter(mounting) {
    var _this2 = this;
    var enter = this.props.enter;
    var appearing = this.context ? this.context.isMounting : mounting;
    var _ref22 = this.props.nodeRef ? [appearing] : [import_react_dom2.default.findDOMNode(this), appearing], maybeNode = _ref22[0], maybeAppearing = _ref22[1];
    var timeouts = this.getTimeouts();
    var enterTimeout = appearing ? timeouts.appear : timeouts.enter;
    if (!mounting && !enter || config_default.disabled) {
      this.safeSetState({
        status: ENTERED
      }, function() {
        _this2.props.onEntered(maybeNode);
      });
      return;
    }
    this.props.onEnter(maybeNode, maybeAppearing);
    this.safeSetState({
      status: ENTERING
    }, function() {
      _this2.props.onEntering(maybeNode, maybeAppearing);
      _this2.onTransitionEnd(enterTimeout, function() {
        _this2.safeSetState({
          status: ENTERED
        }, function() {
          _this2.props.onEntered(maybeNode, maybeAppearing);
        });
      });
    });
  };
  _proto.performExit = function performExit() {
    var _this3 = this;
    var exit = this.props.exit;
    var timeouts = this.getTimeouts();
    var maybeNode = this.props.nodeRef ? void 0 : import_react_dom2.default.findDOMNode(this);
    if (!exit || config_default.disabled) {
      this.safeSetState({
        status: EXITED
      }, function() {
        _this3.props.onExited(maybeNode);
      });
      return;
    }
    this.props.onExit(maybeNode);
    this.safeSetState({
      status: EXITING
    }, function() {
      _this3.props.onExiting(maybeNode);
      _this3.onTransitionEnd(timeouts.exit, function() {
        _this3.safeSetState({
          status: EXITED
        }, function() {
          _this3.props.onExited(maybeNode);
        });
      });
    });
  };
  _proto.cancelNextCallback = function cancelNextCallback() {
    if (this.nextCallback !== null) {
      this.nextCallback.cancel();
      this.nextCallback = null;
    }
  };
  _proto.safeSetState = function safeSetState(nextState, callback) {
    callback = this.setNextCallback(callback);
    this.setState(nextState, callback);
  };
  _proto.setNextCallback = function setNextCallback(callback) {
    var _this4 = this;
    var active = true;
    this.nextCallback = function(event) {
      if (active) {
        active = false;
        _this4.nextCallback = null;
        callback(event);
      }
    };
    this.nextCallback.cancel = function() {
      active = false;
    };
    return this.nextCallback;
  };
  _proto.onTransitionEnd = function onTransitionEnd(timeout2, handler) {
    this.setNextCallback(handler);
    var node56 = this.props.nodeRef ? this.props.nodeRef.current : import_react_dom2.default.findDOMNode(this);
    var doesNotHaveTimeoutOrListener = timeout2 == null && !this.props.addEndListener;
    if (!node56 || doesNotHaveTimeoutOrListener) {
      setTimeout(this.nextCallback, 0);
      return;
    }
    if (this.props.addEndListener) {
      var _ref32 = this.props.nodeRef ? [this.nextCallback] : [node56, this.nextCallback], maybeNode = _ref32[0], maybeNextCallback = _ref32[1];
      this.props.addEndListener(maybeNode, maybeNextCallback);
    }
    if (timeout2 != null) {
      setTimeout(this.nextCallback, timeout2);
    }
  };
  _proto.render = function render2() {
    var status = this.state.status;
    if (status === UNMOUNTED) {
      return null;
    }
    var _this$props = this.props, children = _this$props.children, _in = _this$props.in, _mountOnEnter = _this$props.mountOnEnter, _unmountOnExit = _this$props.unmountOnExit, _appear = _this$props.appear, _enter = _this$props.enter, _exit = _this$props.exit, _timeout = _this$props.timeout, _addEndListener = _this$props.addEndListener, _onEnter = _this$props.onEnter, _onEntering = _this$props.onEntering, _onEntered = _this$props.onEntered, _onExit = _this$props.onExit, _onExiting = _this$props.onExiting, _onExited = _this$props.onExited, _nodeRef = _this$props.nodeRef, childProps = _objectWithoutPropertiesLoose(_this$props, ["children", "in", "mountOnEnter", "unmountOnExit", "appear", "enter", "exit", "timeout", "addEndListener", "onEnter", "onEntering", "onEntered", "onExit", "onExiting", "onExited", "nodeRef"]);
    return (
      // allows for nested Transitions
      /* @__PURE__ */ import_react11.default.createElement(TransitionGroupContext_default.Provider, {
        value: null
      }, typeof children === "function" ? children(status, childProps) : import_react11.default.cloneElement(import_react11.default.Children.only(children), childProps))
    );
  };
  return Transition3;
}(import_react11.default.Component);
Transition.contextType = TransitionGroupContext_default;
Transition.propTypes = true ? {
  /**
   * A React reference to DOM element that need to transition:
   * https://stackoverflow.com/a/51127130/4671932
   *
   *   - When `nodeRef` prop is used, `node` is not passed to callback functions
   *      (e.g. `onEnter`) because user already has direct access to the node.
   *   - When changing `key` prop of `Transition` in a `TransitionGroup` a new
   *     `nodeRef` need to be provided to `Transition` with changed `key` prop
   *     (see
   *     [test/CSSTransition-test.js](https://github.com/reactjs/react-transition-group/blob/13435f897b3ab71f6e19d724f145596f5910581c/test/CSSTransition-test.js#L362-L437)).
   */
  nodeRef: import_prop_types2.default.shape({
    current: typeof Element === "undefined" ? import_prop_types2.default.any : function(propValue, key, componentName, location2, propFullName, secret) {
      var value = propValue[key];
      return import_prop_types2.default.instanceOf(value && "ownerDocument" in value ? value.ownerDocument.defaultView.Element : Element)(propValue, key, componentName, location2, propFullName, secret);
    }
  }),
  /**
   * A `function` child can be used instead of a React element. This function is
   * called with the current transition status (`'entering'`, `'entered'`,
   * `'exiting'`, `'exited'`), which can be used to apply context
   * specific props to a component.
   *
   * ```jsx
   * <Transition in={this.state.in} timeout={150}>
   *   {state => (
   *     <MyComponent className={`fade fade-${state}`} />
   *   )}
   * </Transition>
   * ```
   */
  children: import_prop_types2.default.oneOfType([import_prop_types2.default.func.isRequired, import_prop_types2.default.element.isRequired]).isRequired,
  /**
   * Show the component; triggers the enter or exit states
   */
  in: import_prop_types2.default.bool,
  /**
   * By default the child component is mounted immediately along with
   * the parent `Transition` component. If you want to "lazy mount" the component on the
   * first `in={true}` you can set `mountOnEnter`. After the first enter transition the component will stay
   * mounted, even on "exited", unless you also specify `unmountOnExit`.
   */
  mountOnEnter: import_prop_types2.default.bool,
  /**
   * By default the child component stays mounted after it reaches the `'exited'` state.
   * Set `unmountOnExit` if you'd prefer to unmount the component after it finishes exiting.
   */
  unmountOnExit: import_prop_types2.default.bool,
  /**
   * By default the child component does not perform the enter transition when
   * it first mounts, regardless of the value of `in`. If you want this
   * behavior, set both `appear` and `in` to `true`.
   *
   * > **Note**: there are no special appear states like `appearing`/`appeared`, this prop
   * > only adds an additional enter transition. However, in the
   * > `<CSSTransition>` component that first enter transition does result in
   * > additional `.appear-*` classes, that way you can choose to style it
   * > differently.
   */
  appear: import_prop_types2.default.bool,
  /**
   * Enable or disable enter transitions.
   */
  enter: import_prop_types2.default.bool,
  /**
   * Enable or disable exit transitions.
   */
  exit: import_prop_types2.default.bool,
  /**
   * The duration of the transition, in milliseconds.
   * Required unless `addEndListener` is provided.
   *
   * You may specify a single timeout for all transitions:
   *
   * ```jsx
   * timeout={500}
   * ```
   *
   * or individually:
   *
   * ```jsx
   * timeout={{
   *  appear: 500,
   *  enter: 300,
   *  exit: 500,
   * }}
   * ```
   *
   * - `appear` defaults to the value of `enter`
   * - `enter` defaults to `0`
   * - `exit` defaults to `0`
   *
   * @type {number | { enter?: number, exit?: number, appear?: number }}
   */
  timeout: function timeout(props) {
    var pt = timeoutsShape;
    if (!props.addEndListener)
      pt = pt.isRequired;
    for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
      args[_key - 1] = arguments[_key];
    }
    return pt.apply(void 0, [props].concat(args));
  },
  /**
   * Add a custom transition end trigger. Called with the transitioning
   * DOM node and a `done` callback. Allows for more fine grained transition end
   * logic. Timeouts are still used as a fallback if provided.
   *
   * **Note**: when `nodeRef` prop is passed, `node` is not passed.
   *
   * ```jsx
   * addEndListener={(node, done) => {
   *   // use the css transitionend event to mark the finish of a transition
   *   node.addEventListener('transitionend', done, false);
   * }}
   * ```
   */
  addEndListener: import_prop_types2.default.func,
  /**
   * Callback fired before the "entering" status is applied. An extra parameter
   * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount
   *
   * **Note**: when `nodeRef` prop is passed, `node` is not passed.
   *
   * @type Function(node: HtmlElement, isAppearing: bool) -> void
   */
  onEnter: import_prop_types2.default.func,
  /**
   * Callback fired after the "entering" status is applied. An extra parameter
   * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount
   *
   * **Note**: when `nodeRef` prop is passed, `node` is not passed.
   *
   * @type Function(node: HtmlElement, isAppearing: bool)
   */
  onEntering: import_prop_types2.default.func,
  /**
   * Callback fired after the "entered" status is applied. An extra parameter
   * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount
   *
   * **Note**: when `nodeRef` prop is passed, `node` is not passed.
   *
   * @type Function(node: HtmlElement, isAppearing: bool) -> void
   */
  onEntered: import_prop_types2.default.func,
  /**
   * Callback fired before the "exiting" status is applied.
   *
   * **Note**: when `nodeRef` prop is passed, `node` is not passed.
   *
   * @type Function(node: HtmlElement) -> void
   */
  onExit: import_prop_types2.default.func,
  /**
   * Callback fired after the "exiting" status is applied.
   *
   * **Note**: when `nodeRef` prop is passed, `node` is not passed.
   *
   * @type Function(node: HtmlElement) -> void
   */
  onExiting: import_prop_types2.default.func,
  /**
   * Callback fired after the "exited" status is applied.
   *
   * **Note**: when `nodeRef` prop is passed, `node` is not passed
   *
   * @type Function(node: HtmlElement) -> void
   */
  onExited: import_prop_types2.default.func
} : {};
function noop() {
}
Transition.defaultProps = {
  in: false,
  mountOnEnter: false,
  unmountOnExit: false,
  appear: false,
  enter: true,
  exit: true,
  onEnter: noop,
  onEntering: noop,
  onEntered: noop,
  onExit: noop,
  onExiting: noop,
  onExited: noop
};
Transition.UNMOUNTED = UNMOUNTED;
Transition.EXITED = EXITED;
Transition.ENTERING = ENTERING;
Transition.ENTERED = ENTERED;
Transition.EXITING = EXITING;
var Transition_default = Transition;

// node_modules/@react-aria/dialog/dist/import.mjs
var import_react12 = __toESM(require_react(), 1);
function $40df3f8667284809$export$d55e7ee900f34e93(props, ref) {
  let { role = "dialog" } = props;
  let titleId = (0, $bdb11010cef70236$export$b4cc09c592e8fdb8)();
  titleId = props["aria-label"] ? void 0 : titleId;
  let isRefocusing = (0, import_react12.useRef)(false);
  (0, import_react12.useEffect)(() => {
    if (ref.current && !ref.current.contains(document.activeElement)) {
      (0, $6a99195332edec8b$export$80f3e147d781571c)(ref.current);
      let timeout2 = setTimeout(() => {
        if (document.activeElement === ref.current) {
          isRefocusing.current = true;
          ref.current.blur();
          (0, $6a99195332edec8b$export$80f3e147d781571c)(ref.current);
          isRefocusing.current = false;
        }
      }, 500);
      return () => {
        clearTimeout(timeout2);
      };
    }
  }, [
    ref
  ]);
  (0, $337b884510726a0d$export$14c98a7594375490)();
  return {
    dialogProps: {
      ...(0, $65484d02dcb7eb3e$export$457c3d6518dd4c6f)(props, {
        labelable: true
      }),
      role,
      tabIndex: -1,
      "aria-labelledby": props["aria-labelledby"] || titleId,
      // Prevent blur events from reaching useOverlay, which may cause
      // popovers to close. Since focus is contained within the dialog,
      // we don't want this to occur due to the above useEffect.
      onBlur: (e3) => {
        if (isRefocusing.current)
          e3.stopPropagation();
      }
    },
    titleProps: {
      id: titleId
    }
  };
}

// node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js
function _assertThisInitialized(self2) {
  if (self2 === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }
  return self2;
}

// node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js
function _getPrototypeOf(o) {
  _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf18(o2) {
    return o2.__proto__ || Object.getPrototypeOf(o2);
  };
  return _getPrototypeOf(o);
}

// node_modules/@babel/runtime/helpers/esm/isNativeFunction.js
function _isNativeFunction(fn) {
  try {
    return Function.toString.call(fn).indexOf("[native code]") !== -1;
  } catch (e3) {
    return typeof fn === "function";
  }
}

// node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js
function _isNativeReflectConstruct() {
  if (typeof Reflect === "undefined" || !Reflect.construct)
    return false;
  if (Reflect.construct.sham)
    return false;
  if (typeof Proxy === "function")
    return true;
  try {
    Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
    return true;
  } catch (e3) {
    return false;
  }
}

// node_modules/@babel/runtime/helpers/esm/construct.js
function _construct(Parent, args, Class) {
  if (_isNativeReflectConstruct()) {
    _construct = Reflect.construct.bind();
  } else {
    _construct = function _construct2(Parent2, args2, Class2) {
      var a2 = [null];
      a2.push.apply(a2, args2);
      var Constructor = Function.bind.apply(Parent2, a2);
      var instance = new Constructor();
      if (Class2)
        _setPrototypeOf(instance, Class2.prototype);
      return instance;
    };
  }
  return _construct.apply(null, arguments);
}

// node_modules/@babel/runtime/helpers/esm/wrapNativeSuper.js
function _wrapNativeSuper(Class) {
  var _cache = typeof Map === "function" ? /* @__PURE__ */ new Map() : void 0;
  _wrapNativeSuper = function _wrapNativeSuper2(Class2) {
    if (Class2 === null || !_isNativeFunction(Class2))
      return Class2;
    if (typeof Class2 !== "function") {
      throw new TypeError("Super expression must either be null or a function");
    }
    if (typeof _cache !== "undefined") {
      if (_cache.has(Class2))
        return _cache.get(Class2);
      _cache.set(Class2, Wrapper);
    }
    function Wrapper() {
      return _construct(Class2, arguments, _getPrototypeOf(this).constructor);
    }
    Wrapper.prototype = Object.create(Class2.prototype, {
      constructor: {
        value: Wrapper,
        enumerable: false,
        writable: true,
        configurable: true
      }
    });
    return _setPrototypeOf(Wrapper, Class2);
  };
  return _wrapNativeSuper(Class);
}

// node_modules/polished/dist/polished.esm.js
var ERRORS = {
  "1": "Passed invalid arguments to hsl, please pass multiple numbers e.g. hsl(360, 0.75, 0.4) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75 }).\n\n",
  "2": "Passed invalid arguments to hsla, please pass multiple numbers e.g. hsla(360, 0.75, 0.4, 0.7) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75, alpha: 0.7 }).\n\n",
  "3": "Passed an incorrect argument to a color function, please pass a string representation of a color.\n\n",
  "4": "Couldn't generate valid rgb string from %s, it returned %s.\n\n",
  "5": "Couldn't parse the color string. Please provide the color as a string in hex, rgb, rgba, hsl or hsla notation.\n\n",
  "6": "Passed invalid arguments to rgb, please pass multiple numbers e.g. rgb(255, 205, 100) or an object e.g. rgb({ red: 255, green: 205, blue: 100 }).\n\n",
  "7": "Passed invalid arguments to rgba, please pass multiple numbers e.g. rgb(255, 205, 100, 0.75) or an object e.g. rgb({ red: 255, green: 205, blue: 100, alpha: 0.75 }).\n\n",
  "8": "Passed invalid argument to toColorString, please pass a RgbColor, RgbaColor, HslColor or HslaColor object.\n\n",
  "9": "Please provide a number of steps to the modularScale helper.\n\n",
  "10": "Please pass a number or one of the predefined scales to the modularScale helper as the ratio.\n\n",
  "11": 'Invalid value passed as base to modularScale, expected number or em string but got "%s"\n\n',
  "12": 'Expected a string ending in "px" or a number passed as the first argument to %s(), got "%s" instead.\n\n',
  "13": 'Expected a string ending in "px" or a number passed as the second argument to %s(), got "%s" instead.\n\n',
  "14": 'Passed invalid pixel value ("%s") to %s(), please pass a value like "12px" or 12.\n\n',
  "15": 'Passed invalid base value ("%s") to %s(), please pass a value like "12px" or 12.\n\n',
  "16": "You must provide a template to this method.\n\n",
  "17": "You passed an unsupported selector state to this method.\n\n",
  "18": "minScreen and maxScreen must be provided as stringified numbers with the same units.\n\n",
  "19": "fromSize and toSize must be provided as stringified numbers with the same units.\n\n",
  "20": "expects either an array of objects or a single object with the properties prop, fromSize, and toSize.\n\n",
  "21": "expects the objects in the first argument array to have the properties `prop`, `fromSize`, and `toSize`.\n\n",
  "22": "expects the first argument object to have the properties `prop`, `fromSize`, and `toSize`.\n\n",
  "23": "fontFace expects a name of a font-family.\n\n",
  "24": "fontFace expects either the path to the font file(s) or a name of a local copy.\n\n",
  "25": "fontFace expects localFonts to be an array.\n\n",
  "26": "fontFace expects fileFormats to be an array.\n\n",
  "27": "radialGradient requries at least 2 color-stops to properly render.\n\n",
  "28": "Please supply a filename to retinaImage() as the first argument.\n\n",
  "29": "Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.\n\n",
  "30": "Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",
  "31": "The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation\n\n",
  "32": "To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\nTo pass a single animation please supply them in simple values, e.g. animation('rotate', '2s')\n\n",
  "33": "The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation\n\n",
  "34": "borderRadius expects a radius value as a string or number as the second argument.\n\n",
  "35": 'borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.\n\n',
  "36": "Property must be a string value.\n\n",
  "37": "Syntax Error at %s.\n\n",
  "38": "Formula contains a function that needs parentheses at %s.\n\n",
  "39": "Formula is missing closing parenthesis at %s.\n\n",
  "40": "Formula has too many closing parentheses at %s.\n\n",
  "41": "All values in a formula must have the same unit or be unitless.\n\n",
  "42": "Please provide a number of steps to the modularScale helper.\n\n",
  "43": "Please pass a number or one of the predefined scales to the modularScale helper as the ratio.\n\n",
  "44": "Invalid value passed as base to modularScale, expected number or em/rem string but got %s.\n\n",
  "45": "Passed invalid argument to hslToColorString, please pass a HslColor or HslaColor object.\n\n",
  "46": "Passed invalid argument to rgbToColorString, please pass a RgbColor or RgbaColor object.\n\n",
  "47": "minScreen and maxScreen must be provided as stringified numbers with the same units.\n\n",
  "48": "fromSize and toSize must be provided as stringified numbers with the same units.\n\n",
  "49": "Expects either an array of objects or a single object with the properties prop, fromSize, and toSize.\n\n",
  "50": "Expects the objects in the first argument array to have the properties prop, fromSize, and toSize.\n\n",
  "51": "Expects the first argument object to have the properties prop, fromSize, and toSize.\n\n",
  "52": "fontFace expects either the path to the font file(s) or a name of a local copy.\n\n",
  "53": "fontFace expects localFonts to be an array.\n\n",
  "54": "fontFace expects fileFormats to be an array.\n\n",
  "55": "fontFace expects a name of a font-family.\n\n",
  "56": "linearGradient requries at least 2 color-stops to properly render.\n\n",
  "57": "radialGradient requries at least 2 color-stops to properly render.\n\n",
  "58": "Please supply a filename to retinaImage() as the first argument.\n\n",
  "59": "Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.\n\n",
  "60": "Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",
  "61": "Property must be a string value.\n\n",
  "62": "borderRadius expects a radius value as a string or number as the second argument.\n\n",
  "63": 'borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.\n\n',
  "64": "The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation.\n\n",
  "65": "To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\\nTo pass a single animation please supply them in simple values, e.g. animation('rotate', '2s').\n\n",
  "66": "The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation.\n\n",
  "67": "You must provide a template to this method.\n\n",
  "68": "You passed an unsupported selector state to this method.\n\n",
  "69": 'Expected a string ending in "px" or a number passed as the first argument to %s(), got %s instead.\n\n',
  "70": 'Expected a string ending in "px" or a number passed as the second argument to %s(), got %s instead.\n\n',
  "71": 'Passed invalid pixel value %s to %s(), please pass a value like "12px" or 12.\n\n',
  "72": 'Passed invalid base value %s to %s(), please pass a value like "12px" or 12.\n\n',
  "73": "Please provide a valid CSS variable.\n\n",
  "74": "CSS variable not found and no default was provided.\n\n",
  "75": "important requires a valid style object, got a %s instead.\n\n",
  "76": "fromSize and toSize must be provided as stringified numbers with the same units as minScreen and maxScreen.\n\n",
  "77": 'remToPx expects a value in "rem" but you provided it in "%s".\n\n',
  "78": 'base must be set in "px" or "%" but you set it in "%s".\n'
};
function format() {
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
    args[_key] = arguments[_key];
  }
  var a2 = args[0];
  var b = [];
  var c4;
  for (c4 = 1; c4 < args.length; c4 += 1) {
    b.push(args[c4]);
  }
  b.forEach(function(d) {
    a2 = a2.replace(/%[a-z]/, d);
  });
  return a2;
}
var PolishedError = /* @__PURE__ */ function(_Error) {
  _inheritsLoose(PolishedError2, _Error);
  function PolishedError2(code) {
    var _this;
    if (false) {
      _this = _Error.call(this, "An error occurred. See https://github.com/styled-components/polished/blob/main/src/internalHelpers/errors.md#" + code + " for more information.") || this;
    } else {
      for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
        args[_key2 - 1] = arguments[_key2];
      }
      _this = _Error.call(this, format.apply(void 0, [ERRORS[code]].concat(args))) || this;
    }
    return _assertThisInitialized(_this);
  }
  return PolishedError2;
}(/* @__PURE__ */ _wrapNativeSuper(Error));
function colorToInt(color2) {
  return Math.round(color2 * 255);
}
function convertToInt(red, green, blue) {
  return colorToInt(red) + "," + colorToInt(green) + "," + colorToInt(blue);
}
function hslToRgb(hue2, saturation, lightness, convert) {
  if (convert === void 0) {
    convert = convertToInt;
  }
  if (saturation === 0) {
    return convert(lightness, lightness, lightness);
  }
  var huePrime = (hue2 % 360 + 360) % 360 / 60;
  var chroma = (1 - Math.abs(2 * lightness - 1)) * saturation;
  var secondComponent = chroma * (1 - Math.abs(huePrime % 2 - 1));
  var red = 0;
  var green = 0;
  var blue = 0;
  if (huePrime >= 0 && huePrime < 1) {
    red = chroma;
    green = secondComponent;
  } else if (huePrime >= 1 && huePrime < 2) {
    red = secondComponent;
    green = chroma;
  } else if (huePrime >= 2 && huePrime < 3) {
    green = chroma;
    blue = secondComponent;
  } else if (huePrime >= 3 && huePrime < 4) {
    green = secondComponent;
    blue = chroma;
  } else if (huePrime >= 4 && huePrime < 5) {
    red = secondComponent;
    blue = chroma;
  } else if (huePrime >= 5 && huePrime < 6) {
    red = chroma;
    blue = secondComponent;
  }
  var lightnessModification = lightness - chroma / 2;
  var finalRed = red + lightnessModification;
  var finalGreen = green + lightnessModification;
  var finalBlue = blue + lightnessModification;
  return convert(finalRed, finalGreen, finalBlue);
}
var namedColorMap = {
  aliceblue: "f0f8ff",
  antiquewhite: "faebd7",
  aqua: "00ffff",
  aquamarine: "7fffd4",
  azure: "f0ffff",
  beige: "f5f5dc",
  bisque: "ffe4c4",
  black: "000",
  blanchedalmond: "ffebcd",
  blue: "0000ff",
  blueviolet: "8a2be2",
  brown: "a52a2a",
  burlywood: "deb887",
  cadetblue: "5f9ea0",
  chartreuse: "7fff00",
  chocolate: "d2691e",
  coral: "ff7f50",
  cornflowerblue: "6495ed",
  cornsilk: "fff8dc",
  crimson: "dc143c",
  cyan: "00ffff",
  darkblue: "00008b",
  darkcyan: "008b8b",
  darkgoldenrod: "b8860b",
  darkgray: "a9a9a9",
  darkgreen: "006400",
  darkgrey: "a9a9a9",
  darkkhaki: "bdb76b",
  darkmagenta: "8b008b",
  darkolivegreen: "556b2f",
  darkorange: "ff8c00",
  darkorchid: "9932cc",
  darkred: "8b0000",
  darksalmon: "e9967a",
  darkseagreen: "8fbc8f",
  darkslateblue: "483d8b",
  darkslategray: "2f4f4f",
  darkslategrey: "2f4f4f",
  darkturquoise: "00ced1",
  darkviolet: "9400d3",
  deeppink: "ff1493",
  deepskyblue: "00bfff",
  dimgray: "696969",
  dimgrey: "696969",
  dodgerblue: "1e90ff",
  firebrick: "b22222",
  floralwhite: "fffaf0",
  forestgreen: "228b22",
  fuchsia: "ff00ff",
  gainsboro: "dcdcdc",
  ghostwhite: "f8f8ff",
  gold: "ffd700",
  goldenrod: "daa520",
  gray: "808080",
  green: "008000",
  greenyellow: "adff2f",
  grey: "808080",
  honeydew: "f0fff0",
  hotpink: "ff69b4",
  indianred: "cd5c5c",
  indigo: "4b0082",
  ivory: "fffff0",
  khaki: "f0e68c",
  lavender: "e6e6fa",
  lavenderblush: "fff0f5",
  lawngreen: "7cfc00",
  lemonchiffon: "fffacd",
  lightblue: "add8e6",
  lightcoral: "f08080",
  lightcyan: "e0ffff",
  lightgoldenrodyellow: "fafad2",
  lightgray: "d3d3d3",
  lightgreen: "90ee90",
  lightgrey: "d3d3d3",
  lightpink: "ffb6c1",
  lightsalmon: "ffa07a",
  lightseagreen: "20b2aa",
  lightskyblue: "87cefa",
  lightslategray: "789",
  lightslategrey: "789",
  lightsteelblue: "b0c4de",
  lightyellow: "ffffe0",
  lime: "0f0",
  limegreen: "32cd32",
  linen: "faf0e6",
  magenta: "f0f",
  maroon: "800000",
  mediumaquamarine: "66cdaa",
  mediumblue: "0000cd",
  mediumorchid: "ba55d3",
  mediumpurple: "9370db",
  mediumseagreen: "3cb371",
  mediumslateblue: "7b68ee",
  mediumspringgreen: "00fa9a",
  mediumturquoise: "48d1cc",
  mediumvioletred: "c71585",
  midnightblue: "191970",
  mintcream: "f5fffa",
  mistyrose: "ffe4e1",
  moccasin: "ffe4b5",
  navajowhite: "ffdead",
  navy: "000080",
  oldlace: "fdf5e6",
  olive: "808000",
  olivedrab: "6b8e23",
  orange: "ffa500",
  orangered: "ff4500",
  orchid: "da70d6",
  palegoldenrod: "eee8aa",
  palegreen: "98fb98",
  paleturquoise: "afeeee",
  palevioletred: "db7093",
  papayawhip: "ffefd5",
  peachpuff: "ffdab9",
  peru: "cd853f",
  pink: "ffc0cb",
  plum: "dda0dd",
  powderblue: "b0e0e6",
  purple: "800080",
  rebeccapurple: "639",
  red: "f00",
  rosybrown: "bc8f8f",
  royalblue: "4169e1",
  saddlebrown: "8b4513",
  salmon: "fa8072",
  sandybrown: "f4a460",
  seagreen: "2e8b57",
  seashell: "fff5ee",
  sienna: "a0522d",
  silver: "c0c0c0",
  skyblue: "87ceeb",
  slateblue: "6a5acd",
  slategray: "708090",
  slategrey: "708090",
  snow: "fffafa",
  springgreen: "00ff7f",
  steelblue: "4682b4",
  tan: "d2b48c",
  teal: "008080",
  thistle: "d8bfd8",
  tomato: "ff6347",
  turquoise: "40e0d0",
  violet: "ee82ee",
  wheat: "f5deb3",
  white: "fff",
  whitesmoke: "f5f5f5",
  yellow: "ff0",
  yellowgreen: "9acd32"
};
function nameToHex(color2) {
  if (typeof color2 !== "string")
    return color2;
  var normalizedColorName = color2.toLowerCase();
  return namedColorMap[normalizedColorName] ? "#" + namedColorMap[normalizedColorName] : color2;
}
var hexRegex = /^#[a-fA-F0-9]{6}$/;
var hexRgbaRegex = /^#[a-fA-F0-9]{8}$/;
var reducedHexRegex = /^#[a-fA-F0-9]{3}$/;
var reducedRgbaHexRegex = /^#[a-fA-F0-9]{4}$/;
var rgbRegex = /^rgb\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*\)$/i;
var rgbaRegex = /^rgb(?:a)?\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i;
var hslRegex = /^hsl\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*\)$/i;
var hslaRegex = /^hsl(?:a)?\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i;
function parseToRgb(color2) {
  if (typeof color2 !== "string") {
    throw new PolishedError(3);
  }
  var normalizedColor = nameToHex(color2);
  if (normalizedColor.match(hexRegex)) {
    return {
      red: parseInt("" + normalizedColor[1] + normalizedColor[2], 16),
      green: parseInt("" + normalizedColor[3] + normalizedColor[4], 16),
      blue: parseInt("" + normalizedColor[5] + normalizedColor[6], 16)
    };
  }
  if (normalizedColor.match(hexRgbaRegex)) {
    var alpha3 = parseFloat((parseInt("" + normalizedColor[7] + normalizedColor[8], 16) / 255).toFixed(2));
    return {
      red: parseInt("" + normalizedColor[1] + normalizedColor[2], 16),
      green: parseInt("" + normalizedColor[3] + normalizedColor[4], 16),
      blue: parseInt("" + normalizedColor[5] + normalizedColor[6], 16),
      alpha: alpha3
    };
  }
  if (normalizedColor.match(reducedHexRegex)) {
    return {
      red: parseInt("" + normalizedColor[1] + normalizedColor[1], 16),
      green: parseInt("" + normalizedColor[2] + normalizedColor[2], 16),
      blue: parseInt("" + normalizedColor[3] + normalizedColor[3], 16)
    };
  }
  if (normalizedColor.match(reducedRgbaHexRegex)) {
    var _alpha = parseFloat((parseInt("" + normalizedColor[4] + normalizedColor[4], 16) / 255).toFixed(2));
    return {
      red: parseInt("" + normalizedColor[1] + normalizedColor[1], 16),
      green: parseInt("" + normalizedColor[2] + normalizedColor[2], 16),
      blue: parseInt("" + normalizedColor[3] + normalizedColor[3], 16),
      alpha: _alpha
    };
  }
  var rgbMatched = rgbRegex.exec(normalizedColor);
  if (rgbMatched) {
    return {
      red: parseInt("" + rgbMatched[1], 10),
      green: parseInt("" + rgbMatched[2], 10),
      blue: parseInt("" + rgbMatched[3], 10)
    };
  }
  var rgbaMatched = rgbaRegex.exec(normalizedColor.substring(0, 50));
  if (rgbaMatched) {
    return {
      red: parseInt("" + rgbaMatched[1], 10),
      green: parseInt("" + rgbaMatched[2], 10),
      blue: parseInt("" + rgbaMatched[3], 10),
      alpha: parseFloat("" + rgbaMatched[4]) > 1 ? parseFloat("" + rgbaMatched[4]) / 100 : parseFloat("" + rgbaMatched[4])
    };
  }
  var hslMatched = hslRegex.exec(normalizedColor);
  if (hslMatched) {
    var hue2 = parseInt("" + hslMatched[1], 10);
    var saturation = parseInt("" + hslMatched[2], 10) / 100;
    var lightness = parseInt("" + hslMatched[3], 10) / 100;
    var rgbColorString = "rgb(" + hslToRgb(hue2, saturation, lightness) + ")";
    var hslRgbMatched = rgbRegex.exec(rgbColorString);
    if (!hslRgbMatched) {
      throw new PolishedError(4, normalizedColor, rgbColorString);
    }
    return {
      red: parseInt("" + hslRgbMatched[1], 10),
      green: parseInt("" + hslRgbMatched[2], 10),
      blue: parseInt("" + hslRgbMatched[3], 10)
    };
  }
  var hslaMatched = hslaRegex.exec(normalizedColor.substring(0, 50));
  if (hslaMatched) {
    var _hue = parseInt("" + hslaMatched[1], 10);
    var _saturation = parseInt("" + hslaMatched[2], 10) / 100;
    var _lightness = parseInt("" + hslaMatched[3], 10) / 100;
    var _rgbColorString = "rgb(" + hslToRgb(_hue, _saturation, _lightness) + ")";
    var _hslRgbMatched = rgbRegex.exec(_rgbColorString);
    if (!_hslRgbMatched) {
      throw new PolishedError(4, normalizedColor, _rgbColorString);
    }
    return {
      red: parseInt("" + _hslRgbMatched[1], 10),
      green: parseInt("" + _hslRgbMatched[2], 10),
      blue: parseInt("" + _hslRgbMatched[3], 10),
      alpha: parseFloat("" + hslaMatched[4]) > 1 ? parseFloat("" + hslaMatched[4]) / 100 : parseFloat("" + hslaMatched[4])
    };
  }
  throw new PolishedError(5);
}
function rgbToHsl(color2) {
  var red = color2.red / 255;
  var green = color2.green / 255;
  var blue = color2.blue / 255;
  var max3 = Math.max(red, green, blue);
  var min3 = Math.min(red, green, blue);
  var lightness = (max3 + min3) / 2;
  if (max3 === min3) {
    if (color2.alpha !== void 0) {
      return {
        hue: 0,
        saturation: 0,
        lightness,
        alpha: color2.alpha
      };
    } else {
      return {
        hue: 0,
        saturation: 0,
        lightness
      };
    }
  }
  var hue2;
  var delta = max3 - min3;
  var saturation = lightness > 0.5 ? delta / (2 - max3 - min3) : delta / (max3 + min3);
  switch (max3) {
    case red:
      hue2 = (green - blue) / delta + (green < blue ? 6 : 0);
      break;
    case green:
      hue2 = (blue - red) / delta + 2;
      break;
    default:
      hue2 = (red - green) / delta + 4;
      break;
  }
  hue2 *= 60;
  if (color2.alpha !== void 0) {
    return {
      hue: hue2,
      saturation,
      lightness,
      alpha: color2.alpha
    };
  }
  return {
    hue: hue2,
    saturation,
    lightness
  };
}
function parseToHsl(color2) {
  return rgbToHsl(parseToRgb(color2));
}
var reduceHexValue = function reduceHexValue2(value) {
  if (value.length === 7 && value[1] === value[2] && value[3] === value[4] && value[5] === value[6]) {
    return "#" + value[1] + value[3] + value[5];
  }
  return value;
};
var reduceHexValue$1 = reduceHexValue;
function numberToHex(value) {
  var hex2 = value.toString(16);
  return hex2.length === 1 ? "0" + hex2 : hex2;
}
function colorToHex(color2) {
  return numberToHex(Math.round(color2 * 255));
}
function convertToHex(red, green, blue) {
  return reduceHexValue$1("#" + colorToHex(red) + colorToHex(green) + colorToHex(blue));
}
function hslToHex(hue2, saturation, lightness) {
  return hslToRgb(hue2, saturation, lightness, convertToHex);
}
function hsl(value, saturation, lightness) {
  if (typeof value === "number" && typeof saturation === "number" && typeof lightness === "number") {
    return hslToHex(value, saturation, lightness);
  } else if (typeof value === "object" && saturation === void 0 && lightness === void 0) {
    return hslToHex(value.hue, value.saturation, value.lightness);
  }
  throw new PolishedError(1);
}
function hsla(value, saturation, lightness, alpha3) {
  if (typeof value === "number" && typeof saturation === "number" && typeof lightness === "number" && typeof alpha3 === "number") {
    return alpha3 >= 1 ? hslToHex(value, saturation, lightness) : "rgba(" + hslToRgb(value, saturation, lightness) + "," + alpha3 + ")";
  } else if (typeof value === "object" && saturation === void 0 && lightness === void 0 && alpha3 === void 0) {
    return value.alpha >= 1 ? hslToHex(value.hue, value.saturation, value.lightness) : "rgba(" + hslToRgb(value.hue, value.saturation, value.lightness) + "," + value.alpha + ")";
  }
  throw new PolishedError(2);
}
function rgb(value, green, blue) {
  if (typeof value === "number" && typeof green === "number" && typeof blue === "number") {
    return reduceHexValue$1("#" + numberToHex(value) + numberToHex(green) + numberToHex(blue));
  } else if (typeof value === "object" && green === void 0 && blue === void 0) {
    return reduceHexValue$1("#" + numberToHex(value.red) + numberToHex(value.green) + numberToHex(value.blue));
  }
  throw new PolishedError(6);
}
function rgba(firstValue, secondValue, thirdValue, fourthValue) {
  if (typeof firstValue === "string" && typeof secondValue === "number") {
    var rgbValue = parseToRgb(firstValue);
    return "rgba(" + rgbValue.red + "," + rgbValue.green + "," + rgbValue.blue + "," + secondValue + ")";
  } else if (typeof firstValue === "number" && typeof secondValue === "number" && typeof thirdValue === "number" && typeof fourthValue === "number") {
    return fourthValue >= 1 ? rgb(firstValue, secondValue, thirdValue) : "rgba(" + firstValue + "," + secondValue + "," + thirdValue + "," + fourthValue + ")";
  } else if (typeof firstValue === "object" && secondValue === void 0 && thirdValue === void 0 && fourthValue === void 0) {
    return firstValue.alpha >= 1 ? rgb(firstValue.red, firstValue.green, firstValue.blue) : "rgba(" + firstValue.red + "," + firstValue.green + "," + firstValue.blue + "," + firstValue.alpha + ")";
  }
  throw new PolishedError(7);
}
var isRgb = function isRgb2(color2) {
  return typeof color2.red === "number" && typeof color2.green === "number" && typeof color2.blue === "number" && (typeof color2.alpha !== "number" || typeof color2.alpha === "undefined");
};
var isRgba = function isRgba2(color2) {
  return typeof color2.red === "number" && typeof color2.green === "number" && typeof color2.blue === "number" && typeof color2.alpha === "number";
};
var isHsl = function isHsl2(color2) {
  return typeof color2.hue === "number" && typeof color2.saturation === "number" && typeof color2.lightness === "number" && (typeof color2.alpha !== "number" || typeof color2.alpha === "undefined");
};
var isHsla = function isHsla2(color2) {
  return typeof color2.hue === "number" && typeof color2.saturation === "number" && typeof color2.lightness === "number" && typeof color2.alpha === "number";
};
function toColorString(color2) {
  if (typeof color2 !== "object")
    throw new PolishedError(8);
  if (isRgba(color2))
    return rgba(color2);
  if (isRgb(color2))
    return rgb(color2);
  if (isHsla(color2))
    return hsla(color2);
  if (isHsl(color2))
    return hsl(color2);
  throw new PolishedError(8);
}
function curried(f, length2, acc) {
  return function fn() {
    var combined = acc.concat(Array.prototype.slice.call(arguments));
    return combined.length >= length2 ? f.apply(this, combined) : curried(f, length2, combined);
  };
}
function curry(f) {
  return curried(f, f.length, []);
}
function guard(lowerBoundary, upperBoundary, value) {
  return Math.max(lowerBoundary, Math.min(upperBoundary, value));
}
function darken(amount, color2) {
  if (color2 === "transparent")
    return color2;
  var hslColor = parseToHsl(color2);
  return toColorString(_extends({}, hslColor, {
    lightness: guard(0, 1, hslColor.lightness - parseFloat(amount))
  }));
}
var curriedDarken = /* @__PURE__ */ curry(darken);
var curriedDarken$1 = curriedDarken;
function lighten(amount, color2) {
  if (color2 === "transparent")
    return color2;
  var hslColor = parseToHsl(color2);
  return toColorString(_extends({}, hslColor, {
    lightness: guard(0, 1, hslColor.lightness + parseFloat(amount))
  }));
}
var curriedLighten = /* @__PURE__ */ curry(lighten);
var curriedLighten$1 = curriedLighten;
function mix(weight, color2, otherColor) {
  if (color2 === "transparent")
    return otherColor;
  if (otherColor === "transparent")
    return color2;
  if (weight === 0)
    return otherColor;
  var parsedColor1 = parseToRgb(color2);
  var color1 = _extends({}, parsedColor1, {
    alpha: typeof parsedColor1.alpha === "number" ? parsedColor1.alpha : 1
  });
  var parsedColor2 = parseToRgb(otherColor);
  var color22 = _extends({}, parsedColor2, {
    alpha: typeof parsedColor2.alpha === "number" ? parsedColor2.alpha : 1
  });
  var alphaDelta = color1.alpha - color22.alpha;
  var x2 = parseFloat(weight) * 2 - 1;
  var y2 = x2 * alphaDelta === -1 ? x2 : x2 + alphaDelta;
  var z = 1 + x2 * alphaDelta;
  var weight1 = (y2 / z + 1) / 2;
  var weight2 = 1 - weight1;
  var mixedColor = {
    red: Math.floor(color1.red * weight1 + color22.red * weight2),
    green: Math.floor(color1.green * weight1 + color22.green * weight2),
    blue: Math.floor(color1.blue * weight1 + color22.blue * weight2),
    alpha: color1.alpha * parseFloat(weight) + color22.alpha * (1 - parseFloat(weight))
  };
  return rgba(mixedColor);
}
var curriedMix = /* @__PURE__ */ curry(mix);
var mix$1 = curriedMix;
function shade(percentage, color2) {
  if (color2 === "transparent")
    return color2;
  return mix$1(parseFloat(percentage), "rgb(0, 0, 0)", color2);
}
var curriedShade = /* @__PURE__ */ curry(shade);
var curriedShade$1 = curriedShade;
function transparentize(amount, color2) {
  if (color2 === "transparent")
    return color2;
  var parsedColor = parseToRgb(color2);
  var alpha3 = typeof parsedColor.alpha === "number" ? parsedColor.alpha : 1;
  var colorWithAlpha = _extends({}, parsedColor, {
    alpha: guard(0, 1, +(alpha3 * 100 - parseFloat(amount) * 100).toFixed(2) / 100)
  });
  return rgba(colorWithAlpha);
}
var curriedTransparentize = /* @__PURE__ */ curry(transparentize);
var curriedTransparentize$1 = curriedTransparentize;

// node_modules/@react-stately/overlays/dist/import.mjs
var import_react13 = __toESM(require_react(), 1);
function $fc909762b330b746$export$61c6a8c84e605fb6(props) {
  let [isOpen, setOpen] = (0, $458b0a5536c1a7cf$export$40bfa8c7b0832715)(props.isOpen, props.defaultOpen || false, props.onOpenChange);
  const open = (0, import_react13.useCallback)(() => {
    setOpen(true);
  }, [
    setOpen
  ]);
  const close = (0, import_react13.useCallback)(() => {
    setOpen(false);
  }, [
    setOpen
  ]);
  const toggle = (0, import_react13.useCallback)(() => {
    setOpen(!isOpen);
  }, [
    setOpen,
    isOpen
  ]);
  return {
    isOpen,
    setOpen,
    open,
    close,
    toggle
  };
}

// node_modules/@react-aria/button/dist/import.mjs
function $701a24aa0da5b062$export$ea18c227d4417cc3(props, ref) {
  let {
    elementType = "button",
    isDisabled,
    onPress,
    onPressStart,
    onPressEnd,
    onPressChange,
    preventFocusOnPress,
    allowFocusWhenDisabled,
    // @ts-ignore
    onClick: deprecatedOnClick,
    href,
    target,
    rel,
    type = "button"
  } = props;
  let additionalProps;
  if (elementType === "button")
    additionalProps = {
      type,
      disabled: isDisabled
    };
  else
    additionalProps = {
      role: "button",
      tabIndex: isDisabled ? void 0 : 0,
      href: elementType === "a" && isDisabled ? void 0 : href,
      target: elementType === "a" ? target : void 0,
      type: elementType === "input" ? type : void 0,
      disabled: elementType === "input" ? isDisabled : void 0,
      "aria-disabled": !isDisabled || elementType === "input" ? void 0 : isDisabled,
      rel: elementType === "a" ? rel : void 0
    };
  let { pressProps, isPressed } = (0, $f6c31cce2adf654f$export$45712eceda6fad21)({
    onPressStart,
    onPressEnd,
    onPressChange,
    onPress,
    isDisabled,
    preventFocusOnPress,
    ref
  });
  let { focusableProps } = (0, $e6afbd83fe6ebbd2$export$4c014de7c8940b4c)(props, ref);
  if (allowFocusWhenDisabled)
    focusableProps.tabIndex = isDisabled ? -1 : focusableProps.tabIndex;
  let buttonProps = (0, $3ef42575df84b30b$export$9d1611c77c2fe928)(focusableProps, pressProps, (0, $65484d02dcb7eb3e$export$457c3d6518dd4c6f)(props, {
    labelable: true
  }));
  return {
    isPressed,
    buttonProps: (0, $3ef42575df84b30b$export$9d1611c77c2fe928)(additionalProps, buttonProps, {
      "aria-haspopup": props["aria-haspopup"],
      "aria-expanded": props["aria-expanded"],
      "aria-controls": props["aria-controls"],
      "aria-pressed": props["aria-pressed"],
      onClick: (e3) => {
        if (deprecatedOnClick) {
          deprecatedOnClick(e3);
          console.warn("onClick is deprecated, please use onPress");
        }
      }
    })
  };
}

// node_modules/@react-aria/tooltip/dist/import.mjs
var import_react14 = __toESM(require_react(), 1);
function $326e436e94273fe1$export$1c4b08e0eca38426(props, state) {
  let domProps = (0, $65484d02dcb7eb3e$export$457c3d6518dd4c6f)(props, {
    labelable: true
  });
  let { hoverProps } = (0, $6179b936705e76d3$export$ae780daf29e6d456)({
    onHoverStart: () => {
      return state === null || state === void 0 ? void 0 : state.open(true);
    },
    onHoverEnd: () => {
      return state === null || state === void 0 ? void 0 : state.close();
    }
  });
  return {
    tooltipProps: (0, $3ef42575df84b30b$export$9d1611c77c2fe928)(domProps, hoverProps, {
      role: "tooltip"
    })
  };
}
function $4e1b34546679e357$export$a6da6c504e4bba8b(props, state, ref) {
  let { isDisabled, trigger } = props;
  let tooltipId = (0, $bdb11010cef70236$export$f680877a34711e37)();
  let isHovered = (0, import_react14.useRef)(false);
  let isFocused = (0, import_react14.useRef)(false);
  let handleShow = () => {
    if (isHovered.current || isFocused.current)
      state.open(isFocused.current);
  };
  let handleHide = (immediate) => {
    if (!isHovered.current && !isFocused.current)
      state.close(immediate);
  };
  (0, import_react14.useEffect)(() => {
    let onKeyDown = (e3) => {
      if (ref && ref.current) {
        if (e3.key === "Escape") {
          e3.stopPropagation();
          state.close(true);
        }
      }
    };
    if (state.isOpen) {
      document.addEventListener("keydown", onKeyDown, true);
      return () => {
        document.removeEventListener("keydown", onKeyDown, true);
      };
    }
  }, [
    ref,
    state
  ]);
  let onHoverStart = () => {
    if (trigger === "focus")
      return;
    if ((0, $507fabe10e71c6fb$export$630ff653c5ada6a9)() === "pointer")
      isHovered.current = true;
    else
      isHovered.current = false;
    handleShow();
  };
  let onHoverEnd = () => {
    if (trigger === "focus")
      return;
    isFocused.current = false;
    isHovered.current = false;
    handleHide();
  };
  let onPressStart = () => {
    isFocused.current = false;
    isHovered.current = false;
    handleHide(true);
  };
  let onFocus = () => {
    let isVisible2 = (0, $507fabe10e71c6fb$export$b9b3dfddab17db27)();
    if (isVisible2) {
      isFocused.current = true;
      handleShow();
    }
  };
  let onBlur = () => {
    isFocused.current = false;
    isHovered.current = false;
    handleHide(true);
  };
  let { hoverProps } = (0, $6179b936705e76d3$export$ae780daf29e6d456)({
    isDisabled,
    onHoverStart,
    onHoverEnd
  });
  let { pressProps } = (0, $f6c31cce2adf654f$export$45712eceda6fad21)({
    onPressStart
  });
  let { focusableProps } = (0, $e6afbd83fe6ebbd2$export$4c014de7c8940b4c)({
    isDisabled,
    onFocus,
    onBlur
  }, ref);
  return {
    triggerProps: {
      "aria-describedby": state.isOpen ? tooltipId : void 0,
      ...(0, $3ef42575df84b30b$export$9d1611c77c2fe928)(focusableProps, hoverProps, pressProps)
    },
    tooltipProps: {
      id: tooltipId
    }
  };
}

// node_modules/@react-stately/tooltip/dist/import.mjs
var import_react15 = __toESM(require_react(), 1);
var $8796f90736e175cb$var$TOOLTIP_DELAY = 1500;
var $8796f90736e175cb$var$TOOLTIP_COOLDOWN = 500;
var $8796f90736e175cb$var$tooltips = {};
var $8796f90736e175cb$var$tooltipId = 0;
var $8796f90736e175cb$var$globalWarmedUp = false;
var $8796f90736e175cb$var$globalWarmUpTimeout = null;
var $8796f90736e175cb$var$globalCooldownTimeout = null;
function $8796f90736e175cb$export$4d40659c25ecb50b(props = {}) {
  let { delay = $8796f90736e175cb$var$TOOLTIP_DELAY, closeDelay = $8796f90736e175cb$var$TOOLTIP_COOLDOWN } = props;
  let { isOpen, open, close } = (0, $fc909762b330b746$export$61c6a8c84e605fb6)(props);
  let id2 = (0, import_react15.useMemo)(() => `${++$8796f90736e175cb$var$tooltipId}`, []);
  let closeTimeout = (0, import_react15.useRef)();
  let ensureTooltipEntry = () => {
    $8796f90736e175cb$var$tooltips[id2] = hideTooltip2;
  };
  let closeOpenTooltips = () => {
    for (let hideTooltipId in $8796f90736e175cb$var$tooltips)
      if (hideTooltipId !== id2) {
        $8796f90736e175cb$var$tooltips[hideTooltipId](true);
        delete $8796f90736e175cb$var$tooltips[hideTooltipId];
      }
  };
  let showTooltip2 = () => {
    clearTimeout(closeTimeout.current);
    closeTimeout.current = null;
    closeOpenTooltips();
    ensureTooltipEntry();
    $8796f90736e175cb$var$globalWarmedUp = true;
    open();
    if ($8796f90736e175cb$var$globalWarmUpTimeout) {
      clearTimeout($8796f90736e175cb$var$globalWarmUpTimeout);
      $8796f90736e175cb$var$globalWarmUpTimeout = null;
    }
    if ($8796f90736e175cb$var$globalCooldownTimeout) {
      clearTimeout($8796f90736e175cb$var$globalCooldownTimeout);
      $8796f90736e175cb$var$globalCooldownTimeout = null;
    }
  };
  let hideTooltip2 = (immediate) => {
    if (immediate || closeDelay <= 0) {
      clearTimeout(closeTimeout.current);
      closeTimeout.current = null;
      close();
    } else if (!closeTimeout.current)
      closeTimeout.current = setTimeout(() => {
        closeTimeout.current = null;
        close();
      }, closeDelay);
    if ($8796f90736e175cb$var$globalWarmUpTimeout) {
      clearTimeout($8796f90736e175cb$var$globalWarmUpTimeout);
      $8796f90736e175cb$var$globalWarmUpTimeout = null;
    }
    if ($8796f90736e175cb$var$globalWarmedUp) {
      if ($8796f90736e175cb$var$globalCooldownTimeout)
        clearTimeout($8796f90736e175cb$var$globalCooldownTimeout);
      $8796f90736e175cb$var$globalCooldownTimeout = setTimeout(() => {
        delete $8796f90736e175cb$var$tooltips[id2];
        $8796f90736e175cb$var$globalCooldownTimeout = null;
        $8796f90736e175cb$var$globalWarmedUp = false;
      }, Math.max($8796f90736e175cb$var$TOOLTIP_COOLDOWN, closeDelay));
    }
  };
  let warmupTooltip = () => {
    closeOpenTooltips();
    ensureTooltipEntry();
    if (!isOpen && !$8796f90736e175cb$var$globalWarmUpTimeout && !$8796f90736e175cb$var$globalWarmedUp)
      $8796f90736e175cb$var$globalWarmUpTimeout = setTimeout(() => {
        $8796f90736e175cb$var$globalWarmUpTimeout = null;
        $8796f90736e175cb$var$globalWarmedUp = true;
        showTooltip2();
      }, delay);
    else if (!isOpen)
      showTooltip2();
  };
  (0, import_react15.useEffect)(() => {
    return () => {
      clearTimeout(closeTimeout.current);
      let tooltip = $8796f90736e175cb$var$tooltips[id2];
      if (tooltip)
        delete $8796f90736e175cb$var$tooltips[id2];
    };
  }, [
    id2
  ]);
  return {
    isOpen,
    open: (immediate) => {
      if (!immediate && delay > 0 && !closeTimeout.current)
        warmupTooltip();
      else
        showTooltip2();
    },
    close: hideTooltip2
  };
}

// node_modules/@react-stately/radio/dist/import.mjs
var import_react16 = __toESM(require_react(), 1);
var $a54cdc5c1942b639$var$instance = Math.round(Math.random() * 1e10);
var $a54cdc5c1942b639$var$i = 0;
function $a54cdc5c1942b639$export$bca9d026f8e704eb(props) {
  let name2 = (0, import_react16.useMemo)(() => props.name || `radio-group-${$a54cdc5c1942b639$var$instance}-${++$a54cdc5c1942b639$var$i}`, [
    props.name
  ]);
  let [selectedValue, setSelected] = (0, $458b0a5536c1a7cf$export$40bfa8c7b0832715)(props.value, props.defaultValue, props.onChange);
  let [lastFocusedValue, setLastFocusedValue] = (0, import_react16.useState)(null);
  let setSelectedValue = (value) => {
    if (!props.isReadOnly && !props.isDisabled)
      setSelected(value);
  };
  return {
    name: name2,
    selectedValue,
    setSelectedValue,
    lastFocusedValue,
    setLastFocusedValue,
    isDisabled: props.isDisabled || false,
    isReadOnly: props.isReadOnly || false,
    isRequired: props.isRequired || false,
    validationState: props.validationState || null,
    isInvalid: props.isInvalid || props.validationState === "invalid"
  };
}

// node_modules/@react-aria/label/dist/import.mjs
function $d191a55c9702f145$export$8467354a121f1b9f(props) {
  let { id: id2, label, "aria-labelledby": ariaLabelledby, "aria-label": ariaLabel, labelElementType = "label" } = props;
  id2 = (0, $bdb11010cef70236$export$f680877a34711e37)(id2);
  let labelId = (0, $bdb11010cef70236$export$f680877a34711e37)();
  let labelProps = {};
  if (label) {
    ariaLabelledby = ariaLabelledby ? `${labelId} ${ariaLabelledby}` : labelId;
    labelProps = {
      id: labelId,
      htmlFor: labelElementType === "label" ? id2 : void 0
    };
  } else if (!ariaLabelledby && !ariaLabel)
    console.warn("If you do not provide a visible label, you must specify an aria-label or aria-labelledby attribute for accessibility");
  let fieldProps = (0, $313b98861ee5dd6c$export$d6875122194c7b44)({
    id: id2,
    "aria-label": ariaLabel,
    "aria-labelledby": ariaLabelledby
  });
  return {
    labelProps,
    fieldProps
  };
}
function $2baaea4c71418dea$export$294aa081a6c6f55d(props) {
  let { description, errorMessage, isInvalid, validationState } = props;
  let { labelProps, fieldProps } = (0, $d191a55c9702f145$export$8467354a121f1b9f)(props);
  let descriptionId = (0, $bdb11010cef70236$export$b4cc09c592e8fdb8)([
    Boolean(description),
    Boolean(errorMessage),
    isInvalid,
    validationState
  ]);
  let errorMessageId = (0, $bdb11010cef70236$export$b4cc09c592e8fdb8)([
    Boolean(description),
    Boolean(errorMessage),
    isInvalid,
    validationState
  ]);
  fieldProps = (0, $3ef42575df84b30b$export$9d1611c77c2fe928)(fieldProps, {
    "aria-describedby": [
      descriptionId,
      // Use aria-describedby for error message because aria-errormessage is unsupported using VoiceOver or NVDA. See https://github.com/adobe/react-spectrum/issues/1346#issuecomment-740136268
      errorMessageId,
      props["aria-describedby"]
    ].filter(Boolean).join(" ") || void 0
  });
  return {
    labelProps,
    fieldProps,
    descriptionProps: {
      id: descriptionId
    },
    errorMessageProps: {
      id: errorMessageId
    }
  };
}

// node_modules/@react-aria/radio/dist/import.mjs
var $884aeceb3d67f00f$export$3b7b268d09480394 = /* @__PURE__ */ new WeakMap();
var $884aeceb3d67f00f$export$8e8b214e06dd397d = /* @__PURE__ */ new WeakMap();
var $884aeceb3d67f00f$export$61c8d3f0151e21b2 = /* @__PURE__ */ new WeakMap();
function $0d5c49892c1215da$export$37b0961d2f4751e2(props, state, ref) {
  let { value, children, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby } = props;
  const isDisabled = props.isDisabled || state.isDisabled;
  let hasChildren = children != null;
  let hasAriaLabel = ariaLabel != null || ariaLabelledby != null;
  if (!hasChildren && !hasAriaLabel)
    console.warn("If you do not provide children, you must specify an aria-label for accessibility");
  let checked = state.selectedValue === value;
  let onChange = (e3) => {
    e3.stopPropagation();
    state.setSelectedValue(value);
  };
  let { pressProps, isPressed } = (0, $f6c31cce2adf654f$export$45712eceda6fad21)({
    isDisabled
  });
  let { focusableProps } = (0, $e6afbd83fe6ebbd2$export$4c014de7c8940b4c)((0, $3ef42575df84b30b$export$9d1611c77c2fe928)(props, {
    onFocus: () => state.setLastFocusedValue(value)
  }), ref);
  let interactions = (0, $3ef42575df84b30b$export$9d1611c77c2fe928)(pressProps, focusableProps);
  let domProps = (0, $65484d02dcb7eb3e$export$457c3d6518dd4c6f)(props, {
    labelable: true
  });
  let tabIndex = -1;
  if (state.selectedValue != null) {
    if (state.selectedValue === value)
      tabIndex = 0;
  } else if (state.lastFocusedValue === value || state.lastFocusedValue == null)
    tabIndex = 0;
  if (isDisabled)
    tabIndex = void 0;
  (0, $99facab73266f662$export$5add1d006293d136)(ref, state.selectedValue, state.setSelectedValue);
  return {
    inputProps: (0, $3ef42575df84b30b$export$9d1611c77c2fe928)(domProps, {
      ...interactions,
      type: "radio",
      name: (0, $884aeceb3d67f00f$export$3b7b268d09480394).get(state),
      tabIndex,
      disabled: isDisabled,
      checked,
      value,
      onChange,
      "aria-describedby": [
        props["aria-describedby"],
        state.isInvalid ? (0, $884aeceb3d67f00f$export$61c8d3f0151e21b2).get(state) : null,
        (0, $884aeceb3d67f00f$export$8e8b214e06dd397d).get(state)
      ].filter(Boolean).join(" ") || void 0
    }),
    isDisabled,
    isSelected: checked,
    isPressed
  };
}
function $430f30ed08ec25fa$export$62b9571f283ff5c2(props, state) {
  let { name: name2, isReadOnly, isRequired, isDisabled, orientation = "vertical" } = props;
  let { direction } = (0, $18f2051aff69b9bf$export$43bb16f9c6d9e3f7)();
  let { labelProps, fieldProps, descriptionProps, errorMessageProps } = (0, $2baaea4c71418dea$export$294aa081a6c6f55d)({
    ...props,
    // Radio group is not an HTML input element so it
    // shouldn't be labeled by a <label> element.
    labelElementType: "span"
  });
  (0, $884aeceb3d67f00f$export$8e8b214e06dd397d).set(state, descriptionProps.id);
  (0, $884aeceb3d67f00f$export$61c8d3f0151e21b2).set(state, errorMessageProps.id);
  let domProps = (0, $65484d02dcb7eb3e$export$457c3d6518dd4c6f)(props, {
    labelable: true
  });
  let { focusWithinProps } = (0, $9ab94262bd0047c7$export$420e68273165f4ec)({
    onBlurWithin() {
      if (!state.selectedValue)
        state.setLastFocusedValue(null);
    }
  });
  let onKeyDown = (e3) => {
    let nextDir;
    switch (e3.key) {
      case "ArrowRight":
        if (direction === "rtl" && orientation !== "vertical")
          nextDir = "prev";
        else
          nextDir = "next";
        break;
      case "ArrowLeft":
        if (direction === "rtl" && orientation !== "vertical")
          nextDir = "next";
        else
          nextDir = "prev";
        break;
      case "ArrowDown":
        nextDir = "next";
        break;
      case "ArrowUp":
        nextDir = "prev";
        break;
      default:
        return;
    }
    e3.preventDefault();
    let walker = (0, $9bf71ea28793e738$export$2d6ec8fc375ceafa)(e3.currentTarget, {
      from: e3.target
    });
    let nextElem;
    if (nextDir === "next") {
      nextElem = walker.nextNode();
      if (!nextElem) {
        walker.currentNode = e3.currentTarget;
        nextElem = walker.firstChild();
      }
    } else {
      nextElem = walker.previousNode();
      if (!nextElem) {
        walker.currentNode = e3.currentTarget;
        nextElem = walker.lastChild();
      }
    }
    if (nextElem) {
      nextElem.focus();
      state.setSelectedValue(nextElem.value);
    }
  };
  let groupName = (0, $bdb11010cef70236$export$f680877a34711e37)(name2);
  (0, $884aeceb3d67f00f$export$3b7b268d09480394).set(state, groupName);
  return {
    radioGroupProps: (0, $3ef42575df84b30b$export$9d1611c77c2fe928)(domProps, {
      // https://www.w3.org/TR/wai-aria-1.2/#radiogroup
      role: "radiogroup",
      onKeyDown,
      "aria-invalid": state.isInvalid || void 0,
      "aria-errormessage": props["aria-errormessage"],
      "aria-readonly": isReadOnly || void 0,
      "aria-required": isRequired || void 0,
      "aria-disabled": isDisabled || void 0,
      "aria-orientation": orientation,
      ...fieldProps,
      ...focusWithinProps
    }),
    labelProps,
    descriptionProps,
    errorMessageProps
  };
}

// node_modules/@react-aria/selection/dist/import.mjs
var import_react_dom3 = __toESM(require_react_dom(), 1);
var import_react17 = __toESM(require_react(), 1);
function $feb5ffebff200149$export$d3e3bd3e26688c04(e3) {
  return (0, $c87311424ea30a05$export$e1865c3bedcd822b)() ? e3.altKey : e3.ctrlKey;
}
function $feb5ffebff200149$export$16792effe837dba3(e3) {
  if ((0, $c87311424ea30a05$export$9ac100e40613ea10)())
    return e3.metaKey;
  return e3.ctrlKey;
}
var $fb3050f43d946246$var$TYPEAHEAD_DEBOUNCE_WAIT_MS = 1e3;
function $fb3050f43d946246$export$e32c88dfddc6e1d8(options) {
  let { keyboardDelegate, selectionManager, onTypeSelect } = options;
  let state = (0, import_react17.useRef)({
    search: "",
    timeout: null
  }).current;
  let onKeyDown = (e3) => {
    let character2 = $fb3050f43d946246$var$getStringForKey(e3.key);
    if (!character2 || e3.ctrlKey || e3.metaKey || !e3.currentTarget.contains(e3.target))
      return;
    if (character2 === " " && state.search.trim().length > 0) {
      e3.preventDefault();
      if (!("continuePropagation" in e3))
        e3.stopPropagation();
    }
    state.search += character2;
    let key = keyboardDelegate.getKeyForSearch(state.search, selectionManager.focusedKey);
    if (key == null)
      key = keyboardDelegate.getKeyForSearch(state.search);
    if (key != null) {
      selectionManager.setFocusedKey(key);
      if (onTypeSelect)
        onTypeSelect(key);
    }
    clearTimeout(state.timeout);
    state.timeout = setTimeout(() => {
      state.search = "";
    }, $fb3050f43d946246$var$TYPEAHEAD_DEBOUNCE_WAIT_MS);
  };
  return {
    typeSelectProps: {
      // Using a capturing listener to catch the keydown event before
      // other hooks in order to handle the Spacebar event.
      onKeyDownCapture: keyboardDelegate.getKeyForSearch ? onKeyDown : null
    }
  };
}
function $fb3050f43d946246$var$getStringForKey(key) {
  if (key.length === 1 || !/^[A-Z]/i.test(key))
    return key;
  return "";
}
function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
  let { selectionManager: manager, keyboardDelegate: delegate, ref, autoFocus = false, shouldFocusWrap = false, disallowEmptySelection = false, disallowSelectAll = false, selectOnFocus = manager.selectionBehavior === "replace", disallowTypeAhead = false, shouldUseVirtualFocus, allowsTabNavigation = false, isVirtualized, scrollRef = ref, linkBehavior = "action" } = options;
  let { direction } = (0, $18f2051aff69b9bf$export$43bb16f9c6d9e3f7)();
  let router2 = (0, $ea8dcbcb9ea1b556$export$9a302a45f65d0572)();
  let onKeyDown = (e3) => {
    if (e3.altKey && e3.key === "Tab")
      e3.preventDefault();
    if (!ref.current.contains(e3.target))
      return;
    const navigateToKey = (key, childFocus) => {
      if (key != null) {
        if (manager.isLink(key) && linkBehavior === "selection" && selectOnFocus && !(0, $feb5ffebff200149$export$d3e3bd3e26688c04)(e3)) {
          (0, import_react_dom3.flushSync)(() => {
            manager.setFocusedKey(key, childFocus);
          });
          let item = scrollRef.current.querySelector(`[data-key="${key}"]`);
          router2.open(item, e3);
          return;
        }
        manager.setFocusedKey(key, childFocus);
        if (manager.isLink(key) && linkBehavior === "override")
          return;
        if (e3.shiftKey && manager.selectionMode === "multiple")
          manager.extendSelection(key);
        else if (selectOnFocus && !(0, $feb5ffebff200149$export$d3e3bd3e26688c04)(e3))
          manager.replaceSelection(key);
      }
    };
    switch (e3.key) {
      case "ArrowDown":
        if (delegate.getKeyBelow) {
          var _delegate_getFirstKey, _delegate_getFirstKey1;
          e3.preventDefault();
          let nextKey = manager.focusedKey != null ? delegate.getKeyBelow(manager.focusedKey) : (_delegate_getFirstKey = delegate.getFirstKey) === null || _delegate_getFirstKey === void 0 ? void 0 : _delegate_getFirstKey.call(delegate);
          if (nextKey == null && shouldFocusWrap)
            nextKey = (_delegate_getFirstKey1 = delegate.getFirstKey) === null || _delegate_getFirstKey1 === void 0 ? void 0 : _delegate_getFirstKey1.call(delegate, manager.focusedKey);
          navigateToKey(nextKey);
        }
        break;
      case "ArrowUp":
        if (delegate.getKeyAbove) {
          var _delegate_getLastKey, _delegate_getLastKey1;
          e3.preventDefault();
          let nextKey = manager.focusedKey != null ? delegate.getKeyAbove(manager.focusedKey) : (_delegate_getLastKey = delegate.getLastKey) === null || _delegate_getLastKey === void 0 ? void 0 : _delegate_getLastKey.call(delegate);
          if (nextKey == null && shouldFocusWrap)
            nextKey = (_delegate_getLastKey1 = delegate.getLastKey) === null || _delegate_getLastKey1 === void 0 ? void 0 : _delegate_getLastKey1.call(delegate, manager.focusedKey);
          navigateToKey(nextKey);
        }
        break;
      case "ArrowLeft":
        if (delegate.getKeyLeftOf) {
          var _delegate_getFirstKey2, _delegate_getLastKey2;
          e3.preventDefault();
          let nextKey = delegate.getKeyLeftOf(manager.focusedKey);
          if (nextKey == null && shouldFocusWrap)
            nextKey = direction === "rtl" ? (_delegate_getFirstKey2 = delegate.getFirstKey) === null || _delegate_getFirstKey2 === void 0 ? void 0 : _delegate_getFirstKey2.call(delegate, manager.focusedKey) : (_delegate_getLastKey2 = delegate.getLastKey) === null || _delegate_getLastKey2 === void 0 ? void 0 : _delegate_getLastKey2.call(delegate, manager.focusedKey);
          navigateToKey(nextKey, direction === "rtl" ? "first" : "last");
        }
        break;
      case "ArrowRight":
        if (delegate.getKeyRightOf) {
          var _delegate_getLastKey3, _delegate_getFirstKey3;
          e3.preventDefault();
          let nextKey = delegate.getKeyRightOf(manager.focusedKey);
          if (nextKey == null && shouldFocusWrap)
            nextKey = direction === "rtl" ? (_delegate_getLastKey3 = delegate.getLastKey) === null || _delegate_getLastKey3 === void 0 ? void 0 : _delegate_getLastKey3.call(delegate, manager.focusedKey) : (_delegate_getFirstKey3 = delegate.getFirstKey) === null || _delegate_getFirstKey3 === void 0 ? void 0 : _delegate_getFirstKey3.call(delegate, manager.focusedKey);
          navigateToKey(nextKey, direction === "rtl" ? "last" : "first");
        }
        break;
      case "Home":
        if (delegate.getFirstKey) {
          e3.preventDefault();
          let firstKey = delegate.getFirstKey(manager.focusedKey, (0, $feb5ffebff200149$export$16792effe837dba3)(e3));
          manager.setFocusedKey(firstKey);
          if ((0, $feb5ffebff200149$export$16792effe837dba3)(e3) && e3.shiftKey && manager.selectionMode === "multiple")
            manager.extendSelection(firstKey);
          else if (selectOnFocus)
            manager.replaceSelection(firstKey);
        }
        break;
      case "End":
        if (delegate.getLastKey) {
          e3.preventDefault();
          let lastKey = delegate.getLastKey(manager.focusedKey, (0, $feb5ffebff200149$export$16792effe837dba3)(e3));
          manager.setFocusedKey(lastKey);
          if ((0, $feb5ffebff200149$export$16792effe837dba3)(e3) && e3.shiftKey && manager.selectionMode === "multiple")
            manager.extendSelection(lastKey);
          else if (selectOnFocus)
            manager.replaceSelection(lastKey);
        }
        break;
      case "PageDown":
        if (delegate.getKeyPageBelow) {
          e3.preventDefault();
          let nextKey = delegate.getKeyPageBelow(manager.focusedKey);
          navigateToKey(nextKey);
        }
        break;
      case "PageUp":
        if (delegate.getKeyPageAbove) {
          e3.preventDefault();
          let nextKey = delegate.getKeyPageAbove(manager.focusedKey);
          navigateToKey(nextKey);
        }
        break;
      case "a":
        if ((0, $feb5ffebff200149$export$16792effe837dba3)(e3) && manager.selectionMode === "multiple" && disallowSelectAll !== true) {
          e3.preventDefault();
          manager.selectAll();
        }
        break;
      case "Escape":
        e3.preventDefault();
        if (!disallowEmptySelection)
          manager.clearSelection();
        break;
      case "Tab":
        if (!allowsTabNavigation) {
          if (e3.shiftKey)
            ref.current.focus();
          else {
            let walker = (0, $9bf71ea28793e738$export$2d6ec8fc375ceafa)(ref.current, {
              tabbable: true
            });
            let next2;
            let last;
            do {
              last = walker.lastChild();
              if (last)
                next2 = last;
            } while (last);
            if (next2 && !next2.contains(document.activeElement))
              (0, $7215afc6de606d6b$export$de79e2c695e052f3)(next2);
          }
          break;
        }
    }
  };
  let scrollPos = (0, import_react17.useRef)({
    top: 0,
    left: 0
  });
  (0, $e9faafb641e167db$export$90fc3a17d93f704c)(scrollRef, "scroll", isVirtualized ? null : () => {
    scrollPos.current = {
      top: scrollRef.current.scrollTop,
      left: scrollRef.current.scrollLeft
    };
  });
  let onFocus = (e3) => {
    if (manager.isFocused) {
      if (!e3.currentTarget.contains(e3.target))
        manager.setFocused(false);
      return;
    }
    if (!e3.currentTarget.contains(e3.target))
      return;
    manager.setFocused(true);
    if (manager.focusedKey == null) {
      let navigateToFirstKey = (key) => {
        if (key != null) {
          manager.setFocusedKey(key);
          if (selectOnFocus)
            manager.replaceSelection(key);
        }
      };
      let relatedTarget = e3.relatedTarget;
      var _manager_lastSelectedKey, _manager_firstSelectedKey;
      if (relatedTarget && e3.currentTarget.compareDocumentPosition(relatedTarget) & Node.DOCUMENT_POSITION_FOLLOWING)
        navigateToFirstKey((_manager_lastSelectedKey = manager.lastSelectedKey) !== null && _manager_lastSelectedKey !== void 0 ? _manager_lastSelectedKey : delegate.getLastKey());
      else
        navigateToFirstKey((_manager_firstSelectedKey = manager.firstSelectedKey) !== null && _manager_firstSelectedKey !== void 0 ? _manager_firstSelectedKey : delegate.getFirstKey());
    } else if (!isVirtualized) {
      scrollRef.current.scrollTop = scrollPos.current.top;
      scrollRef.current.scrollLeft = scrollPos.current.left;
    }
    if (!isVirtualized && manager.focusedKey != null) {
      let element2 = scrollRef.current.querySelector(`[data-key="${manager.focusedKey}"]`);
      if (element2) {
        if (!element2.contains(document.activeElement))
          (0, $7215afc6de606d6b$export$de79e2c695e052f3)(element2);
        let modality = (0, $507fabe10e71c6fb$export$630ff653c5ada6a9)();
        if (modality === "keyboard")
          (0, $2f04cbc44ee30ce0$export$c826860796309d1b)(element2, {
            containingElement: ref.current
          });
      }
    }
  };
  let onBlur = (e3) => {
    if (!e3.currentTarget.contains(e3.relatedTarget))
      manager.setFocused(false);
  };
  const autoFocusRef = (0, import_react17.useRef)(autoFocus);
  (0, import_react17.useEffect)(() => {
    if (autoFocusRef.current) {
      let focusedKey = null;
      if (autoFocus === "first")
        focusedKey = delegate.getFirstKey();
      if (autoFocus === "last")
        focusedKey = delegate.getLastKey();
      let selectedKeys = manager.selectedKeys;
      if (selectedKeys.size)
        focusedKey = selectedKeys.values().next().value;
      manager.setFocused(true);
      manager.setFocusedKey(focusedKey);
      if (focusedKey == null && !shouldUseVirtualFocus)
        (0, $6a99195332edec8b$export$80f3e147d781571c)(ref.current);
    }
    autoFocusRef.current = false;
  }, []);
  let lastFocusedKey = (0, import_react17.useRef)(manager.focusedKey);
  (0, import_react17.useEffect)(() => {
    let modality = (0, $507fabe10e71c6fb$export$630ff653c5ada6a9)();
    if (manager.isFocused && manager.focusedKey != null && (scrollRef === null || scrollRef === void 0 ? void 0 : scrollRef.current)) {
      let element2 = scrollRef.current.querySelector(`[data-key="${manager.focusedKey}"]`);
      if (element2 && modality === "keyboard") {
        if (!isVirtualized)
          (0, $2f04cbc44ee30ce0$export$53a0910f038337bd)(scrollRef.current, element2);
        (0, $2f04cbc44ee30ce0$export$c826860796309d1b)(element2, {
          containingElement: ref.current
        });
      }
    }
    if (manager.isFocused && manager.focusedKey == null && lastFocusedKey.current != null)
      (0, $6a99195332edec8b$export$80f3e147d781571c)(ref.current);
    lastFocusedKey.current = manager.focusedKey;
  }, [
    isVirtualized,
    scrollRef,
    manager.focusedKey,
    manager.isFocused,
    ref
  ]);
  let handlers2 = {
    onKeyDown,
    onFocus,
    onBlur,
    onMouseDown(e3) {
      if (scrollRef.current === e3.target)
        e3.preventDefault();
    }
  };
  let { typeSelectProps } = (0, $fb3050f43d946246$export$e32c88dfddc6e1d8)({
    keyboardDelegate: delegate,
    selectionManager: manager
  });
  if (!disallowTypeAhead)
    handlers2 = (0, $3ef42575df84b30b$export$9d1611c77c2fe928)(typeSelectProps, handlers2);
  let tabIndex;
  if (!shouldUseVirtualFocus)
    tabIndex = manager.focusedKey == null ? 0 : -1;
  return {
    collectionProps: {
      ...handlers2,
      tabIndex
    }
  };
}
function $880e95eb8b93ba9a$export$ecf600387e221c37(options) {
  let { selectionManager: manager, key, ref, shouldSelectOnPressUp, shouldUseVirtualFocus, focus, isDisabled, onAction, allowsDifferentPressOrigin, linkBehavior = "action" } = options;
  let router2 = (0, $ea8dcbcb9ea1b556$export$9a302a45f65d0572)();
  let onSelect = (e3) => {
    if (e3.pointerType === "keyboard" && (0, $feb5ffebff200149$export$d3e3bd3e26688c04)(e3))
      manager.toggleSelection(key);
    else {
      if (manager.selectionMode === "none")
        return;
      if (manager.isLink(key)) {
        if (linkBehavior === "selection") {
          router2.open(ref.current, e3);
          manager.setSelectedKeys(manager.selectedKeys);
          return;
        } else if (linkBehavior === "override" || linkBehavior === "none")
          return;
      }
      if (manager.selectionMode === "single") {
        if (manager.isSelected(key) && !manager.disallowEmptySelection)
          manager.toggleSelection(key);
        else
          manager.replaceSelection(key);
      } else if (e3 && e3.shiftKey)
        manager.extendSelection(key);
      else if (manager.selectionBehavior === "toggle" || e3 && ((0, $feb5ffebff200149$export$16792effe837dba3)(e3) || e3.pointerType === "touch" || e3.pointerType === "virtual"))
        manager.toggleSelection(key);
      else
        manager.replaceSelection(key);
    }
  };
  (0, import_react17.useEffect)(() => {
    let isFocused = key === manager.focusedKey;
    if (isFocused && manager.isFocused && !shouldUseVirtualFocus) {
      if (focus)
        focus();
      else if (document.activeElement !== ref.current)
        (0, $6a99195332edec8b$export$80f3e147d781571c)(ref.current);
    }
  }, [
    ref,
    key,
    manager.focusedKey,
    manager.childFocusStrategy,
    manager.isFocused,
    shouldUseVirtualFocus
  ]);
  isDisabled = isDisabled || manager.isDisabled(key);
  let itemProps = {};
  if (!shouldUseVirtualFocus && !isDisabled)
    itemProps = {
      tabIndex: key === manager.focusedKey ? 0 : -1,
      onFocus(e3) {
        if (e3.target === ref.current)
          manager.setFocusedKey(key);
      }
    };
  else if (isDisabled)
    itemProps.onMouseDown = (e3) => {
      e3.preventDefault();
    };
  let isLinkOverride = manager.isLink(key) && linkBehavior === "override";
  let hasLinkAction = manager.isLink(key) && linkBehavior !== "selection" && linkBehavior !== "none";
  let allowsSelection = !isDisabled && manager.canSelectItem(key) && !isLinkOverride;
  let allowsActions = (onAction || hasLinkAction) && !isDisabled;
  let hasPrimaryAction = allowsActions && (manager.selectionBehavior === "replace" ? !allowsSelection : !allowsSelection || manager.isEmpty);
  let hasSecondaryAction = allowsActions && allowsSelection && manager.selectionBehavior === "replace";
  let hasAction = hasPrimaryAction || hasSecondaryAction;
  let modality = (0, import_react17.useRef)(null);
  let longPressEnabled = hasAction && allowsSelection;
  let longPressEnabledOnPressStart = (0, import_react17.useRef)(false);
  let hadPrimaryActionOnPressStart = (0, import_react17.useRef)(false);
  let performAction = (e3) => {
    if (onAction)
      onAction();
    if (hasLinkAction)
      router2.open(ref.current, e3);
  };
  let itemPressProps = {};
  if (shouldSelectOnPressUp) {
    itemPressProps.onPressStart = (e3) => {
      modality.current = e3.pointerType;
      longPressEnabledOnPressStart.current = longPressEnabled;
      if (e3.pointerType === "keyboard" && (!hasAction || $880e95eb8b93ba9a$var$isSelectionKey()))
        onSelect(e3);
    };
    if (!allowsDifferentPressOrigin)
      itemPressProps.onPress = (e3) => {
        if (hasPrimaryAction || hasSecondaryAction && e3.pointerType !== "mouse") {
          if (e3.pointerType === "keyboard" && !$880e95eb8b93ba9a$var$isActionKey())
            return;
          performAction(e3);
        } else if (e3.pointerType !== "keyboard" && allowsSelection)
          onSelect(e3);
      };
    else {
      itemPressProps.onPressUp = hasPrimaryAction ? null : (e3) => {
        if (e3.pointerType !== "keyboard" && allowsSelection)
          onSelect(e3);
      };
      itemPressProps.onPress = hasPrimaryAction ? performAction : null;
    }
  } else {
    itemPressProps.onPressStart = (e3) => {
      modality.current = e3.pointerType;
      longPressEnabledOnPressStart.current = longPressEnabled;
      hadPrimaryActionOnPressStart.current = hasPrimaryAction;
      if (allowsSelection && (e3.pointerType === "mouse" && !hasPrimaryAction || e3.pointerType === "keyboard" && (!allowsActions || $880e95eb8b93ba9a$var$isSelectionKey())))
        onSelect(e3);
    };
    itemPressProps.onPress = (e3) => {
      if (e3.pointerType === "touch" || e3.pointerType === "pen" || e3.pointerType === "virtual" || e3.pointerType === "keyboard" && hasAction && $880e95eb8b93ba9a$var$isActionKey() || e3.pointerType === "mouse" && hadPrimaryActionOnPressStart.current) {
        if (hasAction)
          performAction(e3);
        else if (allowsSelection)
          onSelect(e3);
      }
    };
  }
  itemProps["data-key"] = key;
  itemPressProps.preventFocusOnPress = shouldUseVirtualFocus;
  let { pressProps, isPressed } = (0, $f6c31cce2adf654f$export$45712eceda6fad21)(itemPressProps);
  let onDoubleClick = hasSecondaryAction ? (e3) => {
    if (modality.current === "mouse") {
      e3.stopPropagation();
      e3.preventDefault();
      performAction(e3);
    }
  } : void 0;
  let { longPressProps } = (0, $8a26561d2877236e$export$c24ed0104d07eab9)({
    isDisabled: !longPressEnabled,
    onLongPress(e3) {
      if (e3.pointerType === "touch") {
        onSelect(e3);
        manager.setSelectionBehavior("toggle");
      }
    }
  });
  let onDragStartCapture = (e3) => {
    if (modality.current === "touch" && longPressEnabledOnPressStart.current)
      e3.preventDefault();
  };
  let onClick = manager.isLink(key) ? (e3) => {
    if (!(0, $ea8dcbcb9ea1b556$export$95185d699e05d4d7).isOpening)
      e3.preventDefault();
  } : void 0;
  return {
    itemProps: (0, $3ef42575df84b30b$export$9d1611c77c2fe928)(itemProps, allowsSelection || hasPrimaryAction ? pressProps : {}, longPressEnabled ? longPressProps : {}, {
      onDoubleClick,
      onDragStartCapture,
      onClick
    }),
    isPressed,
    isSelected: manager.isSelected(key),
    isFocused: manager.isFocused && manager.focusedKey === key,
    isDisabled,
    allowsSelection,
    hasAction
  };
}
function $880e95eb8b93ba9a$var$isActionKey() {
  let event = window.event;
  return (event === null || event === void 0 ? void 0 : event.key) === "Enter";
}
function $880e95eb8b93ba9a$var$isSelectionKey() {
  let event = window.event;
  return (event === null || event === void 0 ? void 0 : event.key) === " " || (event === null || event === void 0 ? void 0 : event.code) === "Space";
}
var $2a25aae57d74318e$export$a05409b8bb224a5a = class {
  getNextKey(key) {
    key = this.collection.getKeyAfter(key);
    while (key != null) {
      let item = this.collection.getItem(key);
      if (item.type === "item" && !this.disabledKeys.has(key))
        return key;
      key = this.collection.getKeyAfter(key);
    }
    return null;
  }
  getPreviousKey(key) {
    key = this.collection.getKeyBefore(key);
    while (key != null) {
      let item = this.collection.getItem(key);
      if (item.type === "item" && !this.disabledKeys.has(key))
        return key;
      key = this.collection.getKeyBefore(key);
    }
    return null;
  }
  findKey(key, nextKey, shouldSkip) {
    let item = this.getItem(key);
    if (!item)
      return null;
    let prevRect = item.getBoundingClientRect();
    do {
      key = nextKey(key);
      item = this.getItem(key);
    } while (item && shouldSkip(prevRect, item.getBoundingClientRect()));
    return key;
  }
  isSameRow(prevRect, itemRect) {
    return prevRect.top === itemRect.top || prevRect.left !== itemRect.left;
  }
  isSameColumn(prevRect, itemRect) {
    return prevRect.left === itemRect.left || prevRect.top !== itemRect.top;
  }
  getKeyBelow(key) {
    if (this.layout === "grid" && this.orientation === "vertical")
      return this.findKey(key, (key2) => this.getNextKey(key2), this.isSameRow);
    else
      return this.getNextKey(key);
  }
  getKeyAbove(key) {
    if (this.layout === "grid" && this.orientation === "vertical")
      return this.findKey(key, (key2) => this.getPreviousKey(key2), this.isSameRow);
    else
      return this.getPreviousKey(key);
  }
  getNextColumn(key, right) {
    return right ? this.getPreviousKey(key) : this.getNextKey(key);
  }
  getKeyRightOf(key) {
    if (this.layout === "grid") {
      if (this.orientation === "vertical")
        return this.getNextColumn(key, this.direction === "rtl");
      else
        return this.findKey(key, (key2) => this.getNextColumn(key2, this.direction === "rtl"), this.isSameColumn);
    } else if (this.orientation === "horizontal")
      return this.getNextColumn(key, this.direction === "rtl");
    return null;
  }
  getKeyLeftOf(key) {
    if (this.layout === "grid") {
      if (this.orientation === "vertical")
        return this.getNextColumn(key, this.direction === "ltr");
      else
        return this.findKey(key, (key2) => this.getNextColumn(key2, this.direction === "ltr"), this.isSameColumn);
    } else if (this.orientation === "horizontal")
      return this.getNextColumn(key, this.direction === "ltr");
    return null;
  }
  getFirstKey() {
    let key = this.collection.getFirstKey();
    while (key != null) {
      let item = this.collection.getItem(key);
      if (item.type === "item" && !this.disabledKeys.has(key))
        return key;
      key = this.collection.getKeyAfter(key);
    }
    return null;
  }
  getLastKey() {
    let key = this.collection.getLastKey();
    while (key != null) {
      let item = this.collection.getItem(key);
      if (item.type === "item" && !this.disabledKeys.has(key))
        return key;
      key = this.collection.getKeyBefore(key);
    }
    return null;
  }
  getItem(key) {
    return this.ref.current.querySelector(`[data-key="${key}"]`);
  }
  getKeyPageAbove(key) {
    let menu = this.ref.current;
    let item = this.getItem(key);
    if (!item)
      return null;
    if (!(0, $62d8ded9296f3872$export$2bb74740c4e19def)(menu))
      return this.getFirstKey();
    let containerRect = menu.getBoundingClientRect();
    let itemRect = item.getBoundingClientRect();
    if (this.orientation === "horizontal") {
      let containerX = containerRect.x - menu.scrollLeft;
      let pageX = Math.max(0, itemRect.x - containerX + itemRect.width - containerRect.width);
      while (item && itemRect.x - containerX > pageX) {
        key = this.getKeyAbove(key);
        item = key == null ? null : this.getItem(key);
        itemRect = item === null || item === void 0 ? void 0 : item.getBoundingClientRect();
      }
    } else {
      let containerY = containerRect.y - menu.scrollTop;
      let pageY = Math.max(0, itemRect.y - containerY + itemRect.height - containerRect.height);
      while (item && itemRect.y - containerY > pageY) {
        key = this.getKeyAbove(key);
        item = key == null ? null : this.getItem(key);
        itemRect = item === null || item === void 0 ? void 0 : item.getBoundingClientRect();
      }
    }
    return key !== null && key !== void 0 ? key : this.getFirstKey();
  }
  getKeyPageBelow(key) {
    let menu = this.ref.current;
    let item = this.getItem(key);
    if (!item)
      return null;
    if (!(0, $62d8ded9296f3872$export$2bb74740c4e19def)(menu))
      return this.getLastKey();
    let containerRect = menu.getBoundingClientRect();
    let itemRect = item.getBoundingClientRect();
    if (this.orientation === "horizontal") {
      let containerX = containerRect.x - menu.scrollLeft;
      let pageX = Math.min(menu.scrollWidth, itemRect.x - containerX - itemRect.width + containerRect.width);
      while (item && itemRect.x - containerX < pageX) {
        key = this.getKeyBelow(key);
        item = key == null ? null : this.getItem(key);
        itemRect = item === null || item === void 0 ? void 0 : item.getBoundingClientRect();
      }
    } else {
      let containerY = containerRect.y - menu.scrollTop;
      let pageY = Math.min(menu.scrollHeight, itemRect.y - containerY - itemRect.height + containerRect.height);
      while (item && itemRect.y - containerY < pageY) {
        key = this.getKeyBelow(key);
        item = key == null ? null : this.getItem(key);
        itemRect = item === null || item === void 0 ? void 0 : item.getBoundingClientRect();
      }
    }
    return key !== null && key !== void 0 ? key : this.getLastKey();
  }
  getKeyForSearch(search, fromKey) {
    if (!this.collator)
      return null;
    let collection = this.collection;
    let key = fromKey || this.getFirstKey();
    while (key != null) {
      let item = collection.getItem(key);
      let substring = item.textValue.slice(0, search.length);
      if (item.textValue && this.collator.compare(substring, search) === 0)
        return key;
      key = this.getKeyBelow(key);
    }
    return null;
  }
  constructor(...args) {
    if (args.length === 1) {
      let opts = args[0];
      this.collection = opts.collection;
      this.ref = opts.ref;
      this.collator = opts.collator;
      this.disabledKeys = opts.disabledKeys || /* @__PURE__ */ new Set();
      this.orientation = opts.orientation;
      this.direction = opts.direction;
      this.layout = opts.layout || "stack";
    } else {
      this.collection = args[0];
      this.disabledKeys = args[1];
      this.ref = args[2];
      this.collator = args[3];
      this.layout = "stack";
      this.orientation = "vertical";
    }
    if (this.layout === "stack" && this.orientation === "vertical") {
      this.getKeyLeftOf = void 0;
      this.getKeyRightOf = void 0;
    }
  }
};
function $982254629710d113$export$b95089534ab7c1fd(props) {
  let { selectionManager, collection, disabledKeys, ref, keyboardDelegate } = props;
  let collator = (0, $325a3faab7a68acd$export$a16aca283550c30d)({
    usage: "search",
    sensitivity: "base"
  });
  let disabledBehavior = selectionManager.disabledBehavior;
  let delegate = (0, import_react17.useMemo)(() => keyboardDelegate || new (0, $2a25aae57d74318e$export$a05409b8bb224a5a)(collection, disabledBehavior === "selection" ? /* @__PURE__ */ new Set() : disabledKeys, ref, collator), [
    keyboardDelegate,
    collection,
    disabledKeys,
    ref,
    collator,
    disabledBehavior
  ]);
  let { collectionProps } = (0, $ae20dd8cbca75726$export$d6daf82dcd84e87c)({
    ...props,
    ref,
    selectionManager,
    keyboardDelegate: delegate
  });
  return {
    listProps: collectionProps
  };
}

// node_modules/@react-stately/collections/dist/import.mjs
var import_react18 = __toESM(require_react(), 1);
function $c1d7fb2ec91bae71$var$Item(props) {
  return null;
}
$c1d7fb2ec91bae71$var$Item.getCollectionNode = function* getCollectionNode(props, context2) {
  let { childItems, title, children } = props;
  let rendered = props.title || props.children;
  let textValue = props.textValue || (typeof rendered === "string" ? rendered : "") || props["aria-label"] || "";
  if (!textValue && !(context2 === null || context2 === void 0 ? void 0 : context2.suppressTextValueWarning))
    console.warn("<Item> with non-plain text contents is unsupported by type to select for accessibility. Please add a `textValue` prop.");
  yield {
    type: "item",
    props,
    rendered,
    textValue,
    "aria-label": props["aria-label"],
    hasChildNodes: $c1d7fb2ec91bae71$var$hasChildItems(props),
    *childNodes() {
      if (childItems)
        for (let child of childItems)
          yield {
            type: "item",
            value: child
          };
      else if (title) {
        let items = [];
        (0, import_react18.default).Children.forEach(children, (child) => {
          items.push({
            type: "item",
            element: child
          });
        });
        yield* items;
      }
    }
  };
};
function $c1d7fb2ec91bae71$var$hasChildItems(props) {
  if (props.hasChildItems != null)
    return props.hasChildItems;
  if (props.childItems)
    return true;
  if (props.title && (0, import_react18.default).Children.count(props.children) > 0)
    return true;
  return false;
}
var $c1d7fb2ec91bae71$export$6d08773d2e66f8f2 = $c1d7fb2ec91bae71$var$Item;
function $9fc4852771d079eb$var$Section(props) {
  return null;
}
$9fc4852771d079eb$var$Section.getCollectionNode = function* getCollectionNode2(props) {
  let { children, title, items } = props;
  yield {
    type: "section",
    props,
    hasChildNodes: true,
    rendered: title,
    "aria-label": props["aria-label"],
    *childNodes() {
      if (typeof children === "function") {
        if (!items)
          throw new Error("props.children was a function but props.items is missing");
        for (let item of items)
          yield {
            type: "item",
            value: item,
            renderer: children
          };
      } else {
        let items2 = [];
        (0, import_react18.default).Children.forEach(children, (child) => {
          items2.push({
            type: "item",
            element: child
          });
        });
        yield* items2;
      }
    }
  };
};
var $9fc4852771d079eb$export$6e2c8f0811a474ce = $9fc4852771d079eb$var$Section;
var $eb2240fc39a57fa5$export$bf788dd355e3a401 = class {
  build(props, context2) {
    this.context = context2;
    return $eb2240fc39a57fa5$var$iterable(() => this.iterateCollection(props));
  }
  *iterateCollection(props) {
    let { children, items } = props;
    if (typeof children === "function") {
      if (!items)
        throw new Error("props.children was a function but props.items is missing");
      for (let item of props.items)
        yield* this.getFullNode({
          value: item
        }, {
          renderer: children
        });
    } else {
      let items2 = [];
      (0, import_react18.default).Children.forEach(children, (child) => {
        items2.push(child);
      });
      let index = 0;
      for (let item of items2) {
        let nodes = this.getFullNode({
          element: item,
          index
        }, {});
        for (let node56 of nodes) {
          index++;
          yield node56;
        }
      }
    }
  }
  getKey(item, partialNode, state, parentKey) {
    if (item.key != null)
      return item.key;
    if (partialNode.type === "cell" && partialNode.key != null)
      return `${parentKey}${partialNode.key}`;
    let v4 = partialNode.value;
    if (v4 != null) {
      var _v_key;
      let key = (_v_key = v4.key) !== null && _v_key !== void 0 ? _v_key : v4.id;
      if (key == null)
        throw new Error("No key found for item");
      return key;
    }
    return parentKey ? `${parentKey}.${partialNode.index}` : `$.${partialNode.index}`;
  }
  getChildState(state, partialNode) {
    return {
      renderer: partialNode.renderer || state.renderer
    };
  }
  *getFullNode(partialNode, state, parentKey, parentNode) {
    let element2 = partialNode.element;
    if (!element2 && partialNode.value && state && state.renderer) {
      let cached = this.cache.get(partialNode.value);
      if (cached && (!cached.shouldInvalidate || !cached.shouldInvalidate(this.context))) {
        cached.index = partialNode.index;
        cached.parentKey = parentNode ? parentNode.key : null;
        yield cached;
        return;
      }
      element2 = state.renderer(partialNode.value);
    }
    if ((0, import_react18.default).isValidElement(element2)) {
      let type = element2.type;
      if (typeof type !== "function" && typeof type.getCollectionNode !== "function") {
        let name2 = typeof element2.type === "function" ? element2.type.name : element2.type;
        throw new Error(`Unknown element <${name2}> in collection.`);
      }
      let childNodes = type.getCollectionNode(element2.props, this.context);
      let index = partialNode.index;
      let result = childNodes.next();
      while (!result.done && result.value) {
        let childNode = result.value;
        partialNode.index = index;
        let nodeKey = childNode.key;
        if (!nodeKey)
          nodeKey = childNode.element ? null : this.getKey(element2, partialNode, state, parentKey);
        let nodes = this.getFullNode({
          ...childNode,
          key: nodeKey,
          index,
          wrapper: $eb2240fc39a57fa5$var$compose(partialNode.wrapper, childNode.wrapper)
        }, this.getChildState(state, childNode), parentKey ? `${parentKey}${element2.key}` : element2.key, parentNode);
        let children = [
          ...nodes
        ];
        for (let node57 of children) {
          node57.value = childNode.value || partialNode.value;
          if (node57.value)
            this.cache.set(node57.value, node57);
          if (partialNode.type && node57.type !== partialNode.type)
            throw new Error(`Unsupported type <${$eb2240fc39a57fa5$var$capitalize(node57.type)}> in <${$eb2240fc39a57fa5$var$capitalize(parentNode.type)}>. Only <${$eb2240fc39a57fa5$var$capitalize(partialNode.type)}> is supported.`);
          index++;
          yield node57;
        }
        result = childNodes.next(children);
      }
      return;
    }
    if (partialNode.key == null)
      return;
    let builder = this;
    let node56 = {
      type: partialNode.type,
      props: partialNode.props,
      key: partialNode.key,
      parentKey: parentNode ? parentNode.key : null,
      value: partialNode.value,
      level: parentNode ? parentNode.level + 1 : 0,
      index: partialNode.index,
      rendered: partialNode.rendered,
      textValue: partialNode.textValue,
      "aria-label": partialNode["aria-label"],
      wrapper: partialNode.wrapper,
      shouldInvalidate: partialNode.shouldInvalidate,
      hasChildNodes: partialNode.hasChildNodes,
      childNodes: $eb2240fc39a57fa5$var$iterable(function* () {
        if (!partialNode.hasChildNodes)
          return;
        let index = 0;
        for (let child of partialNode.childNodes()) {
          if (child.key != null)
            child.key = `${node56.key}${child.key}`;
          child.index = index;
          let nodes = builder.getFullNode(child, builder.getChildState(state, child), node56.key, node56);
          for (let node57 of nodes) {
            index++;
            yield node57;
          }
        }
      })
    };
    yield node56;
  }
  constructor() {
    this.cache = /* @__PURE__ */ new WeakMap();
  }
};
function $eb2240fc39a57fa5$var$iterable(iterator) {
  let cache2 = [];
  let iterable = null;
  return {
    *[Symbol.iterator]() {
      for (let item of cache2)
        yield item;
      if (!iterable)
        iterable = iterator();
      for (let item of iterable) {
        cache2.push(item);
        yield item;
      }
    }
  };
}
function $eb2240fc39a57fa5$var$compose(outer, inner) {
  if (outer && inner)
    return (element2) => outer(inner(element2));
  if (outer)
    return outer;
  if (inner)
    return inner;
}
function $eb2240fc39a57fa5$var$capitalize(str) {
  return str[0].toUpperCase() + str.slice(1);
}
function $7613b1592d41b092$export$6cd28814d92fa9c9(props, factory, context2) {
  let builder = (0, import_react18.useMemo)(() => new (0, $eb2240fc39a57fa5$export$bf788dd355e3a401)(), []);
  let { children, items, collection } = props;
  let result = (0, import_react18.useMemo)(() => {
    if (collection)
      return collection;
    let nodes = builder.build({
      children,
      items
    }, context2);
    return factory(nodes);
  }, [
    builder,
    children,
    items,
    collection,
    context2,
    factory
  ]);
  return result;
}
function $c5a24bc478652b5f$export$1005530eda016c13(node56, collection) {
  if (typeof collection.getChildren === "function")
    return collection.getChildren(node56.key);
  return node56.childNodes;
}
function $c5a24bc478652b5f$export$fbdeaa6a76694f71(iterable) {
  return $c5a24bc478652b5f$export$5f3398f8733f90e2(iterable, 0);
}
function $c5a24bc478652b5f$export$5f3398f8733f90e2(iterable, index) {
  if (index < 0)
    return void 0;
  let i2 = 0;
  for (let item of iterable) {
    if (i2 === index)
      return item;
    i2++;
  }
}
function $c5a24bc478652b5f$export$8c434b3a7a4dad6(collection, a2, b) {
  if (a2.parentKey === b.parentKey)
    return a2.index - b.index;
  let aAncestors = [
    ...$c5a24bc478652b5f$var$getAncestors(collection, a2),
    a2
  ];
  let bAncestors = [
    ...$c5a24bc478652b5f$var$getAncestors(collection, b),
    b
  ];
  let firstNonMatchingAncestor = aAncestors.slice(0, bAncestors.length).findIndex((a3, i2) => a3 !== bAncestors[i2]);
  if (firstNonMatchingAncestor !== -1) {
    a2 = aAncestors[firstNonMatchingAncestor];
    b = bAncestors[firstNonMatchingAncestor];
    return a2.index - b.index;
  }
  if (aAncestors.findIndex((node56) => node56 === b) >= 0)
    return 1;
  else if (bAncestors.findIndex((node56) => node56 === a2) >= 0)
    return -1;
  return -1;
}
function $c5a24bc478652b5f$var$getAncestors(collection, node56) {
  let parents = [];
  while ((node56 === null || node56 === void 0 ? void 0 : node56.parentKey) != null) {
    node56 = collection.getItem(node56.parentKey);
    parents.unshift(node56);
  }
  return parents;
}
var $453cc9f0df89c0a5$var$cache = /* @__PURE__ */ new WeakMap();
function $453cc9f0df89c0a5$export$77d5aafae4e095b2(collection) {
  let count2 = $453cc9f0df89c0a5$var$cache.get(collection);
  if (count2 != null)
    return count2;
  count2 = 0;
  let countItems = (items) => {
    for (let item of items)
      if (item.type === "section")
        countItems((0, $c5a24bc478652b5f$export$1005530eda016c13)(item, collection));
      else
        count2++;
  };
  countItems(collection);
  $453cc9f0df89c0a5$var$cache.set(collection, count2);
  return count2;
}

// node_modules/@react-aria/listbox/dist/import.mjs
var $b1f0cad8af73213b$export$3585ede4d035bf14 = /* @__PURE__ */ new WeakMap();
function $b1f0cad8af73213b$var$normalizeKey(key) {
  if (typeof key === "string")
    return key.replace(/\s*/g, "");
  return "" + key;
}
function $b1f0cad8af73213b$export$9145995848b05025(state, itemKey) {
  let data = $b1f0cad8af73213b$export$3585ede4d035bf14.get(state);
  if (!data)
    throw new Error("Unknown list");
  return `${data.id}-option-${$b1f0cad8af73213b$var$normalizeKey(itemKey)}`;
}
function $c132121280ec012d$export$50eacbbf140a3141(props, state, ref) {
  let domProps = (0, $65484d02dcb7eb3e$export$457c3d6518dd4c6f)(props, {
    labelable: true
  });
  let selectionBehavior = props.selectionBehavior || "toggle";
  let linkBehavior = props.linkBehavior || (selectionBehavior === "replace" ? "action" : "override");
  if (selectionBehavior === "toggle" && linkBehavior === "action")
    linkBehavior = "override";
  let { listProps } = (0, $982254629710d113$export$b95089534ab7c1fd)({
    ...props,
    ref,
    selectionManager: state.selectionManager,
    collection: state.collection,
    disabledKeys: state.disabledKeys,
    linkBehavior
  });
  let { focusWithinProps } = (0, $9ab94262bd0047c7$export$420e68273165f4ec)({
    onFocusWithin: props.onFocus,
    onBlurWithin: props.onBlur,
    onFocusWithinChange: props.onFocusChange
  });
  let id2 = (0, $bdb11010cef70236$export$f680877a34711e37)(props.id);
  (0, $b1f0cad8af73213b$export$3585ede4d035bf14).set(state, {
    id: id2,
    shouldUseVirtualFocus: props.shouldUseVirtualFocus,
    shouldSelectOnPressUp: props.shouldSelectOnPressUp,
    shouldFocusOnHover: props.shouldFocusOnHover,
    isVirtualized: props.isVirtualized,
    onAction: props.onAction,
    linkBehavior
  });
  let { labelProps, fieldProps } = (0, $d191a55c9702f145$export$8467354a121f1b9f)({
    ...props,
    id: id2,
    // listbox is not an HTML input element so it
    // shouldn't be labeled by a <label> element.
    labelElementType: "span"
  });
  return {
    labelProps,
    listBoxProps: (0, $3ef42575df84b30b$export$9d1611c77c2fe928)(domProps, focusWithinProps, state.selectionManager.selectionMode === "multiple" ? {
      "aria-multiselectable": "true"
    } : {}, {
      role: "listbox",
      ...(0, $3ef42575df84b30b$export$9d1611c77c2fe928)(fieldProps, listProps)
    })
  };
}
function $293f70390ea03370$export$497855f14858aa34(props, state, ref) {
  var _item_props;
  let { key } = props;
  let data = (0, $b1f0cad8af73213b$export$3585ede4d035bf14).get(state);
  var _props_isDisabled;
  let isDisabled = (_props_isDisabled = props.isDisabled) !== null && _props_isDisabled !== void 0 ? _props_isDisabled : state.disabledKeys.has(key);
  var _props_isSelected;
  let isSelected = (_props_isSelected = props.isSelected) !== null && _props_isSelected !== void 0 ? _props_isSelected : state.selectionManager.isSelected(key);
  var _props_shouldSelectOnPressUp;
  let shouldSelectOnPressUp = (_props_shouldSelectOnPressUp = props.shouldSelectOnPressUp) !== null && _props_shouldSelectOnPressUp !== void 0 ? _props_shouldSelectOnPressUp : data === null || data === void 0 ? void 0 : data.shouldSelectOnPressUp;
  var _props_shouldFocusOnHover;
  let shouldFocusOnHover = (_props_shouldFocusOnHover = props.shouldFocusOnHover) !== null && _props_shouldFocusOnHover !== void 0 ? _props_shouldFocusOnHover : data === null || data === void 0 ? void 0 : data.shouldFocusOnHover;
  var _props_shouldUseVirtualFocus;
  let shouldUseVirtualFocus = (_props_shouldUseVirtualFocus = props.shouldUseVirtualFocus) !== null && _props_shouldUseVirtualFocus !== void 0 ? _props_shouldUseVirtualFocus : data === null || data === void 0 ? void 0 : data.shouldUseVirtualFocus;
  var _props_isVirtualized;
  let isVirtualized = (_props_isVirtualized = props.isVirtualized) !== null && _props_isVirtualized !== void 0 ? _props_isVirtualized : data === null || data === void 0 ? void 0 : data.isVirtualized;
  let labelId = (0, $bdb11010cef70236$export$b4cc09c592e8fdb8)();
  let descriptionId = (0, $bdb11010cef70236$export$b4cc09c592e8fdb8)();
  let optionProps = {
    role: "option",
    "aria-disabled": isDisabled || void 0,
    "aria-selected": state.selectionManager.selectionMode !== "none" ? isSelected : void 0
  };
  if (!((0, $c87311424ea30a05$export$9ac100e40613ea10)() && (0, $c87311424ea30a05$export$78551043582a6a98)())) {
    optionProps["aria-label"] = props["aria-label"];
    optionProps["aria-labelledby"] = labelId;
    optionProps["aria-describedby"] = descriptionId;
  }
  let item = state.collection.getItem(key);
  if (isVirtualized) {
    let index = Number(item === null || item === void 0 ? void 0 : item.index);
    optionProps["aria-posinset"] = Number.isNaN(index) ? void 0 : index + 1;
    optionProps["aria-setsize"] = (0, $453cc9f0df89c0a5$export$77d5aafae4e095b2)(state.collection);
  }
  let { itemProps, isPressed, isFocused, hasAction, allowsSelection } = (0, $880e95eb8b93ba9a$export$ecf600387e221c37)({
    selectionManager: state.selectionManager,
    key,
    ref,
    shouldSelectOnPressUp,
    allowsDifferentPressOrigin: shouldSelectOnPressUp && shouldFocusOnHover,
    isVirtualized,
    shouldUseVirtualFocus,
    isDisabled,
    onAction: (data === null || data === void 0 ? void 0 : data.onAction) ? () => {
      var _data_onAction;
      return data === null || data === void 0 ? void 0 : (_data_onAction = data.onAction) === null || _data_onAction === void 0 ? void 0 : _data_onAction.call(data, key);
    } : void 0,
    linkBehavior: data === null || data === void 0 ? void 0 : data.linkBehavior
  });
  let { hoverProps } = (0, $6179b936705e76d3$export$ae780daf29e6d456)({
    isDisabled: isDisabled || !shouldFocusOnHover,
    onHoverStart() {
      if (!(0, $507fabe10e71c6fb$export$b9b3dfddab17db27)()) {
        state.selectionManager.setFocused(true);
        state.selectionManager.setFocusedKey(key);
      }
    }
  });
  let domProps = (0, $65484d02dcb7eb3e$export$457c3d6518dd4c6f)(item === null || item === void 0 ? void 0 : item.props, {
    isLink: !!(item === null || item === void 0 ? void 0 : (_item_props = item.props) === null || _item_props === void 0 ? void 0 : _item_props.href)
  });
  delete domProps.id;
  return {
    optionProps: {
      ...optionProps,
      ...(0, $3ef42575df84b30b$export$9d1611c77c2fe928)(domProps, itemProps, hoverProps),
      id: (0, $b1f0cad8af73213b$export$9145995848b05025)(state, key)
    },
    labelProps: {
      id: labelId
    },
    descriptionProps: {
      id: descriptionId
    },
    isFocused,
    isFocusVisible: isFocused && (0, $507fabe10e71c6fb$export$b9b3dfddab17db27)(),
    isSelected,
    isDisabled,
    isPressed,
    allowsSelection,
    hasAction
  };
}
function $af383d3bef1cfdc9$export$c3f9f39876e4bc7(props) {
  let { heading: heading2, "aria-label": ariaLabel } = props;
  let headingId = (0, $bdb11010cef70236$export$f680877a34711e37)();
  return {
    itemProps: {
      role: "presentation"
    },
    headingProps: heading2 ? {
      // Techincally, listbox cannot contain headings according to ARIA.
      // We hide the heading from assistive technology, using role="presentation",
      // and only use it as a visual label for the nested group.
      id: headingId,
      role: "presentation"
    } : {},
    groupProps: {
      role: "group",
      "aria-label": ariaLabel,
      "aria-labelledby": heading2 ? headingId : void 0
    }
  };
}

// node_modules/@react-stately/virtualizer/dist/import.mjs
var import_react19 = __toESM(require_react(), 1);
var $c74cda7d31af1253$export$c84671f46d6a1ca = class {
  /**
  * Returns whether the layout should invalidate in response to
  * visible rectangle changes. By default, it only invalidates
  * when the collection view's size changes. Return true always
  * to make the layout invalidate while scrolling (e.g. sticky headers).
  */
  shouldInvalidate(newRect, oldRect) {
    return newRect.width !== oldRect.width || newRect.height !== oldRect.height;
  }
  /**
  * This method allows the layout to perform any pre-computation
  * it needs to in order to prepare {@link LayoutInfo}s for retrieval.
  * Called by the collection view before {@link getVisibleLayoutInfos}
  * or {@link getLayoutInfo} are called.
  */
  validate(invalidationContext) {
  }
  /**
  * Returns a {@link DragTarget} describing a view at the given point to be dragged.
  * Return `null` to cancel the drag. The default implementation returns the view at the given point.
  * @param point The point at which the drag occurred.
  */
  // getDragTarget(point: Point): DragTarget | null {
  //   let target = this.virtualizer.keyAtPoint(point);
  //   if (!target) {
  //     return null;
  //   }
  //   return {
  //     type: 'item',
  //     key: target
  //   };
  // }
  /**
  * Returns a {@link DragTarget} object describing where a drop should occur. Return `null`
  * to reject the drop. The dropped items will be inserted before the resulting target.
  * @param point The point at which the drop occurred.
  */
  // getDropTarget(point: Point): DropTarget | null {
  //   return null;
  // }
  /**
  * Returns the starting attributes for an animated insertion.
  * The view is animated from this {@link LayoutInfo} to the one returned by {@link getLayoutInfo}.
  * The default implementation just returns its input.
  *
  * @param layoutInfo The proposed LayoutInfo for this view.
  */
  getInitialLayoutInfo(layoutInfo) {
    return layoutInfo;
  }
  /**
  * Returns the ending attributes for an animated removal.
  * The view is animated from the {@link LayoutInfo} returned by {@link getLayoutInfo}
  * to the one returned by this method. The default implementation returns its input.
  *
  * @param layoutInfo The original LayoutInfo for this view.
  */
  getFinalLayoutInfo(layoutInfo) {
    return layoutInfo;
  }
};
var $d7fd61009c21d0bb$export$7e0eeb9da702a085 = class _$d7fd61009c21d0bb$export$7e0eeb9da702a085 {
  /**
  * Returns a copy of the LayoutInfo.
  */
  copy() {
    let res = new _$d7fd61009c21d0bb$export$7e0eeb9da702a085(this.type, this.key, this.rect.copy());
    res.estimatedSize = this.estimatedSize;
    res.opacity = this.opacity;
    res.transform = this.transform;
    res.parentKey = this.parentKey;
    res.isSticky = this.isSticky;
    res.zIndex = this.zIndex;
    res.allowOverflow = this.allowOverflow;
    return res;
  }
  /**
  * @param type A string representing the view type. Should be `'item'` for item views.
                           Other types are used by supplementary views.
  * @param key The unique key for this view.
  * @param rect The rectangle describing the size and position of this view.
  */
  constructor(type, key, rect) {
    this.type = type;
    this.key = key;
    this.parentKey = null;
    this.rect = rect;
    this.estimatedSize = false;
    this.isSticky = false;
    this.opacity = 1;
    this.transform = null;
    this.zIndex = 0;
    this.allowOverflow = false;
  }
};
var $3041db3296945e6e$export$baf26146a414f24a = class _$3041db3296945e6e$export$baf26146a414f24a {
  /**
  * Returns a copy of this point.
  */
  copy() {
    return new _$3041db3296945e6e$export$baf26146a414f24a(this.x, this.y);
  }
  /**
  * Checks if two points are equal.
  */
  equals(point4) {
    return this.x === point4.x && this.y === point4.y;
  }
  /**
  * Returns true if this point is the origin.
  */
  isOrigin() {
    return this.x === 0 && this.y === 0;
  }
  constructor(x2 = 0, y2 = 0) {
    this.x = x2;
    this.y = y2;
  }
};
var $60423f92c7f9ad87$export$c79fc6492f3af13d = class _$60423f92c7f9ad87$export$c79fc6492f3af13d {
  /**
  * The maximum x-coordinate in the rectangle.
  */
  get maxX() {
    return this.x + this.width;
  }
  /**
  * The maximum y-coordinate in the rectangle.
  */
  get maxY() {
    return this.y + this.height;
  }
  /**
  * The area of the rectangle.
  */
  get area() {
    return this.width * this.height;
  }
  /**
  * The top left corner of the rectangle.
  */
  get topLeft() {
    return new (0, $3041db3296945e6e$export$baf26146a414f24a)(this.x, this.y);
  }
  /**
  * The top right corner of the rectangle.
  */
  get topRight() {
    return new (0, $3041db3296945e6e$export$baf26146a414f24a)(this.maxX, this.y);
  }
  /**
  * The bottom left corner of the rectangle.
  */
  get bottomLeft() {
    return new (0, $3041db3296945e6e$export$baf26146a414f24a)(this.x, this.maxY);
  }
  /**
  * The bottom right corner of the rectangle.
  */
  get bottomRight() {
    return new (0, $3041db3296945e6e$export$baf26146a414f24a)(this.maxX, this.maxY);
  }
  /**
  * Returns whether this rectangle intersects another rectangle.
  * @param rect - The rectangle to check.
  */
  intersects(rect) {
    return this.x <= rect.x + rect.width && rect.x <= this.x + this.width && this.y <= rect.y + rect.height && rect.y <= this.y + this.height;
  }
  /**
  * Returns whether this rectangle fully contains another rectangle.
  * @param rect - The rectangle to check.
  */
  containsRect(rect) {
    return this.x <= rect.x && this.y <= rect.y && this.maxX >= rect.maxX && this.maxY >= rect.maxY;
  }
  /**
  * Returns whether the rectangle contains the given point.
  * @param point - The point to check.
  */
  containsPoint(point4) {
    return this.x <= point4.x && this.y <= point4.y && this.maxX >= point4.x && this.maxY >= point4.y;
  }
  /**
  * Returns the first corner of this rectangle (from top to bottom, left to right)
  * that is contained in the given rectangle, or null of the rectangles do not intersect.
  * @param rect - The rectangle to check.
  */
  getCornerInRect(rect) {
    for (let key of [
      "topLeft",
      "topRight",
      "bottomLeft",
      "bottomRight"
    ]) {
      if (rect.containsPoint(this[key]))
        return key;
    }
    return null;
  }
  equals(rect) {
    return rect.x === this.x && rect.y === this.y && rect.width === this.width && rect.height === this.height;
  }
  pointEquals(point4) {
    return this.x === point4.x && this.y === point4.y;
  }
  sizeEquals(size) {
    return this.width === size.width && this.height === size.height;
  }
  /**
  * Returns the union of this Rect and another.
  */
  union(other) {
    let x2 = Math.min(this.x, other.x);
    let y2 = Math.min(this.y, other.y);
    let width = Math.max(this.maxX, other.maxX) - x2;
    let height = Math.max(this.maxY, other.maxY) - y2;
    return new _$60423f92c7f9ad87$export$c79fc6492f3af13d(x2, y2, width, height);
  }
  /**
  * Returns the intersection of this Rect with another.
  * If the rectangles do not intersect, an all zero Rect is returned.
  */
  intersection(other) {
    if (!this.intersects(other))
      return new _$60423f92c7f9ad87$export$c79fc6492f3af13d(0, 0, 0, 0);
    let x2 = Math.max(this.x, other.x);
    let y2 = Math.max(this.y, other.y);
    return new _$60423f92c7f9ad87$export$c79fc6492f3af13d(x2, y2, Math.min(this.maxX, other.maxX) - x2, Math.min(this.maxY, other.maxY) - y2);
  }
  /**
  * Returns a copy of this rectangle.
  */
  copy() {
    return new _$60423f92c7f9ad87$export$c79fc6492f3af13d(this.x, this.y, this.width, this.height);
  }
  constructor(x2 = 0, y2 = 0, width = 0, height = 0) {
    this.x = x2;
    this.y = y2;
    this.width = width;
    this.height = height;
  }
};
var $ee1bfa90a957fb8a$export$cb6da89c6af1a8ec = class _$ee1bfa90a957fb8a$export$cb6da89c6af1a8ec {
  /**
  * Returns a copy of this size.
  */
  copy() {
    return new _$ee1bfa90a957fb8a$export$cb6da89c6af1a8ec(this.width, this.height);
  }
  /**
  * Returns whether this size is equal to another one.
  */
  equals(other) {
    return this.width === other.width && this.height === other.height;
  }
  /**
  * The total area of the Size.
  */
  get area() {
    return this.width * this.height;
  }
  constructor(width = 0, height = 0) {
    this.width = width;
    this.height = height;
  }
};
var $ad1d98aa8f0c31b4$var$KEY = 0;
var $ad1d98aa8f0c31b4$export$1a5223887c560441 = class {
  /**
  * Prepares the view for reuse. Called just before the view is removed from the DOM.
  */
  prepareForReuse() {
    this.content = null;
    this.rendered = null;
    this.layoutInfo = null;
  }
  constructor(virtualizer) {
    this.virtualizer = virtualizer;
    this.key = ++$ad1d98aa8f0c31b4$var$KEY;
  }
};
var $3eb131dcf37ad5f8$var$perf = typeof window !== "undefined" ? window.performance : null;
var $3eb131dcf37ad5f8$var$perfNow = $3eb131dcf37ad5f8$var$perf && ($3eb131dcf37ad5f8$var$perf.now || $3eb131dcf37ad5f8$var$perf.webkitNow || $3eb131dcf37ad5f8$var$perf.msNow || $3eb131dcf37ad5f8$var$perf.mozNow);
var $3eb131dcf37ad5f8$var$getTime = $3eb131dcf37ad5f8$var$perfNow ? $3eb131dcf37ad5f8$var$perfNow.bind($3eb131dcf37ad5f8$var$perf) : function() {
  return Date.now ? Date.now() : (/* @__PURE__ */ new Date()).getTime();
};
var $3eb131dcf37ad5f8$var$fixTs;
function $3eb131dcf37ad5f8$export$dc0b63720788090c(begin, end, duration, ease, fn) {
  let canceled = false;
  let raf_id;
  let promise = new Promise((resolve2) => {
    let start = $3eb131dcf37ad5f8$var$getTime();
    let diffX = end.x - begin.x;
    let diffY = end.y - begin.y;
    raf_id = requestAnimationFrame(function run2(t3) {
      if ($3eb131dcf37ad5f8$var$fixTs == null)
        $3eb131dcf37ad5f8$var$fixTs = t3 > 1e12 !== $3eb131dcf37ad5f8$var$getTime() > 1e12;
      if ($3eb131dcf37ad5f8$var$fixTs)
        t3 = $3eb131dcf37ad5f8$var$getTime();
      let delta = t3 - start;
      if (delta > duration) {
        fn(end);
        resolve2();
      } else {
        let proceed = fn(new (0, $3041db3296945e6e$export$baf26146a414f24a)(begin.x + diffX * ease(delta / duration), begin.y + diffY * ease(delta / duration)));
        if (proceed !== false && !canceled)
          raf_id = requestAnimationFrame(run2);
      }
    });
  });
  promise.cancel = function() {
    canceled = true;
    cancelAnimationFrame(raf_id);
  };
  return promise;
}
function $3eb131dcf37ad5f8$export$57636bb43b1ccbb0(t3) {
  return Math.sin(t3 * Math.PI / 2);
}
function $fc36f9a046a9ce79$export$37a26b283fd7740e(a2, b) {
  let res = /* @__PURE__ */ new Set();
  for (let key of a2.keys())
    if (!b.has(key))
      res.add(key);
  return res;
}
function $fc36f9a046a9ce79$export$acaf96a27438246b(a2, b) {
  let toRemove = $fc36f9a046a9ce79$export$37a26b283fd7740e(a2, b);
  let toAdd = $fc36f9a046a9ce79$export$37a26b283fd7740e(b, a2);
  let toUpdate = /* @__PURE__ */ new Set();
  for (let key of a2.keys())
    if (b.has(key))
      toUpdate.add(key);
  return {
    toRemove,
    toAdd,
    toUpdate
  };
}
function* $fc36f9a046a9ce79$export$cfc14088dfefce5f(...iterators) {
  for (let iterator of iterators)
    yield* iterator;
}
function $fc36f9a046a9ce79$export$a8d0d0c8d1c5df64(a2, b) {
  if (a2 === b)
    return true;
  if (a2.size !== b.size)
    return false;
  for (let key of a2) {
    if (!b.has(key))
      return false;
  }
  return true;
}
var $364191b3decf3697$var$RollingAverage = class {
  addSample(sample) {
    this.count++;
    this.value += (sample - this.value) / this.count;
  }
  constructor() {
    this.count = 0;
    this.value = 0;
  }
};
var $364191b3decf3697$export$4455ee6afb38dcbb = class {
  setVisibleRect(rect) {
    let time2 = performance.now() - this.startTime;
    if (time2 < 500) {
      this.averageTime.addSample(time2);
      if (rect.x !== this.visibleRect.x && time2 > 0)
        this.velocity.x = (rect.x - this.visibleRect.x) / time2;
      if (rect.y !== this.visibleRect.y && time2 > 0)
        this.velocity.y = (rect.y - this.visibleRect.y) / time2;
    }
    this.startTime = performance.now();
    this.visibleRect = rect;
  }
  collectMetrics() {
    let time2 = performance.now() - this.startTime;
    if (time2 < 500)
      this.averagePerf.addSample(time2);
    if (this.visibleRect.height > 0) {
      let o = Math.abs(this.velocity.y * (this.averageTime.value + this.averagePerf.value));
      this.overscanY.addSample(o);
    }
    if (this.visibleRect.width > 0) {
      let o = Math.abs(this.velocity.x * (this.averageTime.value + this.averagePerf.value));
      this.overscanX.addSample(o);
    }
  }
  getOverscannedRect() {
    let overscanned = this.visibleRect.copy();
    let overscanY = Math.round(Math.min(this.visibleRect.height * 2, this.overscanY.value) / 100) * 100;
    if (this.velocity.y > 0) {
      overscanned.y -= overscanY * 0.2;
      overscanned.height += overscanY + overscanY * 0.2;
    } else {
      overscanned.y -= overscanY;
      overscanned.height += overscanY + overscanY * 0.2;
    }
    let overscanX = Math.round(Math.min(this.visibleRect.width * 2, this.overscanX.value) / 100) * 100;
    if (this.velocity.x > 0) {
      overscanned.x -= overscanX * 0.2;
      overscanned.width += overscanX + overscanX * 0.2;
    } else {
      overscanned.x -= overscanX;
      overscanned.width += overscanX + overscanX * 0.2;
    }
    return overscanned;
  }
  constructor() {
    this.startTime = 0;
    this.averagePerf = new $364191b3decf3697$var$RollingAverage();
    this.averageTime = new $364191b3decf3697$var$RollingAverage();
    this.velocity = new (0, $3041db3296945e6e$export$baf26146a414f24a)(5, 5);
    this.overscanX = new $364191b3decf3697$var$RollingAverage();
    this.overscanY = new $364191b3decf3697$var$RollingAverage();
    this.visibleRect = new (0, $60423f92c7f9ad87$export$c79fc6492f3af13d)();
  }
};
var $8e135e531d8dcb66$export$febc5573c75cefb0 = class {
  constructor() {
    this.level = 0;
    this.actions = [];
    this.animated = true;
    this.initialMap = /* @__PURE__ */ new Map();
    this.finalMap = /* @__PURE__ */ new Map();
    this.initialLayoutInfo = /* @__PURE__ */ new Map();
    this.finalLayoutInfo = /* @__PURE__ */ new Map();
    this.removed = /* @__PURE__ */ new Map();
    this.toRemove = /* @__PURE__ */ new Map();
  }
};
var $38b9490c1cca8fc4$export$89be5a243e59c4b2 = class {
  _setContentSize(size) {
    this._contentSize = size;
    this.delegate.setContentSize(size);
  }
  _setContentOffset(offset) {
    let rect = new (0, $60423f92c7f9ad87$export$c79fc6492f3af13d)(offset.x, offset.y, this._visibleRect.width, this._visibleRect.height);
    this.delegate.setVisibleRect(rect);
  }
  /**
  * Get the size of the scrollable content.
  */
  get contentSize() {
    return this._contentSize;
  }
  /**
  * Get the collection view's currently visible rectangle.
  */
  get visibleRect() {
    return this._visibleRect;
  }
  /**
  * Set the collection view's currently visible rectangle.
  */
  set visibleRect(rect) {
    this._setVisibleRect(rect);
  }
  _setVisibleRect(rect, forceUpdate = false) {
    let current = this._visibleRect;
    if (rect.equals(current))
      return;
    if (this.shouldOverscan)
      this._overscanManager.setVisibleRect(rect);
    let shouldInvalidate = this.layout && this.layout.shouldInvalidate(rect, this._visibleRect);
    this._resetAnimatedContentOffset();
    this._visibleRect = rect;
    if (shouldInvalidate)
      this.relayoutNow({
        offsetChanged: !rect.pointEquals(current),
        sizeChanged: !rect.sizeEquals(current)
      });
    else
      this.updateSubviews(forceUpdate);
  }
  get collection() {
    return this._collection;
  }
  set collection(data) {
    this._setData(data);
  }
  _setData(data) {
    if (data === this._collection)
      return;
    if (this._collection)
      this._runTransaction(() => {
        this._collection = data;
      }, this.transitionDuration > 0);
    else {
      this._collection = data;
      this.reloadData();
    }
  }
  /**
  * Reloads the data from the data source and relayouts the collection view.
  * Does not animate any changes. Equivalent to re-assigning the same data source
  * to the collection view.
  */
  reloadData() {
    this.relayout({
      contentChanged: true
    });
  }
  /**
  * Returns the item with the given key.
  */
  getItem(key) {
    return this._collection ? this._collection.getItem(key) : null;
  }
  /** The set of persisted keys are always present in the DOM, even if not currently in view. */
  get persistedKeys() {
    return this._persistedKeys;
  }
  /** The set of persisted keys are always present in the DOM, even if not currently in view. */
  set persistedKeys(persistedKeys) {
    if (!(0, $fc36f9a046a9ce79$export$a8d0d0c8d1c5df64)(persistedKeys, this._persistedKeys)) {
      this._persistedKeys = persistedKeys;
      this.updateSubviews();
    }
  }
  /** Returns whether the given key, or an ancestor, is persisted. */
  isPersistedKey(key) {
    if (this._persistedKeys.has(key))
      return true;
    for (let k2 of this._persistedKeys)
      while (k2 != null) {
        let layoutInfo = this.layout.getLayoutInfo(k2);
        if (!layoutInfo)
          break;
        k2 = layoutInfo.parentKey;
        if (k2 === key)
          return true;
      }
    return false;
  }
  /**
  * Get the collection view's layout.
  */
  get layout() {
    return this._layout;
  }
  /**
  * Set the collection view's layout.
  */
  set layout(layout) {
    this.setLayout(layout);
  }
  /**
  * Sets the collection view's layout, optionally with an animated transition
  * from the current layout to the new layout.
  * @param layout The layout to switch to.
  * @param animated Whether to animate the layout change.
  */
  setLayout(layout, animated = false) {
    if (layout === this._layout)
      return;
    let applyLayout = () => {
      if (this._layout)
        this._layout.virtualizer = null;
      layout.virtualizer = this;
      this._layout = layout;
    };
    if (animated)
      this._runTransaction(applyLayout);
    else {
      applyLayout();
      this.relayout();
    }
  }
  _getReuseType(layoutInfo, content2) {
    if (layoutInfo.type === "item" && content2) {
      let type = this.delegate.getType ? this.delegate.getType(content2) : "item";
      let reuseType = type === "item" ? "item" : layoutInfo.type + "_" + type;
      return {
        type,
        reuseType
      };
    }
    return {
      type: layoutInfo.type,
      reuseType: layoutInfo.type
    };
  }
  getReusableView(layoutInfo) {
    let content2 = this.getItem(layoutInfo.key);
    let { reuseType } = this._getReuseType(layoutInfo, content2);
    if (!this._reusableViews[reuseType])
      this._reusableViews[reuseType] = [];
    let reusable = this._reusableViews[reuseType];
    let view = reusable.length > 0 ? reusable.pop() : new (0, $ad1d98aa8f0c31b4$export$1a5223887c560441)(this);
    view.viewType = reuseType;
    if (!this._animatedContentOffset.isOrigin()) {
      layoutInfo = layoutInfo.copy();
      layoutInfo.rect.x += this._animatedContentOffset.x;
      layoutInfo.rect.y += this._animatedContentOffset.y;
    }
    view.layoutInfo = layoutInfo;
    this._renderView(view);
    return view;
  }
  _renderView(reusableView) {
    let { type, key } = reusableView.layoutInfo;
    reusableView.content = this.getItem(key);
    reusableView.rendered = this._renderContent(type, reusableView.content);
  }
  _renderContent(type, content2) {
    let cached = this._renderedContent.get(content2);
    if (cached != null)
      return cached;
    let rendered = this.delegate.renderView(type, content2);
    if (content2)
      this._renderedContent.set(content2, rendered);
    return rendered;
  }
  /**
  * Returns an array of all currently visible views, including both
  * item views and supplementary views.
  */
  get visibleViews() {
    return Array.from(this._visibleViews.values());
  }
  /**
  * Gets the visible view for the given type and key. Returns null if
  * the view is not currently visible.
  *
  * @param key The key of the view to retrieve.
  */
  getView(key) {
    return this._visibleViews.get(key) || null;
  }
  /**
  * Returns an array of visible views matching the given type.
  * @param type The view type to find.
  */
  getViewsOfType(type) {
    return this.visibleViews.filter((v4) => v4.layoutInfo && v4.layoutInfo.type === type);
  }
  /**
  * Returns the key for the given view. Returns null
  * if the view is not currently visible.
  */
  keyForView(view) {
    if (view && view.layoutInfo)
      return view.layoutInfo.key;
    return null;
  }
  /**
  * Returns the key for the item view currently at the given point.
  */
  keyAtPoint(point4) {
    let rect = new (0, $60423f92c7f9ad87$export$c79fc6492f3af13d)(point4.x, point4.y, 1, 1);
    let layoutInfos = this.layout.getVisibleLayoutInfos(rect);
    for (let layoutInfo of layoutInfos) {
      if (layoutInfo.rect.intersects(rect))
        return layoutInfo.key;
    }
    return null;
  }
  /**
  * Cleanup for when the Virtualizer will be unmounted.
  */
  willUnmount() {
    cancelAnimationFrame(this._relayoutRaf);
  }
  /**
  * Triggers a layout invalidation, and updates the visible subviews.
  */
  relayout(context2 = {}) {
    if (this._scrollAnimation || typeof requestAnimationFrame === "undefined")
      return;
    if (this._invalidationContext) {
      Object.assign(this._invalidationContext, context2);
      return;
    }
    this._invalidationContext = context2;
  }
  /**
  * Performs a relayout immediately. Prefer {@link relayout} over this method
  * where possible, since it coalesces multiple layout passes in the same tick.
  */
  relayoutNow(context2 = this._invalidationContext || {}) {
    if (this._relayoutRaf) {
      cancelAnimationFrame(this._relayoutRaf);
      this._relayoutRaf = null;
      context2 = {
        ...this._invalidationContext,
        ...context2
      };
    }
    this._invalidationContext = null;
    if (!this.layout || !this._collection || this._scrollAnimation)
      return;
    let scrollAnchor = this._getScrollAnchor();
    if (typeof context2.beforeLayout === "function")
      context2.beforeLayout();
    this.layout.validate(context2);
    this._setContentSize(this.layout.getContentSize());
    if (typeof context2.afterLayout === "function")
      context2.afterLayout();
    let visibleRect = this.getVisibleRect();
    let restoredScrollAnchor = this._restoreScrollAnchor(scrollAnchor, context2);
    let contentOffsetX = context2.contentChanged ? 0 : restoredScrollAnchor.x;
    let contentOffsetY = context2.contentChanged ? 0 : restoredScrollAnchor.y;
    contentOffsetX = Math.max(0, Math.min(this.contentSize.width - visibleRect.width, contentOffsetX));
    contentOffsetY = Math.max(0, Math.min(this.contentSize.height - visibleRect.height, contentOffsetY));
    let hasLayoutUpdates = false;
    if (contentOffsetX !== visibleRect.x || contentOffsetY !== visibleRect.y) {
      if (context2.animated || !this._animatedContentOffset.isOrigin()) {
        this._animatedContentOffset.x += visibleRect.x - contentOffsetX;
        this._animatedContentOffset.y += visibleRect.y - contentOffsetY;
        hasLayoutUpdates = this.updateSubviews(context2.contentChanged);
      } else
        this._setContentOffset(new (0, $3041db3296945e6e$export$baf26146a414f24a)(contentOffsetX, contentOffsetY));
    } else
      hasLayoutUpdates = this.updateSubviews(context2.contentChanged);
    if (!(context2.transaction && context2.animated))
      this._applyLayoutInfos();
    if (context2.animated && hasLayoutUpdates) {
      this._enableTransitions();
      let done = () => {
        this._disableTransitions();
        if (!this._animatedContentOffset.isOrigin()) {
          let { x: x2, y: y2 } = this.getVisibleRect();
          this._resetAnimatedContentOffset();
          this._setContentOffset(new (0, $3041db3296945e6e$export$baf26146a414f24a)(x2, y2));
        }
        if (typeof context2.afterAnimation === "function")
          context2.afterAnimation();
      };
      setTimeout(done, this.transitionDuration + 100);
      return;
    } else if (typeof context2.afterAnimation === "function")
      context2.afterAnimation();
  }
  /**
  * Corrects DOM order of visible views to match item order of collection.
  */
  _correctItemOrder() {
    if (this._isScrolling || this._transaction)
      return;
    for (let key of this._visibleLayoutInfos.keys()) {
      let view = this._visibleViews.get(key);
      this._children.delete(view);
      this._children.add(view);
    }
  }
  _enableTransitions() {
    this.delegate.beginAnimations();
  }
  _disableTransitions() {
    this.delegate.endAnimations();
  }
  _getScrollAnchor() {
    if (!this.anchorScrollPosition)
      return null;
    let visibleRect = this.getVisibleRect();
    if (this.delegate.getScrollAnchor) {
      let key = this.delegate.getScrollAnchor(visibleRect);
      if (key != null) {
        let layoutInfo = this.layout.getLayoutInfo(key);
        let corner = layoutInfo.rect.getCornerInRect(visibleRect);
        if (corner) {
          let key2 = layoutInfo.key;
          let offset = layoutInfo.rect[corner].y - visibleRect.y;
          return {
            key: key2,
            layoutInfo,
            corner,
            offset
          };
        }
      }
    }
    if (visibleRect.y === 0 && !this.anchorScrollPositionAtTop)
      return null;
    let cornerAnchor = null;
    for (let [key, view] of this._visibleViews) {
      let layoutInfo = view.layoutInfo;
      if (layoutInfo && layoutInfo.rect.area > 0) {
        let corner = layoutInfo.rect.getCornerInRect(visibleRect);
        if (corner) {
          let offset = layoutInfo.rect[corner].y - visibleRect.y;
          if (!cornerAnchor || offset < cornerAnchor.offset)
            cornerAnchor = {
              key,
              layoutInfo,
              corner,
              offset
            };
        }
      }
    }
    return cornerAnchor;
  }
  _restoreScrollAnchor(scrollAnchor, context2) {
    let contentOffset = this.getVisibleRect();
    if (scrollAnchor) {
      var _context_transaction;
      let finalAnchor = ((_context_transaction = context2.transaction) === null || _context_transaction === void 0 ? void 0 : _context_transaction.animated) ? context2.transaction.finalMap.get(scrollAnchor.key) : this.layout.getLayoutInfo(scrollAnchor.layoutInfo.key);
      if (finalAnchor) {
        let adjustment = finalAnchor.rect[scrollAnchor.corner].y - contentOffset.y - scrollAnchor.offset;
        contentOffset.y += adjustment;
      }
    }
    return contentOffset;
  }
  getVisibleRect() {
    let v4 = this.visibleRect;
    let x2 = v4.x - this._animatedContentOffset.x;
    let y2 = v4.y - this._animatedContentOffset.y;
    return new (0, $60423f92c7f9ad87$export$c79fc6492f3af13d)(x2, y2, v4.width, v4.height);
  }
  getVisibleLayoutInfos() {
    let rect = this.shouldOverscan ? this._overscanManager.getOverscannedRect() : this.getVisibleRect();
    this._visibleLayoutInfos = this._getLayoutInfoMap(rect);
    return this._visibleLayoutInfos;
  }
  _getLayoutInfoMap(rect, copy4 = false) {
    let layoutInfos = this.layout.getVisibleLayoutInfos(rect);
    let map3 = /* @__PURE__ */ new Map();
    for (let layoutInfo of layoutInfos) {
      if (copy4)
        layoutInfo = layoutInfo.copy();
      map3.set(layoutInfo.key, layoutInfo);
    }
    return map3;
  }
  updateSubviews(forceUpdate = false) {
    if (!this._collection)
      return;
    let visibleLayoutInfos = this.getVisibleLayoutInfos();
    let currentlyVisible = this._visibleViews;
    let toAdd, toRemove, toUpdate;
    if (forceUpdate) {
      toAdd = visibleLayoutInfos;
      toRemove = currentlyVisible;
      toUpdate = /* @__PURE__ */ new Set();
    } else {
      ({ toAdd, toRemove, toUpdate } = (0, $fc36f9a046a9ce79$export$acaf96a27438246b)(currentlyVisible, visibleLayoutInfos));
      for (let key of toUpdate) {
        let view = currentlyVisible.get(key);
        if (!view || !view.layoutInfo)
          continue;
        let item = this.getItem(visibleLayoutInfos.get(key).key);
        if (view.content === item)
          toUpdate.delete(key);
        else {
          let { reuseType } = this._getReuseType(view.layoutInfo, item);
          if (view.viewType !== reuseType) {
            toUpdate.delete(key);
            toAdd.add(key);
            toRemove.add(key);
          }
        }
      }
      if (toAdd.size === 0 && toRemove.size === 0 && toUpdate.size === 0) {
        if (this._transaction)
          this._applyLayoutInfos();
        return;
      }
    }
    let removed = /* @__PURE__ */ new Set();
    for (let key of toRemove.keys()) {
      let view = this._visibleViews.get(key);
      if (view) {
        removed.add(view);
        this._visibleViews.delete(key);
        if (this._transaction)
          this._transaction.toRemove.set(key, view);
        else
          this.reuseView(view);
      }
    }
    for (let key of toAdd.keys()) {
      let layoutInfo = visibleLayoutInfos.get(key);
      let view;
      if (this._transaction) {
        if (this._transaction.initialLayoutInfo.has(key))
          layoutInfo = this._transaction.initialLayoutInfo.get(key);
        view = this._transaction.toRemove.get(key);
        if (view) {
          this._transaction.toRemove.delete(key);
          this._applyLayoutInfo(view, layoutInfo);
        }
      }
      if (!view) {
        view = this.getReusableView(layoutInfo);
        if (!removed.has(view))
          this._children.add(view);
      }
      this._visibleViews.set(key, view);
      removed.delete(view);
    }
    for (let key of toUpdate) {
      let view = currentlyVisible.get(key);
      this._renderedContent.delete(key);
      this._renderView(view);
    }
    if (!this._transaction)
      this.removeViews(removed);
    this._correctItemOrder();
    this._flushVisibleViews();
    let hasLayoutUpdates = this._transaction && (toAdd.size > 0 || toRemove.size > 0 || this._hasLayoutUpdates());
    if (hasLayoutUpdates)
      requestAnimationFrame(() => {
        if (this._transaction)
          requestAnimationFrame(() => this._applyLayoutInfos());
      });
    return hasLayoutUpdates;
  }
  afterRender() {
    if (this._transactionQueue.length > 0)
      this._processTransactionQueue();
    else if (this._invalidationContext)
      this.relayoutNow();
    if (this.shouldOverscan)
      this._overscanManager.collectMetrics();
  }
  _flushVisibleViews() {
    let viewsByParentKey = /* @__PURE__ */ new Map([
      [
        null,
        []
      ]
    ]);
    for (let view of this._children) {
      var _view_layoutInfo, _viewsByParentKey_get, _view_layoutInfo1, _view_layoutInfo2, _view_layoutInfo3;
      if (((_view_layoutInfo = view.layoutInfo) === null || _view_layoutInfo === void 0 ? void 0 : _view_layoutInfo.parentKey) != null && !viewsByParentKey.has(view.layoutInfo.parentKey))
        viewsByParentKey.set(view.layoutInfo.parentKey, []);
      (_viewsByParentKey_get = viewsByParentKey.get((_view_layoutInfo1 = view.layoutInfo) === null || _view_layoutInfo1 === void 0 ? void 0 : _view_layoutInfo1.parentKey)) === null || _viewsByParentKey_get === void 0 ? void 0 : _viewsByParentKey_get.push(view);
      if (!viewsByParentKey.has((_view_layoutInfo2 = view.layoutInfo) === null || _view_layoutInfo2 === void 0 ? void 0 : _view_layoutInfo2.key))
        viewsByParentKey.set((_view_layoutInfo3 = view.layoutInfo) === null || _view_layoutInfo3 === void 0 ? void 0 : _view_layoutInfo3.key, []);
    }
    let buildTree2 = (parent, views) => views.map((view) => {
      let children2 = viewsByParentKey.get(view.layoutInfo.key);
      return this.delegate.renderWrapper(parent, view, children2, (childViews) => buildTree2(view, childViews));
    });
    let children = buildTree2(null, viewsByParentKey.get(null));
    this.delegate.setVisibleViews(children);
  }
  _applyLayoutInfo(view, layoutInfo) {
    if (view.layoutInfo === layoutInfo)
      return false;
    view.layoutInfo = layoutInfo;
    return true;
  }
  _applyLayoutInfos() {
    let updated = false;
    for (let view of this._visibleViews.values()) {
      let cur2 = view.layoutInfo;
      if ((cur2 === null || cur2 === void 0 ? void 0 : cur2.key) != null) {
        let layoutInfo = this.layout.getLayoutInfo(cur2.key);
        if (this._applyLayoutInfo(view, layoutInfo))
          updated = true;
      }
    }
    if (this._transaction) {
      for (let view of this._transaction.toRemove.values()) {
        let cur2 = view.layoutInfo;
        if ((cur2 === null || cur2 === void 0 ? void 0 : cur2.key) != null) {
          let layoutInfo = this.layout.getLayoutInfo(cur2.key);
          if (this._applyLayoutInfo(view, layoutInfo))
            updated = true;
        }
      }
      for (let view of this._transaction.removed.values()) {
        let cur2 = view.layoutInfo;
        let layoutInfo = this._transaction.finalLayoutInfo.get(cur2.key) || cur2;
        layoutInfo = this.layout.getFinalLayoutInfo(layoutInfo.copy());
        if (this._applyLayoutInfo(view, layoutInfo))
          updated = true;
      }
    }
    if (updated)
      this._flushVisibleViews();
  }
  _hasLayoutUpdates() {
    if (!this._transaction)
      return false;
    for (let view of this._visibleViews.values()) {
      let cur2 = view.layoutInfo;
      if (!cur2)
        return true;
      let layoutInfo = this.layout.getLayoutInfo(cur2.key);
      if (
        // Uses equals rather than pointEquals so that width/height changes are taken into account
        !cur2.rect.equals(layoutInfo.rect) || cur2.opacity !== layoutInfo.opacity || cur2.transform !== layoutInfo.transform
      )
        return true;
    }
    return false;
  }
  reuseView(view) {
    view.prepareForReuse();
    this._reusableViews[view.viewType].push(view);
  }
  removeViews(toRemove) {
    for (let view of toRemove)
      this._children.delete(view);
  }
  updateItemSize(key, size) {
    if (!this.layout.updateItemSize)
      return;
    if (this._scrollAnimation) {
      this._sizeUpdateQueue.set(key, size);
      return;
    }
    let changed = this.layout.updateItemSize(key, size);
    if (changed)
      this.relayout();
  }
  startScrolling() {
    this._isScrolling = true;
  }
  endScrolling() {
    this._isScrolling = false;
    this._correctItemOrder();
    this._flushVisibleViews();
  }
  _resetAnimatedContentOffset() {
    if (!this._animatedContentOffset.isOrigin()) {
      this._animatedContentOffset = new (0, $3041db3296945e6e$export$baf26146a414f24a)(0, 0);
      this._applyLayoutInfos();
    }
  }
  /**
  * Scrolls the item with the given key into view, optionally with an animation.
  * @param key The key of the item to scroll into view.
  * @param duration The duration of the scroll animation.
  */
  scrollToItem(key, options) {
    if (key == null)
      return;
    let layoutInfo = this.layout.getLayoutInfo(key);
    if (!layoutInfo)
      return;
    let { duration = 300, shouldScrollX = true, shouldScrollY = true, offsetX = 0, offsetY = 0 } = options;
    let x2 = this.visibleRect.x;
    let y2 = this.visibleRect.y;
    let minX = layoutInfo.rect.x - offsetX;
    let minY = layoutInfo.rect.y - offsetY;
    let maxX = x2 + this.visibleRect.width;
    let maxY = y2 + this.visibleRect.height;
    if (shouldScrollX) {
      if (minX <= x2 || maxX === 0)
        x2 = minX;
      else if (layoutInfo.rect.maxX > maxX)
        x2 += layoutInfo.rect.maxX - maxX;
    }
    if (shouldScrollY) {
      if (minY <= y2 || maxY === 0)
        y2 = minY;
      else if (layoutInfo.rect.maxY > maxY)
        y2 += layoutInfo.rect.maxY - maxY;
    }
    return this.scrollTo(new (0, $3041db3296945e6e$export$baf26146a414f24a)(x2, y2), duration);
  }
  /**
  * Performs an animated scroll to the given offset.
  * @param offset - The offset to scroll to.
  * @param duration The duration of the animation.
  * @returns A promise that resolves when the animation is complete.
  */
  scrollTo(offset, duration = 300) {
    if (this._scrollAnimation) {
      this._scrollAnimation.cancel();
      this._scrollAnimation = null;
    }
    if (duration <= 0 || this.visibleRect.pointEquals(offset)) {
      this._setContentOffset(offset);
      return Promise.resolve();
    }
    this.startScrolling();
    this._scrollAnimation = (0, $3eb131dcf37ad5f8$export$dc0b63720788090c)(this.visibleRect, offset, duration, (0, $3eb131dcf37ad5f8$export$57636bb43b1ccbb0), (offset2) => {
      this._setContentOffset(offset2);
    });
    this._scrollAnimation.then(() => {
      this._scrollAnimation = null;
      for (let [key, size] of this._sizeUpdateQueue)
        this.updateItemSize(key, size);
      this._sizeUpdateQueue.clear();
      this.relayout();
      this._processTransactionQueue();
      this.endScrolling();
    });
    return this._scrollAnimation;
  }
  _runTransaction(action, animated) {
    this._startTransaction();
    if (this._nextTransaction)
      this._nextTransaction.actions.push(action);
    this._endTransaction(animated);
  }
  _startTransaction() {
    if (!this._nextTransaction)
      this._nextTransaction = new (0, $8e135e531d8dcb66$export$febc5573c75cefb0)();
    this._nextTransaction.level++;
  }
  _endTransaction(animated) {
    if (!this._nextTransaction)
      return false;
    if (animated != null)
      this._nextTransaction.animated = animated;
    if (--this._nextTransaction.level > 0)
      return false;
    if (this._nextTransaction.actions.length === 0) {
      this._nextTransaction = null;
      return false;
    }
    if (this._nextTransaction.animated == null)
      this._nextTransaction.animated = true;
    this._transactionQueue.push(this._nextTransaction);
    this._nextTransaction = null;
    return true;
  }
  _processTransactionQueue() {
    if (this._transaction || this._scrollAnimation)
      return;
    let next2 = this._transactionQueue.shift();
    if (next2)
      this._performTransaction(next2);
  }
  _getContentRect() {
    return new (0, $60423f92c7f9ad87$export$c79fc6492f3af13d)(0, 0, this.contentSize.width, this.contentSize.height);
  }
  _performTransaction(transaction) {
    this._transaction = transaction;
    this.relayoutNow({
      transaction,
      animated: transaction.animated,
      beforeLayout: () => {
        if (transaction.animated)
          transaction.initialMap = this._getLayoutInfoMap(this._getContentRect(), true);
        for (let action of transaction.actions)
          action();
      },
      afterLayout: () => {
        if (transaction.animated) {
          transaction.finalMap = this._getLayoutInfoMap(this._getContentRect());
          this._setupTransactionAnimations(transaction);
        } else
          this._transaction = null;
      },
      afterAnimation: () => {
        if (transaction.toRemove.size > 0 || transaction.removed.size > 0)
          for (let view of (0, $fc36f9a046a9ce79$export$cfc14088dfefce5f)(transaction.toRemove.values(), transaction.removed.values())) {
            this._children.delete(view);
            this.reuseView(view);
          }
        this._transaction = null;
        this._correctItemOrder();
        this._flushVisibleViews();
        this._processTransactionQueue();
      }
    });
  }
  _setupTransactionAnimations(transaction) {
    let { initialMap, finalMap } = transaction;
    for (let [key, layoutInfo] of initialMap)
      if (finalMap.has(key))
        transaction.initialLayoutInfo.set(key, layoutInfo);
      else
        transaction.finalLayoutInfo.set(layoutInfo.key, layoutInfo);
    for (let [key, layoutInfo] of finalMap)
      if (!initialMap.has(key)) {
        let initialLayoutInfo = this.layout.getInitialLayoutInfo(layoutInfo.copy());
        transaction.initialLayoutInfo.set(key, initialLayoutInfo);
      }
    for (let [key, view] of this._visibleViews)
      if (!finalMap.has(key) && view.layoutInfo.rect.width > 0) {
        transaction.removed.set(key, view);
        this._visibleViews.delete(key);
        if (view.layoutInfo) {
          if (!transaction.finalLayoutInfo.has(view.layoutInfo.key))
            transaction.finalLayoutInfo.set(view.layoutInfo.key, view.layoutInfo);
        }
      }
  }
  constructor(options = {}) {
    this._contentSize = new (0, $ee1bfa90a957fb8a$export$cb6da89c6af1a8ec)();
    this._visibleRect = new (0, $60423f92c7f9ad87$export$c79fc6492f3af13d)();
    this._reusableViews = {};
    this._visibleLayoutInfos = /* @__PURE__ */ new Map();
    this._visibleViews = /* @__PURE__ */ new Map();
    this._renderedContent = /* @__PURE__ */ new WeakMap();
    this._children = /* @__PURE__ */ new Set();
    this._invalidationContext = null;
    this._overscanManager = new (0, $364191b3decf3697$export$4455ee6afb38dcbb)();
    this._persistedKeys = /* @__PURE__ */ new Set();
    this._scrollAnimation = null;
    this._isScrolling = false;
    this._sizeUpdateQueue = /* @__PURE__ */ new Map();
    this._animatedContentOffset = new (0, $3041db3296945e6e$export$baf26146a414f24a)(0, 0);
    this._transaction = null;
    this._nextTransaction = null;
    this._transactionQueue = [];
    var _options_transitionDuration;
    this.transitionDuration = (_options_transitionDuration = options.transitionDuration) !== null && _options_transitionDuration !== void 0 ? _options_transitionDuration : 500;
    this.anchorScrollPosition = options.anchorScrollPosition || false;
    this.anchorScrollPositionAtTop = options.anchorScrollPositionAtTop || false;
    this.shouldOverscan = options.shouldOverscan !== false;
    for (let key of [
      "delegate",
      "size",
      "layout",
      "collection"
    ])
      if (options[key])
        this[key] = options[key];
  }
};
function $fc0b13b484ac1194$export$1505db82fe357e65(opts) {
  let [visibleViews, setVisibleViews] = (0, import_react19.useState)([]);
  let [contentSize, setContentSize] = (0, import_react19.useState)(new (0, $ee1bfa90a957fb8a$export$cb6da89c6af1a8ec)());
  let [isAnimating, setAnimating] = (0, import_react19.useState)(false);
  let [isScrolling, setScrolling] = (0, import_react19.useState)(false);
  let virtualizer = (0, import_react19.useMemo)(() => new (0, $38b9490c1cca8fc4$export$89be5a243e59c4b2)(), []);
  virtualizer.delegate = {
    setVisibleViews,
    setVisibleRect(rect) {
      virtualizer.visibleRect = rect;
      opts.onVisibleRectChange(rect);
    },
    setContentSize,
    renderView: opts.renderView,
    renderWrapper: opts.renderWrapper,
    beginAnimations: () => setAnimating(true),
    endAnimations: () => setAnimating(false),
    getScrollAnchor: opts.getScrollAnchor
  };
  virtualizer.layout = opts.layout;
  virtualizer.collection = opts.collection;
  virtualizer.transitionDuration = opts.transitionDuration;
  (0, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(() => {
    virtualizer.afterRender();
  });
  (0, import_react19.useEffect)(() => {
    return () => virtualizer.willUnmount();
  }, []);
  let setVisibleRect = (0, import_react19.useCallback)((rect) => {
    virtualizer.visibleRect = rect;
  }, [
    virtualizer
  ]);
  let startScrolling = (0, import_react19.useCallback)(() => {
    virtualizer.startScrolling();
    setScrolling(true);
  }, [
    virtualizer
  ]);
  let endScrolling = (0, import_react19.useCallback)(() => {
    virtualizer.endScrolling();
    setScrolling(false);
  }, [
    virtualizer
  ]);
  let state = (0, import_react19.useMemo)(() => ({
    virtualizer,
    visibleViews,
    setVisibleRect,
    contentSize,
    isAnimating,
    isScrolling,
    startScrolling,
    endScrolling
  }), [
    virtualizer,
    visibleViews,
    setVisibleRect,
    contentSize,
    isAnimating,
    isScrolling,
    startScrolling,
    endScrolling
  ]);
  return state;
}

// node_modules/@react-aria/virtualizer/dist/import.mjs
var import_react20 = __toESM(require_react(), 1);
var import_react_dom4 = __toESM(require_react_dom(), 1);
var $ce415dc67314b753$var$cachedRTLResult = null;
function $ce415dc67314b753$export$faf7630257ad4304(recalculate = false) {
  if ($ce415dc67314b753$var$cachedRTLResult === null || recalculate) {
    const outerDiv = document.createElement("div");
    const outerStyle = outerDiv.style;
    outerStyle.width = "50px";
    outerStyle.height = "50px";
    outerStyle.overflow = "scroll";
    outerStyle.direction = "rtl";
    const innerDiv = document.createElement("div");
    const innerStyle = innerDiv.style;
    innerStyle.width = "100px";
    innerStyle.height = "100px";
    outerDiv.appendChild(innerDiv);
    document.body.appendChild(outerDiv);
    if (outerDiv.scrollLeft > 0)
      $ce415dc67314b753$var$cachedRTLResult = "positive-descending";
    else {
      outerDiv.scrollLeft = 1;
      if (outerDiv.scrollLeft === 0)
        $ce415dc67314b753$var$cachedRTLResult = "negative";
      else
        $ce415dc67314b753$var$cachedRTLResult = "positive-ascending";
    }
    document.body.removeChild(outerDiv);
    return $ce415dc67314b753$var$cachedRTLResult;
  }
  return $ce415dc67314b753$var$cachedRTLResult;
}
function $ce415dc67314b753$export$1389d168952b34b5(node56, direction) {
  let { scrollLeft } = node56;
  if (direction === "rtl") {
    let { scrollWidth, clientWidth } = node56;
    switch ($ce415dc67314b753$export$faf7630257ad4304()) {
      case "negative":
        scrollLeft = -scrollLeft;
        break;
      case "positive-descending":
        scrollLeft = scrollWidth - clientWidth - scrollLeft;
        break;
    }
  }
  return scrollLeft;
}
function $44a6ee657928b002$var$ScrollView(props, ref) {
  let { contentSize, onVisibleRectChange, children, innerStyle, sizeToFit, onScrollStart, onScrollEnd, scrollDirection = "both", ...otherProps } = props;
  let defaultRef = (0, import_react20.useRef)();
  ref = ref || defaultRef;
  let state = (0, import_react20.useRef)({
    scrollTop: 0,
    scrollLeft: 0,
    scrollEndTime: 0,
    scrollTimeout: null,
    width: 0,
    height: 0,
    isScrolling: false
  }).current;
  let { direction } = (0, $18f2051aff69b9bf$export$43bb16f9c6d9e3f7)();
  let [isScrolling, setScrolling] = (0, import_react20.useState)(false);
  let onScroll = (0, import_react20.useCallback)((e3) => {
    if (e3.target !== e3.currentTarget)
      return;
    if (props.onScroll)
      props.onScroll(e3);
    (0, import_react_dom4.flushSync)(() => {
      let scrollTop = e3.currentTarget.scrollTop;
      let scrollLeft = (0, $ce415dc67314b753$export$1389d168952b34b5)(e3.currentTarget, direction);
      state.scrollTop = Math.max(0, Math.min(scrollTop, contentSize.height - state.height));
      state.scrollLeft = Math.max(0, Math.min(scrollLeft, contentSize.width - state.width));
      onVisibleRectChange(new (0, $60423f92c7f9ad87$export$c79fc6492f3af13d)(state.scrollLeft, state.scrollTop, state.width, state.height));
      if (!state.isScrolling) {
        state.isScrolling = true;
        setScrolling(true);
        if (onScrollStart)
          onScrollStart();
      }
      let now2 = Date.now();
      if (state.scrollEndTime <= now2 + 50) {
        state.scrollEndTime = now2 + 300;
        clearTimeout(state.scrollTimeout);
        state.scrollTimeout = setTimeout(() => {
          state.isScrolling = false;
          setScrolling(false);
          state.scrollTimeout = null;
          if (onScrollEnd)
            onScrollEnd();
        }, 300);
      }
    });
  }, [
    props,
    direction,
    state,
    contentSize,
    onVisibleRectChange,
    onScrollStart,
    onScrollEnd
  ]);
  (0, import_react20.useEffect)(() => {
    return () => {
      clearTimeout(state.scrollTimeout);
    };
  }, []);
  let updateSize = (0, import_react20.useCallback)(() => {
    let dom = ref.current;
    if (!dom)
      return;
    let w = dom.clientWidth;
    let h = dom.clientHeight;
    if (sizeToFit && contentSize.width > 0 && contentSize.height > 0) {
      if (sizeToFit === "width")
        w = Math.min(w, contentSize.width);
      else if (sizeToFit === "height")
        h = Math.min(h, contentSize.height);
    }
    if (state.width !== w || state.height !== h) {
      state.width = w;
      state.height = h;
      onVisibleRectChange(new (0, $60423f92c7f9ad87$export$c79fc6492f3af13d)(state.scrollLeft, state.scrollTop, w, h));
    }
  }, [
    onVisibleRectChange,
    ref,
    state,
    sizeToFit,
    contentSize
  ]);
  (0, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(() => {
    updateSize();
  }, [
    updateSize
  ]);
  (0, $9daab02d461809db$export$683480f191c0e3ea)({
    ref,
    onResize: updateSize
  });
  let style = {
    // Reset padding so that relative positioning works correctly. Padding will be done in JS layout.
    padding: 0,
    ...otherProps.style
  };
  if (scrollDirection === "horizontal") {
    style.overflowX = "auto";
    style.overflowY = "hidden";
  } else if (scrollDirection === "vertical") {
    style.overflowY = "auto";
    style.overflowX = "hidden";
  } else
    style.overflow = "auto";
  return /* @__PURE__ */ (0, import_react20.default).createElement("div", {
    ...otherProps,
    style,
    ref,
    onScroll
  }, /* @__PURE__ */ (0, import_react20.default).createElement("div", {
    role: "presentation",
    style: {
      width: contentSize.width,
      height: contentSize.height,
      pointerEvents: isScrolling ? "none" : "auto",
      position: "relative",
      ...innerStyle
    }
  }, children));
}
var $44a6ee657928b002$export$5665e3d6be6adea = /* @__PURE__ */ (0, import_react20.default).forwardRef($44a6ee657928b002$var$ScrollView);
function $47736c1e63ba1c6d$export$1da781778207e0a2(options) {
  let { layoutInfo, virtualizer, ref } = options;
  let updateSize = (0, import_react20.useCallback)(() => {
    let size = $47736c1e63ba1c6d$var$getSize(ref.current);
    virtualizer.updateItemSize(layoutInfo.key, size);
  }, [
    virtualizer,
    layoutInfo.key,
    ref
  ]);
  (0, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(() => {
    if (layoutInfo.estimatedSize)
      updateSize();
  });
  return {
    updateSize
  };
}
function $47736c1e63ba1c6d$var$getSize(node56) {
  let height = node56.style.height;
  node56.style.height = "";
  let size = new (0, $ee1bfa90a957fb8a$export$cb6da89c6af1a8ec)(node56.scrollWidth, node56.scrollHeight);
  node56.style.height = height;
  return size;
}
function $ccf8a0a04e4175ae$export$6796df8ba7398521(props) {
  let { className, layoutInfo, virtualizer, parent, children } = props;
  let { direction } = (0, $18f2051aff69b9bf$export$43bb16f9c6d9e3f7)();
  let ref = (0, import_react20.useRef)();
  (0, $47736c1e63ba1c6d$export$1da781778207e0a2)({
    layoutInfo,
    virtualizer,
    ref
  });
  return /* @__PURE__ */ (0, import_react20.default).createElement("div", {
    role: "presentation",
    ref,
    className,
    style: $ccf8a0a04e4175ae$export$1481e64fbe01b8b3(layoutInfo, direction, parent)
  }, children);
}
var $ccf8a0a04e4175ae$var$cache = /* @__PURE__ */ new WeakMap();
function $ccf8a0a04e4175ae$export$1481e64fbe01b8b3(layoutInfo, dir, parent) {
  let xProperty = dir === "rtl" ? "right" : "left";
  let cached = $ccf8a0a04e4175ae$var$cache.get(layoutInfo);
  if (cached && cached[xProperty] != null) {
    if (!parent)
      return cached;
    let top2 = layoutInfo.rect.y - parent.rect.y;
    let x2 = layoutInfo.rect.x - parent.rect.x;
    if (cached.top === top2 && cached[xProperty] === x2)
      return cached;
  }
  let style = {
    position: layoutInfo.isSticky ? "sticky" : "absolute",
    // Sticky elements are positioned in normal document flow. Display inline-block so that they don't push other sticky columns onto the following rows.
    display: layoutInfo.isSticky ? "inline-block" : void 0,
    overflow: layoutInfo.allowOverflow ? "visible" : "hidden",
    top: layoutInfo.rect.y - (parent ? parent.rect.y : 0),
    [xProperty]: layoutInfo.rect.x - (parent ? parent.rect.x : 0),
    transition: "all",
    WebkitTransition: "all",
    WebkitTransitionDuration: "inherit",
    transitionDuration: "inherit",
    width: layoutInfo.rect.width,
    height: layoutInfo.rect.height,
    opacity: layoutInfo.opacity,
    zIndex: layoutInfo.zIndex,
    transform: layoutInfo.transform,
    contain: "size layout style"
  };
  $ccf8a0a04e4175ae$var$cache.set(layoutInfo, style);
  return style;
}
function $6d0a5c394373ae64$var$Virtualizer(props, ref) {
  let { children: renderView, renderWrapper, layout, collection, sizeToFit, scrollDirection, transitionDuration, isLoading, onLoadMore, focusedKey, shouldUseVirtualFocus, scrollToItem, autoFocus, ...otherProps } = props;
  let fallbackRef = (0, import_react20.useRef)();
  ref = ref || fallbackRef;
  let state = (0, $fc0b13b484ac1194$export$1505db82fe357e65)({
    transitionDuration,
    layout,
    collection,
    renderView,
    renderWrapper: renderWrapper || $6d0a5c394373ae64$var$defaultRenderWrapper,
    onVisibleRectChange(rect) {
      ref.current.scrollLeft = rect.x;
      ref.current.scrollTop = rect.y;
    }
  });
  let { virtualizerProps, scrollViewProps } = $6d0a5c394373ae64$export$dd6d526d88b5a137(props, state, ref);
  return /* @__PURE__ */ (0, import_react20.default).createElement((0, $44a6ee657928b002$export$5665e3d6be6adea), {
    ...(0, $3ef42575df84b30b$export$9d1611c77c2fe928)(otherProps, virtualizerProps, scrollViewProps),
    ref,
    innerStyle: state.isAnimating ? {
      transition: `none ${state.virtualizer.transitionDuration}ms`
    } : void 0,
    contentSize: state.contentSize,
    onScrollStart: state.startScrolling,
    onScrollEnd: state.endScrolling,
    sizeToFit,
    scrollDirection
  }, state.visibleViews);
}
function $6d0a5c394373ae64$export$dd6d526d88b5a137(props, state, ref) {
  let { focusedKey, scrollToItem, shouldUseVirtualFocus, isLoading, onLoadMore } = props;
  let { virtualizer } = state;
  let lastFocusedKey = (0, import_react20.useRef)(null);
  let isFocusWithin = (0, import_react20.useRef)(false);
  let autoFocus = (0, import_react20.useRef)(props.autoFocus);
  (0, import_react20.useEffect)(() => {
    if (virtualizer.visibleRect.height === 0)
      return;
    let modality = (0, $507fabe10e71c6fb$export$630ff653c5ada6a9)();
    if (focusedKey !== lastFocusedKey.current && (modality !== "pointer" || autoFocus.current)) {
      autoFocus.current = false;
      if (scrollToItem)
        scrollToItem(focusedKey);
      else
        virtualizer.scrollToItem(focusedKey, {
          duration: 0
        });
    }
    lastFocusedKey.current = focusedKey;
  }, [
    focusedKey,
    virtualizer.visibleRect.height,
    virtualizer,
    lastFocusedKey,
    scrollToItem,
    ref
  ]);
  virtualizer.persistedKeys = (0, import_react20.useMemo)(() => focusedKey ? /* @__PURE__ */ new Set([
    focusedKey
  ]) : /* @__PURE__ */ new Set(), [
    focusedKey
  ]);
  let onFocus = (0, import_react20.useCallback)((e3) => {
    let modality = (0, $507fabe10e71c6fb$export$630ff653c5ada6a9)();
    if (!isFocusWithin.current && ref.current.contains(e3.target) && modality !== "pointer") {
      if (scrollToItem)
        scrollToItem(focusedKey);
      else
        virtualizer.scrollToItem(focusedKey, {
          duration: 0
        });
    }
    isFocusWithin.current = e3.target !== ref.current;
  }, [
    ref,
    virtualizer,
    focusedKey,
    scrollToItem
  ]);
  let onBlur = (0, import_react20.useCallback)((e3) => {
    isFocusWithin.current = ref.current.contains(e3.relatedTarget);
  }, [
    ref
  ]);
  let tabIndex;
  if (!shouldUseVirtualFocus) {
    tabIndex = focusedKey != null ? -1 : 0;
    if (virtualizer.collection.size === 0 && props.tabIndex != null)
      tabIndex = props.tabIndex;
  }
  let isLoadingRef = (0, import_react20.useRef)(isLoading);
  let prevProps = (0, import_react20.useRef)(props);
  let onVisibleRectChange = (0, import_react20.useCallback)((rect) => {
    state.setVisibleRect(rect);
    if (!isLoadingRef.current && onLoadMore) {
      let scrollOffset = state.virtualizer.contentSize.height - rect.height * 2;
      if (rect.y > scrollOffset) {
        isLoadingRef.current = true;
        onLoadMore();
      }
    }
  }, [
    onLoadMore,
    state
  ]);
  let lastContentSize = (0, import_react20.useRef)(0);
  (0, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(() => {
    if (state.isAnimating)
      return;
    let wasLoading = isLoadingRef.current;
    if (props !== prevProps.current) {
      isLoadingRef.current = isLoading;
      prevProps.current = props;
    }
    let shouldLoadMore = !isLoadingRef.current && onLoadMore && state.contentSize.height > 0 && state.contentSize.height <= state.virtualizer.visibleRect.height && (wasLoading || state.contentSize.height !== lastContentSize.current);
    if (shouldLoadMore) {
      isLoadingRef.current = true;
      onLoadMore();
    }
    lastContentSize.current = state.contentSize.height;
  }, [
    state.contentSize,
    state.isAnimating,
    state.virtualizer,
    isLoading,
    onLoadMore,
    props
  ]);
  return {
    virtualizerProps: {
      tabIndex,
      onFocus,
      onBlur
    },
    scrollViewProps: {
      onVisibleRectChange
    }
  };
}
var $6d0a5c394373ae64$export$89be5a243e59c4b2 = /* @__PURE__ */ (0, import_react20.default).forwardRef($6d0a5c394373ae64$var$Virtualizer);
function $6d0a5c394373ae64$var$defaultRenderWrapper(parent, reusableView) {
  return /* @__PURE__ */ (0, import_react20.default).createElement((0, $ccf8a0a04e4175ae$export$6796df8ba7398521), {
    key: reusableView.key,
    layoutInfo: reusableView.layoutInfo,
    virtualizer: reusableView.virtualizer,
    parent: parent === null || parent === void 0 ? void 0 : parent.layoutInfo
  }, reusableView.rendered);
}

// node_modules/@react-aria/separator/dist/import.mjs
function $f4b273590fab9f93$export$52210f68a14655d0(props) {
  let domProps = (0, $65484d02dcb7eb3e$export$457c3d6518dd4c6f)(props, {
    labelable: true
  });
  let ariaOrientation;
  if (props.orientation === "vertical")
    ariaOrientation = "vertical";
  if (props.elementType !== "hr")
    return {
      separatorProps: {
        ...domProps,
        role: "separator",
        "aria-orientation": ariaOrientation
      }
    };
  return {
    separatorProps: domProps
  };
}

// node_modules/@react-stately/layout/dist/import.mjs
var $61ef60fc9b1041f4$var$DEFAULT_HEIGHT = 48;
var $61ef60fc9b1041f4$export$cacbb3924155d68e = class extends (0, $c74cda7d31af1253$export$c84671f46d6a1ca) {
  getLayoutInfo(key) {
    let res = this.layoutInfos.get(key);
    if (!res && this.validRect.area < this.contentSize.area && this.lastCollection) {
      this.lastValidRect = this.validRect;
      this.validRect = new (0, $60423f92c7f9ad87$export$c79fc6492f3af13d)(0, 0, Infinity, Infinity);
      this.rootNodes = this.buildCollection();
      this.validRect = new (0, $60423f92c7f9ad87$export$c79fc6492f3af13d)(0, 0, this.contentSize.width, this.contentSize.height);
      res = this.layoutInfos.get(key);
    }
    return res;
  }
  getVisibleLayoutInfos(rect) {
    if (!this.validRect.containsRect(rect) && this.lastCollection) {
      this.lastValidRect = this.validRect;
      this.validRect = this.validRect.union(rect);
      this.rootNodes = this.buildCollection();
    }
    let res = [];
    let addNodes = (nodes) => {
      for (let node56 of nodes)
        if (this.isVisible(node56, rect)) {
          res.push(node56.layoutInfo);
          if (node56.header)
            res.push(node56.header);
          if (node56.children)
            addNodes(node56.children);
        }
    };
    addNodes(this.rootNodes);
    return res;
  }
  isVisible(node56, rect) {
    return node56.layoutInfo.rect.intersects(rect) || node56.layoutInfo.isSticky || this.virtualizer.isPersistedKey(node56.layoutInfo.key);
  }
  shouldInvalidateEverything(invalidationContext) {
    return invalidationContext.sizeChanged;
  }
  validate(invalidationContext) {
    this.collection = this.virtualizer.collection;
    this.invalidateEverything = this.shouldInvalidateEverything(invalidationContext);
    if (this.invalidateEverything) {
      this.lastValidRect = this.validRect;
      this.validRect = this.virtualizer.getVisibleRect();
    }
    this.rootNodes = this.buildCollection();
    if (this.lastCollection && this.collection !== this.lastCollection) {
      for (let key of this.lastCollection.getKeys())
        if (!this.collection.getItem(key)) {
          let layoutNode = this.layoutNodes.get(key);
          if (layoutNode) {
            var _layoutNode_header;
            this.layoutInfos.delete(layoutNode.layoutInfo.key);
            this.layoutInfos.delete((_layoutNode_header = layoutNode.header) === null || _layoutNode_header === void 0 ? void 0 : _layoutNode_header.key);
            this.layoutNodes.delete(key);
          }
        }
    }
    this.lastWidth = this.virtualizer.visibleRect.width;
    this.lastCollection = this.collection;
    this.invalidateEverything = false;
  }
  buildCollection() {
    let y2 = this.padding;
    let skipped = 0;
    let nodes = [];
    for (let node56 of this.collection) {
      var _this_rowHeight;
      let rowHeight = (_this_rowHeight = this.rowHeight) !== null && _this_rowHeight !== void 0 ? _this_rowHeight : this.estimatedRowHeight;
      if (node56.type === "item" && y2 + rowHeight < this.validRect.y && !this.isValid(node56, y2)) {
        y2 += rowHeight;
        skipped++;
        continue;
      }
      let layoutNode = this.buildChild(node56, 0, y2);
      y2 = layoutNode.layoutInfo.rect.maxY;
      nodes.push(layoutNode);
      if (node56.type === "item" && y2 > this.validRect.maxY) {
        y2 += (this.collection.size - (nodes.length + skipped)) * rowHeight;
        break;
      }
    }
    if (this.isLoading) {
      var _this_loaderHeight;
      let rect = new (0, $60423f92c7f9ad87$export$c79fc6492f3af13d)(0, y2, this.virtualizer.visibleRect.width, (_this_loaderHeight = this.loaderHeight) !== null && _this_loaderHeight !== void 0 ? _this_loaderHeight : this.virtualizer.visibleRect.height);
      let loader = new (0, $d7fd61009c21d0bb$export$7e0eeb9da702a085)("loader", "loader", rect);
      this.layoutInfos.set("loader", loader);
      nodes.push({
        layoutInfo: loader
      });
      y2 = loader.rect.maxY;
    }
    if (nodes.length === 0) {
      var _this_placeholderHeight;
      let rect = new (0, $60423f92c7f9ad87$export$c79fc6492f3af13d)(0, y2, this.virtualizer.visibleRect.width, (_this_placeholderHeight = this.placeholderHeight) !== null && _this_placeholderHeight !== void 0 ? _this_placeholderHeight : this.virtualizer.visibleRect.height);
      let placeholder2 = new (0, $d7fd61009c21d0bb$export$7e0eeb9da702a085)("placeholder", "placeholder", rect);
      this.layoutInfos.set("placeholder", placeholder2);
      nodes.push({
        layoutInfo: placeholder2
      });
      y2 = placeholder2.rect.maxY;
    }
    this.contentSize = new (0, $ee1bfa90a957fb8a$export$cb6da89c6af1a8ec)(this.virtualizer.visibleRect.width, y2 + this.padding);
    return nodes;
  }
  isValid(node56, y2) {
    let cached = this.layoutNodes.get(node56.key);
    return !this.invalidateEverything && cached && cached.node === node56 && y2 === (cached.header || cached.layoutInfo).rect.y && cached.layoutInfo.rect.intersects(this.lastValidRect) && cached.validRect.containsRect(cached.layoutInfo.rect.intersection(this.validRect));
  }
  buildChild(node56, x2, y2) {
    if (this.isValid(node56, y2))
      return this.layoutNodes.get(node56.key);
    let layoutNode = this.buildNode(node56, x2, y2);
    layoutNode.node = node56;
    var _node_parentKey;
    layoutNode.layoutInfo.parentKey = (_node_parentKey = node56.parentKey) !== null && _node_parentKey !== void 0 ? _node_parentKey : null;
    this.layoutInfos.set(layoutNode.layoutInfo.key, layoutNode.layoutInfo);
    if (layoutNode.header)
      this.layoutInfos.set(layoutNode.header.key, layoutNode.header);
    this.layoutNodes.set(node56.key, layoutNode);
    return layoutNode;
  }
  buildNode(node56, x2, y2) {
    switch (node56.type) {
      case "section":
        return this.buildSection(node56, x2, y2);
      case "item":
        return this.buildItem(node56, x2, y2);
    }
  }
  buildSection(node56, x2, y2) {
    let width = this.virtualizer.visibleRect.width;
    let rectHeight = this.headingHeight;
    let isEstimated = false;
    if (rectHeight == null) {
      let previousLayoutNode = this.layoutNodes.get(node56.key);
      if (previousLayoutNode && previousLayoutNode.header) {
        let curNode = this.collection.getItem(node56.key);
        let lastNode = this.lastCollection ? this.lastCollection.getItem(node56.key) : null;
        rectHeight = previousLayoutNode.header.rect.height;
        isEstimated = width !== this.lastWidth || curNode !== lastNode || previousLayoutNode.header.estimatedSize;
      } else {
        rectHeight = node56.rendered ? this.estimatedHeadingHeight : 0;
        isEstimated = true;
      }
    }
    if (rectHeight == null)
      rectHeight = $61ef60fc9b1041f4$var$DEFAULT_HEIGHT;
    let headerRect = new (0, $60423f92c7f9ad87$export$c79fc6492f3af13d)(0, y2, width, rectHeight);
    let header = new (0, $d7fd61009c21d0bb$export$7e0eeb9da702a085)("header", node56.key + ":header", headerRect);
    header.estimatedSize = isEstimated;
    header.parentKey = node56.key;
    y2 += header.rect.height;
    let rect = new (0, $60423f92c7f9ad87$export$c79fc6492f3af13d)(0, y2, width, 0);
    let layoutInfo = new (0, $d7fd61009c21d0bb$export$7e0eeb9da702a085)(node56.type, node56.key, rect);
    let startY = y2;
    let skipped = 0;
    let children = [];
    for (let child of (0, $c5a24bc478652b5f$export$1005530eda016c13)(node56, this.collection)) {
      var _this_rowHeight;
      let rowHeight = (_this_rowHeight = this.rowHeight) !== null && _this_rowHeight !== void 0 ? _this_rowHeight : this.estimatedRowHeight;
      if (y2 + rowHeight < this.validRect.y && !this.isValid(node56, y2)) {
        y2 += rowHeight;
        skipped++;
        continue;
      }
      let layoutNode = this.buildChild(child, x2, y2);
      y2 = layoutNode.layoutInfo.rect.maxY;
      children.push(layoutNode);
      if (y2 > this.validRect.maxY) {
        y2 += ([
          ...(0, $c5a24bc478652b5f$export$1005530eda016c13)(node56, this.collection)
        ].length - (children.length + skipped)) * rowHeight;
        break;
      }
    }
    rect.height = y2 - startY;
    return {
      header,
      layoutInfo,
      children,
      validRect: layoutInfo.rect.intersection(this.validRect)
    };
  }
  buildItem(node56, x2, y2) {
    let width = this.virtualizer.visibleRect.width;
    let rectHeight = this.rowHeight;
    let isEstimated = false;
    if (rectHeight == null) {
      let previousLayoutNode = this.layoutNodes.get(node56.key);
      if (previousLayoutNode) {
        rectHeight = previousLayoutNode.layoutInfo.rect.height;
        isEstimated = width !== this.lastWidth || node56 !== previousLayoutNode.node || previousLayoutNode.layoutInfo.estimatedSize;
      } else {
        rectHeight = this.estimatedRowHeight;
        isEstimated = true;
      }
    }
    if (rectHeight == null)
      rectHeight = $61ef60fc9b1041f4$var$DEFAULT_HEIGHT;
    if (typeof this.indentationForItem === "function")
      x2 += this.indentationForItem(this.collection, node56.key) || 0;
    let rect = new (0, $60423f92c7f9ad87$export$c79fc6492f3af13d)(x2, y2, width - x2, rectHeight);
    let layoutInfo = new (0, $d7fd61009c21d0bb$export$7e0eeb9da702a085)(node56.type, node56.key, rect);
    layoutInfo.allowOverflow = true;
    layoutInfo.estimatedSize = isEstimated;
    return {
      layoutInfo,
      validRect: layoutInfo.rect
    };
  }
  updateItemSize(key, size) {
    let layoutInfo = this.layoutInfos.get(key);
    if (!layoutInfo)
      return false;
    layoutInfo.estimatedSize = false;
    if (layoutInfo.rect.height !== size.height) {
      let newLayoutInfo = layoutInfo.copy();
      newLayoutInfo.rect.height = size.height;
      this.layoutInfos.set(key, newLayoutInfo);
      this.updateLayoutNode(key, layoutInfo, newLayoutInfo);
      let node56 = this.collection.getItem(layoutInfo.parentKey);
      while (node56) {
        this.updateLayoutNode(node56.key, layoutInfo, newLayoutInfo);
        node56 = this.collection.getItem(node56.parentKey);
      }
      return true;
    }
    return false;
  }
  updateLayoutNode(key, oldLayoutInfo, newLayoutInfo) {
    let n2 = this.layoutNodes.get(key);
    if (n2) {
      n2.validRect = new (0, $60423f92c7f9ad87$export$c79fc6492f3af13d)();
      if (n2.header === oldLayoutInfo)
        n2.header = newLayoutInfo;
      else if (n2.layoutInfo === oldLayoutInfo)
        n2.layoutInfo = newLayoutInfo;
    }
  }
  getContentSize() {
    return this.contentSize;
  }
  getKeyAbove(key) {
    let collection = this.collection;
    key = collection.getKeyBefore(key);
    while (key != null) {
      let item = collection.getItem(key);
      if (item.type === "item" && (this.allowDisabledKeyFocus || !this.disabledKeys.has(item.key)))
        return key;
      key = collection.getKeyBefore(key);
    }
  }
  getKeyBelow(key) {
    let collection = this.collection;
    key = collection.getKeyAfter(key);
    while (key != null) {
      let item = collection.getItem(key);
      if (item.type === "item" && (this.allowDisabledKeyFocus || !this.disabledKeys.has(item.key)))
        return key;
      key = collection.getKeyAfter(key);
    }
  }
  getKeyPageAbove(key) {
    let layoutInfo = this.getLayoutInfo(key);
    if (layoutInfo) {
      let pageY = Math.max(0, layoutInfo.rect.y + layoutInfo.rect.height - this.virtualizer.visibleRect.height);
      while (layoutInfo && layoutInfo.rect.y > pageY) {
        let keyAbove = this.getKeyAbove(layoutInfo.key);
        layoutInfo = this.getLayoutInfo(keyAbove);
      }
      if (layoutInfo)
        return layoutInfo.key;
    }
    return this.getFirstKey();
  }
  getKeyPageBelow(key) {
    let layoutInfo = this.getLayoutInfo(key != null ? key : this.getFirstKey());
    if (layoutInfo) {
      let pageY = Math.min(this.virtualizer.contentSize.height, layoutInfo.rect.y - layoutInfo.rect.height + this.virtualizer.visibleRect.height);
      while (layoutInfo && layoutInfo.rect.y < pageY) {
        let keyBelow = this.getKeyBelow(layoutInfo.key);
        layoutInfo = this.getLayoutInfo(keyBelow);
      }
      if (layoutInfo)
        return layoutInfo.key;
    }
    return this.getLastKey();
  }
  getFirstKey() {
    let collection = this.collection;
    let key = collection.getFirstKey();
    while (key != null) {
      let item = collection.getItem(key);
      if (item.type === "item" && (this.allowDisabledKeyFocus || !this.disabledKeys.has(item.key)))
        return key;
      key = collection.getKeyAfter(key);
    }
  }
  getLastKey() {
    let collection = this.collection;
    let key = collection.getLastKey();
    while (key != null) {
      let item = collection.getItem(key);
      if (item.type === "item" && (this.allowDisabledKeyFocus || !this.disabledKeys.has(item.key)))
        return key;
      key = collection.getKeyBefore(key);
    }
  }
  getKeyForSearch(search, fromKey) {
    if (!this.collator)
      return null;
    let collection = this.collection;
    let key = fromKey || this.getFirstKey();
    while (key != null) {
      let item = collection.getItem(key);
      let substring = item.textValue.slice(0, search.length);
      if (item.textValue && this.collator.compare(substring, search) === 0)
        return key;
      key = this.getKeyBelow(key);
    }
    return null;
  }
  getInitialLayoutInfo(layoutInfo) {
    layoutInfo.opacity = 0;
    layoutInfo.transform = "scale3d(0.8, 0.8, 0.8)";
    return layoutInfo;
  }
  getFinalLayoutInfo(layoutInfo) {
    layoutInfo.opacity = 0;
    layoutInfo.transform = "scale3d(0.8, 0.8, 0.8)";
    return layoutInfo;
  }
  getDropTargetFromPoint(x2, y2, isValidDropTarget) {
    x2 += this.virtualizer.visibleRect.x;
    y2 += this.virtualizer.visibleRect.y;
    let key = this.virtualizer.keyAtPoint(new (0, $3041db3296945e6e$export$baf26146a414f24a)(x2, y2));
    if (key == null || this.collection.size === 0)
      return {
        type: "root"
      };
    let layoutInfo = this.getLayoutInfo(key);
    let rect = layoutInfo.rect;
    let target = {
      type: "item",
      key: layoutInfo.key,
      dropPosition: "on"
    };
    if (!isValidDropTarget(target)) {
      if (y2 <= rect.y + rect.height / 2 && isValidDropTarget({
        ...target,
        dropPosition: "before"
      }))
        target.dropPosition = "before";
      else if (isValidDropTarget({
        ...target,
        dropPosition: "after"
      }))
        target.dropPosition = "after";
    } else if (y2 <= rect.y + 10 && isValidDropTarget({
      ...target,
      dropPosition: "before"
    }))
      target.dropPosition = "before";
    else if (y2 >= rect.maxY - 10 && isValidDropTarget({
      ...target,
      dropPosition: "after"
    }))
      target.dropPosition = "after";
    return target;
  }
  /**
  * Creates a new ListLayout with options. See the list of properties below for a description
  * of the options that can be provided.
  */
  constructor(options = {}) {
    super();
    this.disabledKeys = /* @__PURE__ */ new Set();
    this.allowDisabledKeyFocus = false;
    this.rowHeight = options.rowHeight;
    this.estimatedRowHeight = options.estimatedRowHeight;
    this.headingHeight = options.headingHeight;
    this.estimatedHeadingHeight = options.estimatedHeadingHeight;
    this.padding = options.padding || 0;
    this.indentationForItem = options.indentationForItem;
    this.collator = options.collator;
    this.loaderHeight = options.loaderHeight;
    this.placeholderHeight = options.placeholderHeight;
    this.layoutInfos = /* @__PURE__ */ new Map();
    this.layoutNodes = /* @__PURE__ */ new Map();
    this.rootNodes = [];
    this.lastWidth = 0;
    this.lastCollection = null;
    this.allowDisabledKeyFocus = options.allowDisabledKeyFocus;
    this.lastValidRect = new (0, $60423f92c7f9ad87$export$c79fc6492f3af13d)();
    this.validRect = new (0, $60423f92c7f9ad87$export$c79fc6492f3af13d)();
    this.contentSize = new (0, $ee1bfa90a957fb8a$export$cb6da89c6af1a8ec)();
  }
};

// node_modules/@react-stately/list/dist/module.js
var import_react22 = __toESM(require_react());

// node_modules/@react-stately/selection/dist/import.mjs
var import_react21 = __toESM(require_react(), 1);
var $e40ea825a81a3709$export$52baac22726c72bf = class _$e40ea825a81a3709$export$52baac22726c72bf extends Set {
  constructor(keys4, anchorKey, currentKey) {
    super(keys4);
    if (keys4 instanceof _$e40ea825a81a3709$export$52baac22726c72bf) {
      this.anchorKey = anchorKey || keys4.anchorKey;
      this.currentKey = currentKey || keys4.currentKey;
    } else {
      this.anchorKey = anchorKey;
      this.currentKey = currentKey;
    }
  }
};
function $7af3f5b51489e0b5$var$equalSets(setA, setB) {
  if (setA.size !== setB.size)
    return false;
  for (let item of setA) {
    if (!setB.has(item))
      return false;
  }
  return true;
}
function $7af3f5b51489e0b5$export$253fe78d46329472(props) {
  let { selectionMode = "none", disallowEmptySelection, allowDuplicateSelectionEvents, selectionBehavior: selectionBehaviorProp = "toggle", disabledBehavior = "all" } = props;
  let isFocusedRef = (0, import_react21.useRef)(false);
  let [, setFocused] = (0, import_react21.useState)(false);
  let focusedKeyRef = (0, import_react21.useRef)(null);
  let childFocusStrategyRef = (0, import_react21.useRef)(null);
  let [, setFocusedKey] = (0, import_react21.useState)(null);
  let selectedKeysProp = (0, import_react21.useMemo)(() => $7af3f5b51489e0b5$var$convertSelection(props.selectedKeys), [
    props.selectedKeys
  ]);
  let defaultSelectedKeys = (0, import_react21.useMemo)(() => $7af3f5b51489e0b5$var$convertSelection(props.defaultSelectedKeys, new (0, $e40ea825a81a3709$export$52baac22726c72bf)()), [
    props.defaultSelectedKeys
  ]);
  let [selectedKeys, setSelectedKeys] = (0, $458b0a5536c1a7cf$export$40bfa8c7b0832715)(selectedKeysProp, defaultSelectedKeys, props.onSelectionChange);
  let disabledKeysProp = (0, import_react21.useMemo)(() => props.disabledKeys ? new Set(props.disabledKeys) : /* @__PURE__ */ new Set(), [
    props.disabledKeys
  ]);
  let [selectionBehavior, setSelectionBehavior] = (0, import_react21.useState)(selectionBehaviorProp);
  if (selectionBehaviorProp === "replace" && selectionBehavior === "toggle" && typeof selectedKeys === "object" && selectedKeys.size === 0)
    setSelectionBehavior("replace");
  let lastSelectionBehavior = (0, import_react21.useRef)(selectionBehaviorProp);
  (0, import_react21.useEffect)(() => {
    if (selectionBehaviorProp !== lastSelectionBehavior.current) {
      setSelectionBehavior(selectionBehaviorProp);
      lastSelectionBehavior.current = selectionBehaviorProp;
    }
  }, [
    selectionBehaviorProp
  ]);
  return {
    selectionMode,
    disallowEmptySelection,
    selectionBehavior,
    setSelectionBehavior,
    get isFocused() {
      return isFocusedRef.current;
    },
    setFocused(f) {
      isFocusedRef.current = f;
      setFocused(f);
    },
    get focusedKey() {
      return focusedKeyRef.current;
    },
    get childFocusStrategy() {
      return childFocusStrategyRef.current;
    },
    setFocusedKey(k2, childFocusStrategy = "first") {
      focusedKeyRef.current = k2;
      childFocusStrategyRef.current = childFocusStrategy;
      setFocusedKey(k2);
    },
    selectedKeys,
    setSelectedKeys(keys4) {
      if (allowDuplicateSelectionEvents || !$7af3f5b51489e0b5$var$equalSets(keys4, selectedKeys))
        setSelectedKeys(keys4);
    },
    disabledKeys: disabledKeysProp,
    disabledBehavior
  };
}
function $7af3f5b51489e0b5$var$convertSelection(selection2, defaultValue) {
  if (!selection2)
    return defaultValue;
  return selection2 === "all" ? "all" : new (0, $e40ea825a81a3709$export$52baac22726c72bf)(selection2);
}
var $d496c0a20b6e58ec$export$6c8a5aaad13c9852 = class {
  /**
  * The type of selection that is allowed in the collection.
  */
  get selectionMode() {
    return this.state.selectionMode;
  }
  /**
  * Whether the collection allows empty selection.
  */
  get disallowEmptySelection() {
    return this.state.disallowEmptySelection;
  }
  /**
  * The selection behavior for the collection.
  */
  get selectionBehavior() {
    return this.state.selectionBehavior;
  }
  /**
  * Sets the selection behavior for the collection.
  */
  setSelectionBehavior(selectionBehavior) {
    this.state.setSelectionBehavior(selectionBehavior);
  }
  /**
  * Whether the collection is currently focused.
  */
  get isFocused() {
    return this.state.isFocused;
  }
  /**
  * Sets whether the collection is focused.
  */
  setFocused(isFocused) {
    this.state.setFocused(isFocused);
  }
  /**
  * The current focused key in the collection.
  */
  get focusedKey() {
    return this.state.focusedKey;
  }
  /** Whether the first or last child of the focused key should receive focus. */
  get childFocusStrategy() {
    return this.state.childFocusStrategy;
  }
  /**
  * Sets the focused key.
  */
  setFocusedKey(key, childFocusStrategy) {
    if (key == null || this.collection.getItem(key))
      this.state.setFocusedKey(key, childFocusStrategy);
  }
  /**
  * The currently selected keys in the collection.
  */
  get selectedKeys() {
    return this.state.selectedKeys === "all" ? new Set(this.getSelectAllKeys()) : this.state.selectedKeys;
  }
  /**
  * The raw selection value for the collection.
  * Either 'all' for select all, or a set of keys.
  */
  get rawSelection() {
    return this.state.selectedKeys;
  }
  /**
  * Returns whether a key is selected.
  */
  isSelected(key) {
    if (this.state.selectionMode === "none")
      return false;
    key = this.getKey(key);
    return this.state.selectedKeys === "all" ? this.canSelectItem(key) : this.state.selectedKeys.has(key);
  }
  /**
  * Whether the selection is empty.
  */
  get isEmpty() {
    return this.state.selectedKeys !== "all" && this.state.selectedKeys.size === 0;
  }
  /**
  * Whether all items in the collection are selected.
  */
  get isSelectAll() {
    if (this.isEmpty)
      return false;
    if (this.state.selectedKeys === "all")
      return true;
    if (this._isSelectAll != null)
      return this._isSelectAll;
    let allKeys = this.getSelectAllKeys();
    let selectedKeys = this.state.selectedKeys;
    this._isSelectAll = allKeys.every((k2) => selectedKeys.has(k2));
    return this._isSelectAll;
  }
  get firstSelectedKey() {
    let first = null;
    for (let key of this.state.selectedKeys) {
      let item = this.collection.getItem(key);
      if (!first || item && (0, $c5a24bc478652b5f$export$8c434b3a7a4dad6)(this.collection, item, first) < 0)
        first = item;
    }
    return first === null || first === void 0 ? void 0 : first.key;
  }
  get lastSelectedKey() {
    let last = null;
    for (let key of this.state.selectedKeys) {
      let item = this.collection.getItem(key);
      if (!last || item && (0, $c5a24bc478652b5f$export$8c434b3a7a4dad6)(this.collection, item, last) > 0)
        last = item;
    }
    return last === null || last === void 0 ? void 0 : last.key;
  }
  get disabledKeys() {
    return this.state.disabledKeys;
  }
  get disabledBehavior() {
    return this.state.disabledBehavior;
  }
  /**
  * Extends the selection to the given key.
  */
  extendSelection(toKey) {
    if (this.selectionMode === "none")
      return;
    if (this.selectionMode === "single") {
      this.replaceSelection(toKey);
      return;
    }
    toKey = this.getKey(toKey);
    let selection2;
    if (this.state.selectedKeys === "all")
      selection2 = new (0, $e40ea825a81a3709$export$52baac22726c72bf)([
        toKey
      ], toKey, toKey);
    else {
      let selectedKeys = this.state.selectedKeys;
      let anchorKey = selectedKeys.anchorKey || toKey;
      selection2 = new (0, $e40ea825a81a3709$export$52baac22726c72bf)(selectedKeys, anchorKey, toKey);
      for (let key of this.getKeyRange(anchorKey, selectedKeys.currentKey || toKey))
        selection2.delete(key);
      for (let key of this.getKeyRange(toKey, anchorKey))
        if (this.canSelectItem(key))
          selection2.add(key);
    }
    this.state.setSelectedKeys(selection2);
  }
  getKeyRange(from2, to) {
    let fromItem = this.collection.getItem(from2);
    let toItem = this.collection.getItem(to);
    if (fromItem && toItem) {
      if ((0, $c5a24bc478652b5f$export$8c434b3a7a4dad6)(this.collection, fromItem, toItem) <= 0)
        return this.getKeyRangeInternal(from2, to);
      return this.getKeyRangeInternal(to, from2);
    }
    return [];
  }
  getKeyRangeInternal(from2, to) {
    let keys4 = [];
    let key = from2;
    while (key) {
      let item = this.collection.getItem(key);
      if (item && item.type === "item" || item.type === "cell" && this.allowsCellSelection)
        keys4.push(key);
      if (key === to)
        return keys4;
      key = this.collection.getKeyAfter(key);
    }
    return [];
  }
  getKey(key) {
    let item = this.collection.getItem(key);
    if (!item)
      return key;
    if (item.type === "cell" && this.allowsCellSelection)
      return key;
    while (item.type !== "item" && item.parentKey != null)
      item = this.collection.getItem(item.parentKey);
    if (!item || item.type !== "item")
      return null;
    return item.key;
  }
  /**
  * Toggles whether the given key is selected.
  */
  toggleSelection(key) {
    if (this.selectionMode === "none")
      return;
    if (this.selectionMode === "single" && !this.isSelected(key)) {
      this.replaceSelection(key);
      return;
    }
    key = this.getKey(key);
    if (key == null)
      return;
    let keys4 = new (0, $e40ea825a81a3709$export$52baac22726c72bf)(this.state.selectedKeys === "all" ? this.getSelectAllKeys() : this.state.selectedKeys);
    if (keys4.has(key))
      keys4.delete(key);
    else if (this.canSelectItem(key)) {
      keys4.add(key);
      keys4.anchorKey = key;
      keys4.currentKey = key;
    }
    if (this.disallowEmptySelection && keys4.size === 0)
      return;
    this.state.setSelectedKeys(keys4);
  }
  /**
  * Replaces the selection with only the given key.
  */
  replaceSelection(key) {
    if (this.selectionMode === "none")
      return;
    key = this.getKey(key);
    if (key == null)
      return;
    let selection2 = this.canSelectItem(key) ? new (0, $e40ea825a81a3709$export$52baac22726c72bf)([
      key
    ], key, key) : new (0, $e40ea825a81a3709$export$52baac22726c72bf)();
    this.state.setSelectedKeys(selection2);
  }
  /**
  * Replaces the selection with the given keys.
  */
  setSelectedKeys(keys4) {
    if (this.selectionMode === "none")
      return;
    let selection2 = new (0, $e40ea825a81a3709$export$52baac22726c72bf)();
    for (let key of keys4) {
      key = this.getKey(key);
      if (key != null) {
        selection2.add(key);
        if (this.selectionMode === "single")
          break;
      }
    }
    this.state.setSelectedKeys(selection2);
  }
  getSelectAllKeys() {
    let keys4 = [];
    let addKeys = (key) => {
      while (key) {
        if (this.canSelectItem(key)) {
          let item = this.collection.getItem(key);
          if (item.type === "item")
            keys4.push(key);
          if (item.hasChildNodes && (this.allowsCellSelection || item.type !== "item"))
            addKeys((0, $c5a24bc478652b5f$export$fbdeaa6a76694f71)((0, $c5a24bc478652b5f$export$1005530eda016c13)(item, this.collection)).key);
        }
        key = this.collection.getKeyAfter(key);
      }
    };
    addKeys(this.collection.getFirstKey());
    return keys4;
  }
  /**
  * Selects all items in the collection.
  */
  selectAll() {
    if (!this.isSelectAll && this.selectionMode === "multiple")
      this.state.setSelectedKeys("all");
  }
  /**
  * Removes all keys from the selection.
  */
  clearSelection() {
    if (!this.disallowEmptySelection && (this.state.selectedKeys === "all" || this.state.selectedKeys.size > 0))
      this.state.setSelectedKeys(new (0, $e40ea825a81a3709$export$52baac22726c72bf)());
  }
  /**
  * Toggles between select all and an empty selection.
  */
  toggleSelectAll() {
    if (this.isSelectAll)
      this.clearSelection();
    else
      this.selectAll();
  }
  select(key, e3) {
    if (this.selectionMode === "none")
      return;
    if (this.selectionMode === "single") {
      if (this.isSelected(key) && !this.disallowEmptySelection)
        this.toggleSelection(key);
      else
        this.replaceSelection(key);
    } else if (this.selectionBehavior === "toggle" || e3 && (e3.pointerType === "touch" || e3.pointerType === "virtual"))
      this.toggleSelection(key);
    else
      this.replaceSelection(key);
  }
  /**
  * Returns whether the current selection is equal to the given selection.
  */
  isSelectionEqual(selection2) {
    if (selection2 === this.state.selectedKeys)
      return true;
    let selectedKeys = this.selectedKeys;
    if (selection2.size !== selectedKeys.size)
      return false;
    for (let key of selection2) {
      if (!selectedKeys.has(key))
        return false;
    }
    for (let key of selectedKeys) {
      if (!selection2.has(key))
        return false;
    }
    return true;
  }
  canSelectItem(key) {
    if (this.state.selectionMode === "none" || this.state.disabledKeys.has(key))
      return false;
    let item = this.collection.getItem(key);
    if (!item || item.type === "cell" && !this.allowsCellSelection)
      return false;
    return true;
  }
  isDisabled(key) {
    return this.state.disabledKeys.has(key) && this.state.disabledBehavior === "all";
  }
  isLink(key) {
    var _this_collection_getItem, _this_collection_getItem_props;
    return !!((_this_collection_getItem = this.collection.getItem(key)) === null || _this_collection_getItem === void 0 ? void 0 : (_this_collection_getItem_props = _this_collection_getItem.props) === null || _this_collection_getItem_props === void 0 ? void 0 : _this_collection_getItem_props.href);
  }
  constructor(collection, state, options) {
    this.collection = collection;
    this.state = state;
    var _options_allowsCellSelection;
    this.allowsCellSelection = (_options_allowsCellSelection = options === null || options === void 0 ? void 0 : options.allowsCellSelection) !== null && _options_allowsCellSelection !== void 0 ? _options_allowsCellSelection : false;
    this._isSelectAll = null;
  }
};

// node_modules/@react-stately/list/node_modules/@swc/helpers/esm/_define_property.js
function _define_property(obj, key, value) {
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else
    obj[key] = value;
  return obj;
}

// node_modules/@react-stately/list/dist/module.js
var $a02d57049d202695$var$_Symbol_iterator = Symbol.iterator;
var $a02d57049d202695$export$d085fb9e920b5ca7 = class {
  *[$a02d57049d202695$var$_Symbol_iterator]() {
    yield* this.iterable;
  }
  get size() {
    return this.keyMap.size;
  }
  getKeys() {
    return this.keyMap.keys();
  }
  getKeyBefore(key) {
    let node56 = this.keyMap.get(key);
    return node56 ? node56.prevKey : null;
  }
  getKeyAfter(key) {
    let node56 = this.keyMap.get(key);
    return node56 ? node56.nextKey : null;
  }
  getFirstKey() {
    return this.firstKey;
  }
  getLastKey() {
    return this.lastKey;
  }
  getItem(key) {
    return this.keyMap.get(key);
  }
  at(idx) {
    const keys4 = [
      ...this.getKeys()
    ];
    return this.getItem(keys4[idx]);
  }
  constructor(nodes) {
    (0, _define_property)(this, "keyMap", /* @__PURE__ */ new Map());
    this.iterable = nodes;
    let visit = (node56) => {
      this.keyMap.set(node56.key, node56);
      if (node56.childNodes && node56.type === "section")
        for (let child of node56.childNodes)
          visit(child);
    };
    for (let node56 of nodes)
      visit(node56);
    let last;
    let index = 0;
    for (let [key, node1] of this.keyMap) {
      if (last) {
        last.nextKey = key;
        node1.prevKey = last.key;
      } else {
        this.firstKey = key;
        node1.prevKey = void 0;
      }
      if (node1.type === "item")
        node1.index = index++;
      last = node1;
      last.nextKey = void 0;
    }
    this.lastKey = last === null || last === void 0 ? void 0 : last.key;
  }
};
function $e72dd72e1c76a225$export$2f645645f7bca764(props) {
  let { filter } = props;
  let selectionState = (0, $7af3f5b51489e0b5$export$253fe78d46329472)(props);
  let disabledKeys = (0, import_react22.useMemo)(() => props.disabledKeys ? new Set(props.disabledKeys) : /* @__PURE__ */ new Set(), [
    props.disabledKeys
  ]);
  let factory = (nodes) => filter ? new (0, $a02d57049d202695$export$d085fb9e920b5ca7)(filter(nodes)) : new (0, $a02d57049d202695$export$d085fb9e920b5ca7)(nodes);
  let context2 = (0, import_react22.useMemo)(() => ({
    suppressTextValueWarning: props.suppressTextValueWarning
  }), [
    props.suppressTextValueWarning
  ]);
  let collection = (0, $7613b1592d41b092$export$6cd28814d92fa9c9)(props, factory, context2, [
    filter
  ]);
  (0, import_react22.useEffect)(() => {
    if (selectionState.focusedKey != null && !collection.getItem(selectionState.focusedKey))
      selectionState.setFocusedKey(null);
  }, [
    collection,
    selectionState.focusedKey
  ]);
  return {
    collection,
    disabledKeys,
    selectionManager: new (0, $d496c0a20b6e58ec$export$6c8a5aaad13c9852)(collection, selectionState)
  };
}

// node_modules/@react-aria/select/dist/import.mjs
var import_react24 = __toESM(require_react(), 1);

// node_modules/@react-aria/menu/dist/import.mjs
var import_react23 = __toESM(require_react(), 1);
function $parcel$interopDefault2(a2) {
  return a2 && a2.__esModule ? a2.default : a2;
}
var $2cbb7ca666678a14$exports = {};
var $c0398ad35c3639b7$exports = {};
$c0398ad35c3639b7$exports = {
  "longPressMessage": `\u0627\u0636\u063A\u0637 \u0645\u0637\u0648\u0644\u0627\u064B \u0623\u0648 \u0627\u0636\u063A\u0637 \u0639\u0644\u0649 Alt + \u0627\u0644\u0633\u0647\u0645 \u0644\u0623\u0633\u0641\u0644 \u0644\u0641\u062A\u062D \u0627\u0644\u0642\u0627\u0626\u0645\u0629`
};
var $7af657c4165927c3$exports = {};
$7af657c4165927c3$exports = {
  "longPressMessage": `\u041D\u0430\u0442\u0438\u0441\u043D\u0435\u0442\u0435 \u043F\u0440\u043E\u0434\u044A\u043B\u0436\u0438\u0442\u0435\u043B\u043D\u043E \u0438\u043B\u0438 \u043D\u0430\u0442\u0438\u0441\u043D\u0435\u0442\u0435 Alt+ \u0441\u0442\u0440\u0435\u043B\u043A\u0430 \u043D\u0430\u0434\u043E\u043B\u0443, \u0437\u0430 \u0434\u0430 \u043E\u0442\u0432\u043E\u0440\u0438\u0442\u0435 \u043C\u0435\u043D\u044E\u0442\u043E`
};
var $d95d4da6d531ab81$exports = {};
$d95d4da6d531ab81$exports = {
  "longPressMessage": `Dlouh\xFDm stiskem nebo stisknut\xEDm kl\xE1ves Alt + \u0161ipka dol\u016F otev\u0159ete nab\xEDdku`
};
var $24ebda9c775dca17$exports = {};
$24ebda9c775dca17$exports = {
  "longPressMessage": `Langt tryk eller tryk p\xE5 Alt + pil ned for at \xE5bne menuen`
};
var $743e0dfca6cab1e9$exports = {};
$743e0dfca6cab1e9$exports = {
  "longPressMessage": `Dr\xFCcken Sie lange oder dr\xFCcken Sie Alt + Nach-unten, um das Men\xFC zu \xF6ffnen`
};
var $a2f41026e05f1c84$exports = {};
$a2f41026e05f1c84$exports = {
  "longPressMessage": `\u03A0\u03B9\u03AD\u03C3\u03C4\u03B5 \u03C0\u03B1\u03C1\u03B1\u03C4\u03B5\u03C4\u03B1\u03BC\u03AD\u03BD\u03B1 \u03AE \u03C0\u03B1\u03C4\u03AE\u03C3\u03C4\u03B5 Alt + \u03BA\u03AC\u03C4\u03C9 \u03B2\u03AD\u03BB\u03BF\u03C2 \u03B3\u03B9\u03B1 \u03BD\u03B1 \u03B1\u03BD\u03BF\u03AF\u03BE\u03B5\u03C4\u03B5 \u03C4\u03BF \u03BC\u03B5\u03BD\u03BF\u03CD`
};
var $43b800e97c901737$exports = {};
$43b800e97c901737$exports = {
  "longPressMessage": `Long press or press Alt + ArrowDown to open menu`
};
var $442f5f6ac211e29f$exports = {};
$442f5f6ac211e29f$exports = {
  "longPressMessage": `Mantenga pulsado o pulse Alt + flecha abajo para abrir el men\xFA`
};
var $dff280acfeb2d8ac$exports = {};
$dff280acfeb2d8ac$exports = {
  "longPressMessage": `Men\xFC\xFC avamiseks vajutage pikalt v\xF5i vajutage klahve Alt + allanool`
};
var $51608325613944d7$exports = {};
$51608325613944d7$exports = {
  "longPressMessage": `Avaa valikko painamalla pohjassa tai n\xE4pp\xE4inyhdistelm\xE4ll\xE4 Alt + Alanuoli`
};
var $c4a1b1eabeaa87be$exports = {};
$c4a1b1eabeaa87be$exports = {
  "longPressMessage": `Appuyez de mani\xE8re prolong\xE9e ou appuyez sur Alt\xA0+\xA0Fl\xE8che vers le bas pour ouvrir le menu.`
};
var $8c74815cdee18d1b$exports = {};
$8c74815cdee18d1b$exports = {
  "longPressMessage": `\u05DC\u05D7\u05E5 \u05DC\u05D7\u05D9\u05E6\u05D4 \u05D0\u05E8\u05D5\u05DB\u05D4 \u05D0\u05D5 \u05D4\u05E7\u05E9 Alt + ArrowDown \u05DB\u05D3\u05D9 \u05DC\u05E4\u05EA\u05D5\u05D7 \u05D0\u05EA \u05D4\u05EA\u05E4\u05E8\u05D9\u05D8`
};
var $fd0e9ef6a7fe0ec9$exports = {};
$fd0e9ef6a7fe0ec9$exports = {
  "longPressMessage": `Dugo pritisnite ili pritisnite Alt + strelicu prema dolje za otvaranje izbornika`
};
var $a89a74a39eba465a$exports = {};
$a89a74a39eba465a$exports = {
  "longPressMessage": `Nyomja meg hosszan, vagy nyomja meg az Alt + lefele ny\xEDl gombot a men\xFC megnyit\xE1s\xE1hoz`
};
var $edc7c66594a0ae8a$exports = {};
$edc7c66594a0ae8a$exports = {
  "longPressMessage": `Premere a lungo o premere Alt + Freccia gi\xF9 per aprire il menu`
};
var $f1ab51510712db52$exports = {};
$f1ab51510712db52$exports = {
  "longPressMessage": `\u9577\u62BC\u3057\u307E\u305F\u306F Alt+\u4E0B\u77E2\u5370\u30AD\u30FC\u3067\u30E1\u30CB\u30E5\u30FC\u3092\u958B\u304F`
};
var $f9b672d9b82fa3d6$exports = {};
$f9b672d9b82fa3d6$exports = {
  "longPressMessage": `\uAE38\uAC8C \uB204\uB974\uAC70\uB098 Alt + \uC544\uB798\uCABD \uD654\uC0B4\uD45C\uB97C \uB20C\uB7EC \uBA54\uB274 \uC5F4\uAE30`
};
var $a385f3910feda499$exports = {};
$a385f3910feda499$exports = {
  "longPressMessage": `Nor\u0117dami atidaryti meniu, nuspaud\u0119 palaikykite arba paspauskite \u201EAlt + ArrowDown\u201C.`
};
var $4f1bde932c441789$exports = {};
$4f1bde932c441789$exports = {
  "longPressMessage": `Lai atv\u0113rtu izv\u0113lni, turiet nospiestu vai nospiediet tausti\u0146u kombin\u0101ciju Alt + lejupv\u0113rst\u0101 bulti\u0146a`
};
var $914a51a8a594d5be$exports = {};
$914a51a8a594d5be$exports = {
  "longPressMessage": `Langt trykk eller trykk Alt + PilNed for \xE5 \xE5pne menyen`
};
var $89aaf803103bb500$exports = {};
$89aaf803103bb500$exports = {
  "longPressMessage": `Druk lang op Alt + pijl-omlaag of druk op Alt om het menu te openen`
};
var $c685891476dbaaca$exports = {};
$c685891476dbaaca$exports = {
  "longPressMessage": `Naci\u015Bnij i przytrzymaj lub naci\u015Bnij klawisze Alt + Strza\u0142ka w d\xF3\u0142, aby otworzy\u0107 menu`
};
var $885879b9b10c2959$exports = {};
$885879b9b10c2959$exports = {
  "longPressMessage": `Pressione e segure ou pressione Alt + Seta para baixo para abrir o menu`
};
var $6b39616688a51692$exports = {};
$6b39616688a51692$exports = {
  "longPressMessage": `Prima continuamente ou prima Alt + Seta Para Baixo para abrir o menu`
};
var $f26362aed63f47e2$exports = {};
$f26362aed63f47e2$exports = {
  "longPressMessage": `Ap\u0103sa\u021Bi lung sau ap\u0103sa\u021Bi pe Alt + s\u0103geat\u0103 \xEEn jos pentru a deschide meniul`
};
var $06cbade644558bf0$exports = {};
$06cbade644558bf0$exports = {
  "longPressMessage": `\u041D\u0430\u0436\u043C\u0438\u0442\u0435 \u0438 \u0443\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0439\u0442\u0435 \u0438\u043B\u0438 \u043D\u0430\u0436\u043C\u0438\u0442\u0435 Alt + \u0421\u0442\u0440\u0435\u043B\u043A\u0430 \u0432\u043D\u0438\u0437, \u0447\u0442\u043E\u0431\u044B \u043E\u0442\u043A\u0440\u044B\u0442\u044C \u043C\u0435\u043D\u044E`
};
var $0a391ff68f9d59b1$exports = {};
$0a391ff68f9d59b1$exports = {
  "longPressMessage": `Ponuku otvor\xEDte dlh\xFDm stla\u010Den\xEDm alebo stla\u010Den\xEDm kl\xE1vesu Alt + kl\xE1vesu so \u0161\xEDpkou nadol`
};
var $8193cf0e649c7928$exports = {};
$8193cf0e649c7928$exports = {
  "longPressMessage": `Za odprtje menija pritisnite in dr\u017Eite gumb ali pritisnite Alt+pu\u0161\u010Dica navzdol`
};
var $f398debcce5a5c55$exports = {};
$f398debcce5a5c55$exports = {
  "longPressMessage": `Dugo pritisnite ili pritisnite Alt + strelicu prema dole da otvorite meni`
};
var $9e9fef000aa4c013$exports = {};
$9e9fef000aa4c013$exports = {
  "longPressMessage": `H\xE5ll nedtryckt eller tryck p\xE5 Alt + pil ned\xE5t f\xF6r att \xF6ppna menyn`
};
var $c016c8183bbe3d68$exports = {};
$c016c8183bbe3d68$exports = {
  "longPressMessage": `Men\xFCy\xFC a\xE7mak i\xE7in uzun bas\u0131n veya Alt + A\u015Fa\u011F\u0131 Ok tu\u015Funa bas\u0131n`
};
var $ca4f6c8462244e62$exports = {};
$ca4f6c8462244e62$exports = {
  "longPressMessage": `\u0414\u043E\u0432\u0433\u043E \u0430\u0431\u043E \u0437\u0432\u0438\u0447\u0430\u0439\u043D\u043E \u043D\u0430\u0442\u0438\u0441\u043D\u0456\u0442\u044C \u043A\u043E\u043C\u0431\u0456\u043D\u0430\u0446\u0456\u044E \u043A\u043B\u0430\u0432\u0456\u0448 Alt \u0456 \u0441\u0442\u0440\u0456\u043B\u043A\u0430 \u0432\u043D\u0438\u0437, \u0449\u043E\u0431 \u0432\u0456\u0434\u043A\u0440\u0438\u0442\u0438 \u043C\u0435\u043D\u044E`
};
var $2d9960c02ccac927$exports = {};
$2d9960c02ccac927$exports = {
  "longPressMessage": `\u957F\u6309\u6216\u6309 Alt + \u5411\u4E0B\u65B9\u5411\u952E\u4EE5\u6253\u5F00\u83DC\u5355`
};
var $f1b682a4c8c5631c$exports = {};
$f1b682a4c8c5631c$exports = {
  "longPressMessage": `\u9577\u6309\u6216\u6309 Alt+\u5411\u4E0B\u9375\u4EE5\u958B\u555F\u529F\u80FD\u8868`
};
$2cbb7ca666678a14$exports = {
  "ar-AE": $c0398ad35c3639b7$exports,
  "bg-BG": $7af657c4165927c3$exports,
  "cs-CZ": $d95d4da6d531ab81$exports,
  "da-DK": $24ebda9c775dca17$exports,
  "de-DE": $743e0dfca6cab1e9$exports,
  "el-GR": $a2f41026e05f1c84$exports,
  "en-US": $43b800e97c901737$exports,
  "es-ES": $442f5f6ac211e29f$exports,
  "et-EE": $dff280acfeb2d8ac$exports,
  "fi-FI": $51608325613944d7$exports,
  "fr-FR": $c4a1b1eabeaa87be$exports,
  "he-IL": $8c74815cdee18d1b$exports,
  "hr-HR": $fd0e9ef6a7fe0ec9$exports,
  "hu-HU": $a89a74a39eba465a$exports,
  "it-IT": $edc7c66594a0ae8a$exports,
  "ja-JP": $f1ab51510712db52$exports,
  "ko-KR": $f9b672d9b82fa3d6$exports,
  "lt-LT": $a385f3910feda499$exports,
  "lv-LV": $4f1bde932c441789$exports,
  "nb-NO": $914a51a8a594d5be$exports,
  "nl-NL": $89aaf803103bb500$exports,
  "pl-PL": $c685891476dbaaca$exports,
  "pt-BR": $885879b9b10c2959$exports,
  "pt-PT": $6b39616688a51692$exports,
  "ro-RO": $f26362aed63f47e2$exports,
  "ru-RU": $06cbade644558bf0$exports,
  "sk-SK": $0a391ff68f9d59b1$exports,
  "sl-SI": $8193cf0e649c7928$exports,
  "sr-SP": $f398debcce5a5c55$exports,
  "sv-SE": $9e9fef000aa4c013$exports,
  "tr-TR": $c016c8183bbe3d68$exports,
  "uk-UA": $ca4f6c8462244e62$exports,
  "zh-CN": $2d9960c02ccac927$exports,
  "zh-TW": $f1b682a4c8c5631c$exports
};
function $168583247155ddda$export$dc9c12ed27dd1b49(props, state, ref) {
  let { type = "menu", isDisabled, trigger = "press" } = props;
  let menuTriggerId = (0, $bdb11010cef70236$export$f680877a34711e37)();
  let { triggerProps, overlayProps } = (0, $628037886ba31236$export$f9d5c8beee7d008d)({
    type
  }, state, ref);
  let onKeyDown = (e3) => {
    if (isDisabled)
      return;
    if (trigger === "longPress" && !e3.altKey)
      return;
    if (ref && ref.current)
      switch (e3.key) {
        case "Enter":
        case " ":
          if (trigger === "longPress")
            return;
        case "ArrowDown":
          if (!("continuePropagation" in e3))
            e3.stopPropagation();
          e3.preventDefault();
          state.toggle("first");
          break;
        case "ArrowUp":
          if (!("continuePropagation" in e3))
            e3.stopPropagation();
          e3.preventDefault();
          state.toggle("last");
          break;
        default:
          if ("continuePropagation" in e3)
            e3.continuePropagation();
      }
  };
  let stringFormatter = (0, $fca6afa0e843324b$export$f12b703ca79dfbb1)((0, /* @__PURE__ */ $parcel$interopDefault2($2cbb7ca666678a14$exports)));
  let { longPressProps } = (0, $8a26561d2877236e$export$c24ed0104d07eab9)({
    isDisabled: isDisabled || trigger !== "longPress",
    accessibilityDescription: stringFormatter.format("longPressMessage"),
    onLongPressStart() {
      state.close();
    },
    onLongPress() {
      state.open("first");
    }
  });
  let pressProps = {
    onPressStart(e3) {
      if (e3.pointerType !== "touch" && e3.pointerType !== "keyboard" && !isDisabled)
        state.toggle(e3.pointerType === "virtual" ? "first" : null);
    },
    onPress(e3) {
      if (e3.pointerType === "touch" && !isDisabled)
        state.toggle();
    }
  };
  delete triggerProps.onPress;
  return {
    menuTriggerProps: {
      ...triggerProps,
      ...trigger === "press" ? pressProps : longPressProps,
      id: menuTriggerId,
      onKeyDown
    },
    menuProps: {
      ...overlayProps,
      "aria-labelledby": menuTriggerId,
      autoFocus: state.focusStrategy || true,
      onClose: state.close
    }
  };
}
var $d5336fe17ce95402$export$6f49b4016bfc8d56 = /* @__PURE__ */ new WeakMap();
function $d5336fe17ce95402$export$38eaa17faae8f579(props, state, ref) {
  let { shouldFocusWrap = true, ...otherProps } = props;
  if (!props["aria-label"] && !props["aria-labelledby"])
    console.warn("An aria-label or aria-labelledby prop is required for accessibility.");
  let domProps = (0, $65484d02dcb7eb3e$export$457c3d6518dd4c6f)(props, {
    labelable: true
  });
  let { listProps } = (0, $982254629710d113$export$b95089534ab7c1fd)({
    ...otherProps,
    ref,
    selectionManager: state.selectionManager,
    collection: state.collection,
    disabledKeys: state.disabledKeys,
    shouldFocusWrap,
    linkBehavior: "override"
  });
  $d5336fe17ce95402$export$6f49b4016bfc8d56.set(state, {
    onClose: props.onClose,
    onAction: props.onAction
  });
  return {
    menuProps: (0, $3ef42575df84b30b$export$9d1611c77c2fe928)(domProps, {
      role: "menu",
      // this forces AT to move their cursors into any open sub dialogs, the sub dialogs contain hidden close buttons in order to come back to this level of the menu
      "aria-hidden": state.expandedKeys.size > 0 ? true : void 0,
      ...listProps,
      onKeyDown: (e3) => {
        if (e3.key !== "Escape")
          listProps.onKeyDown(e3);
      }
    })
  };
}
function $a2e5df62f93c7633$export$9d32628fc2aea7da(props, state, ref) {
  var _item_props;
  let { key, closeOnSelect, isVirtualized, "aria-haspopup": hasPopup } = props;
  let { direction } = (0, $18f2051aff69b9bf$export$43bb16f9c6d9e3f7)();
  let isTrigger = !!hasPopup;
  let isOpen = state.expandedKeys.has(key);
  var _props_isDisabled;
  let isDisabled = (_props_isDisabled = props.isDisabled) !== null && _props_isDisabled !== void 0 ? _props_isDisabled : state.disabledKeys.has(key);
  var _props_isSelected;
  let isSelected = (_props_isSelected = props.isSelected) !== null && _props_isSelected !== void 0 ? _props_isSelected : state.selectionManager.isSelected(key);
  let openTimeout = (0, import_react23.useRef)();
  let cancelOpenTimeout = (0, import_react23.useCallback)(() => {
    if (openTimeout.current) {
      clearTimeout(openTimeout.current);
      openTimeout.current = void 0;
    }
  }, [
    openTimeout
  ]);
  let onSubmenuOpen = (0, $8ae05eaa5c114e9c$export$7f54fc3180508a52)(() => {
    cancelOpenTimeout();
    state.setExpandedKeys(/* @__PURE__ */ new Set([
      key
    ]));
  });
  (0, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(() => {
    return () => cancelOpenTimeout();
  }, [
    cancelOpenTimeout
  ]);
  let data = (0, $d5336fe17ce95402$export$6f49b4016bfc8d56).get(state);
  let onClose = props.onClose || data.onClose;
  let onActionMenuDialogTrigger = (0, import_react23.useCallback)(() => {
    onSubmenuOpen();
  }, []);
  let onAction = isTrigger ? onActionMenuDialogTrigger : props.onAction || data.onAction;
  let router2 = (0, $ea8dcbcb9ea1b556$export$9a302a45f65d0572)();
  let performAction = (e3) => {
    if (onAction)
      onAction(key);
    if (e3.target instanceof HTMLAnchorElement)
      router2.open(e3.target, e3);
  };
  let role = "menuitem";
  if (state.selectionManager.selectionMode === "single")
    role = "menuitemradio";
  else if (state.selectionManager.selectionMode === "multiple")
    role = "menuitemcheckbox";
  let labelId = (0, $bdb11010cef70236$export$b4cc09c592e8fdb8)();
  let descriptionId = (0, $bdb11010cef70236$export$b4cc09c592e8fdb8)();
  let keyboardId = (0, $bdb11010cef70236$export$b4cc09c592e8fdb8)();
  let ariaProps = {
    "aria-disabled": isDisabled || void 0,
    role,
    "aria-label": props["aria-label"],
    "aria-labelledby": labelId,
    "aria-describedby": [
      descriptionId,
      keyboardId
    ].filter(Boolean).join(" ") || void 0
  };
  if (state.selectionManager.selectionMode !== "none")
    ariaProps["aria-checked"] = isSelected;
  let item = state.collection.getItem(key);
  if (isVirtualized) {
    ariaProps["aria-posinset"] = item === null || item === void 0 ? void 0 : item.index;
    ariaProps["aria-setsize"] = (0, $453cc9f0df89c0a5$export$77d5aafae4e095b2)(state.collection);
  }
  if (hasPopup != null) {
    ariaProps["aria-haspopup"] = hasPopup;
    ariaProps["aria-expanded"] = isOpen ? "true" : "false";
  }
  let onPressStart = (e3) => {
    if (e3.pointerType === "keyboard")
      performAction(e3);
  };
  let onPressUp = (e3) => {
    if (e3.pointerType !== "keyboard") {
      performAction(e3);
      if (!isTrigger && onClose && (closeOnSelect !== null && closeOnSelect !== void 0 ? closeOnSelect : state.selectionManager.selectionMode !== "multiple" || state.selectionManager.isLink(key)))
        onClose();
    }
  };
  let { itemProps, isFocused } = (0, $880e95eb8b93ba9a$export$ecf600387e221c37)({
    selectionManager: state.selectionManager,
    key,
    ref,
    shouldSelectOnPressUp: true,
    allowsDifferentPressOrigin: true,
    // Disable all handling of links in useSelectable item
    // because we handle it ourselves. The behavior of menus
    // is slightly different from other collections because
    // actions are performed on key down rather than key up.
    linkBehavior: "none"
  });
  let { pressProps, isPressed } = (0, $f6c31cce2adf654f$export$45712eceda6fad21)({
    onPressStart,
    onPressUp,
    isDisabled: isDisabled || isTrigger && state.expandedKeys.has(key)
  });
  let { hoverProps } = (0, $6179b936705e76d3$export$ae780daf29e6d456)({
    isDisabled,
    onHoverStart() {
      if (!(0, $507fabe10e71c6fb$export$b9b3dfddab17db27)() && !(isTrigger && state.expandedKeys.has(key))) {
        state.selectionManager.setFocused(true);
        state.selectionManager.setFocusedKey(key);
        let isFocused2 = key === state.selectionManager.focusedKey;
        if (isFocused2 && state.selectionManager.isFocused && document.activeElement !== ref.current)
          (0, $6a99195332edec8b$export$80f3e147d781571c)(ref.current);
      }
    },
    onHoverChange: (isHovered) => {
      if (isHovered && isTrigger && !state.expandedKeys.has(key)) {
        if (!openTimeout.current)
          openTimeout.current = setTimeout(() => {
            onSubmenuOpen();
          }, 200);
      } else if (!isHovered)
        cancelOpenTimeout();
    }
  });
  let { keyboardProps } = (0, $46d819fcbaf35654$export$8f71654801c2f7cd)({
    onKeyDown: (e3) => {
      if (e3.repeat) {
        e3.continuePropagation();
        return;
      }
      switch (e3.key) {
        case " ":
          if (!isDisabled && state.selectionManager.selectionMode === "none" && !isTrigger && closeOnSelect !== false && onClose)
            onClose();
          break;
        case "Enter":
          if (!isDisabled && closeOnSelect !== false && !isTrigger && onClose)
            onClose();
          break;
        case "ArrowRight":
          if (isTrigger && direction === "ltr")
            onSubmenuOpen();
          else
            e3.continuePropagation();
          break;
        case "ArrowLeft":
          if (isTrigger && direction === "rtl")
            onSubmenuOpen();
          else
            e3.continuePropagation();
          break;
        default:
          e3.continuePropagation();
          break;
      }
    }
  });
  let domProps = (0, $65484d02dcb7eb3e$export$457c3d6518dd4c6f)(item.props, {
    isLink: !!(item === null || item === void 0 ? void 0 : (_item_props = item.props) === null || _item_props === void 0 ? void 0 : _item_props.href)
  });
  delete domProps.id;
  return {
    menuItemProps: {
      ...ariaProps,
      ...(0, $3ef42575df84b30b$export$9d1611c77c2fe928)(domProps, itemProps, pressProps, hoverProps, keyboardProps)
    },
    labelProps: {
      id: labelId
    },
    descriptionProps: {
      id: descriptionId
    },
    keyboardShortcutProps: {
      id: keyboardId
    },
    isFocused,
    isSelected,
    isPressed,
    isDisabled
  };
}
function $3e5eb2498db5b506$export$73f7a44322579622(props) {
  let { heading: heading2, "aria-label": ariaLabel } = props;
  let headingId = (0, $bdb11010cef70236$export$f680877a34711e37)();
  return {
    itemProps: {
      role: "presentation"
    },
    headingProps: heading2 ? {
      // Techincally, menus cannot contain headings according to ARIA.
      // We hide the heading from assistive technology, using role="presentation",
      // and only use it as a label for the nested group.
      id: headingId,
      role: "presentation"
    } : {},
    groupProps: {
      role: "group",
      "aria-label": ariaLabel,
      "aria-labelledby": heading2 ? headingId : void 0
    }
  };
}

// node_modules/@react-aria/select/dist/import.mjs
function $58aed456727eb0f3$export$e64b2f635402ca43(props, state, ref) {
  let { keyboardDelegate, isDisabled } = props;
  let collator = (0, $325a3faab7a68acd$export$a16aca283550c30d)({
    usage: "search",
    sensitivity: "base"
  });
  let delegate = (0, import_react24.useMemo)(() => keyboardDelegate || new (0, $2a25aae57d74318e$export$a05409b8bb224a5a)(state.collection, state.disabledKeys, null, collator), [
    keyboardDelegate,
    state.collection,
    state.disabledKeys,
    collator
  ]);
  let { menuTriggerProps, menuProps } = (0, $168583247155ddda$export$dc9c12ed27dd1b49)({
    isDisabled,
    type: "listbox"
  }, state, ref);
  let onKeyDown = (e3) => {
    switch (e3.key) {
      case "ArrowLeft": {
        e3.preventDefault();
        let key = state.selectedKey != null ? delegate.getKeyAbove(state.selectedKey) : delegate.getFirstKey();
        if (key)
          state.setSelectedKey(key);
        break;
      }
      case "ArrowRight": {
        e3.preventDefault();
        let key = state.selectedKey != null ? delegate.getKeyBelow(state.selectedKey) : delegate.getFirstKey();
        if (key)
          state.setSelectedKey(key);
        break;
      }
    }
  };
  let { typeSelectProps } = (0, $fb3050f43d946246$export$e32c88dfddc6e1d8)({
    keyboardDelegate: delegate,
    selectionManager: state.selectionManager,
    onTypeSelect(key) {
      state.setSelectedKey(key);
    }
  });
  let { labelProps, fieldProps, descriptionProps, errorMessageProps } = (0, $2baaea4c71418dea$export$294aa081a6c6f55d)({
    ...props,
    labelElementType: "span"
  });
  typeSelectProps.onKeyDown = typeSelectProps.onKeyDownCapture;
  delete typeSelectProps.onKeyDownCapture;
  let domProps = (0, $65484d02dcb7eb3e$export$457c3d6518dd4c6f)(props, {
    labelable: true
  });
  let triggerProps = (0, $3ef42575df84b30b$export$9d1611c77c2fe928)(typeSelectProps, menuTriggerProps, fieldProps);
  let valueId = (0, $bdb11010cef70236$export$f680877a34711e37)();
  return {
    labelProps: {
      ...labelProps,
      onClick: () => {
        if (!props.isDisabled) {
          ref.current.focus();
          (0, $507fabe10e71c6fb$export$8397ddfc504fdb9a)("keyboard");
        }
      }
    },
    triggerProps: (0, $3ef42575df84b30b$export$9d1611c77c2fe928)(domProps, {
      ...triggerProps,
      isDisabled,
      onKeyDown: (0, $ff5963eb1fccf552$export$e08e3b67e392101e)(triggerProps.onKeyDown, onKeyDown, props.onKeyDown),
      onKeyUp: props.onKeyUp,
      "aria-labelledby": [
        valueId,
        triggerProps["aria-labelledby"],
        triggerProps["aria-label"] && !triggerProps["aria-labelledby"] ? triggerProps.id : null
      ].filter(Boolean).join(" "),
      onFocus(e3) {
        if (state.isFocused)
          return;
        if (props.onFocus)
          props.onFocus(e3);
        if (props.onFocusChange)
          props.onFocusChange(true);
        state.setFocused(true);
      },
      onBlur(e3) {
        if (state.isOpen)
          return;
        if (props.onBlur)
          props.onBlur(e3);
        if (props.onFocusChange)
          props.onFocusChange(false);
        state.setFocused(false);
      }
    }),
    valueProps: {
      id: valueId
    },
    menuProps: {
      ...menuProps,
      autoFocus: state.focusStrategy || true,
      shouldSelectOnPressUp: true,
      shouldFocusOnHover: true,
      disallowEmptySelection: true,
      linkBehavior: "selection",
      onBlur: (e3) => {
        if (e3.currentTarget.contains(e3.relatedTarget))
          return;
        if (props.onBlur)
          props.onBlur(e3);
        if (props.onFocusChange)
          props.onFocusChange(false);
        state.setFocused(false);
      },
      "aria-labelledby": [
        fieldProps["aria-labelledby"],
        triggerProps["aria-label"] && !fieldProps["aria-labelledby"] ? triggerProps.id : null
      ].filter(Boolean).join(" ")
    },
    descriptionProps,
    errorMessageProps
  };
}
function $bdd25dc72710631f$export$f809e80f58e251d1(props, state, triggerRef) {
  let { autoComplete, name: name2, isDisabled } = props;
  let modality = (0, $507fabe10e71c6fb$export$98e20ec92f614cfe)();
  let { visuallyHiddenProps } = (0, $5c3e21d68f1c4674$export$a966af930f325cab)();
  (0, $99facab73266f662$export$5add1d006293d136)(props.selectRef, state.selectedKey, state.setSelectedKey);
  var _state_selectedKey;
  return {
    containerProps: {
      ...visuallyHiddenProps,
      "aria-hidden": true,
      ["data-a11y-ignore"]: "aria-hidden-focus"
    },
    inputProps: {
      type: "text",
      tabIndex: modality == null || state.isFocused || state.isOpen ? -1 : 0,
      style: {
        fontSize: 16
      },
      onFocus: () => triggerRef.current.focus(),
      disabled: isDisabled
    },
    selectProps: {
      tabIndex: -1,
      autoComplete,
      disabled: isDisabled,
      name: name2,
      size: state.collection.size,
      value: (_state_selectedKey = state.selectedKey) !== null && _state_selectedKey !== void 0 ? _state_selectedKey : "",
      onChange: (e3) => state.setSelectedKey(e3.target.value)
    }
  };
}
function $bdd25dc72710631f$export$cbd84cdb2e668835(props) {
  let { state, triggerRef, label, name: name2, isDisabled } = props;
  let selectRef = (0, import_react24.useRef)(null);
  let { containerProps, inputProps, selectProps } = $bdd25dc72710631f$export$f809e80f58e251d1({
    ...props,
    selectRef
  }, state, triggerRef);
  var _state_selectedKey;
  if (state.collection.size <= 300)
    return /* @__PURE__ */ (0, import_react24.default).createElement("div", {
      ...containerProps,
      "data-testid": "hidden-select-container"
    }, /* @__PURE__ */ (0, import_react24.default).createElement("input", inputProps), /* @__PURE__ */ (0, import_react24.default).createElement("label", null, label, /* @__PURE__ */ (0, import_react24.default).createElement("select", {
      ...selectProps,
      ref: selectRef
    }, /* @__PURE__ */ (0, import_react24.default).createElement("option", null), [
      ...state.collection.getKeys()
    ].map((key) => {
      let item = state.collection.getItem(key);
      if (item.type === "item")
        return /* @__PURE__ */ (0, import_react24.default).createElement("option", {
          key: item.key,
          value: item.key
        }, item.textValue);
    }))));
  else if (name2)
    return /* @__PURE__ */ (0, import_react24.default).createElement("input", {
      type: "hidden",
      autoComplete: selectProps.autoComplete,
      name: name2,
      disabled: isDisabled,
      value: (_state_selectedKey = state.selectedKey) !== null && _state_selectedKey !== void 0 ? _state_selectedKey : ""
    });
  return null;
}

// node_modules/@react-stately/menu/dist/import.mjs
var import_react25 = __toESM(require_react(), 1);
function $a28c903ee9ad8dc5$export$79fefeb1c2091ac3(props) {
  let overlayTriggerState = (0, $fc909762b330b746$export$61c6a8c84e605fb6)(props);
  let [focusStrategy, setFocusStrategy] = (0, import_react25.useState)(null);
  return {
    focusStrategy,
    ...overlayTriggerState,
    open(focusStrategy2 = null) {
      setFocusStrategy(focusStrategy2);
      overlayTriggerState.open();
    },
    toggle(focusStrategy2 = null) {
      setFocusStrategy(focusStrategy2);
      overlayTriggerState.toggle();
    }
  };
}

// node_modules/@react-stately/select/node_modules/@react-stately/list/dist/import.mjs
var import_react26 = __toESM(require_react(), 1);
var $a02d57049d202695$export$d085fb9e920b5ca72 = class {
  *[Symbol.iterator]() {
    yield* this.iterable;
  }
  get size() {
    return this.keyMap.size;
  }
  getKeys() {
    return this.keyMap.keys();
  }
  getKeyBefore(key) {
    let node56 = this.keyMap.get(key);
    return node56 ? node56.prevKey : null;
  }
  getKeyAfter(key) {
    let node56 = this.keyMap.get(key);
    return node56 ? node56.nextKey : null;
  }
  getFirstKey() {
    return this.firstKey;
  }
  getLastKey() {
    return this.lastKey;
  }
  getItem(key) {
    return this.keyMap.get(key);
  }
  at(idx) {
    const keys4 = [
      ...this.getKeys()
    ];
    return this.getItem(keys4[idx]);
  }
  getChildren(key) {
    let node56 = this.keyMap.get(key);
    return (node56 === null || node56 === void 0 ? void 0 : node56.childNodes) || [];
  }
  constructor(nodes) {
    this.keyMap = /* @__PURE__ */ new Map();
    this.iterable = nodes;
    let visit = (node56) => {
      this.keyMap.set(node56.key, node56);
      if (node56.childNodes && node56.type === "section")
        for (let child of node56.childNodes)
          visit(child);
    };
    for (let node56 of nodes)
      visit(node56);
    let last;
    let index = 0;
    for (let [key, node56] of this.keyMap) {
      if (last) {
        last.nextKey = key;
        node56.prevKey = last.key;
      } else {
        this.firstKey = key;
        node56.prevKey = void 0;
      }
      if (node56.type === "item")
        node56.index = index++;
      last = node56;
      last.nextKey = void 0;
    }
    this.lastKey = last === null || last === void 0 ? void 0 : last.key;
  }
};
function $e72dd72e1c76a225$export$2f645645f7bca7642(props) {
  let { filter } = props;
  let selectionState = (0, $7af3f5b51489e0b5$export$253fe78d46329472)(props);
  let disabledKeys = (0, import_react26.useMemo)(() => props.disabledKeys ? new Set(props.disabledKeys) : /* @__PURE__ */ new Set(), [
    props.disabledKeys
  ]);
  let factory = (0, import_react26.useCallback)((nodes) => filter ? new (0, $a02d57049d202695$export$d085fb9e920b5ca72)(filter(nodes)) : new (0, $a02d57049d202695$export$d085fb9e920b5ca72)(nodes), [
    filter
  ]);
  let context2 = (0, import_react26.useMemo)(() => ({
    suppressTextValueWarning: props.suppressTextValueWarning
  }), [
    props.suppressTextValueWarning
  ]);
  let collection = (0, $7613b1592d41b092$export$6cd28814d92fa9c9)(props, factory, context2);
  let selectionManager = (0, import_react26.useMemo)(() => new (0, $d496c0a20b6e58ec$export$6c8a5aaad13c9852)(collection, selectionState), [
    collection,
    selectionState
  ]);
  const cachedCollection = (0, import_react26.useRef)(null);
  (0, import_react26.useEffect)(() => {
    if (selectionState.focusedKey != null && !collection.getItem(selectionState.focusedKey)) {
      const startItem = cachedCollection.current.getItem(selectionState.focusedKey);
      const cachedItemNodes = [
        ...cachedCollection.current.getKeys()
      ].map((key) => {
        const itemNode = cachedCollection.current.getItem(key);
        return itemNode.type === "item" ? itemNode : null;
      }).filter((node56) => node56 !== null);
      const itemNodes = [
        ...collection.getKeys()
      ].map((key) => {
        const itemNode = collection.getItem(key);
        return itemNode.type === "item" ? itemNode : null;
      }).filter((node56) => node56 !== null);
      const diff = cachedItemNodes.length - itemNodes.length;
      let index = Math.min(diff > 1 ? Math.max(startItem.index - diff + 1, 0) : startItem.index, itemNodes.length - 1);
      let newNode;
      while (index >= 0) {
        if (!selectionManager.isDisabled(itemNodes[index].key)) {
          newNode = itemNodes[index];
          break;
        }
        if (index < itemNodes.length - 1)
          index++;
        else {
          if (index > startItem.index)
            index = startItem.index;
          index--;
        }
      }
      selectionState.setFocusedKey(newNode ? newNode.key : null);
    }
    cachedCollection.current = collection;
  }, [
    collection,
    selectionManager,
    selectionState,
    selectionState.focusedKey
  ]);
  return {
    collection,
    disabledKeys,
    selectionManager
  };
}
function $a0d645289fe9b86b$export$e7f05e985daf4b5f(props) {
  var _props_defaultSelectedKey;
  let [selectedKey, setSelectedKey] = (0, $458b0a5536c1a7cf$export$40bfa8c7b0832715)(props.selectedKey, (_props_defaultSelectedKey = props.defaultSelectedKey) !== null && _props_defaultSelectedKey !== void 0 ? _props_defaultSelectedKey : null, props.onSelectionChange);
  let selectedKeys = (0, import_react26.useMemo)(() => selectedKey != null ? [
    selectedKey
  ] : [], [
    selectedKey
  ]);
  let { collection, disabledKeys, selectionManager } = (0, $e72dd72e1c76a225$export$2f645645f7bca7642)({
    ...props,
    selectionMode: "single",
    disallowEmptySelection: true,
    allowDuplicateSelectionEvents: true,
    selectedKeys,
    onSelectionChange: (keys4) => {
      var _keys_values_next_value;
      let key = (_keys_values_next_value = keys4.values().next().value) !== null && _keys_values_next_value !== void 0 ? _keys_values_next_value : null;
      if (key === selectedKey && props.onSelectionChange)
        props.onSelectionChange(key);
      setSelectedKey(key);
    }
  });
  let selectedItem = selectedKey != null ? collection.getItem(selectedKey) : null;
  return {
    collection,
    disabledKeys,
    selectionManager,
    selectedKey,
    setSelectedKey,
    selectedItem
  };
}

// node_modules/@react-stately/select/dist/import.mjs
var import_react27 = __toESM(require_react(), 1);
function $2bc3a590c5373a4e$export$5159ec8b34d4ec12(props) {
  let triggerState = (0, $a28c903ee9ad8dc5$export$79fefeb1c2091ac3)(props);
  let listState = (0, $a0d645289fe9b86b$export$e7f05e985daf4b5f)({
    ...props,
    onSelectionChange: (key) => {
      if (props.onSelectionChange != null)
        props.onSelectionChange(key);
      triggerState.close();
    }
  });
  let [isFocused, setFocused] = (0, import_react27.useState)(false);
  return {
    ...listState,
    ...triggerState,
    open() {
      if (listState.collection.size !== 0)
        triggerState.open();
    },
    toggle(focusStrategy) {
      if (listState.collection.size !== 0)
        triggerState.toggle(focusStrategy);
    },
    isFocused,
    setFocused
  };
}

// node_modules/react-transition-group/esm/CSSTransition.js
var import_prop_types3 = __toESM(require_prop_types());

// node_modules/dom-helpers/esm/hasClass.js
function hasClass(element2, className) {
  if (element2.classList)
    return !!className && element2.classList.contains(className);
  return (" " + (element2.className.baseVal || element2.className) + " ").indexOf(" " + className + " ") !== -1;
}

// node_modules/dom-helpers/esm/addClass.js
function addClass(element2, className) {
  if (element2.classList)
    element2.classList.add(className);
  else if (!hasClass(element2, className))
    if (typeof element2.className === "string")
      element2.className = element2.className + " " + className;
    else
      element2.setAttribute("class", (element2.className && element2.className.baseVal || "") + " " + className);
}

// node_modules/dom-helpers/esm/removeClass.js
function replaceClassName(origClass, classToRemove) {
  return origClass.replace(new RegExp("(^|\\s)" + classToRemove + "(?:\\s|$)", "g"), "$1").replace(/\s+/g, " ").replace(/^\s*|\s*$/g, "");
}
function removeClass(element2, className) {
  if (element2.classList) {
    element2.classList.remove(className);
  } else if (typeof element2.className === "string") {
    element2.className = replaceClassName(element2.className, className);
  } else {
    element2.setAttribute("class", replaceClassName(element2.className && element2.className.baseVal || "", className));
  }
}

// node_modules/react-transition-group/esm/CSSTransition.js
var import_react28 = __toESM(require_react());
var _addClass = function addClass2(node56, classes) {
  return node56 && classes && classes.split(" ").forEach(function(c4) {
    return addClass(node56, c4);
  });
};
var removeClass2 = function removeClass3(node56, classes) {
  return node56 && classes && classes.split(" ").forEach(function(c4) {
    return removeClass(node56, c4);
  });
};
var CSSTransition = /* @__PURE__ */ function(_React$Component) {
  _inheritsLoose(CSSTransition2, _React$Component);
  function CSSTransition2() {
    var _this;
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
    _this.appliedClasses = {
      appear: {},
      enter: {},
      exit: {}
    };
    _this.onEnter = function(maybeNode, maybeAppearing) {
      var _this$resolveArgument = _this.resolveArguments(maybeNode, maybeAppearing), node56 = _this$resolveArgument[0], appearing = _this$resolveArgument[1];
      _this.removeClasses(node56, "exit");
      _this.addClass(node56, appearing ? "appear" : "enter", "base");
      if (_this.props.onEnter) {
        _this.props.onEnter(maybeNode, maybeAppearing);
      }
    };
    _this.onEntering = function(maybeNode, maybeAppearing) {
      var _this$resolveArgument2 = _this.resolveArguments(maybeNode, maybeAppearing), node56 = _this$resolveArgument2[0], appearing = _this$resolveArgument2[1];
      var type = appearing ? "appear" : "enter";
      _this.addClass(node56, type, "active");
      if (_this.props.onEntering) {
        _this.props.onEntering(maybeNode, maybeAppearing);
      }
    };
    _this.onEntered = function(maybeNode, maybeAppearing) {
      var _this$resolveArgument3 = _this.resolveArguments(maybeNode, maybeAppearing), node56 = _this$resolveArgument3[0], appearing = _this$resolveArgument3[1];
      var type = appearing ? "appear" : "enter";
      _this.removeClasses(node56, type);
      _this.addClass(node56, type, "done");
      if (_this.props.onEntered) {
        _this.props.onEntered(maybeNode, maybeAppearing);
      }
    };
    _this.onExit = function(maybeNode) {
      var _this$resolveArgument4 = _this.resolveArguments(maybeNode), node56 = _this$resolveArgument4[0];
      _this.removeClasses(node56, "appear");
      _this.removeClasses(node56, "enter");
      _this.addClass(node56, "exit", "base");
      if (_this.props.onExit) {
        _this.props.onExit(maybeNode);
      }
    };
    _this.onExiting = function(maybeNode) {
      var _this$resolveArgument5 = _this.resolveArguments(maybeNode), node56 = _this$resolveArgument5[0];
      _this.addClass(node56, "exit", "active");
      if (_this.props.onExiting) {
        _this.props.onExiting(maybeNode);
      }
    };
    _this.onExited = function(maybeNode) {
      var _this$resolveArgument6 = _this.resolveArguments(maybeNode), node56 = _this$resolveArgument6[0];
      _this.removeClasses(node56, "exit");
      _this.addClass(node56, "exit", "done");
      if (_this.props.onExited) {
        _this.props.onExited(maybeNode);
      }
    };
    _this.resolveArguments = function(maybeNode, maybeAppearing) {
      return _this.props.nodeRef ? [_this.props.nodeRef.current, maybeNode] : [maybeNode, maybeAppearing];
    };
    _this.getClassNames = function(type) {
      var classNames28 = _this.props.classNames;
      var isStringClassNames = typeof classNames28 === "string";
      var prefix3 = isStringClassNames && classNames28 ? classNames28 + "-" : "";
      var baseClassName = isStringClassNames ? "" + prefix3 + type : classNames28[type];
      var activeClassName = isStringClassNames ? baseClassName + "-active" : classNames28[type + "Active"];
      var doneClassName = isStringClassNames ? baseClassName + "-done" : classNames28[type + "Done"];
      return {
        baseClassName,
        activeClassName,
        doneClassName
      };
    };
    return _this;
  }
  var _proto = CSSTransition2.prototype;
  _proto.addClass = function addClass3(node56, type, phase) {
    var className = this.getClassNames(type)[phase + "ClassName"];
    var _this$getClassNames = this.getClassNames("enter"), doneClassName = _this$getClassNames.doneClassName;
    if (type === "appear" && phase === "done" && doneClassName) {
      className += " " + doneClassName;
    }
    if (phase === "active") {
      if (node56)
        forceReflow(node56);
    }
    if (className) {
      this.appliedClasses[type][phase] = className;
      _addClass(node56, className);
    }
  };
  _proto.removeClasses = function removeClasses(node56, type) {
    var _this$appliedClasses$ = this.appliedClasses[type], baseClassName = _this$appliedClasses$.base, activeClassName = _this$appliedClasses$.active, doneClassName = _this$appliedClasses$.done;
    this.appliedClasses[type] = {};
    if (baseClassName) {
      removeClass2(node56, baseClassName);
    }
    if (activeClassName) {
      removeClass2(node56, activeClassName);
    }
    if (doneClassName) {
      removeClass2(node56, doneClassName);
    }
  };
  _proto.render = function render2() {
    var _this$props = this.props, _ = _this$props.classNames, props = _objectWithoutPropertiesLoose(_this$props, ["classNames"]);
    return /* @__PURE__ */ import_react28.default.createElement(Transition_default, _extends({}, props, {
      onEnter: this.onEnter,
      onEntered: this.onEntered,
      onEntering: this.onEntering,
      onExit: this.onExit,
      onExiting: this.onExiting,
      onExited: this.onExited
    }));
  };
  return CSSTransition2;
}(import_react28.default.Component);
CSSTransition.defaultProps = {
  classNames: ""
};
CSSTransition.propTypes = true ? _extends({}, Transition_default.propTypes, {
  /**
   * The animation classNames applied to the component as it appears, enters,
   * exits or has finished the transition. A single name can be provided, which
   * will be suffixed for each stage, e.g. `classNames="fade"` applies:
   *
   * - `fade-appear`, `fade-appear-active`, `fade-appear-done`
   * - `fade-enter`, `fade-enter-active`, `fade-enter-done`
   * - `fade-exit`, `fade-exit-active`, `fade-exit-done`
   *
   * A few details to note about how these classes are applied:
   *
   * 1. They are _joined_ with the ones that are already defined on the child
   *    component, so if you want to add some base styles, you can use
   *    `className` without worrying that it will be overridden.
   *
   * 2. If the transition component mounts with `in={false}`, no classes are
   *    applied yet. You might be expecting `*-exit-done`, but if you think
   *    about it, a component cannot finish exiting if it hasn't entered yet.
   *
   * 2. `fade-appear-done` and `fade-enter-done` will _both_ be applied. This
   *    allows you to define different behavior for when appearing is done and
   *    when regular entering is done, using selectors like
   *    `.fade-enter-done:not(.fade-appear-done)`. For example, you could apply
   *    an epic entrance animation when element first appears in the DOM using
   *    [Animate.css](https://daneden.github.io/animate.css/). Otherwise you can
   *    simply use `fade-enter-done` for defining both cases.
   *
   * Each individual classNames can also be specified independently like:
   *
   * ```js
   * classNames={{
   *  appear: 'my-appear',
   *  appearActive: 'my-active-appear',
   *  appearDone: 'my-done-appear',
   *  enter: 'my-enter',
   *  enterActive: 'my-active-enter',
   *  enterDone: 'my-done-enter',
   *  exit: 'my-exit',
   *  exitActive: 'my-active-exit',
   *  exitDone: 'my-done-exit',
   * }}
   * ```
   *
   * If you want to set these classes using CSS Modules:
   *
   * ```js
   * import styles from './styles.css';
   * ```
   *
   * you might want to use camelCase in your CSS file, that way could simply
   * spread them instead of listing them one by one:
   *
   * ```js
   * classNames={{ ...styles }}
   * ```
   *
   * @type {string | {
   *  appear?: string,
   *  appearActive?: string,
   *  appearDone?: string,
   *  enter?: string,
   *  enterActive?: string,
   *  enterDone?: string,
   *  exit?: string,
   *  exitActive?: string,
   *  exitDone?: string,
   * }}
   */
  classNames: classNamesShape,
  /**
   * A `<Transition>` callback fired immediately after the 'enter' or 'appear' class is
   * applied.
   *
   * **Note**: when `nodeRef` prop is passed, `node` is not passed.
   *
   * @type Function(node: HtmlElement, isAppearing: bool)
   */
  onEnter: import_prop_types3.default.func,
  /**
   * A `<Transition>` callback fired immediately after the 'enter-active' or
   * 'appear-active' class is applied.
   *
   * **Note**: when `nodeRef` prop is passed, `node` is not passed.
   *
   * @type Function(node: HtmlElement, isAppearing: bool)
   */
  onEntering: import_prop_types3.default.func,
  /**
   * A `<Transition>` callback fired immediately after the 'enter' or
   * 'appear' classes are **removed** and the `done` class is added to the DOM node.
   *
   * **Note**: when `nodeRef` prop is passed, `node` is not passed.
   *
   * @type Function(node: HtmlElement, isAppearing: bool)
   */
  onEntered: import_prop_types3.default.func,
  /**
   * A `<Transition>` callback fired immediately after the 'exit' class is
   * applied.
   *
   * **Note**: when `nodeRef` prop is passed, `node` is not passed
   *
   * @type Function(node: HtmlElement)
   */
  onExit: import_prop_types3.default.func,
  /**
   * A `<Transition>` callback fired immediately after the 'exit-active' is applied.
   *
   * **Note**: when `nodeRef` prop is passed, `node` is not passed
   *
   * @type Function(node: HtmlElement)
   */
  onExiting: import_prop_types3.default.func,
  /**
   * A `<Transition>` callback fired immediately after the 'exit' classes
   * are **removed** and the `exit-done` class is added to the DOM node.
   *
   * **Note**: when `nodeRef` prop is passed, `node` is not passed
   *
   * @type Function(node: HtmlElement)
   */
  onExited: import_prop_types3.default.func
}) : {};
var CSSTransition_default = CSSTransition;

// node_modules/react-transition-group/esm/TransitionGroup.js
var import_prop_types4 = __toESM(require_prop_types());
var import_react30 = __toESM(require_react());

// node_modules/react-transition-group/esm/utils/ChildMapping.js
var import_react29 = __toESM(require_react());
function getChildMapping(children, mapFn) {
  var mapper = function mapper2(child) {
    return mapFn && (0, import_react29.isValidElement)(child) ? mapFn(child) : child;
  };
  var result = /* @__PURE__ */ Object.create(null);
  if (children)
    import_react29.Children.map(children, function(c4) {
      return c4;
    }).forEach(function(child) {
      result[child.key] = mapper(child);
    });
  return result;
}
function mergeChildMappings(prev2, next2) {
  prev2 = prev2 || {};
  next2 = next2 || {};
  function getValueForKey(key) {
    return key in next2 ? next2[key] : prev2[key];
  }
  var nextKeysPending = /* @__PURE__ */ Object.create(null);
  var pendingKeys = [];
  for (var prevKey in prev2) {
    if (prevKey in next2) {
      if (pendingKeys.length) {
        nextKeysPending[prevKey] = pendingKeys;
        pendingKeys = [];
      }
    } else {
      pendingKeys.push(prevKey);
    }
  }
  var i2;
  var childMapping = {};
  for (var nextKey in next2) {
    if (nextKeysPending[nextKey]) {
      for (i2 = 0; i2 < nextKeysPending[nextKey].length; i2++) {
        var pendingNextKey = nextKeysPending[nextKey][i2];
        childMapping[nextKeysPending[nextKey][i2]] = getValueForKey(pendingNextKey);
      }
    }
    childMapping[nextKey] = getValueForKey(nextKey);
  }
  for (i2 = 0; i2 < pendingKeys.length; i2++) {
    childMapping[pendingKeys[i2]] = getValueForKey(pendingKeys[i2]);
  }
  return childMapping;
}
function getProp(child, prop, props) {
  return props[prop] != null ? props[prop] : child.props[prop];
}
function getInitialChildMapping(props, onExited) {
  return getChildMapping(props.children, function(child) {
    return (0, import_react29.cloneElement)(child, {
      onExited: onExited.bind(null, child),
      in: true,
      appear: getProp(child, "appear", props),
      enter: getProp(child, "enter", props),
      exit: getProp(child, "exit", props)
    });
  });
}
function getNextChildMapping(nextProps, prevChildMapping, onExited) {
  var nextChildMapping = getChildMapping(nextProps.children);
  var children = mergeChildMappings(prevChildMapping, nextChildMapping);
  Object.keys(children).forEach(function(key) {
    var child = children[key];
    if (!(0, import_react29.isValidElement)(child))
      return;
    var hasPrev = key in prevChildMapping;
    var hasNext = key in nextChildMapping;
    var prevChild = prevChildMapping[key];
    var isLeaving = (0, import_react29.isValidElement)(prevChild) && !prevChild.props.in;
    if (hasNext && (!hasPrev || isLeaving)) {
      children[key] = (0, import_react29.cloneElement)(child, {
        onExited: onExited.bind(null, child),
        in: true,
        exit: getProp(child, "exit", nextProps),
        enter: getProp(child, "enter", nextProps)
      });
    } else if (!hasNext && hasPrev && !isLeaving) {
      children[key] = (0, import_react29.cloneElement)(child, {
        in: false
      });
    } else if (hasNext && hasPrev && (0, import_react29.isValidElement)(prevChild)) {
      children[key] = (0, import_react29.cloneElement)(child, {
        onExited: onExited.bind(null, child),
        in: prevChild.props.in,
        exit: getProp(child, "exit", nextProps),
        enter: getProp(child, "enter", nextProps)
      });
    }
  });
  return children;
}

// node_modules/react-transition-group/esm/TransitionGroup.js
var values = Object.values || function(obj) {
  return Object.keys(obj).map(function(k2) {
    return obj[k2];
  });
};
var defaultProps = {
  component: "div",
  childFactory: function childFactory(child) {
    return child;
  }
};
var TransitionGroup = /* @__PURE__ */ function(_React$Component) {
  _inheritsLoose(TransitionGroup3, _React$Component);
  function TransitionGroup3(props, context2) {
    var _this;
    _this = _React$Component.call(this, props, context2) || this;
    var handleExited = _this.handleExited.bind(_assertThisInitialized(_this));
    _this.state = {
      contextValue: {
        isMounting: true
      },
      handleExited,
      firstRender: true
    };
    return _this;
  }
  var _proto = TransitionGroup3.prototype;
  _proto.componentDidMount = function componentDidMount() {
    this.mounted = true;
    this.setState({
      contextValue: {
        isMounting: false
      }
    });
  };
  _proto.componentWillUnmount = function componentWillUnmount() {
    this.mounted = false;
  };
  TransitionGroup3.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, _ref18) {
    var prevChildMapping = _ref18.children, handleExited = _ref18.handleExited, firstRender = _ref18.firstRender;
    return {
      children: firstRender ? getInitialChildMapping(nextProps, handleExited) : getNextChildMapping(nextProps, prevChildMapping, handleExited),
      firstRender: false
    };
  };
  _proto.handleExited = function handleExited(child, node56) {
    var currentChildMapping = getChildMapping(this.props.children);
    if (child.key in currentChildMapping)
      return;
    if (child.props.onExited) {
      child.props.onExited(node56);
    }
    if (this.mounted) {
      this.setState(function(state) {
        var children = _extends({}, state.children);
        delete children[child.key];
        return {
          children
        };
      });
    }
  };
  _proto.render = function render2() {
    var _this$props = this.props, Component8 = _this$props.component, childFactory2 = _this$props.childFactory, props = _objectWithoutPropertiesLoose(_this$props, ["component", "childFactory"]);
    var contextValue = this.state.contextValue;
    var children = values(this.state.children).map(childFactory2);
    delete props.appear;
    delete props.enter;
    delete props.exit;
    if (Component8 === null) {
      return /* @__PURE__ */ import_react30.default.createElement(TransitionGroupContext_default.Provider, {
        value: contextValue
      }, children);
    }
    return /* @__PURE__ */ import_react30.default.createElement(TransitionGroupContext_default.Provider, {
      value: contextValue
    }, /* @__PURE__ */ import_react30.default.createElement(Component8, props, children));
  };
  return TransitionGroup3;
}(import_react30.default.Component);
TransitionGroup.propTypes = true ? {
  /**
   * `<TransitionGroup>` renders a `<div>` by default. You can change this
   * behavior by providing a `component` prop.
   * If you use React v16+ and would like to avoid a wrapping `<div>` element
   * you can pass in `component={null}`. This is useful if the wrapping div
   * borks your css styles.
   */
  component: import_prop_types4.default.any,
  /**
   * A set of `<Transition>` components, that are toggled `in` and out as they
   * leave. the `<TransitionGroup>` will inject specific transition props, so
   * remember to spread them through if you are wrapping the `<Transition>` as
   * with our `<Fade>` example.
   *
   * While this component is meant for multiple `Transition` or `CSSTransition`
   * children, sometimes you may want to have a single transition child with
   * content that you want to be transitioned out and in when you change it
   * (e.g. routes, images etc.) In that case you can change the `key` prop of
   * the transition child as you change its content, this will cause
   * `TransitionGroup` to transition the child out and back in.
   */
  children: import_prop_types4.default.node,
  /**
   * A convenience prop that enables or disables appear animations
   * for all children. Note that specifying this will override any defaults set
   * on individual children Transitions.
   */
  appear: import_prop_types4.default.bool,
  /**
   * A convenience prop that enables or disables enter animations
   * for all children. Note that specifying this will override any defaults set
   * on individual children Transitions.
   */
  enter: import_prop_types4.default.bool,
  /**
   * A convenience prop that enables or disables exit animations
   * for all children. Note that specifying this will override any defaults set
   * on individual children Transitions.
   */
  exit: import_prop_types4.default.bool,
  /**
   * You may need to apply reactive updates to a child as it is exiting.
   * This is generally done by using `cloneElement` however in the case of an exiting
   * child the element has already been removed and not accessible to the consumer.
   *
   * If you do need to update a child as it leaves you can provide a `childFactory`
   * to wrap every child, even the ones that are leaving.
   *
   * @type Function(child: ReactElement) -> ReactElement
   */
  childFactory: import_prop_types4.default.func
} : {};
TransitionGroup.defaultProps = defaultProps;
var TransitionGroup_default = TransitionGroup;

// node_modules/@react-aria/textfield/dist/import.mjs
var import_react31 = __toESM(require_react(), 1);
function $2d73ec29415bd339$export$712718f7aec83d5(props, ref) {
  let { inputElementType = "input", isDisabled = false, isRequired = false, isReadOnly = false, validationState, isInvalid = false, type = "text", value, defaultValue, onChange = () => {
  } } = props;
  let { focusableProps } = (0, $e6afbd83fe6ebbd2$export$4c014de7c8940b4c)(props, ref);
  let { labelProps, fieldProps, descriptionProps, errorMessageProps } = (0, $2baaea4c71418dea$export$294aa081a6c6f55d)(props);
  let domProps = (0, $65484d02dcb7eb3e$export$457c3d6518dd4c6f)(props, {
    labelable: true
  });
  const inputOnlyProps = {
    type,
    pattern: props.pattern
  };
  var _ref18;
  (0, $99facab73266f662$export$5add1d006293d136)(ref, (_ref18 = value !== null && value !== void 0 ? value : defaultValue) !== null && _ref18 !== void 0 ? _ref18 : "", onChange);
  return {
    labelProps,
    inputProps: (0, $3ef42575df84b30b$export$9d1611c77c2fe928)(domProps, inputElementType === "input" && inputOnlyProps, {
      disabled: isDisabled,
      readOnly: isReadOnly,
      "aria-required": isRequired || void 0,
      "aria-invalid": isInvalid || validationState === "invalid" || void 0,
      "aria-errormessage": props["aria-errormessage"],
      "aria-activedescendant": props["aria-activedescendant"],
      "aria-autocomplete": props["aria-autocomplete"],
      "aria-haspopup": props["aria-haspopup"],
      value: props.value,
      defaultValue: props.value ? void 0 : props.defaultValue,
      onChange: (e3) => onChange(e3.target.value),
      autoComplete: props.autoComplete,
      maxLength: props.maxLength,
      minLength: props.minLength,
      name: props.name,
      placeholder: props.placeholder,
      inputMode: props.inputMode,
      // Clipboard events
      onCopy: props.onCopy,
      onCut: props.onCut,
      onPaste: props.onPaste,
      // Composition events
      onCompositionEnd: props.onCompositionEnd,
      onCompositionStart: props.onCompositionStart,
      onCompositionUpdate: props.onCompositionUpdate,
      // Selection events
      onSelect: props.onSelect,
      // Input events
      onBeforeInput: props.onBeforeInput,
      onInput: props.onInput,
      ...focusableProps,
      ...fieldProps
    }),
    descriptionProps,
    errorMessageProps
  };
}

// node_modules/@react-stately/tree/dist/import.mjs
var import_react32 = __toESM(require_react(), 1);
var $05ca4cd7c4a5a999$export$863faf230ee2118a = class {
  *[Symbol.iterator]() {
    yield* this.iterable;
  }
  get size() {
    return this.keyMap.size;
  }
  getKeys() {
    return this.keyMap.keys();
  }
  getKeyBefore(key) {
    let node56 = this.keyMap.get(key);
    return node56 ? node56.prevKey : null;
  }
  getKeyAfter(key) {
    let node56 = this.keyMap.get(key);
    return node56 ? node56.nextKey : null;
  }
  getFirstKey() {
    return this.firstKey;
  }
  getLastKey() {
    return this.lastKey;
  }
  getItem(key) {
    return this.keyMap.get(key);
  }
  at(idx) {
    const keys4 = [
      ...this.getKeys()
    ];
    return this.getItem(keys4[idx]);
  }
  constructor(nodes, { expandedKeys } = {}) {
    this.keyMap = /* @__PURE__ */ new Map();
    this.iterable = nodes;
    expandedKeys = expandedKeys || /* @__PURE__ */ new Set();
    let visit = (node56) => {
      this.keyMap.set(node56.key, node56);
      if (node56.childNodes && (node56.type === "section" || expandedKeys.has(node56.key)))
        for (let child of node56.childNodes)
          visit(child);
    };
    for (let node56 of nodes)
      visit(node56);
    let last;
    let index = 0;
    for (let [key, node56] of this.keyMap) {
      if (last) {
        last.nextKey = key;
        node56.prevKey = last.key;
      } else {
        this.firstKey = key;
        node56.prevKey = void 0;
      }
      if (node56.type === "item")
        node56.index = index++;
      last = node56;
      last.nextKey = void 0;
    }
    this.lastKey = last === null || last === void 0 ? void 0 : last.key;
  }
};
function $875d6693e12af071$export$728d6ba534403756(props) {
  let [expandedKeys, setExpandedKeys] = (0, $458b0a5536c1a7cf$export$40bfa8c7b0832715)(props.expandedKeys ? new Set(props.expandedKeys) : void 0, props.defaultExpandedKeys ? new Set(props.defaultExpandedKeys) : /* @__PURE__ */ new Set(), props.onExpandedChange);
  let selectionState = (0, $7af3f5b51489e0b5$export$253fe78d46329472)(props);
  let disabledKeys = (0, import_react32.useMemo)(() => props.disabledKeys ? new Set(props.disabledKeys) : /* @__PURE__ */ new Set(), [
    props.disabledKeys
  ]);
  let tree = (0, $7613b1592d41b092$export$6cd28814d92fa9c9)(props, (0, import_react32.useCallback)((nodes) => new (0, $05ca4cd7c4a5a999$export$863faf230ee2118a)(nodes, {
    expandedKeys
  }), [
    expandedKeys
  ]), null);
  (0, import_react32.useEffect)(() => {
    if (selectionState.focusedKey != null && !tree.getItem(selectionState.focusedKey))
      selectionState.setFocusedKey(null);
  }, [
    tree,
    selectionState.focusedKey
  ]);
  let onToggle = (key) => {
    setExpandedKeys($875d6693e12af071$var$toggleKey(expandedKeys, key));
  };
  return {
    collection: tree,
    expandedKeys,
    disabledKeys,
    toggleKey: onToggle,
    setExpandedKeys,
    selectionManager: new (0, $d496c0a20b6e58ec$export$6c8a5aaad13c9852)(tree, selectionState)
  };
}
function $875d6693e12af071$var$toggleKey(set3, key) {
  let res = new Set(set3);
  if (res.has(key))
    res.delete(key);
  else
    res.add(key);
  return res;
}

// node_modules/@react-aria/link/dist/import.mjs
function $298d61e98472621b$export$dcf14c9974fe2767(props, ref) {
  let {
    elementType = "a",
    onPress,
    onPressStart,
    onPressEnd,
    // @ts-ignore
    onClick: deprecatedOnClick,
    isDisabled,
    ...otherProps
  } = props;
  let linkProps = {};
  if (elementType !== "a")
    linkProps = {
      role: "link",
      tabIndex: !isDisabled ? 0 : void 0
    };
  let { focusableProps } = (0, $e6afbd83fe6ebbd2$export$4c014de7c8940b4c)(props, ref);
  let { pressProps, isPressed } = (0, $f6c31cce2adf654f$export$45712eceda6fad21)({
    onPress,
    onPressStart,
    onPressEnd,
    isDisabled,
    ref
  });
  let domProps = (0, $65484d02dcb7eb3e$export$457c3d6518dd4c6f)(otherProps, {
    labelable: true,
    isLink: elementType === "a"
  });
  let interactionHandlers = (0, $3ef42575df84b30b$export$9d1611c77c2fe928)(focusableProps, pressProps);
  let router2 = (0, $ea8dcbcb9ea1b556$export$9a302a45f65d0572)();
  return {
    isPressed,
    linkProps: (0, $3ef42575df84b30b$export$9d1611c77c2fe928)(domProps, {
      ...interactionHandlers,
      ...linkProps,
      "aria-disabled": isDisabled || void 0,
      "aria-current": props["aria-current"],
      onClick: (e3) => {
        var _pressProps_onClick;
        (_pressProps_onClick = pressProps.onClick) === null || _pressProps_onClick === void 0 ? void 0 : _pressProps_onClick.call(pressProps, e3);
        if (deprecatedOnClick) {
          deprecatedOnClick(e3);
          console.warn("onClick is deprecated, please use onPress");
        }
        if (!router2.isNative && e3.currentTarget instanceof HTMLAnchorElement && e3.currentTarget.href && // If props are applied to a router Link component, it may have already prevented default.
        !e3.isDefaultPrevented() && (0, $ea8dcbcb9ea1b556$export$efa8c9099e530235)(e3.currentTarget, e3)) {
          e3.preventDefault();
          router2.open(e3.currentTarget, e3);
        }
      }
    })
  };
}

// node_modules/@react-aria/breadcrumbs/dist/import.mjs
function $parcel$interopDefault3(a2) {
  return a2 && a2.__esModule ? a2.default : a2;
}
function $dafd15390222438a$export$452b38fce62c9384(props, ref) {
  let { isCurrent, isDisabled, "aria-current": ariaCurrent, elementType = "a", ...otherProps } = props;
  let { linkProps } = (0, $298d61e98472621b$export$dcf14c9974fe2767)({
    isDisabled: isDisabled || isCurrent,
    elementType,
    ...otherProps
  }, ref);
  let isHeading = /^h[1-6]$/.test(elementType);
  let itemProps = {};
  if (!isHeading)
    itemProps = linkProps;
  if (isCurrent) {
    itemProps["aria-current"] = ariaCurrent || "page";
    itemProps.tabIndex = props.autoFocus ? -1 : void 0;
  }
  return {
    itemProps: {
      "aria-disabled": isDisabled,
      ...itemProps
    }
  };
}
var $8229b34715874f89$exports = {};
var $b91590b2dc47de39$exports = {};
$b91590b2dc47de39$exports = {
  "breadcrumbs": `\u0639\u0646\u0627\u0635\u0631 \u0627\u0644\u0648\u0627\u062C\u0647\u0629`
};
var $55b0693b2cf3fe91$exports = {};
$55b0693b2cf3fe91$exports = {
  "breadcrumbs": `\u0422\u0440\u043E\u0445\u0438 \u0445\u043B\u044F\u0431`
};
var $6ec1ed7729e948cc$exports = {};
$6ec1ed7729e948cc$exports = {
  "breadcrumbs": `Popis cesty`
};
var $5a41bb2baa6861e4$exports = {};
$5a41bb2baa6861e4$exports = {
  "breadcrumbs": `Br\xF8dkrummer`
};
var $f28bbea439e87eca$exports = {};
$f28bbea439e87eca$exports = {
  "breadcrumbs": `Breadcrumbs`
};
var $b3eca51cb720961a$exports = {};
$b3eca51cb720961a$exports = {
  "breadcrumbs": `\u03A0\u03BB\u03BF\u03B7\u03B3\u03AE\u03C3\u03B5\u03B9\u03C2 breadcrumb`
};
var $0b39b205118db415$exports = {};
$0b39b205118db415$exports = {
  "breadcrumbs": `Breadcrumbs`
};
var $f467c0ee7bfb0950$exports = {};
$f467c0ee7bfb0950$exports = {
  "breadcrumbs": `Migas de pan`
};
var $ab711d2ffb4cdf3d$exports = {};
$ab711d2ffb4cdf3d$exports = {
  "breadcrumbs": `Lingiread`
};
var $b63105d663e6f9d5$exports = {};
$b63105d663e6f9d5$exports = {
  "breadcrumbs": `Navigointilinkit`
};
var $9d2ed7be7fcdc2a1$exports = {};
$9d2ed7be7fcdc2a1$exports = {
  "breadcrumbs": `Chemin de navigation`
};
var $c5704294d85c7b5d$exports = {};
$c5704294d85c7b5d$exports = {
  "breadcrumbs": `\u05E9\u05D1\u05D9\u05DC\u05D9 \u05E0\u05D9\u05D5\u05D5\u05D8`
};
var $20c975671d6bbc63$exports = {};
$20c975671d6bbc63$exports = {
  "breadcrumbs": `Navigacijski putovi`
};
var $2569ca3917233115$exports = {};
$2569ca3917233115$exports = {
  "breadcrumbs": `Morzsamen\xFC`
};
var $caa152f7f8e96c85$exports = {};
$caa152f7f8e96c85$exports = {
  "breadcrumbs": `Breadcrumb`
};
var $cbc6af0cc98fad10$exports = {};
$cbc6af0cc98fad10$exports = {
  "breadcrumbs": `\u30D1\u30F3\u304F\u305A\u30EA\u30B9\u30C8`
};
var $ad9be5d332b4d607$exports = {};
$ad9be5d332b4d607$exports = {
  "breadcrumbs": `\uD0D0\uC0C9 \uD45C\uC2DC`
};
var $659de19a00ff9617$exports = {};
$659de19a00ff9617$exports = {
  "breadcrumbs": `Nar\u0161ymo kelias`
};
var $173e9fb4d14fe309$exports = {};
$173e9fb4d14fe309$exports = {
  "breadcrumbs": `Atpaka\u013Cce\u013Ci`
};
var $d8e2640a066567a9$exports = {};
$d8e2640a066567a9$exports = {
  "breadcrumbs": `Navigasjonsstier`
};
var $d71fd764236c0d12$exports = {};
$d71fd764236c0d12$exports = {
  "breadcrumbs": `Broodkruimels`
};
var $f4ad3faf9f4aaec6$exports = {};
$f4ad3faf9f4aaec6$exports = {
  "breadcrumbs": `Struktura nawigacyjna`
};
var $9703be9d55d8e9c2$exports = {};
$9703be9d55d8e9c2$exports = {
  "breadcrumbs": `Caminho detalhado`
};
var $7e23baec8a14f309$exports = {};
$7e23baec8a14f309$exports = {
  "breadcrumbs": `Categorias`
};
var $568f95594049d56e$exports = {};
$568f95594049d56e$exports = {
  "breadcrumbs": `Miez de p\xE2ine`
};
var $625df06cecc70764$exports = {};
$625df06cecc70764$exports = {
  "breadcrumbs": `\u041D\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044F`
};
var $b5a67525f3a2f594$exports = {};
$b5a67525f3a2f594$exports = {
  "breadcrumbs": `Naviga\u010Dn\xE9 prvky Breadcrumbs`
};
var $16125922964febca$exports = {};
$16125922964febca$exports = {
  "breadcrumbs": `Drobtine`
};
var $de104bf355206bcf$exports = {};
$de104bf355206bcf$exports = {
  "breadcrumbs": `Putanje navigacije`
};
var $d5ab76bcbadc9c07$exports = {};
$d5ab76bcbadc9c07$exports = {
  "breadcrumbs": `S\xF6kv\xE4gar`
};
var $a6a1af5968159b55$exports = {};
$a6a1af5968159b55$exports = {
  "breadcrumbs": `\u0130\xE7erik haritalar\u0131`
};
var $5204a30f0d17ffec$exports = {};
$5204a30f0d17ffec$exports = {
  "breadcrumbs": `\u041D\u0430\u0432\u0456\u0433\u0430\u0446\u0456\u0439\u043D\u0430 \u0441\u0442\u0435\u0436\u043A\u0430`
};
var $8d15e736e12d3dfd$exports = {};
$8d15e736e12d3dfd$exports = {
  "breadcrumbs": `\u5BFC\u822A\u680F`
};
var $f8c49dd804b75140$exports = {};
$f8c49dd804b75140$exports = {
  "breadcrumbs": `\u5C0E\u89BD\u5217`
};
$8229b34715874f89$exports = {
  "ar-AE": $b91590b2dc47de39$exports,
  "bg-BG": $55b0693b2cf3fe91$exports,
  "cs-CZ": $6ec1ed7729e948cc$exports,
  "da-DK": $5a41bb2baa6861e4$exports,
  "de-DE": $f28bbea439e87eca$exports,
  "el-GR": $b3eca51cb720961a$exports,
  "en-US": $0b39b205118db415$exports,
  "es-ES": $f467c0ee7bfb0950$exports,
  "et-EE": $ab711d2ffb4cdf3d$exports,
  "fi-FI": $b63105d663e6f9d5$exports,
  "fr-FR": $9d2ed7be7fcdc2a1$exports,
  "he-IL": $c5704294d85c7b5d$exports,
  "hr-HR": $20c975671d6bbc63$exports,
  "hu-HU": $2569ca3917233115$exports,
  "it-IT": $caa152f7f8e96c85$exports,
  "ja-JP": $cbc6af0cc98fad10$exports,
  "ko-KR": $ad9be5d332b4d607$exports,
  "lt-LT": $659de19a00ff9617$exports,
  "lv-LV": $173e9fb4d14fe309$exports,
  "nb-NO": $d8e2640a066567a9$exports,
  "nl-NL": $d71fd764236c0d12$exports,
  "pl-PL": $f4ad3faf9f4aaec6$exports,
  "pt-BR": $9703be9d55d8e9c2$exports,
  "pt-PT": $7e23baec8a14f309$exports,
  "ro-RO": $568f95594049d56e$exports,
  "ru-RU": $625df06cecc70764$exports,
  "sk-SK": $b5a67525f3a2f594$exports,
  "sl-SI": $16125922964febca$exports,
  "sr-SP": $de104bf355206bcf$exports,
  "sv-SE": $d5ab76bcbadc9c07$exports,
  "tr-TR": $a6a1af5968159b55$exports,
  "uk-UA": $5204a30f0d17ffec$exports,
  "zh-CN": $8d15e736e12d3dfd$exports,
  "zh-TW": $f8c49dd804b75140$exports
};
function $848231d7a2b3998e$export$8cefe241bd876ca0(props) {
  let { "aria-label": ariaLabel, ...otherProps } = props;
  let strings = (0, $fca6afa0e843324b$export$f12b703ca79dfbb1)((0, /* @__PURE__ */ $parcel$interopDefault3($8229b34715874f89$exports)));
  return {
    navProps: {
      ...(0, $65484d02dcb7eb3e$export$457c3d6518dd4c6f)(otherProps, {
        labelable: true
      }),
      "aria-label": ariaLabel || strings.format("breadcrumbs")
    }
  };
}

// node_modules/@react-stately/slider/dist/import.mjs
var import_react33 = __toESM(require_react(), 1);
var $28f99e3e86e6ec45$var$DEFAULT_MIN_VALUE = 0;
var $28f99e3e86e6ec45$var$DEFAULT_MAX_VALUE = 100;
var $28f99e3e86e6ec45$var$DEFAULT_STEP_VALUE = 1;
function $28f99e3e86e6ec45$export$e5fda3247f5d67f9(props) {
  const { isDisabled = false, minValue = $28f99e3e86e6ec45$var$DEFAULT_MIN_VALUE, maxValue = $28f99e3e86e6ec45$var$DEFAULT_MAX_VALUE, numberFormatter: formatter3, step = $28f99e3e86e6ec45$var$DEFAULT_STEP_VALUE, orientation = "horizontal" } = props;
  let pageSize = (0, import_react33.useMemo)(() => {
    let calcPageSize = (maxValue - minValue) / 10;
    calcPageSize = (0, $9446cca9a3875146$export$cb6e0bb50bc19463)(calcPageSize, 0, calcPageSize + step, step);
    return Math.max(calcPageSize, step);
  }, [
    step,
    maxValue,
    minValue
  ]);
  let value = (0, import_react33.useMemo)(() => $28f99e3e86e6ec45$var$convertValue(props.value), [
    props.value
  ]);
  var _convertValue;
  let defaultValue = (0, import_react33.useMemo)(() => (_convertValue = $28f99e3e86e6ec45$var$convertValue(props.defaultValue)) !== null && _convertValue !== void 0 ? _convertValue : [
    minValue
  ], [
    props.defaultValue,
    minValue
  ]);
  let onChange = $28f99e3e86e6ec45$var$createOnChange(props.value, props.defaultValue, props.onChange);
  let onChangeEnd = $28f99e3e86e6ec45$var$createOnChange(props.value, props.defaultValue, props.onChangeEnd);
  const [values2, setValuesState] = (0, $458b0a5536c1a7cf$export$40bfa8c7b0832715)(value, defaultValue, onChange);
  const [isDraggings, setDraggingsState] = (0, import_react33.useState)(new Array(values2.length).fill(false));
  const isEditablesRef = (0, import_react33.useRef)(new Array(values2.length).fill(true));
  const [focusedIndex, setFocusedIndex] = (0, import_react33.useState)(void 0);
  const valuesRef = (0, import_react33.useRef)(values2);
  const isDraggingsRef = (0, import_react33.useRef)(isDraggings);
  let setValues = (values3) => {
    valuesRef.current = values3;
    setValuesState(values3);
  };
  let setDraggings = (draggings) => {
    isDraggingsRef.current = draggings;
    setDraggingsState(draggings);
  };
  function getValuePercent(value2) {
    return (value2 - minValue) / (maxValue - minValue);
  }
  function getThumbMinValue(index) {
    return index === 0 ? minValue : values2[index - 1];
  }
  function getThumbMaxValue(index) {
    return index === values2.length - 1 ? maxValue : values2[index + 1];
  }
  function isThumbEditable(index) {
    return isEditablesRef.current[index];
  }
  function setThumbEditable(index, editable2) {
    isEditablesRef.current[index] = editable2;
  }
  function updateValue(index, value2) {
    if (isDisabled || !isThumbEditable(index))
      return;
    const thisMin = getThumbMinValue(index);
    const thisMax = getThumbMaxValue(index);
    value2 = (0, $9446cca9a3875146$export$cb6e0bb50bc19463)(value2, thisMin, thisMax, step);
    let newValues = $28f99e3e86e6ec45$var$replaceIndex(valuesRef.current, index, value2);
    setValues(newValues);
  }
  function updateDragging(index, dragging) {
    if (isDisabled || !isThumbEditable(index))
      return;
    const wasDragging = isDraggingsRef.current[index];
    isDraggingsRef.current = $28f99e3e86e6ec45$var$replaceIndex(isDraggingsRef.current, index, dragging);
    setDraggings(isDraggingsRef.current);
    if (onChangeEnd && wasDragging && !isDraggingsRef.current.some(Boolean))
      onChangeEnd(valuesRef.current);
  }
  function getFormattedValue(value2) {
    return formatter3.format(value2);
  }
  function setThumbPercent(index, percent) {
    updateValue(index, getPercentValue3(percent));
  }
  function getRoundedValue(value2) {
    return Math.round((value2 - minValue) / step) * step + minValue;
  }
  function getPercentValue3(percent) {
    const val = percent * (maxValue - minValue) + minValue;
    return (0, $9446cca9a3875146$export$7d15b64cf5a3a4c4)(getRoundedValue(val), minValue, maxValue);
  }
  function incrementThumb(index, stepSize = 1) {
    let s2 = Math.max(stepSize, step);
    updateValue(index, (0, $9446cca9a3875146$export$cb6e0bb50bc19463)(values2[index] + s2, minValue, maxValue, step));
  }
  function decrementThumb(index, stepSize = 1) {
    let s2 = Math.max(stepSize, step);
    updateValue(index, (0, $9446cca9a3875146$export$cb6e0bb50bc19463)(values2[index] - s2, minValue, maxValue, step));
  }
  return {
    values: values2,
    getThumbValue: (index) => values2[index],
    setThumbValue: updateValue,
    setThumbPercent,
    isThumbDragging: (index) => isDraggings[index],
    setThumbDragging: updateDragging,
    focusedThumb: focusedIndex,
    setFocusedThumb: setFocusedIndex,
    getThumbPercent: (index) => getValuePercent(values2[index]),
    getValuePercent,
    getThumbValueLabel: (index) => getFormattedValue(values2[index]),
    getFormattedValue,
    getThumbMinValue,
    getThumbMaxValue,
    getPercentValue: getPercentValue3,
    isThumbEditable,
    setThumbEditable,
    incrementThumb,
    decrementThumb,
    step,
    pageSize,
    orientation,
    isDisabled
  };
}
function $28f99e3e86e6ec45$var$replaceIndex(array, index, value) {
  if (array[index] === value)
    return array;
  return [
    ...array.slice(0, index),
    value,
    ...array.slice(index + 1)
  ];
}
function $28f99e3e86e6ec45$var$convertValue(value) {
  if (value == null)
    return void 0;
  return Array.isArray(value) ? value : [
    value
  ];
}
function $28f99e3e86e6ec45$var$createOnChange(value, defaultValue, onChange) {
  return (newValue) => {
    if (typeof value === "number" || typeof defaultValue === "number")
      onChange === null || onChange === void 0 ? void 0 : onChange(newValue[0]);
    else
      onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
  };
}

// node_modules/@react-aria/slider/dist/import.mjs
var import_react34 = __toESM(require_react(), 1);
var $aa519ee6cf463259$export$d6c8d9636a3dc49c = /* @__PURE__ */ new WeakMap();
function $aa519ee6cf463259$export$68e648cbec363a18(state, index) {
  let data = $aa519ee6cf463259$export$d6c8d9636a3dc49c.get(state);
  if (!data)
    throw new Error("Unknown slider state");
  return `${data.id}-${index}`;
}
function $bcca50147b47f54d$export$56b2c08e277f365(props, state, trackRef) {
  let { labelProps, fieldProps } = (0, $d191a55c9702f145$export$8467354a121f1b9f)(props);
  let isVertical = props.orientation === "vertical";
  var _labelProps_id;
  (0, $aa519ee6cf463259$export$d6c8d9636a3dc49c).set(state, {
    id: (_labelProps_id = labelProps.id) !== null && _labelProps_id !== void 0 ? _labelProps_id : fieldProps.id,
    "aria-describedby": props["aria-describedby"],
    "aria-details": props["aria-details"]
  });
  let { direction } = (0, $18f2051aff69b9bf$export$43bb16f9c6d9e3f7)();
  let { addGlobalListener, removeGlobalListener } = (0, $03deb23ff14920c4$export$4eaf04e54aa8eed6)();
  const realTimeTrackDraggingIndex = (0, import_react34.useRef)(null);
  const reverseX = direction === "rtl";
  const currentPosition = (0, import_react34.useRef)(null);
  const { moveProps } = (0, $e8a7022cf87cba2a$export$36da96379f79f245)({
    onMoveStart() {
      currentPosition.current = null;
    },
    onMove({ deltaX, deltaY }) {
      let { height, width } = trackRef.current.getBoundingClientRect();
      let size = isVertical ? height : width;
      if (currentPosition.current == null)
        currentPosition.current = state.getThumbPercent(realTimeTrackDraggingIndex.current) * size;
      let delta = isVertical ? deltaY : deltaX;
      if (isVertical || reverseX)
        delta = -delta;
      currentPosition.current += delta;
      if (realTimeTrackDraggingIndex.current != null && trackRef.current) {
        const percent = (0, $9446cca9a3875146$export$7d15b64cf5a3a4c4)(currentPosition.current / size, 0, 1);
        state.setThumbPercent(realTimeTrackDraggingIndex.current, percent);
      }
    },
    onMoveEnd() {
      if (realTimeTrackDraggingIndex.current != null) {
        state.setThumbDragging(realTimeTrackDraggingIndex.current, false);
        realTimeTrackDraggingIndex.current = null;
      }
    }
  });
  let currentPointer = (0, import_react34.useRef)(void 0);
  let onDownTrack = (e3, id2, clientX, clientY) => {
    if (trackRef.current && !props.isDisabled && state.values.every((_, i2) => !state.isThumbDragging(i2))) {
      let { height, width, top: top2, left } = trackRef.current.getBoundingClientRect();
      let size = isVertical ? height : width;
      const trackPosition = isVertical ? top2 : left;
      const clickPosition = isVertical ? clientY : clientX;
      const offset = clickPosition - trackPosition;
      let percent = offset / size;
      if (direction === "rtl" || isVertical)
        percent = 1 - percent;
      let value = state.getPercentValue(percent);
      let closestThumb;
      let split = state.values.findIndex((v4) => value - v4 < 0);
      if (split === 0)
        closestThumb = split;
      else if (split === -1)
        closestThumb = state.values.length - 1;
      else {
        let lastLeft = state.values[split - 1];
        let firstRight = state.values[split];
        if (Math.abs(lastLeft - value) < Math.abs(firstRight - value))
          closestThumb = split - 1;
        else
          closestThumb = split;
      }
      if (closestThumb >= 0 && state.isThumbEditable(closestThumb)) {
        e3.preventDefault();
        realTimeTrackDraggingIndex.current = closestThumb;
        state.setFocusedThumb(closestThumb);
        currentPointer.current = id2;
        state.setThumbDragging(realTimeTrackDraggingIndex.current, true);
        state.setThumbValue(closestThumb, value);
        addGlobalListener(window, "mouseup", onUpTrack, false);
        addGlobalListener(window, "touchend", onUpTrack, false);
        addGlobalListener(window, "pointerup", onUpTrack, false);
      } else
        realTimeTrackDraggingIndex.current = null;
    }
  };
  let onUpTrack = (e3) => {
    var _e_changedTouches;
    var _e_pointerId;
    let id2 = (_e_pointerId = e3.pointerId) !== null && _e_pointerId !== void 0 ? _e_pointerId : (_e_changedTouches = e3.changedTouches) === null || _e_changedTouches === void 0 ? void 0 : _e_changedTouches[0].identifier;
    if (id2 === currentPointer.current) {
      if (realTimeTrackDraggingIndex.current != null) {
        state.setThumbDragging(realTimeTrackDraggingIndex.current, false);
        realTimeTrackDraggingIndex.current = null;
      }
      removeGlobalListener(window, "mouseup", onUpTrack, false);
      removeGlobalListener(window, "touchend", onUpTrack, false);
      removeGlobalListener(window, "pointerup", onUpTrack, false);
    }
  };
  if ("htmlFor" in labelProps && labelProps.htmlFor) {
    delete labelProps.htmlFor;
    labelProps.onClick = () => {
      var _document_getElementById;
      (_document_getElementById = document.getElementById((0, $aa519ee6cf463259$export$68e648cbec363a18)(state, 0))) === null || _document_getElementById === void 0 ? void 0 : _document_getElementById.focus();
      (0, $507fabe10e71c6fb$export$8397ddfc504fdb9a)("keyboard");
    };
  }
  return {
    labelProps,
    // The root element of the Slider will have role="group" to group together
    // all the thumb inputs in the Slider.  The label of the Slider will
    // be used to label the group.
    groupProps: {
      role: "group",
      ...fieldProps
    },
    trackProps: (0, $3ef42575df84b30b$export$9d1611c77c2fe928)({
      onMouseDown(e3) {
        if (e3.button !== 0 || e3.altKey || e3.ctrlKey || e3.metaKey)
          return;
        onDownTrack(e3, void 0, e3.clientX, e3.clientY);
      },
      onPointerDown(e3) {
        if (e3.pointerType === "mouse" && (e3.button !== 0 || e3.altKey || e3.ctrlKey || e3.metaKey))
          return;
        onDownTrack(e3, e3.pointerId, e3.clientX, e3.clientY);
      },
      onTouchStart(e3) {
        onDownTrack(e3, e3.changedTouches[0].identifier, e3.changedTouches[0].clientX, e3.changedTouches[0].clientY);
      },
      style: {
        position: "relative",
        touchAction: "none"
      }
    }, moveProps),
    outputProps: {
      htmlFor: state.values.map((_, index) => (0, $aa519ee6cf463259$export$68e648cbec363a18)(state, index)).join(" "),
      "aria-live": "off"
    }
  };
}
function $47b897dc8cdb026b$export$8d15029008292ae(opts, state) {
  let { index = 0, isRequired, validationState, isInvalid, trackRef, inputRef, orientation = state.orientation, name: name2 } = opts;
  let isDisabled = opts.isDisabled || state.isDisabled;
  let isVertical = orientation === "vertical";
  let { direction } = (0, $18f2051aff69b9bf$export$43bb16f9c6d9e3f7)();
  let { addGlobalListener, removeGlobalListener } = (0, $03deb23ff14920c4$export$4eaf04e54aa8eed6)();
  let data = (0, $aa519ee6cf463259$export$d6c8d9636a3dc49c).get(state);
  var _opts_arialabelledby;
  const { labelProps, fieldProps } = (0, $d191a55c9702f145$export$8467354a121f1b9f)({
    ...opts,
    id: (0, $aa519ee6cf463259$export$68e648cbec363a18)(state, index),
    "aria-labelledby": `${data.id} ${(_opts_arialabelledby = opts["aria-labelledby"]) !== null && _opts_arialabelledby !== void 0 ? _opts_arialabelledby : ""}`.trim()
  });
  const value = state.values[index];
  const focusInput = (0, import_react34.useCallback)(() => {
    if (inputRef.current)
      (0, $7215afc6de606d6b$export$de79e2c695e052f3)(inputRef.current);
  }, [
    inputRef
  ]);
  const isFocused = state.focusedThumb === index;
  (0, import_react34.useEffect)(() => {
    if (isFocused)
      focusInput();
  }, [
    isFocused,
    focusInput
  ]);
  let reverseX = direction === "rtl";
  let currentPosition = (0, import_react34.useRef)(null);
  let { keyboardProps } = (0, $46d819fcbaf35654$export$8f71654801c2f7cd)({
    onKeyDown(e3) {
      let { getThumbMaxValue, getThumbMinValue, decrementThumb, incrementThumb, setThumbValue, setThumbDragging, pageSize } = state;
      if (!/^(PageUp|PageDown|Home|End)$/.test(e3.key)) {
        e3.continuePropagation();
        return;
      }
      e3.preventDefault();
      setThumbDragging(index, true);
      switch (e3.key) {
        case "PageUp":
          incrementThumb(index, pageSize);
          break;
        case "PageDown":
          decrementThumb(index, pageSize);
          break;
        case "Home":
          setThumbValue(index, getThumbMinValue(index));
          break;
        case "End":
          setThumbValue(index, getThumbMaxValue(index));
          break;
      }
      setThumbDragging(index, false);
    }
  });
  let { moveProps } = (0, $e8a7022cf87cba2a$export$36da96379f79f245)({
    onMoveStart() {
      currentPosition.current = null;
      state.setThumbDragging(index, true);
    },
    onMove({ deltaX, deltaY, pointerType, shiftKey }) {
      const { getThumbPercent, setThumbPercent, decrementThumb, incrementThumb, step, pageSize } = state;
      let { width, height } = trackRef.current.getBoundingClientRect();
      let size = isVertical ? height : width;
      if (currentPosition.current == null)
        currentPosition.current = getThumbPercent(index) * size;
      if (pointerType === "keyboard") {
        if (deltaX > 0 && reverseX || deltaX < 0 && !reverseX || deltaY > 0)
          decrementThumb(index, shiftKey ? pageSize : step);
        else
          incrementThumb(index, shiftKey ? pageSize : step);
      } else {
        let delta = isVertical ? deltaY : deltaX;
        if (isVertical || reverseX)
          delta = -delta;
        currentPosition.current += delta;
        setThumbPercent(index, (0, $9446cca9a3875146$export$7d15b64cf5a3a4c4)(currentPosition.current / size, 0, 1));
      }
    },
    onMoveEnd() {
      state.setThumbDragging(index, false);
    }
  });
  state.setThumbEditable(index, !isDisabled);
  const { focusableProps } = (0, $e6afbd83fe6ebbd2$export$4c014de7c8940b4c)((0, $3ef42575df84b30b$export$9d1611c77c2fe928)(opts, {
    onFocus: () => state.setFocusedThumb(index),
    onBlur: () => state.setFocusedThumb(void 0)
  }), inputRef);
  let currentPointer = (0, import_react34.useRef)(void 0);
  let onDown = (id2) => {
    focusInput();
    currentPointer.current = id2;
    state.setThumbDragging(index, true);
    addGlobalListener(window, "mouseup", onUp, false);
    addGlobalListener(window, "touchend", onUp, false);
    addGlobalListener(window, "pointerup", onUp, false);
  };
  let onUp = (e3) => {
    var _e_changedTouches;
    var _e_pointerId;
    let id2 = (_e_pointerId = e3.pointerId) !== null && _e_pointerId !== void 0 ? _e_pointerId : (_e_changedTouches = e3.changedTouches) === null || _e_changedTouches === void 0 ? void 0 : _e_changedTouches[0].identifier;
    if (id2 === currentPointer.current) {
      focusInput();
      state.setThumbDragging(index, false);
      removeGlobalListener(window, "mouseup", onUp, false);
      removeGlobalListener(window, "touchend", onUp, false);
      removeGlobalListener(window, "pointerup", onUp, false);
    }
  };
  let thumbPosition = state.getThumbPercent(index);
  if (isVertical || direction === "rtl")
    thumbPosition = 1 - thumbPosition;
  let interactions = !isDisabled ? (0, $3ef42575df84b30b$export$9d1611c77c2fe928)(keyboardProps, moveProps, {
    onMouseDown: (e3) => {
      if (e3.button !== 0 || e3.altKey || e3.ctrlKey || e3.metaKey)
        return;
      onDown();
    },
    onPointerDown: (e3) => {
      if (e3.button !== 0 || e3.altKey || e3.ctrlKey || e3.metaKey)
        return;
      onDown(e3.pointerId);
    },
    onTouchStart: (e3) => {
      onDown(e3.changedTouches[0].identifier);
    }
  }) : {};
  (0, $99facab73266f662$export$5add1d006293d136)(inputRef, value, (v4) => {
    state.setThumbValue(index, v4);
  });
  return {
    inputProps: (0, $3ef42575df84b30b$export$9d1611c77c2fe928)(focusableProps, fieldProps, {
      type: "range",
      tabIndex: !isDisabled ? 0 : void 0,
      min: state.getThumbMinValue(index),
      max: state.getThumbMaxValue(index),
      step: state.step,
      value,
      name: name2,
      disabled: isDisabled,
      "aria-orientation": orientation,
      "aria-valuetext": state.getThumbValueLabel(index),
      "aria-required": isRequired || void 0,
      "aria-invalid": isInvalid || validationState === "invalid" || void 0,
      "aria-errormessage": opts["aria-errormessage"],
      "aria-describedby": [
        data["aria-describedby"],
        opts["aria-describedby"]
      ].filter(Boolean).join(" "),
      "aria-details": [
        data["aria-details"],
        opts["aria-details"]
      ].filter(Boolean).join(" "),
      onChange: (e3) => {
        state.setThumbValue(index, parseFloat(e3.target.value));
      }
    }),
    thumbProps: {
      ...interactions,
      style: {
        position: "absolute",
        [isVertical ? "top" : "left"]: `${thumbPosition * 100}%`,
        transform: "translate(-50%, -50%)",
        touchAction: "none"
      }
    },
    labelProps,
    isDragging: state.isThumbDragging(index),
    isDisabled,
    isFocused
  };
}

// node_modules/@react-aria/progress/dist/import.mjs
function $204d9ebcedfb8806$export$ed5abd763a836edc(props) {
  let { value = 0, minValue = 0, maxValue = 100, valueLabel, isIndeterminate, formatOptions = {
    style: "percent"
  } } = props;
  let domProps = (0, $65484d02dcb7eb3e$export$457c3d6518dd4c6f)(props, {
    labelable: true
  });
  let { labelProps, fieldProps } = (0, $d191a55c9702f145$export$8467354a121f1b9f)({
    ...props,
    // Progress bar is not an HTML input element so it
    // shouldn't be labeled by a <label> element.
    labelElementType: "span"
  });
  value = (0, $9446cca9a3875146$export$7d15b64cf5a3a4c4)(value, minValue, maxValue);
  let percentage = (value - minValue) / (maxValue - minValue);
  let formatter3 = (0, $a916eb452884faea$export$b7a616150fdb9f44)(formatOptions);
  if (!isIndeterminate && !valueLabel) {
    let valueToFormat = formatOptions.style === "percent" ? percentage : value;
    valueLabel = formatter3.format(valueToFormat);
  }
  return {
    progressBarProps: (0, $3ef42575df84b30b$export$9d1611c77c2fe928)(domProps, {
      ...fieldProps,
      "aria-valuenow": isIndeterminate ? void 0 : value,
      "aria-valuemin": minValue,
      "aria-valuemax": maxValue,
      "aria-valuetext": isIndeterminate ? void 0 : valueLabel,
      role: "progressbar"
    }),
    labelProps
  };
}

// node_modules/@react-aria/toggle/dist/import.mjs
function $d2c8e2b0480f3f34$export$cbe85ee05b554577(props, state, ref) {
  let { isDisabled = false, isRequired = false, isReadOnly = false, value, name: name2, children, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, validationState = "valid", isInvalid } = props;
  let onChange = (e3) => {
    e3.stopPropagation();
    state.setSelected(e3.target.checked);
  };
  let hasChildren = children != null;
  let hasAriaLabel = ariaLabel != null || ariaLabelledby != null;
  if (!hasChildren && !hasAriaLabel)
    console.warn("If you do not provide children, you must specify an aria-label for accessibility");
  let { pressProps, isPressed } = (0, $f6c31cce2adf654f$export$45712eceda6fad21)({
    isDisabled
  });
  let { focusableProps } = (0, $e6afbd83fe6ebbd2$export$4c014de7c8940b4c)(props, ref);
  let interactions = (0, $3ef42575df84b30b$export$9d1611c77c2fe928)(pressProps, focusableProps);
  let domProps = (0, $65484d02dcb7eb3e$export$457c3d6518dd4c6f)(props, {
    labelable: true
  });
  (0, $99facab73266f662$export$5add1d006293d136)(ref, state.isSelected, state.setSelected);
  return {
    inputProps: (0, $3ef42575df84b30b$export$9d1611c77c2fe928)(domProps, {
      "aria-invalid": isInvalid || validationState === "invalid" || void 0,
      "aria-errormessage": props["aria-errormessage"],
      "aria-controls": props["aria-controls"],
      "aria-readonly": isReadOnly || void 0,
      "aria-required": isRequired || void 0,
      onChange,
      disabled: isDisabled,
      ...value == null ? {} : {
        value
      },
      name: name2,
      type: "checkbox",
      ...interactions
    }),
    isSelected: state.isSelected,
    isPressed,
    isDisabled,
    isReadOnly,
    isInvalid: isInvalid || validationState === "invalid"
  };
}

// node_modules/@react-aria/switch/dist/import.mjs
function $b418ec0c85c52f27$export$d853f7095ae95f88(props, state, ref) {
  let { inputProps, isSelected, isPressed, isDisabled, isReadOnly } = (0, $d2c8e2b0480f3f34$export$cbe85ee05b554577)(props, state, ref);
  return {
    inputProps: {
      ...inputProps,
      role: "switch",
      checked: isSelected
    },
    isSelected,
    isPressed,
    isDisabled,
    isReadOnly
  };
}

// node_modules/@react-stately/toggle/dist/import.mjs
function $3017fa7ffdddec74$export$8042c6c013fd5226(props = {}) {
  let { isReadOnly } = props;
  let [isSelected, setSelected] = (0, $458b0a5536c1a7cf$export$40bfa8c7b0832715)(props.isSelected, props.defaultSelected || false, props.onChange);
  function updateSelected(value) {
    if (!isReadOnly)
      setSelected(value);
  }
  function toggleState() {
    if (!isReadOnly)
      setSelected(!isSelected);
  }
  return {
    isSelected,
    setSelected: updateSelected,
    toggle: toggleState
  };
}

// node_modules/@arizeai/components/dist/components.esm.js
function _regeneratorRuntime() {
  _regeneratorRuntime = function() {
    return e3;
  };
  var t3, e3 = {}, r3 = Object.prototype, n2 = r3.hasOwnProperty, o = Object.defineProperty || function(t4, e4, r4) {
    t4[e4] = r4.value;
  }, i2 = "function" == typeof Symbol ? Symbol : {}, a2 = i2.iterator || "@@iterator", c4 = i2.asyncIterator || "@@asyncIterator", u = i2.toStringTag || "@@toStringTag";
  function define2(t4, e4, r4) {
    return Object.defineProperty(t4, e4, {
      value: r4,
      enumerable: true,
      configurable: true,
      writable: true
    }), t4[e4];
  }
  try {
    define2({}, "");
  } catch (t4) {
    define2 = function(t5, e4, r4) {
      return t5[e4] = r4;
    };
  }
  function wrap(t4, e4, r4, n3) {
    var i3 = e4 && e4.prototype instanceof Generator ? e4 : Generator, a3 = Object.create(i3.prototype), c5 = new Context2(n3 || []);
    return o(a3, "_invoke", {
      value: makeInvokeMethod(t4, r4, c5)
    }), a3;
  }
  function tryCatch(t4, e4, r4) {
    try {
      return {
        type: "normal",
        arg: t4.call(e4, r4)
      };
    } catch (t5) {
      return {
        type: "throw",
        arg: t5
      };
    }
  }
  e3.wrap = wrap;
  var h = "suspendedStart", l = "suspendedYield", f = "executing", s2 = "completed", y2 = {};
  function Generator() {
  }
  function GeneratorFunction() {
  }
  function GeneratorFunctionPrototype() {
  }
  var p = {};
  define2(p, a2, function() {
    return this;
  });
  var d = Object.getPrototypeOf, v4 = d && d(d(values2([])));
  v4 && v4 !== r3 && n2.call(v4, a2) && (p = v4);
  var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
  function defineIteratorMethods(t4) {
    ["next", "throw", "return"].forEach(function(e4) {
      define2(t4, e4, function(t5) {
        return this._invoke(e4, t5);
      });
    });
  }
  function AsyncIterator(t4, e4) {
    function invoke(r5, o2, i3, a3) {
      var c5 = tryCatch(t4[r5], t4, o2);
      if ("throw" !== c5.type) {
        var u2 = c5.arg, h2 = u2.value;
        return h2 && "object" == typeof h2 && n2.call(h2, "__await") ? e4.resolve(h2.__await).then(function(t5) {
          invoke("next", t5, i3, a3);
        }, function(t5) {
          invoke("throw", t5, i3, a3);
        }) : e4.resolve(h2).then(function(t5) {
          u2.value = t5, i3(u2);
        }, function(t5) {
          return invoke("throw", t5, i3, a3);
        });
      }
      a3(c5.arg);
    }
    var r4;
    o(this, "_invoke", {
      value: function(t5, n3) {
        function callInvokeWithMethodAndArg() {
          return new e4(function(e6, r5) {
            invoke(t5, n3, e6, r5);
          });
        }
        return r4 = r4 ? r4.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
      }
    });
  }
  function makeInvokeMethod(e4, r4, n3) {
    var o2 = h;
    return function(i3, a3) {
      if (o2 === f)
        throw new Error("Generator is already running");
      if (o2 === s2) {
        if ("throw" === i3)
          throw a3;
        return {
          value: t3,
          done: true
        };
      }
      for (n3.method = i3, n3.arg = a3; ; ) {
        var c5 = n3.delegate;
        if (c5) {
          var u2 = maybeInvokeDelegate(c5, n3);
          if (u2) {
            if (u2 === y2)
              continue;
            return u2;
          }
        }
        if ("next" === n3.method)
          n3.sent = n3._sent = n3.arg;
        else if ("throw" === n3.method) {
          if (o2 === h)
            throw o2 = s2, n3.arg;
          n3.dispatchException(n3.arg);
        } else
          "return" === n3.method && n3.abrupt("return", n3.arg);
        o2 = f;
        var p2 = tryCatch(e4, r4, n3);
        if ("normal" === p2.type) {
          if (o2 = n3.done ? s2 : l, p2.arg === y2)
            continue;
          return {
            value: p2.arg,
            done: n3.done
          };
        }
        "throw" === p2.type && (o2 = s2, n3.method = "throw", n3.arg = p2.arg);
      }
    };
  }
  function maybeInvokeDelegate(e4, r4) {
    var n3 = r4.method, o2 = e4.iterator[n3];
    if (o2 === t3)
      return r4.delegate = null, "throw" === n3 && e4.iterator.return && (r4.method = "return", r4.arg = t3, maybeInvokeDelegate(e4, r4), "throw" === r4.method) || "return" !== n3 && (r4.method = "throw", r4.arg = new TypeError("The iterator does not provide a '" + n3 + "' method")), y2;
    var i3 = tryCatch(o2, e4.iterator, r4.arg);
    if ("throw" === i3.type)
      return r4.method = "throw", r4.arg = i3.arg, r4.delegate = null, y2;
    var a3 = i3.arg;
    return a3 ? a3.done ? (r4[e4.resultName] = a3.value, r4.next = e4.nextLoc, "return" !== r4.method && (r4.method = "next", r4.arg = t3), r4.delegate = null, y2) : a3 : (r4.method = "throw", r4.arg = new TypeError("iterator result is not an object"), r4.delegate = null, y2);
  }
  function pushTryEntry(t4) {
    var e4 = {
      tryLoc: t4[0]
    };
    1 in t4 && (e4.catchLoc = t4[1]), 2 in t4 && (e4.finallyLoc = t4[2], e4.afterLoc = t4[3]), this.tryEntries.push(e4);
  }
  function resetTryEntry(t4) {
    var e4 = t4.completion || {};
    e4.type = "normal", delete e4.arg, t4.completion = e4;
  }
  function Context2(t4) {
    this.tryEntries = [{
      tryLoc: "root"
    }], t4.forEach(pushTryEntry, this), this.reset(true);
  }
  function values2(e4) {
    if (e4 || "" === e4) {
      var r4 = e4[a2];
      if (r4)
        return r4.call(e4);
      if ("function" == typeof e4.next)
        return e4;
      if (!isNaN(e4.length)) {
        var o2 = -1, i3 = function next2() {
          for (; ++o2 < e4.length; )
            if (n2.call(e4, o2))
              return next2.value = e4[o2], next2.done = false, next2;
          return next2.value = t3, next2.done = true, next2;
        };
        return i3.next = i3;
      }
    }
    throw new TypeError(typeof e4 + " is not iterable");
  }
  return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
    value: GeneratorFunctionPrototype,
    configurable: true
  }), o(GeneratorFunctionPrototype, "constructor", {
    value: GeneratorFunction,
    configurable: true
  }), GeneratorFunction.displayName = define2(GeneratorFunctionPrototype, u, "GeneratorFunction"), e3.isGeneratorFunction = function(t4) {
    var e4 = "function" == typeof t4 && t4.constructor;
    return !!e4 && (e4 === GeneratorFunction || "GeneratorFunction" === (e4.displayName || e4.name));
  }, e3.mark = function(t4) {
    return Object.setPrototypeOf ? Object.setPrototypeOf(t4, GeneratorFunctionPrototype) : (t4.__proto__ = GeneratorFunctionPrototype, define2(t4, u, "GeneratorFunction")), t4.prototype = Object.create(g), t4;
  }, e3.awrap = function(t4) {
    return {
      __await: t4
    };
  }, defineIteratorMethods(AsyncIterator.prototype), define2(AsyncIterator.prototype, c4, function() {
    return this;
  }), e3.AsyncIterator = AsyncIterator, e3.async = function(t4, r4, n3, o2, i3) {
    void 0 === i3 && (i3 = Promise);
    var a3 = new AsyncIterator(wrap(t4, r4, n3, o2), i3);
    return e3.isGeneratorFunction(r4) ? a3 : a3.next().then(function(t5) {
      return t5.done ? t5.value : a3.next();
    });
  }, defineIteratorMethods(g), define2(g, u, "Generator"), define2(g, a2, function() {
    return this;
  }), define2(g, "toString", function() {
    return "[object Generator]";
  }), e3.keys = function(t4) {
    var e4 = Object(t4), r4 = [];
    for (var n3 in e4)
      r4.push(n3);
    return r4.reverse(), function next2() {
      for (; r4.length; ) {
        var t5 = r4.pop();
        if (t5 in e4)
          return next2.value = t5, next2.done = false, next2;
      }
      return next2.done = true, next2;
    };
  }, e3.values = values2, Context2.prototype = {
    constructor: Context2,
    reset: function(e4) {
      if (this.prev = 0, this.next = 0, this.sent = this._sent = t3, this.done = false, this.delegate = null, this.method = "next", this.arg = t3, this.tryEntries.forEach(resetTryEntry), !e4)
        for (var r4 in this)
          "t" === r4.charAt(0) && n2.call(this, r4) && !isNaN(+r4.slice(1)) && (this[r4] = t3);
    },
    stop: function() {
      this.done = true;
      var t4 = this.tryEntries[0].completion;
      if ("throw" === t4.type)
        throw t4.arg;
      return this.rval;
    },
    dispatchException: function(e4) {
      if (this.done)
        throw e4;
      var r4 = this;
      function handle(n3, o3) {
        return a3.type = "throw", a3.arg = e4, r4.next = n3, o3 && (r4.method = "next", r4.arg = t3), !!o3;
      }
      for (var o2 = this.tryEntries.length - 1; o2 >= 0; --o2) {
        var i3 = this.tryEntries[o2], a3 = i3.completion;
        if ("root" === i3.tryLoc)
          return handle("end");
        if (i3.tryLoc <= this.prev) {
          var c5 = n2.call(i3, "catchLoc"), u2 = n2.call(i3, "finallyLoc");
          if (c5 && u2) {
            if (this.prev < i3.catchLoc)
              return handle(i3.catchLoc, true);
            if (this.prev < i3.finallyLoc)
              return handle(i3.finallyLoc);
          } else if (c5) {
            if (this.prev < i3.catchLoc)
              return handle(i3.catchLoc, true);
          } else {
            if (!u2)
              throw new Error("try statement without catch or finally");
            if (this.prev < i3.finallyLoc)
              return handle(i3.finallyLoc);
          }
        }
      }
    },
    abrupt: function(t4, e4) {
      for (var r4 = this.tryEntries.length - 1; r4 >= 0; --r4) {
        var o2 = this.tryEntries[r4];
        if (o2.tryLoc <= this.prev && n2.call(o2, "finallyLoc") && this.prev < o2.finallyLoc) {
          var i3 = o2;
          break;
        }
      }
      i3 && ("break" === t4 || "continue" === t4) && i3.tryLoc <= e4 && e4 <= i3.finallyLoc && (i3 = null);
      var a3 = i3 ? i3.completion : {};
      return a3.type = t4, a3.arg = e4, i3 ? (this.method = "next", this.next = i3.finallyLoc, y2) : this.complete(a3);
    },
    complete: function(t4, e4) {
      if ("throw" === t4.type)
        throw t4.arg;
      return "break" === t4.type || "continue" === t4.type ? this.next = t4.arg : "return" === t4.type ? (this.rval = this.arg = t4.arg, this.method = "return", this.next = "end") : "normal" === t4.type && e4 && (this.next = e4), y2;
    },
    finish: function(t4) {
      for (var e4 = this.tryEntries.length - 1; e4 >= 0; --e4) {
        var r4 = this.tryEntries[e4];
        if (r4.finallyLoc === t4)
          return this.complete(r4.completion, r4.afterLoc), resetTryEntry(r4), y2;
      }
    },
    catch: function(t4) {
      for (var e4 = this.tryEntries.length - 1; e4 >= 0; --e4) {
        var r4 = this.tryEntries[e4];
        if (r4.tryLoc === t4) {
          var n3 = r4.completion;
          if ("throw" === n3.type) {
            var o2 = n3.arg;
            resetTryEntry(r4);
          }
          return o2;
        }
      }
      throw new Error("illegal catch attempt");
    },
    delegateYield: function(e4, r4, n3) {
      return this.delegate = {
        iterator: values2(e4),
        resultName: r4,
        nextLoc: n3
      }, "next" === this.method && (this.arg = t3), y2;
    }
  }, e3;
}
function _extends2() {
  _extends2 = Object.assign ? Object.assign.bind() : function(target) {
    for (var i2 = 1; i2 < arguments.length; i2++) {
      var source = arguments[i2];
      for (var key in source) {
        if (Object.prototype.hasOwnProperty.call(source, key)) {
          target[key] = source[key];
        }
      }
    }
    return target;
  };
  return _extends2.apply(this, arguments);
}
function _inheritsLoose2(subClass, superClass) {
  subClass.prototype = Object.create(superClass.prototype);
  subClass.prototype.constructor = subClass;
  _setPrototypeOf2(subClass, superClass);
}
function _setPrototypeOf2(o, p) {
  _setPrototypeOf2 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf19(o2, p2) {
    o2.__proto__ = p2;
    return o2;
  };
  return _setPrototypeOf2(o, p);
}
function _objectDestructuringEmpty(obj) {
  if (obj == null)
    throw new TypeError("Cannot destructure " + obj);
}
function _objectWithoutPropertiesLoose2(source, excluded) {
  if (source == null)
    return {};
  var target = {};
  var sourceKeys = Object.keys(source);
  var key, i2;
  for (i2 = 0; i2 < sourceKeys.length; i2++) {
    key = sourceKeys[i2];
    if (excluded.indexOf(key) >= 0)
      continue;
    target[key] = source[key];
  }
  return target;
}
function _assertThisInitialized2(self2) {
  if (self2 === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }
  return self2;
}
function _taggedTemplateLiteralLoose2(strings, raw) {
  if (!raw) {
    raw = strings.slice(0);
  }
  strings.raw = raw;
  return strings;
}
function _unsupportedIterableToArray(o, minLen) {
  if (!o)
    return;
  if (typeof o === "string")
    return _arrayLikeToArray(o, minLen);
  var n2 = Object.prototype.toString.call(o).slice(8, -1);
  if (n2 === "Object" && o.constructor)
    n2 = o.constructor.name;
  if (n2 === "Map" || n2 === "Set")
    return Array.from(o);
  if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2))
    return _arrayLikeToArray(o, minLen);
}
function _arrayLikeToArray(arr, len) {
  if (len == null || len > arr.length)
    len = arr.length;
  for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++)
    arr2[i2] = arr[i2];
  return arr2;
}
function _createForOfIteratorHelperLoose(o, allowArrayLike) {
  var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
  if (it)
    return (it = it.call(o)).next.bind(it);
  if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
    if (it)
      o = it;
    var i2 = 0;
    return function() {
      if (i2 >= o.length)
        return {
          done: true
        };
      return {
        done: false,
        value: o[i2++]
      };
    };
  }
  throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _EMOTION_STRINGIFIED_CSS_ERROR__() {
  return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
}
var mediumRootCSS = false ? {
  name: "9rndb8",
  styles: ":root{--ac-global-dimension-scale-factor:1;--ac-global-dimension-size-0:0px;--ac-global-dimension-size-10:1px;--ac-global-dimension-size-25:2px;--ac-global-dimension-size-30:2px;--ac-global-dimension-size-40:3px;--ac-global-dimension-size-50:4px;--ac-global-dimension-size-65:5px;--ac-global-dimension-size-75:6px;--ac-global-dimension-size-85:7px;--ac-global-dimension-size-100:8px;--ac-global-dimension-size-115:9px;--ac-global-dimension-size-125:10px;--ac-global-dimension-size-130:11px;--ac-global-dimension-size-150:12px;--ac-global-dimension-size-160:13px;--ac-global-dimension-size-175:14px;--ac-global-dimension-size-185:15px;--ac-global-dimension-size-200:16px;--ac-global-dimension-size-225:18px;--ac-global-dimension-size-250:20px;--ac-global-dimension-size-275:22px;--ac-global-dimension-size-300:24px;--ac-global-dimension-size-325:26px;--ac-global-dimension-size-350:28px;--ac-global-dimension-size-400:32px;--ac-global-dimension-size-450:36px;--ac-global-dimension-size-500:40px;--ac-global-dimension-size-550:44px;--ac-global-dimension-size-600:48px;--ac-global-dimension-size-650:52px;--ac-global-dimension-size-675:54px;--ac-global-dimension-size-700:56px;--ac-global-dimension-size-750:60px;--ac-global-dimension-size-800:64px;--ac-global-dimension-size-900:72px;--ac-global-dimension-size-1000:80px;--ac-global-dimension-size-1125:90px;--ac-global-dimension-size-1200:96px;--ac-global-dimension-size-1250:100px;--ac-global-dimension-size-1600:128px;--ac-global-dimension-size-1700:136px;--ac-global-dimension-size-1800:144px;--ac-global-dimension-size-2000:160px;--ac-global-dimension-size-2400:192px;--ac-global-dimension-size-2500:200px;--ac-global-dimension-size-3000:240px;--ac-global-dimension-size-3400:272px;--ac-global-dimension-size-3600:288px;--ac-global-dimension-size-4600:368px;--ac-global-dimension-size-5000:400px;--ac-global-dimension-size-6000:480px;}"
} : {
  name: "w27t3t-mediumRootCSS",
  styles: ":root{--ac-global-dimension-scale-factor:1;--ac-global-dimension-size-0:0px;--ac-global-dimension-size-10:1px;--ac-global-dimension-size-25:2px;--ac-global-dimension-size-30:2px;--ac-global-dimension-size-40:3px;--ac-global-dimension-size-50:4px;--ac-global-dimension-size-65:5px;--ac-global-dimension-size-75:6px;--ac-global-dimension-size-85:7px;--ac-global-dimension-size-100:8px;--ac-global-dimension-size-115:9px;--ac-global-dimension-size-125:10px;--ac-global-dimension-size-130:11px;--ac-global-dimension-size-150:12px;--ac-global-dimension-size-160:13px;--ac-global-dimension-size-175:14px;--ac-global-dimension-size-185:15px;--ac-global-dimension-size-200:16px;--ac-global-dimension-size-225:18px;--ac-global-dimension-size-250:20px;--ac-global-dimension-size-275:22px;--ac-global-dimension-size-300:24px;--ac-global-dimension-size-325:26px;--ac-global-dimension-size-350:28px;--ac-global-dimension-size-400:32px;--ac-global-dimension-size-450:36px;--ac-global-dimension-size-500:40px;--ac-global-dimension-size-550:44px;--ac-global-dimension-size-600:48px;--ac-global-dimension-size-650:52px;--ac-global-dimension-size-675:54px;--ac-global-dimension-size-700:56px;--ac-global-dimension-size-750:60px;--ac-global-dimension-size-800:64px;--ac-global-dimension-size-900:72px;--ac-global-dimension-size-1000:80px;--ac-global-dimension-size-1125:90px;--ac-global-dimension-size-1200:96px;--ac-global-dimension-size-1250:100px;--ac-global-dimension-size-1600:128px;--ac-global-dimension-size-1700:136px;--ac-global-dimension-size-1800:144px;--ac-global-dimension-size-2000:160px;--ac-global-dimension-size-2400:192px;--ac-global-dimension-size-2500:200px;--ac-global-dimension-size-3000:240px;--ac-global-dimension-size-3400:272px;--ac-global-dimension-size-3600:288px;--ac-global-dimension-size-4600:368px;--ac-global-dimension-size-5000:400px;--ac-global-dimension-size-6000:480px;};label:mediumRootCSS;",
  map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */",
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__
};
var staticCSS = false ? {
  name: "18z5ye1",
  styles: ":root{--ac-global-static-color-white-900:rgba(255, 255, 255, 0.9);--ac-global-static-color-white-700:rgba(255, 255, 255, 0.7);--ac-global-static-color-white-300:rgba(255, 255, 255, 0.3);}"
} : {
  name: "1bmm68z-staticCSS",
  styles: ":root{--ac-global-static-color-white-900:rgba(255, 255, 255, 0.9);--ac-global-static-color-white-700:rgba(255, 255, 255, 0.7);--ac-global-static-color-white-300:rgba(255, 255, 255, 0.3);};label:staticCSS;",
  map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */",
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__
};
var dimensionsCSS = false ? {
  name: "1rwlz7j",
  styles: ":root{--ac-global-dimension-static-size-0:0px;--ac-global-dimension-static-size-10:1px;--ac-global-dimension-static-size-25:2px;--ac-global-dimension-static-size-50:4px;--ac-global-dimension-static-size-40:3px;--ac-global-dimension-static-size-65:5px;--ac-global-dimension-static-size-100:8px;--ac-global-dimension-static-size-115:9px;--ac-global-dimension-static-size-125:10px;--ac-global-dimension-static-size-130:11px;--ac-global-dimension-static-size-150:12px;--ac-global-dimension-static-size-160:13px;--ac-global-dimension-static-size-175:14px;--ac-global-dimension-static-size-200:16px;--ac-global-dimension-static-size-225:18px;--ac-global-dimension-static-size-250:20px;--ac-global-dimension-static-size-300:24px;--ac-global-dimension-static-size-400:32px;--ac-global-dimension-static-size-450:36px;--ac-global-dimension-static-size-500:40px;--ac-global-dimension-static-size-550:44px;--ac-global-dimension-static-size-600:48px;--ac-global-dimension-static-size-700:56px;--ac-global-dimension-static-size-800:64px;--ac-global-dimension-static-size-900:72px;--ac-global-dimension-static-size-1000:80px;--ac-global-dimension-static-size-1200:96px;--ac-global-dimension-static-size-1700:136px;--ac-global-dimension-static-size-2400:192px;--ac-global-dimension-static-size-2600:208px;--ac-global-dimension-static-size-3400:272px;--ac-global-dimension-static-size-3600:288px;--ac-global-dimension-static-size-4600:368px;--ac-global-dimension-static-size-5000:400px;--ac-global-dimension-static-size-6000:480px;--ac-global-dimension-static-font-size-50:11px;--ac-global-dimension-static-font-size-75:12px;--ac-global-dimension-static-font-size-100:14px;--ac-global-dimension-static-font-size-150:15px;--ac-global-dimension-static-font-size-200:16px;--ac-global-dimension-static-font-size-300:18px;--ac-global-dimension-static-font-size-400:20px;--ac-global-dimension-static-font-size-500:22px;--ac-global-dimension-static-font-size-600:25px;--ac-global-dimension-static-font-size-700:28px;--ac-global-dimension-static-font-size-800:32px;--ac-global-dimension-static-font-size-900:36px;--ac-global-dimension-static-font-size-1000:40px;--ac-global-dimension-static-percent-50:50%;--ac-global-dimension-static-percent-100:100%;--ac-global-dimension-static-breakpoint-xsmall:304px;--ac-global-dimension-static-breakpoint-small:768px;--ac-global-dimension-static-breakpoint-medium:1280px;--ac-global-dimension-static-breakpoint-large:1768px;--ac-global-dimension-static-breakpoint-xlarge:2160px;--ac-global-dimension-static-grid-columns:12;--ac-global-dimension-static-grid-fluid-width:100%;--ac-global-dimension-static-grid-fixed-max-width:1280px;}"
} : {
  name: "lbizev-dimensionsCSS",
  styles: ":root{--ac-global-dimension-static-size-0:0px;--ac-global-dimension-static-size-10:1px;--ac-global-dimension-static-size-25:2px;--ac-global-dimension-static-size-50:4px;--ac-global-dimension-static-size-40:3px;--ac-global-dimension-static-size-65:5px;--ac-global-dimension-static-size-100:8px;--ac-global-dimension-static-size-115:9px;--ac-global-dimension-static-size-125:10px;--ac-global-dimension-static-size-130:11px;--ac-global-dimension-static-size-150:12px;--ac-global-dimension-static-size-160:13px;--ac-global-dimension-static-size-175:14px;--ac-global-dimension-static-size-200:16px;--ac-global-dimension-static-size-225:18px;--ac-global-dimension-static-size-250:20px;--ac-global-dimension-static-size-300:24px;--ac-global-dimension-static-size-400:32px;--ac-global-dimension-static-size-450:36px;--ac-global-dimension-static-size-500:40px;--ac-global-dimension-static-size-550:44px;--ac-global-dimension-static-size-600:48px;--ac-global-dimension-static-size-700:56px;--ac-global-dimension-static-size-800:64px;--ac-global-dimension-static-size-900:72px;--ac-global-dimension-static-size-1000:80px;--ac-global-dimension-static-size-1200:96px;--ac-global-dimension-static-size-1700:136px;--ac-global-dimension-static-size-2400:192px;--ac-global-dimension-static-size-2600:208px;--ac-global-dimension-static-size-3400:272px;--ac-global-dimension-static-size-3600:288px;--ac-global-dimension-static-size-4600:368px;--ac-global-dimension-static-size-5000:400px;--ac-global-dimension-static-size-6000:480px;--ac-global-dimension-static-font-size-50:11px;--ac-global-dimension-static-font-size-75:12px;--ac-global-dimension-static-font-size-100:14px;--ac-global-dimension-static-font-size-150:15px;--ac-global-dimension-static-font-size-200:16px;--ac-global-dimension-static-font-size-300:18px;--ac-global-dimension-static-font-size-400:20px;--ac-global-dimension-static-font-size-500:22px;--ac-global-dimension-static-font-size-600:25px;--ac-global-dimension-static-font-size-700:28px;--ac-global-dimension-static-font-size-800:32px;--ac-global-dimension-static-font-size-900:36px;--ac-global-dimension-static-font-size-1000:40px;--ac-global-dimension-static-percent-50:50%;--ac-global-dimension-static-percent-100:100%;--ac-global-dimension-static-breakpoint-xsmall:304px;--ac-global-dimension-static-breakpoint-small:768px;--ac-global-dimension-static-breakpoint-medium:1280px;--ac-global-dimension-static-breakpoint-large:1768px;--ac-global-dimension-static-breakpoint-xlarge:2160px;--ac-global-dimension-static-grid-columns:12;--ac-global-dimension-static-grid-fluid-width:100%;--ac-global-dimension-static-grid-fixed-max-width:1280px;};label:dimensionsCSS;",
  map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */",
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__
};
var darkThemeCSS = false ? {
  name: "xwbvnd",
  styles: ":root,.ac-theme--dark{--ac-global-color-primary:rgb(114, 217, 255);--ac-global-color-primary-900:rgba(114, 217, 255, 0.9);--ac-global-color-primary-700:rgba(114, 217, 255, 0.7);--ac-global-color-primary-500:rgba(114, 217, 255, 0.5);--ac-global-color-primary-300:rgba(114, 217, 255, 0.3);--ac-global-color-gray-900:#181b1f;--ac-global-color-gray-800:#1d2126;--ac-global-color-gray-700:#23282e;--ac-global-color-gray-600:#282e35;--ac-global-color-gray-500:#2f353d;--ac-global-color-gray-400:#3d434a;--ac-global-color-gray-300:#4a5057;--ac-global-color-gray-200:#585d64;--ac-global-color-gray-100:#666b71;--ac-global-color-grey-50-rgb:0,0,0;--ac-global-color-grey-50:rgb(var(--ac-global-color-grey-50-rgb));--ac-global-color-grey-75-rgb:14,14,14;--ac-global-color-grey-75:rgb(var(--ac-global-color-grey-75-rgb));--ac-global-color-grey-100-rgb:29,29,29;--ac-global-color-grey-100:rgb(var(--ac-global-color-grey-100-rgb));--ac-global-color-grey-200-rgb:48,48,48;--ac-global-color-grey-200:rgb(var(--ac-global-color-grey-200-rgb));--ac-global-color-grey-300-rgb:75,75,75;--ac-global-color-grey-300:rgb(var(--ac-global-color-grey-300-rgb));--ac-global-color-grey-400-rgb:106,106,106;--ac-global-color-grey-400:rgb(var(--ac-global-color-grey-400-rgb));--ac-global-color-grey-500-rgb:141,141,141;--ac-global-color-grey-500:rgb(var(--ac-global-color-grey-500-rgb));--ac-global-color-grey-600-rgb:176,176,176;--ac-global-color-grey-600:rgb(var(--ac-global-color-grey-600-rgb));--ac-global-color-grey-700-rgb:208,208,208;--ac-global-color-grey-700:rgb(var(--ac-global-color-grey-700-rgb));--ac-global-color-grey-800-rgb:235,235,235;--ac-global-color-grey-800:rgb(var(--ac-global-color-grey-800-rgb));--ac-global-color-grey-900-rgb:255,255,255;--ac-global-color-grey-900:rgb(var(--ac-global-color-grey-900-rgb));--ac-global-color-red-100-rgb:87,0,0;--ac-global-color-red-100:rgb(var(--ac-global-color-red-100-rgb));--ac-global-color-red-200-rgb:110,0,0;--ac-global-color-red-200:rgb(var(--ac-global-color-red-200-rgb));--ac-global-color-red-300-rgb:138,0,0;--ac-global-color-red-300:rgb(var(--ac-global-color-red-300-rgb));--ac-global-color-red-400-rgb:167,0,0;--ac-global-color-red-400:rgb(var(--ac-global-color-red-400-rgb));--ac-global-color-red-500-rgb:196,7,6;--ac-global-color-red-500:rgb(var(--ac-global-color-red-500-rgb));--ac-global-color-red-600-rgb:221,33,24;--ac-global-color-red-600:rgb(var(--ac-global-color-red-600-rgb));--ac-global-color-red-700-rgb:238,67,49;--ac-global-color-red-700:rgb(var(--ac-global-color-red-700-rgb));--ac-global-color-red-800-rgb:249,99,76;--ac-global-color-red-800:rgb(var(--ac-global-color-red-800-rgb));--ac-global-color-red-900-rgb:255,129,107;--ac-global-color-red-900:rgb(var(--ac-global-color-red-900-rgb));--ac-global-color-red-1000-rgb:255,158,140;--ac-global-color-red-1000:rgb(var(--ac-global-color-red-1000-rgb));--ac-global-color-red-1100-rgb:255,183,169;--ac-global-color-red-1100:rgb(var(--ac-global-color-red-1100-rgb));--ac-global-color-red-1200-rgb:255,205,195;--ac-global-color-red-1200:rgb(var(--ac-global-color-red-1200-rgb));--ac-global-color-red-1300-rgb:255,223,217;--ac-global-color-red-1300:rgb(var(--ac-global-color-red-1300-rgb));--ac-global-color-red-1400-rgb:255,237,234;--ac-global-color-red-1400:rgb(var(--ac-global-color-red-1400-rgb));--ac-global-color-orange-100-rgb:72,24,1;--ac-global-color-orange-100:rgb(var(--ac-global-color-orange-100-rgb));--ac-global-color-orange-200-rgb:92,32,0;--ac-global-color-orange-200:rgb(var(--ac-global-color-orange-200-rgb));--ac-global-color-orange-300-rgb:115,43,0;--ac-global-color-orange-300:rgb(var(--ac-global-color-orange-300-rgb));--ac-global-color-orange-400-rgb:138,55,0;--ac-global-color-orange-400:rgb(var(--ac-global-color-orange-400-rgb));--ac-global-color-orange-500-rgb:162,68,0;--ac-global-color-orange-500:rgb(var(--ac-global-color-orange-500-rgb));--ac-global-color-orange-600-rgb:186,82,0;--ac-global-color-orange-600:rgb(var(--ac-global-color-orange-600-rgb));--ac-global-color-orange-700-rgb:210,98,0;--ac-global-color-orange-700:rgb(var(--ac-global-color-orange-700-rgb));--ac-global-color-orange-800-rgb:232,116,0;--ac-global-color-orange-800:rgb(var(--ac-global-color-orange-800-rgb));--ac-global-color-orange-900-rgb:249,137,23;--ac-global-color-orange-900:rgb(var(--ac-global-color-orange-900-rgb));--ac-global-color-orange-1000-rgb:255,162,59;--ac-global-color-orange-1000:rgb(var(--ac-global-color-orange-1000-rgb));--ac-global-color-orange-1100-rgb:255,188,102;--ac-global-color-orange-1100:rgb(var(--ac-global-color-orange-1100-rgb));--ac-global-color-orange-1200-rgb:253,210,145;--ac-global-color-orange-1200:rgb(var(--ac-global-color-orange-1200-rgb));--ac-global-color-orange-1300-rgb:255,226,181;--ac-global-color-orange-1300:rgb(var(--ac-global-color-orange-1300-rgb));--ac-global-color-orange-1400-rgb:255,239,213;--ac-global-color-orange-1400:rgb(var(--ac-global-color-orange-1400-rgb));--ac-global-color-yellow-100-rgb:53,36,0;--ac-global-color-yellow-100:rgb(var(--ac-global-color-yellow-100-rgb));--ac-global-color-yellow-200-rgb:68,47,0;--ac-global-color-yellow-200:rgb(var(--ac-global-color-yellow-200-rgb));--ac-global-color-yellow-300-rgb:86,62,0;--ac-global-color-yellow-300:rgb(var(--ac-global-color-yellow-300-rgb));--ac-global-color-yellow-400-rgb:103,77,0;--ac-global-color-yellow-400:rgb(var(--ac-global-color-yellow-400-rgb));--ac-global-color-yellow-500-rgb:122,92,0;--ac-global-color-yellow-500:rgb(var(--ac-global-color-yellow-500-rgb));--ac-global-color-yellow-600-rgb:141,108,0;--ac-global-color-yellow-600:rgb(var(--ac-global-color-yellow-600-rgb));--ac-global-color-yellow-700-rgb:161,126,0;--ac-global-color-yellow-700:rgb(var(--ac-global-color-yellow-700-rgb));--ac-global-color-yellow-800-rgb:180,144,0;--ac-global-color-yellow-800:rgb(var(--ac-global-color-yellow-800-rgb));--ac-global-color-yellow-900-rgb:199,162,0;--ac-global-color-yellow-900:rgb(var(--ac-global-color-yellow-900-rgb));--ac-global-color-yellow-1000-rgb:216,181,0;--ac-global-color-yellow-1000:rgb(var(--ac-global-color-yellow-1000-rgb));--ac-global-color-yellow-1100-rgb:233,199,0;--ac-global-color-yellow-1100:rgb(var(--ac-global-color-yellow-1100-rgb));--ac-global-color-yellow-1200-rgb:247,216,4;--ac-global-color-yellow-1200:rgb(var(--ac-global-color-yellow-1200-rgb));--ac-global-color-yellow-1300-rgb:249,233,97;--ac-global-color-yellow-1300:rgb(var(--ac-global-color-yellow-1300-rgb));--ac-global-color-yellow-1400-rgb:252,243,170;--ac-global-color-yellow-1400:rgb(var(--ac-global-color-yellow-1400-rgb));--ac-global-color-chartreuse-100-rgb:32,43,0;--ac-global-color-chartreuse-100:rgb(\n      var(--ac-global-color-chartreuse-100-rgb)\n    );--ac-global-color-chartreuse-200-rgb:42,56,0;--ac-global-color-chartreuse-200:rgb(\n      var(--ac-global-color-chartreuse-200-rgb)\n    );--ac-global-color-chartreuse-300-rgb:54,72,0;--ac-global-color-chartreuse-300:rgb(\n      var(--ac-global-color-chartreuse-300-rgb)\n    );--ac-global-color-chartreuse-400-rgb:66,88,0;--ac-global-color-chartreuse-400:rgb(\n      var(--ac-global-color-chartreuse-400-rgb)\n    );--ac-global-color-chartreuse-500-rgb:79,105,0;--ac-global-color-chartreuse-500:rgb(\n      var(--ac-global-color-chartreuse-500-rgb)\n    );--ac-global-color-chartreuse-600-rgb:93,123,0;--ac-global-color-chartreuse-600:rgb(\n      var(--ac-global-color-chartreuse-600-rgb)\n    );--ac-global-color-chartreuse-700-rgb:107,142,0;--ac-global-color-chartreuse-700:rgb(\n      var(--ac-global-color-chartreuse-700-rgb)\n    );--ac-global-color-chartreuse-800-rgb:122,161,0;--ac-global-color-chartreuse-800:rgb(\n      var(--ac-global-color-chartreuse-800-rgb)\n    );--ac-global-color-chartreuse-900-rgb:138,180,3;--ac-global-color-chartreuse-900:rgb(\n      var(--ac-global-color-chartreuse-900-rgb)\n    );--ac-global-color-chartreuse-1000-rgb:154,198,11;--ac-global-color-chartreuse-1000:rgb(\n      var(--ac-global-color-chartreuse-1000-rgb)\n    );--ac-global-color-chartreuse-1100-rgb:170,216,22;--ac-global-color-chartreuse-1100:rgb(\n      var(--ac-global-color-chartreuse-1100-rgb)\n    );--ac-global-color-chartreuse-1200-rgb:187,232,41;--ac-global-color-chartreuse-1200:rgb(\n      var(--ac-global-color-chartreuse-1200-rgb)\n    );--ac-global-color-chartreuse-1300-rgb:205,246,72;--ac-global-color-chartreuse-1300:rgb(\n      var(--ac-global-color-chartreuse-1300-rgb)\n    );--ac-global-color-chartreuse-1400-rgb:225,253,132;--ac-global-color-chartreuse-1400:rgb(\n      var(--ac-global-color-chartreuse-1400-rgb)\n    );--ac-global-color-celery-100-rgb:0,47,7;--ac-global-color-celery-100:rgb(var(--ac-global-color-celery-100-rgb));--ac-global-color-celery-200-rgb:0,61,9;--ac-global-color-celery-200:rgb(var(--ac-global-color-celery-200-rgb));--ac-global-color-celery-300-rgb:0,77,12;--ac-global-color-celery-300:rgb(var(--ac-global-color-celery-300-rgb));--ac-global-color-celery-400-rgb:0,95,15;--ac-global-color-celery-400:rgb(var(--ac-global-color-celery-400-rgb));--ac-global-color-celery-500-rgb:0,113,15;--ac-global-color-celery-500:rgb(var(--ac-global-color-celery-500-rgb));--ac-global-color-celery-600-rgb:0,132,15;--ac-global-color-celery-600:rgb(var(--ac-global-color-celery-600-rgb));--ac-global-color-celery-700-rgb:0,151,20;--ac-global-color-celery-700:rgb(var(--ac-global-color-celery-700-rgb));--ac-global-color-celery-800-rgb:13,171,37;--ac-global-color-celery-800:rgb(var(--ac-global-color-celery-800-rgb));--ac-global-color-celery-900-rgb:45,191,58;--ac-global-color-celery-900:rgb(var(--ac-global-color-celery-900-rgb));--ac-global-color-celery-1000-rgb:80,208,82;--ac-global-color-celery-1000:rgb(var(--ac-global-color-celery-1000-rgb));--ac-global-color-celery-1100-rgb:115,224,107;--ac-global-color-celery-1100:rgb(var(--ac-global-color-celery-1100-rgb));--ac-global-color-celery-1200-rgb:147,237,131;--ac-global-color-celery-1200:rgb(var(--ac-global-color-celery-1200-rgb));--ac-global-color-celery-1300-rgb:180,247,165;--ac-global-color-celery-1300:rgb(var(--ac-global-color-celery-1300-rgb));--ac-global-color-celery-1400-rgb:213,252,202;--ac-global-color-celery-1400:rgb(var(--ac-global-color-celery-1400-rgb));--ac-global-color-green-100-rgb:10,44,28;--ac-global-color-green-100:rgb(var(--ac-global-color-green-100-rgb));--ac-global-color-green-200-rgb:7,59,36;--ac-global-color-green-200:rgb(var(--ac-global-color-green-200-rgb));--ac-global-color-green-300-rgb:0,76,46;--ac-global-color-green-300:rgb(var(--ac-global-color-green-300-rgb));--ac-global-color-green-400-rgb:0,93,57;--ac-global-color-green-400:rgb(var(--ac-global-color-green-400-rgb));--ac-global-color-green-500-rgb:0,111,69;--ac-global-color-green-500:rgb(var(--ac-global-color-green-500-rgb));--ac-global-color-green-600-rgb:0,130,82;--ac-global-color-green-600:rgb(var(--ac-global-color-green-600-rgb));--ac-global-color-green-700-rgb:0,149,98;--ac-global-color-green-700:rgb(var(--ac-global-color-green-700-rgb));--ac-global-color-green-800-rgb:28,168,114;--ac-global-color-green-800:rgb(var(--ac-global-color-green-800-rgb));--ac-global-color-green-900-rgb:52,187,132;--ac-global-color-green-900:rgb(var(--ac-global-color-green-900-rgb));--ac-global-color-green-1000-rgb:75,205,149;--ac-global-color-green-1000:rgb(var(--ac-global-color-green-1000-rgb));--ac-global-color-green-1100-rgb:103,222,168;--ac-global-color-green-1100:rgb(var(--ac-global-color-green-1100-rgb));--ac-global-color-green-1200-rgb:137,236,188;--ac-global-color-green-1200:rgb(var(--ac-global-color-green-1200-rgb));--ac-global-color-green-1300-rgb:177,244,209;--ac-global-color-green-1300:rgb(var(--ac-global-color-green-1300-rgb));--ac-global-color-green-1400-rgb:214,249,228;--ac-global-color-green-1400:rgb(var(--ac-global-color-green-1400-rgb));--ac-global-color-seafoam-100-rgb:18,43,42;--ac-global-color-seafoam-100:rgb(var(--ac-global-color-seafoam-100-rgb));--ac-global-color-seafoam-200-rgb:19,57,55;--ac-global-color-seafoam-200:rgb(var(--ac-global-color-seafoam-200-rgb));--ac-global-color-seafoam-300-rgb:16,73,70;--ac-global-color-seafoam-300:rgb(var(--ac-global-color-seafoam-300-rgb));--ac-global-color-seafoam-400-rgb:3,91,88;--ac-global-color-seafoam-400:rgb(var(--ac-global-color-seafoam-400-rgb));--ac-global-color-seafoam-500-rgb:0,108,104;--ac-global-color-seafoam-500:rgb(var(--ac-global-color-seafoam-500-rgb));--ac-global-color-seafoam-600-rgb:0,127,121;--ac-global-color-seafoam-600:rgb(var(--ac-global-color-seafoam-600-rgb));--ac-global-color-seafoam-700-rgb:0,146,140;--ac-global-color-seafoam-700:rgb(var(--ac-global-color-seafoam-700-rgb));--ac-global-color-seafoam-800-rgb:0,165,159;--ac-global-color-seafoam-800:rgb(var(--ac-global-color-seafoam-800-rgb));--ac-global-color-seafoam-900-rgb:26,185,178;--ac-global-color-seafoam-900:rgb(var(--ac-global-color-seafoam-900-rgb));--ac-global-color-seafoam-1000-rgb:66,202,195;--ac-global-color-seafoam-1000:rgb(\n      var(--ac-global-color-seafoam-1000-rgb)\n    );--ac-global-color-seafoam-1100-rgb:102,218,211;--ac-global-color-seafoam-1100:rgb(\n      var(--ac-global-color-seafoam-1100-rgb)\n    );--ac-global-color-seafoam-1200-rgb:139,232,225;--ac-global-color-seafoam-1200:rgb(\n      var(--ac-global-color-seafoam-1200-rgb)\n    );--ac-global-color-seafoam-1300-rgb:179,242,237;--ac-global-color-seafoam-1300:rgb(\n      var(--ac-global-color-seafoam-1300-rgb)\n    );--ac-global-color-seafoam-1400-rgb:215,248,244;--ac-global-color-seafoam-1400:rgb(\n      var(--ac-global-color-seafoam-1400-rgb)\n    );--ac-global-color-cyan-100-rgb:0,41,68;--ac-global-color-cyan-100:rgb(var(--ac-global-color-cyan-100-rgb));--ac-global-color-cyan-200-rgb:0,54,88;--ac-global-color-cyan-200:rgb(var(--ac-global-color-cyan-200-rgb));--ac-global-color-cyan-300-rgb:0,69,108;--ac-global-color-cyan-300:rgb(var(--ac-global-color-cyan-300-rgb));--ac-global-color-cyan-400-rgb:0,86,128;--ac-global-color-cyan-400:rgb(var(--ac-global-color-cyan-400-rgb));--ac-global-color-cyan-500-rgb:0,103,147;--ac-global-color-cyan-500:rgb(var(--ac-global-color-cyan-500-rgb));--ac-global-color-cyan-600-rgb:0,121,167;--ac-global-color-cyan-600:rgb(var(--ac-global-color-cyan-600-rgb));--ac-global-color-cyan-700-rgb:0,140,186;--ac-global-color-cyan-700:rgb(var(--ac-global-color-cyan-700-rgb));--ac-global-color-cyan-800-rgb:4,160,205;--ac-global-color-cyan-800:rgb(var(--ac-global-color-cyan-800-rgb));--ac-global-color-cyan-900-rgb:23,180,221;--ac-global-color-cyan-900:rgb(var(--ac-global-color-cyan-900-rgb));--ac-global-color-cyan-1000-rgb:57,199,234;--ac-global-color-cyan-1000:rgb(var(--ac-global-color-cyan-1000-rgb));--ac-global-color-cyan-1100-rgb:96,216,243;--ac-global-color-cyan-1100:rgb(var(--ac-global-color-cyan-1100-rgb));--ac-global-color-cyan-1200-rgb:134,230,250;--ac-global-color-cyan-1200:rgb(var(--ac-global-color-cyan-1200-rgb));--ac-global-color-cyan-1300-rgb:170,242,255;--ac-global-color-cyan-1300:rgb(var(--ac-global-color-cyan-1300-rgb));--ac-global-color-cyan-1400-rgb:206,249,255;--ac-global-color-cyan-1400:rgb(var(--ac-global-color-cyan-1400-rgb));--ac-global-color-blue-100-rgb:0,38,81;--ac-global-color-blue-100:rgb(var(--ac-global-color-blue-100-rgb));--ac-global-color-blue-200-rgb:0,50,106;--ac-global-color-blue-200:rgb(var(--ac-global-color-blue-200-rgb));--ac-global-color-blue-300-rgb:0,64,135;--ac-global-color-blue-300:rgb(var(--ac-global-color-blue-300-rgb));--ac-global-color-blue-400-rgb:0,78,166;--ac-global-color-blue-400:rgb(var(--ac-global-color-blue-400-rgb));--ac-global-color-blue-500-rgb:0,92,200;--ac-global-color-blue-500:rgb(var(--ac-global-color-blue-500-rgb));--ac-global-color-blue-600-rgb:6,108,231;--ac-global-color-blue-600:rgb(var(--ac-global-color-blue-600-rgb));--ac-global-color-blue-700-rgb:29,128,245;--ac-global-color-blue-700:rgb(var(--ac-global-color-blue-700-rgb));--ac-global-color-blue-800-rgb:64,150,243;--ac-global-color-blue-800:rgb(var(--ac-global-color-blue-800-rgb));--ac-global-color-blue-900-rgb:94,170,247;--ac-global-color-blue-900:rgb(var(--ac-global-color-blue-900-rgb));--ac-global-color-blue-1000-rgb:124,189,250;--ac-global-color-blue-1000:rgb(var(--ac-global-color-blue-1000-rgb));--ac-global-color-blue-1100-rgb:152,206,253;--ac-global-color-blue-1100:rgb(var(--ac-global-color-blue-1100-rgb));--ac-global-color-blue-1200-rgb:179,222,254;--ac-global-color-blue-1200:rgb(var(--ac-global-color-blue-1200-rgb));--ac-global-color-blue-1300-rgb:227,234,255;--ac-global-color-blue-1300:rgb(var(--ac-global-color-blue-1300-rgb));--ac-global-color-blue-1400-rgb:243,243,255;--ac-global-color-blue-1400:rgb(var(--ac-global-color-blue-1400-rgb));--ac-global-color-indigo-100-rgb:26,29,97;--ac-global-color-indigo-100:rgb(var(--ac-global-color-indigo-100-rgb));--ac-global-color-indigo-200-rgb:35,39,125;--ac-global-color-indigo-200:rgb(var(--ac-global-color-indigo-200-rgb));--ac-global-color-indigo-300-rgb:46,50,157;--ac-global-color-indigo-300:rgb(var(--ac-global-color-indigo-300-rgb));--ac-global-color-indigo-400-rgb:58,63,189;--ac-global-color-indigo-400:rgb(var(--ac-global-color-indigo-400-rgb));--ac-global-color-indigo-500-rgb:73,78,216;--ac-global-color-indigo-500:rgb(var(--ac-global-color-indigo-500-rgb));--ac-global-color-indigo-600-rgb:90,96,235;--ac-global-color-indigo-600:rgb(var(--ac-global-color-indigo-600-rgb));--ac-global-color-indigo-700-rgb:110,115,246;--ac-global-color-indigo-700:rgb(var(--ac-global-color-indigo-700-rgb));--ac-global-color-indigo-800-rgb:132,136,253;--ac-global-color-indigo-800:rgb(var(--ac-global-color-indigo-800-rgb));--ac-global-color-indigo-900-rgb:153,159,255;--ac-global-color-indigo-900:rgb(var(--ac-global-color-indigo-900-rgb));--ac-global-color-indigo-1000-rgb:174,177,255;--ac-global-color-indigo-1000:rgb(var(--ac-global-color-indigo-1000-rgb));--ac-global-color-indigo-1100-rgb:194,196,255;--ac-global-color-indigo-1100:rgb(var(--ac-global-color-indigo-1100-rgb));--ac-global-color-indigo-1200-rgb:212,213,255;--ac-global-color-indigo-1200:rgb(var(--ac-global-color-indigo-1200-rgb));--ac-global-color-indigo-1300-rgb:227,228,255;--ac-global-color-indigo-1300:rgb(var(--ac-global-color-indigo-1300-rgb));--ac-global-color-indigo-1400-rgb:240,240,255;--ac-global-color-indigo-1400:rgb(var(--ac-global-color-indigo-1400-rgb));--ac-global-color-purple-100-rgb:50,16,104;--ac-global-color-purple-100:rgb(var(--ac-global-color-purple-100-rgb));--ac-global-color-purple-200-rgb:67,13,140;--ac-global-color-purple-200:rgb(var(--ac-global-color-purple-200-rgb));--ac-global-color-purple-300-rgb:86,16,173;--ac-global-color-purple-300:rgb(var(--ac-global-color-purple-300-rgb));--ac-global-color-purple-400-rgb:106,29,200;--ac-global-color-purple-400:rgb(var(--ac-global-color-purple-400-rgb));--ac-global-color-purple-500-rgb:126,49,222;--ac-global-color-purple-500:rgb(var(--ac-global-color-purple-500-rgb));--ac-global-color-purple-600-rgb:145,70,236;--ac-global-color-purple-600:rgb(var(--ac-global-color-purple-600-rgb));--ac-global-color-purple-700-rgb:162,94,246;--ac-global-color-purple-700:rgb(var(--ac-global-color-purple-700-rgb));--ac-global-color-purple-800-rgb:178,119,250;--ac-global-color-purple-800:rgb(var(--ac-global-color-purple-800-rgb));--ac-global-color-purple-900-rgb:192,143,252;--ac-global-color-purple-900:rgb(var(--ac-global-color-purple-900-rgb));--ac-global-color-purple-1000-rgb:206,166,253;--ac-global-color-purple-1000:rgb(var(--ac-global-color-purple-1000-rgb));--ac-global-color-purple-1100-rgb:219,188,254;--ac-global-color-purple-1100:rgb(var(--ac-global-color-purple-1100-rgb));--ac-global-color-purple-1200-rgb:230,207,254;--ac-global-color-purple-1200:rgb(var(--ac-global-color-purple-1200-rgb));--ac-global-color-purple-1300-rgb:240,224,255;--ac-global-color-purple-1300:rgb(var(--ac-global-color-purple-1300-rgb));--ac-global-color-purple-1400-rgb:248,237,255;--ac-global-color-purple-1400:rgb(var(--ac-global-color-purple-1400-rgb));--ac-global-color-fuchsia-100-rgb:70,14,68;--ac-global-color-fuchsia-100:rgb(var(--ac-global-color-fuchsia-100-rgb));--ac-global-color-fuchsia-200-rgb:93,9,92;--ac-global-color-fuchsia-200:rgb(var(--ac-global-color-fuchsia-200-rgb));--ac-global-color-fuchsia-300-rgb:120,0,120;--ac-global-color-fuchsia-300:rgb(var(--ac-global-color-fuchsia-300-rgb));--ac-global-color-fuchsia-400-rgb:145,0,78;--ac-global-color-fuchsia-400:rgb(var(--ac-global-color-fuchsia-400-rgb));--ac-global-color-fuchsia-500-rgb:169,19,170;--ac-global-color-fuchsia-500:rgb(var(--ac-global-color-fuchsia-500-rgb));--ac-global-color-fuchsia-600-rgb:209,43,114;--ac-global-color-fuchsia-600:rgb(var(--ac-global-color-fuchsia-600-rgb));--ac-global-color-fuchsia-700-rgb:227,69,137;--ac-global-color-fuchsia-700:rgb(var(--ac-global-color-fuchsia-700-rgb));--ac-global-color-fuchsia-800-rgb:241,97,156;--ac-global-color-fuchsia-800:rgb(var(--ac-global-color-fuchsia-800-rgb));--ac-global-color-fuchsia-900-rgb:252,124,173;--ac-global-color-fuchsia-900:rgb(var(--ac-global-color-fuchsia-900-rgb));--ac-global-color-fuchsia-1000-rgb:255,152,191;--ac-global-color-fuchsia-1000:rgb(\n      var(--ac-global-color-fuchsia-1000-rgb)\n    );--ac-global-color-fuchsia-1100-rgb:255,179,207;--ac-global-color-fuchsia-1100:rgb(\n      var(--ac-global-color-fuchsia-1100-rgb)\n    );--ac-global-color-fuchsia-1200-rgb:254,202,221;--ac-global-color-fuchsia-1200:rgb(\n      var(--ac-global-color-fuchsia-1200-rgb)\n    );--ac-global-color-fuchsia-1300-rgb:255,221,233;--ac-global-color-fuchsia-1300:rgb(\n      var(--ac-global-color-fuchsia-1300-rgb)\n    );--ac-global-color-fuchsia-1400-rgb:255,236,243;--ac-global-color-fuchsia-1400:rgb(\n      var(--ac-global-color-fuchsia-1400-rgb)\n    );--ac-global-color-magenta-100-rgb:83,3,41;--ac-global-color-magenta-100:rgb(var(--ac-global-color-magenta-100-rgb));--ac-global-color-magenta-200-rgb:106,0,52;--ac-global-color-magenta-200:rgb(var(--ac-global-color-magenta-200-rgb));--ac-global-color-magenta-300-rgb:133,0,65;--ac-global-color-magenta-300:rgb(var(--ac-global-color-magenta-300-rgb));--ac-global-color-magenta-400-rgb:161,0,78;--ac-global-color-magenta-400:rgb(var(--ac-global-color-magenta-400-rgb));--ac-global-color-magenta-500-rgb:186,22,93;--ac-global-color-magenta-500:rgb(var(--ac-global-color-magenta-500-rgb));--ac-global-color-magenta-600-rgb:209,43,114;--ac-global-color-magenta-600:rgb(var(--ac-global-color-magenta-600-rgb));--ac-global-color-magenta-700-rgb:227,69,137;--ac-global-color-magenta-700:rgb(var(--ac-global-color-magenta-700-rgb));--ac-global-color-magenta-800-rgb:241,97,156;--ac-global-color-magenta-800:rgb(var(--ac-global-color-magenta-800-rgb));--ac-global-color-magenta-900-rgb:252,124,173;--ac-global-color-magenta-900:rgb(var(--ac-global-color-magenta-900-rgb));--ac-global-color-magenta-1000-rgb:255,152,191;--ac-global-color-magenta-1000:rgb(\n      var(--ac-global-color-magenta-1000-rgb)\n    );--ac-global-color-magenta-1100-rgb:255,179,207;--ac-global-color-magenta-1100:rgb(\n      var(--ac-global-color-magenta-1100-rgb)\n    );--ac-global-color-magenta-1200-rgb:254,202,221;--ac-global-color-magenta-1200:rgb(\n      var(--ac-global-color-magenta-1200-rgb)\n    );--ac-global-color-magenta-1300-rgb:255,221,233;--ac-global-color-magenta-1300:rgb(\n      var(--ac-global-color-magenta-1300-rgb)\n    );--ac-global-color-magenta-1400-rgb:255,236,243;--ac-global-color-magenta-1400:rgb(\n      var(--ac-global-color-magenta-1400-rgb)\n    );--ac-global-color-info-rgb:114,217,255;--ac-global-color-info:rgb(var(--ac-global-color-info-rgb));--ac-global-color-info-900:rgba(var(--ac-global-color-info-rgb), 0.9);--ac-global-color-info-700:rgba(var(--ac-global-color-info-rgb), 0.7);--ac-global-color-info-500:rgba(var(--ac-global-color-info-rgb), 0.5);--ac-global-color-danger-rgb:248,81,73;--ac-global-color-danger:rgb(var(--ac-global-color-danger-rgb));--ac-global-color-danger-900:rgba(var(--ac-global-color-danger-rgb), 0.9);--ac-global-color-danger-700:rgba(var(--ac-global-color-danger-rgb), 0.7);--ac-global-color-danger-500:rgba(var(--ac-global-color-danger-rgb), 0.5);--ac-global-color-success-rgb:126,231,135;--ac-global-color-success:rgb(var(--ac-global-color-success-rgb));--ac-global-color-success-900:rgba(\n      var(--ac-global-color-success-rgb),\n      0.9\n    );--ac-global-color-success-700:rgba(\n      var(--ac-global-color-success-rgb),\n      0.7\n    );--ac-global-color-success-500:rgba(\n      var(--ac-global-color-success-rgb),\n      0.5\n    );--ac-global-color-warning-rgb:230,153,88;--ac-global-color-warning:rgb(var(--ac-global-color-warning-rgb));--ac-global-color-warning-900:rgba(\n      var(--ac-global-color-warning-rgb),\n      0.9\n    );--ac-global-color-warning-700:rgba(\n      var(--ac-global-color-warning-rgb),\n      0.7\n    );--ac-global-color-warning-500:rgba(\n      var(--ac-global-color-warning-rgb),\n      0.5\n    );--ac-global-color-designation-purple:#bb9ff9;--ac-global-color-designation-turquoise:#9efcfd;--ac-global-text-color-900:rgba(255, 255, 255, 0.9);--ac-global-text-color-700:rgba(255, 255, 255, 0.7);--ac-global-text-color-500:rgba(255, 255, 255, 0.5);--ac-global-text-color-300:rgba(255, 255, 255, 0.3);}"
} : {
  name: "o903yc-darkThemeCSS",
  styles: ":root,.ac-theme--dark{--ac-global-color-primary:rgb(114, 217, 255);--ac-global-color-primary-900:rgba(114, 217, 255, 0.9);--ac-global-color-primary-700:rgba(114, 217, 255, 0.7);--ac-global-color-primary-500:rgba(114, 217, 255, 0.5);--ac-global-color-primary-300:rgba(114, 217, 255, 0.3);--ac-global-color-gray-900:#181b1f;--ac-global-color-gray-800:#1d2126;--ac-global-color-gray-700:#23282e;--ac-global-color-gray-600:#282e35;--ac-global-color-gray-500:#2f353d;--ac-global-color-gray-400:#3d434a;--ac-global-color-gray-300:#4a5057;--ac-global-color-gray-200:#585d64;--ac-global-color-gray-100:#666b71;--ac-global-color-grey-50-rgb:0,0,0;--ac-global-color-grey-50:rgb(var(--ac-global-color-grey-50-rgb));--ac-global-color-grey-75-rgb:14,14,14;--ac-global-color-grey-75:rgb(var(--ac-global-color-grey-75-rgb));--ac-global-color-grey-100-rgb:29,29,29;--ac-global-color-grey-100:rgb(var(--ac-global-color-grey-100-rgb));--ac-global-color-grey-200-rgb:48,48,48;--ac-global-color-grey-200:rgb(var(--ac-global-color-grey-200-rgb));--ac-global-color-grey-300-rgb:75,75,75;--ac-global-color-grey-300:rgb(var(--ac-global-color-grey-300-rgb));--ac-global-color-grey-400-rgb:106,106,106;--ac-global-color-grey-400:rgb(var(--ac-global-color-grey-400-rgb));--ac-global-color-grey-500-rgb:141,141,141;--ac-global-color-grey-500:rgb(var(--ac-global-color-grey-500-rgb));--ac-global-color-grey-600-rgb:176,176,176;--ac-global-color-grey-600:rgb(var(--ac-global-color-grey-600-rgb));--ac-global-color-grey-700-rgb:208,208,208;--ac-global-color-grey-700:rgb(var(--ac-global-color-grey-700-rgb));--ac-global-color-grey-800-rgb:235,235,235;--ac-global-color-grey-800:rgb(var(--ac-global-color-grey-800-rgb));--ac-global-color-grey-900-rgb:255,255,255;--ac-global-color-grey-900:rgb(var(--ac-global-color-grey-900-rgb));--ac-global-color-red-100-rgb:87,0,0;--ac-global-color-red-100:rgb(var(--ac-global-color-red-100-rgb));--ac-global-color-red-200-rgb:110,0,0;--ac-global-color-red-200:rgb(var(--ac-global-color-red-200-rgb));--ac-global-color-red-300-rgb:138,0,0;--ac-global-color-red-300:rgb(var(--ac-global-color-red-300-rgb));--ac-global-color-red-400-rgb:167,0,0;--ac-global-color-red-400:rgb(var(--ac-global-color-red-400-rgb));--ac-global-color-red-500-rgb:196,7,6;--ac-global-color-red-500:rgb(var(--ac-global-color-red-500-rgb));--ac-global-color-red-600-rgb:221,33,24;--ac-global-color-red-600:rgb(var(--ac-global-color-red-600-rgb));--ac-global-color-red-700-rgb:238,67,49;--ac-global-color-red-700:rgb(var(--ac-global-color-red-700-rgb));--ac-global-color-red-800-rgb:249,99,76;--ac-global-color-red-800:rgb(var(--ac-global-color-red-800-rgb));--ac-global-color-red-900-rgb:255,129,107;--ac-global-color-red-900:rgb(var(--ac-global-color-red-900-rgb));--ac-global-color-red-1000-rgb:255,158,140;--ac-global-color-red-1000:rgb(var(--ac-global-color-red-1000-rgb));--ac-global-color-red-1100-rgb:255,183,169;--ac-global-color-red-1100:rgb(var(--ac-global-color-red-1100-rgb));--ac-global-color-red-1200-rgb:255,205,195;--ac-global-color-red-1200:rgb(var(--ac-global-color-red-1200-rgb));--ac-global-color-red-1300-rgb:255,223,217;--ac-global-color-red-1300:rgb(var(--ac-global-color-red-1300-rgb));--ac-global-color-red-1400-rgb:255,237,234;--ac-global-color-red-1400:rgb(var(--ac-global-color-red-1400-rgb));--ac-global-color-orange-100-rgb:72,24,1;--ac-global-color-orange-100:rgb(var(--ac-global-color-orange-100-rgb));--ac-global-color-orange-200-rgb:92,32,0;--ac-global-color-orange-200:rgb(var(--ac-global-color-orange-200-rgb));--ac-global-color-orange-300-rgb:115,43,0;--ac-global-color-orange-300:rgb(var(--ac-global-color-orange-300-rgb));--ac-global-color-orange-400-rgb:138,55,0;--ac-global-color-orange-400:rgb(var(--ac-global-color-orange-400-rgb));--ac-global-color-orange-500-rgb:162,68,0;--ac-global-color-orange-500:rgb(var(--ac-global-color-orange-500-rgb));--ac-global-color-orange-600-rgb:186,82,0;--ac-global-color-orange-600:rgb(var(--ac-global-color-orange-600-rgb));--ac-global-color-orange-700-rgb:210,98,0;--ac-global-color-orange-700:rgb(var(--ac-global-color-orange-700-rgb));--ac-global-color-orange-800-rgb:232,116,0;--ac-global-color-orange-800:rgb(var(--ac-global-color-orange-800-rgb));--ac-global-color-orange-900-rgb:249,137,23;--ac-global-color-orange-900:rgb(var(--ac-global-color-orange-900-rgb));--ac-global-color-orange-1000-rgb:255,162,59;--ac-global-color-orange-1000:rgb(var(--ac-global-color-orange-1000-rgb));--ac-global-color-orange-1100-rgb:255,188,102;--ac-global-color-orange-1100:rgb(var(--ac-global-color-orange-1100-rgb));--ac-global-color-orange-1200-rgb:253,210,145;--ac-global-color-orange-1200:rgb(var(--ac-global-color-orange-1200-rgb));--ac-global-color-orange-1300-rgb:255,226,181;--ac-global-color-orange-1300:rgb(var(--ac-global-color-orange-1300-rgb));--ac-global-color-orange-1400-rgb:255,239,213;--ac-global-color-orange-1400:rgb(var(--ac-global-color-orange-1400-rgb));--ac-global-color-yellow-100-rgb:53,36,0;--ac-global-color-yellow-100:rgb(var(--ac-global-color-yellow-100-rgb));--ac-global-color-yellow-200-rgb:68,47,0;--ac-global-color-yellow-200:rgb(var(--ac-global-color-yellow-200-rgb));--ac-global-color-yellow-300-rgb:86,62,0;--ac-global-color-yellow-300:rgb(var(--ac-global-color-yellow-300-rgb));--ac-global-color-yellow-400-rgb:103,77,0;--ac-global-color-yellow-400:rgb(var(--ac-global-color-yellow-400-rgb));--ac-global-color-yellow-500-rgb:122,92,0;--ac-global-color-yellow-500:rgb(var(--ac-global-color-yellow-500-rgb));--ac-global-color-yellow-600-rgb:141,108,0;--ac-global-color-yellow-600:rgb(var(--ac-global-color-yellow-600-rgb));--ac-global-color-yellow-700-rgb:161,126,0;--ac-global-color-yellow-700:rgb(var(--ac-global-color-yellow-700-rgb));--ac-global-color-yellow-800-rgb:180,144,0;--ac-global-color-yellow-800:rgb(var(--ac-global-color-yellow-800-rgb));--ac-global-color-yellow-900-rgb:199,162,0;--ac-global-color-yellow-900:rgb(var(--ac-global-color-yellow-900-rgb));--ac-global-color-yellow-1000-rgb:216,181,0;--ac-global-color-yellow-1000:rgb(var(--ac-global-color-yellow-1000-rgb));--ac-global-color-yellow-1100-rgb:233,199,0;--ac-global-color-yellow-1100:rgb(var(--ac-global-color-yellow-1100-rgb));--ac-global-color-yellow-1200-rgb:247,216,4;--ac-global-color-yellow-1200:rgb(var(--ac-global-color-yellow-1200-rgb));--ac-global-color-yellow-1300-rgb:249,233,97;--ac-global-color-yellow-1300:rgb(var(--ac-global-color-yellow-1300-rgb));--ac-global-color-yellow-1400-rgb:252,243,170;--ac-global-color-yellow-1400:rgb(var(--ac-global-color-yellow-1400-rgb));--ac-global-color-chartreuse-100-rgb:32,43,0;--ac-global-color-chartreuse-100:rgb(\n      var(--ac-global-color-chartreuse-100-rgb)\n    );--ac-global-color-chartreuse-200-rgb:42,56,0;--ac-global-color-chartreuse-200:rgb(\n      var(--ac-global-color-chartreuse-200-rgb)\n    );--ac-global-color-chartreuse-300-rgb:54,72,0;--ac-global-color-chartreuse-300:rgb(\n      var(--ac-global-color-chartreuse-300-rgb)\n    );--ac-global-color-chartreuse-400-rgb:66,88,0;--ac-global-color-chartreuse-400:rgb(\n      var(--ac-global-color-chartreuse-400-rgb)\n    );--ac-global-color-chartreuse-500-rgb:79,105,0;--ac-global-color-chartreuse-500:rgb(\n      var(--ac-global-color-chartreuse-500-rgb)\n    );--ac-global-color-chartreuse-600-rgb:93,123,0;--ac-global-color-chartreuse-600:rgb(\n      var(--ac-global-color-chartreuse-600-rgb)\n    );--ac-global-color-chartreuse-700-rgb:107,142,0;--ac-global-color-chartreuse-700:rgb(\n      var(--ac-global-color-chartreuse-700-rgb)\n    );--ac-global-color-chartreuse-800-rgb:122,161,0;--ac-global-color-chartreuse-800:rgb(\n      var(--ac-global-color-chartreuse-800-rgb)\n    );--ac-global-color-chartreuse-900-rgb:138,180,3;--ac-global-color-chartreuse-900:rgb(\n      var(--ac-global-color-chartreuse-900-rgb)\n    );--ac-global-color-chartreuse-1000-rgb:154,198,11;--ac-global-color-chartreuse-1000:rgb(\n      var(--ac-global-color-chartreuse-1000-rgb)\n    );--ac-global-color-chartreuse-1100-rgb:170,216,22;--ac-global-color-chartreuse-1100:rgb(\n      var(--ac-global-color-chartreuse-1100-rgb)\n    );--ac-global-color-chartreuse-1200-rgb:187,232,41;--ac-global-color-chartreuse-1200:rgb(\n      var(--ac-global-color-chartreuse-1200-rgb)\n    );--ac-global-color-chartreuse-1300-rgb:205,246,72;--ac-global-color-chartreuse-1300:rgb(\n      var(--ac-global-color-chartreuse-1300-rgb)\n    );--ac-global-color-chartreuse-1400-rgb:225,253,132;--ac-global-color-chartreuse-1400:rgb(\n      var(--ac-global-color-chartreuse-1400-rgb)\n    );--ac-global-color-celery-100-rgb:0,47,7;--ac-global-color-celery-100:rgb(var(--ac-global-color-celery-100-rgb));--ac-global-color-celery-200-rgb:0,61,9;--ac-global-color-celery-200:rgb(var(--ac-global-color-celery-200-rgb));--ac-global-color-celery-300-rgb:0,77,12;--ac-global-color-celery-300:rgb(var(--ac-global-color-celery-300-rgb));--ac-global-color-celery-400-rgb:0,95,15;--ac-global-color-celery-400:rgb(var(--ac-global-color-celery-400-rgb));--ac-global-color-celery-500-rgb:0,113,15;--ac-global-color-celery-500:rgb(var(--ac-global-color-celery-500-rgb));--ac-global-color-celery-600-rgb:0,132,15;--ac-global-color-celery-600:rgb(var(--ac-global-color-celery-600-rgb));--ac-global-color-celery-700-rgb:0,151,20;--ac-global-color-celery-700:rgb(var(--ac-global-color-celery-700-rgb));--ac-global-color-celery-800-rgb:13,171,37;--ac-global-color-celery-800:rgb(var(--ac-global-color-celery-800-rgb));--ac-global-color-celery-900-rgb:45,191,58;--ac-global-color-celery-900:rgb(var(--ac-global-color-celery-900-rgb));--ac-global-color-celery-1000-rgb:80,208,82;--ac-global-color-celery-1000:rgb(var(--ac-global-color-celery-1000-rgb));--ac-global-color-celery-1100-rgb:115,224,107;--ac-global-color-celery-1100:rgb(var(--ac-global-color-celery-1100-rgb));--ac-global-color-celery-1200-rgb:147,237,131;--ac-global-color-celery-1200:rgb(var(--ac-global-color-celery-1200-rgb));--ac-global-color-celery-1300-rgb:180,247,165;--ac-global-color-celery-1300:rgb(var(--ac-global-color-celery-1300-rgb));--ac-global-color-celery-1400-rgb:213,252,202;--ac-global-color-celery-1400:rgb(var(--ac-global-color-celery-1400-rgb));--ac-global-color-green-100-rgb:10,44,28;--ac-global-color-green-100:rgb(var(--ac-global-color-green-100-rgb));--ac-global-color-green-200-rgb:7,59,36;--ac-global-color-green-200:rgb(var(--ac-global-color-green-200-rgb));--ac-global-color-green-300-rgb:0,76,46;--ac-global-color-green-300:rgb(var(--ac-global-color-green-300-rgb));--ac-global-color-green-400-rgb:0,93,57;--ac-global-color-green-400:rgb(var(--ac-global-color-green-400-rgb));--ac-global-color-green-500-rgb:0,111,69;--ac-global-color-green-500:rgb(var(--ac-global-color-green-500-rgb));--ac-global-color-green-600-rgb:0,130,82;--ac-global-color-green-600:rgb(var(--ac-global-color-green-600-rgb));--ac-global-color-green-700-rgb:0,149,98;--ac-global-color-green-700:rgb(var(--ac-global-color-green-700-rgb));--ac-global-color-green-800-rgb:28,168,114;--ac-global-color-green-800:rgb(var(--ac-global-color-green-800-rgb));--ac-global-color-green-900-rgb:52,187,132;--ac-global-color-green-900:rgb(var(--ac-global-color-green-900-rgb));--ac-global-color-green-1000-rgb:75,205,149;--ac-global-color-green-1000:rgb(var(--ac-global-color-green-1000-rgb));--ac-global-color-green-1100-rgb:103,222,168;--ac-global-color-green-1100:rgb(var(--ac-global-color-green-1100-rgb));--ac-global-color-green-1200-rgb:137,236,188;--ac-global-color-green-1200:rgb(var(--ac-global-color-green-1200-rgb));--ac-global-color-green-1300-rgb:177,244,209;--ac-global-color-green-1300:rgb(var(--ac-global-color-green-1300-rgb));--ac-global-color-green-1400-rgb:214,249,228;--ac-global-color-green-1400:rgb(var(--ac-global-color-green-1400-rgb));--ac-global-color-seafoam-100-rgb:18,43,42;--ac-global-color-seafoam-100:rgb(var(--ac-global-color-seafoam-100-rgb));--ac-global-color-seafoam-200-rgb:19,57,55;--ac-global-color-seafoam-200:rgb(var(--ac-global-color-seafoam-200-rgb));--ac-global-color-seafoam-300-rgb:16,73,70;--ac-global-color-seafoam-300:rgb(var(--ac-global-color-seafoam-300-rgb));--ac-global-color-seafoam-400-rgb:3,91,88;--ac-global-color-seafoam-400:rgb(var(--ac-global-color-seafoam-400-rgb));--ac-global-color-seafoam-500-rgb:0,108,104;--ac-global-color-seafoam-500:rgb(var(--ac-global-color-seafoam-500-rgb));--ac-global-color-seafoam-600-rgb:0,127,121;--ac-global-color-seafoam-600:rgb(var(--ac-global-color-seafoam-600-rgb));--ac-global-color-seafoam-700-rgb:0,146,140;--ac-global-color-seafoam-700:rgb(var(--ac-global-color-seafoam-700-rgb));--ac-global-color-seafoam-800-rgb:0,165,159;--ac-global-color-seafoam-800:rgb(var(--ac-global-color-seafoam-800-rgb));--ac-global-color-seafoam-900-rgb:26,185,178;--ac-global-color-seafoam-900:rgb(var(--ac-global-color-seafoam-900-rgb));--ac-global-color-seafoam-1000-rgb:66,202,195;--ac-global-color-seafoam-1000:rgb(\n      var(--ac-global-color-seafoam-1000-rgb)\n    );--ac-global-color-seafoam-1100-rgb:102,218,211;--ac-global-color-seafoam-1100:rgb(\n      var(--ac-global-color-seafoam-1100-rgb)\n    );--ac-global-color-seafoam-1200-rgb:139,232,225;--ac-global-color-seafoam-1200:rgb(\n      var(--ac-global-color-seafoam-1200-rgb)\n    );--ac-global-color-seafoam-1300-rgb:179,242,237;--ac-global-color-seafoam-1300:rgb(\n      var(--ac-global-color-seafoam-1300-rgb)\n    );--ac-global-color-seafoam-1400-rgb:215,248,244;--ac-global-color-seafoam-1400:rgb(\n      var(--ac-global-color-seafoam-1400-rgb)\n    );--ac-global-color-cyan-100-rgb:0,41,68;--ac-global-color-cyan-100:rgb(var(--ac-global-color-cyan-100-rgb));--ac-global-color-cyan-200-rgb:0,54,88;--ac-global-color-cyan-200:rgb(var(--ac-global-color-cyan-200-rgb));--ac-global-color-cyan-300-rgb:0,69,108;--ac-global-color-cyan-300:rgb(var(--ac-global-color-cyan-300-rgb));--ac-global-color-cyan-400-rgb:0,86,128;--ac-global-color-cyan-400:rgb(var(--ac-global-color-cyan-400-rgb));--ac-global-color-cyan-500-rgb:0,103,147;--ac-global-color-cyan-500:rgb(var(--ac-global-color-cyan-500-rgb));--ac-global-color-cyan-600-rgb:0,121,167;--ac-global-color-cyan-600:rgb(var(--ac-global-color-cyan-600-rgb));--ac-global-color-cyan-700-rgb:0,140,186;--ac-global-color-cyan-700:rgb(var(--ac-global-color-cyan-700-rgb));--ac-global-color-cyan-800-rgb:4,160,205;--ac-global-color-cyan-800:rgb(var(--ac-global-color-cyan-800-rgb));--ac-global-color-cyan-900-rgb:23,180,221;--ac-global-color-cyan-900:rgb(var(--ac-global-color-cyan-900-rgb));--ac-global-color-cyan-1000-rgb:57,199,234;--ac-global-color-cyan-1000:rgb(var(--ac-global-color-cyan-1000-rgb));--ac-global-color-cyan-1100-rgb:96,216,243;--ac-global-color-cyan-1100:rgb(var(--ac-global-color-cyan-1100-rgb));--ac-global-color-cyan-1200-rgb:134,230,250;--ac-global-color-cyan-1200:rgb(var(--ac-global-color-cyan-1200-rgb));--ac-global-color-cyan-1300-rgb:170,242,255;--ac-global-color-cyan-1300:rgb(var(--ac-global-color-cyan-1300-rgb));--ac-global-color-cyan-1400-rgb:206,249,255;--ac-global-color-cyan-1400:rgb(var(--ac-global-color-cyan-1400-rgb));--ac-global-color-blue-100-rgb:0,38,81;--ac-global-color-blue-100:rgb(var(--ac-global-color-blue-100-rgb));--ac-global-color-blue-200-rgb:0,50,106;--ac-global-color-blue-200:rgb(var(--ac-global-color-blue-200-rgb));--ac-global-color-blue-300-rgb:0,64,135;--ac-global-color-blue-300:rgb(var(--ac-global-color-blue-300-rgb));--ac-global-color-blue-400-rgb:0,78,166;--ac-global-color-blue-400:rgb(var(--ac-global-color-blue-400-rgb));--ac-global-color-blue-500-rgb:0,92,200;--ac-global-color-blue-500:rgb(var(--ac-global-color-blue-500-rgb));--ac-global-color-blue-600-rgb:6,108,231;--ac-global-color-blue-600:rgb(var(--ac-global-color-blue-600-rgb));--ac-global-color-blue-700-rgb:29,128,245;--ac-global-color-blue-700:rgb(var(--ac-global-color-blue-700-rgb));--ac-global-color-blue-800-rgb:64,150,243;--ac-global-color-blue-800:rgb(var(--ac-global-color-blue-800-rgb));--ac-global-color-blue-900-rgb:94,170,247;--ac-global-color-blue-900:rgb(var(--ac-global-color-blue-900-rgb));--ac-global-color-blue-1000-rgb:124,189,250;--ac-global-color-blue-1000:rgb(var(--ac-global-color-blue-1000-rgb));--ac-global-color-blue-1100-rgb:152,206,253;--ac-global-color-blue-1100:rgb(var(--ac-global-color-blue-1100-rgb));--ac-global-color-blue-1200-rgb:179,222,254;--ac-global-color-blue-1200:rgb(var(--ac-global-color-blue-1200-rgb));--ac-global-color-blue-1300-rgb:227,234,255;--ac-global-color-blue-1300:rgb(var(--ac-global-color-blue-1300-rgb));--ac-global-color-blue-1400-rgb:243,243,255;--ac-global-color-blue-1400:rgb(var(--ac-global-color-blue-1400-rgb));--ac-global-color-indigo-100-rgb:26,29,97;--ac-global-color-indigo-100:rgb(var(--ac-global-color-indigo-100-rgb));--ac-global-color-indigo-200-rgb:35,39,125;--ac-global-color-indigo-200:rgb(var(--ac-global-color-indigo-200-rgb));--ac-global-color-indigo-300-rgb:46,50,157;--ac-global-color-indigo-300:rgb(var(--ac-global-color-indigo-300-rgb));--ac-global-color-indigo-400-rgb:58,63,189;--ac-global-color-indigo-400:rgb(var(--ac-global-color-indigo-400-rgb));--ac-global-color-indigo-500-rgb:73,78,216;--ac-global-color-indigo-500:rgb(var(--ac-global-color-indigo-500-rgb));--ac-global-color-indigo-600-rgb:90,96,235;--ac-global-color-indigo-600:rgb(var(--ac-global-color-indigo-600-rgb));--ac-global-color-indigo-700-rgb:110,115,246;--ac-global-color-indigo-700:rgb(var(--ac-global-color-indigo-700-rgb));--ac-global-color-indigo-800-rgb:132,136,253;--ac-global-color-indigo-800:rgb(var(--ac-global-color-indigo-800-rgb));--ac-global-color-indigo-900-rgb:153,159,255;--ac-global-color-indigo-900:rgb(var(--ac-global-color-indigo-900-rgb));--ac-global-color-indigo-1000-rgb:174,177,255;--ac-global-color-indigo-1000:rgb(var(--ac-global-color-indigo-1000-rgb));--ac-global-color-indigo-1100-rgb:194,196,255;--ac-global-color-indigo-1100:rgb(var(--ac-global-color-indigo-1100-rgb));--ac-global-color-indigo-1200-rgb:212,213,255;--ac-global-color-indigo-1200:rgb(var(--ac-global-color-indigo-1200-rgb));--ac-global-color-indigo-1300-rgb:227,228,255;--ac-global-color-indigo-1300:rgb(var(--ac-global-color-indigo-1300-rgb));--ac-global-color-indigo-1400-rgb:240,240,255;--ac-global-color-indigo-1400:rgb(var(--ac-global-color-indigo-1400-rgb));--ac-global-color-purple-100-rgb:50,16,104;--ac-global-color-purple-100:rgb(var(--ac-global-color-purple-100-rgb));--ac-global-color-purple-200-rgb:67,13,140;--ac-global-color-purple-200:rgb(var(--ac-global-color-purple-200-rgb));--ac-global-color-purple-300-rgb:86,16,173;--ac-global-color-purple-300:rgb(var(--ac-global-color-purple-300-rgb));--ac-global-color-purple-400-rgb:106,29,200;--ac-global-color-purple-400:rgb(var(--ac-global-color-purple-400-rgb));--ac-global-color-purple-500-rgb:126,49,222;--ac-global-color-purple-500:rgb(var(--ac-global-color-purple-500-rgb));--ac-global-color-purple-600-rgb:145,70,236;--ac-global-color-purple-600:rgb(var(--ac-global-color-purple-600-rgb));--ac-global-color-purple-700-rgb:162,94,246;--ac-global-color-purple-700:rgb(var(--ac-global-color-purple-700-rgb));--ac-global-color-purple-800-rgb:178,119,250;--ac-global-color-purple-800:rgb(var(--ac-global-color-purple-800-rgb));--ac-global-color-purple-900-rgb:192,143,252;--ac-global-color-purple-900:rgb(var(--ac-global-color-purple-900-rgb));--ac-global-color-purple-1000-rgb:206,166,253;--ac-global-color-purple-1000:rgb(var(--ac-global-color-purple-1000-rgb));--ac-global-color-purple-1100-rgb:219,188,254;--ac-global-color-purple-1100:rgb(var(--ac-global-color-purple-1100-rgb));--ac-global-color-purple-1200-rgb:230,207,254;--ac-global-color-purple-1200:rgb(var(--ac-global-color-purple-1200-rgb));--ac-global-color-purple-1300-rgb:240,224,255;--ac-global-color-purple-1300:rgb(var(--ac-global-color-purple-1300-rgb));--ac-global-color-purple-1400-rgb:248,237,255;--ac-global-color-purple-1400:rgb(var(--ac-global-color-purple-1400-rgb));--ac-global-color-fuchsia-100-rgb:70,14,68;--ac-global-color-fuchsia-100:rgb(var(--ac-global-color-fuchsia-100-rgb));--ac-global-color-fuchsia-200-rgb:93,9,92;--ac-global-color-fuchsia-200:rgb(var(--ac-global-color-fuchsia-200-rgb));--ac-global-color-fuchsia-300-rgb:120,0,120;--ac-global-color-fuchsia-300:rgb(var(--ac-global-color-fuchsia-300-rgb));--ac-global-color-fuchsia-400-rgb:145,0,78;--ac-global-color-fuchsia-400:rgb(var(--ac-global-color-fuchsia-400-rgb));--ac-global-color-fuchsia-500-rgb:169,19,170;--ac-global-color-fuchsia-500:rgb(var(--ac-global-color-fuchsia-500-rgb));--ac-global-color-fuchsia-600-rgb:209,43,114;--ac-global-color-fuchsia-600:rgb(var(--ac-global-color-fuchsia-600-rgb));--ac-global-color-fuchsia-700-rgb:227,69,137;--ac-global-color-fuchsia-700:rgb(var(--ac-global-color-fuchsia-700-rgb));--ac-global-color-fuchsia-800-rgb:241,97,156;--ac-global-color-fuchsia-800:rgb(var(--ac-global-color-fuchsia-800-rgb));--ac-global-color-fuchsia-900-rgb:252,124,173;--ac-global-color-fuchsia-900:rgb(var(--ac-global-color-fuchsia-900-rgb));--ac-global-color-fuchsia-1000-rgb:255,152,191;--ac-global-color-fuchsia-1000:rgb(\n      var(--ac-global-color-fuchsia-1000-rgb)\n    );--ac-global-color-fuchsia-1100-rgb:255,179,207;--ac-global-color-fuchsia-1100:rgb(\n      var(--ac-global-color-fuchsia-1100-rgb)\n    );--ac-global-color-fuchsia-1200-rgb:254,202,221;--ac-global-color-fuchsia-1200:rgb(\n      var(--ac-global-color-fuchsia-1200-rgb)\n    );--ac-global-color-fuchsia-1300-rgb:255,221,233;--ac-global-color-fuchsia-1300:rgb(\n      var(--ac-global-color-fuchsia-1300-rgb)\n    );--ac-global-color-fuchsia-1400-rgb:255,236,243;--ac-global-color-fuchsia-1400:rgb(\n      var(--ac-global-color-fuchsia-1400-rgb)\n    );--ac-global-color-magenta-100-rgb:83,3,41;--ac-global-color-magenta-100:rgb(var(--ac-global-color-magenta-100-rgb));--ac-global-color-magenta-200-rgb:106,0,52;--ac-global-color-magenta-200:rgb(var(--ac-global-color-magenta-200-rgb));--ac-global-color-magenta-300-rgb:133,0,65;--ac-global-color-magenta-300:rgb(var(--ac-global-color-magenta-300-rgb));--ac-global-color-magenta-400-rgb:161,0,78;--ac-global-color-magenta-400:rgb(var(--ac-global-color-magenta-400-rgb));--ac-global-color-magenta-500-rgb:186,22,93;--ac-global-color-magenta-500:rgb(var(--ac-global-color-magenta-500-rgb));--ac-global-color-magenta-600-rgb:209,43,114;--ac-global-color-magenta-600:rgb(var(--ac-global-color-magenta-600-rgb));--ac-global-color-magenta-700-rgb:227,69,137;--ac-global-color-magenta-700:rgb(var(--ac-global-color-magenta-700-rgb));--ac-global-color-magenta-800-rgb:241,97,156;--ac-global-color-magenta-800:rgb(var(--ac-global-color-magenta-800-rgb));--ac-global-color-magenta-900-rgb:252,124,173;--ac-global-color-magenta-900:rgb(var(--ac-global-color-magenta-900-rgb));--ac-global-color-magenta-1000-rgb:255,152,191;--ac-global-color-magenta-1000:rgb(\n      var(--ac-global-color-magenta-1000-rgb)\n    );--ac-global-color-magenta-1100-rgb:255,179,207;--ac-global-color-magenta-1100:rgb(\n      var(--ac-global-color-magenta-1100-rgb)\n    );--ac-global-color-magenta-1200-rgb:254,202,221;--ac-global-color-magenta-1200:rgb(\n      var(--ac-global-color-magenta-1200-rgb)\n    );--ac-global-color-magenta-1300-rgb:255,221,233;--ac-global-color-magenta-1300:rgb(\n      var(--ac-global-color-magenta-1300-rgb)\n    );--ac-global-color-magenta-1400-rgb:255,236,243;--ac-global-color-magenta-1400:rgb(\n      var(--ac-global-color-magenta-1400-rgb)\n    );--ac-global-color-info-rgb:114,217,255;--ac-global-color-info:rgb(var(--ac-global-color-info-rgb));--ac-global-color-info-900:rgba(var(--ac-global-color-info-rgb), 0.9);--ac-global-color-info-700:rgba(var(--ac-global-color-info-rgb), 0.7);--ac-global-color-info-500:rgba(var(--ac-global-color-info-rgb), 0.5);--ac-global-color-danger-rgb:248,81,73;--ac-global-color-danger:rgb(var(--ac-global-color-danger-rgb));--ac-global-color-danger-900:rgba(var(--ac-global-color-danger-rgb), 0.9);--ac-global-color-danger-700:rgba(var(--ac-global-color-danger-rgb), 0.7);--ac-global-color-danger-500:rgba(var(--ac-global-color-danger-rgb), 0.5);--ac-global-color-success-rgb:126,231,135;--ac-global-color-success:rgb(var(--ac-global-color-success-rgb));--ac-global-color-success-900:rgba(\n      var(--ac-global-color-success-rgb),\n      0.9\n    );--ac-global-color-success-700:rgba(\n      var(--ac-global-color-success-rgb),\n      0.7\n    );--ac-global-color-success-500:rgba(\n      var(--ac-global-color-success-rgb),\n      0.5\n    );--ac-global-color-warning-rgb:230,153,88;--ac-global-color-warning:rgb(var(--ac-global-color-warning-rgb));--ac-global-color-warning-900:rgba(\n      var(--ac-global-color-warning-rgb),\n      0.9\n    );--ac-global-color-warning-700:rgba(\n      var(--ac-global-color-warning-rgb),\n      0.7\n    );--ac-global-color-warning-500:rgba(\n      var(--ac-global-color-warning-rgb),\n      0.5\n    );--ac-global-color-designation-purple:#bb9ff9;--ac-global-color-designation-turquoise:#9efcfd;--ac-global-text-color-900:rgba(255, 255, 255, 0.9);--ac-global-text-color-700:rgba(255, 255, 255, 0.7);--ac-global-text-color-500:rgba(255, 255, 255, 0.5);--ac-global-text-color-300:rgba(255, 255, 255, 0.3);};label:darkThemeCSS;",
  map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */",
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__
};
var lightThemeCSS = false ? {
  name: "1w24xpc",
  styles: ":root,.ac-theme--light{--ac-global-color-primary:rgb(2, 173, 221);--ac-global-color-primary-900:rgb(2, 173, 221, 0.9);--ac-global-color-primary-700:rgb(2, 173, 221, 0.7);--ac-global-color-grey-50-rgb:255,255,255;--ac-global-color-grey-50:rgb(var(--ac-global-color-grey-50-rgb));--ac-global-color-grey-75-rgb:253,253,253;--ac-global-color-grey-75:rgb(var(--ac-global-color-grey-75-rgb));--ac-global-color-grey-100-rgb:248,248,248;--ac-global-color-grey-100:rgb(var(--ac-global-color-grey-100-rgb));--ac-global-color-grey-200-rgb:230,230,230;--ac-global-color-grey-200:rgb(var(--ac-global-color-grey-200-rgb));--ac-global-color-grey-300-rgb:213,213,213;--ac-global-color-grey-300:rgb(var(--ac-global-color-grey-300-rgb));--ac-global-color-grey-400-rgb:177,177,177;--ac-global-color-grey-400:rgb(var(--ac-global-color-grey-400-rgb));--ac-global-color-grey-500-rgb:144,144,144;--ac-global-color-grey-500:rgb(var(--ac-global-color-grey-500-rgb));--ac-global-color-grey-600-rgb:104,104,104;--ac-global-color-grey-600:rgb(var(--ac-global-color-grey-600-rgb));--ac-global-color-grey-700-rgb:70,70,70;--ac-global-color-grey-700:rgb(var(--ac-global-color-grey-700-rgb));--ac-global-color-grey-800-rgb:34,34,34;--ac-global-color-grey-800:rgb(var(--ac-global-color-grey-800-rgb));--ac-global-color-grey-900-rgb:0,0,0;--ac-global-color-grey-900:rgb(var(--ac-global-color-grey-900-rgb));--ac-global-color-red-100:#ffebe7;--ac-global-color-red-200:#ffddd6;--ac-global-color-red-300:#ffcdc3;--ac-global-color-red-400:#ffb7a9;--ac-global-color-red-500:#ff9b88;--ac-global-color-red-600:#ff7c65;--ac-global-color-red-700:#f75c46;--ac-global-color-red-800:#ea3829;--ac-global-color-red-900:#d31510;--ac-global-color-red-1000:#b40000;--ac-global-color-red-1100:#930000;--ac-global-color-red-1200:#740000;--ac-global-color-red-1300:#590000;--ac-global-color-red-1400:#430000;--ac-global-color-orange-100:#ffeccc;--ac-global-color-orange-200:#ffdfad;--ac-global-color-orange-300:#fdd291;--ac-global-color-orange-400:#ffbb63;--ac-global-color-orange-500:#ffa037;--ac-global-color-orange-600:#f68511;--ac-global-color-orange-700:#e46f00;--ac-global-color-orange-800:#cb5d00;--ac-global-color-orange-900:#b14c00;--ac-global-color-orange-1000:#953d00;--ac-global-color-orange-1100:#7a2f00;--ac-global-color-orange-1200:#612300;--ac-global-color-orange-1300:#491901;--ac-global-color-orange-1400:#351201;--ac-global-color-yellow-100:#fbf198;--ac-global-color-yellow-200:#f8e750;--ac-global-color-yellow-300:#f8d904;--ac-global-color-yellow-400:#e8c600;--ac-global-color-yellow-500:#d7b300;--ac-global-color-yellow-600:#c49f00;--ac-global-color-yellow-700:#b08c00;--ac-global-color-yellow-800:#9b7800;--ac-global-color-yellow-900:#856600;--ac-global-color-yellow-1000:#705300;--ac-global-color-yellow-1100:#5b4300;--ac-global-color-yellow-1200:#483300;--ac-global-color-yellow-1300:#362500;--ac-global-color-yellow-1400:#281a00;--ac-global-color-chartreuse-100:#dbfc6e;--ac-global-color-chartreuse-200:#cbf443;--ac-global-color-chartreuse-300:#bce92a;--ac-global-color-chartreuse-400:#aad816;--ac-global-color-chartreuse-500:#98c50a;--ac-global-color-chartreuse-600:#87b103;--ac-global-color-chartreuse-700:#769c00;--ac-global-color-chartreuse-800:#678800;--ac-global-color-chartreuse-900:#577400;--ac-global-color-chartreuse-1000:#486000;--ac-global-color-chartreuse-1100:#3a4d00;--ac-global-color-chartreuse-1200:#2c3b00;--ac-global-color-chartreuse-1300:#212c00;--ac-global-color-chartreuse-1400:#181f00;--ac-global-color-celery-100:#cdfcbf;--ac-global-color-celery-200:#aef69d;--ac-global-color-celery-300:#96ee85;--ac-global-color-celery-400:#72e06a;--ac-global-color-celery-500:#4ecf50;--ac-global-color-celery-600:#27bb36;--ac-global-color-celery-700:#07a721;--ac-global-color-celery-800:#009112;--ac-global-color-celery-900:#007c0f;--ac-global-color-celery-1000:#00670f;--ac-global-color-celery-1100:#00530d;--ac-global-color-celery-1200:#00400a;--ac-global-color-celery-1300:#003007;--ac-global-color-celery-1400:#002205;--ac-global-color-green-100:#cef8e0;--ac-global-color-green-200:#adf4ce;--ac-global-color-green-300:#89ecbc;--ac-global-color-green-400:#67dea8;--ac-global-color-green-500:#49cc93;--ac-global-color-green-600:#2fb880;--ac-global-color-green-700:#15a46e;--ac-global-color-green-800:#008f5d;--ac-global-color-green-900:#007a4d;--ac-global-color-green-1000:#00653e;--ac-global-color-green-1100:#005132;--ac-global-color-green-1200:#053f27;--ac-global-color-green-1300:#0a2e1d;--ac-global-color-green-1400:#0a2015;--ac-global-color-seafoam-100:#cef7f3;--ac-global-color-seafoam-200:#aaf1ea;--ac-global-color-seafoam-300:#8ce9e2;--ac-global-color-seafoam-400:#65dad2;--ac-global-color-seafoam-500:#3fc9c1;--ac-global-color-seafoam-600:#0fb5ae;--ac-global-color-seafoam-700:#00a19a;--ac-global-color-seafoam-800:#008c87;--ac-global-color-seafoam-900:#007772;--ac-global-color-seafoam-1000:#00635f;--ac-global-color-seafoam-1100:#0c4f4c;--ac-global-color-seafoam-1200:#123c3a;--ac-global-color-seafoam-1300:#122c2b;--ac-global-color-seafoam-1400:#0f1f1e;--ac-global-color-cyan-100:#c5f8ff;--ac-global-color-cyan-200:#a4f0ff;--ac-global-color-cyan-300:#88e7fa;--ac-global-color-cyan-400:#60d8f3;--ac-global-color-cyan-500:#33c5e8;--ac-global-color-cyan-600:#12b0da;--ac-global-color-cyan-700:#019cc8;--ac-global-color-cyan-800:#0086b4;--ac-global-color-cyan-900:#00719f;--ac-global-color-cyan-1000:#005d89;--ac-global-color-cyan-1100:#004a73;--ac-global-color-cyan-1200:#00395d;--ac-global-color-cyan-1300:#002a46;--ac-global-color-cyan-1400:#001e33;--ac-global-color-blue-100:#e0f2ff;--ac-global-color-blue-200:#cae8ff;--ac-global-color-blue-300:#b5deff;--ac-global-color-blue-400:#96cefd;--ac-global-color-blue-500:#78bbfa;--ac-global-color-blue-600:#59a7f6;--ac-global-color-blue-700:#3892f3;--ac-global-color-blue-800:#147af3;--ac-global-color-blue-900:#0265dc;--ac-global-color-blue-1000:#0054b6;--ac-global-color-blue-1100:#004491;--ac-global-color-blue-1200:#003571;--ac-global-color-blue-1300:#002754;--ac-global-color-blue-1400:#001c3c;--ac-global-color-indigo-100:#edeeff;--ac-global-color-indigo-200:#e0e2ff;--ac-global-color-indigo-300:#d3d5ff;--ac-global-color-indigo-400:#c1c4ff;--ac-global-color-indigo-500:#acafff;--ac-global-color-indigo-600:#9599ff;--ac-global-color-indigo-700:#7e84fc;--ac-global-color-indigo-800:#686df4;--ac-global-color-indigo-900:#5258e4;--ac-global-color-indigo-1000:#4046ca;--ac-global-color-indigo-1100:#3236a8;--ac-global-color-indigo-1200:#262986;--ac-global-color-indigo-1300:#1b1e64;--ac-global-color-indigo-1400:#141648;--ac-global-color-purple-100:#f6ebff;--ac-global-color-purple-200:#edf;--ac-global-color-purple-300:#e6d0ff;--ac-global-color-purple-400:#dbbbfe;--ac-global-color-purple-500:#cca4fd;--ac-global-color-purple-600:#bd8bfc;--ac-global-color-purple-700:#ae72f9;--ac-global-color-purple-800:#9d57f4;--ac-global-color-purple-900:#893de7;--ac-global-color-purple-1000:#7326d3;--ac-global-color-purple-1100:#5d13b7;--ac-global-color-purple-1200:#470c94;--ac-global-color-purple-1300:#33106a;--ac-global-color-purple-1400:#230f49;--ac-global-color-fuchsia-100:#ffe9fc;--ac-global-color-fuchsia-200:#ffdafa;--ac-global-color-fuchsia-300:#fec7f8;--ac-global-color-fuchsia-400:#fbaef6;--ac-global-color-fuchsia-500:#f592f3;--ac-global-color-fuchsia-600:#ed74ed;--ac-global-color-fuchsia-700:#e055e2;--ac-global-color-fuchsia-800:#cd3ace;--ac-global-color-fuchsia-900:#b622b7;--ac-global-color-fuchsia-1000:#9d039e;--ac-global-color-fuchsia-1100:#800081;--ac-global-color-fuchsia-1200:#640664;--ac-global-color-fuchsia-1300:#470e46;--ac-global-color-fuchsia-1400:#320d31;--ac-global-color-magenta-100:#ffeaf1;--ac-global-color-magenta-200:#ffdce8;--ac-global-color-magenta-300:#ffcadd;--ac-global-color-magenta-400:#ffb2ce;--ac-global-color-magenta-500:#ff95bd;--ac-global-color-magenta-600:#fa77aa;--ac-global-color-magenta-700:#ef5a98;--ac-global-color-magenta-800:#de3d82;--ac-global-color-magenta-900:#c82269;--ac-global-color-magenta-1000:#ad0955;--ac-global-color-magenta-1100:#8e0045;--ac-global-color-magenta-1200:#700037;--ac-global-color-magenta-1300:#54032a;--ac-global-color-magenta-1400:#3c061d;--ac-global-color-info:rgb(2, 173, 221);--ac-global-color-info-900:rgba(2, 173, 221, 0.9);--ac-global-color-info-700:rgba(2, 173, 221, 0.7);--ac-global-color-info-500:rgba(2, 173, 221, 0.5);--ac-global-color-danger:rgb(218, 11, 0);--ac-global-color-danger-900:rgba(218, 11, 0, 0.9);--ac-global-color-danger-700:rgba(218, 11, 0, 0.7);--ac-global-color-danger-500:rgba(218, 11, 0, 0.5);--ac-global-color-success:rgb(17, 191, 69);--ac-global-color-success-900:rgba(17, 191, 69, 0.9);--ac-global-color-success-700:rgba(17, 191, 69, 0.7);--ac-global-color-success-500:rgba(17, 191, 69, 0.5);--ac-global-color-warning:rgb(224, 102, 2);--ac-global-color-warning-900:rgba(224, 102, 2, 0.9);--ac-global-color-warning-700:rgba(224, 102, 2, 0.7);--ac-global-color-warning-500:rgba(224, 102, 2, 0.5);--ac-global-color-designation-purple:#4500d9;--ac-global-color-designation-turquoise:#00add0;--ac-global-text-color-900:rgba(0, 0, 0, 0.9);--ac-global-text-color-700:rgba(0, 0, 0, 0.7);--ac-global-text-color-500:rgba(0, 0, 0, 0.5);--ac-global-text-color-300:rgba(0, 0, 0, 0.3);}"
} : {
  name: "1ugnz8q-lightThemeCSS",
  styles: ":root,.ac-theme--light{--ac-global-color-primary:rgb(2, 173, 221);--ac-global-color-primary-900:rgb(2, 173, 221, 0.9);--ac-global-color-primary-700:rgb(2, 173, 221, 0.7);--ac-global-color-grey-50-rgb:255,255,255;--ac-global-color-grey-50:rgb(var(--ac-global-color-grey-50-rgb));--ac-global-color-grey-75-rgb:253,253,253;--ac-global-color-grey-75:rgb(var(--ac-global-color-grey-75-rgb));--ac-global-color-grey-100-rgb:248,248,248;--ac-global-color-grey-100:rgb(var(--ac-global-color-grey-100-rgb));--ac-global-color-grey-200-rgb:230,230,230;--ac-global-color-grey-200:rgb(var(--ac-global-color-grey-200-rgb));--ac-global-color-grey-300-rgb:213,213,213;--ac-global-color-grey-300:rgb(var(--ac-global-color-grey-300-rgb));--ac-global-color-grey-400-rgb:177,177,177;--ac-global-color-grey-400:rgb(var(--ac-global-color-grey-400-rgb));--ac-global-color-grey-500-rgb:144,144,144;--ac-global-color-grey-500:rgb(var(--ac-global-color-grey-500-rgb));--ac-global-color-grey-600-rgb:104,104,104;--ac-global-color-grey-600:rgb(var(--ac-global-color-grey-600-rgb));--ac-global-color-grey-700-rgb:70,70,70;--ac-global-color-grey-700:rgb(var(--ac-global-color-grey-700-rgb));--ac-global-color-grey-800-rgb:34,34,34;--ac-global-color-grey-800:rgb(var(--ac-global-color-grey-800-rgb));--ac-global-color-grey-900-rgb:0,0,0;--ac-global-color-grey-900:rgb(var(--ac-global-color-grey-900-rgb));--ac-global-color-red-100:#ffebe7;--ac-global-color-red-200:#ffddd6;--ac-global-color-red-300:#ffcdc3;--ac-global-color-red-400:#ffb7a9;--ac-global-color-red-500:#ff9b88;--ac-global-color-red-600:#ff7c65;--ac-global-color-red-700:#f75c46;--ac-global-color-red-800:#ea3829;--ac-global-color-red-900:#d31510;--ac-global-color-red-1000:#b40000;--ac-global-color-red-1100:#930000;--ac-global-color-red-1200:#740000;--ac-global-color-red-1300:#590000;--ac-global-color-red-1400:#430000;--ac-global-color-orange-100:#ffeccc;--ac-global-color-orange-200:#ffdfad;--ac-global-color-orange-300:#fdd291;--ac-global-color-orange-400:#ffbb63;--ac-global-color-orange-500:#ffa037;--ac-global-color-orange-600:#f68511;--ac-global-color-orange-700:#e46f00;--ac-global-color-orange-800:#cb5d00;--ac-global-color-orange-900:#b14c00;--ac-global-color-orange-1000:#953d00;--ac-global-color-orange-1100:#7a2f00;--ac-global-color-orange-1200:#612300;--ac-global-color-orange-1300:#491901;--ac-global-color-orange-1400:#351201;--ac-global-color-yellow-100:#fbf198;--ac-global-color-yellow-200:#f8e750;--ac-global-color-yellow-300:#f8d904;--ac-global-color-yellow-400:#e8c600;--ac-global-color-yellow-500:#d7b300;--ac-global-color-yellow-600:#c49f00;--ac-global-color-yellow-700:#b08c00;--ac-global-color-yellow-800:#9b7800;--ac-global-color-yellow-900:#856600;--ac-global-color-yellow-1000:#705300;--ac-global-color-yellow-1100:#5b4300;--ac-global-color-yellow-1200:#483300;--ac-global-color-yellow-1300:#362500;--ac-global-color-yellow-1400:#281a00;--ac-global-color-chartreuse-100:#dbfc6e;--ac-global-color-chartreuse-200:#cbf443;--ac-global-color-chartreuse-300:#bce92a;--ac-global-color-chartreuse-400:#aad816;--ac-global-color-chartreuse-500:#98c50a;--ac-global-color-chartreuse-600:#87b103;--ac-global-color-chartreuse-700:#769c00;--ac-global-color-chartreuse-800:#678800;--ac-global-color-chartreuse-900:#577400;--ac-global-color-chartreuse-1000:#486000;--ac-global-color-chartreuse-1100:#3a4d00;--ac-global-color-chartreuse-1200:#2c3b00;--ac-global-color-chartreuse-1300:#212c00;--ac-global-color-chartreuse-1400:#181f00;--ac-global-color-celery-100:#cdfcbf;--ac-global-color-celery-200:#aef69d;--ac-global-color-celery-300:#96ee85;--ac-global-color-celery-400:#72e06a;--ac-global-color-celery-500:#4ecf50;--ac-global-color-celery-600:#27bb36;--ac-global-color-celery-700:#07a721;--ac-global-color-celery-800:#009112;--ac-global-color-celery-900:#007c0f;--ac-global-color-celery-1000:#00670f;--ac-global-color-celery-1100:#00530d;--ac-global-color-celery-1200:#00400a;--ac-global-color-celery-1300:#003007;--ac-global-color-celery-1400:#002205;--ac-global-color-green-100:#cef8e0;--ac-global-color-green-200:#adf4ce;--ac-global-color-green-300:#89ecbc;--ac-global-color-green-400:#67dea8;--ac-global-color-green-500:#49cc93;--ac-global-color-green-600:#2fb880;--ac-global-color-green-700:#15a46e;--ac-global-color-green-800:#008f5d;--ac-global-color-green-900:#007a4d;--ac-global-color-green-1000:#00653e;--ac-global-color-green-1100:#005132;--ac-global-color-green-1200:#053f27;--ac-global-color-green-1300:#0a2e1d;--ac-global-color-green-1400:#0a2015;--ac-global-color-seafoam-100:#cef7f3;--ac-global-color-seafoam-200:#aaf1ea;--ac-global-color-seafoam-300:#8ce9e2;--ac-global-color-seafoam-400:#65dad2;--ac-global-color-seafoam-500:#3fc9c1;--ac-global-color-seafoam-600:#0fb5ae;--ac-global-color-seafoam-700:#00a19a;--ac-global-color-seafoam-800:#008c87;--ac-global-color-seafoam-900:#007772;--ac-global-color-seafoam-1000:#00635f;--ac-global-color-seafoam-1100:#0c4f4c;--ac-global-color-seafoam-1200:#123c3a;--ac-global-color-seafoam-1300:#122c2b;--ac-global-color-seafoam-1400:#0f1f1e;--ac-global-color-cyan-100:#c5f8ff;--ac-global-color-cyan-200:#a4f0ff;--ac-global-color-cyan-300:#88e7fa;--ac-global-color-cyan-400:#60d8f3;--ac-global-color-cyan-500:#33c5e8;--ac-global-color-cyan-600:#12b0da;--ac-global-color-cyan-700:#019cc8;--ac-global-color-cyan-800:#0086b4;--ac-global-color-cyan-900:#00719f;--ac-global-color-cyan-1000:#005d89;--ac-global-color-cyan-1100:#004a73;--ac-global-color-cyan-1200:#00395d;--ac-global-color-cyan-1300:#002a46;--ac-global-color-cyan-1400:#001e33;--ac-global-color-blue-100:#e0f2ff;--ac-global-color-blue-200:#cae8ff;--ac-global-color-blue-300:#b5deff;--ac-global-color-blue-400:#96cefd;--ac-global-color-blue-500:#78bbfa;--ac-global-color-blue-600:#59a7f6;--ac-global-color-blue-700:#3892f3;--ac-global-color-blue-800:#147af3;--ac-global-color-blue-900:#0265dc;--ac-global-color-blue-1000:#0054b6;--ac-global-color-blue-1100:#004491;--ac-global-color-blue-1200:#003571;--ac-global-color-blue-1300:#002754;--ac-global-color-blue-1400:#001c3c;--ac-global-color-indigo-100:#edeeff;--ac-global-color-indigo-200:#e0e2ff;--ac-global-color-indigo-300:#d3d5ff;--ac-global-color-indigo-400:#c1c4ff;--ac-global-color-indigo-500:#acafff;--ac-global-color-indigo-600:#9599ff;--ac-global-color-indigo-700:#7e84fc;--ac-global-color-indigo-800:#686df4;--ac-global-color-indigo-900:#5258e4;--ac-global-color-indigo-1000:#4046ca;--ac-global-color-indigo-1100:#3236a8;--ac-global-color-indigo-1200:#262986;--ac-global-color-indigo-1300:#1b1e64;--ac-global-color-indigo-1400:#141648;--ac-global-color-purple-100:#f6ebff;--ac-global-color-purple-200:#edf;--ac-global-color-purple-300:#e6d0ff;--ac-global-color-purple-400:#dbbbfe;--ac-global-color-purple-500:#cca4fd;--ac-global-color-purple-600:#bd8bfc;--ac-global-color-purple-700:#ae72f9;--ac-global-color-purple-800:#9d57f4;--ac-global-color-purple-900:#893de7;--ac-global-color-purple-1000:#7326d3;--ac-global-color-purple-1100:#5d13b7;--ac-global-color-purple-1200:#470c94;--ac-global-color-purple-1300:#33106a;--ac-global-color-purple-1400:#230f49;--ac-global-color-fuchsia-100:#ffe9fc;--ac-global-color-fuchsia-200:#ffdafa;--ac-global-color-fuchsia-300:#fec7f8;--ac-global-color-fuchsia-400:#fbaef6;--ac-global-color-fuchsia-500:#f592f3;--ac-global-color-fuchsia-600:#ed74ed;--ac-global-color-fuchsia-700:#e055e2;--ac-global-color-fuchsia-800:#cd3ace;--ac-global-color-fuchsia-900:#b622b7;--ac-global-color-fuchsia-1000:#9d039e;--ac-global-color-fuchsia-1100:#800081;--ac-global-color-fuchsia-1200:#640664;--ac-global-color-fuchsia-1300:#470e46;--ac-global-color-fuchsia-1400:#320d31;--ac-global-color-magenta-100:#ffeaf1;--ac-global-color-magenta-200:#ffdce8;--ac-global-color-magenta-300:#ffcadd;--ac-global-color-magenta-400:#ffb2ce;--ac-global-color-magenta-500:#ff95bd;--ac-global-color-magenta-600:#fa77aa;--ac-global-color-magenta-700:#ef5a98;--ac-global-color-magenta-800:#de3d82;--ac-global-color-magenta-900:#c82269;--ac-global-color-magenta-1000:#ad0955;--ac-global-color-magenta-1100:#8e0045;--ac-global-color-magenta-1200:#700037;--ac-global-color-magenta-1300:#54032a;--ac-global-color-magenta-1400:#3c061d;--ac-global-color-info:rgb(2, 173, 221);--ac-global-color-info-900:rgba(2, 173, 221, 0.9);--ac-global-color-info-700:rgba(2, 173, 221, 0.7);--ac-global-color-info-500:rgba(2, 173, 221, 0.5);--ac-global-color-danger:rgb(218, 11, 0);--ac-global-color-danger-900:rgba(218, 11, 0, 0.9);--ac-global-color-danger-700:rgba(218, 11, 0, 0.7);--ac-global-color-danger-500:rgba(218, 11, 0, 0.5);--ac-global-color-success:rgb(17, 191, 69);--ac-global-color-success-900:rgba(17, 191, 69, 0.9);--ac-global-color-success-700:rgba(17, 191, 69, 0.7);--ac-global-color-success-500:rgba(17, 191, 69, 0.5);--ac-global-color-warning:rgb(224, 102, 2);--ac-global-color-warning-900:rgba(224, 102, 2, 0.9);--ac-global-color-warning-700:rgba(224, 102, 2, 0.7);--ac-global-color-warning-500:rgba(224, 102, 2, 0.5);--ac-global-color-designation-purple:#4500d9;--ac-global-color-designation-turquoise:#00add0;--ac-global-text-color-900:rgba(0, 0, 0, 0.9);--ac-global-text-color-700:rgba(0, 0, 0, 0.7);--ac-global-text-color-500:rgba(0, 0, 0, 0.5);--ac-global-text-color-300:rgba(0, 0, 0, 0.3);};label:lightThemeCSS;",
  map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */",
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__
};
var derivedCSS = function derivedCSS2(theme3) {
  return /* @__PURE__ */ css(":root,.ac-theme--", theme3, "{--ac-global-background-color-default:var(--ac-global-color-grey-100);--ac-global-background-color-light:var(--ac-global-color-grey-200);--ac-global-background-color-light-hover:var(--ac-global-color-grey-300);--ac-global-background-color-dark:var(--ac-global-color-grey-100);--ac-global-background-color-danger:var(--ac-global-color-danger);--ac-global-border-color-default:var(--ac-global-color-grey-300);--ac-global-border-color-light:var(--ac-global-color-grey-400);--ac-global-border-color-dark:var(--ac-global-color-grey-300);--ac-global-input-field-border-color:var(--ac-global-color-grey-400);--ac-global-input-field-border-color-hover:var(--ac-global-color-grey-300);--ac-global-input-field-border-color-active:var(--ac-global-color-primary);--ac-global-input-field-background-color:var(--ac-global-color-grey-200);--ac-global-input-field-background-color-active:var(\n      --ac-global-color-grey-300\n    );--ac-global-menu-border-color:var(--ac-global-color-grey-400);--ac-global-menu-background-color:var(--ac-global-color-grey-200);--ac-global-menu-item-background-color-hover:var(\n      --ac-global-color-grey-300\n    );--ac-global-button-primary-background-color:var(\n      --ac-global-color-primary-700\n    );--ac-global-button-primary-background-color-hover:var(\n      --ac-global-color-primary-900\n    );--ac-global-button-primary-border-color:var(--ac-global-color-primary);--ac-global-button-danger-background-color:var(\n      --ac-global-color-danger-700\n    );--ac-global-button-danger-background-color-hover:var(\n      --ac-global-color-danger-900\n    );--ac-global-button-danger-border-color:var(--ac-global-color-danger);--ac-global-button-success-background-color:var(\n      --ac-global-color-success-700\n    );--ac-global-button-success-background-color-hover:var(\n      --ac-global-color-success-900\n    );--ac-global-button-success-border-color:var(--ac-global-color-success);--ac-global-tooltip-background-color:var(--ac-global-color-grey-100);--ac-global-tooltip-border-color:var(--ac-global-color-grey-300);--ac-global-rounding-small:var(--ac-global-dimension-static-size-50);--ac-global-rounding-medium:var(--ac-global-dimension-static-size-100);--ac-global-border-size-thin:var(--ac-global-dimension-static-size-10);--ac-global-border-size-thick:var(--ac-global-dimension-static-size-25);--ac-global-border-size-thicker:var(--ac-global-dimension-static-size-50);--ac-global-border-size-thickest:var(\n      --ac-global-dimension-static-size-100\n    );--ac-global-border-offset-thin:var(--ac-global-dimension-static-size-25);--ac-global-border-offset-thick:var(--ac-global-dimension-static-size-50);--ac-global-border-offset-thicker:var(\n      --ac-global-dimension-static-size-100\n    );--ac-global-border-offset-thickest:var(\n      --ac-global-dimension-static-size-200\n    );--ac-global-grid-baseline:var(--ac-global-dimension-static-size-100);--ac-global-grid-gutter-xsmall:var(--ac-global-dimension-static-size-200);--ac-global-grid-gutter-small:var(--ac-global-dimension-static-size-300);--ac-global-grid-gutter-medium:var(--ac-global-dimension-static-size-400);--ac-global-grid-gutter-large:var(--ac-global-dimension-static-size-500);--ac-global-grid-gutter-xlarge:var(--ac-global-dimension-static-size-600);--ac-global-grid-margin-xsmall:var(--ac-global-dimension-static-size-200);--ac-global-grid-margin-small:var(--ac-global-dimension-static-size-300);--ac-global-grid-margin-medium:var(--ac-global-dimension-static-size-400);--ac-global-grid-margin-large:var(--ac-global-dimension-static-size-500);--ac-global-grid-margin-xlarge:var(--ac-global-dimension-static-size-600);--ac-alias-single-line-height:var(--ac-global-dimension-size-400);--ac-alias-single-line-width:var(--ac-global-dimension-size-2400);}" + (false ? "" : ";label:derivedCSS;"), false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */");
};
function GlobalStyles() {
  var _useProvider = useProvider(), theme3 = _useProvider.theme;
  theme3 = theme3 || "dark";
  var themeCSS = theme3 === "dark" ? darkThemeCSS : lightThemeCSS;
  return jsx(Global, {
    styles: /* @__PURE__ */ css(dimensionsCSS, staticCSS, themeCSS, derivedCSS(theme3), mediumRootCSS, false ? "" : ";label:GlobalStyles;", false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */")
  });
}
var _excluded = ["children", "theme"];
var Context = /* @__PURE__ */ import_react35.default.createContext(null);
function Provider(props) {
  var prevContext = (0, import_react35.useContext)(Context);
  var children = props.children, propsTheme = props.theme, context2 = _objectWithoutPropertiesLoose2(props, _excluded);
  var theme3 = propsTheme || "dark";
  var isRootProvider = !prevContext;
  if (prevContext && prevContext.theme) {
    theme3 = prevContext.theme;
  }
  var content2 = isRootProvider ? jsx($f57aed4a881a3485$export$bf688221f59024e5, null, children) : children;
  return jsx(Context.Provider, {
    value: _extends2({}, context2, {
      theme: theme3
    })
  }, isRootProvider ? jsx(GlobalStyles, null) : null, jsx("div", {
    className: "ac-theme ac-theme--" + theme3
  }, content2));
}
function useProvider() {
  var context2 = (0, import_react35.useContext)(Context);
  if (!context2) {
    throw new Error("useProvider must be used within a Provider");
  }
  return context2;
}
function useProviderProps(props) {
  var context2 = useProvider();
  if (!context2) {
    return props;
  }
  return Object.assign({}, {
    isQuiet: context2.isQuiet,
    isDisabled: context2.isDisabled,
    isReadOnly: context2.isReadOnly
  }, props);
}
var OPEN_STATES = {
  entering: false,
  entered: true
};
function OpenTransition(props) {
  return (
    // @ts-ignore transition JSX.Element doesn't match latest react types
    jsx(Transition_default, _extends2({
      timeout: {
        enter: 0,
        exit: 350
      }
    }, props), function(state) {
      return import_react35.default.Children.map(props.children, function(child) {
        return (
          // @ts-ignore
          child && import_react35.default.cloneElement(child, {
            isOpen: !!OPEN_STATES[state]
          })
        );
      });
    })
  );
}
function Overlay(props) {
  var children = props.children, isOpen = props.isOpen, container = props.container, onEnter = props.onEnter, onEntering = props.onEntering, onEntered = props.onEntered, onExit = props.onExit, onExiting = props.onExiting, onExited = props.onExited;
  var _useState = (0, import_react35.useState)(!isOpen), exited = _useState[0], setExited = _useState[1];
  var handleEntered = (0, import_react35.useCallback)(function() {
    setExited(false);
    if (onEntered) {
      onEntered();
    }
  }, [onEntered]);
  var handleExited = (0, import_react35.useCallback)(function() {
    setExited(true);
    if (onExited) {
      onExited();
    }
  }, [onExited]);
  var mountOverlay = isOpen || !exited;
  if (!mountOverlay) {
    return null;
  }
  var contents = jsx(OpenTransition, {
    "in": isOpen,
    appear: true,
    onExit,
    onExiting,
    onExited: handleExited,
    onEnter,
    onEntering,
    onEntered: handleEntered
  }, children);
  return import_react_dom5.default.createPortal(contents, container || document.body);
}
function createDOMRef(ref) {
  return {
    // @ts-ignore
    UNSAFE_getDOMNode: function UNSAFE_getDOMNode() {
      return ref.current;
    }
  };
}
function createFocusableRef(domRef, focusableRef) {
  if (focusableRef === void 0) {
    focusableRef = domRef;
  }
  return _extends2({}, createDOMRef(domRef), {
    focus: function focus() {
      if (focusableRef.current) {
        focusableRef.current.focus();
      }
    }
  });
}
function useDOMRef(ref) {
  var domRef = (0, import_react35.useRef)(null);
  (0, import_react35.useImperativeHandle)(ref, function() {
    return createDOMRef(domRef);
  });
  return domRef;
}
function useFocusableRef(ref, focusableRef) {
  var domRef = (0, import_react35.useRef)(null);
  (0, import_react35.useImperativeHandle)(ref, function() {
    return createFocusableRef(domRef, focusableRef);
  });
  return domRef;
}
function unwrapDOMRef(ref) {
  return {
    get current() {
      return ref.current && ref.current.UNSAFE_getDOMNode();
    }
  };
}
function useUnwrapDOMRef(ref) {
  return (0, import_react35.useMemo)(function() {
    return unwrapDOMRef(ref);
  }, [ref]);
}
function getWrappedElement(children) {
  var element2;
  if (typeof children === "string") {
    element2 = jsx("span", null, children);
  } else {
    element2 = import_react35.default.Children.only(children);
  }
  return element2;
}
function assertUnreachable(_) {
  throw new Error("Unreachable");
}
var baseStyleProps = {
  margin: ["margin", dimensionValue],
  marginStart: [/* @__PURE__ */ rtl("marginLeft", "marginRight"), dimensionValue],
  marginEnd: [/* @__PURE__ */ rtl("marginRight", "marginLeft"), dimensionValue],
  // marginLeft: ['marginLeft', dimensionValue],
  // marginRight: ['marginRight', dimensionValue],
  marginTop: ["marginTop", dimensionValue],
  marginBottom: ["marginBottom", dimensionValue],
  marginX: [["marginLeft", "marginRight"], dimensionValue],
  marginY: [["marginTop", "marginBottom"], dimensionValue],
  width: ["width", dimensionValue],
  height: ["height", dimensionValue],
  minWidth: ["minWidth", dimensionValue],
  minHeight: ["minHeight", dimensionValue],
  maxWidth: ["maxWidth", dimensionValue],
  maxHeight: ["maxHeight", dimensionValue],
  isHidden: ["display", hiddenValue],
  alignSelf: ["alignSelf", passthroughStyle],
  justifySelf: ["justifySelf", passthroughStyle],
  position: ["position", anyValue],
  zIndex: ["zIndex", anyValue],
  top: ["top", dimensionValue],
  bottom: ["bottom", dimensionValue],
  start: [/* @__PURE__ */ rtl("left", "right"), dimensionValue],
  end: [/* @__PURE__ */ rtl("right", "left"), dimensionValue],
  left: ["left", dimensionValue],
  right: ["right", dimensionValue],
  order: ["order", anyValue],
  flex: ["flex", flexValue],
  flexGrow: ["flexGrow", passthroughStyle],
  flexShrink: ["flexShrink", passthroughStyle],
  flexBasis: ["flexBasis", passthroughStyle],
  gridArea: ["gridArea", passthroughStyle],
  gridColumn: ["gridColumn", passthroughStyle],
  gridColumnEnd: ["gridColumnEnd", passthroughStyle],
  gridColumnStart: ["gridColumnStart", passthroughStyle],
  gridRow: ["gridRow", passthroughStyle],
  gridRowEnd: ["gridRowEnd", passthroughStyle],
  gridRowStart: ["gridRowStart", passthroughStyle]
};
var viewStyleProps = /* @__PURE__ */ _extends2({}, baseStyleProps, {
  backgroundColor: ["backgroundColor", backgroundColorValue],
  borderWidth: ["borderWidth", borderSizeValue],
  borderStartWidth: [/* @__PURE__ */ rtl("borderLeftWidth", "borderRightWidth"), borderSizeValue],
  borderEndWidth: [/* @__PURE__ */ rtl("borderRightWidth", "borderLeftWidth"), borderSizeValue],
  borderLeftWidth: ["borderLeftWidth", borderSizeValue],
  borderRightWidth: ["borderRightWidth", borderSizeValue],
  borderTopWidth: ["borderTopWidth", borderSizeValue],
  borderBottomWidth: ["borderBottomWidth", borderSizeValue],
  borderXWidth: [["borderLeftWidth", "borderRightWidth"], borderSizeValue],
  borderYWidth: [["borderTopWidth", "borderBottomWidth"], borderSizeValue],
  borderColor: ["borderColor", borderColorValue],
  borderStartColor: [/* @__PURE__ */ rtl("borderLeftColor", "borderRightColor"), borderColorValue],
  borderEndColor: [/* @__PURE__ */ rtl("borderRightColor", "borderLeftColor"), borderColorValue],
  borderLeftColor: ["borderLeftColor", borderColorValue],
  borderRightColor: ["borderRightColor", borderColorValue],
  borderTopColor: ["borderTopColor", borderColorValue],
  borderBottomColor: ["borderBottomColor", borderColorValue],
  borderXColor: [["borderLeftColor", "borderRightColor"], borderColorValue],
  borderYColor: [["borderTopColor", "borderBottomColor"], borderColorValue],
  borderRadius: ["borderRadius", borderRadiusValue],
  borderTopStartRadius: [/* @__PURE__ */ rtl("borderTopLeftRadius", "borderTopRightRadius"), borderRadiusValue],
  borderTopEndRadius: [/* @__PURE__ */ rtl("borderTopRightRadius", "borderTopLeftRadius"), borderRadiusValue],
  borderBottomStartRadius: [/* @__PURE__ */ rtl("borderBottomLeftRadius", "borderBottomRightRadius"), borderRadiusValue],
  borderBottomEndRadius: [/* @__PURE__ */ rtl("borderBottomRightRadius", "borderBottomLeftRadius"), borderRadiusValue],
  borderTopLeftRadius: ["borderTopLeftRadius", borderRadiusValue],
  borderTopRightRadius: ["borderTopRightRadius", borderRadiusValue],
  borderBottomLeftRadius: ["borderBottomLeftRadius", borderRadiusValue],
  borderBottomRightRadius: ["borderBottomRightRadius", borderRadiusValue],
  padding: ["padding", dimensionValue],
  paddingStart: [/* @__PURE__ */ rtl("paddingLeft", "paddingRight"), dimensionValue],
  paddingEnd: [/* @__PURE__ */ rtl("paddingRight", "paddingLeft"), dimensionValue],
  paddingLeft: ["paddingLeft", dimensionValue],
  paddingRight: ["paddingRight", dimensionValue],
  paddingTop: ["paddingTop", dimensionValue],
  paddingBottom: ["paddingBottom", dimensionValue],
  paddingX: [["paddingLeft", "paddingRight"], dimensionValue],
  paddingY: [["paddingTop", "paddingBottom"], dimensionValue],
  overflow: ["overflow", passthroughStyle]
});
var borderStyleProps = {
  borderWidth: "borderStyle",
  borderLeftWidth: "borderLeftStyle",
  borderRightWidth: "borderRightStyle",
  borderTopWidth: "borderTopStyle",
  borderBottomWidth: "borderBottomStyle"
};
var UNIT_RE = /(%|px|em|rem|vw|vh|auto|cm|mm|in|pt|pc|ex|ch|rem|vmin|vmax|fr)$/;
var FUNC_RE = /^\s*\w+\(/;
var AC_VARIABLE_RE = /(static-)?size-\d+|single-line-(height|width)/g;
function dimensionValue(value) {
  if (typeof value === "number") {
    return value + "px";
  }
  if (UNIT_RE.test(value)) {
    return value;
  }
  if (FUNC_RE.test(value)) {
    return value.replace(AC_VARIABLE_RE, "var(--ac-global-dimension-$&)");
  }
  return "var(--ac-global-dimension-" + value + ")";
}
function responsiveDimensionValue(value, matchedBreakpoints) {
  value = getResponsiveProp(value, matchedBreakpoints);
  return dimensionValue(value);
}
function convertStyleProps(props, handlers2, direction, matchedBreakpoints) {
  var style = {};
  for (var key in props) {
    var styleProp = handlers2[key];
    if (!styleProp || props[key] == null) {
      continue;
    }
    var name2 = styleProp[0], convert = styleProp[1];
    if (typeof name2 === "function") {
      name2 = name2(direction);
    }
    var prop = getResponsiveProp(props[key], matchedBreakpoints);
    var value = convert(prop);
    if (Array.isArray(name2)) {
      for (var _iterator = _createForOfIteratorHelperLoose(name2), _step; !(_step = _iterator()).done; ) {
        var k2 = _step.value;
        style[k2] = value;
      }
    } else {
      style[name2] = value;
    }
  }
  for (var _prop in borderStyleProps) {
    if (style[_prop]) {
      style[borderStyleProps[_prop]] = "solid";
      style.boxSizing = "border-box";
    }
  }
  return style;
}
function rtl(ltr, rtl2) {
  return function(direction) {
    return direction === "rtl" ? rtl2 : ltr;
  };
}
function colorValue(value, type) {
  if (type === void 0) {
    type = "default";
  }
  return "var(--ac-global-color-" + value + ", var(--ac-semantic-" + value + "-color-" + type + "))";
}
function designationColorValue(value) {
  switch (value) {
    case "designationPurple":
      return "var(--ac-global-color-designation-purple)";
    case "designationTurquoise":
      return "var(--ac-global-color-designation-turquoise)";
    default:
      assertUnreachable();
  }
}
function backgroundColorValue(value) {
  return "var(--ac-global-background-color-" + value + ", " + colorValue(value, "background") + ")";
}
function borderColorValue(value) {
  if (value === "default") {
    return "var(--ac-global-border-color)";
  }
  return "var(--ac-global-border-color-" + value + ", " + colorValue(value, "border") + ")";
}
function borderSizeValue(value) {
  return "var(--ac-global-border-size-" + value + ")";
}
function passthroughStyle(value) {
  return value;
}
function borderRadiusValue(value) {
  return "var(--ac-global-rounding-" + value + ")";
}
function hiddenValue(value) {
  return value ? "none" : void 0;
}
function anyValue(value) {
  return value;
}
function flexValue(value) {
  if (typeof value === "boolean") {
    return value ? "1" : void 0;
  }
  return "" + value;
}
function getResponsiveProp(prop, matchedBreakpoints) {
  if (prop && typeof prop === "object" && !Array.isArray(prop)) {
    for (var i2 = 0; i2 < matchedBreakpoints.length; i2++) {
      var breakpoint = matchedBreakpoints[i2];
      if (prop[breakpoint] != null) {
        return prop[breakpoint];
      }
    }
    return prop.base;
  }
  return prop;
}
function useStyleProps(props, handlers2, options) {
  if (handlers2 === void 0) {
    handlers2 = baseStyleProps;
  }
  if (options === void 0) {
    options = {};
  }
  var otherProps = _extends2({}, (_objectDestructuringEmpty(props), props));
  var _useLocale = $18f2051aff69b9bf$export$43bb16f9c6d9e3f7(), direction = _useLocale.direction;
  var _options = options, _options$matchedBreak = _options.matchedBreakpoints, matchedBreakpoints = _options$matchedBreak === void 0 ? ["base"] : _options$matchedBreak;
  var styles = convertStyleProps(props, handlers2, direction, matchedBreakpoints);
  var style = _extends2({}, styles);
  if (otherProps.className) {
    console.warn("The className prop is unsafe and is unsupported in Arize Components. Please use style props with AC variables, or UNSAFE_className if you absolutely must do something custom. Note that this may break in future versions due to DOM structure changes.");
  }
  if (otherProps.style) {
    console.warn("The style prop is unsafe and is unsupported in React Arize Components. Please use style props with AC variables, or UNSAFE_style if you absolutely must do something custom. Note that this may break in future versions due to DOM structure changes.");
  }
  var styleProps = {
    style
  };
  if (getResponsiveProp(props.isHidden, matchedBreakpoints)) {
    styleProps.hidden = true;
  }
  return {
    styleProps
  };
}
function _EMOTION_STRINGIFIED_CSS_ERROR__$1() {
  return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
}
var underlayCSS = false ? {
  name: "1j20pja",
  styles: "background:rgba(0, 0, 0, 0.3);opacity:0;visibility:none;transition:opacity 0.2s ease-out 0.2s;&.is-open{transition:opacity 0.2s ease-in 0.1s;visibility:visible;opacity:1;pointer-events:auto;position:fixed;inset:0;z-index:1;}"
} : {
  name: "aju08b-underlayCSS",
  styles: "background:rgba(0, 0, 0, 0.3);opacity:0;visibility:none;transition:opacity 0.2s ease-out 0.2s;&.is-open{transition:opacity 0.2s ease-in 0.1s;visibility:visible;opacity:1;pointer-events:auto;position:fixed;inset:0;z-index:1;};label:underlayCSS;",
  map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlVuZGVybGF5LnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFHd0IiLCJmaWxlIjoiVW5kZXJsYXkudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgY2xhc3NOYW1lcyB9IGZyb20gJy4uL3V0aWxzJztcclxuaW1wb3J0IFJlYWN0IGZyb20gJ3JlYWN0JztcclxuaW1wb3J0IHsgY3NzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xyXG5jb25zdCB1bmRlcmxheUNTUyA9IGNzcyBgXG4gIGJhY2tncm91bmQ6IHJnYmEoMCwgMCwgMCwgMC4zKTtcbiAgb3BhY2l0eTogMDtcbiAgdmlzaWJpbGl0eTogbm9uZTtcblxuICAvLyBFeGl0IGFuaW1hdGlvbnNcbiAgdHJhbnNpdGlvbjogb3BhY2l0eSAwLjJzIGVhc2Utb3V0IDAuMnM7XG4gICYuaXMtb3BlbiB7XG4gICAgLyogRW50cnkgYW5pbWF0aW9ucyAqL1xuICAgIHRyYW5zaXRpb246IG9wYWNpdHkgMC4ycyBlYXNlLWluIDAuMXM7XG4gICAgdmlzaWJpbGl0eTogdmlzaWJsZTtcbiAgICBvcGFjaXR5OiAxO1xuICAgIHBvaW50ZXItZXZlbnRzOiBhdXRvO1xuICAgIHBvc2l0aW9uOiBmaXhlZDtcbiAgICBpbnNldDogMDtcbiAgICB6LWluZGV4OiAxO1xuICB9XG5gO1xyXG5leHBvcnQgZnVuY3Rpb24gVW5kZXJsYXkoeyBpc09wZW4gfSkge1xyXG4gICAgcmV0dXJuICg8ZGl2IGNzcz17dW5kZXJsYXlDU1N9IGNsYXNzTmFtZT17Y2xhc3NOYW1lcygnYWMtdW5kZXJsYXknLCB7XHJcbiAgICAgICAgJ2lzLW9wZW4nOiBpc09wZW4sXHJcbiAgICB9KX0vPik7XHJcbn1cclxuLy8jIHNvdXJjZU1hcHBpbmdVUkw9VW5kZXJsYXkuanN4Lm1hcCJdfQ== */",
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__$1
};
function Underlay(_ref18) {
  var isOpen = _ref18.isOpen;
  return jsx("div", {
    css: underlayCSS,
    className: clsx_m_default("ac-underlay", {
      "is-open": isOpen
    })
  });
}
var _excluded$1 = ["children", "isOpen", "type", "overlayProps"];
var _excluded2 = ["children", "onClose", "type"];
function _EMOTION_STRINGIFIED_CSS_ERROR__$2() {
  return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
}
var modalWrapperCSS = false ? {
  name: "1712jt2",
  styles: "box-sizing:border-box;z-index:2;transition:visibility 0ms linear 130ms;display:flex;position:fixed;pointer-events:none;&.ac-modal-wrapper--slideOver{height:100vh;top:0;right:0;bottom:0;}&.ac-modal-wrapper--modal{left:50%;top:50%;transform:translate(-50%, -50%);}"
} : {
  name: "enh1fe-modalWrapperCSS",
  styles: "box-sizing:border-box;z-index:2;transition:visibility 0ms linear 130ms;display:flex;position:fixed;pointer-events:none;&.ac-modal-wrapper--slideOver{height:100vh;top:0;right:0;bottom:0;}&.ac-modal-wrapper--modal{left:50%;top:50%;transform:translate(-50%, -50%);};label:modalWrapperCSS;",
  map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */",
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__$2
};
var exitTransitionAnimationTime = "0.1s";
var enterTransitionAnimationTime = "0.2s";
var enterTransitionDelayAnimationTime = "0.2s";
var modalCSS = /* @__PURE__ */ css("background-color:var(--ac-global-background-color-dark);pointer-events:auto;opacity:0;&.ac-modal--slideOver{border-left:1px solid var(--ac-global-border-color-dark);box-shadow:-10px 0px 30px 10px rgba(0, 0, 0, 0.1);transform:translateX(500px);transition:opacity ", exitTransitionAnimationTime, " cubic-bezier(0.5, 0, 1, 1),transform ", exitTransitionAnimationTime, " cubic-bezier(0, 0, 0.4, 1);&.is-open{transition:transform ", enterTransitionAnimationTime, " cubic-bezier(0, 0, 0.4, 1),opacity ", enterTransitionAnimationTime, " cubic-bezier(0, 0, 0.4, 1);opacity:0.9999;visibility:visible;transform:translateX(0);}}&.ac-modal--modal{border:1px solid var(--ac-global-border-color-light);border-radius:var(--ac-global-rounding-medium);box-shadow:-10px 0px 30px 10px rgba(0, 0, 0, 0.1);transform:translateY(20px);transition:opacity ", exitTransitionAnimationTime, " cubic-bezier(0.5, 0, 1, 1),transform ", exitTransitionAnimationTime, " cubic-bezier(0, 0, 0.4, 1);&.is-open{transition:transform ", enterTransitionAnimationTime, " cubic-bezier(0, 0, 0.4, 1) ", enterTransitionDelayAnimationTime, ",opacity ", enterTransitionAnimationTime, " cubic-bezier(0, 0, 0.4, 1) ", enterTransitionDelayAnimationTime, ";opacity:0.9999;visibility:visible;transform:translateY(0);}}" + (false ? "" : ";label:modalCSS;"), false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */");
var ModalWrapper = /* @__PURE__ */ (0, import_react35.forwardRef)(function(props, ref) {
  var _classNames, _classNames2;
  var children = props.children, isOpen = props.isOpen, type = props.type, overlayProps = props.overlayProps, otherProps = _objectWithoutPropertiesLoose2(props, _excluded$1);
  $49c51c25361d4cd2$export$ee0f7cc6afcd1c18();
  var _useModal = $f57aed4a881a3485$export$33ffd74ebf07f060(), modalProps = _useModal.modalProps;
  var wrapperClassName = clsx_m_default("ac-modal-wrapper", (_classNames = {}, _classNames["ac-modal-wrapper--" + type] = type, _classNames));
  var modalClassName = clsx_m_default("ac-modal", {
    "is-open": isOpen
  }, (_classNames2 = {}, _classNames2["ac-modal--" + type] = type, _classNames2), otherProps.className);
  return jsx("div", {
    className: wrapperClassName,
    css: modalWrapperCSS
  }, jsx("div", _extends2({}, $3ef42575df84b30b$export$9d1611c77c2fe928(otherProps, overlayProps, modalProps), {
    ref,
    className: modalClassName,
    "data-testid": "modal",
    css: modalCSS
  }), children));
});
function Modal(props, ref) {
  var children = props.children, onClose = props.onClose, _props$type = props.type, type = _props$type === void 0 ? "modal" : _props$type, otherProps = _objectWithoutPropertiesLoose2(props, _excluded2);
  var domRef = useDOMRef(ref);
  var _useOverlay = $a11501f3d1d39e6c$export$ea8f71083e90600f(props, domRef), overlayProps = _useOverlay.overlayProps, underlayProps = _useOverlay.underlayProps;
  return jsx(Overlay, otherProps, jsx(Underlay, underlayProps), jsx(ModalWrapper, {
    onClose,
    type,
    ref: domRef,
    overlayProps
  }, children));
}
var _Modal = /* @__PURE__ */ (0, import_react35.forwardRef)(Modal);
var purpleColors = {
  purple100: "#EFE9FE",
  purple20: "#E2D6FC",
  purple300: "#D5C4FB",
  purple400: "#C8B1FA",
  purple500: "#BB9FF9",
  purple600: "#AE8DF8",
  purple700: "#A17AF7",
  purple800: "#9468F6",
  purple900: "#8755F4",
  purple1000: "#7A43F3",
  purple1100: "#6D30F2",
  purple1200: "#5F1EF1"
};
var turquoiseColors = {
  turquoise100: "#EBFEFF",
  turquoise200: "#D8FEFE",
  turquoise300: "#C4FDFE",
  turquoise400: "#B1FDFD",
  turquoise500: "#9EFCFD",
  turquoise600: "#8BFBFD",
  turquoise700: "#78FBFC",
  turquoise800: "#64FAFC",
  turquoise900: "#51FAFB",
  turquoise1000: "#3EF9FB",
  turquoise1100: "#2BF8FB",
  turquoise1200: "#17F8FA"
};
var grayColors = {
  gray100: "#666b71",
  gray200: "#585d64",
  gray300: "#4a5057",
  gray400: "#3d434a",
  gray500: "#2f353d",
  gray600: "#282e35",
  gray700: "#23282e",
  gray800: "#1d2126",
  gray900: "#181B1F"
};
var _colorPalette = {
  __proto__: null,
  purpleColors,
  turquoiseColors,
  grayColors
};
var colorPalette = _colorPalette;
var arizeColors = {
  arizePink: "#CA2A76",
  arizeGreen: "#48BB95",
  arizeBlue: "#227C9D",
  arizeLightBlue: "#72D9FF"
};
var borderColors = {
  grayBorder: "#2e363e",
  lightGrayBorder: "#768CA3",
  lightGrayHoverBorder: "#b3bfcc"
};
var textColors = {
  white90: "rgba(255, 255, 255, 0.9)",
  white70: "rgba(255, 255, 255, 0.7)",
  white50: "rgba(255, 255, 255, 0.5)",
  white30: "rgba(255, 255, 255, 0.3)",
  inherit: "inherit"
};
var labelColors = {
  white: "rgba(255, 255, 255, 0.9)",
  red: "#F85149",
  green: "#7EE787",
  orange: "#E69958",
  blue: "#72D9FF",
  purple: "#ADA1FF",
  gray: "rgba(255, 255, 255, 0.7)"
};
var designationColors = {
  designationTurquoise: colorPalette.turquoiseColors.turquoise500,
  designationPurple: colorPalette.purpleColors.purple500
};
var grayColors$1 = grayColors;
var theme = {
  colors: /* @__PURE__ */ _extends2({}, arizeColors, grayColors$1, borderColors, {
    statusInfo: "#72D9FF",
    statusSuccess: "#7EE787",
    statusWarning: "#E69958",
    statusDanger: "#F85149",
    dividerColor: "#32383f",
    hoverBgColor: grayColors.gray400
  }),
  textColors,
  labelColors,
  // Add any component specific overrides here
  components: {
    card: {
      backgroundColor: grayColors.gray800,
      borderColor: grayColors.gray400
    },
    accordion: {
      backgroundColor: grayColors.gray500,
      borderColor: grayColors.gray400
    },
    tabs: {
      borderColor: grayColors.gray400
    },
    tooltip: {
      backgroundColor: "#3C4C5D",
      borderColor: "#8398af"
    },
    actionTooltip: {
      backgroundColor: "#2D3845",
      borderColor: "#6F7D8C"
    },
    dropdown: {
      backgroundColor: grayColors.gray500,
      borderColor: grayColors.gray100,
      hoverBorderColor: /* @__PURE__ */ curriedLighten$1(0.2, grayColors.gray100),
      activeBorderColor: arizeColors.arizeLightBlue,
      activeBackgroundColor: /* @__PURE__ */ curriedDarken$1(0.02, grayColors.gray500)
    },
    textField: {
      borderColor: grayColors.gray100,
      hoverBorderColor: /* @__PURE__ */ curriedLighten$1(0.2, grayColors.gray100),
      activeBorderColor: arizeColors.arizeLightBlue,
      backgroundColor: grayColors.gray500,
      activeBackgroundColor: /* @__PURE__ */ curriedDarken$1(0.02, grayColors.gray500)
    },
    button: {
      primaryBorderColor: "#5BAECC",
      primaryHoverBackgroundColor: "#5BAECC",
      defaultBorderColor: borderColors.lightGrayBorder,
      defaultHoverBackgroundColor: "#64768A",
      dangerBorderColor: "#fa807a",
      dangerHoverBackgroundColor: "#fa807a",
      successColor: "#3C6E40",
      successBorderColor: "#7EE787",
      successHoverBackgroundColor: "#7EE787"
    },
    modal: {
      backgroundColor: grayColors.gray800
    }
  },
  typography: {
    weights: {
      heavy: 600,
      normal: 400
    },
    sizes: {
      xxxlarge: {
        fontSize: 44,
        lineHeight: 52
      },
      xxlarge: {
        fontSize: 28,
        lineHeight: 36
      },
      xlarge: {
        fontSize: 18,
        lineHeight: 28
      },
      large: {
        fontSize: 16,
        lineHeight: 24
      },
      medium: {
        fontSize: 14,
        lineHeight: 20
      },
      small: {
        fontSize: 12,
        lineHeight: 16
      },
      xsmall: {
        fontSize: 10,
        lineHeight: 16
      }
    }
  },
  spacing: {
    padding4: 4,
    padding8: 8,
    padding16: 16,
    padding24: 24,
    margin4: 4,
    margin8: 8,
    margin16: 16,
    margin24: 24,
    popover: {
      /**
       * The offset is the distance between the source and the popover edge (or the end of the tip, when there is a tip).
       */
      offset: 6
    },
    tooltip: {
      /**
       * The offset is the distance between the source and the tooltip edge (or the end of the tip, when there is a tip).
       */
      offset: 6
    },
    outline: {
      thin: 2
    }
  },
  rounding: {
    rounding4: 4
  },
  animation: {
    global: {
      /**
       * Fallback to 200ms as an animation duration
       */
      duration: 200
    }
  },
  /**
   * The height of a single line of form input etc.
   */
  singleLineHeight: 36,
  borderRadius: {
    medium: 4
  },
  opacity: {
    disabled: 0.6
  }
};
function _EMOTION_STRINGIFIED_CSS_ERROR__$3() {
  return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
}
var _ref = false ? {
  name: "1lotext",
  styles: "transform:translateX(var(--popover-animation-distance))"
} : {
  name: "xr8emv-transformCSS",
  styles: "transform:translateX(var(--popover-animation-distance));label:transformCSS;",
  map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0eWxlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFxQitCIiwiZmlsZSI6InN0eWxlcy50cyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGNzcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcclxuaW1wb3J0IHRoZW1lIGZyb20gJy4uL3RoZW1lJztcclxuZXhwb3J0IGNvbnN0IHBvcG92ZXJDU1MgPSAoeyBwbGFjZW1lbnQgfSkgPT4ge1xyXG4gICAgbGV0IHRyYW5zZm9ybUNTUyA9IGNzcyBgYDtcclxuICAgIHN3aXRjaCAocGxhY2VtZW50KSB7XHJcbiAgICAgICAgY2FzZSAnYm90dG9tJzpcclxuICAgICAgICAgICAgdHJhbnNmb3JtQ1NTID0gY3NzIGBcbiAgICAgICAgdHJhbnNmb3JtOiB0cmFuc2xhdGVZKHZhcigtLXBvcG92ZXItYW5pbWF0aW9uLWRpc3RhbmNlKSk7XG4gICAgICBgO1xyXG4gICAgICAgICAgICBicmVhaztcclxuICAgICAgICBjYXNlICd0b3AnOlxyXG4gICAgICAgICAgICB0cmFuc2Zvcm1DU1MgPSBjc3MgYFxuICAgICAgICB0cmFuc2Zvcm06IHRyYW5zbGF0ZVkoY2FsYygtMSAqIHZhcigtLXBvcG92ZXItYW5pbWF0aW9uLWRpc3RhbmNlKSkpO1xuICAgICAgYDtcclxuICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgY2FzZSAnbGVmdCc6XHJcbiAgICAgICAgICAgIHRyYW5zZm9ybUNTUyA9IGNzcyBgXG4gICAgICAgIHRyYW5zZm9ybTogdHJhbnNsYXRlWChjYWxjKC0xICogdmFyKC0tcG9wb3Zlci1hbmltYXRpb24tZGlzdGFuY2UpKSk7XG4gICAgICBgO1xyXG4gICAgICAgICAgICBicmVhaztcclxuICAgICAgICBjYXNlICdyaWdodCc6XHJcbiAgICAgICAgICAgIHRyYW5zZm9ybUNTUyA9IGNzcyBgXG4gICAgICAgIHRyYW5zZm9ybTogdHJhbnNsYXRlWCh2YXIoLS1wb3BvdmVyLWFuaW1hdGlvbi1kaXN0YW5jZSkpO1xuICAgICAgYDtcclxuICAgICAgICAgICAgYnJlYWs7XHJcbiAgICB9XHJcbiAgICByZXR1cm4gY3NzIGBcbiAgICAtLXBvcG92ZXItYW5pbWF0aW9uLWRpc3RhbmNlOiAke3RoZW1lLnNwYWNpbmcucG9wb3Zlci5vZmZzZXR9cHg7XG4gICAgb3V0bGluZTogbm9uZTsgLyogSGlkZSBmb2N1cyBvdXRsaW5lICovXG4gICAgdmlzaWJpbGl0eTogaGlkZGVuO1xuICAgIG9wYWNpdHk6IDA7XG4gICAgdHJhbnNpdGlvbjogdHJhbnNmb3JtIDEwMG1zIGVhc2UtaW4tb3V0LCBvcGFjaXR5IDEwMG1zIGVhc2UtaW4tb3V0LFxuICAgICAgdmlzaWJpbGl0eSAxMDBtcyBsaW5lYXIgMTAwbXM7XG4gICAgcG9pbnRlci1ldmVudHM6IG5vbmU7XG4gICAgJi5pcy1vcGVuIHtcbiAgICAgIHZpc2liaWxpdHk6IHZpc2libGU7XG4gICAgICBvcGFjaXR5OiAxO1xuICAgICAgdHJhbnNpdGlvbi1kZWxheTogMG1zO1xuICAgICAgcG9pbnRlci1ldmVudHM6IGF1dG87XG4gICAgICAke3RyYW5zZm9ybUNTU31cbiAgICB9XG4gIGA7XHJcbn07XHJcbi8vIyBzb3VyY2VNYXBwaW5nVVJMPXN0eWxlcy5qcy5tYXAiXX0= */",
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__$3
};
var _ref2 = false ? {
  name: "txwn62",
  styles: "transform:translateX(calc(-1 * var(--popover-animation-distance)))"
} : {
  name: "1jm855o-transformCSS",
  styles: "transform:translateX(calc(-1 * var(--popover-animation-distance)));label:transformCSS;",
  map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0eWxlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFnQitCIiwiZmlsZSI6InN0eWxlcy50cyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGNzcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcclxuaW1wb3J0IHRoZW1lIGZyb20gJy4uL3RoZW1lJztcclxuZXhwb3J0IGNvbnN0IHBvcG92ZXJDU1MgPSAoeyBwbGFjZW1lbnQgfSkgPT4ge1xyXG4gICAgbGV0IHRyYW5zZm9ybUNTUyA9IGNzcyBgYDtcclxuICAgIHN3aXRjaCAocGxhY2VtZW50KSB7XHJcbiAgICAgICAgY2FzZSAnYm90dG9tJzpcclxuICAgICAgICAgICAgdHJhbnNmb3JtQ1NTID0gY3NzIGBcbiAgICAgICAgdHJhbnNmb3JtOiB0cmFuc2xhdGVZKHZhcigtLXBvcG92ZXItYW5pbWF0aW9uLWRpc3RhbmNlKSk7XG4gICAgICBgO1xyXG4gICAgICAgICAgICBicmVhaztcclxuICAgICAgICBjYXNlICd0b3AnOlxyXG4gICAgICAgICAgICB0cmFuc2Zvcm1DU1MgPSBjc3MgYFxuICAgICAgICB0cmFuc2Zvcm06IHRyYW5zbGF0ZVkoY2FsYygtMSAqIHZhcigtLXBvcG92ZXItYW5pbWF0aW9uLWRpc3RhbmNlKSkpO1xuICAgICAgYDtcclxuICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgY2FzZSAnbGVmdCc6XHJcbiAgICAgICAgICAgIHRyYW5zZm9ybUNTUyA9IGNzcyBgXG4gICAgICAgIHRyYW5zZm9ybTogdHJhbnNsYXRlWChjYWxjKC0xICogdmFyKC0tcG9wb3Zlci1hbmltYXRpb24tZGlzdGFuY2UpKSk7XG4gICAgICBgO1xyXG4gICAgICAgICAgICBicmVhaztcclxuICAgICAgICBjYXNlICdyaWdodCc6XHJcbiAgICAgICAgICAgIHRyYW5zZm9ybUNTUyA9IGNzcyBgXG4gICAgICAgIHRyYW5zZm9ybTogdHJhbnNsYXRlWCh2YXIoLS1wb3BvdmVyLWFuaW1hdGlvbi1kaXN0YW5jZSkpO1xuICAgICAgYDtcclxuICAgICAgICAgICAgYnJlYWs7XHJcbiAgICB9XHJcbiAgICByZXR1cm4gY3NzIGBcbiAgICAtLXBvcG92ZXItYW5pbWF0aW9uLWRpc3RhbmNlOiAke3RoZW1lLnNwYWNpbmcucG9wb3Zlci5vZmZzZXR9cHg7XG4gICAgb3V0bGluZTogbm9uZTsgLyogSGlkZSBmb2N1cyBvdXRsaW5lICovXG4gICAgdmlzaWJpbGl0eTogaGlkZGVuO1xuICAgIG9wYWNpdHk6IDA7XG4gICAgdHJhbnNpdGlvbjogdHJhbnNmb3JtIDEwMG1zIGVhc2UtaW4tb3V0LCBvcGFjaXR5IDEwMG1zIGVhc2UtaW4tb3V0LFxuICAgICAgdmlzaWJpbGl0eSAxMDBtcyBsaW5lYXIgMTAwbXM7XG4gICAgcG9pbnRlci1ldmVudHM6IG5vbmU7XG4gICAgJi5pcy1vcGVuIHtcbiAgICAgIHZpc2liaWxpdHk6IHZpc2libGU7XG4gICAgICBvcGFjaXR5OiAxO1xuICAgICAgdHJhbnNpdGlvbi1kZWxheTogMG1zO1xuICAgICAgcG9pbnRlci1ldmVudHM6IGF1dG87XG4gICAgICAke3RyYW5zZm9ybUNTU31cbiAgICB9XG4gIGA7XHJcbn07XHJcbi8vIyBzb3VyY2VNYXBwaW5nVVJMPXN0eWxlcy5qcy5tYXAiXX0= */",
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__$3
};
var _ref3 = false ? {
  name: "140uilo",
  styles: "transform:translateY(calc(-1 * var(--popover-animation-distance)))"
} : {
  name: "6jbhyk-transformCSS",
  styles: "transform:translateY(calc(-1 * var(--popover-animation-distance)));label:transformCSS;",
  map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0eWxlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFXK0IiLCJmaWxlIjoic3R5bGVzLnRzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgY3NzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xyXG5pbXBvcnQgdGhlbWUgZnJvbSAnLi4vdGhlbWUnO1xyXG5leHBvcnQgY29uc3QgcG9wb3ZlckNTUyA9ICh7IHBsYWNlbWVudCB9KSA9PiB7XHJcbiAgICBsZXQgdHJhbnNmb3JtQ1NTID0gY3NzIGBgO1xyXG4gICAgc3dpdGNoIChwbGFjZW1lbnQpIHtcclxuICAgICAgICBjYXNlICdib3R0b20nOlxyXG4gICAgICAgICAgICB0cmFuc2Zvcm1DU1MgPSBjc3MgYFxuICAgICAgICB0cmFuc2Zvcm06IHRyYW5zbGF0ZVkodmFyKC0tcG9wb3Zlci1hbmltYXRpb24tZGlzdGFuY2UpKTtcbiAgICAgIGA7XHJcbiAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgIGNhc2UgJ3RvcCc6XHJcbiAgICAgICAgICAgIHRyYW5zZm9ybUNTUyA9IGNzcyBgXG4gICAgICAgIHRyYW5zZm9ybTogdHJhbnNsYXRlWShjYWxjKC0xICogdmFyKC0tcG9wb3Zlci1hbmltYXRpb24tZGlzdGFuY2UpKSk7XG4gICAgICBgO1xyXG4gICAgICAgICAgICBicmVhaztcclxuICAgICAgICBjYXNlICdsZWZ0JzpcclxuICAgICAgICAgICAgdHJhbnNmb3JtQ1NTID0gY3NzIGBcbiAgICAgICAgdHJhbnNmb3JtOiB0cmFuc2xhdGVYKGNhbGMoLTEgKiB2YXIoLS1wb3BvdmVyLWFuaW1hdGlvbi1kaXN0YW5jZSkpKTtcbiAgICAgIGA7XHJcbiAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgIGNhc2UgJ3JpZ2h0JzpcclxuICAgICAgICAgICAgdHJhbnNmb3JtQ1NTID0gY3NzIGBcbiAgICAgICAgdHJhbnNmb3JtOiB0cmFuc2xhdGVYKHZhcigtLXBvcG92ZXItYW5pbWF0aW9uLWRpc3RhbmNlKSk7XG4gICAgICBgO1xyXG4gICAgICAgICAgICBicmVhaztcclxuICAgIH1cclxuICAgIHJldHVybiBjc3MgYFxuICAgIC0tcG9wb3Zlci1hbmltYXRpb24tZGlzdGFuY2U6ICR7dGhlbWUuc3BhY2luZy5wb3BvdmVyLm9mZnNldH1weDtcbiAgICBvdXRsaW5lOiBub25lOyAvKiBIaWRlIGZvY3VzIG91dGxpbmUgKi9cbiAgICB2aXNpYmlsaXR5OiBoaWRkZW47XG4gICAgb3BhY2l0eTogMDtcbiAgICB0cmFuc2l0aW9uOiB0cmFuc2Zvcm0gMTAwbXMgZWFzZS1pbi1vdXQsIG9wYWNpdHkgMTAwbXMgZWFzZS1pbi1vdXQsXG4gICAgICB2aXNpYmlsaXR5IDEwMG1zIGxpbmVhciAxMDBtcztcbiAgICBwb2ludGVyLWV2ZW50czogbm9uZTtcbiAgICAmLmlzLW9wZW4ge1xuICAgICAgdmlzaWJpbGl0eTogdmlzaWJsZTtcbiAgICAgIG9wYWNpdHk6IDE7XG4gICAgICB0cmFuc2l0aW9uLWRlbGF5OiAwbXM7XG4gICAgICBwb2ludGVyLWV2ZW50czogYXV0bztcbiAgICAgICR7dHJhbnNmb3JtQ1NTfVxuICAgIH1cbiAgYDtcclxufTtcclxuLy8jIHNvdXJjZU1hcHBpbmdVUkw9c3R5bGVzLmpzLm1hcCJdfQ== */",
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__$3
};
var _ref4 = false ? {
  name: "1lkjamn",
  styles: "transform:translateY(var(--popover-animation-distance))"
} : {
  name: "63e0jg-transformCSS",
  styles: "transform:translateY(var(--popover-animation-distance));label:transformCSS;",
  map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0eWxlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFNK0IiLCJmaWxlIjoic3R5bGVzLnRzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgY3NzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xyXG5pbXBvcnQgdGhlbWUgZnJvbSAnLi4vdGhlbWUnO1xyXG5leHBvcnQgY29uc3QgcG9wb3ZlckNTUyA9ICh7IHBsYWNlbWVudCB9KSA9PiB7XHJcbiAgICBsZXQgdHJhbnNmb3JtQ1NTID0gY3NzIGBgO1xyXG4gICAgc3dpdGNoIChwbGFjZW1lbnQpIHtcclxuICAgICAgICBjYXNlICdib3R0b20nOlxyXG4gICAgICAgICAgICB0cmFuc2Zvcm1DU1MgPSBjc3MgYFxuICAgICAgICB0cmFuc2Zvcm06IHRyYW5zbGF0ZVkodmFyKC0tcG9wb3Zlci1hbmltYXRpb24tZGlzdGFuY2UpKTtcbiAgICAgIGA7XHJcbiAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgIGNhc2UgJ3RvcCc6XHJcbiAgICAgICAgICAgIHRyYW5zZm9ybUNTUyA9IGNzcyBgXG4gICAgICAgIHRyYW5zZm9ybTogdHJhbnNsYXRlWShjYWxjKC0xICogdmFyKC0tcG9wb3Zlci1hbmltYXRpb24tZGlzdGFuY2UpKSk7XG4gICAgICBgO1xyXG4gICAgICAgICAgICBicmVhaztcclxuICAgICAgICBjYXNlICdsZWZ0JzpcclxuICAgICAgICAgICAgdHJhbnNmb3JtQ1NTID0gY3NzIGBcbiAgICAgICAgdHJhbnNmb3JtOiB0cmFuc2xhdGVYKGNhbGMoLTEgKiB2YXIoLS1wb3BvdmVyLWFuaW1hdGlvbi1kaXN0YW5jZSkpKTtcbiAgICAgIGA7XHJcbiAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgIGNhc2UgJ3JpZ2h0JzpcclxuICAgICAgICAgICAgdHJhbnNmb3JtQ1NTID0gY3NzIGBcbiAgICAgICAgdHJhbnNmb3JtOiB0cmFuc2xhdGVYKHZhcigtLXBvcG92ZXItYW5pbWF0aW9uLWRpc3RhbmNlKSk7XG4gICAgICBgO1xyXG4gICAgICAgICAgICBicmVhaztcclxuICAgIH1cclxuICAgIHJldHVybiBjc3MgYFxuICAgIC0tcG9wb3Zlci1hbmltYXRpb24tZGlzdGFuY2U6ICR7dGhlbWUuc3BhY2luZy5wb3BvdmVyLm9mZnNldH1weDtcbiAgICBvdXRsaW5lOiBub25lOyAvKiBIaWRlIGZvY3VzIG91dGxpbmUgKi9cbiAgICB2aXNpYmlsaXR5OiBoaWRkZW47XG4gICAgb3BhY2l0eTogMDtcbiAgICB0cmFuc2l0aW9uOiB0cmFuc2Zvcm0gMTAwbXMgZWFzZS1pbi1vdXQsIG9wYWNpdHkgMTAwbXMgZWFzZS1pbi1vdXQsXG4gICAgICB2aXNpYmlsaXR5IDEwMG1zIGxpbmVhciAxMDBtcztcbiAgICBwb2ludGVyLWV2ZW50czogbm9uZTtcbiAgICAmLmlzLW9wZW4ge1xuICAgICAgdmlzaWJpbGl0eTogdmlzaWJsZTtcbiAgICAgIG9wYWNpdHk6IDE7XG4gICAgICB0cmFuc2l0aW9uLWRlbGF5OiAwbXM7XG4gICAgICBwb2ludGVyLWV2ZW50czogYXV0bztcbiAgICAgICR7dHJhbnNmb3JtQ1NTfVxuICAgIH1cbiAgYDtcclxufTtcclxuLy8jIHNvdXJjZU1hcHBpbmdVUkw9c3R5bGVzLmpzLm1hcCJdfQ== */",
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__$3
};
var popoverCSS = function popoverCSS2(_ref52) {
  var placement = _ref52.placement;
  var transformCSS = /* @__PURE__ */ css(false ? "" : ";label:transformCSS;", false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0eWxlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFHMkIiLCJmaWxlIjoic3R5bGVzLnRzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgY3NzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xyXG5pbXBvcnQgdGhlbWUgZnJvbSAnLi4vdGhlbWUnO1xyXG5leHBvcnQgY29uc3QgcG9wb3ZlckNTUyA9ICh7IHBsYWNlbWVudCB9KSA9PiB7XHJcbiAgICBsZXQgdHJhbnNmb3JtQ1NTID0gY3NzIGBgO1xyXG4gICAgc3dpdGNoIChwbGFjZW1lbnQpIHtcclxuICAgICAgICBjYXNlICdib3R0b20nOlxyXG4gICAgICAgICAgICB0cmFuc2Zvcm1DU1MgPSBjc3MgYFxuICAgICAgICB0cmFuc2Zvcm06IHRyYW5zbGF0ZVkodmFyKC0tcG9wb3Zlci1hbmltYXRpb24tZGlzdGFuY2UpKTtcbiAgICAgIGA7XHJcbiAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgIGNhc2UgJ3RvcCc6XHJcbiAgICAgICAgICAgIHRyYW5zZm9ybUNTUyA9IGNzcyBgXG4gICAgICAgIHRyYW5zZm9ybTogdHJhbnNsYXRlWShjYWxjKC0xICogdmFyKC0tcG9wb3Zlci1hbmltYXRpb24tZGlzdGFuY2UpKSk7XG4gICAgICBgO1xyXG4gICAgICAgICAgICBicmVhaztcclxuICAgICAgICBjYXNlICdsZWZ0JzpcclxuICAgICAgICAgICAgdHJhbnNmb3JtQ1NTID0gY3NzIGBcbiAgICAgICAgdHJhbnNmb3JtOiB0cmFuc2xhdGVYKGNhbGMoLTEgKiB2YXIoLS1wb3BvdmVyLWFuaW1hdGlvbi1kaXN0YW5jZSkpKTtcbiAgICAgIGA7XHJcbiAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgIGNhc2UgJ3JpZ2h0JzpcclxuICAgICAgICAgICAgdHJhbnNmb3JtQ1NTID0gY3NzIGBcbiAgICAgICAgdHJhbnNmb3JtOiB0cmFuc2xhdGVYKHZhcigtLXBvcG92ZXItYW5pbWF0aW9uLWRpc3RhbmNlKSk7XG4gICAgICBgO1xyXG4gICAgICAgICAgICBicmVhaztcclxuICAgIH1cclxuICAgIHJldHVybiBjc3MgYFxuICAgIC0tcG9wb3Zlci1hbmltYXRpb24tZGlzdGFuY2U6ICR7dGhlbWUuc3BhY2luZy5wb3BvdmVyLm9mZnNldH1weDtcbiAgICBvdXRsaW5lOiBub25lOyAvKiBIaWRlIGZvY3VzIG91dGxpbmUgKi9cbiAgICB2aXNpYmlsaXR5OiBoaWRkZW47XG4gICAgb3BhY2l0eTogMDtcbiAgICB0cmFuc2l0aW9uOiB0cmFuc2Zvcm0gMTAwbXMgZWFzZS1pbi1vdXQsIG9wYWNpdHkgMTAwbXMgZWFzZS1pbi1vdXQsXG4gICAgICB2aXNpYmlsaXR5IDEwMG1zIGxpbmVhciAxMDBtcztcbiAgICBwb2ludGVyLWV2ZW50czogbm9uZTtcbiAgICAmLmlzLW9wZW4ge1xuICAgICAgdmlzaWJpbGl0eTogdmlzaWJsZTtcbiAgICAgIG9wYWNpdHk6IDE7XG4gICAgICB0cmFuc2l0aW9uLWRlbGF5OiAwbXM7XG4gICAgICBwb2ludGVyLWV2ZW50czogYXV0bztcbiAgICAgICR7dHJhbnNmb3JtQ1NTfVxuICAgIH1cbiAgYDtcclxufTtcclxuLy8jIHNvdXJjZU1hcHBpbmdVUkw9c3R5bGVzLmpzLm1hcCJdfQ== */");
  switch (placement) {
    case "bottom":
      transformCSS = _ref4;
      break;
    case "top":
      transformCSS = _ref3;
      break;
    case "left":
      transformCSS = _ref2;
      break;
    case "right":
      transformCSS = _ref;
      break;
  }
  return /* @__PURE__ */ css("--popover-animation-distance:", theme.spacing.popover.offset, "px;outline:none;visibility:hidden;opacity:0;transition:transform 100ms ease-in-out,opacity 100ms ease-in-out,visibility 100ms linear 100ms;pointer-events:none;&.is-open{visibility:visible;opacity:1;transition-delay:0ms;pointer-events:auto;", transformCSS, ";}" + (false ? "" : ";label:popoverCSS;"), false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0eWxlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUEwQmUiLCJmaWxlIjoic3R5bGVzLnRzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgY3NzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xyXG5pbXBvcnQgdGhlbWUgZnJvbSAnLi4vdGhlbWUnO1xyXG5leHBvcnQgY29uc3QgcG9wb3ZlckNTUyA9ICh7IHBsYWNlbWVudCB9KSA9PiB7XHJcbiAgICBsZXQgdHJhbnNmb3JtQ1NTID0gY3NzIGBgO1xyXG4gICAgc3dpdGNoIChwbGFjZW1lbnQpIHtcclxuICAgICAgICBjYXNlICdib3R0b20nOlxyXG4gICAgICAgICAgICB0cmFuc2Zvcm1DU1MgPSBjc3MgYFxuICAgICAgICB0cmFuc2Zvcm06IHRyYW5zbGF0ZVkodmFyKC0tcG9wb3Zlci1hbmltYXRpb24tZGlzdGFuY2UpKTtcbiAgICAgIGA7XHJcbiAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgIGNhc2UgJ3RvcCc6XHJcbiAgICAgICAgICAgIHRyYW5zZm9ybUNTUyA9IGNzcyBgXG4gICAgICAgIHRyYW5zZm9ybTogdHJhbnNsYXRlWShjYWxjKC0xICogdmFyKC0tcG9wb3Zlci1hbmltYXRpb24tZGlzdGFuY2UpKSk7XG4gICAgICBgO1xyXG4gICAgICAgICAgICBicmVhaztcclxuICAgICAgICBjYXNlICdsZWZ0JzpcclxuICAgICAgICAgICAgdHJhbnNmb3JtQ1NTID0gY3NzIGBcbiAgICAgICAgdHJhbnNmb3JtOiB0cmFuc2xhdGVYKGNhbGMoLTEgKiB2YXIoLS1wb3BvdmVyLWFuaW1hdGlvbi1kaXN0YW5jZSkpKTtcbiAgICAgIGA7XHJcbiAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgIGNhc2UgJ3JpZ2h0JzpcclxuICAgICAgICAgICAgdHJhbnNmb3JtQ1NTID0gY3NzIGBcbiAgICAgICAgdHJhbnNmb3JtOiB0cmFuc2xhdGVYKHZhcigtLXBvcG92ZXItYW5pbWF0aW9uLWRpc3RhbmNlKSk7XG4gICAgICBgO1xyXG4gICAgICAgICAgICBicmVhaztcclxuICAgIH1cclxuICAgIHJldHVybiBjc3MgYFxuICAgIC0tcG9wb3Zlci1hbmltYXRpb24tZGlzdGFuY2U6ICR7dGhlbWUuc3BhY2luZy5wb3BvdmVyLm9mZnNldH1weDtcbiAgICBvdXRsaW5lOiBub25lOyAvKiBIaWRlIGZvY3VzIG91dGxpbmUgKi9cbiAgICB2aXNpYmlsaXR5OiBoaWRkZW47XG4gICAgb3BhY2l0eTogMDtcbiAgICB0cmFuc2l0aW9uOiB0cmFuc2Zvcm0gMTAwbXMgZWFzZS1pbi1vdXQsIG9wYWNpdHkgMTAwbXMgZWFzZS1pbi1vdXQsXG4gICAgICB2aXNpYmlsaXR5IDEwMG1zIGxpbmVhciAxMDBtcztcbiAgICBwb2ludGVyLWV2ZW50czogbm9uZTtcbiAgICAmLmlzLW9wZW4ge1xuICAgICAgdmlzaWJpbGl0eTogdmlzaWJsZTtcbiAgICAgIG9wYWNpdHk6IDE7XG4gICAgICB0cmFuc2l0aW9uLWRlbGF5OiAwbXM7XG4gICAgICBwb2ludGVyLWV2ZW50czogYXV0bztcbiAgICAgICR7dHJhbnNmb3JtQ1NTfVxuICAgIH1cbiAgYDtcclxufTtcclxuLy8jIHNvdXJjZU1hcHBpbmdVUkw9c3R5bGVzLmpzLm1hcCJdfQ== */");
};
var _excluded$2 = ["placement", "children", "isOpen", "onClose", "shouldCloseOnBlur", "style"];
function Popover(props, ref) {
  var _props$placement = props.placement, placement = _props$placement === void 0 ? "bottom" : _props$placement, children = props.children, _props$isOpen = props.isOpen, isOpen = _props$isOpen === void 0 ? false : _props$isOpen, onClose = props.onClose, _props$shouldCloseOnB = props.shouldCloseOnBlur, shouldCloseOnBlur = _props$shouldCloseOnB === void 0 ? true : _props$shouldCloseOnB, style = props.style, otherProps = _objectWithoutPropertiesLoose2(props, _excluded$2);
  var domRef = useDOMRef(ref);
  var _useOverlay = $a11501f3d1d39e6c$export$ea8f71083e90600f({
    onClose,
    isOpen,
    shouldCloseOnBlur,
    isDismissable: true
  }, domRef), overlayProps = _useOverlay.overlayProps;
  var _useModal = $f57aed4a881a3485$export$33ffd74ebf07f060(), modalProps = _useModal.modalProps;
  var _useDialog = $40df3f8667284809$export$d55e7ee900f34e93({}, domRef), dialogProps = _useDialog.dialogProps;
  return jsx(Overlay, {
    isOpen
  }, jsx($9bf71ea28793e738$export$20e40289641fbbb6, {
    restoreFocus: true,
    autoFocus: true
  }, jsx("div", _extends2({}, $3ef42575df84b30b$export$9d1611c77c2fe928(overlayProps, otherProps, dialogProps, modalProps), {
    ref: domRef,
    style,
    className: clsx_m_default("ac-popover", "ac-popover--" + placement, {
      "is-open": isOpen
    }),
    css: popoverCSS({
      placement
    }),
    "data-testid": "popover",
    "data-is-open": isOpen,
    tabIndex: 0
  }), children)));
}
var _Popover = /* @__PURE__ */ (0, import_react35.forwardRef)(Popover);
function PopoverTrigger(props) {
  var children = props.children;
  if (!Array.isArray(children) || children.length > 2) {
    throw new Error("PopoverTrigger must have exactly 2 children");
  }
  var trigger = children[0], content2 = children[1];
  var state = $fc909762b330b746$export$61c6a8c84e605fb6(props);
  var triggerRef = (0, import_react35.useRef)(null);
  var overlayRef = (0, import_react35.useRef)(null);
  var _useOverlayPosition = $2a41e45df1593e64$export$d39e1813b3bdd0e1({
    targetRef: triggerRef,
    overlayRef: unwrapDOMRef(overlayRef),
    placement: props.placement,
    isOpen: state.isOpen
  }), popoverProps = _useOverlayPosition.overlayProps, placement = _useOverlayPosition.placement;
  var _useOverlayTrigger = $628037886ba31236$export$f9d5c8beee7d008d({
    type: "dialog"
  }, state, triggerRef), triggerProps = _useOverlayTrigger.triggerProps;
  var triggerPropsWithRef = _extends2({}, triggerProps, {
    ref: triggerRef
  });
  var overlay = jsx(_Popover, _extends2({
    isOpen: state.isOpen,
    ref: overlayRef,
    onClose: state.close,
    placement
  }, popoverProps), typeof content2 === "function" ? content2(state.close) : content2);
  return jsx(PopoverTriggerBase, {
    state,
    triggerProps: triggerPropsWithRef,
    trigger,
    overlay
  });
}
function PopoverTriggerBase(_ref18) {
  var state = _ref18.state, _ref$triggerProps = _ref18.triggerProps, triggerProps = _ref$triggerProps === void 0 ? {} : _ref$triggerProps, overlay = _ref18.overlay, trigger = _ref18.trigger;
  return jsx(import_react35.default.Fragment, null, jsx($f1ab8c75478c6f73$export$3351871ee4b288b8, _extends2({}, triggerProps, {
    onPress: function onPress() {
      state.toggle();
    },
    isPressed: state.isOpen
  }), trigger), overlay);
}
var _excluded$3 = ["children", "level", "weight"];
function _EMOTION_STRINGIFIED_CSS_ERROR__$4() {
  return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
}
var _theme$typography = theme.typography;
var sizes = _theme$typography.sizes;
var weights = _theme$typography.weights;
var headingCSS = false ? {
  name: "9u781w",
  styles: "margin:0;color:var(--ac-global-text-color-900)"
} : {
  name: "1grwxus-headingCSS",
  styles: "margin:0;color:var(--ac-global-text-color-900);label:headingCSS;",
  map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkhlYWRpbmcudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUt1QiIsImZpbGUiOiJIZWFkaW5nLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBSZWFjdCwgeyBmb3J3YXJkUmVmIH0gZnJvbSAncmVhY3QnO1xyXG5pbXBvcnQgeyBjc3MgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XHJcbmltcG9ydCB7IHVzZURPTVJlZiB9IGZyb20gJy4uL3V0aWxzL3VzZURPTVJlZic7XHJcbmltcG9ydCB0aGVtZSBmcm9tICcuLi90aGVtZSc7XHJcbmNvbnN0IHsgdHlwb2dyYXBoeTogeyBzaXplcywgd2VpZ2h0cyB9LCB9ID0gdGhlbWU7XHJcbmNvbnN0IGhlYWRpbmdDU1MgPSBjc3MgYFxuICAvKiBkZWZhdWx0IHRvIG5vIG1hcmdpbiAqL1xuICBtYXJnaW46IDA7XG4gIGNvbG9yOiB2YXIoLS1hYy1nbG9iYWwtdGV4dC1jb2xvci05MDApO1xuYDtcclxuY29uc3QgaGVhZGluZ1NpemVDU1MgPSAobGV2ZWwpID0+IHtcclxuICAgIHN3aXRjaCAobGV2ZWwpIHtcclxuICAgICAgICBjYXNlIDE6IHtcclxuICAgICAgICAgICAgcmV0dXJuIGNzcyBgXG4gICAgICAgIGZvbnQtc2l6ZTogJHtzaXplcy54eGxhcmdlLmZvbnRTaXplfXB4O1xuICAgICAgICBsaW5lLWhlaWdodDogJHtzaXplcy54eGxhcmdlLmxpbmVIZWlnaHR9cHg7XG4gICAgICBgO1xyXG4gICAgICAgIH1cclxuICAgICAgICBjYXNlIDI6IHtcclxuICAgICAgICAgICAgcmV0dXJuIGNzcyBgXG4gICAgICAgIGZvbnQtc2l6ZTogJHtzaXplcy54bGFyZ2UuZm9udFNpemV9cHg7XG4gICAgICAgIGxpbmUtaGVpZ2h0OiAke3NpemVzLnhsYXJnZS5saW5lSGVpZ2h0fXB4O1xuICAgICAgYDtcclxuICAgICAgICB9XHJcbiAgICAgICAgY2FzZSAzOiB7XHJcbiAgICAgICAgICAgIHJldHVybiBjc3MgYFxuICAgICAgICBmb250LXNpemU6ICR7c2l6ZXMubGFyZ2UuZm9udFNpemV9cHg7XG4gICAgICAgIGxpbmUtaGVpZ2h0OiAke3NpemVzLmxhcmdlLmxpbmVIZWlnaHR9cHg7XG4gICAgICBgO1xyXG4gICAgICAgIH1cclxuICAgICAgICBjYXNlIDQ6IHtcclxuICAgICAgICAgICAgcmV0dXJuIGNzcyBgXG4gICAgICAgIGZvbnQtc2l6ZTogJHtzaXplcy5tZWRpdW0uZm9udFNpemV9cHg7XG4gICAgICAgIGxpbmUtaGVpZ2h0OiAke3NpemVzLm1lZGl1bS5saW5lSGVpZ2h0fXB4O1xuICAgICAgYDtcclxuICAgICAgICB9XHJcbiAgICAgICAgY2FzZSA1OiB7XHJcbiAgICAgICAgICAgIHJldHVybiBjc3MgYFxuICAgICAgICBmb250LXNpemU6ICR7c2l6ZXMuc21hbGwuZm9udFNpemV9cHg7XG4gICAgICAgIGxpbmUtaGVpZ2h0OiAke3NpemVzLnNtYWxsLmxpbmVIZWlnaHR9cHg7XG4gICAgICBgO1xyXG4gICAgICAgIH1cclxuICAgICAgICBjYXNlIDY6IHtcclxuICAgICAgICAgICAgcmV0dXJuIGNzcyBgXG4gICAgICAgIGZvbnQtc2l6ZTogJHtzaXplcy54c21hbGwuZm9udFNpemV9cHg7XG4gICAgICAgIGxpbmUtaGVpZ2h0OiAke3NpemVzLnhzbWFsbC5saW5lSGVpZ2h0fXB4O1xuICAgICAgYDtcclxuICAgICAgICB9XHJcbiAgICAgICAgZGVmYXVsdDoge1xyXG4gICAgICAgICAgICByZXR1cm4gY3NzIGBgO1xyXG4gICAgICAgIH1cclxuICAgIH1cclxufTtcclxuY29uc3QgaGVhZGluZ1dlaWdodENTUyA9ICh3ZWlnaHQpID0+IGNzcyBgXG4gIGZvbnQtd2VpZ2h0OiAke3dlaWdodCA9PT0gJ2hlYXZ5JyA/IHdlaWdodHMuaGVhdnkgOiB3ZWlnaHRzLm5vcm1hbH07XG5gO1xyXG4vKipcclxuICogSGVhZGluZyBpcyB1c2VkIHRvIGNyZWF0ZSB2YXJpb3VzIGxldmVscyBvZiB0eXBvZ3JhcGhpYyBoaWVyYXJjaGllcy5cclxuICovXHJcbmZ1bmN0aW9uIEhlYWRpbmcocHJvcHMsIHJlZikge1xyXG4gICAgY29uc3QgeyBjaGlsZHJlbiwgbGV2ZWwgPSAzLCB3ZWlnaHQgPSAnbm9ybWFsJywgLi4ub3RoZXJQcm9wcyB9ID0gcHJvcHM7XHJcbiAgICBjb25zdCBIZWFkaW5nVGFnID0gYGgke2xldmVsfWA7XHJcbiAgICBjb25zdCBkb21SZWYgPSB1c2VET01SZWYocmVmKTtcclxuICAgIHJldHVybiAoPEhlYWRpbmdUYWcgey4uLm90aGVyUHJvcHN9IGNzcz17Y3NzKGhlYWRpbmdDU1MsIGhlYWRpbmdTaXplQ1NTKGxldmVsKSwgaGVhZGluZ1dlaWdodENTUyh3ZWlnaHQpKX0gcmVmPXtkb21SZWZ9PlxuICAgICAge2NoaWxkcmVufVxuICAgIDwvSGVhZGluZ1RhZz4pO1xyXG59XHJcbmNvbnN0IF9IZWFkaW5nID0gZm9yd2FyZFJlZihIZWFkaW5nKTtcclxuZXhwb3J0IHsgX0hlYWRpbmcgYXMgSGVhZGluZyB9O1xyXG4vLyMgc291cmNlTWFwcGluZ1VSTD1IZWFkaW5nLmpzeC5tYXAiXX0= */",
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__$4
};
var headingSizeCSS = function headingSizeCSS2(level) {
  switch (level) {
    case 1: {
      return /* @__PURE__ */ css("font-size:", sizes.xxlarge.fontSize, "px;line-height:", sizes.xxlarge.lineHeight, "px;" + (false ? "" : ";label:headingSizeCSS;"), false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkhlYWRpbmcudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQWF1QiIsImZpbGUiOiJIZWFkaW5nLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBSZWFjdCwgeyBmb3J3YXJkUmVmIH0gZnJvbSAncmVhY3QnO1xyXG5pbXBvcnQgeyBjc3MgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XHJcbmltcG9ydCB7IHVzZURPTVJlZiB9IGZyb20gJy4uL3V0aWxzL3VzZURPTVJlZic7XHJcbmltcG9ydCB0aGVtZSBmcm9tICcuLi90aGVtZSc7XHJcbmNvbnN0IHsgdHlwb2dyYXBoeTogeyBzaXplcywgd2VpZ2h0cyB9LCB9ID0gdGhlbWU7XHJcbmNvbnN0IGhlYWRpbmdDU1MgPSBjc3MgYFxuICAvKiBkZWZhdWx0IHRvIG5vIG1hcmdpbiAqL1xuICBtYXJnaW46IDA7XG4gIGNvbG9yOiB2YXIoLS1hYy1nbG9iYWwtdGV4dC1jb2xvci05MDApO1xuYDtcclxuY29uc3QgaGVhZGluZ1NpemVDU1MgPSAobGV2ZWwpID0+IHtcclxuICAgIHN3aXRjaCAobGV2ZWwpIHtcclxuICAgICAgICBjYXNlIDE6IHtcclxuICAgICAgICAgICAgcmV0dXJuIGNzcyBgXG4gICAgICAgIGZvbnQtc2l6ZTogJHtzaXplcy54eGxhcmdlLmZvbnRTaXplfXB4O1xuICAgICAgICBsaW5lLWhlaWdodDogJHtzaXplcy54eGxhcmdlLmxpbmVIZWlnaHR9cHg7XG4gICAgICBgO1xyXG4gICAgICAgIH1cclxuICAgICAgICBjYXNlIDI6IHtcclxuICAgICAgICAgICAgcmV0dXJuIGNzcyBgXG4gICAgICAgIGZvbnQtc2l6ZTogJHtzaXplcy54bGFyZ2UuZm9udFNpemV9cHg7XG4gICAgICAgIGxpbmUtaGVpZ2h0OiAke3NpemVzLnhsYXJnZS5saW5lSGVpZ2h0fXB4O1xuICAgICAgYDtcclxuICAgICAgICB9XHJcbiAgICAgICAgY2FzZSAzOiB7XHJcbiAgICAgICAgICAgIHJldHVybiBjc3MgYFxuICAgICAgICBmb250LXNpemU6ICR7c2l6ZXMubGFyZ2UuZm9udFNpemV9cHg7XG4gICAgICAgIGxpbmUtaGVpZ2h0OiAke3NpemVzLmxhcmdlLmxpbmVIZWlnaHR9cHg7XG4gICAgICBgO1xyXG4gICAgICAgIH1cclxuICAgICAgICBjYXNlIDQ6IHtcclxuICAgICAgICAgICAgcmV0dXJuIGNzcyBgXG4gICAgICAgIGZvbnQtc2l6ZTogJHtzaXplcy5tZWRpdW0uZm9udFNpemV9cHg7XG4gICAgICAgIGxpbmUtaGVpZ2h0OiAke3NpemVzLm1lZGl1bS5saW5lSGVpZ2h0fXB4O1xuICAgICAgYDtcclxuICAgICAgICB9XHJcbiAgICAgICAgY2FzZSA1OiB7XHJcbiAgICAgICAgICAgIHJldHVybiBjc3MgYFxuICAgICAgICBmb250LXNpemU6ICR7c2l6ZXMuc21hbGwuZm9udFNpemV9cHg7XG4gICAgICAgIGxpbmUtaGVpZ2h0OiAke3NpemVzLnNtYWxsLmxpbmVIZWlnaHR9cHg7XG4gICAgICBgO1xyXG4gICAgICAgIH1cclxuICAgICAgICBjYXNlIDY6IHtcclxuICAgICAgICAgICAgcmV0dXJuIGNzcyBgXG4gICAgICAgIGZvbnQtc2l6ZTogJHtzaXplcy54c21hbGwuZm9udFNpemV9cHg7XG4gICAgICAgIGxpbmUtaGVpZ2h0OiAke3NpemVzLnhzbWFsbC5saW5lSGVpZ2h0fXB4O1xuICAgICAgYDtcclxuICAgICAgICB9XHJcbiAgICAgICAgZGVmYXVsdDoge1xyXG4gICAgICAgICAgICByZXR1cm4gY3NzIGBgO1xyXG4gICAgICAgIH1cclxuICAgIH1cclxufTtcclxuY29uc3QgaGVhZGluZ1dlaWdodENTUyA9ICh3ZWlnaHQpID0+IGNzcyBgXG4gIGZvbnQtd2VpZ2h0OiAke3dlaWdodCA9PT0gJ2hlYXZ5JyA/IHdlaWdodHMuaGVhdnkgOiB3ZWlnaHRzLm5vcm1hbH07XG5gO1xyXG4vKipcclxuICogSGVhZGluZyBpcyB1c2VkIHRvIGNyZWF0ZSB2YXJpb3VzIGxldmVscyBvZiB0eXBvZ3JhcGhpYyBoaWVyYXJjaGllcy5cclxuICovXHJcbmZ1bmN0aW9uIEhlYWRpbmcocHJvcHMsIHJlZikge1xyXG4gICAgY29uc3QgeyBjaGlsZHJlbiwgbGV2ZWwgPSAzLCB3ZWlnaHQgPSAnbm9ybWFsJywgLi4ub3RoZXJQcm9wcyB9ID0gcHJvcHM7XHJcbiAgICBjb25zdCBIZWFkaW5nVGFnID0gYGgke2xldmVsfWA7XHJcbiAgICBjb25zdCBkb21SZWYgPSB1c2VET01SZWYocmVmKTtcclxuICAgIHJldHVybiAoPEhlYWRpbmdUYWcgey4uLm90aGVyUHJvcHN9IGNzcz17Y3NzKGhlYWRpbmdDU1MsIGhlYWRpbmdTaXplQ1NTKGxldmVsKSwgaGVhZGluZ1dlaWdodENTUyh3ZWlnaHQpKX0gcmVmPXtkb21SZWZ9PlxuICAgICAge2NoaWxkcmVufVxuICAgIDwvSGVhZGluZ1RhZz4pO1xyXG59XHJcbmNvbnN0IF9IZWFkaW5nID0gZm9yd2FyZFJlZihIZWFkaW5nKTtcclxuZXhwb3J0IHsgX0hlYWRpbmcgYXMgSGVhZGluZyB9O1xyXG4vLyMgc291cmNlTWFwcGluZ1VSTD1IZWFkaW5nLmpzeC5tYXAiXX0= */");
    }
    case 2: {
      return /* @__PURE__ */ css("font-size:", sizes.xlarge.fontSize, "px;line-height:", sizes.xlarge.lineHeight, "px;" + (false ? "" : ";label:headingSizeCSS;"), false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkhlYWRpbmcudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQW1CdUIiLCJmaWxlIjoiSGVhZGluZy50c3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgUmVhY3QsIHsgZm9yd2FyZFJlZiB9IGZyb20gJ3JlYWN0JztcclxuaW1wb3J0IHsgY3NzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xyXG5pbXBvcnQgeyB1c2VET01SZWYgfSBmcm9tICcuLi91dGlscy91c2VET01SZWYnO1xyXG5pbXBvcnQgdGhlbWUgZnJvbSAnLi4vdGhlbWUnO1xyXG5jb25zdCB7IHR5cG9ncmFwaHk6IHsgc2l6ZXMsIHdlaWdodHMgfSwgfSA9IHRoZW1lO1xyXG5jb25zdCBoZWFkaW5nQ1NTID0gY3NzIGBcbiAgLyogZGVmYXVsdCB0byBubyBtYXJnaW4gKi9cbiAgbWFyZ2luOiAwO1xuICBjb2xvcjogdmFyKC0tYWMtZ2xvYmFsLXRleHQtY29sb3ItOTAwKTtcbmA7XHJcbmNvbnN0IGhlYWRpbmdTaXplQ1NTID0gKGxldmVsKSA9PiB7XHJcbiAgICBzd2l0Y2ggKGxldmVsKSB7XHJcbiAgICAgICAgY2FzZSAxOiB7XHJcbiAgICAgICAgICAgIHJldHVybiBjc3MgYFxuICAgICAgICBmb250LXNpemU6ICR7c2l6ZXMueHhsYXJnZS5mb250U2l6ZX1weDtcbiAgICAgICAgbGluZS1oZWlnaHQ6ICR7c2l6ZXMueHhsYXJnZS5saW5lSGVpZ2h0fXB4O1xuICAgICAgYDtcclxuICAgICAgICB9XHJcbiAgICAgICAgY2FzZSAyOiB7XHJcbiAgICAgICAgICAgIHJldHVybiBjc3MgYFxuICAgICAgICBmb250LXNpemU6ICR7c2l6ZXMueGxhcmdlLmZvbnRTaXplfXB4O1xuICAgICAgICBsaW5lLWhlaWdodDogJHtzaXplcy54bGFyZ2UubGluZUhlaWdodH1weDtcbiAgICAgIGA7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGNhc2UgMzoge1xyXG4gICAgICAgICAgICByZXR1cm4gY3NzIGBcbiAgICAgICAgZm9udC1zaXplOiAke3NpemVzLmxhcmdlLmZvbnRTaXplfXB4O1xuICAgICAgICBsaW5lLWhlaWdodDogJHtzaXplcy5sYXJnZS5saW5lSGVpZ2h0fXB4O1xuICAgICAgYDtcclxuICAgICAgICB9XHJcbiAgICAgICAgY2FzZSA0OiB7XHJcbiAgICAgICAgICAgIHJldHVybiBjc3MgYFxuICAgICAgICBmb250LXNpemU6ICR7c2l6ZXMubWVkaXVtLmZvbnRTaXplfXB4O1xuICAgICAgICBsaW5lLWhlaWdodDogJHtzaXplcy5tZWRpdW0ubGluZUhlaWdodH1weDtcbiAgICAgIGA7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGNhc2UgNToge1xyXG4gICAgICAgICAgICByZXR1cm4gY3NzIGBcbiAgICAgICAgZm9udC1zaXplOiAke3NpemVzLnNtYWxsLmZvbnRTaXplfXB4O1xuICAgICAgICBsaW5lLWhlaWdodDogJHtzaXplcy5zbWFsbC5saW5lSGVpZ2h0fXB4O1xuICAgICAgYDtcclxuICAgICAgICB9XHJcbiAgICAgICAgY2FzZSA2OiB7XHJcbiAgICAgICAgICAgIHJldHVybiBjc3MgYFxuICAgICAgICBmb250LXNpemU6ICR7c2l6ZXMueHNtYWxsLmZvbnRTaXplfXB4O1xuICAgICAgICBsaW5lLWhlaWdodDogJHtzaXplcy54c21hbGwubGluZUhlaWdodH1weDtcbiAgICAgIGA7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGRlZmF1bHQ6IHtcclxuICAgICAgICAgICAgcmV0dXJuIGNzcyBgYDtcclxuICAgICAgICB9XHJcbiAgICB9XHJcbn07XHJcbmNvbnN0IGhlYWRpbmdXZWlnaHRDU1MgPSAod2VpZ2h0KSA9PiBjc3MgYFxuICBmb250LXdlaWdodDogJHt3ZWlnaHQgPT09ICdoZWF2eScgPyB3ZWlnaHRzLmhlYXZ5IDogd2VpZ2h0cy5ub3JtYWx9O1xuYDtcclxuLyoqXHJcbiAqIEhlYWRpbmcgaXMgdXNlZCB0byBjcmVhdGUgdmFyaW91cyBsZXZlbHMgb2YgdHlwb2dyYXBoaWMgaGllcmFyY2hpZXMuXHJcbiAqL1xyXG5mdW5jdGlvbiBIZWFkaW5nKHByb3BzLCByZWYpIHtcclxuICAgIGNvbnN0IHsgY2hpbGRyZW4sIGxldmVsID0gMywgd2VpZ2h0ID0gJ25vcm1hbCcsIC4uLm90aGVyUHJvcHMgfSA9IHByb3BzO1xyXG4gICAgY29uc3QgSGVhZGluZ1RhZyA9IGBoJHtsZXZlbH1gO1xyXG4gICAgY29uc3QgZG9tUmVmID0gdXNlRE9NUmVmKHJlZik7XHJcbiAgICByZXR1cm4gKDxIZWFkaW5nVGFnIHsuLi5vdGhlclByb3BzfSBjc3M9e2NzcyhoZWFkaW5nQ1NTLCBoZWFkaW5nU2l6ZUNTUyhsZXZlbCksIGhlYWRpbmdXZWlnaHRDU1Mod2VpZ2h0KSl9IHJlZj17ZG9tUmVmfT5cbiAgICAgIHtjaGlsZHJlbn1cbiAgICA8L0hlYWRpbmdUYWc+KTtcclxufVxyXG5jb25zdCBfSGVhZGluZyA9IGZvcndhcmRSZWYoSGVhZGluZyk7XHJcbmV4cG9ydCB7IF9IZWFkaW5nIGFzIEhlYWRpbmcgfTtcclxuLy8jIHNvdXJjZU1hcHBpbmdVUkw9SGVhZGluZy5qc3gubWFwIl19 */");
    }
    case 3: {
      return /* @__PURE__ */ css("font-size:", sizes.large.fontSize, "px;line-height:", sizes.large.lineHeight, "px;" + (false ? "" : ";label:headingSizeCSS;"), false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkhlYWRpbmcudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXlCdUIiLCJmaWxlIjoiSGVhZGluZy50c3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgUmVhY3QsIHsgZm9yd2FyZFJlZiB9IGZyb20gJ3JlYWN0JztcclxuaW1wb3J0IHsgY3NzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xyXG5pbXBvcnQgeyB1c2VET01SZWYgfSBmcm9tICcuLi91dGlscy91c2VET01SZWYnO1xyXG5pbXBvcnQgdGhlbWUgZnJvbSAnLi4vdGhlbWUnO1xyXG5jb25zdCB7IHR5cG9ncmFwaHk6IHsgc2l6ZXMsIHdlaWdodHMgfSwgfSA9IHRoZW1lO1xyXG5jb25zdCBoZWFkaW5nQ1NTID0gY3NzIGBcbiAgLyogZGVmYXVsdCB0byBubyBtYXJnaW4gKi9cbiAgbWFyZ2luOiAwO1xuICBjb2xvcjogdmFyKC0tYWMtZ2xvYmFsLXRleHQtY29sb3ItOTAwKTtcbmA7XHJcbmNvbnN0IGhlYWRpbmdTaXplQ1NTID0gKGxldmVsKSA9PiB7XHJcbiAgICBzd2l0Y2ggKGxldmVsKSB7XHJcbiAgICAgICAgY2FzZSAxOiB7XHJcbiAgICAgICAgICAgIHJldHVybiBjc3MgYFxuICAgICAgICBmb250LXNpemU6ICR7c2l6ZXMueHhsYXJnZS5mb250U2l6ZX1weDtcbiAgICAgICAgbGluZS1oZWlnaHQ6ICR7c2l6ZXMueHhsYXJnZS5saW5lSGVpZ2h0fXB4O1xuICAgICAgYDtcclxuICAgICAgICB9XHJcbiAgICAgICAgY2FzZSAyOiB7XHJcbiAgICAgICAgICAgIHJldHVybiBjc3MgYFxuICAgICAgICBmb250LXNpemU6ICR7c2l6ZXMueGxhcmdlLmZvbnRTaXplfXB4O1xuICAgICAgICBsaW5lLWhlaWdodDogJHtzaXplcy54bGFyZ2UubGluZUhlaWdodH1weDtcbiAgICAgIGA7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGNhc2UgMzoge1xyXG4gICAgICAgICAgICByZXR1cm4gY3NzIGBcbiAgICAgICAgZm9udC1zaXplOiAke3NpemVzLmxhcmdlLmZvbnRTaXplfXB4O1xuICAgICAgICBsaW5lLWhlaWdodDogJHtzaXplcy5sYXJnZS5saW5lSGVpZ2h0fXB4O1xuICAgICAgYDtcclxuICAgICAgICB9XHJcbiAgICAgICAgY2FzZSA0OiB7XHJcbiAgICAgICAgICAgIHJldHVybiBjc3MgYFxuICAgICAgICBmb250LXNpemU6ICR7c2l6ZXMubWVkaXVtLmZvbnRTaXplfXB4O1xuICAgICAgICBsaW5lLWhlaWdodDogJHtzaXplcy5tZWRpdW0ubGluZUhlaWdodH1weDtcbiAgICAgIGA7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGNhc2UgNToge1xyXG4gICAgICAgICAgICByZXR1cm4gY3NzIGBcbiAgICAgICAgZm9udC1zaXplOiAke3NpemVzLnNtYWxsLmZvbnRTaXplfXB4O1xuICAgICAgICBsaW5lLWhlaWdodDogJHtzaXplcy5zbWFsbC5saW5lSGVpZ2h0fXB4O1xuICAgICAgYDtcclxuICAgICAgICB9XHJcbiAgICAgICAgY2FzZSA2OiB7XHJcbiAgICAgICAgICAgIHJldHVybiBjc3MgYFxuICAgICAgICBmb250LXNpemU6ICR7c2l6ZXMueHNtYWxsLmZvbnRTaXplfXB4O1xuICAgICAgICBsaW5lLWhlaWdodDogJHtzaXplcy54c21hbGwubGluZUhlaWdodH1weDtcbiAgICAgIGA7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGRlZmF1bHQ6IHtcclxuICAgICAgICAgICAgcmV0dXJuIGNzcyBgYDtcclxuICAgICAgICB9XHJcbiAgICB9XHJcbn07XHJcbmNvbnN0IGhlYWRpbmdXZWlnaHRDU1MgPSAod2VpZ2h0KSA9PiBjc3MgYFxuICBmb250LXdlaWdodDogJHt3ZWlnaHQgPT09ICdoZWF2eScgPyB3ZWlnaHRzLmhlYXZ5IDogd2VpZ2h0cy5ub3JtYWx9O1xuYDtcclxuLyoqXHJcbiAqIEhlYWRpbmcgaXMgdXNlZCB0byBjcmVhdGUgdmFyaW91cyBsZXZlbHMgb2YgdHlwb2dyYXBoaWMgaGllcmFyY2hpZXMuXHJcbiAqL1xyXG5mdW5jdGlvbiBIZWFkaW5nKHByb3BzLCByZWYpIHtcclxuICAgIGNvbnN0IHsgY2hpbGRyZW4sIGxldmVsID0gMywgd2VpZ2h0ID0gJ25vcm1hbCcsIC4uLm90aGVyUHJvcHMgfSA9IHByb3BzO1xyXG4gICAgY29uc3QgSGVhZGluZ1RhZyA9IGBoJHtsZXZlbH1gO1xyXG4gICAgY29uc3QgZG9tUmVmID0gdXNlRE9NUmVmKHJlZik7XHJcbiAgICByZXR1cm4gKDxIZWFkaW5nVGFnIHsuLi5vdGhlclByb3BzfSBjc3M9e2NzcyhoZWFkaW5nQ1NTLCBoZWFkaW5nU2l6ZUNTUyhsZXZlbCksIGhlYWRpbmdXZWlnaHRDU1Mod2VpZ2h0KSl9IHJlZj17ZG9tUmVmfT5cbiAgICAgIHtjaGlsZHJlbn1cbiAgICA8L0hlYWRpbmdUYWc+KTtcclxufVxyXG5jb25zdCBfSGVhZGluZyA9IGZvcndhcmRSZWYoSGVhZGluZyk7XHJcbmV4cG9ydCB7IF9IZWFkaW5nIGFzIEhlYWRpbmcgfTtcclxuLy8jIHNvdXJjZU1hcHBpbmdVUkw9SGVhZGluZy5qc3gubWFwIl19 */");
    }
    case 4: {
      return /* @__PURE__ */ css("font-size:", sizes.medium.fontSize, "px;line-height:", sizes.medium.lineHeight, "px;" + (false ? "" : ";label:headingSizeCSS;"), false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkhlYWRpbmcudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQStCdUIiLCJmaWxlIjoiSGVhZGluZy50c3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgUmVhY3QsIHsgZm9yd2FyZFJlZiB9IGZyb20gJ3JlYWN0JztcclxuaW1wb3J0IHsgY3NzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xyXG5pbXBvcnQgeyB1c2VET01SZWYgfSBmcm9tICcuLi91dGlscy91c2VET01SZWYnO1xyXG5pbXBvcnQgdGhlbWUgZnJvbSAnLi4vdGhlbWUnO1xyXG5jb25zdCB7IHR5cG9ncmFwaHk6IHsgc2l6ZXMsIHdlaWdodHMgfSwgfSA9IHRoZW1lO1xyXG5jb25zdCBoZWFkaW5nQ1NTID0gY3NzIGBcbiAgLyogZGVmYXVsdCB0byBubyBtYXJnaW4gKi9cbiAgbWFyZ2luOiAwO1xuICBjb2xvcjogdmFyKC0tYWMtZ2xvYmFsLXRleHQtY29sb3ItOTAwKTtcbmA7XHJcbmNvbnN0IGhlYWRpbmdTaXplQ1NTID0gKGxldmVsKSA9PiB7XHJcbiAgICBzd2l0Y2ggKGxldmVsKSB7XHJcbiAgICAgICAgY2FzZSAxOiB7XHJcbiAgICAgICAgICAgIHJldHVybiBjc3MgYFxuICAgICAgICBmb250LXNpemU6ICR7c2l6ZXMueHhsYXJnZS5mb250U2l6ZX1weDtcbiAgICAgICAgbGluZS1oZWlnaHQ6ICR7c2l6ZXMueHhsYXJnZS5saW5lSGVpZ2h0fXB4O1xuICAgICAgYDtcclxuICAgICAgICB9XHJcbiAgICAgICAgY2FzZSAyOiB7XHJcbiAgICAgICAgICAgIHJldHVybiBjc3MgYFxuICAgICAgICBmb250LXNpemU6ICR7c2l6ZXMueGxhcmdlLmZvbnRTaXplfXB4O1xuICAgICAgICBsaW5lLWhlaWdodDogJHtzaXplcy54bGFyZ2UubGluZUhlaWdodH1weDtcbiAgICAgIGA7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGNhc2UgMzoge1xyXG4gICAgICAgICAgICByZXR1cm4gY3NzIGBcbiAgICAgICAgZm9udC1zaXplOiAke3NpemVzLmxhcmdlLmZvbnRTaXplfXB4O1xuICAgICAgICBsaW5lLWhlaWdodDogJHtzaXplcy5sYXJnZS5saW5lSGVpZ2h0fXB4O1xuICAgICAgYDtcclxuICAgICAgICB9XHJcbiAgICAgICAgY2FzZSA0OiB7XHJcbiAgICAgICAgICAgIHJldHVybiBjc3MgYFxuICAgICAgICBmb250LXNpemU6ICR7c2l6ZXMubWVkaXVtLmZvbnRTaXplfXB4O1xuICAgICAgICBsaW5lLWhlaWdodDogJHtzaXplcy5tZWRpdW0ubGluZUhlaWdodH1weDtcbiAgICAgIGA7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGNhc2UgNToge1xyXG4gICAgICAgICAgICByZXR1cm4gY3NzIGBcbiAgICAgICAgZm9udC1zaXplOiAke3NpemVzLnNtYWxsLmZvbnRTaXplfXB4O1xuICAgICAgICBsaW5lLWhlaWdodDogJHtzaXplcy5zbWFsbC5saW5lSGVpZ2h0fXB4O1xuICAgICAgYDtcclxuICAgICAgICB9XHJcbiAgICAgICAgY2FzZSA2OiB7XHJcbiAgICAgICAgICAgIHJldHVybiBjc3MgYFxuICAgICAgICBmb250LXNpemU6ICR7c2l6ZXMueHNtYWxsLmZvbnRTaXplfXB4O1xuICAgICAgICBsaW5lLWhlaWdodDogJHtzaXplcy54c21hbGwubGluZUhlaWdodH1weDtcbiAgICAgIGA7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGRlZmF1bHQ6IHtcclxuICAgICAgICAgICAgcmV0dXJuIGNzcyBgYDtcclxuICAgICAgICB9XHJcbiAgICB9XHJcbn07XHJcbmNvbnN0IGhlYWRpbmdXZWlnaHRDU1MgPSAod2VpZ2h0KSA9PiBjc3MgYFxuICBmb250LXdlaWdodDogJHt3ZWlnaHQgPT09ICdoZWF2eScgPyB3ZWlnaHRzLmhlYXZ5IDogd2VpZ2h0cy5ub3JtYWx9O1xuYDtcclxuLyoqXHJcbiAqIEhlYWRpbmcgaXMgdXNlZCB0byBjcmVhdGUgdmFyaW91cyBsZXZlbHMgb2YgdHlwb2dyYXBoaWMgaGllcmFyY2hpZXMuXHJcbiAqL1xyXG5mdW5jdGlvbiBIZWFkaW5nKHByb3BzLCByZWYpIHtcclxuICAgIGNvbnN0IHsgY2hpbGRyZW4sIGxldmVsID0gMywgd2VpZ2h0ID0gJ25vcm1hbCcsIC4uLm90aGVyUHJvcHMgfSA9IHByb3BzO1xyXG4gICAgY29uc3QgSGVhZGluZ1RhZyA9IGBoJHtsZXZlbH1gO1xyXG4gICAgY29uc3QgZG9tUmVmID0gdXNlRE9NUmVmKHJlZik7XHJcbiAgICByZXR1cm4gKDxIZWFkaW5nVGFnIHsuLi5vdGhlclByb3BzfSBjc3M9e2NzcyhoZWFkaW5nQ1NTLCBoZWFkaW5nU2l6ZUNTUyhsZXZlbCksIGhlYWRpbmdXZWlnaHRDU1Mod2VpZ2h0KSl9IHJlZj17ZG9tUmVmfT5cbiAgICAgIHtjaGlsZHJlbn1cbiAgICA8L0hlYWRpbmdUYWc+KTtcclxufVxyXG5jb25zdCBfSGVhZGluZyA9IGZvcndhcmRSZWYoSGVhZGluZyk7XHJcbmV4cG9ydCB7IF9IZWFkaW5nIGFzIEhlYWRpbmcgfTtcclxuLy8jIHNvdXJjZU1hcHBpbmdVUkw9SGVhZGluZy5qc3gubWFwIl19 */");
    }
    case 5: {
      return /* @__PURE__ */ css("font-size:", sizes.small.fontSize, "px;line-height:", sizes.small.lineHeight, "px;" + (false ? "" : ";label:headingSizeCSS;"), false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkhlYWRpbmcudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXFDdUIiLCJmaWxlIjoiSGVhZGluZy50c3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgUmVhY3QsIHsgZm9yd2FyZFJlZiB9IGZyb20gJ3JlYWN0JztcclxuaW1wb3J0IHsgY3NzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xyXG5pbXBvcnQgeyB1c2VET01SZWYgfSBmcm9tICcuLi91dGlscy91c2VET01SZWYnO1xyXG5pbXBvcnQgdGhlbWUgZnJvbSAnLi4vdGhlbWUnO1xyXG5jb25zdCB7IHR5cG9ncmFwaHk6IHsgc2l6ZXMsIHdlaWdodHMgfSwgfSA9IHRoZW1lO1xyXG5jb25zdCBoZWFkaW5nQ1NTID0gY3NzIGBcbiAgLyogZGVmYXVsdCB0byBubyBtYXJnaW4gKi9cbiAgbWFyZ2luOiAwO1xuICBjb2xvcjogdmFyKC0tYWMtZ2xvYmFsLXRleHQtY29sb3ItOTAwKTtcbmA7XHJcbmNvbnN0IGhlYWRpbmdTaXplQ1NTID0gKGxldmVsKSA9PiB7XHJcbiAgICBzd2l0Y2ggKGxldmVsKSB7XHJcbiAgICAgICAgY2FzZSAxOiB7XHJcbiAgICAgICAgICAgIHJldHVybiBjc3MgYFxuICAgICAgICBmb250LXNpemU6ICR7c2l6ZXMueHhsYXJnZS5mb250U2l6ZX1weDtcbiAgICAgICAgbGluZS1oZWlnaHQ6ICR7c2l6ZXMueHhsYXJnZS5saW5lSGVpZ2h0fXB4O1xuICAgICAgYDtcclxuICAgICAgICB9XHJcbiAgICAgICAgY2FzZSAyOiB7XHJcbiAgICAgICAgICAgIHJldHVybiBjc3MgYFxuICAgICAgICBmb250LXNpemU6ICR7c2l6ZXMueGxhcmdlLmZvbnRTaXplfXB4O1xuICAgICAgICBsaW5lLWhlaWdodDogJHtzaXplcy54bGFyZ2UubGluZUhlaWdodH1weDtcbiAgICAgIGA7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGNhc2UgMzoge1xyXG4gICAgICAgICAgICByZXR1cm4gY3NzIGBcbiAgICAgICAgZm9udC1zaXplOiAke3NpemVzLmxhcmdlLmZvbnRTaXplfXB4O1xuICAgICAgICBsaW5lLWhlaWdodDogJHtzaXplcy5sYXJnZS5saW5lSGVpZ2h0fXB4O1xuICAgICAgYDtcclxuICAgICAgICB9XHJcbiAgICAgICAgY2FzZSA0OiB7XHJcbiAgICAgICAgICAgIHJldHVybiBjc3MgYFxuICAgICAgICBmb250LXNpemU6ICR7c2l6ZXMubWVkaXVtLmZvbnRTaXplfXB4O1xuICAgICAgICBsaW5lLWhlaWdodDogJHtzaXplcy5tZWRpdW0ubGluZUhlaWdodH1weDtcbiAgICAgIGA7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGNhc2UgNToge1xyXG4gICAgICAgICAgICByZXR1cm4gY3NzIGBcbiAgICAgICAgZm9udC1zaXplOiAke3NpemVzLnNtYWxsLmZvbnRTaXplfXB4O1xuICAgICAgICBsaW5lLWhlaWdodDogJHtzaXplcy5zbWFsbC5saW5lSGVpZ2h0fXB4O1xuICAgICAgYDtcclxuICAgICAgICB9XHJcbiAgICAgICAgY2FzZSA2OiB7XHJcbiAgICAgICAgICAgIHJldHVybiBjc3MgYFxuICAgICAgICBmb250LXNpemU6ICR7c2l6ZXMueHNtYWxsLmZvbnRTaXplfXB4O1xuICAgICAgICBsaW5lLWhlaWdodDogJHtzaXplcy54c21hbGwubGluZUhlaWdodH1weDtcbiAgICAgIGA7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGRlZmF1bHQ6IHtcclxuICAgICAgICAgICAgcmV0dXJuIGNzcyBgYDtcclxuICAgICAgICB9XHJcbiAgICB9XHJcbn07XHJcbmNvbnN0IGhlYWRpbmdXZWlnaHRDU1MgPSAod2VpZ2h0KSA9PiBjc3MgYFxuICBmb250LXdlaWdodDogJHt3ZWlnaHQgPT09ICdoZWF2eScgPyB3ZWlnaHRzLmhlYXZ5IDogd2VpZ2h0cy5ub3JtYWx9O1xuYDtcclxuLyoqXHJcbiAqIEhlYWRpbmcgaXMgdXNlZCB0byBjcmVhdGUgdmFyaW91cyBsZXZlbHMgb2YgdHlwb2dyYXBoaWMgaGllcmFyY2hpZXMuXHJcbiAqL1xyXG5mdW5jdGlvbiBIZWFkaW5nKHByb3BzLCByZWYpIHtcclxuICAgIGNvbnN0IHsgY2hpbGRyZW4sIGxldmVsID0gMywgd2VpZ2h0ID0gJ25vcm1hbCcsIC4uLm90aGVyUHJvcHMgfSA9IHByb3BzO1xyXG4gICAgY29uc3QgSGVhZGluZ1RhZyA9IGBoJHtsZXZlbH1gO1xyXG4gICAgY29uc3QgZG9tUmVmID0gdXNlRE9NUmVmKHJlZik7XHJcbiAgICByZXR1cm4gKDxIZWFkaW5nVGFnIHsuLi5vdGhlclByb3BzfSBjc3M9e2NzcyhoZWFkaW5nQ1NTLCBoZWFkaW5nU2l6ZUNTUyhsZXZlbCksIGhlYWRpbmdXZWlnaHRDU1Mod2VpZ2h0KSl9IHJlZj17ZG9tUmVmfT5cbiAgICAgIHtjaGlsZHJlbn1cbiAgICA8L0hlYWRpbmdUYWc+KTtcclxufVxyXG5jb25zdCBfSGVhZGluZyA9IGZvcndhcmRSZWYoSGVhZGluZyk7XHJcbmV4cG9ydCB7IF9IZWFkaW5nIGFzIEhlYWRpbmcgfTtcclxuLy8jIHNvdXJjZU1hcHBpbmdVUkw9SGVhZGluZy5qc3gubWFwIl19 */");
    }
    case 6: {
      return /* @__PURE__ */ css("font-size:", sizes.xsmall.fontSize, "px;line-height:", sizes.xsmall.lineHeight, "px;" + (false ? "" : ";label:headingSizeCSS;"), false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkhlYWRpbmcudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQTJDdUIiLCJmaWxlIjoiSGVhZGluZy50c3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgUmVhY3QsIHsgZm9yd2FyZFJlZiB9IGZyb20gJ3JlYWN0JztcclxuaW1wb3J0IHsgY3NzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xyXG5pbXBvcnQgeyB1c2VET01SZWYgfSBmcm9tICcuLi91dGlscy91c2VET01SZWYnO1xyXG5pbXBvcnQgdGhlbWUgZnJvbSAnLi4vdGhlbWUnO1xyXG5jb25zdCB7IHR5cG9ncmFwaHk6IHsgc2l6ZXMsIHdlaWdodHMgfSwgfSA9IHRoZW1lO1xyXG5jb25zdCBoZWFkaW5nQ1NTID0gY3NzIGBcbiAgLyogZGVmYXVsdCB0byBubyBtYXJnaW4gKi9cbiAgbWFyZ2luOiAwO1xuICBjb2xvcjogdmFyKC0tYWMtZ2xvYmFsLXRleHQtY29sb3ItOTAwKTtcbmA7XHJcbmNvbnN0IGhlYWRpbmdTaXplQ1NTID0gKGxldmVsKSA9PiB7XHJcbiAgICBzd2l0Y2ggKGxldmVsKSB7XHJcbiAgICAgICAgY2FzZSAxOiB7XHJcbiAgICAgICAgICAgIHJldHVybiBjc3MgYFxuICAgICAgICBmb250LXNpemU6ICR7c2l6ZXMueHhsYXJnZS5mb250U2l6ZX1weDtcbiAgICAgICAgbGluZS1oZWlnaHQ6ICR7c2l6ZXMueHhsYXJnZS5saW5lSGVpZ2h0fXB4O1xuICAgICAgYDtcclxuICAgICAgICB9XHJcbiAgICAgICAgY2FzZSAyOiB7XHJcbiAgICAgICAgICAgIHJldHVybiBjc3MgYFxuICAgICAgICBmb250LXNpemU6ICR7c2l6ZXMueGxhcmdlLmZvbnRTaXplfXB4O1xuICAgICAgICBsaW5lLWhlaWdodDogJHtzaXplcy54bGFyZ2UubGluZUhlaWdodH1weDtcbiAgICAgIGA7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGNhc2UgMzoge1xyXG4gICAgICAgICAgICByZXR1cm4gY3NzIGBcbiAgICAgICAgZm9udC1zaXplOiAke3NpemVzLmxhcmdlLmZvbnRTaXplfXB4O1xuICAgICAgICBsaW5lLWhlaWdodDogJHtzaXplcy5sYXJnZS5saW5lSGVpZ2h0fXB4O1xuICAgICAgYDtcclxuICAgICAgICB9XHJcbiAgICAgICAgY2FzZSA0OiB7XHJcbiAgICAgICAgICAgIHJldHVybiBjc3MgYFxuICAgICAgICBmb250LXNpemU6ICR7c2l6ZXMubWVkaXVtLmZvbnRTaXplfXB4O1xuICAgICAgICBsaW5lLWhlaWdodDogJHtzaXplcy5tZWRpdW0ubGluZUhlaWdodH1weDtcbiAgICAgIGA7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGNhc2UgNToge1xyXG4gICAgICAgICAgICByZXR1cm4gY3NzIGBcbiAgICAgICAgZm9udC1zaXplOiAke3NpemVzLnNtYWxsLmZvbnRTaXplfXB4O1xuICAgICAgICBsaW5lLWhlaWdodDogJHtzaXplcy5zbWFsbC5saW5lSGVpZ2h0fXB4O1xuICAgICAgYDtcclxuICAgICAgICB9XHJcbiAgICAgICAgY2FzZSA2OiB7XHJcbiAgICAgICAgICAgIHJldHVybiBjc3MgYFxuICAgICAgICBmb250LXNpemU6ICR7c2l6ZXMueHNtYWxsLmZvbnRTaXplfXB4O1xuICAgICAgICBsaW5lLWhlaWdodDogJHtzaXplcy54c21hbGwubGluZUhlaWdodH1weDtcbiAgICAgIGA7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGRlZmF1bHQ6IHtcclxuICAgICAgICAgICAgcmV0dXJuIGNzcyBgYDtcclxuICAgICAgICB9XHJcbiAgICB9XHJcbn07XHJcbmNvbnN0IGhlYWRpbmdXZWlnaHRDU1MgPSAod2VpZ2h0KSA9PiBjc3MgYFxuICBmb250LXdlaWdodDogJHt3ZWlnaHQgPT09ICdoZWF2eScgPyB3ZWlnaHRzLmhlYXZ5IDogd2VpZ2h0cy5ub3JtYWx9O1xuYDtcclxuLyoqXHJcbiAqIEhlYWRpbmcgaXMgdXNlZCB0byBjcmVhdGUgdmFyaW91cyBsZXZlbHMgb2YgdHlwb2dyYXBoaWMgaGllcmFyY2hpZXMuXHJcbiAqL1xyXG5mdW5jdGlvbiBIZWFkaW5nKHByb3BzLCByZWYpIHtcclxuICAgIGNvbnN0IHsgY2hpbGRyZW4sIGxldmVsID0gMywgd2VpZ2h0ID0gJ25vcm1hbCcsIC4uLm90aGVyUHJvcHMgfSA9IHByb3BzO1xyXG4gICAgY29uc3QgSGVhZGluZ1RhZyA9IGBoJHtsZXZlbH1gO1xyXG4gICAgY29uc3QgZG9tUmVmID0gdXNlRE9NUmVmKHJlZik7XHJcbiAgICByZXR1cm4gKDxIZWFkaW5nVGFnIHsuLi5vdGhlclByb3BzfSBjc3M9e2NzcyhoZWFkaW5nQ1NTLCBoZWFkaW5nU2l6ZUNTUyhsZXZlbCksIGhlYWRpbmdXZWlnaHRDU1Mod2VpZ2h0KSl9IHJlZj17ZG9tUmVmfT5cbiAgICAgIHtjaGlsZHJlbn1cbiAgICA8L0hlYWRpbmdUYWc+KTtcclxufVxyXG5jb25zdCBfSGVhZGluZyA9IGZvcndhcmRSZWYoSGVhZGluZyk7XHJcbmV4cG9ydCB7IF9IZWFkaW5nIGFzIEhlYWRpbmcgfTtcclxuLy8jIHNvdXJjZU1hcHBpbmdVUkw9SGVhZGluZy5qc3gubWFwIl19 */");
    }
    default: {
      return /* @__PURE__ */ css(false ? "" : ";label:headingSizeCSS;", false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkhlYWRpbmcudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQWlEdUIiLCJmaWxlIjoiSGVhZGluZy50c3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgUmVhY3QsIHsgZm9yd2FyZFJlZiB9IGZyb20gJ3JlYWN0JztcclxuaW1wb3J0IHsgY3NzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xyXG5pbXBvcnQgeyB1c2VET01SZWYgfSBmcm9tICcuLi91dGlscy91c2VET01SZWYnO1xyXG5pbXBvcnQgdGhlbWUgZnJvbSAnLi4vdGhlbWUnO1xyXG5jb25zdCB7IHR5cG9ncmFwaHk6IHsgc2l6ZXMsIHdlaWdodHMgfSwgfSA9IHRoZW1lO1xyXG5jb25zdCBoZWFkaW5nQ1NTID0gY3NzIGBcbiAgLyogZGVmYXVsdCB0byBubyBtYXJnaW4gKi9cbiAgbWFyZ2luOiAwO1xuICBjb2xvcjogdmFyKC0tYWMtZ2xvYmFsLXRleHQtY29sb3ItOTAwKTtcbmA7XHJcbmNvbnN0IGhlYWRpbmdTaXplQ1NTID0gKGxldmVsKSA9PiB7XHJcbiAgICBzd2l0Y2ggKGxldmVsKSB7XHJcbiAgICAgICAgY2FzZSAxOiB7XHJcbiAgICAgICAgICAgIHJldHVybiBjc3MgYFxuICAgICAgICBmb250LXNpemU6ICR7c2l6ZXMueHhsYXJnZS5mb250U2l6ZX1weDtcbiAgICAgICAgbGluZS1oZWlnaHQ6ICR7c2l6ZXMueHhsYXJnZS5saW5lSGVpZ2h0fXB4O1xuICAgICAgYDtcclxuICAgICAgICB9XHJcbiAgICAgICAgY2FzZSAyOiB7XHJcbiAgICAgICAgICAgIHJldHVybiBjc3MgYFxuICAgICAgICBmb250LXNpemU6ICR7c2l6ZXMueGxhcmdlLmZvbnRTaXplfXB4O1xuICAgICAgICBsaW5lLWhlaWdodDogJHtzaXplcy54bGFyZ2UubGluZUhlaWdodH1weDtcbiAgICAgIGA7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGNhc2UgMzoge1xyXG4gICAgICAgICAgICByZXR1cm4gY3NzIGBcbiAgICAgICAgZm9udC1zaXplOiAke3NpemVzLmxhcmdlLmZvbnRTaXplfXB4O1xuICAgICAgICBsaW5lLWhlaWdodDogJHtzaXplcy5sYXJnZS5saW5lSGVpZ2h0fXB4O1xuICAgICAgYDtcclxuICAgICAgICB9XHJcbiAgICAgICAgY2FzZSA0OiB7XHJcbiAgICAgICAgICAgIHJldHVybiBjc3MgYFxuICAgICAgICBmb250LXNpemU6ICR7c2l6ZXMubWVkaXVtLmZvbnRTaXplfXB4O1xuICAgICAgICBsaW5lLWhlaWdodDogJHtzaXplcy5tZWRpdW0ubGluZUhlaWdodH1weDtcbiAgICAgIGA7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGNhc2UgNToge1xyXG4gICAgICAgICAgICByZXR1cm4gY3NzIGBcbiAgICAgICAgZm9udC1zaXplOiAke3NpemVzLnNtYWxsLmZvbnRTaXplfXB4O1xuICAgICAgICBsaW5lLWhlaWdodDogJHtzaXplcy5zbWFsbC5saW5lSGVpZ2h0fXB4O1xuICAgICAgYDtcclxuICAgICAgICB9XHJcbiAgICAgICAgY2FzZSA2OiB7XHJcbiAgICAgICAgICAgIHJldHVybiBjc3MgYFxuICAgICAgICBmb250LXNpemU6ICR7c2l6ZXMueHNtYWxsLmZvbnRTaXplfXB4O1xuICAgICAgICBsaW5lLWhlaWdodDogJHtzaXplcy54c21hbGwubGluZUhlaWdodH1weDtcbiAgICAgIGA7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGRlZmF1bHQ6IHtcclxuICAgICAgICAgICAgcmV0dXJuIGNzcyBgYDtcclxuICAgICAgICB9XHJcbiAgICB9XHJcbn07XHJcbmNvbnN0IGhlYWRpbmdXZWlnaHRDU1MgPSAod2VpZ2h0KSA9PiBjc3MgYFxuICBmb250LXdlaWdodDogJHt3ZWlnaHQgPT09ICdoZWF2eScgPyB3ZWlnaHRzLmhlYXZ5IDogd2VpZ2h0cy5ub3JtYWx9O1xuYDtcclxuLyoqXHJcbiAqIEhlYWRpbmcgaXMgdXNlZCB0byBjcmVhdGUgdmFyaW91cyBsZXZlbHMgb2YgdHlwb2dyYXBoaWMgaGllcmFyY2hpZXMuXHJcbiAqL1xyXG5mdW5jdGlvbiBIZWFkaW5nKHByb3BzLCByZWYpIHtcclxuICAgIGNvbnN0IHsgY2hpbGRyZW4sIGxldmVsID0gMywgd2VpZ2h0ID0gJ25vcm1hbCcsIC4uLm90aGVyUHJvcHMgfSA9IHByb3BzO1xyXG4gICAgY29uc3QgSGVhZGluZ1RhZyA9IGBoJHtsZXZlbH1gO1xyXG4gICAgY29uc3QgZG9tUmVmID0gdXNlRE9NUmVmKHJlZik7XHJcbiAgICByZXR1cm4gKDxIZWFkaW5nVGFnIHsuLi5vdGhlclByb3BzfSBjc3M9e2NzcyhoZWFkaW5nQ1NTLCBoZWFkaW5nU2l6ZUNTUyhsZXZlbCksIGhlYWRpbmdXZWlnaHRDU1Mod2VpZ2h0KSl9IHJlZj17ZG9tUmVmfT5cbiAgICAgIHtjaGlsZHJlbn1cbiAgICA8L0hlYWRpbmdUYWc+KTtcclxufVxyXG5jb25zdCBfSGVhZGluZyA9IGZvcndhcmRSZWYoSGVhZGluZyk7XHJcbmV4cG9ydCB7IF9IZWFkaW5nIGFzIEhlYWRpbmcgfTtcclxuLy8jIHNvdXJjZU1hcHBpbmdVUkw9SGVhZGluZy5qc3gubWFwIl19 */");
    }
  }
};
var headingWeightCSS = function headingWeightCSS2(weight) {
  return /* @__PURE__ */ css("font-weight:", weight === "heavy" ? weights.heavy : weights.normal, ";" + (false ? "" : ";label:headingWeightCSS;"), false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkhlYWRpbmcudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXFEeUMiLCJmaWxlIjoiSGVhZGluZy50c3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgUmVhY3QsIHsgZm9yd2FyZFJlZiB9IGZyb20gJ3JlYWN0JztcclxuaW1wb3J0IHsgY3NzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xyXG5pbXBvcnQgeyB1c2VET01SZWYgfSBmcm9tICcuLi91dGlscy91c2VET01SZWYnO1xyXG5pbXBvcnQgdGhlbWUgZnJvbSAnLi4vdGhlbWUnO1xyXG5jb25zdCB7IHR5cG9ncmFwaHk6IHsgc2l6ZXMsIHdlaWdodHMgfSwgfSA9IHRoZW1lO1xyXG5jb25zdCBoZWFkaW5nQ1NTID0gY3NzIGBcbiAgLyogZGVmYXVsdCB0byBubyBtYXJnaW4gKi9cbiAgbWFyZ2luOiAwO1xuICBjb2xvcjogdmFyKC0tYWMtZ2xvYmFsLXRleHQtY29sb3ItOTAwKTtcbmA7XHJcbmNvbnN0IGhlYWRpbmdTaXplQ1NTID0gKGxldmVsKSA9PiB7XHJcbiAgICBzd2l0Y2ggKGxldmVsKSB7XHJcbiAgICAgICAgY2FzZSAxOiB7XHJcbiAgICAgICAgICAgIHJldHVybiBjc3MgYFxuICAgICAgICBmb250LXNpemU6ICR7c2l6ZXMueHhsYXJnZS5mb250U2l6ZX1weDtcbiAgICAgICAgbGluZS1oZWlnaHQ6ICR7c2l6ZXMueHhsYXJnZS5saW5lSGVpZ2h0fXB4O1xuICAgICAgYDtcclxuICAgICAgICB9XHJcbiAgICAgICAgY2FzZSAyOiB7XHJcbiAgICAgICAgICAgIHJldHVybiBjc3MgYFxuICAgICAgICBmb250LXNpemU6ICR7c2l6ZXMueGxhcmdlLmZvbnRTaXplfXB4O1xuICAgICAgICBsaW5lLWhlaWdodDogJHtzaXplcy54bGFyZ2UubGluZUhlaWdodH1weDtcbiAgICAgIGA7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGNhc2UgMzoge1xyXG4gICAgICAgICAgICByZXR1cm4gY3NzIGBcbiAgICAgICAgZm9udC1zaXplOiAke3NpemVzLmxhcmdlLmZvbnRTaXplfXB4O1xuICAgICAgICBsaW5lLWhlaWdodDogJHtzaXplcy5sYXJnZS5saW5lSGVpZ2h0fXB4O1xuICAgICAgYDtcclxuICAgICAgICB9XHJcbiAgICAgICAgY2FzZSA0OiB7XHJcbiAgICAgICAgICAgIHJldHVybiBjc3MgYFxuICAgICAgICBmb250LXNpemU6ICR7c2l6ZXMubWVkaXVtLmZvbnRTaXplfXB4O1xuICAgICAgICBsaW5lLWhlaWdodDogJHtzaXplcy5tZWRpdW0ubGluZUhlaWdodH1weDtcbiAgICAgIGA7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGNhc2UgNToge1xyXG4gICAgICAgICAgICByZXR1cm4gY3NzIGBcbiAgICAgICAgZm9udC1zaXplOiAke3NpemVzLnNtYWxsLmZvbnRTaXplfXB4O1xuICAgICAgICBsaW5lLWhlaWdodDogJHtzaXplcy5zbWFsbC5saW5lSGVpZ2h0fXB4O1xuICAgICAgYDtcclxuICAgICAgICB9XHJcbiAgICAgICAgY2FzZSA2OiB7XHJcbiAgICAgICAgICAgIHJldHVybiBjc3MgYFxuICAgICAgICBmb250LXNpemU6ICR7c2l6ZXMueHNtYWxsLmZvbnRTaXplfXB4O1xuICAgICAgICBsaW5lLWhlaWdodDogJHtzaXplcy54c21hbGwubGluZUhlaWdodH1weDtcbiAgICAgIGA7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGRlZmF1bHQ6IHtcclxuICAgICAgICAgICAgcmV0dXJuIGNzcyBgYDtcclxuICAgICAgICB9XHJcbiAgICB9XHJcbn07XHJcbmNvbnN0IGhlYWRpbmdXZWlnaHRDU1MgPSAod2VpZ2h0KSA9PiBjc3MgYFxuICBmb250LXdlaWdodDogJHt3ZWlnaHQgPT09ICdoZWF2eScgPyB3ZWlnaHRzLmhlYXZ5IDogd2VpZ2h0cy5ub3JtYWx9O1xuYDtcclxuLyoqXHJcbiAqIEhlYWRpbmcgaXMgdXNlZCB0byBjcmVhdGUgdmFyaW91cyBsZXZlbHMgb2YgdHlwb2dyYXBoaWMgaGllcmFyY2hpZXMuXHJcbiAqL1xyXG5mdW5jdGlvbiBIZWFkaW5nKHByb3BzLCByZWYpIHtcclxuICAgIGNvbnN0IHsgY2hpbGRyZW4sIGxldmVsID0gMywgd2VpZ2h0ID0gJ25vcm1hbCcsIC4uLm90aGVyUHJvcHMgfSA9IHByb3BzO1xyXG4gICAgY29uc3QgSGVhZGluZ1RhZyA9IGBoJHtsZXZlbH1gO1xyXG4gICAgY29uc3QgZG9tUmVmID0gdXNlRE9NUmVmKHJlZik7XHJcbiAgICByZXR1cm4gKDxIZWFkaW5nVGFnIHsuLi5vdGhlclByb3BzfSBjc3M9e2NzcyhoZWFkaW5nQ1NTLCBoZWFkaW5nU2l6ZUNTUyhsZXZlbCksIGhlYWRpbmdXZWlnaHRDU1Mod2VpZ2h0KSl9IHJlZj17ZG9tUmVmfT5cbiAgICAgIHtjaGlsZHJlbn1cbiAgICA8L0hlYWRpbmdUYWc+KTtcclxufVxyXG5jb25zdCBfSGVhZGluZyA9IGZvcndhcmRSZWYoSGVhZGluZyk7XHJcbmV4cG9ydCB7IF9IZWFkaW5nIGFzIEhlYWRpbmcgfTtcclxuLy8jIHNvdXJjZU1hcHBpbmdVUkw9SGVhZGluZy5qc3gubWFwIl19 */");
};
function Heading(props, ref) {
  var children = props.children, _props$level = props.level, level = _props$level === void 0 ? 3 : _props$level, _props$weight = props.weight, weight = _props$weight === void 0 ? "normal" : _props$weight, otherProps = _objectWithoutPropertiesLoose2(props, _excluded$3);
  var HeadingTag = "h" + level;
  var domRef = useDOMRef(ref);
  return jsx(HeadingTag, _extends2({}, otherProps, {
    css: /* @__PURE__ */ css(headingCSS, headingSizeCSS(level), headingWeightCSS(weight), false ? "" : ";label:Heading;", false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkhlYWRpbmcudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQStENkMiLCJmaWxlIjoiSGVhZGluZy50c3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgUmVhY3QsIHsgZm9yd2FyZFJlZiB9IGZyb20gJ3JlYWN0JztcclxuaW1wb3J0IHsgY3NzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xyXG5pbXBvcnQgeyB1c2VET01SZWYgfSBmcm9tICcuLi91dGlscy91c2VET01SZWYnO1xyXG5pbXBvcnQgdGhlbWUgZnJvbSAnLi4vdGhlbWUnO1xyXG5jb25zdCB7IHR5cG9ncmFwaHk6IHsgc2l6ZXMsIHdlaWdodHMgfSwgfSA9IHRoZW1lO1xyXG5jb25zdCBoZWFkaW5nQ1NTID0gY3NzIGBcbiAgLyogZGVmYXVsdCB0byBubyBtYXJnaW4gKi9cbiAgbWFyZ2luOiAwO1xuICBjb2xvcjogdmFyKC0tYWMtZ2xvYmFsLXRleHQtY29sb3ItOTAwKTtcbmA7XHJcbmNvbnN0IGhlYWRpbmdTaXplQ1NTID0gKGxldmVsKSA9PiB7XHJcbiAgICBzd2l0Y2ggKGxldmVsKSB7XHJcbiAgICAgICAgY2FzZSAxOiB7XHJcbiAgICAgICAgICAgIHJldHVybiBjc3MgYFxuICAgICAgICBmb250LXNpemU6ICR7c2l6ZXMueHhsYXJnZS5mb250U2l6ZX1weDtcbiAgICAgICAgbGluZS1oZWlnaHQ6ICR7c2l6ZXMueHhsYXJnZS5saW5lSGVpZ2h0fXB4O1xuICAgICAgYDtcclxuICAgICAgICB9XHJcbiAgICAgICAgY2FzZSAyOiB7XHJcbiAgICAgICAgICAgIHJldHVybiBjc3MgYFxuICAgICAgICBmb250LXNpemU6ICR7c2l6ZXMueGxhcmdlLmZvbnRTaXplfXB4O1xuICAgICAgICBsaW5lLWhlaWdodDogJHtzaXplcy54bGFyZ2UubGluZUhlaWdodH1weDtcbiAgICAgIGA7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGNhc2UgMzoge1xyXG4gICAgICAgICAgICByZXR1cm4gY3NzIGBcbiAgICAgICAgZm9udC1zaXplOiAke3NpemVzLmxhcmdlLmZvbnRTaXplfXB4O1xuICAgICAgICBsaW5lLWhlaWdodDogJHtzaXplcy5sYXJnZS5saW5lSGVpZ2h0fXB4O1xuICAgICAgYDtcclxuICAgICAgICB9XHJcbiAgICAgICAgY2FzZSA0OiB7XHJcbiAgICAgICAgICAgIHJldHVybiBjc3MgYFxuICAgICAgICBmb250LXNpemU6ICR7c2l6ZXMubWVkaXVtLmZvbnRTaXplfXB4O1xuICAgICAgICBsaW5lLWhlaWdodDogJHtzaXplcy5tZWRpdW0ubGluZUhlaWdodH1weDtcbiAgICAgIGA7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGNhc2UgNToge1xyXG4gICAgICAgICAgICByZXR1cm4gY3NzIGBcbiAgICAgICAgZm9udC1zaXplOiAke3NpemVzLnNtYWxsLmZvbnRTaXplfXB4O1xuICAgICAgICBsaW5lLWhlaWdodDogJHtzaXplcy5zbWFsbC5saW5lSGVpZ2h0fXB4O1xuICAgICAgYDtcclxuICAgICAgICB9XHJcbiAgICAgICAgY2FzZSA2OiB7XHJcbiAgICAgICAgICAgIHJldHVybiBjc3MgYFxuICAgICAgICBmb250LXNpemU6ICR7c2l6ZXMueHNtYWxsLmZvbnRTaXplfXB4O1xuICAgICAgICBsaW5lLWhlaWdodDogJHtzaXplcy54c21hbGwubGluZUhlaWdodH1weDtcbiAgICAgIGA7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGRlZmF1bHQ6IHtcclxuICAgICAgICAgICAgcmV0dXJuIGNzcyBgYDtcclxuICAgICAgICB9XHJcbiAgICB9XHJcbn07XHJcbmNvbnN0IGhlYWRpbmdXZWlnaHRDU1MgPSAod2VpZ2h0KSA9PiBjc3MgYFxuICBmb250LXdlaWdodDogJHt3ZWlnaHQgPT09ICdoZWF2eScgPyB3ZWlnaHRzLmhlYXZ5IDogd2VpZ2h0cy5ub3JtYWx9O1xuYDtcclxuLyoqXHJcbiAqIEhlYWRpbmcgaXMgdXNlZCB0byBjcmVhdGUgdmFyaW91cyBsZXZlbHMgb2YgdHlwb2dyYXBoaWMgaGllcmFyY2hpZXMuXHJcbiAqL1xyXG5mdW5jdGlvbiBIZWFkaW5nKHByb3BzLCByZWYpIHtcclxuICAgIGNvbnN0IHsgY2hpbGRyZW4sIGxldmVsID0gMywgd2VpZ2h0ID0gJ25vcm1hbCcsIC4uLm90aGVyUHJvcHMgfSA9IHByb3BzO1xyXG4gICAgY29uc3QgSGVhZGluZ1RhZyA9IGBoJHtsZXZlbH1gO1xyXG4gICAgY29uc3QgZG9tUmVmID0gdXNlRE9NUmVmKHJlZik7XHJcbiAgICByZXR1cm4gKDxIZWFkaW5nVGFnIHsuLi5vdGhlclByb3BzfSBjc3M9e2NzcyhoZWFkaW5nQ1NTLCBoZWFkaW5nU2l6ZUNTUyhsZXZlbCksIGhlYWRpbmdXZWlnaHRDU1Mod2VpZ2h0KSl9IHJlZj17ZG9tUmVmfT5cbiAgICAgIHtjaGlsZHJlbn1cbiAgICA8L0hlYWRpbmdUYWc+KTtcclxufVxyXG5jb25zdCBfSGVhZGluZyA9IGZvcndhcmRSZWYoSGVhZGluZyk7XHJcbmV4cG9ydCB7IF9IZWFkaW5nIGFzIEhlYWRpbmcgfTtcclxuLy8jIHNvdXJjZU1hcHBpbmdVUkw9SGVhZGluZy5qc3gubWFwIl19 */"),
    ref: domRef
  }), children);
}
var _Heading = /* @__PURE__ */ (0, import_react35.forwardRef)(Heading);
var _theme$typography$1 = theme.typography;
var sizes$1 = _theme$typography$1.sizes;
var weights$1 = _theme$typography$1.weights;
var textWeightCSS = function textWeightCSS2(weight) {
  return /* @__PURE__ */ css("font-weight:", weight === "heavy" ? weights$1.heavy : weights$1.normal, ";" + (false ? "" : ";label:textWeightCSS;"), false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0eWxlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFHNkMiLCJmaWxlIjoic3R5bGVzLnRzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgY3NzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xyXG5pbXBvcnQgdGhlbWUgZnJvbSAnLi4vdGhlbWUnO1xyXG5jb25zdCB7IHR5cG9ncmFwaHk6IHsgc2l6ZXMsIHdlaWdodHMgfSwgfSA9IHRoZW1lO1xyXG5leHBvcnQgY29uc3QgdGV4dFdlaWdodENTUyA9ICh3ZWlnaHQpID0+IGNzcyBgXG4gIGZvbnQtd2VpZ2h0OiAke3dlaWdodCA9PT0gJ2hlYXZ5JyA/IHdlaWdodHMuaGVhdnkgOiB3ZWlnaHRzLm5vcm1hbH07XG5gO1xyXG5leHBvcnQgY29uc3QgdGV4dFNpemVDU1MgPSAoc2l6ZSkgPT4ge1xyXG4gICAgY29uc3Qgc2l6aW5nID0gc2l6ZXNbc2l6ZV07XHJcbiAgICByZXR1cm4gY3NzIGBcbiAgICBmb250LXNpemU6ICR7c2l6aW5nLmZvbnRTaXplfXB4O1xuICAgIGxpbmUtaGVpZ2h0OiAke3NpemluZy5saW5lSGVpZ2h0fXB4O1xuICBgO1xyXG59O1xyXG4vLyMgc291cmNlTWFwcGluZ1VSTD1zdHlsZXMuanMubWFwIl19 */");
};
var textSizeCSS = function textSizeCSS2(size) {
  var sizing = sizes$1[size];
  return /* @__PURE__ */ css("font-size:", sizing.fontSize, "px;line-height:", sizing.lineHeight, "px;" + (false ? "" : ";label:textSizeCSS;"), false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0eWxlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFRZSIsImZpbGUiOiJzdHlsZXMudHMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBjc3MgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XHJcbmltcG9ydCB0aGVtZSBmcm9tICcuLi90aGVtZSc7XHJcbmNvbnN0IHsgdHlwb2dyYXBoeTogeyBzaXplcywgd2VpZ2h0cyB9LCB9ID0gdGhlbWU7XHJcbmV4cG9ydCBjb25zdCB0ZXh0V2VpZ2h0Q1NTID0gKHdlaWdodCkgPT4gY3NzIGBcbiAgZm9udC13ZWlnaHQ6ICR7d2VpZ2h0ID09PSAnaGVhdnknID8gd2VpZ2h0cy5oZWF2eSA6IHdlaWdodHMubm9ybWFsfTtcbmA7XHJcbmV4cG9ydCBjb25zdCB0ZXh0U2l6ZUNTUyA9IChzaXplKSA9PiB7XHJcbiAgICBjb25zdCBzaXppbmcgPSBzaXplc1tzaXplXTtcclxuICAgIHJldHVybiBjc3MgYFxuICAgIGZvbnQtc2l6ZTogJHtzaXppbmcuZm9udFNpemV9cHg7XG4gICAgbGluZS1oZWlnaHQ6ICR7c2l6aW5nLmxpbmVIZWlnaHR9cHg7XG4gIGA7XHJcbn07XHJcbi8vIyBzb3VyY2VNYXBwaW5nVVJMPXN0eWxlcy5qcy5tYXAiXX0= */");
};
var _excluded$4 = ["children", "color", "textSize", "elementType", "weight", "fontStyle"];
function isDesignationColor(color2) {
  return color2.startsWith("designation");
}
var getTextColor = function getTextColor2(color2) {
  if (isDesignationColor(color2)) {
    return designationColorValue(color2);
  }
  if (color2 === "inherit") {
    return "inherit";
  }
  var textColor = theme.textColors[color2];
  if (textColor) {
    console.warn(textColor + " is deprecated since it is not light/dark theme compatible.");
    return textColor;
  }
  if (color2.startsWith("text-")) {
    var _color$split = color2.split("-"), num = _color$split[1];
    return "var(--ac-global-text-color-" + num + ")";
  }
  return colorValue(color2);
};
var textCSS = function textCSS2(color2) {
  return /* @__PURE__ */ css("margin:0;color:", getTextColor(color2), ";" + (false ? "" : ";label:textCSS;"), false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlRleHQudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQTJCK0IiLCJmaWxlIjoiVGV4dC50c3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgUmVhY3QsIHsgZm9yd2FyZFJlZiwgfSBmcm9tICdyZWFjdCc7XHJcbmltcG9ydCB7IGNzcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcclxuaW1wb3J0IHRoZW1lIGZyb20gJy4uL3RoZW1lJztcclxuaW1wb3J0IHsgdGV4dFNpemVDU1MsIHRleHRXZWlnaHRDU1MgfSBmcm9tICcuL3N0eWxlcyc7XHJcbmltcG9ydCB7IGZpbHRlckRPTVByb3BzIH0gZnJvbSAnQHJlYWN0LWFyaWEvdXRpbHMnO1xyXG5pbXBvcnQgeyBjb2xvclZhbHVlLCBkZXNpZ25hdGlvbkNvbG9yVmFsdWUsIHVzZURPTVJlZiwgdXNlU3R5bGVQcm9wcywgfSBmcm9tICcuLi91dGlscyc7XHJcbmZ1bmN0aW9uIGlzRGVzaWduYXRpb25Db2xvcihjb2xvcikge1xyXG4gICAgcmV0dXJuIGNvbG9yLnN0YXJ0c1dpdGgoJ2Rlc2lnbmF0aW9uJyk7XHJcbn1cclxuY29uc3QgZ2V0VGV4dENvbG9yID0gKGNvbG9yKSA9PiB7XHJcbiAgICBpZiAoaXNEZXNpZ25hdGlvbkNvbG9yKGNvbG9yKSkge1xyXG4gICAgICAgIHJldHVybiBkZXNpZ25hdGlvbkNvbG9yVmFsdWUoY29sb3IpO1xyXG4gICAgfVxyXG4gICAgaWYgKGNvbG9yID09PSAnaW5oZXJpdCcpIHtcclxuICAgICAgICByZXR1cm4gJ2luaGVyaXQnO1xyXG4gICAgfVxyXG4gICAgY29uc3QgdGV4dENvbG9yID0gdGhlbWUudGV4dENvbG9yc1tjb2xvcl07XHJcbiAgICBpZiAodGV4dENvbG9yKSB7XHJcbiAgICAgICAgY29uc29sZS53YXJuKGAke3RleHRDb2xvcn0gaXMgZGVwcmVjYXRlZCBzaW5jZSBpdCBpcyBub3QgbGlnaHQvZGFyayB0aGVtZSBjb21wYXRpYmxlLmApO1xyXG4gICAgICAgIHJldHVybiB0ZXh0Q29sb3I7XHJcbiAgICB9XHJcbiAgICBpZiAoY29sb3Iuc3RhcnRzV2l0aCgndGV4dC0nKSkge1xyXG4gICAgICAgIGNvbnN0IFssIG51bV0gPSBjb2xvci5zcGxpdCgnLScpO1xyXG4gICAgICAgIHJldHVybiBgdmFyKC0tYWMtZ2xvYmFsLXRleHQtY29sb3ItJHtudW19KWA7XHJcbiAgICB9XHJcbiAgICByZXR1cm4gY29sb3JWYWx1ZShjb2xvcik7XHJcbn07XHJcbmNvbnN0IHRleHRDU1MgPSAoY29sb3IpID0+IGNzcyBgXG4gIC8qIGRlZmF1bHQgdG8gbm8gbWFyZ2luICovXG4gIG1hcmdpbjogMDtcbiAgY29sb3I6ICR7Z2V0VGV4dENvbG9yKGNvbG9yKX07XG5gO1xyXG4vKipcclxuICogVGV4dCBpcyB1c2VkIHRvIGNyZWF0ZSB2YXJpb3VzIHNpemVzIG9mIHR5cG9ncmFwaGljIGhpZXJhcmNoaWVzLlxyXG4gKi9cclxuZnVuY3Rpb24gVGV4dChwcm9wcywgcmVmKSB7XHJcbiAgICBjb25zdCB7IGlzRGlzYWJsZWQgPSBmYWxzZSB9ID0gcHJvcHM7XHJcbiAgICBjb25zdCB7IGNoaWxkcmVuLCBjb2xvciA9IGlzRGlzYWJsZWQgPyAndGV4dC0zMDAnIDogJ3RleHQtOTAwJywgdGV4dFNpemUgPSAnbWVkaXVtJywgZWxlbWVudFR5cGUgPSAnc3BhbicsIHdlaWdodCA9ICdub3JtYWwnLCBmb250U3R5bGUgPSAnbm9ybWFsJywgLi4ub3RoZXJQcm9wcyB9ID0gcHJvcHM7XHJcbiAgICBjb25zdCBUZXh0VGFnID0gZWxlbWVudFR5cGU7XHJcbiAgICBjb25zdCBkb21SZWYgPSB1c2VET01SZWYocmVmKTtcclxuICAgIGNvbnN0IHsgc3R5bGVQcm9wcyB9ID0gdXNlU3R5bGVQcm9wcyhvdGhlclByb3BzKTtcclxuICAgIHJldHVybiAoPFRleHRUYWcgY2xhc3NOYW1lPVwiYWMtdGV4dFwiIHsuLi5maWx0ZXJET01Qcm9wcyhvdGhlclByb3BzKX0gey4uLnN0eWxlUHJvcHN9IGNzcz17Y3NzIGBcbiAgICAgICAgJHt0ZXh0Q1NTKGNvbG9yKX07XG4gICAgICAgICR7dGV4dFNpemVDU1ModGV4dFNpemUpfTtcbiAgICAgICAgJHt0ZXh0V2VpZ2h0Q1NTKHdlaWdodCl9O1xuICAgICAgICBmb250LXN0eWxlOiAke2ZvbnRTdHlsZX07XG4gICAgICBgfSByZWY9e2RvbVJlZn0+XG4gICAgICB7Y2hpbGRyZW59XG4gICAgPC9UZXh0VGFnPik7XHJcbn1cclxuY29uc3QgX1RleHQgPSBmb3J3YXJkUmVmKFRleHQpO1xyXG5leHBvcnQgeyBfVGV4dCBhcyBUZXh0IH07XHJcbi8vIyBzb3VyY2VNYXBwaW5nVVJMPVRleHQuanN4Lm1hcCJdfQ== */");
};
function Text(props, ref) {
  var _props$isDisabled = props.isDisabled, isDisabled = _props$isDisabled === void 0 ? false : _props$isDisabled;
  var children = props.children, _props$color = props.color, color2 = _props$color === void 0 ? isDisabled ? "text-300" : "text-900" : _props$color, _props$textSize = props.textSize, textSize = _props$textSize === void 0 ? "medium" : _props$textSize, _props$elementType = props.elementType, elementType = _props$elementType === void 0 ? "span" : _props$elementType, _props$weight = props.weight, weight = _props$weight === void 0 ? "normal" : _props$weight, _props$fontStyle = props.fontStyle, fontStyle = _props$fontStyle === void 0 ? "normal" : _props$fontStyle, otherProps = _objectWithoutPropertiesLoose2(props, _excluded$4);
  var TextTag = elementType;
  var domRef = useDOMRef(ref);
  var _useStyleProps = useStyleProps(otherProps), styleProps = _useStyleProps.styleProps;
  return jsx(TextTag, _extends2({
    className: "ac-text"
  }, $65484d02dcb7eb3e$export$457c3d6518dd4c6f(otherProps), styleProps, {
    css: /* @__PURE__ */ css(textCSS(color2), ";", textSizeCSS(textSize), ";", textWeightCSS(weight), ";font-style:", fontStyle, ";" + (false ? "" : ";label:Text;"), false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlRleHQudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXlDa0ciLCJmaWxlIjoiVGV4dC50c3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgUmVhY3QsIHsgZm9yd2FyZFJlZiwgfSBmcm9tICdyZWFjdCc7XHJcbmltcG9ydCB7IGNzcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcclxuaW1wb3J0IHRoZW1lIGZyb20gJy4uL3RoZW1lJztcclxuaW1wb3J0IHsgdGV4dFNpemVDU1MsIHRleHRXZWlnaHRDU1MgfSBmcm9tICcuL3N0eWxlcyc7XHJcbmltcG9ydCB7IGZpbHRlckRPTVByb3BzIH0gZnJvbSAnQHJlYWN0LWFyaWEvdXRpbHMnO1xyXG5pbXBvcnQgeyBjb2xvclZhbHVlLCBkZXNpZ25hdGlvbkNvbG9yVmFsdWUsIHVzZURPTVJlZiwgdXNlU3R5bGVQcm9wcywgfSBmcm9tICcuLi91dGlscyc7XHJcbmZ1bmN0aW9uIGlzRGVzaWduYXRpb25Db2xvcihjb2xvcikge1xyXG4gICAgcmV0dXJuIGNvbG9yLnN0YXJ0c1dpdGgoJ2Rlc2lnbmF0aW9uJyk7XHJcbn1cclxuY29uc3QgZ2V0VGV4dENvbG9yID0gKGNvbG9yKSA9PiB7XHJcbiAgICBpZiAoaXNEZXNpZ25hdGlvbkNvbG9yKGNvbG9yKSkge1xyXG4gICAgICAgIHJldHVybiBkZXNpZ25hdGlvbkNvbG9yVmFsdWUoY29sb3IpO1xyXG4gICAgfVxyXG4gICAgaWYgKGNvbG9yID09PSAnaW5oZXJpdCcpIHtcclxuICAgICAgICByZXR1cm4gJ2luaGVyaXQnO1xyXG4gICAgfVxyXG4gICAgY29uc3QgdGV4dENvbG9yID0gdGhlbWUudGV4dENvbG9yc1tjb2xvcl07XHJcbiAgICBpZiAodGV4dENvbG9yKSB7XHJcbiAgICAgICAgY29uc29sZS53YXJuKGAke3RleHRDb2xvcn0gaXMgZGVwcmVjYXRlZCBzaW5jZSBpdCBpcyBub3QgbGlnaHQvZGFyayB0aGVtZSBjb21wYXRpYmxlLmApO1xyXG4gICAgICAgIHJldHVybiB0ZXh0Q29sb3I7XHJcbiAgICB9XHJcbiAgICBpZiAoY29sb3Iuc3RhcnRzV2l0aCgndGV4dC0nKSkge1xyXG4gICAgICAgIGNvbnN0IFssIG51bV0gPSBjb2xvci5zcGxpdCgnLScpO1xyXG4gICAgICAgIHJldHVybiBgdmFyKC0tYWMtZ2xvYmFsLXRleHQtY29sb3ItJHtudW19KWA7XHJcbiAgICB9XHJcbiAgICByZXR1cm4gY29sb3JWYWx1ZShjb2xvcik7XHJcbn07XHJcbmNvbnN0IHRleHRDU1MgPSAoY29sb3IpID0+IGNzcyBgXG4gIC8qIGRlZmF1bHQgdG8gbm8gbWFyZ2luICovXG4gIG1hcmdpbjogMDtcbiAgY29sb3I6ICR7Z2V0VGV4dENvbG9yKGNvbG9yKX07XG5gO1xyXG4vKipcclxuICogVGV4dCBpcyB1c2VkIHRvIGNyZWF0ZSB2YXJpb3VzIHNpemVzIG9mIHR5cG9ncmFwaGljIGhpZXJhcmNoaWVzLlxyXG4gKi9cclxuZnVuY3Rpb24gVGV4dChwcm9wcywgcmVmKSB7XHJcbiAgICBjb25zdCB7IGlzRGlzYWJsZWQgPSBmYWxzZSB9ID0gcHJvcHM7XHJcbiAgICBjb25zdCB7IGNoaWxkcmVuLCBjb2xvciA9IGlzRGlzYWJsZWQgPyAndGV4dC0zMDAnIDogJ3RleHQtOTAwJywgdGV4dFNpemUgPSAnbWVkaXVtJywgZWxlbWVudFR5cGUgPSAnc3BhbicsIHdlaWdodCA9ICdub3JtYWwnLCBmb250U3R5bGUgPSAnbm9ybWFsJywgLi4ub3RoZXJQcm9wcyB9ID0gcHJvcHM7XHJcbiAgICBjb25zdCBUZXh0VGFnID0gZWxlbWVudFR5cGU7XHJcbiAgICBjb25zdCBkb21SZWYgPSB1c2VET01SZWYocmVmKTtcclxuICAgIGNvbnN0IHsgc3R5bGVQcm9wcyB9ID0gdXNlU3R5bGVQcm9wcyhvdGhlclByb3BzKTtcclxuICAgIHJldHVybiAoPFRleHRUYWcgY2xhc3NOYW1lPVwiYWMtdGV4dFwiIHsuLi5maWx0ZXJET01Qcm9wcyhvdGhlclByb3BzKX0gey4uLnN0eWxlUHJvcHN9IGNzcz17Y3NzIGBcbiAgICAgICAgJHt0ZXh0Q1NTKGNvbG9yKX07XG4gICAgICAgICR7dGV4dFNpemVDU1ModGV4dFNpemUpfTtcbiAgICAgICAgJHt0ZXh0V2VpZ2h0Q1NTKHdlaWdodCl9O1xuICAgICAgICBmb250LXN0eWxlOiAke2ZvbnRTdHlsZX07XG4gICAgICBgfSByZWY9e2RvbVJlZn0+XG4gICAgICB7Y2hpbGRyZW59XG4gICAgPC9UZXh0VGFnPik7XHJcbn1cclxuY29uc3QgX1RleHQgPSBmb3J3YXJkUmVmKFRleHQpO1xyXG5leHBvcnQgeyBfVGV4dCBhcyBUZXh0IH07XHJcbi8vIyBzb3VyY2VNYXBwaW5nVVJMPVRleHQuanN4Lm1hcCJdfQ== */"),
    ref: domRef
  }), children);
}
var _Text = /* @__PURE__ */ (0, import_react35.forwardRef)(Text);
var _templateObject;
var bounceDelay = /* @__PURE__ */ keyframes(_templateObject || (_templateObject = /* @__PURE__ */ _taggedTemplateLiteralLoose2(["\n    0%,\n    80%,\n    100% {\n        transform: scale(0);\n    }\n    40% {\n        transform: scale(1);\n    }\n"])));
var spinnerCSS = /* @__PURE__ */ css("width:16px;height:16px;position:relative;display:inline-block;.loadingChild{width:100%;height:100%;position:absolute;left:0;top:0;}.loadingChild:before{content:'';display:block;margin:0 auto;width:15%;height:15%;background-color:#fff;border-radius:100%;animation:", bounceDelay, " 1.2s infinite ease-in-out both;}.loadingSpinnerCircle2{transform:rotate(30deg);}.loadingSpinnerCircle3{transform:rotate(60deg);}.loadingSpinnerCircle4{transform:rotate(90deg);}.loadingSpinnerCircle5{transform:rotate(120deg);}.loadingSpinnerCircle6{transform:rotate(150deg);}.loadingSpinnerCircle7{transform:rotate(180deg);}.loadingSpinnerCircle8{transform:rotate(210deg);}.loadingSpinnerCircle9{transform:rotate(240deg);}.loadingSpinnerCircle10{transform:rotate(270deg);}.loadingSpinnerCircle11{transform:rotate(300deg);}.loadingSpinnerCircle12{transform:rotate(330deg);}.loadingSpinnerCircle2:before{animation-delay:-1.1s;}.loadingSpinnerCircle3:before{animation-delay:-1s;}.loadingSpinnerCircle4:before{animation-delay:-0.9s;}.loadingSpinnerCircle5:before{animation-delay:-0.8s;}.loadingSpinnerCircle6:before{animation-delay:-0.7s;}.loadingSpinnerCircle7:before{animation-delay:-0.6s;}.loadingSpinnerCircle8:before{animation-delay:-0.5s;}.loadingSpinnerCircle9:before{animation-delay:-0.4s;}.loadingSpinnerCircle10:before{animation-delay:-0.3s;}.loadingSpinnerCircle11:before{animation-delay:-0.2s;}.loadingSpinnerCircle12:before{animation-delay:-0.1s;}" + (false ? "" : ";label:spinnerCSS;"), false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */");
var Spinner = function Spinner2() {
  return jsx("div", {
    css: spinnerCSS,
    className: "ac-spinner"
  }, jsx("div", {
    className: "loadingSpinnerCircle1 loadingChild"
  }), jsx("div", {
    className: "loadingSpinnerCircle2 loadingChild"
  }), jsx("div", {
    className: "loadingSpinnerCircle3 loadingChild"
  }), jsx("div", {
    className: "loadingSpinnerCircle4 loadingChild"
  }), jsx("div", {
    className: "loadingSpinnerCircle5 loadingChild"
  }), jsx("div", {
    className: "loadingSpinnerCircle6 loadingChild"
  }), jsx("div", {
    className: "loadingSpinnerCircle7 loadingChild"
  }), jsx("div", {
    className: "loadingSpinnerCircle8 loadingChild"
  }), jsx("div", {
    className: "loadingSpinnerCircle9 loadingChild"
  }), jsx("div", {
    className: "loadingSpinnerCircle10 loadingChild"
  }), jsx("div", {
    className: "loadingSpinnerCircle11 loadingChild"
  }), jsx("div", {
    className: "loadingSpinnerCircle12 loadingChild"
  }));
};
var buttonCSS = /* @__PURE__ */ css("border:1px solid var(--ac-global-border-color-default);font-weight:600;margin:0;display:flex;justify-content:center;align-items:center;box-sizing:border-box;border-radius:", theme.borderRadius.medium, "px;color:var(--ac-global-text-color-900);cursor:pointer;outline:none;&:not([disabled]){transition:all 0.2s ease-in-out;}&[disabled]{cursor:default;opacity:", theme.opacity.disabled, ";}&[data-size='normal'][data-childless='false']{padding:var(--ac-global-dimension-static-size-100) var(--ac-global-dimension-static-size-200);}&[data-size='compact'][data-childless='false']{padding:var(--ac-global-dimension-static-size-50) var(--ac-global-dimension-static-size-100);}&[data-size='normal'][data-childless='true']{padding:var(--ac-global-dimension-static-size-100) var(--ac-global-dimension-static-size-100);}&[data-size='compact'][data-childless='true']{padding:var(--ac-global-dimension-static-size-50) var(--ac-global-dimension-static-size-50);}&[data-variant='primary']{background-color:var(--ac-global-button-primary-background-color);border-color:var(--ac-global-button-primary-border-color);color:var(--ac-global-static-color-white-900);&:hover:not([disabled]){background-color:var(--ac-global-button-primary-background-color-hover);}}&[data-variant='danger']{background-color:var(--ac-global-button-danger-background-color);border-color:var(--ac-global-button-danger-border-color);color:var(--ac-global-static-color-white-900);&:hover:not([disabled]){background-color:var(--ac-global-button-danger-background-color-hover);}}&[data-variant='success']{background-color:var(--ac-global-button-success-background-color);border-color:var(--ac-global-button-success-border-color);color:var(--ac-global-static-color-white-900);color:var(--ac-global-static-color-white-900);&:hover:not([disabled]){background-color:var(--ac-global-button-success-background-color-hover);}}&[data-variant='default']{background-color:var(--ac-global-input-field-background-color);border-color:var(--ac-global-input-field-border-color);&:hover:not([disabled]){background-color:var(--ac-global-input-field-border-color-hover);}}&[data-variant='quiet']{background-color:transparent;border-color:transparent;&:hover:not([disabled]){border-color:transparent;background-color:var(--ac-global-input-field-background-color-active);}}&[data-childless='false']>i,&>.ac-spinner{margin-right:var(--ac-global-dimension-static-size-50);}" + (false ? "" : ";label:buttonCSS;"), false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */");
var _excluded$5 = ["disabled", "children", "loading", "variant", "onClick", "icon", "className", "size"];
var Button = function Button2(props, ref) {
  var domRef = useFocusableRef(ref);
  var disabled = props.disabled, children = props.children, loading2 = props.loading, variant = props.variant, onClick = props.onClick, icon = props.icon, className = props.className, _props$size = props.size, size = _props$size === void 0 ? "normal" : _props$size, otherProps = _objectWithoutPropertiesLoose2(props, _excluded$5);
  var isDisabled = disabled || loading2;
  var isChildless = children == null;
  var _useButton = $701a24aa0da5b062$export$ea18c227d4417cc3(props, domRef), buttonProps = _useButton.buttonProps, isPressed = _useButton.isPressed;
  var _useHover = $6179b936705e76d3$export$ae780daf29e6d456({
    isDisabled
  }), hoverProps = _useHover.hoverProps, isHovered = _useHover.isHovered;
  return jsx("button", _extends2({}, $3ef42575df84b30b$export$9d1611c77c2fe928(buttonProps, hoverProps, otherProps), {
    ref: domRef,
    css: buttonCSS,
    className: clsx_m_default("ac-button", className, {
      "is-active": isPressed,
      "is-disabled": isDisabled,
      "is-hovered": isHovered
    }),
    "data-variant": variant,
    "data-size": size,
    "data-childless": isChildless,
    disabled: isDisabled,
    onClick: isDisabled ? void 0 : onClick
  }), loading2 ? jsx(Spinner, null) : null, !loading2 && icon ? icon : null, jsx(_Text, {
    textSize: "medium",
    color: "inherit"
  }, children));
};
var _Button = /* @__PURE__ */ import_react35.default.forwardRef(Button);
var _excluded$6 = ["isDisabled", "children", "style", "isQuiet"];
function ActionButton(props, ref) {
  var domRef = useFocusableRef(ref);
  var isDisabled = props.isDisabled, children = props.children, style = props.style, _props$isQuiet = props.isQuiet, isQuiet = _props$isQuiet === void 0 ? false : _props$isQuiet, otherProps = _objectWithoutPropertiesLoose2(props, _excluded$6);
  var _useButton = $701a24aa0da5b062$export$ea18c227d4417cc3(props, domRef), buttonProps = _useButton.buttonProps, isPressed = _useButton.isPressed;
  var _useHover = $6179b936705e76d3$export$ae780daf29e6d456({
    isDisabled
  }), hoverProps = _useHover.hoverProps, isHovered = _useHover.isHovered;
  return jsx("button", _extends2({}, $3ef42575df84b30b$export$9d1611c77c2fe928(buttonProps, hoverProps, otherProps), {
    ref: domRef,
    className: clsx_m_default("ac-action-button", {
      "is-active": isPressed,
      "is-disabled": isDisabled,
      "is-hovered": isHovered
    }),
    style,
    css: isQuiet ? quietButtonCSS : null
  }), children);
}
var quietButtonCSS = /* @__PURE__ */ css("border:none;margin:0;padding:0 0;color:inherit;background:none;cursor:pointer;border-radius:", theme.rounding.rounding4, "px;opacity:0.8;transition:all 0.2s ease-in-out;&:hover{opacity:1;}svg{padding:var(--ac-dimension-size-85);}" + (false ? "" : ";label:quietButtonCSS;"), false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkFjdGlvbkJ1dHRvbi50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBMkIyQiIsImZpbGUiOiJBY3Rpb25CdXR0b24udHN4Iiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IFJlYWN0IGZyb20gJ3JlYWN0JztcclxuaW1wb3J0IHsgY2xhc3NOYW1lcyB9IGZyb20gJy4uL3V0aWxzL2NsYXNzTmFtZXMnO1xyXG5pbXBvcnQgeyBtZXJnZVByb3BzIH0gZnJvbSAnQHJlYWN0LWFyaWEvdXRpbHMnO1xyXG5pbXBvcnQgeyB1c2VCdXR0b24gfSBmcm9tICdAcmVhY3QtYXJpYS9idXR0b24nO1xyXG5pbXBvcnQgeyB1c2VIb3ZlciB9IGZyb20gJ0ByZWFjdC1hcmlhL2ludGVyYWN0aW9ucyc7XHJcbmltcG9ydCB7IHVzZUZvY3VzYWJsZVJlZiB9IGZyb20gJy4uL3V0aWxzL3VzZURPTVJlZic7XHJcbmltcG9ydCB7IGNzcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcclxuaW1wb3J0IHsgdGhlbWUgfSBmcm9tICcuLi90aGVtZSc7XHJcbi8qKlxyXG4gKiBBIGJ1dHRvbiB0aGF0IHBlcmZvcm1zIGFuIGFjdGlvbiAoZS5nLiBvcGVuIGEgcG9wb3ZlcilcclxuICogQHBhcmFtIHByb3BzXHJcbiAqIEBwYXJhbSByZWZcclxuICogQHJldHVybnNcclxuICovXHJcbmZ1bmN0aW9uIEFjdGlvbkJ1dHRvbihwcm9wcywgcmVmKSB7XHJcbiAgICBsZXQgZG9tUmVmID0gdXNlRm9jdXNhYmxlUmVmKHJlZik7XHJcbiAgICBjb25zdCB7IGlzRGlzYWJsZWQsIGNoaWxkcmVuLCBzdHlsZSwgaXNRdWlldCA9IGZhbHNlLCAuLi5vdGhlclByb3BzIH0gPSBwcm9wcztcclxuICAgIGNvbnN0IHsgYnV0dG9uUHJvcHMsIGlzUHJlc3NlZCB9ID0gdXNlQnV0dG9uKHByb3BzLCBkb21SZWYpO1xyXG4gICAgY29uc3QgeyBob3ZlclByb3BzLCBpc0hvdmVyZWQgfSA9IHVzZUhvdmVyKHsgaXNEaXNhYmxlZCB9KTtcclxuICAgIHJldHVybiAoPGJ1dHRvbiB7Li4ubWVyZ2VQcm9wcyhidXR0b25Qcm9wcywgaG92ZXJQcm9wcywgb3RoZXJQcm9wcyl9IHJlZj17ZG9tUmVmfSBjbGFzc05hbWU9e2NsYXNzTmFtZXMoJ2FjLWFjdGlvbi1idXR0b24nLCB7XHJcbiAgICAgICAgJ2lzLWFjdGl2ZSc6IGlzUHJlc3NlZCxcclxuICAgICAgICAnaXMtZGlzYWJsZWQnOiBpc0Rpc2FibGVkLFxyXG4gICAgICAgICdpcy1ob3ZlcmVkJzogaXNIb3ZlcmVkLFxyXG4gICAgfSl9IHN0eWxlPXtzdHlsZX0gY3NzPXtpc1F1aWV0ID8gcXVpZXRCdXR0b25DU1MgOiBudWxsfT5cbiAgICAgIHtjaGlsZHJlbn1cbiAgICA8L2J1dHRvbj4pO1xyXG59XHJcbmNvbnN0IHF1aWV0QnV0dG9uQ1NTID0gY3NzIGBcbiAgYm9yZGVyOiBub25lO1xuICBtYXJnaW46IDA7XG4gIHBhZGRpbmc6IDAgMDtcbiAgY29sb3I6IGluaGVyaXQ7XG4gIGJhY2tncm91bmQ6IG5vbmU7XG4gIGN1cnNvcjogcG9pbnRlcjtcbiAgYm9yZGVyLXJhZGl1czogJHt0aGVtZS5yb3VuZGluZy5yb3VuZGluZzR9cHg7XG4gIG9wYWNpdHk6IDAuODtcbiAgdHJhbnNpdGlvbjogYWxsIDAuMnMgZWFzZS1pbi1vdXQ7XG4gICY6aG92ZXIge1xuICAgIG9wYWNpdHk6IDE7XG4gIH1cbiAgc3ZnIHtcbiAgICBwYWRkaW5nOiB2YXIoLS1hYy1kaW1lbnNpb24tc2l6ZS04NSk7XG4gIH1cbmA7XHJcbi8qKlxyXG4gKiBBY3Rpb25CdXR0b25zIGFsbG93IHVzZXJzIHRvIHBlcmZvcm0gYW4gYWN0aW9uLlxyXG4gKiBUaGV54oCZcmUgdXNlZCBmb3Igc2ltaWxhciwgdGFzay1iYXNlZCBvcHRpb25zIHdpdGhpbiBhIHdvcmtmbG93LCBhbmQgYXJlIGlkZWFsIGZvciBpbnRlcmZhY2VzIHdoZXJlIGJ1dHRvbnMgYXJlbuKAmXQgbWVhbnQgdG8gZHJhdyBhIGxvdCBvZiBhdHRlbnRpb24uXHJcbiAqL1xyXG5sZXQgX0FjdGlvbkJ1dHRvbiA9IFJlYWN0LmZvcndhcmRSZWYoQWN0aW9uQnV0dG9uKTtcclxuZXhwb3J0IHsgX0FjdGlvbkJ1dHRvbiBhcyBBY3Rpb25CdXR0b24gfTtcclxuLy8jIHNvdXJjZU1hcHBpbmdVUkw9QWN0aW9uQnV0dG9uLmpzeC5tYXAiXX0= */");
var _ActionButton = /* @__PURE__ */ import_react35.default.forwardRef(ActionButton);
var _excluded$8 = ["svg", "style", "className", "isDisabled", "color"];
var Icon = function Icon2(_ref18) {
  var svg2 = _ref18.svg, style = _ref18.style, className = _ref18.className, _ref$color = _ref18.color, color2 = _ref$color === void 0 ? "inherit" : _ref$color, restProps = _objectWithoutPropertiesLoose2(_ref18, _excluded$8);
  var resolvedColor = color2 === "inherit" ? "inherit" : colorValue(color2);
  return jsx("i", _extends2({
    className: clsx_m_default("ac-icon-wrap", className),
    css: /* @__PURE__ */ css("width:1em;height:1em;font-size:1.3rem;color:", resolvedColor, ";display:flex;svg{fill:currentColor;width:1em;height:1em;display:inline-block;transition:fill 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;flex-shrink:0;user-select:none;}" + (false ? "" : ";label:Icon;"), false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkljb24udHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQVEwRSIsImZpbGUiOiJJY29uLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBSZWFjdCBmcm9tICdyZWFjdCc7XHJcbmltcG9ydCB7IGNsYXNzTmFtZXMsIGNvbG9yVmFsdWUgfSBmcm9tICcuLi91dGlscyc7XHJcbmltcG9ydCB7IGNzcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcclxuLyoqXHJcbiAqIFdyYXBzIHRoZSBzdmcgaW4gYSByZWFzb25hYmxlIHNpemUgYW5kIGFwcGxpZXMgYSBjb2xvclxyXG4gKi9cclxuZXhwb3J0IGNvbnN0IEljb24gPSAoeyBzdmcsIHN0eWxlLCBjbGFzc05hbWUsIGlzRGlzYWJsZWQ6IF9pc0Rpc2FibGVkLCBjb2xvciA9ICdpbmhlcml0JywgLi4ucmVzdFByb3BzIH0pID0+IHtcclxuICAgIGNvbnN0IHJlc29sdmVkQ29sb3IgPSBjb2xvciA9PT0gJ2luaGVyaXQnID8gJ2luaGVyaXQnIDogY29sb3JWYWx1ZShjb2xvcik7XHJcbiAgICByZXR1cm4gKDxpIGNsYXNzTmFtZT17Y2xhc3NOYW1lcygnYWMtaWNvbi13cmFwJywgY2xhc3NOYW1lKX0gY3NzPXtjc3MgYFxuICAgICAgICB3aWR0aDogMWVtO1xuICAgICAgICBoZWlnaHQ6IDFlbTtcbiAgICAgICAgZm9udC1zaXplOiAxLjNyZW07XG4gICAgICAgIGNvbG9yOiAke3Jlc29sdmVkQ29sb3J9O1xuICAgICAgICBkaXNwbGF5OiBmbGV4O1xuICAgICAgICBzdmcge1xuICAgICAgICAgIGZpbGw6IGN1cnJlbnRDb2xvcjtcbiAgICAgICAgICB3aWR0aDogMWVtO1xuICAgICAgICAgIGhlaWdodDogMWVtO1xuICAgICAgICAgIGRpc3BsYXk6IGlubGluZS1ibG9jaztcbiAgICAgICAgICB0cmFuc2l0aW9uOiBmaWxsIDIwMG1zIGN1YmljLWJlemllcigwLjQsIDAsIDAuMiwgMSkgMG1zO1xuICAgICAgICAgIGZsZXgtc2hyaW5rOiAwO1xuICAgICAgICAgIHVzZXItc2VsZWN0OiBub25lO1xuICAgICAgICB9XG4gICAgICBgfSBzdHlsZT17c3R5bGV9IHsuLi5yZXN0UHJvcHN9PlxuICAgICAge3N2Z31cbiAgICA8L2k+KTtcclxufTtcclxuLy8jIHNvdXJjZU1hcHBpbmdVUkw9SWNvbi5qc3gubWFwIl19 */"),
    style
  }, restProps), svg2);
};
var _templateObject$1;
var loadingCircleKeyframes = /* @__PURE__ */ keyframes(_templateObject$1 || (_templateObject$1 = /* @__PURE__ */ _taggedTemplateLiteralLoose2(["\n 100% {\n    transform: rotate(360deg);\n  }\n"])));
var ActivityOutline = function ActivityOutline2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "activity"
  }, jsx("rect", {
    width: "24",
    height: "24",
    transform: "rotate(90 12 12)",
    opacity: "0"
  }), jsx("path", {
    d: "M14.33 20h-.21a2 2 0 0 1-1.76-1.58L9.68 6l-2.76 6.4A1 1 0 0 1 6 13H3a1 1 0 0 1 0-2h2.34l2.51-5.79a2 2 0 0 1 3.79.38L14.32 18l2.76-6.38A1 1 0 0 1 18 11h3a1 1 0 0 1 0 2h-2.34l-2.51 5.79A2 2 0 0 1 14.33 20z"
  }))));
};
var ArchiveOutline = function ArchiveOutline2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "archive"
  }, jsx("rect", {
    width: "24",
    height: "24",
    transform: "rotate(90 12 12)",
    opacity: "0"
  }), jsx("path", {
    d: "M21 6a3 3 0 0 0-3-3H6a3 3 0 0 0-2 5.22V18a3 3 0 0 0 3 3h10a3 3 0 0 0 3-3V8.22A3 3 0 0 0 21 6zM6 5h12a1 1 0 0 1 0 2H6a1 1 0 0 1 0-2zm12 13a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V9h12z"
  }), jsx("rect", {
    x: "9",
    y: "12",
    width: "6",
    height: "2",
    rx: ".87",
    ry: ".87"
  }))));
};
var ArrowBack = function ArrowBack2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "arrow-back"
  }, jsx("rect", {
    width: "24",
    height: "24",
    transform: "rotate(90 12 12)",
    opacity: "0"
  }), jsx("path", {
    d: "M19 11H7.14l3.63-4.36a1 1 0 1 0-1.54-1.28l-5 6a1.19 1.19 0 0 0-.09.15c0 .05 0 .08-.07.13A1 1 0 0 0 4 12a1 1 0 0 0 .07.36c0 .05 0 .08.07.13a1.19 1.19 0 0 0 .09.15l5 6A1 1 0 0 0 10 19a1 1 0 0 0 .64-.23 1 1 0 0 0 .13-1.41L7.14 13H19a1 1 0 0 0 0-2z"
  }))));
};
var ArrowIosBackOutline = function ArrowIosBackOutline2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "arrow-ios-back"
  }, jsx("rect", {
    width: "24",
    height: "24",
    transform: "rotate(90 12 12)",
    opacity: "0"
  }), jsx("path", {
    d: "M13.83 19a1 1 0 0 1-.78-.37l-4.83-6a1 1 0 0 1 0-1.27l5-6a1 1 0 0 1 1.54 1.28L10.29 12l4.32 5.36a1 1 0 0 1-.78 1.64z"
  }))));
};
var ArrowDown = function ArrowDown2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "arrow-downward"
  }, jsx("rect", {
    width: "24",
    height: "24",
    transform: "rotate(-90 12 12)",
    opacity: "0"
  }), jsx("path", {
    d: "M12 17a1.72 1.72 0 0 1-1.33-.64l-4.21-5.1a2.1 2.1 0 0 1-.26-2.21A1.76 1.76 0 0 1 7.79 8h8.42a1.76 1.76 0 0 1 1.59 1.05 2.1 2.1 0 0 1-.26 2.21l-4.21 5.1A1.72 1.72 0 0 1 12 17z"
  }))));
};
var ArrowDownFill = function ArrowDownFill2() {
  return jsx("svg", {
    viewBox: "0 0 24 24",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, jsx("path", {
    d: "M12 17C11.494 17 11.01 16.767 10.674 16.358L6.46103 11.26C5.95703 10.649 5.85603 9.782 6.20203 9.049C6.50703 8.402 7.11403 8 7.78703 8H16.213C16.886 8 17.493 8.402 17.798 9.049C18.144 9.782 18.043 10.649 17.54 11.259L13.326 16.358C12.99 16.767 12.506 17 12 17"
  }), jsx("mask", {
    id: "mask0_0_2149",
    maskUnits: "userSpaceOnUse",
    x: "5",
    y: "8",
    width: "14",
    height: "9"
  }, jsx("path", {
    d: "M12 17C11.494 17 11.01 16.767 10.674 16.358L6.46103 11.26C5.95703 10.649 5.85603 9.782 6.20203 9.049C6.50703 8.402 7.11403 8 7.78703 8H16.213C16.886 8 17.493 8.402 17.798 9.049C18.144 9.782 18.043 10.649 17.54 11.259L13.326 16.358C12.99 16.767 12.506 17 12 17Z"
  })), jsx("g", {
    mask: "url(#mask0_0_2149)"
  }));
};
var ArrowDownFilled = function ArrowDownFilled2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "arrow-downward"
  }, jsx("rect", {
    width: "24",
    height: "24",
    transform: "rotate(-90 12 12)",
    opacity: "0"
  }), jsx("path", {
    d: "M12 17a1.72 1.72 0 0 1-1.33-.64l-4.21-5.1a2.1 2.1 0 0 1-.26-2.21A1.76 1.76 0 0 1 7.79 8h8.42a1.76 1.76 0 0 1 1.59 1.05 2.1 2.1 0 0 1-.26 2.21l-4.21 5.1A1.72 1.72 0 0 1 12 17z"
  }))));
};
var ArrowIosDownwardOutline = function ArrowIosDownwardOutline2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "arrow-ios-downward"
  }, jsx("rect", {
    width: "24",
    height: "24",
    opacity: "0"
  }), jsx("path", {
    d: "M12 16a1 1 0 0 1-.64-.23l-6-5a1 1 0 1 1 1.28-1.54L12 13.71l5.36-4.32a1 1 0 0 1 1.41.15 1 1 0 0 1-.14 1.46l-6 4.83A1 1 0 0 1 12 16z"
  }))));
};
var ArrowDownWithStem = function ArrowDownWithStem2() {
  return jsx("svg", {
    width: "20",
    height: "20",
    viewBox: "0 0 20 20",
    xmlns: "http://www.w3.org/2000/svg"
  }, jsx("path", {
    d: "M15.6405 11.1335C15.3455 10.7802 14.8205 10.7318 14.4672 11.0268L10.8339 14.0543V4.16683C10.8339 3.70683 10.4605 3.3335 10.0005 3.3335C9.54052 3.3335 9.16719 3.70683 9.16719 4.16683V14.0543L5.53385 11.0268C5.17969 10.7318 4.65469 10.7802 4.36052 11.1335C4.06552 11.4868 4.11302 12.0127 4.46719 12.3068L9.46719 16.4735C9.50636 16.5068 9.55302 16.5227 9.59636 16.5477C9.63052 16.5677 9.66052 16.591 9.69802 16.606C9.79552 16.6443 9.89719 16.6668 10.0005 16.6668C10.1039 16.6668 10.2055 16.6443 10.303 16.606C10.3405 16.591 10.3705 16.5677 10.4047 16.5477C10.448 16.5227 10.4947 16.5068 10.5339 16.4735L15.5339 12.3068C15.8872 12.0127 15.9355 11.4868 15.6405 11.1335"
  }), jsx("mask", {
    maskUnits: "userSpaceOnUse",
    x: "4",
    y: "3",
    width: "12",
    height: "14"
  }, jsx("path", {
    d: "M15.6405 11.1335C15.3455 10.7802 14.8205 10.7318 14.4672 11.0268L10.8339 14.0543V4.16683C10.8339 3.70683 10.4605 3.3335 10.0005 3.3335C9.54052 3.3335 9.16719 3.70683 9.16719 4.16683V14.0543L5.53385 11.0268C5.17969 10.7318 4.65469 10.7802 4.36052 11.1335C4.06552 11.4868 4.11302 12.0127 4.46719 12.3068L9.46719 16.4735C9.50636 16.5068 9.55302 16.5227 9.59636 16.5477C9.63052 16.5677 9.66052 16.591 9.69802 16.606C9.79552 16.6443 9.89719 16.6668 10.0005 16.6668C10.1039 16.6668 10.2055 16.6443 10.303 16.606C10.3405 16.591 10.3705 16.5677 10.4047 16.5477C10.448 16.5227 10.4947 16.5068 10.5339 16.4735L15.5339 12.3068C15.8872 12.0127 15.9355 11.4868 15.6405 11.1335"
  })), jsx("g", {
    mask: "url(#mask0_815_1646)"
  }));
};
var ArrowRight = function ArrowRight2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "arrow-right"
  }, jsx("rect", {
    width: "24",
    height: "24",
    transform: "rotate(180 12 12)",
    opacity: "0"
  }), jsx("path", {
    d: "M10.46 18a2.23 2.23 0 0 1-.91-.2 1.76 1.76 0 0 1-1.05-1.59V7.79A1.76 1.76 0 0 1 9.55 6.2a2.1 2.1 0 0 1 2.21.26l5.1 4.21a1.7 1.7 0 0 1 0 2.66l-5.1 4.21a2.06 2.06 0 0 1-1.3.46z"
  }))));
};
var ArrowHeadRight = function ArrowHeadRight2() {
  return jsx("svg", {
    width: "24",
    height: "24",
    viewBox: "0 0 24 24",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, jsx("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M13.9513 5.373L18.7793 11.373C19.0783 11.744 19.0733 12.274 18.7683 12.64L13.7683 18.64C13.5703 18.877 13.2863 19 12.9993 19C12.7743 19 12.5473 18.924 12.3603 18.768C11.9353 18.415 11.8783 17.784 12.2323 17.36L16.7083 11.989L12.3923 6.627C12.0463 6.197 12.1143 5.567 12.5453 5.221C12.9753 4.874 13.6043 4.943 13.9513 5.373ZM5.5452 5.221C5.9752 4.875 6.6042 4.943 6.9512 5.373L11.7792 11.373C12.0772 11.744 12.0732 12.274 11.7682 12.64L6.7682 18.64C6.5702 18.877 6.2862 19 5.9992 19C5.7742 19 5.5472 18.924 5.3602 18.768C4.9352 18.415 4.8782 17.784 5.2322 17.36L9.7072 11.989L5.3922 6.627C5.0462 6.197 5.1152 5.567 5.5452 5.221Z"
  }), jsx("mask", {
    style: {
      maskType: "alpha"
    },
    maskUnits: "userSpaceOnUse",
    x: "5",
    y: "4",
    width: "15",
    height: "15"
  }, jsx("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M13.9513 5.373L18.7793 11.373C19.0783 11.744 19.0733 12.274 18.7683 12.64L13.7683 18.64C13.5703 18.877 13.2863 19 12.9993 19C12.7743 19 12.5473 18.924 12.3603 18.768C11.9353 18.415 11.8783 17.784 12.2323 17.36L16.7083 11.989L12.3923 6.627C12.0463 6.197 12.1143 5.567 12.5453 5.221C12.9753 4.874 13.6043 4.943 13.9513 5.373ZM5.5452 5.221C5.9752 4.875 6.6042 4.943 6.9512 5.373L11.7792 11.373C12.0772 11.744 12.0732 12.274 11.7682 12.64L6.7682 18.64C6.5702 18.877 6.2862 19 5.9992 19C5.7742 19 5.5472 18.924 5.3602 18.768C4.9352 18.415 4.8782 17.784 5.2322 17.36L9.7072 11.989L5.3922 6.627C5.0462 6.197 5.1152 5.567 5.5452 5.221Z"
  })), jsx("g", {
    mask: "url(#mask0_0_111)"
  }));
};
var ArrowUp = function ArrowUp2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "arrow-up"
  }, jsx("rect", {
    width: "24",
    height: "24",
    transform: "rotate(90 12 12)",
    opacity: "0"
  }), jsx("path", {
    d: "M16.21 16H7.79a1.76 1.76 0 0 1-1.59-1 2.1 2.1 0 0 1 .26-2.21l4.21-5.1a1.76 1.76 0 0 1 2.66 0l4.21 5.1A2.1 2.1 0 0 1 17.8 15a1.76 1.76 0 0 1-1.59 1z"
  }))));
};
var ArrowUpFilled = function ArrowUpFilled2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "arrow-up"
  }, jsx("rect", {
    width: "24",
    height: "24",
    transform: "rotate(90 12 12)",
    opacity: "0"
  }), jsx("path", {
    d: "M16.21 16H7.79a1.76 1.76 0 0 1-1.59-1 2.1 2.1 0 0 1 .26-2.21l4.21-5.1a1.76 1.76 0 0 1 2.66 0l4.21 5.1A2.1 2.1 0 0 1 17.8 15a1.76 1.76 0 0 1-1.59 1z"
  }))));
};
var ArrowUpWithStem = function ArrowUpWithStem2() {
  return jsx("svg", {
    width: "20",
    height: "20",
    viewBox: "0 0 20 20",
    xmlns: "http://www.w3.org/2000/svg"
  }, jsx("path", {
    d: "M4.35927 8.86634C4.65427 9.21968 5.17927 9.26801 5.53261 8.97301L9.16594 5.94551V15.833C9.16594 16.293 9.53927 16.6663 9.99927 16.6663C10.4593 16.6663 10.8326 16.293 10.8326 15.833V5.94551L14.4659 8.97301C14.8201 9.26801 15.3451 9.21968 15.6393 8.86634C15.9343 8.51301 15.8868 7.98717 15.5326 7.69301L10.5326 3.52634C10.4934 3.49301 10.4468 3.47717 10.4034 3.45217C10.3693 3.43217 10.3393 3.40884 10.3018 3.39384C10.2043 3.35551 10.1026 3.33301 9.99927 3.33301C9.89594 3.33301 9.79427 3.35551 9.69677 3.39384C9.65927 3.40884 9.62927 3.43217 9.59511 3.45217C9.55177 3.47717 9.50511 3.49301 9.46594 3.52634L4.46594 7.69301C4.11261 7.98717 4.06427 8.51301 4.35927 8.86634Z"
  }), jsx("mask", {
    maskUnits: "userSpaceOnUse",
    x: "4",
    y: "3",
    width: "12",
    height: "14"
  }, jsx("path", {
    d: "M4.35927 8.86634C4.65427 9.21968 5.17927 9.26801 5.53261 8.97301L9.16594 5.94551V15.833C9.16594 16.293 9.53927 16.6663 9.99927 16.6663C10.4593 16.6663 10.8326 16.293 10.8326 15.833V5.94551L14.4659 8.97301C14.8201 9.26801 15.3451 9.21968 15.6393 8.86634C15.9343 8.51301 15.8868 7.98717 15.5326 7.69301L10.5326 3.52634C10.4934 3.49301 10.4468 3.47717 10.4034 3.45217C10.3693 3.43217 10.3393 3.40884 10.3018 3.39384C10.2043 3.35551 10.1026 3.33301 9.99927 3.33301C9.89594 3.33301 9.79427 3.35551 9.69677 3.39384C9.65927 3.40884 9.62927 3.43217 9.59511 3.45217C9.55177 3.47717 9.50511 3.49301 9.46594 3.52634L4.46594 7.69301C4.11261 7.98717 4.06427 8.51301 4.35927 8.86634Z"
  })));
};
var ArrowIosUpwardOutline = function ArrowIosUpwardOutline2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "arrow-ios-upward"
  }, jsx("rect", {
    width: "24",
    height: "24",
    transform: "rotate(180 12 12)",
    opacity: "0"
  }), jsx("path", {
    d: "M18 15a1 1 0 0 1-.64-.23L12 10.29l-5.37 4.32a1 1 0 0 1-1.41-.15 1 1 0 0 1 .15-1.41l6-4.83a1 1 0 0 1 1.27 0l6 5a1 1 0 0 1 .13 1.41A1 1 0 0 1 18 15z"
  }))));
};
var ArrowIosForwardOutline = function ArrowIosForwardOutline2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "arrow-ios-forward"
  }, jsx("rect", {
    width: "24",
    height: "24",
    transform: "rotate(-90 12 12)",
    opacity: "0"
  }), jsx("path", {
    d: "M10 19a1 1 0 0 1-.64-.23 1 1 0 0 1-.13-1.41L13.71 12 9.39 6.63a1 1 0 0 1 .15-1.41 1 1 0 0 1 1.46.15l4.83 6a1 1 0 0 1 0 1.27l-5 6A1 1 0 0 1 10 19z"
  }))));
};
var ArrowMix = function ArrowMix2() {
  return jsx("svg", {
    width: "24",
    height: "24",
    viewBox: "0 0 24 24",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, jsx("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M7.78812 11.4707H16.2141C16.8871 11.4707 17.4941 11.0688 17.7991 10.4218C18.1451 9.68875 18.0441 8.82175 17.5401 8.21075L13.3271 3.11275C12.6561 2.29575 11.3471 2.29575 10.6751 3.11275L6.46112 8.21175C5.95812 8.82175 5.85812 9.68875 6.20312 10.4218C6.50812 11.0688 7.11612 11.4707 7.78812 11.4707ZM15.9101 9.47075H8.01512L11.9991 4.64875L15.9101 9.47075Z"
  }), jsx("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M10.6751 20.858C11.0111 21.267 11.4951 21.5 12.0011 21.5C12.5071 21.5 12.9911 21.267 13.3271 20.858L17.5411 15.759C18.0441 15.149 18.1451 14.282 17.7991 13.549C17.4941 12.902 16.8871 12.5 16.2141 12.5H7.78806C7.11506 12.5 6.50806 12.902 6.20306 13.549C5.85806 14.282 5.95806 15.149 6.46206 15.76L10.6751 20.858ZM12.0031 19.322L8.09306 14.5H15.9881L12.0031 19.322Z"
  }));
};
var AlertTriangleOutline = function AlertTriangleOutline2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "alert-triangle"
  }, jsx("rect", {
    width: "24",
    height: "24",
    transform: "rotate(90 12 12)",
    opacity: "0"
  }), jsx("path", {
    d: "M22.56 16.3L14.89 3.58a3.43 3.43 0 0 0-5.78 0L1.44 16.3a3 3 0 0 0-.05 3A3.37 3.37 0 0 0 4.33 21h15.34a3.37 3.37 0 0 0 2.94-1.66 3 3 0 0 0-.05-3.04zm-1.7 2.05a1.31 1.31 0 0 1-1.19.65H4.33a1.31 1.31 0 0 1-1.19-.65 1 1 0 0 1 0-1l7.68-12.73a1.48 1.48 0 0 1 2.36 0l7.67 12.72a1 1 0 0 1 .01 1.01z"
  }), jsx("circle", {
    cx: "12",
    cy: "16",
    r: "1"
  }), jsx("path", {
    d: "M12 8a1 1 0 0 0-1 1v4a1 1 0 0 0 2 0V9a1 1 0 0 0-1-1z"
  }))));
};
var AlertTriangleFilled = function AlertTriangleFilled2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "alert-triangle"
  }, jsx("rect", {
    width: "24",
    height: "24",
    transform: "rotate(90 12 12)",
    opacity: "0"
  }), jsx("path", {
    d: "M22.56 16.3L14.89 3.58a3.43 3.43 0 0 0-5.78 0L1.44 16.3a3 3 0 0 0-.05 3A3.37 3.37 0 0 0 4.33 21h15.34a3.37 3.37 0 0 0 2.94-1.66 3 3 0 0 0-.05-3.04zM12 17a1 1 0 1 1 1-1 1 1 0 0 1-1 1zm1-4a1 1 0 0 1-2 0V9a1 1 0 0 1 2 0z"
  }))));
};
var AlertCircleOutline = function AlertCircleOutline2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "alert-circle"
  }, jsx("rect", {
    width: "24",
    height: "24",
    opacity: "0"
  }), jsx("path", {
    d: "M12 2a10 10 0 1 0 10 10A10 10 0 0 0 12 2zm0 18a8 8 0 1 1 8-8 8 8 0 0 1-8 8z"
  }), jsx("circle", {
    cx: "12",
    cy: "16",
    r: "1"
  }), jsx("path", {
    d: "M12 7a1 1 0 0 0-1 1v5a1 1 0 0 0 2 0V8a1 1 0 0 0-1-1z"
  }))));
};
var AlertCircleFilled = function AlertCircleFilled2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "alert-circle"
  }, jsx("rect", {
    width: "24",
    height: "24",
    opacity: "0"
  }), jsx("path", {
    d: "M12 2a10 10 0 1 0 10 10A10 10 0 0 0 12 2zm0 15a1 1 0 1 1 1-1 1 1 0 0 1-1 1zm1-4a1 1 0 0 1-2 0V8a1 1 0 0 1 2 0z"
  }))));
};
var Bell = function Bell2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "bell"
  }, jsx("rect", {
    width: "24",
    height: "24",
    opacity: "0"
  }), jsx("path", {
    d: "M20.52 15.21l-1.8-1.81V8.94a6.86 6.86 0 0 0-5.82-6.88 6.74 6.74 0 0 0-7.62 6.67v4.67l-1.8 1.81A1.64 1.64 0 0 0 4.64 18H8v.34A3.84 3.84 0 0 0 12 22a3.84 3.84 0 0 0 4-3.66V18h3.36a1.64 1.64 0 0 0 1.16-2.79zM14 18.34A1.88 1.88 0 0 1 12 20a1.88 1.88 0 0 1-2-1.66V18h4z"
  }))));
};
var BellOutline = function BellOutline2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "bell"
  }, jsx("rect", {
    width: "24",
    height: "24",
    opacity: "0"
  }), jsx("path", {
    d: "M20.52 15.21l-1.8-1.81V8.94a6.86 6.86 0 0 0-5.82-6.88 6.74 6.74 0 0 0-7.62 6.67v4.67l-1.8 1.81A1.64 1.64 0 0 0 4.64 18H8v.34A3.84 3.84 0 0 0 12 22a3.84 3.84 0 0 0 4-3.66V18h3.36a1.64 1.64 0 0 0 1.16-2.79zM14 18.34A1.88 1.88 0 0 1 12 20a1.88 1.88 0 0 1-2-1.66V18h4zM5.51 16l1.18-1.18a2 2 0 0 0 .59-1.42V8.73A4.73 4.73 0 0 1 8.9 5.17 4.67 4.67 0 0 1 12.64 4a4.86 4.86 0 0 1 4.08 4.9v4.5a2 2 0 0 0 .58 1.42L18.49 16z"
  }))));
};
var BookOpen = function BookOpen2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "book-open"
  }, jsx("rect", {
    width: "24",
    height: "24",
    transform: "rotate(180 12 12)",
    opacity: "0"
  }), jsx("path", {
    d: "M20.62 4.22a1 1 0 0 0-.84-.2L12 5.77 4.22 4A1 1 0 0 0 3 5v12.2a1 1 0 0 0 .78 1l8 1.8h.44l8-1.8a1 1 0 0 0 .78-1V5a1 1 0 0 0-.38-.78zM5 6.25l6 1.35v10.15L5 16.4zM19 16.4l-6 1.35V7.6l6-1.35z"
  }))));
};
var BookOpenFilled = function BookOpenFilled2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "book-open"
  }, jsx("rect", {
    width: "24",
    height: "24",
    transform: "rotate(180 12 12)",
    opacity: "0"
  }), jsx("path", {
    d: "M21 4.34a1.24 1.24 0 0 0-1.08-.23L13 5.89v14.27l7.56-1.94A1.25 1.25 0 0 0 21.5 17V5.32a1.25 1.25 0 0 0-.5-.98z"
  }), jsx("path", {
    d: "M11 5.89L4.06 4.11A1.27 1.27 0 0 0 3 4.34a1.25 1.25 0 0 0-.48 1V17a1.25 1.25 0 0 0 .94 1.21L11 20.16z"
  }))));
};
var BookFilled = function BookFilled2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "book"
  }, jsx("rect", {
    width: "24",
    height: "24",
    opacity: "0"
  }), jsx("path", {
    d: "M19 3H7a3 3 0 0 0-3 3v12a3 3 0 0 0 3 3h12a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1zM7 19a1 1 0 0 1 0-2h11v2z"
  }))));
};
var BookOutline = function BookOutline2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "book"
  }, jsx("rect", {
    width: "24",
    height: "24",
    opacity: "0"
  }), jsx("path", {
    d: "M19 3H7a3 3 0 0 0-3 3v12a3 3 0 0 0 3 3h12a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1zM7 5h11v10H7a3 3 0 0 0-1 .18V6a1 1 0 0 1 1-1zm0 14a1 1 0 0 1 0-2h11v2z"
  }))));
};
var BrowserOutline = function BrowserOutline2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "browser"
  }, jsx("rect", {
    width: "24",
    height: "24",
    opacity: "0"
  }), jsx("path", {
    d: "M18 3H6a3 3 0 0 0-3 3v12a3 3 0 0 0 3 3h12a3 3 0 0 0 3-3V6a3 3 0 0 0-3-3zm1 15a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1v-7h14zM5 9V6a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3z"
  }), jsx("circle", {
    cx: "8",
    cy: "7.03",
    r: "1"
  }), jsx("circle", {
    cx: "12",
    cy: "7.03",
    r: "1"
  }))));
};
var CalendarOutline = function CalendarOutline2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "calendar"
  }, jsx("rect", {
    width: "24",
    height: "24",
    opacity: "0"
  }), jsx("path", {
    d: "M18 4h-1V3a1 1 0 0 0-2 0v1H9V3a1 1 0 0 0-2 0v1H6a3 3 0 0 0-3 3v12a3 3 0 0 0 3 3h12a3 3 0 0 0 3-3V7a3 3 0 0 0-3-3zM6 6h1v1a1 1 0 0 0 2 0V6h6v1a1 1 0 0 0 2 0V6h1a1 1 0 0 1 1 1v4H5V7a1 1 0 0 1 1-1zm12 14H6a1 1 0 0 1-1-1v-6h14v6a1 1 0 0 1-1 1z"
  }), jsx("circle", {
    cx: "8",
    cy: "16",
    r: "1"
  }), jsx("path", {
    d: "M16 15h-4a1 1 0 0 0 0 2h4a1 1 0 0 0 0-2z"
  }))));
};
var Column = function Column2() {
  return jsx("svg", {
    width: "12",
    height: "13",
    viewBox: "0 0 12 13",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, jsx("path", {
    d: "M2.2 12.4H9.8C10.0889 12.4 10.375 12.3431 10.6419 12.2325C10.9088 12.122 11.1513 11.9599 11.3556 11.7556C11.5599 11.5513 11.722 11.3088 11.8325 11.0419C11.9431 10.775 12 10.4889 12 10.2V2.2C12 1.91109 11.9431 1.62501 11.8325 1.3581C11.722 1.09118 11.5599 0.848654 11.3556 0.644365C11.1513 0.440076 10.9088 0.278026 10.6419 0.167465C10.375 0.0569049 10.0889 0 9.8 0H2.2C1.61652 0 1.05694 0.231785 0.644365 0.644365C0.231785 1.05694 0 1.61652 0 2.2V10.2C0 10.7835 0.231785 11.3431 0.644365 11.7556C1.05694 12.1682 1.61652 12.4 2.2 12.4ZM4.8 11.2V1.2H7.2V11.2H4.8ZM10.8 2.2V10.2C10.8 10.4652 10.6946 10.7196 10.5071 10.9071C10.3196 11.0946 10.0652 11.2 9.8 11.2H8.4V1.2H9.8C10.0652 1.2 10.3196 1.30536 10.5071 1.49289C10.6946 1.68043 10.8 1.93478 10.8 2.2ZM1.2 2.2C1.2 1.93478 1.30536 1.68043 1.49289 1.49289C1.68043 1.30536 1.93478 1.2 2.2 1.2H3.6V11.2H2.2C1.93478 11.2 1.68043 11.0946 1.49289 10.9071C1.30536 10.7196 1.2 10.4652 1.2 10.2V2.2Z"
  }));
};
var Code = function Code2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "code"
  }, jsx("rect", {
    width: "24",
    height: "24",
    transform: "rotate(90 12 12)",
    opacity: "0"
  }), jsx("path", {
    d: "M8.64 5.23a1 1 0 0 0-1.41.13l-5 6a1 1 0 0 0 0 1.27l4.83 6a1 1 0 0 0 .78.37 1 1 0 0 0 .78-1.63L4.29 12l4.48-5.36a1 1 0 0 0-.13-1.41z"
  }), jsx("path", {
    d: "M21.78 11.37l-4.78-6a1 1 0 0 0-1.41-.15 1 1 0 0 0-.15 1.41L19.71 12l-4.48 5.37a1 1 0 0 0 .13 1.41A1 1 0 0 0 16 19a1 1 0 0 0 .77-.36l5-6a1 1 0 0 0 .01-1.27z"
  }))));
};
var CodeDownload = function CodeDownload2() {
  return jsx("svg", {
    width: "24",
    height: "24",
    viewBox: "0 0 24 24",
    xmlns: "http://www.w3.org/2000/svg"
  }, jsx("g", null, jsx("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M21.7793 11.373L16.9513 5.373C16.6033 4.943 15.9743 4.873 15.5453 5.221C15.1143 5.567 15.0473 6.196 15.3923 6.627L19.7083 11.989L15.2313 17.359C14.8783 17.784 14.9353 18.415 15.3593 18.769C15.5473 18.924 15.7733 19 15.9993 19C16.2863 19 16.5703 18.878 16.7683 18.641L21.7683 12.641C22.0733 12.274 22.0783 11.744 21.7793 11.373ZM4.29198 12.0107L8.76898 6.6407C9.12198 6.2157 9.06398 5.5847 8.64098 5.2317C8.21498 4.8787 7.58598 4.9357 7.23098 5.3597L2.23098 11.3597C1.92698 11.7257 1.92198 12.2557 2.22098 12.6267L7.04898 18.6267C7.24698 18.8717 7.53598 18.9997 7.82898 18.9997C8.04898 18.9997 8.27098 18.9277 8.45498 18.7797C8.88598 18.4327 8.95298 17.8037 8.60698 17.3727L4.29198 12.0107ZM14.3057 11.3842C14.7017 11.0002 15.3367 11.0132 15.7197 11.4092C16.1027 11.8062 16.0917 12.4392 15.6947 12.8232L12.6947 15.7202C12.5007 15.9062 12.2497 16.0002 11.9997 16.0002C11.7437 16.0002 11.4887 15.9022 11.2927 15.7072L8.29268 12.7072C7.90268 12.3162 7.90268 11.6832 8.29268 11.2932C8.68368 10.9022 9.31668 10.9022 9.70668 11.2932L10.9997 12.5852V8.0002C10.9997 7.4472 11.4477 7.0002 11.9997 7.0002C12.5527 7.0002 12.9997 7.4472 12.9997 8.0002V12.6442L14.3057 11.3842Z"
  }), jsx("mask", {
    id: "mask0_0_1632",
    style: {
      maskType: "alpha"
    },
    maskUnits: "userSpaceOnUse",
    x: "1",
    y: "4",
    width: "22",
    height: "15"
  }, jsx("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M21.7793 11.373L16.9513 5.373C16.6033 4.943 15.9743 4.873 15.5453 5.221C15.1143 5.567 15.0473 6.196 15.3923 6.627L19.7083 11.989L15.2313 17.359C14.8783 17.784 14.9353 18.415 15.3593 18.769C15.5473 18.924 15.7733 19 15.9993 19C16.2863 19 16.5703 18.878 16.7683 18.641L21.7683 12.641C22.0733 12.274 22.0783 11.744 21.7793 11.373ZM4.29198 12.0107L8.76898 6.6407C9.12198 6.2157 9.06398 5.5847 8.64098 5.2317C8.21498 4.8787 7.58598 4.9357 7.23098 5.3597L2.23098 11.3597C1.92698 11.7257 1.92198 12.2557 2.22098 12.6267L7.04898 18.6267C7.24698 18.8717 7.53598 18.9997 7.82898 18.9997C8.04898 18.9997 8.27098 18.9277 8.45498 18.7797C8.88598 18.4327 8.95298 17.8037 8.60698 17.3727L4.29198 12.0107ZM14.3057 11.3842C14.7017 11.0002 15.3367 11.0132 15.7197 11.4092C16.1027 11.8062 16.0917 12.4392 15.6947 12.8232L12.6947 15.7202C12.5007 15.9062 12.2497 16.0002 11.9997 16.0002C11.7437 16.0002 11.4887 15.9022 11.2927 15.7072L8.29268 12.7072C7.90268 12.3162 7.90268 11.6832 8.29268 11.2932C8.68368 10.9022 9.31668 10.9022 9.70668 11.2932L10.9997 12.5852V8.0002C10.9997 7.4472 11.4477 7.0002 11.9997 7.0002C12.5527 7.0002 12.9997 7.4472 12.9997 8.0002V12.6442L14.3057 11.3842Z"
  })), jsx("g", {
    mask: "url(#mask0_0_1632)"
  })));
};
var ChevronLeft = function ChevronLeft2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "chevron-left"
  }, jsx("rect", {
    width: "24",
    height: "24",
    transform: "rotate(90 12 12)",
    opacity: "0"
  }), jsx("path", {
    d: "M13.36 17a1 1 0 0 1-.72-.31l-3.86-4a1 1 0 0 1 0-1.4l4-4a1 1 0 1 1 1.42 1.42L10.9 12l3.18 3.3a1 1 0 0 1 0 1.41 1 1 0 0 1-.72.29z"
  }))));
};
var ChevronRight = function ChevronRight2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "chevron-right"
  }, jsx("rect", {
    width: "24",
    height: "24",
    transform: "rotate(-90 12 12)",
    opacity: "0"
  }), jsx("path", {
    d: "M10.5 17a1 1 0 0 1-.71-.29 1 1 0 0 1 0-1.42L13.1 12 9.92 8.69a1 1 0 0 1 0-1.41 1 1 0 0 1 1.42 0l3.86 4a1 1 0 0 1 0 1.4l-4 4a1 1 0 0 1-.7.32z"
  }))));
};
var ChevronRightOutline = function ChevronRightOutline2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "chevron-right"
  }, jsx("rect", {
    width: "24",
    height: "24",
    transform: "rotate(-90 12 12)",
    opacity: "0"
  }), jsx("path", {
    d: "M10.5 17a1 1 0 0 1-.71-.29 1 1 0 0 1 0-1.42L13.1 12 9.92 8.69a1 1 0 0 1 0-1.41 1 1 0 0 1 1.42 0l3.86 4a1 1 0 0 1 0 1.4l-4 4a1 1 0 0 1-.7.32z"
  }))));
};
var ChevronUp = function ChevronUp2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "chevron-up"
  }, jsx("rect", {
    width: "24",
    height: "24",
    transform: "rotate(180 12 12)",
    opacity: "0"
  }), jsx("path", {
    d: "M16 14.5a1 1 0 0 1-.71-.29L12 10.9l-3.3 3.18a1 1 0 0 1-1.41 0 1 1 0 0 1 0-1.42l4-3.86a1 1 0 0 1 1.4 0l4 4a1 1 0 0 1 0 1.42 1 1 0 0 1-.69.28z"
  }))));
};
var ChevronDown = function ChevronDown2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "chevron-down"
  }, jsx("rect", {
    width: "24",
    height: "24",
    opacity: "0"
  }), jsx("path", {
    d: "M12 15.5a1 1 0 0 1-.71-.29l-4-4a1 1 0 1 1 1.42-1.42L12 13.1l3.3-3.18a1 1 0 1 1 1.38 1.44l-4 3.86a1 1 0 0 1-.68.28z"
  }))));
};
var ChevronDownOutline = function ChevronDownOutline2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "chevron-down"
  }, jsx("rect", {
    width: "24",
    height: "24",
    opacity: "0"
  }), jsx("path", {
    d: "M12 15.5a1 1 0 0 1-.71-.29l-4-4a1 1 0 1 1 1.42-1.42L12 13.1l3.3-3.18a1 1 0 1 1 1.38 1.44l-4 3.86a1 1 0 0 1-.68.28z"
  }))));
};
var Cube = function Cube2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "cube"
  }, jsx("rect", {
    width: "24",
    height: "24",
    opacity: "0"
  }), jsx("path", {
    d: "M11.25 11.83L3 8.36v7.73a1.69 1.69 0 0 0 1 1.52L11.19 21h.06z"
  }), jsx("path", {
    d: "M12 10.5l8.51-3.57a1.62 1.62 0 0 0-.51-.38l-7.2-3.37a1.87 1.87 0 0 0-1.6 0L4 6.55a1.62 1.62 0 0 0-.51.38z"
  }), jsx("path", {
    d: "M12.75 11.83V21h.05l7.2-3.39a1.69 1.69 0 0 0 1-1.51V8.36z"
  }))));
};
var CubeOutline = function CubeOutline2() {
  return jsx("svg", {
    width: "24",
    height: "24",
    viewBox: "0 0 24 24",
    xmlns: "http://www.w3.org/2000/svg"
  }, jsx("g", {
    id: "cube"
  }, jsx("path", {
    id: "\xF0\x9F\x8E\xA8 Icon \xD0\xA1olor",
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M20.654 7.24778C20.6545 7.25157 20.655 7.25534 20.6564 7.25891C20.8684 7.62191 20.9994 8.02891 21.0004 8.45691V15.5399C20.9994 16.4879 20.4224 17.3659 19.5304 17.7779L13.1334 20.7499C12.7724 20.9179 12.3844 21.0019 11.9964 21.0019C11.6074 21.0019 11.2194 20.9179 10.8574 20.7489L4.45839 17.7769C3.56439 17.3589 2.99239 16.4749 3.00039 15.5249V8.45791C3.00039 8.02991 3.13139 7.62291 3.34239 7.26091C3.34439 7.25641 3.34514 7.25191 3.34589 7.24741C3.34664 7.24291 3.34739 7.23841 3.34939 7.23391C3.35141 7.22986 3.35446 7.22633 3.35763 7.22266C3.36072 7.21907 3.36392 7.21536 3.36639 7.21091C3.40377 7.14975 3.44764 7.09363 3.49188 7.03705C3.49972 7.02703 3.50756 7.017 3.51539 7.00691C3.52685 6.99407 3.53758 6.98061 3.54827 6.96723C3.56835 6.94207 3.58824 6.91715 3.61239 6.89691C3.84739 6.62091 4.12539 6.37891 4.46939 6.21991L10.8664 3.24791C11.5874 2.91591 12.4124 2.91491 13.1314 3.24691C13.1314 3.24791 13.1324 3.24791 13.1334 3.24791L19.5334 6.22091C19.8774 6.37991 20.1544 6.62291 20.3894 6.89891C20.4111 6.91742 20.4291 6.93959 20.4474 6.96205C20.4577 6.97478 20.4682 6.98761 20.4794 6.99991C20.492 7.01663 20.5049 7.03318 20.5177 7.04972C20.5586 7.10243 20.5994 7.15507 20.6344 7.21291C20.6365 7.21633 20.6392 7.21919 20.6418 7.22198C20.6453 7.22572 20.6487 7.22933 20.6504 7.23391C20.6526 7.23834 20.6533 7.24308 20.654 7.24778ZM11.7074 5.06391C11.7984 5.02091 11.8994 4.99991 12.0004 4.99991C12.1004 4.99991 12.2014 5.02091 12.2924 5.06391L17.6214 7.53791L12.0004 10.1499L6.37839 7.53791L11.7074 5.06391ZM5.00039 15.5319C4.99839 15.7139 5.11439 15.8759 5.30339 15.9639L11.0004 18.6089V11.8909L5.00039 9.10391V15.5319ZM13.0004 18.6069L18.6904 15.9629C18.8824 15.8749 19.0004 15.7129 19.0004 15.5389V9.10391L13.0004 11.8909V18.6069Z"
  }), jsx("mask", {
    id: "mask0_0_196",
    "mask-type": "alpha",
    maskUnits: "userSpaceOnUse",
    x: "3",
    y: "2",
    width: "19",
    height: "20"
  }, jsx("path", {
    id: "\xF0\x9F\x8E\xA8 Icon \xD0\xA1olor_2",
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M20.654 7.24778C20.6545 7.25157 20.655 7.25534 20.6564 7.25891C20.8684 7.62191 20.9994 8.02891 21.0004 8.45691V15.5399C20.9994 16.4879 20.4224 17.3659 19.5304 17.7779L13.1334 20.7499C12.7724 20.9179 12.3844 21.0019 11.9964 21.0019C11.6074 21.0019 11.2194 20.9179 10.8574 20.7489L4.45839 17.7769C3.56439 17.3589 2.99239 16.4749 3.00039 15.5249V8.45791C3.00039 8.02991 3.13139 7.62291 3.34239 7.26091C3.34439 7.25641 3.34514 7.25191 3.34589 7.24741C3.34664 7.24291 3.34739 7.23841 3.34939 7.23391C3.35141 7.22986 3.35446 7.22633 3.35763 7.22266C3.36072 7.21907 3.36392 7.21536 3.36639 7.21091C3.40377 7.14975 3.44764 7.09363 3.49188 7.03705C3.49972 7.02703 3.50756 7.017 3.51539 7.00691C3.52685 6.99407 3.53758 6.98061 3.54827 6.96723C3.56835 6.94207 3.58824 6.91715 3.61239 6.89691C3.84739 6.62091 4.12539 6.37891 4.46939 6.21991L10.8664 3.24791C11.5874 2.91591 12.4124 2.91491 13.1314 3.24691C13.1314 3.24791 13.1324 3.24791 13.1334 3.24791L19.5334 6.22091C19.8774 6.37991 20.1544 6.62291 20.3894 6.89891C20.4111 6.91742 20.4291 6.93959 20.4474 6.96205C20.4577 6.97478 20.4682 6.98761 20.4794 6.99991C20.492 7.01663 20.5049 7.03318 20.5177 7.04972C20.5586 7.10243 20.5994 7.15507 20.6344 7.21291C20.6365 7.21633 20.6392 7.21919 20.6418 7.22198C20.6453 7.22572 20.6487 7.22933 20.6504 7.23391C20.6526 7.23834 20.6533 7.24308 20.654 7.24778ZM11.7074 5.06391C11.7984 5.02091 11.8994 4.99991 12.0004 4.99991C12.1004 4.99991 12.2014 5.02091 12.2924 5.06391L17.6214 7.53791L12.0004 10.1499L6.37839 7.53791L11.7074 5.06391ZM5.00039 15.5319C4.99839 15.7139 5.11439 15.8759 5.30339 15.9639L11.0004 18.6089V11.8909L5.00039 9.10391V15.5319ZM13.0004 18.6069L18.6904 15.9629C18.8824 15.8749 19.0004 15.7129 19.0004 15.5389V9.10391L13.0004 11.8909V18.6069Z"
  })), jsx("g", {
    mask: "url(#mask0_0_196)"
  })));
};
var ClockOutline = function ClockOutline2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "clock"
  }, jsx("rect", {
    width: "24",
    height: "24",
    transform: "rotate(180 12 12)",
    opacity: "0"
  }), jsx("path", {
    d: "M12 2a10 10 0 1 0 10 10A10 10 0 0 0 12 2zm0 18a8 8 0 1 1 8-8 8 8 0 0 1-8 8z"
  }), jsx("path", {
    d: "M16 11h-3V8a1 1 0 0 0-2 0v4a1 1 0 0 0 1 1h4a1 1 0 0 0 0-2z"
  }))));
};
var Checkmark = function Checkmark2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "checkmark"
  }, jsx("rect", {
    width: "24",
    height: "24",
    opacity: "0"
  }), jsx("path", {
    d: "M9.86 18a1 1 0 0 1-.73-.32l-4.86-5.17a1 1 0 1 1 1.46-1.37l4.12 4.39 8.41-9.2a1 1 0 1 1 1.48 1.34l-9.14 10a1 1 0 0 1-.73.33z"
  }))));
};
var CheckmarkCircle = function CheckmarkCircle2() {
  return jsx("svg", {
    width: "24",
    height: "24",
    viewBox: "0 0 24 24",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, jsx("g", null, jsx("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M20.997 10.9741H21C21.551 10.9741 21.999 11.4201 22 11.9711C22.008 14.6421 20.975 17.1571 19.091 19.0511C17.208 20.9451 14.7 21.9921 12.029 22.0001H12C9.339 22.0001 6.836 20.9681 4.949 19.0911C3.055 17.2081 2.008 14.7001 2 12.0291C1.992 9.3571 3.025 6.8431 4.909 4.9491C6.792 3.0551 9.3 2.0081 11.971 2.0001C12.766 2.0121 13.576 2.0921 14.352 2.2781C14.888 2.4081 15.219 2.9481 15.089 3.4851C14.96 4.0211 14.417 4.3511 13.883 4.2231C13.262 4.0731 12.603 4.0101 11.977 4.0001C9.84 4.0061 7.833 4.8441 6.327 6.3591C4.82 7.8741 3.994 9.8861 4 12.0231C4.006 14.1601 4.844 16.1661 6.359 17.6731C7.869 19.1741 9.871 20.0001 12 20.0001H12.023C14.16 19.9941 16.167 19.1561 17.673 17.6411C19.18 16.1251 20.006 14.1141 20 11.9771C19.999 11.4251 20.445 10.9751 20.997 10.9741ZM8.293 11.293C8.684 10.902 9.316 10.902 9.707 11.293L11.951 13.537L18.248 6.341C18.612 5.928 19.243 5.884 19.659 6.248C20.074 6.611 20.116 7.243 19.752 7.659L12.752 15.659C12.57 15.867 12.31 15.99 12.033 16H12C11.735 16 11.481 15.895 11.293 15.707L8.293 12.707C7.902 12.316 7.902 11.684 8.293 11.293Z"
  }), jsx("mask", {
    "mask-type": "alpha",
    maskUnits: "userSpaceOnUse",
    x: "2",
    y: "2",
    width: "20",
    height: "20"
  }, jsx("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M20.997 10.9741H21C21.551 10.9741 21.999 11.4201 22 11.9711C22.008 14.6421 20.975 17.1571 19.091 19.0511C17.208 20.9451 14.7 21.9921 12.029 22.0001H12C9.339 22.0001 6.836 20.9681 4.949 19.0911C3.055 17.2081 2.008 14.7001 2 12.0291C1.992 9.3571 3.025 6.8431 4.909 4.9491C6.792 3.0551 9.3 2.0081 11.971 2.0001C12.766 2.0121 13.576 2.0921 14.352 2.2781C14.888 2.4081 15.219 2.9481 15.089 3.4851C14.96 4.0211 14.417 4.3511 13.883 4.2231C13.262 4.0731 12.603 4.0101 11.977 4.0001C9.84 4.0061 7.833 4.8441 6.327 6.3591C4.82 7.8741 3.994 9.8861 4 12.0231C4.006 14.1601 4.844 16.1661 6.359 17.6731C7.869 19.1741 9.871 20.0001 12 20.0001H12.023C14.16 19.9941 16.167 19.1561 17.673 17.6411C19.18 16.1251 20.006 14.1141 20 11.9771C19.999 11.4251 20.445 10.9751 20.997 10.9741ZM8.293 11.293C8.684 10.902 9.316 10.902 9.707 11.293L11.951 13.537L18.248 6.341C18.612 5.928 19.243 5.884 19.659 6.248C20.074 6.611 20.116 7.243 19.752 7.659L12.752 15.659C12.57 15.867 12.31 15.99 12.033 16H12C11.735 16 11.481 15.895 11.293 15.707L8.293 12.707C7.902 12.316 7.902 11.684 8.293 11.293Z"
  })), jsx("g", {
    mask: "url(#mask0)"
  })));
};
var CheckmarkOutline = function CheckmarkOutline2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "checkmark"
  }, jsx("rect", {
    width: "24",
    height: "24",
    opacity: "0"
  }), jsx("path", {
    d: "M9.86 18a1 1 0 0 1-.73-.32l-4.86-5.17a1 1 0 1 1 1.46-1.37l4.12 4.39 8.41-9.2a1 1 0 1 1 1.48 1.34l-9.14 10a1 1 0 0 1-.73.33z"
  }))));
};
var CheckmarkCircleOutline = function CheckmarkCircleOutline2() {
  return jsx("svg", {
    width: "24",
    height: "24",
    viewBox: "0 0 24 24",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, jsx("g", null, jsx("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M20.997 10.9741H21C21.551 10.9741 21.999 11.4201 22 11.9711C22.008 14.6421 20.975 17.1571 19.091 19.0511C17.208 20.9451 14.7 21.9921 12.029 22.0001H12C9.339 22.0001 6.836 20.9681 4.949 19.0911C3.055 17.2081 2.008 14.7001 2 12.0291C1.992 9.3571 3.025 6.8431 4.909 4.9491C6.792 3.0551 9.3 2.0081 11.971 2.0001C12.766 2.0121 13.576 2.0921 14.352 2.2781C14.888 2.4081 15.219 2.9481 15.089 3.4851C14.96 4.0211 14.417 4.3511 13.883 4.2231C13.262 4.0731 12.603 4.0101 11.977 4.0001C9.84 4.0061 7.833 4.8441 6.327 6.3591C4.82 7.8741 3.994 9.8861 4 12.0231C4.006 14.1601 4.844 16.1661 6.359 17.6731C7.869 19.1741 9.871 20.0001 12 20.0001H12.023C14.16 19.9941 16.167 19.1561 17.673 17.6411C19.18 16.1251 20.006 14.1141 20 11.9771C19.999 11.4251 20.445 10.9751 20.997 10.9741ZM8.293 11.293C8.684 10.902 9.316 10.902 9.707 11.293L11.951 13.537L18.248 6.341C18.612 5.928 19.243 5.884 19.659 6.248C20.074 6.611 20.116 7.243 19.752 7.659L12.752 15.659C12.57 15.867 12.31 15.99 12.033 16H12C11.735 16 11.481 15.895 11.293 15.707L8.293 12.707C7.902 12.316 7.902 11.684 8.293 11.293Z"
  }), jsx("mask", {
    "mask-type": "alpha",
    maskUnits: "userSpaceOnUse",
    x: "2",
    y: "2",
    width: "20",
    height: "20"
  }, jsx("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M20.997 10.9741H21C21.551 10.9741 21.999 11.4201 22 11.9711C22.008 14.6421 20.975 17.1571 19.091 19.0511C17.208 20.9451 14.7 21.9921 12.029 22.0001H12C9.339 22.0001 6.836 20.9681 4.949 19.0911C3.055 17.2081 2.008 14.7001 2 12.0291C1.992 9.3571 3.025 6.8431 4.909 4.9491C6.792 3.0551 9.3 2.0081 11.971 2.0001C12.766 2.0121 13.576 2.0921 14.352 2.2781C14.888 2.4081 15.219 2.9481 15.089 3.4851C14.96 4.0211 14.417 4.3511 13.883 4.2231C13.262 4.0731 12.603 4.0101 11.977 4.0001C9.84 4.0061 7.833 4.8441 6.327 6.3591C4.82 7.8741 3.994 9.8861 4 12.0231C4.006 14.1601 4.844 16.1661 6.359 17.6731C7.869 19.1741 9.871 20.0001 12 20.0001H12.023C14.16 19.9941 16.167 19.1561 17.673 17.6411C19.18 16.1251 20.006 14.1141 20 11.9771C19.999 11.4251 20.445 10.9751 20.997 10.9741ZM8.293 11.293C8.684 10.902 9.316 10.902 9.707 11.293L11.951 13.537L18.248 6.341C18.612 5.928 19.243 5.884 19.659 6.248C20.074 6.611 20.116 7.243 19.752 7.659L12.752 15.659C12.57 15.867 12.31 15.99 12.033 16H12C11.735 16 11.481 15.895 11.293 15.707L8.293 12.707C7.902 12.316 7.902 11.684 8.293 11.293Z"
  })), jsx("g", {
    mask: "url(#mask0)"
  })));
};
var CheckmarkCircleFilled = function CheckmarkCircleFilled2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "checkmark-circle-2"
  }, jsx("rect", {
    width: "24",
    height: "24",
    opacity: "0"
  }), jsx("path", {
    d: "M12 2a10 10 0 1 0 10 10A10 10 0 0 0 12 2zm4.3 7.61l-4.57 6a1 1 0 0 1-.79.39 1 1 0 0 1-.79-.38l-2.44-3.11a1 1 0 0 1 1.58-1.23l1.63 2.08 3.78-5a1 1 0 1 1 1.6 1.22z"
  }))));
};
var CloseCircle = function CloseCircle2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "close-circle"
  }, jsx("rect", {
    width: "24",
    height: "24",
    opacity: "0"
  }), jsx("path", {
    d: "M12 2a10 10 0 1 0 10 10A10 10 0 0 0 12 2zm2.71 11.29a1 1 0 0 1 0 1.42 1 1 0 0 1-1.42 0L12 13.41l-1.29 1.3a1 1 0 0 1-1.42 0 1 1 0 0 1 0-1.42l1.3-1.29-1.3-1.29a1 1 0 0 1 1.42-1.42l1.29 1.3 1.29-1.3a1 1 0 0 1 1.42 1.42L13.41 12z"
  }))));
};
var CloseOutline = function CloseOutline2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "close"
  }, jsx("rect", {
    width: "24",
    height: "24",
    transform: "rotate(180 12 12)",
    opacity: "0"
  }), jsx("path", {
    d: "M13.41 12l4.3-4.29a1 1 0 1 0-1.42-1.42L12 10.59l-4.29-4.3a1 1 0 0 0-1.42 1.42l4.3 4.29-4.3 4.29a1 1 0 0 0 0 1.42 1 1 0 0 0 1.42 0l4.29-4.3 4.29 4.3a1 1 0 0 0 1.42 0 1 1 0 0 0 0-1.42z"
  }))));
};
var CloseCircleOutline = function CloseCircleOutline2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "close-circle"
  }, jsx("rect", {
    width: "24",
    height: "24",
    opacity: "0"
  }), jsx("path", {
    d: "M12 2a10 10 0 1 0 10 10A10 10 0 0 0 12 2zm0 18a8 8 0 1 1 8-8 8 8 0 0 1-8 8z"
  }), jsx("path", {
    d: "M14.71 9.29a1 1 0 0 0-1.42 0L12 10.59l-1.29-1.3a1 1 0 0 0-1.42 1.42l1.3 1.29-1.3 1.29a1 1 0 0 0 0 1.42 1 1 0 0 0 1.42 0l1.29-1.3 1.29 1.3a1 1 0 0 0 1.42 0 1 1 0 0 0 0-1.42L13.41 12l1.3-1.29a1 1 0 0 0 0-1.42z"
  }))));
};
var ClipboardCopy = function ClipboardCopy2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "clipboard"
  }, jsx("rect", {
    width: "24",
    height: "24",
    opacity: "0"
  }), jsx("path", {
    d: "M18 5V4a2 2 0 0 0-2-2H8a2 2 0 0 0-2 2v1a3 3 0 0 0-3 3v11a3 3 0 0 0 3 3h12a3 3 0 0 0 3-3V8a3 3 0 0 0-3-3zM8 4h8v4H8V4zm11 15a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1v1a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V7a1 1 0 0 1 1 1z"
  }))));
};
var CollapseOutline = function CollapseOutline2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "collapse"
  }, jsx("rect", {
    width: "24",
    height: "24",
    transform: "rotate(180 12 12)",
    opacity: "0"
  }), jsx("path", {
    d: "M19 9h-2.58l3.29-3.29a1 1 0 1 0-1.42-1.42L15 7.57V5a1 1 0 0 0-1-1 1 1 0 0 0-1 1v5a1 1 0 0 0 1 1h5a1 1 0 0 0 0-2z"
  }), jsx("path", {
    d: "M10 13H5a1 1 0 0 0 0 2h2.57l-3.28 3.29a1 1 0 0 0 0 1.42 1 1 0 0 0 1.42 0L9 16.42V19a1 1 0 0 0 1 1 1 1 0 0 0 1-1v-5a1 1 0 0 0-1-1z"
  }))));
};
var CloudDownloadOutline = function CloudDownloadOutline2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "cloud-download"
  }, jsx("rect", {
    width: "24",
    height: "24",
    opacity: "0"
  }), jsx("path", {
    d: "M14.31 16.38L13 17.64V12a1 1 0 0 0-2 0v5.59l-1.29-1.3a1 1 0 0 0-1.42 1.42l3 3A1 1 0 0 0 12 21a1 1 0 0 0 .69-.28l3-2.9a1 1 0 1 0-1.38-1.44z"
  }), jsx("path", {
    d: "M17.67 7A6 6 0 0 0 6.33 7a5 5 0 0 0-3.08 8.27A1 1 0 1 0 4.75 14 3 3 0 0 1 7 9h.1a1 1 0 0 0 1-.8 4 4 0 0 1 7.84 0 1 1 0 0 0 1 .8H17a3 3 0 0 1 2.25 5 1 1 0 0 0 .09 1.42 1 1 0 0 0 .66.25 1 1 0 0 0 .75-.34A5 5 0 0 0 17.67 7z"
  }))));
};
var CloudUpload = function CloudUpload2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "cloud-upload"
  }, jsx("rect", {
    width: "24",
    height: "24",
    opacity: "0"
  }), jsx("path", {
    d: "M21.9 12c0-.11-.06-.22-.09-.33a4.17 4.17 0 0 0-.18-.57c-.05-.12-.12-.24-.18-.37s-.15-.3-.24-.44S21 10.08 21 10s-.2-.25-.31-.37-.21-.2-.32-.3L20 9l-.36-.24a3.68 3.68 0 0 0-.44-.23l-.39-.18a4.13 4.13 0 0 0-.5-.15 3 3 0 0 0-.41-.09L17.67 8A6 6 0 0 0 6.33 8l-.18.05a3 3 0 0 0-.41.09 4.13 4.13 0 0 0-.5.15l-.39.18a3.68 3.68 0 0 0-.44.23l-.36.3-.37.31c-.11.1-.22.19-.32.3s-.21.25-.31.37-.18.23-.26.36-.16.29-.24.44-.13.25-.18.37a4.17 4.17 0 0 0-.18.57c0 .11-.07.22-.09.33A5.23 5.23 0 0 0 2 13a5.5 5.5 0 0 0 .09.91c0 .1.05.19.07.29a5.58 5.58 0 0 0 .18.58l.12.29a5 5 0 0 0 .3.56l.14.22a.56.56 0 0 0 .05.08L3 16a5 5 0 0 0 4 2h3v-1.37a2 2 0 0 1-1 .27 2.05 2.05 0 0 1-1.44-.61 2 2 0 0 1 .05-2.83l3-2.9A2 2 0 0 1 12 10a2 2 0 0 1 1.41.59l3 3a2 2 0 0 1 0 2.82A2 2 0 0 1 15 17a1.92 1.92 0 0 1-1-.27V18h3a5 5 0 0 0 4-2l.05-.05a.56.56 0 0 0 .05-.08l.14-.22a5 5 0 0 0 .3-.56l.12-.29a5.58 5.58 0 0 0 .18-.58c0-.1.05-.19.07-.29A5.5 5.5 0 0 0 22 13a5.23 5.23 0 0 0-.1-1z"
  }), jsx("path", {
    d: "M12.71 11.29a1 1 0 0 0-1.4 0l-3 2.9a1 1 0 1 0 1.38 1.44L11 14.36V20a1 1 0 0 0 2 0v-5.59l1.29 1.3a1 1 0 0 0 1.42 0 1 1 0 0 0 0-1.42z"
  }))));
};
var DatabaseOutline = function DatabaseOutline2() {
  return jsx("svg", {
    width: "24",
    height: "24",
    viewBox: "0 0 24 24",
    xmlns: "http://www.w3.org/2000/svg"
  }, jsx("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M17.7099 6.58966C17.7099 6.76496 17.5314 7.30055 16.381 7.87573C15.3144 8.40905 13.7429 8.77932 11.9306 8.77932C10.1183 8.77932 8.54678 8.40905 7.48014 7.87573C6.32977 7.30055 6.15127 6.76496 6.15127 6.58966C6.15127 6.41436 6.32977 5.87877 7.48014 5.30358C8.54678 4.77027 10.1183 4.4 11.9306 4.4C13.7429 4.4 15.3144 4.77027 16.381 5.30358C17.5314 5.87877 17.7099 6.41436 17.7099 6.58966ZM17.9612 8.53814C16.6822 9.52579 14.459 10.1793 11.9306 10.1793C9.40219 10.1793 7.17906 9.52581 5.9 8.53818V10.7527C5.94224 10.7859 5.99067 10.8229 6.04525 10.8631C6.30238 11.0523 6.695 11.3107 7.21968 11.5711C8.26721 12.0908 9.84399 12.6199 11.9306 12.6199C14.0172 12.6199 15.594 12.0908 16.6415 11.5711C17.1662 11.3107 17.5588 11.0523 17.816 10.8631C17.8706 10.8229 17.919 10.7859 17.9612 10.7527V8.53814ZM19.109 6.53223C19.0476 4.5762 15.8573 3 11.9306 3C8.09716 3 4.96546 4.50223 4.7618 6.39354C4.60217 6.52184 4.5 6.71872 4.5 6.93945V10.9395V11.0763V11.3725V14.9395V15.0763V15.3725V19.0763V19.3725L4.71258 19.5788L5.2 19.0763C4.71258 19.5788 4.71282 19.579 4.71307 19.5792L4.71362 19.5798L4.71489 19.581L4.71806 19.584L4.72702 19.5925C4.73414 19.5992 4.74359 19.608 4.75533 19.6187C4.77883 19.6402 4.81157 19.6693 4.85351 19.7051C4.93737 19.7767 5.05816 19.8749 5.21549 19.9907C5.53003 20.2222 5.99168 20.5246 6.5974 20.8252C7.81067 21.4272 9.59919 22.0199 11.9306 22.0199C14.262 22.0199 16.0506 21.4272 17.2638 20.8252C17.8695 20.5246 18.3312 20.2222 18.6457 19.9907C18.8031 19.8749 18.9238 19.7767 19.0077 19.7051C19.0497 19.6693 19.0824 19.6402 19.1059 19.6187C19.1176 19.608 19.1271 19.5992 19.1342 19.5925L19.1432 19.584L19.1463 19.581L19.1476 19.5798L19.1481 19.5792C19.1484 19.579 19.1486 19.5788 18.6612 19.0763L19.1486 19.5788L19.3612 19.3725V19.0763V15.3725V15.0763V15.0703V11.3725V11.0763V11.0703V7.07029C19.3612 6.854 19.2631 6.66063 19.109 6.53223ZM17.9612 16.4445C17.7552 16.5679 17.5227 16.6967 17.2638 16.8252C16.0506 17.4272 14.262 18.0199 11.9306 18.0199C9.59919 18.0199 7.81067 17.4272 6.5974 16.8252C6.33854 16.6967 6.106 16.5679 5.9 16.4445V18.7527C5.94224 18.7859 5.99067 18.8229 6.04525 18.8631C6.30238 19.0523 6.695 19.3107 7.21968 19.5711C8.26721 20.0908 9.84399 20.6199 11.9306 20.6199C14.0172 20.6199 15.594 20.0908 16.6415 19.5711C17.1662 19.3107 17.5588 19.0523 17.816 18.8631C17.8706 18.8229 17.919 18.7859 17.9612 18.7527V16.4445ZM5.9 14.7527V12.4445C6.106 12.5679 6.33854 12.6967 6.5974 12.8252C7.81067 13.4272 9.59919 14.0199 11.9306 14.0199C14.262 14.0199 16.0506 13.4272 17.2638 12.8252C17.5227 12.6967 17.7552 12.5679 17.9612 12.4445V14.7527C17.919 14.7859 17.8706 14.8229 17.816 14.8631C17.5588 15.0523 17.1662 15.3107 16.6415 15.5711C15.594 16.0908 14.0172 16.6199 11.9306 16.6199C9.84399 16.6199 8.26721 16.0908 7.21968 15.5711C6.695 15.3107 6.30238 15.0523 6.04525 14.8631C5.99067 14.8229 5.94224 14.7859 5.9 14.7527Z"
  }));
};
var Download = function Download2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "download"
  }, jsx("rect", {
    width: "24",
    height: "24",
    opacity: "0"
  }), jsx("rect", {
    x: "4",
    y: "18",
    width: "16",
    height: "2",
    rx: "1",
    ry: "1"
  }), jsx("rect", {
    x: "3",
    y: "17",
    width: "4",
    height: "2",
    rx: "1",
    ry: "1",
    transform: "rotate(-90 5 18)"
  }), jsx("rect", {
    x: "17",
    y: "17",
    width: "4",
    height: "2",
    rx: "1",
    ry: "1",
    transform: "rotate(-90 19 18)"
  }), jsx("path", {
    d: "M12 15a1 1 0 0 1-.58-.18l-4-2.82a1 1 0 0 1-.24-1.39 1 1 0 0 1 1.4-.24L12 12.76l3.4-2.56a1 1 0 0 1 1.2 1.6l-4 3a1 1 0 0 1-.6.2z"
  }), jsx("path", {
    d: "M12 13a1 1 0 0 1-1-1V4a1 1 0 0 1 2 0v8a1 1 0 0 1-1 1z"
  }))));
};
var DownloadOutline = function DownloadOutline2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "download"
  }, jsx("rect", {
    width: "24",
    height: "24",
    opacity: "0"
  }), jsx("rect", {
    x: "4",
    y: "18",
    width: "16",
    height: "2",
    rx: "1",
    ry: "1"
  }), jsx("rect", {
    x: "3",
    y: "17",
    width: "4",
    height: "2",
    rx: "1",
    ry: "1",
    transform: "rotate(-90 5 18)"
  }), jsx("rect", {
    x: "17",
    y: "17",
    width: "4",
    height: "2",
    rx: "1",
    ry: "1",
    transform: "rotate(-90 19 18)"
  }), jsx("path", {
    d: "M12 15a1 1 0 0 1-.58-.18l-4-2.82a1 1 0 0 1-.24-1.39 1 1 0 0 1 1.4-.24L12 12.76l3.4-2.56a1 1 0 0 1 1.2 1.6l-4 3a1 1 0 0 1-.6.2z"
  }), jsx("path", {
    d: "M12 13a1 1 0 0 1-1-1V4a1 1 0 0 1 2 0v8a1 1 0 0 1-1 1z"
  }))));
};
var DriftOutline = function DriftOutline2() {
  return jsx("svg", {
    width: "24",
    height: "24",
    viewBox: "0 0 24 24",
    xmlns: "http://www.w3.org/2000/svg"
  }, jsx("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M3.78389 18.447C3.78322 18.4445 3.77831 18.426 3.77252 18.386C3.7662 18.3423 3.76035 18.2837 3.75621 18.2085C3.7479 18.0576 3.74761 17.8616 3.75731 17.6222C3.7767 17.1439 3.83444 16.5276 3.93009 15.8178C4.12128 14.3992 4.45861 12.646 4.91828 10.9427C5.38014 9.23123 5.95466 7.61119 6.60681 6.43547C6.93346 5.84658 7.26003 5.40529 7.57257 5.11963C7.88315 4.83577 8.12862 4.75 8.31705 4.75C8.37741 4.75 8.57528 4.79666 8.92545 5.16644C9.25722 5.51679 9.62321 6.04945 10.0219 6.74436C10.722 7.96483 11.4503 9.55355 12.2236 11.2404L12.2976 11.4018L12.2972 11.4021L12.3051 11.4192C11.4683 12.149 10.5956 13.1093 9.74878 14.0812C9.45638 14.4167 9.16679 14.754 8.88052 15.0874L8.88039 15.0875L8.88035 15.0876C8.1619 15.9243 7.46437 16.7366 6.79593 17.4368C6.33197 17.9227 5.90039 18.3346 5.50685 18.647C5.10517 18.9658 4.78741 19.1448 4.55135 19.2158C4.33998 19.2794 4.25769 19.2421 4.20548 19.2061C4.11659 19.1449 3.94575 18.958 3.78391 18.4472C3.78399 18.4474 3.78398 18.4474 3.78389 18.447ZM12.9638 12.8456C12.3124 13.4557 11.611 14.2273 10.8797 15.0666C10.605 15.3818 10.3261 15.7067 10.0457 16.0332L10.0457 16.0332C9.31686 16.882 8.57849 17.7419 7.88085 18.4726C7.39438 18.9821 6.90928 19.4489 6.43936 19.8219C5.97757 20.1884 5.4851 20.5013 4.98361 20.6522C4.45743 20.8106 3.87487 20.7999 3.35441 20.4413C2.87062 20.108 2.56096 19.5536 2.35395 18.9002C2.24681 18.562 2.23832 18.0603 2.25854 17.5614C2.2804 17.0223 2.34386 16.357 2.44353 15.6175C2.643 14.1374 2.99281 12.3204 3.47009 10.5519C3.94517 8.79142 4.5574 7.03782 5.29509 5.70788C5.66337 5.04394 6.08251 4.44939 6.56061 4.01242C7.04067 3.57365 7.63079 3.25 8.31705 3.25C9.00899 3.25 9.5797 3.67581 10.0146 4.13505C10.4679 4.61372 10.9034 5.26664 11.323 5.99795C12.0449 7.25639 12.7891 8.87392 13.5408 10.514C14.0136 10.2451 14.5147 10.0628 15.023 10.0628C16.1887 10.0628 17.1812 10.7151 17.9678 11.5153C18.763 12.3243 19.4401 13.3764 19.9841 14.388C20.5316 15.406 20.9631 16.4186 21.257 17.1733C21.4044 17.5516 21.518 17.8675 21.5952 18.09C21.6339 18.2013 21.6634 18.2894 21.6835 18.3503C21.6936 18.3808 21.7013 18.4045 21.7066 18.421L21.7128 18.4402L21.7145 18.4456L21.715 18.4473L21.7152 18.4478C21.7153 18.448 21.7153 18.4482 21 18.6737L21.7153 18.4482L21.8412 18.8474L21.5675 19.164C20.7568 20.1023 19.8241 20.58 18.8004 20.4176C17.85 20.2667 17.0382 19.589 16.3564 18.7813C15.1452 17.3466 14.0108 15.0891 12.9638 12.8456ZM17.5025 17.8137C16.3764 16.4797 15.2709 14.2549 14.1711 11.8841C14.5473 11.6526 14.8285 11.5628 15.023 11.5628C15.6067 11.5628 16.2359 11.8932 16.8981 12.5668C17.5516 13.2317 18.1501 14.1448 18.663 15.0985C19.1724 16.0457 19.5792 16.9984 19.8593 17.7176C19.9784 18.0234 20.0739 18.2853 20.1441 18.4844C19.6772 18.917 19.3138 18.9803 19.0356 18.9361C18.6293 18.8716 18.1155 18.5398 17.5025 17.8137Z"
  }));
};
var DuplicateIcon = function DuplicateIcon2() {
  return jsx("svg", {
    width: "24",
    height: "24",
    viewBox: "0 0 24 24",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, jsx("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M9 13V12C9 10.346 10.346 9 12 9H13V5.667C13 5.299 12.701 5 12.333 5H5.667C5.299 5 5 5.299 5 5.667V12.333C5 12.701 5.299 13 5.667 13H9ZM9 15H5.667C4.196 15 3 13.804 3 12.333V5.667C3 4.196 4.196 3 5.667 3H12.333C13.804 3 15 4.196 15 5.667V9H18C19.654 9 21 10.346 21 12V18C21 19.654 19.654 21 18 21H12C10.346 21 9 19.654 9 18V15ZM12 11C11.449 11 11 11.449 11 12V18C11 18.551 11.449 19 12 19H18C18.552 19 19 18.551 19 18V12C19 11.449 18.552 11 18 11H12Z"
  }), jsx("mask", {
    id: "mask0_725_12898",
    style: {
      maskType: "alpha"
    },
    maskUnits: "userSpaceOnUse",
    x: "3",
    y: "3",
    width: "18",
    height: "18"
  }, jsx("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M9 13V12C9 10.346 10.346 9 12 9H13V5.667C13 5.299 12.701 5 12.333 5H5.667C5.299 5 5 5.299 5 5.667V12.333C5 12.701 5.299 13 5.667 13H9ZM9 15H5.667C4.196 15 3 13.804 3 12.333V5.667C3 4.196 4.196 3 5.667 3H12.333C13.804 3 15 4.196 15 5.667V9H18C19.654 9 21 10.346 21 12V18C21 19.654 19.654 21 18 21H12C10.346 21 9 19.654 9 18V15ZM12 11C11.449 11 11 11.449 11 12V18C11 18.551 11.449 19 12 19H18C18.552 19 19 18.551 19 18V12C19 11.449 18.552 11 18 11H12Z"
  })), jsx("g", {
    mask: "url(#mask0_725_12898)"
  }));
};
var EditOutline = function EditOutline2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "edit"
  }, jsx("rect", {
    width: "24",
    height: "24",
    opacity: "0"
  }), jsx("path", {
    d: "M19.4 7.34L16.66 4.6A2 2 0 0 0 14 4.53l-9 9a2 2 0 0 0-.57 1.21L4 18.91a1 1 0 0 0 .29.8A1 1 0 0 0 5 20h.09l4.17-.38a2 2 0 0 0 1.21-.57l9-9a1.92 1.92 0 0 0-.07-2.71zM9.08 17.62l-3 .28.27-3L12 9.32l2.7 2.7zM16 10.68L13.32 8l1.95-2L18 8.73z"
  }))));
};
var Edit2Outline = function Edit2Outline2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "edit-2"
  }, jsx("rect", {
    width: "24",
    height: "24",
    opacity: "0"
  }), jsx("path", {
    d: "M19 20H5a1 1 0 0 0 0 2h14a1 1 0 0 0 0-2z"
  }), jsx("path", {
    d: "M5 18h.09l4.17-.38a2 2 0 0 0 1.21-.57l9-9a1.92 1.92 0 0 0-.07-2.71L16.66 2.6A2 2 0 0 0 14 2.53l-9 9a2 2 0 0 0-.57 1.21L4 16.91a1 1 0 0 0 .29.8A1 1 0 0 0 5 18zM15.27 4L18 6.73l-2 1.95L13.32 6zm-8.9 8.91L12 7.32l2.7 2.7-5.6 5.6-3 .28z"
  }))));
};
var EmbeddingsOutline = function EmbeddingsOutline2() {
  return jsx("svg", {
    width: "24",
    height: "24",
    viewBox: "0 0 24 24",
    xmlns: "http://www.w3.org/2000/svg"
  }, jsx("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M11.5 6C11.5 7.38071 10.3807 8.5 9 8.5C7.61929 8.5 6.5 7.38071 6.5 6C6.5 4.61929 7.61929 3.5 9 3.5C10.3807 3.5 11.5 4.61929 11.5 6ZM11.4968 9.12523C10.8125 9.67265 9.94448 10 9 10C8.83503 10 8.67239 9.99001 8.51265 9.97061L7.35003 14.2336C8.89489 14.7874 10 16.2646 10 18C10 20.2091 8.20914 22 6 22C3.79086 22 2 20.2091 2 18C2 15.8383 3.71477 14.0771 5.85827 14.0025L7.08305 9.5116C5.8418 8.83257 5 7.51459 5 6C5 3.79086 6.79086 2 9 2C11.2091 2 13 3.79086 13 6C13 6.71768 12.811 7.39122 12.48 7.97355L15.7722 11.6773C16.4089 11.2496 17.1753 11 18 11C20.2091 11 22 12.7909 22 15C22 17.2091 20.2091 19 18 19C15.7909 19 14 17.2091 14 15C14 14.1584 14.2599 13.3775 14.7039 12.7332L11.4968 9.12523ZM20.5 15C20.5 16.3807 19.3807 17.5 18 17.5C16.6193 17.5 15.5 16.3807 15.5 15C15.5 13.6193 16.6193 12.5 18 12.5C19.3807 12.5 20.5 13.6193 20.5 15ZM6 20.5C7.38071 20.5 8.5 19.3807 8.5 18C8.5 16.6193 7.38071 15.5 6 15.5C4.61929 15.5 3.5 16.6193 3.5 18C3.5 19.3807 4.61929 20.5 6 20.5Z"
  }));
};
var ExternalLinkOutline = function ExternalLinkOutline2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "external-link"
  }, jsx("rect", {
    width: "24",
    height: "24",
    opacity: "0"
  }), jsx("path", {
    d: "M20 11a1 1 0 0 0-1 1v6a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1h6a1 1 0 0 0 0-2H6a3 3 0 0 0-3 3v12a3 3 0 0 0 3 3h12a3 3 0 0 0 3-3v-6a1 1 0 0 0-1-1z"
  }), jsx("path", {
    d: "M16 5h1.58l-6.29 6.28a1 1 0 0 0 0 1.42 1 1 0 0 0 1.42 0L19 6.42V8a1 1 0 0 0 1 1 1 1 0 0 0 1-1V4a1 1 0 0 0-1-1h-4a1 1 0 0 0 0 2z"
  }))));
};
var ExpandOutline = function ExpandOutline2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "expand"
  }, jsx("rect", {
    width: "24",
    height: "24",
    transform: "rotate(180 12 12)",
    opacity: "0"
  }), jsx("path", {
    d: "M20 5a1 1 0 0 0-1-1h-5a1 1 0 0 0 0 2h2.57l-3.28 3.29a1 1 0 0 0 0 1.42 1 1 0 0 0 1.42 0L18 7.42V10a1 1 0 0 0 1 1 1 1 0 0 0 1-1z"
  }), jsx("path", {
    d: "M10.71 13.29a1 1 0 0 0-1.42 0L6 16.57V14a1 1 0 0 0-1-1 1 1 0 0 0-1 1v5a1 1 0 0 0 1 1h5a1 1 0 0 0 0-2H7.42l3.29-3.29a1 1 0 0 0 0-1.42z"
  }))));
};
var Explainability = function Explainability2() {
  return jsx("svg", {
    width: "24",
    height: "24",
    viewBox: "0 0 24 24",
    xmlns: "http://www.w3.org/2000/svg"
  }, jsx("rect", {
    x: "10.75",
    y: "12",
    width: "2.5",
    height: "9.98733",
    rx: "1.25"
  }), jsx("rect", {
    x: "10.75",
    y: "2.00096",
    width: "2.5",
    height: "8.27023",
    rx: "1.25"
  }), jsx("rect", {
    x: "14.5417",
    y: "8.77119",
    width: "2.5",
    height: "11.027",
    rx: "1.25"
  }), jsx("rect", {
    x: "18.3337",
    y: "11.5279",
    width: "2.5",
    height: "6.93593",
    rx: "1.25"
  }), jsx("rect", {
    x: "18.3337",
    y: "5.89282",
    width: "2.5",
    height: "3.68917",
    rx: "1.25"
  }), jsx("rect", {
    x: "2.98645",
    y: "14.8522",
    width: "2.5",
    height: "3.61164",
    rx: "1.25"
  }), jsx("rect", {
    x: "2.98645",
    y: "5.89283",
    width: "2.5",
    height: "7.3378",
    rx: "1.25"
  }), jsx("rect", {
    x: "6.77844",
    y: "2.97392",
    width: "2.5",
    height: "9.52698",
    rx: "1.25"
  }), jsx("rect", {
    x: "6.77844",
    y: "14.3252",
    width: "2.5",
    height: "6.44591",
    rx: "1.25"
  }), jsx("rect", {
    x: "14.5417",
    y: "3.37933",
    width: "2.5",
    height: "3.64864",
    rx: "1.25"
  }));
};
var EyeOutline = function EyeOutline2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    width: "20",
    height: "20",
    viewBox: "0 0 20 20",
    fill: "none"
  }, jsx("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M9.77475 4.16985C14.7548 4.01401 17.6914 8.65901 18.2231 9.58568C18.3698 9.84235 18.3698 10.1582 18.2231 10.4148C17.5114 11.6557 14.8314 15.7132 10.2256 15.8307C10.1573 15.8323 10.0889 15.8332 10.0206 15.8332C5.13475 15.8332 2.30142 11.329 1.77725 10.4148C1.62975 10.1582 1.62975 9.84235 1.77725 9.58568C2.48892 8.34485 5.16808 4.28651 9.77475 4.16985ZM10.1831 14.1648C6.59475 14.2482 4.25392 11.179 3.47725 9.99651C4.33225 8.65901 6.48558 5.92068 9.81725 5.83568C13.3914 5.74485 15.7456 8.82151 16.5223 10.004C15.6681 11.3415 13.5139 14.0798 10.1831 14.1648ZM7.08333 10.0002C7.08333 8.39185 8.39167 7.08351 10 7.08351C11.6083 7.08351 12.9167 8.39185 12.9167 10.0002C12.9167 11.6085 11.6083 12.9168 10 12.9168C8.39167 12.9168 7.08333 11.6085 7.08333 10.0002ZM8.75 10.0002C8.75 10.6893 9.31083 11.2502 10 11.2502C10.6892 11.2502 11.25 10.6893 11.25 10.0002C11.25 9.31101 10.6892 8.75018 10 8.75018C9.31083 8.75018 8.75 9.31101 8.75 10.0002Z"
  }), jsx("mask", {
    id: "mask0_935_15127",
    style: {
      maskType: "alpha"
    },
    maskUnits: "userSpaceOnUse",
    x: "1",
    y: "4",
    width: "18",
    height: "12"
  }, jsx("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M9.77475 4.16985C14.7548 4.01401 17.6914 8.65901 18.2231 9.58568C18.3698 9.84235 18.3698 10.1582 18.2231 10.4148C17.5114 11.6557 14.8314 15.7132 10.2256 15.8307C10.1573 15.8323 10.0889 15.8332 10.0206 15.8332C5.13475 15.8332 2.30142 11.329 1.77725 10.4148C1.62975 10.1582 1.62975 9.84235 1.77725 9.58568C2.48892 8.34485 5.16808 4.28651 9.77475 4.16985ZM10.1831 14.1648C6.59475 14.2482 4.25392 11.179 3.47725 9.99651C4.33225 8.65901 6.48558 5.92068 9.81725 5.83568C13.3914 5.74485 15.7456 8.82151 16.5223 10.004C15.6681 11.3415 13.5139 14.0798 10.1831 14.1648ZM7.08333 10.0002C7.08333 8.39185 8.39167 7.08351 10 7.08351C11.6083 7.08351 12.9167 8.39185 12.9167 10.0002C12.9167 11.6085 11.6083 12.9168 10 12.9168C8.39167 12.9168 7.08333 11.6085 7.08333 10.0002ZM8.75 10.0002C8.75 10.6893 9.31083 11.2502 10 11.2502C10.6892 11.2502 11.25 10.6893 11.25 10.0002C11.25 9.31101 10.6892 8.75018 10 8.75018C9.31083 8.75018 8.75 9.31101 8.75 10.0002Z"
  })), jsx("g", {
    mask: "url(#mask0_935_15127)"
  }));
};
var Fairness = function Fairness2() {
  return jsx("svg", {
    width: "24",
    height: "24",
    viewBox: "0 0 24 24",
    xmlns: "http://www.w3.org/2000/svg"
  }, jsx("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M19.5 7.5C19.5 9.15685 18.1569 10.5 16.5 10.5C14.8431 10.5 13.5 9.15685 13.5 7.5C13.5 5.84315 14.8431 4.5 16.5 4.5C18.1569 4.5 19.5 5.84315 19.5 7.5ZM21 7.5C21 9.98528 18.9853 12 16.5 12C14.0147 12 12 9.98528 12 7.5C12 5.01472 14.0147 3 16.5 3C18.9853 3 21 5.01472 21 7.5ZM3.22132 13.218C3.51641 12.9273 3.99484 12.9273 4.28993 13.218L7.06073 15.9474L9.71151 13.3362C10.0066 13.0456 10.485 13.0456 10.7801 13.3362C11.0752 13.6269 11.0752 14.0982 10.7801 14.3889L8.12934 17.0001L10.7801 19.6113C11.0752 19.902 11.0752 20.3733 10.7801 20.664C10.485 20.9546 10.0066 20.9546 9.71152 20.664L7.06073 18.0527L4.28992 20.7822C3.99484 21.0729 3.5164 21.0729 3.22132 20.7822C2.92623 20.4915 2.92623 20.0202 3.22132 19.7295L5.99212 17.0001L3.22132 14.2707C2.92623 13.98 2.92623 13.5087 3.22132 13.218Z"
  }));
};
var FileAdd = function FileAdd2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "file-add"
  }, jsx("rect", {
    width: "24",
    height: "24",
    opacity: "0"
  }), jsx("path", {
    d: "M19.74 7.33l-4.44-5a1 1 0 0 0-.74-.33h-8A2.53 2.53 0 0 0 4 4.5v15A2.53 2.53 0 0 0 6.56 22h10.88A2.53 2.53 0 0 0 20 19.5V8a1 1 0 0 0-.26-.67zM14 15h-1v1a1 1 0 0 1-2 0v-1h-1a1 1 0 0 1 0-2h1v-1a1 1 0 0 1 2 0v1h1a1 1 0 0 1 0 2zm.71-7a.79.79 0 0 1-.71-.85V4l3.74 4z"
  }))));
};
var FileAddOutline = function FileAddOutline2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "file-add"
  }, jsx("rect", {
    width: "24",
    height: "24",
    opacity: "0"
  }), jsx("path", {
    d: "M19.74 8.33l-5.44-6a1 1 0 0 0-.74-.33h-7A2.53 2.53 0 0 0 4 4.5v15A2.53 2.53 0 0 0 6.56 22h10.88A2.53 2.53 0 0 0 20 19.5V9a1 1 0 0 0-.26-.67zM14 5l2.74 3h-2a.79.79 0 0 1-.74-.85zm3.44 15H6.56a.53.53 0 0 1-.56-.5v-15a.53.53 0 0 1 .56-.5H12v3.15A2.79 2.79 0 0 0 14.71 10H18v9.5a.53.53 0 0 1-.56.5z"
  }), jsx("path", {
    d: "M14 13h-1v-1a1 1 0 0 0-2 0v1h-1a1 1 0 0 0 0 2h1v1a1 1 0 0 0 2 0v-1h1a1 1 0 0 0 0-2z"
  }))));
};
var FileOutline = function FileOutline2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "file"
  }, jsx("rect", {
    width: "24",
    height: "24",
    opacity: "0"
  }), jsx("path", {
    d: "M19.74 8.33l-5.44-6a1 1 0 0 0-.74-.33h-7A2.53 2.53 0 0 0 4 4.5v15A2.53 2.53 0 0 0 6.56 22h10.88A2.53 2.53 0 0 0 20 19.5V9a1 1 0 0 0-.26-.67zM17.65 9h-3.94a.79.79 0 0 1-.71-.85V4h.11zm-.21 11H6.56a.53.53 0 0 1-.56-.5v-15a.53.53 0 0 1 .56-.5H11v4.15A2.79 2.79 0 0 0 13.71 11H18v8.5a.53.53 0 0 1-.56.5z"
  }))));
};
var FireOutline = function FireOutline2() {
  return jsx("svg", {
    width: "24",
    height: "24",
    viewBox: "0 0 24 24",
    xmlns: "http://www.w3.org/2000/svg"
  }, jsx("g", null, jsx("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M11.4941 21.0015H11.5011C13.5091 21.0015 15.3951 20.2065 16.8141 18.7605C19.7291 15.7895 19.7241 10.9565 16.8041 7.99247L12.2141 3.30347C11.8331 2.91147 11.1971 2.91147 10.8001 3.28847C10.5861 3.49247 10.4731 3.78147 10.4921 4.07647C10.5001 4.21547 10.5001 4.35447 10.5001 4.50147C10.5001 7.05847 9.8581 8.56947 9.5031 8.94347C9.3521 8.77747 9.0781 8.34047 8.8481 7.45147C8.7581 7.10347 8.4881 6.83047 8.1411 6.73647C7.7921 6.64547 7.4231 6.74347 7.1691 6.99747L6.1861 7.99147C3.2771 10.9565 3.2811 15.7895 6.1951 18.7595C7.6061 20.2045 9.4881 20.9995 11.4941 21.0015ZM7.6241 17.3605C5.5061 15.2015 5.4631 11.7155 7.4951 9.51647C8.1641 10.7755 8.9921 11.0015 9.5001 11.0015C11.1581 11.0015 12.0891 8.82347 12.3911 6.34147L15.3771 9.39247C17.5381 11.5875 17.5421 15.1625 15.3861 17.3605C14.3471 18.4185 12.9681 19.0015 11.5011 19.0015H11.4961C10.0321 19.0005 8.6581 18.4175 7.6241 17.3605Z"
  }), jsx("g", {
    mask: "url(#mask0)"
  })));
};
var FolderOutline = function FolderOutline2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "folder"
  }, jsx("rect", {
    width: "24",
    height: "24",
    opacity: "0"
  }), jsx("path", {
    d: "M19.5 20.5h-15A2.47 2.47 0 0 1 2 18.07V5.93A2.47 2.47 0 0 1 4.5 3.5h4.6a1 1 0 0 1 .77.37l2.6 3.18h7A2.47 2.47 0 0 1 22 9.48v8.59a2.47 2.47 0 0 1-2.5 2.43zM4 13.76v4.31a.46.46 0 0 0 .5.43h15a.46.46 0 0 0 .5-.43V9.48a.46.46 0 0 0-.5-.43H12a1 1 0 0 1-.77-.37L8.63 5.5H4.5a.46.46 0 0 0-.5.43z"
  }))));
};
var FunnelOutline = function FunnelOutline2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "funnel"
  }, jsx("rect", {
    width: "24",
    height: "24",
    opacity: "0"
  }), jsx("path", {
    d: "M13.9 22a1 1 0 0 1-.6-.2l-4-3.05a1 1 0 0 1-.39-.8v-3.27l-4.8-9.22A1 1 0 0 1 5 4h14a1 1 0 0 1 .86.49 1 1 0 0 1 0 1l-5 9.21V21a1 1 0 0 1-.55.9 1 1 0 0 1-.41.1zm-3-4.54l2 1.53v-4.55A1 1 0 0 1 13 14l4.3-8H6.64l4.13 8a1 1 0 0 1 .11.46z"
  }))));
};
var Grid = function Grid2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "grid"
  }, jsx("rect", {
    width: "24",
    height: "24",
    opacity: "0"
  }), jsx("path", {
    d: "M9 3H5a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h4a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2z"
  }), jsx("path", {
    d: "M19 3h-4a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h4a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2z"
  }), jsx("path", {
    d: "M9 13H5a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h4a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2z"
  }), jsx("path", {
    d: "M19 13h-4a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h4a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2z"
  }))));
};
var GridOutline = function GridOutline2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "grid"
  }, jsx("rect", {
    width: "24",
    height: "24",
    opacity: "0"
  }), jsx("path", {
    d: "M9 3H5a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h4a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2zM5 9V5h4v4z"
  }), jsx("path", {
    d: "M19 3h-4a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h4a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2zm-4 6V5h4v4z"
  }), jsx("path", {
    d: "M9 13H5a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h4a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2zm-4 6v-4h4v4z"
  }), jsx("path", {
    d: "M19 13h-4a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h4a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2zm-4 6v-4h4v4z"
  }))));
};
var Globe = function Globe2() {
  return jsx("svg", {
    width: "16",
    height: "16",
    viewBox: "0 0 16 16",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, jsx("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M8.01883 1.33532C11.6862 1.34598 14.6668 4.33132 14.6668 8.00065C14.6668 11.67 11.6862 14.656 8.01883 14.666C8.0175 14.666 8.0155 14.6673 8.0135 14.6673C8.01283 14.6673 8.01233 14.6672 8.01183 14.667C8.01133 14.6668 8.01083 14.6667 8.01016 14.6667C8.00896 14.6667 8.00763 14.6668 8.00616 14.6669C8.00436 14.6671 8.00236 14.6673 8.00016 14.6673C4.32416 14.6673 1.3335 11.6767 1.3335 8.00065C1.3335 4.32532 4.32416 1.33398 8.00016 1.33398C8.00192 1.33398 8.00387 1.33417 8.0057 1.33435C8.00735 1.3345 8.0089 1.33465 8.01016 1.33465C8.01192 1.33465 8.0135 1.33484 8.01498 1.33501C8.01631 1.33517 8.01757 1.33532 8.01883 1.33532ZM6.05283 7.33398C6.25683 5.15265 7.37283 3.63398 8.0175 2.93198C8.68416 3.64598 9.78283 5.15065 9.97283 7.33398H6.05283ZM4.71016 7.33398C4.85683 5.42532 5.59083 3.95198 6.29216 2.95332C4.39083 3.59865 2.97016 5.28598 2.71283 7.33398H4.71016ZM2.71283 8.66732H4.7075C4.84483 10.5753 5.56283 12.038 6.2715 13.0413C4.38016 12.39 2.9695 10.708 2.71283 8.66732ZM9.74483 13.0353C10.4442 12.0367 11.1715 10.568 11.3168 8.66732H13.2868C13.0315 10.702 11.6275 12.3807 9.74483 13.0353ZM9.97483 8.66732H6.0535C6.2395 10.8487 7.31016 12.3327 8.00816 13.0726C8.65216 12.3707 9.77083 10.852 9.97483 8.66732ZM13.2868 7.33398H11.3188C11.1822 5.43465 10.4722 3.97665 9.76683 2.97465C11.6388 3.63465 13.0328 5.30732 13.2868 7.33398Z",
    fillOpacity: "0.9"
  }), jsx("mask", {
    style: {
      maskType: "alpha"
    },
    maskUnits: "userSpaceOnUse",
    x: "1",
    y: "1",
    width: "14",
    height: "14"
  }, jsx("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M8.01883 1.33532C11.6862 1.34598 14.6668 4.33132 14.6668 8.00065C14.6668 11.67 11.6862 14.656 8.01883 14.666C8.0175 14.666 8.0155 14.6673 8.0135 14.6673C8.01283 14.6673 8.01233 14.6672 8.01183 14.667C8.01133 14.6668 8.01083 14.6667 8.01016 14.6667C8.00896 14.6667 8.00763 14.6668 8.00616 14.6669C8.00436 14.6671 8.00236 14.6673 8.00016 14.6673C4.32416 14.6673 1.3335 11.6767 1.3335 8.00065C1.3335 4.32532 4.32416 1.33398 8.00016 1.33398C8.00192 1.33398 8.00387 1.33417 8.0057 1.33435C8.00735 1.3345 8.0089 1.33465 8.01016 1.33465C8.01192 1.33465 8.0135 1.33484 8.01498 1.33501C8.01631 1.33517 8.01757 1.33532 8.01883 1.33532ZM6.05283 7.33398C6.25683 5.15265 7.37283 3.63398 8.0175 2.93198C8.68416 3.64598 9.78283 5.15065 9.97283 7.33398H6.05283ZM4.71016 7.33398C4.85683 5.42532 5.59083 3.95198 6.29216 2.95332C4.39083 3.59865 2.97016 5.28598 2.71283 7.33398H4.71016ZM2.71283 8.66732H4.7075C4.84483 10.5753 5.56283 12.038 6.2715 13.0413C4.38016 12.39 2.9695 10.708 2.71283 8.66732ZM9.74483 13.0353C10.4442 12.0367 11.1715 10.568 11.3168 8.66732H13.2868C13.0315 10.702 11.6275 12.3807 9.74483 13.0353ZM9.97483 8.66732H6.0535C6.2395 10.8487 7.31016 12.3327 8.00816 13.0726C8.65216 12.3707 9.77083 10.852 9.97483 8.66732ZM13.2868 7.33398H11.3188C11.1822 5.43465 10.4722 3.97665 9.76683 2.97465C11.6388 3.63465 13.0328 5.30732 13.2868 7.33398Z"
  })), jsx("g", {
    mask: "url(#mask0_427_13582)"
  }));
};
var Histogram = function Histogram2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "bar-chart"
  }, jsx("rect", {
    width: "24",
    height: "24",
    transform: "rotate(90 12 12)",
    opacity: "0"
  }), jsx("path", {
    d: "M12 4a1 1 0 0 0-1 1v15a1 1 0 0 0 2 0V5a1 1 0 0 0-1-1z"
  }), jsx("path", {
    d: "M19 12a1 1 0 0 0-1 1v7a1 1 0 0 0 2 0v-7a1 1 0 0 0-1-1z"
  }), jsx("path", {
    d: "M5 8a1 1 0 0 0-1 1v11a1 1 0 0 0 2 0V9a1 1 0 0 0-1-1z"
  }))));
};
var Home = function Home2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "home"
  }, jsx("rect", {
    width: "24",
    height: "24",
    opacity: "0"
  }), jsx("rect", {
    x: "10",
    y: "14",
    width: "4",
    height: "7"
  }), jsx("path", {
    d: "M20.42 10.18L12.71 2.3a1 1 0 0 0-1.42 0l-7.71 7.89A2 2 0 0 0 3 11.62V20a2 2 0 0 0 1.89 2H8v-9a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v9h3.11A2 2 0 0 0 21 20v-8.38a2.07 2.07 0 0 0-.58-1.44z"
  }))));
};
var HomeOutline = function HomeOutline2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "home"
  }, jsx("rect", {
    width: "24",
    height: "24",
    opacity: "0"
  }), jsx("path", {
    d: "M20.42 10.18L12.71 2.3a1 1 0 0 0-1.42 0l-7.71 7.89A2 2 0 0 0 3 11.62V20a2 2 0 0 0 1.89 2h14.22A2 2 0 0 0 21 20v-8.38a2.07 2.07 0 0 0-.58-1.44zM10 20v-6h4v6zm9 0h-3v-7a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1v7H5v-8.42l7-7.15 7 7.19z"
  }))));
};
var Info = function Info2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "info"
  }, jsx("rect", {
    width: "24",
    height: "24",
    transform: "rotate(180 12 12)",
    opacity: "0"
  }), jsx("path", {
    d: "M12 2a10 10 0 1 0 10 10A10 10 0 0 0 12 2zm1 14a1 1 0 0 1-2 0v-5a1 1 0 0 1 2 0zm-1-7a1 1 0 1 1 1-1 1 1 0 0 1-1 1z"
  }))));
};
var InfoFilled = function InfoFilled2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "info"
  }, jsx("rect", {
    width: "24",
    height: "24",
    transform: "rotate(180 12 12)",
    opacity: "0"
  }), jsx("path", {
    d: "M12 2a10 10 0 1 0 10 10A10 10 0 0 0 12 2zm1 14a1 1 0 0 1-2 0v-5a1 1 0 0 1 2 0zm-1-7a1 1 0 1 1 1-1 1 1 0 0 1-1 1z"
  }))));
};
var InfoOutline = function InfoOutline2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "info"
  }, jsx("rect", {
    width: "24",
    height: "24",
    transform: "rotate(180 12 12)",
    opacity: "0"
  }), jsx("path", {
    d: "M12 2a10 10 0 1 0 10 10A10 10 0 0 0 12 2zm0 18a8 8 0 1 1 8-8 8 8 0 0 1-8 8z"
  }), jsx("circle", {
    cx: "12",
    cy: "8",
    r: "1"
  }), jsx("path", {
    d: "M12 10a1 1 0 0 0-1 1v5a1 1 0 0 0 2 0v-5a1 1 0 0 0-1-1z"
  }))));
};
var LassoOutline = function LassoOutline2() {
  return jsx("svg", {
    width: "20",
    height: "20",
    viewBox: "0 0 20 20",
    xmlns: "http://www.w3.org/2000/svg"
  }, jsx("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M12.2257 11.8L11.7393 8.41153C11.7109 8.22144 11.7902 8.03189 11.9431 7.9217C12.0956 7.81142 12.2951 7.79984 12.4586 7.89091L16.2173 9.99324C17.4623 8.99204 18.1154 7.77352 18.1154 6.53971C18.1154 5.16011 17.2989 3.79965 15.7513 2.74073C14.2085 1.6851 12.0218 1 9.55769 1C7.09362 1 4.90688 1.6851 3.36408 2.74073C1.81649 3.79965 1 5.16011 1 6.53971C1 7.9193 1.81649 9.27976 3.36408 10.3387C3.42007 10.377 3.4769 10.4148 3.53457 10.4521C3.57721 10.4488 3.6203 10.447 3.66378 10.447C4.25644 10.447 4.7771 10.7654 5.0742 11.2456C6.36894 11.7696 7.9006 12.0794 9.55769 12.0794C10.4938 12.0794 11.3898 11.9805 12.2257 11.8ZM12.3681 12.7921C11.4796 12.9789 10.5358 13.0794 9.55769 13.0794C8.03657 13.0794 6.59844 12.8363 5.32179 12.4037C5.2538 12.9334 4.95341 13.3874 4.5299 13.6526C4.61517 13.7612 4.70537 13.8853 4.79522 14.0242C5.16436 14.5947 5.54041 15.4345 5.51764 16.4699C5.49439 17.5267 5.00709 18.3616 4.55343 18.915C4.32482 19.1938 4.0981 19.4095 3.92766 19.5564C3.84217 19.63 3.77007 19.687 3.71793 19.7265C3.69184 19.7463 3.67068 19.7618 3.65525 19.7728L3.6365 19.7861L3.63052 19.7902L3.62841 19.7917L3.62759 19.7922L3.62723 19.7925C3.62707 19.7926 3.62691 19.7927 3.34519 19.379L3.62691 19.7927C3.39879 19.9479 3.08774 19.8884 2.93215 19.66C2.7767 19.4317 2.83526 19.1211 3.06288 18.9658L3.06295 18.9658L3.06304 18.9657L3.06326 18.9655L3.07183 18.9595C3.08034 18.9534 3.0943 18.9432 3.11293 18.9291C3.15023 18.9008 3.20601 18.8569 3.27421 18.7981C3.41116 18.6801 3.59512 18.5051 3.77969 18.28C4.15237 17.8254 4.50136 17.1997 4.51794 16.4459C4.53499 15.6707 4.25394 15.0268 3.95603 14.5663C3.80773 14.3371 3.65843 14.1585 3.54764 14.0386C3.49243 13.9788 3.44732 13.9342 3.41742 13.9058C3.40487 13.8938 3.39504 13.8848 3.38831 13.8787C2.59563 13.743 1.99119 13.0317 1.99119 12.1745C1.99119 11.6923 2.18248 11.2563 2.49096 10.9429C0.943505 9.78084 0 8.23567 0 6.53971C0 2.92793 4.27912 0 9.55769 0C14.8363 0 19.1154 2.92793 19.1154 6.53971C19.1154 8.03471 18.3822 9.41255 17.1485 10.5141L19.7425 11.965C19.9297 12.0691 20.029 12.285 19.9925 12.4988C19.9907 12.5093 19.9885 12.5192 19.9863 12.5291C19.9347 12.7525 19.7439 12.912 19.5215 12.9178L15.7303 13.0197C15.5329 13.0249 15.3583 13.1512 15.286 13.341L13.8962 16.9857C13.8153 17.1997 13.6049 17.3304 13.384 17.304C13.1626 17.2776 12.9862 17.1018 12.9542 16.8745L12.3681 12.7921ZM3.36757 11.5227C3.15331 11.6367 2.99119 11.872 2.99119 12.1745C2.99119 12.607 3.3225 12.902 3.66378 12.902C4.00506 12.902 4.33638 12.607 4.33638 12.1745C4.33638 12.1174 4.3306 12.0627 4.31979 12.0108C3.98738 11.8615 3.66939 11.6984 3.36757 11.5227Z"
  }));
};
var ListOutline = function ListOutline2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "list"
  }, jsx("rect", {
    width: "24",
    height: "24",
    transform: "rotate(180 12 12)",
    opacity: "0"
  }), jsx("circle", {
    cx: "4",
    cy: "7",
    r: "1"
  }), jsx("circle", {
    cx: "4",
    cy: "12",
    r: "1"
  }), jsx("circle", {
    cx: "4",
    cy: "17",
    r: "1"
  }), jsx("rect", {
    x: "7",
    y: "11",
    width: "14",
    height: "2",
    rx: ".94",
    ry: ".94"
  }), jsx("rect", {
    x: "7",
    y: "16",
    width: "14",
    height: "2",
    rx: ".94",
    ry: ".94"
  }), jsx("rect", {
    x: "7",
    y: "6",
    width: "14",
    height: "2",
    rx: ".94",
    ry: ".94"
  }))));
};
var LoadingOutline = function LoadingOutline2() {
  return jsx("svg", {
    width: "24",
    height: "24",
    viewBox: "0 0 24 24",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg",
    css: /* @__PURE__ */ css("animation:", loadingCircleKeyframes, " 1s infinite linear;" + (false ? "" : ";label:LoadingOutline;"), false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */")
  }, jsx("g", {
    id: "loading"
  }, jsx("mask", {
    id: "mask0_804_24",
    style: {
      maskType: "alpha"
    },
    maskUnits: "userSpaceOnUse",
    x: "2",
    y: "2",
    width: "20",
    height: "20"
  }, jsx("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M2 12C2 6.486 6.486 2 12 2C17.514 2 22 6.486 22 12C22 17.514 17.514 22 12 22C6.486 22 2 17.514 2 12ZM4 12C4 16.411 7.589 20 12 20C16.411 20 20 16.411 20 12C20 7.589 16.411 4 12 4C7.589 4 4 7.589 4 12Z",
    fill: "inherit"
  })), jsx("g", {
    mask: "url(#mask0_804_24)"
  }, jsx("path", {
    id: "Union",
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M15.8268 2.7612C14.6136 2.25866 13.3132 2 12 2C11.4477 2 11 2.44772 11 3C11 3.55228 11.4477 4 12 4V12H20C20 12.5523 20.4477 13 21 13C21.5523 13 22 12.5523 22 12C22 10.6868 21.7413 9.38642 21.2388 8.17317C20.7362 6.95991 19.9997 5.85752 19.0711 4.92893C18.1425 4.00035 17.0401 3.26375 15.8268 2.7612Z",
    fill: "inherit"
  }))));
};
var LogOut = function LogOut2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "log-out"
  }, jsx("rect", {
    width: "24",
    height: "24",
    transform: "rotate(90 12 12)",
    opacity: "0"
  }), jsx("path", {
    d: "M7 6a1 1 0 0 0 0-2H5a1 1 0 0 0-1 1v14a1 1 0 0 0 1 1h2a1 1 0 0 0 0-2H6V6z"
  }), jsx("path", {
    d: "M20.82 11.42l-2.82-4a1 1 0 0 0-1.39-.24 1 1 0 0 0-.24 1.4L18.09 11H10a1 1 0 0 0 0 2h8l-1.8 2.4a1 1 0 0 0 .2 1.4 1 1 0 0 0 .6.2 1 1 0 0 0 .8-.4l3-4a1 1 0 0 0 .02-1.18z"
  }))));
};
var MaximizeOutline = function MaximizeOutline2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "maximize"
  }, jsx("rect", {
    width: "24",
    height: "24",
    opacity: "0"
  }), jsx("path", {
    d: "M20.71 19.29l-3.4-3.39A7.92 7.92 0 0 0 19 11a8 8 0 1 0-8 8 7.92 7.92 0 0 0 4.9-1.69l3.39 3.4a1 1 0 0 0 1.42 0 1 1 0 0 0 0-1.42zM5 11a6 6 0 1 1 6 6 6 6 0 0 1-6-6z"
  }), jsx("path", {
    d: "M13 10h-1V9a1 1 0 0 0-2 0v1H9a1 1 0 0 0 0 2h1v1a1 1 0 0 0 2 0v-1h1a1 1 0 0 0 0-2z"
  }))));
};
var MinimizeOutline = function MinimizeOutline2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "minimize"
  }, jsx("rect", {
    width: "24",
    height: "24",
    opacity: "0"
  }), jsx("path", {
    d: "M20.71 19.29l-3.4-3.39A7.92 7.92 0 0 0 19 11a8 8 0 1 0-8 8 7.92 7.92 0 0 0 4.9-1.69l3.39 3.4a1 1 0 0 0 1.42 0 1 1 0 0 0 0-1.42zM5 11a6 6 0 1 1 6 6 6 6 0 0 1-6-6z"
  }), jsx("path", {
    d: "M13 10H9a1 1 0 0 0 0 2h4a1 1 0 0 0 0-2z"
  }))));
};
var MinusCircle = function MinusCircle2() {
  return jsx("svg", {
    width: "24",
    height: "24",
    viewBox: "0 0 24 24",
    xmlns: "http://www.w3.org/2000/svg"
  }, jsx("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M2 12C2 6.486 6.486 2 12 2C17.514 2 22 6.486 22 12C22 17.514 17.514 22 12 22C6.486 22 2 17.514 2 12ZM12 20C7.589 20 4 16.411 4 12C4 7.589 7.589 4 12 4C16.411 4 20 7.589 20 12C20 16.411 16.411 20 12 20ZM9 11C8.45 11 8 11.45 8 12C8 12.55 8.45 13 9 13H15C15.55 13 16 12.55 16 12C16 11.45 15.55 11 15 11H9Z"
  }), jsx("mask", {
    "mask-type": "alpha",
    maskUnits: "userSpaceOnUse",
    x: "2",
    y: "2",
    width: "20",
    height: "20"
  }, jsx("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M2 12C2 6.486 6.486 2 12 2C17.514 2 22 6.486 22 12C22 17.514 17.514 22 12 22C6.486 22 2 17.514 2 12ZM12 20C7.589 20 4 16.411 4 12C4 7.589 7.589 4 12 4C16.411 4 20 7.589 20 12C20 16.411 16.411 20 12 20ZM9 11C8.45 11 8 11.45 8 12C8 12.55 8.45 13 9 13H15C15.55 13 16 12.55 16 12C16 11.45 15.55 11 15 11H9Z"
  })));
};
var MinusCircleOutline = function MinusCircleOutline2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "minus-circle"
  }, jsx("rect", {
    width: "24",
    height: "24",
    opacity: "0"
  }), jsx("path", {
    d: "M12 2a10 10 0 1 0 10 10A10 10 0 0 0 12 2zm0 18a8 8 0 1 1 8-8 8 8 0 0 1-8 8z"
  }), jsx("path", {
    d: "M15 11H9a1 1 0 0 0 0 2h6a1 1 0 0 0 0-2z"
  }))));
};
var MoonOutline = function MoonOutline2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "moon"
  }, jsx("rect", {
    width: "24",
    height: "24",
    opacity: "0"
  }), jsx("path", {
    d: "M12.3 22h-.1a10.31 10.31 0 0 1-7.34-3.15 10.46 10.46 0 0 1-.26-14 10.13 10.13 0 0 1 4-2.74 1 1 0 0 1 1.06.22 1 1 0 0 1 .24 1 8.4 8.4 0 0 0 1.94 8.81 8.47 8.47 0 0 0 8.83 1.94 1 1 0 0 1 1.27 1.29A10.16 10.16 0 0 1 19.6 19a10.28 10.28 0 0 1-7.3 3zM7.46 4.92a7.93 7.93 0 0 0-1.37 1.22 8.44 8.44 0 0 0 .2 11.32A8.29 8.29 0 0 0 12.22 20h.08a8.34 8.34 0 0 0 6.78-3.49A10.37 10.37 0 0 1 7.46 4.92z"
  }))));
};
var MoreHorizontalOutline = function MoreHorizontalOutline2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "more-horizotnal"
  }, jsx("rect", {
    width: "24",
    height: "24",
    opacity: "0"
  }), jsx("circle", {
    cx: "12",
    cy: "12",
    r: "2"
  }), jsx("circle", {
    cx: "19",
    cy: "12",
    r: "2"
  }), jsx("circle", {
    cx: "5",
    cy: "12",
    r: "2"
  }))));
};
var MoveFilled = function MoveFilled2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "move"
  }, jsx("rect", {
    width: "24",
    height: "24",
    transform: "rotate(180 12 12)",
    opacity: "0"
  }), jsx("path", {
    d: "M21.71 11.31l-3-3a1 1 0 0 0-1.42 1.42L18.58 11H13V5.41l1.29 1.3A1 1 0 0 0 15 7a1 1 0 0 0 .71-.29 1 1 0 0 0 0-1.42l-3-3A1 1 0 0 0 12 2a1 1 0 0 0-.7.29l-3 3a1 1 0 0 0 1.41 1.42L11 5.42V11H5.41l1.3-1.29a1 1 0 0 0-1.42-1.42l-3 3A1 1 0 0 0 2 12a1 1 0 0 0 .29.71l3 3A1 1 0 0 0 6 16a1 1 0 0 0 .71-.29 1 1 0 0 0 0-1.42L5.42 13H11v5.59l-1.29-1.3a1 1 0 0 0-1.42 1.42l3 3A1 1 0 0 0 12 22a1 1 0 0 0 .7-.29l3-3a1 1 0 0 0-1.42-1.42L13 18.58V13h5.59l-1.3 1.29a1 1 0 0 0 0 1.42A1 1 0 0 0 18 16a1 1 0 0 0 .71-.29l3-3A1 1 0 0 0 22 12a1 1 0 0 0-.29-.69z"
  }))));
};
var OptionsOutline = function OptionsOutline2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "options"
  }, jsx("rect", {
    width: "24",
    height: "24",
    opacity: "0"
  }), jsx("path", {
    d: "M7 14.18V3a1 1 0 0 0-2 0v11.18a3 3 0 0 0 0 5.64V21a1 1 0 0 0 2 0v-1.18a3 3 0 0 0 0-5.64zM6 18a1 1 0 1 1 1-1 1 1 0 0 1-1 1z"
  }), jsx("path", {
    d: "M21 13a3 3 0 0 0-2-2.82V3a1 1 0 0 0-2 0v7.18a3 3 0 0 0 0 5.64V21a1 1 0 0 0 2 0v-5.18A3 3 0 0 0 21 13zm-3 1a1 1 0 1 1 1-1 1 1 0 0 1-1 1z"
  }), jsx("path", {
    d: "M15 5a3 3 0 1 0-4 2.82V21a1 1 0 0 0 2 0V7.82A3 3 0 0 0 15 5zm-3 1a1 1 0 1 1 1-1 1 1 0 0 1-1 1z"
  }))));
};
var PauseCircle = function PauseCircle2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "pause-circle"
  }, jsx("rect", {
    width: "24",
    height: "24",
    opacity: "0"
  }), jsx("path", {
    d: "M12 2a10 10 0 1 0 10 10A10 10 0 0 0 12 2zm0 18a8 8 0 1 1 8-8 8 8 0 0 1-8 8z"
  }), jsx("path", {
    d: "M15 8a1 1 0 0 0-1 1v6a1 1 0 0 0 2 0V9a1 1 0 0 0-1-1z"
  }), jsx("path", {
    d: "M9 8a1 1 0 0 0-1 1v6a1 1 0 0 0 2 0V9a1 1 0 0 0-1-1z"
  }))));
};
var Person = function Person2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "person"
  }, jsx("rect", {
    width: "24",
    height: "24",
    opacity: "0"
  }), jsx("path", {
    d: "M12 11a4 4 0 1 0-4-4 4 4 0 0 0 4 4z"
  }), jsx("path", {
    d: "M18 21a1 1 0 0 0 1-1 7 7 0 0 0-14 0 1 1 0 0 0 1 1z"
  }))));
};
var PlayCircleOutline = function PlayCircleOutline2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "play-circle"
  }, jsx("rect", {
    width: "24",
    height: "24",
    opacity: "0"
  }), jsx("path", {
    d: "M12 2a10 10 0 1 0 10 10A10 10 0 0 0 12 2zm0 18a8 8 0 1 1 8-8 8 8 0 0 1-8 8z"
  }), jsx("path", {
    d: "M12.34 7.45a1.7 1.7 0 0 0-1.85-.3 1.6 1.6 0 0 0-1 1.48v6.74a1.6 1.6 0 0 0 1 1.48 1.68 1.68 0 0 0 .69.15 1.74 1.74 0 0 0 1.16-.45L16 13.18a1.6 1.6 0 0 0 0-2.36zm-.84 7.15V9.4l2.81 2.6z"
  }))));
};
var PlusOutline = function PlusOutline2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "plus"
  }, jsx("rect", {
    width: "24",
    height: "24",
    transform: "rotate(180 12 12)",
    opacity: "0"
  }), jsx("path", {
    d: "M19 11h-6V5a1 1 0 0 0-2 0v6H5a1 1 0 0 0 0 2h6v6a1 1 0 0 0 2 0v-6h6a1 1 0 0 0 0-2z"
  }))));
};
var PlusCircleOutline = function PlusCircleOutline2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "plus-circle"
  }, jsx("rect", {
    width: "24",
    height: "24",
    opacity: "0"
  }), jsx("path", {
    d: "M12 2a10 10 0 1 0 10 10A10 10 0 0 0 12 2zm0 18a8 8 0 1 1 8-8 8 8 0 0 1-8 8z"
  }), jsx("path", {
    d: "M15 11h-2V9a1 1 0 0 0-2 0v2H9a1 1 0 0 0 0 2h2v2a1 1 0 0 0 2 0v-2h2a1 1 0 0 0 0-2z"
  }))));
};
var QuestionOutline = function QuestionOutline2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "menu-arrow-circle"
  }, jsx("rect", {
    width: "24",
    height: "24",
    transform: "rotate(180 12 12)",
    opacity: "0"
  }), jsx("path", {
    d: "M12 2a10 10 0 1 0 10 10A10 10 0 0 0 12 2zm0 18a8 8 0 1 1 8-8 8 8 0 0 1-8 8z"
  }), jsx("path", {
    d: "M12 6a3.5 3.5 0 0 0-3.5 3.5 1 1 0 0 0 2 0A1.5 1.5 0 1 1 12 11a1 1 0 0 0-1 1v2a1 1 0 0 0 2 0v-1.16A3.49 3.49 0 0 0 12 6z"
  }), jsx("circle", {
    cx: "12",
    cy: "17",
    r: "1"
  }))));
};
var QuestionMarkCircle = function QuestionMarkCircle2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "menu-arrow-circle"
  }, jsx("rect", {
    width: "24",
    height: "24",
    transform: "rotate(180 12 12)",
    opacity: "0"
  }), jsx("path", {
    d: "M12 2a10 10 0 1 0 10 10A10 10 0 0 0 12 2zm0 16a1 1 0 1 1 1-1 1 1 0 0 1-1 1zm1-5.16V14a1 1 0 0 1-2 0v-2a1 1 0 0 1 1-1 1.5 1.5 0 1 0-1.5-1.5 1 1 0 0 1-2 0 3.5 3.5 0 1 1 4.5 3.34z"
  }))));
};
var Refresh = function Refresh2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "refresh"
  }, jsx("rect", {
    width: "24",
    height: "24",
    opacity: "0"
  }), jsx("path", {
    d: "M20.3 13.43a1 1 0 0 0-1.25.65A7.14 7.14 0 0 1 12.18 19 7.1 7.1 0 0 1 5 12a7.1 7.1 0 0 1 7.18-7 7.26 7.26 0 0 1 4.65 1.67l-2.17-.36a1 1 0 0 0-1.15.83 1 1 0 0 0 .83 1.15l4.24.7h.17a1 1 0 0 0 .34-.06.33.33 0 0 0 .1-.06.78.78 0 0 0 .2-.11l.09-.11c0-.05.09-.09.13-.15s0-.1.05-.14a1.34 1.34 0 0 0 .07-.18l.75-4a1 1 0 0 0-2-.38l-.27 1.45A9.21 9.21 0 0 0 12.18 3 9.1 9.1 0 0 0 3 12a9.1 9.1 0 0 0 9.18 9A9.12 9.12 0 0 0 21 14.68a1 1 0 0 0-.7-1.25z"
  }))));
};
var Search = function Search2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "search"
  }, jsx("rect", {
    width: "24",
    height: "24",
    opacity: "0"
  }), jsx("path", {
    d: "M20.71 19.29l-3.4-3.39A7.92 7.92 0 0 0 19 11a8 8 0 1 0-8 8 7.92 7.92 0 0 0 4.9-1.69l3.39 3.4a1 1 0 0 0 1.42 0 1 1 0 0 0 0-1.42zM5 11a6 6 0 1 1 6 6 6 6 0 0 1-6-6z"
  }))));
};
var SearchOutline = function SearchOutline2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "search"
  }, jsx("rect", {
    width: "24",
    height: "24",
    opacity: "0"
  }), jsx("path", {
    d: "M20.71 19.29l-3.4-3.39A7.92 7.92 0 0 0 19 11a8 8 0 1 0-8 8 7.92 7.92 0 0 0 4.9-1.69l3.39 3.4a1 1 0 0 0 1.42 0 1 1 0 0 0 0-1.42zM5 11a6 6 0 1 1 6 6 6 6 0 0 1-6-6z"
  }))));
};
var Settings = function Settings2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "settings"
  }, jsx("rect", {
    width: "24",
    height: "24",
    opacity: "0"
  }), jsx("circle", {
    cx: "12",
    cy: "12",
    r: "1.5"
  }), jsx("path", {
    d: "M21.89 10.32L21.1 7.8a2.26 2.26 0 0 0-2.88-1.51l-.34.11a1.74 1.74 0 0 1-1.59-.26l-.11-.08a1.76 1.76 0 0 1-.69-1.43v-.28a2.37 2.37 0 0 0-.68-1.68 2.26 2.26 0 0 0-1.6-.67h-2.55a2.32 2.32 0 0 0-2.29 2.33v.24a1.94 1.94 0 0 1-.73 1.51l-.13.1a1.93 1.93 0 0 1-1.78.29 2.14 2.14 0 0 0-1.68.12 2.18 2.18 0 0 0-1.12 1.33l-.82 2.6a2.34 2.34 0 0 0 1.48 2.94h.16a1.83 1.83 0 0 1 1.12 1.22l.06.16a2.06 2.06 0 0 1-.23 1.86 2.37 2.37 0 0 0 .49 3.3l2.07 1.57a2.25 2.25 0 0 0 1.35.43A2 2 0 0 0 9 22a2.25 2.25 0 0 0 1.47-1l.23-.33a1.8 1.8 0 0 1 1.43-.77 1.75 1.75 0 0 1 1.5.78l.12.17a2.24 2.24 0 0 0 3.22.53L19 19.86a2.38 2.38 0 0 0 .5-3.23l-.26-.38A2 2 0 0 1 19 14.6a1.89 1.89 0 0 1 1.21-1.28l.2-.07a2.36 2.36 0 0 0 1.48-2.93zM12 15.5a3.5 3.5 0 1 1 3.5-3.5 3.5 3.5 0 0 1-3.5 3.5z"
  }))));
};
var SettingsOutline = function SettingsOutline2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "settings"
  }, jsx("rect", {
    width: "24",
    height: "24",
    opacity: "0"
  }), jsx("path", {
    d: "M8.61 22a2.25 2.25 0 0 1-1.35-.46L5.19 20a2.37 2.37 0 0 1-.49-3.22 2.06 2.06 0 0 0 .23-1.86l-.06-.16a1.83 1.83 0 0 0-1.12-1.22h-.16a2.34 2.34 0 0 1-1.48-2.94L2.93 8a2.18 2.18 0 0 1 1.12-1.41 2.14 2.14 0 0 1 1.68-.12 1.93 1.93 0 0 0 1.78-.29l.13-.1a1.94 1.94 0 0 0 .73-1.51v-.24A2.32 2.32 0 0 1 10.66 2h2.55a2.26 2.26 0 0 1 1.6.67 2.37 2.37 0 0 1 .68 1.68v.28a1.76 1.76 0 0 0 .69 1.43l.11.08a1.74 1.74 0 0 0 1.59.26l.34-.11A2.26 2.26 0 0 1 21.1 7.8l.79 2.52a2.36 2.36 0 0 1-1.46 2.93l-.2.07A1.89 1.89 0 0 0 19 14.6a2 2 0 0 0 .25 1.65l.26.38a2.38 2.38 0 0 1-.5 3.23L17 21.41a2.24 2.24 0 0 1-3.22-.53l-.12-.17a1.75 1.75 0 0 0-1.5-.78 1.8 1.8 0 0 0-1.43.77l-.23.33A2.25 2.25 0 0 1 9 22a2 2 0 0 1-.39 0zM4.4 11.62a3.83 3.83 0 0 1 2.38 2.5v.12a4 4 0 0 1-.46 3.62.38.38 0 0 0 0 .51L8.47 20a.25.25 0 0 0 .37-.07l.23-.33a3.77 3.77 0 0 1 6.2 0l.12.18a.3.3 0 0 0 .18.12.25.25 0 0 0 .19-.05l2.06-1.56a.36.36 0 0 0 .07-.49l-.26-.38A4 4 0 0 1 17.1 14a3.92 3.92 0 0 1 2.49-2.61l.2-.07a.34.34 0 0 0 .19-.44l-.78-2.49a.35.35 0 0 0-.2-.19.21.21 0 0 0-.19 0l-.34.11a3.74 3.74 0 0 1-3.43-.57L15 7.65a3.76 3.76 0 0 1-1.49-3v-.31a.37.37 0 0 0-.1-.26.31.31 0 0 0-.21-.08h-2.54a.31.31 0 0 0-.29.33v.25a3.9 3.9 0 0 1-1.52 3.09l-.13.1a3.91 3.91 0 0 1-3.63.59.22.22 0 0 0-.14 0 .28.28 0 0 0-.12.15L4 11.12a.36.36 0 0 0 .22.45z",
    "data-name": "<Group>"
  }), jsx("path", {
    d: "M12 15.5a3.5 3.5 0 1 1 3.5-3.5 3.5 3.5 0 0 1-3.5 3.5zm0-5a1.5 1.5 0 1 0 1.5 1.5 1.5 1.5 0 0 0-1.5-1.5z"
  }))));
};
var SunOutline = function SunOutline2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "sun"
  }, jsx("rect", {
    width: "24",
    height: "24",
    transform: "rotate(180 12 12)",
    opacity: "0"
  }), jsx("path", {
    d: "M12 6a1 1 0 0 0 1-1V3a1 1 0 0 0-2 0v2a1 1 0 0 0 1 1z"
  }), jsx("path", {
    d: "M21 11h-2a1 1 0 0 0 0 2h2a1 1 0 0 0 0-2z"
  }), jsx("path", {
    d: "M6 12a1 1 0 0 0-1-1H3a1 1 0 0 0 0 2h2a1 1 0 0 0 1-1z"
  }), jsx("path", {
    d: "M6.22 5a1 1 0 0 0-1.39 1.47l1.44 1.39a1 1 0 0 0 .73.28 1 1 0 0 0 .72-.31 1 1 0 0 0 0-1.41z"
  }), jsx("path", {
    d: "M17 8.14a1 1 0 0 0 .69-.28l1.44-1.39A1 1 0 0 0 17.78 5l-1.44 1.42a1 1 0 0 0 0 1.41 1 1 0 0 0 .66.31z"
  }), jsx("path", {
    d: "M12 18a1 1 0 0 0-1 1v2a1 1 0 0 0 2 0v-2a1 1 0 0 0-1-1z"
  }), jsx("path", {
    d: "M17.73 16.14a1 1 0 0 0-1.39 1.44L17.78 19a1 1 0 0 0 .69.28 1 1 0 0 0 .72-.3 1 1 0 0 0 0-1.42z"
  }), jsx("path", {
    d: "M6.27 16.14l-1.44 1.39a1 1 0 0 0 0 1.42 1 1 0 0 0 .72.3 1 1 0 0 0 .67-.25l1.44-1.39a1 1 0 0 0-1.39-1.44z"
  }), jsx("path", {
    d: "M12 8a4 4 0 1 0 4 4 4 4 0 0 0-4-4zm0 6a2 2 0 1 1 2-2 2 2 0 0 1-2 2z"
  }))));
};
var TokensOutline = function TokensOutline2() {
  return jsx("svg", {
    width: "16",
    height: "16",
    viewBox: "0 0 16 16",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, jsx("g", null, jsx("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M7.32264 7.73275L6.26721 6.67733C5.93552 6.34564 5.39776 6.34564 5.06607 6.67733L4.01064 7.73275C3.67895 8.06445 3.67895 8.60221 4.01064 8.9339L5.06607 9.98933C5.39776 10.321 5.93552 10.321 6.26721 9.98933L7.32264 8.9339C7.65433 8.60221 7.65433 8.06445 7.32264 7.73275ZM4.75695 8.33333L5.66664 7.42364L6.57633 8.33333L5.66664 9.24302L4.75695 8.33333Z"
  }), jsx("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M5.66672 13.3333C6.43362 13.3333 7.16019 13.1607 7.80972 12.8521C8.4596 13.1608 9.18643 13.3333 9.95243 13.3333C12.7139 13.3333 14.9524 11.0948 14.9524 8.33334C14.9524 5.57192 12.7139 3.33334 9.95243 3.33334C9.18643 3.33334 8.4596 3.50591 7.80969 3.81458C7.16019 3.50601 6.43362 3.33334 5.66672 3.33334C2.90529 3.33334 0.666718 5.57192 0.666718 8.33334C0.666718 11.0948 2.90529 13.3333 5.66672 13.3333ZM5.66672 4.28572C3.43129 4.28572 1.6191 6.09791 1.6191 8.33334C1.6191 10.5688 3.43129 12.381 5.66672 12.381C7.72319 12.381 9.42146 10.8473 9.68019 8.86141C9.70272 8.68858 9.71434 8.51232 9.71434 8.33334C9.71434 8.19363 9.70727 8.05556 9.69343 7.91949C9.48617 5.87846 7.76243 4.28572 5.66672 4.28572ZM9.95243 12.381C9.55679 12.381 9.17481 12.3243 8.81393 12.2188C9.81991 11.4029 10.5028 10.2043 10.6409 8.84456C10.658 8.67649 10.6667 8.50594 10.6667 8.33334C10.6667 8.10822 10.6518 7.88658 10.623 7.66934C10.451 6.37275 9.78208 5.23306 8.81393 4.44791C9.17481 4.34237 9.55679 4.28572 9.95243 4.28572C12.1879 4.28572 14.0001 6.09791 14.0001 8.33334C14.0001 10.5688 12.1879 12.381 9.95243 12.381Z"
  })));
};
var TrashOutline = function TrashOutline2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "trash"
  }, jsx("rect", {
    width: "24",
    height: "24",
    opacity: "0"
  }), jsx("path", {
    d: "M21 6h-5V4.33A2.42 2.42 0 0 0 13.5 2h-3A2.42 2.42 0 0 0 8 4.33V6H3a1 1 0 0 0 0 2h1v11a3 3 0 0 0 3 3h10a3 3 0 0 0 3-3V8h1a1 1 0 0 0 0-2zM10 4.33c0-.16.21-.33.5-.33h3c.29 0 .5.17.5.33V6h-4zM18 19a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V8h12z"
  }))));
};
var TrendingUpOutline = function TrendingUpOutline2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "trending-up"
  }, jsx("rect", {
    width: "24",
    height: "24",
    transform: "rotate(-90 12 12)",
    opacity: "0"
  }), jsx("path", {
    d: "M21 7a.78.78 0 0 0 0-.21.64.64 0 0 0-.05-.17 1.1 1.1 0 0 0-.09-.14.75.75 0 0 0-.14-.17l-.12-.07a.69.69 0 0 0-.19-.1h-.2A.7.7 0 0 0 20 6h-5a1 1 0 0 0 0 2h2.83l-4 4.71-4.32-2.57a1 1 0 0 0-1.28.22l-5 6a1 1 0 0 0 .13 1.41A1 1 0 0 0 4 18a1 1 0 0 0 .77-.36l4.45-5.34 4.27 2.56a1 1 0 0 0 1.27-.21L19 9.7V12a1 1 0 0 0 2 0V7z"
  }))));
};
var VolumeOffOutline = function VolumeOffOutline2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "volume-off"
  }, jsx("rect", {
    width: "24",
    height: "24",
    opacity: "0"
  }), jsx("path", {
    d: "M4.71 3.29a1 1 0 0 0-1.42 1.42l16 16a1 1 0 0 0 1.42 0 1 1 0 0 0 0-1.42z"
  }), jsx("path", {
    d: "M16.91 14.08l1.44 1.44a6 6 0 0 0-.07-7.15 1 1 0 1 0-1.56 1.26 4 4 0 0 1 .19 4.45z"
  }), jsx("path", {
    d: "M21 12a6.51 6.51 0 0 1-1.78 4.39l1.42 1.42A8.53 8.53 0 0 0 23 12a8.75 8.75 0 0 0-3.36-6.77 1 1 0 1 0-1.28 1.54A6.8 6.8 0 0 1 21 12z"
  }), jsx("path", {
    d: "M13.5 18.1l-5.1-3.5a1 1 0 0 0-.57-.17H3.5V9.57h3.24l-2-2H2.5a1 1 0 0 0-1 1v6.86a1 1 0 0 0 1 1h5l6.41 4.4a1.06 1.06 0 0 0 .57.17 1 1 0 0 0 1-1v-1.67l-2-2z"
  }), jsx("path", {
    d: "M13.5 5.9v4.77l2 2V4a1 1 0 0 0-1.57-.83L9.23 6.4l1.44 1.44z"
  }))));
};
var VolumeOnOutline = function VolumeOnOutline2() {
  return jsx("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24"
  }, jsx("g", {
    "data-name": "Layer 2"
  }, jsx("g", {
    "data-name": "volume-up"
  }, jsx("rect", {
    width: "24",
    height: "24",
    opacity: "0"
  }), jsx("path", {
    d: "M18.28 8.37a1 1 0 1 0-1.56 1.26 4 4 0 0 1 0 4.74A1 1 0 0 0 17.5 16a1 1 0 0 0 .78-.37 6 6 0 0 0 0-7.26z"
  }), jsx("path", {
    d: "M19.64 5.23a1 1 0 1 0-1.28 1.54A6.8 6.8 0 0 1 21 12a6.8 6.8 0 0 1-2.64 5.23 1 1 0 0 0-.13 1.41A1 1 0 0 0 19 19a1 1 0 0 0 .64-.23A8.75 8.75 0 0 0 23 12a8.75 8.75 0 0 0-3.36-6.77z"
  }), jsx("path", {
    d: "M15 3.12a1 1 0 0 0-1 0L7.52 7.57h-5a1 1 0 0 0-1 1v6.86a1 1 0 0 0 1 1h5l6.41 4.4a1.06 1.06 0 0 0 .57.17 1 1 0 0 0 1-1V4a1 1 0 0 0-.5-.88zm-1.47 15L8.4 14.6a1 1 0 0 0-.57-.17H3.5V9.57h4.33a1 1 0 0 0 .57-.17l5.1-3.5z"
  }))));
};
var Icons = {
  __proto__: null,
  ActivityOutline,
  ArchiveOutline,
  ArrowBack,
  ArrowIosBackOutline,
  ArrowDown,
  ArrowDownFill,
  ArrowDownFilled,
  ArrowIosDownwardOutline,
  ArrowDownWithStem,
  ArrowRight,
  ArrowHeadRight,
  ArrowUp,
  ArrowUpFilled,
  ArrowUpWithStem,
  ArrowIosUpwardOutline,
  ArrowIosForwardOutline,
  ArrowMix,
  AlertTriangleOutline,
  AlertTriangleFilled,
  AlertCircleOutline,
  AlertCircleFilled,
  Bell,
  BellOutline,
  BookOpen,
  BookOpenFilled,
  BookFilled,
  BookOutline,
  BrowserOutline,
  CalendarOutline,
  Column,
  Code,
  CodeDownload,
  ChevronLeft,
  ChevronRight,
  ChevronRightOutline,
  ChevronUp,
  ChevronDown,
  ChevronDownOutline,
  Cube,
  CubeOutline,
  ClockOutline,
  Checkmark,
  CheckmarkCircle,
  CheckmarkOutline,
  CheckmarkCircleOutline,
  CheckmarkCircleFilled,
  CloseCircle,
  CloseOutline,
  CloseCircleOutline,
  ClipboardCopy,
  CollapseOutline,
  CloudDownloadOutline,
  CloudUpload,
  DatabaseOutline,
  Download,
  DownloadOutline,
  DriftOutline,
  DuplicateIcon,
  EditOutline,
  Edit2Outline,
  EmbeddingsOutline,
  ExternalLinkOutline,
  ExpandOutline,
  Explainability,
  EyeOutline,
  Fairness,
  FileAdd,
  FileAddOutline,
  FileOutline,
  FireOutline,
  FolderOutline,
  FunnelOutline,
  Grid,
  GridOutline,
  Globe,
  Histogram,
  Home,
  HomeOutline,
  Info,
  InfoFilled,
  InfoOutline,
  LassoOutline,
  ListOutline,
  LoadingOutline,
  LogOut,
  MaximizeOutline,
  MinimizeOutline,
  MinusCircle,
  MinusCircleOutline,
  MoonOutline,
  MoreHorizontalOutline,
  MoveFilled,
  OptionsOutline,
  PauseCircle,
  Person,
  PlayCircleOutline,
  PlusOutline,
  PlusCircleOutline,
  QuestionOutline,
  QuestionMarkCircle,
  Refresh,
  Search,
  SearchOutline,
  Settings,
  SettingsOutline,
  SunOutline,
  TokensOutline,
  TrashOutline,
  TrendingUpOutline,
  VolumeOffOutline,
  VolumeOnOutline
};
function _EMOTION_STRINGIFIED_CSS_ERROR__$7() {
  return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
}
var accordionItemCSS = false ? {
  name: "11w00m4",
  styles: "cursor:pointer;padding:var(--accordion-padding-top) var(--accordion-padding-side);display:block;width:100%;display:flex;flex-direction:row;flex:1 1 auto;justify-content:space-between;align-items:center;appearance:none;background-color:inherit;border:0;text-align:start;color:var(--ac-global-text-color-900);border-bottom:1px solid var(--ac-global-border-color-dark);outline:none;background-color:var(--ac-global-background-color-light);transition:background-color 0.2s ease-in-out;&:hover{background-color:var(--ac-global-background-color-light-hover);}.ac-accordion-item__title{font-size:var(--accordion-font-size);}"
} : {
  name: "1diwq6p-accordionItemCSS",
  styles: "cursor:pointer;padding:var(--accordion-padding-top) var(--accordion-padding-side);display:block;width:100%;display:flex;flex-direction:row;flex:1 1 auto;justify-content:space-between;align-items:center;appearance:none;background-color:inherit;border:0;text-align:start;color:var(--ac-global-text-color-900);border-bottom:1px solid var(--ac-global-border-color-dark);outline:none;background-color:var(--ac-global-background-color-light);transition:background-color 0.2s ease-in-out;&:hover{background-color:var(--ac-global-background-color-light-hover);}.ac-accordion-item__title{font-size:var(--accordion-font-size);};label:accordionItemCSS;",
  map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */",
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__$7
};
function Accordion(_ref42) {
  var children = _ref42.children;
  return jsx("div", {
    className: "ac-accordion ac-accordion--default",
    role: "region",
    css: /* @__PURE__ */ css("--accordion-animation-duration:", theme.animation.global.duration, "ms;&.ac-accordion--default{--accordion-padding-top:var(--ac-global-dimension-static-size-100);--accordion-padding-side:var(--ac-global-dimension-static-size-200);--accordion-font-size:", theme.typography.sizes.medium.fontSize, "px;}" + (false ? "" : ";label:Accordion;"), false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */")
  }, children);
}
var _ref$2 = false ? {
  name: "1ggr1ok",
  styles: "transition:transform ease var(--accordion-animation-duration);transform:rotate(0deg)"
} : {
  name: "1qrxy49-AccordionItem",
  styles: "transition:transform ease var(--accordion-animation-duration);transform:rotate(0deg);label:AccordionItem;",
  map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */",
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__$7
};
var _ref2$1 = false ? {
  name: "1yjz5t8",
  styles: "&.is-open{.ac-accordion-itemIndicator{transform:rotate(180deg);}}"
} : {
  name: "1dbi71x-AccordionItem",
  styles: "&.is-open{.ac-accordion-itemIndicator{transform:rotate(180deg);}};label:AccordionItem;",
  map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */",
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__$7
};
var _ref3$1 = false ? {
  name: "euf8ri",
  styles: "display:flex;flex-direction:row;.ac-accordion-item__title{margin-right:var(--ac-global-dimension-static-size-50);}"
} : {
  name: "1qrat55-titleEl",
  styles: "display:flex;flex-direction:row;.ac-accordion-item__title{margin-right:var(--ac-global-dimension-static-size-50);};label:titleEl;",
  map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */",
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__$7
};
function AccordionItem(props) {
  var title = props.title, titleExtra = props.titleExtra, id2 = props.id, _props$defaultIsOpen = props.defaultIsOpen, defaultIsOpen = _props$defaultIsOpen === void 0 ? true : _props$defaultIsOpen, onChange = props.onChange, children = props.children;
  var _useState = (0, import_react35.useState)(defaultIsOpen), isOpen = _useState[0], setIsOpen = _useState[1];
  var contentId = id2 + "-content", headerId = id2 + "-heading";
  var titleEl = titleExtra ? jsx("div", {
    css: _ref3$1
  }, jsx("span", {
    className: "ac-accordion-item__title"
  }, title), titleExtra) : jsx("span", {
    className: "ac-accordion-item__title"
  }, title);
  return jsx("div", {
    className: clsx_m_default("ac-accordion-item", {
      "is-open": isOpen
    }),
    role: "presentation",
    css: _ref2$1
  }, jsx(_Heading, {
    level: 3
  }, jsx("button", {
    id: headerId,
    css: accordionItemCSS,
    onClick: function onClick() {
      var newIsOpen = !isOpen;
      setIsOpen(newIsOpen);
      onChange && onChange(newIsOpen);
    },
    "aria-controls": contentId,
    "aria-expanded": isOpen
  }, titleEl, jsx(Icon, {
    svg: jsx(ArrowIosDownwardOutline, null),
    className: "ac-accordion-itemIndicator",
    css: _ref$2,
    "aria-hidden": true
  }))), jsx("div", {
    className: "ac-accordion-itemContent",
    id: contentId,
    role: "region",
    css: /* @__PURE__ */ css("border-bottom:1px solid var(--ac-global-border-color-dark);display:", isOpen ? "block" : "none", ";" + (false ? "" : ";label:AccordionItem;"), false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */"),
    "aria-labelledby": headerId,
    "aria-hidden": !isOpen
  }, children));
}
function _EMOTION_STRINGIFIED_CSS_ERROR__$8() {
  return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
}
var titleWrapCSS = false ? {
  name: "1vg1mr7",
  styles: "display:flex;flex-direction:column;&>h3,&>h4{padding:0;margin:0;}"
} : {
  name: "vkndi-titleWrapCSS",
  styles: "display:flex;flex-direction:column;&>h3,&>h4{padding:0;margin:0;};label:titleWrapCSS;",
  map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkNvbGxhcHNpYmxlQ2FyZFRpdGxlLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFJeUIiLCJmaWxlIjoiQ29sbGFwc2libGVDYXJkVGl0bGUudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IFJlYWN0IGZyb20gJ3JlYWN0JztcclxuaW1wb3J0IHsgY3NzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xyXG5pbXBvcnQgeyBJY29uLCBBcnJvd0lvc0Rvd253YXJkT3V0bGluZSB9IGZyb20gJy4uL2ljb24nO1xyXG5pbXBvcnQgeyBjbGFzc05hbWVzLCB1c2VTdHlsZVByb3BzLCB2aWV3U3R5bGVQcm9wcyB9IGZyb20gJy4uL3V0aWxzJztcclxuY29uc3QgdGl0bGVXcmFwQ1NTID0gY3NzIGBcbiAgZGlzcGxheTogZmxleDtcbiAgZmxleC1kaXJlY3Rpb246IGNvbHVtbjtcbiAgJiA+IGgzLFxuICAmID4gaDQge1xuICAgIHBhZGRpbmc6IDA7XG4gICAgbWFyZ2luOiAwO1xuICB9XG5gO1xyXG5leHBvcnQgZnVuY3Rpb24gQ29sbGFwc2libGVDYXJkVGl0bGUocHJvcHMpIHtcclxuICAgIGNvbnN0IHsgb25PcGVuLCBpc09wZW4sIHRpdGxlLCBjbGFzc05hbWUsIGNvbnRlbnRJZCwgaGVhZGVySWQsIHN1YlRpdGxlLCB9ID0gcHJvcHM7XHJcbiAgICBjb25zdCB7IHN0eWxlUHJvcHMgfSA9IHVzZVN0eWxlUHJvcHMocHJvcHMsIHZpZXdTdHlsZVByb3BzKTtcclxuICAgIHJldHVybiAoPGJ1dHRvbiBpZD17aGVhZGVySWR9IGNsYXNzTmFtZT17Y2xhc3NOYW1lcyhjbGFzc05hbWUpfSBvbkNsaWNrPXtvbk9wZW59IGFyaWEtY29udHJvbHM9e2NvbnRlbnRJZH0gYXJpYS1leHBhbmRlZD17aXNPcGVufSB7Li4uc3R5bGVQcm9wc30+XG4gICAgICA8SWNvbiBzdmc9ezxBcnJvd0lvc0Rvd253YXJkT3V0bGluZSAvPn0gY2xhc3NOYW1lPVwiYWMtY2FyZC1jb2xsYXBzaWJsZV9fdHJpZ2dlclwiIGNzcz17Y3NzIGBcbiAgICAgICAgICB0cmFuc2l0aW9uOiB0cmFuc2Zvcm0gZWFzZSB2YXIoLS1jb2xsYXBzaWJsZS1jYXJkLWFuaW1hdGlvbi1kdXJhdGlvbik7XG4gICAgICAgICAgdHJhbnNmb3JtOiByb3RhdGUoLTkwZGVnKTtcbiAgICAgICAgICBtYXJnaW4tcmlnaHQ6IHZhcigtLWFjLWdsb2JhbC1kaW1lbnNpb24tc3RhdGljLXNpemUtMTAwKTtcbiAgICAgICAgYH0gYXJpYS1oaWRkZW49e3RydWV9Lz5cbiAgICAgIDxkaXYgY3NzPXt0aXRsZVdyYXBDU1N9PlxuICAgICAgICB7dGl0bGV9XG4gICAgICAgIHtzdWJUaXRsZX1cbiAgICAgIDwvZGl2PlxuICAgIDwvYnV0dG9uPik7XHJcbn1cclxuLy8jIHNvdXJjZU1hcHBpbmdVUkw9Q29sbGFwc2libGVDYXJkVGl0bGUuanN4Lm1hcCJdfQ== */",
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__$8
};
var _ref$3 = false ? {
  name: "1dw8uo9",
  styles: "transition:transform ease var(--collapsible-card-animation-duration);transform:rotate(-90deg);margin-right:var(--ac-global-dimension-static-size-100)"
} : {
  name: "1m9t3k5-CollapsibleCardTitle",
  styles: "transition:transform ease var(--collapsible-card-animation-duration);transform:rotate(-90deg);margin-right:var(--ac-global-dimension-static-size-100);label:CollapsibleCardTitle;",
  map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkNvbGxhcHNpYmxlQ2FyZFRpdGxlLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFpQmdHIiwiZmlsZSI6IkNvbGxhcHNpYmxlQ2FyZFRpdGxlLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBSZWFjdCBmcm9tICdyZWFjdCc7XHJcbmltcG9ydCB7IGNzcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcclxuaW1wb3J0IHsgSWNvbiwgQXJyb3dJb3NEb3dud2FyZE91dGxpbmUgfSBmcm9tICcuLi9pY29uJztcclxuaW1wb3J0IHsgY2xhc3NOYW1lcywgdXNlU3R5bGVQcm9wcywgdmlld1N0eWxlUHJvcHMgfSBmcm9tICcuLi91dGlscyc7XHJcbmNvbnN0IHRpdGxlV3JhcENTUyA9IGNzcyBgXG4gIGRpc3BsYXk6IGZsZXg7XG4gIGZsZXgtZGlyZWN0aW9uOiBjb2x1bW47XG4gICYgPiBoMyxcbiAgJiA+IGg0IHtcbiAgICBwYWRkaW5nOiAwO1xuICAgIG1hcmdpbjogMDtcbiAgfVxuYDtcclxuZXhwb3J0IGZ1bmN0aW9uIENvbGxhcHNpYmxlQ2FyZFRpdGxlKHByb3BzKSB7XHJcbiAgICBjb25zdCB7IG9uT3BlbiwgaXNPcGVuLCB0aXRsZSwgY2xhc3NOYW1lLCBjb250ZW50SWQsIGhlYWRlcklkLCBzdWJUaXRsZSwgfSA9IHByb3BzO1xyXG4gICAgY29uc3QgeyBzdHlsZVByb3BzIH0gPSB1c2VTdHlsZVByb3BzKHByb3BzLCB2aWV3U3R5bGVQcm9wcyk7XHJcbiAgICByZXR1cm4gKDxidXR0b24gaWQ9e2hlYWRlcklkfSBjbGFzc05hbWU9e2NsYXNzTmFtZXMoY2xhc3NOYW1lKX0gb25DbGljaz17b25PcGVufSBhcmlhLWNvbnRyb2xzPXtjb250ZW50SWR9IGFyaWEtZXhwYW5kZWQ9e2lzT3Blbn0gey4uLnN0eWxlUHJvcHN9PlxuICAgICAgPEljb24gc3ZnPXs8QXJyb3dJb3NEb3dud2FyZE91dGxpbmUgLz59IGNsYXNzTmFtZT1cImFjLWNhcmQtY29sbGFwc2libGVfX3RyaWdnZXJcIiBjc3M9e2NzcyBgXG4gICAgICAgICAgdHJhbnNpdGlvbjogdHJhbnNmb3JtIGVhc2UgdmFyKC0tY29sbGFwc2libGUtY2FyZC1hbmltYXRpb24tZHVyYXRpb24pO1xuICAgICAgICAgIHRyYW5zZm9ybTogcm90YXRlKC05MGRlZyk7XG4gICAgICAgICAgbWFyZ2luLXJpZ2h0OiB2YXIoLS1hYy1nbG9iYWwtZGltZW5zaW9uLXN0YXRpYy1zaXplLTEwMCk7XG4gICAgICAgIGB9IGFyaWEtaGlkZGVuPXt0cnVlfS8+XG4gICAgICA8ZGl2IGNzcz17dGl0bGVXcmFwQ1NTfT5cbiAgICAgICAge3RpdGxlfVxuICAgICAgICB7c3ViVGl0bGV9XG4gICAgICA8L2Rpdj5cbiAgICA8L2J1dHRvbj4pO1xyXG59XHJcbi8vIyBzb3VyY2VNYXBwaW5nVVJMPUNvbGxhcHNpYmxlQ2FyZFRpdGxlLmpzeC5tYXAiXX0= */",
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__$8
};
function CollapsibleCardTitle(props) {
  var onOpen = props.onOpen, isOpen = props.isOpen, title = props.title, className = props.className, contentId = props.contentId, headerId = props.headerId, subTitle = props.subTitle;
  var _useStyleProps = useStyleProps(props, viewStyleProps), styleProps = _useStyleProps.styleProps;
  return jsx("button", _extends2({
    id: headerId,
    className: clsx_m_default(className),
    onClick: onOpen,
    "aria-controls": contentId,
    "aria-expanded": isOpen
  }, styleProps), jsx(Icon, {
    svg: jsx(ArrowIosDownwardOutline, null),
    className: "ac-card-collapsible__trigger",
    css: _ref$3,
    "aria-hidden": true
  }), jsx("div", {
    css: titleWrapCSS
  }, title, subTitle));
}
function _EMOTION_STRINGIFIED_CSS_ERROR__$9() {
  return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
}
var cardCSS = function cardCSS2(style) {
  return /* @__PURE__ */ css("--scope-border-color:", style.borderColor, ";display:flex;flex-direction:column;background-color:var(--ac-global-background-color-dark);color:var(--ac-global-text-color-900);border-radius:var(--ac-global-rounding-medium);border:1px solid var(--scope-border-color);overflow:hidden;&.ac-card--default{--card-header-height:68px;}&.ac-card--compact{--card-header-height:46px;}" + (false ? "" : ";label:cardCSS;"), false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0eWxlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFFc0MiLCJmaWxlIjoic3R5bGVzLnRzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgY3NzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xyXG5pbXBvcnQgdGhlbWUgZnJvbSAnLi4vdGhlbWUnO1xyXG5leHBvcnQgY29uc3QgY2FyZENTUyA9IChzdHlsZSkgPT4gY3NzIGBcbiAgLS1zY29wZS1ib3JkZXItY29sb3I6ICR7c3R5bGUuYm9yZGVyQ29sb3J9O1xuICBkaXNwbGF5OiBmbGV4O1xuICBmbGV4LWRpcmVjdGlvbjogY29sdW1uO1xuICBiYWNrZ3JvdW5kLWNvbG9yOiB2YXIoLS1hYy1nbG9iYWwtYmFja2dyb3VuZC1jb2xvci1kYXJrKTtcbiAgY29sb3I6IHZhcigtLWFjLWdsb2JhbC10ZXh0LWNvbG9yLTkwMCk7XG4gIGJvcmRlci1yYWRpdXM6IHZhcigtLWFjLWdsb2JhbC1yb3VuZGluZy1tZWRpdW0pO1xuICBib3JkZXI6IDFweCBzb2xpZCB2YXIoLS1zY29wZS1ib3JkZXItY29sb3IpO1xuICBvdmVyZmxvdzogaGlkZGVuO1xuICAvKiB2YXJpYW50IHZhcmlhYmxlcyAqL1xuICAmLmFjLWNhcmQtLWRlZmF1bHQge1xuICAgIC0tY2FyZC1oZWFkZXItaGVpZ2h0OiA2OHB4O1xuICB9XG4gICYuYWMtY2FyZC0tY29tcGFjdCB7XG4gICAgLS1jYXJkLWhlYWRlci1oZWlnaHQ6IDQ2cHg7XG4gIH1cbmA7XHJcbmNvbnN0IGhlYWRlckJvcmRlckNTUyA9IGNzcyBgXG4gIGJvcmRlci1ib3R0b206IDFweCBzb2xpZCB2YXIoLS1zY29wZS1ib3JkZXItY29sb3IpO1xuYDtcclxuZXhwb3J0IGNvbnN0IGhlYWRlckNTUyA9ICh7IGJvcmRlcmVkIH0pID0+IHtcclxuICAgIHJldHVybiBjc3MgYFxuICAgIGRpc3BsYXk6IGZsZXg7XG4gICAgZmxleC1kaXJlY3Rpb246IHJvdztcbiAgICBmbGV4OiBub25lO1xuICAgIGp1c3RpZnktY29udGVudDogc3BhY2UtYmV0d2VlbjtcbiAgICBhbGlnbi1pdGVtczogY2VudGVyO1xuICAgIHBhZGRpbmc6IDAgMTZweDtcbiAgICBoZWlnaHQ6IHZhcigtLWNhcmQtaGVhZGVyLWhlaWdodCk7XG4gICAgdHJhbnNpdGlvbjogYmFja2dyb3VuZC1jb2xvciAwLjJzIGVhc2UtaW4tb3V0O1xuICAgICYuaXMtY29sbGFwc2libGU6aG92ZXIge1xuICAgICAgYmFja2dyb3VuZC1jb2xvcjogcmdiYSgyNTUsIDI1NSwgMjU1LCAwLjEpO1xuICAgIH1cbiAgICAke2JvcmRlcmVkID8gaGVhZGVyQm9yZGVyQ1NTIDogJyd9XG4gIGA7XHJcbn07XHJcbmV4cG9ydCBjb25zdCBjb2xsYXBzaWJsZUNhcmRDU1MgPSAoc3R5bGUpID0+IGNzcyBgXG4gICR7Y2FyZENTUyhzdHlsZSl9XG4gIC5hYy1jYXJkLWNvbGxhcHNpYmxlLWhlYWRlciB7XG4gICAgcGFkZGluZzogMDtcbiAgICBjdXJzb3I6IHBvaW50ZXI7XG4gICAgZGlzcGxheTogYmxvY2s7XG4gICAgd2lkdGg6IDEwMCU7XG4gICAgZGlzcGxheTogZmxleDtcbiAgICBmbGV4LWRpcmVjdGlvbjogcm93O1xuICAgIGZsZXg6IDEgMSBhdXRvO1xuICAgIGFsaWduLWl0ZW1zOiBjZW50ZXI7XG4gICAgYXBwZWFyYW5jZTogbm9uZTtcbiAgICBiYWNrZ3JvdW5kLWNvbG9yOiBpbmhlcml0O1xuICAgIGJvcmRlcjogMDtcbiAgICB0ZXh0LWFsaWduOiBzdGFydDtcbiAgICBjb2xvcjogdmFyKC0tYWMtZ2xvYmFsLXRleHQtY29sb3ItOTAwKTtcbiAgICAvKiByZW1vdmUgb3V0bGluZSAtIFRPRE8gbWlnaHQgbmVlZCB0byBnaXZlIGEgdmlzdWFsIGN1ZSB0aGF0IHRoaXMgYXJlYSBpcyBpbiBmb2N1cyAqL1xuICAgIG91dGxpbmU6IG5vbmU7XG4gIH1cblxuICAmLmlzLW9wZW4ge1xuICAgIC5hYy1jYXJkLWNvbGxhcHNpYmxlX190cmlnZ2VyIHtcbiAgICAgIHRyYW5zZm9ybTogcm90YXRlKDBkZWcpO1xuICAgIH1cbiAgfVxuICAvKiBzaHJpbmsgdGhlIGhlaWdodCB0byB0aGUgY2FyZCB0aXRsZSBzbyB0aGUgYm9keSBpcyBoaWRkZW4gKi9cbiAgJjpub3QoLmlzLW9wZW4pIHtcbiAgICBoZWlnaHQ6IHZhcigtLWNhcmQtaGVhZGVyLWhlaWdodCkgIWltcG9ydGFudDtcbiAgICBvdmVyZmxvdzogaGlkZGVuO1xuICB9XG5cbiAgLS1jb2xsYXBzaWJsZS1jYXJkLWFuaW1hdGlvbi1kdXJhdGlvbjogJHt0aGVtZS5hbmltYXRpb24uZ2xvYmFsLmR1cmF0aW9ufW1zO1xuYDtcclxuLy8jIHNvdXJjZU1hcHBpbmdVUkw9c3R5bGVzLmpzLm1hcCJdfQ== */");
};
var headerBorderCSS = false ? {
  name: "ome23u",
  styles: "border-bottom:1px solid var(--scope-border-color)"
} : {
  name: "evlx9m-headerBorderCSS",
  styles: "border-bottom:1px solid var(--scope-border-color);label:headerBorderCSS;",
  map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0eWxlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFtQjRCIiwiZmlsZSI6InN0eWxlcy50cyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGNzcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcclxuaW1wb3J0IHRoZW1lIGZyb20gJy4uL3RoZW1lJztcclxuZXhwb3J0IGNvbnN0IGNhcmRDU1MgPSAoc3R5bGUpID0+IGNzcyBgXG4gIC0tc2NvcGUtYm9yZGVyLWNvbG9yOiAke3N0eWxlLmJvcmRlckNvbG9yfTtcbiAgZGlzcGxheTogZmxleDtcbiAgZmxleC1kaXJlY3Rpb246IGNvbHVtbjtcbiAgYmFja2dyb3VuZC1jb2xvcjogdmFyKC0tYWMtZ2xvYmFsLWJhY2tncm91bmQtY29sb3ItZGFyayk7XG4gIGNvbG9yOiB2YXIoLS1hYy1nbG9iYWwtdGV4dC1jb2xvci05MDApO1xuICBib3JkZXItcmFkaXVzOiB2YXIoLS1hYy1nbG9iYWwtcm91bmRpbmctbWVkaXVtKTtcbiAgYm9yZGVyOiAxcHggc29saWQgdmFyKC0tc2NvcGUtYm9yZGVyLWNvbG9yKTtcbiAgb3ZlcmZsb3c6IGhpZGRlbjtcbiAgLyogdmFyaWFudCB2YXJpYWJsZXMgKi9cbiAgJi5hYy1jYXJkLS1kZWZhdWx0IHtcbiAgICAtLWNhcmQtaGVhZGVyLWhlaWdodDogNjhweDtcbiAgfVxuICAmLmFjLWNhcmQtLWNvbXBhY3Qge1xuICAgIC0tY2FyZC1oZWFkZXItaGVpZ2h0OiA0NnB4O1xuICB9XG5gO1xyXG5jb25zdCBoZWFkZXJCb3JkZXJDU1MgPSBjc3MgYFxuICBib3JkZXItYm90dG9tOiAxcHggc29saWQgdmFyKC0tc2NvcGUtYm9yZGVyLWNvbG9yKTtcbmA7XHJcbmV4cG9ydCBjb25zdCBoZWFkZXJDU1MgPSAoeyBib3JkZXJlZCB9KSA9PiB7XHJcbiAgICByZXR1cm4gY3NzIGBcbiAgICBkaXNwbGF5OiBmbGV4O1xuICAgIGZsZXgtZGlyZWN0aW9uOiByb3c7XG4gICAgZmxleDogbm9uZTtcbiAgICBqdXN0aWZ5LWNvbnRlbnQ6IHNwYWNlLWJldHdlZW47XG4gICAgYWxpZ24taXRlbXM6IGNlbnRlcjtcbiAgICBwYWRkaW5nOiAwIDE2cHg7XG4gICAgaGVpZ2h0OiB2YXIoLS1jYXJkLWhlYWRlci1oZWlnaHQpO1xuICAgIHRyYW5zaXRpb246IGJhY2tncm91bmQtY29sb3IgMC4ycyBlYXNlLWluLW91dDtcbiAgICAmLmlzLWNvbGxhcHNpYmxlOmhvdmVyIHtcbiAgICAgIGJhY2tncm91bmQtY29sb3I6IHJnYmEoMjU1LCAyNTUsIDI1NSwgMC4xKTtcbiAgICB9XG4gICAgJHtib3JkZXJlZCA/IGhlYWRlckJvcmRlckNTUyA6ICcnfVxuICBgO1xyXG59O1xyXG5leHBvcnQgY29uc3QgY29sbGFwc2libGVDYXJkQ1NTID0gKHN0eWxlKSA9PiBjc3MgYFxuICAke2NhcmRDU1Moc3R5bGUpfVxuICAuYWMtY2FyZC1jb2xsYXBzaWJsZS1oZWFkZXIge1xuICAgIHBhZGRpbmc6IDA7XG4gICAgY3Vyc29yOiBwb2ludGVyO1xuICAgIGRpc3BsYXk6IGJsb2NrO1xuICAgIHdpZHRoOiAxMDAlO1xuICAgIGRpc3BsYXk6IGZsZXg7XG4gICAgZmxleC1kaXJlY3Rpb246IHJvdztcbiAgICBmbGV4OiAxIDEgYXV0bztcbiAgICBhbGlnbi1pdGVtczogY2VudGVyO1xuICAgIGFwcGVhcmFuY2U6IG5vbmU7XG4gICAgYmFja2dyb3VuZC1jb2xvcjogaW5oZXJpdDtcbiAgICBib3JkZXI6IDA7XG4gICAgdGV4dC1hbGlnbjogc3RhcnQ7XG4gICAgY29sb3I6IHZhcigtLWFjLWdsb2JhbC10ZXh0LWNvbG9yLTkwMCk7XG4gICAgLyogcmVtb3ZlIG91dGxpbmUgLSBUT0RPIG1pZ2h0IG5lZWQgdG8gZ2l2ZSBhIHZpc3VhbCBjdWUgdGhhdCB0aGlzIGFyZWEgaXMgaW4gZm9jdXMgKi9cbiAgICBvdXRsaW5lOiBub25lO1xuICB9XG5cbiAgJi5pcy1vcGVuIHtcbiAgICAuYWMtY2FyZC1jb2xsYXBzaWJsZV9fdHJpZ2dlciB7XG4gICAgICB0cmFuc2Zvcm06IHJvdGF0ZSgwZGVnKTtcbiAgICB9XG4gIH1cbiAgLyogc2hyaW5rIHRoZSBoZWlnaHQgdG8gdGhlIGNhcmQgdGl0bGUgc28gdGhlIGJvZHkgaXMgaGlkZGVuICovXG4gICY6bm90KC5pcy1vcGVuKSB7XG4gICAgaGVpZ2h0OiB2YXIoLS1jYXJkLWhlYWRlci1oZWlnaHQpICFpbXBvcnRhbnQ7XG4gICAgb3ZlcmZsb3c6IGhpZGRlbjtcbiAgfVxuXG4gIC0tY29sbGFwc2libGUtY2FyZC1hbmltYXRpb24tZHVyYXRpb246ICR7dGhlbWUuYW5pbWF0aW9uLmdsb2JhbC5kdXJhdGlvbn1tcztcbmA7XHJcbi8vIyBzb3VyY2VNYXBwaW5nVVJMPXN0eWxlcy5qcy5tYXAiXX0= */",
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__$9
};
var headerCSS = function headerCSS2(_ref18) {
  var bordered = _ref18.bordered;
  return /* @__PURE__ */ css("display:flex;flex-direction:row;flex:none;justify-content:space-between;align-items:center;padding:0 16px;height:var(--card-header-height);transition:background-color 0.2s ease-in-out;&.is-collapsible:hover{background-color:rgba(255, 255, 255, 0.1);}", bordered ? headerBorderCSS : "", ";" + (false ? "" : ";label:headerCSS;"), false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0eWxlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUF1QmUiLCJmaWxlIjoic3R5bGVzLnRzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgY3NzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xyXG5pbXBvcnQgdGhlbWUgZnJvbSAnLi4vdGhlbWUnO1xyXG5leHBvcnQgY29uc3QgY2FyZENTUyA9IChzdHlsZSkgPT4gY3NzIGBcbiAgLS1zY29wZS1ib3JkZXItY29sb3I6ICR7c3R5bGUuYm9yZGVyQ29sb3J9O1xuICBkaXNwbGF5OiBmbGV4O1xuICBmbGV4LWRpcmVjdGlvbjogY29sdW1uO1xuICBiYWNrZ3JvdW5kLWNvbG9yOiB2YXIoLS1hYy1nbG9iYWwtYmFja2dyb3VuZC1jb2xvci1kYXJrKTtcbiAgY29sb3I6IHZhcigtLWFjLWdsb2JhbC10ZXh0LWNvbG9yLTkwMCk7XG4gIGJvcmRlci1yYWRpdXM6IHZhcigtLWFjLWdsb2JhbC1yb3VuZGluZy1tZWRpdW0pO1xuICBib3JkZXI6IDFweCBzb2xpZCB2YXIoLS1zY29wZS1ib3JkZXItY29sb3IpO1xuICBvdmVyZmxvdzogaGlkZGVuO1xuICAvKiB2YXJpYW50IHZhcmlhYmxlcyAqL1xuICAmLmFjLWNhcmQtLWRlZmF1bHQge1xuICAgIC0tY2FyZC1oZWFkZXItaGVpZ2h0OiA2OHB4O1xuICB9XG4gICYuYWMtY2FyZC0tY29tcGFjdCB7XG4gICAgLS1jYXJkLWhlYWRlci1oZWlnaHQ6IDQ2cHg7XG4gIH1cbmA7XHJcbmNvbnN0IGhlYWRlckJvcmRlckNTUyA9IGNzcyBgXG4gIGJvcmRlci1ib3R0b206IDFweCBzb2xpZCB2YXIoLS1zY29wZS1ib3JkZXItY29sb3IpO1xuYDtcclxuZXhwb3J0IGNvbnN0IGhlYWRlckNTUyA9ICh7IGJvcmRlcmVkIH0pID0+IHtcclxuICAgIHJldHVybiBjc3MgYFxuICAgIGRpc3BsYXk6IGZsZXg7XG4gICAgZmxleC1kaXJlY3Rpb246IHJvdztcbiAgICBmbGV4OiBub25lO1xuICAgIGp1c3RpZnktY29udGVudDogc3BhY2UtYmV0d2VlbjtcbiAgICBhbGlnbi1pdGVtczogY2VudGVyO1xuICAgIHBhZGRpbmc6IDAgMTZweDtcbiAgICBoZWlnaHQ6IHZhcigtLWNhcmQtaGVhZGVyLWhlaWdodCk7XG4gICAgdHJhbnNpdGlvbjogYmFja2dyb3VuZC1jb2xvciAwLjJzIGVhc2UtaW4tb3V0O1xuICAgICYuaXMtY29sbGFwc2libGU6aG92ZXIge1xuICAgICAgYmFja2dyb3VuZC1jb2xvcjogcmdiYSgyNTUsIDI1NSwgMjU1LCAwLjEpO1xuICAgIH1cbiAgICAke2JvcmRlcmVkID8gaGVhZGVyQm9yZGVyQ1NTIDogJyd9XG4gIGA7XHJcbn07XHJcbmV4cG9ydCBjb25zdCBjb2xsYXBzaWJsZUNhcmRDU1MgPSAoc3R5bGUpID0+IGNzcyBgXG4gICR7Y2FyZENTUyhzdHlsZSl9XG4gIC5hYy1jYXJkLWNvbGxhcHNpYmxlLWhlYWRlciB7XG4gICAgcGFkZGluZzogMDtcbiAgICBjdXJzb3I6IHBvaW50ZXI7XG4gICAgZGlzcGxheTogYmxvY2s7XG4gICAgd2lkdGg6IDEwMCU7XG4gICAgZGlzcGxheTogZmxleDtcbiAgICBmbGV4LWRpcmVjdGlvbjogcm93O1xuICAgIGZsZXg6IDEgMSBhdXRvO1xuICAgIGFsaWduLWl0ZW1zOiBjZW50ZXI7XG4gICAgYXBwZWFyYW5jZTogbm9uZTtcbiAgICBiYWNrZ3JvdW5kLWNvbG9yOiBpbmhlcml0O1xuICAgIGJvcmRlcjogMDtcbiAgICB0ZXh0LWFsaWduOiBzdGFydDtcbiAgICBjb2xvcjogdmFyKC0tYWMtZ2xvYmFsLXRleHQtY29sb3ItOTAwKTtcbiAgICAvKiByZW1vdmUgb3V0bGluZSAtIFRPRE8gbWlnaHQgbmVlZCB0byBnaXZlIGEgdmlzdWFsIGN1ZSB0aGF0IHRoaXMgYXJlYSBpcyBpbiBmb2N1cyAqL1xuICAgIG91dGxpbmU6IG5vbmU7XG4gIH1cblxuICAmLmlzLW9wZW4ge1xuICAgIC5hYy1jYXJkLWNvbGxhcHNpYmxlX190cmlnZ2VyIHtcbiAgICAgIHRyYW5zZm9ybTogcm90YXRlKDBkZWcpO1xuICAgIH1cbiAgfVxuICAvKiBzaHJpbmsgdGhlIGhlaWdodCB0byB0aGUgY2FyZCB0aXRsZSBzbyB0aGUgYm9keSBpcyBoaWRkZW4gKi9cbiAgJjpub3QoLmlzLW9wZW4pIHtcbiAgICBoZWlnaHQ6IHZhcigtLWNhcmQtaGVhZGVyLWhlaWdodCkgIWltcG9ydGFudDtcbiAgICBvdmVyZmxvdzogaGlkZGVuO1xuICB9XG5cbiAgLS1jb2xsYXBzaWJsZS1jYXJkLWFuaW1hdGlvbi1kdXJhdGlvbjogJHt0aGVtZS5hbmltYXRpb24uZ2xvYmFsLmR1cmF0aW9ufW1zO1xuYDtcclxuLy8jIHNvdXJjZU1hcHBpbmdVUkw9c3R5bGVzLmpzLm1hcCJdfQ== */");
};
var collapsibleCardCSS = function collapsibleCardCSS2(style) {
  return /* @__PURE__ */ css(cardCSS(style), " .ac-card-collapsible-header{padding:0;cursor:pointer;display:block;width:100%;display:flex;flex-direction:row;flex:1 1 auto;align-items:center;appearance:none;background-color:inherit;border:0;text-align:start;color:var(--ac-global-text-color-900);outline:none;}&.is-open{.ac-card-collapsible__trigger{transform:rotate(0deg);}}&:not(.is-open){height:var(--card-header-height)!important;overflow:hidden;}--collapsible-card-animation-duration:", theme.animation.global.duration, "ms;" + (false ? "" : ";label:collapsibleCardCSS;"), false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0eWxlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFzQ2lEIiwiZmlsZSI6InN0eWxlcy50cyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGNzcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcclxuaW1wb3J0IHRoZW1lIGZyb20gJy4uL3RoZW1lJztcclxuZXhwb3J0IGNvbnN0IGNhcmRDU1MgPSAoc3R5bGUpID0+IGNzcyBgXG4gIC0tc2NvcGUtYm9yZGVyLWNvbG9yOiAke3N0eWxlLmJvcmRlckNvbG9yfTtcbiAgZGlzcGxheTogZmxleDtcbiAgZmxleC1kaXJlY3Rpb246IGNvbHVtbjtcbiAgYmFja2dyb3VuZC1jb2xvcjogdmFyKC0tYWMtZ2xvYmFsLWJhY2tncm91bmQtY29sb3ItZGFyayk7XG4gIGNvbG9yOiB2YXIoLS1hYy1nbG9iYWwtdGV4dC1jb2xvci05MDApO1xuICBib3JkZXItcmFkaXVzOiB2YXIoLS1hYy1nbG9iYWwtcm91bmRpbmctbWVkaXVtKTtcbiAgYm9yZGVyOiAxcHggc29saWQgdmFyKC0tc2NvcGUtYm9yZGVyLWNvbG9yKTtcbiAgb3ZlcmZsb3c6IGhpZGRlbjtcbiAgLyogdmFyaWFudCB2YXJpYWJsZXMgKi9cbiAgJi5hYy1jYXJkLS1kZWZhdWx0IHtcbiAgICAtLWNhcmQtaGVhZGVyLWhlaWdodDogNjhweDtcbiAgfVxuICAmLmFjLWNhcmQtLWNvbXBhY3Qge1xuICAgIC0tY2FyZC1oZWFkZXItaGVpZ2h0OiA0NnB4O1xuICB9XG5gO1xyXG5jb25zdCBoZWFkZXJCb3JkZXJDU1MgPSBjc3MgYFxuICBib3JkZXItYm90dG9tOiAxcHggc29saWQgdmFyKC0tc2NvcGUtYm9yZGVyLWNvbG9yKTtcbmA7XHJcbmV4cG9ydCBjb25zdCBoZWFkZXJDU1MgPSAoeyBib3JkZXJlZCB9KSA9PiB7XHJcbiAgICByZXR1cm4gY3NzIGBcbiAgICBkaXNwbGF5OiBmbGV4O1xuICAgIGZsZXgtZGlyZWN0aW9uOiByb3c7XG4gICAgZmxleDogbm9uZTtcbiAgICBqdXN0aWZ5LWNvbnRlbnQ6IHNwYWNlLWJldHdlZW47XG4gICAgYWxpZ24taXRlbXM6IGNlbnRlcjtcbiAgICBwYWRkaW5nOiAwIDE2cHg7XG4gICAgaGVpZ2h0OiB2YXIoLS1jYXJkLWhlYWRlci1oZWlnaHQpO1xuICAgIHRyYW5zaXRpb246IGJhY2tncm91bmQtY29sb3IgMC4ycyBlYXNlLWluLW91dDtcbiAgICAmLmlzLWNvbGxhcHNpYmxlOmhvdmVyIHtcbiAgICAgIGJhY2tncm91bmQtY29sb3I6IHJnYmEoMjU1LCAyNTUsIDI1NSwgMC4xKTtcbiAgICB9XG4gICAgJHtib3JkZXJlZCA/IGhlYWRlckJvcmRlckNTUyA6ICcnfVxuICBgO1xyXG59O1xyXG5leHBvcnQgY29uc3QgY29sbGFwc2libGVDYXJkQ1NTID0gKHN0eWxlKSA9PiBjc3MgYFxuICAke2NhcmRDU1Moc3R5bGUpfVxuICAuYWMtY2FyZC1jb2xsYXBzaWJsZS1oZWFkZXIge1xuICAgIHBhZGRpbmc6IDA7XG4gICAgY3Vyc29yOiBwb2ludGVyO1xuICAgIGRpc3BsYXk6IGJsb2NrO1xuICAgIHdpZHRoOiAxMDAlO1xuICAgIGRpc3BsYXk6IGZsZXg7XG4gICAgZmxleC1kaXJlY3Rpb246IHJvdztcbiAgICBmbGV4OiAxIDEgYXV0bztcbiAgICBhbGlnbi1pdGVtczogY2VudGVyO1xuICAgIGFwcGVhcmFuY2U6IG5vbmU7XG4gICAgYmFja2dyb3VuZC1jb2xvcjogaW5oZXJpdDtcbiAgICBib3JkZXI6IDA7XG4gICAgdGV4dC1hbGlnbjogc3RhcnQ7XG4gICAgY29sb3I6IHZhcigtLWFjLWdsb2JhbC10ZXh0LWNvbG9yLTkwMCk7XG4gICAgLyogcmVtb3ZlIG91dGxpbmUgLSBUT0RPIG1pZ2h0IG5lZWQgdG8gZ2l2ZSBhIHZpc3VhbCBjdWUgdGhhdCB0aGlzIGFyZWEgaXMgaW4gZm9jdXMgKi9cbiAgICBvdXRsaW5lOiBub25lO1xuICB9XG5cbiAgJi5pcy1vcGVuIHtcbiAgICAuYWMtY2FyZC1jb2xsYXBzaWJsZV9fdHJpZ2dlciB7XG4gICAgICB0cmFuc2Zvcm06IHJvdGF0ZSgwZGVnKTtcbiAgICB9XG4gIH1cbiAgLyogc2hyaW5rIHRoZSBoZWlnaHQgdG8gdGhlIGNhcmQgdGl0bGUgc28gdGhlIGJvZHkgaXMgaGlkZGVuICovXG4gICY6bm90KC5pcy1vcGVuKSB7XG4gICAgaGVpZ2h0OiB2YXIoLS1jYXJkLWhlYWRlci1oZWlnaHQpICFpbXBvcnRhbnQ7XG4gICAgb3ZlcmZsb3c6IGhpZGRlbjtcbiAgfVxuXG4gIC0tY29sbGFwc2libGUtY2FyZC1hbmltYXRpb24tZHVyYXRpb246ICR7dGhlbWUuYW5pbWF0aW9uLmdsb2JhbC5kdXJhdGlvbn1tcztcbmA7XHJcbi8vIyBzb3VyY2VNYXBwaW5nVVJMPXN0eWxlcy5qcy5tYXAiXX0= */");
};
var _excluded$9 = ["title", "subTitle", "variant", "children", "style", "bodyStyle", "extra", "className", "titleExtra", "collapsible", "defaultOpen", "id", "onOpenChange"];
function _EMOTION_STRINGIFIED_CSS_ERROR__$a() {
  return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
}
var headerTitleWrapCSS = false ? {
  name: "scsw20",
  styles: "flex:1 1 auto;display:flex;flex-direction:column;&>h3,&>h4{padding:0;margin:0;}"
} : {
  name: "awttqs-headerTitleWrapCSS",
  styles: "flex:1 1 auto;display:flex;flex-direction:column;&>h3,&>h4{padding:0;margin:0;};label:headerTitleWrapCSS;",
  map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */",
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__$a
};
var titleWithTitleExtraCSS = false ? {
  name: "16gllem",
  styles: "display:flex;flex-direction:row;align-items:center;gap:var(--ac-global-dimension-static-size-100)"
} : {
  name: "1mbh7kr-titleWithTitleExtraCSS",
  styles: "display:flex;flex-direction:row;align-items:center;gap:var(--ac-global-dimension-static-size-100);label:titleWithTitleExtraCSS;",
  map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */",
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__$a
};
var bodyCSS = false ? {
  name: "10laadz",
  styles: "flex:1 1 auto;padding:var(--ac-global-dimension-static-size-200)"
} : {
  name: "5pcar5-bodyCSS",
  styles: "flex:1 1 auto;padding:var(--ac-global-dimension-static-size-200);label:bodyCSS;",
  map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */",
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__$a
};
function useStyleBorderColor(styleProps) {
  return (0, import_react35.useMemo)(function() {
    var _styleProps$style;
    return styleProps.style && (_styleProps$style = styleProps.style) != null && _styleProps$style.borderColor ? styleProps.style.borderColor : "var(--ac-global-border-color-default)";
  }, [styleProps.style]);
}
function Card(_ref18) {
  var title = _ref18.title, subTitle = _ref18.subTitle, _ref$variant = _ref18.variant, variant = _ref$variant === void 0 ? "default" : _ref$variant, children = _ref18.children, style = _ref18.style, bodyStyle = _ref18.bodyStyle, extra = _ref18.extra, className = _ref18.className, titleExtra = _ref18.titleExtra, _ref$collapsible = _ref18.collapsible, collapsible = _ref$collapsible === void 0 ? false : _ref$collapsible, _ref$defaultOpen = _ref18.defaultOpen, defaultOpen = _ref$defaultOpen === void 0 ? true : _ref$defaultOpen, id2 = _ref18.id, onOpenChange = _ref18.onOpenChange, props = _objectWithoutPropertiesLoose2(_ref18, _excluded$9);
  var _useStyleProps = useStyleProps(props, viewStyleProps), styleProps = _useStyleProps.styleProps;
  var _useState = (0, import_react35.useState)(defaultOpen), isOpen = _useState[0], setIsOpen = _useState[1];
  var idPrefix = $bdb11010cef70236$export$f680877a34711e37(id2);
  var contentId = idPrefix + "-content", headerId = idPrefix + "-heading";
  var titleSize = variant === "default" ? "xlarge" : "large";
  var subTitleSize = variant === "default" ? "medium" : "xsmall";
  var borderColor = useStyleBorderColor(styleProps);
  var defaultTitle = jsx(_Text, {
    textSize: titleSize,
    elementType: "h3",
    weight: "heavy"
  }, title);
  var titleEl = titleExtra != null ? jsx("div", {
    css: titleWithTitleExtraCSS
  }, defaultTitle, titleExtra) : defaultTitle;
  var subTitleEl = subTitle != null ? jsx(_Text, {
    textSize: subTitleSize,
    elementType: "h4",
    color: "text-700"
  }, subTitle) : void 0;
  var titleClassName = "ac-card__title-wrap ac-card__title-wrap--" + variant;
  var titleComponent = collapsible ? jsx("div", {
    css: headerTitleWrapCSS,
    className: titleClassName
  }, jsx(CollapsibleCardTitle, _extends2({
    isOpen,
    onOpen: function onOpen() {
      var newIsOpen = !isOpen;
      setIsOpen(newIsOpen);
      onOpenChange && onOpenChange(newIsOpen);
    },
    title: titleEl,
    contentId,
    headerId,
    className: "ac-card-collapsible-header",
    subTitle: subTitleEl
  }, styleProps))) : jsx("div", {
    css: headerTitleWrapCSS,
    className: titleClassName
  }, titleEl, subTitleEl);
  return jsx("section", {
    css: collapsible ? collapsibleCardCSS({
      borderColor
    }) : cardCSS({
      borderColor
    }),
    className: clsx_m_default("ac-card", "ac-card--" + variant, className, {
      "is-open": isOpen
    }),
    style: _extends2({}, style, styleProps.style)
  }, jsx("header", {
    css: headerCSS({
      bordered: true
    }),
    id: headerId,
    className: clsx_m_default({
      "is-collapsible": collapsible
    })
  }, titleComponent, extra), jsx("div", {
    css: /* @__PURE__ */ css(bodyCSS, /* @__PURE__ */ css(!isOpen && "display: none !important;", ";" + (false ? "" : ";label:Card;"), false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */"), false ? "" : ";label:Card;", false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */"),
    className: "ac-card__body",
    style: bodyStyle,
    id: contentId,
    "aria-labelledby": headerId,
    "aria-hidden": !isOpen
  }, children));
}
var _excluded$a = ["title", "children", "extra", "variant", "className", "style"];
function _EMOTION_STRINGIFIED_CSS_ERROR__$b() {
  return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
}
var tabbedCardCSS = false ? {
  name: "15rwh11",
  styles: "&[data-has-title='false']{.ac-tabs{margin-top:20px;}}"
} : {
  name: "us1vt0-tabbedCardCSS",
  styles: "&[data-has-title='false']{.ac-tabs{margin-top:20px;}};label:tabbedCardCSS;",
  map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlRhYmJlZENhcmQudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQU0wQiIsImZpbGUiOiJUYWJiZWRDYXJkLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBSZWFjdCBmcm9tICdyZWFjdCc7XHJcbmltcG9ydCB7IHVzZVN0eWxlQm9yZGVyQ29sb3IgfSBmcm9tICcuL0NhcmQnO1xyXG5pbXBvcnQgeyBjc3MgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XHJcbmltcG9ydCB7IFRleHQgfSBmcm9tICcuLi9jb250ZW50JztcclxuaW1wb3J0IHsgY2FyZENTUywgaGVhZGVyQ1NTIH0gZnJvbSAnLi9zdHlsZXMnO1xyXG5pbXBvcnQgeyBjbGFzc05hbWVzLCB1c2VTdHlsZVByb3BzLCB2aWV3U3R5bGVQcm9wcyB9IGZyb20gJy4uL3V0aWxzJztcclxuY29uc3QgdGFiYmVkQ2FyZENTUyA9IGNzcyBgXG4gICZbZGF0YS1oYXMtdGl0bGU9J2ZhbHNlJ10ge1xuICAgIC5hYy10YWJzIHtcbiAgICAgIG1hcmdpbi10b3A6IDIwcHg7XG4gICAgfVxuICB9XG5gO1xyXG5leHBvcnQgZnVuY3Rpb24gVGFiYmVkQ2FyZChwcm9wcykge1xyXG4gICAgY29uc3QgeyB0aXRsZSwgY2hpbGRyZW4sIGV4dHJhLCB2YXJpYW50ID0gJ2RlZmF1bHQnLCBjbGFzc05hbWUsIHN0eWxlLCAuLi5yZXN0UHJvcHMgfSA9IHByb3BzO1xyXG4gICAgY29uc3QgeyBzdHlsZVByb3BzIH0gPSB1c2VTdHlsZVByb3BzKHByb3BzLCB2aWV3U3R5bGVQcm9wcyk7XHJcbiAgICBjb25zdCBoYXNUaXRsZSA9IHRpdGxlICE9IG51bGw7XHJcbiAgICBjb25zdCBib3JkZXJDb2xvciA9IHVzZVN0eWxlQm9yZGVyQ29sb3Ioc3R5bGVQcm9wcyk7XHJcbiAgICByZXR1cm4gKDxzZWN0aW9uIGNzcz17Y3NzKGNhcmRDU1MoeyBib3JkZXJDb2xvciB9KSwgdGFiYmVkQ2FyZENTUyl9IGNsYXNzTmFtZT17Y2xhc3NOYW1lcyhgYWMtY2FyZCBhYy1jYXJkLS0ke3ZhcmlhbnR9IGFjLWNhcmQtLXRhYmJlZGAsIGNsYXNzTmFtZSl9IGRhdGEtaGFzLXRpdGxlPXtoYXNUaXRsZX0gey4uLnJlc3RQcm9wc30gey4uLnN0eWxlUHJvcHN9IFxyXG4gICAgLy8gVE9ETzogZGVwcmVjYXRlIHN0eWxlIHByb3BcclxuICAgIHN0eWxlPXt7IC4uLnN0eWxlLCAuLi5zdHlsZVByb3BzLnN0eWxlIH19PlxuICAgICAge2hhc1RpdGxlID8gKDxoZWFkZXIgY3NzPXtoZWFkZXJDU1MoeyBib3JkZXJlZDogZmFsc2UgfSl9PlxuICAgICAgICAgIDxUZXh0IHRleHRTaXplPVwieGxhcmdlXCIgZWxlbWVudFR5cGU9XCJoM1wiIHdlaWdodD1cImhlYXZ5XCI+XG4gICAgICAgICAgICB7dGl0bGV9XG4gICAgICAgICAgPC9UZXh0PlxuICAgICAgICAgIHtleHRyYX1cbiAgICAgICAgPC9oZWFkZXI+KSA6IG51bGx9XG4gICAgICB7Y2hpbGRyZW59XG4gICAgPC9zZWN0aW9uPik7XHJcbn1cclxuLy8jIHNvdXJjZU1hcHBpbmdVUkw9VGFiYmVkQ2FyZC5qc3gubWFwIl19 */",
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__$b
};
function TabbedCard(props) {
  var title = props.title, children = props.children, extra = props.extra, _props$variant = props.variant, variant = _props$variant === void 0 ? "default" : _props$variant, className = props.className, style = props.style, restProps = _objectWithoutPropertiesLoose2(props, _excluded$a);
  var _useStyleProps = useStyleProps(props, viewStyleProps), styleProps = _useStyleProps.styleProps;
  var hasTitle = title != null;
  var borderColor = useStyleBorderColor(styleProps);
  return jsx("section", _extends2({
    css: /* @__PURE__ */ css(cardCSS({
      borderColor
    }), tabbedCardCSS, false ? "" : ";label:TabbedCard;", false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlRhYmJlZENhcmQudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQWtCMEIiLCJmaWxlIjoiVGFiYmVkQ2FyZC50c3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgUmVhY3QgZnJvbSAncmVhY3QnO1xyXG5pbXBvcnQgeyB1c2VTdHlsZUJvcmRlckNvbG9yIH0gZnJvbSAnLi9DYXJkJztcclxuaW1wb3J0IHsgY3NzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xyXG5pbXBvcnQgeyBUZXh0IH0gZnJvbSAnLi4vY29udGVudCc7XHJcbmltcG9ydCB7IGNhcmRDU1MsIGhlYWRlckNTUyB9IGZyb20gJy4vc3R5bGVzJztcclxuaW1wb3J0IHsgY2xhc3NOYW1lcywgdXNlU3R5bGVQcm9wcywgdmlld1N0eWxlUHJvcHMgfSBmcm9tICcuLi91dGlscyc7XHJcbmNvbnN0IHRhYmJlZENhcmRDU1MgPSBjc3MgYFxuICAmW2RhdGEtaGFzLXRpdGxlPSdmYWxzZSddIHtcbiAgICAuYWMtdGFicyB7XG4gICAgICBtYXJnaW4tdG9wOiAyMHB4O1xuICAgIH1cbiAgfVxuYDtcclxuZXhwb3J0IGZ1bmN0aW9uIFRhYmJlZENhcmQocHJvcHMpIHtcclxuICAgIGNvbnN0IHsgdGl0bGUsIGNoaWxkcmVuLCBleHRyYSwgdmFyaWFudCA9ICdkZWZhdWx0JywgY2xhc3NOYW1lLCBzdHlsZSwgLi4ucmVzdFByb3BzIH0gPSBwcm9wcztcclxuICAgIGNvbnN0IHsgc3R5bGVQcm9wcyB9ID0gdXNlU3R5bGVQcm9wcyhwcm9wcywgdmlld1N0eWxlUHJvcHMpO1xyXG4gICAgY29uc3QgaGFzVGl0bGUgPSB0aXRsZSAhPSBudWxsO1xyXG4gICAgY29uc3QgYm9yZGVyQ29sb3IgPSB1c2VTdHlsZUJvcmRlckNvbG9yKHN0eWxlUHJvcHMpO1xyXG4gICAgcmV0dXJuICg8c2VjdGlvbiBjc3M9e2NzcyhjYXJkQ1NTKHsgYm9yZGVyQ29sb3IgfSksIHRhYmJlZENhcmRDU1MpfSBjbGFzc05hbWU9e2NsYXNzTmFtZXMoYGFjLWNhcmQgYWMtY2FyZC0tJHt2YXJpYW50fSBhYy1jYXJkLS10YWJiZWRgLCBjbGFzc05hbWUpfSBkYXRhLWhhcy10aXRsZT17aGFzVGl0bGV9IHsuLi5yZXN0UHJvcHN9IHsuLi5zdHlsZVByb3BzfSBcclxuICAgIC8vIFRPRE86IGRlcHJlY2F0ZSBzdHlsZSBwcm9wXHJcbiAgICBzdHlsZT17eyAuLi5zdHlsZSwgLi4uc3R5bGVQcm9wcy5zdHlsZSB9fT5cbiAgICAgIHtoYXNUaXRsZSA/ICg8aGVhZGVyIGNzcz17aGVhZGVyQ1NTKHsgYm9yZGVyZWQ6IGZhbHNlIH0pfT5cbiAgICAgICAgICA8VGV4dCB0ZXh0U2l6ZT1cInhsYXJnZVwiIGVsZW1lbnRUeXBlPVwiaDNcIiB3ZWlnaHQ9XCJoZWF2eVwiPlxuICAgICAgICAgICAge3RpdGxlfVxuICAgICAgICAgIDwvVGV4dD5cbiAgICAgICAgICB7ZXh0cmF9XG4gICAgICAgIDwvaGVhZGVyPikgOiBudWxsfVxuICAgICAge2NoaWxkcmVufVxuICAgIDwvc2VjdGlvbj4pO1xyXG59XHJcbi8vIyBzb3VyY2VNYXBwaW5nVVJMPVRhYmJlZENhcmQuanN4Lm1hcCJdfQ== */"),
    className: clsx_m_default("ac-card ac-card--" + variant + " ac-card--tabbed", className),
    "data-has-title": hasTitle
  }, restProps, styleProps, {
    // TODO: deprecate style prop
    style: _extends2({}, style, styleProps.style)
  }), hasTitle ? jsx("header", {
    css: headerCSS({
      bordered: false
    })
  }, jsx(_Text, {
    textSize: "xlarge",
    elementType: "h3",
    weight: "heavy"
  }, title), extra) : null, children);
}
function _EMOTION_STRINGIFIED_CSS_ERROR__$c() {
  return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
}
var interactiveListCSS = false ? {
  name: "t0t996",
  styles: "&>li:hover{background-color:var(--ac-global-background-color-light-hover);cursor:pointer;}"
} : {
  name: "474n39-interactiveListCSS",
  styles: "&>li:hover{background-color:var(--ac-global-background-color-light-hover);cursor:pointer;};label:interactiveListCSS;",
  map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkxpc3QudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUUrQiIsImZpbGUiOiJMaXN0LnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBSZWFjdCwgeyBDaGlsZHJlbiwgY2xvbmVFbGVtZW50LCBpc1ZhbGlkRWxlbWVudCwgfSBmcm9tICdyZWFjdCc7XHJcbmltcG9ydCB7IGNzcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcclxuY29uc3QgaW50ZXJhY3RpdmVMaXN0Q1NTID0gY3NzIGBcbiAgJiA+IGxpOmhvdmVyIHtcbiAgICBiYWNrZ3JvdW5kLWNvbG9yOiB2YXIoLS1hYy1nbG9iYWwtYmFja2dyb3VuZC1jb2xvci1saWdodC1ob3Zlcik7XG4gICAgY3Vyc29yOiBwb2ludGVyO1xuICB9XG5gO1xyXG5leHBvcnQgZnVuY3Rpb24gTGlzdCh7IGNoaWxkcmVuLCBsaXN0U2l6ZSA9ICdkZWZhdWx0JywgaW50ZXJhY3RpdmUgPSBmYWxzZSwgbm9QYWRkaW5nID0gZmFsc2UsIH0pIHtcclxuICAgIHJldHVybiAoPHVsIGNsYXNzTmFtZT1cImFjLWxpc3RcIiBjc3M9e2Nzcyhjc3MgYFxuICAgICAgICAgIGxpc3Qtc3R5bGU6IG5vbmU7XG4gICAgICAgICAgcGFkZGluZzogMDtcbiAgICAgICAgICBtYXJnaW46IDA7XG4gICAgICAgIGAsIGludGVyYWN0aXZlID8gaW50ZXJhY3RpdmVMaXN0Q1NTIDogbnVsbCl9PlxuICAgICAge0NoaWxkcmVuLm1hcChjaGlsZHJlbiwgY2hpbGQgPT4ge1xyXG4gICAgICAgIGlmIChpc1ZhbGlkRWxlbWVudChjaGlsZCkpIHtcclxuICAgICAgICAgICAgcmV0dXJuIGNsb25lRWxlbWVudChjaGlsZCwge1xyXG4gICAgICAgICAgICAgICAgbGlzdFNpemUsXHJcbiAgICAgICAgICAgICAgICBub1BhZGRpbmcsXHJcbiAgICAgICAgICAgIH0pO1xyXG4gICAgICAgIH1cclxuICAgICAgICByZXR1cm4gbnVsbDtcclxuICAgIH0pfVxuICAgIDwvdWw+KTtcclxufVxyXG5jb25zdCBsaXN0SXRlbUNTUyA9IChvcHRpb25zKSA9PiB7XHJcbiAgICBjb25zdCBzcGFjaW5nID0gb3B0aW9ucy5saXN0U2l6ZSA9PT0gJ3NtYWxsJ1xyXG4gICAgICAgID8gJ3ZhcigtLWFjLWdsb2JhbC1kaW1lbnNpb24tc3RhdGljLXNpemUtMTAwKSdcclxuICAgICAgICA6ICd2YXIoLS1hYy1nbG9iYWwtZGltZW5zaW9uLXN0YXRpYy1zaXplLTIwMCknO1xyXG4gICAgY29uc3QgaW5uZXJQYWRkaW5nID0gb3B0aW9ucy5ub1BhZGRpbmcgPyAwIDogc3BhY2luZztcclxuICAgIHJldHVybiBjc3MgYFxuICAgIHBhZGRpbmc6ICR7aW5uZXJQYWRkaW5nfTtcbiAgICBwb3NpdGlvbjogcmVsYXRpdmU7XG4gICAgJjpob3ZlciB7XG4gICAgICBiYWNrZ3JvdW5kLWNvbG9yOiAke29wdGlvbnMuaW50ZXJhY3RpdmVcclxuICAgICAgICA/ICd2YXIoLS1hYy1nbG9iYWwtYmFja2dyb3VuZC1jb2xvci1saWdodC1ob3ZlciknXHJcbiAgICAgICAgOiAndHJhbnNwYXJlbnQnfTtcbiAgICAgIGN1cnNvcjogJHtvcHRpb25zLmludGVyYWN0aXZlID8gJ3BvaW50ZXInIDogJ2RlZmF1bHQnfTtcbiAgICB9XG5cbiAgICAmOm5vdCg6Zmlyc3Qtb2YtdHlwZSk6OmFmdGVyIHtcbiAgICAgIGNvbnRlbnQ6ICcgJztcbiAgICAgIGJvcmRlci10b3A6IDFweCBzb2xpZCB2YXIoLS1hYy1nbG9iYWwtYm9yZGVyLWNvbG9yLWRlZmF1bHQpO1xuICAgICAgcG9zaXRpb246IGFic29sdXRlO1xuICAgICAgbGVmdDogJHtzcGFjaW5nfTtcbiAgICAgIHJpZ2h0OiAwO1xuICAgICAgdG9wOiAwO1xuICAgIH1cbiAgYDtcclxufTtcclxuZXhwb3J0IGZ1bmN0aW9uIExpc3RJdGVtKHsgY2hpbGRyZW4sIGxpc3RTaXplID0gJ2RlZmF1bHQnLCBub1BhZGRpbmcgPSBmYWxzZSwgaW50ZXJhY3RpdmUgPSBmYWxzZSwgb25DbGljaywgfSkge1xyXG4gICAgcmV0dXJuICg8bGkgY2xhc3NOYW1lPVwiYWMtbGlzdC1pdGVtXCIgY3NzPXtsaXN0SXRlbUNTUyh7IGxpc3RTaXplLCBub1BhZGRpbmcsIGludGVyYWN0aXZlIH0pfSBvbkNsaWNrPXtvbkNsaWNrfT5cbiAgICAgIHtjaGlsZHJlbn1cbiAgICA8L2xpPik7XHJcbn1cclxuLy8jIHNvdXJjZU1hcHBpbmdVUkw9TGlzdC5qc3gubWFwIl19 */",
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__$c
};
var _ref$4 = false ? {
  name: "v5al3",
  styles: "list-style:none;padding:0;margin:0"
} : {
  name: "xhjdqo-List",
  styles: "list-style:none;padding:0;margin:0;label:List;",
  map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkxpc3QudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQVNpRCIsImZpbGUiOiJMaXN0LnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBSZWFjdCwgeyBDaGlsZHJlbiwgY2xvbmVFbGVtZW50LCBpc1ZhbGlkRWxlbWVudCwgfSBmcm9tICdyZWFjdCc7XHJcbmltcG9ydCB7IGNzcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcclxuY29uc3QgaW50ZXJhY3RpdmVMaXN0Q1NTID0gY3NzIGBcbiAgJiA+IGxpOmhvdmVyIHtcbiAgICBiYWNrZ3JvdW5kLWNvbG9yOiB2YXIoLS1hYy1nbG9iYWwtYmFja2dyb3VuZC1jb2xvci1saWdodC1ob3Zlcik7XG4gICAgY3Vyc29yOiBwb2ludGVyO1xuICB9XG5gO1xyXG5leHBvcnQgZnVuY3Rpb24gTGlzdCh7IGNoaWxkcmVuLCBsaXN0U2l6ZSA9ICdkZWZhdWx0JywgaW50ZXJhY3RpdmUgPSBmYWxzZSwgbm9QYWRkaW5nID0gZmFsc2UsIH0pIHtcclxuICAgIHJldHVybiAoPHVsIGNsYXNzTmFtZT1cImFjLWxpc3RcIiBjc3M9e2Nzcyhjc3MgYFxuICAgICAgICAgIGxpc3Qtc3R5bGU6IG5vbmU7XG4gICAgICAgICAgcGFkZGluZzogMDtcbiAgICAgICAgICBtYXJnaW46IDA7XG4gICAgICAgIGAsIGludGVyYWN0aXZlID8gaW50ZXJhY3RpdmVMaXN0Q1NTIDogbnVsbCl9PlxuICAgICAge0NoaWxkcmVuLm1hcChjaGlsZHJlbiwgY2hpbGQgPT4ge1xyXG4gICAgICAgIGlmIChpc1ZhbGlkRWxlbWVudChjaGlsZCkpIHtcclxuICAgICAgICAgICAgcmV0dXJuIGNsb25lRWxlbWVudChjaGlsZCwge1xyXG4gICAgICAgICAgICAgICAgbGlzdFNpemUsXHJcbiAgICAgICAgICAgICAgICBub1BhZGRpbmcsXHJcbiAgICAgICAgICAgIH0pO1xyXG4gICAgICAgIH1cclxuICAgICAgICByZXR1cm4gbnVsbDtcclxuICAgIH0pfVxuICAgIDwvdWw+KTtcclxufVxyXG5jb25zdCBsaXN0SXRlbUNTUyA9IChvcHRpb25zKSA9PiB7XHJcbiAgICBjb25zdCBzcGFjaW5nID0gb3B0aW9ucy5saXN0U2l6ZSA9PT0gJ3NtYWxsJ1xyXG4gICAgICAgID8gJ3ZhcigtLWFjLWdsb2JhbC1kaW1lbnNpb24tc3RhdGljLXNpemUtMTAwKSdcclxuICAgICAgICA6ICd2YXIoLS1hYy1nbG9iYWwtZGltZW5zaW9uLXN0YXRpYy1zaXplLTIwMCknO1xyXG4gICAgY29uc3QgaW5uZXJQYWRkaW5nID0gb3B0aW9ucy5ub1BhZGRpbmcgPyAwIDogc3BhY2luZztcclxuICAgIHJldHVybiBjc3MgYFxuICAgIHBhZGRpbmc6ICR7aW5uZXJQYWRkaW5nfTtcbiAgICBwb3NpdGlvbjogcmVsYXRpdmU7XG4gICAgJjpob3ZlciB7XG4gICAgICBiYWNrZ3JvdW5kLWNvbG9yOiAke29wdGlvbnMuaW50ZXJhY3RpdmVcclxuICAgICAgICA/ICd2YXIoLS1hYy1nbG9iYWwtYmFja2dyb3VuZC1jb2xvci1saWdodC1ob3ZlciknXHJcbiAgICAgICAgOiAndHJhbnNwYXJlbnQnfTtcbiAgICAgIGN1cnNvcjogJHtvcHRpb25zLmludGVyYWN0aXZlID8gJ3BvaW50ZXInIDogJ2RlZmF1bHQnfTtcbiAgICB9XG5cbiAgICAmOm5vdCg6Zmlyc3Qtb2YtdHlwZSk6OmFmdGVyIHtcbiAgICAgIGNvbnRlbnQ6ICcgJztcbiAgICAgIGJvcmRlci10b3A6IDFweCBzb2xpZCB2YXIoLS1hYy1nbG9iYWwtYm9yZGVyLWNvbG9yLWRlZmF1bHQpO1xuICAgICAgcG9zaXRpb246IGFic29sdXRlO1xuICAgICAgbGVmdDogJHtzcGFjaW5nfTtcbiAgICAgIHJpZ2h0OiAwO1xuICAgICAgdG9wOiAwO1xuICAgIH1cbiAgYDtcclxufTtcclxuZXhwb3J0IGZ1bmN0aW9uIExpc3RJdGVtKHsgY2hpbGRyZW4sIGxpc3RTaXplID0gJ2RlZmF1bHQnLCBub1BhZGRpbmcgPSBmYWxzZSwgaW50ZXJhY3RpdmUgPSBmYWxzZSwgb25DbGljaywgfSkge1xyXG4gICAgcmV0dXJuICg8bGkgY2xhc3NOYW1lPVwiYWMtbGlzdC1pdGVtXCIgY3NzPXtsaXN0SXRlbUNTUyh7IGxpc3RTaXplLCBub1BhZGRpbmcsIGludGVyYWN0aXZlIH0pfSBvbkNsaWNrPXtvbkNsaWNrfT5cbiAgICAgIHtjaGlsZHJlbn1cbiAgICA8L2xpPik7XHJcbn1cclxuLy8jIHNvdXJjZU1hcHBpbmdVUkw9TGlzdC5qc3gubWFwIl19 */",
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__$c
};
function List(_ref22) {
  var children = _ref22.children, _ref2$listSize = _ref22.listSize, listSize = _ref2$listSize === void 0 ? "default" : _ref2$listSize, _ref2$interactive = _ref22.interactive, interactive = _ref2$interactive === void 0 ? false : _ref2$interactive, _ref2$noPadding = _ref22.noPadding, noPadding = _ref2$noPadding === void 0 ? false : _ref2$noPadding;
  return jsx("ul", {
    className: "ac-list",
    css: /* @__PURE__ */ css(_ref$4, interactive ? interactiveListCSS : null, false ? "" : ";label:List;", false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkxpc3QudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQVN5QyIsImZpbGUiOiJMaXN0LnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBSZWFjdCwgeyBDaGlsZHJlbiwgY2xvbmVFbGVtZW50LCBpc1ZhbGlkRWxlbWVudCwgfSBmcm9tICdyZWFjdCc7XHJcbmltcG9ydCB7IGNzcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcclxuY29uc3QgaW50ZXJhY3RpdmVMaXN0Q1NTID0gY3NzIGBcbiAgJiA+IGxpOmhvdmVyIHtcbiAgICBiYWNrZ3JvdW5kLWNvbG9yOiB2YXIoLS1hYy1nbG9iYWwtYmFja2dyb3VuZC1jb2xvci1saWdodC1ob3Zlcik7XG4gICAgY3Vyc29yOiBwb2ludGVyO1xuICB9XG5gO1xyXG5leHBvcnQgZnVuY3Rpb24gTGlzdCh7IGNoaWxkcmVuLCBsaXN0U2l6ZSA9ICdkZWZhdWx0JywgaW50ZXJhY3RpdmUgPSBmYWxzZSwgbm9QYWRkaW5nID0gZmFsc2UsIH0pIHtcclxuICAgIHJldHVybiAoPHVsIGNsYXNzTmFtZT1cImFjLWxpc3RcIiBjc3M9e2Nzcyhjc3MgYFxuICAgICAgICAgIGxpc3Qtc3R5bGU6IG5vbmU7XG4gICAgICAgICAgcGFkZGluZzogMDtcbiAgICAgICAgICBtYXJnaW46IDA7XG4gICAgICAgIGAsIGludGVyYWN0aXZlID8gaW50ZXJhY3RpdmVMaXN0Q1NTIDogbnVsbCl9PlxuICAgICAge0NoaWxkcmVuLm1hcChjaGlsZHJlbiwgY2hpbGQgPT4ge1xyXG4gICAgICAgIGlmIChpc1ZhbGlkRWxlbWVudChjaGlsZCkpIHtcclxuICAgICAgICAgICAgcmV0dXJuIGNsb25lRWxlbWVudChjaGlsZCwge1xyXG4gICAgICAgICAgICAgICAgbGlzdFNpemUsXHJcbiAgICAgICAgICAgICAgICBub1BhZGRpbmcsXHJcbiAgICAgICAgICAgIH0pO1xyXG4gICAgICAgIH1cclxuICAgICAgICByZXR1cm4gbnVsbDtcclxuICAgIH0pfVxuICAgIDwvdWw+KTtcclxufVxyXG5jb25zdCBsaXN0SXRlbUNTUyA9IChvcHRpb25zKSA9PiB7XHJcbiAgICBjb25zdCBzcGFjaW5nID0gb3B0aW9ucy5saXN0U2l6ZSA9PT0gJ3NtYWxsJ1xyXG4gICAgICAgID8gJ3ZhcigtLWFjLWdsb2JhbC1kaW1lbnNpb24tc3RhdGljLXNpemUtMTAwKSdcclxuICAgICAgICA6ICd2YXIoLS1hYy1nbG9iYWwtZGltZW5zaW9uLXN0YXRpYy1zaXplLTIwMCknO1xyXG4gICAgY29uc3QgaW5uZXJQYWRkaW5nID0gb3B0aW9ucy5ub1BhZGRpbmcgPyAwIDogc3BhY2luZztcclxuICAgIHJldHVybiBjc3MgYFxuICAgIHBhZGRpbmc6ICR7aW5uZXJQYWRkaW5nfTtcbiAgICBwb3NpdGlvbjogcmVsYXRpdmU7XG4gICAgJjpob3ZlciB7XG4gICAgICBiYWNrZ3JvdW5kLWNvbG9yOiAke29wdGlvbnMuaW50ZXJhY3RpdmVcclxuICAgICAgICA/ICd2YXIoLS1hYy1nbG9iYWwtYmFja2dyb3VuZC1jb2xvci1saWdodC1ob3ZlciknXHJcbiAgICAgICAgOiAndHJhbnNwYXJlbnQnfTtcbiAgICAgIGN1cnNvcjogJHtvcHRpb25zLmludGVyYWN0aXZlID8gJ3BvaW50ZXInIDogJ2RlZmF1bHQnfTtcbiAgICB9XG5cbiAgICAmOm5vdCg6Zmlyc3Qtb2YtdHlwZSk6OmFmdGVyIHtcbiAgICAgIGNvbnRlbnQ6ICcgJztcbiAgICAgIGJvcmRlci10b3A6IDFweCBzb2xpZCB2YXIoLS1hYy1nbG9iYWwtYm9yZGVyLWNvbG9yLWRlZmF1bHQpO1xuICAgICAgcG9zaXRpb246IGFic29sdXRlO1xuICAgICAgbGVmdDogJHtzcGFjaW5nfTtcbiAgICAgIHJpZ2h0OiAwO1xuICAgICAgdG9wOiAwO1xuICAgIH1cbiAgYDtcclxufTtcclxuZXhwb3J0IGZ1bmN0aW9uIExpc3RJdGVtKHsgY2hpbGRyZW4sIGxpc3RTaXplID0gJ2RlZmF1bHQnLCBub1BhZGRpbmcgPSBmYWxzZSwgaW50ZXJhY3RpdmUgPSBmYWxzZSwgb25DbGljaywgfSkge1xyXG4gICAgcmV0dXJuICg8bGkgY2xhc3NOYW1lPVwiYWMtbGlzdC1pdGVtXCIgY3NzPXtsaXN0SXRlbUNTUyh7IGxpc3RTaXplLCBub1BhZGRpbmcsIGludGVyYWN0aXZlIH0pfSBvbkNsaWNrPXtvbkNsaWNrfT5cbiAgICAgIHtjaGlsZHJlbn1cbiAgICA8L2xpPik7XHJcbn1cclxuLy8jIHNvdXJjZU1hcHBpbmdVUkw9TGlzdC5qc3gubWFwIl19 */")
  }, import_react35.Children.map(children, function(child) {
    if ((0, import_react35.isValidElement)(child)) {
      return (0, import_react35.cloneElement)(child, {
        listSize,
        noPadding
      });
    }
    return null;
  }));
}
var listItemCSS = function listItemCSS2(options) {
  var spacing = options.listSize === "small" ? "var(--ac-global-dimension-static-size-100)" : "var(--ac-global-dimension-static-size-200)";
  var innerPadding = options.noPadding ? 0 : spacing;
  return /* @__PURE__ */ css("padding:", innerPadding, ";position:relative;&:hover{background-color:", options.interactive ? "var(--ac-global-background-color-light-hover)" : "transparent", ";cursor:", options.interactive ? "pointer" : "default", ";}&:not(:first-of-type)::after{content:' ';border-top:1px solid var(--ac-global-border-color-default);position:absolute;left:", spacing, ";right:0;top:0;}" + (false ? "" : ";label:listItemCSS;"), false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkxpc3QudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQThCZSIsImZpbGUiOiJMaXN0LnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBSZWFjdCwgeyBDaGlsZHJlbiwgY2xvbmVFbGVtZW50LCBpc1ZhbGlkRWxlbWVudCwgfSBmcm9tICdyZWFjdCc7XHJcbmltcG9ydCB7IGNzcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcclxuY29uc3QgaW50ZXJhY3RpdmVMaXN0Q1NTID0gY3NzIGBcbiAgJiA+IGxpOmhvdmVyIHtcbiAgICBiYWNrZ3JvdW5kLWNvbG9yOiB2YXIoLS1hYy1nbG9iYWwtYmFja2dyb3VuZC1jb2xvci1saWdodC1ob3Zlcik7XG4gICAgY3Vyc29yOiBwb2ludGVyO1xuICB9XG5gO1xyXG5leHBvcnQgZnVuY3Rpb24gTGlzdCh7IGNoaWxkcmVuLCBsaXN0U2l6ZSA9ICdkZWZhdWx0JywgaW50ZXJhY3RpdmUgPSBmYWxzZSwgbm9QYWRkaW5nID0gZmFsc2UsIH0pIHtcclxuICAgIHJldHVybiAoPHVsIGNsYXNzTmFtZT1cImFjLWxpc3RcIiBjc3M9e2Nzcyhjc3MgYFxuICAgICAgICAgIGxpc3Qtc3R5bGU6IG5vbmU7XG4gICAgICAgICAgcGFkZGluZzogMDtcbiAgICAgICAgICBtYXJnaW46IDA7XG4gICAgICAgIGAsIGludGVyYWN0aXZlID8gaW50ZXJhY3RpdmVMaXN0Q1NTIDogbnVsbCl9PlxuICAgICAge0NoaWxkcmVuLm1hcChjaGlsZHJlbiwgY2hpbGQgPT4ge1xyXG4gICAgICAgIGlmIChpc1ZhbGlkRWxlbWVudChjaGlsZCkpIHtcclxuICAgICAgICAgICAgcmV0dXJuIGNsb25lRWxlbWVudChjaGlsZCwge1xyXG4gICAgICAgICAgICAgICAgbGlzdFNpemUsXHJcbiAgICAgICAgICAgICAgICBub1BhZGRpbmcsXHJcbiAgICAgICAgICAgIH0pO1xyXG4gICAgICAgIH1cclxuICAgICAgICByZXR1cm4gbnVsbDtcclxuICAgIH0pfVxuICAgIDwvdWw+KTtcclxufVxyXG5jb25zdCBsaXN0SXRlbUNTUyA9IChvcHRpb25zKSA9PiB7XHJcbiAgICBjb25zdCBzcGFjaW5nID0gb3B0aW9ucy5saXN0U2l6ZSA9PT0gJ3NtYWxsJ1xyXG4gICAgICAgID8gJ3ZhcigtLWFjLWdsb2JhbC1kaW1lbnNpb24tc3RhdGljLXNpemUtMTAwKSdcclxuICAgICAgICA6ICd2YXIoLS1hYy1nbG9iYWwtZGltZW5zaW9uLXN0YXRpYy1zaXplLTIwMCknO1xyXG4gICAgY29uc3QgaW5uZXJQYWRkaW5nID0gb3B0aW9ucy5ub1BhZGRpbmcgPyAwIDogc3BhY2luZztcclxuICAgIHJldHVybiBjc3MgYFxuICAgIHBhZGRpbmc6ICR7aW5uZXJQYWRkaW5nfTtcbiAgICBwb3NpdGlvbjogcmVsYXRpdmU7XG4gICAgJjpob3ZlciB7XG4gICAgICBiYWNrZ3JvdW5kLWNvbG9yOiAke29wdGlvbnMuaW50ZXJhY3RpdmVcclxuICAgICAgICA/ICd2YXIoLS1hYy1nbG9iYWwtYmFja2dyb3VuZC1jb2xvci1saWdodC1ob3ZlciknXHJcbiAgICAgICAgOiAndHJhbnNwYXJlbnQnfTtcbiAgICAgIGN1cnNvcjogJHtvcHRpb25zLmludGVyYWN0aXZlID8gJ3BvaW50ZXInIDogJ2RlZmF1bHQnfTtcbiAgICB9XG5cbiAgICAmOm5vdCg6Zmlyc3Qtb2YtdHlwZSk6OmFmdGVyIHtcbiAgICAgIGNvbnRlbnQ6ICcgJztcbiAgICAgIGJvcmRlci10b3A6IDFweCBzb2xpZCB2YXIoLS1hYy1nbG9iYWwtYm9yZGVyLWNvbG9yLWRlZmF1bHQpO1xuICAgICAgcG9zaXRpb246IGFic29sdXRlO1xuICAgICAgbGVmdDogJHtzcGFjaW5nfTtcbiAgICAgIHJpZ2h0OiAwO1xuICAgICAgdG9wOiAwO1xuICAgIH1cbiAgYDtcclxufTtcclxuZXhwb3J0IGZ1bmN0aW9uIExpc3RJdGVtKHsgY2hpbGRyZW4sIGxpc3RTaXplID0gJ2RlZmF1bHQnLCBub1BhZGRpbmcgPSBmYWxzZSwgaW50ZXJhY3RpdmUgPSBmYWxzZSwgb25DbGljaywgfSkge1xyXG4gICAgcmV0dXJuICg8bGkgY2xhc3NOYW1lPVwiYWMtbGlzdC1pdGVtXCIgY3NzPXtsaXN0SXRlbUNTUyh7IGxpc3RTaXplLCBub1BhZGRpbmcsIGludGVyYWN0aXZlIH0pfSBvbkNsaWNrPXtvbkNsaWNrfT5cbiAgICAgIHtjaGlsZHJlbn1cbiAgICA8L2xpPik7XHJcbn1cclxuLy8jIHNvdXJjZU1hcHBpbmdVUkw9TGlzdC5qc3gubWFwIl19 */");
};
function ListItem(_ref32) {
  var children = _ref32.children, _ref3$listSize = _ref32.listSize, listSize = _ref3$listSize === void 0 ? "default" : _ref3$listSize, _ref3$noPadding = _ref32.noPadding, noPadding = _ref3$noPadding === void 0 ? false : _ref3$noPadding, _ref3$interactive = _ref32.interactive, interactive = _ref3$interactive === void 0 ? false : _ref3$interactive, onClick = _ref32.onClick;
  return jsx("li", {
    className: "ac-list-item",
    css: listItemCSS({
      listSize,
      noPadding,
      interactive
    }),
    onClick
  }, children);
}
var TooltipContext = /* @__PURE__ */ import_react35.default.createContext({});
var DEFAULT_OFFSET = -1;
var DEFAULT_CROSS_OFFSET = 0;
function TooltipTrigger(props) {
  var children = props.children, _props$offset = props.offset, offset = _props$offset === void 0 ? DEFAULT_OFFSET : _props$offset, _props$crossOffset = props.crossOffset, crossOffset = _props$crossOffset === void 0 ? DEFAULT_CROSS_OFFSET : _props$crossOffset, isDisabled = props.isDisabled, triggerAction = props.trigger;
  var _React$Children$toArr = import_react35.default.Children.toArray(children), trigger = _React$Children$toArr[0], tooltip = _React$Children$toArr[1];
  var state = $8796f90736e175cb$export$4d40659c25ecb50b(props);
  var tooltipTriggerRef = (0, import_react35.useRef)(null);
  var overlayRef = (0, import_react35.useRef)(null);
  var _useTooltipTrigger = $4e1b34546679e357$export$a6da6c504e4bba8b({
    isDisabled,
    trigger: triggerAction
  }, state, tooltipTriggerRef), triggerProps = _useTooltipTrigger.triggerProps, tooltipProps = _useTooltipTrigger.tooltipProps;
  var _useOverlayPosition = $2a41e45df1593e64$export$d39e1813b3bdd0e1({
    placement: props.placement || "top",
    targetRef: tooltipTriggerRef,
    overlayRef,
    offset,
    crossOffset,
    isOpen: state.isOpen
  }), overlayProps = _useOverlayPosition.overlayProps, arrowProps = _useOverlayPosition.arrowProps, placement = _useOverlayPosition.placement;
  return jsx($e6afbd83fe6ebbd2$export$13f3202a3e5ddd5, _extends2({}, triggerProps, {
    ref: tooltipTriggerRef
  }), trigger, jsx(TooltipContext.Provider, {
    value: _extends2({
      state,
      placement,
      ref: overlayRef,
      style: overlayProps.style,
      arrowProps
    }, tooltipProps)
  }, jsx(Overlay, {
    isOpen: state.isOpen
  }, tooltip)));
}
function _EMOTION_STRINGIFIED_CSS_ERROR__$d() {
  return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
}
var _ref14 = false ? {
  name: "1m90tjj",
  styles: "transform:translateX(var(--tooltip-animation-distance))"
} : {
  name: "srzhhk-transformCSS",
  styles: "transform:translateX(var(--tooltip-animation-distance));label:transformCSS;",
  map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */",
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__$d
};
var _ref15 = false ? {
  name: "18bghnx",
  styles: "transform:translateX(calc(-1 * var(--tooltip-animation-distance)))"
} : {
  name: "1njsjms-transformCSS",
  styles: "transform:translateX(calc(-1 * var(--tooltip-animation-distance)));label:transformCSS;",
  map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */",
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__$d
};
var _ref16 = false ? {
  name: "1vymxbq",
  styles: "transform:translateY(calc(-1 * var(--tooltip-animation-distance)))"
} : {
  name: "768mg8-transformCSS",
  styles: "transform:translateY(calc(-1 * var(--tooltip-animation-distance)));label:transformCSS;",
  map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */",
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__$d
};
var _ref17 = false ? {
  name: "1hto7y3",
  styles: "transform:translateY(var(--tooltip-animation-distance))"
} : {
  name: "sxewcc-transformCSS",
  styles: "transform:translateY(var(--tooltip-animation-distance));label:transformCSS;",
  map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */",
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__$d
};
var tooltipCSS = function tooltipCSS2(_ref18) {
  var placement = _ref18.placement;
  var transformCSS = /* @__PURE__ */ css(false ? "" : ";label:transformCSS;", false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */");
  switch (placement) {
    case "bottom":
      transformCSS = _ref17;
      break;
    case "top":
      transformCSS = _ref16;
      break;
    case "left":
      transformCSS = _ref15;
      break;
    case "right":
      transformCSS = _ref14;
      break;
  }
  return /* @__PURE__ */ css("--tooltip-animation-distance:", theme.spacing.tooltip.offset, "px;--tooltip-target-offset:", theme.spacing.tooltip.offset, "px;--tooltip-tip-width:8px;--tooltip-max-inline-size:200px;--tooltip-background-color:var(--ac-global-color-grey-200);color:var(--ac-global-text-color-900);background-color:var(--tooltip-background-color);position:relative;display:inline-flex;flex-direction:row;align-items:center;box-sizing:border-box;vertical-align:top;width:auto;padding:var(--ac-global-dimension-static-size-100);border-radius:4px;min-height:24px;max-inline-size:var(--tooltip-max-inline-size);word-break:break-word;-webkit-font-smoothing:antialiased;visibility:hidden;opacity:0;transition:transform 200ms ease-in-out,opacity 200ms ease-in-out,visibility 200ms linear;&.is-open{visibility:visible;opacity:1;transition-delay:0ms;pointer-events:auto;", transformCSS, ";}" + (false ? "" : ";label:tooltipCSS;"), false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */");
};
var _ref9 = false ? {
  name: "1329nf4",
  styles: "position:absolute;border-color:var(--tooltip-background-color);height:0;width:0;border-width:var(--tooltip-tip-width);border-style:solid;border-left-color:transparent;border-right-color:transparent;border-bottom-color:transparent"
} : {
  name: "1thmhis-tooltipTipCSS",
  styles: "position:absolute;border-color:var(--tooltip-background-color);height:0;width:0;border-width:var(--tooltip-tip-width);border-style:solid;border-left-color:transparent;border-right-color:transparent;border-bottom-color:transparent;label:tooltipTipCSS;",
  map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */",
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__$d
};
var _ref10 = false ? {
  name: "p353xm",
  styles: "right:100%;top:50%;margin-top:calc(-1 * var(--tooltip-tip-width));transform:rotate(90deg)"
} : {
  name: "1ey4s01-additionalCSS",
  styles: "right:100%;top:50%;margin-top:calc(-1 * var(--tooltip-tip-width));transform:rotate(90deg);label:additionalCSS;",
  map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */",
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__$d
};
var _ref11 = false ? {
  name: "tn0szd",
  styles: "left:100%;top:50%;margin-top:calc(-1 * var(--tooltip-tip-width));transform:rotate(-90deg)"
} : {
  name: "1xo2h9i-additionalCSS",
  styles: "left:100%;top:50%;margin-top:calc(-1 * var(--tooltip-tip-width));transform:rotate(-90deg);label:additionalCSS;",
  map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */",
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__$d
};
var _ref12 = false ? {
  name: "449ofh",
  styles: "left:50%;top:100%;margin-left:calc(-1 * var(--tooltip-tip-width))"
} : {
  name: "d71zdj-additionalCSS",
  styles: "left:50%;top:100%;margin-left:calc(-1 * var(--tooltip-tip-width));label:additionalCSS;",
  map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */",
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__$d
};
var _ref13 = false ? {
  name: "1fcgeqa",
  styles: "left:50%;bottom:100%;transform:rotate(-180deg);margin-left:calc(-1 * var(--tooltip-tip-width))"
} : {
  name: "1mut62o-additionalCSS",
  styles: "left:50%;bottom:100%;transform:rotate(-180deg);margin-left:calc(-1 * var(--tooltip-tip-width));label:additionalCSS;",
  map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */",
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__$d
};
var tooltipTipCSS = function tooltipTipCSS2(_ref19) {
  var placement = _ref19.placement;
  var additionalCSS = /* @__PURE__ */ css(false ? "" : ";label:additionalCSS;", false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */");
  switch (placement) {
    case "bottom":
      additionalCSS = _ref13;
      break;
    case "top":
      additionalCSS = _ref12;
      break;
    case "left":
      additionalCSS = _ref11;
      break;
    case "right":
      additionalCSS = _ref10;
      break;
  }
  return /* @__PURE__ */ css(_ref9, additionalCSS, false ? "" : ";label:tooltipTipCSS;", false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */");
};
var _ref5 = false ? {
  name: "1m90tjj",
  styles: "transform:translateX(var(--tooltip-animation-distance))"
} : {
  name: "srzhhk-transformCSS",
  styles: "transform:translateX(var(--tooltip-animation-distance));label:transformCSS;",
  map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */",
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__$d
};
var _ref6 = false ? {
  name: "18bghnx",
  styles: "transform:translateX(calc(-1 * var(--tooltip-animation-distance)))"
} : {
  name: "1njsjms-transformCSS",
  styles: "transform:translateX(calc(-1 * var(--tooltip-animation-distance)));label:transformCSS;",
  map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */",
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__$d
};
var _ref7 = false ? {
  name: "1vymxbq",
  styles: "transform:translateY(calc(-1 * var(--tooltip-animation-distance)))"
} : {
  name: "768mg8-transformCSS",
  styles: "transform:translateY(calc(-1 * var(--tooltip-animation-distance)));label:transformCSS;",
  map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */",
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__$d
};
var _ref8 = false ? {
  name: "1hto7y3",
  styles: "transform:translateY(var(--tooltip-animation-distance))"
} : {
  name: "sxewcc-transformCSS",
  styles: "transform:translateY(var(--tooltip-animation-distance));label:transformCSS;",
  map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */",
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__$d
};
var actionTooltipCSS = function actionTooltipCSS2(_ref20) {
  var placement = _ref20.placement;
  var transformCSS = /* @__PURE__ */ css(false ? "" : ";label:transformCSS;", false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */");
  switch (placement) {
    case "bottom":
      transformCSS = _ref8;
      break;
    case "top":
      transformCSS = _ref7;
      break;
    case "left":
      transformCSS = _ref6;
      break;
    case "right":
      transformCSS = _ref5;
      break;
  }
  return /* @__PURE__ */ css("--tooltip-animation-distance:", theme.spacing.tooltip.offset, "px;--tooltip-target-offset:", theme.spacing.tooltip.offset, "px;--tooltip-tip-width:8px;--tooltip-max-inline-size:500px;color:var(--ac-global-text-color-900);background-color:var(--ac-global-tooltip-background-color);border-radius:8px;border:1px solid var(--ac-global-tooltip-border-color);position:relative;display:flex;flex-direction:column;box-sizing:border-box;vertical-align:top;width:auto;border-radius:4px;min-height:24px;max-inline-size:var(--tooltip-max-inline-size);word-break:break-word;-webkit-font-smoothing:antialiased;visibility:hidden;opacity:0;transition:transform 200ms ease-in-out,opacity 200ms ease-in-out,visibility 200ms linear;&.is-open{visibility:visible;opacity:1;transition-delay:0ms;pointer-events:auto;", transformCSS, ";}" + (false ? "" : ";label:actionTooltipCSS;"), false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */");
};
var actionTooltipHeaderWrapCSS = false ? {
  name: "1urdqxu",
  styles: "border-bottom:1px solid var(--ac-global-tooltip-border-color);padding:var(--ac-global-dimension-static-size-100)"
} : {
  name: "1hvtxh1-actionTooltipHeaderWrapCSS",
  styles: "border-bottom:1px solid var(--ac-global-tooltip-border-color);padding:var(--ac-global-dimension-static-size-100);label:actionTooltipHeaderWrapCSS;",
  map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */",
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__$d
};
var _ref$5 = false ? {
  name: "1m90tjj",
  styles: "transform:translateX(var(--tooltip-animation-distance))"
} : {
  name: "srzhhk-transformCSS",
  styles: "transform:translateX(var(--tooltip-animation-distance));label:transformCSS;",
  map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */",
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__$d
};
var _ref2$2 = false ? {
  name: "18bghnx",
  styles: "transform:translateX(calc(-1 * var(--tooltip-animation-distance)))"
} : {
  name: "1njsjms-transformCSS",
  styles: "transform:translateX(calc(-1 * var(--tooltip-animation-distance)));label:transformCSS;",
  map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */",
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__$d
};
var _ref3$2 = false ? {
  name: "1vymxbq",
  styles: "transform:translateY(calc(-1 * var(--tooltip-animation-distance)))"
} : {
  name: "768mg8-transformCSS",
  styles: "transform:translateY(calc(-1 * var(--tooltip-animation-distance)));label:transformCSS;",
  map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */",
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__$d
};
var _ref4$1 = false ? {
  name: "1hto7y3",
  styles: "transform:translateY(var(--tooltip-animation-distance))"
} : {
  name: "sxewcc-transformCSS",
  styles: "transform:translateY(var(--tooltip-animation-distance));label:transformCSS;",
  map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */",
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__$d
};
var helpTooltipCSS = function helpTooltipCSS2(_ref21) {
  var placement = _ref21.placement;
  var transformCSS = /* @__PURE__ */ css(false ? "" : ";label:transformCSS;", false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */");
  switch (placement) {
    case "bottom":
      transformCSS = _ref4$1;
      break;
    case "top":
      transformCSS = _ref3$2;
      break;
    case "left":
      transformCSS = _ref2$2;
      break;
    case "right":
      transformCSS = _ref$5;
      break;
  }
  return /* @__PURE__ */ css("--tooltip-animation-distance:", theme.spacing.tooltip.offset, "px;--tooltip-target-offset:", theme.spacing.tooltip.offset, "px;--tooltip-max-inline-size:300px;--tooltip-background-color:var(--ac-global-tooltip-background-color);--tooltip-border-color:var(--ac-global-tooltip-border-color);color:var(--ac-global-text-color-900);background-color:var(--tooltip-background-color);position:relative;box-sizing:border-box;font-size:", theme.typography.sizes.medium.fontSize, "px;vertical-align:top;width:auto;padding:var(--ac-global-dimension-static-size-200);border-radius:var(--ac-global-rounding-medium);border:1px solid var(--tooltip-border-color);min-height:24px;max-inline-size:var(--tooltip-max-inline-size);box-shadow:0 2px 8px 2px rgba(0, 0, 0, 0.1);word-break:break-word;-webkit-font-smoothing:antialiased;visibility:hidden;opacity:0;transition:transform 200ms ease-in-out,opacity 200ms ease-in-out,visibility 200ms linear;&.is-open{visibility:visible;opacity:1;transition-delay:0ms;pointer-events:auto;", transformCSS, ";}.ac-content{margin:var(--ac-global-dimension-static-size-100) 0 var(--ac-global-dimension-static-size-100) 0;}" + (false ? "" : ";label:helpTooltipCSS;"), false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */");
};
var _excluded$b = ["ref", "arrowProps", "state"];
function Tooltip(props, _ref18) {
  var _useContext = (0, import_react35.useContext)(TooltipContext), overlayRef = _useContext.ref, arrowProps = _useContext.arrowProps, state = _useContext.state, tooltipProviderProps = _objectWithoutPropertiesLoose2(_useContext, _excluded$b);
  props = $3ef42575df84b30b$export$9d1611c77c2fe928(props, tooltipProviderProps);
  var _props = props, _props$placement = _props.placement, placement = _props$placement === void 0 ? "top" : _props$placement, isOpen = _props.isOpen, style = _props.style, id2 = _props.id;
  var _useTooltip = $326e436e94273fe1$export$1c4b08e0eca38426(props, state), tooltipProps = _useTooltip.tooltipProps;
  return jsx("div", _extends2({
    id: id2,
    style
  }, tooltipProps, {
    className: clsx_m_default("ac-tooltip", "ac-tooltip--" + placement, {
      "is-open": isOpen
    }),
    ref: overlayRef,
    css: tooltipCSS({
      placement
    })
  }), props.children && jsx(_Text, {
    color: "text-900",
    textSize: "medium",
    className: clsx_m_default("ac-tooltip-label")
  }, props.children), jsx("span", _extends2({}, arrowProps, {
    className: clsx_m_default("ac-Tooltip-tip"),
    css: tooltipTipCSS({
      placement
    })
  })));
}
var _Tooltip = /* @__PURE__ */ import_react35.default.forwardRef(Tooltip);
var _excluded$c = ["ref", "arrowProps", "state"];
function ActionTooltip(props, _ref18) {
  var _props2;
  var _useContext = (0, import_react35.useContext)(TooltipContext), overlayRef = _useContext.ref, state = _useContext.state, tooltipProviderProps = _objectWithoutPropertiesLoose2(_useContext, _excluded$c);
  props = $3ef42575df84b30b$export$9d1611c77c2fe928(props, tooltipProviderProps);
  var _props = props, title = _props.title, subTitle = _props.subTitle, _props$placement = _props.placement, placement = _props$placement === void 0 ? "right" : _props$placement, isOpen = _props.isOpen, propsStyle = _props.style, id2 = _props.id;
  var _useTooltip = $326e436e94273fe1$export$1c4b08e0eca38426(props, state), tooltipProps = _useTooltip.tooltipProps;
  var style = _extends2({}, (_props2 = props) == null ? void 0 : _props2.UNSAFE_style, propsStyle, tooltipProps.style);
  return jsx("div", _extends2({
    id: id2
  }, tooltipProps, {
    style,
    className: clsx_m_default("ac-action-tooltip", "ac-action-tooltip--" + placement, {
      "is-open": isOpen
    }),
    ref: overlayRef,
    css: actionTooltipCSS({
      placement
    })
  }), jsx("div", {
    css: actionTooltipHeaderWrapCSS,
    className: clsx_m_default("ac-action-tooltip__title-wrap")
  }, jsx(_Text, {
    color: "text-900",
    textSize: "large",
    elementType: "h5",
    weight: "heavy"
  }, title), subTitle && jsx(_Text, {
    color: "text-700",
    textSize: "small",
    elementType: "h6"
  }, subTitle)), props.children);
}
var _ActionTooltip = /* @__PURE__ */ import_react35.default.forwardRef(ActionTooltip);
var _excluded$d = ["children", "style"];
function TriggerWrap(props, ref) {
  var domRef = useFocusableRef(ref);
  var children = props.children, style = props.style, otherProps = _objectWithoutPropertiesLoose2(props, _excluded$d);
  var _useButton = $701a24aa0da5b062$export$ea18c227d4417cc3(props, domRef), buttonProps = _useButton.buttonProps;
  var _useHover = $6179b936705e76d3$export$ae780daf29e6d456({}), hoverProps = _useHover.hoverProps, isHovered = _useHover.isHovered;
  return jsx("div", _extends2({}, $3ef42575df84b30b$export$9d1611c77c2fe928(hoverProps, buttonProps, otherProps), {
    ref: domRef,
    className: clsx_m_default("ac-trigger-wrap", {
      "is-hovered": isHovered
    }),
    style
  }), children);
}
var _TriggerWrap = /* @__PURE__ */ import_react35.default.forwardRef(TriggerWrap);
var _excluded$e = ["ref", "arrowProps", "state"];
function HelpTooltip(props, _ref18) {
  var _props2;
  var _useContext = (0, import_react35.useContext)(TooltipContext), overlayRef = _useContext.ref, state = _useContext.state, tooltipProviderProps = _objectWithoutPropertiesLoose2(_useContext, _excluded$e);
  props = $3ef42575df84b30b$export$9d1611c77c2fe928(props, tooltipProviderProps);
  var _props = props, _props$placement = _props.placement, placement = _props$placement === void 0 ? "right" : _props$placement, isOpen = _props.isOpen, propsStyle = _props.style, id2 = _props.id;
  var _useTooltip = $326e436e94273fe1$export$1c4b08e0eca38426(props, state), tooltipProps = _useTooltip.tooltipProps;
  var style = _extends2({}, (_props2 = props) == null ? void 0 : _props2.UNSAFE_style, propsStyle, tooltipProps.style);
  return jsx("div", _extends2({
    id: id2
  }, tooltipProps, {
    style,
    className: clsx_m_default("ac-help-tooltip", "ac-help-tooltip--" + placement, {
      "is-open": isOpen
    }),
    ref: overlayRef,
    css: helpTooltipCSS({
      placement
    })
  }), props.children);
}
var _HelpTooltip = /* @__PURE__ */ import_react35.default.forwardRef(HelpTooltip);
var _excluded$f = ["name", "children", "className", "isSelected", "hidden", "index"];
function _EMOTION_STRINGIFIED_CSS_ERROR__$e() {
  return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
}
var tabsContainerCSS = false ? {
  name: "1bu7e8c",
  styles: "display:flex;&[data-orientation='horizontal']{flex-direction:column;}&[data-orientation='vertical']{flex-direction:row;}"
} : {
  name: "1lcwbqb-tabsContainerCSS",
  styles: "display:flex;&[data-orientation='horizontal']{flex-direction:column;}&[data-orientation='vertical']{flex-direction:row;};label:tabsContainerCSS;",
  map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */",
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__$e
};
var tabListCSS = false ? {
  name: "12xhwgl",
  styles: "display:flex;--tab-border-color:var(\n    --scope-border-color,\n    var(--ac-global-border-color-default)\n  );--tab-hover-color:var(--ac-global-color-primary-900);--tab-selected-border-color:var(--ac-global-color-primary);.ac-tabs__tab-list-item{box-sizing:border-box;background-color:inherit;border:none;outline:none;cursor:pointer;padding:0 var(--ac-global-dimension-static-size-200);min-height:30px;transition:0.3s;font-weight:bold;border-color:var(--tab-border-color);display:flex;align-items:center;gap:var(--ac-global-dimension-static-size-65);}.ac-tabs__tab-list-item[data-is-hidden='true']{display:none;}&[data-orientation='horizontal']{flex-direction:row;border-bottom:1px solid var(--tab-border-color);.ac-tabs__tab-list-item{border-bottom:2px solid transparent;&:hover{border-color:var(--tab-hover-color);}&[data-selected='true']{border-color:var(--tab-selected-border-color);}}.ac-tabs__extra{display:flex;align-items:center;justify-content:flex-end;}}&[data-orientation='vertical']{flex-direction:column;border-right:1px solid var(--tab-border-color);.ac-tabs__tab-list-item{border-right:2px solid transparent;&:hover{border-color:var(--tab-hover-color);}&[data-selected='true']{border-color:var(--tab-selected-border-color);}}.ac-tabs__extra{display:flex;align-items:center;justify-content:center;}}"
} : {
  name: "1jvupd9-tabListCSS",
  styles: "display:flex;--tab-border-color:var(\n    --scope-border-color,\n    var(--ac-global-border-color-default)\n  );--tab-hover-color:var(--ac-global-color-primary-900);--tab-selected-border-color:var(--ac-global-color-primary);.ac-tabs__tab-list-item{box-sizing:border-box;background-color:inherit;border:none;outline:none;cursor:pointer;padding:0 var(--ac-global-dimension-static-size-200);min-height:30px;transition:0.3s;font-weight:bold;border-color:var(--tab-border-color);display:flex;align-items:center;gap:var(--ac-global-dimension-static-size-65);}.ac-tabs__tab-list-item[data-is-hidden='true']{display:none;}&[data-orientation='horizontal']{flex-direction:row;border-bottom:1px solid var(--tab-border-color);.ac-tabs__tab-list-item{border-bottom:2px solid transparent;&:hover{border-color:var(--tab-hover-color);}&[data-selected='true']{border-color:var(--tab-selected-border-color);}}.ac-tabs__extra{display:flex;align-items:center;justify-content:flex-end;}}&[data-orientation='vertical']{flex-direction:column;border-right:1px solid var(--tab-border-color);.ac-tabs__tab-list-item{border-right:2px solid transparent;&:hover{border-color:var(--tab-hover-color);}&[data-selected='true']{border-color:var(--tab-selected-border-color);}}.ac-tabs__extra{display:flex;align-items:center;justify-content:center;}};label:tabListCSS;",
  map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */",
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__$e
};
function parseTabList(children) {
  return import_react35.default.Children.toArray(children).map(function(node56, index) {
    if (import_react35.default.isValidElement(node56)) {
      return _extends2({}, node56.props, {
        key: node56.key ? String(node56.key) : String(index),
        node: node56
      });
    }
    return null;
  }).filter(function(tab2) {
    return tab2;
  });
}
function Tabs(_ref22) {
  var children = _ref22.children, className = _ref22.className, onChange = _ref22.onChange, _ref2$orientation = _ref22.orientation, orientation = _ref2$orientation === void 0 ? "horizontal" : _ref2$orientation, extra = _ref22.extra;
  children = import_react35.Children.toArray(children).filter(function(child) {
    return child;
  });
  var tabs = parseTabList(children);
  var _useState = (0, import_react35.useState)(tabs.findIndex(function(tab2) {
    return !tab2.hidden;
  })), selectedIndex = _useState[0], setSelectedIndex = _useState[1];
  return jsx("div", {
    className: "ac-tabs " + className,
    "data-orientation": orientation,
    css: tabsContainerCSS,
    "data-selected-tab-index": selectedIndex
  }, jsx("div", {
    role: "tablist",
    "data-orientation": orientation,
    css: tabListCSS
  }, tabs.map(function(tab2, index) {
    var isSelected = index === selectedIndex;
    return jsx("button", _extends2({
      key: tab2.key,
      "data-selected": isSelected,
      "data-tab-index": index,
      "data-is-hidden": tab2.hidden,
      role: "tab",
      className: "ac-tabs__tab-list-item",
      onClick: function onClick(e3) {
        e3.preventDefault();
        setSelectedIndex(index);
        onChange && onChange(index);
      }
    }, tab2 == null ? void 0 : tab2.tabListItemProps), jsx(_Text, {
      textSize: "medium",
      weight: "heavy",
      color: isSelected ? "text-900" : "text-700"
    }, tab2.name), tab2 == null ? void 0 : tab2.extra);
  }), extra && jsx("div", {
    className: "ac-tabs__extra"
  }, extra)), jsx("div", {
    className: "ac-tabs__pane-container"
  }, import_react35.Children.map(children, function(child, index) {
    if ((0, import_react35.isValidElement)(child)) {
      return (0, import_react35.cloneElement)(child, {
        isSelected: index === selectedIndex,
        index
      });
    }
    return null;
  })));
}
var _ref$6 = false ? {
  name: "12mkfdx",
  styles: "outline:none"
} : {
  name: "j5dgia-TabPane",
  styles: "outline:none;label:TabPane;",
  map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */",
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__$e
};
var TabPane = function TabPane2(_ref32) {
  var name2 = _ref32.name, children = _ref32.children, className = _ref32.className, _ref3$isSelected = _ref32.isSelected, isSelected = _ref3$isSelected === void 0 ? false : _ref3$isSelected, _ref3$hidden = _ref32.hidden, hidden = _ref3$hidden === void 0 ? false : _ref3$hidden, index = _ref32.index, divProps = _objectWithoutPropertiesLoose2(_ref32, _excluded$f);
  return jsx("div", _extends2({
    "data-tab-name": name2
  }, divProps, {
    hidden: !isSelected || hidden,
    role: "tabpanel",
    className,
    tabIndex: isSelected ? 0 : -1,
    css: _ref$6
  }), typeof children === "function" ? children({
    isSelected,
    index
  }) : children);
};
Tabs.TabPane = TabPane;
function _EMOTION_STRINGIFIED_CSS_ERROR__$f() {
  return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
}
var radioGroupLabelCSS = false ? {
  name: "ok7tql",
  styles: "margin-bottom:var(--ac-global-dimension-static-size-100)"
} : {
  name: "q5b25v-radioGroupLabelCSS",
  styles: "margin-bottom:var(--ac-global-dimension-static-size-100);label:radioGroupLabelCSS;",
  map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */",
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__$f
};
var radioGroupCSS = function radioGroupCSS2(_ref32) {
  var _ref3$isDisabled = _ref32.isDisabled, isDisabled = _ref3$isDisabled === void 0 ? false : _ref3$isDisabled;
  return /* @__PURE__ */ css("color:", isDisabled ? "var(--ac-global-text-color-300)" : "var(--ac-global-text-color-900)", ";&.ac-radio-group--inline-button{display:inline-flex;flex-direction:row;background-color:var(--ac-global-input-field-background-color);border:1px solid var(--ac-global-input-field-border-color);border-radius:", theme.borderRadius.medium, "px;overflow:hidden;.ac-radio+.ac-radio{border-left:1px solid var(--ac-global-input-field-border-color);}}" + (false ? "" : ";label:radioGroupCSS;"), false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */");
};
var radioCSS = function radioCSS2(_ref42) {
  var _ref4$isDisabled = _ref42.isDisabled, isDisabled = _ref4$isDisabled === void 0 ? false : _ref4$isDisabled, _ref4$noPadding = _ref42.noPadding, noPadding = _ref4$noPadding === void 0 ? false : _ref4$noPadding;
  return /* @__PURE__ */ css("display:flex;cursor:", isDisabled ? "not-allowed" : "pointer", ";&.orientation-vertical{flex-direction:column;&:not(:first-of-type){margin-top:", noPadding ? "0" : theme.spacing.padding8, "px;}}&.orientation-horizontal{flex-direction:row;}" + (false ? "" : ";label:radioCSS;"), false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */");
};
var _ref2$3 = false ? {
  name: "zjik7",
  styles: "display:flex"
} : {
  name: "9rsdve-defaultRadioCSS",
  styles: "display:flex;label:defaultRadioCSS;",
  map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */",
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__$f
};
var defaultRadioCSS = function defaultRadioCSS2() {
  return _ref2$3;
};
var selectorRadioCSS = function selectorRadioCSS2(_ref52) {
  var _ref5$isSelected = _ref52.isSelected, isSelected = _ref5$isSelected === void 0 ? false : _ref5$isSelected, _ref5$isDisabled = _ref52.isDisabled, isDisabled = _ref5$isDisabled === void 0 ? false : _ref5$isDisabled;
  return /* @__PURE__ */ css("height:50px;border-radius:8px;border:2px solid ", isSelected ? "var(--ac-global-text-color-900)" : "var(--ac-global-input-field-border-color)", ";color:", isDisabled ? "var(--ac-global-text-color-300)" : "var(--ac-global-text-color-900)", ";margin-right:var(--ac-global-dimension-static-size-50);padding:var(--ac-global-dimension-static-size-200);", !isDisabled && !isSelected && "&:hover {\n    border-color: var(--ac-global-input-field-border-color-hover);\n    transition: border-color 0.2s ease-in-out;\n  }", ";" + (false ? "" : ";label:selectorRadioCSS;"), false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */");
};
var _ref$7 = false ? {
  name: "kmskww",
  styles: "transition:all 0.2s ease-in-out;&.is-selected{background-color:var(--ac-global-button-primary-background-color);&:hover{background-color:var(\n            --ac-global-button-primary-background-color-hover\n          );}}&:not(.is-selected){&:hover{background-color:--ac-global-input-field-background-color-hover;}}&[data-size='normal']{padding:var(--ac-global-dimension-static-size-100) var(--ac-global-dimension-static-size-200);}&[data-size='compact']{padding:var(--ac-global-dimension-static-size-50) var(--ac-global-dimension-static-size-100);}"
} : {
  name: "zpcecf-inlineButtonRadioCSS",
  styles: "transition:all 0.2s ease-in-out;&.is-selected{background-color:var(--ac-global-button-primary-background-color);&:hover{background-color:var(\n            --ac-global-button-primary-background-color-hover\n          );}}&:not(.is-selected){&:hover{background-color:--ac-global-input-field-background-color-hover;}}&[data-size='normal']{padding:var(--ac-global-dimension-static-size-100) var(--ac-global-dimension-static-size-200);}&[data-size='compact']{padding:var(--ac-global-dimension-static-size-50) var(--ac-global-dimension-static-size-100);};label:inlineButtonRadioCSS;",
  map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */",
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__$f
};
var inlineButtonRadioCSS = function inlineButtonRadioCSS2() {
  return /* @__PURE__ */ css(_ref$7, textSizeCSS("medium"), false ? "" : ";label:inlineButtonRadioCSS;", false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */");
};
var getRadioCSS = function getRadioCSS2(variant) {
  switch (variant) {
    case "default": {
      return defaultRadioCSS;
    }
    case "selector": {
      return selectorRadioCSS;
    }
    case "inline-button": {
      return inlineButtonRadioCSS;
    }
  }
};
var radioButtonIconCSS = function radioButtonIconCSS2(_ref62) {
  var _ref6$isFocusVisible = _ref62.isFocusVisible, isFocusVisible = _ref6$isFocusVisible === void 0 ? false : _ref6$isFocusVisible, _ref6$isDisabled = _ref62.isDisabled, isDisabled = _ref6$isDisabled === void 0 ? false : _ref6$isDisabled;
  return /* @__PURE__ */ css("color:", isDisabled ? "var(--ac-global-text-color-300)" : "var(--ac-global-text-color-900)", ";margin-right:var(--ac-global-dimension-static-size-50);", isFocusVisible && "outline: " + theme.spacing.outline.thin + "px solid -webkit-focus-ring-color;", ";" + (false ? "" : ";label:radioButtonIconCSS;"), false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */");
};
var radioChildrenCSS = false ? {
  name: "wwgl9g",
  styles: "display:flex;padding:0;margin-top:var(--ac-global-dimension-static-size-50);flex-direction:column"
} : {
  name: "13lmedt-radioChildrenCSS",
  styles: "display:flex;padding:0;margin-top:var(--ac-global-dimension-static-size-50);flex-direction:column;label:radioChildrenCSS;",
  map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */",
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__$f
};
var RadioContext = /* @__PURE__ */ import_react35.default.createContext(null);
function useRadioProvider() {
  return import_react35.default.useContext(RadioContext);
}
function RadioGroup(props) {
  var children = props.children, label = props.label, variant = props.variant, _props$size = props.size, size = _props$size === void 0 ? "normal" : _props$size;
  var labeledById = $bdb11010cef70236$export$f680877a34711e37();
  var state = $a54cdc5c1942b639$export$bca9d026f8e704eb(props);
  var _useRadioGroup = $430f30ed08ec25fa$export$62b9571f283ff5c2(_extends2({}, props, {
    "aria-labelledby": labeledById
  }), state), radioGroupProps = _useRadioGroup.radioGroupProps, labelProps = _useRadioGroup.labelProps;
  return jsx("div", _extends2({
    role: "radiogroup",
    css: radioGroupCSS(state)
  }, radioGroupProps, {
    className: clsx_m_default("ac-radio-group", "ac-radio-group--" + variant)
  }, labelProps), label && jsx(_Text, {
    css: radioGroupLabelCSS,
    id: labeledById,
    elementType: "p"
  }, label), jsx(RadioContext.Provider, {
    value: {
      state
    }
  }, children && import_react35.default.Children.map(children, function(child) {
    if ((0, import_react35.isValidElement)(child)) {
      return import_react35.default.cloneElement(child, {
        variant,
        size
      });
    }
    return null;
  })));
}
var RadioButtonOff = function RadioButtonOff2() {
  return jsx("svg", {
    width: "24",
    height: "24",
    viewBox: "0 0 24 24",
    xmlns: "http://www.w3.org/2000/svg"
  }, jsx("g", null, jsx("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M2 12C2 17.514 6.486 22 12 22C17.514 22 22 17.514 22 12C22 6.486 17.514 2 12 2C6.486 2 2 6.486 2 12ZM4 12C4 7.589 7.589 4 12 4C16.411 4 20 7.589 20 12C20 16.411 16.411 20 12 20C7.589 20 4 16.411 4 12Z"
  }), jsx("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M2 12C2 17.514 6.486 22 12 22C17.514 22 22 17.514 22 12C22 6.486 17.514 2 12 2C6.486 2 2 6.486 2 12ZM4 12C4 7.589 7.589 4 12 4C16.411 4 20 7.589 20 12C20 16.411 16.411 20 12 20C7.589 20 4 16.411 4 12Z"
  })));
};
var RadioButtonOnFill = function RadioButtonOnFill2() {
  return jsx("svg", {
    width: "24",
    height: "24",
    viewBox: "0 0 24 24",
    xmlns: "http://www.w3.org/2000/svg"
  }, jsx("g", null, jsx("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M2 11.9999C2 6.48591 6.486 1.99991 12 1.99991C17.514 1.99991 22 6.48591 22 11.9999C22 17.5139 17.514 21.9999 12 21.9999C6.486 21.9999 2 17.5139 2 11.9999ZM12 19.9999C7.589 19.9999 4 16.4109 4 11.9999C4 7.58891 7.589 3.99991 12 3.99991C16.411 3.99991 20 7.58891 20 11.9999C20 16.4109 16.411 19.9999 12 19.9999ZM12 6.99991C9.243 6.99991 7 9.24291 7 11.9999C7 14.7569 9.243 16.9999 12 16.9999C14.757 16.9999 17 14.7569 17 11.9999C17 9.24291 14.757 6.99991 12 6.99991Z"
  }), jsx("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M2 11.9999C2 6.48591 6.486 1.99991 12 1.99991C17.514 1.99991 22 6.48591 22 11.9999C22 17.5139 17.514 21.9999 12 21.9999C6.486 21.9999 2 17.5139 2 11.9999ZM12 19.9999C7.589 19.9999 4 16.4109 4 11.9999C4 7.58891 7.589 3.99991 12 3.99991C16.411 3.99991 20 7.58891 20 11.9999C20 16.4109 16.411 19.9999 12 19.9999ZM12 6.99991C9.243 6.99991 7 9.24291 7 11.9999C7 14.7569 9.243 16.9999 12 16.9999C14.757 16.9999 17 14.7569 17 11.9999C17 9.24291 14.757 6.99991 12 6.99991Z"
  })));
};
function Radio(props) {
  var radioGroupProps = useRadioProvider();
  var state = radioGroupProps.state;
  var _props$variant = props.variant, variant = _props$variant === void 0 ? "default" : _props$variant, _props$size = props.size, size = _props$size === void 0 ? "normal" : _props$size, children = props.children, value = props.value, noPadding = props.noPadding, label = props.label, onClick = props.onClick, _props$isDisabled = props.isDisabled, isDisabled = _props$isDisabled === void 0 ? state.isDisabled : _props$isDisabled;
  var inputRef = import_react35.default.useRef(null);
  var labeledById = $bdb11010cef70236$export$f680877a34711e37();
  var _useRadio = $0d5c49892c1215da$export$37b0961d2f4751e2(_extends2({}, props, radioGroupProps, {
    "aria-labelledby": labeledById
  }), state, inputRef), inputProps = _useRadio.inputProps;
  var _useFocusRing = $f7dceffc5ad7768b$export$4e328f61c538687f(), isFocusVisible = _useFocusRing.isFocusVisible, focusProps = _useFocusRing.focusProps;
  var isSelected = state.selectedValue === props.value;
  var currentRadioButton = isSelected ? jsx(RadioButtonOnFill, null) : jsx(RadioButtonOff, null);
  var handleOnChangeLabel = function handleOnChangeLabel2() {
    if (!isDisabled) {
      state.setSelectedValue(props.value);
      onClick && onClick();
    }
  };
  var handleOnChange = function handleOnChange2(e3) {
    if (!isDisabled) {
      state.setSelectedValue(props.value);
      onClick && onClick(e3);
    }
  };
  var radioChildren = children ? import_react35.default.Children.map(props.children, function(child) {
    return (0, import_react35.isValidElement)(child) ? import_react35.default.cloneElement(child, {
      isDisabled
    }) : child;
  }) : null;
  return jsx("label", _extends2({
    "aria-disabled": isDisabled,
    css: radioCSS({
      isDisabled,
      noPadding
    }),
    "aria-label": value,
    className: clsx_m_default("ac-radio", "ac-radio--" + variant, {
      "is-disabled": isDisabled,
      "is-selected": isSelected,
      "orientation-vertical": variant !== "inline-button",
      "orientation-horizontal": variant === "inline-button"
    })
  }, focusProps, {
    onClick: handleOnChangeLabel
  }), jsx($5c3e21d68f1c4674$export$439d29a4e110a164, null, jsx("input", _extends2({
    "aria-label": value
  }, inputProps, {
    onChange: handleOnChange,
    value,
    ref: inputRef
  }))), variant === "default" ? jsx("div", {
    css: getRadioCSS(variant)({
      isDisabled,
      isSelected
    }),
    className: clsx_m_default("ac-radio--variant-" + variant, {
      "is-disabled": isDisabled,
      "is-selected": isSelected
    })
  }, jsx(Icon, {
    svg: currentRadioButton,
    css: radioButtonIconCSS({
      isDisabled,
      isFocusVisible
    }),
    "aria-label": value,
    "aria-hidden": true
  }), jsx(_Text, {
    textSize: "medium",
    color: isDisabled ? "text-300" : "text-900"
  }, label)) : jsx("div", {
    className: clsx_m_default("ac-radio--variant-" + variant, {
      "is-disabled": isDisabled,
      "is-selected": isSelected
    }),
    css: getRadioCSS(variant)({
      isDisabled,
      isSelected
    }),
    "data-variant": variant,
    "data-size": size,
    "aria-label": value,
    "aria-hidden": true
  }, radioChildren != null ? radioChildren : jsx("span", {
    className: "ac-radio__text"
  }, label)), variant === "default" && children && jsx("div", {
    css: radioChildrenCSS,
    className: "ac-radio--children"
  }, radioChildren));
}
var _excluded$g = ["icon", "children", "color", "shape", "onClick"];
function isBaseLabelColor(color2) {
  return color2 === "white" || color2 === "blue" || color2 === "orange" || color2 === "green" || color2 === "red" || color2 === "purple" || color2 === "gray";
}
var labelCSS = function labelCSS2(color2) {
  return /* @__PURE__ */ css("color:", color2 || theme.labelColors.white, ";border:1px solid ", color2 || theme.labelColors.white, ";background-color:transparent;padding:1px 8px;text-align:center;display:inline-flex;align-items:center;&[data-shape='pill']{border-radius:12px;}&[data-shape='badge']{border-radius:4px;}&.interactive{cursor:pointer;transition:opacity 0.2s ease;&:hover{opacity:0.8;}}&.ac-label--blue{color:", theme.labelColors.blue, ";border:1px solid ", theme.labelColors.blue, ";}&.ac-label--orange{color:", theme.labelColors.orange, ";border:1px solid ", theme.labelColors.orange, ";}&.ac-label--green{color:", theme.labelColors.green, ";border:1px solid ", theme.labelColors.green, ";}&.ac-label--red{color:", theme.labelColors.red, ";border:1px solid ", theme.labelColors.red, ";}&.ac-label--purple{color:", theme.labelColors.purple, ";border:1px solid ", theme.labelColors.purple, ";}&.ac-label--gray{color:", theme.labelColors.gray, ";border:1px solid ", theme.labelColors.gray, ";}&>i{font-size:10px;margin-right:2px;position:relative;svg{position:absolute;top:0;left:0;bottom:100%;}}" + (false ? "" : ";label:labelCSS;"), false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkxhYmVsLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFjZ0MiLCJmaWxlIjoiTGFiZWwudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgY3NzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xyXG5pbXBvcnQgUmVhY3QsIHsgdXNlTWVtbyB9IGZyb20gJ3JlYWN0JztcclxuaW1wb3J0IHsgY2xhc3NOYW1lcywgY29sb3JWYWx1ZSB9IGZyb20gJy4uL3V0aWxzJztcclxuaW1wb3J0IHRoZW1lIGZyb20gJy4uL3RoZW1lJztcclxuaW1wb3J0IHsgVGV4dCB9IGZyb20gJy4uL2NvbnRlbnQnO1xyXG5mdW5jdGlvbiBpc0Jhc2VMYWJlbENvbG9yKGNvbG9yKSB7XHJcbiAgICByZXR1cm4gKGNvbG9yID09PSAnd2hpdGUnIHx8XHJcbiAgICAgICAgY29sb3IgPT09ICdibHVlJyB8fFxyXG4gICAgICAgIGNvbG9yID09PSAnb3JhbmdlJyB8fFxyXG4gICAgICAgIGNvbG9yID09PSAnZ3JlZW4nIHx8XHJcbiAgICAgICAgY29sb3IgPT09ICdyZWQnIHx8XHJcbiAgICAgICAgY29sb3IgPT09ICdwdXJwbGUnIHx8XHJcbiAgICAgICAgY29sb3IgPT09ICdncmF5Jyk7XHJcbn1cclxuY29uc3QgbGFiZWxDU1MgPSAoY29sb3IpID0+IGNzcyBgXG4gIGNvbG9yOiAke2NvbG9yIHx8IHRoZW1lLmxhYmVsQ29sb3JzLndoaXRlfTtcbiAgYm9yZGVyOiAxcHggc29saWQgJHtjb2xvciB8fCB0aGVtZS5sYWJlbENvbG9ycy53aGl0ZX07XG4gIGJhY2tncm91bmQtY29sb3I6IHRyYW5zcGFyZW50O1xuICBwYWRkaW5nOiAxcHggOHB4O1xuXG4gIHRleHQtYWxpZ246IGNlbnRlcjtcbiAgZGlzcGxheTogaW5saW5lLWZsZXg7XG4gIGFsaWduLWl0ZW1zOiBjZW50ZXI7XG4gICZbZGF0YS1zaGFwZT0ncGlsbCddIHtcbiAgICBib3JkZXItcmFkaXVzOiAxMnB4O1xuICB9XG4gICZbZGF0YS1zaGFwZT0nYmFkZ2UnXSB7XG4gICAgYm9yZGVyLXJhZGl1czogNHB4O1xuICB9XG4gICYuaW50ZXJhY3RpdmUge1xuICAgIGN1cnNvcjogcG9pbnRlcjtcbiAgICB0cmFuc2l0aW9uOiBvcGFjaXR5IDAuMnMgZWFzZTtcbiAgICAmOmhvdmVyIHtcbiAgICAgIG9wYWNpdHk6IDAuODtcbiAgICB9XG4gIH1cbiAgLy8gaGFyZCBjb2RlZCB2YWx1ZXNcbiAgJi5hYy1sYWJlbC0tYmx1ZSB7XG4gICAgY29sb3I6ICR7dGhlbWUubGFiZWxDb2xvcnMuYmx1ZX07XG4gICAgYm9yZGVyOiAxcHggc29saWQgJHt0aGVtZS5sYWJlbENvbG9ycy5ibHVlfTtcbiAgfVxuICAmLmFjLWxhYmVsLS1vcmFuZ2Uge1xuICAgIGNvbG9yOiAke3RoZW1lLmxhYmVsQ29sb3JzLm9yYW5nZX07XG4gICAgYm9yZGVyOiAxcHggc29saWQgJHt0aGVtZS5sYWJlbENvbG9ycy5vcmFuZ2V9O1xuICB9XG4gICYuYWMtbGFiZWwtLWdyZWVuIHtcbiAgICBjb2xvcjogJHt0aGVtZS5sYWJlbENvbG9ycy5ncmVlbn07XG4gICAgYm9yZGVyOiAxcHggc29saWQgJHt0aGVtZS5sYWJlbENvbG9ycy5ncmVlbn07XG4gIH1cbiAgJi5hYy1sYWJlbC0tcmVkIHtcbiAgICBjb2xvcjogJHt0aGVtZS5sYWJlbENvbG9ycy5yZWR9O1xuICAgIGJvcmRlcjogMXB4IHNvbGlkICR7dGhlbWUubGFiZWxDb2xvcnMucmVkfTtcbiAgfVxuICAmLmFjLWxhYmVsLS1wdXJwbGUge1xuICAgIGNvbG9yOiAke3RoZW1lLmxhYmVsQ29sb3JzLnB1cnBsZX07XG4gICAgYm9yZGVyOiAxcHggc29saWQgJHt0aGVtZS5sYWJlbENvbG9ycy5wdXJwbGV9O1xuICB9XG4gICYuYWMtbGFiZWwtLWdyYXkge1xuICAgIGNvbG9yOiAke3RoZW1lLmxhYmVsQ29sb3JzLmdyYXl9O1xuICAgIGJvcmRlcjogMXB4IHNvbGlkICR7dGhlbWUubGFiZWxDb2xvcnMuZ3JheX07XG4gIH1cbiAgJiA+IGkge1xuICAgIGZvbnQtc2l6ZTogMTBweDtcbiAgICBtYXJnaW4tcmlnaHQ6IDJweDtcbiAgICBwb3NpdGlvbjogcmVsYXRpdmU7XG4gICAgc3ZnIHtcbiAgICAgIHBvc2l0aW9uOiBhYnNvbHV0ZTtcbiAgICAgIHRvcDogMDtcbiAgICAgIGxlZnQ6IDA7XG4gICAgICBib3R0b206IDEwMCU7XG4gICAgfVxuICB9XG5gO1xyXG5leHBvcnQgY29uc3QgTGFiZWwgPSAoeyBpY29uLCBjaGlsZHJlbiwgY29sb3IgPSAnd2hpdGUnLCBzaGFwZSA9ICdwaWxsJywgb25DbGljaywgLi4ucHJvcHMgfSkgPT4ge1xyXG4gICAgY29uc3QgY2xhc3NlcyA9IFsnYWMtbGFiZWwnXTtcclxuICAgIGlmIChjb2xvciAhPSBudWxsKSB7XHJcbiAgICAgICAgY2xhc3Nlcy5wdXNoKGBhYy1sYWJlbC0tJHtjb2xvcn1gKTtcclxuICAgIH1cclxuICAgIGxldCBMYWJlbFRhZyA9ICdzcGFuJztcclxuICAgIGlmIChvbkNsaWNrKSB7XHJcbiAgICAgICAgLy8gQ29udmVydCB0aGUgZWxlbWVudCB0byBiZSBidXR0b25cclxuICAgICAgICBMYWJlbFRhZyA9ICdidXR0b24nO1xyXG4gICAgICAgIGNsYXNzZXMucHVzaCgnaW50ZXJhY3RpdmUnKTtcclxuICAgIH1cclxuICAgIGNvbnN0IGdsb2JhbENvbG9yID0gdXNlTWVtbygoKSA9PiB7XHJcbiAgICAgICAgaWYgKHR5cGVvZiBjb2xvciA9PT0gJ3N0cmluZycgJiYgaXNCYXNlTGFiZWxDb2xvcihjb2xvcikpIHtcclxuICAgICAgICAgICAgcmV0dXJuIG51bGw7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHJldHVybiBjb2xvclZhbHVlKGNvbG9yKTtcclxuICAgIH0sIFtjb2xvcl0pO1xyXG4gICAgcmV0dXJuICg8TGFiZWxUYWcgY2xhc3NOYW1lPXtjbGFzc05hbWVzKGNsYXNzZXMpfSBjc3M9e2xhYmVsQ1NTKGdsb2JhbENvbG9yKX0gb25DbGljaz17b25DbGlja30gZGF0YS1zaGFwZT17c2hhcGV9IHsuLi5wcm9wc30+XG4gICAgICB7aWNvbn1cbiAgICAgIDxUZXh0IHRleHRTaXplPVwieHNtYWxsXCIgY29sb3I9XCJpbmhlcml0XCI+XG4gICAgICAgIHtjaGlsZHJlbn1cbiAgICAgIDwvVGV4dD5cbiAgICA8L0xhYmVsVGFnPik7XHJcbn07XHJcbi8vIyBzb3VyY2VNYXBwaW5nVVJMPUxhYmVsLmpzeC5tYXAiXX0= */");
};
var Label = function Label2(_ref18) {
  var icon = _ref18.icon, children = _ref18.children, _ref$color = _ref18.color, color2 = _ref$color === void 0 ? "white" : _ref$color, _ref$shape = _ref18.shape, shape = _ref$shape === void 0 ? "pill" : _ref$shape, onClick = _ref18.onClick, props = _objectWithoutPropertiesLoose2(_ref18, _excluded$g);
  var classes = ["ac-label"];
  if (color2 != null) {
    classes.push("ac-label--" + color2);
  }
  var LabelTag = "span";
  if (onClick) {
    LabelTag = "button";
    classes.push("interactive");
  }
  var globalColor = (0, import_react35.useMemo)(function() {
    if (typeof color2 === "string" && isBaseLabelColor(color2)) {
      return null;
    }
    return colorValue(color2);
  }, [color2]);
  return jsx(LabelTag, _extends2({
    className: clsx_m_default(classes),
    css: labelCSS(globalColor),
    onClick,
    "data-shape": shape
  }, props), icon, jsx(_Text, {
    textSize: "xsmall",
    color: "inherit"
  }, children));
};
function _EMOTION_STRINGIFIED_CSS_ERROR__$h() {
  return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
}
var baseSeverityCSS = false ? {
  name: "9vstlm",
  styles: "backdrop-filter:blur(10px)"
} : {
  name: "ndak7k-baseSeverityCSS",
  styles: "backdrop-filter:blur(10px);label:baseSeverityCSS;",
  map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0eWxlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFDbUMiLCJmaWxlIjoic3R5bGVzLnRzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgY3NzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xyXG5leHBvcnQgY29uc3QgYmFzZVNldmVyaXR5Q1NTID0gY3NzIGBcbiAgYmFja2Ryb3AtZmlsdGVyOiBibHVyKDEwcHgpO1xuYDtcclxuY29uc3QgZ2VuZXJhdGVTZXZlcml0eUNTUyA9IChzZW1hbnRpY0NvbG9yKSA9PiB7XHJcbiAgICBjb25zdCBjb2xvclByZWZpeCA9IGAtLWFjLWdsb2JhbC1jb2xvci0ke3NlbWFudGljQ29sb3J9YDtcclxuICAgIHJldHVybiBjc3MoYmFzZVNldmVyaXR5Q1NTLCBjc3MgYFxuICAgICAgYm9yZGVyOiAxcHggc29saWQgdmFyKCR7Y29sb3JQcmVmaXh9KTtcbiAgICAgIGJhY2tncm91bmQtY29sb3I6IHZhcigke2NvbG9yUHJlZml4fS03MDApO1xuICAgICAgY29sb3I6IHZhcigtLWFjLWdsb2JhbC1zdGF0aWMtY29sb3Itd2hpdGUtOTAwKTtcbiAgICBgKTtcclxufTtcclxuZXhwb3J0IGNvbnN0IHdhcm5pbmdDU1MgPSBnZW5lcmF0ZVNldmVyaXR5Q1NTKCd3YXJuaW5nJyk7XHJcbmV4cG9ydCBjb25zdCBpbmZvQ1NTID0gZ2VuZXJhdGVTZXZlcml0eUNTUygnaW5mbycpO1xyXG5leHBvcnQgY29uc3QgZGFuZ2VyQ1NTID0gZ2VuZXJhdGVTZXZlcml0eUNTUygnZGFuZ2VyJyk7XHJcbmV4cG9ydCBjb25zdCBzdWNjZXNzQ1NTID0gZ2VuZXJhdGVTZXZlcml0eUNTUygnc3VjY2VzcycpO1xyXG4vLyMgc291cmNlTWFwcGluZ1VSTD1zdHlsZXMuanMubWFwIl19 */",
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__$h
};
var generateSeverityCSS = function generateSeverityCSS2(semanticColor) {
  var colorPrefix = "--ac-global-color-" + semanticColor;
  return /* @__PURE__ */ css(baseSeverityCSS, /* @__PURE__ */ css("border:1px solid var(", colorPrefix, ");background-color:var(", colorPrefix, "-700);color:var(--ac-global-static-color-white-900);" + (false ? "" : ";label:generateSeverityCSS;"), false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0eWxlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFNb0MiLCJmaWxlIjoic3R5bGVzLnRzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgY3NzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xyXG5leHBvcnQgY29uc3QgYmFzZVNldmVyaXR5Q1NTID0gY3NzIGBcbiAgYmFja2Ryb3AtZmlsdGVyOiBibHVyKDEwcHgpO1xuYDtcclxuY29uc3QgZ2VuZXJhdGVTZXZlcml0eUNTUyA9IChzZW1hbnRpY0NvbG9yKSA9PiB7XHJcbiAgICBjb25zdCBjb2xvclByZWZpeCA9IGAtLWFjLWdsb2JhbC1jb2xvci0ke3NlbWFudGljQ29sb3J9YDtcclxuICAgIHJldHVybiBjc3MoYmFzZVNldmVyaXR5Q1NTLCBjc3MgYFxuICAgICAgYm9yZGVyOiAxcHggc29saWQgdmFyKCR7Y29sb3JQcmVmaXh9KTtcbiAgICAgIGJhY2tncm91bmQtY29sb3I6IHZhcigke2NvbG9yUHJlZml4fS03MDApO1xuICAgICAgY29sb3I6IHZhcigtLWFjLWdsb2JhbC1zdGF0aWMtY29sb3Itd2hpdGUtOTAwKTtcbiAgICBgKTtcclxufTtcclxuZXhwb3J0IGNvbnN0IHdhcm5pbmdDU1MgPSBnZW5lcmF0ZVNldmVyaXR5Q1NTKCd3YXJuaW5nJyk7XHJcbmV4cG9ydCBjb25zdCBpbmZvQ1NTID0gZ2VuZXJhdGVTZXZlcml0eUNTUygnaW5mbycpO1xyXG5leHBvcnQgY29uc3QgZGFuZ2VyQ1NTID0gZ2VuZXJhdGVTZXZlcml0eUNTUygnZGFuZ2VyJyk7XHJcbmV4cG9ydCBjb25zdCBzdWNjZXNzQ1NTID0gZ2VuZXJhdGVTZXZlcml0eUNTUygnc3VjY2VzcycpO1xyXG4vLyMgc291cmNlTWFwcGluZ1VSTD1zdHlsZXMuanMubWFwIl19 */"), false ? "" : ";label:generateSeverityCSS;", false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0eWxlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFNVyIsImZpbGUiOiJzdHlsZXMudHMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBjc3MgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XHJcbmV4cG9ydCBjb25zdCBiYXNlU2V2ZXJpdHlDU1MgPSBjc3MgYFxuICBiYWNrZHJvcC1maWx0ZXI6IGJsdXIoMTBweCk7XG5gO1xyXG5jb25zdCBnZW5lcmF0ZVNldmVyaXR5Q1NTID0gKHNlbWFudGljQ29sb3IpID0+IHtcclxuICAgIGNvbnN0IGNvbG9yUHJlZml4ID0gYC0tYWMtZ2xvYmFsLWNvbG9yLSR7c2VtYW50aWNDb2xvcn1gO1xyXG4gICAgcmV0dXJuIGNzcyhiYXNlU2V2ZXJpdHlDU1MsIGNzcyBgXG4gICAgICBib3JkZXI6IDFweCBzb2xpZCB2YXIoJHtjb2xvclByZWZpeH0pO1xuICAgICAgYmFja2dyb3VuZC1jb2xvcjogdmFyKCR7Y29sb3JQcmVmaXh9LTcwMCk7XG4gICAgICBjb2xvcjogdmFyKC0tYWMtZ2xvYmFsLXN0YXRpYy1jb2xvci13aGl0ZS05MDApO1xuICAgIGApO1xyXG59O1xyXG5leHBvcnQgY29uc3Qgd2FybmluZ0NTUyA9IGdlbmVyYXRlU2V2ZXJpdHlDU1MoJ3dhcm5pbmcnKTtcclxuZXhwb3J0IGNvbnN0IGluZm9DU1MgPSBnZW5lcmF0ZVNldmVyaXR5Q1NTKCdpbmZvJyk7XHJcbmV4cG9ydCBjb25zdCBkYW5nZXJDU1MgPSBnZW5lcmF0ZVNldmVyaXR5Q1NTKCdkYW5nZXInKTtcclxuZXhwb3J0IGNvbnN0IHN1Y2Nlc3NDU1MgPSBnZW5lcmF0ZVNldmVyaXR5Q1NTKCdzdWNjZXNzJyk7XHJcbi8vIyBzb3VyY2VNYXBwaW5nVVJMPXN0eWxlcy5qcy5tYXAiXX0= */");
};
var warningCSS = /* @__PURE__ */ generateSeverityCSS("warning");
var infoCSS = /* @__PURE__ */ generateSeverityCSS("info");
var dangerCSS = /* @__PURE__ */ generateSeverityCSS("danger");
var successCSS = /* @__PURE__ */ generateSeverityCSS("success");
function useSeverityStyle(severity) {
  var style;
  switch (severity) {
    case "warning":
      style = warningCSS;
      break;
    case "info":
      style = infoCSS;
      break;
    case "danger":
      style = dangerCSS;
      break;
    case "success":
      style = successCSS;
      break;
  }
  return style;
}
function getSeverityIcon(severity, _temp) {
  var _ref18 = _temp === void 0 ? {
    filled: true
  } : _temp, filled = _ref18.filled;
  var svg2;
  switch (severity) {
    case "warning":
      svg2 = filled ? jsx(AlertTriangleFilled, null) : jsx(AlertTriangleOutline, null);
      break;
    case "info":
      svg2 = filled ? jsx(InfoFilled, null) : jsx(InfoOutline, null);
      break;
    case "danger":
      svg2 = filled ? jsx(AlertCircleFilled, null) : jsx(AlertCircleOutline, null);
      break;
    case "success":
      svg2 = filled ? jsx(CheckmarkCircleFilled, null) : jsx(CheckmarkCircleOutline, null);
      break;
  }
  return jsx(Icon, {
    svg: svg2
  });
}
var _excluded$h = ["variant", "title", "icon", "children", "showIcon", "dismissable", "onDismissClick", "banner", "extra"];
function _EMOTION_STRINGIFIED_CSS_ERROR__$i() {
  return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
}
var _ref$9 = false ? {
  name: "1psfx32",
  styles: "background-color:transparent;color:inherit;padding:0;border:none;cursor:pointer;width:20px;height:20px;margin-left:var(--ac-global-dimension-static-size-200)"
} : {
  name: "1w6u657-Alert",
  styles: "background-color:transparent;color:inherit;padding:0;border:none;cursor:pointer;width:20px;height:20px;margin-left:var(--ac-global-dimension-static-size-200);label:Alert;",
  map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkFsZXJ0LnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFzRHVDIiwiZmlsZSI6IkFsZXJ0LnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBSZWFjdCBmcm9tICdyZWFjdCc7XHJcbmltcG9ydCB7IGNzcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcclxuaW1wb3J0IHRoZW1lIGZyb20gJy4uL3RoZW1lJztcclxuaW1wb3J0IHsgY2xhc3NOYW1lcyB9IGZyb20gJy4uL3V0aWxzJztcclxuaW1wb3J0IHsgVGV4dCB9IGZyb20gJy4uL2NvbnRlbnQnO1xyXG5pbXBvcnQgeyBJY29uLCBDbG9zZU91dGxpbmUgfSBmcm9tICcuLi9pY29uJztcclxuaW1wb3J0IHsgdXNlU2V2ZXJpdHlTdHlsZSB9IGZyb20gJy4vdXNlU2V2ZXJpdHlTdHlsZSc7XHJcbmltcG9ydCB7IGdldFNldmVyaXR5SWNvbiB9IGZyb20gJy4vZ2V0U2V2ZXJpdHlJY29uJztcclxuZXhwb3J0IGNvbnN0IEFsZXJ0ID0gKHsgdmFyaWFudCwgdGl0bGUsIGljb24sIGNoaWxkcmVuLCBzaG93SWNvbiA9IHRydWUsIGRpc21pc3NhYmxlID0gZmFsc2UsIG9uRGlzbWlzc0NsaWNrLCBiYW5uZXIgPSBmYWxzZSwgZXh0cmEsIC4uLm90aGVyUHJvcHMgfSkgPT4ge1xyXG4gICAgbGV0IHZhcmlhbnRTdHlsZSA9IHVzZVNldmVyaXR5U3R5bGUodmFyaWFudCk7XHJcbiAgICBpZiAoIWljb24gJiYgc2hvd0ljb24pIHtcclxuICAgICAgICBpY29uID0gZ2V0U2V2ZXJpdHlJY29uKHZhcmlhbnQpO1xyXG4gICAgfVxyXG4gICAgcmV0dXJuICg8ZGl2IHsuLi5vdGhlclByb3BzfSBjc3M9e2NzcyBgXG4gICAgICAgIHBhZGRpbmc6IHZhcigtLWFjLWdsb2JhbC1kaW1lbnNpb24tc3RhdGljLXNpemUtMTAwKVxuICAgICAgICAgIHZhcigtLWFjLWdsb2JhbC1kaW1lbnNpb24tc3RhdGljLXNpemUtMjAwKTtcbiAgICAgICAgYm9yZGVyLXJhZGl1czogNHB4O1xuICAgICAgICBjb2xvcjogdmFyKC0tYWMtZ2xvYmFsLXRleHQtY29sb3ItOTAwKTtcbiAgICAgICAgZGlzcGxheTogZmxleDtcbiAgICAgICAgZmxleC1kaXJlY3Rpb246IHJvdztcbiAgICAgICAgYWxpZ24taXRlbXM6IGNlbnRlcjtcbiAgICAgICAgJi5hYy1hbGVydC0tYmFubmVyIHtcbiAgICAgICAgICBib3JkZXItcmFkaXVzOiAwO1xuICAgICAgICAgIGJvcmRlci1sZWZ0OiAwcHg7XG4gICAgICAgICAgYm9yZGVyLXJpZ2h0OiAwcHg7XG4gICAgICAgIH1cbiAgICAgICAgJHt2YXJpYW50U3R5bGV9XG4gICAgICAgIC5hYy1hbGVydF9faWNvbi10aXRsZS13cmFwIC5hYy1pY29uLXdyYXAge1xuICAgICAgICAgIG1hcmdpbi1yaWdodDogdmFyKC0tYWMtZ2xvYmFsLWRpbWVuc2lvbi1zdGF0aWMtc2l6ZS0yMDApO1xuICAgICAgICAgIGZvbnQtc2l6ZTogJHt0aGVtZS50eXBvZ3JhcGh5LnNpemVzLnhsYXJnZS5mb250U2l6ZX1weDtcbiAgICAgICAgICBtYXJnaW4tdG9wOiAycHg7XG4gICAgICAgIH1cbiAgICAgICAgJi5hYy1hbGVydC0td2l0aC10aXRsZSAuYWMtYWxlcnRfX2ljb24tdGl0bGUtd3JhcCAuYWMtaWNvbi13cmFwIHtcbiAgICAgICAgICAvKiBUaGUgbGluZSBoZWlnaHQgd2l0aCB0aGUgdGl0bGUgaXMgZGlmZmVyZW50IHNvIGFjY29tbW9kYXRlIGZvciBpdCAqL1xuICAgICAgICAgIG1hcmdpbi10b3A6IDNweDtcbiAgICAgICAgfVxuICAgICAgYH0gY2xhc3NOYW1lPXtjbGFzc05hbWVzKCdhYy1hbGVydCcsIHRpdGxlID8gJ2FjLWFsZXJ0LS13aXRoLXRpdGxlJyA6IG51bGwsIGJhbm5lciA/ICdhYy1hbGVydC0tYmFubmVyJyA6IG51bGwpfT5cbiAgICAgIDxkaXYgY2xhc3NOYW1lPVwiYWMtYWxlcnRfX2ljb24tdGl0bGUtd3JhcFwiIGNzcz17Y3NzIGBcbiAgICAgICAgICBkaXNwbGF5OiBmbGV4O1xuICAgICAgICAgIGZsZXgtZGlyZWN0aW9uOiByb3c7XG4gICAgICAgICAgYWxpZ24taXRlbXM6IGZsZXgtc3RhcnQ7XG4gICAgICAgICAgZmxleDogMSAxIGF1dG87XG4gICAgICAgIGB9PlxuICAgICAgICB7aWNvbn1cbiAgICAgICAgPGRpdj5cbiAgICAgICAgICB7dGl0bGUgPyAoPFRleHQgZWxlbWVudFR5cGU9XCJoNVwiIHRleHRTaXplPVwibGFyZ2VcIiB3ZWlnaHQ9XCJoZWF2eVwiIGNvbG9yPVwiaW5oZXJpdFwiPlxuICAgICAgICAgICAgICB7dGl0bGV9XG4gICAgICAgICAgICA8L1RleHQ+KSA6IG51bGx9XG4gICAgICAgICAgPFRleHQgY29sb3I9XCJpbmhlcml0XCIgdGV4dFNpemU9XCJtZWRpdW1cIj5cbiAgICAgICAgICAgIHtjaGlsZHJlbn1cbiAgICAgICAgICA8L1RleHQ+XG4gICAgICAgIDwvZGl2PlxuICAgICAgPC9kaXY+XG4gICAgICB7ZXh0cmF9XG4gICAgICB7ZGlzbWlzc2FibGUgPyAoPGJ1dHRvbiBjc3M9e2NzcyBgXG4gICAgICAgICAgICBiYWNrZ3JvdW5kLWNvbG9yOiB0cmFuc3BhcmVudDtcbiAgICAgICAgICAgIGNvbG9yOiBpbmhlcml0O1xuICAgICAgICAgICAgcGFkZGluZzogMDtcbiAgICAgICAgICAgIGJvcmRlcjogbm9uZTtcbiAgICAgICAgICAgIGN1cnNvcjogcG9pbnRlcjtcbiAgICAgICAgICAgIHdpZHRoOiAyMHB4O1xuICAgICAgICAgICAgaGVpZ2h0OiAyMHB4O1xuICAgICAgICAgICAgbWFyZ2luLWxlZnQ6IHZhcigtLWFjLWdsb2JhbC1kaW1lbnNpb24tc3RhdGljLXNpemUtMjAwKTtcbiAgICAgICAgICBgfSBvbkNsaWNrPXtvbkRpc21pc3NDbGlja30+XG4gICAgICAgICAgezxJY29uIHN2Zz17PENsb3NlT3V0bGluZSAvPn0vPn1cbiAgICAgICAgPC9idXR0b24+KSA6IG51bGx9XG4gICAgPC9kaXY+KTtcclxufTtcclxuLy8jIHNvdXJjZU1hcHBpbmdVUkw9QWxlcnQuanN4Lm1hcCJdfQ== */",
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__$i
};
var _ref2$4 = false ? {
  name: "lgsyz4",
  styles: "display:flex;flex-direction:row;align-items:flex-start;flex:1 1 auto"
} : {
  name: "1plmzdc-Alert",
  styles: "display:flex;flex-direction:row;align-items:flex-start;flex:1 1 auto;label:Alert;",
  map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkFsZXJ0LnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFxQzBEIiwiZmlsZSI6IkFsZXJ0LnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBSZWFjdCBmcm9tICdyZWFjdCc7XHJcbmltcG9ydCB7IGNzcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcclxuaW1wb3J0IHRoZW1lIGZyb20gJy4uL3RoZW1lJztcclxuaW1wb3J0IHsgY2xhc3NOYW1lcyB9IGZyb20gJy4uL3V0aWxzJztcclxuaW1wb3J0IHsgVGV4dCB9IGZyb20gJy4uL2NvbnRlbnQnO1xyXG5pbXBvcnQgeyBJY29uLCBDbG9zZU91dGxpbmUgfSBmcm9tICcuLi9pY29uJztcclxuaW1wb3J0IHsgdXNlU2V2ZXJpdHlTdHlsZSB9IGZyb20gJy4vdXNlU2V2ZXJpdHlTdHlsZSc7XHJcbmltcG9ydCB7IGdldFNldmVyaXR5SWNvbiB9IGZyb20gJy4vZ2V0U2V2ZXJpdHlJY29uJztcclxuZXhwb3J0IGNvbnN0IEFsZXJ0ID0gKHsgdmFyaWFudCwgdGl0bGUsIGljb24sIGNoaWxkcmVuLCBzaG93SWNvbiA9IHRydWUsIGRpc21pc3NhYmxlID0gZmFsc2UsIG9uRGlzbWlzc0NsaWNrLCBiYW5uZXIgPSBmYWxzZSwgZXh0cmEsIC4uLm90aGVyUHJvcHMgfSkgPT4ge1xyXG4gICAgbGV0IHZhcmlhbnRTdHlsZSA9IHVzZVNldmVyaXR5U3R5bGUodmFyaWFudCk7XHJcbiAgICBpZiAoIWljb24gJiYgc2hvd0ljb24pIHtcclxuICAgICAgICBpY29uID0gZ2V0U2V2ZXJpdHlJY29uKHZhcmlhbnQpO1xyXG4gICAgfVxyXG4gICAgcmV0dXJuICg8ZGl2IHsuLi5vdGhlclByb3BzfSBjc3M9e2NzcyBgXG4gICAgICAgIHBhZGRpbmc6IHZhcigtLWFjLWdsb2JhbC1kaW1lbnNpb24tc3RhdGljLXNpemUtMTAwKVxuICAgICAgICAgIHZhcigtLWFjLWdsb2JhbC1kaW1lbnNpb24tc3RhdGljLXNpemUtMjAwKTtcbiAgICAgICAgYm9yZGVyLXJhZGl1czogNHB4O1xuICAgICAgICBjb2xvcjogdmFyKC0tYWMtZ2xvYmFsLXRleHQtY29sb3ItOTAwKTtcbiAgICAgICAgZGlzcGxheTogZmxleDtcbiAgICAgICAgZmxleC1kaXJlY3Rpb246IHJvdztcbiAgICAgICAgYWxpZ24taXRlbXM6IGNlbnRlcjtcbiAgICAgICAgJi5hYy1hbGVydC0tYmFubmVyIHtcbiAgICAgICAgICBib3JkZXItcmFkaXVzOiAwO1xuICAgICAgICAgIGJvcmRlci1sZWZ0OiAwcHg7XG4gICAgICAgICAgYm9yZGVyLXJpZ2h0OiAwcHg7XG4gICAgICAgIH1cbiAgICAgICAgJHt2YXJpYW50U3R5bGV9XG4gICAgICAgIC5hYy1hbGVydF9faWNvbi10aXRsZS13cmFwIC5hYy1pY29uLXdyYXAge1xuICAgICAgICAgIG1hcmdpbi1yaWdodDogdmFyKC0tYWMtZ2xvYmFsLWRpbWVuc2lvbi1zdGF0aWMtc2l6ZS0yMDApO1xuICAgICAgICAgIGZvbnQtc2l6ZTogJHt0aGVtZS50eXBvZ3JhcGh5LnNpemVzLnhsYXJnZS5mb250U2l6ZX1weDtcbiAgICAgICAgICBtYXJnaW4tdG9wOiAycHg7XG4gICAgICAgIH1cbiAgICAgICAgJi5hYy1hbGVydC0td2l0aC10aXRsZSAuYWMtYWxlcnRfX2ljb24tdGl0bGUtd3JhcCAuYWMtaWNvbi13cmFwIHtcbiAgICAgICAgICAvKiBUaGUgbGluZSBoZWlnaHQgd2l0aCB0aGUgdGl0bGUgaXMgZGlmZmVyZW50IHNvIGFjY29tbW9kYXRlIGZvciBpdCAqL1xuICAgICAgICAgIG1hcmdpbi10b3A6IDNweDtcbiAgICAgICAgfVxuICAgICAgYH0gY2xhc3NOYW1lPXtjbGFzc05hbWVzKCdhYy1hbGVydCcsIHRpdGxlID8gJ2FjLWFsZXJ0LS13aXRoLXRpdGxlJyA6IG51bGwsIGJhbm5lciA/ICdhYy1hbGVydC0tYmFubmVyJyA6IG51bGwpfT5cbiAgICAgIDxkaXYgY2xhc3NOYW1lPVwiYWMtYWxlcnRfX2ljb24tdGl0bGUtd3JhcFwiIGNzcz17Y3NzIGBcbiAgICAgICAgICBkaXNwbGF5OiBmbGV4O1xuICAgICAgICAgIGZsZXgtZGlyZWN0aW9uOiByb3c7XG4gICAgICAgICAgYWxpZ24taXRlbXM6IGZsZXgtc3RhcnQ7XG4gICAgICAgICAgZmxleDogMSAxIGF1dG87XG4gICAgICAgIGB9PlxuICAgICAgICB7aWNvbn1cbiAgICAgICAgPGRpdj5cbiAgICAgICAgICB7dGl0bGUgPyAoPFRleHQgZWxlbWVudFR5cGU9XCJoNVwiIHRleHRTaXplPVwibGFyZ2VcIiB3ZWlnaHQ9XCJoZWF2eVwiIGNvbG9yPVwiaW5oZXJpdFwiPlxuICAgICAgICAgICAgICB7dGl0bGV9XG4gICAgICAgICAgICA8L1RleHQ+KSA6IG51bGx9XG4gICAgICAgICAgPFRleHQgY29sb3I9XCJpbmhlcml0XCIgdGV4dFNpemU9XCJtZWRpdW1cIj5cbiAgICAgICAgICAgIHtjaGlsZHJlbn1cbiAgICAgICAgICA8L1RleHQ+XG4gICAgICAgIDwvZGl2PlxuICAgICAgPC9kaXY+XG4gICAgICB7ZXh0cmF9XG4gICAgICB7ZGlzbWlzc2FibGUgPyAoPGJ1dHRvbiBjc3M9e2NzcyBgXG4gICAgICAgICAgICBiYWNrZ3JvdW5kLWNvbG9yOiB0cmFuc3BhcmVudDtcbiAgICAgICAgICAgIGNvbG9yOiBpbmhlcml0O1xuICAgICAgICAgICAgcGFkZGluZzogMDtcbiAgICAgICAgICAgIGJvcmRlcjogbm9uZTtcbiAgICAgICAgICAgIGN1cnNvcjogcG9pbnRlcjtcbiAgICAgICAgICAgIHdpZHRoOiAyMHB4O1xuICAgICAgICAgICAgaGVpZ2h0OiAyMHB4O1xuICAgICAgICAgICAgbWFyZ2luLWxlZnQ6IHZhcigtLWFjLWdsb2JhbC1kaW1lbnNpb24tc3RhdGljLXNpemUtMjAwKTtcbiAgICAgICAgICBgfSBvbkNsaWNrPXtvbkRpc21pc3NDbGlja30+XG4gICAgICAgICAgezxJY29uIHN2Zz17PENsb3NlT3V0bGluZSAvPn0vPn1cbiAgICAgICAgPC9idXR0b24+KSA6IG51bGx9XG4gICAgPC9kaXY+KTtcclxufTtcclxuLy8jIHNvdXJjZU1hcHBpbmdVUkw9QWxlcnQuanN4Lm1hcCJdfQ== */",
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__$i
};
var Alert = function Alert2(_ref32) {
  var variant = _ref32.variant, title = _ref32.title, icon = _ref32.icon, children = _ref32.children, _ref3$showIcon = _ref32.showIcon, showIcon = _ref3$showIcon === void 0 ? true : _ref3$showIcon, _ref3$dismissable = _ref32.dismissable, dismissable = _ref3$dismissable === void 0 ? false : _ref3$dismissable, onDismissClick = _ref32.onDismissClick, _ref3$banner = _ref32.banner, banner = _ref3$banner === void 0 ? false : _ref3$banner, extra = _ref32.extra, otherProps = _objectWithoutPropertiesLoose2(_ref32, _excluded$h);
  var variantStyle = useSeverityStyle(variant);
  if (!icon && showIcon) {
    icon = getSeverityIcon(variant);
  }
  return jsx("div", _extends2({}, otherProps, {
    css: /* @__PURE__ */ css("padding:var(--ac-global-dimension-static-size-100) var(--ac-global-dimension-static-size-200);border-radius:4px;color:var(--ac-global-text-color-900);display:flex;flex-direction:row;align-items:center;&.ac-alert--banner{border-radius:0;border-left:0px;border-right:0px;}", variantStyle, " .ac-alert__icon-title-wrap .ac-icon-wrap{margin-right:var(--ac-global-dimension-static-size-200);font-size:", theme.typography.sizes.xlarge.fontSize, "px;margin-top:2px;}&.ac-alert--with-title .ac-alert__icon-title-wrap .ac-icon-wrap{margin-top:3px;}" + (false ? "" : ";label:Alert;"), false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkFsZXJ0LnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFhMEMiLCJmaWxlIjoiQWxlcnQudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IFJlYWN0IGZyb20gJ3JlYWN0JztcclxuaW1wb3J0IHsgY3NzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xyXG5pbXBvcnQgdGhlbWUgZnJvbSAnLi4vdGhlbWUnO1xyXG5pbXBvcnQgeyBjbGFzc05hbWVzIH0gZnJvbSAnLi4vdXRpbHMnO1xyXG5pbXBvcnQgeyBUZXh0IH0gZnJvbSAnLi4vY29udGVudCc7XHJcbmltcG9ydCB7IEljb24sIENsb3NlT3V0bGluZSB9IGZyb20gJy4uL2ljb24nO1xyXG5pbXBvcnQgeyB1c2VTZXZlcml0eVN0eWxlIH0gZnJvbSAnLi91c2VTZXZlcml0eVN0eWxlJztcclxuaW1wb3J0IHsgZ2V0U2V2ZXJpdHlJY29uIH0gZnJvbSAnLi9nZXRTZXZlcml0eUljb24nO1xyXG5leHBvcnQgY29uc3QgQWxlcnQgPSAoeyB2YXJpYW50LCB0aXRsZSwgaWNvbiwgY2hpbGRyZW4sIHNob3dJY29uID0gdHJ1ZSwgZGlzbWlzc2FibGUgPSBmYWxzZSwgb25EaXNtaXNzQ2xpY2ssIGJhbm5lciA9IGZhbHNlLCBleHRyYSwgLi4ub3RoZXJQcm9wcyB9KSA9PiB7XHJcbiAgICBsZXQgdmFyaWFudFN0eWxlID0gdXNlU2V2ZXJpdHlTdHlsZSh2YXJpYW50KTtcclxuICAgIGlmICghaWNvbiAmJiBzaG93SWNvbikge1xyXG4gICAgICAgIGljb24gPSBnZXRTZXZlcml0eUljb24odmFyaWFudCk7XHJcbiAgICB9XHJcbiAgICByZXR1cm4gKDxkaXYgey4uLm90aGVyUHJvcHN9IGNzcz17Y3NzIGBcbiAgICAgICAgcGFkZGluZzogdmFyKC0tYWMtZ2xvYmFsLWRpbWVuc2lvbi1zdGF0aWMtc2l6ZS0xMDApXG4gICAgICAgICAgdmFyKC0tYWMtZ2xvYmFsLWRpbWVuc2lvbi1zdGF0aWMtc2l6ZS0yMDApO1xuICAgICAgICBib3JkZXItcmFkaXVzOiA0cHg7XG4gICAgICAgIGNvbG9yOiB2YXIoLS1hYy1nbG9iYWwtdGV4dC1jb2xvci05MDApO1xuICAgICAgICBkaXNwbGF5OiBmbGV4O1xuICAgICAgICBmbGV4LWRpcmVjdGlvbjogcm93O1xuICAgICAgICBhbGlnbi1pdGVtczogY2VudGVyO1xuICAgICAgICAmLmFjLWFsZXJ0LS1iYW5uZXIge1xuICAgICAgICAgIGJvcmRlci1yYWRpdXM6IDA7XG4gICAgICAgICAgYm9yZGVyLWxlZnQ6IDBweDtcbiAgICAgICAgICBib3JkZXItcmlnaHQ6IDBweDtcbiAgICAgICAgfVxuICAgICAgICAke3ZhcmlhbnRTdHlsZX1cbiAgICAgICAgLmFjLWFsZXJ0X19pY29uLXRpdGxlLXdyYXAgLmFjLWljb24td3JhcCB7XG4gICAgICAgICAgbWFyZ2luLXJpZ2h0OiB2YXIoLS1hYy1nbG9iYWwtZGltZW5zaW9uLXN0YXRpYy1zaXplLTIwMCk7XG4gICAgICAgICAgZm9udC1zaXplOiAke3RoZW1lLnR5cG9ncmFwaHkuc2l6ZXMueGxhcmdlLmZvbnRTaXplfXB4O1xuICAgICAgICAgIG1hcmdpbi10b3A6IDJweDtcbiAgICAgICAgfVxuICAgICAgICAmLmFjLWFsZXJ0LS13aXRoLXRpdGxlIC5hYy1hbGVydF9faWNvbi10aXRsZS13cmFwIC5hYy1pY29uLXdyYXAge1xuICAgICAgICAgIC8qIFRoZSBsaW5lIGhlaWdodCB3aXRoIHRoZSB0aXRsZSBpcyBkaWZmZXJlbnQgc28gYWNjb21tb2RhdGUgZm9yIGl0ICovXG4gICAgICAgICAgbWFyZ2luLXRvcDogM3B4O1xuICAgICAgICB9XG4gICAgICBgfSBjbGFzc05hbWU9e2NsYXNzTmFtZXMoJ2FjLWFsZXJ0JywgdGl0bGUgPyAnYWMtYWxlcnQtLXdpdGgtdGl0bGUnIDogbnVsbCwgYmFubmVyID8gJ2FjLWFsZXJ0LS1iYW5uZXInIDogbnVsbCl9PlxuICAgICAgPGRpdiBjbGFzc05hbWU9XCJhYy1hbGVydF9faWNvbi10aXRsZS13cmFwXCIgY3NzPXtjc3MgYFxuICAgICAgICAgIGRpc3BsYXk6IGZsZXg7XG4gICAgICAgICAgZmxleC1kaXJlY3Rpb246IHJvdztcbiAgICAgICAgICBhbGlnbi1pdGVtczogZmxleC1zdGFydDtcbiAgICAgICAgICBmbGV4OiAxIDEgYXV0bztcbiAgICAgICAgYH0+XG4gICAgICAgIHtpY29ufVxuICAgICAgICA8ZGl2PlxuICAgICAgICAgIHt0aXRsZSA/ICg8VGV4dCBlbGVtZW50VHlwZT1cImg1XCIgdGV4dFNpemU9XCJsYXJnZVwiIHdlaWdodD1cImhlYXZ5XCIgY29sb3I9XCJpbmhlcml0XCI+XG4gICAgICAgICAgICAgIHt0aXRsZX1cbiAgICAgICAgICAgIDwvVGV4dD4pIDogbnVsbH1cbiAgICAgICAgICA8VGV4dCBjb2xvcj1cImluaGVyaXRcIiB0ZXh0U2l6ZT1cIm1lZGl1bVwiPlxuICAgICAgICAgICAge2NoaWxkcmVufVxuICAgICAgICAgIDwvVGV4dD5cbiAgICAgICAgPC9kaXY+XG4gICAgICA8L2Rpdj5cbiAgICAgIHtleHRyYX1cbiAgICAgIHtkaXNtaXNzYWJsZSA/ICg8YnV0dG9uIGNzcz17Y3NzIGBcbiAgICAgICAgICAgIGJhY2tncm91bmQtY29sb3I6IHRyYW5zcGFyZW50O1xuICAgICAgICAgICAgY29sb3I6IGluaGVyaXQ7XG4gICAgICAgICAgICBwYWRkaW5nOiAwO1xuICAgICAgICAgICAgYm9yZGVyOiBub25lO1xuICAgICAgICAgICAgY3Vyc29yOiBwb2ludGVyO1xuICAgICAgICAgICAgd2lkdGg6IDIwcHg7XG4gICAgICAgICAgICBoZWlnaHQ6IDIwcHg7XG4gICAgICAgICAgICBtYXJnaW4tbGVmdDogdmFyKC0tYWMtZ2xvYmFsLWRpbWVuc2lvbi1zdGF0aWMtc2l6ZS0yMDApO1xuICAgICAgICAgIGB9IG9uQ2xpY2s9e29uRGlzbWlzc0NsaWNrfT5cbiAgICAgICAgICB7PEljb24gc3ZnPXs8Q2xvc2VPdXRsaW5lIC8+fS8+fVxuICAgICAgICA8L2J1dHRvbj4pIDogbnVsbH1cbiAgICA8L2Rpdj4pO1xyXG59O1xyXG4vLyMgc291cmNlTWFwcGluZ1VSTD1BbGVydC5qc3gubWFwIl19 */"),
    className: clsx_m_default("ac-alert", title ? "ac-alert--with-title" : null, banner ? "ac-alert--banner" : null)
  }), jsx("div", {
    className: "ac-alert__icon-title-wrap",
    css: _ref2$4
  }, icon, jsx("div", null, title ? jsx(_Text, {
    elementType: "h5",
    textSize: "large",
    weight: "heavy",
    color: "inherit"
  }, title) : null, jsx(_Text, {
    color: "inherit",
    textSize: "medium"
  }, children))), extra, dismissable ? jsx("button", {
    css: _ref$9,
    onClick: onDismissClick
  }, jsx(Icon, {
    svg: jsx(CloseOutline, null)
  })) : null);
};
function HelpText(props, ref) {
  var description = props.description, errorMessage = props.errorMessage, validationState = props.validationState, isDisabled = props.isDisabled, showErrorIcon = props.showErrorIcon, descriptionProps = props.descriptionProps, errorMessageProps = props.errorMessageProps;
  var domRef = useDOMRef(ref);
  var isErrorMessage = errorMessage && validationState === "invalid";
  return jsx("div", {
    className: clsx_m_default("ac-help-text", "ac-help-text--" + (isErrorMessage ? "danger" : "neutral"), {
      "is-disabled": isDisabled
    }),
    ref: domRef,
    css: /* @__PURE__ */ css("height:16px;padding:var(--ac-global-dimension-static-size-50) 0 0;color:var(--ac-global-text-color-500);&.ac-help-text--danger{color:var(--ac-global-color-danger);}.ac-help-text__text{font-size:", theme.typography.sizes.small.fontSize, "px;line-height:", theme.typography.sizes.small.lineHeight, "px;}" + (false ? "" : ";label:HelpText;"), false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkhlbHBUZXh0LnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFRdUsiLCJmaWxlIjoiSGVscFRleHQudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgY2xhc3NOYW1lcywgdXNlRE9NUmVmIH0gZnJvbSAnLi4vdXRpbHMnO1xyXG5pbXBvcnQgUmVhY3QgZnJvbSAncmVhY3QnO1xyXG5pbXBvcnQgeyBjc3MgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XHJcbmltcG9ydCB0aGVtZSBmcm9tICcuLi90aGVtZSc7XHJcbmZ1bmN0aW9uIEhlbHBUZXh0KHByb3BzLCByZWYpIHtcclxuICAgIGxldCB7IGRlc2NyaXB0aW9uLCBlcnJvck1lc3NhZ2UsIHZhbGlkYXRpb25TdGF0ZSwgaXNEaXNhYmxlZCwgc2hvd0Vycm9ySWNvbiwgZGVzY3JpcHRpb25Qcm9wcywgZXJyb3JNZXNzYWdlUHJvcHMsIH0gPSBwcm9wcztcclxuICAgIGxldCBkb21SZWYgPSB1c2VET01SZWYocmVmKTtcclxuICAgIGxldCBpc0Vycm9yTWVzc2FnZSA9IGVycm9yTWVzc2FnZSAmJiB2YWxpZGF0aW9uU3RhdGUgPT09ICdpbnZhbGlkJztcclxuICAgIHJldHVybiAoPGRpdiBjbGFzc05hbWU9e2NsYXNzTmFtZXMoJ2FjLWhlbHAtdGV4dCcsIGBhYy1oZWxwLXRleHQtLSR7aXNFcnJvck1lc3NhZ2UgPyAnZGFuZ2VyJyA6ICduZXV0cmFsJ31gLCB7ICdpcy1kaXNhYmxlZCc6IGlzRGlzYWJsZWQgfSl9IHJlZj17ZG9tUmVmfSBjc3M9e2NzcyBgXG4gICAgICAgIGhlaWdodDogMTZweDtcbiAgICAgICAgcGFkZGluZzogdmFyKC0tYWMtZ2xvYmFsLWRpbWVuc2lvbi1zdGF0aWMtc2l6ZS01MCkgMCAwO1xuICAgICAgICBjb2xvcjogdmFyKC0tYWMtZ2xvYmFsLXRleHQtY29sb3ItNTAwKTtcbiAgICAgICAgJi5hYy1oZWxwLXRleHQtLWRhbmdlciB7XG4gICAgICAgICAgY29sb3I6IHZhcigtLWFjLWdsb2JhbC1jb2xvci1kYW5nZXIpO1xuICAgICAgICB9XG4gICAgICAgIC5hYy1oZWxwLXRleHRfX3RleHQge1xuICAgICAgICAgIGZvbnQtc2l6ZTogJHt0aGVtZS50eXBvZ3JhcGh5LnNpemVzLnNtYWxsLmZvbnRTaXplfXB4O1xuICAgICAgICAgIGxpbmUtaGVpZ2h0OiAke3RoZW1lLnR5cG9ncmFwaHkuc2l6ZXMuc21hbGwubGluZUhlaWdodH1weDtcbiAgICAgICAgfVxuICAgICAgYH0+XG4gICAgICB7aXNFcnJvck1lc3NhZ2UgPyAoPD5cbiAgICAgICAgICBcbiAgICAgICAgICB7c2hvd0Vycm9ySWNvbiAmJiAnZXJyb3IgaWNvbiBoZXJlJ31cbiAgICAgICAgICA8ZGl2IHsuLi5lcnJvck1lc3NhZ2VQcm9wc30gY2xhc3NOYW1lPXsnYWMtaGVscC10ZXh0X190ZXh0J30+XG4gICAgICAgICAgICB7ZXJyb3JNZXNzYWdlfVxuICAgICAgICAgIDwvZGl2PlxuICAgICAgICA8Lz4pIDogKDxkaXYgey4uLmRlc2NyaXB0aW9uUHJvcHN9IGNsYXNzTmFtZT17J2FjLWhlbHAtdGV4dF9fdGV4dCd9PlxuICAgICAgICAgIHtkZXNjcmlwdGlvbn1cbiAgICAgICAgPC9kaXY+KX1cbiAgICA8L2Rpdj4pO1xyXG59XHJcbi8qKlxyXG4gKiBIZWxwIHRleHQgcHJvdmlkZXMgZWl0aGVyIGFuIGluZm9ybWF0aXZlIGRlc2NyaXB0aW9uIG9yIGFuIGVycm9yIG1lc3NhZ2UgdGhhdCBnaXZlcyBtb3JlIGNvbnRleHQgYWJvdXQgd2hhdCBhIHVzZXIgbmVlZHMgdG8gaW5wdXQuIEl0J3MgY29tbW9ubHkgdXNlZCBpbiBmb3Jtcy5cclxuICovXHJcbmNvbnN0IF9IZWxwVGV4dCA9IFJlYWN0LmZvcndhcmRSZWYoSGVscFRleHQpO1xyXG5leHBvcnQgeyBfSGVscFRleHQgYXMgSGVscFRleHQgfTtcclxuLy8jIHNvdXJjZU1hcHBpbmdVUkw9SGVscFRleHQuanN4Lm1hcCJdfQ== */")
  }, isErrorMessage ? jsx(import_react35.default.Fragment, null, showErrorIcon && "error icon here", jsx("div", _extends2({}, errorMessageProps, {
    className: "ac-help-text__text"
  }), errorMessage)) : jsx("div", _extends2({}, descriptionProps, {
    className: "ac-help-text__text"
  }), description));
}
var _HelpText = /* @__PURE__ */ import_react35.default.forwardRef(HelpText);
var _excluded$i = ["children", "labelPosition", "labelAlign", "labelExtra", "isRequired", "necessityIndicator", "includeNecessityIndicatorInAccessibilityName", "htmlFor", "for", "elementType", "onClick"];
function _EMOTION_STRINGIFIED_CSS_ERROR__$j() {
  return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
}
var _ref$a = false ? {
  name: "zaiqj",
  styles: "margin-left:var(--ac-global-dimension-static-size-50);display:inline-flex;align-items:center"
} : {
  name: "1nd2shf-FieldLabel",
  styles: "margin-left:var(--ac-global-dimension-static-size-50);display:inline-flex;align-items:center;label:FieldLabel;",
  map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkZpZWxkTGFiZWwudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQWtDNkUiLCJmaWxlIjoiRmllbGRMYWJlbC50c3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBjbGFzc05hbWVzLCB1c2VET01SZWYgfSBmcm9tICcuLi91dGlscyc7XHJcbmltcG9ydCB7IGNzcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcclxuaW1wb3J0IHsgZmlsdGVyRE9NUHJvcHMgfSBmcm9tICdAcmVhY3QtYXJpYS91dGlscyc7XHJcbmltcG9ydCBSZWFjdCBmcm9tICdyZWFjdCc7XHJcbmltcG9ydCB0aGVtZSBmcm9tICcuLi90aGVtZSc7XHJcbmZ1bmN0aW9uIEZpZWxkTGFiZWwocHJvcHMsIHJlZikge1xyXG4gICAgbGV0IHsgY2hpbGRyZW4sIGxhYmVsUG9zaXRpb24gPSAndG9wJywgbGFiZWxBbGlnbiA9IGxhYmVsUG9zaXRpb24gPT09ICdzaWRlJyA/ICdzdGFydCcgOiBudWxsLCBsYWJlbEV4dHJhLCBpc1JlcXVpcmVkLCBuZWNlc3NpdHlJbmRpY2F0b3IgPSAnaWNvbicsIGluY2x1ZGVOZWNlc3NpdHlJbmRpY2F0b3JJbkFjY2Vzc2liaWxpdHlOYW1lID0gZmFsc2UsIGh0bWxGb3IsIGZvcjogbGFiZWxGb3IsIGVsZW1lbnRUeXBlOiBFbGVtZW50VHlwZSA9ICdsYWJlbCcsIG9uQ2xpY2ssIC4uLm90aGVyUHJvcHMgfSA9IHByb3BzO1xyXG4gICAgbGV0IGRvbVJlZiA9IHVzZURPTVJlZihyZWYpO1xyXG4gICAgbGV0IG5lY2Vzc2l0eUxhYmVsID0gaXNSZXF1aXJlZCA/ICcocmVxdWlyZWQpJyA6ICcob3B0aW9uYWwpJztcclxuICAgIGxldCBpY29uID0gJyonO1xyXG4gICAgbGV0IGxhYmVsQ2xhc3NOYW1lcyA9IGNsYXNzTmFtZXMoJ2FjLWZpZWxkLWxhYmVsJywge1xyXG4gICAgICAgICdhYy1maWVsZC1sYWJlbC0tcG9zaXRpb25TaWRlJzogbGFiZWxQb3NpdGlvbiA9PT0gJ3NpZGUnLFxyXG4gICAgICAgICdhYy1maWVsZC1sYWJlbC0tYWxpZ25FbmQnOiBsYWJlbEFsaWduID09PSAnZW5kJyxcclxuICAgIH0pO1xyXG4gICAgcmV0dXJuICg8RWxlbWVudFR5cGUgey4uLmZpbHRlckRPTVByb3BzKG90aGVyUHJvcHMpfSBvbkNsaWNrPXtvbkNsaWNrfSByZWY9e2RvbVJlZn0gY2xhc3NOYW1lPXtsYWJlbENsYXNzTmFtZXN9IGh0bWxGb3I9e0VsZW1lbnRUeXBlID09PSAnbGFiZWwnID8gbGFiZWxGb3IgfHwgaHRtbEZvciA6IHVuZGVmaW5lZH0gY3NzPXtjc3MgYFxuICAgICAgICBmb250LXNpemU6ICR7dGhlbWUudHlwb2dyYXBoeS5zaXplcy5zbWFsbC5mb250U2l6ZX1weDtcbiAgICAgICAgbGluZS1oZWlnaHQ6ICR7dGhlbWUudHlwb2dyYXBoeS5zaXplcy5zbWFsbC5saW5lSGVpZ2h0fXB4O1xuICAgICAgICBmb250LXdlaWdodDogJHt0aGVtZS50eXBvZ3JhcGh5LndlaWdodHMuaGVhdnl9O1xuICAgICAgICBjb2xvcjogdmFyKC0tYWMtZ2xvYmFsLXRleHQtY29sb3ItOTAwKTtcbiAgICAgICAgcGFkZGluZzogdmFyKC0tYWMtZ2xvYmFsLWRpbWVuc2lvbi1zdGF0aWMtc2l6ZS01MCkgMDtcbiAgICAgICAgZGlzcGxheTogaW5saW5lLWZsZXg7XG4gICAgICAgIGFsaWduLWl0ZW1zOiBjZW50ZXI7XG4gICAgICBgfT5cbiAgICAgIHtjaGlsZHJlbn1cbiAgICAgIHsobmVjZXNzaXR5SW5kaWNhdG9yID09PSAnbGFiZWwnIHx8XHJcbiAgICAgICAgKG5lY2Vzc2l0eUluZGljYXRvciA9PT0gJ2ljb24nICYmIGlzUmVxdWlyZWQpKSAmJlxyXG4gICAgICAgICcgXFx1MjAwYid9XG4gICAgICBcbiAgICAgIHtuZWNlc3NpdHlJbmRpY2F0b3IgPT09ICdsYWJlbCcgJiYgKDxzcGFuIGFyaWEtaGlkZGVuPXshaW5jbHVkZU5lY2Vzc2l0eUluZGljYXRvckluQWNjZXNzaWJpbGl0eU5hbWVcclxuICAgICAgICA/IGlzUmVxdWlyZWRcclxuICAgICAgICA6IHVuZGVmaW5lZH0+XG4gICAgICAgICAge25lY2Vzc2l0eUxhYmVsfVxuICAgICAgICA8L3NwYW4+KX1cbiAgICAgIHtuZWNlc3NpdHlJbmRpY2F0b3IgPT09ICdpY29uJyAmJiBpc1JlcXVpcmVkICYmIGljb259XG4gICAgICB7bGFiZWxFeHRyYSAmJiAoPHNwYW4gY2xhc3NOYW1lPVwiYWMtZmllbGQtbGFiZWxfX2xhYmVsLWV4dHJhXCIgY3NzPXtjc3MgYFxuICAgICAgICAgICAgbWFyZ2luLWxlZnQ6IHZhcigtLWFjLWdsb2JhbC1kaW1lbnNpb24tc3RhdGljLXNpemUtNTApO1xuICAgICAgICAgICAgZGlzcGxheTogaW5saW5lLWZsZXg7XG4gICAgICAgICAgICBhbGlnbi1pdGVtczogY2VudGVyO1xuICAgICAgICAgIGB9PlxuICAgICAgICAgIHtsYWJlbEV4dHJhfVxuICAgICAgICA8L3NwYW4+KX1cbiAgICA8L0VsZW1lbnRUeXBlPik7XHJcbn1cclxubGV0IF9GaWVsZExhYmVsID0gUmVhY3QuZm9yd2FyZFJlZihGaWVsZExhYmVsKTtcclxuZXhwb3J0IHsgX0ZpZWxkTGFiZWwgYXMgRmllbGRMYWJlbCB9O1xyXG4vLyMgc291cmNlTWFwcGluZ1VSTD1GaWVsZExhYmVsLmpzeC5tYXAiXX0= */",
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__$j
};
function FieldLabel(props, ref) {
  var children = props.children, _props$labelPosition = props.labelPosition, labelPosition = _props$labelPosition === void 0 ? "top" : _props$labelPosition, _props$labelAlign = props.labelAlign, labelAlign = _props$labelAlign === void 0 ? labelPosition === "side" ? "start" : null : _props$labelAlign, labelExtra = props.labelExtra, isRequired = props.isRequired, _props$necessityIndic = props.necessityIndicator, necessityIndicator = _props$necessityIndic === void 0 ? "icon" : _props$necessityIndic, _props$includeNecessi = props.includeNecessityIndicatorInAccessibilityName, includeNecessityIndicatorInAccessibilityName = _props$includeNecessi === void 0 ? false : _props$includeNecessi, htmlFor = props.htmlFor, labelFor = props["for"], _props$elementType = props.elementType, ElementType = _props$elementType === void 0 ? "label" : _props$elementType, onClick = props.onClick, otherProps = _objectWithoutPropertiesLoose2(props, _excluded$i);
  var domRef = useDOMRef(ref);
  var necessityLabel = isRequired ? "(required)" : "(optional)";
  var icon = "*";
  var labelClassNames = clsx_m_default("ac-field-label", {
    "ac-field-label--positionSide": labelPosition === "side",
    "ac-field-label--alignEnd": labelAlign === "end"
  });
  return jsx(ElementType, _extends2({}, $65484d02dcb7eb3e$export$457c3d6518dd4c6f(otherProps), {
    onClick,
    ref: domRef,
    className: labelClassNames,
    htmlFor: ElementType === "label" ? labelFor || htmlFor : void 0,
    css: /* @__PURE__ */ css("font-size:", theme.typography.sizes.small.fontSize, "px;line-height:", theme.typography.sizes.small.lineHeight, "px;font-weight:", theme.typography.weights.heavy, ";color:var(--ac-global-text-color-900);padding:var(--ac-global-dimension-static-size-50) 0;display:inline-flex;align-items:center;" + (false ? "" : ";label:FieldLabel;"), false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkZpZWxkTGFiZWwudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQWNpTSIsImZpbGUiOiJGaWVsZExhYmVsLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGNsYXNzTmFtZXMsIHVzZURPTVJlZiB9IGZyb20gJy4uL3V0aWxzJztcclxuaW1wb3J0IHsgY3NzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xyXG5pbXBvcnQgeyBmaWx0ZXJET01Qcm9wcyB9IGZyb20gJ0ByZWFjdC1hcmlhL3V0aWxzJztcclxuaW1wb3J0IFJlYWN0IGZyb20gJ3JlYWN0JztcclxuaW1wb3J0IHRoZW1lIGZyb20gJy4uL3RoZW1lJztcclxuZnVuY3Rpb24gRmllbGRMYWJlbChwcm9wcywgcmVmKSB7XHJcbiAgICBsZXQgeyBjaGlsZHJlbiwgbGFiZWxQb3NpdGlvbiA9ICd0b3AnLCBsYWJlbEFsaWduID0gbGFiZWxQb3NpdGlvbiA9PT0gJ3NpZGUnID8gJ3N0YXJ0JyA6IG51bGwsIGxhYmVsRXh0cmEsIGlzUmVxdWlyZWQsIG5lY2Vzc2l0eUluZGljYXRvciA9ICdpY29uJywgaW5jbHVkZU5lY2Vzc2l0eUluZGljYXRvckluQWNjZXNzaWJpbGl0eU5hbWUgPSBmYWxzZSwgaHRtbEZvciwgZm9yOiBsYWJlbEZvciwgZWxlbWVudFR5cGU6IEVsZW1lbnRUeXBlID0gJ2xhYmVsJywgb25DbGljaywgLi4ub3RoZXJQcm9wcyB9ID0gcHJvcHM7XHJcbiAgICBsZXQgZG9tUmVmID0gdXNlRE9NUmVmKHJlZik7XHJcbiAgICBsZXQgbmVjZXNzaXR5TGFiZWwgPSBpc1JlcXVpcmVkID8gJyhyZXF1aXJlZCknIDogJyhvcHRpb25hbCknO1xyXG4gICAgbGV0IGljb24gPSAnKic7XHJcbiAgICBsZXQgbGFiZWxDbGFzc05hbWVzID0gY2xhc3NOYW1lcygnYWMtZmllbGQtbGFiZWwnLCB7XHJcbiAgICAgICAgJ2FjLWZpZWxkLWxhYmVsLS1wb3NpdGlvblNpZGUnOiBsYWJlbFBvc2l0aW9uID09PSAnc2lkZScsXHJcbiAgICAgICAgJ2FjLWZpZWxkLWxhYmVsLS1hbGlnbkVuZCc6IGxhYmVsQWxpZ24gPT09ICdlbmQnLFxyXG4gICAgfSk7XHJcbiAgICByZXR1cm4gKDxFbGVtZW50VHlwZSB7Li4uZmlsdGVyRE9NUHJvcHMob3RoZXJQcm9wcyl9IG9uQ2xpY2s9e29uQ2xpY2t9IHJlZj17ZG9tUmVmfSBjbGFzc05hbWU9e2xhYmVsQ2xhc3NOYW1lc30gaHRtbEZvcj17RWxlbWVudFR5cGUgPT09ICdsYWJlbCcgPyBsYWJlbEZvciB8fCBodG1sRm9yIDogdW5kZWZpbmVkfSBjc3M9e2NzcyBgXG4gICAgICAgIGZvbnQtc2l6ZTogJHt0aGVtZS50eXBvZ3JhcGh5LnNpemVzLnNtYWxsLmZvbnRTaXplfXB4O1xuICAgICAgICBsaW5lLWhlaWdodDogJHt0aGVtZS50eXBvZ3JhcGh5LnNpemVzLnNtYWxsLmxpbmVIZWlnaHR9cHg7XG4gICAgICAgIGZvbnQtd2VpZ2h0OiAke3RoZW1lLnR5cG9ncmFwaHkud2VpZ2h0cy5oZWF2eX07XG4gICAgICAgIGNvbG9yOiB2YXIoLS1hYy1nbG9iYWwtdGV4dC1jb2xvci05MDApO1xuICAgICAgICBwYWRkaW5nOiB2YXIoLS1hYy1nbG9iYWwtZGltZW5zaW9uLXN0YXRpYy1zaXplLTUwKSAwO1xuICAgICAgICBkaXNwbGF5OiBpbmxpbmUtZmxleDtcbiAgICAgICAgYWxpZ24taXRlbXM6IGNlbnRlcjtcbiAgICAgIGB9PlxuICAgICAge2NoaWxkcmVufVxuICAgICAgeyhuZWNlc3NpdHlJbmRpY2F0b3IgPT09ICdsYWJlbCcgfHxcclxuICAgICAgICAobmVjZXNzaXR5SW5kaWNhdG9yID09PSAnaWNvbicgJiYgaXNSZXF1aXJlZCkpICYmXHJcbiAgICAgICAgJyBcXHUyMDBiJ31cbiAgICAgIFxuICAgICAge25lY2Vzc2l0eUluZGljYXRvciA9PT0gJ2xhYmVsJyAmJiAoPHNwYW4gYXJpYS1oaWRkZW49eyFpbmNsdWRlTmVjZXNzaXR5SW5kaWNhdG9ySW5BY2Nlc3NpYmlsaXR5TmFtZVxyXG4gICAgICAgID8gaXNSZXF1aXJlZFxyXG4gICAgICAgIDogdW5kZWZpbmVkfT5cbiAgICAgICAgICB7bmVjZXNzaXR5TGFiZWx9XG4gICAgICAgIDwvc3Bhbj4pfVxuICAgICAge25lY2Vzc2l0eUluZGljYXRvciA9PT0gJ2ljb24nICYmIGlzUmVxdWlyZWQgJiYgaWNvbn1cbiAgICAgIHtsYWJlbEV4dHJhICYmICg8c3BhbiBjbGFzc05hbWU9XCJhYy1maWVsZC1sYWJlbF9fbGFiZWwtZXh0cmFcIiBjc3M9e2NzcyBgXG4gICAgICAgICAgICBtYXJnaW4tbGVmdDogdmFyKC0tYWMtZ2xvYmFsLWRpbWVuc2lvbi1zdGF0aWMtc2l6ZS01MCk7XG4gICAgICAgICAgICBkaXNwbGF5OiBpbmxpbmUtZmxleDtcbiAgICAgICAgICAgIGFsaWduLWl0ZW1zOiBjZW50ZXI7XG4gICAgICAgICAgYH0+XG4gICAgICAgICAge2xhYmVsRXh0cmF9XG4gICAgICAgIDwvc3Bhbj4pfVxuICAgIDwvRWxlbWVudFR5cGU+KTtcclxufVxyXG5sZXQgX0ZpZWxkTGFiZWwgPSBSZWFjdC5mb3J3YXJkUmVmKEZpZWxkTGFiZWwpO1xyXG5leHBvcnQgeyBfRmllbGRMYWJlbCBhcyBGaWVsZExhYmVsIH07XHJcbi8vIyBzb3VyY2VNYXBwaW5nVVJMPUZpZWxkTGFiZWwuanN4Lm1hcCJdfQ== */")
  }), children, (necessityIndicator === "label" || necessityIndicator === "icon" && isRequired) && " \u200B", necessityIndicator === "label" && jsx("span", {
    "aria-hidden": !includeNecessityIndicatorInAccessibilityName ? isRequired : void 0
  }, necessityLabel), necessityIndicator === "icon" && isRequired && icon, labelExtra && jsx("span", {
    className: "ac-field-label__label-extra",
    css: _ref$a
  }, labelExtra));
}
var _FieldLabel = /* @__PURE__ */ import_react35.default.forwardRef(FieldLabel);
var _excluded$j = ["children", "labelPosition", "labelAlign", "layout", "isRequired", "necessityIndicator", "isDisabled", "isReadOnly", "isQuiet"];
var FormContext = /* @__PURE__ */ import_react35.default.createContext({});
function useFormProps(props) {
  var ctx = (0, import_react35.useContext)(FormContext);
  return _extends2({}, ctx, props);
}
var formPropNames = /* @__PURE__ */ new Set(["action", "autoComplete", "encType", "method", "target", "onSubmit"]);
var formCSS = /* @__PURE__ */ css("&.ac-form--vertical{&>div,&{&>.ac-field:not(.ac-field--hasHelpText){margin-bottom:20px;}&>.ac-field{&>.ac-dropdown{width:100%;&>.ac-dropdown-button{width:100%;}}&>.ac-dropdown-button{width:100%;}}}}&.ac-form--inline{&>div,&{width:100%;display:inline-flex;flex-direction:row;align-items:baseline;flex-wrap:wrap;gap:0.5em;--ac-field-text-color-override:", theme.colors.arizeLightBlue, ";}}" + (false ? "" : ";label:formCSS;"), false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkZvcm0udHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQW1Cb0IiLCJmaWxlIjoiRm9ybS50c3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBjbGFzc05hbWVzLCB1c2VET01SZWYgfSBmcm9tICcuLi91dGlscyc7XHJcbmltcG9ydCB7IGZpbHRlckRPTVByb3BzIH0gZnJvbSAnQHJlYWN0LWFyaWEvdXRpbHMnO1xyXG5pbXBvcnQgUmVhY3QsIHsgdXNlQ29udGV4dCB9IGZyb20gJ3JlYWN0JztcclxuaW1wb3J0IHsgY3NzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xyXG5pbXBvcnQgeyBQcm92aWRlciB9IGZyb20gJy4uL3Byb3ZpZGVyJztcclxuaW1wb3J0IHRoZW1lIGZyb20gJy4uL3RoZW1lJztcclxubGV0IEZvcm1Db250ZXh0ID0gUmVhY3QuY3JlYXRlQ29udGV4dCh7fSk7XHJcbmV4cG9ydCBmdW5jdGlvbiB1c2VGb3JtUHJvcHMocHJvcHMpIHtcclxuICAgIGxldCBjdHggPSB1c2VDb250ZXh0KEZvcm1Db250ZXh0KTtcclxuICAgIHJldHVybiB7IC4uLmN0eCwgLi4ucHJvcHMgfTtcclxufVxyXG5jb25zdCBmb3JtUHJvcE5hbWVzID0gbmV3IFNldChbXHJcbiAgICAnYWN0aW9uJyxcclxuICAgICdhdXRvQ29tcGxldGUnLFxyXG4gICAgJ2VuY1R5cGUnLFxyXG4gICAgJ21ldGhvZCcsXHJcbiAgICAndGFyZ2V0JyxcclxuICAgICdvblN1Ym1pdCcsXHJcbl0pO1xyXG5jb25zdCBmb3JtQ1NTID0gY3NzIGBcbiAgLy8gVmVydGljYWwgbGF5b3V0IHN0eWxlXG4gICYuYWMtZm9ybS0tdmVydGljYWwge1xuICAgICYgPiBkaXYsXG4gICAgJiB7XG4gICAgICAmID4gLmFjLWZpZWxkOm5vdCguYWMtZmllbGQtLWhhc0hlbHBUZXh0KSB7XG4gICAgICAgIG1hcmdpbi1ib3R0b206IDIwcHg7XG4gICAgICB9XG4gICAgICAmID4gLmFjLWZpZWxkIHtcbiAgICAgICAgJiA+IC5hYy1kcm9wZG93biB7XG4gICAgICAgICAgd2lkdGg6IDEwMCU7XG4gICAgICAgICAgJiA+IC5hYy1kcm9wZG93bi1idXR0b24ge1xuICAgICAgICAgICAgd2lkdGg6IDEwMCU7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgICYgPiAuYWMtZHJvcGRvd24tYnV0dG9uIHtcbiAgICAgICAgICB3aWR0aDogMTAwJTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH1cbiAgfVxuICAvLyBJbmxpbmUgbGF5b3V0IHN0eWxlXG4gICYuYWMtZm9ybS0taW5saW5lIHtcbiAgICAmID4gZGl2LFxuICAgICYge1xuICAgICAgd2lkdGg6IDEwMCU7XG4gICAgICBkaXNwbGF5OiBpbmxpbmUtZmxleDtcbiAgICAgIGZsZXgtZGlyZWN0aW9uOiByb3c7XG4gICAgICBhbGlnbi1pdGVtczogYmFzZWxpbmU7XG4gICAgICBmbGV4LXdyYXA6IHdyYXA7XG4gICAgICBnYXA6IDAuNWVtO1xuXG4gICAgICAtLWFjLWZpZWxkLXRleHQtY29sb3Itb3ZlcnJpZGU6ICR7dGhlbWUuY29sb3JzLmFyaXplTGlnaHRCbHVlfTtcbiAgICB9XG4gIH1cbmA7XHJcbmZ1bmN0aW9uIEZvcm0ocHJvcHMsIHJlZikge1xyXG4gICAgbGV0IHsgY2hpbGRyZW4sIGxhYmVsUG9zaXRpb24gPSAndG9wJywgbGFiZWxBbGlnbiA9ICdzdGFydCcsIGxheW91dCA9ICd2ZXJ0aWNhbCcsIGlzUmVxdWlyZWQsIG5lY2Vzc2l0eUluZGljYXRvciwgaXNEaXNhYmxlZCwgaXNSZWFkT25seSwgaXNRdWlldCwgLi4ub3RoZXJQcm9wcyB9ID0gcHJvcHM7XHJcbiAgICBsZXQgZG9tUmVmID0gdXNlRE9NUmVmKHJlZik7XHJcbiAgICBsZXQgY3R4ID0ge1xyXG4gICAgICAgIGxhYmVsUG9zaXRpb24sXHJcbiAgICAgICAgbGFiZWxBbGlnbixcclxuICAgICAgICBuZWNlc3NpdHlJbmRpY2F0b3IsXHJcbiAgICB9O1xyXG4gICAgcmV0dXJuICg8Zm9ybSB7Li4uZmlsdGVyRE9NUHJvcHMob3RoZXJQcm9wcywge1xyXG4gICAgICAgIGxhYmVsYWJsZTogdHJ1ZSxcclxuICAgICAgICBwcm9wTmFtZXM6IGZvcm1Qcm9wTmFtZXMsXHJcbiAgICB9KX0gbm9WYWxpZGF0ZSByZWY9e2RvbVJlZn0gY2xhc3NOYW1lPXtjbGFzc05hbWVzKCdhYy1mb3JtJywge1xyXG4gICAgICAgICdhYy1mb3JtLS1wb3NpdGlvblNpZGUnOiBsYWJlbFBvc2l0aW9uID09PSAnc2lkZScsXHJcbiAgICAgICAgJ2FjLWZvcm0tLXBvc2l0aW9uVG9wJzogbGFiZWxQb3NpdGlvbiA9PT0gJ3RvcCcsXHJcbiAgICAgICAgJ2FjLWZvcm0tLXZlcnRpY2FsJzogbGF5b3V0ID09PSAndmVydGljYWwnLFxyXG4gICAgICAgICdhYy1mb3JtLS1pbmxpbmUnOiBsYXlvdXQgIT09ICd2ZXJ0aWNhbCcsXHJcbiAgICB9KX0gY3NzPXtmb3JtQ1NTfT5cbiAgICAgIDxGb3JtQ29udGV4dC5Qcm92aWRlciB2YWx1ZT17Y3R4fT5cbiAgICAgICAgPFByb3ZpZGVyIGlzUXVpZXQ9e2lzUXVpZXR9IGlzRGlzYWJsZWQ9e2lzRGlzYWJsZWR9IGlzUmVhZE9ubHk9e2lzUmVhZE9ubHl9PlxuICAgICAgICAgIHtjaGlsZHJlbn1cbiAgICAgICAgPC9Qcm92aWRlcj5cbiAgICAgIDwvRm9ybUNvbnRleHQuUHJvdmlkZXI+XG4gICAgPC9mb3JtPik7XHJcbn1cclxuLyoqXHJcbiAqIEZvcm1zIGFsbG93IHVzZXJzIHRvIGVudGVyIGRhdGEgdGhhdCBjYW4gYmUgc3VibWl0dGVkIHdoaWxlIHByb3ZpZGluZyBhbGlnbm1lbnQgYW5kIHN0eWxpbmcgZm9yIGZvcm0gZmllbGRzLlxyXG4gKi9cclxuY29uc3QgX0Zvcm0gPSBSZWFjdC5mb3J3YXJkUmVmKEZvcm0pO1xyXG5leHBvcnQgeyBfRm9ybSBhcyBGb3JtIH07XHJcbi8vIyBzb3VyY2VNYXBwaW5nVVJMPUZvcm0uanN4Lm1hcCJdfQ== */");
function Form(props, ref) {
  var children = props.children, _props$labelPosition = props.labelPosition, labelPosition = _props$labelPosition === void 0 ? "top" : _props$labelPosition, _props$labelAlign = props.labelAlign, labelAlign = _props$labelAlign === void 0 ? "start" : _props$labelAlign, _props$layout = props.layout, layout = _props$layout === void 0 ? "vertical" : _props$layout, necessityIndicator = props.necessityIndicator, isDisabled = props.isDisabled, isReadOnly = props.isReadOnly, isQuiet = props.isQuiet, otherProps = _objectWithoutPropertiesLoose2(props, _excluded$j);
  var domRef = useDOMRef(ref);
  var ctx = {
    labelPosition,
    labelAlign,
    necessityIndicator
  };
  return jsx("form", _extends2({}, $65484d02dcb7eb3e$export$457c3d6518dd4c6f(otherProps, {
    labelable: true,
    propNames: formPropNames
  }), {
    noValidate: true,
    ref: domRef,
    className: clsx_m_default("ac-form", {
      "ac-form--positionSide": labelPosition === "side",
      "ac-form--positionTop": labelPosition === "top",
      "ac-form--vertical": layout === "vertical",
      "ac-form--inline": layout !== "vertical"
    }),
    css: formCSS
  }), jsx(FormContext.Provider, {
    value: ctx
  }, jsx(Provider, {
    isQuiet,
    isDisabled,
    isReadOnly
  }, children)));
}
var _Form = /* @__PURE__ */ import_react35.default.forwardRef(Form);
var _templateObject$2;
var appearKeyframes = /* @__PURE__ */ keyframes(_templateObject$2 || (_templateObject$2 = /* @__PURE__ */ _taggedTemplateLiteralLoose2(["\n    0% {  opacity: 0; }\n    100% { opacity: 1; }\n"])));
function Field(props, ref) {
  props = useFormProps(props);
  var _props = props, label = _props.label, labelExtra = _props.labelExtra, _props$labelPosition = _props.labelPosition, labelPosition = _props$labelPosition === void 0 ? "top" : _props$labelPosition, labelAlign = _props.labelAlign, isRequired = _props.isRequired, necessityIndicator = _props.necessityIndicator, includeNecessityIndicatorInAccessibilityName = _props.includeNecessityIndicatorInAccessibilityName, validationState = _props.validationState, description = _props.description, errorMessage = _props.errorMessage, isDisabled = _props.isDisabled, showErrorIcon = _props.showErrorIcon, children = _props.children, labelProps = _props.labelProps, _props$descriptionPro = _props.descriptionProps, descriptionProps = _props$descriptionPro === void 0 ? {} : _props$descriptionPro, _props$errorMessagePr = _props.errorMessageProps, errorMessageProps = _props$errorMessagePr === void 0 ? {} : _props$errorMessagePr, elementType = _props.elementType, wrapperClassName = _props.wrapperClassName;
  var hasHelpText = !!description || errorMessage && validationState === "invalid";
  var labelWrapperClass = clsx_m_default("ac-field", {
    "ac-field--positionTop": labelPosition === "top",
    "ac-field--positionSide": labelPosition === "side",
    "ac-field--hasHelpText": hasHelpText
  }, wrapperClassName);
  children = import_react35.default.cloneElement(
    children,
    // @ts-ignore
    $3ef42575df84b30b$export$9d1611c77c2fe928(children.props, {
      className: "ac-field__field"
    })
  );
  var renderHelpText = function renderHelpText2() {
    return jsx(_HelpText, {
      descriptionProps,
      errorMessageProps,
      description,
      errorMessage,
      validationState,
      isDisabled,
      showErrorIcon
    });
  };
  return jsx("div", {
    ref,
    className: labelWrapperClass,
    css: /* @__PURE__ */ css("display:flex;flex-direction:column;align-items:flex-start;.ac-help-text--danger{animation:", appearKeyframes, " ", 0.3, "s forwards ease-in-out;}" + (false ? "" : ";label:Field;"), false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkZpZWxkLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUE4QmtFIiwiZmlsZSI6IkZpZWxkLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGNzcywga2V5ZnJhbWVzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xyXG5pbXBvcnQgeyBjbGFzc05hbWVzIH0gZnJvbSAnLi4vdXRpbHMnO1xyXG5pbXBvcnQgeyBIZWxwVGV4dCB9IGZyb20gJy4vSGVscFRleHQnO1xyXG5pbXBvcnQgeyBGaWVsZExhYmVsIH0gZnJvbSAnLi9GaWVsZExhYmVsJztcclxuaW1wb3J0IHsgbWVyZ2VQcm9wcyB9IGZyb20gJ0ByZWFjdC1hcmlhL3V0aWxzJztcclxuaW1wb3J0IFJlYWN0IGZyb20gJ3JlYWN0JztcclxuaW1wb3J0IHsgdXNlRm9ybVByb3BzIH0gZnJvbSAnLi4vZm9ybSc7XHJcbmNvbnN0IGFwcGVhcktleWZyYW1lcyA9IGtleWZyYW1lcyBgXG4gICAgMCUgeyAgb3BhY2l0eTogMDsgfVxuICAgIDEwMCUgeyBvcGFjaXR5OiAxOyB9XG5gO1xyXG5mdW5jdGlvbiBGaWVsZChwcm9wcywgcmVmKSB7XHJcbiAgICBwcm9wcyA9IHVzZUZvcm1Qcm9wcyhwcm9wcyk7XHJcbiAgICBsZXQgeyBsYWJlbCwgbGFiZWxFeHRyYSwgbGFiZWxQb3NpdGlvbiA9ICd0b3AnLCBsYWJlbEFsaWduLCBpc1JlcXVpcmVkLCBuZWNlc3NpdHlJbmRpY2F0b3IsIGluY2x1ZGVOZWNlc3NpdHlJbmRpY2F0b3JJbkFjY2Vzc2liaWxpdHlOYW1lLCB2YWxpZGF0aW9uU3RhdGUsIGRlc2NyaXB0aW9uLCBlcnJvck1lc3NhZ2UsIGlzRGlzYWJsZWQsIHNob3dFcnJvckljb24sIGNoaWxkcmVuLCBsYWJlbFByb3BzLCBcclxuICAgIC8vIE5vdCBldmVyeSBjb21wb25lbnQgdGhhdCB1c2VzIDxGaWVsZD4gc3VwcG9ydHMgaGVscCB0ZXh0LlxyXG4gICAgZGVzY3JpcHRpb25Qcm9wcyA9IHt9LCBlcnJvck1lc3NhZ2VQcm9wcyA9IHt9LCBlbGVtZW50VHlwZSwgd3JhcHBlckNsYXNzTmFtZSwgfSA9IHByb3BzO1xyXG4gICAgbGV0IGhhc0hlbHBUZXh0ID0gISFkZXNjcmlwdGlvbiB8fCAoZXJyb3JNZXNzYWdlICYmIHZhbGlkYXRpb25TdGF0ZSA9PT0gJ2ludmFsaWQnKTtcclxuICAgIGxldCBsYWJlbFdyYXBwZXJDbGFzcyA9IGNsYXNzTmFtZXMoJ2FjLWZpZWxkJywge1xyXG4gICAgICAgICdhYy1maWVsZC0tcG9zaXRpb25Ub3AnOiBsYWJlbFBvc2l0aW9uID09PSAndG9wJyxcclxuICAgICAgICAnYWMtZmllbGQtLXBvc2l0aW9uU2lkZSc6IGxhYmVsUG9zaXRpb24gPT09ICdzaWRlJyxcclxuICAgICAgICAnYWMtZmllbGQtLWhhc0hlbHBUZXh0JzogaGFzSGVscFRleHQsXHJcbiAgICB9LCB3cmFwcGVyQ2xhc3NOYW1lKTtcclxuICAgIGNoaWxkcmVuID0gUmVhY3QuY2xvbmVFbGVtZW50KGNoaWxkcmVuLCBcclxuICAgIC8vIEB0cy1pZ25vcmVcclxuICAgIG1lcmdlUHJvcHMoY2hpbGRyZW4ucHJvcHMsIHtcclxuICAgICAgICBjbGFzc05hbWU6ICdhYy1maWVsZF9fZmllbGQnLFxyXG4gICAgfSkpO1xyXG4gICAgbGV0IHJlbmRlckhlbHBUZXh0ID0gKCkgPT4gKDxIZWxwVGV4dCBkZXNjcmlwdGlvblByb3BzPXtkZXNjcmlwdGlvblByb3BzfSBlcnJvck1lc3NhZ2VQcm9wcz17ZXJyb3JNZXNzYWdlUHJvcHN9IGRlc2NyaXB0aW9uPXtkZXNjcmlwdGlvbn0gZXJyb3JNZXNzYWdlPXtlcnJvck1lc3NhZ2V9IHZhbGlkYXRpb25TdGF0ZT17dmFsaWRhdGlvblN0YXRlfSBpc0Rpc2FibGVkPXtpc0Rpc2FibGVkfSBcclxuICAgIC8vIGxhYmVsQWxpZ249e2xhYmVsQWxpZ259IFRPRE8gc3VwcG9ydCBkaWZmZXJlbnQgYWxpZ25tZW50c1xyXG4gICAgc2hvd0Vycm9ySWNvbj17c2hvd0Vycm9ySWNvbn0vPik7XHJcbiAgICByZXR1cm4gKDxkaXYgcmVmPXtyZWZ9IGNsYXNzTmFtZT17bGFiZWxXcmFwcGVyQ2xhc3N9IGNzcz17Y3NzIGBcbiAgICAgICAgLyogRm9yIG5vdyBhc3N1bWUgdmVydGljYWwgYWxpZ25tZW50IG9mIGxhYmVscyAqL1xuICAgICAgICBkaXNwbGF5OiBmbGV4O1xuICAgICAgICBmbGV4LWRpcmVjdGlvbjogY29sdW1uO1xuICAgICAgICBhbGlnbi1pdGVtczogZmxleC1zdGFydDtcbiAgICAgICAgLmFjLWhlbHAtdGV4dC0tZGFuZ2VyIHtcbiAgICAgICAgICAvKiBBbmltYXRlIGluIHRoZSBoZWxwIHRleHQgKi9cbiAgICAgICAgICBhbmltYXRpb246ICR7YXBwZWFyS2V5ZnJhbWVzfSAkezAuM31zIGZvcndhcmRzIGVhc2UtaW4tb3V0O1xuICAgICAgICB9XG4gICAgICBgfT5cbiAgICAgIHtsYWJlbCAmJiAoPEZpZWxkTGFiZWwgey4uLmxhYmVsUHJvcHN9IGxhYmVsUG9zaXRpb249e2xhYmVsUG9zaXRpb259IGxhYmVsQWxpZ249e2xhYmVsQWxpZ259IGxhYmVsRXh0cmE9e2xhYmVsRXh0cmF9IGlzUmVxdWlyZWQ9e2lzUmVxdWlyZWR9IG5lY2Vzc2l0eUluZGljYXRvcj17bmVjZXNzaXR5SW5kaWNhdG9yfSBpbmNsdWRlTmVjZXNzaXR5SW5kaWNhdG9ySW5BY2Nlc3NpYmlsaXR5TmFtZT17aW5jbHVkZU5lY2Vzc2l0eUluZGljYXRvckluQWNjZXNzaWJpbGl0eU5hbWV9IGVsZW1lbnRUeXBlPXtlbGVtZW50VHlwZX0+XG4gICAgICAgICAge2xhYmVsfVxuICAgICAgICA8L0ZpZWxkTGFiZWw+KX1cbiAgICAgIHtjaGlsZHJlbn1cbiAgICAgIHtoYXNIZWxwVGV4dCAmJiByZW5kZXJIZWxwVGV4dCgpfVxuICAgIDwvZGl2Pik7XHJcbn1cclxuLy8gQHRzLWlnbm9yZVxyXG5sZXQgX0ZpZWxkID0gUmVhY3QuZm9yd2FyZFJlZihGaWVsZCk7XHJcbmV4cG9ydCB7IF9GaWVsZCBhcyBGaWVsZCB9O1xyXG4vLyMgc291cmNlTWFwcGluZ1VSTD1GaWVsZC5qc3gubWFwIl19 */")
  }, label && jsx(_FieldLabel, _extends2({}, labelProps, {
    labelPosition,
    labelAlign,
    labelExtra,
    isRequired,
    necessityIndicator,
    includeNecessityIndicatorInAccessibilityName,
    elementType
  }), label), children, hasHelpText && renderHelpText());
}
var _Field = /* @__PURE__ */ import_react35.default.forwardRef(Field);
var addonBeforeCSS = /* @__PURE__ */ css("background-color:var(--ac-global-color-grey-300);padding:0 var(--ac-global-dimension-static-size-100);flex:none;box-sizing:border-box;height:", theme.singleLineHeight, "px;display:flex;align-items:center;" + (false ? "" : ";label:addonBeforeCSS;"), false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkFkZG9uLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFJMkIiLCJmaWxlIjoiQWRkb24udHN4Iiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IFJlYWN0IGZyb20gJ3JlYWN0JztcclxuaW1wb3J0IHsgY3NzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xyXG5pbXBvcnQgdGhlbWUgZnJvbSAnLi4vdGhlbWUnO1xyXG5pbXBvcnQgeyBUZXh0IH0gZnJvbSAnLi4vY29udGVudC9UZXh0JztcclxuY29uc3QgYWRkb25CZWZvcmVDU1MgPSBjc3MgYFxuICBiYWNrZ3JvdW5kLWNvbG9yOiB2YXIoLS1hYy1nbG9iYWwtY29sb3ItZ3JleS0zMDApO1xuICBwYWRkaW5nOiAwIHZhcigtLWFjLWdsb2JhbC1kaW1lbnNpb24tc3RhdGljLXNpemUtMTAwKTtcbiAgZmxleDogbm9uZTtcbiAgYm94LXNpemluZzogYm9yZGVyLWJveDtcbiAgaGVpZ2h0OiAke3RoZW1lLnNpbmdsZUxpbmVIZWlnaHR9cHg7XG4gIGRpc3BsYXk6IGZsZXg7XG4gIGFsaWduLWl0ZW1zOiBjZW50ZXI7XG5gO1xyXG4vKipcclxuICogQSBsYWJlbCBlbGVtZW50IHRoYXQgZGVzY3JpYmVzIGEgYnV0dG9uIG9yIGFuIGlucHV0IGZpZWxkXHJcbiAqL1xyXG5leHBvcnQgZnVuY3Rpb24gQWRkb25CZWZvcmUoeyBjaGlsZHJlbiB9KSB7XHJcbiAgICByZXR1cm4gKDxkaXYgY3NzPXthZGRvbkJlZm9yZUNTU30gY2xhc3NOYW1lPVwiYWMtYWRkb24gYWMtYWRkb24tLWJlZm9yZVwiPlxuICAgICAgPFRleHQgdGV4dFNpemU9XCJtZWRpdW1cIiB3ZWlnaHQ9XCJoZWF2eVwiIGNvbG9yPVwidGV4dC03MDBcIj5cbiAgICAgICAge2NoaWxkcmVufVxuICAgICAgPC9UZXh0PlxuICAgIDwvZGl2Pik7XHJcbn1cclxuLy8jIHNvdXJjZU1hcHBpbmdVUkw9QWRkb24uanN4Lm1hcCJdfQ== */");
function AddonBefore(_ref18) {
  var children = _ref18.children;
  return jsx("div", {
    css: addonBeforeCSS,
    className: "ac-addon ac-addon--before"
  }, jsx(_Text, {
    textSize: "medium",
    weight: "heavy",
    color: "text-700"
  }, children));
}
function FieldColorDesignation(props) {
  var children = props.children, color2 = props.color;
  var colorVariable = "--ac-global-color-designation-turquoise";
  switch (color2) {
    case "designationTurquoise":
      colorVariable = "--ac-global-color-designation-turquoise";
      break;
    case "designationPurple":
      colorVariable = "--ac-global-color-designation-purple";
      break;
    default:
      assertUnreachable();
  }
  return jsx("div", {
    css: /* @__PURE__ */ css("--ac-field-border-color-override:var(", colorVariable, ");" + (false ? "" : ";label:FieldColorDesignation;"), false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkZpZWxkQ29sb3JEZXNpZ25hdGlvbi50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBZ0IwQiIsImZpbGUiOiJGaWVsZENvbG9yRGVzaWduYXRpb24udHN4Iiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgY3NzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xyXG5pbXBvcnQgUmVhY3QgZnJvbSAncmVhY3QnO1xyXG5pbXBvcnQgeyBhc3NlcnRVbnJlYWNoYWJsZSB9IGZyb20gJy4uL3V0aWxzL3R5cGVVdGlscyc7XHJcbmV4cG9ydCBmdW5jdGlvbiBGaWVsZENvbG9yRGVzaWduYXRpb24ocHJvcHMpIHtcclxuICAgIGNvbnN0IHsgY2hpbGRyZW4sIGNvbG9yIH0gPSBwcm9wcztcclxuICAgIGxldCBjb2xvclZhcmlhYmxlID0gYC0tYWMtZ2xvYmFsLWNvbG9yLWRlc2lnbmF0aW9uLXR1cnF1b2lzZWA7XHJcbiAgICBzd2l0Y2ggKGNvbG9yKSB7XHJcbiAgICAgICAgY2FzZSAnZGVzaWduYXRpb25UdXJxdW9pc2UnOlxyXG4gICAgICAgICAgICBjb2xvclZhcmlhYmxlID0gYC0tYWMtZ2xvYmFsLWNvbG9yLWRlc2lnbmF0aW9uLXR1cnF1b2lzZWA7XHJcbiAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgIGNhc2UgJ2Rlc2lnbmF0aW9uUHVycGxlJzpcclxuICAgICAgICAgICAgY29sb3JWYXJpYWJsZSA9IGAtLWFjLWdsb2JhbC1jb2xvci1kZXNpZ25hdGlvbi1wdXJwbGVgO1xyXG4gICAgICAgICAgICBicmVhaztcclxuICAgICAgICBkZWZhdWx0OlxyXG4gICAgICAgICAgICBhc3NlcnRVbnJlYWNoYWJsZShjb2xvcik7XHJcbiAgICB9XHJcbiAgICByZXR1cm4gKDxkaXYgY3NzPXtjc3MgYFxuICAgICAgICAtLWFjLWZpZWxkLWJvcmRlci1jb2xvci1vdmVycmlkZTogdmFyKCR7Y29sb3JWYXJpYWJsZX0pO1xuICAgICAgYH0+XG4gICAgICB7Y2hpbGRyZW59XG4gICAgPC9kaXY+KTtcclxufVxyXG4vLyMgc291cmNlTWFwcGluZ1VSTD1GaWVsZENvbG9yRGVzaWduYXRpb24uanN4Lm1hcCJdfQ== */")
  }, children);
}
var _excluded$k = ["isQuiet", "isDisabled", "isActive", "children", "style", "addonBefore", "validationState"];
var _templateObject$3;
function _EMOTION_STRINGIFIED_CSS_ERROR__$k() {
  return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
}
var appearKeyframes$1 = /* @__PURE__ */ keyframes(_templateObject$3 || (_templateObject$3 = /* @__PURE__ */ _taggedTemplateLiteralLoose2(["\n    0% {  opacity: 0; }\n    100% { opacity: 1; }\n"])));
var buttonBaseCSS = /* @__PURE__ */ css("border:none;background-color:transparent;color:var(--ac-global-text-color-900);display:flex;justify-content:center;align-items:center;padding:0;overflow:hidden;cursor:pointer;transition:all 0.2s ease-in-out;outline:none;.ac-dropdown-button__text{flex:1 1 auto;text-align:left;display:inline-block;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;color:var(--ac-field-text-color-override, var(--ac-global-text-color-900));}.ac-dropdown-button__dropdown-icon{margin:10px 0 10px 10px;flex:fixed;width:16px;height:16px;font-size:16px;}--ac-validation-icon-width:var(--ac-global-dimension-size-300);.ac-dropdown-button__validation-icon{margin:0 0 0 10px;}&[disabled]{opacity:", theme.opacity.disabled, ";}.ac-dropdown-button__validation-icon{animation:", appearKeyframes$1, " ", 0.2, "s forwards ease-in-out;top:var(--ac-global-dimension-static-size-100);right:0;&.ac-dropdown-button__validation-icon--invalid{color:var(--ac-global-color-danger);}}&.ac-dropdown-button>.ac-dropdown-button__text{padding-right:calc(\n      var(--ac-global-dimension-static-size-100) +\n        var(--ac-validation-icon-width)\n    );}&.ac-dropdown-button--invalid>.ac-dropdown-button__text{padding-right:0;}" + (false ? "" : ";label:buttonBaseCSS;"), false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */");
var quietButtonCSS$1 = /* @__PURE__ */ css("--ac-dropdown-button-border-color:var(--ac-global-border-color-default);border-left:1px solid transparent;border-right:1px solid transparent;border-top:1px solid transparent;border-bottom:1px solid var(\n      --ac-field-border-color-override,\n      var(--ac-dropdown-button-border-color)\n    );margin:var(--ac-global-dimension-static-size-100) 0 var(--ac-global-dimension-static-size-100) 0;&.is-hovered{border-bottom:1px solid var(--ac-global-color-grey-500);}&.is-active,&:focus{border-bottom:1px solid var(--ac-global-color-primary);}&[disabled]{cursor:default;border-bottom:1px solid ", theme.components.dropdown.borderColor, ";}&.ac-dropdown-button--invalid{border-bottom-color:var(--ac-global-color-danger);div.ac-dropdown__content{color:var(--ac-global-color-danger);}}" + (false ? "" : ";label:quietButtonCSS;"), false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */");
var nonQuietButtonCSS = /* @__PURE__ */ css("min-width:200px;padding:0 var(--ac-global-dimension-static-size-100) 0 0;--ac-dropdown-button-border-color:var(--ac-global-input-field-border-color);border:1px solid var(\n      --ac-field-border-color-override,\n      var(--ac-dropdown-button-border-color)\n    );border-radius:", theme.borderRadius.medium, "px;background-color:var(--ac-global-input-field-background-color);&.is-hovered{border:1px solid var(--ac-global-input-field-border-color-hover);background-color:var(--ac-global-input-field-background-color-active);}&.is-active,&:focus{border:1px solid var(--ac-global-input-field-border-color-active);background-color:var(--ac-global-input-field-background-color-active);}&[disabled]{cursor:default;border:1px solid ", theme.components.dropdown.borderColor, ";}.ac-dropdown-button__text{margin:var(--ac-global-dimension-static-size-100) var(--ac-global-dimension-static-size-100) var(--ac-global-dimension-static-size-100) var(--ac-global-dimension-static-size-200);}&.ac-dropdown-button--invalid{border:1px solid var(--ac-global-color-danger);div.ac-dropdown__content{color:var(--ac-global-color-danger);}}&.ac-dropdown-button--invalid>div.ac-dropdown__content{padding-right:", theme.spacing.padding8 + 24 + theme.spacing.padding4, "px;}" + (false ? "" : ";label:nonQuietButtonCSS;"), false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */");
var _ref$b = false ? {
  name: "ludkcy",
  styles: "color:var(\n              --ac-field-text-color-override,\n              var(--ac-global-text-color-900)\n            )"
} : {
  name: "7yhi27-DropdownButton",
  styles: "color:var(\n              --ac-field-text-color-override,\n              var(--ac-global-text-color-900)\n            );label:DropdownButton;",
  map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */",
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__$k
};
function DropdownButton(props, ref) {
  var domRef = useFocusableRef(ref);
  var _props$isQuiet = props.isQuiet, isQuiet = _props$isQuiet === void 0 ? false : _props$isQuiet, isDisabled = props.isDisabled, isActive = props.isActive, children = props.children, style = props.style, addonBefore = props.addonBefore, validationState = props.validationState, otherProps = _objectWithoutPropertiesLoose2(props, _excluded$k);
  var _useButton = $701a24aa0da5b062$export$ea18c227d4417cc3(props, domRef), buttonProps = _useButton.buttonProps, isPressed = _useButton.isPressed;
  var _useHover = $6179b936705e76d3$export$ae780daf29e6d456({
    isDisabled
  }), hoverProps = _useHover.hoverProps, isHovered = _useHover.isHovered;
  var isInvalid = validationState === "invalid";
  var validation = jsx(Icon, {
    key: "validation-icon",
    className: "ac-dropdown-button__validation-icon ac-dropdown-button__validation-icon--" + validationState,
    svg: jsx(AlertCircleOutline, null)
  });
  return jsx($907718708eab68af$export$1a38b4ad7f578e1d, {
    focusRingClass: "focus-ring"
  }, jsx("button", _extends2({}, $3ef42575df84b30b$export$9d1611c77c2fe928(buttonProps, hoverProps, otherProps), {
    ref: domRef,
    className: clsx_m_default("ac-dropdown-button", {
      "ac-dropdown-button--quiet": isQuiet,
      "is-active": isActive || isPressed,
      "is-disabled": isDisabled,
      "is-hovered": isHovered,
      "ac-dropdown-button--invalid": isInvalid,
      "ac-dropdown-button--valid": validationState === "valid"
    }),
    style,
    css: /* @__PURE__ */ css(buttonBaseCSS, textSizeCSS("medium"), isQuiet ? quietButtonCSS$1 : nonQuietButtonCSS, false ? "" : ";label:DropdownButton;", false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */")
  }), addonBefore != null ? jsx(AddonBefore, null, addonBefore) : null, jsx("span", {
    className: "ac-dropdown-button__text",
    css: _ref$b
  }, children), validationState && validationState === "invalid" ? validation : null, jsx(Icon, {
    className: "ac-dropdown-button__dropdown-icon",
    svg: jsx(ArrowIosDownwardOutline, null)
  })));
}
var _DropdownButton = /* @__PURE__ */ import_react35.default.forwardRef(DropdownButton);
function DropdownMenu(_ref22, _ref18) {
  var children = _ref22.children, _ref2$isPadded = _ref22.isPadded, isPadded = _ref2$isPadded === void 0 ? false : _ref2$isPadded, style = _ref22.style;
  return jsx("div", {
    css: /* @__PURE__ */ css("background-color:var(--ac-global-menu-background-color);border-radius:var(--ac-global-rounding-small);color:var(--ac-global-text-color-900);padding:", isPadded ? theme.spacing.padding8 : 0, "px;box-shadow:0px 4px 10px rgba(0, 0, 0, 0.4);border:1px solid var(--ac-global-menu-border-color);max-height:inherit;" + (false ? "" : ";label:DropdownMenu;"), false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkRyb3Bkb3duTWVudS50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBSTBCIiwiZmlsZSI6IkRyb3Bkb3duTWVudS50c3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgUmVhY3QgZnJvbSAncmVhY3QnO1xyXG5pbXBvcnQgeyBjc3MgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XHJcbmltcG9ydCB0aGVtZSBmcm9tICcuLi90aGVtZSc7XHJcbmZ1bmN0aW9uIERyb3Bkb3duTWVudSh7IGNoaWxkcmVuLCBpc1BhZGRlZCA9IGZhbHNlLCBzdHlsZSB9LCBfcmVmKSB7XHJcbiAgICByZXR1cm4gKDxkaXYgY3NzPXtjc3MgYFxuICAgICAgICBiYWNrZ3JvdW5kLWNvbG9yOiB2YXIoLS1hYy1nbG9iYWwtbWVudS1iYWNrZ3JvdW5kLWNvbG9yKTtcbiAgICAgICAgYm9yZGVyLXJhZGl1czogdmFyKC0tYWMtZ2xvYmFsLXJvdW5kaW5nLXNtYWxsKTtcbiAgICAgICAgY29sb3I6IHZhcigtLWFjLWdsb2JhbC10ZXh0LWNvbG9yLTkwMCk7XG4gICAgICAgIHBhZGRpbmc6ICR7aXNQYWRkZWQgPyB0aGVtZS5zcGFjaW5nLnBhZGRpbmc4IDogMH1weDtcbiAgICAgICAgYm94LXNoYWRvdzogMHB4IDRweCAxMHB4IHJnYmEoMCwgMCwgMCwgMC40KTtcbiAgICAgICAgYm9yZGVyOiAxcHggc29saWQgdmFyKC0tYWMtZ2xvYmFsLW1lbnUtYm9yZGVyLWNvbG9yKTtcbiAgICAgICAgbWF4LWhlaWdodDogaW5oZXJpdDtcbiAgICAgIGB9IHN0eWxlPXtzdHlsZX0+XG4gICAgICB7Y2hpbGRyZW59XG4gICAgPC9kaXY+KTtcclxufVxyXG4vKipcclxuICogTWVudXMgZGlzcGxheSBhIGxpc3Qgb2YgYWN0aW9ucyBvciBvcHRpb25zIHRoYXQgYSB1c2VyIGNhbiBjaG9vc2UuXHJcbiAqL1xyXG4vLyBmb3J3YXJkUmVmIGRvZXNuJ3Qgc3VwcG9ydCBnZW5lcmljIHBhcmFtZXRlcnMsIHNvIGNhc3QgdGhlIHJlc3VsdCB0byB0aGUgY29ycmVjdCB0eXBlXHJcbi8vIGh0dHBzOi8vc3RhY2tvdmVyZmxvdy5jb20vcXVlc3Rpb25zLzU4NDY5MjI5L3JlYWN0LXdpdGgtdHlwZXNjcmlwdC1nZW5lcmljcy13aGlsZS11c2luZy1yZWFjdC1mb3J3YXJkcmVmXHJcbmNvbnN0IF9Ecm9wZG93bk1lbnUgPSBSZWFjdC5mb3J3YXJkUmVmKERyb3Bkb3duTWVudSk7XHJcbmV4cG9ydCB7IF9Ecm9wZG93bk1lbnUgYXMgRHJvcGRvd25NZW51IH07XHJcbi8vIyBzb3VyY2VNYXBwaW5nVVJMPURyb3Bkb3duTWVudS5qc3gubWFwIl19 */"),
    style
  }, children);
}
var _DropdownMenu = /* @__PURE__ */ import_react35.default.forwardRef(DropdownMenu);
var _excluded$l = ["menu", "children", "triggerProps", "isQuiet", "isDisabled", "buttonProps"];
function Dropdown(props) {
  props = useProviderProps(props);
  var _props = props, menu = _props.menu, children = _props.children, _props$triggerProps = _props.triggerProps, triggerProps = _props$triggerProps === void 0 ? {
    placement: "bottom left"
  } : _props$triggerProps, _props$isQuiet = _props.isQuiet, isQuiet = _props$isQuiet === void 0 ? false : _props$isQuiet, isDisabled = _props.isDisabled, buttonProps = _props.buttonProps, otherProps = _objectWithoutPropertiesLoose2(_props, _excluded$l);
  buttonProps = _extends2({}, buttonProps, {
    isDisabled,
    isQuiet
  });
  var triggerRef = (0, import_react35.useRef)(null);
  var unwrappedTriggerRef = useUnwrapDOMRef(triggerRef);
  var _useState = (0, import_react35.useState)(), buttonWidth = _useState[0], setButtonWidth = _useState[1];
  var onResize = (0, import_react35.useCallback)(function() {
    if (unwrappedTriggerRef.current) {
      var width = unwrappedTriggerRef.current.offsetWidth;
      setButtonWidth(width);
    }
  }, [unwrappedTriggerRef, setButtonWidth]);
  $9daab02d461809db$export$683480f191c0e3ea({
    ref: unwrappedTriggerRef,
    onResize
  });
  var menuStyle = {
    minWidth: buttonWidth
  };
  var domProps = $65484d02dcb7eb3e$export$457c3d6518dd4c6f(otherProps);
  var buttonComponentProps = _extends2({}, buttonProps, domProps);
  return jsx(PopoverTrigger, triggerProps, jsx(_DropdownButton, _extends2({
    ref: triggerRef
  }, buttonComponentProps), children), jsx(_DropdownMenu, {
    style: menuStyle
  }, menu));
}
var ListBoxContext = /* @__PURE__ */ import_react35.default.createContext(null);
var menuItemCSS = /* @__PURE__ */ css("outline:none;display:flex;align-items:center;color:var(--ac-global-text-color-900);padding:var(--ac-global-dimension-static-size-100) var(--ac-global-dimension-static-size-200);font-size:", theme.typography.sizes.medium.fontSize, "px;min-width:80px;cursor:pointer;position:relative;&>.ac-icon-wrap.ac-menu-item__selected-checkmark{position:absolute;top:var(--ac-global-dimension-static-size-100);right:var(--ac-global-dimension-static-size-100);}&>.ac-icon-wrap:first-child,&>i:first-child{margin-right:var(--ac-global-dimension-static-size-50);}&.is-selected{i{color:var(--ac-global-color-primary);}}&.is-hovered,&.focus-ring{background-color:var(--ac-global-menu-item-background-color-hover);}&.is-selectable{cursor:pointer;}&.is-disabled{cursor:not-allowed;color:var(--ac-global-color-text-30);}" + (false ? "" : ";label:menuItemCSS;"), false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0eWxlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFFK0IiLCJmaWxlIjoic3R5bGVzLnRzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgY3NzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xyXG5pbXBvcnQgdGhlbWUgZnJvbSAnLi4vdGhlbWUnO1xyXG5leHBvcnQgY29uc3QgbWVudUl0ZW1DU1MgPSBjc3MgYFxuICAvKiBzaG93IGZvY3VzIGluIG90aGVyIHdheXMgKi9cbiAgb3V0bGluZTogbm9uZTtcbiAgZGlzcGxheTogZmxleDtcbiAgYWxpZ24taXRlbXM6IGNlbnRlcjtcbiAgY29sb3I6IHZhcigtLWFjLWdsb2JhbC10ZXh0LWNvbG9yLTkwMCk7XG4gIHBhZGRpbmc6IHZhcigtLWFjLWdsb2JhbC1kaW1lbnNpb24tc3RhdGljLXNpemUtMTAwKVxuICAgIHZhcigtLWFjLWdsb2JhbC1kaW1lbnNpb24tc3RhdGljLXNpemUtMjAwKTtcbiAgZm9udC1zaXplOiAke3RoZW1lLnR5cG9ncmFwaHkuc2l6ZXMubWVkaXVtLmZvbnRTaXplfXB4O1xuICBtaW4td2lkdGg6IDgwcHg7XG4gIGN1cnNvcjogcG9pbnRlcjtcbiAgcG9zaXRpb246IHJlbGF0aXZlO1xuICAmID4gLmFjLWljb24td3JhcC5hYy1tZW51LWl0ZW1fX3NlbGVjdGVkLWNoZWNrbWFyayB7XG4gICAgcG9zaXRpb246IGFic29sdXRlO1xuICAgIHRvcDogdmFyKC0tYWMtZ2xvYmFsLWRpbWVuc2lvbi1zdGF0aWMtc2l6ZS0xMDApO1xuICAgIHJpZ2h0OiB2YXIoLS1hYy1nbG9iYWwtZGltZW5zaW9uLXN0YXRpYy1zaXplLTEwMCk7XG4gIH1cblxuICAmID4gLmFjLWljb24td3JhcDpmaXJzdC1jaGlsZCxcbiAgJiA+IGk6Zmlyc3QtY2hpbGQge1xuICAgIG1hcmdpbi1yaWdodDogdmFyKC0tYWMtZ2xvYmFsLWRpbWVuc2lvbi1zdGF0aWMtc2l6ZS01MCk7XG4gIH1cblxuICAmLmlzLXNlbGVjdGVkIHtcbiAgICBpIHtcbiAgICAgIGNvbG9yOiB2YXIoLS1hYy1nbG9iYWwtY29sb3ItcHJpbWFyeSk7XG4gICAgfVxuICB9XG4gICYuaXMtaG92ZXJlZCxcbiAgJi5mb2N1cy1yaW5nIHtcbiAgICBiYWNrZ3JvdW5kLWNvbG9yOiB2YXIoLS1hYy1nbG9iYWwtbWVudS1pdGVtLWJhY2tncm91bmQtY29sb3ItaG92ZXIpO1xuICB9XG4gICYuaXMtc2VsZWN0YWJsZSB7XG4gICAgY3Vyc29yOiBwb2ludGVyO1xuICB9XG4gICYuaXMtZGlzYWJsZWQge1xuICAgIGN1cnNvcjogbm90LWFsbG93ZWQ7XG4gICAgY29sb3I6IHZhcigtLWFjLWdsb2JhbC1jb2xvci10ZXh0LTMwKTtcbiAgfVxuYDtcclxuLy8jIHNvdXJjZU1hcHBpbmdVUkw9c3R5bGVzLmpzLm1hcCJdfQ== */");
function ListBoxOption(props) {
  var item = props.item, shouldSelectOnPressUp = props.shouldSelectOnPressUp, shouldFocusOnHover = props.shouldFocusOnHover, shouldUseVirtualFocus = props.shouldUseVirtualFocus;
  var rendered = item.rendered, key = item.key;
  var state = (0, import_react35.useContext)(ListBoxContext);
  var ref = (0, import_react35.useRef)();
  var _useOption = $293f70390ea03370$export$497855f14858aa34(
    {
      "aria-label": item["aria-label"],
      key,
      shouldSelectOnPressUp,
      shouldFocusOnHover,
      isVirtualized: true,
      shouldUseVirtualFocus
    },
    state,
    // @ts-ignore
    ref
  ), optionProps = _useOption.optionProps, isSelected = _useOption.isSelected, isDisabled = _useOption.isDisabled, isFocused = _useOption.isFocused;
  var _useHover = $6179b936705e76d3$export$ae780daf29e6d456(_extends2({}, props, {
    isDisabled
  })), hoverProps = _useHover.hoverProps, isHovered = _useHover.isHovered;
  var contents = typeof rendered === "string" ? jsx(_Text, null, rendered) : rendered;
  var isKeyboardModality = $507fabe10e71c6fb$export$b9b3dfddab17db27();
  return jsx($907718708eab68af$export$1a38b4ad7f578e1d, {
    focusRingClass: "focus-ring"
  }, jsx("div", _extends2({}, $3ef42575df84b30b$export$9d1611c77c2fe928(optionProps, shouldFocusOnHover ? {} : hoverProps), {
    // @ts-ignore
    ref,
    className: clsx_m_default("ac-menu-item", {
      // If using virtual focus, apply focused styles to the item when the user is interacting with keyboard modality
      "is-focused": shouldUseVirtualFocus && isFocused && isKeyboardModality,
      "is-disabled": isDisabled,
      "is-selected": isSelected,
      "is-selectable": state.selectionManager.selectionMode !== "none",
      // When shouldFocusOnHover is false, apply hover styles both when hovered with the mouse.
      // Otherwise, apply hover styles when focused using non-keyboard modality.
      "is-hovered": isHovered && !shouldFocusOnHover || isFocused && !isKeyboardModality
    }),
    css: menuItemCSS
  }), contents, isSelected && jsx(Icon, {
    svg: jsx(CheckmarkOutline, null),
    className: "ac-menu-item__selected-checkmark"
  })));
}
function _EMOTION_STRINGIFIED_CSS_ERROR__$l() {
  return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
}
var headingCSS$1 = /* @__PURE__ */ css("padding-left:var(--ac-global-dimension-static-size-200);padding-right:var(--ac-global-dimension-static-size-200);margin-top:var(--ac-global-dimension-size-75);margin-bottom:var(--ac-global-dimension-size-40);font-size:", theme.typography.sizes.medium.fontSize, "px;line-height:", theme.typography.sizes.medium.lineHeight, "px;font-weight:", theme.typography.weights.heavy, ";" + (false ? "" : ";label:headingCSS;"), false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkxpc3RCb3hTZWN0aW9uLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFRdUIiLCJmaWxlIjoiTGlzdEJveFNlY3Rpb24udHN4Iiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgbGF5b3V0SW5mb1RvU3R5bGUsIHVzZVZpcnR1YWxpemVySXRlbSwgfSBmcm9tICdAcmVhY3QtYXJpYS92aXJ0dWFsaXplcic7XHJcbmltcG9ydCB7IExpc3RCb3hDb250ZXh0IH0gZnJvbSAnLi9MaXN0Qm94Q29udGV4dCc7XHJcbmltcG9ydCBSZWFjdCwgeyBGcmFnbWVudCwgdXNlQ29udGV4dCwgdXNlUmVmIH0gZnJvbSAncmVhY3QnO1xyXG5pbXBvcnQgeyB1c2VMaXN0Qm94U2VjdGlvbiB9IGZyb20gJ0ByZWFjdC1hcmlhL2xpc3Rib3gnO1xyXG5pbXBvcnQgeyB1c2VMb2NhbGUgfSBmcm9tICdAcmVhY3QtYXJpYS9pMThuJztcclxuaW1wb3J0IHsgdXNlU2VwYXJhdG9yIH0gZnJvbSAnQHJlYWN0LWFyaWEvc2VwYXJhdG9yJztcclxuaW1wb3J0IHsgY3NzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xyXG5pbXBvcnQgdGhlbWUgZnJvbSAnLi4vdGhlbWUnO1xyXG5jb25zdCBoZWFkaW5nQ1NTID0gY3NzIGBcbiAgcGFkZGluZy1sZWZ0OiB2YXIoLS1hYy1nbG9iYWwtZGltZW5zaW9uLXN0YXRpYy1zaXplLTIwMCk7XG4gIHBhZGRpbmctcmlnaHQ6IHZhcigtLWFjLWdsb2JhbC1kaW1lbnNpb24tc3RhdGljLXNpemUtMjAwKTtcbiAgbWFyZ2luLXRvcDogdmFyKC0tYWMtZ2xvYmFsLWRpbWVuc2lvbi1zaXplLTc1KTtcbiAgbWFyZ2luLWJvdHRvbTogdmFyKC0tYWMtZ2xvYmFsLWRpbWVuc2lvbi1zaXplLTQwKTtcbiAgZm9udC1zaXplOiAke3RoZW1lLnR5cG9ncmFwaHkuc2l6ZXMubWVkaXVtLmZvbnRTaXplfXB4O1xuICBsaW5lLWhlaWdodDogJHt0aGVtZS50eXBvZ3JhcGh5LnNpemVzLm1lZGl1bS5saW5lSGVpZ2h0fXB4O1xuICBmb250LXdlaWdodDogJHt0aGVtZS50eXBvZ3JhcGh5LndlaWdodHMuaGVhdnl9O1xuYDtcclxuY29uc3QgZGl2aWRlckNTUyA9IGNzcyBgXG4gIGJveC1zaXppbmc6IGNvbnRlbnQtYm94O1xuICBoZWlnaHQ6IHZhcigtLWFjLWdsb2JhbC1ib3JkZXItc2l6ZS10aGljayk7XG4gIG1hcmdpbjogMS41cHggdmFyKC0tYWMtZ2xvYmFsLWRpbWVuc2lvbi1zdGF0aWMtc2l6ZS0xNTApO1xuICBiYWNrZ3JvdW5kOiB2YXIoLS1hYy1nbG9iYWwtYm9yZGVyLWNvbG9yLWRlZmF1bHQpO1xuICBib3JkZXI6IG5vbmU7XG4gIHBhZGRpbmc6IDA7XG4gIG92ZXJmbG93OiB2aXNpYmxlO1xuYDtcclxuLyoqIEBwcml2YXRlICovXHJcbmV4cG9ydCBmdW5jdGlvbiBMaXN0Qm94U2VjdGlvbihwcm9wcykge1xyXG4gICAgbGV0IHsgY2hpbGRyZW4sIGxheW91dEluZm8sIGhlYWRlckxheW91dEluZm8sIHZpcnR1YWxpemVyLCBpdGVtIH0gPSBwcm9wcztcclxuICAgIGxldCB7IGhlYWRpbmdQcm9wcywgZ3JvdXBQcm9wcyB9ID0gdXNlTGlzdEJveFNlY3Rpb24oe1xyXG4gICAgICAgIGhlYWRpbmc6IGl0ZW0ucmVuZGVyZWQsXHJcbiAgICAgICAgJ2FyaWEtbGFiZWwnOiBpdGVtWydhcmlhLWxhYmVsJ10sXHJcbiAgICB9KTtcclxuICAgIGxldCB7IHNlcGFyYXRvclByb3BzIH0gPSB1c2VTZXBhcmF0b3Ioe1xyXG4gICAgICAgIGVsZW1lbnRUeXBlOiAnbGknLFxyXG4gICAgfSk7XHJcbiAgICBsZXQgaGVhZGVyUmVmID0gdXNlUmVmKG51bGwpO1xyXG4gICAgdXNlVmlydHVhbGl6ZXJJdGVtKHtcclxuICAgICAgICBsYXlvdXRJbmZvOiBoZWFkZXJMYXlvdXRJbmZvLFxyXG4gICAgICAgIHZpcnR1YWxpemVyLFxyXG4gICAgICAgIHJlZjogaGVhZGVyUmVmLFxyXG4gICAgfSk7XHJcbiAgICBsZXQgeyBkaXJlY3Rpb24gfSA9IHVzZUxvY2FsZSgpO1xyXG4gICAgbGV0IHN0YXRlID0gdXNlQ29udGV4dChMaXN0Qm94Q29udGV4dCk7XHJcbiAgICByZXR1cm4gKDxGcmFnbWVudD5cbiAgICAgIDxkaXYgcm9sZT1cInByZXNlbnRhdGlvblwiIHJlZj17aGVhZGVyUmVmfSBzdHlsZT17bGF5b3V0SW5mb1RvU3R5bGUoaGVhZGVyTGF5b3V0SW5mbywgZGlyZWN0aW9uKX0+XG4gICAgICAgIHtpdGVtLmtleSAhPT0gc3RhdGUuY29sbGVjdGlvbi5nZXRGaXJzdEtleSgpICYmICg8ZGl2IHsuLi5zZXBhcmF0b3JQcm9wc30gY2xhc3NOYW1lPVwiYWMtbWVudS1kaXZpZGVyXCIgY3NzPXtkaXZpZGVyQ1NTfS8+KX1cbiAgICAgICAge2l0ZW0ucmVuZGVyZWQgJiYgKDxkaXYgey4uLmhlYWRpbmdQcm9wc30gY2xhc3NOYW1lPVwiYWMtbWVudS1zZWN0aW9uLWhlYWRpbmdcIiBjc3M9e2hlYWRpbmdDU1N9PlxuICAgICAgICAgICAge2l0ZW0ucmVuZGVyZWR9XG4gICAgICAgICAgPC9kaXY+KX1cbiAgICAgIDwvZGl2PlxuICAgICAgPGRpdiB7Li4uZ3JvdXBQcm9wc30gc3R5bGU9e2xheW91dEluZm9Ub1N0eWxlKGxheW91dEluZm8sIGRpcmVjdGlvbil9IGNsYXNzTmFtZT1cImFjLW1lbnVcIj5cbiAgICAgICAge2NoaWxkcmVufVxuICAgICAgPC9kaXY+XG4gICAgPC9GcmFnbWVudD4pO1xyXG59XHJcbi8vIyBzb3VyY2VNYXBwaW5nVVJMPUxpc3RCb3hTZWN0aW9uLmpzeC5tYXAiXX0= */");
var dividerCSS = false ? {
  name: "gebh5x",
  styles: "box-sizing:content-box;height:var(--ac-global-border-size-thick);margin:1.5px var(--ac-global-dimension-static-size-150);background:var(--ac-global-border-color-default);border:none;padding:0;overflow:visible"
} : {
  name: "1obqcrl-dividerCSS",
  styles: "box-sizing:content-box;height:var(--ac-global-border-size-thick);margin:1.5px var(--ac-global-dimension-static-size-150);background:var(--ac-global-border-color-default);border:none;padding:0;overflow:visible;label:dividerCSS;",
  map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkxpc3RCb3hTZWN0aW9uLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFpQnVCIiwiZmlsZSI6Ikxpc3RCb3hTZWN0aW9uLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGxheW91dEluZm9Ub1N0eWxlLCB1c2VWaXJ0dWFsaXplckl0ZW0sIH0gZnJvbSAnQHJlYWN0LWFyaWEvdmlydHVhbGl6ZXInO1xyXG5pbXBvcnQgeyBMaXN0Qm94Q29udGV4dCB9IGZyb20gJy4vTGlzdEJveENvbnRleHQnO1xyXG5pbXBvcnQgUmVhY3QsIHsgRnJhZ21lbnQsIHVzZUNvbnRleHQsIHVzZVJlZiB9IGZyb20gJ3JlYWN0JztcclxuaW1wb3J0IHsgdXNlTGlzdEJveFNlY3Rpb24gfSBmcm9tICdAcmVhY3QtYXJpYS9saXN0Ym94JztcclxuaW1wb3J0IHsgdXNlTG9jYWxlIH0gZnJvbSAnQHJlYWN0LWFyaWEvaTE4bic7XHJcbmltcG9ydCB7IHVzZVNlcGFyYXRvciB9IGZyb20gJ0ByZWFjdC1hcmlhL3NlcGFyYXRvcic7XHJcbmltcG9ydCB7IGNzcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcclxuaW1wb3J0IHRoZW1lIGZyb20gJy4uL3RoZW1lJztcclxuY29uc3QgaGVhZGluZ0NTUyA9IGNzcyBgXG4gIHBhZGRpbmctbGVmdDogdmFyKC0tYWMtZ2xvYmFsLWRpbWVuc2lvbi1zdGF0aWMtc2l6ZS0yMDApO1xuICBwYWRkaW5nLXJpZ2h0OiB2YXIoLS1hYy1nbG9iYWwtZGltZW5zaW9uLXN0YXRpYy1zaXplLTIwMCk7XG4gIG1hcmdpbi10b3A6IHZhcigtLWFjLWdsb2JhbC1kaW1lbnNpb24tc2l6ZS03NSk7XG4gIG1hcmdpbi1ib3R0b206IHZhcigtLWFjLWdsb2JhbC1kaW1lbnNpb24tc2l6ZS00MCk7XG4gIGZvbnQtc2l6ZTogJHt0aGVtZS50eXBvZ3JhcGh5LnNpemVzLm1lZGl1bS5mb250U2l6ZX1weDtcbiAgbGluZS1oZWlnaHQ6ICR7dGhlbWUudHlwb2dyYXBoeS5zaXplcy5tZWRpdW0ubGluZUhlaWdodH1weDtcbiAgZm9udC13ZWlnaHQ6ICR7dGhlbWUudHlwb2dyYXBoeS53ZWlnaHRzLmhlYXZ5fTtcbmA7XHJcbmNvbnN0IGRpdmlkZXJDU1MgPSBjc3MgYFxuICBib3gtc2l6aW5nOiBjb250ZW50LWJveDtcbiAgaGVpZ2h0OiB2YXIoLS1hYy1nbG9iYWwtYm9yZGVyLXNpemUtdGhpY2spO1xuICBtYXJnaW46IDEuNXB4IHZhcigtLWFjLWdsb2JhbC1kaW1lbnNpb24tc3RhdGljLXNpemUtMTUwKTtcbiAgYmFja2dyb3VuZDogdmFyKC0tYWMtZ2xvYmFsLWJvcmRlci1jb2xvci1kZWZhdWx0KTtcbiAgYm9yZGVyOiBub25lO1xuICBwYWRkaW5nOiAwO1xuICBvdmVyZmxvdzogdmlzaWJsZTtcbmA7XHJcbi8qKiBAcHJpdmF0ZSAqL1xyXG5leHBvcnQgZnVuY3Rpb24gTGlzdEJveFNlY3Rpb24ocHJvcHMpIHtcclxuICAgIGxldCB7IGNoaWxkcmVuLCBsYXlvdXRJbmZvLCBoZWFkZXJMYXlvdXRJbmZvLCB2aXJ0dWFsaXplciwgaXRlbSB9ID0gcHJvcHM7XHJcbiAgICBsZXQgeyBoZWFkaW5nUHJvcHMsIGdyb3VwUHJvcHMgfSA9IHVzZUxpc3RCb3hTZWN0aW9uKHtcclxuICAgICAgICBoZWFkaW5nOiBpdGVtLnJlbmRlcmVkLFxyXG4gICAgICAgICdhcmlhLWxhYmVsJzogaXRlbVsnYXJpYS1sYWJlbCddLFxyXG4gICAgfSk7XHJcbiAgICBsZXQgeyBzZXBhcmF0b3JQcm9wcyB9ID0gdXNlU2VwYXJhdG9yKHtcclxuICAgICAgICBlbGVtZW50VHlwZTogJ2xpJyxcclxuICAgIH0pO1xyXG4gICAgbGV0IGhlYWRlclJlZiA9IHVzZVJlZihudWxsKTtcclxuICAgIHVzZVZpcnR1YWxpemVySXRlbSh7XHJcbiAgICAgICAgbGF5b3V0SW5mbzogaGVhZGVyTGF5b3V0SW5mbyxcclxuICAgICAgICB2aXJ0dWFsaXplcixcclxuICAgICAgICByZWY6IGhlYWRlclJlZixcclxuICAgIH0pO1xyXG4gICAgbGV0IHsgZGlyZWN0aW9uIH0gPSB1c2VMb2NhbGUoKTtcclxuICAgIGxldCBzdGF0ZSA9IHVzZUNvbnRleHQoTGlzdEJveENvbnRleHQpO1xyXG4gICAgcmV0dXJuICg8RnJhZ21lbnQ+XG4gICAgICA8ZGl2IHJvbGU9XCJwcmVzZW50YXRpb25cIiByZWY9e2hlYWRlclJlZn0gc3R5bGU9e2xheW91dEluZm9Ub1N0eWxlKGhlYWRlckxheW91dEluZm8sIGRpcmVjdGlvbil9PlxuICAgICAgICB7aXRlbS5rZXkgIT09IHN0YXRlLmNvbGxlY3Rpb24uZ2V0Rmlyc3RLZXkoKSAmJiAoPGRpdiB7Li4uc2VwYXJhdG9yUHJvcHN9IGNsYXNzTmFtZT1cImFjLW1lbnUtZGl2aWRlclwiIGNzcz17ZGl2aWRlckNTU30vPil9XG4gICAgICAgIHtpdGVtLnJlbmRlcmVkICYmICg8ZGl2IHsuLi5oZWFkaW5nUHJvcHN9IGNsYXNzTmFtZT1cImFjLW1lbnUtc2VjdGlvbi1oZWFkaW5nXCIgY3NzPXtoZWFkaW5nQ1NTfT5cbiAgICAgICAgICAgIHtpdGVtLnJlbmRlcmVkfVxuICAgICAgICAgIDwvZGl2Pil9XG4gICAgICA8L2Rpdj5cbiAgICAgIDxkaXYgey4uLmdyb3VwUHJvcHN9IHN0eWxlPXtsYXlvdXRJbmZvVG9TdHlsZShsYXlvdXRJbmZvLCBkaXJlY3Rpb24pfSBjbGFzc05hbWU9XCJhYy1tZW51XCI+XG4gICAgICAgIHtjaGlsZHJlbn1cbiAgICAgIDwvZGl2PlxuICAgIDwvRnJhZ21lbnQ+KTtcclxufVxyXG4vLyMgc291cmNlTWFwcGluZ1VSTD1MaXN0Qm94U2VjdGlvbi5qc3gubWFwIl19 */",
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__$l
};
function ListBoxSection(props) {
  var children = props.children, layoutInfo = props.layoutInfo, headerLayoutInfo = props.headerLayoutInfo, virtualizer = props.virtualizer, item = props.item;
  var _useListBoxSection = $af383d3bef1cfdc9$export$c3f9f39876e4bc7({
    heading: item.rendered,
    "aria-label": item["aria-label"]
  }), headingProps = _useListBoxSection.headingProps, groupProps = _useListBoxSection.groupProps;
  var _useSeparator = $f4b273590fab9f93$export$52210f68a14655d0({
    elementType: "li"
  }), separatorProps = _useSeparator.separatorProps;
  var headerRef = (0, import_react35.useRef)(null);
  $47736c1e63ba1c6d$export$1da781778207e0a2({
    layoutInfo: headerLayoutInfo,
    virtualizer,
    ref: headerRef
  });
  var _useLocale = $18f2051aff69b9bf$export$43bb16f9c6d9e3f7(), direction = _useLocale.direction;
  var state = (0, import_react35.useContext)(ListBoxContext);
  return jsx(import_react35.Fragment, null, jsx("div", {
    role: "presentation",
    ref: headerRef,
    style: $ccf8a0a04e4175ae$export$1481e64fbe01b8b3(headerLayoutInfo, direction)
  }, item.key !== state.collection.getFirstKey() && jsx("div", _extends2({}, separatorProps, {
    className: "ac-menu-divider",
    css: dividerCSS
  })), item.rendered && jsx("div", _extends2({}, headingProps, {
    className: "ac-menu-section-heading",
    css: headingCSS$1
  }), item.rendered)), jsx("div", _extends2({}, groupProps, {
    style: $ccf8a0a04e4175ae$export$1481e64fbe01b8b3(layoutInfo, direction),
    className: "ac-menu"
  }), children));
}
function useListBoxLayout(state) {
  var collator = $325a3faab7a68acd$export$a16aca283550c30d({
    usage: "search",
    sensitivity: "base"
  });
  var layout = (0, import_react35.useMemo)(function() {
    return new $61ef60fc9b1041f4$export$cacbb3924155d68e({
      estimatedRowHeight: 32,
      estimatedHeadingHeight: 26,
      padding: 4,
      loaderHeight: 40,
      placeholderHeight: 32,
      collator
    });
  }, [collator]);
  layout.collection = state.collection;
  layout.disabledKeys = state.disabledKeys;
  return layout;
}
function ListBoxBase(props, ref) {
  var layout = props.layout, state = props.state, shouldSelectOnPressUp = props.shouldSelectOnPressUp, focusOnPointerEnter = props.focusOnPointerEnter, shouldUseVirtualFocus = props.shouldUseVirtualFocus, _props$domProps = props.domProps, domProps = _props$domProps === void 0 ? {} : _props$domProps, _props$transitionDura = props.transitionDuration, transitionDuration = _props$transitionDura === void 0 ? 0 : _props$transitionDura, onScroll = props.onScroll, _props$isLoading = props.isLoading, isLoading = _props$isLoading === void 0 ? false : _props$isLoading;
  var _useListBox = $c132121280ec012d$export$50eacbbf140a3141(_extends2({}, props, {
    keyboardDelegate: layout,
    isVirtualized: true
  }), state, ref), listBoxProps = _useListBox.listBoxProps;
  layout.isLoading = isLoading;
  var renderWrapper = function renderWrapper2(parent, reusableView, children, renderChildren) {
    var _parent$layoutInfo;
    if (reusableView.viewType === "section") {
      return jsx(ListBoxSection, {
        key: reusableView.key,
        item: reusableView.content,
        layoutInfo: reusableView.layoutInfo,
        virtualizer: reusableView.virtualizer,
        headerLayoutInfo: (
          // @ts-ignore
          children.find(function(c4) {
            return c4.viewType === "header";
          }).layoutInfo
        )
      }, renderChildren(children.filter(function(c4) {
        return c4.viewType === "item";
      })));
    }
    return jsx($ccf8a0a04e4175ae$export$6796df8ba7398521, {
      key: reusableView.key,
      layoutInfo: reusableView.layoutInfo,
      virtualizer: reusableView.virtualizer,
      parent: (_parent$layoutInfo = parent == null ? void 0 : parent.layoutInfo) != null ? _parent$layoutInfo : void 0
    }, reusableView.rendered);
  };
  return jsx(ListBoxContext.Provider, {
    value: state
  }, jsx($6d0a5c394373ae64$export$89be5a243e59c4b2, _extends2({
    style: props.style
  }, $3ef42575df84b30b$export$9d1611c77c2fe928(listBoxProps, domProps), {
    ref,
    focusedKey: state.selectionManager.focusedKey,
    sizeToFit: "height",
    scrollDirection: "vertical",
    className: "ac-menu",
    layout,
    collection: state.collection,
    renderWrapper,
    transitionDuration,
    isLoading,
    onLoadMore: props.onLoadMore,
    shouldUseVirtualFocus,
    onScroll
  }), function(type, item) {
    if (type === "item") {
      return jsx(ListBoxOption, {
        item,
        shouldSelectOnPressUp,
        shouldFocusOnHover: focusOnPointerEnter,
        shouldUseVirtualFocus
      });
    } else if (type === "loader") {
      return (
        // aria-selected isn't needed here since this option is not selectable.
        jsx("div", {
          // eslint-disable-next-line jsx-a11y/role-has-required-aria-props
          role: "option",
          style: {
            display: "flex",
            alignItems: "center",
            justifyContent: "center",
            height: "100%"
          }
        }, jsx("div", {
          className: "ac-dropdown-progress-circle"
        }, state.collection.size > 0 ? "Loading More" : "Loading"))
      );
    } else if (type === "placeholder") {
      var emptyState = props.renderEmptyState ? props.renderEmptyState() : null;
      if (emptyState == null) {
        return null;
      }
      return jsx("div", {
        // aria-selected isn't needed here since this option is not selectable.
        // eslint-disable-next-line jsx-a11y/role-has-required-aria-props
        role: "option"
      }, emptyState);
    }
    return null;
  }));
}
var _ListBoxBase = /* @__PURE__ */ import_react35.default.forwardRef(ListBoxBase);
function ListBox(props, ref) {
  var state = $e72dd72e1c76a225$export$2f645645f7bca764(props);
  var layout = useListBoxLayout(state);
  var domRef = useDOMRef(ref);
  return jsx(_ListBoxBase, _extends2({}, props, {
    ref: domRef,
    state,
    layout
  }));
}
var _ListBox = /* @__PURE__ */ import_react35.default.forwardRef(ListBox);
function _EMOTION_STRINGIFIED_CSS_ERROR__$m() {
  return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
}
var _ref$c = false ? {
  name: "17dzy7a",
  styles: "--ac-dropdown-min-width:200px;.ac-dropdown-button__text{.is-placeholder{color:var(--ac-global-text-color-700);font-style:italic;}}"
} : {
  name: "1ljhkgr-picker",
  styles: "--ac-dropdown-min-width:200px;.ac-dropdown-button__text{.is-placeholder{color:var(--ac-global-text-color-700);font-style:italic;}};label:picker;",
  map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */",
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__$m
};
function Picker(props, ref) {
  props = useProviderProps(props);
  var _props = props, _props$isQuiet = _props.isQuiet, isQuiet = _props$isQuiet === void 0 ? false : _props$isQuiet, isDisabled = _props.isDisabled, _props$direction = _props.direction, direction = _props$direction === void 0 ? "bottom" : _props$direction, _props$align = _props.align, align = _props$align === void 0 ? "start" : _props$align, _props$shouldFlip = _props.shouldFlip, shouldFlip = _props$shouldFlip === void 0 ? true : _props$shouldFlip, _props$placeholder = _props.placeholder, placeholder2 = _props$placeholder === void 0 ? "Select an option..." : _props$placeholder, _props$labelPosition = _props.labelPosition, labelPosition = _props$labelPosition === void 0 ? "top" : _props$labelPosition, label = _props.label, name2 = _props.name, autoFocus = _props.autoFocus, addonBefore = _props.addonBefore, menuWidth = _props.menuWidth, validationState = _props.validationState;
  var state = $2bc3a590c5373a4e$export$5159ec8b34d4ec12(props);
  var domRef = useDOMRef(ref);
  var dropdownRef = (0, import_react35.useRef)(null);
  var unwrappedDropdownRef = useUnwrapDOMRef(dropdownRef);
  var triggerRef = (0, import_react35.useRef)(null);
  var unwrappedTriggerRef = useUnwrapDOMRef(triggerRef);
  var listboxRef = (0, import_react35.useRef)();
  var layout = useListBoxLayout(state);
  var _useSelect = $58aed456727eb0f3$export$e64b2f635402ca43(_extends2({}, props, {
    keyboardDelegate: layout
  }), state, unwrappedTriggerRef), labelProps = _useSelect.labelProps, triggerProps = _useSelect.triggerProps, menuProps = _useSelect.menuProps, descriptionProps = _useSelect.descriptionProps, errorMessageProps = _useSelect.errorMessageProps;
  var _useOverlayPosition = $2a41e45df1593e64$export$d39e1813b3bdd0e1({
    targetRef: unwrappedTriggerRef,
    overlayRef: unwrappedDropdownRef,
    // @ts-ignore refs are not playing nicely with hooks
    scrollRef: listboxRef,
    placement: direction + " " + align,
    shouldFlip,
    isOpen: state.isOpen,
    onClose: state.close
  }), overlayProps = _useOverlayPosition.overlayProps, placement = _useOverlayPosition.placement, updatePosition = _useOverlayPosition.updatePosition;
  var _useHover = $6179b936705e76d3$export$ae780daf29e6d456({
    isDisabled
  }), hoverProps = _useHover.hoverProps, isHovered = _useHover.isHovered;
  $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(function() {
    if (state.isOpen) {
      requestAnimationFrame(function() {
        updatePosition();
      });
    }
  }, [state.isOpen, updatePosition]);
  var isLoadingInitial = props.isLoading && state.collection.size === 0;
  var isLoadingMore = props.isLoading && state.collection.size > 0;
  var listbox = jsx($9bf71ea28793e738$export$20e40289641fbbb6, {
    restoreFocus: true
  }, jsx(_ListBoxBase, _extends2({}, menuProps, {
    // @ts-ignore
    ref: listboxRef,
    disallowEmptySelection: true,
    autoFocus: state.focusStrategy || true,
    shouldSelectOnPressUp: true,
    focusOnPointerEnter: true,
    layout,
    state,
    style: {
      maxHeight: "inherit"
    },
    isLoading: isLoadingMore,
    onLoadMore: props.onLoadMore
  })));
  var _useState = (0, import_react35.useState)(null), buttonWidth = _useState[0], setButtonWidth = _useState[1];
  var onResize = (0, import_react35.useCallback)(function() {
    if (unwrappedTriggerRef.current) {
      var _width = unwrappedTriggerRef.current.offsetWidth;
      setButtonWidth(_width);
    }
  }, [unwrappedTriggerRef, setButtonWidth]);
  $9daab02d461809db$export$683480f191c0e3ea({
    ref: unwrappedTriggerRef,
    onResize
  });
  $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(onResize, [state.selectedKey, onResize]);
  var width = isQuiet ? null : buttonWidth;
  var style = _extends2({}, overlayProps.style, {
    width: menuWidth ? dimensionValue(menuWidth) : width,
    // TODO: move to a css variable
    minWidth: isQuiet ? "200px" : buttonWidth
  });
  var overlay = jsx(_Popover, {
    isOpen: state.isOpen,
    style,
    className: clsx_m_default("ac-dropdown", props.className),
    ref: dropdownRef,
    placement,
    hideArrow: true,
    shouldCloseOnBlur: true,
    onClose: state.close
  }, jsx(_DropdownMenu, null, listbox));
  var contents = state.selectedItem ? state.selectedItem.textValue || state.selectedItem.rendered : placeholder2;
  if (typeof contents === "string") {
    contents = jsx("span", {
      className: clsx_m_default({
        "is-placeholder": state.selectedItem == null,
        "ac-dropdown__content": true
      })
    }, contents);
  }
  var picker = jsx("div", {
    className: clsx_m_default("ac-dropdown ac-dropdown--picker", {
      "is-disabled": isDisabled,
      "ac-dropdown--quiet": isQuiet
    }, props.className),
    ref: domRef,
    css: _ref$c
  }, jsx($bdd25dc72710631f$export$cbd84cdb2e668835, {
    isDisabled,
    state,
    triggerRef: unwrappedTriggerRef,
    label,
    name: name2
  }), jsx($f1ab8c75478c6f73$export$3351871ee4b288b8, $3ef42575df84b30b$export$9d1611c77c2fe928(hoverProps, triggerProps), jsx(
    _DropdownButton,
    {
      ref: triggerRef,
      isQuiet,
      isActive: state.isOpen,
      isDisabled,
      autoFocus,
      className: clsx_m_default("ac-dropdown-trigger", {
        "is-hovered": isHovered
      }),
      validationState,
      addonBefore
    },
    jsx("div", null, contents),
    isLoadingInitial && "Loading..."
  )), state.collection.size === 0 ? null : overlay);
  var wrapperClassName = label ? clsx_m_default("ac-field", props.className, {
    "ac-dropdown-field-wrapper--quiet": isQuiet,
    "ac-Dropdown-field-wrapper--positionSide": labelPosition === "side"
  }) : "";
  return jsx(_Field, _extends2({}, props, {
    ref: domRef,
    wrapperClassName,
    labelProps,
    descriptionProps,
    errorMessageProps,
    showErrorIcon: false,
    includeNecessityIndicatorInAccessibilityName: true,
    elementType: "span"
  }), picker);
}
var _Picker = /* @__PURE__ */ import_react35.default.forwardRef(Picker);
var DEFAULT_EXPIRE_MS = 5e3;
var TRANSITION_ENTER_DURATION_MS = 200;
var TRANSITION_EXIT_DURATION_MS = 200;
var _templateObject$4;
var slideInFromRight = /* @__PURE__ */ keyframes(_templateObject$4 || (_templateObject$4 = /* @__PURE__ */ _taggedTemplateLiteralLoose2(["\n    0% { transform: translateX(400px); opacity: 0; }\n    100% { transform: translateX(0); opacity: 1; }\n"])));
var slideInFromRightCSS = /* @__PURE__ */ css("&.is-enter-active{animation:", slideInFromRight, " ", TRANSITION_ENTER_DURATION_MS / 1e3, "s forwards ease-in-out;}" + (false ? "" : ";label:slideInFromRightCSS;"), false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0eWxlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFNdUMiLCJmaWxlIjoic3R5bGVzLnRzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgY3NzLCBrZXlmcmFtZXMgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XHJcbmltcG9ydCB7IFRSQU5TSVRJT05fRU5URVJfRFVSQVRJT05fTVMsIFRSQU5TSVRJT05fRVhJVF9EVVJBVElPTl9NUywgfSBmcm9tICcuL2NvbnN0YW50cyc7XHJcbmNvbnN0IHNsaWRlSW5Gcm9tUmlnaHQgPSBrZXlmcmFtZXMgYFxuICAgIDAlIHsgdHJhbnNmb3JtOiB0cmFuc2xhdGVYKDQwMHB4KTsgb3BhY2l0eTogMDsgfVxuICAgIDEwMCUgeyB0cmFuc2Zvcm06IHRyYW5zbGF0ZVgoMCk7IG9wYWNpdHk6IDE7IH1cbmA7XHJcbmV4cG9ydCBjb25zdCBzbGlkZUluRnJvbVJpZ2h0Q1NTID0gY3NzIGBcbiAgLyogQ1NTIFRyYW5zaXRpb24gZ3JvdXAgZ2VuZXJhdGVkIGNsYXNzICovXG4gICYuaXMtZW50ZXItYWN0aXZlIHtcbiAgICBhbmltYXRpb246ICR7c2xpZGVJbkZyb21SaWdodH0gJHtUUkFOU0lUSU9OX0VOVEVSX0RVUkFUSU9OX01TIC8gMTAwMH1zXG4gICAgICBmb3J3YXJkcyBlYXNlLWluLW91dDtcbiAgfVxuYDtcclxuZXhwb3J0IGNvbnN0IGRpc2FwcGVhckNTUyA9IGNzcyBgXG4gIG9wYWNpdHk6IDE7XG4gIHRyYW5zaXRpb246IG9wYWNpdHkgJHtUUkFOU0lUSU9OX0VYSVRfRFVSQVRJT05fTVMgLyAxMDAwfXMgZWFzZS1pbi1vdXQ7XG4gIC8qIENTUyBUcmFuc2l0aW9uIGdyb3VwIGdlbmVyYXRlZCBjbGFzcyAqL1xuICAmLmlzLWV4aXQge1xuICAgIG9wYWNpdHk6IDA7XG4gIH1cbmA7XHJcbi8vIyBzb3VyY2VNYXBwaW5nVVJMPXN0eWxlcy5qcy5tYXAiXX0= */");
var disappearCSS = /* @__PURE__ */ css("opacity:1;transition:opacity ", TRANSITION_EXIT_DURATION_MS / 1e3, "s ease-in-out;&.is-exit{opacity:0;}" + (false ? "" : ";label:disappearCSS;"), false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0eWxlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFhZ0MiLCJmaWxlIjoic3R5bGVzLnRzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgY3NzLCBrZXlmcmFtZXMgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XHJcbmltcG9ydCB7IFRSQU5TSVRJT05fRU5URVJfRFVSQVRJT05fTVMsIFRSQU5TSVRJT05fRVhJVF9EVVJBVElPTl9NUywgfSBmcm9tICcuL2NvbnN0YW50cyc7XHJcbmNvbnN0IHNsaWRlSW5Gcm9tUmlnaHQgPSBrZXlmcmFtZXMgYFxuICAgIDAlIHsgdHJhbnNmb3JtOiB0cmFuc2xhdGVYKDQwMHB4KTsgb3BhY2l0eTogMDsgfVxuICAgIDEwMCUgeyB0cmFuc2Zvcm06IHRyYW5zbGF0ZVgoMCk7IG9wYWNpdHk6IDE7IH1cbmA7XHJcbmV4cG9ydCBjb25zdCBzbGlkZUluRnJvbVJpZ2h0Q1NTID0gY3NzIGBcbiAgLyogQ1NTIFRyYW5zaXRpb24gZ3JvdXAgZ2VuZXJhdGVkIGNsYXNzICovXG4gICYuaXMtZW50ZXItYWN0aXZlIHtcbiAgICBhbmltYXRpb246ICR7c2xpZGVJbkZyb21SaWdodH0gJHtUUkFOU0lUSU9OX0VOVEVSX0RVUkFUSU9OX01TIC8gMTAwMH1zXG4gICAgICBmb3J3YXJkcyBlYXNlLWluLW91dDtcbiAgfVxuYDtcclxuZXhwb3J0IGNvbnN0IGRpc2FwcGVhckNTUyA9IGNzcyBgXG4gIG9wYWNpdHk6IDE7XG4gIHRyYW5zaXRpb246IG9wYWNpdHkgJHtUUkFOU0lUSU9OX0VYSVRfRFVSQVRJT05fTVMgLyAxMDAwfXMgZWFzZS1pbi1vdXQ7XG4gIC8qIENTUyBUcmFuc2l0aW9uIGdyb3VwIGdlbmVyYXRlZCBjbGFzcyAqL1xuICAmLmlzLWV4aXQge1xuICAgIG9wYWNpdHk6IDA7XG4gIH1cbmA7XHJcbi8vIyBzb3VyY2VNYXBwaW5nVVJMPXN0eWxlcy5qcy5tYXAiXX0= */");
function _EMOTION_STRINGIFIED_CSS_ERROR__$n() {
  return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
}
var noticeCSS = false ? {
  name: "xgk384",
  styles: "width:400px;padding:var(--ac-global-dimension-static-size-100) var(--ac-global-dimension-static-size-200);border-radius:8px"
} : {
  name: "10700wx-noticeCSS",
  styles: "width:400px;padding:var(--ac-global-dimension-static-size-100) var(--ac-global-dimension-static-size-200);border-radius:8px;label:noticeCSS;",
  map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */",
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__$n
};
var _ref$d = false ? {
  name: "1peqg37",
  styles: "background-color:transparent"
} : {
  name: "tn02lv-Notice",
  styles: "background-color:transparent;label:Notice;",
  map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */",
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__$n
};
var _ref2$5 = false ? {
  name: "zomnem",
  styles: "display:flex;flex-direction:row;justify-content:flex-end;margin-top:var(--ac-global-dimension-static-size-100)"
} : {
  name: "151qjn4-Notice",
  styles: "display:flex;flex-direction:row;justify-content:flex-end;margin-top:var(--ac-global-dimension-static-size-100);label:Notice;",
  map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */",
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__$n
};
var _ref3$3 = false ? {
  name: "kri8n5",
  styles: "background-color:transparent;color:var(--ac-global-static-color-white-900);padding:0;border:none;cursor:pointer;width:20px;height:20px;margin-left:var(--ac-global-dimension-static-size-200)"
} : {
  name: "ifh9tm-Notice",
  styles: "background-color:transparent;color:var(--ac-global-static-color-white-900);padding:0;border:none;cursor:pointer;width:20px;height:20px;margin-left:var(--ac-global-dimension-static-size-200);label:Notice;",
  map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */",
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__$n
};
var _ref4$2 = false ? {
  name: "1jd17po",
  styles: "display:flex;flex-direction:row;align-items:center;color:var(--ac-global-static-color-white-900);flex:1 1 auto;&>.ac-text{flex:1 1 auto;}&>.ac-icon-wrap{margin-right:var(--ac-global-dimension-static-size-100);}"
} : {
  name: "4rny2i-Notice",
  styles: "display:flex;flex-direction:row;align-items:center;color:var(--ac-global-static-color-white-900);flex:1 1 auto;&>.ac-text{flex:1 1 auto;}&>.ac-icon-wrap{margin-right:var(--ac-global-dimension-static-size-100);};label:Notice;",
  map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */",
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__$n
};
function Notice(_ref52) {
  var title = _ref52.title, variant = _ref52.variant, message = _ref52.message, onClose = _ref52.onClose, action = _ref52.action, _ref5$expireMs = _ref52.expireMs, expireMs = _ref5$expireMs === void 0 ? DEFAULT_EXPIRE_MS : _ref5$expireMs;
  var shouldExpire = action == null;
  (0, import_react35.useEffect)(function() {
    if (shouldExpire) {
      var timer = setTimeout(function() {
        onClose();
      }, expireMs);
      return function() {
        return clearTimeout(timer);
      };
    }
    return function() {
    };
  }, []);
  var variantCSS = useSeverityStyle(variant);
  return jsx("div", {
    className: clsx_m_default({
      "ac-notice": true
    }),
    css: /* @__PURE__ */ css(noticeCSS, variantCSS, slideInFromRightCSS, disappearCSS, false ? "" : ";label:Notice;", false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */")
  }, jsx("div", {
    className: "ac-alert__icon-title-wrap",
    css: _ref4$2
  }, getSeverityIcon(variant), jsx(_Text, {
    elementType: "h5",
    textSize: "large",
    weight: "heavy",
    color: "inherit"
  }, title), jsx("button", {
    title: "Close notice",
    css: _ref3$3,
    onClick: onClose
  }, jsx(Icon, {
    svg: jsx(CloseOutline, null)
  }))), message ? jsx(_Text, {
    color: "inherit",
    textSize: "medium",
    css: /* @__PURE__ */ css("padding-left:", 2 * theme.spacing.margin8 + 12, "px;margin-top:var(--ac-global-dimension-static-size-50);display:inline-block;" + (false ? "" : ";label:Notice;"), false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */")
  }, message) : null, action ? jsx("div", {
    css: _ref2$5
  }, jsx("button", {
    css: /* @__PURE__ */ css(buttonCSS, variantCSS, _ref$d, false ? "" : ";label:Notice;", false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */"),
    "data-size": "normal",
    "data-childless": "false",
    onClick: function onClick() {
      action.onClick();
      onClose();
    }
  }, jsx(_Text, {
    textSize: "medium",
    color: "inherit"
  }, action.text))) : null);
}
var _excluded$m = ["isOpen"];
var uuidSeed = 0;
var getUuid = function getUuid2() {
  uuidSeed += 1;
  return "ac-notification-" + uuidSeed;
};
function NotificationContainer(props) {
  var passThroughProps = _objectWithoutPropertiesLoose2(props, _excluded$m);
  return jsx("div", _extends2({
    className: "ac-notification-container",
    css: /* @__PURE__ */ css("position:fixed;bottom:", theme.spacing.margin24, "px;right:", theme.spacing.margin24, "px;& .ac-notice+.ac-notice{margin-top:var(--ac-global-dimension-static-size-200);}" + (false ? "" : ";label:NotificationContainer;"), false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIk5vdGlmaWNhdGlvbi50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBb0JnRSIsImZpbGUiOiJOb3RpZmljYXRpb24udHN4Iiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IFJlYWN0LCB7IENvbXBvbmVudCB9IGZyb20gJ3JlYWN0JztcclxuaW1wb3J0IHsgY3NzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xyXG5pbXBvcnQgeyBPdmVybGF5IH0gZnJvbSAnLi4vb3ZlcmxheXMnO1xyXG5pbXBvcnQgeyBOb3RpY2UgfSBmcm9tICcuL05vdGljZSc7XHJcbmltcG9ydCB0aGVtZSBmcm9tICcuLi90aGVtZSc7XHJcbmltcG9ydCB7IENTU1RyYW5zaXRpb24sIFRyYW5zaXRpb25Hcm91cCB9IGZyb20gJ3JlYWN0LXRyYW5zaXRpb24tZ3JvdXAnO1xyXG5pbXBvcnQgeyBUUkFOU0lUSU9OX0VOVEVSX0RVUkFUSU9OX01TLCBUUkFOU0lUSU9OX0VYSVRfRFVSQVRJT05fTVMsIH0gZnJvbSAnLi9jb25zdGFudHMnO1xyXG4vKipcclxuICogVVVJRCBnZW5lcmF0b3IgZm9yIG5vdGlmaWNhdGlvbnNcclxuICovXHJcbmxldCB1dWlkU2VlZCA9IDA7XHJcbmNvbnN0IGdldFV1aWQgPSAoKSA9PiB7XHJcbiAgICB1dWlkU2VlZCArPSAxO1xyXG4gICAgcmV0dXJuIGBhYy1ub3RpZmljYXRpb24tJHt1dWlkU2VlZH1gO1xyXG59O1xyXG4vKipcclxuICogVGhlIGNvbnRhaW5lciBmb3IgdGhlIG5vdGlmaWNhdGlvbnMgdGhhdCBpcyB1c2VkIGluIHRoZSBDU1MgdHJhbnNpdGlvbiBncm91cFxyXG4gKi9cclxuZnVuY3Rpb24gTm90aWZpY2F0aW9uQ29udGFpbmVyKHByb3BzKSB7XHJcbiAgICBjb25zdCB7IGlzT3BlbiwgLi4ucGFzc1Rocm91Z2hQcm9wcyB9ID0gcHJvcHM7XHJcbiAgICByZXR1cm4gKDxkaXYgY2xhc3NOYW1lPVwiYWMtbm90aWZpY2F0aW9uLWNvbnRhaW5lclwiIGNzcz17Y3NzIGBcbiAgICAgICAgcG9zaXRpb246IGZpeGVkO1xuICAgICAgICBib3R0b206ICR7dGhlbWUuc3BhY2luZy5tYXJnaW4yNH1weDtcbiAgICAgICAgcmlnaHQ6ICR7dGhlbWUuc3BhY2luZy5tYXJnaW4yNH1weDtcbiAgICAgICAgJiAuYWMtbm90aWNlICsgLmFjLW5vdGljZSB7XG4gICAgICAgICAgbWFyZ2luLXRvcDogdmFyKC0tYWMtZ2xvYmFsLWRpbWVuc2lvbi1zdGF0aWMtc2l6ZS0yMDApO1xuICAgICAgICB9XG4gICAgICBgfSB7Li4ucGFzc1Rocm91Z2hQcm9wc30+XG4gICAgICB7cHJvcHMuY2hpbGRyZW59XG4gICAgPC9kaXY+KTtcclxufVxyXG4vKipcclxuICogVGhlIG5vdGlmaWNhdGlvbnMgaG9sZGVyIChjb250YWluZXIgb3ZlcmxheSkgd2hlcmUgdGhlIG1lc3NhZ2VzIGFyZSByZW5kZXJlZFxyXG4gKi9cclxuZXhwb3J0IGNsYXNzIE5vdGlmaWNhdGlvbiBleHRlbmRzIENvbXBvbmVudCB7XHJcbiAgICBjb25zdHJ1Y3Rvcihwcm9wcykge1xyXG4gICAgICAgIHN1cGVyKHByb3BzKTtcclxuICAgICAgICB0aGlzLnN0YXRlID0ge1xyXG4gICAgICAgICAgICBub3RpY2VzOiBbXSxcclxuICAgICAgICB9O1xyXG4gICAgICAgIC8vIEJpbmQgdGhlIG1ldGhvZHNcclxuICAgICAgICB0aGlzLmFkZCA9IHRoaXMuYWRkLmJpbmQodGhpcyk7XHJcbiAgICAgICAgdGhpcy5yZW1vdmUgPSB0aGlzLnJlbW92ZS5iaW5kKHRoaXMpO1xyXG4gICAgfVxyXG4gICAgYWRkKG5vdGljZUNvbmZpZykge1xyXG4gICAgICAgIHRoaXMuc2V0U3RhdGUoe1xyXG4gICAgICAgICAgICBub3RpY2VzOiBbXHJcbiAgICAgICAgICAgICAgICAuLi50aGlzLnN0YXRlLm5vdGljZXMsXHJcbiAgICAgICAgICAgICAgICB7XHJcbiAgICAgICAgICAgICAgICAgICAgaWQ6IGdldFV1aWQoKSxcclxuICAgICAgICAgICAgICAgICAgICAuLi5ub3RpY2VDb25maWcsXHJcbiAgICAgICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICBdLFxyXG4gICAgICAgIH0pO1xyXG4gICAgfVxyXG4gICAgcmVtb3ZlKGlkKSB7XHJcbiAgICAgICAgdGhpcy5zZXRTdGF0ZSh7XHJcbiAgICAgICAgICAgIG5vdGljZXM6IHRoaXMuc3RhdGUubm90aWNlcy5maWx0ZXIobm90aWNlID0+IG5vdGljZS5pZCAhPT0gaWQpLFxyXG4gICAgICAgIH0pO1xyXG4gICAgfVxyXG4gICAgcmVuZGVyKCkge1xyXG4gICAgICAgIHJldHVybiAoPE92ZXJsYXkgaXNPcGVuPlxuICAgICAgICA8Tm90aWZpY2F0aW9uQ29udGFpbmVyIHsuLi50aGlzLnByb3BzfT5cbiAgICAgICAgICA8VHJhbnNpdGlvbkdyb3VwIGNsYXNzTmFtZT1cImFjLW5vdGljZS1saXN0XCI+XG4gICAgICAgICAgICB7dGhpcy5zdGF0ZS5ub3RpY2VzLm1hcChub3RpY2UgPT4gKDxDU1NUcmFuc2l0aW9uIGtleT17bm90aWNlLmlkfSB0aW1lb3V0PXt7XHJcbiAgICAgICAgICAgIGVudGVyOiBUUkFOU0lUSU9OX0VOVEVSX0RVUkFUSU9OX01TLFxyXG4gICAgICAgICAgICBleGl0OiBUUkFOU0lUSU9OX0VYSVRfRFVSQVRJT05fTVMsXHJcbiAgICAgICAgfX0gY2xhc3NOYW1lcz1cImlzXCIgLy8gUHJvZHVjZXMgaXMtZW50ZXJpbmcsIGV0Yy5cclxuICAgICAgICA+XG4gICAgICAgICAgICAgICAgPE5vdGljZSBrZXk9e25vdGljZS5pZH0gey4uLm5vdGljZX0gb25DbG9zZT17KCkgPT4gdGhpcy5yZW1vdmUobm90aWNlLmlkKX0vPlxuICAgICAgICAgICAgICA8L0NTU1RyYW5zaXRpb24+KSl9XG4gICAgICAgICAgPC9UcmFuc2l0aW9uR3JvdXA+XG4gICAgICAgIDwvTm90aWZpY2F0aW9uQ29udGFpbmVyPlxuICAgICAgPC9PdmVybGF5Pik7XHJcbiAgICB9XHJcbn1cclxuLy8jIHNvdXJjZU1hcHBpbmdVUkw9Tm90aWZpY2F0aW9uLmpzeC5tYXAiXX0= */")
  }, passThroughProps), props.children);
}
var Notification = /* @__PURE__ */ function(_Component) {
  _inheritsLoose2(Notification2, _Component);
  function Notification2(props) {
    var _this;
    _this = _Component.call(this, props) || this;
    _this.state = {
      notices: []
    };
    _this.add = _this.add.bind(_assertThisInitialized2(_this));
    _this.remove = _this.remove.bind(_assertThisInitialized2(_this));
    return _this;
  }
  var _proto = Notification2.prototype;
  _proto.add = function add2(noticeConfig) {
    this.setState({
      notices: [].concat(this.state.notices, [_extends2({
        id: getUuid()
      }, noticeConfig)])
    });
  };
  _proto.remove = function remove2(id2) {
    this.setState({
      notices: this.state.notices.filter(function(notice) {
        return notice.id !== id2;
      })
    });
  };
  _proto.render = function render2() {
    var _this2 = this;
    return jsx(Overlay, {
      isOpen: true
    }, jsx(NotificationContainer, this.props, jsx(TransitionGroup_default, {
      className: "ac-notice-list"
    }, this.state.notices.map(function(notice) {
      return jsx(CSSTransition_default, {
        key: notice.id,
        timeout: {
          enter: TRANSITION_ENTER_DURATION_MS,
          exit: TRANSITION_EXIT_DURATION_MS
        },
        classNames: "is"
        // Produces is-entering, etc.
      }, jsx(Notice, _extends2({
        key: notice.id
      }, notice, {
        onClose: function onClose() {
          return _this2.remove(notice.id);
        }
      })));
    }))));
  };
  return Notification2;
}(import_react35.Component);
function useNotification(options) {
  var notification = (0, import_react35.useRef)(null);
  var holderRef = (0, import_react35.useRef)(jsx(Notification, _extends2({}, options, {
    ref: notification
  })));
  var notice = (0, import_react35.useMemo)(function() {
    return function(args) {
      var _notification$current;
      return (_notification$current = notification.current) == null ? void 0 : _notification$current.add(args);
    };
  }, [notification]);
  return [notice, holderRef.current];
}
var _templateObject$5;
var appearKeyframes$2 = /* @__PURE__ */ keyframes(_templateObject$5 || (_templateObject$5 = /* @__PURE__ */ _taggedTemplateLiteralLoose2(["\n    0% {  opacity: 0; }\n    100% { opacity: 1; }\n"])));
var textFieldBaseCSS = function textFieldBaseCSS2(styleProps) {
  var _styleProps$height, _styleProps$height2;
  return /* @__PURE__ */ css("display:flex;flex-direction:row;position:relative;align-items:center;min-width:", styleProps.width ? dimensionValue(styleProps.width) : dimensionValue("static-size-3400"), ";width:", styleProps.width ? dimensionValue(styleProps.width) : "100%", ";transition:all 0.2s ease-in-out;overflow:hidden;font-size:", theme.typography.sizes.medium.fontSize, "px;box-sizing:border-box;--ac-textfield-border-color:var(--ac-global-input-field-border-color);border-bottom:1px solid var(--ac-field-border-color-override, var(--ac-textfield-border-color));.ac-textfield__input::placeholder{color:var(--ac-global-text-color-300);font-style:italic;}.ac-textfield__input{flex:1 1 auto;box-sizing:border-box;background-color:transparent;color:var(--ac-field-text-color-override, var(--ac-global-text-color-900));height:", (_styleProps$height = styleProps.height) != null ? _styleProps$height : theme.singleLineHeight, "px;transition:all 0.2s ease-in-out;outline:none;border:none;}&.ac-textfield--multiline{height:", (_styleProps$height2 = styleProps.height) != null ? _styleProps$height2 : theme.singleLineHeight, "px;", styleProps.height && "padding-top: var(--ac-global-dimension-static-size-50);", ` textarea{resize:none;overflow-y:scroll;}}input[type='search']::-webkit-search-cancel-button{-webkit-appearance:none;width:16px;height:16px;background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='rgba(255,255,255, 0.7)'><path d='M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z'/></svg>");cursor:pointer;}&.ac-textfield--nested{border:none;}--ac-validation-icon-width:var(--ac-global-dimension-size-300);` + (false ? "" : ";label:textFieldBaseCSS;"), false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */");
};
var quietTextfieldBaseCSS = /* @__PURE__ */ css("border-top:1px solid transparent;border-left:1px solid transparent;border-right:1px solid transparent;&.is-hovered:not(.is-disabled){border-bottom:1px solid var(--ac-global-input-field-border-color-active);}&.is-focused:not(.is-disabled){border-bottom:1px solid var(--ac-global-input-field-border-color-active);}&.is-disabled{border-bottom:1px solid ", theme.colors.lightGrayBorder, ";opacity:", theme.opacity.disabled, ";}&.ac-textfield--invalid:not(.is-disabled){border-bottom:1px solid var(--ac-global-color-danger);}&.ac-textfield--invalid.ac-textfield__input{padding-right:var(--ac-validation-icon-width);color:var(--ac-global-color-danger);}.ac-textfield__validation-icon{animation:", appearKeyframes$2, " ", 0.2, "s forwards ease-in-out;top:var(--ac-global-dimension-static-size-100);right:0;position:absolute;&.ac-textfield__validation-icon--invalid{color:var(--ac-global-color-danger);}}" + (false ? "" : ";label:quietTextfieldBaseCSS;"), false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */");
var standardTextfieldBaseCSS = /* @__PURE__ */ css("background-color:var(--ac-global-input-field-background-color);border-radius:", theme.borderRadius.medium, "px;border-top:1px solid var(--ac-field-border-color-override, var(--ac-textfield-border-color));border-left:1px solid var(--ac-field-border-color-override, var(--ac-textfield-border-color));border-right:1px solid var(--ac-field-border-color-override, var(--ac-textfield-border-color));&.is-hovered:not(.is-disabled){border:1px solid var(--ac-global-input-field-border-color-active);background-color:var(--ac-global-input-field-background-color-active);}&.is-focused:not(.is-disabled){border:1px solid var(--ac-global-input-field-border-color-active);background-color:var(--ac-global-input-field-background-color-active);&.ac-textfield--invalid{border:1px solid var(--ac-global-color-danger);.ac-textfield__input{color:var(--ac-global-color-danger);}}}&.is-disabled{border:1px solid ", theme.colors.lightGrayBorder, ";background-color:var(--ac-global-input-field-background-color);opacity:", theme.opacity.disabled, ";.ac-textfield__input{color:var(--ac-global-text-color-500);}}.ac-textfield__input{padding:var(--ac-global-dimension-static-size-50) var(--ac-global-dimension-static-size-100);}&.ac-textfield--invalid:not(.is-disabled){border:1px solid var(--ac-global-color-danger);.ac-textfield__input{color:var(--ac-global-color-danger);}}&.ac-textfield--invalid .ac-textfield__input{padding-right:calc(\n      ", theme.spacing.padding8, " + var(--ac-validation-icon-width) +\n        var(--ac-global-dimension-static-size-50)\n    );color:var(--ac-global-color-danger);}.ac-textfield__validation-icon{animation:", appearKeyframes$2, " ", 0.2, "s forwards ease-in-out;top:var(--ac-global-dimension-static-size-100);right:var(--ac-global-dimension-static-size-100);position:absolute;&.ac-textfield__validation-icon--invalid{color:var(--ac-global-color-danger);}}" + (false ? "" : ";label:standardTextfieldBaseCSS;"), false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */");
function TextFieldBase(props, ref) {
  var label = props.label, validationState = props.validationState, _props$isQuiet = props.isQuiet, isQuiet = _props$isQuiet === void 0 ? false : _props$isQuiet, isDisabled = props.isDisabled, isNested = props.isNested, isReadOnly = props.isReadOnly, multiLine = props.multiLine, autoFocus = props.autoFocus, inputClassName = props.inputClassName, wrapperChildren = props.wrapperChildren, _props$labelProps = props.labelProps, labelProps = _props$labelProps === void 0 ? {} : _props$labelProps, inputProps = props.inputProps, _props$descriptionPro = props.descriptionProps, descriptionProps = _props$descriptionPro === void 0 ? {} : _props$descriptionPro, _props$errorMessagePr = props.errorMessageProps, errorMessageProps = _props$errorMessagePr === void 0 ? {} : _props$errorMessagePr, inputRef = props.inputRef, isLoading = props.isLoading, loadingIndicator = props.loadingIndicator, addonBefore = props.addonBefore, className = props.className, height = props.height, width = props.width;
  var _useHover = $6179b936705e76d3$export$ae780daf29e6d456({
    isDisabled
  }), hoverProps = _useHover.hoverProps, isHovered = _useHover.isHovered;
  var _React$useState = import_react35.default.useState(false), isFocused = _React$useState[0], setIsFocused = _React$useState[1];
  var domRef = (0, import_react35.useRef)(null);
  var defaultInputRef = (0, import_react35.useRef)(null);
  inputRef = inputRef || defaultInputRef;
  (0, import_react35.useImperativeHandle)(ref, function() {
    return _extends2({}, createFocusableRef(domRef, inputRef), {
      select: function select() {
        var _inputRef;
        if ((_inputRef = inputRef) != null && _inputRef.current) {
          var _inputRef2;
          (_inputRef2 = inputRef) == null || _inputRef2.current.select();
        }
      },
      // @ts-ignore
      getInputElement: function getInputElement() {
        var _inputRef3;
        return (_inputRef3 = inputRef) == null ? void 0 : _inputRef3.current;
      }
    });
  });
  var ElementType = multiLine ? "textarea" : "input";
  var isInvalid = validationState === "invalid";
  var validation = jsx(Icon, {
    key: "validation-icon",
    className: "ac-textfield__validation-icon ac-textfield__validation-icon--" + validationState,
    svg: jsx(AlertCircleOutline, null)
  });
  var textField = jsx("div", {
    className: clsx_m_default("ac-textfield", {
      "ac-textfield--quiet": isQuiet,
      "ac-textfield--nested": isNested,
      "ac-textfield--invalid": isInvalid,
      "ac-textfield--valid": validationState === "valid",
      "ac-textfield--loadable": loadingIndicator,
      "ac-textfield--multiline": multiLine,
      "is-hovered": isHovered,
      "is-focused": isFocused,
      "is-disabled": isDisabled,
      "is-readonly": isReadOnly
    }),
    css: /* @__PURE__ */ css(textFieldBaseCSS({
      height,
      width
    }), isQuiet ? quietTextfieldBaseCSS : standardTextfieldBaseCSS, false ? "" : ";label:textField;", false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */")
  }, addonBefore != null ? jsx(AddonBefore, {
    key: "addon-before"
  }, addonBefore) : null, jsx($907718708eab68af$export$1a38b4ad7f578e1d, {
    focusRingClass: "focus-ring",
    isTextInput: true,
    autoFocus
  }, jsx(ElementType, _extends2({
    key: "element"
  }, $3ef42575df84b30b$export$9d1611c77c2fe928(inputProps, hoverProps, {
    onFocus: function onFocus() {
      setIsFocused(true);
    },
    onBlur: function onBlur() {
      return setIsFocused(false);
    }
  }), {
    ref: inputRef,
    rows: multiLine ? 1 : void 0,
    className: clsx_m_default("ac-textfield__input", inputClassName)
  }))), validationState && validationState === "invalid" && !isLoading ? validation : null, isLoading && loadingIndicator, wrapperChildren);
  if (label) {
    textField = import_react35.default.cloneElement(textField, $3ef42575df84b30b$export$9d1611c77c2fe928(textField.props, {
      className: multiLine ? "ac-textfield--multiline" : ""
    }));
  }
  return jsx(_Field, _extends2({}, props, {
    labelProps,
    descriptionProps,
    errorMessageProps,
    showErrorIcon: false,
    ref: domRef,
    wrapperClassName: className
  }), textField);
}
var _TextFieldBase = /* @__PURE__ */ (0, import_react35.forwardRef)(TextFieldBase);
function TextField(props, ref) {
  props = useProviderProps(props);
  var inputRef = (0, import_react35.useRef)(null);
  var _useTextField = $2d73ec29415bd339$export$712718f7aec83d5(props, inputRef), labelProps = _useTextField.labelProps, inputProps = _useTextField.inputProps, descriptionProps = _useTextField.descriptionProps, errorMessageProps = _useTextField.errorMessageProps;
  return jsx(_TextFieldBase, _extends2({}, props, {
    labelProps,
    inputProps,
    descriptionProps,
    errorMessageProps,
    ref,
    inputRef
  }));
}
var _TextField = /* @__PURE__ */ (0, import_react35.forwardRef)(TextField);
var DialogContext = /* @__PURE__ */ import_react35.default.createContext(null);
var _excluded$o = ["type"];
function _EMOTION_STRINGIFIED_CSS_ERROR__$o() {
  return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
}
var dialogCSS = false ? {
  name: "37zstw",
  styles: "outline:none;&.ac-dialog--slideOver{height:100vh;display:flex;flex-direction:column;&.ac-dialog--small{width:400px;}&.ac-dialog--medium{width:700px;}&.ac-dialog--large{width:900px;}&.ac-dialog--extraLarge{width:1600px;max-width:calc(100vw - var(--ac-global-dimension-static-size-1700));}&.ac-dialog--fullscreen{width:calc(100vw - var(--ac-global-dimension-static-size-1700));@media (min-width: var(--ac-global-dimension-static-breakpoint-medium)){width:calc(100vw - var(--ac-global-dimension-static-size-3400));}}}&.ac-dialog--modal{display:flex;flex-direction:column;&.ac-dialog--small{width:500px;}&.ac-dialog--medium{width:700px;}&.ac-dialog--large{width:900px;}&.ac-dialog--extraLarge{width:1600px;max-width:calc(100vw - var(--ac-global-dimension-static-size-1700));}&.ac-dialog--fullscreen{width:calc(100vw - var(--ac-global-dimension-static-size-1700));@media (min-width: var(--ac-global-dimension-static-breakpoint-medium)){width:calc(100vw - var(--ac-global-dimension-static-size-3400));}}}"
} : {
  name: "p558km-dialogCSS",
  styles: "outline:none;&.ac-dialog--slideOver{height:100vh;display:flex;flex-direction:column;&.ac-dialog--small{width:400px;}&.ac-dialog--medium{width:700px;}&.ac-dialog--large{width:900px;}&.ac-dialog--extraLarge{width:1600px;max-width:calc(100vw - var(--ac-global-dimension-static-size-1700));}&.ac-dialog--fullscreen{width:calc(100vw - var(--ac-global-dimension-static-size-1700));@media (min-width: var(--ac-global-dimension-static-breakpoint-medium)){width:calc(100vw - var(--ac-global-dimension-static-size-3400));}}}&.ac-dialog--modal{display:flex;flex-direction:column;&.ac-dialog--small{width:500px;}&.ac-dialog--medium{width:700px;}&.ac-dialog--large{width:900px;}&.ac-dialog--extraLarge{width:1600px;max-width:calc(100vw - var(--ac-global-dimension-static-size-1700));}&.ac-dialog--fullscreen{width:calc(100vw - var(--ac-global-dimension-static-size-1700));@media (min-width: var(--ac-global-dimension-static-breakpoint-medium)){width:calc(100vw - var(--ac-global-dimension-static-size-3400));}}};label:dialogCSS;",
  map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */",
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__$o
};
var sizeMap = {
  S: "small",
  M: "medium",
  L: "large",
  XL: "extraLarge",
  fullscreen: "fullscreen"
};
var _ref$e = false ? {
  name: "192cb7h",
  styles: "display:flex;flex-direction:row;.ac-dialog__dismiss-button{margin-left:var(--ac-global-dimension-static-size-100);}"
} : {
  name: "dgdwfb-Dialog",
  styles: "display:flex;flex-direction:row;.ac-dialog__dismiss-button{margin-left:var(--ac-global-dimension-static-size-100);};label:Dialog;",
  map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */",
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__$o
};
var _ref2$6 = false ? {
  name: "rze0n7",
  styles: "display:flex;flex-direction:row;justify-content:space-between;align-items:center;padding:var(--ac-global-dimension-static-size-100) var(--ac-global-dimension-static-size-200);border-bottom:1px solid var(--ac-global-border-color-dark);flex:none"
} : {
  name: "1435be7-Dialog",
  styles: "display:flex;flex-direction:row;justify-content:space-between;align-items:center;padding:var(--ac-global-dimension-static-size-100) var(--ac-global-dimension-static-size-200);border-bottom:1px solid var(--ac-global-border-color-dark);flex:none;label:Dialog;",
  map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */",
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__$o
};
function Dialog(props, ref) {
  var _classNames;
  var _ref32 = (0, import_react35.useContext)(DialogContext) || {}, _ref3$type = _ref32.type, type = _ref3$type === void 0 ? "modal" : _ref3$type, contextProps = _objectWithoutPropertiesLoose2(_ref32, _excluded$o);
  var children = props.children, _props$isDismissable = props.isDismissable, isDismissable = _props$isDismissable === void 0 ? contextProps.isDismissable : _props$isDismissable, _props$onDismiss = props.onDismiss, onDismiss = _props$onDismiss === void 0 ? contextProps.onClose : _props$onDismiss, size = props.size, title = props.title, extra = props.extra;
  var domRef = useDOMRef(ref);
  size = size || "S";
  var sizeVariant = sizeMap[size];
  var _useDialog = $40df3f8667284809$export$d55e7ee900f34e93($3ef42575df84b30b$export$9d1611c77c2fe928(contextProps, props), domRef), dialogProps = _useDialog.dialogProps, titleProps = _useDialog.titleProps;
  return jsx($9bf71ea28793e738$export$20e40289641fbbb6, {
    contain: true,
    restoreFocus: true
  }, jsx("section", _extends2({}, dialogProps, {
    className: clsx_m_default("ac-dialog", (_classNames = {}, _classNames["ac-dialog--" + sizeVariant] = sizeVariant, _classNames["ac-dialog--" + type] = type, _classNames["ac-dialog--dismissable"] = isDismissable, _classNames)),
    ref: domRef,
    css: dialogCSS
  }), jsx(_Heading, _extends2({
    level: 2
  }, titleProps, {
    css: _ref2$6
  }), title, jsx("div", {
    css: _ref$e
  }, extra, isDismissable && jsx(_Button, {
    variant: "default",
    "aria-label": "dismiss",
    onClick: onDismiss,
    icon: jsx(Icon, {
      svg: jsx(CloseOutline, null)
    }),
    size: "compact",
    className: "ac-dialog__dismiss-button"
  }))), children));
}
var _Dialog = /* @__PURE__ */ import_react35.default.forwardRef(Dialog);
function DialogContainer(props) {
  var children = props.children, _props$type = props.type, type = _props$type === void 0 ? "modal" : _props$type, onDismiss = props.onDismiss, isDismissable = props.isDismissable, isKeyboardDismissDisabled = props.isKeyboardDismissDisabled;
  var childArray = import_react35.default.Children.toArray(children);
  if (childArray.length > 1) {
    throw new Error("Only a single child can be passed to DialogContainer.");
  }
  var lastChild = (0, import_react35.useRef)(null);
  var child = import_react35.default.isValidElement(childArray[0]) ? childArray[0] : null;
  if (child) {
    lastChild.current = child;
  }
  var context2 = {
    type,
    onClose: onDismiss,
    isDismissable
  };
  return jsx(_Modal, {
    isOpen: !!child,
    onClose: onDismiss,
    type,
    isDismissable,
    isKeyboardDismissDisabled
  }, jsx(DialogContext.Provider, {
    value: context2
  }, lastChild.current));
}
var _excluded$p = ["children"];
function Content(props, ref) {
  var children = props.children, otherProps = _objectWithoutPropertiesLoose2(props, _excluded$p);
  var domRef = useDOMRef(ref);
  return jsx("section", _extends2({}, $65484d02dcb7eb3e$export$457c3d6518dd4c6f(otherProps), {
    ref: domRef,
    className: "ac-content"
  }), children);
}
var _Content = /* @__PURE__ */ (0, import_react35.forwardRef)(Content);
var _excluded$q = ["children", "elementType", "id"];
function _EMOTION_STRINGIFIED_CSS_ERROR__$p() {
  return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
}
var _ref$f = false ? {
  name: "d3v9zr",
  styles: "overflow:hidden"
} : {
  name: "6iaw3v-View",
  styles: "overflow:hidden;label:View;",
  map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlZpZXcudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQVMrRiIsImZpbGUiOiJWaWV3LnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBSZWFjdCwgeyBmb3J3YXJkUmVmIH0gZnJvbSAncmVhY3QnO1xyXG5pbXBvcnQgeyBjc3MgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XHJcbmltcG9ydCB7IHVzZURPTVJlZiB9IGZyb20gJy4uL3V0aWxzJztcclxuaW1wb3J0IHsgdXNlU3R5bGVQcm9wcywgdmlld1N0eWxlUHJvcHMgfSBmcm9tICcuLi91dGlscyc7XHJcbmltcG9ydCB7IGZpbHRlckRPTVByb3BzIH0gZnJvbSAnQHJlYWN0LWFyaWEvdXRpbHMnO1xyXG5mdW5jdGlvbiBWaWV3KHByb3BzLCByZWYpIHtcclxuICAgIGNvbnN0IHsgY2hpbGRyZW4sIGVsZW1lbnRUeXBlOiBFbGVtZW50VHlwZSA9ICdkaXYnLCBpZCwgLi4ub3RoZXJQcm9wcyB9ID0gcHJvcHM7XHJcbiAgICBjb25zdCB7IHN0eWxlUHJvcHMgfSA9IHVzZVN0eWxlUHJvcHMocHJvcHMsIHZpZXdTdHlsZVByb3BzKTtcclxuICAgIGNvbnN0IGRvbVJlZiA9IHVzZURPTVJlZihyZWYpO1xyXG4gICAgcmV0dXJuICg8RWxlbWVudFR5cGUgey4uLmZpbHRlckRPTVByb3BzKG90aGVyUHJvcHMpfSB7Li4uc3R5bGVQcm9wc30gcmVmPXtkb21SZWZ9IGNzcz17Y3NzIGBcbiAgICAgICAgb3ZlcmZsb3c6IGhpZGRlbjtcbiAgICAgIGB9IGNsYXNzTmFtZT1cImFjLXZpZXdcIiBpZD17aWR9PlxuICAgICAge2NoaWxkcmVufVxuICAgIDwvRWxlbWVudFR5cGU+KTtcclxufVxyXG4vKipcclxuICogVmlldyBpcyBhIGdlbmVyYWwgcHVycG9zZSBjb250YWluZXIgd2l0aCBubyBzcGVjaWZpYyBzZW1hbnRpY3NcclxuICogdGhhdCBjYW4gYmUgdXNlZCBmb3IgY3VzdG9tIHN0eWxpbmcgcHVycG9zZXMsIHNpbWlsYXIgdG8gYSBkaXYuXHJcbiAqL1xyXG5jb25zdCBfVmlldyA9IGZvcndhcmRSZWYoVmlldyk7XHJcbmV4cG9ydCB7IF9WaWV3IGFzIFZpZXcgfTtcclxuLy8jIHNvdXJjZU1hcHBpbmdVUkw9Vmlldy5qc3gubWFwIl19 */",
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__$p
};
function View(props, ref) {
  var children = props.children, _props$elementType = props.elementType, ElementType = _props$elementType === void 0 ? "div" : _props$elementType, id2 = props.id, otherProps = _objectWithoutPropertiesLoose2(props, _excluded$q);
  var _useStyleProps = useStyleProps(props, viewStyleProps), styleProps = _useStyleProps.styleProps;
  var domRef = useDOMRef(ref);
  return jsx(ElementType, _extends2({}, $65484d02dcb7eb3e$export$457c3d6518dd4c6f(otherProps), styleProps, {
    ref: domRef,
    css: _ref$f,
    className: "ac-view",
    id: id2
  }), children);
}
var _View = /* @__PURE__ */ (0, import_react35.forwardRef)(View);
var MenuContext = /* @__PURE__ */ import_react35.default.createContext({});
function useMenuContext() {
  return (0, import_react35.useContext)(MenuContext);
}
function MenuItem(props) {
  var item = props.item, state = props.state, isVirtualized = props.isVirtualized, onAction = props.onAction;
  var _useMenuContext = useMenuContext(), onClose = _useMenuContext.onClose, closeOnSelect = _useMenuContext.closeOnSelect;
  var rendered = item.rendered, key = item.key;
  var isSelected = state.selectionManager.isSelected(key);
  var isDisabled = state.disabledKeys.has(key);
  var ref = (0, import_react35.useRef)(null);
  var _useMenuItem = $a2e5df62f93c7633$export$9d32628fc2aea7da({
    isSelected,
    isDisabled,
    "aria-label": item["aria-label"],
    key,
    onClose,
    closeOnSelect,
    isVirtualized,
    onAction
  }, state, ref), menuItemProps = _useMenuItem.menuItemProps;
  var _useHover = $6179b936705e76d3$export$ae780daf29e6d456({
    isDisabled
  }), hoverProps = _useHover.hoverProps, isHovered = _useHover.isHovered;
  var contents = typeof rendered === "string" ? jsx(_Text, null, rendered) : rendered;
  return jsx($907718708eab68af$export$1a38b4ad7f578e1d, {
    focusRingClass: "ac-focus-ring",
    key
  }, jsx("li", _extends2({}, $3ef42575df84b30b$export$9d1611c77c2fe928(menuItemProps, hoverProps), {
    ref,
    key,
    className: clsx_m_default("ac-menu-item", {
      "is-disabled": isDisabled,
      "is-selected": isSelected,
      "is-selectable": state.selectionManager.selectionMode !== "none",
      "is-hovered": isHovered
    }),
    css: menuItemCSS
  }), contents, isSelected && jsx(Icon, {
    svg: jsx(CheckmarkOutline, null)
  })));
}
function _EMOTION_STRINGIFIED_CSS_ERROR__$q() {
  return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
}
var _ref$g = false ? {
  name: "1hcx8jb",
  styles: "padding:0"
} : {
  name: "md5iw2-MenuSection",
  styles: "padding:0;label:MenuSection;",
  map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIk1lbnVTZWN0aW9uLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUErQjJEIiwiZmlsZSI6Ik1lbnVTZWN0aW9uLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IE1lbnVJdGVtIH0gZnJvbSAnLi9NZW51SXRlbSc7XHJcbmltcG9ydCBSZWFjdCwgeyBGcmFnbWVudCB9IGZyb20gJ3JlYWN0JztcclxuaW1wb3J0IHsgdXNlTWVudVNlY3Rpb24gfSBmcm9tICdAcmVhY3QtYXJpYS9tZW51JztcclxuaW1wb3J0IHsgdXNlU2VwYXJhdG9yIH0gZnJvbSAnQHJlYWN0LWFyaWEvc2VwYXJhdG9yJztcclxuaW1wb3J0IHsgZ2V0Q2hpbGROb2RlcyB9IGZyb20gJ0ByZWFjdC1zdGF0ZWx5L2NvbGxlY3Rpb25zJztcclxuaW1wb3J0IHsgY3NzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xyXG5pbXBvcnQgdGhlbWUgZnJvbSAnLi4vdGhlbWUnO1xyXG4vKiogQHByaXZhdGUgKi9cclxuZXhwb3J0IGZ1bmN0aW9uIE1lbnVTZWN0aW9uKHByb3BzKSB7XHJcbiAgICBsZXQgeyBpdGVtLCBzdGF0ZSwgb25BY3Rpb24gfSA9IHByb3BzO1xyXG4gICAgbGV0IHsgaXRlbVByb3BzLCBoZWFkaW5nUHJvcHMsIGdyb3VwUHJvcHMgfSA9IHVzZU1lbnVTZWN0aW9uKHtcclxuICAgICAgICBoZWFkaW5nOiBpdGVtLnJlbmRlcmVkLFxyXG4gICAgICAgICdhcmlhLWxhYmVsJzogaXRlbVsnYXJpYS1sYWJlbCddLFxyXG4gICAgfSk7XHJcbiAgICBsZXQgeyBzZXBhcmF0b3JQcm9wcyB9ID0gdXNlU2VwYXJhdG9yKHtcclxuICAgICAgICBlbGVtZW50VHlwZTogJ2xpJyxcclxuICAgIH0pO1xyXG4gICAgcmV0dXJuICg8RnJhZ21lbnQ+XG4gICAgICB7aXRlbS5rZXkgIT09IHN0YXRlLmNvbGxlY3Rpb24uZ2V0Rmlyc3RLZXkoKSAmJiAoPGxpIHsuLi5zZXBhcmF0b3JQcm9wc30gY2xhc3NOYW1lPXsnYWMtbWVudS1kaXZpZGVyJ30gY3NzPXtjc3MgYFxuICAgICAgICAgICAgYm9yZGVyLWJvdHRvbTogMXB4IHNvbGlkICR7dGhlbWUuY29tcG9uZW50cy5kcm9wZG93bi5ib3JkZXJDb2xvcn07XG4gICAgICAgICAgYH0vPil9XG4gICAgICA8bGkgey4uLml0ZW1Qcm9wc30+XG4gICAgICAgIHtpdGVtLnJlbmRlcmVkICYmICg8c3BhbiB7Li4uaGVhZGluZ1Byb3BzfSBjbGFzc05hbWU9eydhYy1tZW51X19zZWN0aW9uLWhlYWRpbmcnfSBjc3M9e2NzcyBgXG4gICAgICAgICAgICAgIGRpc3BsYXk6IGlubGluZS1ibG9jaztcbiAgICAgICAgICAgICAgbWFyZ2luOiB2YXIoLS1hYy1nbG9iYWwtZGltZW5zaW9uLXN0YXRpYy1zaXplLTEwMClcbiAgICAgICAgICAgICAgICB2YXIoLS1hYy1nbG9iYWwtZGltZW5zaW9uLXN0YXRpYy1zaXplLTIwMCk7XG4gICAgICAgICAgICAgIGZvbnQtc2l6ZTogJHt0aGVtZS50eXBvZ3JhcGh5LnNpemVzLnNtYWxsLmZvbnRTaXplfXB4O1xuICAgICAgICAgICAgICBjb2xvcjogdmFyKC0tYWMtZ2xvYmFsLWNvbG9yLXRleHQtNzAwKTtcbiAgICAgICAgICAgIGB9PlxuICAgICAgICAgICAge2l0ZW0ucmVuZGVyZWR9XG4gICAgICAgICAgPC9zcGFuPil9XG4gICAgICAgIDx1bCB7Li4uZ3JvdXBQcm9wc30gY2xhc3NOYW1lPXsnYWMtbWVudSd9IGNzcz17Y3NzIGBcbiAgICAgICAgICAgIHBhZGRpbmc6IDA7XG4gICAgICAgICAgYH0+XG4gICAgICAgICAge1suLi5nZXRDaGlsZE5vZGVzKGl0ZW0sIHN0YXRlLmNvbGxlY3Rpb24pXS5tYXAobm9kZSA9PiB7XHJcbiAgICAgICAgbGV0IGl0ZW0gPSAoPE1lbnVJdGVtIGtleT17bm9kZS5rZXl9IGl0ZW09e25vZGV9IHN0YXRlPXtzdGF0ZX0gb25BY3Rpb249e29uQWN0aW9ufS8+KTtcclxuICAgICAgICBpZiAobm9kZS53cmFwcGVyKSB7XHJcbiAgICAgICAgICAgIGl0ZW0gPSBub2RlLndyYXBwZXIoaXRlbSk7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHJldHVybiBpdGVtO1xyXG4gICAgfSl9XG4gICAgICAgIDwvdWw+XG4gICAgICA8L2xpPlxuICAgIDwvRnJhZ21lbnQ+KTtcclxufVxyXG4vLyMgc291cmNlTWFwcGluZ1VSTD1NZW51U2VjdGlvbi5qc3gubWFwIl19 */",
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__$q
};
function MenuSection(props) {
  var item = props.item, state = props.state, onAction = props.onAction;
  var _useMenuSection = $3e5eb2498db5b506$export$73f7a44322579622({
    heading: item.rendered,
    "aria-label": item["aria-label"]
  }), itemProps = _useMenuSection.itemProps, headingProps = _useMenuSection.headingProps, groupProps = _useMenuSection.groupProps;
  var _useSeparator = $f4b273590fab9f93$export$52210f68a14655d0({
    elementType: "li"
  }), separatorProps = _useSeparator.separatorProps;
  return jsx(import_react35.Fragment, null, item.key !== state.collection.getFirstKey() && jsx("li", _extends2({}, separatorProps, {
    className: "ac-menu-divider",
    css: /* @__PURE__ */ css("border-bottom:1px solid ", theme.components.dropdown.borderColor, ";" + (false ? "" : ";label:MenuSection;"), false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIk1lbnVTZWN0aW9uLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFrQnNIIiwiZmlsZSI6Ik1lbnVTZWN0aW9uLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IE1lbnVJdGVtIH0gZnJvbSAnLi9NZW51SXRlbSc7XHJcbmltcG9ydCBSZWFjdCwgeyBGcmFnbWVudCB9IGZyb20gJ3JlYWN0JztcclxuaW1wb3J0IHsgdXNlTWVudVNlY3Rpb24gfSBmcm9tICdAcmVhY3QtYXJpYS9tZW51JztcclxuaW1wb3J0IHsgdXNlU2VwYXJhdG9yIH0gZnJvbSAnQHJlYWN0LWFyaWEvc2VwYXJhdG9yJztcclxuaW1wb3J0IHsgZ2V0Q2hpbGROb2RlcyB9IGZyb20gJ0ByZWFjdC1zdGF0ZWx5L2NvbGxlY3Rpb25zJztcclxuaW1wb3J0IHsgY3NzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xyXG5pbXBvcnQgdGhlbWUgZnJvbSAnLi4vdGhlbWUnO1xyXG4vKiogQHByaXZhdGUgKi9cclxuZXhwb3J0IGZ1bmN0aW9uIE1lbnVTZWN0aW9uKHByb3BzKSB7XHJcbiAgICBsZXQgeyBpdGVtLCBzdGF0ZSwgb25BY3Rpb24gfSA9IHByb3BzO1xyXG4gICAgbGV0IHsgaXRlbVByb3BzLCBoZWFkaW5nUHJvcHMsIGdyb3VwUHJvcHMgfSA9IHVzZU1lbnVTZWN0aW9uKHtcclxuICAgICAgICBoZWFkaW5nOiBpdGVtLnJlbmRlcmVkLFxyXG4gICAgICAgICdhcmlhLWxhYmVsJzogaXRlbVsnYXJpYS1sYWJlbCddLFxyXG4gICAgfSk7XHJcbiAgICBsZXQgeyBzZXBhcmF0b3JQcm9wcyB9ID0gdXNlU2VwYXJhdG9yKHtcclxuICAgICAgICBlbGVtZW50VHlwZTogJ2xpJyxcclxuICAgIH0pO1xyXG4gICAgcmV0dXJuICg8RnJhZ21lbnQ+XG4gICAgICB7aXRlbS5rZXkgIT09IHN0YXRlLmNvbGxlY3Rpb24uZ2V0Rmlyc3RLZXkoKSAmJiAoPGxpIHsuLi5zZXBhcmF0b3JQcm9wc30gY2xhc3NOYW1lPXsnYWMtbWVudS1kaXZpZGVyJ30gY3NzPXtjc3MgYFxuICAgICAgICAgICAgYm9yZGVyLWJvdHRvbTogMXB4IHNvbGlkICR7dGhlbWUuY29tcG9uZW50cy5kcm9wZG93bi5ib3JkZXJDb2xvcn07XG4gICAgICAgICAgYH0vPil9XG4gICAgICA8bGkgey4uLml0ZW1Qcm9wc30+XG4gICAgICAgIHtpdGVtLnJlbmRlcmVkICYmICg8c3BhbiB7Li4uaGVhZGluZ1Byb3BzfSBjbGFzc05hbWU9eydhYy1tZW51X19zZWN0aW9uLWhlYWRpbmcnfSBjc3M9e2NzcyBgXG4gICAgICAgICAgICAgIGRpc3BsYXk6IGlubGluZS1ibG9jaztcbiAgICAgICAgICAgICAgbWFyZ2luOiB2YXIoLS1hYy1nbG9iYWwtZGltZW5zaW9uLXN0YXRpYy1zaXplLTEwMClcbiAgICAgICAgICAgICAgICB2YXIoLS1hYy1nbG9iYWwtZGltZW5zaW9uLXN0YXRpYy1zaXplLTIwMCk7XG4gICAgICAgICAgICAgIGZvbnQtc2l6ZTogJHt0aGVtZS50eXBvZ3JhcGh5LnNpemVzLnNtYWxsLmZvbnRTaXplfXB4O1xuICAgICAgICAgICAgICBjb2xvcjogdmFyKC0tYWMtZ2xvYmFsLWNvbG9yLXRleHQtNzAwKTtcbiAgICAgICAgICAgIGB9PlxuICAgICAgICAgICAge2l0ZW0ucmVuZGVyZWR9XG4gICAgICAgICAgPC9zcGFuPil9XG4gICAgICAgIDx1bCB7Li4uZ3JvdXBQcm9wc30gY2xhc3NOYW1lPXsnYWMtbWVudSd9IGNzcz17Y3NzIGBcbiAgICAgICAgICAgIHBhZGRpbmc6IDA7XG4gICAgICAgICAgYH0+XG4gICAgICAgICAge1suLi5nZXRDaGlsZE5vZGVzKGl0ZW0sIHN0YXRlLmNvbGxlY3Rpb24pXS5tYXAobm9kZSA9PiB7XHJcbiAgICAgICAgbGV0IGl0ZW0gPSAoPE1lbnVJdGVtIGtleT17bm9kZS5rZXl9IGl0ZW09e25vZGV9IHN0YXRlPXtzdGF0ZX0gb25BY3Rpb249e29uQWN0aW9ufS8+KTtcclxuICAgICAgICBpZiAobm9kZS53cmFwcGVyKSB7XHJcbiAgICAgICAgICAgIGl0ZW0gPSBub2RlLndyYXBwZXIoaXRlbSk7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHJldHVybiBpdGVtO1xyXG4gICAgfSl9XG4gICAgICAgIDwvdWw+XG4gICAgICA8L2xpPlxuICAgIDwvRnJhZ21lbnQ+KTtcclxufVxyXG4vLyMgc291cmNlTWFwcGluZ1VSTD1NZW51U2VjdGlvbi5qc3gubWFwIl19 */")
  })), jsx("li", itemProps, item.rendered && jsx("span", _extends2({}, headingProps, {
    className: "ac-menu__section-heading",
    css: /* @__PURE__ */ css("display:inline-block;margin:var(--ac-global-dimension-static-size-100) var(--ac-global-dimension-static-size-200);font-size:", theme.typography.sizes.small.fontSize, "px;color:var(--ac-global-color-text-700);" + (false ? "" : ";label:MenuSection;"), false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIk1lbnVTZWN0aW9uLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFzQm1HIiwiZmlsZSI6Ik1lbnVTZWN0aW9uLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IE1lbnVJdGVtIH0gZnJvbSAnLi9NZW51SXRlbSc7XHJcbmltcG9ydCBSZWFjdCwgeyBGcmFnbWVudCB9IGZyb20gJ3JlYWN0JztcclxuaW1wb3J0IHsgdXNlTWVudVNlY3Rpb24gfSBmcm9tICdAcmVhY3QtYXJpYS9tZW51JztcclxuaW1wb3J0IHsgdXNlU2VwYXJhdG9yIH0gZnJvbSAnQHJlYWN0LWFyaWEvc2VwYXJhdG9yJztcclxuaW1wb3J0IHsgZ2V0Q2hpbGROb2RlcyB9IGZyb20gJ0ByZWFjdC1zdGF0ZWx5L2NvbGxlY3Rpb25zJztcclxuaW1wb3J0IHsgY3NzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xyXG5pbXBvcnQgdGhlbWUgZnJvbSAnLi4vdGhlbWUnO1xyXG4vKiogQHByaXZhdGUgKi9cclxuZXhwb3J0IGZ1bmN0aW9uIE1lbnVTZWN0aW9uKHByb3BzKSB7XHJcbiAgICBsZXQgeyBpdGVtLCBzdGF0ZSwgb25BY3Rpb24gfSA9IHByb3BzO1xyXG4gICAgbGV0IHsgaXRlbVByb3BzLCBoZWFkaW5nUHJvcHMsIGdyb3VwUHJvcHMgfSA9IHVzZU1lbnVTZWN0aW9uKHtcclxuICAgICAgICBoZWFkaW5nOiBpdGVtLnJlbmRlcmVkLFxyXG4gICAgICAgICdhcmlhLWxhYmVsJzogaXRlbVsnYXJpYS1sYWJlbCddLFxyXG4gICAgfSk7XHJcbiAgICBsZXQgeyBzZXBhcmF0b3JQcm9wcyB9ID0gdXNlU2VwYXJhdG9yKHtcclxuICAgICAgICBlbGVtZW50VHlwZTogJ2xpJyxcclxuICAgIH0pO1xyXG4gICAgcmV0dXJuICg8RnJhZ21lbnQ+XG4gICAgICB7aXRlbS5rZXkgIT09IHN0YXRlLmNvbGxlY3Rpb24uZ2V0Rmlyc3RLZXkoKSAmJiAoPGxpIHsuLi5zZXBhcmF0b3JQcm9wc30gY2xhc3NOYW1lPXsnYWMtbWVudS1kaXZpZGVyJ30gY3NzPXtjc3MgYFxuICAgICAgICAgICAgYm9yZGVyLWJvdHRvbTogMXB4IHNvbGlkICR7dGhlbWUuY29tcG9uZW50cy5kcm9wZG93bi5ib3JkZXJDb2xvcn07XG4gICAgICAgICAgYH0vPil9XG4gICAgICA8bGkgey4uLml0ZW1Qcm9wc30+XG4gICAgICAgIHtpdGVtLnJlbmRlcmVkICYmICg8c3BhbiB7Li4uaGVhZGluZ1Byb3BzfSBjbGFzc05hbWU9eydhYy1tZW51X19zZWN0aW9uLWhlYWRpbmcnfSBjc3M9e2NzcyBgXG4gICAgICAgICAgICAgIGRpc3BsYXk6IGlubGluZS1ibG9jaztcbiAgICAgICAgICAgICAgbWFyZ2luOiB2YXIoLS1hYy1nbG9iYWwtZGltZW5zaW9uLXN0YXRpYy1zaXplLTEwMClcbiAgICAgICAgICAgICAgICB2YXIoLS1hYy1nbG9iYWwtZGltZW5zaW9uLXN0YXRpYy1zaXplLTIwMCk7XG4gICAgICAgICAgICAgIGZvbnQtc2l6ZTogJHt0aGVtZS50eXBvZ3JhcGh5LnNpemVzLnNtYWxsLmZvbnRTaXplfXB4O1xuICAgICAgICAgICAgICBjb2xvcjogdmFyKC0tYWMtZ2xvYmFsLWNvbG9yLXRleHQtNzAwKTtcbiAgICAgICAgICAgIGB9PlxuICAgICAgICAgICAge2l0ZW0ucmVuZGVyZWR9XG4gICAgICAgICAgPC9zcGFuPil9XG4gICAgICAgIDx1bCB7Li4uZ3JvdXBQcm9wc30gY2xhc3NOYW1lPXsnYWMtbWVudSd9IGNzcz17Y3NzIGBcbiAgICAgICAgICAgIHBhZGRpbmc6IDA7XG4gICAgICAgICAgYH0+XG4gICAgICAgICAge1suLi5nZXRDaGlsZE5vZGVzKGl0ZW0sIHN0YXRlLmNvbGxlY3Rpb24pXS5tYXAobm9kZSA9PiB7XHJcbiAgICAgICAgbGV0IGl0ZW0gPSAoPE1lbnVJdGVtIGtleT17bm9kZS5rZXl9IGl0ZW09e25vZGV9IHN0YXRlPXtzdGF0ZX0gb25BY3Rpb249e29uQWN0aW9ufS8+KTtcclxuICAgICAgICBpZiAobm9kZS53cmFwcGVyKSB7XHJcbiAgICAgICAgICAgIGl0ZW0gPSBub2RlLndyYXBwZXIoaXRlbSk7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHJldHVybiBpdGVtO1xyXG4gICAgfSl9XG4gICAgICAgIDwvdWw+XG4gICAgICA8L2xpPlxuICAgIDwvRnJhZ21lbnQ+KTtcclxufVxyXG4vLyMgc291cmNlTWFwcGluZ1VSTD1NZW51U2VjdGlvbi5qc3gubWFwIl19 */")
  }), item.rendered), jsx("ul", _extends2({}, groupProps, {
    className: "ac-menu",
    css: _ref$g
  }), [].concat($c5a24bc478652b5f$export$1005530eda016c13(item, state.collection)).map(function(node56) {
    var item2 = jsx(MenuItem, {
      key: node56.key,
      item: node56,
      state,
      onAction
    });
    if (node56.wrapper) {
      item2 = node56.wrapper(item2);
    }
    return item2;
  }))));
}
function _EMOTION_STRINGIFIED_CSS_ERROR__$r() {
  return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
}
var menuULCSS = false ? {
  name: "z6p78r",
  styles: "background-color:var(--ac-global-menu-background-color);border-radius:var(--ac-global-rounding-small);color:var(--ac-global-color-text-900);box-shadow:0px 4px 10px rgba(0, 0, 0, 0.4);outline:none;border:1px solid var(--ac-global-menu-border-color);box-shadow:0px 4px 10px rgba(0, 0, 0, 0.4);max-height:inherit;list-style:none;margin:0;padding:var(--ac-global-dimension-static-size-50) 0"
} : {
  name: "1qqaw5j-menuULCSS",
  styles: "background-color:var(--ac-global-menu-background-color);border-radius:var(--ac-global-rounding-small);color:var(--ac-global-color-text-900);box-shadow:0px 4px 10px rgba(0, 0, 0, 0.4);outline:none;border:1px solid var(--ac-global-menu-border-color);box-shadow:0px 4px 10px rgba(0, 0, 0, 0.4);max-height:inherit;list-style:none;margin:0;padding:var(--ac-global-dimension-static-size-50) 0;label:menuULCSS;",
  map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIk1lbnUudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQVNzQiIsImZpbGUiOiJNZW51LnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IHVzZURPTVJlZiB9IGZyb20gJy4uL3V0aWxzJztcclxuaW1wb3J0IHsgTWVudUNvbnRleHQgfSBmcm9tICcuL2NvbnRleHQnO1xyXG5pbXBvcnQgeyBNZW51SXRlbSB9IGZyb20gJy4vTWVudUl0ZW0nO1xyXG5pbXBvcnQgeyBNZW51U2VjdGlvbiB9IGZyb20gJy4vTWVudVNlY3Rpb24nO1xyXG5pbXBvcnQgeyBtZXJnZVByb3BzLCB1c2VTeW5jUmVmIH0gZnJvbSAnQHJlYWN0LWFyaWEvdXRpbHMnO1xyXG5pbXBvcnQgUmVhY3QsIHsgdXNlQ29udGV4dCB9IGZyb20gJ3JlYWN0JztcclxuaW1wb3J0IHsgdXNlTWVudSB9IGZyb20gJ0ByZWFjdC1hcmlhL21lbnUnO1xyXG5pbXBvcnQgeyB1c2VUcmVlU3RhdGUgfSBmcm9tICdAcmVhY3Qtc3RhdGVseS90cmVlJztcclxuaW1wb3J0IHsgY3NzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xyXG5jb25zdCBtZW51VUxDU1MgPSBjc3MgYFxuICBiYWNrZ3JvdW5kLWNvbG9yOiB2YXIoLS1hYy1nbG9iYWwtbWVudS1iYWNrZ3JvdW5kLWNvbG9yKTtcbiAgYm9yZGVyLXJhZGl1czogdmFyKC0tYWMtZ2xvYmFsLXJvdW5kaW5nLXNtYWxsKTtcbiAgY29sb3I6IHZhcigtLWFjLWdsb2JhbC1jb2xvci10ZXh0LTkwMCk7XG4gIGJveC1zaGFkb3c6IDBweCA0cHggMTBweCByZ2JhKDAsIDAsIDAsIDAuNCk7XG4gIG91dGxpbmU6IG5vbmU7XG4gIGJvcmRlcjogMXB4IHNvbGlkIHZhcigtLWFjLWdsb2JhbC1tZW51LWJvcmRlci1jb2xvcik7XG4gIGJveC1zaGFkb3c6IDBweCA0cHggMTBweCByZ2JhKDAsIDAsIDAsIDAuNCk7XG4gIG1heC1oZWlnaHQ6IGluaGVyaXQ7XG4gIGxpc3Qtc3R5bGU6IG5vbmU7XG4gIG1hcmdpbjogMDtcbiAgcGFkZGluZzogdmFyKC0tYWMtZ2xvYmFsLWRpbWVuc2lvbi1zdGF0aWMtc2l6ZS01MCkgMDtcbmA7XHJcbmZ1bmN0aW9uIE1lbnUocHJvcHMsIHJlZikge1xyXG4gICAgbGV0IGNvbnRleHRQcm9wcyA9IHVzZUNvbnRleHQoTWVudUNvbnRleHQpO1xyXG4gICAgbGV0IGNvbXBsZXRlUHJvcHMgPSB7XHJcbiAgICAgICAgLi4ubWVyZ2VQcm9wcyhjb250ZXh0UHJvcHMsIHByb3BzKSxcclxuICAgIH07XHJcbiAgICBsZXQgZG9tUmVmID0gdXNlRE9NUmVmKHJlZik7XHJcbiAgICBsZXQgc3RhdGUgPSB1c2VUcmVlU3RhdGUoY29tcGxldGVQcm9wcyk7XHJcbiAgICBsZXQgeyBtZW51UHJvcHMgfSA9IHVzZU1lbnUoY29tcGxldGVQcm9wcywgc3RhdGUsIGRvbVJlZik7XHJcbiAgICB1c2VTeW5jUmVmKGNvbnRleHRQcm9wcywgZG9tUmVmKTtcclxuICAgIGNvbnN0IGl0ZW1zID0gQXJyYXkuZnJvbShzdGF0ZS5jb2xsZWN0aW9uKTtcclxuICAgIHJldHVybiAoPHVsIHsuLi5tZW51UHJvcHN9IHJlZj17ZG9tUmVmfSBjbGFzc05hbWU9eydhYy1tZW51J30gY3NzPXttZW51VUxDU1N9PlxuICAgICAge2l0ZW1zLm1hcChpdGVtID0+IHtcclxuICAgICAgICBpZiAoaXRlbS50eXBlID09PSAnc2VjdGlvbicpIHtcclxuICAgICAgICAgICAgcmV0dXJuICg8TWVudVNlY3Rpb24ga2V5PXtpdGVtLmtleX0gaXRlbT17aXRlbX0gc3RhdGU9e3N0YXRlfSBvbkFjdGlvbj17Y29tcGxldGVQcm9wcy5vbkFjdGlvbn0vPik7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGxldCBtZW51SXRlbSA9ICg8TWVudUl0ZW0ga2V5PXtpdGVtLmtleX0gaXRlbT17aXRlbX0gc3RhdGU9e3N0YXRlfSBvbkFjdGlvbj17Y29tcGxldGVQcm9wcy5vbkFjdGlvbn0vPik7XHJcbiAgICAgICAgaWYgKGl0ZW0ud3JhcHBlcikge1xyXG4gICAgICAgICAgICBtZW51SXRlbSA9IGl0ZW0ud3JhcHBlcihtZW51SXRlbSk7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHJldHVybiBtZW51SXRlbTtcclxuICAgIH0pfVxuICAgIDwvdWw+KTtcclxufVxyXG4vKipcclxuICogTWVudXMgZGlzcGxheSBhIGxpc3Qgb2YgYWN0aW9ucyBvciBvcHRpb25zIHRoYXQgYSB1c2VyIGNhbiBjaG9vc2UuXHJcbiAqL1xyXG4vLyBmb3J3YXJkUmVmIGRvZXNuJ3Qgc3VwcG9ydCBnZW5lcmljIHBhcmFtZXRlcnMsIHNvIGNhc3QgdGhlIHJlc3VsdCB0byB0aGUgY29ycmVjdCB0eXBlXHJcbi8vIGh0dHBzOi8vc3RhY2tvdmVyZmxvdy5jb20vcXVlc3Rpb25zLzU4NDY5MjI5L3JlYWN0LXdpdGgtdHlwZXNjcmlwdC1nZW5lcmljcy13aGlsZS11c2luZy1yZWFjdC1mb3J3YXJkcmVmXHJcbmNvbnN0IF9NZW51ID0gUmVhY3QuZm9yd2FyZFJlZihNZW51KTtcclxuZXhwb3J0IHsgX01lbnUgYXMgTWVudSB9O1xyXG4vLyMgc291cmNlTWFwcGluZ1VSTD1NZW51LmpzeC5tYXAiXX0= */",
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__$r
};
function Menu(props, ref) {
  var contextProps = (0, import_react35.useContext)(MenuContext);
  var completeProps = _extends2({}, $3ef42575df84b30b$export$9d1611c77c2fe928(contextProps, props));
  var domRef = useDOMRef(ref);
  var state = $875d6693e12af071$export$728d6ba534403756(completeProps);
  var _useMenu = $d5336fe17ce95402$export$38eaa17faae8f579(completeProps, state, domRef), menuProps = _useMenu.menuProps;
  $e7801be82b4b2a53$export$4debdb1a3f0fa79e(contextProps, domRef);
  var items = Array.from(state.collection);
  return jsx("ul", _extends2({}, menuProps, {
    ref: domRef,
    className: "ac-menu",
    css: menuULCSS
  }), items.map(function(item) {
    if (item.type === "section") {
      return jsx(MenuSection, {
        key: item.key,
        item,
        state,
        onAction: completeProps.onAction
      });
    }
    var menuItem = jsx(MenuItem, {
      key: item.key,
      item,
      state,
      onAction: completeProps.onAction
    });
    if (item.wrapper) {
      menuItem = item.wrapper(menuItem);
    }
    return menuItem;
  }));
}
var _Menu = /* @__PURE__ */ import_react35.default.forwardRef(Menu);
function MenuTrigger(props, ref) {
  var menuPopoverRef = (0, import_react35.useRef)(null);
  var triggerRef = (0, import_react35.useRef)(null);
  var domRef = useDOMRef(ref);
  var menuTriggerRef = domRef || triggerRef;
  var menuRef = (0, import_react35.useRef)(null);
  var children = props.children, _props$align = props.align, align = _props$align === void 0 ? "start" : _props$align, _props$shouldFlip = props.shouldFlip, shouldFlip = _props$shouldFlip === void 0 ? true : _props$shouldFlip, _props$direction = props.direction, direction = _props$direction === void 0 ? "bottom" : _props$direction, closeOnSelect = props.closeOnSelect, _props$trigger = props.trigger, trigger = _props$trigger === void 0 ? "press" : _props$trigger;
  var _React$Children$toArr = import_react35.default.Children.toArray(children), menuTrigger = _React$Children$toArr[0], menu = _React$Children$toArr[1];
  var state = $a28c903ee9ad8dc5$export$79fefeb1c2091ac3(props);
  var _useMenuTrigger = $168583247155ddda$export$dc9c12ed27dd1b49({
    trigger
  }, state, menuTriggerRef), menuTriggerProps = _useMenuTrigger.menuTriggerProps, menuProps = _useMenuTrigger.menuProps;
  var initialPlacement;
  switch (direction) {
    case "left":
    case "right":
    case "start":
    case "end":
      initialPlacement = direction + " " + (align === "end" ? "bottom" : "top");
      break;
    case "bottom":
    case "top":
    default:
      initialPlacement = direction + " " + align;
  }
  var _useOverlayPosition = $2a41e45df1593e64$export$d39e1813b3bdd0e1({
    targetRef: menuTriggerRef,
    overlayRef: unwrapDOMRef(menuPopoverRef),
    scrollRef: menuRef,
    placement: initialPlacement,
    shouldFlip,
    isOpen: state.isOpen,
    onClose: state.close
  }), positionProps = _useOverlayPosition.overlayProps, placement = _useOverlayPosition.placement;
  var menuContext = _extends2({}, menuProps, {
    ref: menuRef,
    onClose: state.close,
    closeOnSelect,
    autoFocus: state.focusStrategy || true,
    UNSAFE_className: "ac-menu-popover"
  });
  var contents = jsx($9bf71ea28793e738$export$20e40289641fbbb6, {
    restoreFocus: true
  }, jsx($86ea4cb521eb2e37$export$2317d149ed6f78c4, {
    onDismiss: state.close
  }), menu, jsx($86ea4cb521eb2e37$export$2317d149ed6f78c4, {
    onDismiss: state.close
  }));
  var overlay = jsx(_Popover, {
    isOpen: state.isOpen,
    style: positionProps.style,
    ref: menuPopoverRef,
    placement,
    onClose: state.close,
    shouldCloseOnBlur: true
  }, contents);
  return jsx(import_react35.Fragment, null, jsx($f1ab8c75478c6f73$export$3351871ee4b288b8, _extends2({}, menuTriggerProps, {
    ref: menuTriggerRef,
    isPressed: state.isOpen
  }), menuTrigger), jsx(MenuContext.Provider, {
    value: menuContext
  }, overlay));
}
var _MenuTrigger = /* @__PURE__ */ (0, import_react35.forwardRef)(MenuTrigger);
function _EMOTION_STRINGIFIED_CSS_ERROR__$s() {
  return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
}
var _ref$h = false ? {
  name: "1oqb35s",
  styles: "display:flex;align-items:center;.ac-icon-wrap{flex:fixed;padding-left:var(--ac-global-dimension-static-size-100);width:16px;height:16px;font-size:16px;margin-right:-4px;}"
} : {
  name: "1x1u48h-buttonChildren",
  styles: "display:flex;align-items:center;.ac-icon-wrap{flex:fixed;padding-left:var(--ac-global-dimension-static-size-100);width:16px;height:16px;font-size:16px;margin-right:-4px;};label:buttonChildren;",
  map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkFjdGlvbk1lbnUudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQWV5QyIsImZpbGUiOiJBY3Rpb25NZW51LnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IEJ1dHRvbiB9IGZyb20gJy4uL2J1dHRvbic7XHJcbmltcG9ydCB7IGZpbHRlckRPTVByb3BzIH0gZnJvbSAnQHJlYWN0LWFyaWEvdXRpbHMnO1xyXG5pbXBvcnQgeyBNZW51IH0gZnJvbSAnLi9NZW51JztcclxuaW1wb3J0IHsgTWVudVRyaWdnZXIgfSBmcm9tICcuL01lbnVUcmlnZ2VyJztcclxuaW1wb3J0IHsgQXJyb3dJb3NEb3dud2FyZE91dGxpbmUsIEljb24sIE1vcmVIb3Jpem9udGFsT3V0bGluZSB9IGZyb20gJy4uL2ljb24nO1xyXG5pbXBvcnQgUmVhY3QsIHsgZm9yd2FyZFJlZiB9IGZyb20gJ3JlYWN0JztcclxuaW1wb3J0IHsgY3NzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xyXG5mdW5jdGlvbiBBY3Rpb25NZW51KHByb3BzLCByZWYpIHtcclxuICAgIGNvbnN0IHsgY2hpbGRyZW4sIGJ1dHRvblRleHQsIGJ1dHRvblNpemUsIGJ1dHRvblZhcmlhbnQgPSAnZGVmYXVsdCcsIGljb24sIH0gPSBwcm9wcztcclxuICAgIGNvbnN0IGJ1dHRvblByb3BzID0gZmlsdGVyRE9NUHJvcHMocHJvcHMsIHsgbGFiZWxhYmxlOiB0cnVlIH0pO1xyXG4gICAgaWYgKGJ1dHRvblByb3BzWydhcmlhLWxhYmVsJ10gPT09IHVuZGVmaW5lZCkge1xyXG4gICAgICAgIGJ1dHRvblByb3BzWydhcmlhLWxhYmVsJ10gPSAnYWN0aW9ucyc7XHJcbiAgICB9XHJcbiAgICBsZXQgYnV0dG9uQ2hpbGRyZW47XHJcbiAgICBpZiAoYnV0dG9uVGV4dCkge1xyXG4gICAgICAgIGJ1dHRvbkNoaWxkcmVuID0gKDxzcGFuIGNzcz17Y3NzIGBcbiAgICAgICAgICBkaXNwbGF5OiBmbGV4O1xuICAgICAgICAgIGFsaWduLWl0ZW1zOiBjZW50ZXI7XG4gICAgICAgICAgLmFjLWljb24td3JhcCB7XG4gICAgICAgICAgICBmbGV4OiBmaXhlZDtcbiAgICAgICAgICAgIHBhZGRpbmctbGVmdDogdmFyKC0tYWMtZ2xvYmFsLWRpbWVuc2lvbi1zdGF0aWMtc2l6ZS0xMDApO1xuICAgICAgICAgICAgd2lkdGg6IDE2cHg7XG4gICAgICAgICAgICBoZWlnaHQ6IDE2cHg7XG4gICAgICAgICAgICBmb250LXNpemU6IDE2cHg7XG4gICAgICAgICAgICBtYXJnaW4tcmlnaHQ6IC00cHg7XG4gICAgICAgICAgfVxuICAgICAgICBgfT5cbiAgICAgICAge2J1dHRvblRleHR9XG4gICAgICAgIDxJY29uIHN2Zz17PEFycm93SW9zRG93bndhcmRPdXRsaW5lIC8+fS8+XG4gICAgICA8L3NwYW4+KTtcclxuICAgIH1cclxuICAgIHJldHVybiAoPE1lbnVUcmlnZ2VyIGlzT3Blbj17cHJvcHMuaXNPcGVufSBkZWZhdWx0T3Blbj17cHJvcHMuZGVmYXVsdE9wZW59IG9uT3BlbkNoYW5nZT17cHJvcHMub25PcGVuQ2hhbmdlfSBhbGlnbj17cHJvcHMuYWxpZ259IGRpcmVjdGlvbj17cHJvcHMuZGlyZWN0aW9ufSBzaG91bGRGbGlwPXtwcm9wcy5zaG91bGRGbGlwfT5cbiAgICAgIDxCdXR0b24gaWNvbj17aWNvbiA/PyA8SWNvbiBzdmc9ezxNb3JlSG9yaXpvbnRhbE91dGxpbmUgLz59Lz59IHJlZj17cmVmfSB7Li4uYnV0dG9uUHJvcHN9IGNoaWxkcmVuPXtidXR0b25DaGlsZHJlbn0gc2l6ZT17YnV0dG9uU2l6ZX0gdmFyaWFudD17YnV0dG9uVmFyaWFudH0gZGlzYWJsZWQ9e3Byb3BzLmlzRGlzYWJsZWR9Lz5cbiAgICAgIDxNZW51IGNoaWxkcmVuPXtjaGlsZHJlbn0gaXRlbXM9e3Byb3BzLml0ZW1zfSBkaXNhYmxlZEtleXM9e3Byb3BzLmRpc2FibGVkS2V5c30gb25BY3Rpb249e3Byb3BzLm9uQWN0aW9ufS8+XG4gICAgPC9NZW51VHJpZ2dlcj4pO1xyXG59XHJcbi8qKlxyXG4gKiBBY3Rpb25NZW51IGNvbWJpbmVzIGFuIEFjdGlvbkJ1dHRvbiB3aXRoIGEgTWVudSBmb3Igc2ltcGxlIFwibW9yZSBhY3Rpb25zXCIgdXNlIGNhc2VzLlxyXG4gKi9cclxuY29uc3QgX0FjdGlvbk1lbnUgPSBmb3J3YXJkUmVmKEFjdGlvbk1lbnUpO1xyXG5leHBvcnQgeyBfQWN0aW9uTWVudSBhcyBBY3Rpb25NZW51IH07XHJcbi8vIyBzb3VyY2VNYXBwaW5nVVJMPUFjdGlvbk1lbnUuanN4Lm1hcCJdfQ== */",
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__$s
};
function ActionMenu(props, ref) {
  var children = props.children, buttonText = props.buttonText, buttonSize = props.buttonSize, _props$buttonVariant = props.buttonVariant, buttonVariant = _props$buttonVariant === void 0 ? "default" : _props$buttonVariant, icon = props.icon;
  var buttonProps = $65484d02dcb7eb3e$export$457c3d6518dd4c6f(props, {
    labelable: true
  });
  if (buttonProps["aria-label"] === void 0) {
    buttonProps["aria-label"] = "actions";
  }
  var buttonChildren;
  if (buttonText) {
    buttonChildren = jsx("span", {
      css: _ref$h
    }, buttonText, jsx(Icon, {
      svg: jsx(ArrowIosDownwardOutline, null)
    }));
  }
  return jsx(_MenuTrigger, {
    isOpen: props.isOpen,
    defaultOpen: props.defaultOpen,
    onOpenChange: props.onOpenChange,
    align: props.align,
    direction: props.direction,
    shouldFlip: props.shouldFlip
  }, jsx(_Button, _extends2({
    icon: icon != null ? icon : jsx(Icon, {
      svg: jsx(MoreHorizontalOutline, null)
    }),
    ref
  }, buttonProps, {
    children: buttonChildren,
    size: buttonSize,
    variant: buttonVariant,
    disabled: props.isDisabled
  })), jsx(_Menu, {
    children,
    items: props.items,
    disabledKeys: props.disabledKeys,
    onAction: props.onAction
  }));
}
var _ActionMenu = /* @__PURE__ */ (0, import_react35.forwardRef)(ActionMenu);
function BreadcrumbItem(props) {
  var children = props.children, isCurrent = props.isCurrent, isDisabled = props.isDisabled;
  var ref = (0, import_react35.useRef)(null);
  var _useBreadcrumbItem = $dafd15390222438a$export$452b38fce62c9384(_extends2({}, props, {
    elementType: typeof children === "string" ? "span" : "a"
  }), ref), itemProps = _useBreadcrumbItem.itemProps;
  var _useHover = $6179b936705e76d3$export$ae780daf29e6d456(props), hoverProps = _useHover.hoverProps, isHovered = _useHover.isHovered;
  var element2 = import_react35.default.cloneElement(getWrappedElement(children), _extends2({}, $3ef42575df84b30b$export$9d1611c77c2fe928(itemProps, hoverProps), {
    ref,
    className: clsx_m_default("ac-breadcrumbs-item-link", {
      "is-disabled": !isCurrent && isDisabled,
      "is-hovered": isHovered
    })
  }));
  return jsx(import_react35.Fragment, null, jsx($907718708eab68af$export$1a38b4ad7f578e1d, {
    focusRingClass: "focus-ring"
  }, element2), isCurrent === false && jsx(Icon, {
    svg: jsx(ChevronRightOutline, null)
  }));
}
function _EMOTION_STRINGIFIED_CSS_ERROR__$t() {
  return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
}
var MIN_VISIBLE_ITEMS = 1;
var MAX_VISIBLE_ITEMS = 4;
var ulCSS = /* @__PURE__ */ css("flex-wrap:nowrap;flex:1 0;justify-content:flex-start;margin:0;padding:0;list-style-type:none;display:flex;color:var(--ac-global-text-color-700);li:last-of-type{font-weight:", theme.typography.weights.heavy, ";color:var(--ac-global-text-color-900);}li:not(:last-of-type):hover{text-decoration:underline;cursor:pointer;color:var(--ac-global-text-color-900);}" + (false ? "" : ";label:ulCSS;"), false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */");
var liCSS = false ? {
  name: "k9quu7",
  styles: "box-sizing:border-box;white-space:nowrap;justify-content:flex-start;align-items:center;display:inline-flex;position:relative;.ac-breadcrumbs-item-link{padding:0 var(--ac-global-dimension-static-size-50);outline:none;}.ac-icon-wrap{color:var(--ac-global-text-color-700);}"
} : {
  name: "1uzcsod-liCSS",
  styles: "box-sizing:border-box;white-space:nowrap;justify-content:flex-start;align-items:center;display:inline-flex;position:relative;.ac-breadcrumbs-item-link{padding:0 var(--ac-global-dimension-static-size-50);outline:none;}.ac-icon-wrap{color:var(--ac-global-text-color-700);};label:liCSS;",
  map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */",
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__$t
};
var _ref$i = false ? {
  name: "1d3w5wq",
  styles: "width:100%"
} : {
  name: "1c6yc9g-Breadcrumbs",
  styles: "width:100%;label:Breadcrumbs;",
  map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */",
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__$t
};
function Breadcrumbs(props, ref) {
  props = useProviderProps(props);
  var _props = props, _props$size = _props.size, size = _props$size === void 0 ? "L" : _props$size, isMultiline = _props.isMultiline, children = _props.children, showRoot = _props.showRoot, isDisabled = _props.isDisabled, onAction = _props.onAction, autoFocusCurrent = _props.autoFocusCurrent;
  var childArray = [];
  import_react35.default.Children.forEach(children, function(child) {
    if (import_react35.default.isValidElement(child)) {
      childArray.push(child);
    }
  });
  var domRef = useDOMRef(ref);
  var listRef = (0, import_react35.useRef)(null);
  var _useValueEffect = $1dbecbe27a04f9af$export$14d238f342723f25(childArray.length), visibleItems = _useValueEffect[0], setVisibleItems = _useValueEffect[1];
  var _useBreadcrumbs = $848231d7a2b3998e$export$8cefe241bd876ca0(props), navProps = _useBreadcrumbs.navProps;
  var updateOverflow = (0, import_react35.useCallback)(function() {
    var computeVisibleItems = function computeVisibleItems2(visibleItems2) {
      var currListRef = listRef.current;
      if (!currListRef) {
        return;
      }
      var listItems = Array.from(currListRef.children);
      var containerWidth = currListRef.offsetWidth;
      var isShowingMenu = childArray.length > visibleItems2;
      var calculatedWidth = 0;
      var newVisibleItems = 0;
      var maxVisibleItems = MAX_VISIBLE_ITEMS;
      if (showRoot) {
        calculatedWidth += listItems.shift().offsetWidth;
        newVisibleItems++;
      }
      if (isShowingMenu) {
        calculatedWidth += listItems.shift().offsetWidth;
        maxVisibleItems--;
      }
      if (showRoot && calculatedWidth >= containerWidth) {
        newVisibleItems--;
      }
      if (isMultiline) {
        listItems.pop();
        newVisibleItems++;
      } else {
        if (listItems.length > 0) {
          var last = listItems.pop();
          last.style.overflow = "visible";
          calculatedWidth += last.offsetWidth;
          if (calculatedWidth < containerWidth) {
            newVisibleItems++;
          }
          last.style.overflow = "";
        }
      }
      for (var _iterator = _createForOfIteratorHelperLoose(listItems.reverse()), _step; !(_step = _iterator()).done; ) {
        var breadcrumb = _step.value;
        calculatedWidth += breadcrumb.offsetWidth;
        if (calculatedWidth < containerWidth) {
          newVisibleItems++;
        }
      }
      return Math.max(MIN_VISIBLE_ITEMS, Math.min(maxVisibleItems, newVisibleItems));
    };
    setVisibleItems(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee() {
      var newVisibleItems;
      return _regeneratorRuntime().wrap(function _callee$(_context2) {
        while (1)
          switch (_context2.prev = _context2.next) {
            case 0:
              _context2.next = 2;
              return childArray.length;
            case 2:
              newVisibleItems = computeVisibleItems(childArray.length);
              _context2.next = 5;
              return newVisibleItems;
            case 5:
              if (!(newVisibleItems != null && newVisibleItems < childArray.length && newVisibleItems > 1)) {
                _context2.next = 8;
                break;
              }
              _context2.next = 8;
              return computeVisibleItems(newVisibleItems);
            case 8:
            case "end":
              return _context2.stop();
          }
      }, _callee);
    }));
  }, [childArray.length, setVisibleItems, showRoot, isMultiline]);
  $9daab02d461809db$export$683480f191c0e3ea({
    ref: domRef,
    onResize: updateOverflow
  });
  $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(updateOverflow, [children]);
  var contents = childArray;
  if (childArray.length > visibleItems) {
    var _selectedItem$key, _contents;
    var selectedItem = childArray[childArray.length - 1];
    var selectedKey = (_selectedItem$key = selectedItem.key) != null ? _selectedItem$key : childArray.length - 1;
    var onMenuAction = function onMenuAction2(key) {
      if (key !== selectedKey && onAction) {
        onAction(key);
      }
    };
    var menuItem = jsx(BreadcrumbItem, {
      key: "menu"
    }, jsx(_MenuTrigger, null, jsx(_ActionButton, {
      "aria-label": "\u2026",
      isDisabled
    }, jsx(FolderOutline, null)), jsx(_Menu, {
      selectionMode: "single",
      selectedKeys: [selectedKey],
      onAction: onMenuAction
    }, childArray)));
    contents = [menuItem];
    var breadcrumbs = [].concat(childArray);
    var endItems = visibleItems;
    if (showRoot && visibleItems > 1) {
      contents.unshift(breadcrumbs.shift());
      endItems--;
    }
    (_contents = contents).push.apply(_contents, breadcrumbs.slice(-endItems));
  }
  var lastIndex = contents.length - 1;
  var breadcrumbItems = contents.map(function(child, index) {
    var _child$key;
    var isCurrent = index === lastIndex;
    var key = (_child$key = child.key) != null ? _child$key : index;
    var onPress = function onPress2() {
      if (onAction) {
        onAction(key);
      }
    };
    return jsx("li", {
      key: index,
      className: clsx_m_default("ac-breadcrumbs-item"),
      css: liCSS
    }, jsx(BreadcrumbItem, {
      key,
      isCurrent,
      isDisabled,
      onPress,
      autoFocus: isCurrent && autoFocusCurrent
    }, child.props.children));
  });
  return jsx("nav", _extends2({}, navProps, {
    ref: domRef,
    css: _ref$i
  }), jsx("ul", {
    ref: listRef,
    className: clsx_m_default("ac-breadcrumbs", {
      "ac-breadcrumbs--small": size === "S",
      "ac-breadcrumbs--medium": size === "M",
      "ac-breadcrumbs--multiline": isMultiline,
      "ac-breadcrumbs--showRoot": showRoot,
      "is-disabled": isDisabled
    }),
    css: ulCSS
  }, breadcrumbItems));
}
var _Breadcrumbs = /* @__PURE__ */ import_react35.default.forwardRef(Breadcrumbs);
function _EMOTION_STRINGIFIED_CSS_ERROR__$u() {
  return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
}
var sliderCSS = /* @__PURE__ */ css("--ac-slider-track-height:var(--ac-global-dimension-size-30);--ac-slider-handle-width:var(--ac-global-dimension-size-250);--ac-slider-handle-height:var(--ac-global-dimension-size-250);--ac-slider-handle-halo-width:var(--ac-global-dimension-size-350);--ac-slider-handle-border-radius:var(--ac-global-dimension-size-250);--ac-slider-handle-background-color:white;--ac-slider-track-height:var(--ac-global-dimension-size-100);width:var(\n    --ac-alias-single-line-width,\n    var(--ac-global-dimension-size-2400)\n  );flex-direction:column;display:inline-flex;.ac-slider-track{height:var(--ac-slider-track-height, var(--ac-global-border-size-thick));box-sizing:border-box;z-index:1;top:calc(var(--ac-slider-height, var(--ac-alias-single-line-height)) / 2);margin-top:calc(var(--ac-slider-track-height) / -2);pointer-events:none;position:absolute;&::before{content:'';height:100%;display:block;}&:first-of-type::before,&:last-of-type::before{background:var(--ac-global-color-grey-300);}&:not(:first-of-type):not(:last-of-type)::before{background:", theme.colors.arizeLightBlue, ";}&:first-of-type{margin-left:calc(\n        var(--ac-slider-handle-width, var(--ac-global-dimension-size-200)) / 2 *\n          -1\n      );::before{border-top-left-radius:var(--ac-global-border-size-thicker);border-bottom-left-radius:var(--ac-global-border-size-thicker);}}&:last-of-type{margin-right:calc(\n        var(--ac-slider-handle-width, var(--ac-global-dimension-size-200)) / 2 *\n          -1\n      );right:0;left:auto;padding-right:0;&::before{border-top-right-radius:var(--ac-global-border-size-thicker);border-bottom-right-radius:var(--ac-global-border-size-thicker);}}}" + (false ? "" : ";label:sliderCSS;"), false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */");
var handleCSS = false ? {
  name: "7wg0rd",
  styles: "top:calc(var(--ac-slider-height, var(--ac-alias-single-line-height)) / 2);z-index:2;box-sizing:content-box;width:var(--ac-slider-handle-width, var(--ac-global-dimension-size-200));height:var(--ac-slider-handle-height, var(--ac-global-dimension-size-200));border-radius:var(\n    --ac-slider-handle-border-radius,\n    var(--ac-global-rounding-medium)\n  );transition:border-width var(--ac-slider-animation-duration, var(--ac-global-animation-duration-100)) ease-in-out;outline:none;display:inline-block;position:absolute;background-color:var(--ac-slider-handle-background-color);box-shadow:0 4px 4px 0 rgba(0, 0, 0, 0.25);&:hover::after{content:'';background:white;opacity:0.5;display:block;width:var(--ac-slider-handle-halo-width);height:var(--ac-slider-handle-halo-width);margin-left:calc(\n      calc(var(--ac-slider-handle-halo-width) - var(--ac-slider-handle-width)) /\n        -2\n    );margin-top:calc(\n      calc(var(--ac-slider-handle-halo-width) - var(--ac-slider-handle-width)) /\n        -2\n    );border-radius:var(\n      --ac-slider-handle-border-radius,\n      var(--ac-global-rounding-medium)\n    );}"
} : {
  name: "1v87sly-handleCSS",
  styles: "top:calc(var(--ac-slider-height, var(--ac-alias-single-line-height)) / 2);z-index:2;box-sizing:content-box;width:var(--ac-slider-handle-width, var(--ac-global-dimension-size-200));height:var(--ac-slider-handle-height, var(--ac-global-dimension-size-200));border-radius:var(\n    --ac-slider-handle-border-radius,\n    var(--ac-global-rounding-medium)\n  );transition:border-width var(--ac-slider-animation-duration, var(--ac-global-animation-duration-100)) ease-in-out;outline:none;display:inline-block;position:absolute;background-color:var(--ac-slider-handle-background-color);box-shadow:0 4px 4px 0 rgba(0, 0, 0, 0.25);&:hover::after{content:'';background:white;opacity:0.5;display:block;width:var(--ac-slider-handle-halo-width);height:var(--ac-slider-handle-halo-width);margin-left:calc(\n      calc(var(--ac-slider-handle-halo-width) - var(--ac-slider-handle-width)) /\n        -2\n    );margin-top:calc(\n      calc(var(--ac-slider-handle-halo-width) - var(--ac-slider-handle-width)) /\n        -2\n    );border-radius:var(\n      --ac-slider-handle-border-radius,\n      var(--ac-global-rounding-medium)\n    );};label:handleCSS;",
  map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */",
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__$u
};
var labelContainerCSS = false ? {
  name: "xfrneu",
  styles: "grid-template-columns:auto 1fr auto;grid-template-areas:'label contextualHelp value';justify-items:start;display:grid"
} : {
  name: "ndtbyn-labelContainerCSS",
  styles: "grid-template-columns:auto 1fr auto;grid-template-areas:'label contextualHelp value';justify-items:start;display:grid;label:labelContainerCSS;",
  map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */",
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__$u
};
var labelCSS$1 = false ? {
  name: "1wcz3gp",
  styles: "color:var(--ac-global-text-color-900);font-size:var(--ac-global-dimension-static-font-size-100)"
} : {
  name: "6ks9sh-labelCSS",
  styles: "color:var(--ac-global-text-color-900);font-size:var(--ac-global-dimension-static-font-size-100);label:labelCSS;",
  map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */",
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__$u
};
function _EMOTION_STRINGIFIED_CSS_ERROR__$v() {
  return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
}
var controlsCSS = false ? {
  name: "1g24h02",
  styles: "min-height:var(--ac-slider-height, var(--ac-alias-single-line-height));width:calc(\n    100% - var(--ac-slider-handle-width, var(--ac-global-dimension-size-200)) /\n      2 * 2\n  );margin-left:calc(\n    var(--ac-slider-handle-width, var(--ac-global-dimension-size-200)) / 2\n  )"
} : {
  name: "ku7lrl-controlsCSS",
  styles: "min-height:var(--ac-slider-height, var(--ac-alias-single-line-height));width:calc(\n    100% - var(--ac-slider-handle-width, var(--ac-global-dimension-size-200)) /\n      2 * 2\n  );margin-left:calc(\n    var(--ac-slider-handle-width, var(--ac-global-dimension-size-200)) / 2\n  );label:controlsCSS;",
  map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */",
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__$v
};
var _ref$j = false ? {
  name: "1jbhyes",
  styles: "grid-area:value;text-align:right;color:var(--ac-global-text-color-900)"
} : {
  name: "1rcrluv-valueNode",
  styles: "grid-area:value;text-align:right;color:var(--ac-global-text-color-900);label:valueNode;",
  map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */",
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__$v
};
function SliderBase(props, ref) {
  props = useProviderProps(props);
  var _props = props, isDisabled = _props.isDisabled, children = _props.children, classes = _props.classes, style = _props.style, _props$labelPosition = _props.labelPosition, labelPosition = _props$labelPosition === void 0 ? "top" : _props$labelPosition, getValueLabel = _props.getValueLabel, _props$showValueLabel = _props.showValueLabel, showValueLabel = _props$showValueLabel === void 0 ? !!props.label : _props$showValueLabel, formatOptions = _props.formatOptions, _props$minValue = _props.minValue, minValue = _props$minValue === void 0 ? 0 : _props$minValue, _props$maxValue = _props.maxValue, maxValue = _props$maxValue === void 0 ? 100 : _props$maxValue;
  var alwaysDisplaySign = Math.abs(Math.sign(minValue) - Math.sign(maxValue)) === 2;
  if (alwaysDisplaySign) {
    if (formatOptions != null) {
      if (!("signDisplay" in formatOptions)) {
        formatOptions = _extends2({}, formatOptions, {
          signDisplay: "exceptZero"
        });
      }
    } else {
      formatOptions = {
        signDisplay: "exceptZero"
      };
    }
  }
  var formatter3 = $a916eb452884faea$export$b7a616150fdb9f44(formatOptions);
  var state = $28f99e3e86e6ec45$export$e5fda3247f5d67f9(_extends2({}, props, {
    numberFormatter: formatter3,
    minValue,
    maxValue
  }));
  var trackRef = (0, import_react35.useRef)(null);
  var _useSlider = $bcca50147b47f54d$export$56b2c08e277f365(props, state, trackRef), groupProps = _useSlider.groupProps, trackProps = _useSlider.trackProps, labelProps = _useSlider.labelProps, outputProps = _useSlider.outputProps;
  var inputRef = (0, import_react35.useRef)(null);
  var domRef = useFocusableRef(ref, inputRef);
  var displayValue = "";
  var maxLabelLength = void 0;
  if (typeof getValueLabel === "function") {
    displayValue = getValueLabel(state.values);
    switch (state.values.length) {
      case 1:
        maxLabelLength = Math.max(getValueLabel([minValue]).length, getValueLabel([maxValue]).length);
        break;
      case 2:
        maxLabelLength = Math.max(getValueLabel([minValue, minValue]).length, getValueLabel([minValue, maxValue]).length, getValueLabel([maxValue, minValue]).length, getValueLabel([maxValue, maxValue]).length);
        break;
      default:
        throw new Error("Only sliders with 1 or 2 handles are supported!");
    }
  } else {
    maxLabelLength = Math.max([].concat(formatter3.format(minValue)).length, [].concat(formatter3.format(maxValue)).length);
    switch (state.values.length) {
      case 1:
        displayValue = state.getThumbValueLabel(0);
        break;
      case 2:
        displayValue = state.getThumbValueLabel(0) + " \u2013 " + state.getThumbValueLabel(1);
        maxLabelLength = 3 + 2 * Math.max(maxLabelLength, [].concat(formatter3.format(minValue)).length, [].concat(formatter3.format(maxValue)).length);
        break;
      default:
        throw new Error("Only sliders with 1 or 2 handles are supported!");
    }
  }
  var labelNode = jsx("label", _extends2({
    className: "ac-slider-label"
  }, labelProps, {
    css: labelCSS$1
  }), props.label);
  var valueNode = jsx("output", _extends2({}, outputProps, {
    className: "ac-slider-value",
    css: _ref$j
  }), displayValue);
  return jsx("div", _extends2({
    ref: domRef,
    className: clsx_m_default("ac-slider", {
      "ac-slider--positionTop": labelPosition === "top",
      "ac-slider--positionSide": labelPosition === "side",
      "is-disabled": isDisabled
    }, classes),
    style: _extends2({}, style)
  }, groupProps, {
    css: sliderCSS
  }), props.label && jsx("div", {
    className: "ac-slider-labelContainer",
    css: labelContainerCSS,
    role: "presentation"
  }, props.label && labelNode, labelPosition === "top" && showValueLabel && valueNode), jsx("div", _extends2({
    className: "ac-slider-controls",
    css: controlsCSS,
    ref: trackRef
  }, trackProps, {
    role: "presentation"
  }), children({
    trackRef,
    inputRef,
    state
  })), labelPosition === "side" && jsx("div", {
    className: "ac-slider-valueLabelContainer",
    role: "presentation"
  }, showValueLabel && valueNode));
}
var _SliderBase = /* @__PURE__ */ import_react35.default.forwardRef(SliderBase);
function SliderThumb(props) {
  var inputRef = props.inputRef, state = props.state;
  var backupRef = (0, import_react35.useRef)(null);
  inputRef = inputRef || backupRef;
  var _useSliderThumb = $47b897dc8cdb026b$export$8d15029008292ae(_extends2({}, props, {
    inputRef
  }), state), thumbProps = _useSliderThumb.thumbProps, inputProps = _useSliderThumb.inputProps, isDragging = _useSliderThumb.isDragging, isFocused = _useSliderThumb.isFocused;
  var _useHover = $6179b936705e76d3$export$ae780daf29e6d456({}), hoverProps = _useHover.hoverProps, isHovered = _useHover.isHovered;
  return jsx($907718708eab68af$export$1a38b4ad7f578e1d, {
    within: true,
    focusRingClass: "is-focused"
  }, jsx("div", _extends2({
    className: clsx_m_default("ac-slider-handle", {
      "is-hovered": isHovered,
      "is-dragged": isDragging,
      "is-tophandle": isFocused
    })
  }, $3ef42575df84b30b$export$9d1611c77c2fe928(thumbProps, hoverProps), {
    role: "presentation",
    css: handleCSS
  }), jsx($5c3e21d68f1c4674$export$439d29a4e110a164, null, jsx("input", _extends2({
    className: clsx_m_default("ac-slider-input"),
    ref: inputRef
  }, inputProps)))));
}
var _excluded$s = ["onChange", "onChangeEnd", "value", "defaultValue", "isFilled", "fillOffset", "trackGradient", "getValueLabel"];
function Slider(props, ref) {
  var _onChange = props.onChange, _onChangeEnd = props.onChangeEnd, value = props.value, defaultValue = props.defaultValue, isFilled = props.isFilled, fillOffset = props.fillOffset, getValueLabel = props.getValueLabel, otherProps = _objectWithoutPropertiesLoose2(props, _excluded$s);
  var baseProps = _extends2({}, otherProps, {
    // Normalize `value: number[]` to `value: number`
    value: value != null ? [value] : void 0,
    defaultValue: defaultValue != null ? [defaultValue] : void 0,
    onChange: function onChange(v4) {
      _onChange == null || _onChange(v4[0]);
    },
    onChangeEnd: function onChangeEnd(v4) {
      _onChangeEnd == null || _onChangeEnd(v4[0]);
    },
    getValueLabel: typeof getValueLabel === "function" ? (
      // @ts-ignore
      function(_ref18) {
        var v4 = _ref18[0];
        return getValueLabel(v4);
      }
    ) : void 0
  });
  return jsx(_SliderBase, _extends2({}, baseProps, {
    ref
  }), function(_ref22) {
    var trackRef = _ref22.trackRef, inputRef = _ref22.inputRef, state = _ref22.state;
    fillOffset = fillOffset != null ? $9446cca9a3875146$export$7d15b64cf5a3a4c4(fillOffset, state.getThumbMinValue(0), state.getThumbMaxValue(0)) : fillOffset;
    var lowerTrack = jsx("div", {
      className: clsx_m_default("ac-slider-track"),
      style: {
        width: state.getThumbPercent(0) * 100 + "%",
        // TODO not sure if it has advantages, but this could also be implemented as CSS calc():
        // .track::before {
        //    background-size: calc((1/ (var(--width)/100)) * 100%);
        //    width: calc(var(--width) * 1%)M
        // }
        // @ts-ignore
        "--ac-track-background-size": 1 / state.getThumbPercent(0) * 100 + "%"
      }
    });
    var upperTrack = jsx("div", {
      className: "ac-slider-track",
      style: {
        width: (1 - state.getThumbPercent(0)) * 100 + "%",
        // @ts-ignore
        "--ac-track-background-size": 1 / (1 - state.getThumbPercent(0)) * 100 + "%",
        "--ac-track-background-position": "100%"
      }
    });
    var filledTrack = null;
    if (isFilled && fillOffset != null) {
      var width = state.getThumbPercent(0) - state.getValuePercent(fillOffset);
      var isRightOfOffset = width > 0;
      var offset = isRightOfOffset ? state.getValuePercent(fillOffset) : state.getThumbPercent(0);
      filledTrack = jsx("div", {
        className: "ac-slider-fill",
        style: {
          left: offset * 100 + "%",
          width: Math.abs(width) * 100 + "%"
        }
      });
    }
    return jsx(import_react35.default.Fragment, null, lowerTrack, jsx(SliderThumb, {
      index: 0,
      isDisabled: props.isDisabled,
      trackRef,
      inputRef,
      state,
      name: props.name
    }), filledTrack, upperTrack);
  });
}
var _Slider = /* @__PURE__ */ import_react35.default.forwardRef(Slider);
var navCSS = /* @__PURE__ */ css(".ac-menu-item__selected-checkmark{visibility:hidden;}.ac-menu-item{margin-left:var(--ac-global-dimension-static-size-100);border-radius:", theme.rounding.rounding4, "px;position:relative;overflow:visible;&.is-selected{background-color:", theme.colors.gray600, ";&::before{position:absolute;display:block;content:'';background-color:", theme.colors.arizeLightBlue, ";width:4px;height:calc(100% - 4px);left:-8px;border-radius:", theme.rounding.rounding4, "px;}}&:hover{background-color:", theme.colors.gray500, ";}}" + (false ? "" : ";label:navCSS;"), false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIk5hdkxpc3QudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUttQiIsImZpbGUiOiJOYXZMaXN0LnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBSZWFjdCBmcm9tICdyZWFjdCc7XHJcbmltcG9ydCB7IExpc3RCb3ggfSBmcm9tICcuLi9saXN0Ym94JztcclxuaW1wb3J0IHsgdXNlRE9NUmVmIH0gZnJvbSAnLi4vdXRpbHMnO1xyXG5pbXBvcnQgeyBjc3MgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XHJcbmltcG9ydCB0aGVtZSBmcm9tICcuLi90aGVtZSc7XHJcbmNvbnN0IG5hdkNTUyA9IGNzcyBgXG4gIC5hYy1tZW51LWl0ZW1fX3NlbGVjdGVkLWNoZWNrbWFyayB7XG4gICAgdmlzaWJpbGl0eTogaGlkZGVuO1xuICB9XG4gIC5hYy1tZW51LWl0ZW0ge1xuICAgIG1hcmdpbi1sZWZ0OiB2YXIoLS1hYy1nbG9iYWwtZGltZW5zaW9uLXN0YXRpYy1zaXplLTEwMCk7XG4gICAgYm9yZGVyLXJhZGl1czogJHt0aGVtZS5yb3VuZGluZy5yb3VuZGluZzR9cHg7XG4gICAgcG9zaXRpb246IHJlbGF0aXZlO1xuICAgIG92ZXJmbG93OiB2aXNpYmxlO1xuICAgICYuaXMtc2VsZWN0ZWQge1xuICAgICAgYmFja2dyb3VuZC1jb2xvcjogJHt0aGVtZS5jb2xvcnMuZ3JheTYwMH07XG4gICAgICAmOjpiZWZvcmUge1xuICAgICAgICBwb3NpdGlvbjogYWJzb2x1dGU7XG4gICAgICAgIGRpc3BsYXk6IGJsb2NrO1xuICAgICAgICBjb250ZW50OiAnJztcbiAgICAgICAgYmFja2dyb3VuZC1jb2xvcjogJHt0aGVtZS5jb2xvcnMuYXJpemVMaWdodEJsdWV9O1xuICAgICAgICB3aWR0aDogNHB4O1xuICAgICAgICBoZWlnaHQ6IGNhbGMoMTAwJSAtIDRweCk7XG4gICAgICAgIGxlZnQ6IC04cHg7XG4gICAgICAgIGJvcmRlci1yYWRpdXM6ICR7dGhlbWUucm91bmRpbmcucm91bmRpbmc0fXB4O1xuICAgICAgfVxuICAgIH1cbiAgICAmOmhvdmVyIHtcbiAgICAgIGJhY2tncm91bmQtY29sb3I6ICR7dGhlbWUuY29sb3JzLmdyYXk1MDB9O1xuICAgIH1cbiAgfVxuYDtcclxuZnVuY3Rpb24gTmF2TGlzdChwcm9wcywgcmVmKSB7XHJcbiAgICBjb25zdCB7IGRlZmF1bHRTZWxlY3RlZEtleSwgb25TZWxlY3Rpb25DaGFuZ2UsIC4uLmxpc3RCb3hQcm9wcyB9ID0gcHJvcHM7XHJcbiAgICBjb25zdCBkb21SZWYgPSB1c2VET01SZWYocmVmKTtcclxuICAgIHJldHVybiAoPG5hdiByZWY9e2RvbVJlZn0gY3NzPXtuYXZDU1N9IGNsYXNzTmFtZT1cImFjLW5hdi1saXN0XCI+XG4gICAgICA8TGlzdEJveCB7Li4ubGlzdEJveFByb3BzfSBzZWxlY3Rpb25Nb2RlPVwic2luZ2xlXCIgZGVmYXVsdFNlbGVjdGVkS2V5cz17ZGVmYXVsdFNlbGVjdGVkS2V5ID8gW2RlZmF1bHRTZWxlY3RlZEtleV0gOiB1bmRlZmluZWR9IG9uU2VsZWN0aW9uQ2hhbmdlPXtrZXlzID0+IHtcclxuICAgICAgICBpZiAoa2V5cyAhPT0gJ2FsbCcgJiYgb25TZWxlY3Rpb25DaGFuZ2UpIHtcclxuICAgICAgICAgICAgb25TZWxlY3Rpb25DaGFuZ2Uoa2V5cy52YWx1ZXMoKS5uZXh0KCkudmFsdWUpO1xyXG4gICAgICAgIH1cclxuICAgIH19IGRpc2FsbG93RW1wdHlTZWxlY3Rpb24+PC9MaXN0Qm94PlxuICAgIDwvbmF2Pik7XHJcbn1cclxuLyoqXHJcbiAqIEEgbGlzdCBvZiBuYXZpZ2F0aW9uYWwgaXRlbXNcclxuICovXHJcbmNvbnN0IF9OYXZMaXN0ID0gUmVhY3QuZm9yd2FyZFJlZihOYXZMaXN0KTtcclxuZXhwb3J0IHsgX05hdkxpc3QgYXMgTmF2TGlzdCB9O1xyXG4vLyMgc291cmNlTWFwcGluZ1VSTD1OYXZMaXN0LmpzeC5tYXAiXX0= */");
var _templateObject$6;
var _templateObject2;
var _templateObject3;
var fillMask1 = /* @__PURE__ */ keyframes(_templateObject$6 || (_templateObject$6 = /* @__PURE__ */ _taggedTemplateLiteralLoose2([" \n  11.86% {\n    transform: rotate(0deg);\n  }\n\n  13.56% {\n    transform: rotate(0deg);\n  }\n\n  15.25% {\n    transform: rotate(0deg);\n  }\n\n  16.95% {\n    transform: rotate(0deg);\n  }\n\n  18.64% {\n    transform: rotate(0deg);\n  }\n\n  20.34% {\n    transform: rotate(0deg);\n  }\n\n  22.03% {\n    transform: rotate(0deg);\n  }\n\n  23.73% {\n    transform: rotate(0deg);\n  }\n\n  25.42% {\n    transform: rotate(0deg);\n  }\n\n  27.12% {\n    transform: rotate(0deg);\n  }\n\n  28.81% {\n    transform: rotate(0deg);\n  }\n\n  30.51% {\n    transform: rotate(0deg);\n  }\n\n  32.2% {\n    transform: rotate(0deg);\n  }\n\n  33.9% {\n    transform: rotate(0deg);\n  }\n\n  35.59% {\n    transform: rotate(0deg);\n  }\n\n  37.29% {\n    transform: rotate(0deg);\n  }\n\n  38.98% {\n    transform: rotate(0deg);\n  }\n\n  40.68% {\n    transform: rotate(0deg);\n  }\n\n  42.37% {\n    transform: rotate(5.3deg);\n  }\n\n  44.07% {\n    transform: rotate(13.4deg);\n  }\n\n  45.76% {\n    transform: rotate(20.6deg);\n  }\n\n  47.46% {\n    transform: rotate(29deg);\n  }\n\n  49.15% {\n    transform: rotate(36.5deg);\n  }\n\n  50.85% {\n    transform: rotate(42.6deg);\n  }\n\n  52.54% {\n    transform: rotate(48.8deg);\n  }\n\n  54.24% {\n    transform: rotate(54.2deg);\n  }\n\n  55.93% {\n    transform: rotate(59.4deg);\n  }\n\n  57.63% {\n    transform: rotate(63.2deg);\n  }\n\n  59.32% {\n    transform: rotate(67.2deg);\n  }\n\n  61.02% {\n    transform: rotate(70.8deg);\n  }\n\n  62.71% {\n    transform: rotate(73.8deg);\n  }\n\n  64.41% {\n    transform: rotate(76.2deg);\n  }\n\n  66.1% {\n    transform: rotate(78.7deg);\n  }\n\n  67.8% {\n    transform: rotate(80.6deg);\n  }\n\n  69.49% {\n    transform: rotate(82.6deg);\n  }\n\n  71.19% {\n    transform: rotate(83.7deg);\n  }\n\n  72.88% {\n    transform: rotate(85deg);\n  }\n\n  74.58% {\n    transform: rotate(86.3deg);\n  }\n\n  76.27% {\n    transform: rotate(87deg);\n  }\n\n  77.97% {\n    transform: rotate(87.7deg);\n  }\n\n  79.66% {\n    transform: rotate(88.3deg);\n  }\n\n  81.36% {\n    transform: rotate(88.6deg);\n  }\n\n  83.05% {\n    transform: rotate(89.2deg);\n  }\n\n  84.75% {\n    transform: rotate(89.2deg);\n  }\n\n  86.44% {\n    transform: rotate(89.5deg);\n  }\n\n  88.14% {\n    transform: rotate(89.9deg);\n  }\n\n  89.83% {\n    transform: rotate(89.7deg);\n  }\n\n  91.53% {\n    transform: rotate(90.1deg);\n  }\n\n  93.22% {\n    transform: rotate(90.2deg);\n  }\n\n  94.92% {\n    transform: rotate(90.1deg);\n  }\n\n  96.61% {\n    transform: rotate(90deg);\n  }\n\n  98.31% {\n    transform: rotate(89.8deg);\n  }\n\n  100% {\n    transform: rotate(90deg);\n  }\n"])));
var fillMask2 = /* @__PURE__ */ keyframes(_templateObject2 || (_templateObject2 = /* @__PURE__ */ _taggedTemplateLiteralLoose2(["  \n  0% {\n    transform: rotate(180deg);\n  }\n\n  1.69% {\n    transform: rotate(180deg);\n  }\n\n  3.39% {\n    transform: rotate(180deg);\n  }\n\n  5.08% {\n    transform: rotate(180deg);\n  }\n\n  6.78% {\n    transform: rotate(180deg);\n  }\n\n  8.47% {\n    transform: rotate(180deg);\n  }\n\n  10.17% {\n    transform: rotate(179.2deg);\n  }\n\n  11.86% {\n    transform: rotate(164deg);\n  }\n\n  13.56% {\n    transform: rotate(151.8deg);\n  }\n\n  15.25% {\n    transform: rotate(140.8deg);\n  }\n\n  16.95% {\n    transform: rotate(130.3deg);\n  }\n\n  18.64% {\n    transform: rotate(120.4deg);\n  }\n\n  20.34% {\n    transform: rotate(110.8deg);\n  }\n\n  22.03% {\n    transform: rotate(101.6deg);\n  }\n\n  23.73% {\n    transform: rotate(93.5deg);\n  }\n\n  25.42% {\n    transform: rotate(85.4deg);\n  }\n\n  27.12% {\n    transform: rotate(78.1deg);\n  }\n\n  28.81% {\n    transform: rotate(71.2deg);\n  }\n\n  30.51% {\n    transform: rotate(89.1deg);\n  }\n\n  32.2% {\n    transform: rotate(105.5deg);\n  }\n\n  33.9% {\n    transform: rotate(121.3deg);\n  }\n\n  35.59% {\n    transform: rotate(135.5deg);\n  }\n\n  37.29% {\n    transform: rotate(148.4deg);\n  }\n\n  38.98% {\n    transform: rotate(161deg);\n  }\n\n  40.68% {\n    transform: rotate(173.5deg);\n  }\n\n  42.37% {\n    transform: rotate(180deg);\n  }\n\n  44.07% {\n    transform: rotate(180deg);\n  }\n\n  45.76% {\n    transform: rotate(180deg);\n  }\n\n  47.46% {\n    transform: rotate(180deg);\n  }\n\n  49.15% {\n    transform: rotate(180deg);\n  }\n\n  50.85% {\n    transform: rotate(180deg);\n  }\n\n  52.54% {\n    transform: rotate(180deg);\n  }\n\n  54.24% {\n    transform: rotate(180deg);\n  }\n\n  55.93% {\n    transform: rotate(180deg);\n  }\n\n  57.63% {\n    transform: rotate(180deg);\n  }\n\n  59.32% {\n    transform: rotate(180deg);\n  }\n\n  61.02% {\n    transform: rotate(180deg);\n  }\n\n  62.71% {\n    transform: rotate(180deg);\n  }\n\n  64.41% {\n    transform: rotate(180deg);\n  }\n\n  66.1% {\n    transform: rotate(180deg);\n  }\n\n  67.8% {\n    transform: rotate(180deg);\n  }\n\n  69.49% {\n    transform: rotate(180deg);\n  }\n\n  71.19% {\n    transform: rotate(180deg);\n  }\n\n  72.88% {\n    transform: rotate(180deg);\n  }\n\n  74.58% {\n    transform: rotate(180deg);\n  }\n\n  76.27% {\n    transform: rotate(180deg);\n  }\n\n  77.97% {\n    transform: rotate(180deg);\n  }\n\n  79.66% {\n    transform: rotate(180deg);\n  }\n\n  81.36% {\n    transform: rotate(180deg);\n  }\n\n  83.05% {\n    transform: rotate(180deg);\n  }\n\n  84.75% {\n    transform: rotate(180deg);\n  }\n\n  86.44% {\n    transform: rotate(180deg);\n  }\n\n  88.14% {\n    transform: rotate(180deg);\n  }\n\n  89.83% {\n    transform: rotate(180deg);\n  }\n\n  91.53% {\n    transform: rotate(180deg);\n  }\n\n  93.22% {\n    transform: rotate(180deg);\n  }\n\n  94.92% {\n    transform: rotate(180deg);\n  }\n\n  96.61% {\n    transform: rotate(180deg);\n  }\n\n  98.31% {\n    transform: rotate(180deg);\n  }\n\n  100% {\n    transform: rotate(180deg);\n  }\n"])));
var fillsRotate = /* @__PURE__ */ keyframes(_templateObject3 || (_templateObject3 = /* @__PURE__ */ _taggedTemplateLiteralLoose2(["\n  0% {\n    transform: rotate(-90deg);\n  }\n  100% {\n    transform: rotate(270deg);\n  }\n"])));
var progressCircleCSS = /* @__PURE__ */ css("--progress-circle-track-border-color:var(--ac-global-color-grey-300);--progress-circle-fill-border-color:var(--ac-global-color-primary);--progress-circle-size:32px;--progress-circle-thickness:3px;--progress-circle-track-border-style:solid;&.ac-progress-circle--small{--progress-circle-size:16px;--progress-circle-thickness:2px;}&.ac-progress-circle--medium{--progress-circle-size:32px;--progress-circle-thickness:3px;}&.ac-progress-circle--large{--progress-circle-size:64px;--progress-circle-thickness:4px;}&.ac-progress-circle{display:inline-block;inline-size:var(--progress-circle-size);block-size:var(--progress-circle-size);position:relative;direction:ltr;transform:translate3d(0, 0, 0);}.ac-progress-circle-track{box-sizing:border-box;inline-size:var(--progress-circle-size);block-size:var(--progress-circle-size);border-style:var(--progress-circle-track-border-style);border-width:var(--progress-circle-thickness);border-radius:var(--progress-circle-size);border-color:var(--progress-circle-track-border-color);}.ac-progress-circle-fills{position:absolute;inset-block-start:0;inset-inline-start:0;inline-size:100%;block-size:100%;}.ac-progress-circle-fill{box-sizing:border-box;inline-size:var(--progress-circle-size);block-size:var(--progress-circle-size);border-style:solid;border-width:var(\n      --mod-progress-circle-thickness,\n      var(--progress-circle-thickness)\n    );border-radius:var(--mod-progress-circle-size, var(--progress-circle-size));border-color:var(--progress-circle-fill-border-color);}.ac-progress-circle-fillMask1,.ac-progress-circle-fillMask2{inline-size:50%;block-size:100%;transform-origin:100% center;transform:rotate(180deg);overflow:hidden;position:absolute;}.ac-progress-circle-fillSubMask1,.ac-progress-circle-fillSubMask2{inline-size:100%;block-size:100%;transform-origin:100% center;overflow:hidden;transform:rotate(-180deg);}.ac-progress-circle-fillMask2{transform:rotate(0deg);}&.ac-progress-circle--indeterminate{.ac-progress-circle-fills{will-change:transform;transform:translateZ(0);animation:1s infinite cubic-bezier(0.25, 0.78, 0.48, 0.89) ", fillsRotate, ";transform-origin:center;}.ac-progress-circle-fillSubMask1{will-change:transform;transform:translateZ(0);animation:1s infinite linear ", fillMask1, ";}.ac-progress-circle-fillSubMask2{will-change:transform;transform:translateZ(0);animation:1s infinite linear ", fillMask2, ";}}" + (false ? "" : ";label:progressCircleCSS;"), false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */");
function ProgressCircle(props, ref) {
  var _props$value = props.value, value = _props$value === void 0 ? 0 : _props$value, _props$minValue = props.minValue, minValue = _props$minValue === void 0 ? 0 : _props$minValue, _props$maxValue = props.maxValue, maxValue = _props$maxValue === void 0 ? 100 : _props$maxValue, _props$size = props.size, size = _props$size === void 0 ? "M" : _props$size, _props$isIndeterminat = props.isIndeterminate, isIndeterminate = _props$isIndeterminat === void 0 ? false : _props$isIndeterminat, ariaLabel = props["aria-label"], ariaLabelledby = props["aria-labelledby"];
  var domRef = useDOMRef(ref);
  value = $9446cca9a3875146$export$7d15b64cf5a3a4c4(value, minValue, maxValue);
  var _useProgressBar = $204d9ebcedfb8806$export$ed5abd763a836edc(_extends2({}, props, {
    value
  })), progressBarProps = _useProgressBar.progressBarProps;
  var subMask1Style = {};
  var subMask2Style = {};
  if (!isIndeterminate) {
    var percentage = (value - minValue) / (maxValue - minValue) * 100;
    var angle;
    if (percentage > 0 && percentage <= 50) {
      angle = -180 + percentage / 50 * 180;
      subMask1Style.transform = "rotate(" + angle + "deg)";
      subMask2Style.transform = "rotate(-180deg)";
    } else if (percentage > 50) {
      angle = -180 + (percentage - 50) / 50 * 180;
      subMask1Style.transform = "rotate(0deg)";
      subMask2Style.transform = "rotate(" + angle + "deg)";
    }
  }
  if (!ariaLabel && !ariaLabelledby) {
    console.warn("ProgressCircle requires an aria-label or aria-labelledby attribute for accessibility");
  }
  return jsx("div", _extends2({}, progressBarProps, {
    ref: domRef,
    css: progressCircleCSS,
    className: clsx_m_default("ac-progress-circle", {
      "ac-progress-circle--indeterminate": isIndeterminate,
      "ac-progress-circle--small": size === "S",
      "ac-progress-circle--large": size === "L"
    })
  }), jsx("div", {
    className: "ac-progress-circle-track"
  }), jsx("div", {
    className: "ac-progress-circle-fills"
  }, jsx("div", {
    className: "ac-progress-circle-fillMask1"
  }, jsx("div", {
    className: "ac-progress-circle-fillSubMask1",
    "data-testid": "fillSubMask1",
    style: subMask1Style
  }, jsx("div", {
    className: "ac-progress-circle-fill"
  }))), jsx("div", {
    className: "ac-progress-circle-fillMask2"
  }, jsx("div", {
    className: "ac-progress-circle-fillSubMask2",
    "data-testid": "fillSubMask2",
    style: subMask2Style
  }, jsx("div", {
    className: "ac-progress-circle-fill"
  })))));
}
var _ProgressCircle = /* @__PURE__ */ import_react35.default.forwardRef(ProgressCircle);
var switchCSS = /* @__PURE__ */ css("--ac-switch-label-color-disabled:var(--ac-global-text-color-500);--ac-switch-background-color:var(--ac-global-color-grey-300);--ac-switch-background-color-disabled:var(--ac-global-color-grey-300);--ac-switch-background-color-selected:var(--ac-global-color-primary-900);--ac-switch-handle-background-color:white;--ac-switch-handle-background-color-selected:var(--ac-global-color-primary);--ac-switch-min-height:30px;--ac-switch-rail-width:34px;--ac-switch-rail-height:14px;--ac-switch-handle-size:20px;--ac-switch-halo-size:28px;--ac-switch-control-label-spacing:var(--ac-global-dimension-static-size-100);--ac-switch-spacing-top-to-control:10px;--ac-switch-spacing-top-to-label:3px;--ac-switch-spacing-label-to-handle:var(\n    --ac-global-dimension-static-size-100\n  );--ac-switch-font-size:", theme.typography.sizes.medium.fontSize, "px;&.ac-switch{display:inline-flex;align-items:flex-start;position:relative;min-block-size:", theme.typography.sizes.medium.lineHeight, "px;max-inline-size:100%;vertical-align:top;}&.ac-switch--label-placement-start{flex-direction:row-reverse;gap:var(--ac-switch-spacing-label-to-handle);}&.ac-switch--label-placement-end{flex-direction:row;gap:var(--ac-switch-spacing-label-to-handle);}&.is-disabled{opacity:", theme.opacity.disabled, ";.ac-switch-input{cursor:not-allowed;}}&.is-hovered,&.is-selected{&:after{background-color:var(--ac-switch-handle-background-color-selected);height:100px;width:100px;border-radius:50%;}}.ac-switch-element{display:inline-block;box-sizing:border-box;position:relative;inline-size:var(--ac-switch-rail-width);margin-block:calc(\n      var(--ac-switch-min-height) - var(--ac-switch-rail-height) -\n        var(--ac-switch-spacing-top-to-control)\n    );margin-inline:0;flex-grow:0;flex-shrink:0;vertical-align:middle;transition:background 100ms ease-in-out,border 100ms ease-in-out;block-size:var(--ac-switch-rail-height);inset-inline-start:0;inset-inline-end:0;border-radius:calc(var(--ac-switch-rail-height) / 2);background-color:var(--ac-switch-background-color);&:before{display:block;position:absolute;content:'';box-sizing:border-box;transition:background 100ms ease-in-out,border 100ms ease-in-out,transform 100ms ease-in-out,box-shadow 100ms ease-in-out;inline-size:var(--ac-switch-handle-size);block-size:var(--ac-switch-handle-size);inset-block-start:calc(\n        -1 * (var(--ac-switch-handle-size) - var(--ac-switch-rail-height)) / 2\n      );inset-inline-start:0;border-radius:calc(var(--ac-switch-handle-size) / 2);background-color:var(--ac-switch-handle-background-color);box-shadow:0 4px 4px 0 rgba(0, 0, 0, 0.25);}&:after{display:block;position:absolute;content:'';box-sizing:border-box;transition:background 100ms ease-in-out,border 100ms ease-in-out,transform 100ms ease-in-out,box-shadow 100ms ease-in-out;inline-size:var(--ac-switch-halo-size);block-size:var(--ac-switch-halo-size);inset-block-start:calc(var(--ac-switch-halo-size) / -4);inset-inline-start:calc(\n        -1 * (var(--ac-switch-halo-size) - var(--ac-switch-handle-size)) / 2\n      );border-radius:calc(var(--ac-switch-halo-size) / 2);box-shadow:0 4px 4px 0 rgba(0, 0, 0, 0.5);background-color:var(--ac-switch-handle-background-color);opacity:0;}}.ac-switch-input{margin:0;box-sizing:border-box;padding:0;position:absolute;inline-size:100%;block-size:100%;inset-block-start:0;inset-inline-start:0;opacity:0;z-index:1;cursor:pointer;}.ac-switch-label{color:var(--ac-global-text-color-900);margin-block-start:var(--ac-switch-spacing-top-to-label);margin-block-end:0;font-size:var(--ac-switch-font-size);line-height:", theme.typography.sizes.medium.lineHeight, "px;transition:color 200ms ease-in-out;}&.is-selected .ac-switch-element{background-color:var(--ac-switch-background-color-selected);&:before{border-color:var(--ac-switch-handle-border-color-selected);transform:translateX(calc(var(--ac-switch-rail-width) - 100%));background-color:var(--ac-switch-handle-background-color-selected);}&:after{border-color:var(--ac-switch-handle-border-color-selected);transform:translateX(calc(100% - var(--ac-switch-halo-size) / 2));background-color:var(--ac-switch-handle-background-color-selected);}}&.is-hovered .ac-switch-element{&:after{opacity:0.4;}}" + (false ? "" : ";label:switchCSS;"), false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */");
function Switch(props, ref) {
  var isDisabled = props.isDisabled, autoFocus = props.autoFocus, children = props.children, _props$labelPlacement = props.labelPlacement, labelPlacement = _props$labelPlacement === void 0 ? "end" : _props$labelPlacement;
  var _useHover = $6179b936705e76d3$export$ae780daf29e6d456({
    isDisabled
  }), hoverProps = _useHover.hoverProps, isHovered = _useHover.isHovered;
  var domRef = useFocusableRef(ref);
  var inputRef = (0, import_react35.useRef)(null);
  var state = $3017fa7ffdddec74$export$8042c6c013fd5226(props);
  var _useSwitch = $b418ec0c85c52f27$export$d853f7095ae95f88(props, state, inputRef), inputProps = _useSwitch.inputProps;
  return jsx("label", _extends2({}, hoverProps, {
    ref: domRef,
    className: clsx_m_default({
      "ac-switch": true,
      "ac-switch--label-placement-end": labelPlacement === "end",
      "ac-switch--label-placement-start": labelPlacement === "start",
      "is-disabled": isDisabled,
      "is-hovered": isHovered,
      "is-selected": state.isSelected
    }),
    css: switchCSS
  }), jsx($907718708eab68af$export$1a38b4ad7f578e1d, {
    focusRingClass: "focus-ring",
    autoFocus
  }, jsx("input", _extends2({}, inputProps, {
    ref: inputRef,
    className: clsx_m_default("ac-switch-input")
  }))), jsx("span", {
    className: "ac-switch-element"
  }), children && jsx("span", {
    className: "ac-switch-label"
  }, children));
}
var _Switch = /* @__PURE__ */ (0, import_react35.forwardRef)(Switch);
var EmptyDocumentsSVG = function EmptyDocumentsSVG2(props) {
  var id2 = (0, import_react35.useId)();
  var linearGradientIdPrefix = "#" + id2 + "-linear-gradient";
  var _useStyleProps = useStyleProps(props), styleProps = _useStyleProps.styleProps;
  return jsx("svg", _extends2({
    xmlns: "http://www.w3.org/2000/svg",
    xmlnsXlink: "http://www.w3.org/1999/xlink",
    viewBox: "0 0 140 164"
  }, styleProps, {
    css: /* @__PURE__ */ css(".cls-1{isolation:isolate;}.cls-2{fill:var(--ac-global-color-grey-200);}.cls-3,.cls-9{fill:none;stroke-linecap:round;stroke-miterlimit:10;}.cls-3{stroke:var(--ac-global-color-primary);stroke-width:1.21px;stroke-dasharray:0 6.2;}.cls-4{mix-blend-mode:multiply;opacity:0.18;}.cls-5{fill:url(", linearGradientIdPrefix, ");}.cls-6{fill:url(", linearGradientIdPrefix, "-2);}.cls-7{fill:url(", linearGradientIdPrefix, "-3);}.cls-8{fill:url(", linearGradientIdPrefix, "-4);}.cls-9{stroke:var(--ac-global-color-primary);stroke-width:2px;}" + (false ? "" : ";label:EmptyDocumentsSVG;"), false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */")
  }), jsx("defs", null, jsx("linearGradient", {
    id: id2 + "-linear-gradient",
    x1: "106.26",
    y1: "82.71",
    x2: "20.35",
    y2: "96.39",
    gradientUnits: "userSpaceOnUse"
  }, jsx("stop", {
    offset: "0",
    stopColor: "#38424e"
  }), jsx("stop", {
    offset: "1",
    stopColor: "#636a71"
  })), jsx("linearGradient", {
    id: id2 + "-linear-gradient-2",
    x1: "100.49",
    y1: "4.2",
    x2: "100.49",
    y2: "20.69",
    gradientTransform: "translate(-9.43 38.61) rotate(-8.26)",
    gradientUnits: "userSpaceOnUse"
  }, jsx("stop", {
    offset: "0",
    stopColor: "#636a71"
  }), jsx("stop", {
    offset: "1",
    stopColor: "#38424e"
  })), jsx("linearGradient", {
    id: id2 + "-linear-gradient-3",
    x1: "118.29",
    y1: "66.59",
    x2: "32.38",
    y2: "80.27",
    xlinkHref: "" + linearGradientIdPrefix
  }), jsx("linearGradient", {
    id: id2 + "-linear-gradient-4",
    x1: "114.72",
    y1: "-10.03",
    x2: "114.72",
    y2: "6.47",
    xlinkHref: linearGradientIdPrefix + "-2"
  })), jsx("g", {
    className: "cls-1"
  }, jsx("g", {
    id: "Layer_2",
    "data-name": "Layer 2"
  }, jsx("g", null, jsx("circle", {
    className: "cls-2",
    cx: "69.61",
    cy: "82.49",
    r: "64.93"
  })), jsx("g", null, jsx("circle", {
    className: "cls-3",
    cx: "69.61",
    cy: "82.49",
    r: "57.48"
  }), jsx("image", {
    className: "cls-4",
    width: "128",
    height: "147",
    transform: "translate(0 17)",
    xlinkHref: "data:image/png;base64, "
  }), jsx("path", {
    className: "cls-5",
    d: "M101.15,43.46l13.32,91.75a4.11,4.11,0,0,1-3.47,4.66l-78.52,11.4a4.12,4.12,0,0,1-4.66-3.48l-15.1-104a4.11,4.11,0,0,1,3.48-4.65l66.26-9.62"
  }), jsx("path", {
    className: "cls-6",
    d: "M101.15,43.46,88.9,45.24a4.11,4.11,0,0,1-4.66-3.47L82.46,29.51Z"
  }), jsx("image", {
    className: "cls-4",
    width: "128",
    height: "148",
    transform: "translate(12)",
    xlinkHref: "data:image/png;base64, "
  }), jsx("path", {
    className: "cls-7",
    d: "M113.19,27.34l13.32,91.75a4.12,4.12,0,0,1-3.48,4.66l-78.52,11.4a4.12,4.12,0,0,1-4.66-3.48l-15.09-104A4.1,4.1,0,0,1,28.23,23l66.26-9.62"
  }), jsx("path", {
    className: "cls-8",
    d: "M113.19,27.34l-12.26,1.78a4.11,4.11,0,0,1-4.66-3.47L94.49,13.39Z"
  }), jsx("line", {
    className: "cls-9",
    x1: "39.15",
    y1: "40.96",
    x2: "75.63",
    y2: "35.67"
  }), jsx("line", {
    className: "cls-9",
    x1: "40.77",
    y1: "52.15",
    x2: "89.96",
    y2: "45.01"
  }), jsx("line", {
    className: "cls-9",
    x1: "42.4",
    y1: "63.33",
    x2: "102.42",
    y2: "54.62"
  }), jsx("line", {
    className: "cls-9",
    x1: "44.02",
    y1: "74.51",
    x2: "82.46",
    y2: "68.93"
  }), jsx("line", {
    className: "cls-9",
    x1: "45.64",
    y1: "85.69",
    x2: "89.96",
    y2: "79.26"
  }), jsx("line", {
    className: "cls-9",
    x1: "47.27",
    y1: "96.87",
    x2: "89.96",
    y2: "90.68"
  }), jsx("line", {
    className: "cls-9",
    x1: "48.89",
    y1: "108.06",
    x2: "74.45",
    y2: "104.35"
  }), jsx("line", {
    className: "cls-9",
    x1: "50.51",
    y1: "119.24",
    x2: "99.13",
    y2: "112.18"
  })))));
};
var NotFoundSVG = function NotFoundSVG2(props) {
  var id2 = (0, import_react35.useId)();
  var _useStyleProps = useStyleProps(props), styleProps = _useStyleProps.styleProps;
  var linearGradientID1 = id2 + "-linear-gradient-1";
  var linearGradientId2 = id2 + "-linear-gradient-2";
  return jsx("svg", _extends2({
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 150 150"
  }, styleProps, {
    css: /* @__PURE__ */ css(".cls-1{isolation:isolate;}.cls-2{fill:transparent;}.cls-14,.cls-3{fill:var(--ac-global-color-grey-200);}.cls-4{fill:url(#", id2, ");}.cls-10,.cls-13,.cls-5,.cls-6,.cls-7,.cls-8,.cls-9{fill:none;stroke-linecap:round;stroke-miterlimit:10;}.cls-5,.cls-6,.cls-7,.cls-8,.cls-9{stroke:var(--ac-global-color-primary);}.cls-5{stroke-width:0.95px;}.cls-6{stroke-width:0.75px;}.cls-7{stroke-width:0.55px;}.cls-8{stroke-width:0.35px;}.cls-9{stroke-width:0.25px;}.cls-10{stroke:var(--ac-global-color-primary);stroke-dasharray:0 5.11;}.cls-11{mix-blend-mode:multiply;opacity:0.18;}.cls-12,.cls-14{stroke:var(--ac-global-color-grey-900);stroke-miterlimit:1;stroke-width:1.5px;}.cls-12{fill:url(#", linearGradientId2, ");}.cls-13{stroke:#fff;stroke-width:0.5px;}" + (false ? "" : ";label:NotFoundSVG;"), false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */")
  }), jsx("defs", null, jsx("linearGradient", {
    id: linearGradientID1,
    x1: "75.17",
    y1: "34.89",
    x2: "75.17",
    y2: "118.38",
    gradientUnits: "userSpaceOnUse"
  }, jsx("stop", {
    offset: "0",
    stopColor: "#636a71",
    stopOpacity: "0.9"
  }), jsx("stop", {
    offset: "1",
    stopColor: "#636a71",
    stopOpacity: "0"
  })), jsx("linearGradient", {
    id: linearGradientId2,
    x1: "20.04",
    y1: "58.35",
    x2: "127.35",
    y2: "30.32",
    gradientUnits: "userSpaceOnUse"
  }, jsx("stop", {
    offset: "0",
    stopColor: "#636a71"
  }), jsx("stop", {
    offset: "1",
    stopColor: "#38424e"
  }))), jsx("g", {
    className: "cls-1"
  }, jsx("g", {
    id: id2 + "-Layer_2",
    "data-name": "Layer 2"
  }, jsx("g", {
    id: id2 + "-BG"
  }, jsx("rect", {
    className: "cls-2",
    width: "150",
    height: "150"
  }), jsx("circle", {
    className: "cls-3",
    cx: "75",
    cy: "75",
    r: "64.93"
  })), jsx("g", {
    id: id2 + "-Art"
  }, jsx("path", {
    className: "cls-4",
    d: "M29.68,121.49s17.5,18.44,44.4,18.44c30.24,0,46.58-18.78,46.58-18.78L74.08,34.89"
  }), jsx("ellipse", {
    className: "cls-5",
    cx: "75",
    cy: "124.23",
    rx: "29.32",
    ry: "5.94"
  }), jsx("ellipse", {
    className: "cls-6",
    cx: "75",
    cy: "106.36",
    rx: "24.35",
    ry: "4.93"
  }), jsx("ellipse", {
    className: "cls-7",
    cx: "75",
    cy: "90.5",
    rx: "19.38",
    ry: "3.92"
  }), jsx("ellipse", {
    className: "cls-8",
    cx: "75",
    cy: "77.86",
    rx: "14.41",
    ry: "2.92"
  }), jsx("ellipse", {
    className: "cls-9",
    cx: "75",
    cy: "66.72",
    rx: "9.44",
    ry: "1.91"
  }), jsx("path", {
    className: "cls-10",
    d: "M26.49,108.86a59.58,59.58,0,1,1,98.8,0"
  }), jsx("image", {
    className: "cls-11",
    width: "142",
    height: "66",
    transform: "translate(3.51 9.54)",
    xlinkHref: "data:image/png;base64, "
  }), jsx("path", {
    className: "cls-12",
    d: "M91.46,30C113,27.51,129,28.76,129.89,33.61c1.18,6.21-22.72,16-53.37,21.78s-56.46,5.51-57.64-.7C18,49.83,32.42,42.8,53.46,37.18"
  }), jsx("path", {
    className: "cls-13",
    d: "M71.65,51.92C53,55.45,36.59,56.05,29.11,53.87"
  }), jsx("path", {
    className: "cls-14",
    d: "M52.63,40C53.46,33.83,61,27.9,70.94,26s19,.82,22.09,6.15l0,0A60.63,60.63,0,0,1,52.63,40Z"
  })))));
};
function ErrorSVG(props) {
  var id2 = (0, import_react35.useId)();
  var _useStyleProps = useStyleProps(props), styleProps = _useStyleProps.styleProps;
  var linearGradientID = id2 + "-linear-gradient";
  return jsx("svg", _extends2({
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 150 150"
  }, styleProps, {
    css: /* @__PURE__ */ css(".cls-1{isolation:isolate;}.cls-2{fill:transparent;}.cls-3{fill:var(--ac-global-color-grey-200);}.cls-4{mix-blend-mode:multiply;opacity:0.18;}.cls-5{fill:url(#", linearGradientID, ");}.cls-6,.cls-7{fill:none;stroke-linecap:round;stroke-miterlimit:10;}.cls-6{stroke:var(--ac-global-color-primary);stroke-dasharray:0 6.31;}.cls-7{stroke:var(--ac-global-color-primary);stroke-width:2px;}" + (false ? "" : ";label:ErrorSVG;"), false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,  */")
  }), jsx("defs", null, jsx("linearGradient", {
    id: linearGradientID,
    x1: "40.04",
    y1: "75.24",
    x2: "109.77",
    y2: "75.24",
    gradientTransform: "translate(150.24 0.29) rotate(90)",
    gradientUnits: "userSpaceOnUse"
  }, jsx("stop", {
    offset: "0",
    stopColor: "#636a71"
  }), jsx("stop", {
    offset: "1",
    stopColor: "#38424e"
  }))), jsx("g", {
    className: "cls-1"
  }, jsx("g", {
    id: "Layer_2",
    "data-name": "Layer 2"
  }, jsx("g", {
    id: "BG"
  }, jsx("rect", {
    className: "cls-2",
    width: "150",
    height: "150"
  }), jsx("circle", {
    className: "cls-3",
    cx: "75",
    cy: "75.2",
    r: "64.93"
  })), jsx("g", {
    id: "Art"
  }, jsx("image", {
    className: "cls-4",
    width: "122",
    height: "121",
    transform: "translate(14.23 14.82)",
    xlinkHref: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHoAAAB5CAYAAAD2zTVKAAAACXBIWXMAAAsSAAALEgHS3X78AAAJWklEQVR4Xu3daXfaPBCG4dtZ2rRpuvz/H9nlTUOz+v1gPfF4LC+AAUtizpljQyihvpiR7ASlquuac+QfF1MPOEcecTX1gByiqqpq6Gt1IS2tyvH/OQJr74/+x3OFzwraAVduOxa122YHng20Qa7oItvbsahN2ttZYSc/RkeAfV6YfR9CfaMLXgO1njoH8KQrOoJ8YbY+PbZF9unxk8dOtqIdsiAvw/6lS4/tkV9dvoXnfgevqqpKGTtJ6IDs27OFvQp5HbYWXGGBX4DnsH0J91VhC6aVp4qdHPQIssW9Bj6E1G1hK4T8HPIppG7bNq8KJ1XspKAjyL6CPwAfI/mBtrLVulXJT8CjS9vmVdmq7iSxk4GeQL6mRb0BPpm8CferjQta7foR+AdsQtox/ZFuJIudBPQEslq0gD8DtyE/h7yhrWoL/USD/ED7ZhC0Wrdt4ZAo9uqhZyCrigX8xeVnmjfAx/BvLmjG3Beait2Yr9vJ29j5d3LYq4aeiWyr+C7kV7Ovyh6CfgD+0k7cPHIMGhLDXi30lshfaIG/me1d+JrGat+6/9Fv7VPVbCMZ7FVC74j8LeR3s2+h1ZoFrYnYhm41a2Y+haxIAnt10Dsgfw353aXa9y3dMdpW9CPTY/Mc8NVjrwp6R2RV7w9aZLXvO8Zn3TrHHhub50DDyrFXA70Q8g+6bVvVfEOLKehX+uPy3LF5KFaLvQroPZBVwbaa1co129YFE4EqXmln4UPtetuqhpVinxx6YWQ7AbPnz7411+b7jEHvGqvDPin0AZFvaSvZX+cWdE33Chhuf99YFfbJoA+MbCs5dlkTGmhfxUtCw4qwTwJ9IuQY9DFiFdhHhz4xsq9Y+4sIh4yTYx8VemXIul0E9tGgV4IcG6OhAOyjQK8QWbeLwT449EqRFcVgHxR65ciKIrAPBp0IsiJ77INAJ4asyBp7cehEkRXZYi8KnTiyIkvsxaAzQVZkh70IdGbIiqyw94bOFFmRDfZe0JkjK7LA3hm6EGRF8tg7QReGrEgae2voQpEVyWJvBV04siJJ7NnQZ+ROJIc9C/qMHI2ksCehz8ijkQz2KHRAhjPyWCSBPQgdQRbCFQ3MELKgS0BWnBp7ch20qdZtgVXJQtaaIV9oEAX9g7KQFUtij1VnbbY1zeoNFRPYUejIuCzoa5qWbZG/0G3XNktBViyJDS2m3be3bWhJy2j0oE3Lhi6yb9m39MflEivZxxLYQ8BjWQGD4/VQ6/bjcqyab2kgv5kU8lfKRFbsg+2R7eKzQwvUdqo91sLHxmgBxMZmTcDs2Kwq9sh2QbcSkBW7YseQxxan9eD2Od6jAz0w046dTqltC1p5R4usD6FrtYGSkBVzsWOt2uJqMdpnt7WL1L5PyohErKJ92/anVH7xtju6wLd0VxooFVkxB9vijCFrYdpH2sVpLfTgDHyqdfuJmMZoi638HPIT/fU3S0VWzMGGFlmt2eL+c/lIc3yfiB/XyTG6chnDtufRdpFVX8Vn5DbGsIfatapXC9890C8ie4x1fIfHaHda9X433Zm3nviDyY9he00f2L+AUpEVQ9iXdKvZHlubut8XkT++vRhqIb6qfXVrG0s7tsdeQKnICvtm98fWd0+ftoK3KqIh6KnwT3bG3C+m8C/M7aEiHI2xSYHdj40hsRw7mbfPd45u+FMrf7zt+bR/jD++0RiraP8Nhampvp0R2rRTfuH7FzT5wjKOKVR/jG3a8+atju37ZKyu6zpMyOw/iH1zOxNUbujPBmMzbb2x9H0mW05m4ZGHcO35ss1YMQ11zk4MnUfbf2gr2Z7PaUFzXcfWbNBPFKALWir2HGQd3w3N8dUx1v6G9hzaV7gF78UU9NA5nf4GhdLOCm0lQxyyNOwxZN8lNzS4f4F7k7pP2KrsGHIPOwatA29fkP2LMnYh86ELI3PO7UrBnkK2x/WBFvaPy//oQtuq7mGP/vTKjdO+ovWC7LmcP6ezlTwncseei6wueU8D+gf4HVLQquoH2oqe1bZhunVb7GfiF0xiFTzr3C5ErthzkdWqhfwb+GW2v+hW9APtxMy27u3GaFfVb+Fuizd18r5L5Ia9D7KAf9KtalX0WNsG+m0bBio6YL/fpHkyaAAezf4Q7i5QuWDvg/wrkkK+Z3oiVm/1y4EmbFVDe/BjyPtUtCJ17CWQf9JWs1q2RY5Vc6eiYzEIPTIxmxP7AKWKvRSyxmfbsnUObZF74/LOv9cduVo2F3rfSA17SWRBx5DtTPvVfL/dP6mhcOM1nLF9nBp5cFy2MQkNZ+yRSAIZZkLDGTsSySDDFtBwxjaRFDJsCQ1nbBJEhh2goWjsJJFhR2goEjtZZNgDGorCThoZ9oSGIrCTR4YFoCFr7CyQYSFoyBI7G2RYEBqyws4KGRaGhiyws0OGA0BD0thZIsOBoCFJ7GyR4YDQkBR21shwYGhIAjt7ZDgCNKwauwhkOBI0rBK7GGQ4IjSsCltRBDIcGRpWgW2jCGQ4ATScFLui27oFnTUynAgajo5d0//MtkX2nxbNChlOCA1HwdZB1v4lXWhh2M8nZ4cMJ4aGg2Nb5GuaCtZYbVv2Ew2W/ehqNsiwAmg4CLYFthOuK7rQLzRAdqmOPyGzQYaVQMPe2PXA9o0W+oWmqi20reb7kL9DCjj28dWkkGFF0LA3tg1fyS+0y0lfhseobdvVBv7Qb9nJI8PKoGEv7KF2bcfhGLTGZv9BdKVaebLIsEJo2Bk7Bq1TJ43DH+lC25m2QAUtdH0+OVlkWCk07IwNfWS15080qylZaI3Pf2lABS30LJBhxdCwE/ZYNd8Qh7bnzsJV/iUDZFg5NGyFXZsU8gvt1a6pyZiq+j7sC1nLSSSLDAlAw2xsX80eUiscemi9ER5owVXFWhgmaWRIBBpmYdvJmLB1aXND07bHLphs3PYx5DOJI0NC0DAbO/aDClvNsUugas22TauKk0eGxKBhELt2abGvaQCviP9QQ28InWtr3yLrCluSyJAgNESx3+yX6UJf0SKP/ZjS5qvJ5JEhUWjoYNfEf5nAtubYorT+cXYSp309pobme5JoVAm/doChP7Oorc3KJPRbvU0LnDwyZAANUeyxtOHH9lgmjwyZQCsi4LF9G7XZ9vZzAFZkBQ3E/tB5bN+GPQDv+zkhQ4bQCgc+O3IDVmQL7WMIPldYH8VAlx6xTy+cI8P4H0wbTqGEUzy4AAAAAElFTkSuQmCC"
  }), jsx("rect", {
    className: "cls-5",
    x: "40.13",
    y: "40.33",
    width: "69.74",
    height: "69.74",
    rx: "4.81",
    transform: "translate(-31.21 75.06) rotate(-45)"
  }), jsx("line", {
    className: "cls-6",
    x1: "75.01",
    y1: "17.89",
    x2: "75.01",
    y2: "3.44"
  }), jsx("line", {
    className: "cls-6",
    x1: "55.41",
    y1: "21.34",
    x2: "50.47",
    y2: "7.76"
  }), jsx("line", {
    className: "cls-6",
    x1: "38.17",
    y1: "31.29",
    x2: "28.88",
    y2: "20.22"
  }), jsx("line", {
    className: "cls-6",
    x1: "25.38",
    y1: "46.53",
    x2: "12.86",
    y2: "39.31"
  }), jsx("line", {
    className: "cls-6",
    x1: "18.57",
    y1: "65.24",
    x2: "4.33",
    y2: "62.73"
  }), jsx("line", {
    className: "cls-6",
    x1: "18.56",
    y1: "85.14",
    x2: "4.33",
    y2: "87.65"
  }), jsx("line", {
    className: "cls-6",
    x1: "25.36",
    y1: "103.84",
    x2: "12.85",
    y2: "111.07"
  }), jsx("line", {
    className: "cls-6",
    x1: "38.15",
    y1: "119.09",
    x2: "28.86",
    y2: "130.16"
  }), jsx("line", {
    className: "cls-6",
    x1: "55.39",
    y1: "129.05",
    x2: "50.44",
    y2: "142.63"
  }), jsx("line", {
    className: "cls-6",
    x1: "74.99",
    y1: "132.51",
    x2: "74.99",
    y2: "146.96"
  }), jsx("line", {
    className: "cls-6",
    x1: "94.59",
    y1: "129.06",
    x2: "99.53",
    y2: "142.64"
  }), jsx("line", {
    className: "cls-6",
    x1: "111.83",
    y1: "119.11",
    x2: "121.12",
    y2: "130.18"
  }), jsx("line", {
    className: "cls-6",
    x1: "124.62",
    y1: "103.87",
    x2: "137.14",
    y2: "111.09"
  }), jsx("line", {
    className: "cls-6",
    x1: "131.43",
    y1: "85.17",
    x2: "145.67",
    y2: "87.67"
  }), jsx("line", {
    className: "cls-6",
    x1: "131.44",
    y1: "65.26",
    x2: "145.67",
    y2: "62.75"
  }), jsx("line", {
    className: "cls-6",
    x1: "124.64",
    y1: "46.56",
    x2: "137.15",
    y2: "39.33"
  }), jsx("line", {
    className: "cls-6",
    x1: "111.85",
    y1: "31.31",
    x2: "121.14",
    y2: "20.24"
  }), jsx("line", {
    className: "cls-6",
    x1: "94.61",
    y1: "21.35",
    x2: "99.56",
    y2: "7.77"
  }), jsx("circle", {
    className: "cls-7",
    cx: "75",
    cy: "100.67",
    r: "5.34"
  }), jsx("path", {
    className: "cls-7",
    d: "M76.88,86.93H73.12a2.51,2.51,0,0,1-2.5-2.32L68,47.07a2.49,2.49,0,0,1,2.49-2.67h9.06A2.49,2.49,0,0,1,82,47.07L79.38,84.61A2.51,2.51,0,0,1,76.88,86.93Z"
  })))));
}
function EmptyGraphic(props) {
  var _props$size = props.size, size = _props$size === void 0 ? "M" : _props$size, _props$graphicKey = props.graphicKey, graphicKey = _props$graphicKey === void 0 ? "documents" : _props$graphicKey;
  var dimensions = (0, import_react35.useMemo)(function() {
    switch (size) {
      case "S":
        return {
          width: 72,
          height: 72
        };
      case "M":
        return {
          width: 96,
          height: 96
        };
      case "L":
        return {
          width: 136,
          height: 136
        };
      default:
        assertUnreachable();
    }
  }, [size]);
  var graphic = (0, import_react35.useMemo)(function() {
    switch (graphicKey) {
      case "documents":
        return jsx(EmptyDocumentsSVG, dimensions);
      case "not found":
        return jsx(NotFoundSVG, dimensions);
      case "error":
        return jsx(ErrorSVG, dimensions);
      default:
        assertUnreachable();
    }
  }, [graphicKey, dimensions]);
  return jsx("div", null, graphic);
}
var _excluded$u = ["variant", "placement", "children", "delay"];
function ContextualHelp(props, ref) {
  var _props$variant = props.variant, variant = _props$variant === void 0 ? "help" : _props$variant, _props$placement = props.placement, placement = _props$placement === void 0 ? "bottom start" : _props$placement, children = props.children, _props$delay = props.delay, delay = _props$delay === void 0 ? 0 : _props$delay, otherProps = _objectWithoutPropertiesLoose2(props, _excluded$u);
  var iconSVG = variant === "info" ? jsx(InfoOutline, null) : jsx(QuestionOutline, null);
  var icon = jsx(Icon, {
    color: "grey-900",
    svg: iconSVG,
    style: {
      fontSize: "inherit"
    }
  });
  var labelProps = $313b98861ee5dd6c$export$d6875122194c7b44(otherProps);
  return jsx(TooltipTrigger, _extends2({}, otherProps, {
    placement,
    delay
  }), jsx(_ActionButton, _extends2({}, $3ef42575df84b30b$export$9d1611c77c2fe928(otherProps, labelProps, {
    isDisabled: false
  }), {
    ref,
    isQuiet: true
  }), icon), jsx(_HelpTooltip, null, children));
}
var _ContextualHelp = /* @__PURE__ */ import_react35.default.forwardRef(ContextualHelp);
var counterCSS = /* @__PURE__ */ css("display:inline-block;padding:0 var(--ac-global-dimension-static-size-65);border-radius:calc(\n    (\n      ", theme.typography.sizes.small.lineHeight, "px + 2 *\n        var(--ac-global-dimension-static-size-25) / 2\n    )\n  );background-color:var(--ac-global-background-color-light);font-size:", theme.typography.sizes.small.fontSize, "px;line-height:", theme.typography.sizes.small.lineHeight, "px;color:var(--ac-global-text-color-900);&[data-variant='light']{background-color:var(--ac-global-color-grey-400);}&[data-variant='dark']{background-color:var(--ac-global-background-color-dark);}&[data-variant='danger']{background-color:var(--ac-global-background-color-danger);}" + (false ? "" : ";label:counterCSS;"), false ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkNvdW50ZXIudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUd1QiIsImZpbGUiOiJDb3VudGVyLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBSZWFjdCBmcm9tICdyZWFjdCc7XHJcbmltcG9ydCB7IGNzcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcclxuaW1wb3J0IHRoZW1lIGZyb20gJy4uL3RoZW1lJztcclxuY29uc3QgY291bnRlckNTUyA9IGNzcyBgXG4gIGRpc3BsYXk6IGlubGluZS1ibG9jaztcbiAgcGFkZGluZzogMCB2YXIoLS1hYy1nbG9iYWwtZGltZW5zaW9uLXN0YXRpYy1zaXplLTY1KTtcbiAgYm9yZGVyLXJhZGl1czogY2FsYyhcbiAgICAoXG4gICAgICAke3RoZW1lLnR5cG9ncmFwaHkuc2l6ZXMuc21hbGwubGluZUhlaWdodH1weCArIDIgKlxuICAgICAgICB2YXIoLS1hYy1nbG9iYWwtZGltZW5zaW9uLXN0YXRpYy1zaXplLTI1KSAvIDJcbiAgICApXG4gICk7XG4gIGJhY2tncm91bmQtY29sb3I6IHZhcigtLWFjLWdsb2JhbC1iYWNrZ3JvdW5kLWNvbG9yLWxpZ2h0KTtcbiAgZm9udC1zaXplOiAke3RoZW1lLnR5cG9ncmFwaHkuc2l6ZXMuc21hbGwuZm9udFNpemV9cHg7XG4gIGxpbmUtaGVpZ2h0OiAke3RoZW1lLnR5cG9ncmFwaHkuc2l6ZXMuc21hbGwubGluZUhlaWdodH1weDtcbiAgY29sb3I6IHZhcigtLWFjLWdsb2JhbC10ZXh0LWNvbG9yLTkwMCk7XG4gICZbZGF0YS12YXJpYW50PSdsaWdodCddIHtcbiAgICBiYWNrZ3JvdW5kLWNvbG9yOiB2YXIoLS1hYy1nbG9iYWwtY29sb3ItZ3JleS00MDApO1xuICB9XG4gICZbZGF0YS12YXJpYW50PSdkYXJrJ10ge1xuICAgIGJhY2tncm91bmQtY29sb3I6IHZhcigtLWFjLWdsb2JhbC1iYWNrZ3JvdW5kLWNvbG9yLWRhcmspO1xuICB9XG4gICZbZGF0YS12YXJpYW50PSdkYW5nZXInXSB7XG4gICAgYmFja2dyb3VuZC1jb2xvcjogdmFyKC0tYWMtZ2xvYmFsLWJhY2tncm91bmQtY29sb3ItZGFuZ2VyKTtcbiAgfVxuYDtcclxuZXhwb3J0IGZ1bmN0aW9uIENvdW50ZXIocHJvcHMpIHtcclxuICAgIGNvbnN0IHsgY2hpbGRyZW4sIHZhcmlhbnQgPSAnZGVmYXVsdCcgfSA9IHByb3BzO1xyXG4gICAgcmV0dXJuICg8c3BhbiBjc3M9e2NvdW50ZXJDU1N9IGRhdGEtdmFyaWFudD17dmFyaWFudH0gY2xhc3NOYW1lPVwiYWMtY291bnRlclwiPlxuICAgICAge2NoaWxkcmVufVxuICAgIDwvc3Bhbj4pO1xyXG59XHJcbi8vIyBzb3VyY2VNYXBwaW5nVVJMPUNvdW50ZXIuanN4Lm1hcCJdfQ== */");
function Counter(props) {
  var children = props.children, _props$variant = props.variant, variant = _props$variant === void 0 ? "default" : _props$variant;
  return jsx("span", {
    css: counterCSS,
    "data-variant": variant,
    className: "ac-counter"
  }, children);
}
var _excluded$v = ["children"];
function _EMOTION_STRINGIFIED_CSS_ERROR__$w() {
  return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
}
var flexCSS = false ? {
  name: "zjik7",
  styles: "display:flex"
} : {
  name: "18l0u1r-flexCSS",
  styles: "display:flex;label:flexCSS;",
  map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkZsZXgudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUlvQiIsImZpbGUiOiJGbGV4LnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGNsYXNzTmFtZXMsIHBhc3N0aHJvdWdoU3R5bGUsIHJlc3BvbnNpdmVEaW1lbnNpb25WYWx1ZSwgdXNlRE9NUmVmLCB1c2VTdHlsZVByb3BzLCB9IGZyb20gJy4uL3V0aWxzJztcclxuaW1wb3J0IHsgZmlsdGVyRE9NUHJvcHMgfSBmcm9tICdAcmVhY3QtYXJpYS91dGlscyc7XHJcbmltcG9ydCBSZWFjdCwgeyBmb3J3YXJkUmVmIH0gZnJvbSAncmVhY3QnO1xyXG5pbXBvcnQgeyBjc3MgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XHJcbmNvbnN0IGZsZXhDU1MgPSBjc3MgYFxuICBkaXNwbGF5OiBmbGV4O1xuYDtcclxuY29uc3QgZmxleFN0eWxlUHJvcHMgPSB7XHJcbiAgICBkaXJlY3Rpb246IFsnZmxleERpcmVjdGlvbicsIHBhc3N0aHJvdWdoU3R5bGVdLFxyXG4gICAgd3JhcDogWydmbGV4V3JhcCcsIGZsZXhXcmFwVmFsdWVdLFxyXG4gICAganVzdGlmeUNvbnRlbnQ6IFsnanVzdGlmeUNvbnRlbnQnLCBmbGV4QWxpZ25WYWx1ZV0sXHJcbiAgICBhbGlnbkl0ZW1zOiBbJ2FsaWduSXRlbXMnLCBmbGV4QWxpZ25WYWx1ZV0sXHJcbiAgICBhbGlnbkNvbnRlbnQ6IFsnYWxpZ25Db250ZW50JywgZmxleEFsaWduVmFsdWVdLFxyXG59O1xyXG5mdW5jdGlvbiBGbGV4KHByb3BzLCByZWYpIHtcclxuICAgIGxldCB7IGNoaWxkcmVuLCAuLi5vdGhlclByb3BzIH0gPSBwcm9wcztcclxuICAgIGxldCBtYXRjaGVkQnJlYWtwb2ludHMgPSBbJ2Jhc2UnXTtcclxuICAgIGxldCB7IHN0eWxlUHJvcHMgfSA9IHVzZVN0eWxlUHJvcHMob3RoZXJQcm9wcyk7XHJcbiAgICBsZXQgeyBzdHlsZVByb3BzOiBmbGV4U3R5bGUgfSA9IHVzZVN0eWxlUHJvcHMob3RoZXJQcm9wcywgZmxleFN0eWxlUHJvcHMpO1xyXG4gICAgbGV0IGRvbVJlZiA9IHVzZURPTVJlZihyZWYpO1xyXG4gICAgLy8gSWYgbm8gZ2Fwcywgb3IgbmF0aXZlIHN1cHBvcnQgZXhpc3RzLCB0aGVuIHdlIG9ubHkgbmVlZCB0byByZW5kZXIgYSBzaW5nbGUgZGl2LlxyXG4gICAgbGV0IHN0eWxlID0ge1xyXG4gICAgICAgIC4uLnN0eWxlUHJvcHMuc3R5bGUsXHJcbiAgICAgICAgLi4uZmxleFN0eWxlLnN0eWxlLFxyXG4gICAgfTtcclxuICAgIGlmIChwcm9wcy5nYXAgIT0gbnVsbCkge1xyXG4gICAgICAgIHN0eWxlLmdhcCA9IHJlc3BvbnNpdmVEaW1lbnNpb25WYWx1ZShwcm9wcy5nYXAsIG1hdGNoZWRCcmVha3BvaW50cyk7XHJcbiAgICB9XHJcbiAgICBpZiAocHJvcHMuY29sdW1uR2FwICE9IG51bGwpIHtcclxuICAgICAgICBzdHlsZS5jb2x1bW5HYXAgPSByZXNwb25zaXZlRGltZW5zaW9uVmFsdWUocHJvcHMuY29sdW1uR2FwLCBtYXRjaGVkQnJlYWtwb2ludHMpO1xyXG4gICAgfVxyXG4gICAgaWYgKHByb3BzLnJvd0dhcCAhPSBudWxsKSB7XHJcbiAgICAgICAgc3R5bGUucm93R2FwID0gcmVzcG9uc2l2ZURpbWVuc2lvblZhbHVlKHByb3BzLnJvd0dhcCwgbWF0Y2hlZEJyZWFrcG9pbnRzKTtcclxuICAgIH1cclxuICAgIHJldHVybiAoPGRpdiBjc3M9e2ZsZXhDU1N9IHsuLi5maWx0ZXJET01Qcm9wcyhvdGhlclByb3BzKX0gY2xhc3NOYW1lPXtjbGFzc05hbWVzKCdmbGV4Jywgc3R5bGVQcm9wcy5jbGFzc05hbWUpfSBzdHlsZT17c3R5bGV9IHJlZj17ZG9tUmVmfT5cbiAgICAgIHtjaGlsZHJlbn1cbiAgICA8L2Rpdj4pO1xyXG59XHJcbi8qKlxyXG4gKiBOb3JtYWxpemUgJ3N0YXJ0JyBhbmQgJ2VuZCcgYWxpZ25tZW50IHZhbHVlcyB0byAnZmxleC1zdGFydCcgYW5kICdmbGV4LWVuZCdcclxuICogaW4gZmxleCBjb250YWluZXJzIGZvciBicm93c2VyIGNvbXBhdGliaWxpdHkuXHJcbiAqL1xyXG5mdW5jdGlvbiBmbGV4QWxpZ25WYWx1ZSh2YWx1ZSkge1xyXG4gICAgaWYgKHZhbHVlID09PSAnc3RhcnQnKSB7XHJcbiAgICAgICAgcmV0dXJuICdmbGV4LXN0YXJ0JztcclxuICAgIH1cclxuICAgIGlmICh2YWx1ZSA9PT0gJ2VuZCcpIHtcclxuICAgICAgICByZXR1cm4gJ2ZsZXgtZW5kJztcclxuICAgIH1cclxuICAgIHJldHVybiB2YWx1ZTtcclxufVxyXG4vKipcclxuICogVGFrZXMgYSBib29sZWFuIGFuZCB0cmFuc2xhdGVzIGl0IHRvIGZsZXggd3JhcCBvciBub3dyYXAuXHJcbiAqL1xyXG5mdW5jdGlvbiBmbGV4V3JhcFZhbHVlKHZhbHVlKSB7XHJcbiAgICBpZiAodHlwZW9mIHZhbHVlID09PSAnYm9vbGVhbicpIHtcclxuICAgICAgICByZXR1cm4gdmFsdWUgPyAnd3JhcCcgOiAnbm93cmFwJztcclxuICAgIH1cclxuICAgIHJldHVybiB2YWx1ZTtcclxufVxyXG4vKipcclxuICogQSBsYXlvdXQgY29udGFpbmVyIHVzaW5nIGZsZXhib3guIFByb3ZpZGVzIEFDIGRpbWVuc2lvbiB2YWx1ZXMsIGFuZCBzdXBwb3J0cyB0aGUgZ2FwXHJcbiAqIHByb3BlcnR5IHRvIGRlZmluZSBjb25zaXN0ZW50IHNwYWNpbmcgYmV0d2VlbiBpdGVtcy5cclxuICovXHJcbmNvbnN0IF9GbGV4ID0gZm9yd2FyZFJlZihGbGV4KTtcclxuZXhwb3J0IHsgX0ZsZXggYXMgRmxleCB9O1xyXG4vLyMgc291cmNlTWFwcGluZ1VSTD1GbGV4LmpzeC5tYXAiXX0= */",
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__$w
};
var flexStyleProps = {
  direction: ["flexDirection", passthroughStyle],
  wrap: ["flexWrap", flexWrapValue],
  justifyContent: ["justifyContent", flexAlignValue],
  alignItems: ["alignItems", flexAlignValue],
  alignContent: ["alignContent", flexAlignValue]
};
function Flex(props, ref) {
  var children = props.children, otherProps = _objectWithoutPropertiesLoose2(props, _excluded$v);
  var matchedBreakpoints = ["base"];
  var _useStyleProps = useStyleProps(otherProps), styleProps = _useStyleProps.styleProps;
  var _useStyleProps2 = useStyleProps(otherProps, flexStyleProps), flexStyle = _useStyleProps2.styleProps;
  var domRef = useDOMRef(ref);
  var style = _extends2({}, styleProps.style, flexStyle.style);
  if (props.gap != null) {
    style.gap = responsiveDimensionValue(props.gap, matchedBreakpoints);
  }
  if (props.columnGap != null) {
    style.columnGap = responsiveDimensionValue(props.columnGap, matchedBreakpoints);
  }
  if (props.rowGap != null) {
    style.rowGap = responsiveDimensionValue(props.rowGap, matchedBreakpoints);
  }
  return jsx("div", _extends2({
    css: flexCSS
  }, $65484d02dcb7eb3e$export$457c3d6518dd4c6f(otherProps), {
    className: clsx_m_default("flex", styleProps.className),
    style,
    ref: domRef
  }), children);
}
function flexAlignValue(value) {
  if (value === "start") {
    return "flex-start";
  }
  if (value === "end") {
    return "flex-end";
  }
  return value;
}
function flexWrapValue(value) {
  if (typeof value === "boolean") {
    return value ? "wrap" : "nowrap";
  }
  return value;
}
var _Flex = /* @__PURE__ */ (0, import_react35.forwardRef)(Flex);

// src/contexts/FeatureFlagsContext.tsx
var import_react39 = __toESM(require_react());

// node_modules/react-hotkeys-hook/dist/react-hotkeys-hook.esm.js
var import_react37 = __toESM(require_react());
var import_jsx_runtime = __toESM(require_jsx_runtime());
function _extends3() {
  _extends3 = Object.assign ? Object.assign.bind() : function(target) {
    for (var i2 = 1; i2 < arguments.length; i2++) {
      var source = arguments[i2];
      for (var key in source) {
        if (Object.prototype.hasOwnProperty.call(source, key)) {
          target[key] = source[key];
        }
      }
    }
    return target;
  };
  return _extends3.apply(this, arguments);
}
var reservedModifierKeywords = ["shift", "alt", "meta", "mod", "ctrl"];
var mappedKeys = {
  esc: "escape",
  "return": "enter",
  ".": "period",
  ",": "comma",
  "-": "slash",
  " ": "space",
  "`": "backquote",
  "#": "backslash",
  "+": "bracketright",
  ShiftLeft: "shift",
  ShiftRight: "shift",
  AltLeft: "alt",
  AltRight: "alt",
  MetaLeft: "meta",
  MetaRight: "meta",
  OSLeft: "meta",
  OSRight: "meta",
  ControlLeft: "ctrl",
  ControlRight: "ctrl"
};
function mapKey(key) {
  return (mappedKeys[key] || key).trim().toLowerCase().replace(/key|digit|numpad|arrow/, "");
}
function isHotkeyModifier(key) {
  return reservedModifierKeywords.includes(key);
}
function parseKeysHookInput(keys4, splitKey) {
  if (splitKey === void 0) {
    splitKey = ",";
  }
  return keys4.split(splitKey);
}
function parseHotkey(hotkey, combinationKey, description) {
  if (combinationKey === void 0) {
    combinationKey = "+";
  }
  var keys4 = hotkey.toLocaleLowerCase().split(combinationKey).map(function(k2) {
    return mapKey(k2);
  });
  var modifiers2 = {
    alt: keys4.includes("alt"),
    ctrl: keys4.includes("ctrl") || keys4.includes("control"),
    shift: keys4.includes("shift"),
    meta: keys4.includes("meta"),
    mod: keys4.includes("mod")
  };
  var singleCharKeys = keys4.filter(function(k2) {
    return !reservedModifierKeywords.includes(k2);
  });
  return _extends3({}, modifiers2, {
    keys: singleCharKeys,
    description
  });
}
(function() {
  if (typeof document !== "undefined") {
    document.addEventListener("keydown", function(e3) {
      if (e3.key === void 0) {
        return;
      }
      pushToCurrentlyPressedKeys([mapKey(e3.key), mapKey(e3.code)]);
    });
    document.addEventListener("keyup", function(e3) {
      if (e3.key === void 0) {
        return;
      }
      removeFromCurrentlyPressedKeys([mapKey(e3.key), mapKey(e3.code)]);
    });
  }
  if (typeof window !== "undefined") {
    window.addEventListener("blur", function() {
      currentlyPressedKeys.clear();
    });
  }
})();
var currentlyPressedKeys = /* @__PURE__ */ new Set();
function isReadonlyArray(value) {
  return Array.isArray(value);
}
function isHotkeyPressed(key, splitKey) {
  if (splitKey === void 0) {
    splitKey = ",";
  }
  var hotkeyArray = isReadonlyArray(key) ? key : key.split(splitKey);
  return hotkeyArray.every(function(hotkey) {
    return currentlyPressedKeys.has(hotkey.trim().toLowerCase());
  });
}
function pushToCurrentlyPressedKeys(key) {
  var hotkeyArray = Array.isArray(key) ? key : [key];
  if (currentlyPressedKeys.has("meta")) {
    currentlyPressedKeys.forEach(function(key2) {
      return !isHotkeyModifier(key2) && currentlyPressedKeys["delete"](key2.toLowerCase());
    });
  }
  hotkeyArray.forEach(function(hotkey) {
    return currentlyPressedKeys.add(hotkey.toLowerCase());
  });
}
function removeFromCurrentlyPressedKeys(key) {
  var hotkeyArray = Array.isArray(key) ? key : [key];
  if (key === "meta") {
    currentlyPressedKeys.clear();
  } else {
    hotkeyArray.forEach(function(hotkey) {
      return currentlyPressedKeys["delete"](hotkey.toLowerCase());
    });
  }
}
function maybePreventDefault(e3, hotkey, preventDefault) {
  if (typeof preventDefault === "function" && preventDefault(e3, hotkey) || preventDefault === true) {
    e3.preventDefault();
  }
}
function isHotkeyEnabled(e3, hotkey, enabled) {
  if (typeof enabled === "function") {
    return enabled(e3, hotkey);
  }
  return enabled === true || enabled === void 0;
}
function isKeyboardEventTriggeredByInput(ev) {
  return isHotkeyEnabledOnTag(ev, ["input", "textarea", "select"]);
}
function isHotkeyEnabledOnTag(_ref18, enabledOnTags) {
  var target = _ref18.target;
  if (enabledOnTags === void 0) {
    enabledOnTags = false;
  }
  var targetTagName = target && target.tagName;
  if (isReadonlyArray(enabledOnTags)) {
    return Boolean(targetTagName && enabledOnTags && enabledOnTags.some(function(tag) {
      return tag.toLowerCase() === targetTagName.toLowerCase();
    }));
  }
  return Boolean(targetTagName && enabledOnTags && enabledOnTags === true);
}
function isScopeActive(activeScopes, scopes) {
  if (activeScopes.length === 0 && scopes) {
    console.warn('A hotkey has the "scopes" option set, however no active scopes were found. If you want to use the global scopes feature, you need to wrap your app in a <HotkeysProvider>');
    return true;
  }
  if (!scopes) {
    return true;
  }
  return activeScopes.some(function(scope) {
    return scopes.includes(scope);
  }) || activeScopes.includes("*");
}
var isHotkeyMatchingKeyboardEvent = function isHotkeyMatchingKeyboardEvent2(e3, hotkey, ignoreModifiers) {
  if (ignoreModifiers === void 0) {
    ignoreModifiers = false;
  }
  var alt = hotkey.alt, meta2 = hotkey.meta, mod = hotkey.mod, shift2 = hotkey.shift, ctrl = hotkey.ctrl, keys4 = hotkey.keys;
  var pressedKeyUppercase = e3.key, code = e3.code, ctrlKey = e3.ctrlKey, metaKey = e3.metaKey, shiftKey = e3.shiftKey, altKey = e3.altKey;
  var keyCode = mapKey(code);
  var pressedKey = pressedKeyUppercase.toLowerCase();
  if (!ignoreModifiers) {
    if (alt === !altKey && pressedKey !== "alt") {
      return false;
    }
    if (shift2 === !shiftKey && pressedKey !== "shift") {
      return false;
    }
    if (mod) {
      if (!metaKey && !ctrlKey) {
        return false;
      }
    } else {
      if (meta2 === !metaKey && pressedKey !== "meta" && pressedKey !== "os") {
        return false;
      }
      if (ctrl === !ctrlKey && pressedKey !== "ctrl" && pressedKey !== "control") {
        return false;
      }
    }
  }
  if (keys4 && keys4.length === 1 && (keys4.includes(pressedKey) || keys4.includes(keyCode))) {
    return true;
  } else if (keys4) {
    return isHotkeyPressed(keys4);
  } else if (!keys4) {
    return true;
  }
  return false;
};
var BoundHotkeysProxyProvider = /* @__PURE__ */ (0, import_react37.createContext)(void 0);
var useBoundHotkeysProxy = function useBoundHotkeysProxy2() {
  return (0, import_react37.useContext)(BoundHotkeysProxyProvider);
};
function deepEqual(x2, y2) {
  return x2 && y2 && typeof x2 === "object" && typeof y2 === "object" ? Object.keys(x2).length === Object.keys(y2).length && //@ts-ignore
  Object.keys(x2).reduce(function(isEqual, key) {
    return isEqual && deepEqual(x2[key], y2[key]);
  }, true) : x2 === y2;
}
var HotkeysContext = /* @__PURE__ */ (0, import_react37.createContext)({
  hotkeys: [],
  enabledScopes: [],
  toggleScope: function toggleScope() {
  },
  enableScope: function enableScope() {
  },
  disableScope: function disableScope() {
  }
});
var useHotkeysContext = function useHotkeysContext2() {
  return (0, import_react37.useContext)(HotkeysContext);
};
function useDeepEqualMemo(value) {
  var ref = (0, import_react37.useRef)(void 0);
  if (!deepEqual(ref.current, value)) {
    ref.current = value;
  }
  return ref.current;
}
var stopPropagation = function stopPropagation2(e3) {
  e3.stopPropagation();
  e3.preventDefault();
  e3.stopImmediatePropagation();
};
var useSafeLayoutEffect = typeof window !== "undefined" ? import_react37.useLayoutEffect : import_react37.useEffect;
function useHotkeys(keys4, callback, options, dependencies) {
  var ref = (0, import_react37.useRef)(null);
  var hasTriggeredRef = (0, import_react37.useRef)(false);
  var _options = !(options instanceof Array) ? options : !(dependencies instanceof Array) ? dependencies : void 0;
  var _keys = isReadonlyArray(keys4) ? keys4.join(_options == null ? void 0 : _options.splitKey) : keys4;
  var _deps = options instanceof Array ? options : dependencies instanceof Array ? dependencies : void 0;
  var memoisedCB = (0, import_react37.useCallback)(callback, _deps != null ? _deps : []);
  var cbRef = (0, import_react37.useRef)(memoisedCB);
  if (_deps) {
    cbRef.current = memoisedCB;
  } else {
    cbRef.current = callback;
  }
  var memoisedOptions = useDeepEqualMemo(_options);
  var _useHotkeysContext = useHotkeysContext(), enabledScopes = _useHotkeysContext.enabledScopes;
  var proxy = useBoundHotkeysProxy();
  useSafeLayoutEffect(function() {
    if ((memoisedOptions == null ? void 0 : memoisedOptions.enabled) === false || !isScopeActive(enabledScopes, memoisedOptions == null ? void 0 : memoisedOptions.scopes)) {
      return;
    }
    var listener = function listener2(e3, isKeyUp) {
      var _e$target;
      if (isKeyUp === void 0) {
        isKeyUp = false;
      }
      if (isKeyboardEventTriggeredByInput(e3) && !isHotkeyEnabledOnTag(e3, memoisedOptions == null ? void 0 : memoisedOptions.enableOnFormTags)) {
        return;
      }
      if (memoisedOptions != null && memoisedOptions.ignoreEventWhen != null && memoisedOptions.ignoreEventWhen(e3)) {
        return;
      }
      if (ref.current !== null && document.activeElement !== ref.current && !ref.current.contains(document.activeElement)) {
        stopPropagation(e3);
        return;
      }
      if ((_e$target = e3.target) != null && _e$target.isContentEditable && !(memoisedOptions != null && memoisedOptions.enableOnContentEditable)) {
        return;
      }
      parseKeysHookInput(_keys, memoisedOptions == null ? void 0 : memoisedOptions.splitKey).forEach(function(key) {
        var _hotkey$keys;
        var hotkey = parseHotkey(key, memoisedOptions == null ? void 0 : memoisedOptions.combinationKey);
        if (isHotkeyMatchingKeyboardEvent(e3, hotkey, memoisedOptions == null ? void 0 : memoisedOptions.ignoreModifiers) || (_hotkey$keys = hotkey.keys) != null && _hotkey$keys.includes("*")) {
          if (isKeyUp && hasTriggeredRef.current) {
            return;
          }
          maybePreventDefault(e3, hotkey, memoisedOptions == null ? void 0 : memoisedOptions.preventDefault);
          if (!isHotkeyEnabled(e3, hotkey, memoisedOptions == null ? void 0 : memoisedOptions.enabled)) {
            stopPropagation(e3);
            return;
          }
          cbRef.current(e3, hotkey);
          if (!isKeyUp) {
            hasTriggeredRef.current = true;
          }
        }
      });
    };
    var handleKeyDown = function handleKeyDown2(event) {
      if (event.key === void 0) {
        return;
      }
      pushToCurrentlyPressedKeys(mapKey(event.code));
      if ((memoisedOptions == null ? void 0 : memoisedOptions.keydown) === void 0 && (memoisedOptions == null ? void 0 : memoisedOptions.keyup) !== true || memoisedOptions != null && memoisedOptions.keydown) {
        listener(event);
      }
    };
    var handleKeyUp = function handleKeyUp2(event) {
      if (event.key === void 0) {
        return;
      }
      removeFromCurrentlyPressedKeys(mapKey(event.code));
      hasTriggeredRef.current = false;
      if (memoisedOptions != null && memoisedOptions.keyup) {
        listener(event, true);
      }
    };
    var domNode = ref.current || (_options == null ? void 0 : _options.document) || document;
    domNode.addEventListener("keyup", handleKeyUp);
    domNode.addEventListener("keydown", handleKeyDown);
    if (proxy) {
      parseKeysHookInput(_keys, memoisedOptions == null ? void 0 : memoisedOptions.splitKey).forEach(function(key) {
        return proxy.addHotkey(parseHotkey(key, memoisedOptions == null ? void 0 : memoisedOptions.combinationKey, memoisedOptions == null ? void 0 : memoisedOptions.description));
      });
    }
    return function() {
      domNode.removeEventListener("keyup", handleKeyUp);
      domNode.removeEventListener("keydown", handleKeyDown);
      if (proxy) {
        parseKeysHookInput(_keys, memoisedOptions == null ? void 0 : memoisedOptions.splitKey).forEach(function(key) {
          return proxy.removeHotkey(parseHotkey(key, memoisedOptions == null ? void 0 : memoisedOptions.combinationKey, memoisedOptions == null ? void 0 : memoisedOptions.description));
        });
      }
    };
  }, [_keys, memoisedOptions, enabledScopes]);
  return ref;
}

// node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js
var ReactJSXRuntime = __toESM(require_jsx_runtime());
var import_react38 = __toESM(require_react());
var import_hoist_non_react_statics2 = __toESM(require_hoist_non_react_statics_cjs());
var Fragment5 = ReactJSXRuntime.Fragment;
function jsx5(type, props, key) {
  if (!hasOwnProperty.call(props, "css")) {
    return ReactJSXRuntime.jsx(type, props, key);
  }
  return ReactJSXRuntime.jsx(Emotion$1, createEmotionProps(type, props), key);
}
function jsxs2(type, props, key) {
  if (!hasOwnProperty.call(props, "css")) {
    return ReactJSXRuntime.jsxs(type, props, key);
  }
  return ReactJSXRuntime.jsxs(Emotion$1, createEmotionProps(type, props), key);
}

// src/contexts/FeatureFlagsContext.tsx
var LOCAL_STORAGE_FEATURE_FLAGS_KEY = "arize-phoenix-feature-flags";
var DEFAULT_FEATURE_FLAGS = {
  __CLEAR__: false
};
function getFeatureFlags() {
  const featureFlagsFromLocalStorage = localStorage.getItem(
    LOCAL_STORAGE_FEATURE_FLAGS_KEY
  );
  if (!featureFlagsFromLocalStorage) {
    return DEFAULT_FEATURE_FLAGS;
  }
  try {
    const parsedFeatureFlags = JSON.parse(featureFlagsFromLocalStorage);
    return Object.assign({}, DEFAULT_FEATURE_FLAGS, parsedFeatureFlags);
  } catch (e3) {
    return DEFAULT_FEATURE_FLAGS;
  }
}
var FeatureFlagsContext = (0, import_react39.createContext)(null);
function useFeatureFlags() {
  const context2 = import_react39.default.useContext(FeatureFlagsContext);
  if (context2 === null) {
    throw new Error(
      "useFeatureFlags must be used within a FeatureFlagsProvider"
    );
  }
  return context2;
}
function FeatureFlagsProvider(props) {
  const [featureFlags, _setFeatureFlags] = (0, import_react39.useState)(getFeatureFlags());
  const setFeatureFlags = (featureFlags2) => {
    localStorage.setItem(
      LOCAL_STORAGE_FEATURE_FLAGS_KEY,
      JSON.stringify(featureFlags2)
    );
    _setFeatureFlags(featureFlags2);
  };
  return /* @__PURE__ */ jsx5(FeatureFlagsContext.Provider, { value: { featureFlags, setFeatureFlags }, children: /* @__PURE__ */ jsx5(FeatureFlagsControls, { children: props.children }) });
}
function FeatureFlagsControls(props) {
  const { children } = props;
  const { featureFlags, setFeatureFlags } = useFeatureFlags();
  const [showControls, setShowControls] = (0, import_react39.useState)(false);
  useHotkeys("ctrl+shift+f", () => setShowControls(true));
  return /* @__PURE__ */ jsxs2(Fragment5, { children: [
    children,
    /* @__PURE__ */ jsx5(
      DialogContainer,
      {
        type: "modal",
        isDismissable: true,
        onDismiss: () => setShowControls(false),
        children: showControls && /* @__PURE__ */ jsx5(_Dialog, { title: "Feature Flags", children: /* @__PURE__ */ jsx5(_View, { height: "size-1000", padding: "size-100", children: Object.keys(featureFlags).map((featureFlag) => /* @__PURE__ */ jsx5(
          _Switch,
          {
            isSelected: featureFlags[featureFlag],
            onChange: (isSelected) => setFeatureFlags({
              ...featureFlags,
              [featureFlag]: isSelected
            }),
            children: featureFlag
          },
          featureFlag
        )) }) })
      }
    )
  ] });
}

// src/contexts/DatasetsContext.tsx
var import_react40 = __toESM(require_react());

// src/typeUtils.ts
function assertUnreachable2(_) {
  throw new Error("Unreachable");
}
function isNumberOrNull(value) {
  return typeof value === "number" || value === null;
}
function isStringOrNull(value) {
  return typeof value === "string" || value === null;
}
function isStringArray(value) {
  if (!Array.isArray(value)) {
    return false;
  }
  return value.every((item) => typeof item === "string");
}

// src/contexts/DatasetsContext.tsx
var DatasetsContext = (0, import_react40.createContext)(null);
function useDatasets() {
  const context2 = import_react40.default.useContext(DatasetsContext);
  if (context2 === null) {
    throw new Error("useDatasets must be used within a DatasetsProvider");
  }
  return context2;
}
function DatasetsProvider(props) {
  return /* @__PURE__ */ jsx5(
    DatasetsContext.Provider,
    {
      value: {
        primaryDataset: props.primaryDataset,
        referenceDataset: props.referenceDataset,
        corpusDataset: props.corpusDataset,
        getDatasetNameByRole: (datasetRole) => {
          switch (datasetRole) {
            case "primary" /* primary */:
              return props.primaryDataset.name;
            case "reference" /* reference */:
              return props.referenceDataset?.name ?? "reference";
            case "corpus" /* corpus */:
              return props.corpusDataset?.name ?? "corpus";
            default:
              assertUnreachable2(datasetRole);
          }
        }
      },
      children: props.children
    }
  );
}

// src/contexts/PointCloudContext.tsx
var import_react46 = __toESM(require_react());

// node_modules/use-zustand/dist/index.modern.js
var import_react41 = __toESM(require_react());
function n(n2, c4, o = Object.is) {
  const i2 = n2.getState(), s2 = (0, import_react41.useMemo)(() => c4(i2), [i2, c4]), [[u, b], f] = (0, import_react41.useReducer)((t3, r3) => {
    if (r3)
      return [s2, n2];
    const e3 = n2.getState();
    if (Object.is(i2, e3) && t3[1] === n2)
      return t3;
    const u2 = c4(e3);
    return o(t3[0], u2) && t3[1] === n2 ? t3 : [u2, n2];
  }, void 0, () => [s2, n2]);
  return (0, import_react41.useEffect)(() => {
    const t3 = n2.subscribe(f);
    return f(), t3;
  }, [n2]), b !== n2 ? (f(true), s2) : (o(u, s2) || f(true), u);
}

// src/store/__generated__/pointCloudStore_dimensionMetadataQuery.graphql.ts
var node2 = function() {
  var v0 = {
    "defaultValue": null,
    "kind": "LocalArgument",
    "name": "getDimensionCategories"
  }, v12 = {
    "defaultValue": null,
    "kind": "LocalArgument",
    "name": "getDimensionMinMax"
  }, v22 = {
    "defaultValue": null,
    "kind": "LocalArgument",
    "name": "id"
  }, v32 = [
    {
      "kind": "Variable",
      "name": "id",
      "variableName": "id"
    }
  ], v4 = {
    "alias": null,
    "args": null,
    "kind": "ScalarField",
    "name": "id",
    "storageKey": null
  }, v5 = {
    "condition": "getDimensionMinMax",
    "kind": "Condition",
    "passingValue": true,
    "selections": [
      {
        "alias": "min",
        "args": [
          {
            "kind": "Literal",
            "name": "metric",
            "value": "min"
          }
        ],
        "kind": "ScalarField",
        "name": "dataQualityMetric",
        "storageKey": 'dataQualityMetric(metric:"min")'
      },
      {
        "alias": "max",
        "args": [
          {
            "kind": "Literal",
            "name": "metric",
            "value": "max"
          }
        ],
        "kind": "ScalarField",
        "name": "dataQualityMetric",
        "storageKey": 'dataQualityMetric(metric:"max")'
      }
    ]
  }, v6 = {
    "condition": "getDimensionCategories",
    "kind": "Condition",
    "passingValue": true,
    "selections": [
      {
        "alias": null,
        "args": null,
        "kind": "ScalarField",
        "name": "categories",
        "storageKey": null
      }
    ]
  };
  return {
    "fragment": {
      "argumentDefinitions": [
        v0,
        v12,
        v22
      ],
      "kind": "Fragment",
      "metadata": null,
      "name": "pointCloudStore_dimensionMetadataQuery",
      "selections": [
        {
          "kind": "RequiredField",
          "field": {
            "alias": "dimension",
            "args": v32,
            "concreteType": null,
            "kind": "LinkedField",
            "name": "node",
            "plural": false,
            "selections": [
              {
                "kind": "InlineFragment",
                "selections": [
                  v4,
                  v5,
                  v6
                ],
                "type": "Dimension",
                "abstractKey": null
              }
            ],
            "storageKey": null
          },
          "action": "THROW",
          "path": "dimension"
        }
      ],
      "type": "Query",
      "abstractKey": null
    },
    "kind": "Request",
    "operation": {
      "argumentDefinitions": [
        v22,
        v12,
        v0
      ],
      "kind": "Operation",
      "name": "pointCloudStore_dimensionMetadataQuery",
      "selections": [
        {
          "alias": "dimension",
          "args": v32,
          "concreteType": null,
          "kind": "LinkedField",
          "name": "node",
          "plural": false,
          "selections": [
            {
              "alias": null,
              "args": null,
              "kind": "ScalarField",
              "name": "__typename",
              "storageKey": null
            },
            {
              "kind": "TypeDiscriminator",
              "abstractKey": "__isNode"
            },
            v4,
            {
              "kind": "InlineFragment",
              "selections": [
                v5,
                v6
              ],
              "type": "Dimension",
              "abstractKey": null
            }
          ],
          "storageKey": null
        }
      ]
    },
    "params": {
      "cacheID": "79c15606d5694bd068270b42ed2fe74c",
      "id": null,
      "metadata": {},
      "name": "pointCloudStore_dimensionMetadataQuery",
      "operationKind": "query",
      "text": "query pointCloudStore_dimensionMetadataQuery(\n  $id: GlobalID!\n  $getDimensionMinMax: Boolean!\n  $getDimensionCategories: Boolean!\n) {\n  dimension: node(id: $id) {\n    __typename\n    ... on Dimension {\n      id\n      min: dataQualityMetric(metric: min) @include(if: $getDimensionMinMax)\n      max: dataQualityMetric(metric: max) @include(if: $getDimensionMinMax)\n      categories @include(if: $getDimensionCategories)\n    }\n    __isNode: __typename\n    id\n  }\n}\n"
    }
  };
}();
node2.hash = "e8fa488a0d466b5e40fdadc1e5227a57";
var pointCloudStore_dimensionMetadataQuery_graphql_default = node2;

// src/store/__generated__/pointCloudStore_eventsQuery.graphql.ts
var node3 = function() {
  var v0 = {
    "defaultValue": null,
    "kind": "LocalArgument",
    "name": "corpusEventIds"
  }, v12 = {
    "defaultValue": null,
    "kind": "LocalArgument",
    "name": "primaryEventIds"
  }, v22 = {
    "defaultValue": null,
    "kind": "LocalArgument",
    "name": "referenceEventIds"
  }, v32 = {
    "alias": null,
    "args": null,
    "kind": "ScalarField",
    "name": "id",
    "storageKey": null
  }, v4 = {
    "alias": null,
    "args": null,
    "kind": "ScalarField",
    "name": "name",
    "storageKey": null
  }, v5 = {
    "alias": null,
    "args": null,
    "kind": "ScalarField",
    "name": "type",
    "storageKey": null
  }, v6 = {
    "alias": null,
    "args": null,
    "kind": "ScalarField",
    "name": "value",
    "storageKey": null
  }, v7 = {
    "alias": null,
    "args": null,
    "concreteType": "EventMetadata",
    "kind": "LinkedField",
    "name": "eventMetadata",
    "plural": false,
    "selections": [
      {
        "alias": null,
        "args": null,
        "kind": "ScalarField",
        "name": "predictionId",
        "storageKey": null
      },
      {
        "alias": null,
        "args": null,
        "kind": "ScalarField",
        "name": "predictionLabel",
        "storageKey": null
      },
      {
        "alias": null,
        "args": null,
        "kind": "ScalarField",
        "name": "predictionScore",
        "storageKey": null
      },
      {
        "alias": null,
        "args": null,
        "kind": "ScalarField",
        "name": "actualLabel",
        "storageKey": null
      },
      {
        "alias": null,
        "args": null,
        "kind": "ScalarField",
        "name": "actualScore",
        "storageKey": null
      }
    ],
    "storageKey": null
  }, v8 = {
    "alias": null,
    "args": null,
    "concreteType": "PromptResponse",
    "kind": "LinkedField",
    "name": "promptAndResponse",
    "plural": false,
    "selections": [
      {
        "alias": null,
        "args": null,
        "kind": "ScalarField",
        "name": "prompt",
        "storageKey": null
      },
      {
        "alias": null,
        "args": null,
        "kind": "ScalarField",
        "name": "response",
        "storageKey": null
      }
    ],
    "storageKey": null
  }, v9 = {
    "alias": null,
    "args": null,
    "kind": "ScalarField",
    "name": "documentText",
    "storageKey": null
  }, v10 = [
    v32,
    {
      "alias": null,
      "args": null,
      "concreteType": "DimensionWithValue",
      "kind": "LinkedField",
      "name": "dimensions",
      "plural": true,
      "selections": [
        {
          "alias": null,
          "args": null,
          "concreteType": "Dimension",
          "kind": "LinkedField",
          "name": "dimension",
          "plural": false,
          "selections": [
            v4,
            v5
          ],
          "storageKey": null
        },
        v6
      ],
      "storageKey": null
    },
    v7,
    v8,
    v9
  ], v11 = [
    {
      "alias": null,
      "args": null,
      "concreteType": "Model",
      "kind": "LinkedField",
      "name": "model",
      "plural": false,
      "selections": [
        {
          "alias": null,
          "args": null,
          "concreteType": "Dataset",
          "kind": "LinkedField",
          "name": "primaryDataset",
          "plural": false,
          "selections": [
            {
              "alias": null,
              "args": [
                {
                  "kind": "Variable",
                  "name": "eventIds",
                  "variableName": "primaryEventIds"
                }
              ],
              "concreteType": "Event",
              "kind": "LinkedField",
              "name": "events",
              "plural": true,
              "selections": v10,
              "storageKey": null
            }
          ],
          "storageKey": null
        },
        {
          "alias": null,
          "args": null,
          "concreteType": "Dataset",
          "kind": "LinkedField",
          "name": "referenceDataset",
          "plural": false,
          "selections": [
            {
              "alias": null,
              "args": [
                {
                  "kind": "Variable",
                  "name": "eventIds",
                  "variableName": "referenceEventIds"
                }
              ],
              "concreteType": "Event",
              "kind": "LinkedField",
              "name": "events",
              "plural": true,
              "selections": [
                v32,
                {
                  "alias": null,
                  "args": null,
                  "concreteType": "DimensionWithValue",
                  "kind": "LinkedField",
                  "name": "dimensions",
                  "plural": true,
                  "selections": [
                    {
                      "alias": null,
                      "args": null,
                      "concreteType": "Dimension",
                      "kind": "LinkedField",
                      "name": "dimension",
                      "plural": false,
                      "selections": [
                        v32,
                        v4,
                        v5
                      ],
                      "storageKey": null
                    },
                    v6
                  ],
                  "storageKey": null
                },
                v7,
                v8,
                v9
              ],
              "storageKey": null
            }
          ],
          "storageKey": null
        },
        {
          "alias": null,
          "args": null,
          "concreteType": "Dataset",
          "kind": "LinkedField",
          "name": "corpusDataset",
          "plural": false,
          "selections": [
            {
              "alias": null,
              "args": [
                {
                  "kind": "Variable",
                  "name": "eventIds",
                  "variableName": "corpusEventIds"
                }
              ],
              "concreteType": "Event",
              "kind": "LinkedField",
              "name": "events",
              "plural": true,
              "selections": v10,
              "storageKey": null
            }
          ],
          "storageKey": null
        }
      ],
      "storageKey": null
    }
  ];
  return {
    "fragment": {
      "argumentDefinitions": [
        v0,
        v12,
        v22
      ],
      "kind": "Fragment",
      "metadata": null,
      "name": "pointCloudStore_eventsQuery",
      "selections": v11,
      "type": "Query",
      "abstractKey": null
    },
    "kind": "Request",
    "operation": {
      "argumentDefinitions": [
        v12,
        v22,
        v0
      ],
      "kind": "Operation",
      "name": "pointCloudStore_eventsQuery",
      "selections": v11
    },
    "params": {
      "cacheID": "e26a15665d2dd03479941745a539410d",
      "id": null,
      "metadata": {},
      "name": "pointCloudStore_eventsQuery",
      "operationKind": "query",
      "text": "query pointCloudStore_eventsQuery(\n  $primaryEventIds: [ID!]!\n  $referenceEventIds: [ID!]!\n  $corpusEventIds: [ID!]!\n) {\n  model {\n    primaryDataset {\n      events(eventIds: $primaryEventIds) {\n        id\n        dimensions {\n          dimension {\n            name\n            type\n          }\n          value\n        }\n        eventMetadata {\n          predictionId\n          predictionLabel\n          predictionScore\n          actualLabel\n          actualScore\n        }\n        promptAndResponse {\n          prompt\n          response\n        }\n        documentText\n      }\n    }\n    referenceDataset {\n      events(eventIds: $referenceEventIds) {\n        id\n        dimensions {\n          dimension {\n            id\n            name\n            type\n          }\n          value\n        }\n        eventMetadata {\n          predictionId\n          predictionLabel\n          predictionScore\n          actualLabel\n          actualScore\n        }\n        promptAndResponse {\n          prompt\n          response\n        }\n        documentText\n      }\n    }\n    corpusDataset {\n      events(eventIds: $corpusEventIds) {\n        id\n        dimensions {\n          dimension {\n            name\n            type\n          }\n          value\n        }\n        eventMetadata {\n          predictionId\n          predictionLabel\n          predictionScore\n          actualLabel\n          actualScore\n        }\n        promptAndResponse {\n          prompt\n          response\n        }\n        documentText\n      }\n    }\n  }\n}\n"
    }
  };
}();
node3.hash = "2ecca9b28388f179d9bd79010fae7bf2";
var pointCloudStore_eventsQuery_graphql_default = node3;

// src/store/__generated__/pointCloudStore_clustersQuery.graphql.ts
var node4 = function() {
  var v0 = {
    "defaultValue": null,
    "kind": "LocalArgument",
    "name": "clusterMinSamples"
  }, v12 = {
    "defaultValue": null,
    "kind": "LocalArgument",
    "name": "clusterSelectionEpsilon"
  }, v22 = {
    "defaultValue": null,
    "kind": "LocalArgument",
    "name": "coordinates"
  }, v32 = {
    "defaultValue": null,
    "kind": "LocalArgument",
    "name": "dataQualityMetricColumnName"
  }, v4 = {
    "defaultValue": null,
    "kind": "LocalArgument",
    "name": "eventIds"
  }, v5 = {
    "defaultValue": null,
    "kind": "LocalArgument",
    "name": "fetchDataQualityMetric"
  }, v6 = {
    "defaultValue": null,
    "kind": "LocalArgument",
    "name": "fetchPerformanceMetric"
  }, v7 = {
    "defaultValue": null,
    "kind": "LocalArgument",
    "name": "minClusterSize"
  }, v8 = {
    "defaultValue": null,
    "kind": "LocalArgument",
    "name": "performanceMetric"
  }, v9 = [
    {
      "alias": null,
      "args": null,
      "kind": "ScalarField",
      "name": "primaryValue",
      "storageKey": null
    },
    {
      "alias": null,
      "args": null,
      "kind": "ScalarField",
      "name": "referenceValue",
      "storageKey": null
    }
  ], v10 = [
    {
      "alias": null,
      "args": [
        {
          "kind": "Variable",
          "name": "clusterMinSamples",
          "variableName": "clusterMinSamples"
        },
        {
          "kind": "Variable",
          "name": "clusterSelectionEpsilon",
          "variableName": "clusterSelectionEpsilon"
        },
        {
          "kind": "Variable",
          "name": "coordinates3d",
          "variableName": "coordinates"
        },
        {
          "kind": "Variable",
          "name": "eventIds",
          "variableName": "eventIds"
        },
        {
          "kind": "Variable",
          "name": "minClusterSize",
          "variableName": "minClusterSize"
        }
      ],
      "concreteType": "Cluster",
      "kind": "LinkedField",
      "name": "hdbscanClustering",
      "plural": true,
      "selections": [
        {
          "alias": null,
          "args": null,
          "kind": "ScalarField",
          "name": "id",
          "storageKey": null
        },
        {
          "alias": null,
          "args": null,
          "kind": "ScalarField",
          "name": "eventIds",
          "storageKey": null
        },
        {
          "alias": null,
          "args": null,
          "kind": "ScalarField",
          "name": "driftRatio",
          "storageKey": null
        },
        {
          "alias": null,
          "args": null,
          "kind": "ScalarField",
          "name": "primaryToCorpusRatio",
          "storageKey": null
        },
        {
          "condition": "fetchDataQualityMetric",
          "kind": "Condition",
          "passingValue": true,
          "selections": [
            {
              "alias": null,
              "args": [
                {
                  "fields": [
                    {
                      "kind": "Variable",
                      "name": "columnName",
                      "variableName": "dataQualityMetricColumnName"
                    },
                    {
                      "kind": "Literal",
                      "name": "metric",
                      "value": "mean"
                    }
                  ],
                  "kind": "ObjectValue",
                  "name": "metric"
                }
              ],
              "concreteType": "DatasetValues",
              "kind": "LinkedField",
              "name": "dataQualityMetric",
              "plural": false,
              "selections": v9,
              "storageKey": null
            }
          ]
        },
        {
          "condition": "fetchPerformanceMetric",
          "kind": "Condition",
          "passingValue": true,
          "selections": [
            {
              "alias": null,
              "args": [
                {
                  "fields": [
                    {
                      "kind": "Variable",
                      "name": "metric",
                      "variableName": "performanceMetric"
                    }
                  ],
                  "kind": "ObjectValue",
                  "name": "metric"
                }
              ],
              "concreteType": "DatasetValues",
              "kind": "LinkedField",
              "name": "performanceMetric",
              "plural": false,
              "selections": v9,
              "storageKey": null
            }
          ]
        }
      ],
      "storageKey": null
    }
  ];
  return {
    "fragment": {
      "argumentDefinitions": [
        v0,
        v12,
        v22,
        v32,
        v4,
        v5,
        v6,
        v7,
        v8
      ],
      "kind": "Fragment",
      "metadata": null,
      "name": "pointCloudStore_clustersQuery",
      "selections": v10,
      "type": "Query",
      "abstractKey": null
    },
    "kind": "Request",
    "operation": {
      "argumentDefinitions": [
        v4,
        v22,
        v7,
        v0,
        v12,
        v5,
        v32,
        v6,
        v8
      ],
      "kind": "Operation",
      "name": "pointCloudStore_clustersQuery",
      "selections": v10
    },
    "params": {
      "cacheID": "a1a02d970d255935edfcdd797e4ca80d",
      "id": null,
      "metadata": {},
      "name": "pointCloudStore_clustersQuery",
      "operationKind": "query",
      "text": "query pointCloudStore_clustersQuery(\n  $eventIds: [ID!]!\n  $coordinates: [InputCoordinate3D!]!\n  $minClusterSize: Int!\n  $clusterMinSamples: Int!\n  $clusterSelectionEpsilon: Float!\n  $fetchDataQualityMetric: Boolean!\n  $dataQualityMetricColumnName: String\n  $fetchPerformanceMetric: Boolean!\n  $performanceMetric: PerformanceMetric!\n) {\n  hdbscanClustering(eventIds: $eventIds, coordinates3d: $coordinates, minClusterSize: $minClusterSize, clusterMinSamples: $clusterMinSamples, clusterSelectionEpsilon: $clusterSelectionEpsilon) {\n    id\n    eventIds\n    driftRatio\n    primaryToCorpusRatio\n    dataQualityMetric(metric: {metric: mean, columnName: $dataQualityMetricColumnName}) @include(if: $fetchDataQualityMetric) {\n      primaryValue\n      referenceValue\n    }\n    performanceMetric(metric: {metric: $performanceMetric}) @include(if: $fetchPerformanceMetric) {\n      primaryValue\n      referenceValue\n    }\n  }\n}\n"
    }
  };
}();
node4.hash = "b26f299a862a3bc4f5487ace49db1d43";
var pointCloudStore_clustersQuery_graphql_default = node4;

// src/store/__generated__/pointCloudStore_clusterMetricsQuery.graphql.ts
var node5 = function() {
  var v0 = {
    "defaultValue": null,
    "kind": "LocalArgument",
    "name": "clusters"
  }, v12 = {
    "defaultValue": null,
    "kind": "LocalArgument",
    "name": "dataQualityMetricColumnName"
  }, v22 = {
    "defaultValue": null,
    "kind": "LocalArgument",
    "name": "fetchDataQualityMetric"
  }, v32 = {
    "defaultValue": null,
    "kind": "LocalArgument",
    "name": "fetchPerformanceMetric"
  }, v4 = {
    "defaultValue": null,
    "kind": "LocalArgument",
    "name": "performanceMetric"
  }, v5 = [
    {
      "alias": null,
      "args": null,
      "kind": "ScalarField",
      "name": "primaryValue",
      "storageKey": null
    },
    {
      "alias": null,
      "args": null,
      "kind": "ScalarField",
      "name": "referenceValue",
      "storageKey": null
    }
  ], v6 = [
    {
      "alias": null,
      "args": [
        {
          "kind": "Variable",
          "name": "clusters",
          "variableName": "clusters"
        }
      ],
      "concreteType": "Cluster",
      "kind": "LinkedField",
      "name": "clusters",
      "plural": true,
      "selections": [
        {
          "alias": null,
          "args": null,
          "kind": "ScalarField",
          "name": "id",
          "storageKey": null
        },
        {
          "alias": null,
          "args": null,
          "kind": "ScalarField",
          "name": "eventIds",
          "storageKey": null
        },
        {
          "alias": null,
          "args": null,
          "kind": "ScalarField",
          "name": "driftRatio",
          "storageKey": null
        },
        {
          "alias": null,
          "args": null,
          "kind": "ScalarField",
          "name": "primaryToCorpusRatio",
          "storageKey": null
        },
        {
          "condition": "fetchDataQualityMetric",
          "kind": "Condition",
          "passingValue": true,
          "selections": [
            {
              "alias": null,
              "args": [
                {
                  "fields": [
                    {
                      "kind": "Variable",
                      "name": "columnName",
                      "variableName": "dataQualityMetricColumnName"
                    },
                    {
                      "kind": "Literal",
                      "name": "metric",
                      "value": "mean"
                    }
                  ],
                  "kind": "ObjectValue",
                  "name": "metric"
                }
              ],
              "concreteType": "DatasetValues",
              "kind": "LinkedField",
              "name": "dataQualityMetric",
              "plural": false,
              "selections": v5,
              "storageKey": null
            }
          ]
        },
        {
          "condition": "fetchPerformanceMetric",
          "kind": "Condition",
          "passingValue": true,
          "selections": [
            {
              "alias": null,
              "args": [
                {
                  "fields": [
                    {
                      "kind": "Variable",
                      "name": "metric",
                      "variableName": "performanceMetric"
                    }
                  ],
                  "kind": "ObjectValue",
                  "name": "metric"
                }
              ],
              "concreteType": "DatasetValues",
              "kind": "LinkedField",
              "name": "performanceMetric",
              "plural": false,
              "selections": v5,
              "storageKey": null
            }
          ]
        }
      ],
      "storageKey": null
    }
  ];
  return {
    "fragment": {
      "argumentDefinitions": [
        v0,
        v12,
        v22,
        v32,
        v4
      ],
      "kind": "Fragment",
      "metadata": null,
      "name": "pointCloudStore_clusterMetricsQuery",
      "selections": v6,
      "type": "Query",
      "abstractKey": null
    },
    "kind": "Request",
    "operation": {
      "argumentDefinitions": [
        v0,
        v22,
        v12,
        v32,
        v4
      ],
      "kind": "Operation",
      "name": "pointCloudStore_clusterMetricsQuery",
      "selections": v6
    },
    "params": {
      "cacheID": "86666967012812887ac0a0149d2d2535",
      "id": null,
      "metadata": {},
      "name": "pointCloudStore_clusterMetricsQuery",
      "operationKind": "query",
      "text": "query pointCloudStore_clusterMetricsQuery(\n  $clusters: [ClusterInput!]!\n  $fetchDataQualityMetric: Boolean!\n  $dataQualityMetricColumnName: String\n  $fetchPerformanceMetric: Boolean!\n  $performanceMetric: PerformanceMetric!\n) {\n  clusters(clusters: $clusters) {\n    id\n    eventIds\n    driftRatio\n    primaryToCorpusRatio\n    dataQualityMetric(metric: {metric: mean, columnName: $dataQualityMetricColumnName}) @include(if: $fetchDataQualityMetric) {\n      primaryValue\n      referenceValue\n    }\n    performanceMetric(metric: {metric: $performanceMetric}) @include(if: $fetchPerformanceMetric) {\n      primaryValue\n      referenceValue\n    }\n  }\n}\n"
    }
  };
}();
node5.hash = "dbfc8c02ba1ec4f2ba0317b371854d9b";
var pointCloudStore_clusterMetricsQuery_graphql_default = node5;

// src/store/pointCloudStore.ts
var import_react_relay = __toESM(require_react_relay());

// node_modules/d3-scale-chromatic/src/colors.js
function colors_default(specifier) {
  var n2 = specifier.length / 6 | 0, colors = new Array(n2), i2 = 0;
  while (i2 < n2)
    colors[i2] = "#" + specifier.slice(i2 * 6, ++i2 * 6);
  return colors;
}

// node_modules/d3-scale-chromatic/src/categorical/category10.js
var category10_default = colors_default("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf");

// node_modules/d3-color/src/define.js
function define_default(constructor, factory, prototype) {
  constructor.prototype = factory.prototype = prototype;
  prototype.constructor = constructor;
}
function extend(parent, definition) {
  var prototype = Object.create(parent.prototype);
  for (var key in definition)
    prototype[key] = definition[key];
  return prototype;
}

// node_modules/d3-color/src/color.js
function Color() {
}
var darker = 0.7;
var brighter = 1 / darker;
var reI = "\\s*([+-]?\\d+)\\s*";
var reN = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*";
var reP = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*";
var reHex = /^#([0-9a-f]{3,8})$/;
var reRgbInteger = new RegExp(`^rgb\\(${reI},${reI},${reI}\\)$`);
var reRgbPercent = new RegExp(`^rgb\\(${reP},${reP},${reP}\\)$`);
var reRgbaInteger = new RegExp(`^rgba\\(${reI},${reI},${reI},${reN}\\)$`);
var reRgbaPercent = new RegExp(`^rgba\\(${reP},${reP},${reP},${reN}\\)$`);
var reHslPercent = new RegExp(`^hsl\\(${reN},${reP},${reP}\\)$`);
var reHslaPercent = new RegExp(`^hsla\\(${reN},${reP},${reP},${reN}\\)$`);
var named = {
  aliceblue: 15792383,
  antiquewhite: 16444375,
  aqua: 65535,
  aquamarine: 8388564,
  azure: 15794175,
  beige: 16119260,
  bisque: 16770244,
  black: 0,
  blanchedalmond: 16772045,
  blue: 255,
  blueviolet: 9055202,
  brown: 10824234,
  burlywood: 14596231,
  cadetblue: 6266528,
  chartreuse: 8388352,
  chocolate: 13789470,
  coral: 16744272,
  cornflowerblue: 6591981,
  cornsilk: 16775388,
  crimson: 14423100,
  cyan: 65535,
  darkblue: 139,
  darkcyan: 35723,
  darkgoldenrod: 12092939,
  darkgray: 11119017,
  darkgreen: 25600,
  darkgrey: 11119017,
  darkkhaki: 12433259,
  darkmagenta: 9109643,
  darkolivegreen: 5597999,
  darkorange: 16747520,
  darkorchid: 10040012,
  darkred: 9109504,
  darksalmon: 15308410,
  darkseagreen: 9419919,
  darkslateblue: 4734347,
  darkslategray: 3100495,
  darkslategrey: 3100495,
  darkturquoise: 52945,
  darkviolet: 9699539,
  deeppink: 16716947,
  deepskyblue: 49151,
  dimgray: 6908265,
  dimgrey: 6908265,
  dodgerblue: 2003199,
  firebrick: 11674146,
  floralwhite: 16775920,
  forestgreen: 2263842,
  fuchsia: 16711935,
  gainsboro: 14474460,
  ghostwhite: 16316671,
  gold: 16766720,
  goldenrod: 14329120,
  gray: 8421504,
  green: 32768,
  greenyellow: 11403055,
  grey: 8421504,
  honeydew: 15794160,
  hotpink: 16738740,
  indianred: 13458524,
  indigo: 4915330,
  ivory: 16777200,
  khaki: 15787660,
  lavender: 15132410,
  lavenderblush: 16773365,
  lawngreen: 8190976,
  lemonchiffon: 16775885,
  lightblue: 11393254,
  lightcoral: 15761536,
  lightcyan: 14745599,
  lightgoldenrodyellow: 16448210,
  lightgray: 13882323,
  lightgreen: 9498256,
  lightgrey: 13882323,
  lightpink: 16758465,
  lightsalmon: 16752762,
  lightseagreen: 2142890,
  lightskyblue: 8900346,
  lightslategray: 7833753,
  lightslategrey: 7833753,
  lightsteelblue: 11584734,
  lightyellow: 16777184,
  lime: 65280,
  limegreen: 3329330,
  linen: 16445670,
  magenta: 16711935,
  maroon: 8388608,
  mediumaquamarine: 6737322,
  mediumblue: 205,
  mediumorchid: 12211667,
  mediumpurple: 9662683,
  mediumseagreen: 3978097,
  mediumslateblue: 8087790,
  mediumspringgreen: 64154,
  mediumturquoise: 4772300,
  mediumvioletred: 13047173,
  midnightblue: 1644912,
  mintcream: 16121850,
  mistyrose: 16770273,
  moccasin: 16770229,
  navajowhite: 16768685,
  navy: 128,
  oldlace: 16643558,
  olive: 8421376,
  olivedrab: 7048739,
  orange: 16753920,
  orangered: 16729344,
  orchid: 14315734,
  palegoldenrod: 15657130,
  palegreen: 10025880,
  paleturquoise: 11529966,
  palevioletred: 14381203,
  papayawhip: 16773077,
  peachpuff: 16767673,
  peru: 13468991,
  pink: 16761035,
  plum: 14524637,
  powderblue: 11591910,
  purple: 8388736,
  rebeccapurple: 6697881,
  red: 16711680,
  rosybrown: 12357519,
  royalblue: 4286945,
  saddlebrown: 9127187,
  salmon: 16416882,
  sandybrown: 16032864,
  seagreen: 3050327,
  seashell: 16774638,
  sienna: 10506797,
  silver: 12632256,
  skyblue: 8900331,
  slateblue: 6970061,
  slategray: 7372944,
  slategrey: 7372944,
  snow: 16775930,
  springgreen: 65407,
  steelblue: 4620980,
  tan: 13808780,
  teal: 32896,
  thistle: 14204888,
  tomato: 16737095,
  turquoise: 4251856,
  violet: 15631086,
  wheat: 16113331,
  white: 16777215,
  whitesmoke: 16119285,
  yellow: 16776960,
  yellowgreen: 10145074
};
define_default(Color, color, {
  copy(channels) {
    return Object.assign(new this.constructor(), this, channels);
  },
  displayable() {
    return this.rgb().displayable();
  },
  hex: color_formatHex,
  // Deprecated! Use color.formatHex.
  formatHex: color_formatHex,
  formatHex8: color_formatHex8,
  formatHsl: color_formatHsl,
  formatRgb: color_formatRgb,
  toString: color_formatRgb
});
function color_formatHex() {
  return this.rgb().formatHex();
}
function color_formatHex8() {
  return this.rgb().formatHex8();
}
function color_formatHsl() {
  return hslConvert(this).formatHsl();
}
function color_formatRgb() {
  return this.rgb().formatRgb();
}
function color(format3) {
  var m, l;
  format3 = (format3 + "").trim().toLowerCase();
  return (m = reHex.exec(format3)) ? (l = m[1].length, m = parseInt(m[1], 16), l === 6 ? rgbn(m) : l === 3 ? new Rgb(m >> 8 & 15 | m >> 4 & 240, m >> 4 & 15 | m & 240, (m & 15) << 4 | m & 15, 1) : l === 8 ? rgba2(m >> 24 & 255, m >> 16 & 255, m >> 8 & 255, (m & 255) / 255) : l === 4 ? rgba2(m >> 12 & 15 | m >> 8 & 240, m >> 8 & 15 | m >> 4 & 240, m >> 4 & 15 | m & 240, ((m & 15) << 4 | m & 15) / 255) : null) : (m = reRgbInteger.exec(format3)) ? new Rgb(m[1], m[2], m[3], 1) : (m = reRgbPercent.exec(format3)) ? new Rgb(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, 1) : (m = reRgbaInteger.exec(format3)) ? rgba2(m[1], m[2], m[3], m[4]) : (m = reRgbaPercent.exec(format3)) ? rgba2(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, m[4]) : (m = reHslPercent.exec(format3)) ? hsla2(m[1], m[2] / 100, m[3] / 100, 1) : (m = reHslaPercent.exec(format3)) ? hsla2(m[1], m[2] / 100, m[3] / 100, m[4]) : named.hasOwnProperty(format3) ? rgbn(named[format3]) : format3 === "transparent" ? new Rgb(NaN, NaN, NaN, 0) : null;
}
function rgbn(n2) {
  return new Rgb(n2 >> 16 & 255, n2 >> 8 & 255, n2 & 255, 1);
}
function rgba2(r3, g, b, a2) {
  if (a2 <= 0)
    r3 = g = b = NaN;
  return new Rgb(r3, g, b, a2);
}
function rgbConvert(o) {
  if (!(o instanceof Color))
    o = color(o);
  if (!o)
    return new Rgb();
  o = o.rgb();
  return new Rgb(o.r, o.g, o.b, o.opacity);
}
function rgb2(r3, g, b, opacity) {
  return arguments.length === 1 ? rgbConvert(r3) : new Rgb(r3, g, b, opacity == null ? 1 : opacity);
}
function Rgb(r3, g, b, opacity) {
  this.r = +r3;
  this.g = +g;
  this.b = +b;
  this.opacity = +opacity;
}
define_default(Rgb, rgb2, extend(Color, {
  brighter(k2) {
    k2 = k2 == null ? brighter : Math.pow(brighter, k2);
    return new Rgb(this.r * k2, this.g * k2, this.b * k2, this.opacity);
  },
  darker(k2) {
    k2 = k2 == null ? darker : Math.pow(darker, k2);
    return new Rgb(this.r * k2, this.g * k2, this.b * k2, this.opacity);
  },
  rgb() {
    return this;
  },
  clamp() {
    return new Rgb(clampi(this.r), clampi(this.g), clampi(this.b), clampa(this.opacity));
  },
  displayable() {
    return -0.5 <= this.r && this.r < 255.5 && (-0.5 <= this.g && this.g < 255.5) && (-0.5 <= this.b && this.b < 255.5) && (0 <= this.opacity && this.opacity <= 1);
  },
  hex: rgb_formatHex,
  // Deprecated! Use color.formatHex.
  formatHex: rgb_formatHex,
  formatHex8: rgb_formatHex8,
  formatRgb: rgb_formatRgb,
  toString: rgb_formatRgb
}));
function rgb_formatHex() {
  return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}`;
}
function rgb_formatHex8() {
  return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}${hex((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`;
}
function rgb_formatRgb() {
  const a2 = clampa(this.opacity);
  return `${a2 === 1 ? "rgb(" : "rgba("}${clampi(this.r)}, ${clampi(this.g)}, ${clampi(this.b)}${a2 === 1 ? ")" : `, ${a2})`}`;
}
function clampa(opacity) {
  return isNaN(opacity) ? 1 : Math.max(0, Math.min(1, opacity));
}
function clampi(value) {
  return Math.max(0, Math.min(255, Math.round(value) || 0));
}
function hex(value) {
  value = clampi(value);
  return (value < 16 ? "0" : "") + value.toString(16);
}
function hsla2(h, s2, l, a2) {
  if (a2 <= 0)
    h = s2 = l = NaN;
  else if (l <= 0 || l >= 1)
    h = s2 = NaN;
  else if (s2 <= 0)
    h = NaN;
  return new Hsl(h, s2, l, a2);
}
function hslConvert(o) {
  if (o instanceof Hsl)
    return new Hsl(o.h, o.s, o.l, o.opacity);
  if (!(o instanceof Color))
    o = color(o);
  if (!o)
    return new Hsl();
  if (o instanceof Hsl)
    return o;
  o = o.rgb();
  var r3 = o.r / 255, g = o.g / 255, b = o.b / 255, min3 = Math.min(r3, g, b), max3 = Math.max(r3, g, b), h = NaN, s2 = max3 - min3, l = (max3 + min3) / 2;
  if (s2) {
    if (r3 === max3)
      h = (g - b) / s2 + (g < b) * 6;
    else if (g === max3)
      h = (b - r3) / s2 + 2;
    else
      h = (r3 - g) / s2 + 4;
    s2 /= l < 0.5 ? max3 + min3 : 2 - max3 - min3;
    h *= 60;
  } else {
    s2 = l > 0 && l < 1 ? 0 : h;
  }
  return new Hsl(h, s2, l, o.opacity);
}
function hsl2(h, s2, l, opacity) {
  return arguments.length === 1 ? hslConvert(h) : new Hsl(h, s2, l, opacity == null ? 1 : opacity);
}
function Hsl(h, s2, l, opacity) {
  this.h = +h;
  this.s = +s2;
  this.l = +l;
  this.opacity = +opacity;
}
define_default(Hsl, hsl2, extend(Color, {
  brighter(k2) {
    k2 = k2 == null ? brighter : Math.pow(brighter, k2);
    return new Hsl(this.h, this.s, this.l * k2, this.opacity);
  },
  darker(k2) {
    k2 = k2 == null ? darker : Math.pow(darker, k2);
    return new Hsl(this.h, this.s, this.l * k2, this.opacity);
  },
  rgb() {
    var h = this.h % 360 + (this.h < 0) * 360, s2 = isNaN(h) || isNaN(this.s) ? 0 : this.s, l = this.l, m2 = l + (l < 0.5 ? l : 1 - l) * s2, m1 = 2 * l - m2;
    return new Rgb(
      hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2),
      hsl2rgb(h, m1, m2),
      hsl2rgb(h < 120 ? h + 240 : h - 120, m1, m2),
      this.opacity
    );
  },
  clamp() {
    return new Hsl(clamph(this.h), clampt(this.s), clampt(this.l), clampa(this.opacity));
  },
  displayable() {
    return (0 <= this.s && this.s <= 1 || isNaN(this.s)) && (0 <= this.l && this.l <= 1) && (0 <= this.opacity && this.opacity <= 1);
  },
  formatHsl() {
    const a2 = clampa(this.opacity);
    return `${a2 === 1 ? "hsl(" : "hsla("}${clamph(this.h)}, ${clampt(this.s) * 100}%, ${clampt(this.l) * 100}%${a2 === 1 ? ")" : `, ${a2})`}`;
  }
}));
function clamph(value) {
  value = (value || 0) % 360;
  return value < 0 ? value + 360 : value;
}
function clampt(value) {
  return Math.max(0, Math.min(1, value || 0));
}
function hsl2rgb(h, m1, m2) {
  return (h < 60 ? m1 + (m2 - m1) * h / 60 : h < 180 ? m2 : h < 240 ? m1 + (m2 - m1) * (240 - h) / 60 : m1) * 255;
}

// node_modules/d3-color/src/math.js
var radians = Math.PI / 180;
var degrees = 180 / Math.PI;

// node_modules/d3-color/src/cubehelix.js
var A = -0.14861;
var B = 1.78277;
var C = -0.29227;
var D = -0.90649;
var E = 1.97294;
var ED = E * D;
var EB = E * B;
var BC_DA = B * C - D * A;
function cubehelixConvert(o) {
  if (o instanceof Cubehelix)
    return new Cubehelix(o.h, o.s, o.l, o.opacity);
  if (!(o instanceof Rgb))
    o = rgbConvert(o);
  var r3 = o.r / 255, g = o.g / 255, b = o.b / 255, l = (BC_DA * b + ED * r3 - EB * g) / (BC_DA + ED - EB), bl = b - l, k2 = (E * (g - l) - C * bl) / D, s2 = Math.sqrt(k2 * k2 + bl * bl) / (E * l * (1 - l)), h = s2 ? Math.atan2(k2, bl) * degrees - 120 : NaN;
  return new Cubehelix(h < 0 ? h + 360 : h, s2, l, o.opacity);
}
function cubehelix(h, s2, l, opacity) {
  return arguments.length === 1 ? cubehelixConvert(h) : new Cubehelix(h, s2, l, opacity == null ? 1 : opacity);
}
function Cubehelix(h, s2, l, opacity) {
  this.h = +h;
  this.s = +s2;
  this.l = +l;
  this.opacity = +opacity;
}
define_default(Cubehelix, cubehelix, extend(Color, {
  brighter(k2) {
    k2 = k2 == null ? brighter : Math.pow(brighter, k2);
    return new Cubehelix(this.h, this.s, this.l * k2, this.opacity);
  },
  darker(k2) {
    k2 = k2 == null ? darker : Math.pow(darker, k2);
    return new Cubehelix(this.h, this.s, this.l * k2, this.opacity);
  },
  rgb() {
    var h = isNaN(this.h) ? 0 : (this.h + 120) * radians, l = +this.l, a2 = isNaN(this.s) ? 0 : this.s * l * (1 - l), cosh = Math.cos(h), sinh = Math.sin(h);
    return new Rgb(
      255 * (l + a2 * (A * cosh + B * sinh)),
      255 * (l + a2 * (C * cosh + D * sinh)),
      255 * (l + a2 * (E * cosh)),
      this.opacity
    );
  }
}));

// node_modules/d3-interpolate/src/basis.js
function basis(t12, v0, v12, v22, v32) {
  var t22 = t12 * t12, t3 = t22 * t12;
  return ((1 - 3 * t12 + 3 * t22 - t3) * v0 + (4 - 6 * t22 + 3 * t3) * v12 + (1 + 3 * t12 + 3 * t22 - 3 * t3) * v22 + t3 * v32) / 6;
}
function basis_default(values2) {
  var n2 = values2.length - 1;
  return function(t3) {
    var i2 = t3 <= 0 ? t3 = 0 : t3 >= 1 ? (t3 = 1, n2 - 1) : Math.floor(t3 * n2), v12 = values2[i2], v22 = values2[i2 + 1], v0 = i2 > 0 ? values2[i2 - 1] : 2 * v12 - v22, v32 = i2 < n2 - 1 ? values2[i2 + 2] : 2 * v22 - v12;
    return basis((t3 - i2 / n2) * n2, v0, v12, v22, v32);
  };
}

// node_modules/d3-interpolate/src/basisClosed.js
function basisClosed_default(values2) {
  var n2 = values2.length;
  return function(t3) {
    var i2 = Math.floor(((t3 %= 1) < 0 ? ++t3 : t3) * n2), v0 = values2[(i2 + n2 - 1) % n2], v12 = values2[i2 % n2], v22 = values2[(i2 + 1) % n2], v32 = values2[(i2 + 2) % n2];
    return basis((t3 - i2 / n2) * n2, v0, v12, v22, v32);
  };
}

// node_modules/d3-interpolate/src/constant.js
var constant_default = (x2) => () => x2;

// node_modules/d3-interpolate/src/color.js
function linear(a2, d) {
  return function(t3) {
    return a2 + t3 * d;
  };
}
function exponential(a2, b, y2) {
  return a2 = Math.pow(a2, y2), b = Math.pow(b, y2) - a2, y2 = 1 / y2, function(t3) {
    return Math.pow(a2 + t3 * b, y2);
  };
}
function hue(a2, b) {
  var d = b - a2;
  return d ? linear(a2, d > 180 || d < -180 ? d - 360 * Math.round(d / 360) : d) : constant_default(isNaN(a2) ? b : a2);
}
function gamma(y2) {
  return (y2 = +y2) === 1 ? nogamma : function(a2, b) {
    return b - a2 ? exponential(a2, b, y2) : constant_default(isNaN(a2) ? b : a2);
  };
}
function nogamma(a2, b) {
  var d = b - a2;
  return d ? linear(a2, d) : constant_default(isNaN(a2) ? b : a2);
}

// node_modules/d3-interpolate/src/rgb.js
var rgb_default = function rgbGamma(y2) {
  var color2 = gamma(y2);
  function rgb3(start, end) {
    var r3 = color2((start = rgb2(start)).r, (end = rgb2(end)).r), g = color2(start.g, end.g), b = color2(start.b, end.b), opacity = nogamma(start.opacity, end.opacity);
    return function(t3) {
      start.r = r3(t3);
      start.g = g(t3);
      start.b = b(t3);
      start.opacity = opacity(t3);
      return start + "";
    };
  }
  rgb3.gamma = rgbGamma;
  return rgb3;
}(1);
function rgbSpline(spline) {
  return function(colors) {
    var n2 = colors.length, r3 = new Array(n2), g = new Array(n2), b = new Array(n2), i2, color2;
    for (i2 = 0; i2 < n2; ++i2) {
      color2 = rgb2(colors[i2]);
      r3[i2] = color2.r || 0;
      g[i2] = color2.g || 0;
      b[i2] = color2.b || 0;
    }
    r3 = spline(r3);
    g = spline(g);
    b = spline(b);
    color2.opacity = 1;
    return function(t3) {
      color2.r = r3(t3);
      color2.g = g(t3);
      color2.b = b(t3);
      return color2 + "";
    };
  };
}
var rgbBasis = rgbSpline(basis_default);
var rgbBasisClosed = rgbSpline(basisClosed_default);

// node_modules/d3-interpolate/src/numberArray.js
function numberArray_default(a2, b) {
  if (!b)
    b = [];
  var n2 = a2 ? Math.min(b.length, a2.length) : 0, c4 = b.slice(), i2;
  return function(t3) {
    for (i2 = 0; i2 < n2; ++i2)
      c4[i2] = a2[i2] * (1 - t3) + b[i2] * t3;
    return c4;
  };
}
function isNumberArray(x2) {
  return ArrayBuffer.isView(x2) && !(x2 instanceof DataView);
}

// node_modules/d3-interpolate/src/array.js
function genericArray(a2, b) {
  var nb = b ? b.length : 0, na = a2 ? Math.min(nb, a2.length) : 0, x2 = new Array(na), c4 = new Array(nb), i2;
  for (i2 = 0; i2 < na; ++i2)
    x2[i2] = value_default(a2[i2], b[i2]);
  for (; i2 < nb; ++i2)
    c4[i2] = b[i2];
  return function(t3) {
    for (i2 = 0; i2 < na; ++i2)
      c4[i2] = x2[i2](t3);
    return c4;
  };
}

// node_modules/d3-interpolate/src/date.js
function date_default(a2, b) {
  var d = /* @__PURE__ */ new Date();
  return a2 = +a2, b = +b, function(t3) {
    return d.setTime(a2 * (1 - t3) + b * t3), d;
  };
}

// node_modules/d3-interpolate/src/number.js
function number_default(a2, b) {
  return a2 = +a2, b = +b, function(t3) {
    return a2 * (1 - t3) + b * t3;
  };
}

// node_modules/d3-interpolate/src/object.js
function object_default(a2, b) {
  var i2 = {}, c4 = {}, k2;
  if (a2 === null || typeof a2 !== "object")
    a2 = {};
  if (b === null || typeof b !== "object")
    b = {};
  for (k2 in b) {
    if (k2 in a2) {
      i2[k2] = value_default(a2[k2], b[k2]);
    } else {
      c4[k2] = b[k2];
    }
  }
  return function(t3) {
    for (k2 in i2)
      c4[k2] = i2[k2](t3);
    return c4;
  };
}

// node_modules/d3-interpolate/src/string.js
var reA = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g;
var reB = new RegExp(reA.source, "g");
function zero(b) {
  return function() {
    return b;
  };
}
function one(b) {
  return function(t3) {
    return b(t3) + "";
  };
}
function string_default(a2, b) {
  var bi = reA.lastIndex = reB.lastIndex = 0, am, bm, bs, i2 = -1, s2 = [], q = [];
  a2 = a2 + "", b = b + "";
  while ((am = reA.exec(a2)) && (bm = reB.exec(b))) {
    if ((bs = bm.index) > bi) {
      bs = b.slice(bi, bs);
      if (s2[i2])
        s2[i2] += bs;
      else
        s2[++i2] = bs;
    }
    if ((am = am[0]) === (bm = bm[0])) {
      if (s2[i2])
        s2[i2] += bm;
      else
        s2[++i2] = bm;
    } else {
      s2[++i2] = null;
      q.push({ i: i2, x: number_default(am, bm) });
    }
    bi = reB.lastIndex;
  }
  if (bi < b.length) {
    bs = b.slice(bi);
    if (s2[i2])
      s2[i2] += bs;
    else
      s2[++i2] = bs;
  }
  return s2.length < 2 ? q[0] ? one(q[0].x) : zero(b) : (b = q.length, function(t3) {
    for (var i3 = 0, o; i3 < b; ++i3)
      s2[(o = q[i3]).i] = o.x(t3);
    return s2.join("");
  });
}

// node_modules/d3-interpolate/src/value.js
function value_default(a2, b) {
  var t3 = typeof b, c4;
  return b == null || t3 === "boolean" ? constant_default(b) : (t3 === "number" ? number_default : t3 === "string" ? (c4 = color(b)) ? (b = c4, rgb_default) : string_default : b instanceof color ? rgb_default : b instanceof Date ? date_default : isNumberArray(b) ? numberArray_default : Array.isArray(b) ? genericArray : typeof b.valueOf !== "function" && typeof b.toString !== "function" || isNaN(b) ? object_default : number_default)(a2, b);
}

// node_modules/d3-interpolate/src/round.js
function round_default(a2, b) {
  return a2 = +a2, b = +b, function(t3) {
    return Math.round(a2 * (1 - t3) + b * t3);
  };
}

// node_modules/d3-interpolate/src/cubehelix.js
function cubehelix2(hue2) {
  return function cubehelixGamma(y2) {
    y2 = +y2;
    function cubehelix3(start, end) {
      var h = hue2((start = cubehelix(start)).h, (end = cubehelix(end)).h), s2 = nogamma(start.s, end.s), l = nogamma(start.l, end.l), opacity = nogamma(start.opacity, end.opacity);
      return function(t3) {
        start.h = h(t3);
        start.s = s2(t3);
        start.l = l(Math.pow(t3, y2));
        start.opacity = opacity(t3);
        return start + "";
      };
    }
    cubehelix3.gamma = cubehelixGamma;
    return cubehelix3;
  }(1);
}
var cubehelix_default = cubehelix2(hue);
var cubehelixLong = cubehelix2(nogamma);

// node_modules/d3-interpolate/src/piecewise.js
function piecewise(interpolate, values2) {
  if (values2 === void 0)
    values2 = interpolate, interpolate = value_default;
  var i2 = 0, n2 = values2.length - 1, v4 = values2[0], I = new Array(n2 < 0 ? 0 : n2);
  while (i2 < n2)
    I[i2] = interpolate(v4, v4 = values2[++i2]);
  return function(t3) {
    var i3 = Math.max(0, Math.min(n2 - 1, Math.floor(t3 *= n2)));
    return I[i3](t3 - i3);
  };
}

// node_modules/d3-scale-chromatic/src/sequential-multi/rainbow.js
var warm = cubehelixLong(cubehelix(-100, 0.75, 0.35), cubehelix(80, 1.5, 0.8));
var cool = cubehelixLong(cubehelix(260, 0.75, 0.35), cubehelix(80, 1.5, 0.8));
var c = cubehelix();

// node_modules/d3-scale-chromatic/src/sequential-multi/sinebow.js
var c2 = rgb2();
var pi_1_3 = Math.PI / 3;
var pi_2_3 = Math.PI * 2 / 3;
function sinebow_default(t3) {
  var x2;
  t3 = (0.5 - t3) * Math.PI;
  c2.r = 255 * (x2 = Math.sin(t3)) * x2;
  c2.g = 255 * (x2 = Math.sin(t3 + pi_1_3)) * x2;
  c2.b = 255 * (x2 = Math.sin(t3 + pi_2_3)) * x2;
  return c2 + "";
}

// node_modules/zustand/esm/vanilla.mjs
var createStoreImpl = (createState) => {
  let state;
  const listeners = /* @__PURE__ */ new Set();
  const setState = (partial, replace2) => {
    const nextState = typeof partial === "function" ? partial(state) : partial;
    if (!Object.is(nextState, state)) {
      const previousState = state;
      state = (replace2 != null ? replace2 : typeof nextState !== "object") ? nextState : Object.assign({}, state, nextState);
      listeners.forEach((listener) => listener(state, previousState));
    }
  };
  const getState = () => state;
  const subscribe = (listener) => {
    listeners.add(listener);
    return () => listeners.delete(listener);
  };
  const destroy = () => {
    if ((import.meta.env ? import.meta.env.MODE : void 0) !== "production") {
      console.warn(
        "[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."
      );
    }
    listeners.clear();
  };
  const api = { setState, getState, subscribe, destroy };
  state = createState(setState, getState, api);
  return api;
};
var createStore = (createState) => createState ? createStoreImpl(createState) : createStoreImpl;

// node_modules/zustand/esm/index.mjs
var import_react42 = __toESM(require_react(), 1);
var import_with_selector = __toESM(require_with_selector(), 1);
var { useDebugValue } = import_react42.default;
var { useSyncExternalStoreWithSelector } = import_with_selector.default;
var didWarnAboutEqualityFn = false;
function useStore(api, selector = api.getState, equalityFn) {
  if ((import.meta.env ? import.meta.env.MODE : void 0) !== "production" && equalityFn && !didWarnAboutEqualityFn) {
    console.warn(
      "[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"
    );
    didWarnAboutEqualityFn = true;
  }
  const slice3 = useSyncExternalStoreWithSelector(
    api.subscribe,
    api.getState,
    api.getServerState || api.getState,
    selector,
    equalityFn
  );
  useDebugValue(slice3);
  return slice3;
}
var createImpl = (createState) => {
  if ((import.meta.env ? import.meta.env.MODE : void 0) !== "production" && typeof createState !== "function") {
    console.warn(
      "[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`."
    );
  }
  const api = typeof createState === "function" ? createStore(createState) : createState;
  const useBoundStore = (selector, equalityFn) => useStore(api, selector, equalityFn);
  Object.assign(useBoundStore, api);
  return useBoundStore;
};
var create = (createState) => createState ? createImpl(createState) : createImpl;

// node_modules/zustand/esm/middleware.mjs
var trackedConnections = /* @__PURE__ */ new Map();
var getTrackedConnectionState = (name2) => {
  const api = trackedConnections.get(name2);
  if (!api)
    return {};
  return Object.fromEntries(
    Object.entries(api.stores).map(([key, api2]) => [key, api2.getState()])
  );
};
var extractConnectionInformation = (store, extensionConnector, options) => {
  if (store === void 0) {
    return {
      type: "untracked",
      connection: extensionConnector.connect(options)
    };
  }
  const existingConnection = trackedConnections.get(options.name);
  if (existingConnection) {
    return { type: "tracked", store, ...existingConnection };
  }
  const newConnection = {
    connection: extensionConnector.connect(options),
    stores: {}
  };
  trackedConnections.set(options.name, newConnection);
  return { type: "tracked", store, ...newConnection };
};
var devtoolsImpl = (fn, devtoolsOptions = {}) => (set3, get3, api) => {
  const { enabled, anonymousActionType, store, ...options } = devtoolsOptions;
  let extensionConnector;
  try {
    extensionConnector = (enabled != null ? enabled : (import.meta.env ? import.meta.env.MODE : void 0) !== "production") && window.__REDUX_DEVTOOLS_EXTENSION__;
  } catch (e3) {
  }
  if (!extensionConnector) {
    if ((import.meta.env ? import.meta.env.MODE : void 0) !== "production" && enabled) {
      console.warn(
        "[zustand devtools middleware] Please install/enable Redux devtools extension"
      );
    }
    return fn(set3, get3, api);
  }
  const { connection, ...connectionInformation } = extractConnectionInformation(store, extensionConnector, options);
  let isRecording = true;
  api.setState = (state, replace2, nameOrAction) => {
    const r3 = set3(state, replace2);
    if (!isRecording)
      return r3;
    const action = nameOrAction === void 0 ? { type: anonymousActionType || "anonymous" } : typeof nameOrAction === "string" ? { type: nameOrAction } : nameOrAction;
    if (store === void 0) {
      connection == null ? void 0 : connection.send(action, get3());
      return r3;
    }
    connection == null ? void 0 : connection.send(
      {
        ...action,
        type: `${store}/${action.type}`
      },
      {
        ...getTrackedConnectionState(options.name),
        [store]: api.getState()
      }
    );
    return r3;
  };
  const setStateFromDevtools = (...a2) => {
    const originalIsRecording = isRecording;
    isRecording = false;
    set3(...a2);
    isRecording = originalIsRecording;
  };
  const initialState = fn(api.setState, get3, api);
  if (connectionInformation.type === "untracked") {
    connection == null ? void 0 : connection.init(initialState);
  } else {
    connectionInformation.stores[connectionInformation.store] = api;
    connection == null ? void 0 : connection.init(
      Object.fromEntries(
        Object.entries(connectionInformation.stores).map(([key, store2]) => [
          key,
          key === connectionInformation.store ? initialState : store2.getState()
        ])
      )
    );
  }
  if (api.dispatchFromDevtools && typeof api.dispatch === "function") {
    let didWarnAboutReservedActionType = false;
    const originalDispatch = api.dispatch;
    api.dispatch = (...a2) => {
      if ((import.meta.env ? import.meta.env.MODE : void 0) !== "production" && a2[0].type === "__setState" && !didWarnAboutReservedActionType) {
        console.warn(
          '[zustand devtools middleware] "__setState" action type is reserved to set state from the devtools. Avoid using it.'
        );
        didWarnAboutReservedActionType = true;
      }
      originalDispatch(...a2);
    };
  }
  connection.subscribe((message) => {
    var _a2;
    switch (message.type) {
      case "ACTION":
        if (typeof message.payload !== "string") {
          console.error(
            "[zustand devtools middleware] Unsupported action format"
          );
          return;
        }
        return parseJsonThen(
          message.payload,
          (action) => {
            if (action.type === "__setState") {
              if (store === void 0) {
                setStateFromDevtools(action.state);
                return;
              }
              if (Object.keys(action.state).length !== 1) {
                console.error(
                  `
                    [zustand devtools middleware] Unsupported __setState action format. 
                    When using 'store' option in devtools(), the 'state' should have only one key, which is a value of 'store' that was passed in devtools(),
                    and value of this only key should be a state object. Example: { "type": "__setState", "state": { "abc123Store": { "foo": "bar" } } }
                    `
                );
              }
              const stateFromDevtools = action.state[store];
              if (stateFromDevtools === void 0 || stateFromDevtools === null) {
                return;
              }
              if (JSON.stringify(api.getState()) !== JSON.stringify(stateFromDevtools)) {
                setStateFromDevtools(stateFromDevtools);
              }
              return;
            }
            if (!api.dispatchFromDevtools)
              return;
            if (typeof api.dispatch !== "function")
              return;
            api.dispatch(action);
          }
        );
      case "DISPATCH":
        switch (message.payload.type) {
          case "RESET":
            setStateFromDevtools(initialState);
            if (store === void 0) {
              return connection == null ? void 0 : connection.init(api.getState());
            }
            return connection == null ? void 0 : connection.init(getTrackedConnectionState(options.name));
          case "COMMIT":
            if (store === void 0) {
              connection == null ? void 0 : connection.init(api.getState());
              return;
            }
            return connection == null ? void 0 : connection.init(getTrackedConnectionState(options.name));
          case "ROLLBACK":
            return parseJsonThen(message.state, (state) => {
              if (store === void 0) {
                setStateFromDevtools(state);
                connection == null ? void 0 : connection.init(api.getState());
                return;
              }
              setStateFromDevtools(state[store]);
              connection == null ? void 0 : connection.init(getTrackedConnectionState(options.name));
            });
          case "JUMP_TO_STATE":
          case "JUMP_TO_ACTION":
            return parseJsonThen(message.state, (state) => {
              if (store === void 0) {
                setStateFromDevtools(state);
                return;
              }
              if (JSON.stringify(api.getState()) !== JSON.stringify(state[store])) {
                setStateFromDevtools(state[store]);
              }
            });
          case "IMPORT_STATE": {
            const { nextLiftedState } = message.payload;
            const lastComputedState = (_a2 = nextLiftedState.computedStates.slice(-1)[0]) == null ? void 0 : _a2.state;
            if (!lastComputedState)
              return;
            if (store === void 0) {
              setStateFromDevtools(lastComputedState);
            } else {
              setStateFromDevtools(lastComputedState[store]);
            }
            connection == null ? void 0 : connection.send(
              null,
              // FIXME no-any
              nextLiftedState
            );
            return;
          }
          case "PAUSE_RECORDING":
            return isRecording = !isRecording;
        }
        return;
    }
  });
  return initialState;
};
var devtools = devtoolsImpl;
var parseJsonThen = (stringified, f) => {
  let parsed;
  try {
    parsed = JSON.parse(stringified);
  } catch (e3) {
    console.error(
      "[zustand devtools middleware] Could not parse the received json",
      e3
    );
  }
  if (parsed !== void 0)
    f(parsed);
};

// node_modules/@arizeai/point-cloud/dist/point-cloud.esm.js
var import_react45 = __toESM(require_react());

// node_modules/three/build/three.module.js
var three_module_exports = {};
__export(three_module_exports, {
  ACESFilmicToneMapping: () => ACESFilmicToneMapping,
  AddEquation: () => AddEquation,
  AddOperation: () => AddOperation,
  AdditiveAnimationBlendMode: () => AdditiveAnimationBlendMode,
  AdditiveBlending: () => AdditiveBlending,
  AlphaFormat: () => AlphaFormat,
  AlwaysDepth: () => AlwaysDepth,
  AlwaysStencilFunc: () => AlwaysStencilFunc,
  AmbientLight: () => AmbientLight,
  AmbientLightProbe: () => AmbientLightProbe,
  AnimationClip: () => AnimationClip,
  AnimationLoader: () => AnimationLoader,
  AnimationMixer: () => AnimationMixer,
  AnimationObjectGroup: () => AnimationObjectGroup,
  AnimationUtils: () => AnimationUtils,
  ArcCurve: () => ArcCurve,
  ArrayCamera: () => ArrayCamera,
  ArrowHelper: () => ArrowHelper,
  Audio: () => Audio,
  AudioAnalyser: () => AudioAnalyser,
  AudioContext: () => AudioContext,
  AudioListener: () => AudioListener,
  AudioLoader: () => AudioLoader,
  AxesHelper: () => AxesHelper,
  AxisHelper: () => AxisHelper,
  BackSide: () => BackSide,
  BasicDepthPacking: () => BasicDepthPacking,
  BasicShadowMap: () => BasicShadowMap,
  BinaryTextureLoader: () => BinaryTextureLoader,
  Bone: () => Bone,
  BooleanKeyframeTrack: () => BooleanKeyframeTrack,
  BoundingBoxHelper: () => BoundingBoxHelper,
  Box2: () => Box2,
  Box3: () => Box3,
  Box3Helper: () => Box3Helper,
  BoxBufferGeometry: () => BoxGeometry,
  BoxGeometry: () => BoxGeometry,
  BoxHelper: () => BoxHelper,
  BufferAttribute: () => BufferAttribute,
  BufferGeometry: () => BufferGeometry,
  BufferGeometryLoader: () => BufferGeometryLoader,
  ByteType: () => ByteType,
  Cache: () => Cache,
  Camera: () => Camera,
  CameraHelper: () => CameraHelper,
  CanvasRenderer: () => CanvasRenderer,
  CanvasTexture: () => CanvasTexture,
  CapsuleBufferGeometry: () => CapsuleGeometry,
  CapsuleGeometry: () => CapsuleGeometry,
  CatmullRomCurve3: () => CatmullRomCurve3,
  CineonToneMapping: () => CineonToneMapping,
  CircleBufferGeometry: () => CircleGeometry,
  CircleGeometry: () => CircleGeometry,
  ClampToEdgeWrapping: () => ClampToEdgeWrapping,
  Clock: () => Clock,
  Color: () => Color2,
  ColorKeyframeTrack: () => ColorKeyframeTrack,
  ColorManagement: () => ColorManagement,
  CompressedTexture: () => CompressedTexture,
  CompressedTextureLoader: () => CompressedTextureLoader,
  ConeBufferGeometry: () => ConeGeometry,
  ConeGeometry: () => ConeGeometry,
  CubeCamera: () => CubeCamera,
  CubeReflectionMapping: () => CubeReflectionMapping,
  CubeRefractionMapping: () => CubeRefractionMapping,
  CubeTexture: () => CubeTexture,
  CubeTextureLoader: () => CubeTextureLoader,
  CubeUVReflectionMapping: () => CubeUVReflectionMapping,
  CubicBezierCurve: () => CubicBezierCurve,
  CubicBezierCurve3: () => CubicBezierCurve3,
  CubicInterpolant: () => CubicInterpolant,
  CullFaceBack: () => CullFaceBack,
  CullFaceFront: () => CullFaceFront,
  CullFaceFrontBack: () => CullFaceFrontBack,
  CullFaceNone: () => CullFaceNone,
  Curve: () => Curve,
  CurvePath: () => CurvePath,
  CustomBlending: () => CustomBlending,
  CustomToneMapping: () => CustomToneMapping,
  CylinderBufferGeometry: () => CylinderGeometry,
  CylinderGeometry: () => CylinderGeometry,
  Cylindrical: () => Cylindrical,
  Data3DTexture: () => Data3DTexture,
  DataArrayTexture: () => DataArrayTexture,
  DataTexture: () => DataTexture,
  DataTexture2DArray: () => DataTexture2DArray,
  DataTexture3D: () => DataTexture3D,
  DataTextureLoader: () => DataTextureLoader,
  DataUtils: () => DataUtils,
  DecrementStencilOp: () => DecrementStencilOp,
  DecrementWrapStencilOp: () => DecrementWrapStencilOp,
  DefaultLoadingManager: () => DefaultLoadingManager,
  DepthFormat: () => DepthFormat,
  DepthStencilFormat: () => DepthStencilFormat,
  DepthTexture: () => DepthTexture,
  DirectionalLight: () => DirectionalLight,
  DirectionalLightHelper: () => DirectionalLightHelper,
  DiscreteInterpolant: () => DiscreteInterpolant,
  DodecahedronBufferGeometry: () => DodecahedronGeometry,
  DodecahedronGeometry: () => DodecahedronGeometry,
  DoubleSide: () => DoubleSide,
  DstAlphaFactor: () => DstAlphaFactor,
  DstColorFactor: () => DstColorFactor,
  DynamicBufferAttribute: () => DynamicBufferAttribute,
  DynamicCopyUsage: () => DynamicCopyUsage,
  DynamicDrawUsage: () => DynamicDrawUsage,
  DynamicReadUsage: () => DynamicReadUsage,
  EdgesGeometry: () => EdgesGeometry,
  EdgesHelper: () => EdgesHelper,
  EllipseCurve: () => EllipseCurve,
  EqualDepth: () => EqualDepth,
  EqualStencilFunc: () => EqualStencilFunc,
  EquirectangularReflectionMapping: () => EquirectangularReflectionMapping,
  EquirectangularRefractionMapping: () => EquirectangularRefractionMapping,
  Euler: () => Euler,
  EventDispatcher: () => EventDispatcher,
  ExtrudeBufferGeometry: () => ExtrudeGeometry,
  ExtrudeGeometry: () => ExtrudeGeometry,
  FaceColors: () => FaceColors,
  FileLoader: () => FileLoader,
  FlatShading: () => FlatShading,
  Float16BufferAttribute: () => Float16BufferAttribute,
  Float32Attribute: () => Float32Attribute,
  Float32BufferAttribute: () => Float32BufferAttribute,
  Float64Attribute: () => Float64Attribute,
  Float64BufferAttribute: () => Float64BufferAttribute,
  FloatType: () => FloatType,
  Fog: () => Fog,
  FogExp2: () => FogExp2,
  Font: () => Font,
  FontLoader: () => FontLoader,
  FramebufferTexture: () => FramebufferTexture,
  FrontSide: () => FrontSide,
  Frustum: () => Frustum,
  GLBufferAttribute: () => GLBufferAttribute,
  GLSL1: () => GLSL1,
  GLSL3: () => GLSL3,
  GreaterDepth: () => GreaterDepth,
  GreaterEqualDepth: () => GreaterEqualDepth,
  GreaterEqualStencilFunc: () => GreaterEqualStencilFunc,
  GreaterStencilFunc: () => GreaterStencilFunc,
  GridHelper: () => GridHelper,
  Group: () => Group,
  HalfFloatType: () => HalfFloatType,
  HemisphereLight: () => HemisphereLight,
  HemisphereLightHelper: () => HemisphereLightHelper,
  HemisphereLightProbe: () => HemisphereLightProbe,
  IcosahedronBufferGeometry: () => IcosahedronGeometry,
  IcosahedronGeometry: () => IcosahedronGeometry,
  ImageBitmapLoader: () => ImageBitmapLoader,
  ImageLoader: () => ImageLoader,
  ImageUtils: () => ImageUtils,
  ImmediateRenderObject: () => ImmediateRenderObject,
  IncrementStencilOp: () => IncrementStencilOp,
  IncrementWrapStencilOp: () => IncrementWrapStencilOp,
  InstancedBufferAttribute: () => InstancedBufferAttribute,
  InstancedBufferGeometry: () => InstancedBufferGeometry,
  InstancedInterleavedBuffer: () => InstancedInterleavedBuffer,
  InstancedMesh: () => InstancedMesh,
  Int16Attribute: () => Int16Attribute,
  Int16BufferAttribute: () => Int16BufferAttribute,
  Int32Attribute: () => Int32Attribute,
  Int32BufferAttribute: () => Int32BufferAttribute,
  Int8Attribute: () => Int8Attribute,
  Int8BufferAttribute: () => Int8BufferAttribute,
  IntType: () => IntType,
  InterleavedBuffer: () => InterleavedBuffer,
  InterleavedBufferAttribute: () => InterleavedBufferAttribute,
  Interpolant: () => Interpolant,
  InterpolateDiscrete: () => InterpolateDiscrete,
  InterpolateLinear: () => InterpolateLinear,
  InterpolateSmooth: () => InterpolateSmooth,
  InvertStencilOp: () => InvertStencilOp,
  JSONLoader: () => JSONLoader,
  KeepStencilOp: () => KeepStencilOp,
  KeyframeTrack: () => KeyframeTrack,
  LOD: () => LOD,
  LatheBufferGeometry: () => LatheGeometry,
  LatheGeometry: () => LatheGeometry,
  Layers: () => Layers,
  LensFlare: () => LensFlare,
  LessDepth: () => LessDepth,
  LessEqualDepth: () => LessEqualDepth,
  LessEqualStencilFunc: () => LessEqualStencilFunc,
  LessStencilFunc: () => LessStencilFunc,
  Light: () => Light,
  LightProbe: () => LightProbe,
  Line: () => Line,
  Line3: () => Line3,
  LineBasicMaterial: () => LineBasicMaterial,
  LineCurve: () => LineCurve,
  LineCurve3: () => LineCurve3,
  LineDashedMaterial: () => LineDashedMaterial,
  LineLoop: () => LineLoop,
  LinePieces: () => LinePieces,
  LineSegments: () => LineSegments,
  LineStrip: () => LineStrip,
  LinearEncoding: () => LinearEncoding,
  LinearFilter: () => LinearFilter,
  LinearInterpolant: () => LinearInterpolant,
  LinearMipMapLinearFilter: () => LinearMipMapLinearFilter,
  LinearMipMapNearestFilter: () => LinearMipMapNearestFilter,
  LinearMipmapLinearFilter: () => LinearMipmapLinearFilter,
  LinearMipmapNearestFilter: () => LinearMipmapNearestFilter,
  LinearSRGBColorSpace: () => LinearSRGBColorSpace,
  LinearToneMapping: () => LinearToneMapping,
  Loader: () => Loader,
  LoaderUtils: () => LoaderUtils,
  LoadingManager: () => LoadingManager,
  LoopOnce: () => LoopOnce,
  LoopPingPong: () => LoopPingPong,
  LoopRepeat: () => LoopRepeat,
  LuminanceAlphaFormat: () => LuminanceAlphaFormat,
  LuminanceFormat: () => LuminanceFormat,
  MOUSE: () => MOUSE,
  Material: () => Material,
  MaterialLoader: () => MaterialLoader,
  Math: () => MathUtils,
  MathUtils: () => MathUtils,
  Matrix3: () => Matrix3,
  Matrix4: () => Matrix4,
  MaxEquation: () => MaxEquation,
  Mesh: () => Mesh,
  MeshBasicMaterial: () => MeshBasicMaterial,
  MeshDepthMaterial: () => MeshDepthMaterial,
  MeshDistanceMaterial: () => MeshDistanceMaterial,
  MeshFaceMaterial: () => MeshFaceMaterial,
  MeshLambertMaterial: () => MeshLambertMaterial,
  MeshMatcapMaterial: () => MeshMatcapMaterial,
  MeshNormalMaterial: () => MeshNormalMaterial,
  MeshPhongMaterial: () => MeshPhongMaterial,
  MeshPhysicalMaterial: () => MeshPhysicalMaterial,
  MeshStandardMaterial: () => MeshStandardMaterial,
  MeshToonMaterial: () => MeshToonMaterial,
  MinEquation: () => MinEquation,
  MirroredRepeatWrapping: () => MirroredRepeatWrapping,
  MixOperation: () => MixOperation,
  MultiMaterial: () => MultiMaterial,
  MultiplyBlending: () => MultiplyBlending,
  MultiplyOperation: () => MultiplyOperation,
  NearestFilter: () => NearestFilter,
  NearestMipMapLinearFilter: () => NearestMipMapLinearFilter,
  NearestMipMapNearestFilter: () => NearestMipMapNearestFilter,
  NearestMipmapLinearFilter: () => NearestMipmapLinearFilter,
  NearestMipmapNearestFilter: () => NearestMipmapNearestFilter,
  NeverDepth: () => NeverDepth,
  NeverStencilFunc: () => NeverStencilFunc,
  NoBlending: () => NoBlending,
  NoColorSpace: () => NoColorSpace,
  NoColors: () => NoColors,
  NoToneMapping: () => NoToneMapping,
  NormalAnimationBlendMode: () => NormalAnimationBlendMode,
  NormalBlending: () => NormalBlending,
  NotEqualDepth: () => NotEqualDepth,
  NotEqualStencilFunc: () => NotEqualStencilFunc,
  NumberKeyframeTrack: () => NumberKeyframeTrack,
  Object3D: () => Object3D,
  ObjectLoader: () => ObjectLoader,
  ObjectSpaceNormalMap: () => ObjectSpaceNormalMap,
  OctahedronBufferGeometry: () => OctahedronGeometry,
  OctahedronGeometry: () => OctahedronGeometry,
  OneFactor: () => OneFactor,
  OneMinusDstAlphaFactor: () => OneMinusDstAlphaFactor,
  OneMinusDstColorFactor: () => OneMinusDstColorFactor,
  OneMinusSrcAlphaFactor: () => OneMinusSrcAlphaFactor,
  OneMinusSrcColorFactor: () => OneMinusSrcColorFactor,
  OrthographicCamera: () => OrthographicCamera,
  PCFShadowMap: () => PCFShadowMap,
  PCFSoftShadowMap: () => PCFSoftShadowMap,
  PMREMGenerator: () => PMREMGenerator,
  ParametricGeometry: () => ParametricGeometry,
  Particle: () => Particle,
  ParticleBasicMaterial: () => ParticleBasicMaterial,
  ParticleSystem: () => ParticleSystem,
  ParticleSystemMaterial: () => ParticleSystemMaterial,
  Path: () => Path,
  PerspectiveCamera: () => PerspectiveCamera,
  Plane: () => Plane,
  PlaneBufferGeometry: () => PlaneGeometry,
  PlaneGeometry: () => PlaneGeometry,
  PlaneHelper: () => PlaneHelper,
  PointCloud: () => PointCloud,
  PointCloudMaterial: () => PointCloudMaterial,
  PointLight: () => PointLight,
  PointLightHelper: () => PointLightHelper,
  Points: () => Points,
  PointsMaterial: () => PointsMaterial,
  PolarGridHelper: () => PolarGridHelper,
  PolyhedronBufferGeometry: () => PolyhedronGeometry,
  PolyhedronGeometry: () => PolyhedronGeometry,
  PositionalAudio: () => PositionalAudio,
  PropertyBinding: () => PropertyBinding,
  PropertyMixer: () => PropertyMixer,
  QuadraticBezierCurve: () => QuadraticBezierCurve,
  QuadraticBezierCurve3: () => QuadraticBezierCurve3,
  Quaternion: () => Quaternion,
  QuaternionKeyframeTrack: () => QuaternionKeyframeTrack,
  QuaternionLinearInterpolant: () => QuaternionLinearInterpolant,
  REVISION: () => REVISION,
  RGBADepthPacking: () => RGBADepthPacking,
  RGBAFormat: () => RGBAFormat,
  RGBAIntegerFormat: () => RGBAIntegerFormat,
  RGBA_ASTC_10x10_Format: () => RGBA_ASTC_10x10_Format,
  RGBA_ASTC_10x5_Format: () => RGBA_ASTC_10x5_Format,
  RGBA_ASTC_10x6_Format: () => RGBA_ASTC_10x6_Format,
  RGBA_ASTC_10x8_Format: () => RGBA_ASTC_10x8_Format,
  RGBA_ASTC_12x10_Format: () => RGBA_ASTC_12x10_Format,
  RGBA_ASTC_12x12_Format: () => RGBA_ASTC_12x12_Format,
  RGBA_ASTC_4x4_Format: () => RGBA_ASTC_4x4_Format,
  RGBA_ASTC_5x4_Format: () => RGBA_ASTC_5x4_Format,
  RGBA_ASTC_5x5_Format: () => RGBA_ASTC_5x5_Format,
  RGBA_ASTC_6x5_Format: () => RGBA_ASTC_6x5_Format,
  RGBA_ASTC_6x6_Format: () => RGBA_ASTC_6x6_Format,
  RGBA_ASTC_8x5_Format: () => RGBA_ASTC_8x5_Format,
  RGBA_ASTC_8x6_Format: () => RGBA_ASTC_8x6_Format,
  RGBA_ASTC_8x8_Format: () => RGBA_ASTC_8x8_Format,
  RGBA_BPTC_Format: () => RGBA_BPTC_Format,
  RGBA_ETC2_EAC_Format: () => RGBA_ETC2_EAC_Format,
  RGBA_PVRTC_2BPPV1_Format: () => RGBA_PVRTC_2BPPV1_Format,
  RGBA_PVRTC_4BPPV1_Format: () => RGBA_PVRTC_4BPPV1_Format,
  RGBA_S3TC_DXT1_Format: () => RGBA_S3TC_DXT1_Format,
  RGBA_S3TC_DXT3_Format: () => RGBA_S3TC_DXT3_Format,
  RGBA_S3TC_DXT5_Format: () => RGBA_S3TC_DXT5_Format,
  RGBFormat: () => RGBFormat,
  RGB_ETC1_Format: () => RGB_ETC1_Format,
  RGB_ETC2_Format: () => RGB_ETC2_Format,
  RGB_PVRTC_2BPPV1_Format: () => RGB_PVRTC_2BPPV1_Format,
  RGB_PVRTC_4BPPV1_Format: () => RGB_PVRTC_4BPPV1_Format,
  RGB_S3TC_DXT1_Format: () => RGB_S3TC_DXT1_Format,
  RGFormat: () => RGFormat,
  RGIntegerFormat: () => RGIntegerFormat,
  RawShaderMaterial: () => RawShaderMaterial,
  Ray: () => Ray,
  Raycaster: () => Raycaster,
  RectAreaLight: () => RectAreaLight,
  RedFormat: () => RedFormat,
  RedIntegerFormat: () => RedIntegerFormat,
  ReinhardToneMapping: () => ReinhardToneMapping,
  RepeatWrapping: () => RepeatWrapping,
  ReplaceStencilOp: () => ReplaceStencilOp,
  ReverseSubtractEquation: () => ReverseSubtractEquation,
  RingBufferGeometry: () => RingGeometry,
  RingGeometry: () => RingGeometry,
  SRGBColorSpace: () => SRGBColorSpace,
  Scene: () => Scene,
  SceneUtils: () => SceneUtils,
  ShaderChunk: () => ShaderChunk,
  ShaderLib: () => ShaderLib,
  ShaderMaterial: () => ShaderMaterial,
  ShadowMaterial: () => ShadowMaterial,
  Shape: () => Shape,
  ShapeBufferGeometry: () => ShapeGeometry,
  ShapeGeometry: () => ShapeGeometry,
  ShapePath: () => ShapePath,
  ShapeUtils: () => ShapeUtils,
  ShortType: () => ShortType,
  Skeleton: () => Skeleton,
  SkeletonHelper: () => SkeletonHelper,
  SkinnedMesh: () => SkinnedMesh,
  SmoothShading: () => SmoothShading,
  Source: () => Source,
  Sphere: () => Sphere,
  SphereBufferGeometry: () => SphereGeometry,
  SphereGeometry: () => SphereGeometry,
  Spherical: () => Spherical,
  SphericalHarmonics3: () => SphericalHarmonics3,
  SplineCurve: () => SplineCurve,
  SpotLight: () => SpotLight,
  SpotLightHelper: () => SpotLightHelper,
  Sprite: () => Sprite,
  SpriteMaterial: () => SpriteMaterial,
  SrcAlphaFactor: () => SrcAlphaFactor,
  SrcAlphaSaturateFactor: () => SrcAlphaSaturateFactor,
  SrcColorFactor: () => SrcColorFactor,
  StaticCopyUsage: () => StaticCopyUsage,
  StaticDrawUsage: () => StaticDrawUsage,
  StaticReadUsage: () => StaticReadUsage,
  StereoCamera: () => StereoCamera,
  StreamCopyUsage: () => StreamCopyUsage,
  StreamDrawUsage: () => StreamDrawUsage,
  StreamReadUsage: () => StreamReadUsage,
  StringKeyframeTrack: () => StringKeyframeTrack,
  SubtractEquation: () => SubtractEquation,
  SubtractiveBlending: () => SubtractiveBlending,
  TOUCH: () => TOUCH,
  TangentSpaceNormalMap: () => TangentSpaceNormalMap,
  TetrahedronBufferGeometry: () => TetrahedronGeometry,
  TetrahedronGeometry: () => TetrahedronGeometry,
  TextGeometry: () => TextGeometry,
  Texture: () => Texture,
  TextureLoader: () => TextureLoader,
  TorusBufferGeometry: () => TorusGeometry,
  TorusGeometry: () => TorusGeometry,
  TorusKnotBufferGeometry: () => TorusKnotGeometry,
  TorusKnotGeometry: () => TorusKnotGeometry,
  Triangle: () => Triangle,
  TriangleFanDrawMode: () => TriangleFanDrawMode,
  TriangleStripDrawMode: () => TriangleStripDrawMode,
  TrianglesDrawMode: () => TrianglesDrawMode,
  TubeBufferGeometry: () => TubeGeometry,
  TubeGeometry: () => TubeGeometry,
  UVMapping: () => UVMapping,
  Uint16Attribute: () => Uint16Attribute,
  Uint16BufferAttribute: () => Uint16BufferAttribute,
  Uint32Attribute: () => Uint32Attribute,
  Uint32BufferAttribute: () => Uint32BufferAttribute,
  Uint8Attribute: () => Uint8Attribute,
  Uint8BufferAttribute: () => Uint8BufferAttribute,
  Uint8ClampedAttribute: () => Uint8ClampedAttribute,
  Uint8ClampedBufferAttribute: () => Uint8ClampedBufferAttribute,
  Uniform: () => Uniform,
  UniformsLib: () => UniformsLib,
  UniformsUtils: () => UniformsUtils,
  UnsignedByteType: () => UnsignedByteType,
  UnsignedInt248Type: () => UnsignedInt248Type,
  UnsignedIntType: () => UnsignedIntType,
  UnsignedShort4444Type: () => UnsignedShort4444Type,
  UnsignedShort5551Type: () => UnsignedShort5551Type,
  UnsignedShortType: () => UnsignedShortType,
  VSMShadowMap: () => VSMShadowMap,
  Vector2: () => Vector2,
  Vector3: () => Vector3,
  Vector4: () => Vector4,
  VectorKeyframeTrack: () => VectorKeyframeTrack,
  Vertex: () => Vertex,
  VertexColors: () => VertexColors,
  VideoTexture: () => VideoTexture,
  WebGL1Renderer: () => WebGL1Renderer,
  WebGL3DRenderTarget: () => WebGL3DRenderTarget,
  WebGLArrayRenderTarget: () => WebGLArrayRenderTarget,
  WebGLCubeRenderTarget: () => WebGLCubeRenderTarget,
  WebGLMultipleRenderTargets: () => WebGLMultipleRenderTargets,
  WebGLMultisampleRenderTarget: () => WebGLMultisampleRenderTarget,
  WebGLRenderTarget: () => WebGLRenderTarget,
  WebGLRenderTargetCube: () => WebGLRenderTargetCube,
  WebGLRenderer: () => WebGLRenderer,
  WebGLUtils: () => WebGLUtils,
  WireframeGeometry: () => WireframeGeometry,
  WireframeHelper: () => WireframeHelper,
  WrapAroundEnding: () => WrapAroundEnding,
  XHRLoader: () => XHRLoader,
  ZeroCurvatureEnding: () => ZeroCurvatureEnding,
  ZeroFactor: () => ZeroFactor,
  ZeroSlopeEnding: () => ZeroSlopeEnding,
  ZeroStencilOp: () => ZeroStencilOp,
  _SRGBAFormat: () => _SRGBAFormat,
  sRGBEncoding: () => sRGBEncoding
});
var REVISION = "139";
var MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2, ROTATE: 0, DOLLY: 1, PAN: 2 };
var TOUCH = { ROTATE: 0, PAN: 1, DOLLY_PAN: 2, DOLLY_ROTATE: 3 };
var CullFaceNone = 0;
var CullFaceBack = 1;
var CullFaceFront = 2;
var CullFaceFrontBack = 3;
var BasicShadowMap = 0;
var PCFShadowMap = 1;
var PCFSoftShadowMap = 2;
var VSMShadowMap = 3;
var FrontSide = 0;
var BackSide = 1;
var DoubleSide = 2;
var FlatShading = 1;
var SmoothShading = 2;
var NoBlending = 0;
var NormalBlending = 1;
var AdditiveBlending = 2;
var SubtractiveBlending = 3;
var MultiplyBlending = 4;
var CustomBlending = 5;
var AddEquation = 100;
var SubtractEquation = 101;
var ReverseSubtractEquation = 102;
var MinEquation = 103;
var MaxEquation = 104;
var ZeroFactor = 200;
var OneFactor = 201;
var SrcColorFactor = 202;
var OneMinusSrcColorFactor = 203;
var SrcAlphaFactor = 204;
var OneMinusSrcAlphaFactor = 205;
var DstAlphaFactor = 206;
var OneMinusDstAlphaFactor = 207;
var DstColorFactor = 208;
var OneMinusDstColorFactor = 209;
var SrcAlphaSaturateFactor = 210;
var NeverDepth = 0;
var AlwaysDepth = 1;
var LessDepth = 2;
var LessEqualDepth = 3;
var EqualDepth = 4;
var GreaterEqualDepth = 5;
var GreaterDepth = 6;
var NotEqualDepth = 7;
var MultiplyOperation = 0;
var MixOperation = 1;
var AddOperation = 2;
var NoToneMapping = 0;
var LinearToneMapping = 1;
var ReinhardToneMapping = 2;
var CineonToneMapping = 3;
var ACESFilmicToneMapping = 4;
var CustomToneMapping = 5;
var UVMapping = 300;
var CubeReflectionMapping = 301;
var CubeRefractionMapping = 302;
var EquirectangularReflectionMapping = 303;
var EquirectangularRefractionMapping = 304;
var CubeUVReflectionMapping = 306;
var RepeatWrapping = 1e3;
var ClampToEdgeWrapping = 1001;
var MirroredRepeatWrapping = 1002;
var NearestFilter = 1003;
var NearestMipmapNearestFilter = 1004;
var NearestMipMapNearestFilter = 1004;
var NearestMipmapLinearFilter = 1005;
var NearestMipMapLinearFilter = 1005;
var LinearFilter = 1006;
var LinearMipmapNearestFilter = 1007;
var LinearMipMapNearestFilter = 1007;
var LinearMipmapLinearFilter = 1008;
var LinearMipMapLinearFilter = 1008;
var UnsignedByteType = 1009;
var ByteType = 1010;
var ShortType = 1011;
var UnsignedShortType = 1012;
var IntType = 1013;
var UnsignedIntType = 1014;
var FloatType = 1015;
var HalfFloatType = 1016;
var UnsignedShort4444Type = 1017;
var UnsignedShort5551Type = 1018;
var UnsignedInt248Type = 1020;
var AlphaFormat = 1021;
var RGBFormat = 1022;
var RGBAFormat = 1023;
var LuminanceFormat = 1024;
var LuminanceAlphaFormat = 1025;
var DepthFormat = 1026;
var DepthStencilFormat = 1027;
var RedFormat = 1028;
var RedIntegerFormat = 1029;
var RGFormat = 1030;
var RGIntegerFormat = 1031;
var RGBAIntegerFormat = 1033;
var RGB_S3TC_DXT1_Format = 33776;
var RGBA_S3TC_DXT1_Format = 33777;
var RGBA_S3TC_DXT3_Format = 33778;
var RGBA_S3TC_DXT5_Format = 33779;
var RGB_PVRTC_4BPPV1_Format = 35840;
var RGB_PVRTC_2BPPV1_Format = 35841;
var RGBA_PVRTC_4BPPV1_Format = 35842;
var RGBA_PVRTC_2BPPV1_Format = 35843;
var RGB_ETC1_Format = 36196;
var RGB_ETC2_Format = 37492;
var RGBA_ETC2_EAC_Format = 37496;
var RGBA_ASTC_4x4_Format = 37808;
var RGBA_ASTC_5x4_Format = 37809;
var RGBA_ASTC_5x5_Format = 37810;
var RGBA_ASTC_6x5_Format = 37811;
var RGBA_ASTC_6x6_Format = 37812;
var RGBA_ASTC_8x5_Format = 37813;
var RGBA_ASTC_8x6_Format = 37814;
var RGBA_ASTC_8x8_Format = 37815;
var RGBA_ASTC_10x5_Format = 37816;
var RGBA_ASTC_10x6_Format = 37817;
var RGBA_ASTC_10x8_Format = 37818;
var RGBA_ASTC_10x10_Format = 37819;
var RGBA_ASTC_12x10_Format = 37820;
var RGBA_ASTC_12x12_Format = 37821;
var RGBA_BPTC_Format = 36492;
var LoopOnce = 2200;
var LoopRepeat = 2201;
var LoopPingPong = 2202;
var InterpolateDiscrete = 2300;
var InterpolateLinear = 2301;
var InterpolateSmooth = 2302;
var ZeroCurvatureEnding = 2400;
var ZeroSlopeEnding = 2401;
var WrapAroundEnding = 2402;
var NormalAnimationBlendMode = 2500;
var AdditiveAnimationBlendMode = 2501;
var TrianglesDrawMode = 0;
var TriangleStripDrawMode = 1;
var TriangleFanDrawMode = 2;
var LinearEncoding = 3e3;
var sRGBEncoding = 3001;
var BasicDepthPacking = 3200;
var RGBADepthPacking = 3201;
var TangentSpaceNormalMap = 0;
var ObjectSpaceNormalMap = 1;
var NoColorSpace = "";
var SRGBColorSpace = "srgb";
var LinearSRGBColorSpace = "srgb-linear";
var ZeroStencilOp = 0;
var KeepStencilOp = 7680;
var ReplaceStencilOp = 7681;
var IncrementStencilOp = 7682;
var DecrementStencilOp = 7683;
var IncrementWrapStencilOp = 34055;
var DecrementWrapStencilOp = 34056;
var InvertStencilOp = 5386;
var NeverStencilFunc = 512;
var LessStencilFunc = 513;
var EqualStencilFunc = 514;
var LessEqualStencilFunc = 515;
var GreaterStencilFunc = 516;
var NotEqualStencilFunc = 517;
var GreaterEqualStencilFunc = 518;
var AlwaysStencilFunc = 519;
var StaticDrawUsage = 35044;
var DynamicDrawUsage = 35048;
var StreamDrawUsage = 35040;
var StaticReadUsage = 35045;
var DynamicReadUsage = 35049;
var StreamReadUsage = 35041;
var StaticCopyUsage = 35046;
var DynamicCopyUsage = 35050;
var StreamCopyUsage = 35042;
var GLSL1 = "100";
var GLSL3 = "300 es";
var _SRGBAFormat = 1035;
var EventDispatcher = class {
  addEventListener(type, listener) {
    if (this._listeners === void 0)
      this._listeners = {};
    const listeners = this._listeners;
    if (listeners[type] === void 0) {
      listeners[type] = [];
    }
    if (listeners[type].indexOf(listener) === -1) {
      listeners[type].push(listener);
    }
  }
  hasEventListener(type, listener) {
    if (this._listeners === void 0)
      return false;
    const listeners = this._listeners;
    return listeners[type] !== void 0 && listeners[type].indexOf(listener) !== -1;
  }
  removeEventListener(type, listener) {
    if (this._listeners === void 0)
      return;
    const listeners = this._listeners;
    const listenerArray = listeners[type];
    if (listenerArray !== void 0) {
      const index = listenerArray.indexOf(listener);
      if (index !== -1) {
        listenerArray.splice(index, 1);
      }
    }
  }
  dispatchEvent(event) {
    if (this._listeners === void 0)
      return;
    const listeners = this._listeners;
    const listenerArray = listeners[event.type];
    if (listenerArray !== void 0) {
      event.target = this;
      const array = listenerArray.slice(0);
      for (let i2 = 0, l = array.length; i2 < l; i2++) {
        array[i2].call(this, event);
      }
      event.target = null;
    }
  }
};
var _lut = [];
for (let i2 = 0; i2 < 256; i2++) {
  _lut[i2] = (i2 < 16 ? "0" : "") + i2.toString(16);
}
var _seed = 1234567;
var DEG2RAD = Math.PI / 180;
var RAD2DEG = 180 / Math.PI;
function generateUUID() {
  const d0 = Math.random() * 4294967295 | 0;
  const d1 = Math.random() * 4294967295 | 0;
  const d2 = Math.random() * 4294967295 | 0;
  const d3 = Math.random() * 4294967295 | 0;
  const uuid = _lut[d0 & 255] + _lut[d0 >> 8 & 255] + _lut[d0 >> 16 & 255] + _lut[d0 >> 24 & 255] + "-" + _lut[d1 & 255] + _lut[d1 >> 8 & 255] + "-" + _lut[d1 >> 16 & 15 | 64] + _lut[d1 >> 24 & 255] + "-" + _lut[d2 & 63 | 128] + _lut[d2 >> 8 & 255] + "-" + _lut[d2 >> 16 & 255] + _lut[d2 >> 24 & 255] + _lut[d3 & 255] + _lut[d3 >> 8 & 255] + _lut[d3 >> 16 & 255] + _lut[d3 >> 24 & 255];
  return uuid.toLowerCase();
}
function clamp(value, min3, max3) {
  return Math.max(min3, Math.min(max3, value));
}
function euclideanModulo(n2, m) {
  return (n2 % m + m) % m;
}
function mapLinear(x2, a1, a2, b1, b2) {
  return b1 + (x2 - a1) * (b2 - b1) / (a2 - a1);
}
function inverseLerp(x2, y2, value) {
  if (x2 !== y2) {
    return (value - x2) / (y2 - x2);
  } else {
    return 0;
  }
}
function lerp(x2, y2, t3) {
  return (1 - t3) * x2 + t3 * y2;
}
function damp(x2, y2, lambda, dt) {
  return lerp(x2, y2, 1 - Math.exp(-lambda * dt));
}
function pingpong(x2, length2 = 1) {
  return length2 - Math.abs(euclideanModulo(x2, length2 * 2) - length2);
}
function smoothstep(x2, min3, max3) {
  if (x2 <= min3)
    return 0;
  if (x2 >= max3)
    return 1;
  x2 = (x2 - min3) / (max3 - min3);
  return x2 * x2 * (3 - 2 * x2);
}
function smootherstep(x2, min3, max3) {
  if (x2 <= min3)
    return 0;
  if (x2 >= max3)
    return 1;
  x2 = (x2 - min3) / (max3 - min3);
  return x2 * x2 * x2 * (x2 * (x2 * 6 - 15) + 10);
}
function randInt(low, high) {
  return low + Math.floor(Math.random() * (high - low + 1));
}
function randFloat(low, high) {
  return low + Math.random() * (high - low);
}
function randFloatSpread(range4) {
  return range4 * (0.5 - Math.random());
}
function seededRandom(s2) {
  if (s2 !== void 0)
    _seed = s2;
  let t3 = _seed += 1831565813;
  t3 = Math.imul(t3 ^ t3 >>> 15, t3 | 1);
  t3 ^= t3 + Math.imul(t3 ^ t3 >>> 7, t3 | 61);
  return ((t3 ^ t3 >>> 14) >>> 0) / 4294967296;
}
function degToRad(degrees2) {
  return degrees2 * DEG2RAD;
}
function radToDeg(radians2) {
  return radians2 * RAD2DEG;
}
function isPowerOfTwo(value) {
  return (value & value - 1) === 0 && value !== 0;
}
function ceilPowerOfTwo(value) {
  return Math.pow(2, Math.ceil(Math.log(value) / Math.LN2));
}
function floorPowerOfTwo(value) {
  return Math.pow(2, Math.floor(Math.log(value) / Math.LN2));
}
function setQuaternionFromProperEuler(q, a2, b, c4, order) {
  const cos2 = Math.cos;
  const sin2 = Math.sin;
  const c22 = cos2(b / 2);
  const s2 = sin2(b / 2);
  const c13 = cos2((a2 + c4) / 2);
  const s13 = sin2((a2 + c4) / 2);
  const c1_3 = cos2((a2 - c4) / 2);
  const s1_3 = sin2((a2 - c4) / 2);
  const c3_1 = cos2((c4 - a2) / 2);
  const s3_1 = sin2((c4 - a2) / 2);
  switch (order) {
    case "XYX":
      q.set(c22 * s13, s2 * c1_3, s2 * s1_3, c22 * c13);
      break;
    case "YZY":
      q.set(s2 * s1_3, c22 * s13, s2 * c1_3, c22 * c13);
      break;
    case "ZXZ":
      q.set(s2 * c1_3, s2 * s1_3, c22 * s13, c22 * c13);
      break;
    case "XZX":
      q.set(c22 * s13, s2 * s3_1, s2 * c3_1, c22 * c13);
      break;
    case "YXY":
      q.set(s2 * c3_1, c22 * s13, s2 * s3_1, c22 * c13);
      break;
    case "ZYZ":
      q.set(s2 * s3_1, s2 * c3_1, c22 * s13, c22 * c13);
      break;
    default:
      console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: " + order);
  }
}
function denormalize$1(value, array) {
  switch (array.constructor) {
    case Float32Array:
      return value;
    case Uint16Array:
      return value / 65535;
    case Uint8Array:
      return value / 255;
    case Int16Array:
      return Math.max(value / 32767, -1);
    case Int8Array:
      return Math.max(value / 127, -1);
    default:
      throw new Error("Invalid component type.");
  }
}
function normalize(value, array) {
  switch (array.constructor) {
    case Float32Array:
      return value;
    case Uint16Array:
      return Math.round(value * 65535);
    case Uint8Array:
      return Math.round(value * 255);
    case Int16Array:
      return Math.round(value * 32767);
    case Int8Array:
      return Math.round(value * 127);
    default:
      throw new Error("Invalid component type.");
  }
}
var MathUtils = /* @__PURE__ */ Object.freeze({
  __proto__: null,
  DEG2RAD,
  RAD2DEG,
  generateUUID,
  clamp,
  euclideanModulo,
  mapLinear,
  inverseLerp,
  lerp,
  damp,
  pingpong,
  smoothstep,
  smootherstep,
  randInt,
  randFloat,
  randFloatSpread,
  seededRandom,
  degToRad,
  radToDeg,
  isPowerOfTwo,
  ceilPowerOfTwo,
  floorPowerOfTwo,
  setQuaternionFromProperEuler,
  normalize,
  denormalize: denormalize$1
});
var Vector2 = class {
  constructor(x2 = 0, y2 = 0) {
    this.x = x2;
    this.y = y2;
  }
  get width() {
    return this.x;
  }
  set width(value) {
    this.x = value;
  }
  get height() {
    return this.y;
  }
  set height(value) {
    this.y = value;
  }
  set(x2, y2) {
    this.x = x2;
    this.y = y2;
    return this;
  }
  setScalar(scalar) {
    this.x = scalar;
    this.y = scalar;
    return this;
  }
  setX(x2) {
    this.x = x2;
    return this;
  }
  setY(y2) {
    this.y = y2;
    return this;
  }
  setComponent(index, value) {
    switch (index) {
      case 0:
        this.x = value;
        break;
      case 1:
        this.y = value;
        break;
      default:
        throw new Error("index is out of range: " + index);
    }
    return this;
  }
  getComponent(index) {
    switch (index) {
      case 0:
        return this.x;
      case 1:
        return this.y;
      default:
        throw new Error("index is out of range: " + index);
    }
  }
  clone() {
    return new this.constructor(this.x, this.y);
  }
  copy(v4) {
    this.x = v4.x;
    this.y = v4.y;
    return this;
  }
  add(v4, w) {
    if (w !== void 0) {
      console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead.");
      return this.addVectors(v4, w);
    }
    this.x += v4.x;
    this.y += v4.y;
    return this;
  }
  addScalar(s2) {
    this.x += s2;
    this.y += s2;
    return this;
  }
  addVectors(a2, b) {
    this.x = a2.x + b.x;
    this.y = a2.y + b.y;
    return this;
  }
  addScaledVector(v4, s2) {
    this.x += v4.x * s2;
    this.y += v4.y * s2;
    return this;
  }
  sub(v4, w) {
    if (w !== void 0) {
      console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.");
      return this.subVectors(v4, w);
    }
    this.x -= v4.x;
    this.y -= v4.y;
    return this;
  }
  subScalar(s2) {
    this.x -= s2;
    this.y -= s2;
    return this;
  }
  subVectors(a2, b) {
    this.x = a2.x - b.x;
    this.y = a2.y - b.y;
    return this;
  }
  multiply(v4) {
    this.x *= v4.x;
    this.y *= v4.y;
    return this;
  }
  multiplyScalar(scalar) {
    this.x *= scalar;
    this.y *= scalar;
    return this;
  }
  divide(v4) {
    this.x /= v4.x;
    this.y /= v4.y;
    return this;
  }
  divideScalar(scalar) {
    return this.multiplyScalar(1 / scalar);
  }
  applyMatrix3(m) {
    const x2 = this.x, y2 = this.y;
    const e3 = m.elements;
    this.x = e3[0] * x2 + e3[3] * y2 + e3[6];
    this.y = e3[1] * x2 + e3[4] * y2 + e3[7];
    return this;
  }
  min(v4) {
    this.x = Math.min(this.x, v4.x);
    this.y = Math.min(this.y, v4.y);
    return this;
  }
  max(v4) {
    this.x = Math.max(this.x, v4.x);
    this.y = Math.max(this.y, v4.y);
    return this;
  }
  clamp(min3, max3) {
    this.x = Math.max(min3.x, Math.min(max3.x, this.x));
    this.y = Math.max(min3.y, Math.min(max3.y, this.y));
    return this;
  }
  clampScalar(minVal, maxVal) {
    this.x = Math.max(minVal, Math.min(maxVal, this.x));
    this.y = Math.max(minVal, Math.min(maxVal, this.y));
    return this;
  }
  clampLength(min3, max3) {
    const length2 = this.length();
    return this.divideScalar(length2 || 1).multiplyScalar(Math.max(min3, Math.min(max3, length2)));
  }
  floor() {
    this.x = Math.floor(this.x);
    this.y = Math.floor(this.y);
    return this;
  }
  ceil() {
    this.x = Math.ceil(this.x);
    this.y = Math.ceil(this.y);
    return this;
  }
  round() {
    this.x = Math.round(this.x);
    this.y = Math.round(this.y);
    return this;
  }
  roundToZero() {
    this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x);
    this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y);
    return this;
  }
  negate() {
    this.x = -this.x;
    this.y = -this.y;
    return this;
  }
  dot(v4) {
    return this.x * v4.x + this.y * v4.y;
  }
  cross(v4) {
    return this.x * v4.y - this.y * v4.x;
  }
  lengthSq() {
    return this.x * this.x + this.y * this.y;
  }
  length() {
    return Math.sqrt(this.x * this.x + this.y * this.y);
  }
  manhattanLength() {
    return Math.abs(this.x) + Math.abs(this.y);
  }
  normalize() {
    return this.divideScalar(this.length() || 1);
  }
  angle() {
    const angle = Math.atan2(-this.y, -this.x) + Math.PI;
    return angle;
  }
  distanceTo(v4) {
    return Math.sqrt(this.distanceToSquared(v4));
  }
  distanceToSquared(v4) {
    const dx = this.x - v4.x, dy = this.y - v4.y;
    return dx * dx + dy * dy;
  }
  manhattanDistanceTo(v4) {
    return Math.abs(this.x - v4.x) + Math.abs(this.y - v4.y);
  }
  setLength(length2) {
    return this.normalize().multiplyScalar(length2);
  }
  lerp(v4, alpha3) {
    this.x += (v4.x - this.x) * alpha3;
    this.y += (v4.y - this.y) * alpha3;
    return this;
  }
  lerpVectors(v12, v22, alpha3) {
    this.x = v12.x + (v22.x - v12.x) * alpha3;
    this.y = v12.y + (v22.y - v12.y) * alpha3;
    return this;
  }
  equals(v4) {
    return v4.x === this.x && v4.y === this.y;
  }
  fromArray(array, offset = 0) {
    this.x = array[offset];
    this.y = array[offset + 1];
    return this;
  }
  toArray(array = [], offset = 0) {
    array[offset] = this.x;
    array[offset + 1] = this.y;
    return array;
  }
  fromBufferAttribute(attribute, index, offset) {
    if (offset !== void 0) {
      console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute().");
    }
    this.x = attribute.getX(index);
    this.y = attribute.getY(index);
    return this;
  }
  rotateAround(center, angle) {
    const c4 = Math.cos(angle), s2 = Math.sin(angle);
    const x2 = this.x - center.x;
    const y2 = this.y - center.y;
    this.x = x2 * c4 - y2 * s2 + center.x;
    this.y = x2 * s2 + y2 * c4 + center.y;
    return this;
  }
  random() {
    this.x = Math.random();
    this.y = Math.random();
    return this;
  }
  *[Symbol.iterator]() {
    yield this.x;
    yield this.y;
  }
};
Vector2.prototype.isVector2 = true;
var Matrix3 = class {
  constructor() {
    this.elements = [
      1,
      0,
      0,
      0,
      1,
      0,
      0,
      0,
      1
    ];
    if (arguments.length > 0) {
      console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.");
    }
  }
  set(n11, n12, n13, n21, n22, n23, n31, n32, n33) {
    const te = this.elements;
    te[0] = n11;
    te[1] = n21;
    te[2] = n31;
    te[3] = n12;
    te[4] = n22;
    te[5] = n32;
    te[6] = n13;
    te[7] = n23;
    te[8] = n33;
    return this;
  }
  identity() {
    this.set(
      1,
      0,
      0,
      0,
      1,
      0,
      0,
      0,
      1
    );
    return this;
  }
  copy(m) {
    const te = this.elements;
    const me = m.elements;
    te[0] = me[0];
    te[1] = me[1];
    te[2] = me[2];
    te[3] = me[3];
    te[4] = me[4];
    te[5] = me[5];
    te[6] = me[6];
    te[7] = me[7];
    te[8] = me[8];
    return this;
  }
  extractBasis(xAxis, yAxis, zAxis) {
    xAxis.setFromMatrix3Column(this, 0);
    yAxis.setFromMatrix3Column(this, 1);
    zAxis.setFromMatrix3Column(this, 2);
    return this;
  }
  setFromMatrix4(m) {
    const me = m.elements;
    this.set(
      me[0],
      me[4],
      me[8],
      me[1],
      me[5],
      me[9],
      me[2],
      me[6],
      me[10]
    );
    return this;
  }
  multiply(m) {
    return this.multiplyMatrices(this, m);
  }
  premultiply(m) {
    return this.multiplyMatrices(m, this);
  }
  multiplyMatrices(a2, b) {
    const ae = a2.elements;
    const be = b.elements;
    const te = this.elements;
    const a11 = ae[0], a12 = ae[3], a13 = ae[6];
    const a21 = ae[1], a22 = ae[4], a23 = ae[7];
    const a31 = ae[2], a32 = ae[5], a33 = ae[8];
    const b11 = be[0], b12 = be[3], b13 = be[6];
    const b21 = be[1], b22 = be[4], b23 = be[7];
    const b31 = be[2], b32 = be[5], b33 = be[8];
    te[0] = a11 * b11 + a12 * b21 + a13 * b31;
    te[3] = a11 * b12 + a12 * b22 + a13 * b32;
    te[6] = a11 * b13 + a12 * b23 + a13 * b33;
    te[1] = a21 * b11 + a22 * b21 + a23 * b31;
    te[4] = a21 * b12 + a22 * b22 + a23 * b32;
    te[7] = a21 * b13 + a22 * b23 + a23 * b33;
    te[2] = a31 * b11 + a32 * b21 + a33 * b31;
    te[5] = a31 * b12 + a32 * b22 + a33 * b32;
    te[8] = a31 * b13 + a32 * b23 + a33 * b33;
    return this;
  }
  multiplyScalar(s2) {
    const te = this.elements;
    te[0] *= s2;
    te[3] *= s2;
    te[6] *= s2;
    te[1] *= s2;
    te[4] *= s2;
    te[7] *= s2;
    te[2] *= s2;
    te[5] *= s2;
    te[8] *= s2;
    return this;
  }
  determinant() {
    const te = this.elements;
    const a2 = te[0], b = te[1], c4 = te[2], d = te[3], e3 = te[4], f = te[5], g = te[6], h = te[7], i2 = te[8];
    return a2 * e3 * i2 - a2 * f * h - b * d * i2 + b * f * g + c4 * d * h - c4 * e3 * g;
  }
  invert() {
    const te = this.elements, n11 = te[0], n21 = te[1], n31 = te[2], n12 = te[3], n22 = te[4], n32 = te[5], n13 = te[6], n23 = te[7], n33 = te[8], t11 = n33 * n22 - n32 * n23, t12 = n32 * n13 - n33 * n12, t13 = n23 * n12 - n22 * n13, det = n11 * t11 + n21 * t12 + n31 * t13;
    if (det === 0)
      return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0);
    const detInv = 1 / det;
    te[0] = t11 * detInv;
    te[1] = (n31 * n23 - n33 * n21) * detInv;
    te[2] = (n32 * n21 - n31 * n22) * detInv;
    te[3] = t12 * detInv;
    te[4] = (n33 * n11 - n31 * n13) * detInv;
    te[5] = (n31 * n12 - n32 * n11) * detInv;
    te[6] = t13 * detInv;
    te[7] = (n21 * n13 - n23 * n11) * detInv;
    te[8] = (n22 * n11 - n21 * n12) * detInv;
    return this;
  }
  transpose() {
    let tmp2;
    const m = this.elements;
    tmp2 = m[1];
    m[1] = m[3];
    m[3] = tmp2;
    tmp2 = m[2];
    m[2] = m[6];
    m[6] = tmp2;
    tmp2 = m[5];
    m[5] = m[7];
    m[7] = tmp2;
    return this;
  }
  getNormalMatrix(matrix4) {
    return this.setFromMatrix4(matrix4).invert().transpose();
  }
  transposeIntoArray(r3) {
    const m = this.elements;
    r3[0] = m[0];
    r3[1] = m[3];
    r3[2] = m[6];
    r3[3] = m[1];
    r3[4] = m[4];
    r3[5] = m[7];
    r3[6] = m[2];
    r3[7] = m[5];
    r3[8] = m[8];
    return this;
  }
  setUvTransform(tx, ty, sx, sy, rotation, cx, cy) {
    const c4 = Math.cos(rotation);
    const s2 = Math.sin(rotation);
    this.set(
      sx * c4,
      sx * s2,
      -sx * (c4 * cx + s2 * cy) + cx + tx,
      -sy * s2,
      sy * c4,
      -sy * (-s2 * cx + c4 * cy) + cy + ty,
      0,
      0,
      1
    );
    return this;
  }
  scale(sx, sy) {
    const te = this.elements;
    te[0] *= sx;
    te[3] *= sx;
    te[6] *= sx;
    te[1] *= sy;
    te[4] *= sy;
    te[7] *= sy;
    return this;
  }
  rotate(theta) {
    const c4 = Math.cos(theta);
    const s2 = Math.sin(theta);
    const te = this.elements;
    const a11 = te[0], a12 = te[3], a13 = te[6];
    const a21 = te[1], a22 = te[4], a23 = te[7];
    te[0] = c4 * a11 + s2 * a21;
    te[3] = c4 * a12 + s2 * a22;
    te[6] = c4 * a13 + s2 * a23;
    te[1] = -s2 * a11 + c4 * a21;
    te[4] = -s2 * a12 + c4 * a22;
    te[7] = -s2 * a13 + c4 * a23;
    return this;
  }
  translate(tx, ty) {
    const te = this.elements;
    te[0] += tx * te[2];
    te[3] += tx * te[5];
    te[6] += tx * te[8];
    te[1] += ty * te[2];
    te[4] += ty * te[5];
    te[7] += ty * te[8];
    return this;
  }
  equals(matrix) {
    const te = this.elements;
    const me = matrix.elements;
    for (let i2 = 0; i2 < 9; i2++) {
      if (te[i2] !== me[i2])
        return false;
    }
    return true;
  }
  fromArray(array, offset = 0) {
    for (let i2 = 0; i2 < 9; i2++) {
      this.elements[i2] = array[i2 + offset];
    }
    return this;
  }
  toArray(array = [], offset = 0) {
    const te = this.elements;
    array[offset] = te[0];
    array[offset + 1] = te[1];
    array[offset + 2] = te[2];
    array[offset + 3] = te[3];
    array[offset + 4] = te[4];
    array[offset + 5] = te[5];
    array[offset + 6] = te[6];
    array[offset + 7] = te[7];
    array[offset + 8] = te[8];
    return array;
  }
  clone() {
    return new this.constructor().fromArray(this.elements);
  }
};
Matrix3.prototype.isMatrix3 = true;
function arrayNeedsUint32(array) {
  for (let i2 = array.length - 1; i2 >= 0; --i2) {
    if (array[i2] > 65535)
      return true;
  }
  return false;
}
var TYPED_ARRAYS = {
  Int8Array,
  Uint8Array,
  Uint8ClampedArray,
  Int16Array,
  Uint16Array,
  Int32Array,
  Uint32Array,
  Float32Array,
  Float64Array
};
function getTypedArray(type, buffer) {
  return new TYPED_ARRAYS[type](buffer);
}
function createElementNS(name2) {
  return document.createElementNS("http://www.w3.org/1999/xhtml", name2);
}
function SRGBToLinear(c4) {
  return c4 < 0.04045 ? c4 * 0.0773993808 : Math.pow(c4 * 0.9478672986 + 0.0521327014, 2.4);
}
function LinearToSRGB(c4) {
  return c4 < 31308e-7 ? c4 * 12.92 : 1.055 * Math.pow(c4, 0.41666) - 0.055;
}
var FN = {
  [SRGBColorSpace]: { [LinearSRGBColorSpace]: SRGBToLinear },
  [LinearSRGBColorSpace]: { [SRGBColorSpace]: LinearToSRGB }
};
var ColorManagement = {
  legacyMode: true,
  get workingColorSpace() {
    return LinearSRGBColorSpace;
  },
  set workingColorSpace(colorSpace) {
    console.warn("THREE.ColorManagement: .workingColorSpace is readonly.");
  },
  convert: function(color2, sourceColorSpace, targetColorSpace) {
    if (this.legacyMode || sourceColorSpace === targetColorSpace || !sourceColorSpace || !targetColorSpace) {
      return color2;
    }
    if (FN[sourceColorSpace] && FN[sourceColorSpace][targetColorSpace] !== void 0) {
      const fn = FN[sourceColorSpace][targetColorSpace];
      color2.r = fn(color2.r);
      color2.g = fn(color2.g);
      color2.b = fn(color2.b);
      return color2;
    }
    throw new Error("Unsupported color space conversion.");
  },
  fromWorkingColorSpace: function(color2, targetColorSpace) {
    return this.convert(color2, this.workingColorSpace, targetColorSpace);
  },
  toWorkingColorSpace: function(color2, sourceColorSpace) {
    return this.convert(color2, sourceColorSpace, this.workingColorSpace);
  }
};
var _colorKeywords = {
  "aliceblue": 15792383,
  "antiquewhite": 16444375,
  "aqua": 65535,
  "aquamarine": 8388564,
  "azure": 15794175,
  "beige": 16119260,
  "bisque": 16770244,
  "black": 0,
  "blanchedalmond": 16772045,
  "blue": 255,
  "blueviolet": 9055202,
  "brown": 10824234,
  "burlywood": 14596231,
  "cadetblue": 6266528,
  "chartreuse": 8388352,
  "chocolate": 13789470,
  "coral": 16744272,
  "cornflowerblue": 6591981,
  "cornsilk": 16775388,
  "crimson": 14423100,
  "cyan": 65535,
  "darkblue": 139,
  "darkcyan": 35723,
  "darkgoldenrod": 12092939,
  "darkgray": 11119017,
  "darkgreen": 25600,
  "darkgrey": 11119017,
  "darkkhaki": 12433259,
  "darkmagenta": 9109643,
  "darkolivegreen": 5597999,
  "darkorange": 16747520,
  "darkorchid": 10040012,
  "darkred": 9109504,
  "darksalmon": 15308410,
  "darkseagreen": 9419919,
  "darkslateblue": 4734347,
  "darkslategray": 3100495,
  "darkslategrey": 3100495,
  "darkturquoise": 52945,
  "darkviolet": 9699539,
  "deeppink": 16716947,
  "deepskyblue": 49151,
  "dimgray": 6908265,
  "dimgrey": 6908265,
  "dodgerblue": 2003199,
  "firebrick": 11674146,
  "floralwhite": 16775920,
  "forestgreen": 2263842,
  "fuchsia": 16711935,
  "gainsboro": 14474460,
  "ghostwhite": 16316671,
  "gold": 16766720,
  "goldenrod": 14329120,
  "gray": 8421504,
  "green": 32768,
  "greenyellow": 11403055,
  "grey": 8421504,
  "honeydew": 15794160,
  "hotpink": 16738740,
  "indianred": 13458524,
  "indigo": 4915330,
  "ivory": 16777200,
  "khaki": 15787660,
  "lavender": 15132410,
  "lavenderblush": 16773365,
  "lawngreen": 8190976,
  "lemonchiffon": 16775885,
  "lightblue": 11393254,
  "lightcoral": 15761536,
  "lightcyan": 14745599,
  "lightgoldenrodyellow": 16448210,
  "lightgray": 13882323,
  "lightgreen": 9498256,
  "lightgrey": 13882323,
  "lightpink": 16758465,
  "lightsalmon": 16752762,
  "lightseagreen": 2142890,
  "lightskyblue": 8900346,
  "lightslategray": 7833753,
  "lightslategrey": 7833753,
  "lightsteelblue": 11584734,
  "lightyellow": 16777184,
  "lime": 65280,
  "limegreen": 3329330,
  "linen": 16445670,
  "magenta": 16711935,
  "maroon": 8388608,
  "mediumaquamarine": 6737322,
  "mediumblue": 205,
  "mediumorchid": 12211667,
  "mediumpurple": 9662683,
  "mediumseagreen": 3978097,
  "mediumslateblue": 8087790,
  "mediumspringgreen": 64154,
  "mediumturquoise": 4772300,
  "mediumvioletred": 13047173,
  "midnightblue": 1644912,
  "mintcream": 16121850,
  "mistyrose": 16770273,
  "moccasin": 16770229,
  "navajowhite": 16768685,
  "navy": 128,
  "oldlace": 16643558,
  "olive": 8421376,
  "olivedrab": 7048739,
  "orange": 16753920,
  "orangered": 16729344,
  "orchid": 14315734,
  "palegoldenrod": 15657130,
  "palegreen": 10025880,
  "paleturquoise": 11529966,
  "palevioletred": 14381203,
  "papayawhip": 16773077,
  "peachpuff": 16767673,
  "peru": 13468991,
  "pink": 16761035,
  "plum": 14524637,
  "powderblue": 11591910,
  "purple": 8388736,
  "rebeccapurple": 6697881,
  "red": 16711680,
  "rosybrown": 12357519,
  "royalblue": 4286945,
  "saddlebrown": 9127187,
  "salmon": 16416882,
  "sandybrown": 16032864,
  "seagreen": 3050327,
  "seashell": 16774638,
  "sienna": 10506797,
  "silver": 12632256,
  "skyblue": 8900331,
  "slateblue": 6970061,
  "slategray": 7372944,
  "slategrey": 7372944,
  "snow": 16775930,
  "springgreen": 65407,
  "steelblue": 4620980,
  "tan": 13808780,
  "teal": 32896,
  "thistle": 14204888,
  "tomato": 16737095,
  "turquoise": 4251856,
  "violet": 15631086,
  "wheat": 16113331,
  "white": 16777215,
  "whitesmoke": 16119285,
  "yellow": 16776960,
  "yellowgreen": 10145074
};
var _rgb = { r: 0, g: 0, b: 0 };
var _hslA = { h: 0, s: 0, l: 0 };
var _hslB = { h: 0, s: 0, l: 0 };
function hue2rgb(p, q, t3) {
  if (t3 < 0)
    t3 += 1;
  if (t3 > 1)
    t3 -= 1;
  if (t3 < 1 / 6)
    return p + (q - p) * 6 * t3;
  if (t3 < 1 / 2)
    return q;
  if (t3 < 2 / 3)
    return p + (q - p) * 6 * (2 / 3 - t3);
  return p;
}
function toComponents(source, target) {
  target.r = source.r;
  target.g = source.g;
  target.b = source.b;
  return target;
}
var Color2 = class {
  constructor(r3, g, b) {
    if (g === void 0 && b === void 0) {
      return this.set(r3);
    }
    return this.setRGB(r3, g, b);
  }
  set(value) {
    if (value && value.isColor) {
      this.copy(value);
    } else if (typeof value === "number") {
      this.setHex(value);
    } else if (typeof value === "string") {
      this.setStyle(value);
    }
    return this;
  }
  setScalar(scalar) {
    this.r = scalar;
    this.g = scalar;
    this.b = scalar;
    return this;
  }
  setHex(hex2, colorSpace = SRGBColorSpace) {
    hex2 = Math.floor(hex2);
    this.r = (hex2 >> 16 & 255) / 255;
    this.g = (hex2 >> 8 & 255) / 255;
    this.b = (hex2 & 255) / 255;
    ColorManagement.toWorkingColorSpace(this, colorSpace);
    return this;
  }
  setRGB(r3, g, b, colorSpace = LinearSRGBColorSpace) {
    this.r = r3;
    this.g = g;
    this.b = b;
    ColorManagement.toWorkingColorSpace(this, colorSpace);
    return this;
  }
  setHSL(h, s2, l, colorSpace = LinearSRGBColorSpace) {
    h = euclideanModulo(h, 1);
    s2 = clamp(s2, 0, 1);
    l = clamp(l, 0, 1);
    if (s2 === 0) {
      this.r = this.g = this.b = l;
    } else {
      const p = l <= 0.5 ? l * (1 + s2) : l + s2 - l * s2;
      const q = 2 * l - p;
      this.r = hue2rgb(q, p, h + 1 / 3);
      this.g = hue2rgb(q, p, h);
      this.b = hue2rgb(q, p, h - 1 / 3);
    }
    ColorManagement.toWorkingColorSpace(this, colorSpace);
    return this;
  }
  setStyle(style, colorSpace = SRGBColorSpace) {
    function handleAlpha(string2) {
      if (string2 === void 0)
        return;
      if (parseFloat(string2) < 1) {
        console.warn("THREE.Color: Alpha component of " + style + " will be ignored.");
      }
    }
    let m;
    if (m = /^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(style)) {
      let color2;
      const name2 = m[1];
      const components = m[2];
      switch (name2) {
        case "rgb":
        case "rgba":
          if (color2 = /^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(components)) {
            this.r = Math.min(255, parseInt(color2[1], 10)) / 255;
            this.g = Math.min(255, parseInt(color2[2], 10)) / 255;
            this.b = Math.min(255, parseInt(color2[3], 10)) / 255;
            ColorManagement.toWorkingColorSpace(this, colorSpace);
            handleAlpha(color2[4]);
            return this;
          }
          if (color2 = /^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(components)) {
            this.r = Math.min(100, parseInt(color2[1], 10)) / 100;
            this.g = Math.min(100, parseInt(color2[2], 10)) / 100;
            this.b = Math.min(100, parseInt(color2[3], 10)) / 100;
            ColorManagement.toWorkingColorSpace(this, colorSpace);
            handleAlpha(color2[4]);
            return this;
          }
          break;
        case "hsl":
        case "hsla":
          if (color2 = /^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(components)) {
            const h = parseFloat(color2[1]) / 360;
            const s2 = parseInt(color2[2], 10) / 100;
            const l = parseInt(color2[3], 10) / 100;
            handleAlpha(color2[4]);
            return this.setHSL(h, s2, l, colorSpace);
          }
          break;
      }
    } else if (m = /^\#([A-Fa-f\d]+)$/.exec(style)) {
      const hex2 = m[1];
      const size = hex2.length;
      if (size === 3) {
        this.r = parseInt(hex2.charAt(0) + hex2.charAt(0), 16) / 255;
        this.g = parseInt(hex2.charAt(1) + hex2.charAt(1), 16) / 255;
        this.b = parseInt(hex2.charAt(2) + hex2.charAt(2), 16) / 255;
        ColorManagement.toWorkingColorSpace(this, colorSpace);
        return this;
      } else if (size === 6) {
        this.r = parseInt(hex2.charAt(0) + hex2.charAt(1), 16) / 255;
        this.g = parseInt(hex2.charAt(2) + hex2.charAt(3), 16) / 255;
        this.b = parseInt(hex2.charAt(4) + hex2.charAt(5), 16) / 255;
        ColorManagement.toWorkingColorSpace(this, colorSpace);
        return this;
      }
    }
    if (style && style.length > 0) {
      return this.setColorName(style, colorSpace);
    }
    return this;
  }
  setColorName(style, colorSpace = SRGBColorSpace) {
    const hex2 = _colorKeywords[style.toLowerCase()];
    if (hex2 !== void 0) {
      this.setHex(hex2, colorSpace);
    } else {
      console.warn("THREE.Color: Unknown color " + style);
    }
    return this;
  }
  clone() {
    return new this.constructor(this.r, this.g, this.b);
  }
  copy(color2) {
    this.r = color2.r;
    this.g = color2.g;
    this.b = color2.b;
    return this;
  }
  copySRGBToLinear(color2) {
    this.r = SRGBToLinear(color2.r);
    this.g = SRGBToLinear(color2.g);
    this.b = SRGBToLinear(color2.b);
    return this;
  }
  copyLinearToSRGB(color2) {
    this.r = LinearToSRGB(color2.r);
    this.g = LinearToSRGB(color2.g);
    this.b = LinearToSRGB(color2.b);
    return this;
  }
  convertSRGBToLinear() {
    this.copySRGBToLinear(this);
    return this;
  }
  convertLinearToSRGB() {
    this.copyLinearToSRGB(this);
    return this;
  }
  getHex(colorSpace = SRGBColorSpace) {
    ColorManagement.fromWorkingColorSpace(toComponents(this, _rgb), colorSpace);
    return clamp(_rgb.r * 255, 0, 255) << 16 ^ clamp(_rgb.g * 255, 0, 255) << 8 ^ clamp(_rgb.b * 255, 0, 255) << 0;
  }
  getHexString(colorSpace = SRGBColorSpace) {
    return ("000000" + this.getHex(colorSpace).toString(16)).slice(-6);
  }
  getHSL(target, colorSpace = LinearSRGBColorSpace) {
    ColorManagement.fromWorkingColorSpace(toComponents(this, _rgb), colorSpace);
    const r3 = _rgb.r, g = _rgb.g, b = _rgb.b;
    const max3 = Math.max(r3, g, b);
    const min3 = Math.min(r3, g, b);
    let hue2, saturation;
    const lightness = (min3 + max3) / 2;
    if (min3 === max3) {
      hue2 = 0;
      saturation = 0;
    } else {
      const delta = max3 - min3;
      saturation = lightness <= 0.5 ? delta / (max3 + min3) : delta / (2 - max3 - min3);
      switch (max3) {
        case r3:
          hue2 = (g - b) / delta + (g < b ? 6 : 0);
          break;
        case g:
          hue2 = (b - r3) / delta + 2;
          break;
        case b:
          hue2 = (r3 - g) / delta + 4;
          break;
      }
      hue2 /= 6;
    }
    target.h = hue2;
    target.s = saturation;
    target.l = lightness;
    return target;
  }
  getRGB(target, colorSpace = LinearSRGBColorSpace) {
    ColorManagement.fromWorkingColorSpace(toComponents(this, _rgb), colorSpace);
    target.r = _rgb.r;
    target.g = _rgb.g;
    target.b = _rgb.b;
    return target;
  }
  getStyle(colorSpace = SRGBColorSpace) {
    ColorManagement.fromWorkingColorSpace(toComponents(this, _rgb), colorSpace);
    if (colorSpace !== SRGBColorSpace) {
      return `color(${colorSpace} ${_rgb.r} ${_rgb.g} ${_rgb.b})`;
    }
    return `rgb(${_rgb.r * 255 | 0},${_rgb.g * 255 | 0},${_rgb.b * 255 | 0})`;
  }
  offsetHSL(h, s2, l) {
    this.getHSL(_hslA);
    _hslA.h += h;
    _hslA.s += s2;
    _hslA.l += l;
    this.setHSL(_hslA.h, _hslA.s, _hslA.l);
    return this;
  }
  add(color2) {
    this.r += color2.r;
    this.g += color2.g;
    this.b += color2.b;
    return this;
  }
  addColors(color1, color2) {
    this.r = color1.r + color2.r;
    this.g = color1.g + color2.g;
    this.b = color1.b + color2.b;
    return this;
  }
  addScalar(s2) {
    this.r += s2;
    this.g += s2;
    this.b += s2;
    return this;
  }
  sub(color2) {
    this.r = Math.max(0, this.r - color2.r);
    this.g = Math.max(0, this.g - color2.g);
    this.b = Math.max(0, this.b - color2.b);
    return this;
  }
  multiply(color2) {
    this.r *= color2.r;
    this.g *= color2.g;
    this.b *= color2.b;
    return this;
  }
  multiplyScalar(s2) {
    this.r *= s2;
    this.g *= s2;
    this.b *= s2;
    return this;
  }
  lerp(color2, alpha3) {
    this.r += (color2.r - this.r) * alpha3;
    this.g += (color2.g - this.g) * alpha3;
    this.b += (color2.b - this.b) * alpha3;
    return this;
  }
  lerpColors(color1, color2, alpha3) {
    this.r = color1.r + (color2.r - color1.r) * alpha3;
    this.g = color1.g + (color2.g - color1.g) * alpha3;
    this.b = color1.b + (color2.b - color1.b) * alpha3;
    return this;
  }
  lerpHSL(color2, alpha3) {
    this.getHSL(_hslA);
    color2.getHSL(_hslB);
    const h = lerp(_hslA.h, _hslB.h, alpha3);
    const s2 = lerp(_hslA.s, _hslB.s, alpha3);
    const l = lerp(_hslA.l, _hslB.l, alpha3);
    this.setHSL(h, s2, l);
    return this;
  }
  equals(c4) {
    return c4.r === this.r && c4.g === this.g && c4.b === this.b;
  }
  fromArray(array, offset = 0) {
    this.r = array[offset];
    this.g = array[offset + 1];
    this.b = array[offset + 2];
    return this;
  }
  toArray(array = [], offset = 0) {
    array[offset] = this.r;
    array[offset + 1] = this.g;
    array[offset + 2] = this.b;
    return array;
  }
  fromBufferAttribute(attribute, index) {
    this.r = attribute.getX(index);
    this.g = attribute.getY(index);
    this.b = attribute.getZ(index);
    if (attribute.normalized === true) {
      this.r /= 255;
      this.g /= 255;
      this.b /= 255;
    }
    return this;
  }
  toJSON() {
    return this.getHex();
  }
};
Color2.NAMES = _colorKeywords;
Color2.prototype.isColor = true;
Color2.prototype.r = 1;
Color2.prototype.g = 1;
Color2.prototype.b = 1;
var _canvas;
var ImageUtils = class {
  static getDataURL(image) {
    if (/^data:/i.test(image.src)) {
      return image.src;
    }
    if (typeof HTMLCanvasElement == "undefined") {
      return image.src;
    }
    let canvas;
    if (image instanceof HTMLCanvasElement) {
      canvas = image;
    } else {
      if (_canvas === void 0)
        _canvas = createElementNS("canvas");
      _canvas.width = image.width;
      _canvas.height = image.height;
      const context2 = _canvas.getContext("2d");
      if (image instanceof ImageData) {
        context2.putImageData(image, 0, 0);
      } else {
        context2.drawImage(image, 0, 0, image.width, image.height);
      }
      canvas = _canvas;
    }
    if (canvas.width > 2048 || canvas.height > 2048) {
      console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons", image);
      return canvas.toDataURL("image/jpeg", 0.6);
    } else {
      return canvas.toDataURL("image/png");
    }
  }
  static sRGBToLinear(image) {
    if (typeof HTMLImageElement !== "undefined" && image instanceof HTMLImageElement || typeof HTMLCanvasElement !== "undefined" && image instanceof HTMLCanvasElement || typeof ImageBitmap !== "undefined" && image instanceof ImageBitmap) {
      const canvas = createElementNS("canvas");
      canvas.width = image.width;
      canvas.height = image.height;
      const context2 = canvas.getContext("2d");
      context2.drawImage(image, 0, 0, image.width, image.height);
      const imageData = context2.getImageData(0, 0, image.width, image.height);
      const data = imageData.data;
      for (let i2 = 0; i2 < data.length; i2++) {
        data[i2] = SRGBToLinear(data[i2] / 255) * 255;
      }
      context2.putImageData(imageData, 0, 0);
      return canvas;
    } else if (image.data) {
      const data = image.data.slice(0);
      for (let i2 = 0; i2 < data.length; i2++) {
        if (data instanceof Uint8Array || data instanceof Uint8ClampedArray) {
          data[i2] = Math.floor(SRGBToLinear(data[i2] / 255) * 255);
        } else {
          data[i2] = SRGBToLinear(data[i2]);
        }
      }
      return {
        data,
        width: image.width,
        height: image.height
      };
    } else {
      console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied.");
      return image;
    }
  }
};
var Source = class {
  constructor(data = null) {
    this.uuid = generateUUID();
    this.data = data;
    this.version = 0;
  }
  set needsUpdate(value) {
    if (value === true)
      this.version++;
  }
  toJSON(meta2) {
    const isRootObject = meta2 === void 0 || typeof meta2 === "string";
    if (!isRootObject && meta2.images[this.uuid] !== void 0) {
      return meta2.images[this.uuid];
    }
    const output = {
      uuid: this.uuid,
      url: ""
    };
    const data = this.data;
    if (data !== null) {
      let url;
      if (Array.isArray(data)) {
        url = [];
        for (let i2 = 0, l = data.length; i2 < l; i2++) {
          if (data[i2].isDataTexture) {
            url.push(serializeImage(data[i2].image));
          } else {
            url.push(serializeImage(data[i2]));
          }
        }
      } else {
        url = serializeImage(data);
      }
      output.url = url;
    }
    if (!isRootObject) {
      meta2.images[this.uuid] = output;
    }
    return output;
  }
};
function serializeImage(image) {
  if (typeof HTMLImageElement !== "undefined" && image instanceof HTMLImageElement || typeof HTMLCanvasElement !== "undefined" && image instanceof HTMLCanvasElement || typeof ImageBitmap !== "undefined" && image instanceof ImageBitmap) {
    return ImageUtils.getDataURL(image);
  } else {
    if (image.data) {
      return {
        data: Array.prototype.slice.call(image.data),
        width: image.width,
        height: image.height,
        type: image.data.constructor.name
      };
    } else {
      console.warn("THREE.Texture: Unable to serialize Texture.");
      return {};
    }
  }
}
Source.prototype.isSource = true;
var textureId = 0;
var Texture = class _Texture extends EventDispatcher {
  constructor(image = _Texture.DEFAULT_IMAGE, mapping = _Texture.DEFAULT_MAPPING, wrapS = ClampToEdgeWrapping, wrapT = ClampToEdgeWrapping, magFilter = LinearFilter, minFilter = LinearMipmapLinearFilter, format3 = RGBAFormat, type = UnsignedByteType, anisotropy = 1, encoding = LinearEncoding) {
    super();
    Object.defineProperty(this, "id", { value: textureId++ });
    this.uuid = generateUUID();
    this.name = "";
    this.source = new Source(image);
    this.mipmaps = [];
    this.mapping = mapping;
    this.wrapS = wrapS;
    this.wrapT = wrapT;
    this.magFilter = magFilter;
    this.minFilter = minFilter;
    this.anisotropy = anisotropy;
    this.format = format3;
    this.internalFormat = null;
    this.type = type;
    this.offset = new Vector2(0, 0);
    this.repeat = new Vector2(1, 1);
    this.center = new Vector2(0, 0);
    this.rotation = 0;
    this.matrixAutoUpdate = true;
    this.matrix = new Matrix3();
    this.generateMipmaps = true;
    this.premultiplyAlpha = false;
    this.flipY = true;
    this.unpackAlignment = 4;
    this.encoding = encoding;
    this.userData = {};
    this.version = 0;
    this.onUpdate = null;
    this.isRenderTargetTexture = false;
    this.needsPMREMUpdate = false;
  }
  get image() {
    return this.source.data;
  }
  set image(value) {
    this.source.data = value;
  }
  updateMatrix() {
    this.matrix.setUvTransform(this.offset.x, this.offset.y, this.repeat.x, this.repeat.y, this.rotation, this.center.x, this.center.y);
  }
  clone() {
    return new this.constructor().copy(this);
  }
  copy(source) {
    this.name = source.name;
    this.source = source.source;
    this.mipmaps = source.mipmaps.slice(0);
    this.mapping = source.mapping;
    this.wrapS = source.wrapS;
    this.wrapT = source.wrapT;
    this.magFilter = source.magFilter;
    this.minFilter = source.minFilter;
    this.anisotropy = source.anisotropy;
    this.format = source.format;
    this.internalFormat = source.internalFormat;
    this.type = source.type;
    this.offset.copy(source.offset);
    this.repeat.copy(source.repeat);
    this.center.copy(source.center);
    this.rotation = source.rotation;
    this.matrixAutoUpdate = source.matrixAutoUpdate;
    this.matrix.copy(source.matrix);
    this.generateMipmaps = source.generateMipmaps;
    this.premultiplyAlpha = source.premultiplyAlpha;
    this.flipY = source.flipY;
    this.unpackAlignment = source.unpackAlignment;
    this.encoding = source.encoding;
    this.userData = JSON.parse(JSON.stringify(source.userData));
    this.needsUpdate = true;
    return this;
  }
  toJSON(meta2) {
    const isRootObject = meta2 === void 0 || typeof meta2 === "string";
    if (!isRootObject && meta2.textures[this.uuid] !== void 0) {
      return meta2.textures[this.uuid];
    }
    const output = {
      metadata: {
        version: 4.5,
        type: "Texture",
        generator: "Texture.toJSON"
      },
      uuid: this.uuid,
      name: this.name,
      image: this.source.toJSON(meta2).uuid,
      mapping: this.mapping,
      repeat: [this.repeat.x, this.repeat.y],
      offset: [this.offset.x, this.offset.y],
      center: [this.center.x, this.center.y],
      rotation: this.rotation,
      wrap: [this.wrapS, this.wrapT],
      format: this.format,
      type: this.type,
      encoding: this.encoding,
      minFilter: this.minFilter,
      magFilter: this.magFilter,
      anisotropy: this.anisotropy,
      flipY: this.flipY,
      premultiplyAlpha: this.premultiplyAlpha,
      unpackAlignment: this.unpackAlignment
    };
    if (JSON.stringify(this.userData) !== "{}")
      output.userData = this.userData;
    if (!isRootObject) {
      meta2.textures[this.uuid] = output;
    }
    return output;
  }
  dispose() {
    this.dispatchEvent({ type: "dispose" });
  }
  transformUv(uv) {
    if (this.mapping !== UVMapping)
      return uv;
    uv.applyMatrix3(this.matrix);
    if (uv.x < 0 || uv.x > 1) {
      switch (this.wrapS) {
        case RepeatWrapping:
          uv.x = uv.x - Math.floor(uv.x);
          break;
        case ClampToEdgeWrapping:
          uv.x = uv.x < 0 ? 0 : 1;
          break;
        case MirroredRepeatWrapping:
          if (Math.abs(Math.floor(uv.x) % 2) === 1) {
            uv.x = Math.ceil(uv.x) - uv.x;
          } else {
            uv.x = uv.x - Math.floor(uv.x);
          }
          break;
      }
    }
    if (uv.y < 0 || uv.y > 1) {
      switch (this.wrapT) {
        case RepeatWrapping:
          uv.y = uv.y - Math.floor(uv.y);
          break;
        case ClampToEdgeWrapping:
          uv.y = uv.y < 0 ? 0 : 1;
          break;
        case MirroredRepeatWrapping:
          if (Math.abs(Math.floor(uv.y) % 2) === 1) {
            uv.y = Math.ceil(uv.y) - uv.y;
          } else {
            uv.y = uv.y - Math.floor(uv.y);
          }
          break;
      }
    }
    if (this.flipY) {
      uv.y = 1 - uv.y;
    }
    return uv;
  }
  set needsUpdate(value) {
    if (value === true) {
      this.version++;
      this.source.needsUpdate = true;
    }
  }
};
Texture.DEFAULT_IMAGE = null;
Texture.DEFAULT_MAPPING = UVMapping;
Texture.prototype.isTexture = true;
var Vector4 = class {
  constructor(x2 = 0, y2 = 0, z = 0, w = 1) {
    this.x = x2;
    this.y = y2;
    this.z = z;
    this.w = w;
  }
  get width() {
    return this.z;
  }
  set width(value) {
    this.z = value;
  }
  get height() {
    return this.w;
  }
  set height(value) {
    this.w = value;
  }
  set(x2, y2, z, w) {
    this.x = x2;
    this.y = y2;
    this.z = z;
    this.w = w;
    return this;
  }
  setScalar(scalar) {
    this.x = scalar;
    this.y = scalar;
    this.z = scalar;
    this.w = scalar;
    return this;
  }
  setX(x2) {
    this.x = x2;
    return this;
  }
  setY(y2) {
    this.y = y2;
    return this;
  }
  setZ(z) {
    this.z = z;
    return this;
  }
  setW(w) {
    this.w = w;
    return this;
  }
  setComponent(index, value) {
    switch (index) {
      case 0:
        this.x = value;
        break;
      case 1:
        this.y = value;
        break;
      case 2:
        this.z = value;
        break;
      case 3:
        this.w = value;
        break;
      default:
        throw new Error("index is out of range: " + index);
    }
    return this;
  }
  getComponent(index) {
    switch (index) {
      case 0:
        return this.x;
      case 1:
        return this.y;
      case 2:
        return this.z;
      case 3:
        return this.w;
      default:
        throw new Error("index is out of range: " + index);
    }
  }
  clone() {
    return new this.constructor(this.x, this.y, this.z, this.w);
  }
  copy(v4) {
    this.x = v4.x;
    this.y = v4.y;
    this.z = v4.z;
    this.w = v4.w !== void 0 ? v4.w : 1;
    return this;
  }
  add(v4, w) {
    if (w !== void 0) {
      console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead.");
      return this.addVectors(v4, w);
    }
    this.x += v4.x;
    this.y += v4.y;
    this.z += v4.z;
    this.w += v4.w;
    return this;
  }
  addScalar(s2) {
    this.x += s2;
    this.y += s2;
    this.z += s2;
    this.w += s2;
    return this;
  }
  addVectors(a2, b) {
    this.x = a2.x + b.x;
    this.y = a2.y + b.y;
    this.z = a2.z + b.z;
    this.w = a2.w + b.w;
    return this;
  }
  addScaledVector(v4, s2) {
    this.x += v4.x * s2;
    this.y += v4.y * s2;
    this.z += v4.z * s2;
    this.w += v4.w * s2;
    return this;
  }
  sub(v4, w) {
    if (w !== void 0) {
      console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.");
      return this.subVectors(v4, w);
    }
    this.x -= v4.x;
    this.y -= v4.y;
    this.z -= v4.z;
    this.w -= v4.w;
    return this;
  }
  subScalar(s2) {
    this.x -= s2;
    this.y -= s2;
    this.z -= s2;
    this.w -= s2;
    return this;
  }
  subVectors(a2, b) {
    this.x = a2.x - b.x;
    this.y = a2.y - b.y;
    this.z = a2.z - b.z;
    this.w = a2.w - b.w;
    return this;
  }
  multiply(v4) {
    this.x *= v4.x;
    this.y *= v4.y;
    this.z *= v4.z;
    this.w *= v4.w;
    return this;
  }
  multiplyScalar(scalar) {
    this.x *= scalar;
    this.y *= scalar;
    this.z *= scalar;
    this.w *= scalar;
    return this;
  }
  applyMatrix4(m) {
    const x2 = this.x, y2 = this.y, z = this.z, w = this.w;
    const e3 = m.elements;
    this.x = e3[0] * x2 + e3[4] * y2 + e3[8] * z + e3[12] * w;
    this.y = e3[1] * x2 + e3[5] * y2 + e3[9] * z + e3[13] * w;
    this.z = e3[2] * x2 + e3[6] * y2 + e3[10] * z + e3[14] * w;
    this.w = e3[3] * x2 + e3[7] * y2 + e3[11] * z + e3[15] * w;
    return this;
  }
  divideScalar(scalar) {
    return this.multiplyScalar(1 / scalar);
  }
  setAxisAngleFromQuaternion(q) {
    this.w = 2 * Math.acos(q.w);
    const s2 = Math.sqrt(1 - q.w * q.w);
    if (s2 < 1e-4) {
      this.x = 1;
      this.y = 0;
      this.z = 0;
    } else {
      this.x = q.x / s2;
      this.y = q.y / s2;
      this.z = q.z / s2;
    }
    return this;
  }
  setAxisAngleFromRotationMatrix(m) {
    let angle, x2, y2, z;
    const epsilon3 = 0.01, epsilon22 = 0.1, te = m.elements, m11 = te[0], m12 = te[4], m13 = te[8], m21 = te[1], m22 = te[5], m23 = te[9], m31 = te[2], m32 = te[6], m33 = te[10];
    if (Math.abs(m12 - m21) < epsilon3 && Math.abs(m13 - m31) < epsilon3 && Math.abs(m23 - m32) < epsilon3) {
      if (Math.abs(m12 + m21) < epsilon22 && Math.abs(m13 + m31) < epsilon22 && Math.abs(m23 + m32) < epsilon22 && Math.abs(m11 + m22 + m33 - 3) < epsilon22) {
        this.set(1, 0, 0, 0);
        return this;
      }
      angle = Math.PI;
      const xx = (m11 + 1) / 2;
      const yy = (m22 + 1) / 2;
      const zz = (m33 + 1) / 2;
      const xy = (m12 + m21) / 4;
      const xz = (m13 + m31) / 4;
      const yz = (m23 + m32) / 4;
      if (xx > yy && xx > zz) {
        if (xx < epsilon3) {
          x2 = 0;
          y2 = 0.707106781;
          z = 0.707106781;
        } else {
          x2 = Math.sqrt(xx);
          y2 = xy / x2;
          z = xz / x2;
        }
      } else if (yy > zz) {
        if (yy < epsilon3) {
          x2 = 0.707106781;
          y2 = 0;
          z = 0.707106781;
        } else {
          y2 = Math.sqrt(yy);
          x2 = xy / y2;
          z = yz / y2;
        }
      } else {
        if (zz < epsilon3) {
          x2 = 0.707106781;
          y2 = 0.707106781;
          z = 0;
        } else {
          z = Math.sqrt(zz);
          x2 = xz / z;
          y2 = yz / z;
        }
      }
      this.set(x2, y2, z, angle);
      return this;
    }
    let s2 = Math.sqrt((m32 - m23) * (m32 - m23) + (m13 - m31) * (m13 - m31) + (m21 - m12) * (m21 - m12));
    if (Math.abs(s2) < 1e-3)
      s2 = 1;
    this.x = (m32 - m23) / s2;
    this.y = (m13 - m31) / s2;
    this.z = (m21 - m12) / s2;
    this.w = Math.acos((m11 + m22 + m33 - 1) / 2);
    return this;
  }
  min(v4) {
    this.x = Math.min(this.x, v4.x);
    this.y = Math.min(this.y, v4.y);
    this.z = Math.min(this.z, v4.z);
    this.w = Math.min(this.w, v4.w);
    return this;
  }
  max(v4) {
    this.x = Math.max(this.x, v4.x);
    this.y = Math.max(this.y, v4.y);
    this.z = Math.max(this.z, v4.z);
    this.w = Math.max(this.w, v4.w);
    return this;
  }
  clamp(min3, max3) {
    this.x = Math.max(min3.x, Math.min(max3.x, this.x));
    this.y = Math.max(min3.y, Math.min(max3.y, this.y));
    this.z = Math.max(min3.z, Math.min(max3.z, this.z));
    this.w = Math.max(min3.w, Math.min(max3.w, this.w));
    return this;
  }
  clampScalar(minVal, maxVal) {
    this.x = Math.max(minVal, Math.min(maxVal, this.x));
    this.y = Math.max(minVal, Math.min(maxVal, this.y));
    this.z = Math.max(minVal, Math.min(maxVal, this.z));
    this.w = Math.max(minVal, Math.min(maxVal, this.w));
    return this;
  }
  clampLength(min3, max3) {
    const length2 = this.length();
    return this.divideScalar(length2 || 1).multiplyScalar(Math.max(min3, Math.min(max3, length2)));
  }
  floor() {
    this.x = Math.floor(this.x);
    this.y = Math.floor(this.y);
    this.z = Math.floor(this.z);
    this.w = Math.floor(this.w);
    return this;
  }
  ceil() {
    this.x = Math.ceil(this.x);
    this.y = Math.ceil(this.y);
    this.z = Math.ceil(this.z);
    this.w = Math.ceil(this.w);
    return this;
  }
  round() {
    this.x = Math.round(this.x);
    this.y = Math.round(this.y);
    this.z = Math.round(this.z);
    this.w = Math.round(this.w);
    return this;
  }
  roundToZero() {
    this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x);
    this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y);
    this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z);
    this.w = this.w < 0 ? Math.ceil(this.w) : Math.floor(this.w);
    return this;
  }
  negate() {
    this.x = -this.x;
    this.y = -this.y;
    this.z = -this.z;
    this.w = -this.w;
    return this;
  }
  dot(v4) {
    return this.x * v4.x + this.y * v4.y + this.z * v4.z + this.w * v4.w;
  }
  lengthSq() {
    return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w;
  }
  length() {
    return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w);
  }
  manhattanLength() {
    return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w);
  }
  normalize() {
    return this.divideScalar(this.length() || 1);
  }
  setLength(length2) {
    return this.normalize().multiplyScalar(length2);
  }
  lerp(v4, alpha3) {
    this.x += (v4.x - this.x) * alpha3;
    this.y += (v4.y - this.y) * alpha3;
    this.z += (v4.z - this.z) * alpha3;
    this.w += (v4.w - this.w) * alpha3;
    return this;
  }
  lerpVectors(v12, v22, alpha3) {
    this.x = v12.x + (v22.x - v12.x) * alpha3;
    this.y = v12.y + (v22.y - v12.y) * alpha3;
    this.z = v12.z + (v22.z - v12.z) * alpha3;
    this.w = v12.w + (v22.w - v12.w) * alpha3;
    return this;
  }
  equals(v4) {
    return v4.x === this.x && v4.y === this.y && v4.z === this.z && v4.w === this.w;
  }
  fromArray(array, offset = 0) {
    this.x = array[offset];
    this.y = array[offset + 1];
    this.z = array[offset + 2];
    this.w = array[offset + 3];
    return this;
  }
  toArray(array = [], offset = 0) {
    array[offset] = this.x;
    array[offset + 1] = this.y;
    array[offset + 2] = this.z;
    array[offset + 3] = this.w;
    return array;
  }
  fromBufferAttribute(attribute, index, offset) {
    if (offset !== void 0) {
      console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute().");
    }
    this.x = attribute.getX(index);
    this.y = attribute.getY(index);
    this.z = attribute.getZ(index);
    this.w = attribute.getW(index);
    return this;
  }
  random() {
    this.x = Math.random();
    this.y = Math.random();
    this.z = Math.random();
    this.w = Math.random();
    return this;
  }
  *[Symbol.iterator]() {
    yield this.x;
    yield this.y;
    yield this.z;
    yield this.w;
  }
};
Vector4.prototype.isVector4 = true;
var WebGLRenderTarget = class extends EventDispatcher {
  constructor(width, height, options = {}) {
    super();
    this.width = width;
    this.height = height;
    this.depth = 1;
    this.scissor = new Vector4(0, 0, width, height);
    this.scissorTest = false;
    this.viewport = new Vector4(0, 0, width, height);
    const image = { width, height, depth: 1 };
    this.texture = new Texture(image, options.mapping, options.wrapS, options.wrapT, options.magFilter, options.minFilter, options.format, options.type, options.anisotropy, options.encoding);
    this.texture.isRenderTargetTexture = true;
    this.texture.flipY = false;
    this.texture.generateMipmaps = options.generateMipmaps !== void 0 ? options.generateMipmaps : false;
    this.texture.internalFormat = options.internalFormat !== void 0 ? options.internalFormat : null;
    this.texture.minFilter = options.minFilter !== void 0 ? options.minFilter : LinearFilter;
    this.depthBuffer = options.depthBuffer !== void 0 ? options.depthBuffer : true;
    this.stencilBuffer = options.stencilBuffer !== void 0 ? options.stencilBuffer : false;
    this.depthTexture = options.depthTexture !== void 0 ? options.depthTexture : null;
    this.samples = options.samples !== void 0 ? options.samples : 0;
  }
  setSize(width, height, depth = 1) {
    if (this.width !== width || this.height !== height || this.depth !== depth) {
      this.width = width;
      this.height = height;
      this.depth = depth;
      this.texture.image.width = width;
      this.texture.image.height = height;
      this.texture.image.depth = depth;
      this.dispose();
    }
    this.viewport.set(0, 0, width, height);
    this.scissor.set(0, 0, width, height);
  }
  clone() {
    return new this.constructor().copy(this);
  }
  copy(source) {
    this.width = source.width;
    this.height = source.height;
    this.depth = source.depth;
    this.viewport.copy(source.viewport);
    this.texture = source.texture.clone();
    this.texture.isRenderTargetTexture = true;
    this.texture.image = Object.assign({}, source.texture.image);
    this.depthBuffer = source.depthBuffer;
    this.stencilBuffer = source.stencilBuffer;
    if (source.depthTexture !== null)
      this.depthTexture = source.depthTexture.clone();
    this.samples = source.samples;
    return this;
  }
  dispose() {
    this.dispatchEvent({ type: "dispose" });
  }
};
WebGLRenderTarget.prototype.isWebGLRenderTarget = true;
var DataArrayTexture = class extends Texture {
  constructor(data = null, width = 1, height = 1, depth = 1) {
    super(null);
    this.image = { data, width, height, depth };
    this.magFilter = NearestFilter;
    this.minFilter = NearestFilter;
    this.wrapR = ClampToEdgeWrapping;
    this.generateMipmaps = false;
    this.flipY = false;
    this.unpackAlignment = 1;
  }
};
DataArrayTexture.prototype.isDataArrayTexture = true;
var WebGLArrayRenderTarget = class extends WebGLRenderTarget {
  constructor(width, height, depth) {
    super(width, height);
    this.depth = depth;
    this.texture = new DataArrayTexture(null, width, height, depth);
    this.texture.isRenderTargetTexture = true;
  }
};
WebGLArrayRenderTarget.prototype.isWebGLArrayRenderTarget = true;
var Data3DTexture = class extends Texture {
  constructor(data = null, width = 1, height = 1, depth = 1) {
    super(null);
    this.image = { data, width, height, depth };
    this.magFilter = NearestFilter;
    this.minFilter = NearestFilter;
    this.wrapR = ClampToEdgeWrapping;
    this.generateMipmaps = false;
    this.flipY = false;
    this.unpackAlignment = 1;
  }
};
Data3DTexture.prototype.isData3DTexture = true;
var WebGL3DRenderTarget = class extends WebGLRenderTarget {
  constructor(width, height, depth) {
    super(width, height);
    this.depth = depth;
    this.texture = new Data3DTexture(null, width, height, depth);
    this.texture.isRenderTargetTexture = true;
  }
};
WebGL3DRenderTarget.prototype.isWebGL3DRenderTarget = true;
var WebGLMultipleRenderTargets = class extends WebGLRenderTarget {
  constructor(width, height, count2, options = {}) {
    super(width, height, options);
    const texture = this.texture;
    this.texture = [];
    for (let i2 = 0; i2 < count2; i2++) {
      this.texture[i2] = texture.clone();
      this.texture[i2].isRenderTargetTexture = true;
    }
  }
  setSize(width, height, depth = 1) {
    if (this.width !== width || this.height !== height || this.depth !== depth) {
      this.width = width;
      this.height = height;
      this.depth = depth;
      for (let i2 = 0, il = this.texture.length; i2 < il; i2++) {
        this.texture[i2].image.width = width;
        this.texture[i2].image.height = height;
        this.texture[i2].image.depth = depth;
      }
      this.dispose();
    }
    this.viewport.set(0, 0, width, height);
    this.scissor.set(0, 0, width, height);
    return this;
  }
  copy(source) {
    this.dispose();
    this.width = source.width;
    this.height = source.height;
    this.depth = source.depth;
    this.viewport.set(0, 0, this.width, this.height);
    this.scissor.set(0, 0, this.width, this.height);
    this.depthBuffer = source.depthBuffer;
    this.stencilBuffer = source.stencilBuffer;
    this.depthTexture = source.depthTexture;
    this.texture.length = 0;
    for (let i2 = 0, il = source.texture.length; i2 < il; i2++) {
      this.texture[i2] = source.texture[i2].clone();
    }
    return this;
  }
};
WebGLMultipleRenderTargets.prototype.isWebGLMultipleRenderTargets = true;
var Quaternion = class {
  constructor(x2 = 0, y2 = 0, z = 0, w = 1) {
    this._x = x2;
    this._y = y2;
    this._z = z;
    this._w = w;
  }
  static slerp(qa, qb, qm, t3) {
    console.warn("THREE.Quaternion: Static .slerp() has been deprecated. Use qm.slerpQuaternions( qa, qb, t ) instead.");
    return qm.slerpQuaternions(qa, qb, t3);
  }
  static slerpFlat(dst, dstOffset, src0, srcOffset0, src1, srcOffset1, t3) {
    let x0 = src0[srcOffset0 + 0], y0 = src0[srcOffset0 + 1], z0 = src0[srcOffset0 + 2], w0 = src0[srcOffset0 + 3];
    const x1 = src1[srcOffset1 + 0], y1 = src1[srcOffset1 + 1], z1 = src1[srcOffset1 + 2], w1 = src1[srcOffset1 + 3];
    if (t3 === 0) {
      dst[dstOffset + 0] = x0;
      dst[dstOffset + 1] = y0;
      dst[dstOffset + 2] = z0;
      dst[dstOffset + 3] = w0;
      return;
    }
    if (t3 === 1) {
      dst[dstOffset + 0] = x1;
      dst[dstOffset + 1] = y1;
      dst[dstOffset + 2] = z1;
      dst[dstOffset + 3] = w1;
      return;
    }
    if (w0 !== w1 || x0 !== x1 || y0 !== y1 || z0 !== z1) {
      let s2 = 1 - t3;
      const cos2 = x0 * x1 + y0 * y1 + z0 * z1 + w0 * w1, dir = cos2 >= 0 ? 1 : -1, sqrSin = 1 - cos2 * cos2;
      if (sqrSin > Number.EPSILON) {
        const sin2 = Math.sqrt(sqrSin), len = Math.atan2(sin2, cos2 * dir);
        s2 = Math.sin(s2 * len) / sin2;
        t3 = Math.sin(t3 * len) / sin2;
      }
      const tDir = t3 * dir;
      x0 = x0 * s2 + x1 * tDir;
      y0 = y0 * s2 + y1 * tDir;
      z0 = z0 * s2 + z1 * tDir;
      w0 = w0 * s2 + w1 * tDir;
      if (s2 === 1 - t3) {
        const f = 1 / Math.sqrt(x0 * x0 + y0 * y0 + z0 * z0 + w0 * w0);
        x0 *= f;
        y0 *= f;
        z0 *= f;
        w0 *= f;
      }
    }
    dst[dstOffset] = x0;
    dst[dstOffset + 1] = y0;
    dst[dstOffset + 2] = z0;
    dst[dstOffset + 3] = w0;
  }
  static multiplyQuaternionsFlat(dst, dstOffset, src0, srcOffset0, src1, srcOffset1) {
    const x0 = src0[srcOffset0];
    const y0 = src0[srcOffset0 + 1];
    const z0 = src0[srcOffset0 + 2];
    const w0 = src0[srcOffset0 + 3];
    const x1 = src1[srcOffset1];
    const y1 = src1[srcOffset1 + 1];
    const z1 = src1[srcOffset1 + 2];
    const w1 = src1[srcOffset1 + 3];
    dst[dstOffset] = x0 * w1 + w0 * x1 + y0 * z1 - z0 * y1;
    dst[dstOffset + 1] = y0 * w1 + w0 * y1 + z0 * x1 - x0 * z1;
    dst[dstOffset + 2] = z0 * w1 + w0 * z1 + x0 * y1 - y0 * x1;
    dst[dstOffset + 3] = w0 * w1 - x0 * x1 - y0 * y1 - z0 * z1;
    return dst;
  }
  get x() {
    return this._x;
  }
  set x(value) {
    this._x = value;
    this._onChangeCallback();
  }
  get y() {
    return this._y;
  }
  set y(value) {
    this._y = value;
    this._onChangeCallback();
  }
  get z() {
    return this._z;
  }
  set z(value) {
    this._z = value;
    this._onChangeCallback();
  }
  get w() {
    return this._w;
  }
  set w(value) {
    this._w = value;
    this._onChangeCallback();
  }
  set(x2, y2, z, w) {
    this._x = x2;
    this._y = y2;
    this._z = z;
    this._w = w;
    this._onChangeCallback();
    return this;
  }
  clone() {
    return new this.constructor(this._x, this._y, this._z, this._w);
  }
  copy(quaternion) {
    this._x = quaternion.x;
    this._y = quaternion.y;
    this._z = quaternion.z;
    this._w = quaternion.w;
    this._onChangeCallback();
    return this;
  }
  setFromEuler(euler, update) {
    if (!(euler && euler.isEuler)) {
      throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");
    }
    const x2 = euler._x, y2 = euler._y, z = euler._z, order = euler._order;
    const cos2 = Math.cos;
    const sin2 = Math.sin;
    const c1 = cos2(x2 / 2);
    const c22 = cos2(y2 / 2);
    const c32 = cos2(z / 2);
    const s1 = sin2(x2 / 2);
    const s2 = sin2(y2 / 2);
    const s3 = sin2(z / 2);
    switch (order) {
      case "XYZ":
        this._x = s1 * c22 * c32 + c1 * s2 * s3;
        this._y = c1 * s2 * c32 - s1 * c22 * s3;
        this._z = c1 * c22 * s3 + s1 * s2 * c32;
        this._w = c1 * c22 * c32 - s1 * s2 * s3;
        break;
      case "YXZ":
        this._x = s1 * c22 * c32 + c1 * s2 * s3;
        this._y = c1 * s2 * c32 - s1 * c22 * s3;
        this._z = c1 * c22 * s3 - s1 * s2 * c32;
        this._w = c1 * c22 * c32 + s1 * s2 * s3;
        break;
      case "ZXY":
        this._x = s1 * c22 * c32 - c1 * s2 * s3;
        this._y = c1 * s2 * c32 + s1 * c22 * s3;
        this._z = c1 * c22 * s3 + s1 * s2 * c32;
        this._w = c1 * c22 * c32 - s1 * s2 * s3;
        break;
      case "ZYX":
        this._x = s1 * c22 * c32 - c1 * s2 * s3;
        this._y = c1 * s2 * c32 + s1 * c22 * s3;
        this._z = c1 * c22 * s3 - s1 * s2 * c32;
        this._w = c1 * c22 * c32 + s1 * s2 * s3;
        break;
      case "YZX":
        this._x = s1 * c22 * c32 + c1 * s2 * s3;
        this._y = c1 * s2 * c32 + s1 * c22 * s3;
        this._z = c1 * c22 * s3 - s1 * s2 * c32;
        this._w = c1 * c22 * c32 - s1 * s2 * s3;
        break;
      case "XZY":
        this._x = s1 * c22 * c32 - c1 * s2 * s3;
        this._y = c1 * s2 * c32 - s1 * c22 * s3;
        this._z = c1 * c22 * s3 + s1 * s2 * c32;
        this._w = c1 * c22 * c32 + s1 * s2 * s3;
        break;
      default:
        console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: " + order);
    }
    if (update !== false)
      this._onChangeCallback();
    return this;
  }
  setFromAxisAngle(axis, angle) {
    const halfAngle = angle / 2, s2 = Math.sin(halfAngle);
    this._x = axis.x * s2;
    this._y = axis.y * s2;
    this._z = axis.z * s2;
    this._w = Math.cos(halfAngle);
    this._onChangeCallback();
    return this;
  }
  setFromRotationMatrix(m) {
    const te = m.elements, m11 = te[0], m12 = te[4], m13 = te[8], m21 = te[1], m22 = te[5], m23 = te[9], m31 = te[2], m32 = te[6], m33 = te[10], trace = m11 + m22 + m33;
    if (trace > 0) {
      const s2 = 0.5 / Math.sqrt(trace + 1);
      this._w = 0.25 / s2;
      this._x = (m32 - m23) * s2;
      this._y = (m13 - m31) * s2;
      this._z = (m21 - m12) * s2;
    } else if (m11 > m22 && m11 > m33) {
      const s2 = 2 * Math.sqrt(1 + m11 - m22 - m33);
      this._w = (m32 - m23) / s2;
      this._x = 0.25 * s2;
      this._y = (m12 + m21) / s2;
      this._z = (m13 + m31) / s2;
    } else if (m22 > m33) {
      const s2 = 2 * Math.sqrt(1 + m22 - m11 - m33);
      this._w = (m13 - m31) / s2;
      this._x = (m12 + m21) / s2;
      this._y = 0.25 * s2;
      this._z = (m23 + m32) / s2;
    } else {
      const s2 = 2 * Math.sqrt(1 + m33 - m11 - m22);
      this._w = (m21 - m12) / s2;
      this._x = (m13 + m31) / s2;
      this._y = (m23 + m32) / s2;
      this._z = 0.25 * s2;
    }
    this._onChangeCallback();
    return this;
  }
  setFromUnitVectors(vFrom, vTo) {
    let r3 = vFrom.dot(vTo) + 1;
    if (r3 < Number.EPSILON) {
      r3 = 0;
      if (Math.abs(vFrom.x) > Math.abs(vFrom.z)) {
        this._x = -vFrom.y;
        this._y = vFrom.x;
        this._z = 0;
        this._w = r3;
      } else {
        this._x = 0;
        this._y = -vFrom.z;
        this._z = vFrom.y;
        this._w = r3;
      }
    } else {
      this._x = vFrom.y * vTo.z - vFrom.z * vTo.y;
      this._y = vFrom.z * vTo.x - vFrom.x * vTo.z;
      this._z = vFrom.x * vTo.y - vFrom.y * vTo.x;
      this._w = r3;
    }
    return this.normalize();
  }
  angleTo(q) {
    return 2 * Math.acos(Math.abs(clamp(this.dot(q), -1, 1)));
  }
  rotateTowards(q, step) {
    const angle = this.angleTo(q);
    if (angle === 0)
      return this;
    const t3 = Math.min(1, step / angle);
    this.slerp(q, t3);
    return this;
  }
  identity() {
    return this.set(0, 0, 0, 1);
  }
  invert() {
    return this.conjugate();
  }
  conjugate() {
    this._x *= -1;
    this._y *= -1;
    this._z *= -1;
    this._onChangeCallback();
    return this;
  }
  dot(v4) {
    return this._x * v4._x + this._y * v4._y + this._z * v4._z + this._w * v4._w;
  }
  lengthSq() {
    return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w;
  }
  length() {
    return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w);
  }
  normalize() {
    let l = this.length();
    if (l === 0) {
      this._x = 0;
      this._y = 0;
      this._z = 0;
      this._w = 1;
    } else {
      l = 1 / l;
      this._x = this._x * l;
      this._y = this._y * l;
      this._z = this._z * l;
      this._w = this._w * l;
    }
    this._onChangeCallback();
    return this;
  }
  multiply(q, p) {
    if (p !== void 0) {
      console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead.");
      return this.multiplyQuaternions(q, p);
    }
    return this.multiplyQuaternions(this, q);
  }
  premultiply(q) {
    return this.multiplyQuaternions(q, this);
  }
  multiplyQuaternions(a2, b) {
    const qax = a2._x, qay = a2._y, qaz = a2._z, qaw = a2._w;
    const qbx = b._x, qby = b._y, qbz = b._z, qbw = b._w;
    this._x = qax * qbw + qaw * qbx + qay * qbz - qaz * qby;
    this._y = qay * qbw + qaw * qby + qaz * qbx - qax * qbz;
    this._z = qaz * qbw + qaw * qbz + qax * qby - qay * qbx;
    this._w = qaw * qbw - qax * qbx - qay * qby - qaz * qbz;
    this._onChangeCallback();
    return this;
  }
  slerp(qb, t3) {
    if (t3 === 0)
      return this;
    if (t3 === 1)
      return this.copy(qb);
    const x2 = this._x, y2 = this._y, z = this._z, w = this._w;
    let cosHalfTheta = w * qb._w + x2 * qb._x + y2 * qb._y + z * qb._z;
    if (cosHalfTheta < 0) {
      this._w = -qb._w;
      this._x = -qb._x;
      this._y = -qb._y;
      this._z = -qb._z;
      cosHalfTheta = -cosHalfTheta;
    } else {
      this.copy(qb);
    }
    if (cosHalfTheta >= 1) {
      this._w = w;
      this._x = x2;
      this._y = y2;
      this._z = z;
      return this;
    }
    const sqrSinHalfTheta = 1 - cosHalfTheta * cosHalfTheta;
    if (sqrSinHalfTheta <= Number.EPSILON) {
      const s2 = 1 - t3;
      this._w = s2 * w + t3 * this._w;
      this._x = s2 * x2 + t3 * this._x;
      this._y = s2 * y2 + t3 * this._y;
      this._z = s2 * z + t3 * this._z;
      this.normalize();
      this._onChangeCallback();
      return this;
    }
    const sinHalfTheta = Math.sqrt(sqrSinHalfTheta);
    const halfTheta = Math.atan2(sinHalfTheta, cosHalfTheta);
    const ratioA = Math.sin((1 - t3) * halfTheta) / sinHalfTheta, ratioB = Math.sin(t3 * halfTheta) / sinHalfTheta;
    this._w = w * ratioA + this._w * ratioB;
    this._x = x2 * ratioA + this._x * ratioB;
    this._y = y2 * ratioA + this._y * ratioB;
    this._z = z * ratioA + this._z * ratioB;
    this._onChangeCallback();
    return this;
  }
  slerpQuaternions(qa, qb, t3) {
    return this.copy(qa).slerp(qb, t3);
  }
  random() {
    const u1 = Math.random();
    const sqrt1u1 = Math.sqrt(1 - u1);
    const sqrtu1 = Math.sqrt(u1);
    const u2 = 2 * Math.PI * Math.random();
    const u3 = 2 * Math.PI * Math.random();
    return this.set(
      sqrt1u1 * Math.cos(u2),
      sqrtu1 * Math.sin(u3),
      sqrtu1 * Math.cos(u3),
      sqrt1u1 * Math.sin(u2)
    );
  }
  equals(quaternion) {
    return quaternion._x === this._x && quaternion._y === this._y && quaternion._z === this._z && quaternion._w === this._w;
  }
  fromArray(array, offset = 0) {
    this._x = array[offset];
    this._y = array[offset + 1];
    this._z = array[offset + 2];
    this._w = array[offset + 3];
    this._onChangeCallback();
    return this;
  }
  toArray(array = [], offset = 0) {
    array[offset] = this._x;
    array[offset + 1] = this._y;
    array[offset + 2] = this._z;
    array[offset + 3] = this._w;
    return array;
  }
  fromBufferAttribute(attribute, index) {
    this._x = attribute.getX(index);
    this._y = attribute.getY(index);
    this._z = attribute.getZ(index);
    this._w = attribute.getW(index);
    return this;
  }
  _onChange(callback) {
    this._onChangeCallback = callback;
    return this;
  }
  _onChangeCallback() {
  }
};
Quaternion.prototype.isQuaternion = true;
var Vector3 = class {
  constructor(x2 = 0, y2 = 0, z = 0) {
    this.x = x2;
    this.y = y2;
    this.z = z;
  }
  set(x2, y2, z) {
    if (z === void 0)
      z = this.z;
    this.x = x2;
    this.y = y2;
    this.z = z;
    return this;
  }
  setScalar(scalar) {
    this.x = scalar;
    this.y = scalar;
    this.z = scalar;
    return this;
  }
  setX(x2) {
    this.x = x2;
    return this;
  }
  setY(y2) {
    this.y = y2;
    return this;
  }
  setZ(z) {
    this.z = z;
    return this;
  }
  setComponent(index, value) {
    switch (index) {
      case 0:
        this.x = value;
        break;
      case 1:
        this.y = value;
        break;
      case 2:
        this.z = value;
        break;
      default:
        throw new Error("index is out of range: " + index);
    }
    return this;
  }
  getComponent(index) {
    switch (index) {
      case 0:
        return this.x;
      case 1:
        return this.y;
      case 2:
        return this.z;
      default:
        throw new Error("index is out of range: " + index);
    }
  }
  clone() {
    return new this.constructor(this.x, this.y, this.z);
  }
  copy(v4) {
    this.x = v4.x;
    this.y = v4.y;
    this.z = v4.z;
    return this;
  }
  add(v4, w) {
    if (w !== void 0) {
      console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead.");
      return this.addVectors(v4, w);
    }
    this.x += v4.x;
    this.y += v4.y;
    this.z += v4.z;
    return this;
  }
  addScalar(s2) {
    this.x += s2;
    this.y += s2;
    this.z += s2;
    return this;
  }
  addVectors(a2, b) {
    this.x = a2.x + b.x;
    this.y = a2.y + b.y;
    this.z = a2.z + b.z;
    return this;
  }
  addScaledVector(v4, s2) {
    this.x += v4.x * s2;
    this.y += v4.y * s2;
    this.z += v4.z * s2;
    return this;
  }
  sub(v4, w) {
    if (w !== void 0) {
      console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.");
      return this.subVectors(v4, w);
    }
    this.x -= v4.x;
    this.y -= v4.y;
    this.z -= v4.z;
    return this;
  }
  subScalar(s2) {
    this.x -= s2;
    this.y -= s2;
    this.z -= s2;
    return this;
  }
  subVectors(a2, b) {
    this.x = a2.x - b.x;
    this.y = a2.y - b.y;
    this.z = a2.z - b.z;
    return this;
  }
  multiply(v4, w) {
    if (w !== void 0) {
      console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead.");
      return this.multiplyVectors(v4, w);
    }
    this.x *= v4.x;
    this.y *= v4.y;
    this.z *= v4.z;
    return this;
  }
  multiplyScalar(scalar) {
    this.x *= scalar;
    this.y *= scalar;
    this.z *= scalar;
    return this;
  }
  multiplyVectors(a2, b) {
    this.x = a2.x * b.x;
    this.y = a2.y * b.y;
    this.z = a2.z * b.z;
    return this;
  }
  applyEuler(euler) {
    if (!(euler && euler.isEuler)) {
      console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order.");
    }
    return this.applyQuaternion(_quaternion$4.setFromEuler(euler));
  }
  applyAxisAngle(axis, angle) {
    return this.applyQuaternion(_quaternion$4.setFromAxisAngle(axis, angle));
  }
  applyMatrix3(m) {
    const x2 = this.x, y2 = this.y, z = this.z;
    const e3 = m.elements;
    this.x = e3[0] * x2 + e3[3] * y2 + e3[6] * z;
    this.y = e3[1] * x2 + e3[4] * y2 + e3[7] * z;
    this.z = e3[2] * x2 + e3[5] * y2 + e3[8] * z;
    return this;
  }
  applyNormalMatrix(m) {
    return this.applyMatrix3(m).normalize();
  }
  applyMatrix4(m) {
    const x2 = this.x, y2 = this.y, z = this.z;
    const e3 = m.elements;
    const w = 1 / (e3[3] * x2 + e3[7] * y2 + e3[11] * z + e3[15]);
    this.x = (e3[0] * x2 + e3[4] * y2 + e3[8] * z + e3[12]) * w;
    this.y = (e3[1] * x2 + e3[5] * y2 + e3[9] * z + e3[13]) * w;
    this.z = (e3[2] * x2 + e3[6] * y2 + e3[10] * z + e3[14]) * w;
    return this;
  }
  applyQuaternion(q) {
    const x2 = this.x, y2 = this.y, z = this.z;
    const qx = q.x, qy = q.y, qz = q.z, qw = q.w;
    const ix = qw * x2 + qy * z - qz * y2;
    const iy = qw * y2 + qz * x2 - qx * z;
    const iz = qw * z + qx * y2 - qy * x2;
    const iw = -qx * x2 - qy * y2 - qz * z;
    this.x = ix * qw + iw * -qx + iy * -qz - iz * -qy;
    this.y = iy * qw + iw * -qy + iz * -qx - ix * -qz;
    this.z = iz * qw + iw * -qz + ix * -qy - iy * -qx;
    return this;
  }
  project(camera) {
    return this.applyMatrix4(camera.matrixWorldInverse).applyMatrix4(camera.projectionMatrix);
  }
  unproject(camera) {
    return this.applyMatrix4(camera.projectionMatrixInverse).applyMatrix4(camera.matrixWorld);
  }
  transformDirection(m) {
    const x2 = this.x, y2 = this.y, z = this.z;
    const e3 = m.elements;
    this.x = e3[0] * x2 + e3[4] * y2 + e3[8] * z;
    this.y = e3[1] * x2 + e3[5] * y2 + e3[9] * z;
    this.z = e3[2] * x2 + e3[6] * y2 + e3[10] * z;
    return this.normalize();
  }
  divide(v4) {
    this.x /= v4.x;
    this.y /= v4.y;
    this.z /= v4.z;
    return this;
  }
  divideScalar(scalar) {
    return this.multiplyScalar(1 / scalar);
  }
  min(v4) {
    this.x = Math.min(this.x, v4.x);
    this.y = Math.min(this.y, v4.y);
    this.z = Math.min(this.z, v4.z);
    return this;
  }
  max(v4) {
    this.x = Math.max(this.x, v4.x);
    this.y = Math.max(this.y, v4.y);
    this.z = Math.max(this.z, v4.z);
    return this;
  }
  clamp(min3, max3) {
    this.x = Math.max(min3.x, Math.min(max3.x, this.x));
    this.y = Math.max(min3.y, Math.min(max3.y, this.y));
    this.z = Math.max(min3.z, Math.min(max3.z, this.z));
    return this;
  }
  clampScalar(minVal, maxVal) {
    this.x = Math.max(minVal, Math.min(maxVal, this.x));
    this.y = Math.max(minVal, Math.min(maxVal, this.y));
    this.z = Math.max(minVal, Math.min(maxVal, this.z));
    return this;
  }
  clampLength(min3, max3) {
    const length2 = this.length();
    return this.divideScalar(length2 || 1).multiplyScalar(Math.max(min3, Math.min(max3, length2)));
  }
  floor() {
    this.x = Math.floor(this.x);
    this.y = Math.floor(this.y);
    this.z = Math.floor(this.z);
    return this;
  }
  ceil() {
    this.x = Math.ceil(this.x);
    this.y = Math.ceil(this.y);
    this.z = Math.ceil(this.z);
    return this;
  }
  round() {
    this.x = Math.round(this.x);
    this.y = Math.round(this.y);
    this.z = Math.round(this.z);
    return this;
  }
  roundToZero() {
    this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x);
    this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y);
    this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z);
    return this;
  }
  negate() {
    this.x = -this.x;
    this.y = -this.y;
    this.z = -this.z;
    return this;
  }
  dot(v4) {
    return this.x * v4.x + this.y * v4.y + this.z * v4.z;
  }
  // TODO lengthSquared?
  lengthSq() {
    return this.x * this.x + this.y * this.y + this.z * this.z;
  }
  length() {
    return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z);
  }
  manhattanLength() {
    return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z);
  }
  normalize() {
    return this.divideScalar(this.length() || 1);
  }
  setLength(length2) {
    return this.normalize().multiplyScalar(length2);
  }
  lerp(v4, alpha3) {
    this.x += (v4.x - this.x) * alpha3;
    this.y += (v4.y - this.y) * alpha3;
    this.z += (v4.z - this.z) * alpha3;
    return this;
  }
  lerpVectors(v12, v22, alpha3) {
    this.x = v12.x + (v22.x - v12.x) * alpha3;
    this.y = v12.y + (v22.y - v12.y) * alpha3;
    this.z = v12.z + (v22.z - v12.z) * alpha3;
    return this;
  }
  cross(v4, w) {
    if (w !== void 0) {
      console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead.");
      return this.crossVectors(v4, w);
    }
    return this.crossVectors(this, v4);
  }
  crossVectors(a2, b) {
    const ax = a2.x, ay = a2.y, az = a2.z;
    const bx = b.x, by = b.y, bz = b.z;
    this.x = ay * bz - az * by;
    this.y = az * bx - ax * bz;
    this.z = ax * by - ay * bx;
    return this;
  }
  projectOnVector(v4) {
    const denominator = v4.lengthSq();
    if (denominator === 0)
      return this.set(0, 0, 0);
    const scalar = v4.dot(this) / denominator;
    return this.copy(v4).multiplyScalar(scalar);
  }
  projectOnPlane(planeNormal) {
    _vector$c.copy(this).projectOnVector(planeNormal);
    return this.sub(_vector$c);
  }
  reflect(normal) {
    return this.sub(_vector$c.copy(normal).multiplyScalar(2 * this.dot(normal)));
  }
  angleTo(v4) {
    const denominator = Math.sqrt(this.lengthSq() * v4.lengthSq());
    if (denominator === 0)
      return Math.PI / 2;
    const theta = this.dot(v4) / denominator;
    return Math.acos(clamp(theta, -1, 1));
  }
  distanceTo(v4) {
    return Math.sqrt(this.distanceToSquared(v4));
  }
  distanceToSquared(v4) {
    const dx = this.x - v4.x, dy = this.y - v4.y, dz = this.z - v4.z;
    return dx * dx + dy * dy + dz * dz;
  }
  manhattanDistanceTo(v4) {
    return Math.abs(this.x - v4.x) + Math.abs(this.y - v4.y) + Math.abs(this.z - v4.z);
  }
  setFromSpherical(s2) {
    return this.setFromSphericalCoords(s2.radius, s2.phi, s2.theta);
  }
  setFromSphericalCoords(radius, phi, theta) {
    const sinPhiRadius = Math.sin(phi) * radius;
    this.x = sinPhiRadius * Math.sin(theta);
    this.y = Math.cos(phi) * radius;
    this.z = sinPhiRadius * Math.cos(theta);
    return this;
  }
  setFromCylindrical(c4) {
    return this.setFromCylindricalCoords(c4.radius, c4.theta, c4.y);
  }
  setFromCylindricalCoords(radius, theta, y2) {
    this.x = radius * Math.sin(theta);
    this.y = y2;
    this.z = radius * Math.cos(theta);
    return this;
  }
  setFromMatrixPosition(m) {
    const e3 = m.elements;
    this.x = e3[12];
    this.y = e3[13];
    this.z = e3[14];
    return this;
  }
  setFromMatrixScale(m) {
    const sx = this.setFromMatrixColumn(m, 0).length();
    const sy = this.setFromMatrixColumn(m, 1).length();
    const sz = this.setFromMatrixColumn(m, 2).length();
    this.x = sx;
    this.y = sy;
    this.z = sz;
    return this;
  }
  setFromMatrixColumn(m, index) {
    return this.fromArray(m.elements, index * 4);
  }
  setFromMatrix3Column(m, index) {
    return this.fromArray(m.elements, index * 3);
  }
  setFromEuler(e3) {
    this.x = e3._x;
    this.y = e3._y;
    this.z = e3._z;
    return this;
  }
  equals(v4) {
    return v4.x === this.x && v4.y === this.y && v4.z === this.z;
  }
  fromArray(array, offset = 0) {
    this.x = array[offset];
    this.y = array[offset + 1];
    this.z = array[offset + 2];
    return this;
  }
  toArray(array = [], offset = 0) {
    array[offset] = this.x;
    array[offset + 1] = this.y;
    array[offset + 2] = this.z;
    return array;
  }
  fromBufferAttribute(attribute, index, offset) {
    if (offset !== void 0) {
      console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute().");
    }
    this.x = attribute.getX(index);
    this.y = attribute.getY(index);
    this.z = attribute.getZ(index);
    return this;
  }
  random() {
    this.x = Math.random();
    this.y = Math.random();
    this.z = Math.random();
    return this;
  }
  randomDirection() {
    const u = (Math.random() - 0.5) * 2;
    const t3 = Math.random() * Math.PI * 2;
    const f = Math.sqrt(1 - u ** 2);
    this.x = f * Math.cos(t3);
    this.y = f * Math.sin(t3);
    this.z = u;
    return this;
  }
  *[Symbol.iterator]() {
    yield this.x;
    yield this.y;
    yield this.z;
  }
};
Vector3.prototype.isVector3 = true;
var _vector$c = /* @__PURE__ */ new Vector3();
var _quaternion$4 = /* @__PURE__ */ new Quaternion();
var Box3 = class {
  constructor(min3 = new Vector3(Infinity, Infinity, Infinity), max3 = new Vector3(-Infinity, -Infinity, -Infinity)) {
    this.min = min3;
    this.max = max3;
  }
  set(min3, max3) {
    this.min.copy(min3);
    this.max.copy(max3);
    return this;
  }
  setFromArray(array) {
    let minX = Infinity;
    let minY = Infinity;
    let minZ = Infinity;
    let maxX = -Infinity;
    let maxY = -Infinity;
    let maxZ = -Infinity;
    for (let i2 = 0, l = array.length; i2 < l; i2 += 3) {
      const x2 = array[i2];
      const y2 = array[i2 + 1];
      const z = array[i2 + 2];
      if (x2 < minX)
        minX = x2;
      if (y2 < minY)
        minY = y2;
      if (z < minZ)
        minZ = z;
      if (x2 > maxX)
        maxX = x2;
      if (y2 > maxY)
        maxY = y2;
      if (z > maxZ)
        maxZ = z;
    }
    this.min.set(minX, minY, minZ);
    this.max.set(maxX, maxY, maxZ);
    return this;
  }
  setFromBufferAttribute(attribute) {
    let minX = Infinity;
    let minY = Infinity;
    let minZ = Infinity;
    let maxX = -Infinity;
    let maxY = -Infinity;
    let maxZ = -Infinity;
    for (let i2 = 0, l = attribute.count; i2 < l; i2++) {
      const x2 = attribute.getX(i2);
      const y2 = attribute.getY(i2);
      const z = attribute.getZ(i2);
      if (x2 < minX)
        minX = x2;
      if (y2 < minY)
        minY = y2;
      if (z < minZ)
        minZ = z;
      if (x2 > maxX)
        maxX = x2;
      if (y2 > maxY)
        maxY = y2;
      if (z > maxZ)
        maxZ = z;
    }
    this.min.set(minX, minY, minZ);
    this.max.set(maxX, maxY, maxZ);
    return this;
  }
  setFromPoints(points) {
    this.makeEmpty();
    for (let i2 = 0, il = points.length; i2 < il; i2++) {
      this.expandByPoint(points[i2]);
    }
    return this;
  }
  setFromCenterAndSize(center, size) {
    const halfSize = _vector$b.copy(size).multiplyScalar(0.5);
    this.min.copy(center).sub(halfSize);
    this.max.copy(center).add(halfSize);
    return this;
  }
  setFromObject(object, precise = false) {
    this.makeEmpty();
    return this.expandByObject(object, precise);
  }
  clone() {
    return new this.constructor().copy(this);
  }
  copy(box) {
    this.min.copy(box.min);
    this.max.copy(box.max);
    return this;
  }
  makeEmpty() {
    this.min.x = this.min.y = this.min.z = Infinity;
    this.max.x = this.max.y = this.max.z = -Infinity;
    return this;
  }
  isEmpty() {
    return this.max.x < this.min.x || this.max.y < this.min.y || this.max.z < this.min.z;
  }
  getCenter(target) {
    return this.isEmpty() ? target.set(0, 0, 0) : target.addVectors(this.min, this.max).multiplyScalar(0.5);
  }
  getSize(target) {
    return this.isEmpty() ? target.set(0, 0, 0) : target.subVectors(this.max, this.min);
  }
  expandByPoint(point4) {
    this.min.min(point4);
    this.max.max(point4);
    return this;
  }
  expandByVector(vector) {
    this.min.sub(vector);
    this.max.add(vector);
    return this;
  }
  expandByScalar(scalar) {
    this.min.addScalar(-scalar);
    this.max.addScalar(scalar);
    return this;
  }
  expandByObject(object, precise = false) {
    object.updateWorldMatrix(false, false);
    const geometry = object.geometry;
    if (geometry !== void 0) {
      if (precise && geometry.attributes != void 0 && geometry.attributes.position !== void 0) {
        const position2 = geometry.attributes.position;
        for (let i2 = 0, l = position2.count; i2 < l; i2++) {
          _vector$b.fromBufferAttribute(position2, i2).applyMatrix4(object.matrixWorld);
          this.expandByPoint(_vector$b);
        }
      } else {
        if (geometry.boundingBox === null) {
          geometry.computeBoundingBox();
        }
        _box$3.copy(geometry.boundingBox);
        _box$3.applyMatrix4(object.matrixWorld);
        this.union(_box$3);
      }
    }
    const children = object.children;
    for (let i2 = 0, l = children.length; i2 < l; i2++) {
      this.expandByObject(children[i2], precise);
    }
    return this;
  }
  containsPoint(point4) {
    return point4.x < this.min.x || point4.x > this.max.x || point4.y < this.min.y || point4.y > this.max.y || point4.z < this.min.z || point4.z > this.max.z ? false : true;
  }
  containsBox(box) {
    return this.min.x <= box.min.x && box.max.x <= this.max.x && this.min.y <= box.min.y && box.max.y <= this.max.y && this.min.z <= box.min.z && box.max.z <= this.max.z;
  }
  getParameter(point4, target) {
    return target.set(
      (point4.x - this.min.x) / (this.max.x - this.min.x),
      (point4.y - this.min.y) / (this.max.y - this.min.y),
      (point4.z - this.min.z) / (this.max.z - this.min.z)
    );
  }
  intersectsBox(box) {
    return box.max.x < this.min.x || box.min.x > this.max.x || box.max.y < this.min.y || box.min.y > this.max.y || box.max.z < this.min.z || box.min.z > this.max.z ? false : true;
  }
  intersectsSphere(sphere) {
    this.clampPoint(sphere.center, _vector$b);
    return _vector$b.distanceToSquared(sphere.center) <= sphere.radius * sphere.radius;
  }
  intersectsPlane(plane) {
    let min3, max3;
    if (plane.normal.x > 0) {
      min3 = plane.normal.x * this.min.x;
      max3 = plane.normal.x * this.max.x;
    } else {
      min3 = plane.normal.x * this.max.x;
      max3 = plane.normal.x * this.min.x;
    }
    if (plane.normal.y > 0) {
      min3 += plane.normal.y * this.min.y;
      max3 += plane.normal.y * this.max.y;
    } else {
      min3 += plane.normal.y * this.max.y;
      max3 += plane.normal.y * this.min.y;
    }
    if (plane.normal.z > 0) {
      min3 += plane.normal.z * this.min.z;
      max3 += plane.normal.z * this.max.z;
    } else {
      min3 += plane.normal.z * this.max.z;
      max3 += plane.normal.z * this.min.z;
    }
    return min3 <= -plane.constant && max3 >= -plane.constant;
  }
  intersectsTriangle(triangle) {
    if (this.isEmpty()) {
      return false;
    }
    this.getCenter(_center);
    _extents.subVectors(this.max, _center);
    _v0$2.subVectors(triangle.a, _center);
    _v1$7.subVectors(triangle.b, _center);
    _v2$3.subVectors(triangle.c, _center);
    _f0.subVectors(_v1$7, _v0$2);
    _f1.subVectors(_v2$3, _v1$7);
    _f2.subVectors(_v0$2, _v2$3);
    let axes = [
      0,
      -_f0.z,
      _f0.y,
      0,
      -_f1.z,
      _f1.y,
      0,
      -_f2.z,
      _f2.y,
      _f0.z,
      0,
      -_f0.x,
      _f1.z,
      0,
      -_f1.x,
      _f2.z,
      0,
      -_f2.x,
      -_f0.y,
      _f0.x,
      0,
      -_f1.y,
      _f1.x,
      0,
      -_f2.y,
      _f2.x,
      0
    ];
    if (!satForAxes(axes, _v0$2, _v1$7, _v2$3, _extents)) {
      return false;
    }
    axes = [1, 0, 0, 0, 1, 0, 0, 0, 1];
    if (!satForAxes(axes, _v0$2, _v1$7, _v2$3, _extents)) {
      return false;
    }
    _triangleNormal.crossVectors(_f0, _f1);
    axes = [_triangleNormal.x, _triangleNormal.y, _triangleNormal.z];
    return satForAxes(axes, _v0$2, _v1$7, _v2$3, _extents);
  }
  clampPoint(point4, target) {
    return target.copy(point4).clamp(this.min, this.max);
  }
  distanceToPoint(point4) {
    const clampedPoint = _vector$b.copy(point4).clamp(this.min, this.max);
    return clampedPoint.sub(point4).length();
  }
  getBoundingSphere(target) {
    this.getCenter(target.center);
    target.radius = this.getSize(_vector$b).length() * 0.5;
    return target;
  }
  intersect(box) {
    this.min.max(box.min);
    this.max.min(box.max);
    if (this.isEmpty())
      this.makeEmpty();
    return this;
  }
  union(box) {
    this.min.min(box.min);
    this.max.max(box.max);
    return this;
  }
  applyMatrix4(matrix) {
    if (this.isEmpty())
      return this;
    _points[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(matrix);
    _points[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(matrix);
    _points[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(matrix);
    _points[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(matrix);
    _points[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(matrix);
    _points[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(matrix);
    _points[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(matrix);
    _points[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(matrix);
    this.setFromPoints(_points);
    return this;
  }
  translate(offset) {
    this.min.add(offset);
    this.max.add(offset);
    return this;
  }
  equals(box) {
    return box.min.equals(this.min) && box.max.equals(this.max);
  }
};
Box3.prototype.isBox3 = true;
var _points = [
  /* @__PURE__ */ new Vector3(),
  /* @__PURE__ */ new Vector3(),
  /* @__PURE__ */ new Vector3(),
  /* @__PURE__ */ new Vector3(),
  /* @__PURE__ */ new Vector3(),
  /* @__PURE__ */ new Vector3(),
  /* @__PURE__ */ new Vector3(),
  /* @__PURE__ */ new Vector3()
];
var _vector$b = /* @__PURE__ */ new Vector3();
var _box$3 = /* @__PURE__ */ new Box3();
var _v0$2 = /* @__PURE__ */ new Vector3();
var _v1$7 = /* @__PURE__ */ new Vector3();
var _v2$3 = /* @__PURE__ */ new Vector3();
var _f0 = /* @__PURE__ */ new Vector3();
var _f1 = /* @__PURE__ */ new Vector3();
var _f2 = /* @__PURE__ */ new Vector3();
var _center = /* @__PURE__ */ new Vector3();
var _extents = /* @__PURE__ */ new Vector3();
var _triangleNormal = /* @__PURE__ */ new Vector3();
var _testAxis = /* @__PURE__ */ new Vector3();
function satForAxes(axes, v0, v12, v22, extents) {
  for (let i2 = 0, j = axes.length - 3; i2 <= j; i2 += 3) {
    _testAxis.fromArray(axes, i2);
    const r3 = extents.x * Math.abs(_testAxis.x) + extents.y * Math.abs(_testAxis.y) + extents.z * Math.abs(_testAxis.z);
    const p0 = v0.dot(_testAxis);
    const p1 = v12.dot(_testAxis);
    const p2 = v22.dot(_testAxis);
    if (Math.max(-Math.max(p0, p1, p2), Math.min(p0, p1, p2)) > r3) {
      return false;
    }
  }
  return true;
}
var _box$2 = /* @__PURE__ */ new Box3();
var _v1$6 = /* @__PURE__ */ new Vector3();
var _toFarthestPoint = /* @__PURE__ */ new Vector3();
var _toPoint = /* @__PURE__ */ new Vector3();
var Sphere = class {
  constructor(center = new Vector3(), radius = -1) {
    this.center = center;
    this.radius = radius;
  }
  set(center, radius) {
    this.center.copy(center);
    this.radius = radius;
    return this;
  }
  setFromPoints(points, optionalCenter) {
    const center = this.center;
    if (optionalCenter !== void 0) {
      center.copy(optionalCenter);
    } else {
      _box$2.setFromPoints(points).getCenter(center);
    }
    let maxRadiusSq = 0;
    for (let i2 = 0, il = points.length; i2 < il; i2++) {
      maxRadiusSq = Math.max(maxRadiusSq, center.distanceToSquared(points[i2]));
    }
    this.radius = Math.sqrt(maxRadiusSq);
    return this;
  }
  copy(sphere) {
    this.center.copy(sphere.center);
    this.radius = sphere.radius;
    return this;
  }
  isEmpty() {
    return this.radius < 0;
  }
  makeEmpty() {
    this.center.set(0, 0, 0);
    this.radius = -1;
    return this;
  }
  containsPoint(point4) {
    return point4.distanceToSquared(this.center) <= this.radius * this.radius;
  }
  distanceToPoint(point4) {
    return point4.distanceTo(this.center) - this.radius;
  }
  intersectsSphere(sphere) {
    const radiusSum = this.radius + sphere.radius;
    return sphere.center.distanceToSquared(this.center) <= radiusSum * radiusSum;
  }
  intersectsBox(box) {
    return box.intersectsSphere(this);
  }
  intersectsPlane(plane) {
    return Math.abs(plane.distanceToPoint(this.center)) <= this.radius;
  }
  clampPoint(point4, target) {
    const deltaLengthSq = this.center.distanceToSquared(point4);
    target.copy(point4);
    if (deltaLengthSq > this.radius * this.radius) {
      target.sub(this.center).normalize();
      target.multiplyScalar(this.radius).add(this.center);
    }
    return target;
  }
  getBoundingBox(target) {
    if (this.isEmpty()) {
      target.makeEmpty();
      return target;
    }
    target.set(this.center, this.center);
    target.expandByScalar(this.radius);
    return target;
  }
  applyMatrix4(matrix) {
    this.center.applyMatrix4(matrix);
    this.radius = this.radius * matrix.getMaxScaleOnAxis();
    return this;
  }
  translate(offset) {
    this.center.add(offset);
    return this;
  }
  expandByPoint(point4) {
    _toPoint.subVectors(point4, this.center);
    const lengthSq = _toPoint.lengthSq();
    if (lengthSq > this.radius * this.radius) {
      const length2 = Math.sqrt(lengthSq);
      const missingRadiusHalf = (length2 - this.radius) * 0.5;
      this.center.add(_toPoint.multiplyScalar(missingRadiusHalf / length2));
      this.radius += missingRadiusHalf;
    }
    return this;
  }
  union(sphere) {
    if (this.center.equals(sphere.center) === true) {
      _toFarthestPoint.set(0, 0, 1).multiplyScalar(sphere.radius);
    } else {
      _toFarthestPoint.subVectors(sphere.center, this.center).normalize().multiplyScalar(sphere.radius);
    }
    this.expandByPoint(_v1$6.copy(sphere.center).add(_toFarthestPoint));
    this.expandByPoint(_v1$6.copy(sphere.center).sub(_toFarthestPoint));
    return this;
  }
  equals(sphere) {
    return sphere.center.equals(this.center) && sphere.radius === this.radius;
  }
  clone() {
    return new this.constructor().copy(this);
  }
};
var _vector$a = /* @__PURE__ */ new Vector3();
var _segCenter = /* @__PURE__ */ new Vector3();
var _segDir = /* @__PURE__ */ new Vector3();
var _diff = /* @__PURE__ */ new Vector3();
var _edge1 = /* @__PURE__ */ new Vector3();
var _edge2 = /* @__PURE__ */ new Vector3();
var _normal$1 = /* @__PURE__ */ new Vector3();
var Ray = class {
  constructor(origin = new Vector3(), direction = new Vector3(0, 0, -1)) {
    this.origin = origin;
    this.direction = direction;
  }
  set(origin, direction) {
    this.origin.copy(origin);
    this.direction.copy(direction);
    return this;
  }
  copy(ray) {
    this.origin.copy(ray.origin);
    this.direction.copy(ray.direction);
    return this;
  }
  at(t3, target) {
    return target.copy(this.direction).multiplyScalar(t3).add(this.origin);
  }
  lookAt(v4) {
    this.direction.copy(v4).sub(this.origin).normalize();
    return this;
  }
  recast(t3) {
    this.origin.copy(this.at(t3, _vector$a));
    return this;
  }
  closestPointToPoint(point4, target) {
    target.subVectors(point4, this.origin);
    const directionDistance = target.dot(this.direction);
    if (directionDistance < 0) {
      return target.copy(this.origin);
    }
    return target.copy(this.direction).multiplyScalar(directionDistance).add(this.origin);
  }
  distanceToPoint(point4) {
    return Math.sqrt(this.distanceSqToPoint(point4));
  }
  distanceSqToPoint(point4) {
    const directionDistance = _vector$a.subVectors(point4, this.origin).dot(this.direction);
    if (directionDistance < 0) {
      return this.origin.distanceToSquared(point4);
    }
    _vector$a.copy(this.direction).multiplyScalar(directionDistance).add(this.origin);
    return _vector$a.distanceToSquared(point4);
  }
  distanceSqToSegment(v0, v12, optionalPointOnRay, optionalPointOnSegment) {
    _segCenter.copy(v0).add(v12).multiplyScalar(0.5);
    _segDir.copy(v12).sub(v0).normalize();
    _diff.copy(this.origin).sub(_segCenter);
    const segExtent = v0.distanceTo(v12) * 0.5;
    const a01 = -this.direction.dot(_segDir);
    const b0 = _diff.dot(this.direction);
    const b1 = -_diff.dot(_segDir);
    const c4 = _diff.lengthSq();
    const det = Math.abs(1 - a01 * a01);
    let s0, s1, sqrDist, extDet;
    if (det > 0) {
      s0 = a01 * b1 - b0;
      s1 = a01 * b0 - b1;
      extDet = segExtent * det;
      if (s0 >= 0) {
        if (s1 >= -extDet) {
          if (s1 <= extDet) {
            const invDet = 1 / det;
            s0 *= invDet;
            s1 *= invDet;
            sqrDist = s0 * (s0 + a01 * s1 + 2 * b0) + s1 * (a01 * s0 + s1 + 2 * b1) + c4;
          } else {
            s1 = segExtent;
            s0 = Math.max(0, -(a01 * s1 + b0));
            sqrDist = -s0 * s0 + s1 * (s1 + 2 * b1) + c4;
          }
        } else {
          s1 = -segExtent;
          s0 = Math.max(0, -(a01 * s1 + b0));
          sqrDist = -s0 * s0 + s1 * (s1 + 2 * b1) + c4;
        }
      } else {
        if (s1 <= -extDet) {
          s0 = Math.max(0, -(-a01 * segExtent + b0));
          s1 = s0 > 0 ? -segExtent : Math.min(Math.max(-segExtent, -b1), segExtent);
          sqrDist = -s0 * s0 + s1 * (s1 + 2 * b1) + c4;
        } else if (s1 <= extDet) {
          s0 = 0;
          s1 = Math.min(Math.max(-segExtent, -b1), segExtent);
          sqrDist = s1 * (s1 + 2 * b1) + c4;
        } else {
          s0 = Math.max(0, -(a01 * segExtent + b0));
          s1 = s0 > 0 ? segExtent : Math.min(Math.max(-segExtent, -b1), segExtent);
          sqrDist = -s0 * s0 + s1 * (s1 + 2 * b1) + c4;
        }
      }
    } else {
      s1 = a01 > 0 ? -segExtent : segExtent;
      s0 = Math.max(0, -(a01 * s1 + b0));
      sqrDist = -s0 * s0 + s1 * (s1 + 2 * b1) + c4;
    }
    if (optionalPointOnRay) {
      optionalPointOnRay.copy(this.direction).multiplyScalar(s0).add(this.origin);
    }
    if (optionalPointOnSegment) {
      optionalPointOnSegment.copy(_segDir).multiplyScalar(s1).add(_segCenter);
    }
    return sqrDist;
  }
  intersectSphere(sphere, target) {
    _vector$a.subVectors(sphere.center, this.origin);
    const tca = _vector$a.dot(this.direction);
    const d2 = _vector$a.dot(_vector$a) - tca * tca;
    const radius2 = sphere.radius * sphere.radius;
    if (d2 > radius2)
      return null;
    const thc = Math.sqrt(radius2 - d2);
    const t02 = tca - thc;
    const t12 = tca + thc;
    if (t02 < 0 && t12 < 0)
      return null;
    if (t02 < 0)
      return this.at(t12, target);
    return this.at(t02, target);
  }
  intersectsSphere(sphere) {
    return this.distanceSqToPoint(sphere.center) <= sphere.radius * sphere.radius;
  }
  distanceToPlane(plane) {
    const denominator = plane.normal.dot(this.direction);
    if (denominator === 0) {
      if (plane.distanceToPoint(this.origin) === 0) {
        return 0;
      }
      return null;
    }
    const t3 = -(this.origin.dot(plane.normal) + plane.constant) / denominator;
    return t3 >= 0 ? t3 : null;
  }
  intersectPlane(plane, target) {
    const t3 = this.distanceToPlane(plane);
    if (t3 === null) {
      return null;
    }
    return this.at(t3, target);
  }
  intersectsPlane(plane) {
    const distToPoint = plane.distanceToPoint(this.origin);
    if (distToPoint === 0) {
      return true;
    }
    const denominator = plane.normal.dot(this.direction);
    if (denominator * distToPoint < 0) {
      return true;
    }
    return false;
  }
  intersectBox(box, target) {
    let tmin, tmax, tymin, tymax, tzmin, tzmax;
    const invdirx = 1 / this.direction.x, invdiry = 1 / this.direction.y, invdirz = 1 / this.direction.z;
    const origin = this.origin;
    if (invdirx >= 0) {
      tmin = (box.min.x - origin.x) * invdirx;
      tmax = (box.max.x - origin.x) * invdirx;
    } else {
      tmin = (box.max.x - origin.x) * invdirx;
      tmax = (box.min.x - origin.x) * invdirx;
    }
    if (invdiry >= 0) {
      tymin = (box.min.y - origin.y) * invdiry;
      tymax = (box.max.y - origin.y) * invdiry;
    } else {
      tymin = (box.max.y - origin.y) * invdiry;
      tymax = (box.min.y - origin.y) * invdiry;
    }
    if (tmin > tymax || tymin > tmax)
      return null;
    if (tymin > tmin || tmin !== tmin)
      tmin = tymin;
    if (tymax < tmax || tmax !== tmax)
      tmax = tymax;
    if (invdirz >= 0) {
      tzmin = (box.min.z - origin.z) * invdirz;
      tzmax = (box.max.z - origin.z) * invdirz;
    } else {
      tzmin = (box.max.z - origin.z) * invdirz;
      tzmax = (box.min.z - origin.z) * invdirz;
    }
    if (tmin > tzmax || tzmin > tmax)
      return null;
    if (tzmin > tmin || tmin !== tmin)
      tmin = tzmin;
    if (tzmax < tmax || tmax !== tmax)
      tmax = tzmax;
    if (tmax < 0)
      return null;
    return this.at(tmin >= 0 ? tmin : tmax, target);
  }
  intersectsBox(box) {
    return this.intersectBox(box, _vector$a) !== null;
  }
  intersectTriangle(a2, b, c4, backfaceCulling, target) {
    _edge1.subVectors(b, a2);
    _edge2.subVectors(c4, a2);
    _normal$1.crossVectors(_edge1, _edge2);
    let DdN = this.direction.dot(_normal$1);
    let sign3;
    if (DdN > 0) {
      if (backfaceCulling)
        return null;
      sign3 = 1;
    } else if (DdN < 0) {
      sign3 = -1;
      DdN = -DdN;
    } else {
      return null;
    }
    _diff.subVectors(this.origin, a2);
    const DdQxE2 = sign3 * this.direction.dot(_edge2.crossVectors(_diff, _edge2));
    if (DdQxE2 < 0) {
      return null;
    }
    const DdE1xQ = sign3 * this.direction.dot(_edge1.cross(_diff));
    if (DdE1xQ < 0) {
      return null;
    }
    if (DdQxE2 + DdE1xQ > DdN) {
      return null;
    }
    const QdN = -sign3 * _diff.dot(_normal$1);
    if (QdN < 0) {
      return null;
    }
    return this.at(QdN / DdN, target);
  }
  applyMatrix4(matrix4) {
    this.origin.applyMatrix4(matrix4);
    this.direction.transformDirection(matrix4);
    return this;
  }
  equals(ray) {
    return ray.origin.equals(this.origin) && ray.direction.equals(this.direction);
  }
  clone() {
    return new this.constructor().copy(this);
  }
};
var Matrix4 = class _Matrix4 {
  constructor() {
    this.elements = [
      1,
      0,
      0,
      0,
      0,
      1,
      0,
      0,
      0,
      0,
      1,
      0,
      0,
      0,
      0,
      1
    ];
    if (arguments.length > 0) {
      console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.");
    }
  }
  set(n11, n12, n13, n14, n21, n22, n23, n24, n31, n32, n33, n34, n41, n42, n43, n44) {
    const te = this.elements;
    te[0] = n11;
    te[4] = n12;
    te[8] = n13;
    te[12] = n14;
    te[1] = n21;
    te[5] = n22;
    te[9] = n23;
    te[13] = n24;
    te[2] = n31;
    te[6] = n32;
    te[10] = n33;
    te[14] = n34;
    te[3] = n41;
    te[7] = n42;
    te[11] = n43;
    te[15] = n44;
    return this;
  }
  identity() {
    this.set(
      1,
      0,
      0,
      0,
      0,
      1,
      0,
      0,
      0,
      0,
      1,
      0,
      0,
      0,
      0,
      1
    );
    return this;
  }
  clone() {
    return new _Matrix4().fromArray(this.elements);
  }
  copy(m) {
    const te = this.elements;
    const me = m.elements;
    te[0] = me[0];
    te[1] = me[1];
    te[2] = me[2];
    te[3] = me[3];
    te[4] = me[4];
    te[5] = me[5];
    te[6] = me[6];
    te[7] = me[7];
    te[8] = me[8];
    te[9] = me[9];
    te[10] = me[10];
    te[11] = me[11];
    te[12] = me[12];
    te[13] = me[13];
    te[14] = me[14];
    te[15] = me[15];
    return this;
  }
  copyPosition(m) {
    const te = this.elements, me = m.elements;
    te[12] = me[12];
    te[13] = me[13];
    te[14] = me[14];
    return this;
  }
  setFromMatrix3(m) {
    const me = m.elements;
    this.set(
      me[0],
      me[3],
      me[6],
      0,
      me[1],
      me[4],
      me[7],
      0,
      me[2],
      me[5],
      me[8],
      0,
      0,
      0,
      0,
      1
    );
    return this;
  }
  extractBasis(xAxis, yAxis, zAxis) {
    xAxis.setFromMatrixColumn(this, 0);
    yAxis.setFromMatrixColumn(this, 1);
    zAxis.setFromMatrixColumn(this, 2);
    return this;
  }
  makeBasis(xAxis, yAxis, zAxis) {
    this.set(
      xAxis.x,
      yAxis.x,
      zAxis.x,
      0,
      xAxis.y,
      yAxis.y,
      zAxis.y,
      0,
      xAxis.z,
      yAxis.z,
      zAxis.z,
      0,
      0,
      0,
      0,
      1
    );
    return this;
  }
  extractRotation(m) {
    const te = this.elements;
    const me = m.elements;
    const scaleX = 1 / _v1$5.setFromMatrixColumn(m, 0).length();
    const scaleY = 1 / _v1$5.setFromMatrixColumn(m, 1).length();
    const scaleZ = 1 / _v1$5.setFromMatrixColumn(m, 2).length();
    te[0] = me[0] * scaleX;
    te[1] = me[1] * scaleX;
    te[2] = me[2] * scaleX;
    te[3] = 0;
    te[4] = me[4] * scaleY;
    te[5] = me[5] * scaleY;
    te[6] = me[6] * scaleY;
    te[7] = 0;
    te[8] = me[8] * scaleZ;
    te[9] = me[9] * scaleZ;
    te[10] = me[10] * scaleZ;
    te[11] = 0;
    te[12] = 0;
    te[13] = 0;
    te[14] = 0;
    te[15] = 1;
    return this;
  }
  makeRotationFromEuler(euler) {
    if (!(euler && euler.isEuler)) {
      console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
    }
    const te = this.elements;
    const x2 = euler.x, y2 = euler.y, z = euler.z;
    const a2 = Math.cos(x2), b = Math.sin(x2);
    const c4 = Math.cos(y2), d = Math.sin(y2);
    const e3 = Math.cos(z), f = Math.sin(z);
    if (euler.order === "XYZ") {
      const ae = a2 * e3, af = a2 * f, be = b * e3, bf = b * f;
      te[0] = c4 * e3;
      te[4] = -c4 * f;
      te[8] = d;
      te[1] = af + be * d;
      te[5] = ae - bf * d;
      te[9] = -b * c4;
      te[2] = bf - ae * d;
      te[6] = be + af * d;
      te[10] = a2 * c4;
    } else if (euler.order === "YXZ") {
      const ce = c4 * e3, cf = c4 * f, de = d * e3, df = d * f;
      te[0] = ce + df * b;
      te[4] = de * b - cf;
      te[8] = a2 * d;
      te[1] = a2 * f;
      te[5] = a2 * e3;
      te[9] = -b;
      te[2] = cf * b - de;
      te[6] = df + ce * b;
      te[10] = a2 * c4;
    } else if (euler.order === "ZXY") {
      const ce = c4 * e3, cf = c4 * f, de = d * e3, df = d * f;
      te[0] = ce - df * b;
      te[4] = -a2 * f;
      te[8] = de + cf * b;
      te[1] = cf + de * b;
      te[5] = a2 * e3;
      te[9] = df - ce * b;
      te[2] = -a2 * d;
      te[6] = b;
      te[10] = a2 * c4;
    } else if (euler.order === "ZYX") {
      const ae = a2 * e3, af = a2 * f, be = b * e3, bf = b * f;
      te[0] = c4 * e3;
      te[4] = be * d - af;
      te[8] = ae * d + bf;
      te[1] = c4 * f;
      te[5] = bf * d + ae;
      te[9] = af * d - be;
      te[2] = -d;
      te[6] = b * c4;
      te[10] = a2 * c4;
    } else if (euler.order === "YZX") {
      const ac = a2 * c4, ad = a2 * d, bc = b * c4, bd = b * d;
      te[0] = c4 * e3;
      te[4] = bd - ac * f;
      te[8] = bc * f + ad;
      te[1] = f;
      te[5] = a2 * e3;
      te[9] = -b * e3;
      te[2] = -d * e3;
      te[6] = ad * f + bc;
      te[10] = ac - bd * f;
    } else if (euler.order === "XZY") {
      const ac = a2 * c4, ad = a2 * d, bc = b * c4, bd = b * d;
      te[0] = c4 * e3;
      te[4] = -f;
      te[8] = d * e3;
      te[1] = ac * f + bd;
      te[5] = a2 * e3;
      te[9] = ad * f - bc;
      te[2] = bc * f - ad;
      te[6] = b * e3;
      te[10] = bd * f + ac;
    }
    te[3] = 0;
    te[7] = 0;
    te[11] = 0;
    te[12] = 0;
    te[13] = 0;
    te[14] = 0;
    te[15] = 1;
    return this;
  }
  makeRotationFromQuaternion(q) {
    return this.compose(_zero, q, _one);
  }
  lookAt(eye, target, up) {
    const te = this.elements;
    _z.subVectors(eye, target);
    if (_z.lengthSq() === 0) {
      _z.z = 1;
    }
    _z.normalize();
    _x.crossVectors(up, _z);
    if (_x.lengthSq() === 0) {
      if (Math.abs(up.z) === 1) {
        _z.x += 1e-4;
      } else {
        _z.z += 1e-4;
      }
      _z.normalize();
      _x.crossVectors(up, _z);
    }
    _x.normalize();
    _y.crossVectors(_z, _x);
    te[0] = _x.x;
    te[4] = _y.x;
    te[8] = _z.x;
    te[1] = _x.y;
    te[5] = _y.y;
    te[9] = _z.y;
    te[2] = _x.z;
    te[6] = _y.z;
    te[10] = _z.z;
    return this;
  }
  multiply(m, n2) {
    if (n2 !== void 0) {
      console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead.");
      return this.multiplyMatrices(m, n2);
    }
    return this.multiplyMatrices(this, m);
  }
  premultiply(m) {
    return this.multiplyMatrices(m, this);
  }
  multiplyMatrices(a2, b) {
    const ae = a2.elements;
    const be = b.elements;
    const te = this.elements;
    const a11 = ae[0], a12 = ae[4], a13 = ae[8], a14 = ae[12];
    const a21 = ae[1], a22 = ae[5], a23 = ae[9], a24 = ae[13];
    const a31 = ae[2], a32 = ae[6], a33 = ae[10], a34 = ae[14];
    const a41 = ae[3], a42 = ae[7], a43 = ae[11], a44 = ae[15];
    const b11 = be[0], b12 = be[4], b13 = be[8], b14 = be[12];
    const b21 = be[1], b22 = be[5], b23 = be[9], b24 = be[13];
    const b31 = be[2], b32 = be[6], b33 = be[10], b34 = be[14];
    const b41 = be[3], b42 = be[7], b43 = be[11], b44 = be[15];
    te[0] = a11 * b11 + a12 * b21 + a13 * b31 + a14 * b41;
    te[4] = a11 * b12 + a12 * b22 + a13 * b32 + a14 * b42;
    te[8] = a11 * b13 + a12 * b23 + a13 * b33 + a14 * b43;
    te[12] = a11 * b14 + a12 * b24 + a13 * b34 + a14 * b44;
    te[1] = a21 * b11 + a22 * b21 + a23 * b31 + a24 * b41;
    te[5] = a21 * b12 + a22 * b22 + a23 * b32 + a24 * b42;
    te[9] = a21 * b13 + a22 * b23 + a23 * b33 + a24 * b43;
    te[13] = a21 * b14 + a22 * b24 + a23 * b34 + a24 * b44;
    te[2] = a31 * b11 + a32 * b21 + a33 * b31 + a34 * b41;
    te[6] = a31 * b12 + a32 * b22 + a33 * b32 + a34 * b42;
    te[10] = a31 * b13 + a32 * b23 + a33 * b33 + a34 * b43;
    te[14] = a31 * b14 + a32 * b24 + a33 * b34 + a34 * b44;
    te[3] = a41 * b11 + a42 * b21 + a43 * b31 + a44 * b41;
    te[7] = a41 * b12 + a42 * b22 + a43 * b32 + a44 * b42;
    te[11] = a41 * b13 + a42 * b23 + a43 * b33 + a44 * b43;
    te[15] = a41 * b14 + a42 * b24 + a43 * b34 + a44 * b44;
    return this;
  }
  multiplyScalar(s2) {
    const te = this.elements;
    te[0] *= s2;
    te[4] *= s2;
    te[8] *= s2;
    te[12] *= s2;
    te[1] *= s2;
    te[5] *= s2;
    te[9] *= s2;
    te[13] *= s2;
    te[2] *= s2;
    te[6] *= s2;
    te[10] *= s2;
    te[14] *= s2;
    te[3] *= s2;
    te[7] *= s2;
    te[11] *= s2;
    te[15] *= s2;
    return this;
  }
  determinant() {
    const te = this.elements;
    const n11 = te[0], n12 = te[4], n13 = te[8], n14 = te[12];
    const n21 = te[1], n22 = te[5], n23 = te[9], n24 = te[13];
    const n31 = te[2], n32 = te[6], n33 = te[10], n34 = te[14];
    const n41 = te[3], n42 = te[7], n43 = te[11], n44 = te[15];
    return n41 * (+n14 * n23 * n32 - n13 * n24 * n32 - n14 * n22 * n33 + n12 * n24 * n33 + n13 * n22 * n34 - n12 * n23 * n34) + n42 * (+n11 * n23 * n34 - n11 * n24 * n33 + n14 * n21 * n33 - n13 * n21 * n34 + n13 * n24 * n31 - n14 * n23 * n31) + n43 * (+n11 * n24 * n32 - n11 * n22 * n34 - n14 * n21 * n32 + n12 * n21 * n34 + n14 * n22 * n31 - n12 * n24 * n31) + n44 * (-n13 * n22 * n31 - n11 * n23 * n32 + n11 * n22 * n33 + n13 * n21 * n32 - n12 * n21 * n33 + n12 * n23 * n31);
  }
  transpose() {
    const te = this.elements;
    let tmp2;
    tmp2 = te[1];
    te[1] = te[4];
    te[4] = tmp2;
    tmp2 = te[2];
    te[2] = te[8];
    te[8] = tmp2;
    tmp2 = te[6];
    te[6] = te[9];
    te[9] = tmp2;
    tmp2 = te[3];
    te[3] = te[12];
    te[12] = tmp2;
    tmp2 = te[7];
    te[7] = te[13];
    te[13] = tmp2;
    tmp2 = te[11];
    te[11] = te[14];
    te[14] = tmp2;
    return this;
  }
  setPosition(x2, y2, z) {
    const te = this.elements;
    if (x2.isVector3) {
      te[12] = x2.x;
      te[13] = x2.y;
      te[14] = x2.z;
    } else {
      te[12] = x2;
      te[13] = y2;
      te[14] = z;
    }
    return this;
  }
  invert() {
    const te = this.elements, n11 = te[0], n21 = te[1], n31 = te[2], n41 = te[3], n12 = te[4], n22 = te[5], n32 = te[6], n42 = te[7], n13 = te[8], n23 = te[9], n33 = te[10], n43 = te[11], n14 = te[12], n24 = te[13], n34 = te[14], n44 = te[15], t11 = n23 * n34 * n42 - n24 * n33 * n42 + n24 * n32 * n43 - n22 * n34 * n43 - n23 * n32 * n44 + n22 * n33 * n44, t12 = n14 * n33 * n42 - n13 * n34 * n42 - n14 * n32 * n43 + n12 * n34 * n43 + n13 * n32 * n44 - n12 * n33 * n44, t13 = n13 * n24 * n42 - n14 * n23 * n42 + n14 * n22 * n43 - n12 * n24 * n43 - n13 * n22 * n44 + n12 * n23 * n44, t14 = n14 * n23 * n32 - n13 * n24 * n32 - n14 * n22 * n33 + n12 * n24 * n33 + n13 * n22 * n34 - n12 * n23 * n34;
    const det = n11 * t11 + n21 * t12 + n31 * t13 + n41 * t14;
    if (det === 0)
      return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
    const detInv = 1 / det;
    te[0] = t11 * detInv;
    te[1] = (n24 * n33 * n41 - n23 * n34 * n41 - n24 * n31 * n43 + n21 * n34 * n43 + n23 * n31 * n44 - n21 * n33 * n44) * detInv;
    te[2] = (n22 * n34 * n41 - n24 * n32 * n41 + n24 * n31 * n42 - n21 * n34 * n42 - n22 * n31 * n44 + n21 * n32 * n44) * detInv;
    te[3] = (n23 * n32 * n41 - n22 * n33 * n41 - n23 * n31 * n42 + n21 * n33 * n42 + n22 * n31 * n43 - n21 * n32 * n43) * detInv;
    te[4] = t12 * detInv;
    te[5] = (n13 * n34 * n41 - n14 * n33 * n41 + n14 * n31 * n43 - n11 * n34 * n43 - n13 * n31 * n44 + n11 * n33 * n44) * detInv;
    te[6] = (n14 * n32 * n41 - n12 * n34 * n41 - n14 * n31 * n42 + n11 * n34 * n42 + n12 * n31 * n44 - n11 * n32 * n44) * detInv;
    te[7] = (n12 * n33 * n41 - n13 * n32 * n41 + n13 * n31 * n42 - n11 * n33 * n42 - n12 * n31 * n43 + n11 * n32 * n43) * detInv;
    te[8] = t13 * detInv;
    te[9] = (n14 * n23 * n41 - n13 * n24 * n41 - n14 * n21 * n43 + n11 * n24 * n43 + n13 * n21 * n44 - n11 * n23 * n44) * detInv;
    te[10] = (n12 * n24 * n41 - n14 * n22 * n41 + n14 * n21 * n42 - n11 * n24 * n42 - n12 * n21 * n44 + n11 * n22 * n44) * detInv;
    te[11] = (n13 * n22 * n41 - n12 * n23 * n41 - n13 * n21 * n42 + n11 * n23 * n42 + n12 * n21 * n43 - n11 * n22 * n43) * detInv;
    te[12] = t14 * detInv;
    te[13] = (n13 * n24 * n31 - n14 * n23 * n31 + n14 * n21 * n33 - n11 * n24 * n33 - n13 * n21 * n34 + n11 * n23 * n34) * detInv;
    te[14] = (n14 * n22 * n31 - n12 * n24 * n31 - n14 * n21 * n32 + n11 * n24 * n32 + n12 * n21 * n34 - n11 * n22 * n34) * detInv;
    te[15] = (n12 * n23 * n31 - n13 * n22 * n31 + n13 * n21 * n32 - n11 * n23 * n32 - n12 * n21 * n33 + n11 * n22 * n33) * detInv;
    return this;
  }
  scale(v4) {
    const te = this.elements;
    const x2 = v4.x, y2 = v4.y, z = v4.z;
    te[0] *= x2;
    te[4] *= y2;
    te[8] *= z;
    te[1] *= x2;
    te[5] *= y2;
    te[9] *= z;
    te[2] *= x2;
    te[6] *= y2;
    te[10] *= z;
    te[3] *= x2;
    te[7] *= y2;
    te[11] *= z;
    return this;
  }
  getMaxScaleOnAxis() {
    const te = this.elements;
    const scaleXSq = te[0] * te[0] + te[1] * te[1] + te[2] * te[2];
    const scaleYSq = te[4] * te[4] + te[5] * te[5] + te[6] * te[6];
    const scaleZSq = te[8] * te[8] + te[9] * te[9] + te[10] * te[10];
    return Math.sqrt(Math.max(scaleXSq, scaleYSq, scaleZSq));
  }
  makeTranslation(x2, y2, z) {
    this.set(
      1,
      0,
      0,
      x2,
      0,
      1,
      0,
      y2,
      0,
      0,
      1,
      z,
      0,
      0,
      0,
      1
    );
    return this;
  }
  makeRotationX(theta) {
    const c4 = Math.cos(theta), s2 = Math.sin(theta);
    this.set(
      1,
      0,
      0,
      0,
      0,
      c4,
      -s2,
      0,
      0,
      s2,
      c4,
      0,
      0,
      0,
      0,
      1
    );
    return this;
  }
  makeRotationY(theta) {
    const c4 = Math.cos(theta), s2 = Math.sin(theta);
    this.set(
      c4,
      0,
      s2,
      0,
      0,
      1,
      0,
      0,
      -s2,
      0,
      c4,
      0,
      0,
      0,
      0,
      1
    );
    return this;
  }
  makeRotationZ(theta) {
    const c4 = Math.cos(theta), s2 = Math.sin(theta);
    this.set(
      c4,
      -s2,
      0,
      0,
      s2,
      c4,
      0,
      0,
      0,
      0,
      1,
      0,
      0,
      0,
      0,
      1
    );
    return this;
  }
  makeRotationAxis(axis, angle) {
    const c4 = Math.cos(angle);
    const s2 = Math.sin(angle);
    const t3 = 1 - c4;
    const x2 = axis.x, y2 = axis.y, z = axis.z;
    const tx = t3 * x2, ty = t3 * y2;
    this.set(
      tx * x2 + c4,
      tx * y2 - s2 * z,
      tx * z + s2 * y2,
      0,
      tx * y2 + s2 * z,
      ty * y2 + c4,
      ty * z - s2 * x2,
      0,
      tx * z - s2 * y2,
      ty * z + s2 * x2,
      t3 * z * z + c4,
      0,
      0,
      0,
      0,
      1
    );
    return this;
  }
  makeScale(x2, y2, z) {
    this.set(
      x2,
      0,
      0,
      0,
      0,
      y2,
      0,
      0,
      0,
      0,
      z,
      0,
      0,
      0,
      0,
      1
    );
    return this;
  }
  makeShear(xy, xz, yx, yz, zx, zy) {
    this.set(
      1,
      yx,
      zx,
      0,
      xy,
      1,
      zy,
      0,
      xz,
      yz,
      1,
      0,
      0,
      0,
      0,
      1
    );
    return this;
  }
  compose(position2, quaternion, scale) {
    const te = this.elements;
    const x2 = quaternion._x, y2 = quaternion._y, z = quaternion._z, w = quaternion._w;
    const x22 = x2 + x2, y22 = y2 + y2, z2 = z + z;
    const xx = x2 * x22, xy = x2 * y22, xz = x2 * z2;
    const yy = y2 * y22, yz = y2 * z2, zz = z * z2;
    const wx = w * x22, wy = w * y22, wz = w * z2;
    const sx = scale.x, sy = scale.y, sz = scale.z;
    te[0] = (1 - (yy + zz)) * sx;
    te[1] = (xy + wz) * sx;
    te[2] = (xz - wy) * sx;
    te[3] = 0;
    te[4] = (xy - wz) * sy;
    te[5] = (1 - (xx + zz)) * sy;
    te[6] = (yz + wx) * sy;
    te[7] = 0;
    te[8] = (xz + wy) * sz;
    te[9] = (yz - wx) * sz;
    te[10] = (1 - (xx + yy)) * sz;
    te[11] = 0;
    te[12] = position2.x;
    te[13] = position2.y;
    te[14] = position2.z;
    te[15] = 1;
    return this;
  }
  decompose(position2, quaternion, scale) {
    const te = this.elements;
    let sx = _v1$5.set(te[0], te[1], te[2]).length();
    const sy = _v1$5.set(te[4], te[5], te[6]).length();
    const sz = _v1$5.set(te[8], te[9], te[10]).length();
    const det = this.determinant();
    if (det < 0)
      sx = -sx;
    position2.x = te[12];
    position2.y = te[13];
    position2.z = te[14];
    _m1$2.copy(this);
    const invSX = 1 / sx;
    const invSY = 1 / sy;
    const invSZ = 1 / sz;
    _m1$2.elements[0] *= invSX;
    _m1$2.elements[1] *= invSX;
    _m1$2.elements[2] *= invSX;
    _m1$2.elements[4] *= invSY;
    _m1$2.elements[5] *= invSY;
    _m1$2.elements[6] *= invSY;
    _m1$2.elements[8] *= invSZ;
    _m1$2.elements[9] *= invSZ;
    _m1$2.elements[10] *= invSZ;
    quaternion.setFromRotationMatrix(_m1$2);
    scale.x = sx;
    scale.y = sy;
    scale.z = sz;
    return this;
  }
  makePerspective(left, right, top2, bottom, near, far) {
    if (far === void 0) {
      console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");
    }
    const te = this.elements;
    const x2 = 2 * near / (right - left);
    const y2 = 2 * near / (top2 - bottom);
    const a2 = (right + left) / (right - left);
    const b = (top2 + bottom) / (top2 - bottom);
    const c4 = -(far + near) / (far - near);
    const d = -2 * far * near / (far - near);
    te[0] = x2;
    te[4] = 0;
    te[8] = a2;
    te[12] = 0;
    te[1] = 0;
    te[5] = y2;
    te[9] = b;
    te[13] = 0;
    te[2] = 0;
    te[6] = 0;
    te[10] = c4;
    te[14] = d;
    te[3] = 0;
    te[7] = 0;
    te[11] = -1;
    te[15] = 0;
    return this;
  }
  makeOrthographic(left, right, top2, bottom, near, far) {
    const te = this.elements;
    const w = 1 / (right - left);
    const h = 1 / (top2 - bottom);
    const p = 1 / (far - near);
    const x2 = (right + left) * w;
    const y2 = (top2 + bottom) * h;
    const z = (far + near) * p;
    te[0] = 2 * w;
    te[4] = 0;
    te[8] = 0;
    te[12] = -x2;
    te[1] = 0;
    te[5] = 2 * h;
    te[9] = 0;
    te[13] = -y2;
    te[2] = 0;
    te[6] = 0;
    te[10] = -2 * p;
    te[14] = -z;
    te[3] = 0;
    te[7] = 0;
    te[11] = 0;
    te[15] = 1;
    return this;
  }
  equals(matrix) {
    const te = this.elements;
    const me = matrix.elements;
    for (let i2 = 0; i2 < 16; i2++) {
      if (te[i2] !== me[i2])
        return false;
    }
    return true;
  }
  fromArray(array, offset = 0) {
    for (let i2 = 0; i2 < 16; i2++) {
      this.elements[i2] = array[i2 + offset];
    }
    return this;
  }
  toArray(array = [], offset = 0) {
    const te = this.elements;
    array[offset] = te[0];
    array[offset + 1] = te[1];
    array[offset + 2] = te[2];
    array[offset + 3] = te[3];
    array[offset + 4] = te[4];
    array[offset + 5] = te[5];
    array[offset + 6] = te[6];
    array[offset + 7] = te[7];
    array[offset + 8] = te[8];
    array[offset + 9] = te[9];
    array[offset + 10] = te[10];
    array[offset + 11] = te[11];
    array[offset + 12] = te[12];
    array[offset + 13] = te[13];
    array[offset + 14] = te[14];
    array[offset + 15] = te[15];
    return array;
  }
};
Matrix4.prototype.isMatrix4 = true;
var _v1$5 = /* @__PURE__ */ new Vector3();
var _m1$2 = /* @__PURE__ */ new Matrix4();
var _zero = /* @__PURE__ */ new Vector3(0, 0, 0);
var _one = /* @__PURE__ */ new Vector3(1, 1, 1);
var _x = /* @__PURE__ */ new Vector3();
var _y = /* @__PURE__ */ new Vector3();
var _z = /* @__PURE__ */ new Vector3();
var _matrix$1 = /* @__PURE__ */ new Matrix4();
var _quaternion$3 = /* @__PURE__ */ new Quaternion();
var Euler = class _Euler {
  constructor(x2 = 0, y2 = 0, z = 0, order = _Euler.DefaultOrder) {
    this._x = x2;
    this._y = y2;
    this._z = z;
    this._order = order;
  }
  get x() {
    return this._x;
  }
  set x(value) {
    this._x = value;
    this._onChangeCallback();
  }
  get y() {
    return this._y;
  }
  set y(value) {
    this._y = value;
    this._onChangeCallback();
  }
  get z() {
    return this._z;
  }
  set z(value) {
    this._z = value;
    this._onChangeCallback();
  }
  get order() {
    return this._order;
  }
  set order(value) {
    this._order = value;
    this._onChangeCallback();
  }
  set(x2, y2, z, order = this._order) {
    this._x = x2;
    this._y = y2;
    this._z = z;
    this._order = order;
    this._onChangeCallback();
    return this;
  }
  clone() {
    return new this.constructor(this._x, this._y, this._z, this._order);
  }
  copy(euler) {
    this._x = euler._x;
    this._y = euler._y;
    this._z = euler._z;
    this._order = euler._order;
    this._onChangeCallback();
    return this;
  }
  setFromRotationMatrix(m, order = this._order, update = true) {
    const te = m.elements;
    const m11 = te[0], m12 = te[4], m13 = te[8];
    const m21 = te[1], m22 = te[5], m23 = te[9];
    const m31 = te[2], m32 = te[6], m33 = te[10];
    switch (order) {
      case "XYZ":
        this._y = Math.asin(clamp(m13, -1, 1));
        if (Math.abs(m13) < 0.9999999) {
          this._x = Math.atan2(-m23, m33);
          this._z = Math.atan2(-m12, m11);
        } else {
          this._x = Math.atan2(m32, m22);
          this._z = 0;
        }
        break;
      case "YXZ":
        this._x = Math.asin(-clamp(m23, -1, 1));
        if (Math.abs(m23) < 0.9999999) {
          this._y = Math.atan2(m13, m33);
          this._z = Math.atan2(m21, m22);
        } else {
          this._y = Math.atan2(-m31, m11);
          this._z = 0;
        }
        break;
      case "ZXY":
        this._x = Math.asin(clamp(m32, -1, 1));
        if (Math.abs(m32) < 0.9999999) {
          this._y = Math.atan2(-m31, m33);
          this._z = Math.atan2(-m12, m22);
        } else {
          this._y = 0;
          this._z = Math.atan2(m21, m11);
        }
        break;
      case "ZYX":
        this._y = Math.asin(-clamp(m31, -1, 1));
        if (Math.abs(m31) < 0.9999999) {
          this._x = Math.atan2(m32, m33);
          this._z = Math.atan2(m21, m11);
        } else {
          this._x = 0;
          this._z = Math.atan2(-m12, m22);
        }
        break;
      case "YZX":
        this._z = Math.asin(clamp(m21, -1, 1));
        if (Math.abs(m21) < 0.9999999) {
          this._x = Math.atan2(-m23, m22);
          this._y = Math.atan2(-m31, m11);
        } else {
          this._x = 0;
          this._y = Math.atan2(m13, m33);
        }
        break;
      case "XZY":
        this._z = Math.asin(-clamp(m12, -1, 1));
        if (Math.abs(m12) < 0.9999999) {
          this._x = Math.atan2(m32, m22);
          this._y = Math.atan2(m13, m11);
        } else {
          this._x = Math.atan2(-m23, m33);
          this._y = 0;
        }
        break;
      default:
        console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: " + order);
    }
    this._order = order;
    if (update === true)
      this._onChangeCallback();
    return this;
  }
  setFromQuaternion(q, order, update) {
    _matrix$1.makeRotationFromQuaternion(q);
    return this.setFromRotationMatrix(_matrix$1, order, update);
  }
  setFromVector3(v4, order = this._order) {
    return this.set(v4.x, v4.y, v4.z, order);
  }
  reorder(newOrder) {
    _quaternion$3.setFromEuler(this);
    return this.setFromQuaternion(_quaternion$3, newOrder);
  }
  equals(euler) {
    return euler._x === this._x && euler._y === this._y && euler._z === this._z && euler._order === this._order;
  }
  fromArray(array) {
    this._x = array[0];
    this._y = array[1];
    this._z = array[2];
    if (array[3] !== void 0)
      this._order = array[3];
    this._onChangeCallback();
    return this;
  }
  toArray(array = [], offset = 0) {
    array[offset] = this._x;
    array[offset + 1] = this._y;
    array[offset + 2] = this._z;
    array[offset + 3] = this._order;
    return array;
  }
  _onChange(callback) {
    this._onChangeCallback = callback;
    return this;
  }
  _onChangeCallback() {
  }
};
Euler.prototype.isEuler = true;
Euler.DefaultOrder = "XYZ";
Euler.RotationOrders = ["XYZ", "YZX", "ZXY", "XZY", "YXZ", "ZYX"];
var Layers = class {
  constructor() {
    this.mask = 1 | 0;
  }
  set(channel) {
    this.mask = (1 << channel | 0) >>> 0;
  }
  enable(channel) {
    this.mask |= 1 << channel | 0;
  }
  enableAll() {
    this.mask = 4294967295 | 0;
  }
  toggle(channel) {
    this.mask ^= 1 << channel | 0;
  }
  disable(channel) {
    this.mask &= ~(1 << channel | 0);
  }
  disableAll() {
    this.mask = 0;
  }
  test(layers) {
    return (this.mask & layers.mask) !== 0;
  }
  isEnabled(channel) {
    return (this.mask & (1 << channel | 0)) !== 0;
  }
};
var _object3DId = 0;
var _v1$4 = /* @__PURE__ */ new Vector3();
var _q1 = /* @__PURE__ */ new Quaternion();
var _m1$1 = /* @__PURE__ */ new Matrix4();
var _target = /* @__PURE__ */ new Vector3();
var _position$3 = /* @__PURE__ */ new Vector3();
var _scale$2 = /* @__PURE__ */ new Vector3();
var _quaternion$2 = /* @__PURE__ */ new Quaternion();
var _xAxis = /* @__PURE__ */ new Vector3(1, 0, 0);
var _yAxis = /* @__PURE__ */ new Vector3(0, 1, 0);
var _zAxis = /* @__PURE__ */ new Vector3(0, 0, 1);
var _addedEvent = { type: "added" };
var _removedEvent = { type: "removed" };
var Object3D = class _Object3D extends EventDispatcher {
  constructor() {
    super();
    Object.defineProperty(this, "id", { value: _object3DId++ });
    this.uuid = generateUUID();
    this.name = "";
    this.type = "Object3D";
    this.parent = null;
    this.children = [];
    this.up = _Object3D.DefaultUp.clone();
    const position2 = new Vector3();
    const rotation = new Euler();
    const quaternion = new Quaternion();
    const scale = new Vector3(1, 1, 1);
    function onRotationChange() {
      quaternion.setFromEuler(rotation, false);
    }
    function onQuaternionChange() {
      rotation.setFromQuaternion(quaternion, void 0, false);
    }
    rotation._onChange(onRotationChange);
    quaternion._onChange(onQuaternionChange);
    Object.defineProperties(this, {
      position: {
        configurable: true,
        enumerable: true,
        value: position2
      },
      rotation: {
        configurable: true,
        enumerable: true,
        value: rotation
      },
      quaternion: {
        configurable: true,
        enumerable: true,
        value: quaternion
      },
      scale: {
        configurable: true,
        enumerable: true,
        value: scale
      },
      modelViewMatrix: {
        value: new Matrix4()
      },
      normalMatrix: {
        value: new Matrix3()
      }
    });
    this.matrix = new Matrix4();
    this.matrixWorld = new Matrix4();
    this.matrixAutoUpdate = _Object3D.DefaultMatrixAutoUpdate;
    this.matrixWorldNeedsUpdate = false;
    this.layers = new Layers();
    this.visible = true;
    this.castShadow = false;
    this.receiveShadow = false;
    this.frustumCulled = true;
    this.renderOrder = 0;
    this.animations = [];
    this.userData = {};
  }
  onBeforeRender() {
  }
  onAfterRender() {
  }
  applyMatrix4(matrix) {
    if (this.matrixAutoUpdate)
      this.updateMatrix();
    this.matrix.premultiply(matrix);
    this.matrix.decompose(this.position, this.quaternion, this.scale);
  }
  applyQuaternion(q) {
    this.quaternion.premultiply(q);
    return this;
  }
  setRotationFromAxisAngle(axis, angle) {
    this.quaternion.setFromAxisAngle(axis, angle);
  }
  setRotationFromEuler(euler) {
    this.quaternion.setFromEuler(euler, true);
  }
  setRotationFromMatrix(m) {
    this.quaternion.setFromRotationMatrix(m);
  }
  setRotationFromQuaternion(q) {
    this.quaternion.copy(q);
  }
  rotateOnAxis(axis, angle) {
    _q1.setFromAxisAngle(axis, angle);
    this.quaternion.multiply(_q1);
    return this;
  }
  rotateOnWorldAxis(axis, angle) {
    _q1.setFromAxisAngle(axis, angle);
    this.quaternion.premultiply(_q1);
    return this;
  }
  rotateX(angle) {
    return this.rotateOnAxis(_xAxis, angle);
  }
  rotateY(angle) {
    return this.rotateOnAxis(_yAxis, angle);
  }
  rotateZ(angle) {
    return this.rotateOnAxis(_zAxis, angle);
  }
  translateOnAxis(axis, distance) {
    _v1$4.copy(axis).applyQuaternion(this.quaternion);
    this.position.add(_v1$4.multiplyScalar(distance));
    return this;
  }
  translateX(distance) {
    return this.translateOnAxis(_xAxis, distance);
  }
  translateY(distance) {
    return this.translateOnAxis(_yAxis, distance);
  }
  translateZ(distance) {
    return this.translateOnAxis(_zAxis, distance);
  }
  localToWorld(vector) {
    return vector.applyMatrix4(this.matrixWorld);
  }
  worldToLocal(vector) {
    return vector.applyMatrix4(_m1$1.copy(this.matrixWorld).invert());
  }
  lookAt(x2, y2, z) {
    if (x2.isVector3) {
      _target.copy(x2);
    } else {
      _target.set(x2, y2, z);
    }
    const parent = this.parent;
    this.updateWorldMatrix(true, false);
    _position$3.setFromMatrixPosition(this.matrixWorld);
    if (this.isCamera || this.isLight) {
      _m1$1.lookAt(_position$3, _target, this.up);
    } else {
      _m1$1.lookAt(_target, _position$3, this.up);
    }
    this.quaternion.setFromRotationMatrix(_m1$1);
    if (parent) {
      _m1$1.extractRotation(parent.matrixWorld);
      _q1.setFromRotationMatrix(_m1$1);
      this.quaternion.premultiply(_q1.invert());
    }
  }
  add(object) {
    if (arguments.length > 1) {
      for (let i2 = 0; i2 < arguments.length; i2++) {
        this.add(arguments[i2]);
      }
      return this;
    }
    if (object === this) {
      console.error("THREE.Object3D.add: object can't be added as a child of itself.", object);
      return this;
    }
    if (object && object.isObject3D) {
      if (object.parent !== null) {
        object.parent.remove(object);
      }
      object.parent = this;
      this.children.push(object);
      object.dispatchEvent(_addedEvent);
    } else {
      console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.", object);
    }
    return this;
  }
  remove(object) {
    if (arguments.length > 1) {
      for (let i2 = 0; i2 < arguments.length; i2++) {
        this.remove(arguments[i2]);
      }
      return this;
    }
    const index = this.children.indexOf(object);
    if (index !== -1) {
      object.parent = null;
      this.children.splice(index, 1);
      object.dispatchEvent(_removedEvent);
    }
    return this;
  }
  removeFromParent() {
    const parent = this.parent;
    if (parent !== null) {
      parent.remove(this);
    }
    return this;
  }
  clear() {
    for (let i2 = 0; i2 < this.children.length; i2++) {
      const object = this.children[i2];
      object.parent = null;
      object.dispatchEvent(_removedEvent);
    }
    this.children.length = 0;
    return this;
  }
  attach(object) {
    this.updateWorldMatrix(true, false);
    _m1$1.copy(this.matrixWorld).invert();
    if (object.parent !== null) {
      object.parent.updateWorldMatrix(true, false);
      _m1$1.multiply(object.parent.matrixWorld);
    }
    object.applyMatrix4(_m1$1);
    this.add(object);
    object.updateWorldMatrix(false, true);
    return this;
  }
  getObjectById(id2) {
    return this.getObjectByProperty("id", id2);
  }
  getObjectByName(name2) {
    return this.getObjectByProperty("name", name2);
  }
  getObjectByProperty(name2, value) {
    if (this[name2] === value)
      return this;
    for (let i2 = 0, l = this.children.length; i2 < l; i2++) {
      const child = this.children[i2];
      const object = child.getObjectByProperty(name2, value);
      if (object !== void 0) {
        return object;
      }
    }
    return void 0;
  }
  getWorldPosition(target) {
    this.updateWorldMatrix(true, false);
    return target.setFromMatrixPosition(this.matrixWorld);
  }
  getWorldQuaternion(target) {
    this.updateWorldMatrix(true, false);
    this.matrixWorld.decompose(_position$3, target, _scale$2);
    return target;
  }
  getWorldScale(target) {
    this.updateWorldMatrix(true, false);
    this.matrixWorld.decompose(_position$3, _quaternion$2, target);
    return target;
  }
  getWorldDirection(target) {
    this.updateWorldMatrix(true, false);
    const e3 = this.matrixWorld.elements;
    return target.set(e3[8], e3[9], e3[10]).normalize();
  }
  raycast() {
  }
  traverse(callback) {
    callback(this);
    const children = this.children;
    for (let i2 = 0, l = children.length; i2 < l; i2++) {
      children[i2].traverse(callback);
    }
  }
  traverseVisible(callback) {
    if (this.visible === false)
      return;
    callback(this);
    const children = this.children;
    for (let i2 = 0, l = children.length; i2 < l; i2++) {
      children[i2].traverseVisible(callback);
    }
  }
  traverseAncestors(callback) {
    const parent = this.parent;
    if (parent !== null) {
      callback(parent);
      parent.traverseAncestors(callback);
    }
  }
  updateMatrix() {
    this.matrix.compose(this.position, this.quaternion, this.scale);
    this.matrixWorldNeedsUpdate = true;
  }
  updateMatrixWorld(force) {
    if (this.matrixAutoUpdate)
      this.updateMatrix();
    if (this.matrixWorldNeedsUpdate || force) {
      if (this.parent === null) {
        this.matrixWorld.copy(this.matrix);
      } else {
        this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix);
      }
      this.matrixWorldNeedsUpdate = false;
      force = true;
    }
    const children = this.children;
    for (let i2 = 0, l = children.length; i2 < l; i2++) {
      children[i2].updateMatrixWorld(force);
    }
  }
  updateWorldMatrix(updateParents, updateChildren) {
    const parent = this.parent;
    if (updateParents === true && parent !== null) {
      parent.updateWorldMatrix(true, false);
    }
    if (this.matrixAutoUpdate)
      this.updateMatrix();
    if (this.parent === null) {
      this.matrixWorld.copy(this.matrix);
    } else {
      this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix);
    }
    if (updateChildren === true) {
      const children = this.children;
      for (let i2 = 0, l = children.length; i2 < l; i2++) {
        children[i2].updateWorldMatrix(false, true);
      }
    }
  }
  toJSON(meta2) {
    const isRootObject = meta2 === void 0 || typeof meta2 === "string";
    const output = {};
    if (isRootObject) {
      meta2 = {
        geometries: {},
        materials: {},
        textures: {},
        images: {},
        shapes: {},
        skeletons: {},
        animations: {},
        nodes: {}
      };
      output.metadata = {
        version: 4.5,
        type: "Object",
        generator: "Object3D.toJSON"
      };
    }
    const object = {};
    object.uuid = this.uuid;
    object.type = this.type;
    if (this.name !== "")
      object.name = this.name;
    if (this.castShadow === true)
      object.castShadow = true;
    if (this.receiveShadow === true)
      object.receiveShadow = true;
    if (this.visible === false)
      object.visible = false;
    if (this.frustumCulled === false)
      object.frustumCulled = false;
    if (this.renderOrder !== 0)
      object.renderOrder = this.renderOrder;
    if (JSON.stringify(this.userData) !== "{}")
      object.userData = this.userData;
    object.layers = this.layers.mask;
    object.matrix = this.matrix.toArray();
    if (this.matrixAutoUpdate === false)
      object.matrixAutoUpdate = false;
    if (this.isInstancedMesh) {
      object.type = "InstancedMesh";
      object.count = this.count;
      object.instanceMatrix = this.instanceMatrix.toJSON();
      if (this.instanceColor !== null)
        object.instanceColor = this.instanceColor.toJSON();
    }
    function serialize2(library, element2) {
      if (library[element2.uuid] === void 0) {
        library[element2.uuid] = element2.toJSON(meta2);
      }
      return element2.uuid;
    }
    if (this.isScene) {
      if (this.background) {
        if (this.background.isColor) {
          object.background = this.background.toJSON();
        } else if (this.background.isTexture) {
          object.background = this.background.toJSON(meta2).uuid;
        }
      }
      if (this.environment && this.environment.isTexture) {
        object.environment = this.environment.toJSON(meta2).uuid;
      }
    } else if (this.isMesh || this.isLine || this.isPoints) {
      object.geometry = serialize2(meta2.geometries, this.geometry);
      const parameters = this.geometry.parameters;
      if (parameters !== void 0 && parameters.shapes !== void 0) {
        const shapes = parameters.shapes;
        if (Array.isArray(shapes)) {
          for (let i2 = 0, l = shapes.length; i2 < l; i2++) {
            const shape = shapes[i2];
            serialize2(meta2.shapes, shape);
          }
        } else {
          serialize2(meta2.shapes, shapes);
        }
      }
    }
    if (this.isSkinnedMesh) {
      object.bindMode = this.bindMode;
      object.bindMatrix = this.bindMatrix.toArray();
      if (this.skeleton !== void 0) {
        serialize2(meta2.skeletons, this.skeleton);
        object.skeleton = this.skeleton.uuid;
      }
    }
    if (this.material !== void 0) {
      if (Array.isArray(this.material)) {
        const uuids = [];
        for (let i2 = 0, l = this.material.length; i2 < l; i2++) {
          uuids.push(serialize2(meta2.materials, this.material[i2]));
        }
        object.material = uuids;
      } else {
        object.material = serialize2(meta2.materials, this.material);
      }
    }
    if (this.children.length > 0) {
      object.children = [];
      for (let i2 = 0; i2 < this.children.length; i2++) {
        object.children.push(this.children[i2].toJSON(meta2).object);
      }
    }
    if (this.animations.length > 0) {
      object.animations = [];
      for (let i2 = 0; i2 < this.animations.length; i2++) {
        const animation = this.animations[i2];
        object.animations.push(serialize2(meta2.animations, animation));
      }
    }
    if (isRootObject) {
      const geometries = extractFromCache(meta2.geometries);
      const materials = extractFromCache(meta2.materials);
      const textures = extractFromCache(meta2.textures);
      const images = extractFromCache(meta2.images);
      const shapes = extractFromCache(meta2.shapes);
      const skeletons = extractFromCache(meta2.skeletons);
      const animations = extractFromCache(meta2.animations);
      const nodes = extractFromCache(meta2.nodes);
      if (geometries.length > 0)
        output.geometries = geometries;
      if (materials.length > 0)
        output.materials = materials;
      if (textures.length > 0)
        output.textures = textures;
      if (images.length > 0)
        output.images = images;
      if (shapes.length > 0)
        output.shapes = shapes;
      if (skeletons.length > 0)
        output.skeletons = skeletons;
      if (animations.length > 0)
        output.animations = animations;
      if (nodes.length > 0)
        output.nodes = nodes;
    }
    output.object = object;
    return output;
    function extractFromCache(cache2) {
      const values2 = [];
      for (const key in cache2) {
        const data = cache2[key];
        delete data.metadata;
        values2.push(data);
      }
      return values2;
    }
  }
  clone(recursive) {
    return new this.constructor().copy(this, recursive);
  }
  copy(source, recursive = true) {
    this.name = source.name;
    this.up.copy(source.up);
    this.position.copy(source.position);
    this.rotation.order = source.rotation.order;
    this.quaternion.copy(source.quaternion);
    this.scale.copy(source.scale);
    this.matrix.copy(source.matrix);
    this.matrixWorld.copy(source.matrixWorld);
    this.matrixAutoUpdate = source.matrixAutoUpdate;
    this.matrixWorldNeedsUpdate = source.matrixWorldNeedsUpdate;
    this.layers.mask = source.layers.mask;
    this.visible = source.visible;
    this.castShadow = source.castShadow;
    this.receiveShadow = source.receiveShadow;
    this.frustumCulled = source.frustumCulled;
    this.renderOrder = source.renderOrder;
    this.userData = JSON.parse(JSON.stringify(source.userData));
    if (recursive === true) {
      for (let i2 = 0; i2 < source.children.length; i2++) {
        const child = source.children[i2];
        this.add(child.clone());
      }
    }
    return this;
  }
};
Object3D.DefaultUp = new Vector3(0, 1, 0);
Object3D.DefaultMatrixAutoUpdate = true;
Object3D.prototype.isObject3D = true;
var _v0$1 = /* @__PURE__ */ new Vector3();
var _v1$3 = /* @__PURE__ */ new Vector3();
var _v2$2 = /* @__PURE__ */ new Vector3();
var _v3$1 = /* @__PURE__ */ new Vector3();
var _vab = /* @__PURE__ */ new Vector3();
var _vac = /* @__PURE__ */ new Vector3();
var _vbc = /* @__PURE__ */ new Vector3();
var _vap = /* @__PURE__ */ new Vector3();
var _vbp = /* @__PURE__ */ new Vector3();
var _vcp = /* @__PURE__ */ new Vector3();
var Triangle = class _Triangle {
  constructor(a2 = new Vector3(), b = new Vector3(), c4 = new Vector3()) {
    this.a = a2;
    this.b = b;
    this.c = c4;
  }
  static getNormal(a2, b, c4, target) {
    target.subVectors(c4, b);
    _v0$1.subVectors(a2, b);
    target.cross(_v0$1);
    const targetLengthSq = target.lengthSq();
    if (targetLengthSq > 0) {
      return target.multiplyScalar(1 / Math.sqrt(targetLengthSq));
    }
    return target.set(0, 0, 0);
  }
  // static/instance method to calculate barycentric coordinates
  // based on: http://www.blackpawn.com/texts/pointinpoly/default.html
  static getBarycoord(point4, a2, b, c4, target) {
    _v0$1.subVectors(c4, a2);
    _v1$3.subVectors(b, a2);
    _v2$2.subVectors(point4, a2);
    const dot00 = _v0$1.dot(_v0$1);
    const dot01 = _v0$1.dot(_v1$3);
    const dot02 = _v0$1.dot(_v2$2);
    const dot11 = _v1$3.dot(_v1$3);
    const dot12 = _v1$3.dot(_v2$2);
    const denom = dot00 * dot11 - dot01 * dot01;
    if (denom === 0) {
      return target.set(-2, -1, -1);
    }
    const invDenom = 1 / denom;
    const u = (dot11 * dot02 - dot01 * dot12) * invDenom;
    const v4 = (dot00 * dot12 - dot01 * dot02) * invDenom;
    return target.set(1 - u - v4, v4, u);
  }
  static containsPoint(point4, a2, b, c4) {
    this.getBarycoord(point4, a2, b, c4, _v3$1);
    return _v3$1.x >= 0 && _v3$1.y >= 0 && _v3$1.x + _v3$1.y <= 1;
  }
  static getUV(point4, p1, p2, p3, uv1, uv2, uv3, target) {
    this.getBarycoord(point4, p1, p2, p3, _v3$1);
    target.set(0, 0);
    target.addScaledVector(uv1, _v3$1.x);
    target.addScaledVector(uv2, _v3$1.y);
    target.addScaledVector(uv3, _v3$1.z);
    return target;
  }
  static isFrontFacing(a2, b, c4, direction) {
    _v0$1.subVectors(c4, b);
    _v1$3.subVectors(a2, b);
    return _v0$1.cross(_v1$3).dot(direction) < 0 ? true : false;
  }
  set(a2, b, c4) {
    this.a.copy(a2);
    this.b.copy(b);
    this.c.copy(c4);
    return this;
  }
  setFromPointsAndIndices(points, i0, i1, i2) {
    this.a.copy(points[i0]);
    this.b.copy(points[i1]);
    this.c.copy(points[i2]);
    return this;
  }
  setFromAttributeAndIndices(attribute, i0, i1, i2) {
    this.a.fromBufferAttribute(attribute, i0);
    this.b.fromBufferAttribute(attribute, i1);
    this.c.fromBufferAttribute(attribute, i2);
    return this;
  }
  clone() {
    return new this.constructor().copy(this);
  }
  copy(triangle) {
    this.a.copy(triangle.a);
    this.b.copy(triangle.b);
    this.c.copy(triangle.c);
    return this;
  }
  getArea() {
    _v0$1.subVectors(this.c, this.b);
    _v1$3.subVectors(this.a, this.b);
    return _v0$1.cross(_v1$3).length() * 0.5;
  }
  getMidpoint(target) {
    return target.addVectors(this.a, this.b).add(this.c).multiplyScalar(1 / 3);
  }
  getNormal(target) {
    return _Triangle.getNormal(this.a, this.b, this.c, target);
  }
  getPlane(target) {
    return target.setFromCoplanarPoints(this.a, this.b, this.c);
  }
  getBarycoord(point4, target) {
    return _Triangle.getBarycoord(point4, this.a, this.b, this.c, target);
  }
  getUV(point4, uv1, uv2, uv3, target) {
    return _Triangle.getUV(point4, this.a, this.b, this.c, uv1, uv2, uv3, target);
  }
  containsPoint(point4) {
    return _Triangle.containsPoint(point4, this.a, this.b, this.c);
  }
  isFrontFacing(direction) {
    return _Triangle.isFrontFacing(this.a, this.b, this.c, direction);
  }
  intersectsBox(box) {
    return box.intersectsTriangle(this);
  }
  closestPointToPoint(p, target) {
    const a2 = this.a, b = this.b, c4 = this.c;
    let v4, w;
    _vab.subVectors(b, a2);
    _vac.subVectors(c4, a2);
    _vap.subVectors(p, a2);
    const d1 = _vab.dot(_vap);
    const d2 = _vac.dot(_vap);
    if (d1 <= 0 && d2 <= 0) {
      return target.copy(a2);
    }
    _vbp.subVectors(p, b);
    const d3 = _vab.dot(_vbp);
    const d4 = _vac.dot(_vbp);
    if (d3 >= 0 && d4 <= d3) {
      return target.copy(b);
    }
    const vc = d1 * d4 - d3 * d2;
    if (vc <= 0 && d1 >= 0 && d3 <= 0) {
      v4 = d1 / (d1 - d3);
      return target.copy(a2).addScaledVector(_vab, v4);
    }
    _vcp.subVectors(p, c4);
    const d5 = _vab.dot(_vcp);
    const d6 = _vac.dot(_vcp);
    if (d6 >= 0 && d5 <= d6) {
      return target.copy(c4);
    }
    const vb = d5 * d2 - d1 * d6;
    if (vb <= 0 && d2 >= 0 && d6 <= 0) {
      w = d2 / (d2 - d6);
      return target.copy(a2).addScaledVector(_vac, w);
    }
    const va = d3 * d6 - d5 * d4;
    if (va <= 0 && d4 - d3 >= 0 && d5 - d6 >= 0) {
      _vbc.subVectors(c4, b);
      w = (d4 - d3) / (d4 - d3 + (d5 - d6));
      return target.copy(b).addScaledVector(_vbc, w);
    }
    const denom = 1 / (va + vb + vc);
    v4 = vb * denom;
    w = vc * denom;
    return target.copy(a2).addScaledVector(_vab, v4).addScaledVector(_vac, w);
  }
  equals(triangle) {
    return triangle.a.equals(this.a) && triangle.b.equals(this.b) && triangle.c.equals(this.c);
  }
};
var materialId = 0;
var Material = class extends EventDispatcher {
  constructor() {
    super();
    Object.defineProperty(this, "id", { value: materialId++ });
    this.uuid = generateUUID();
    this.name = "";
    this.type = "Material";
    this.fog = true;
    this.blending = NormalBlending;
    this.side = FrontSide;
    this.vertexColors = false;
    this.opacity = 1;
    this.transparent = false;
    this.blendSrc = SrcAlphaFactor;
    this.blendDst = OneMinusSrcAlphaFactor;
    this.blendEquation = AddEquation;
    this.blendSrcAlpha = null;
    this.blendDstAlpha = null;
    this.blendEquationAlpha = null;
    this.depthFunc = LessEqualDepth;
    this.depthTest = true;
    this.depthWrite = true;
    this.stencilWriteMask = 255;
    this.stencilFunc = AlwaysStencilFunc;
    this.stencilRef = 0;
    this.stencilFuncMask = 255;
    this.stencilFail = KeepStencilOp;
    this.stencilZFail = KeepStencilOp;
    this.stencilZPass = KeepStencilOp;
    this.stencilWrite = false;
    this.clippingPlanes = null;
    this.clipIntersection = false;
    this.clipShadows = false;
    this.shadowSide = null;
    this.colorWrite = true;
    this.precision = null;
    this.polygonOffset = false;
    this.polygonOffsetFactor = 0;
    this.polygonOffsetUnits = 0;
    this.dithering = false;
    this.alphaToCoverage = false;
    this.premultipliedAlpha = false;
    this.visible = true;
    this.toneMapped = true;
    this.userData = {};
    this.version = 0;
    this._alphaTest = 0;
  }
  get alphaTest() {
    return this._alphaTest;
  }
  set alphaTest(value) {
    if (this._alphaTest > 0 !== value > 0) {
      this.version++;
    }
    this._alphaTest = value;
  }
  onBuild() {
  }
  onBeforeRender() {
  }
  onBeforeCompile() {
  }
  customProgramCacheKey() {
    return this.onBeforeCompile.toString();
  }
  setValues(values2) {
    if (values2 === void 0)
      return;
    for (const key in values2) {
      const newValue = values2[key];
      if (newValue === void 0) {
        console.warn("THREE.Material: '" + key + "' parameter is undefined.");
        continue;
      }
      if (key === "shading") {
        console.warn("THREE." + this.type + ": .shading has been removed. Use the boolean .flatShading instead.");
        this.flatShading = newValue === FlatShading ? true : false;
        continue;
      }
      const currentValue = this[key];
      if (currentValue === void 0) {
        console.warn("THREE." + this.type + ": '" + key + "' is not a property of this material.");
        continue;
      }
      if (currentValue && currentValue.isColor) {
        currentValue.set(newValue);
      } else if (currentValue && currentValue.isVector3 && (newValue && newValue.isVector3)) {
        currentValue.copy(newValue);
      } else {
        this[key] = newValue;
      }
    }
  }
  toJSON(meta2) {
    const isRootObject = meta2 === void 0 || typeof meta2 === "string";
    if (isRootObject) {
      meta2 = {
        textures: {},
        images: {}
      };
    }
    const data = {
      metadata: {
        version: 4.5,
        type: "Material",
        generator: "Material.toJSON"
      }
    };
    data.uuid = this.uuid;
    data.type = this.type;
    if (this.name !== "")
      data.name = this.name;
    if (this.color && this.color.isColor)
      data.color = this.color.getHex();
    if (this.roughness !== void 0)
      data.roughness = this.roughness;
    if (this.metalness !== void 0)
      data.metalness = this.metalness;
    if (this.sheen !== void 0)
      data.sheen = this.sheen;
    if (this.sheenColor && this.sheenColor.isColor)
      data.sheenColor = this.sheenColor.getHex();
    if (this.sheenRoughness !== void 0)
      data.sheenRoughness = this.sheenRoughness;
    if (this.emissive && this.emissive.isColor)
      data.emissive = this.emissive.getHex();
    if (this.emissiveIntensity && this.emissiveIntensity !== 1)
      data.emissiveIntensity = this.emissiveIntensity;
    if (this.specular && this.specular.isColor)
      data.specular = this.specular.getHex();
    if (this.specularIntensity !== void 0)
      data.specularIntensity = this.specularIntensity;
    if (this.specularColor && this.specularColor.isColor)
      data.specularColor = this.specularColor.getHex();
    if (this.shininess !== void 0)
      data.shininess = this.shininess;
    if (this.clearcoat !== void 0)
      data.clearcoat = this.clearcoat;
    if (this.clearcoatRoughness !== void 0)
      data.clearcoatRoughness = this.clearcoatRoughness;
    if (this.clearcoatMap && this.clearcoatMap.isTexture) {
      data.clearcoatMap = this.clearcoatMap.toJSON(meta2).uuid;
    }
    if (this.clearcoatRoughnessMap && this.clearcoatRoughnessMap.isTexture) {
      data.clearcoatRoughnessMap = this.clearcoatRoughnessMap.toJSON(meta2).uuid;
    }
    if (this.clearcoatNormalMap && this.clearcoatNormalMap.isTexture) {
      data.clearcoatNormalMap = this.clearcoatNormalMap.toJSON(meta2).uuid;
      data.clearcoatNormalScale = this.clearcoatNormalScale.toArray();
    }
    if (this.map && this.map.isTexture)
      data.map = this.map.toJSON(meta2).uuid;
    if (this.matcap && this.matcap.isTexture)
      data.matcap = this.matcap.toJSON(meta2).uuid;
    if (this.alphaMap && this.alphaMap.isTexture)
      data.alphaMap = this.alphaMap.toJSON(meta2).uuid;
    if (this.lightMap && this.lightMap.isTexture) {
      data.lightMap = this.lightMap.toJSON(meta2).uuid;
      data.lightMapIntensity = this.lightMapIntensity;
    }
    if (this.aoMap && this.aoMap.isTexture) {
      data.aoMap = this.aoMap.toJSON(meta2).uuid;
      data.aoMapIntensity = this.aoMapIntensity;
    }
    if (this.bumpMap && this.bumpMap.isTexture) {
      data.bumpMap = this.bumpMap.toJSON(meta2).uuid;
      data.bumpScale = this.bumpScale;
    }
    if (this.normalMap && this.normalMap.isTexture) {
      data.normalMap = this.normalMap.toJSON(meta2).uuid;
      data.normalMapType = this.normalMapType;
      data.normalScale = this.normalScale.toArray();
    }
    if (this.displacementMap && this.displacementMap.isTexture) {
      data.displacementMap = this.displacementMap.toJSON(meta2).uuid;
      data.displacementScale = this.displacementScale;
      data.displacementBias = this.displacementBias;
    }
    if (this.roughnessMap && this.roughnessMap.isTexture)
      data.roughnessMap = this.roughnessMap.toJSON(meta2).uuid;
    if (this.metalnessMap && this.metalnessMap.isTexture)
      data.metalnessMap = this.metalnessMap.toJSON(meta2).uuid;
    if (this.emissiveMap && this.emissiveMap.isTexture)
      data.emissiveMap = this.emissiveMap.toJSON(meta2).uuid;
    if (this.specularMap && this.specularMap.isTexture)
      data.specularMap = this.specularMap.toJSON(meta2).uuid;
    if (this.specularIntensityMap && this.specularIntensityMap.isTexture)
      data.specularIntensityMap = this.specularIntensityMap.toJSON(meta2).uuid;
    if (this.specularColorMap && this.specularColorMap.isTexture)
      data.specularColorMap = this.specularColorMap.toJSON(meta2).uuid;
    if (this.envMap && this.envMap.isTexture) {
      data.envMap = this.envMap.toJSON(meta2).uuid;
      if (this.combine !== void 0)
        data.combine = this.combine;
    }
    if (this.envMapIntensity !== void 0)
      data.envMapIntensity = this.envMapIntensity;
    if (this.reflectivity !== void 0)
      data.reflectivity = this.reflectivity;
    if (this.refractionRatio !== void 0)
      data.refractionRatio = this.refractionRatio;
    if (this.gradientMap && this.gradientMap.isTexture) {
      data.gradientMap = this.gradientMap.toJSON(meta2).uuid;
    }
    if (this.transmission !== void 0)
      data.transmission = this.transmission;
    if (this.transmissionMap && this.transmissionMap.isTexture)
      data.transmissionMap = this.transmissionMap.toJSON(meta2).uuid;
    if (this.thickness !== void 0)
      data.thickness = this.thickness;
    if (this.thicknessMap && this.thicknessMap.isTexture)
      data.thicknessMap = this.thicknessMap.toJSON(meta2).uuid;
    if (this.attenuationDistance !== void 0)
      data.attenuationDistance = this.attenuationDistance;
    if (this.attenuationColor !== void 0)
      data.attenuationColor = this.attenuationColor.getHex();
    if (this.size !== void 0)
      data.size = this.size;
    if (this.shadowSide !== null)
      data.shadowSide = this.shadowSide;
    if (this.sizeAttenuation !== void 0)
      data.sizeAttenuation = this.sizeAttenuation;
    if (this.blending !== NormalBlending)
      data.blending = this.blending;
    if (this.side !== FrontSide)
      data.side = this.side;
    if (this.vertexColors)
      data.vertexColors = true;
    if (this.opacity < 1)
      data.opacity = this.opacity;
    if (this.transparent === true)
      data.transparent = this.transparent;
    data.depthFunc = this.depthFunc;
    data.depthTest = this.depthTest;
    data.depthWrite = this.depthWrite;
    data.colorWrite = this.colorWrite;
    data.stencilWrite = this.stencilWrite;
    data.stencilWriteMask = this.stencilWriteMask;
    data.stencilFunc = this.stencilFunc;
    data.stencilRef = this.stencilRef;
    data.stencilFuncMask = this.stencilFuncMask;
    data.stencilFail = this.stencilFail;
    data.stencilZFail = this.stencilZFail;
    data.stencilZPass = this.stencilZPass;
    if (this.rotation !== void 0 && this.rotation !== 0)
      data.rotation = this.rotation;
    if (this.polygonOffset === true)
      data.polygonOffset = true;
    if (this.polygonOffsetFactor !== 0)
      data.polygonOffsetFactor = this.polygonOffsetFactor;
    if (this.polygonOffsetUnits !== 0)
      data.polygonOffsetUnits = this.polygonOffsetUnits;
    if (this.linewidth !== void 0 && this.linewidth !== 1)
      data.linewidth = this.linewidth;
    if (this.dashSize !== void 0)
      data.dashSize = this.dashSize;
    if (this.gapSize !== void 0)
      data.gapSize = this.gapSize;
    if (this.scale !== void 0)
      data.scale = this.scale;
    if (this.dithering === true)
      data.dithering = true;
    if (this.alphaTest > 0)
      data.alphaTest = this.alphaTest;
    if (this.alphaToCoverage === true)
      data.alphaToCoverage = this.alphaToCoverage;
    if (this.premultipliedAlpha === true)
      data.premultipliedAlpha = this.premultipliedAlpha;
    if (this.wireframe === true)
      data.wireframe = this.wireframe;
    if (this.wireframeLinewidth > 1)
      data.wireframeLinewidth = this.wireframeLinewidth;
    if (this.wireframeLinecap !== "round")
      data.wireframeLinecap = this.wireframeLinecap;
    if (this.wireframeLinejoin !== "round")
      data.wireframeLinejoin = this.wireframeLinejoin;
    if (this.flatShading === true)
      data.flatShading = this.flatShading;
    if (this.visible === false)
      data.visible = false;
    if (this.toneMapped === false)
      data.toneMapped = false;
    if (JSON.stringify(this.userData) !== "{}")
      data.userData = this.userData;
    function extractFromCache(cache2) {
      const values2 = [];
      for (const key in cache2) {
        const data2 = cache2[key];
        delete data2.metadata;
        values2.push(data2);
      }
      return values2;
    }
    if (isRootObject) {
      const textures = extractFromCache(meta2.textures);
      const images = extractFromCache(meta2.images);
      if (textures.length > 0)
        data.textures = textures;
      if (images.length > 0)
        data.images = images;
    }
    return data;
  }
  clone() {
    return new this.constructor().copy(this);
  }
  copy(source) {
    this.name = source.name;
    this.fog = source.fog;
    this.blending = source.blending;
    this.side = source.side;
    this.vertexColors = source.vertexColors;
    this.opacity = source.opacity;
    this.transparent = source.transparent;
    this.blendSrc = source.blendSrc;
    this.blendDst = source.blendDst;
    this.blendEquation = source.blendEquation;
    this.blendSrcAlpha = source.blendSrcAlpha;
    this.blendDstAlpha = source.blendDstAlpha;
    this.blendEquationAlpha = source.blendEquationAlpha;
    this.depthFunc = source.depthFunc;
    this.depthTest = source.depthTest;
    this.depthWrite = source.depthWrite;
    this.stencilWriteMask = source.stencilWriteMask;
    this.stencilFunc = source.stencilFunc;
    this.stencilRef = source.stencilRef;
    this.stencilFuncMask = source.stencilFuncMask;
    this.stencilFail = source.stencilFail;
    this.stencilZFail = source.stencilZFail;
    this.stencilZPass = source.stencilZPass;
    this.stencilWrite = source.stencilWrite;
    const srcPlanes = source.clippingPlanes;
    let dstPlanes = null;
    if (srcPlanes !== null) {
      const n2 = srcPlanes.length;
      dstPlanes = new Array(n2);
      for (let i2 = 0; i2 !== n2; ++i2) {
        dstPlanes[i2] = srcPlanes[i2].clone();
      }
    }
    this.clippingPlanes = dstPlanes;
    this.clipIntersection = source.clipIntersection;
    this.clipShadows = source.clipShadows;
    this.shadowSide = source.shadowSide;
    this.colorWrite = source.colorWrite;
    this.precision = source.precision;
    this.polygonOffset = source.polygonOffset;
    this.polygonOffsetFactor = source.polygonOffsetFactor;
    this.polygonOffsetUnits = source.polygonOffsetUnits;
    this.dithering = source.dithering;
    this.alphaTest = source.alphaTest;
    this.alphaToCoverage = source.alphaToCoverage;
    this.premultipliedAlpha = source.premultipliedAlpha;
    this.visible = source.visible;
    this.toneMapped = source.toneMapped;
    this.userData = JSON.parse(JSON.stringify(source.userData));
    return this;
  }
  dispose() {
    this.dispatchEvent({ type: "dispose" });
  }
  set needsUpdate(value) {
    if (value === true)
      this.version++;
  }
};
Material.prototype.isMaterial = true;
Material.fromType = function() {
  return null;
};
var MeshBasicMaterial = class extends Material {
  constructor(parameters) {
    super();
    this.type = "MeshBasicMaterial";
    this.color = new Color2(16777215);
    this.map = null;
    this.lightMap = null;
    this.lightMapIntensity = 1;
    this.aoMap = null;
    this.aoMapIntensity = 1;
    this.specularMap = null;
    this.alphaMap = null;
    this.envMap = null;
    this.combine = MultiplyOperation;
    this.reflectivity = 1;
    this.refractionRatio = 0.98;
    this.wireframe = false;
    this.wireframeLinewidth = 1;
    this.wireframeLinecap = "round";
    this.wireframeLinejoin = "round";
    this.setValues(parameters);
  }
  copy(source) {
    super.copy(source);
    this.color.copy(source.color);
    this.map = source.map;
    this.lightMap = source.lightMap;
    this.lightMapIntensity = source.lightMapIntensity;
    this.aoMap = source.aoMap;
    this.aoMapIntensity = source.aoMapIntensity;
    this.specularMap = source.specularMap;
    this.alphaMap = source.alphaMap;
    this.envMap = source.envMap;
    this.combine = source.combine;
    this.reflectivity = source.reflectivity;
    this.refractionRatio = source.refractionRatio;
    this.wireframe = source.wireframe;
    this.wireframeLinewidth = source.wireframeLinewidth;
    this.wireframeLinecap = source.wireframeLinecap;
    this.wireframeLinejoin = source.wireframeLinejoin;
    return this;
  }
};
MeshBasicMaterial.prototype.isMeshBasicMaterial = true;
var _vector$9 = /* @__PURE__ */ new Vector3();
var _vector2$1 = /* @__PURE__ */ new Vector2();
var BufferAttribute = class {
  constructor(array, itemSize, normalized) {
    if (Array.isArray(array)) {
      throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");
    }
    this.name = "";
    this.array = array;
    this.itemSize = itemSize;
    this.count = array !== void 0 ? array.length / itemSize : 0;
    this.normalized = normalized === true;
    this.usage = StaticDrawUsage;
    this.updateRange = { offset: 0, count: -1 };
    this.version = 0;
  }
  onUploadCallback() {
  }
  set needsUpdate(value) {
    if (value === true)
      this.version++;
  }
  setUsage(value) {
    this.usage = value;
    return this;
  }
  copy(source) {
    this.name = source.name;
    this.array = new source.array.constructor(source.array);
    this.itemSize = source.itemSize;
    this.count = source.count;
    this.normalized = source.normalized;
    this.usage = source.usage;
    return this;
  }
  copyAt(index1, attribute, index2) {
    index1 *= this.itemSize;
    index2 *= attribute.itemSize;
    for (let i2 = 0, l = this.itemSize; i2 < l; i2++) {
      this.array[index1 + i2] = attribute.array[index2 + i2];
    }
    return this;
  }
  copyArray(array) {
    this.array.set(array);
    return this;
  }
  copyColorsArray(colors) {
    const array = this.array;
    let offset = 0;
    for (let i2 = 0, l = colors.length; i2 < l; i2++) {
      let color2 = colors[i2];
      if (color2 === void 0) {
        console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined", i2);
        color2 = new Color2();
      }
      array[offset++] = color2.r;
      array[offset++] = color2.g;
      array[offset++] = color2.b;
    }
    return this;
  }
  copyVector2sArray(vectors) {
    const array = this.array;
    let offset = 0;
    for (let i2 = 0, l = vectors.length; i2 < l; i2++) {
      let vector = vectors[i2];
      if (vector === void 0) {
        console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined", i2);
        vector = new Vector2();
      }
      array[offset++] = vector.x;
      array[offset++] = vector.y;
    }
    return this;
  }
  copyVector3sArray(vectors) {
    const array = this.array;
    let offset = 0;
    for (let i2 = 0, l = vectors.length; i2 < l; i2++) {
      let vector = vectors[i2];
      if (vector === void 0) {
        console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined", i2);
        vector = new Vector3();
      }
      array[offset++] = vector.x;
      array[offset++] = vector.y;
      array[offset++] = vector.z;
    }
    return this;
  }
  copyVector4sArray(vectors) {
    const array = this.array;
    let offset = 0;
    for (let i2 = 0, l = vectors.length; i2 < l; i2++) {
      let vector = vectors[i2];
      if (vector === void 0) {
        console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined", i2);
        vector = new Vector4();
      }
      array[offset++] = vector.x;
      array[offset++] = vector.y;
      array[offset++] = vector.z;
      array[offset++] = vector.w;
    }
    return this;
  }
  applyMatrix3(m) {
    if (this.itemSize === 2) {
      for (let i2 = 0, l = this.count; i2 < l; i2++) {
        _vector2$1.fromBufferAttribute(this, i2);
        _vector2$1.applyMatrix3(m);
        this.setXY(i2, _vector2$1.x, _vector2$1.y);
      }
    } else if (this.itemSize === 3) {
      for (let i2 = 0, l = this.count; i2 < l; i2++) {
        _vector$9.fromBufferAttribute(this, i2);
        _vector$9.applyMatrix3(m);
        this.setXYZ(i2, _vector$9.x, _vector$9.y, _vector$9.z);
      }
    }
    return this;
  }
  applyMatrix4(m) {
    for (let i2 = 0, l = this.count; i2 < l; i2++) {
      _vector$9.fromBufferAttribute(this, i2);
      _vector$9.applyMatrix4(m);
      this.setXYZ(i2, _vector$9.x, _vector$9.y, _vector$9.z);
    }
    return this;
  }
  applyNormalMatrix(m) {
    for (let i2 = 0, l = this.count; i2 < l; i2++) {
      _vector$9.fromBufferAttribute(this, i2);
      _vector$9.applyNormalMatrix(m);
      this.setXYZ(i2, _vector$9.x, _vector$9.y, _vector$9.z);
    }
    return this;
  }
  transformDirection(m) {
    for (let i2 = 0, l = this.count; i2 < l; i2++) {
      _vector$9.fromBufferAttribute(this, i2);
      _vector$9.transformDirection(m);
      this.setXYZ(i2, _vector$9.x, _vector$9.y, _vector$9.z);
    }
    return this;
  }
  set(value, offset = 0) {
    this.array.set(value, offset);
    return this;
  }
  getX(index) {
    return this.array[index * this.itemSize];
  }
  setX(index, x2) {
    this.array[index * this.itemSize] = x2;
    return this;
  }
  getY(index) {
    return this.array[index * this.itemSize + 1];
  }
  setY(index, y2) {
    this.array[index * this.itemSize + 1] = y2;
    return this;
  }
  getZ(index) {
    return this.array[index * this.itemSize + 2];
  }
  setZ(index, z) {
    this.array[index * this.itemSize + 2] = z;
    return this;
  }
  getW(index) {
    return this.array[index * this.itemSize + 3];
  }
  setW(index, w) {
    this.array[index * this.itemSize + 3] = w;
    return this;
  }
  setXY(index, x2, y2) {
    index *= this.itemSize;
    this.array[index + 0] = x2;
    this.array[index + 1] = y2;
    return this;
  }
  setXYZ(index, x2, y2, z) {
    index *= this.itemSize;
    this.array[index + 0] = x2;
    this.array[index + 1] = y2;
    this.array[index + 2] = z;
    return this;
  }
  setXYZW(index, x2, y2, z, w) {
    index *= this.itemSize;
    this.array[index + 0] = x2;
    this.array[index + 1] = y2;
    this.array[index + 2] = z;
    this.array[index + 3] = w;
    return this;
  }
  onUpload(callback) {
    this.onUploadCallback = callback;
    return this;
  }
  clone() {
    return new this.constructor(this.array, this.itemSize).copy(this);
  }
  toJSON() {
    const data = {
      itemSize: this.itemSize,
      type: this.array.constructor.name,
      array: Array.prototype.slice.call(this.array),
      normalized: this.normalized
    };
    if (this.name !== "")
      data.name = this.name;
    if (this.usage !== StaticDrawUsage)
      data.usage = this.usage;
    if (this.updateRange.offset !== 0 || this.updateRange.count !== -1)
      data.updateRange = this.updateRange;
    return data;
  }
};
BufferAttribute.prototype.isBufferAttribute = true;
var Int8BufferAttribute = class extends BufferAttribute {
  constructor(array, itemSize, normalized) {
    super(new Int8Array(array), itemSize, normalized);
  }
};
var Uint8BufferAttribute = class extends BufferAttribute {
  constructor(array, itemSize, normalized) {
    super(new Uint8Array(array), itemSize, normalized);
  }
};
var Uint8ClampedBufferAttribute = class extends BufferAttribute {
  constructor(array, itemSize, normalized) {
    super(new Uint8ClampedArray(array), itemSize, normalized);
  }
};
var Int16BufferAttribute = class extends BufferAttribute {
  constructor(array, itemSize, normalized) {
    super(new Int16Array(array), itemSize, normalized);
  }
};
var Uint16BufferAttribute = class extends BufferAttribute {
  constructor(array, itemSize, normalized) {
    super(new Uint16Array(array), itemSize, normalized);
  }
};
var Int32BufferAttribute = class extends BufferAttribute {
  constructor(array, itemSize, normalized) {
    super(new Int32Array(array), itemSize, normalized);
  }
};
var Uint32BufferAttribute = class extends BufferAttribute {
  constructor(array, itemSize, normalized) {
    super(new Uint32Array(array), itemSize, normalized);
  }
};
var Float16BufferAttribute = class extends BufferAttribute {
  constructor(array, itemSize, normalized) {
    super(new Uint16Array(array), itemSize, normalized);
  }
};
Float16BufferAttribute.prototype.isFloat16BufferAttribute = true;
var Float32BufferAttribute = class extends BufferAttribute {
  constructor(array, itemSize, normalized) {
    super(new Float32Array(array), itemSize, normalized);
  }
};
var Float64BufferAttribute = class extends BufferAttribute {
  constructor(array, itemSize, normalized) {
    super(new Float64Array(array), itemSize, normalized);
  }
};
var _id$1 = 0;
var _m1 = /* @__PURE__ */ new Matrix4();
var _obj = /* @__PURE__ */ new Object3D();
var _offset = /* @__PURE__ */ new Vector3();
var _box$1 = /* @__PURE__ */ new Box3();
var _boxMorphTargets = /* @__PURE__ */ new Box3();
var _vector$8 = /* @__PURE__ */ new Vector3();
var BufferGeometry = class _BufferGeometry extends EventDispatcher {
  constructor() {
    super();
    Object.defineProperty(this, "id", { value: _id$1++ });
    this.uuid = generateUUID();
    this.name = "";
    this.type = "BufferGeometry";
    this.index = null;
    this.attributes = {};
    this.morphAttributes = {};
    this.morphTargetsRelative = false;
    this.groups = [];
    this.boundingBox = null;
    this.boundingSphere = null;
    this.drawRange = { start: 0, count: Infinity };
    this.userData = {};
  }
  getIndex() {
    return this.index;
  }
  setIndex(index) {
    if (Array.isArray(index)) {
      this.index = new (arrayNeedsUint32(index) ? Uint32BufferAttribute : Uint16BufferAttribute)(index, 1);
    } else {
      this.index = index;
    }
    return this;
  }
  getAttribute(name2) {
    return this.attributes[name2];
  }
  setAttribute(name2, attribute) {
    this.attributes[name2] = attribute;
    return this;
  }
  deleteAttribute(name2) {
    delete this.attributes[name2];
    return this;
  }
  hasAttribute(name2) {
    return this.attributes[name2] !== void 0;
  }
  addGroup(start, count2, materialIndex = 0) {
    this.groups.push({
      start,
      count: count2,
      materialIndex
    });
  }
  clearGroups() {
    this.groups = [];
  }
  setDrawRange(start, count2) {
    this.drawRange.start = start;
    this.drawRange.count = count2;
  }
  applyMatrix4(matrix) {
    const position2 = this.attributes.position;
    if (position2 !== void 0) {
      position2.applyMatrix4(matrix);
      position2.needsUpdate = true;
    }
    const normal = this.attributes.normal;
    if (normal !== void 0) {
      const normalMatrix = new Matrix3().getNormalMatrix(matrix);
      normal.applyNormalMatrix(normalMatrix);
      normal.needsUpdate = true;
    }
    const tangent = this.attributes.tangent;
    if (tangent !== void 0) {
      tangent.transformDirection(matrix);
      tangent.needsUpdate = true;
    }
    if (this.boundingBox !== null) {
      this.computeBoundingBox();
    }
    if (this.boundingSphere !== null) {
      this.computeBoundingSphere();
    }
    return this;
  }
  applyQuaternion(q) {
    _m1.makeRotationFromQuaternion(q);
    this.applyMatrix4(_m1);
    return this;
  }
  rotateX(angle) {
    _m1.makeRotationX(angle);
    this.applyMatrix4(_m1);
    return this;
  }
  rotateY(angle) {
    _m1.makeRotationY(angle);
    this.applyMatrix4(_m1);
    return this;
  }
  rotateZ(angle) {
    _m1.makeRotationZ(angle);
    this.applyMatrix4(_m1);
    return this;
  }
  translate(x2, y2, z) {
    _m1.makeTranslation(x2, y2, z);
    this.applyMatrix4(_m1);
    return this;
  }
  scale(x2, y2, z) {
    _m1.makeScale(x2, y2, z);
    this.applyMatrix4(_m1);
    return this;
  }
  lookAt(vector) {
    _obj.lookAt(vector);
    _obj.updateMatrix();
    this.applyMatrix4(_obj.matrix);
    return this;
  }
  center() {
    this.computeBoundingBox();
    this.boundingBox.getCenter(_offset).negate();
    this.translate(_offset.x, _offset.y, _offset.z);
    return this;
  }
  setFromPoints(points) {
    const position2 = [];
    for (let i2 = 0, l = points.length; i2 < l; i2++) {
      const point4 = points[i2];
      position2.push(point4.x, point4.y, point4.z || 0);
    }
    this.setAttribute("position", new Float32BufferAttribute(position2, 3));
    return this;
  }
  computeBoundingBox() {
    if (this.boundingBox === null) {
      this.boundingBox = new Box3();
    }
    const position2 = this.attributes.position;
    const morphAttributesPosition = this.morphAttributes.position;
    if (position2 && position2.isGLBufferAttribute) {
      console.error('THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box. Alternatively set "mesh.frustumCulled" to "false".', this);
      this.boundingBox.set(
        new Vector3(-Infinity, -Infinity, -Infinity),
        new Vector3(Infinity, Infinity, Infinity)
      );
      return;
    }
    if (position2 !== void 0) {
      this.boundingBox.setFromBufferAttribute(position2);
      if (morphAttributesPosition) {
        for (let i2 = 0, il = morphAttributesPosition.length; i2 < il; i2++) {
          const morphAttribute = morphAttributesPosition[i2];
          _box$1.setFromBufferAttribute(morphAttribute);
          if (this.morphTargetsRelative) {
            _vector$8.addVectors(this.boundingBox.min, _box$1.min);
            this.boundingBox.expandByPoint(_vector$8);
            _vector$8.addVectors(this.boundingBox.max, _box$1.max);
            this.boundingBox.expandByPoint(_vector$8);
          } else {
            this.boundingBox.expandByPoint(_box$1.min);
            this.boundingBox.expandByPoint(_box$1.max);
          }
        }
      }
    } else {
      this.boundingBox.makeEmpty();
    }
    if (isNaN(this.boundingBox.min.x) || isNaN(this.boundingBox.min.y) || isNaN(this.boundingBox.min.z)) {
      console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.', this);
    }
  }
  computeBoundingSphere() {
    if (this.boundingSphere === null) {
      this.boundingSphere = new Sphere();
    }
    const position2 = this.attributes.position;
    const morphAttributesPosition = this.morphAttributes.position;
    if (position2 && position2.isGLBufferAttribute) {
      console.error('THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere. Alternatively set "mesh.frustumCulled" to "false".', this);
      this.boundingSphere.set(new Vector3(), Infinity);
      return;
    }
    if (position2) {
      const center = this.boundingSphere.center;
      _box$1.setFromBufferAttribute(position2);
      if (morphAttributesPosition) {
        for (let i2 = 0, il = morphAttributesPosition.length; i2 < il; i2++) {
          const morphAttribute = morphAttributesPosition[i2];
          _boxMorphTargets.setFromBufferAttribute(morphAttribute);
          if (this.morphTargetsRelative) {
            _vector$8.addVectors(_box$1.min, _boxMorphTargets.min);
            _box$1.expandByPoint(_vector$8);
            _vector$8.addVectors(_box$1.max, _boxMorphTargets.max);
            _box$1.expandByPoint(_vector$8);
          } else {
            _box$1.expandByPoint(_boxMorphTargets.min);
            _box$1.expandByPoint(_boxMorphTargets.max);
          }
        }
      }
      _box$1.getCenter(center);
      let maxRadiusSq = 0;
      for (let i2 = 0, il = position2.count; i2 < il; i2++) {
        _vector$8.fromBufferAttribute(position2, i2);
        maxRadiusSq = Math.max(maxRadiusSq, center.distanceToSquared(_vector$8));
      }
      if (morphAttributesPosition) {
        for (let i2 = 0, il = morphAttributesPosition.length; i2 < il; i2++) {
          const morphAttribute = morphAttributesPosition[i2];
          const morphTargetsRelative = this.morphTargetsRelative;
          for (let j = 0, jl = morphAttribute.count; j < jl; j++) {
            _vector$8.fromBufferAttribute(morphAttribute, j);
            if (morphTargetsRelative) {
              _offset.fromBufferAttribute(position2, j);
              _vector$8.add(_offset);
            }
            maxRadiusSq = Math.max(maxRadiusSq, center.distanceToSquared(_vector$8));
          }
        }
      }
      this.boundingSphere.radius = Math.sqrt(maxRadiusSq);
      if (isNaN(this.boundingSphere.radius)) {
        console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.', this);
      }
    }
  }
  computeTangents() {
    const index = this.index;
    const attributes = this.attributes;
    if (index === null || attributes.position === void 0 || attributes.normal === void 0 || attributes.uv === void 0) {
      console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");
      return;
    }
    const indices = index.array;
    const positions = attributes.position.array;
    const normals = attributes.normal.array;
    const uvs = attributes.uv.array;
    const nVertices = positions.length / 3;
    if (this.hasAttribute("tangent") === false) {
      this.setAttribute("tangent", new BufferAttribute(new Float32Array(4 * nVertices), 4));
    }
    const tangents = this.getAttribute("tangent").array;
    const tan1 = [], tan2 = [];
    for (let i2 = 0; i2 < nVertices; i2++) {
      tan1[i2] = new Vector3();
      tan2[i2] = new Vector3();
    }
    const vA = new Vector3(), vB = new Vector3(), vC = new Vector3(), uvA = new Vector2(), uvB = new Vector2(), uvC = new Vector2(), sdir = new Vector3(), tdir = new Vector3();
    function handleTriangle(a2, b, c4) {
      vA.fromArray(positions, a2 * 3);
      vB.fromArray(positions, b * 3);
      vC.fromArray(positions, c4 * 3);
      uvA.fromArray(uvs, a2 * 2);
      uvB.fromArray(uvs, b * 2);
      uvC.fromArray(uvs, c4 * 2);
      vB.sub(vA);
      vC.sub(vA);
      uvB.sub(uvA);
      uvC.sub(uvA);
      const r3 = 1 / (uvB.x * uvC.y - uvC.x * uvB.y);
      if (!isFinite(r3))
        return;
      sdir.copy(vB).multiplyScalar(uvC.y).addScaledVector(vC, -uvB.y).multiplyScalar(r3);
      tdir.copy(vC).multiplyScalar(uvB.x).addScaledVector(vB, -uvC.x).multiplyScalar(r3);
      tan1[a2].add(sdir);
      tan1[b].add(sdir);
      tan1[c4].add(sdir);
      tan2[a2].add(tdir);
      tan2[b].add(tdir);
      tan2[c4].add(tdir);
    }
    let groups = this.groups;
    if (groups.length === 0) {
      groups = [{
        start: 0,
        count: indices.length
      }];
    }
    for (let i2 = 0, il = groups.length; i2 < il; ++i2) {
      const group = groups[i2];
      const start = group.start;
      const count2 = group.count;
      for (let j = start, jl = start + count2; j < jl; j += 3) {
        handleTriangle(
          indices[j + 0],
          indices[j + 1],
          indices[j + 2]
        );
      }
    }
    const tmp2 = new Vector3(), tmp22 = new Vector3();
    const n2 = new Vector3(), n22 = new Vector3();
    function handleVertex(v4) {
      n2.fromArray(normals, v4 * 3);
      n22.copy(n2);
      const t3 = tan1[v4];
      tmp2.copy(t3);
      tmp2.sub(n2.multiplyScalar(n2.dot(t3))).normalize();
      tmp22.crossVectors(n22, t3);
      const test = tmp22.dot(tan2[v4]);
      const w = test < 0 ? -1 : 1;
      tangents[v4 * 4] = tmp2.x;
      tangents[v4 * 4 + 1] = tmp2.y;
      tangents[v4 * 4 + 2] = tmp2.z;
      tangents[v4 * 4 + 3] = w;
    }
    for (let i2 = 0, il = groups.length; i2 < il; ++i2) {
      const group = groups[i2];
      const start = group.start;
      const count2 = group.count;
      for (let j = start, jl = start + count2; j < jl; j += 3) {
        handleVertex(indices[j + 0]);
        handleVertex(indices[j + 1]);
        handleVertex(indices[j + 2]);
      }
    }
  }
  computeVertexNormals() {
    const index = this.index;
    const positionAttribute = this.getAttribute("position");
    if (positionAttribute !== void 0) {
      let normalAttribute = this.getAttribute("normal");
      if (normalAttribute === void 0) {
        normalAttribute = new BufferAttribute(new Float32Array(positionAttribute.count * 3), 3);
        this.setAttribute("normal", normalAttribute);
      } else {
        for (let i2 = 0, il = normalAttribute.count; i2 < il; i2++) {
          normalAttribute.setXYZ(i2, 0, 0, 0);
        }
      }
      const pA = new Vector3(), pB = new Vector3(), pC = new Vector3();
      const nA = new Vector3(), nB = new Vector3(), nC = new Vector3();
      const cb = new Vector3(), ab = new Vector3();
      if (index) {
        for (let i2 = 0, il = index.count; i2 < il; i2 += 3) {
          const vA = index.getX(i2 + 0);
          const vB = index.getX(i2 + 1);
          const vC = index.getX(i2 + 2);
          pA.fromBufferAttribute(positionAttribute, vA);
          pB.fromBufferAttribute(positionAttribute, vB);
          pC.fromBufferAttribute(positionAttribute, vC);
          cb.subVectors(pC, pB);
          ab.subVectors(pA, pB);
          cb.cross(ab);
          nA.fromBufferAttribute(normalAttribute, vA);
          nB.fromBufferAttribute(normalAttribute, vB);
          nC.fromBufferAttribute(normalAttribute, vC);
          nA.add(cb);
          nB.add(cb);
          nC.add(cb);
          normalAttribute.setXYZ(vA, nA.x, nA.y, nA.z);
          normalAttribute.setXYZ(vB, nB.x, nB.y, nB.z);
          normalAttribute.setXYZ(vC, nC.x, nC.y, nC.z);
        }
      } else {
        for (let i2 = 0, il = positionAttribute.count; i2 < il; i2 += 3) {
          pA.fromBufferAttribute(positionAttribute, i2 + 0);
          pB.fromBufferAttribute(positionAttribute, i2 + 1);
          pC.fromBufferAttribute(positionAttribute, i2 + 2);
          cb.subVectors(pC, pB);
          ab.subVectors(pA, pB);
          cb.cross(ab);
          normalAttribute.setXYZ(i2 + 0, cb.x, cb.y, cb.z);
          normalAttribute.setXYZ(i2 + 1, cb.x, cb.y, cb.z);
          normalAttribute.setXYZ(i2 + 2, cb.x, cb.y, cb.z);
        }
      }
      this.normalizeNormals();
      normalAttribute.needsUpdate = true;
    }
  }
  merge(geometry, offset) {
    if (!(geometry && geometry.isBufferGeometry)) {
      console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.", geometry);
      return;
    }
    if (offset === void 0) {
      offset = 0;
      console.warn(
        "THREE.BufferGeometry.merge(): Overwriting original geometry, starting at offset=0. Use BufferGeometryUtils.mergeBufferGeometries() for lossless merge."
      );
    }
    const attributes = this.attributes;
    for (const key in attributes) {
      if (geometry.attributes[key] === void 0)
        continue;
      const attribute1 = attributes[key];
      const attributeArray1 = attribute1.array;
      const attribute2 = geometry.attributes[key];
      const attributeArray2 = attribute2.array;
      const attributeOffset = attribute2.itemSize * offset;
      const length2 = Math.min(attributeArray2.length, attributeArray1.length - attributeOffset);
      for (let i2 = 0, j = attributeOffset; i2 < length2; i2++, j++) {
        attributeArray1[j] = attributeArray2[i2];
      }
    }
    return this;
  }
  normalizeNormals() {
    const normals = this.attributes.normal;
    for (let i2 = 0, il = normals.count; i2 < il; i2++) {
      _vector$8.fromBufferAttribute(normals, i2);
      _vector$8.normalize();
      normals.setXYZ(i2, _vector$8.x, _vector$8.y, _vector$8.z);
    }
  }
  toNonIndexed() {
    function convertBufferAttribute(attribute, indices2) {
      const array = attribute.array;
      const itemSize = attribute.itemSize;
      const normalized = attribute.normalized;
      const array2 = new array.constructor(indices2.length * itemSize);
      let index = 0, index2 = 0;
      for (let i2 = 0, l = indices2.length; i2 < l; i2++) {
        if (attribute.isInterleavedBufferAttribute) {
          index = indices2[i2] * attribute.data.stride + attribute.offset;
        } else {
          index = indices2[i2] * itemSize;
        }
        for (let j = 0; j < itemSize; j++) {
          array2[index2++] = array[index++];
        }
      }
      return new BufferAttribute(array2, itemSize, normalized);
    }
    if (this.index === null) {
      console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed.");
      return this;
    }
    const geometry2 = new _BufferGeometry();
    const indices = this.index.array;
    const attributes = this.attributes;
    for (const name2 in attributes) {
      const attribute = attributes[name2];
      const newAttribute = convertBufferAttribute(attribute, indices);
      geometry2.setAttribute(name2, newAttribute);
    }
    const morphAttributes = this.morphAttributes;
    for (const name2 in morphAttributes) {
      const morphArray = [];
      const morphAttribute = morphAttributes[name2];
      for (let i2 = 0, il = morphAttribute.length; i2 < il; i2++) {
        const attribute = morphAttribute[i2];
        const newAttribute = convertBufferAttribute(attribute, indices);
        morphArray.push(newAttribute);
      }
      geometry2.morphAttributes[name2] = morphArray;
    }
    geometry2.morphTargetsRelative = this.morphTargetsRelative;
    const groups = this.groups;
    for (let i2 = 0, l = groups.length; i2 < l; i2++) {
      const group = groups[i2];
      geometry2.addGroup(group.start, group.count, group.materialIndex);
    }
    return geometry2;
  }
  toJSON() {
    const data = {
      metadata: {
        version: 4.5,
        type: "BufferGeometry",
        generator: "BufferGeometry.toJSON"
      }
    };
    data.uuid = this.uuid;
    data.type = this.type;
    if (this.name !== "")
      data.name = this.name;
    if (Object.keys(this.userData).length > 0)
      data.userData = this.userData;
    if (this.parameters !== void 0) {
      const parameters = this.parameters;
      for (const key in parameters) {
        if (parameters[key] !== void 0)
          data[key] = parameters[key];
      }
      return data;
    }
    data.data = { attributes: {} };
    const index = this.index;
    if (index !== null) {
      data.data.index = {
        type: index.array.constructor.name,
        array: Array.prototype.slice.call(index.array)
      };
    }
    const attributes = this.attributes;
    for (const key in attributes) {
      const attribute = attributes[key];
      data.data.attributes[key] = attribute.toJSON(data.data);
    }
    const morphAttributes = {};
    let hasMorphAttributes = false;
    for (const key in this.morphAttributes) {
      const attributeArray = this.morphAttributes[key];
      const array = [];
      for (let i2 = 0, il = attributeArray.length; i2 < il; i2++) {
        const attribute = attributeArray[i2];
        array.push(attribute.toJSON(data.data));
      }
      if (array.length > 0) {
        morphAttributes[key] = array;
        hasMorphAttributes = true;
      }
    }
    if (hasMorphAttributes) {
      data.data.morphAttributes = morphAttributes;
      data.data.morphTargetsRelative = this.morphTargetsRelative;
    }
    const groups = this.groups;
    if (groups.length > 0) {
      data.data.groups = JSON.parse(JSON.stringify(groups));
    }
    const boundingSphere = this.boundingSphere;
    if (boundingSphere !== null) {
      data.data.boundingSphere = {
        center: boundingSphere.center.toArray(),
        radius: boundingSphere.radius
      };
    }
    return data;
  }
  clone() {
    return new this.constructor().copy(this);
  }
  copy(source) {
    this.index = null;
    this.attributes = {};
    this.morphAttributes = {};
    this.groups = [];
    this.boundingBox = null;
    this.boundingSphere = null;
    const data = {};
    this.name = source.name;
    const index = source.index;
    if (index !== null) {
      this.setIndex(index.clone(data));
    }
    const attributes = source.attributes;
    for (const name2 in attributes) {
      const attribute = attributes[name2];
      this.setAttribute(name2, attribute.clone(data));
    }
    const morphAttributes = source.morphAttributes;
    for (const name2 in morphAttributes) {
      const array = [];
      const morphAttribute = morphAttributes[name2];
      for (let i2 = 0, l = morphAttribute.length; i2 < l; i2++) {
        array.push(morphAttribute[i2].clone(data));
      }
      this.morphAttributes[name2] = array;
    }
    this.morphTargetsRelative = source.morphTargetsRelative;
    const groups = source.groups;
    for (let i2 = 0, l = groups.length; i2 < l; i2++) {
      const group = groups[i2];
      this.addGroup(group.start, group.count, group.materialIndex);
    }
    const boundingBox = source.boundingBox;
    if (boundingBox !== null) {
      this.boundingBox = boundingBox.clone();
    }
    const boundingSphere = source.boundingSphere;
    if (boundingSphere !== null) {
      this.boundingSphere = boundingSphere.clone();
    }
    this.drawRange.start = source.drawRange.start;
    this.drawRange.count = source.drawRange.count;
    this.userData = source.userData;
    if (source.parameters !== void 0)
      this.parameters = Object.assign({}, source.parameters);
    return this;
  }
  dispose() {
    this.dispatchEvent({ type: "dispose" });
  }
};
BufferGeometry.prototype.isBufferGeometry = true;
var _inverseMatrix$2 = /* @__PURE__ */ new Matrix4();
var _ray$2 = /* @__PURE__ */ new Ray();
var _sphere$3 = /* @__PURE__ */ new Sphere();
var _vA$1 = /* @__PURE__ */ new Vector3();
var _vB$1 = /* @__PURE__ */ new Vector3();
var _vC$1 = /* @__PURE__ */ new Vector3();
var _tempA = /* @__PURE__ */ new Vector3();
var _tempB = /* @__PURE__ */ new Vector3();
var _tempC = /* @__PURE__ */ new Vector3();
var _morphA = /* @__PURE__ */ new Vector3();
var _morphB = /* @__PURE__ */ new Vector3();
var _morphC = /* @__PURE__ */ new Vector3();
var _uvA$1 = /* @__PURE__ */ new Vector2();
var _uvB$1 = /* @__PURE__ */ new Vector2();
var _uvC$1 = /* @__PURE__ */ new Vector2();
var _intersectionPoint = /* @__PURE__ */ new Vector3();
var _intersectionPointWorld = /* @__PURE__ */ new Vector3();
var Mesh = class extends Object3D {
  constructor(geometry = new BufferGeometry(), material = new MeshBasicMaterial()) {
    super();
    this.type = "Mesh";
    this.geometry = geometry;
    this.material = material;
    this.updateMorphTargets();
  }
  copy(source) {
    super.copy(source);
    if (source.morphTargetInfluences !== void 0) {
      this.morphTargetInfluences = source.morphTargetInfluences.slice();
    }
    if (source.morphTargetDictionary !== void 0) {
      this.morphTargetDictionary = Object.assign({}, source.morphTargetDictionary);
    }
    this.material = source.material;
    this.geometry = source.geometry;
    return this;
  }
  updateMorphTargets() {
    const geometry = this.geometry;
    if (geometry.isBufferGeometry) {
      const morphAttributes = geometry.morphAttributes;
      const keys4 = Object.keys(morphAttributes);
      if (keys4.length > 0) {
        const morphAttribute = morphAttributes[keys4[0]];
        if (morphAttribute !== void 0) {
          this.morphTargetInfluences = [];
          this.morphTargetDictionary = {};
          for (let m = 0, ml = morphAttribute.length; m < ml; m++) {
            const name2 = morphAttribute[m].name || String(m);
            this.morphTargetInfluences.push(0);
            this.morphTargetDictionary[name2] = m;
          }
        }
      }
    } else {
      const morphTargets = geometry.morphTargets;
      if (morphTargets !== void 0 && morphTargets.length > 0) {
        console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");
      }
    }
  }
  raycast(raycaster, intersects2) {
    const geometry = this.geometry;
    const material = this.material;
    const matrixWorld = this.matrixWorld;
    if (material === void 0)
      return;
    if (geometry.boundingSphere === null)
      geometry.computeBoundingSphere();
    _sphere$3.copy(geometry.boundingSphere);
    _sphere$3.applyMatrix4(matrixWorld);
    if (raycaster.ray.intersectsSphere(_sphere$3) === false)
      return;
    _inverseMatrix$2.copy(matrixWorld).invert();
    _ray$2.copy(raycaster.ray).applyMatrix4(_inverseMatrix$2);
    if (geometry.boundingBox !== null) {
      if (_ray$2.intersectsBox(geometry.boundingBox) === false)
        return;
    }
    let intersection;
    if (geometry.isBufferGeometry) {
      const index = geometry.index;
      const position2 = geometry.attributes.position;
      const morphPosition = geometry.morphAttributes.position;
      const morphTargetsRelative = geometry.morphTargetsRelative;
      const uv = geometry.attributes.uv;
      const uv2 = geometry.attributes.uv2;
      const groups = geometry.groups;
      const drawRange = geometry.drawRange;
      if (index !== null) {
        if (Array.isArray(material)) {
          for (let i2 = 0, il = groups.length; i2 < il; i2++) {
            const group = groups[i2];
            const groupMaterial = material[group.materialIndex];
            const start = Math.max(group.start, drawRange.start);
            const end = Math.min(index.count, Math.min(group.start + group.count, drawRange.start + drawRange.count));
            for (let j = start, jl = end; j < jl; j += 3) {
              const a2 = index.getX(j);
              const b = index.getX(j + 1);
              const c4 = index.getX(j + 2);
              intersection = checkBufferGeometryIntersection(this, groupMaterial, raycaster, _ray$2, position2, morphPosition, morphTargetsRelative, uv, uv2, a2, b, c4);
              if (intersection) {
                intersection.faceIndex = Math.floor(j / 3);
                intersection.face.materialIndex = group.materialIndex;
                intersects2.push(intersection);
              }
            }
          }
        } else {
          const start = Math.max(0, drawRange.start);
          const end = Math.min(index.count, drawRange.start + drawRange.count);
          for (let i2 = start, il = end; i2 < il; i2 += 3) {
            const a2 = index.getX(i2);
            const b = index.getX(i2 + 1);
            const c4 = index.getX(i2 + 2);
            intersection = checkBufferGeometryIntersection(this, material, raycaster, _ray$2, position2, morphPosition, morphTargetsRelative, uv, uv2, a2, b, c4);
            if (intersection) {
              intersection.faceIndex = Math.floor(i2 / 3);
              intersects2.push(intersection);
            }
          }
        }
      } else if (position2 !== void 0) {
        if (Array.isArray(material)) {
          for (let i2 = 0, il = groups.length; i2 < il; i2++) {
            const group = groups[i2];
            const groupMaterial = material[group.materialIndex];
            const start = Math.max(group.start, drawRange.start);
            const end = Math.min(position2.count, Math.min(group.start + group.count, drawRange.start + drawRange.count));
            for (let j = start, jl = end; j < jl; j += 3) {
              const a2 = j;
              const b = j + 1;
              const c4 = j + 2;
              intersection = checkBufferGeometryIntersection(this, groupMaterial, raycaster, _ray$2, position2, morphPosition, morphTargetsRelative, uv, uv2, a2, b, c4);
              if (intersection) {
                intersection.faceIndex = Math.floor(j / 3);
                intersection.face.materialIndex = group.materialIndex;
                intersects2.push(intersection);
              }
            }
          }
        } else {
          const start = Math.max(0, drawRange.start);
          const end = Math.min(position2.count, drawRange.start + drawRange.count);
          for (let i2 = start, il = end; i2 < il; i2 += 3) {
            const a2 = i2;
            const b = i2 + 1;
            const c4 = i2 + 2;
            intersection = checkBufferGeometryIntersection(this, material, raycaster, _ray$2, position2, morphPosition, morphTargetsRelative, uv, uv2, a2, b, c4);
            if (intersection) {
              intersection.faceIndex = Math.floor(i2 / 3);
              intersects2.push(intersection);
            }
          }
        }
      }
    } else if (geometry.isGeometry) {
      console.error("THREE.Mesh.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");
    }
  }
};
Mesh.prototype.isMesh = true;
function checkIntersection(object, material, raycaster, ray, pA, pB, pC, point4) {
  let intersect;
  if (material.side === BackSide) {
    intersect = ray.intersectTriangle(pC, pB, pA, true, point4);
  } else {
    intersect = ray.intersectTriangle(pA, pB, pC, material.side !== DoubleSide, point4);
  }
  if (intersect === null)
    return null;
  _intersectionPointWorld.copy(point4);
  _intersectionPointWorld.applyMatrix4(object.matrixWorld);
  const distance = raycaster.ray.origin.distanceTo(_intersectionPointWorld);
  if (distance < raycaster.near || distance > raycaster.far)
    return null;
  return {
    distance,
    point: _intersectionPointWorld.clone(),
    object
  };
}
function checkBufferGeometryIntersection(object, material, raycaster, ray, position2, morphPosition, morphTargetsRelative, uv, uv2, a2, b, c4) {
  _vA$1.fromBufferAttribute(position2, a2);
  _vB$1.fromBufferAttribute(position2, b);
  _vC$1.fromBufferAttribute(position2, c4);
  const morphInfluences = object.morphTargetInfluences;
  if (morphPosition && morphInfluences) {
    _morphA.set(0, 0, 0);
    _morphB.set(0, 0, 0);
    _morphC.set(0, 0, 0);
    for (let i2 = 0, il = morphPosition.length; i2 < il; i2++) {
      const influence = morphInfluences[i2];
      const morphAttribute = morphPosition[i2];
      if (influence === 0)
        continue;
      _tempA.fromBufferAttribute(morphAttribute, a2);
      _tempB.fromBufferAttribute(morphAttribute, b);
      _tempC.fromBufferAttribute(morphAttribute, c4);
      if (morphTargetsRelative) {
        _morphA.addScaledVector(_tempA, influence);
        _morphB.addScaledVector(_tempB, influence);
        _morphC.addScaledVector(_tempC, influence);
      } else {
        _morphA.addScaledVector(_tempA.sub(_vA$1), influence);
        _morphB.addScaledVector(_tempB.sub(_vB$1), influence);
        _morphC.addScaledVector(_tempC.sub(_vC$1), influence);
      }
    }
    _vA$1.add(_morphA);
    _vB$1.add(_morphB);
    _vC$1.add(_morphC);
  }
  if (object.isSkinnedMesh) {
    object.boneTransform(a2, _vA$1);
    object.boneTransform(b, _vB$1);
    object.boneTransform(c4, _vC$1);
  }
  const intersection = checkIntersection(object, material, raycaster, ray, _vA$1, _vB$1, _vC$1, _intersectionPoint);
  if (intersection) {
    if (uv) {
      _uvA$1.fromBufferAttribute(uv, a2);
      _uvB$1.fromBufferAttribute(uv, b);
      _uvC$1.fromBufferAttribute(uv, c4);
      intersection.uv = Triangle.getUV(_intersectionPoint, _vA$1, _vB$1, _vC$1, _uvA$1, _uvB$1, _uvC$1, new Vector2());
    }
    if (uv2) {
      _uvA$1.fromBufferAttribute(uv2, a2);
      _uvB$1.fromBufferAttribute(uv2, b);
      _uvC$1.fromBufferAttribute(uv2, c4);
      intersection.uv2 = Triangle.getUV(_intersectionPoint, _vA$1, _vB$1, _vC$1, _uvA$1, _uvB$1, _uvC$1, new Vector2());
    }
    const face = {
      a: a2,
      b,
      c: c4,
      normal: new Vector3(),
      materialIndex: 0
    };
    Triangle.getNormal(_vA$1, _vB$1, _vC$1, face.normal);
    intersection.face = face;
  }
  return intersection;
}
var BoxGeometry = class _BoxGeometry extends BufferGeometry {
  constructor(width = 1, height = 1, depth = 1, widthSegments = 1, heightSegments = 1, depthSegments = 1) {
    super();
    this.type = "BoxGeometry";
    this.parameters = {
      width,
      height,
      depth,
      widthSegments,
      heightSegments,
      depthSegments
    };
    const scope = this;
    widthSegments = Math.floor(widthSegments);
    heightSegments = Math.floor(heightSegments);
    depthSegments = Math.floor(depthSegments);
    const indices = [];
    const vertices = [];
    const normals = [];
    const uvs = [];
    let numberOfVertices = 0;
    let groupStart = 0;
    buildPlane("z", "y", "x", -1, -1, depth, height, width, depthSegments, heightSegments, 0);
    buildPlane("z", "y", "x", 1, -1, depth, height, -width, depthSegments, heightSegments, 1);
    buildPlane("x", "z", "y", 1, 1, width, depth, height, widthSegments, depthSegments, 2);
    buildPlane("x", "z", "y", 1, -1, width, depth, -height, widthSegments, depthSegments, 3);
    buildPlane("x", "y", "z", 1, -1, width, height, depth, widthSegments, heightSegments, 4);
    buildPlane("x", "y", "z", -1, -1, width, height, -depth, widthSegments, heightSegments, 5);
    this.setIndex(indices);
    this.setAttribute("position", new Float32BufferAttribute(vertices, 3));
    this.setAttribute("normal", new Float32BufferAttribute(normals, 3));
    this.setAttribute("uv", new Float32BufferAttribute(uvs, 2));
    function buildPlane(u, v4, w, udir, vdir, width2, height2, depth2, gridX, gridY, materialIndex) {
      const segmentWidth = width2 / gridX;
      const segmentHeight = height2 / gridY;
      const widthHalf = width2 / 2;
      const heightHalf = height2 / 2;
      const depthHalf = depth2 / 2;
      const gridX1 = gridX + 1;
      const gridY1 = gridY + 1;
      let vertexCounter = 0;
      let groupCount = 0;
      const vector = new Vector3();
      for (let iy = 0; iy < gridY1; iy++) {
        const y2 = iy * segmentHeight - heightHalf;
        for (let ix = 0; ix < gridX1; ix++) {
          const x2 = ix * segmentWidth - widthHalf;
          vector[u] = x2 * udir;
          vector[v4] = y2 * vdir;
          vector[w] = depthHalf;
          vertices.push(vector.x, vector.y, vector.z);
          vector[u] = 0;
          vector[v4] = 0;
          vector[w] = depth2 > 0 ? 1 : -1;
          normals.push(vector.x, vector.y, vector.z);
          uvs.push(ix / gridX);
          uvs.push(1 - iy / gridY);
          vertexCounter += 1;
        }
      }
      for (let iy = 0; iy < gridY; iy++) {
        for (let ix = 0; ix < gridX; ix++) {
          const a2 = numberOfVertices + ix + gridX1 * iy;
          const b = numberOfVertices + ix + gridX1 * (iy + 1);
          const c4 = numberOfVertices + (ix + 1) + gridX1 * (iy + 1);
          const d = numberOfVertices + (ix + 1) + gridX1 * iy;
          indices.push(a2, b, d);
          indices.push(b, c4, d);
          groupCount += 6;
        }
      }
      scope.addGroup(groupStart, groupCount, materialIndex);
      groupStart += groupCount;
      numberOfVertices += vertexCounter;
    }
  }
  static fromJSON(data) {
    return new _BoxGeometry(data.width, data.height, data.depth, data.widthSegments, data.heightSegments, data.depthSegments);
  }
};
function cloneUniforms(src) {
  const dst = {};
  for (const u in src) {
    dst[u] = {};
    for (const p in src[u]) {
      const property = src[u][p];
      if (property && (property.isColor || property.isMatrix3 || property.isMatrix4 || property.isVector2 || property.isVector3 || property.isVector4 || property.isTexture || property.isQuaternion)) {
        dst[u][p] = property.clone();
      } else if (Array.isArray(property)) {
        dst[u][p] = property.slice();
      } else {
        dst[u][p] = property;
      }
    }
  }
  return dst;
}
function mergeUniforms(uniforms) {
  const merged = {};
  for (let u = 0; u < uniforms.length; u++) {
    const tmp2 = cloneUniforms(uniforms[u]);
    for (const p in tmp2) {
      merged[p] = tmp2[p];
    }
  }
  return merged;
}
var UniformsUtils = { clone: cloneUniforms, merge: mergeUniforms };
var default_vertex = "void main() {\n	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}";
var default_fragment = "void main() {\n	gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}";
var ShaderMaterial = class extends Material {
  constructor(parameters) {
    super();
    this.type = "ShaderMaterial";
    this.defines = {};
    this.uniforms = {};
    this.vertexShader = default_vertex;
    this.fragmentShader = default_fragment;
    this.linewidth = 1;
    this.wireframe = false;
    this.wireframeLinewidth = 1;
    this.fog = false;
    this.lights = false;
    this.clipping = false;
    this.extensions = {
      derivatives: false,
      // set to use derivatives
      fragDepth: false,
      // set to use fragment depth values
      drawBuffers: false,
      // set to use draw buffers
      shaderTextureLOD: false
      // set to use shader texture LOD
    };
    this.defaultAttributeValues = {
      "color": [1, 1, 1],
      "uv": [0, 0],
      "uv2": [0, 0]
    };
    this.index0AttributeName = void 0;
    this.uniformsNeedUpdate = false;
    this.glslVersion = null;
    if (parameters !== void 0) {
      if (parameters.attributes !== void 0) {
        console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead.");
      }
      this.setValues(parameters);
    }
  }
  copy(source) {
    super.copy(source);
    this.fragmentShader = source.fragmentShader;
    this.vertexShader = source.vertexShader;
    this.uniforms = cloneUniforms(source.uniforms);
    this.defines = Object.assign({}, source.defines);
    this.wireframe = source.wireframe;
    this.wireframeLinewidth = source.wireframeLinewidth;
    this.lights = source.lights;
    this.clipping = source.clipping;
    this.extensions = Object.assign({}, source.extensions);
    this.glslVersion = source.glslVersion;
    return this;
  }
  toJSON(meta2) {
    const data = super.toJSON(meta2);
    data.glslVersion = this.glslVersion;
    data.uniforms = {};
    for (const name2 in this.uniforms) {
      const uniform = this.uniforms[name2];
      const value = uniform.value;
      if (value && value.isTexture) {
        data.uniforms[name2] = {
          type: "t",
          value: value.toJSON(meta2).uuid
        };
      } else if (value && value.isColor) {
        data.uniforms[name2] = {
          type: "c",
          value: value.getHex()
        };
      } else if (value && value.isVector2) {
        data.uniforms[name2] = {
          type: "v2",
          value: value.toArray()
        };
      } else if (value && value.isVector3) {
        data.uniforms[name2] = {
          type: "v3",
          value: value.toArray()
        };
      } else if (value && value.isVector4) {
        data.uniforms[name2] = {
          type: "v4",
          value: value.toArray()
        };
      } else if (value && value.isMatrix3) {
        data.uniforms[name2] = {
          type: "m3",
          value: value.toArray()
        };
      } else if (value && value.isMatrix4) {
        data.uniforms[name2] = {
          type: "m4",
          value: value.toArray()
        };
      } else {
        data.uniforms[name2] = {
          value
        };
      }
    }
    if (Object.keys(this.defines).length > 0)
      data.defines = this.defines;
    data.vertexShader = this.vertexShader;
    data.fragmentShader = this.fragmentShader;
    const extensions2 = {};
    for (const key in this.extensions) {
      if (this.extensions[key] === true)
        extensions2[key] = true;
    }
    if (Object.keys(extensions2).length > 0)
      data.extensions = extensions2;
    return data;
  }
};
ShaderMaterial.prototype.isShaderMaterial = true;
var Camera = class extends Object3D {
  constructor() {
    super();
    this.type = "Camera";
    this.matrixWorldInverse = new Matrix4();
    this.projectionMatrix = new Matrix4();
    this.projectionMatrixInverse = new Matrix4();
  }
  copy(source, recursive) {
    super.copy(source, recursive);
    this.matrixWorldInverse.copy(source.matrixWorldInverse);
    this.projectionMatrix.copy(source.projectionMatrix);
    this.projectionMatrixInverse.copy(source.projectionMatrixInverse);
    return this;
  }
  getWorldDirection(target) {
    this.updateWorldMatrix(true, false);
    const e3 = this.matrixWorld.elements;
    return target.set(-e3[8], -e3[9], -e3[10]).normalize();
  }
  updateMatrixWorld(force) {
    super.updateMatrixWorld(force);
    this.matrixWorldInverse.copy(this.matrixWorld).invert();
  }
  updateWorldMatrix(updateParents, updateChildren) {
    super.updateWorldMatrix(updateParents, updateChildren);
    this.matrixWorldInverse.copy(this.matrixWorld).invert();
  }
  clone() {
    return new this.constructor().copy(this);
  }
};
Camera.prototype.isCamera = true;
var PerspectiveCamera = class extends Camera {
  constructor(fov2 = 50, aspect2 = 1, near = 0.1, far = 2e3) {
    super();
    this.type = "PerspectiveCamera";
    this.fov = fov2;
    this.zoom = 1;
    this.near = near;
    this.far = far;
    this.focus = 10;
    this.aspect = aspect2;
    this.view = null;
    this.filmGauge = 35;
    this.filmOffset = 0;
    this.updateProjectionMatrix();
  }
  copy(source, recursive) {
    super.copy(source, recursive);
    this.fov = source.fov;
    this.zoom = source.zoom;
    this.near = source.near;
    this.far = source.far;
    this.focus = source.focus;
    this.aspect = source.aspect;
    this.view = source.view === null ? null : Object.assign({}, source.view);
    this.filmGauge = source.filmGauge;
    this.filmOffset = source.filmOffset;
    return this;
  }
  /**
   * Sets the FOV by focal length in respect to the current .filmGauge.
   *
   * The default film gauge is 35, so that the focal length can be specified for
   * a 35mm (full frame) camera.
   *
   * Values for focal length and film gauge must have the same unit.
   */
  setFocalLength(focalLength) {
    const vExtentSlope = 0.5 * this.getFilmHeight() / focalLength;
    this.fov = RAD2DEG * 2 * Math.atan(vExtentSlope);
    this.updateProjectionMatrix();
  }
  /**
   * Calculates the focal length from the current .fov and .filmGauge.
   */
  getFocalLength() {
    const vExtentSlope = Math.tan(DEG2RAD * 0.5 * this.fov);
    return 0.5 * this.getFilmHeight() / vExtentSlope;
  }
  getEffectiveFOV() {
    return RAD2DEG * 2 * Math.atan(
      Math.tan(DEG2RAD * 0.5 * this.fov) / this.zoom
    );
  }
  getFilmWidth() {
    return this.filmGauge * Math.min(this.aspect, 1);
  }
  getFilmHeight() {
    return this.filmGauge / Math.max(this.aspect, 1);
  }
  /**
   * Sets an offset in a larger frustum. This is useful for multi-window or
   * multi-monitor/multi-machine setups.
   *
   * For example, if you have 3x2 monitors and each monitor is 1920x1080 and
   * the monitors are in grid like this
   *
   *   +---+---+---+
   *   | A | B | C |
   *   +---+---+---+
   *   | D | E | F |
   *   +---+---+---+
   *
   * then for each monitor you would call it like this
   *
   *   const w = 1920;
   *   const h = 1080;
   *   const fullWidth = w * 3;
   *   const fullHeight = h * 2;
   *
   *   --A--
   *   camera.setViewOffset( fullWidth, fullHeight, w * 0, h * 0, w, h );
   *   --B--
   *   camera.setViewOffset( fullWidth, fullHeight, w * 1, h * 0, w, h );
   *   --C--
   *   camera.setViewOffset( fullWidth, fullHeight, w * 2, h * 0, w, h );
   *   --D--
   *   camera.setViewOffset( fullWidth, fullHeight, w * 0, h * 1, w, h );
   *   --E--
   *   camera.setViewOffset( fullWidth, fullHeight, w * 1, h * 1, w, h );
   *   --F--
   *   camera.setViewOffset( fullWidth, fullHeight, w * 2, h * 1, w, h );
   *
   *   Note there is no reason monitors have to be the same size or in a grid.
   */
  setViewOffset(fullWidth, fullHeight, x2, y2, width, height) {
    this.aspect = fullWidth / fullHeight;
    if (this.view === null) {
      this.view = {
        enabled: true,
        fullWidth: 1,
        fullHeight: 1,
        offsetX: 0,
        offsetY: 0,
        width: 1,
        height: 1
      };
    }
    this.view.enabled = true;
    this.view.fullWidth = fullWidth;
    this.view.fullHeight = fullHeight;
    this.view.offsetX = x2;
    this.view.offsetY = y2;
    this.view.width = width;
    this.view.height = height;
    this.updateProjectionMatrix();
  }
  clearViewOffset() {
    if (this.view !== null) {
      this.view.enabled = false;
    }
    this.updateProjectionMatrix();
  }
  updateProjectionMatrix() {
    const near = this.near;
    let top2 = near * Math.tan(DEG2RAD * 0.5 * this.fov) / this.zoom;
    let height = 2 * top2;
    let width = this.aspect * height;
    let left = -0.5 * width;
    const view = this.view;
    if (this.view !== null && this.view.enabled) {
      const fullWidth = view.fullWidth, fullHeight = view.fullHeight;
      left += view.offsetX * width / fullWidth;
      top2 -= view.offsetY * height / fullHeight;
      width *= view.width / fullWidth;
      height *= view.height / fullHeight;
    }
    const skew = this.filmOffset;
    if (skew !== 0)
      left += near * skew / this.getFilmWidth();
    this.projectionMatrix.makePerspective(left, left + width, top2, top2 - height, near, this.far);
    this.projectionMatrixInverse.copy(this.projectionMatrix).invert();
  }
  toJSON(meta2) {
    const data = super.toJSON(meta2);
    data.object.fov = this.fov;
    data.object.zoom = this.zoom;
    data.object.near = this.near;
    data.object.far = this.far;
    data.object.focus = this.focus;
    data.object.aspect = this.aspect;
    if (this.view !== null)
      data.object.view = Object.assign({}, this.view);
    data.object.filmGauge = this.filmGauge;
    data.object.filmOffset = this.filmOffset;
    return data;
  }
};
PerspectiveCamera.prototype.isPerspectiveCamera = true;
var fov = 90;
var aspect = 1;
var CubeCamera = class extends Object3D {
  constructor(near, far, renderTarget) {
    super();
    this.type = "CubeCamera";
    if (renderTarget.isWebGLCubeRenderTarget !== true) {
      console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.");
      return;
    }
    this.renderTarget = renderTarget;
    const cameraPX = new PerspectiveCamera(fov, aspect, near, far);
    cameraPX.layers = this.layers;
    cameraPX.up.set(0, -1, 0);
    cameraPX.lookAt(new Vector3(1, 0, 0));
    this.add(cameraPX);
    const cameraNX = new PerspectiveCamera(fov, aspect, near, far);
    cameraNX.layers = this.layers;
    cameraNX.up.set(0, -1, 0);
    cameraNX.lookAt(new Vector3(-1, 0, 0));
    this.add(cameraNX);
    const cameraPY = new PerspectiveCamera(fov, aspect, near, far);
    cameraPY.layers = this.layers;
    cameraPY.up.set(0, 0, 1);
    cameraPY.lookAt(new Vector3(0, 1, 0));
    this.add(cameraPY);
    const cameraNY = new PerspectiveCamera(fov, aspect, near, far);
    cameraNY.layers = this.layers;
    cameraNY.up.set(0, 0, -1);
    cameraNY.lookAt(new Vector3(0, -1, 0));
    this.add(cameraNY);
    const cameraPZ = new PerspectiveCamera(fov, aspect, near, far);
    cameraPZ.layers = this.layers;
    cameraPZ.up.set(0, -1, 0);
    cameraPZ.lookAt(new Vector3(0, 0, 1));
    this.add(cameraPZ);
    const cameraNZ = new PerspectiveCamera(fov, aspect, near, far);
    cameraNZ.layers = this.layers;
    cameraNZ.up.set(0, -1, 0);
    cameraNZ.lookAt(new Vector3(0, 0, -1));
    this.add(cameraNZ);
  }
  update(renderer, scene) {
    if (this.parent === null)
      this.updateMatrixWorld();
    const renderTarget = this.renderTarget;
    const [cameraPX, cameraNX, cameraPY, cameraNY, cameraPZ, cameraNZ] = this.children;
    const currentRenderTarget = renderer.getRenderTarget();
    const currentOutputEncoding = renderer.outputEncoding;
    const currentToneMapping = renderer.toneMapping;
    const currentXrEnabled = renderer.xr.enabled;
    renderer.outputEncoding = LinearEncoding;
    renderer.toneMapping = NoToneMapping;
    renderer.xr.enabled = false;
    const generateMipmaps = renderTarget.texture.generateMipmaps;
    renderTarget.texture.generateMipmaps = false;
    renderer.setRenderTarget(renderTarget, 0);
    renderer.render(scene, cameraPX);
    renderer.setRenderTarget(renderTarget, 1);
    renderer.render(scene, cameraNX);
    renderer.setRenderTarget(renderTarget, 2);
    renderer.render(scene, cameraPY);
    renderer.setRenderTarget(renderTarget, 3);
    renderer.render(scene, cameraNY);
    renderer.setRenderTarget(renderTarget, 4);
    renderer.render(scene, cameraPZ);
    renderTarget.texture.generateMipmaps = generateMipmaps;
    renderer.setRenderTarget(renderTarget, 5);
    renderer.render(scene, cameraNZ);
    renderer.setRenderTarget(currentRenderTarget);
    renderer.outputEncoding = currentOutputEncoding;
    renderer.toneMapping = currentToneMapping;
    renderer.xr.enabled = currentXrEnabled;
    renderTarget.texture.needsPMREMUpdate = true;
  }
};
var CubeTexture = class extends Texture {
  constructor(images, mapping, wrapS, wrapT, magFilter, minFilter, format3, type, anisotropy, encoding) {
    images = images !== void 0 ? images : [];
    mapping = mapping !== void 0 ? mapping : CubeReflectionMapping;
    super(images, mapping, wrapS, wrapT, magFilter, minFilter, format3, type, anisotropy, encoding);
    this.flipY = false;
  }
  get images() {
    return this.image;
  }
  set images(value) {
    this.image = value;
  }
};
CubeTexture.prototype.isCubeTexture = true;
var WebGLCubeRenderTarget = class extends WebGLRenderTarget {
  constructor(size, options = {}) {
    super(size, size, options);
    const image = { width: size, height: size, depth: 1 };
    const images = [image, image, image, image, image, image];
    this.texture = new CubeTexture(images, options.mapping, options.wrapS, options.wrapT, options.magFilter, options.minFilter, options.format, options.type, options.anisotropy, options.encoding);
    this.texture.isRenderTargetTexture = true;
    this.texture.generateMipmaps = options.generateMipmaps !== void 0 ? options.generateMipmaps : false;
    this.texture.minFilter = options.minFilter !== void 0 ? options.minFilter : LinearFilter;
  }
  fromEquirectangularTexture(renderer, texture) {
    this.texture.type = texture.type;
    this.texture.encoding = texture.encoding;
    this.texture.generateMipmaps = texture.generateMipmaps;
    this.texture.minFilter = texture.minFilter;
    this.texture.magFilter = texture.magFilter;
    const shader = {
      uniforms: {
        tEquirect: { value: null }
      },
      vertexShader: (
        /* glsl */
        `

				varying vec3 vWorldDirection;

				vec3 transformDirection( in vec3 dir, in mat4 matrix ) {

					return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );

				}

				void main() {

					vWorldDirection = transformDirection( position, modelMatrix );

					#include <begin_vertex>
					#include <project_vertex>

				}
			`
      ),
      fragmentShader: (
        /* glsl */
        `

				uniform sampler2D tEquirect;

				varying vec3 vWorldDirection;

				#include <common>

				void main() {

					vec3 direction = normalize( vWorldDirection );

					vec2 sampleUV = equirectUv( direction );

					gl_FragColor = texture2D( tEquirect, sampleUV );

				}
			`
      )
    };
    const geometry = new BoxGeometry(5, 5, 5);
    const material = new ShaderMaterial({
      name: "CubemapFromEquirect",
      uniforms: cloneUniforms(shader.uniforms),
      vertexShader: shader.vertexShader,
      fragmentShader: shader.fragmentShader,
      side: BackSide,
      blending: NoBlending
    });
    material.uniforms.tEquirect.value = texture;
    const mesh = new Mesh(geometry, material);
    const currentMinFilter = texture.minFilter;
    if (texture.minFilter === LinearMipmapLinearFilter)
      texture.minFilter = LinearFilter;
    const camera = new CubeCamera(1, 10, this);
    camera.update(renderer, mesh);
    texture.minFilter = currentMinFilter;
    mesh.geometry.dispose();
    mesh.material.dispose();
    return this;
  }
  clear(renderer, color2, depth, stencil) {
    const currentRenderTarget = renderer.getRenderTarget();
    for (let i2 = 0; i2 < 6; i2++) {
      renderer.setRenderTarget(this, i2);
      renderer.clear(color2, depth, stencil);
    }
    renderer.setRenderTarget(currentRenderTarget);
  }
};
WebGLCubeRenderTarget.prototype.isWebGLCubeRenderTarget = true;
var _vector1 = /* @__PURE__ */ new Vector3();
var _vector2 = /* @__PURE__ */ new Vector3();
var _normalMatrix = /* @__PURE__ */ new Matrix3();
var Plane = class {
  constructor(normal = new Vector3(1, 0, 0), constant = 0) {
    this.normal = normal;
    this.constant = constant;
  }
  set(normal, constant) {
    this.normal.copy(normal);
    this.constant = constant;
    return this;
  }
  setComponents(x2, y2, z, w) {
    this.normal.set(x2, y2, z);
    this.constant = w;
    return this;
  }
  setFromNormalAndCoplanarPoint(normal, point4) {
    this.normal.copy(normal);
    this.constant = -point4.dot(this.normal);
    return this;
  }
  setFromCoplanarPoints(a2, b, c4) {
    const normal = _vector1.subVectors(c4, b).cross(_vector2.subVectors(a2, b)).normalize();
    this.setFromNormalAndCoplanarPoint(normal, a2);
    return this;
  }
  copy(plane) {
    this.normal.copy(plane.normal);
    this.constant = plane.constant;
    return this;
  }
  normalize() {
    const inverseNormalLength = 1 / this.normal.length();
    this.normal.multiplyScalar(inverseNormalLength);
    this.constant *= inverseNormalLength;
    return this;
  }
  negate() {
    this.constant *= -1;
    this.normal.negate();
    return this;
  }
  distanceToPoint(point4) {
    return this.normal.dot(point4) + this.constant;
  }
  distanceToSphere(sphere) {
    return this.distanceToPoint(sphere.center) - sphere.radius;
  }
  projectPoint(point4, target) {
    return target.copy(this.normal).multiplyScalar(-this.distanceToPoint(point4)).add(point4);
  }
  intersectLine(line2, target) {
    const direction = line2.delta(_vector1);
    const denominator = this.normal.dot(direction);
    if (denominator === 0) {
      if (this.distanceToPoint(line2.start) === 0) {
        return target.copy(line2.start);
      }
      return null;
    }
    const t3 = -(line2.start.dot(this.normal) + this.constant) / denominator;
    if (t3 < 0 || t3 > 1) {
      return null;
    }
    return target.copy(direction).multiplyScalar(t3).add(line2.start);
  }
  intersectsLine(line2) {
    const startSign = this.distanceToPoint(line2.start);
    const endSign = this.distanceToPoint(line2.end);
    return startSign < 0 && endSign > 0 || endSign < 0 && startSign > 0;
  }
  intersectsBox(box) {
    return box.intersectsPlane(this);
  }
  intersectsSphere(sphere) {
    return sphere.intersectsPlane(this);
  }
  coplanarPoint(target) {
    return target.copy(this.normal).multiplyScalar(-this.constant);
  }
  applyMatrix4(matrix, optionalNormalMatrix) {
    const normalMatrix = optionalNormalMatrix || _normalMatrix.getNormalMatrix(matrix);
    const referencePoint = this.coplanarPoint(_vector1).applyMatrix4(matrix);
    const normal = this.normal.applyMatrix3(normalMatrix).normalize();
    this.constant = -referencePoint.dot(normal);
    return this;
  }
  translate(offset) {
    this.constant -= offset.dot(this.normal);
    return this;
  }
  equals(plane) {
    return plane.normal.equals(this.normal) && plane.constant === this.constant;
  }
  clone() {
    return new this.constructor().copy(this);
  }
};
Plane.prototype.isPlane = true;
var _sphere$2 = /* @__PURE__ */ new Sphere();
var _vector$7 = /* @__PURE__ */ new Vector3();
var Frustum = class {
  constructor(p0 = new Plane(), p1 = new Plane(), p2 = new Plane(), p3 = new Plane(), p4 = new Plane(), p5 = new Plane()) {
    this.planes = [p0, p1, p2, p3, p4, p5];
  }
  set(p0, p1, p2, p3, p4, p5) {
    const planes = this.planes;
    planes[0].copy(p0);
    planes[1].copy(p1);
    planes[2].copy(p2);
    planes[3].copy(p3);
    planes[4].copy(p4);
    planes[5].copy(p5);
    return this;
  }
  copy(frustum) {
    const planes = this.planes;
    for (let i2 = 0; i2 < 6; i2++) {
      planes[i2].copy(frustum.planes[i2]);
    }
    return this;
  }
  setFromProjectionMatrix(m) {
    const planes = this.planes;
    const me = m.elements;
    const me0 = me[0], me1 = me[1], me2 = me[2], me3 = me[3];
    const me4 = me[4], me5 = me[5], me6 = me[6], me7 = me[7];
    const me8 = me[8], me9 = me[9], me10 = me[10], me11 = me[11];
    const me12 = me[12], me13 = me[13], me14 = me[14], me15 = me[15];
    planes[0].setComponents(me3 - me0, me7 - me4, me11 - me8, me15 - me12).normalize();
    planes[1].setComponents(me3 + me0, me7 + me4, me11 + me8, me15 + me12).normalize();
    planes[2].setComponents(me3 + me1, me7 + me5, me11 + me9, me15 + me13).normalize();
    planes[3].setComponents(me3 - me1, me7 - me5, me11 - me9, me15 - me13).normalize();
    planes[4].setComponents(me3 - me2, me7 - me6, me11 - me10, me15 - me14).normalize();
    planes[5].setComponents(me3 + me2, me7 + me6, me11 + me10, me15 + me14).normalize();
    return this;
  }
  intersectsObject(object) {
    const geometry = object.geometry;
    if (geometry.boundingSphere === null)
      geometry.computeBoundingSphere();
    _sphere$2.copy(geometry.boundingSphere).applyMatrix4(object.matrixWorld);
    return this.intersectsSphere(_sphere$2);
  }
  intersectsSprite(sprite) {
    _sphere$2.center.set(0, 0, 0);
    _sphere$2.radius = 0.7071067811865476;
    _sphere$2.applyMatrix4(sprite.matrixWorld);
    return this.intersectsSphere(_sphere$2);
  }
  intersectsSphere(sphere) {
    const planes = this.planes;
    const center = sphere.center;
    const negRadius = -sphere.radius;
    for (let i2 = 0; i2 < 6; i2++) {
      const distance = planes[i2].distanceToPoint(center);
      if (distance < negRadius) {
        return false;
      }
    }
    return true;
  }
  intersectsBox(box) {
    const planes = this.planes;
    for (let i2 = 0; i2 < 6; i2++) {
      const plane = planes[i2];
      _vector$7.x = plane.normal.x > 0 ? box.max.x : box.min.x;
      _vector$7.y = plane.normal.y > 0 ? box.max.y : box.min.y;
      _vector$7.z = plane.normal.z > 0 ? box.max.z : box.min.z;
      if (plane.distanceToPoint(_vector$7) < 0) {
        return false;
      }
    }
    return true;
  }
  containsPoint(point4) {
    const planes = this.planes;
    for (let i2 = 0; i2 < 6; i2++) {
      if (planes[i2].distanceToPoint(point4) < 0) {
        return false;
      }
    }
    return true;
  }
  clone() {
    return new this.constructor().copy(this);
  }
};
function WebGLAnimation() {
  let context2 = null;
  let isAnimating = false;
  let animationLoop = null;
  let requestId = null;
  function onAnimationFrame(time2, frame) {
    animationLoop(time2, frame);
    requestId = context2.requestAnimationFrame(onAnimationFrame);
  }
  return {
    start: function() {
      if (isAnimating === true)
        return;
      if (animationLoop === null)
        return;
      requestId = context2.requestAnimationFrame(onAnimationFrame);
      isAnimating = true;
    },
    stop: function() {
      context2.cancelAnimationFrame(requestId);
      isAnimating = false;
    },
    setAnimationLoop: function(callback) {
      animationLoop = callback;
    },
    setContext: function(value) {
      context2 = value;
    }
  };
}
function WebGLAttributes(gl, capabilities) {
  const isWebGL2 = capabilities.isWebGL2;
  const buffers = /* @__PURE__ */ new WeakMap();
  function createBuffer(attribute, bufferType) {
    const array = attribute.array;
    const usage = attribute.usage;
    const buffer = gl.createBuffer();
    gl.bindBuffer(bufferType, buffer);
    gl.bufferData(bufferType, array, usage);
    attribute.onUploadCallback();
    let type;
    if (array instanceof Float32Array) {
      type = 5126;
    } else if (array instanceof Uint16Array) {
      if (attribute.isFloat16BufferAttribute) {
        if (isWebGL2) {
          type = 5131;
        } else {
          throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");
        }
      } else {
        type = 5123;
      }
    } else if (array instanceof Int16Array) {
      type = 5122;
    } else if (array instanceof Uint32Array) {
      type = 5125;
    } else if (array instanceof Int32Array) {
      type = 5124;
    } else if (array instanceof Int8Array) {
      type = 5120;
    } else if (array instanceof Uint8Array) {
      type = 5121;
    } else if (array instanceof Uint8ClampedArray) {
      type = 5121;
    } else {
      throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: " + array);
    }
    return {
      buffer,
      type,
      bytesPerElement: array.BYTES_PER_ELEMENT,
      version: attribute.version
    };
  }
  function updateBuffer(buffer, attribute, bufferType) {
    const array = attribute.array;
    const updateRange = attribute.updateRange;
    gl.bindBuffer(bufferType, buffer);
    if (updateRange.count === -1) {
      gl.bufferSubData(bufferType, 0, array);
    } else {
      if (isWebGL2) {
        gl.bufferSubData(
          bufferType,
          updateRange.offset * array.BYTES_PER_ELEMENT,
          array,
          updateRange.offset,
          updateRange.count
        );
      } else {
        gl.bufferSubData(
          bufferType,
          updateRange.offset * array.BYTES_PER_ELEMENT,
          array.subarray(updateRange.offset, updateRange.offset + updateRange.count)
        );
      }
      updateRange.count = -1;
    }
  }
  function get3(attribute) {
    if (attribute.isInterleavedBufferAttribute)
      attribute = attribute.data;
    return buffers.get(attribute);
  }
  function remove2(attribute) {
    if (attribute.isInterleavedBufferAttribute)
      attribute = attribute.data;
    const data = buffers.get(attribute);
    if (data) {
      gl.deleteBuffer(data.buffer);
      buffers.delete(attribute);
    }
  }
  function update(attribute, bufferType) {
    if (attribute.isGLBufferAttribute) {
      const cached = buffers.get(attribute);
      if (!cached || cached.version < attribute.version) {
        buffers.set(attribute, {
          buffer: attribute.buffer,
          type: attribute.type,
          bytesPerElement: attribute.elementSize,
          version: attribute.version
        });
      }
      return;
    }
    if (attribute.isInterleavedBufferAttribute)
      attribute = attribute.data;
    const data = buffers.get(attribute);
    if (data === void 0) {
      buffers.set(attribute, createBuffer(attribute, bufferType));
    } else if (data.version < attribute.version) {
      updateBuffer(data.buffer, attribute, bufferType);
      data.version = attribute.version;
    }
  }
  return {
    get: get3,
    remove: remove2,
    update
  };
}
var PlaneGeometry = class _PlaneGeometry extends BufferGeometry {
  constructor(width = 1, height = 1, widthSegments = 1, heightSegments = 1) {
    super();
    this.type = "PlaneGeometry";
    this.parameters = {
      width,
      height,
      widthSegments,
      heightSegments
    };
    const width_half = width / 2;
    const height_half = height / 2;
    const gridX = Math.floor(widthSegments);
    const gridY = Math.floor(heightSegments);
    const gridX1 = gridX + 1;
    const gridY1 = gridY + 1;
    const segment_width = width / gridX;
    const segment_height = height / gridY;
    const indices = [];
    const vertices = [];
    const normals = [];
    const uvs = [];
    for (let iy = 0; iy < gridY1; iy++) {
      const y2 = iy * segment_height - height_half;
      for (let ix = 0; ix < gridX1; ix++) {
        const x2 = ix * segment_width - width_half;
        vertices.push(x2, -y2, 0);
        normals.push(0, 0, 1);
        uvs.push(ix / gridX);
        uvs.push(1 - iy / gridY);
      }
    }
    for (let iy = 0; iy < gridY; iy++) {
      for (let ix = 0; ix < gridX; ix++) {
        const a2 = ix + gridX1 * iy;
        const b = ix + gridX1 * (iy + 1);
        const c4 = ix + 1 + gridX1 * (iy + 1);
        const d = ix + 1 + gridX1 * iy;
        indices.push(a2, b, d);
        indices.push(b, c4, d);
      }
    }
    this.setIndex(indices);
    this.setAttribute("position", new Float32BufferAttribute(vertices, 3));
    this.setAttribute("normal", new Float32BufferAttribute(normals, 3));
    this.setAttribute("uv", new Float32BufferAttribute(uvs, 2));
  }
  static fromJSON(data) {
    return new _PlaneGeometry(data.width, data.height, data.widthSegments, data.heightSegments);
  }
};
var alphamap_fragment = "#ifdef USE_ALPHAMAP\n	diffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif";
var alphamap_pars_fragment = "#ifdef USE_ALPHAMAP\n	uniform sampler2D alphaMap;\n#endif";
var alphatest_fragment = "#ifdef USE_ALPHATEST\n	if ( diffuseColor.a < alphaTest ) discard;\n#endif";
var alphatest_pars_fragment = "#ifdef USE_ALPHATEST\n	uniform float alphaTest;\n#endif";
var aomap_fragment = "#ifdef USE_AOMAP\n	float ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n	reflectedLight.indirectDiffuse *= ambientOcclusion;\n	#if defined( USE_ENVMAP ) && defined( STANDARD )\n		float dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n		reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\n	#endif\n#endif";
var aomap_pars_fragment = "#ifdef USE_AOMAP\n	uniform sampler2D aoMap;\n	uniform float aoMapIntensity;\n#endif";
var begin_vertex = "vec3 transformed = vec3( position );";
var beginnormal_vertex = "vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n	vec3 objectTangent = vec3( tangent.xyz );\n#endif";
var bsdfs = "vec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n	return RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n	float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n	return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n	float a2 = pow2( alpha );\n	float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n	float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n	return 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n	float a2 = pow2( alpha );\n	float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n	return RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 f0, const in float f90, const in float roughness ) {\n	float alpha = pow2( roughness );\n	vec3 halfDir = normalize( lightDir + viewDir );\n	float dotNL = saturate( dot( normal, lightDir ) );\n	float dotNV = saturate( dot( normal, viewDir ) );\n	float dotNH = saturate( dot( normal, halfDir ) );\n	float dotVH = saturate( dot( viewDir, halfDir ) );\n	vec3 F = F_Schlick( f0, f90, dotVH );\n	float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n	float D = D_GGX( alpha, dotNH );\n	return F * ( V * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n	const float LUT_SIZE = 64.0;\n	const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n	const float LUT_BIAS = 0.5 / LUT_SIZE;\n	float dotNV = saturate( dot( N, V ) );\n	vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n	uv = uv * LUT_SCALE + LUT_BIAS;\n	return uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n	float l = length( f );\n	return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n	float x = dot( v1, v2 );\n	float y = abs( x );\n	float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n	float b = 3.4175940 + ( 4.1616724 + y ) * y;\n	float v = a / b;\n	float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n	return cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n	vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n	vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n	vec3 lightNormal = cross( v1, v2 );\n	if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n	vec3 T1, T2;\n	T1 = normalize( V - N * dot( V, N ) );\n	T2 = - cross( N, T1 );\n	mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n	vec3 coords[ 4 ];\n	coords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n	coords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n	coords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n	coords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n	coords[ 0 ] = normalize( coords[ 0 ] );\n	coords[ 1 ] = normalize( coords[ 1 ] );\n	coords[ 2 ] = normalize( coords[ 2 ] );\n	coords[ 3 ] = normalize( coords[ 3 ] );\n	vec3 vectorFormFactor = vec3( 0.0 );\n	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n	float result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n	return vec3( result );\n}\nfloat G_BlinnPhong_Implicit( ) {\n	return 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n	return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {\n	vec3 halfDir = normalize( lightDir + viewDir );\n	float dotNH = saturate( dot( normal, halfDir ) );\n	float dotVH = saturate( dot( viewDir, halfDir ) );\n	vec3 F = F_Schlick( specularColor, 1.0, dotVH );\n	float G = G_BlinnPhong_Implicit( );\n	float D = D_BlinnPhong( shininess, dotNH );\n	return F * ( G * D );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie( float roughness, float dotNH ) {\n	float alpha = pow2( roughness );\n	float invAlpha = 1.0 / alpha;\n	float cos2h = dotNH * dotNH;\n	float sin2h = max( 1.0 - cos2h, 0.0078125 );\n	return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n}\nfloat V_Neubelt( float dotNV, float dotNL ) {\n	return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\n}\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {\n	vec3 halfDir = normalize( lightDir + viewDir );\n	float dotNL = saturate( dot( normal, lightDir ) );\n	float dotNV = saturate( dot( normal, viewDir ) );\n	float dotNH = saturate( dot( normal, halfDir ) );\n	float D = D_Charlie( sheenRoughness, dotNH );\n	float V = V_Neubelt( dotNV, dotNL );\n	return sheenColor * ( D * V );\n}\n#endif";
var bumpmap_pars_fragment = "#ifdef USE_BUMPMAP\n	uniform sampler2D bumpMap;\n	uniform float bumpScale;\n	vec2 dHdxy_fwd() {\n		vec2 dSTdx = dFdx( vUv );\n		vec2 dSTdy = dFdy( vUv );\n		float Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n		float dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n		float dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n		return vec2( dBx, dBy );\n	}\n	vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\n		vec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n		vec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\n		vec3 vN = surf_norm;\n		vec3 R1 = cross( vSigmaY, vN );\n		vec3 R2 = cross( vN, vSigmaX );\n		float fDet = dot( vSigmaX, R1 ) * faceDirection;\n		vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n		return normalize( abs( fDet ) * surf_norm - vGrad );\n	}\n#endif";
var clipping_planes_fragment = "#if NUM_CLIPPING_PLANES > 0\n	vec4 plane;\n	#pragma unroll_loop_start\n	for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n		plane = clippingPlanes[ i ];\n		if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n	}\n	#pragma unroll_loop_end\n	#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n		bool clipped = true;\n		#pragma unroll_loop_start\n		for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n			plane = clippingPlanes[ i ];\n			clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n		}\n		#pragma unroll_loop_end\n		if ( clipped ) discard;\n	#endif\n#endif";
var clipping_planes_pars_fragment = "#if NUM_CLIPPING_PLANES > 0\n	varying vec3 vClipPosition;\n	uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif";
var clipping_planes_pars_vertex = "#if NUM_CLIPPING_PLANES > 0\n	varying vec3 vClipPosition;\n#endif";
var clipping_planes_vertex = "#if NUM_CLIPPING_PLANES > 0\n	vClipPosition = - mvPosition.xyz;\n#endif";
var color_fragment = "#if defined( USE_COLOR_ALPHA )\n	diffuseColor *= vColor;\n#elif defined( USE_COLOR )\n	diffuseColor.rgb *= vColor;\n#endif";
var color_pars_fragment = "#if defined( USE_COLOR_ALPHA )\n	varying vec4 vColor;\n#elif defined( USE_COLOR )\n	varying vec3 vColor;\n#endif";
var color_pars_vertex = "#if defined( USE_COLOR_ALPHA )\n	varying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n	varying vec3 vColor;\n#endif";
var color_vertex = "#if defined( USE_COLOR_ALPHA )\n	vColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n	vColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n	vColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n	vColor.xyz *= instanceColor.xyz;\n#endif";
var common = "#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nhighp float rand( const in vec2 uv ) {\n	const highp float a = 12.9898, b = 78.233, c = 43758.5453;\n	highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n	return fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n	float precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n	float precisionSafeLength( vec3 v ) {\n		float maxComponent = max3( abs( v ) );\n		return length( v / maxComponent ) * maxComponent;\n	}\n#endif\nstruct IncidentLight {\n	vec3 color;\n	vec3 direction;\n	bool visible;\n};\nstruct ReflectedLight {\n	vec3 directDiffuse;\n	vec3 directSpecular;\n	vec3 indirectDiffuse;\n	vec3 indirectSpecular;\n};\nstruct GeometricContext {\n	vec3 position;\n	vec3 normal;\n	vec3 viewDir;\n#ifdef USE_CLEARCOAT\n	vec3 clearcoatNormal;\n#endif\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n	return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n	return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nmat3 transposeMat3( const in mat3 m ) {\n	mat3 tmp;\n	tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n	tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n	tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n	return tmp;\n}\nfloat linearToRelativeLuminance( const in vec3 color ) {\n	vec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n	return dot( weights, color.rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n	return m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n	float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n	float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n	return vec2( u, v );\n}";
var cube_uv_reflection_fragment = "#ifdef ENVMAP_TYPE_CUBE_UV\n	#define cubeUV_minMipLevel 4.0\n	#define cubeUV_minTileSize 16.0\n	float getFace( vec3 direction ) {\n		vec3 absDirection = abs( direction );\n		float face = - 1.0;\n		if ( absDirection.x > absDirection.z ) {\n			if ( absDirection.x > absDirection.y )\n				face = direction.x > 0.0 ? 0.0 : 3.0;\n			else\n				face = direction.y > 0.0 ? 1.0 : 4.0;\n		} else {\n			if ( absDirection.z > absDirection.y )\n				face = direction.z > 0.0 ? 2.0 : 5.0;\n			else\n				face = direction.y > 0.0 ? 1.0 : 4.0;\n		}\n		return face;\n	}\n	vec2 getUV( vec3 direction, float face ) {\n		vec2 uv;\n		if ( face == 0.0 ) {\n			uv = vec2( direction.z, direction.y ) / abs( direction.x );\n		} else if ( face == 1.0 ) {\n			uv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n		} else if ( face == 2.0 ) {\n			uv = vec2( - direction.x, direction.y ) / abs( direction.z );\n		} else if ( face == 3.0 ) {\n			uv = vec2( - direction.z, direction.y ) / abs( direction.x );\n		} else if ( face == 4.0 ) {\n			uv = vec2( - direction.x, direction.z ) / abs( direction.y );\n		} else {\n			uv = vec2( direction.x, direction.y ) / abs( direction.z );\n		}\n		return 0.5 * ( uv + 1.0 );\n	}\n	vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n		float face = getFace( direction );\n		float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n		mipInt = max( mipInt, cubeUV_minMipLevel );\n		float faceSize = exp2( mipInt );\n		vec2 uv = getUV( direction, face ) * ( faceSize - 1.0 ) + 0.5;\n		if ( face > 2.0 ) {\n			uv.y += faceSize;\n			face -= 3.0;\n		}\n		uv.x += face * faceSize;\n		uv.x += filterInt * 3.0 * cubeUV_minTileSize;\n		uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\n		uv.x *= CUBEUV_TEXEL_WIDTH;\n		uv.y *= CUBEUV_TEXEL_HEIGHT;\n		#ifdef texture2DGradEXT\n			return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;\n		#else\n			return texture2D( envMap, uv ).rgb;\n		#endif\n	}\n	#define r0 1.0\n	#define v0 0.339\n	#define m0 - 2.0\n	#define r1 0.8\n	#define v1 0.276\n	#define m1 - 1.0\n	#define r4 0.4\n	#define v4 0.046\n	#define m4 2.0\n	#define r5 0.305\n	#define v5 0.016\n	#define m5 3.0\n	#define r6 0.21\n	#define v6 0.0038\n	#define m6 4.0\n	float roughnessToMip( float roughness ) {\n		float mip = 0.0;\n		if ( roughness >= r1 ) {\n			mip = ( r0 - roughness ) * ( m1 - m0 ) / ( r0 - r1 ) + m0;\n		} else if ( roughness >= r4 ) {\n			mip = ( r1 - roughness ) * ( m4 - m1 ) / ( r1 - r4 ) + m1;\n		} else if ( roughness >= r5 ) {\n			mip = ( r4 - roughness ) * ( m5 - m4 ) / ( r4 - r5 ) + m4;\n		} else if ( roughness >= r6 ) {\n			mip = ( r5 - roughness ) * ( m6 - m5 ) / ( r5 - r6 ) + m5;\n		} else {\n			mip = - 2.0 * log2( 1.16 * roughness );		}\n		return mip;\n	}\n	vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n		float mip = clamp( roughnessToMip( roughness ), m0, CUBEUV_MAX_MIP );\n		float mipF = fract( mip );\n		float mipInt = floor( mip );\n		vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n		if ( mipF == 0.0 ) {\n			return vec4( color0, 1.0 );\n		} else {\n			vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n			return vec4( mix( color0, color1, mipF ), 1.0 );\n		}\n	}\n#endif";
var defaultnormal_vertex = "vec3 transformedNormal = objectNormal;\n#ifdef USE_INSTANCING\n	mat3 m = mat3( instanceMatrix );\n	transformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n	transformedNormal = m * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n	transformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n	vec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n	#ifdef FLIP_SIDED\n		transformedTangent = - transformedTangent;\n	#endif\n#endif";
var displacementmap_pars_vertex = "#ifdef USE_DISPLACEMENTMAP\n	uniform sampler2D displacementMap;\n	uniform float displacementScale;\n	uniform float displacementBias;\n#endif";
var displacementmap_vertex = "#ifdef USE_DISPLACEMENTMAP\n	transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );\n#endif";
var emissivemap_fragment = "#ifdef USE_EMISSIVEMAP\n	vec4 emissiveColor = texture2D( emissiveMap, vUv );\n	totalEmissiveRadiance *= emissiveColor.rgb;\n#endif";
var emissivemap_pars_fragment = "#ifdef USE_EMISSIVEMAP\n	uniform sampler2D emissiveMap;\n#endif";
var encodings_fragment = "gl_FragColor = linearToOutputTexel( gl_FragColor );";
var encodings_pars_fragment = "vec4 LinearToLinear( in vec4 value ) {\n	return value;\n}\nvec4 LinearTosRGB( in vec4 value ) {\n	return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}";
var envmap_fragment = "#ifdef USE_ENVMAP\n	#ifdef ENV_WORLDPOS\n		vec3 cameraToFrag;\n		if ( isOrthographic ) {\n			cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n		} else {\n			cameraToFrag = normalize( vWorldPosition - cameraPosition );\n		}\n		vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n		#ifdef ENVMAP_MODE_REFLECTION\n			vec3 reflectVec = reflect( cameraToFrag, worldNormal );\n		#else\n			vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n		#endif\n	#else\n		vec3 reflectVec = vReflect;\n	#endif\n	#ifdef ENVMAP_TYPE_CUBE\n		vec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n	#elif defined( ENVMAP_TYPE_CUBE_UV )\n		vec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );\n	#else\n		vec4 envColor = vec4( 0.0 );\n	#endif\n	#ifdef ENVMAP_BLENDING_MULTIPLY\n		outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n	#elif defined( ENVMAP_BLENDING_MIX )\n		outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n	#elif defined( ENVMAP_BLENDING_ADD )\n		outgoingLight += envColor.xyz * specularStrength * reflectivity;\n	#endif\n#endif";
var envmap_common_pars_fragment = "#ifdef USE_ENVMAP\n	uniform float envMapIntensity;\n	uniform float flipEnvMap;\n	#ifdef ENVMAP_TYPE_CUBE\n		uniform samplerCube envMap;\n	#else\n		uniform sampler2D envMap;\n	#endif\n	\n#endif";
var envmap_pars_fragment = "#ifdef USE_ENVMAP\n	uniform float reflectivity;\n	#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n		#define ENV_WORLDPOS\n	#endif\n	#ifdef ENV_WORLDPOS\n		varying vec3 vWorldPosition;\n		uniform float refractionRatio;\n	#else\n		varying vec3 vReflect;\n	#endif\n#endif";
var envmap_pars_vertex = "#ifdef USE_ENVMAP\n	#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG )\n		#define ENV_WORLDPOS\n	#endif\n	#ifdef ENV_WORLDPOS\n		\n		varying vec3 vWorldPosition;\n	#else\n		varying vec3 vReflect;\n		uniform float refractionRatio;\n	#endif\n#endif";
var envmap_vertex = "#ifdef USE_ENVMAP\n	#ifdef ENV_WORLDPOS\n		vWorldPosition = worldPosition.xyz;\n	#else\n		vec3 cameraToVertex;\n		if ( isOrthographic ) {\n			cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n		} else {\n			cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n		}\n		vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n		#ifdef ENVMAP_MODE_REFLECTION\n			vReflect = reflect( cameraToVertex, worldNormal );\n		#else\n			vReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n		#endif\n	#endif\n#endif";
var fog_vertex = "#ifdef USE_FOG\n	vFogDepth = - mvPosition.z;\n#endif";
var fog_pars_vertex = "#ifdef USE_FOG\n	varying float vFogDepth;\n#endif";
var fog_fragment = "#ifdef USE_FOG\n	#ifdef FOG_EXP2\n		float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\n	#else\n		float fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\n	#endif\n	gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif";
var fog_pars_fragment = "#ifdef USE_FOG\n	uniform vec3 fogColor;\n	varying float vFogDepth;\n	#ifdef FOG_EXP2\n		uniform float fogDensity;\n	#else\n		uniform float fogNear;\n		uniform float fogFar;\n	#endif\n#endif";
var gradientmap_pars_fragment = "#ifdef USE_GRADIENTMAP\n	uniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n	float dotNL = dot( normal, lightDirection );\n	vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n	#ifdef USE_GRADIENTMAP\n		return vec3( texture2D( gradientMap, coord ).r );\n	#else\n		return ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n	#endif\n}";
var lightmap_fragment = "#ifdef USE_LIGHTMAP\n	vec4 lightMapTexel = texture2D( lightMap, vUv2 );\n	vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n	reflectedLight.indirectDiffuse += lightMapIrradiance;\n#endif";
var lightmap_pars_fragment = "#ifdef USE_LIGHTMAP\n	uniform sampler2D lightMap;\n	uniform float lightMapIntensity;\n#endif";
var lights_lambert_vertex = "vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\nvIndirectFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n	vLightBack = vec3( 0.0 );\n	vIndirectBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\nvIndirectFront += getAmbientLightIrradiance( ambientLightColor );\nvIndirectFront += getLightProbeIrradiance( lightProbe, geometry.normal );\n#ifdef DOUBLE_SIDED\n	vIndirectBack += getAmbientLightIrradiance( ambientLightColor );\n	vIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry.normal );\n#endif\n#if NUM_POINT_LIGHTS > 0\n	#pragma unroll_loop_start\n	for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n		getPointLightInfo( pointLights[ i ], geometry, directLight );\n		dotNL = dot( geometry.normal, directLight.direction );\n		directLightColor_Diffuse = directLight.color;\n		vLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n		#ifdef DOUBLE_SIDED\n			vLightBack += saturate( - dotNL ) * directLightColor_Diffuse;\n		#endif\n	}\n	#pragma unroll_loop_end\n#endif\n#if NUM_SPOT_LIGHTS > 0\n	#pragma unroll_loop_start\n	for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n		getSpotLightInfo( spotLights[ i ], geometry, directLight );\n		dotNL = dot( geometry.normal, directLight.direction );\n		directLightColor_Diffuse = directLight.color;\n		vLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n		#ifdef DOUBLE_SIDED\n			vLightBack += saturate( - dotNL ) * directLightColor_Diffuse;\n		#endif\n	}\n	#pragma unroll_loop_end\n#endif\n#if NUM_DIR_LIGHTS > 0\n	#pragma unroll_loop_start\n	for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n		getDirectionalLightInfo( directionalLights[ i ], geometry, directLight );\n		dotNL = dot( geometry.normal, directLight.direction );\n		directLightColor_Diffuse = directLight.color;\n		vLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n		#ifdef DOUBLE_SIDED\n			vLightBack += saturate( - dotNL ) * directLightColor_Diffuse;\n		#endif\n	}\n	#pragma unroll_loop_end\n#endif\n#if NUM_HEMI_LIGHTS > 0\n	#pragma unroll_loop_start\n	for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n		vIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal );\n		#ifdef DOUBLE_SIDED\n			vIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry.normal );\n		#endif\n	}\n	#pragma unroll_loop_end\n#endif";
var lights_pars_begin = "uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n	float x = normal.x, y = normal.y, z = normal.z;\n	vec3 result = shCoefficients[ 0 ] * 0.886227;\n	result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n	result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n	result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n	result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n	result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n	result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n	result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n	result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n	return result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\n	vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n	vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n	return irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n	vec3 irradiance = ambientLightColor;\n	return irradiance;\n}\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n	#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n		float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n		if ( cutoffDistance > 0.0 ) {\n			distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n		}\n		return distanceFalloff;\n	#else\n		if ( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n			return pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent );\n		}\n		return 1.0;\n	#endif\n}\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n	return smoothstep( coneCosine, penumbraCosine, angleCosine );\n}\n#if NUM_DIR_LIGHTS > 0\n	struct DirectionalLight {\n		vec3 direction;\n		vec3 color;\n	};\n	uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n	void getDirectionalLightInfo( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight light ) {\n		light.color = directionalLight.color;\n		light.direction = directionalLight.direction;\n		light.visible = true;\n	}\n#endif\n#if NUM_POINT_LIGHTS > 0\n	struct PointLight {\n		vec3 position;\n		vec3 color;\n		float distance;\n		float decay;\n	};\n	uniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n	void getPointLightInfo( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight light ) {\n		vec3 lVector = pointLight.position - geometry.position;\n		light.direction = normalize( lVector );\n		float lightDistance = length( lVector );\n		light.color = pointLight.color;\n		light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n		light.visible = ( light.color != vec3( 0.0 ) );\n	}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n	struct SpotLight {\n		vec3 position;\n		vec3 direction;\n		vec3 color;\n		float distance;\n		float decay;\n		float coneCos;\n		float penumbraCos;\n	};\n	uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n	void getSpotLightInfo( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight light ) {\n		vec3 lVector = spotLight.position - geometry.position;\n		light.direction = normalize( lVector );\n		float angleCos = dot( light.direction, spotLight.direction );\n		float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n		if ( spotAttenuation > 0.0 ) {\n			float lightDistance = length( lVector );\n			light.color = spotLight.color * spotAttenuation;\n			light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n			light.visible = ( light.color != vec3( 0.0 ) );\n		} else {\n			light.color = vec3( 0.0 );\n			light.visible = false;\n		}\n	}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n	struct RectAreaLight {\n		vec3 color;\n		vec3 position;\n		vec3 halfWidth;\n		vec3 halfHeight;\n	};\n	uniform sampler2D ltc_1;	uniform sampler2D ltc_2;\n	uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n	struct HemisphereLight {\n		vec3 direction;\n		vec3 skyColor;\n		vec3 groundColor;\n	};\n	uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n	vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\n		float dotNL = dot( normal, hemiLight.direction );\n		float hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n		vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n		return irradiance;\n	}\n#endif";
var envmap_physical_pars_fragment = "#if defined( USE_ENVMAP )\n	vec3 getIBLIrradiance( const in vec3 normal ) {\n		#if defined( ENVMAP_TYPE_CUBE_UV )\n			vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n			vec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n			return PI * envMapColor.rgb * envMapIntensity;\n		#else\n			return vec3( 0.0 );\n		#endif\n	}\n	vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n		#if defined( ENVMAP_TYPE_CUBE_UV )\n			vec3 reflectVec = reflect( - viewDir, normal );\n			reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n			reflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n			vec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n			return envMapColor.rgb * envMapIntensity;\n		#else\n			return vec3( 0.0 );\n		#endif\n	}\n#endif";
var lights_toon_fragment = "ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;";
var lights_toon_pars_fragment = "varying vec3 vViewPosition;\nstruct ToonMaterial {\n	vec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n	vec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n	reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct				RE_Direct_Toon\n#define RE_IndirectDiffuse		RE_IndirectDiffuse_Toon\n#define Material_LightProbeLOD( material )	(0)";
var lights_phong_fragment = "BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;";
var lights_phong_pars_fragment = "varying vec3 vViewPosition;\nstruct BlinnPhongMaterial {\n	vec3 diffuseColor;\n	vec3 specularColor;\n	float specularShininess;\n	float specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n	float dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n	vec3 irradiance = dotNL * directLight.color;\n	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n	reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n	reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct				RE_Direct_BlinnPhong\n#define RE_IndirectDiffuse		RE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )	(0)";
var lights_physical_fragment = "PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n#ifdef IOR\n	#ifdef SPECULAR\n		float specularIntensityFactor = specularIntensity;\n		vec3 specularColorFactor = specularColor;\n		#ifdef USE_SPECULARINTENSITYMAP\n			specularIntensityFactor *= texture2D( specularIntensityMap, vUv ).a;\n		#endif\n		#ifdef USE_SPECULARCOLORMAP\n			specularColorFactor *= texture2D( specularColorMap, vUv ).rgb;\n		#endif\n		material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n	#else\n		float specularIntensityFactor = 1.0;\n		vec3 specularColorFactor = vec3( 1.0 );\n		material.specularF90 = 1.0;\n	#endif\n	material.specularColor = mix( min( pow2( ( ior - 1.0 ) / ( ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\n#else\n	material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n	material.specularF90 = 1.0;\n#endif\n#ifdef USE_CLEARCOAT\n	material.clearcoat = clearcoat;\n	material.clearcoatRoughness = clearcoatRoughness;\n	material.clearcoatF0 = vec3( 0.04 );\n	material.clearcoatF90 = 1.0;\n	#ifdef USE_CLEARCOATMAP\n		material.clearcoat *= texture2D( clearcoatMap, vUv ).x;\n	#endif\n	#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n		material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y;\n	#endif\n	material.clearcoat = saturate( material.clearcoat );	material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n	material.clearcoatRoughness += geometryRoughness;\n	material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_SHEEN\n	material.sheenColor = sheenColor;\n	#ifdef USE_SHEENCOLORMAP\n		material.sheenColor *= texture2D( sheenColorMap, vUv ).rgb;\n	#endif\n	material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n	#ifdef USE_SHEENROUGHNESSMAP\n		material.sheenRoughness *= texture2D( sheenRoughnessMap, vUv ).a;\n	#endif\n#endif";
var lights_physical_pars_fragment = "struct PhysicalMaterial {\n	vec3 diffuseColor;\n	float roughness;\n	vec3 specularColor;\n	float specularF90;\n	#ifdef USE_CLEARCOAT\n		float clearcoat;\n		float clearcoatRoughness;\n		vec3 clearcoatF0;\n		float clearcoatF90;\n	#endif\n	#ifdef USE_SHEEN\n		vec3 sheenColor;\n		float sheenRoughness;\n	#endif\n};\nvec3 clearcoatSpecular = vec3( 0.0 );\nvec3 sheenSpecular = vec3( 0.0 );\nfloat IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness) {\n	float dotNV = saturate( dot( normal, viewDir ) );\n	float r2 = roughness * roughness;\n	float a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;\n	float b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;\n	float DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );\n	return saturate( DG * RECIPROCAL_PI );\n}\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n	float dotNV = saturate( dot( normal, viewDir ) );\n	const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n	const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n	vec4 r = roughness * c0 + c1;\n	float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n	vec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\n	return fab;\n}\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n	vec2 fab = DFGApprox( normal, viewDir, roughness );\n	return specularColor * fab.x + specularF90 * fab.y;\n}\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n	vec2 fab = DFGApprox( normal, viewDir, roughness );\n	vec3 FssEss = specularColor * fab.x + specularF90 * fab.y;\n	float Ess = fab.x + fab.y;\n	float Ems = 1.0 - Ess;\n	vec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619;	vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n	singleScatter += FssEss;\n	multiScatter += Fms * Ems;\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n	void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n		vec3 normal = geometry.normal;\n		vec3 viewDir = geometry.viewDir;\n		vec3 position = geometry.position;\n		vec3 lightPos = rectAreaLight.position;\n		vec3 halfWidth = rectAreaLight.halfWidth;\n		vec3 halfHeight = rectAreaLight.halfHeight;\n		vec3 lightColor = rectAreaLight.color;\n		float roughness = material.roughness;\n		vec3 rectCoords[ 4 ];\n		rectCoords[ 0 ] = lightPos + halfWidth - halfHeight;		rectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n		rectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n		rectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n		vec2 uv = LTC_Uv( normal, viewDir, roughness );\n		vec4 t1 = texture2D( ltc_1, uv );\n		vec4 t2 = texture2D( ltc_2, uv );\n		mat3 mInv = mat3(\n			vec3( t1.x, 0, t1.y ),\n			vec3(    0, 1,    0 ),\n			vec3( t1.z, 0, t1.w )\n		);\n		vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n		reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n		reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n	}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n	float dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n	vec3 irradiance = dotNL * directLight.color;\n	#ifdef USE_CLEARCOAT\n		float dotNLcc = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n		vec3 ccIrradiance = dotNLcc * directLight.color;\n		clearcoatSpecular += ccIrradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.clearcoatNormal, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n	#endif\n	#ifdef USE_SHEEN\n		sheenSpecular += irradiance * BRDF_Sheen( directLight.direction, geometry.viewDir, geometry.normal, material.sheenColor, material.sheenRoughness );\n	#endif\n	reflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularF90, material.roughness );\n	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n	reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n	#ifdef USE_CLEARCOAT\n		clearcoatSpecular += clearcoatRadiance * EnvironmentBRDF( geometry.clearcoatNormal, geometry.viewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n	#endif\n	#ifdef USE_SHEEN\n		sheenSpecular += irradiance * material.sheenColor * IBLSheenBRDF( geometry.normal, geometry.viewDir, material.sheenRoughness );\n	#endif\n	vec3 singleScattering = vec3( 0.0 );\n	vec3 multiScattering = vec3( 0.0 );\n	vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n	computeMultiscattering( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n	vec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );\n	reflectedLight.indirectSpecular += radiance * singleScattering;\n	reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n	reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct				RE_Direct_Physical\n#define RE_Direct_RectArea		RE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse		RE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular		RE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n	return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}";
var lights_fragment_begin = "\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef USE_CLEARCOAT\n	geometry.clearcoatNormal = clearcoatNormal;\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n	PointLight pointLight;\n	#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n	PointLightShadow pointLightShadow;\n	#endif\n	#pragma unroll_loop_start\n	for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n		pointLight = pointLights[ i ];\n		getPointLightInfo( pointLight, geometry, directLight );\n		#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n		pointLightShadow = pointLightShadows[ i ];\n		directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n		#endif\n		RE_Direct( directLight, geometry, material, reflectedLight );\n	}\n	#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n	SpotLight spotLight;\n	#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n	SpotLightShadow spotLightShadow;\n	#endif\n	#pragma unroll_loop_start\n	for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n		spotLight = spotLights[ i ];\n		getSpotLightInfo( spotLight, geometry, directLight );\n		#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n		spotLightShadow = spotLightShadows[ i ];\n		directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n		#endif\n		RE_Direct( directLight, geometry, material, reflectedLight );\n	}\n	#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n	DirectionalLight directionalLight;\n	#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n	DirectionalLightShadow directionalLightShadow;\n	#endif\n	#pragma unroll_loop_start\n	for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n		directionalLight = directionalLights[ i ];\n		getDirectionalLightInfo( directionalLight, geometry, directLight );\n		#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n		directionalLightShadow = directionalLightShadows[ i ];\n		directLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n		#endif\n		RE_Direct( directLight, geometry, material, reflectedLight );\n	}\n	#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n	RectAreaLight rectAreaLight;\n	#pragma unroll_loop_start\n	for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n		rectAreaLight = rectAreaLights[ i ];\n		RE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n	}\n	#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n	vec3 iblIrradiance = vec3( 0.0 );\n	vec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n	irradiance += getLightProbeIrradiance( lightProbe, geometry.normal );\n	#if ( NUM_HEMI_LIGHTS > 0 )\n		#pragma unroll_loop_start\n		for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n			irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal );\n		}\n		#pragma unroll_loop_end\n	#endif\n#endif\n#if defined( RE_IndirectSpecular )\n	vec3 radiance = vec3( 0.0 );\n	vec3 clearcoatRadiance = vec3( 0.0 );\n#endif";
var lights_fragment_maps = "#if defined( RE_IndirectDiffuse )\n	#ifdef USE_LIGHTMAP\n		vec4 lightMapTexel = texture2D( lightMap, vUv2 );\n		vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n		irradiance += lightMapIrradiance;\n	#endif\n	#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n		iblIrradiance += getIBLIrradiance( geometry.normal );\n	#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n	radiance += getIBLRadiance( geometry.viewDir, geometry.normal, material.roughness );\n	#ifdef USE_CLEARCOAT\n		clearcoatRadiance += getIBLRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness );\n	#endif\n#endif";
var lights_fragment_end = "#if defined( RE_IndirectDiffuse )\n	RE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n	RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif";
var logdepthbuf_fragment = "#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n	gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif";
var logdepthbuf_pars_fragment = "#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n	uniform float logDepthBufFC;\n	varying float vFragDepth;\n	varying float vIsPerspective;\n#endif";
var logdepthbuf_pars_vertex = "#ifdef USE_LOGDEPTHBUF\n	#ifdef USE_LOGDEPTHBUF_EXT\n		varying float vFragDepth;\n		varying float vIsPerspective;\n	#else\n		uniform float logDepthBufFC;\n	#endif\n#endif";
var logdepthbuf_vertex = "#ifdef USE_LOGDEPTHBUF\n	#ifdef USE_LOGDEPTHBUF_EXT\n		vFragDepth = 1.0 + gl_Position.w;\n		vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n	#else\n		if ( isPerspectiveMatrix( projectionMatrix ) ) {\n			gl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n			gl_Position.z *= gl_Position.w;\n		}\n	#endif\n#endif";
var map_fragment = "#ifdef USE_MAP\n	vec4 sampledDiffuseColor = texture2D( map, vUv );\n	#ifdef DECODE_VIDEO_TEXTURE\n		sampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w );\n	#endif\n	diffuseColor *= sampledDiffuseColor;\n#endif";
var map_pars_fragment = "#ifdef USE_MAP\n	uniform sampler2D map;\n#endif";
var map_particle_fragment = "#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n	vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n#endif\n#ifdef USE_MAP\n	diffuseColor *= texture2D( map, uv );\n#endif\n#ifdef USE_ALPHAMAP\n	diffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif";
var map_particle_pars_fragment = "#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n	uniform mat3 uvTransform;\n#endif\n#ifdef USE_MAP\n	uniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n	uniform sampler2D alphaMap;\n#endif";
var metalnessmap_fragment = "float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n	vec4 texelMetalness = texture2D( metalnessMap, vUv );\n	metalnessFactor *= texelMetalness.b;\n#endif";
var metalnessmap_pars_fragment = "#ifdef USE_METALNESSMAP\n	uniform sampler2D metalnessMap;\n#endif";
var morphcolor_vertex = "#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE )\n	vColor *= morphTargetBaseInfluence;\n	for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n		#if defined( USE_COLOR_ALPHA )\n			if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];\n		#elif defined( USE_COLOR )\n			if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];\n		#endif\n	}\n#endif";
var morphnormal_vertex = "#ifdef USE_MORPHNORMALS\n	objectNormal *= morphTargetBaseInfluence;\n	#ifdef MORPHTARGETS_TEXTURE\n		for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n			if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];\n		}\n	#else\n		objectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n		objectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n		objectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n		objectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n	#endif\n#endif";
var morphtarget_pars_vertex = "#ifdef USE_MORPHTARGETS\n	uniform float morphTargetBaseInfluence;\n	#ifdef MORPHTARGETS_TEXTURE\n		uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n		uniform sampler2DArray morphTargetsTexture;\n		uniform ivec2 morphTargetsTextureSize;\n		vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\n			int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;\n			int y = texelIndex / morphTargetsTextureSize.x;\n			int x = texelIndex - y * morphTargetsTextureSize.x;\n			ivec3 morphUV = ivec3( x, y, morphTargetIndex );\n			return texelFetch( morphTargetsTexture, morphUV, 0 );\n		}\n	#else\n		#ifndef USE_MORPHNORMALS\n			uniform float morphTargetInfluences[ 8 ];\n		#else\n			uniform float morphTargetInfluences[ 4 ];\n		#endif\n	#endif\n#endif";
var morphtarget_vertex = "#ifdef USE_MORPHTARGETS\n	transformed *= morphTargetBaseInfluence;\n	#ifdef MORPHTARGETS_TEXTURE\n		for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n			if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n		}\n	#else\n		transformed += morphTarget0 * morphTargetInfluences[ 0 ];\n		transformed += morphTarget1 * morphTargetInfluences[ 1 ];\n		transformed += morphTarget2 * morphTargetInfluences[ 2 ];\n		transformed += morphTarget3 * morphTargetInfluences[ 3 ];\n		#ifndef USE_MORPHNORMALS\n			transformed += morphTarget4 * morphTargetInfluences[ 4 ];\n			transformed += morphTarget5 * morphTargetInfluences[ 5 ];\n			transformed += morphTarget6 * morphTargetInfluences[ 6 ];\n			transformed += morphTarget7 * morphTargetInfluences[ 7 ];\n		#endif\n	#endif\n#endif";
var normal_fragment_begin = "float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n	vec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n	vec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n	vec3 normal = normalize( cross( fdx, fdy ) );\n#else\n	vec3 normal = normalize( vNormal );\n	#ifdef DOUBLE_SIDED\n		normal = normal * faceDirection;\n	#endif\n	#ifdef USE_TANGENT\n		vec3 tangent = normalize( vTangent );\n		vec3 bitangent = normalize( vBitangent );\n		#ifdef DOUBLE_SIDED\n			tangent = tangent * faceDirection;\n			bitangent = bitangent * faceDirection;\n		#endif\n		#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\n			mat3 vTBN = mat3( tangent, bitangent, normal );\n		#endif\n	#endif\n#endif\nvec3 geometryNormal = normal;";
var normal_fragment_maps = "#ifdef OBJECTSPACE_NORMALMAP\n	normal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n	#ifdef FLIP_SIDED\n		normal = - normal;\n	#endif\n	#ifdef DOUBLE_SIDED\n		normal = normal * faceDirection;\n	#endif\n	normal = normalize( normalMatrix * normal );\n#elif defined( TANGENTSPACE_NORMALMAP )\n	vec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n	mapN.xy *= normalScale;\n	#ifdef USE_TANGENT\n		normal = normalize( vTBN * mapN );\n	#else\n		normal = perturbNormal2Arb( - vViewPosition, normal, mapN, faceDirection );\n	#endif\n#elif defined( USE_BUMPMAP )\n	normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif";
var normal_pars_fragment = "#ifndef FLAT_SHADED\n	varying vec3 vNormal;\n	#ifdef USE_TANGENT\n		varying vec3 vTangent;\n		varying vec3 vBitangent;\n	#endif\n#endif";
var normal_pars_vertex = "#ifndef FLAT_SHADED\n	varying vec3 vNormal;\n	#ifdef USE_TANGENT\n		varying vec3 vTangent;\n		varying vec3 vBitangent;\n	#endif\n#endif";
var normal_vertex = "#ifndef FLAT_SHADED\n	vNormal = normalize( transformedNormal );\n	#ifdef USE_TANGENT\n		vTangent = normalize( transformedTangent );\n		vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n	#endif\n#endif";
var normalmap_pars_fragment = "#ifdef USE_NORMALMAP\n	uniform sampler2D normalMap;\n	uniform vec2 normalScale;\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\n	uniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n	vec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN, float faceDirection ) {\n		vec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n		vec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n		vec2 st0 = dFdx( vUv.st );\n		vec2 st1 = dFdy( vUv.st );\n		vec3 N = surf_norm;\n		vec3 q1perp = cross( q1, N );\n		vec3 q0perp = cross( N, q0 );\n		vec3 T = q1perp * st0.x + q0perp * st1.x;\n		vec3 B = q1perp * st0.y + q0perp * st1.y;\n		float det = max( dot( T, T ), dot( B, B ) );\n		float scale = ( det == 0.0 ) ? 0.0 : faceDirection * inversesqrt( det );\n		return normalize( T * ( mapN.x * scale ) + B * ( mapN.y * scale ) + N * mapN.z );\n	}\n#endif";
var clearcoat_normal_fragment_begin = "#ifdef USE_CLEARCOAT\n	vec3 clearcoatNormal = geometryNormal;\n#endif";
var clearcoat_normal_fragment_maps = "#ifdef USE_CLEARCOAT_NORMALMAP\n	vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;\n	clearcoatMapN.xy *= clearcoatNormalScale;\n	#ifdef USE_TANGENT\n		clearcoatNormal = normalize( vTBN * clearcoatMapN );\n	#else\n		clearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN, faceDirection );\n	#endif\n#endif";
var clearcoat_pars_fragment = "#ifdef USE_CLEARCOATMAP\n	uniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n	uniform sampler2D clearcoatRoughnessMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n	uniform sampler2D clearcoatNormalMap;\n	uniform vec2 clearcoatNormalScale;\n#endif";
var output_fragment = "#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= transmissionAlpha + 0.1;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );";
var packing = "vec3 packNormalToRGB( const in vec3 normal ) {\n	return normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n	return 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n	vec4 r = vec4( fract( v * PackFactors ), v );\n	r.yzw -= r.xyz * ShiftRight8;	return r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n	return dot( v, UnpackFactors );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n	vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\n	return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n	return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n	return ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n	return linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n	return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n	return ( near * far ) / ( ( far - near ) * invClipZ - far );\n}";
var premultiplied_alpha_fragment = "#ifdef PREMULTIPLIED_ALPHA\n	gl_FragColor.rgb *= gl_FragColor.a;\n#endif";
var project_vertex = "vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_INSTANCING\n	mvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;";
var dithering_fragment = "#ifdef DITHERING\n	gl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif";
var dithering_pars_fragment = "#ifdef DITHERING\n	vec3 dithering( vec3 color ) {\n		float grid_position = rand( gl_FragCoord.xy );\n		vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n		dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n		return color + dither_shift_RGB;\n	}\n#endif";
var roughnessmap_fragment = "float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n	vec4 texelRoughness = texture2D( roughnessMap, vUv );\n	roughnessFactor *= texelRoughness.g;\n#endif";
var roughnessmap_pars_fragment = "#ifdef USE_ROUGHNESSMAP\n	uniform sampler2D roughnessMap;\n#endif";
var shadowmap_pars_fragment = "#ifdef USE_SHADOWMAP\n	#if NUM_DIR_LIGHT_SHADOWS > 0\n		uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n		varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n		struct DirectionalLightShadow {\n			float shadowBias;\n			float shadowNormalBias;\n			float shadowRadius;\n			vec2 shadowMapSize;\n		};\n		uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n	#endif\n	#if NUM_SPOT_LIGHT_SHADOWS > 0\n		uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n		varying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n		struct SpotLightShadow {\n			float shadowBias;\n			float shadowNormalBias;\n			float shadowRadius;\n			vec2 shadowMapSize;\n		};\n		uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n	#endif\n	#if NUM_POINT_LIGHT_SHADOWS > 0\n		uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n		varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n		struct PointLightShadow {\n			float shadowBias;\n			float shadowNormalBias;\n			float shadowRadius;\n			vec2 shadowMapSize;\n			float shadowCameraNear;\n			float shadowCameraFar;\n		};\n		uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n	#endif\n	float texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n		return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n	}\n	vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n		return unpackRGBATo2Half( texture2D( shadow, uv ) );\n	}\n	float VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n		float occlusion = 1.0;\n		vec2 distribution = texture2DDistribution( shadow, uv );\n		float hard_shadow = step( compare , distribution.x );\n		if (hard_shadow != 1.0 ) {\n			float distance = compare - distribution.x ;\n			float variance = max( 0.00000, distribution.y * distribution.y );\n			float softness_probability = variance / (variance + distance * distance );			softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );			occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n		}\n		return occlusion;\n	}\n	float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n		float shadow = 1.0;\n		shadowCoord.xyz /= shadowCoord.w;\n		shadowCoord.z += shadowBias;\n		bvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n		bool inFrustum = all( inFrustumVec );\n		bvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n		bool frustumTest = all( frustumTestVec );\n		if ( frustumTest ) {\n		#if defined( SHADOWMAP_TYPE_PCF )\n			vec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n			float dx0 = - texelSize.x * shadowRadius;\n			float dy0 = - texelSize.y * shadowRadius;\n			float dx1 = + texelSize.x * shadowRadius;\n			float dy1 = + texelSize.y * shadowRadius;\n			float dx2 = dx0 / 2.0;\n			float dy2 = dy0 / 2.0;\n			float dx3 = dx1 / 2.0;\n			float dy3 = dy1 / 2.0;\n			shadow = (\n				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n				texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n				texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n				texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n				texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n				texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n			) * ( 1.0 / 17.0 );\n		#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n			vec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n			float dx = texelSize.x;\n			float dy = texelSize.y;\n			vec2 uv = shadowCoord.xy;\n			vec2 f = fract( uv * shadowMapSize + 0.5 );\n			uv -= f * texelSize;\n			shadow = (\n				texture2DCompare( shadowMap, uv, shadowCoord.z ) +\n				texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n				texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n				texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n				mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), \n					 texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n					 f.x ) +\n				mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), \n					 texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n					 f.x ) +\n				mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), \n					 texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n					 f.y ) +\n				mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), \n					 texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n					 f.y ) +\n				mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), \n						  texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n						  f.x ),\n					 mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), \n						  texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n						  f.x ),\n					 f.y )\n			) * ( 1.0 / 9.0 );\n		#elif defined( SHADOWMAP_TYPE_VSM )\n			shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n		#else\n			shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n		#endif\n		}\n		return shadow;\n	}\n	vec2 cubeToUV( vec3 v, float texelSizeY ) {\n		vec3 absV = abs( v );\n		float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n		absV *= scaleToCube;\n		v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n		vec2 planar = v.xy;\n		float almostATexel = 1.5 * texelSizeY;\n		float almostOne = 1.0 - almostATexel;\n		if ( absV.z >= almostOne ) {\n			if ( v.z > 0.0 )\n				planar.x = 4.0 - v.x;\n		} else if ( absV.x >= almostOne ) {\n			float signX = sign( v.x );\n			planar.x = v.z * signX + 2.0 * signX;\n		} else if ( absV.y >= almostOne ) {\n			float signY = sign( v.y );\n			planar.x = v.x + 2.0 * signY + 2.0;\n			planar.y = v.z * signY - 2.0;\n		}\n		return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n	}\n	float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n		vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n		vec3 lightToPosition = shadowCoord.xyz;\n		float dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );		dp += shadowBias;\n		vec3 bd3D = normalize( lightToPosition );\n		#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n			vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n			return (\n				texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n				texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n				texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n				texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n				texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n				texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n				texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n				texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n				texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n			) * ( 1.0 / 9.0 );\n		#else\n			return texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n		#endif\n	}\n#endif";
var shadowmap_pars_vertex = "#ifdef USE_SHADOWMAP\n	#if NUM_DIR_LIGHT_SHADOWS > 0\n		uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n		varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n		struct DirectionalLightShadow {\n			float shadowBias;\n			float shadowNormalBias;\n			float shadowRadius;\n			vec2 shadowMapSize;\n		};\n		uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n	#endif\n	#if NUM_SPOT_LIGHT_SHADOWS > 0\n		uniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ];\n		varying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n		struct SpotLightShadow {\n			float shadowBias;\n			float shadowNormalBias;\n			float shadowRadius;\n			vec2 shadowMapSize;\n		};\n		uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n	#endif\n	#if NUM_POINT_LIGHT_SHADOWS > 0\n		uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n		varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n		struct PointLightShadow {\n			float shadowBias;\n			float shadowNormalBias;\n			float shadowRadius;\n			vec2 shadowMapSize;\n			float shadowCameraNear;\n			float shadowCameraFar;\n		};\n		uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n	#endif\n#endif";
var shadowmap_vertex = "#ifdef USE_SHADOWMAP\n	#if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0\n		vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n		vec4 shadowWorldPosition;\n	#endif\n	#if NUM_DIR_LIGHT_SHADOWS > 0\n	#pragma unroll_loop_start\n	for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n		shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n		vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n	}\n	#pragma unroll_loop_end\n	#endif\n	#if NUM_SPOT_LIGHT_SHADOWS > 0\n	#pragma unroll_loop_start\n	for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n		shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias, 0 );\n		vSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * shadowWorldPosition;\n	}\n	#pragma unroll_loop_end\n	#endif\n	#if NUM_POINT_LIGHT_SHADOWS > 0\n	#pragma unroll_loop_start\n	for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n		shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n		vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n	}\n	#pragma unroll_loop_end\n	#endif\n#endif";
var shadowmask_pars_fragment = "float getShadowMask() {\n	float shadow = 1.0;\n	#ifdef USE_SHADOWMAP\n	#if NUM_DIR_LIGHT_SHADOWS > 0\n	DirectionalLightShadow directionalLight;\n	#pragma unroll_loop_start\n	for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n		directionalLight = directionalLightShadows[ i ];\n		shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n	}\n	#pragma unroll_loop_end\n	#endif\n	#if NUM_SPOT_LIGHT_SHADOWS > 0\n	SpotLightShadow spotLight;\n	#pragma unroll_loop_start\n	for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n		spotLight = spotLightShadows[ i ];\n		shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n	}\n	#pragma unroll_loop_end\n	#endif\n	#if NUM_POINT_LIGHT_SHADOWS > 0\n	PointLightShadow pointLight;\n	#pragma unroll_loop_start\n	for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n		pointLight = pointLightShadows[ i ];\n		shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n	}\n	#pragma unroll_loop_end\n	#endif\n	#endif\n	return shadow;\n}";
var skinbase_vertex = "#ifdef USE_SKINNING\n	mat4 boneMatX = getBoneMatrix( skinIndex.x );\n	mat4 boneMatY = getBoneMatrix( skinIndex.y );\n	mat4 boneMatZ = getBoneMatrix( skinIndex.z );\n	mat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif";
var skinning_pars_vertex = "#ifdef USE_SKINNING\n	uniform mat4 bindMatrix;\n	uniform mat4 bindMatrixInverse;\n	#ifdef BONE_TEXTURE\n		uniform highp sampler2D boneTexture;\n		uniform int boneTextureSize;\n		mat4 getBoneMatrix( const in float i ) {\n			float j = i * 4.0;\n			float x = mod( j, float( boneTextureSize ) );\n			float y = floor( j / float( boneTextureSize ) );\n			float dx = 1.0 / float( boneTextureSize );\n			float dy = 1.0 / float( boneTextureSize );\n			y = dy * ( y + 0.5 );\n			vec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n			vec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n			vec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n			vec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n			mat4 bone = mat4( v1, v2, v3, v4 );\n			return bone;\n		}\n	#else\n		uniform mat4 boneMatrices[ MAX_BONES ];\n		mat4 getBoneMatrix( const in float i ) {\n			mat4 bone = boneMatrices[ int(i) ];\n			return bone;\n		}\n	#endif\n#endif";
var skinning_vertex = "#ifdef USE_SKINNING\n	vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n	vec4 skinned = vec4( 0.0 );\n	skinned += boneMatX * skinVertex * skinWeight.x;\n	skinned += boneMatY * skinVertex * skinWeight.y;\n	skinned += boneMatZ * skinVertex * skinWeight.z;\n	skinned += boneMatW * skinVertex * skinWeight.w;\n	transformed = ( bindMatrixInverse * skinned ).xyz;\n#endif";
var skinnormal_vertex = "#ifdef USE_SKINNING\n	mat4 skinMatrix = mat4( 0.0 );\n	skinMatrix += skinWeight.x * boneMatX;\n	skinMatrix += skinWeight.y * boneMatY;\n	skinMatrix += skinWeight.z * boneMatZ;\n	skinMatrix += skinWeight.w * boneMatW;\n	skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n	objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n	#ifdef USE_TANGENT\n		objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n	#endif\n#endif";
var specularmap_fragment = "float specularStrength;\n#ifdef USE_SPECULARMAP\n	vec4 texelSpecular = texture2D( specularMap, vUv );\n	specularStrength = texelSpecular.r;\n#else\n	specularStrength = 1.0;\n#endif";
var specularmap_pars_fragment = "#ifdef USE_SPECULARMAP\n	uniform sampler2D specularMap;\n#endif";
var tonemapping_fragment = "#if defined( TONE_MAPPING )\n	gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif";
var tonemapping_pars_fragment = "#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n	return toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n	color *= toneMappingExposure;\n	return saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n	color *= toneMappingExposure;\n	color = max( vec3( 0.0 ), color - 0.004 );\n	return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n	vec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n	vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n	return a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n	const mat3 ACESInputMat = mat3(\n		vec3( 0.59719, 0.07600, 0.02840 ),		vec3( 0.35458, 0.90834, 0.13383 ),\n		vec3( 0.04823, 0.01566, 0.83777 )\n	);\n	const mat3 ACESOutputMat = mat3(\n		vec3(  1.60475, -0.10208, -0.00327 ),		vec3( -0.53108,  1.10813, -0.07276 ),\n		vec3( -0.07367, -0.00605,  1.07602 )\n	);\n	color *= toneMappingExposure / 0.6;\n	color = ACESInputMat * color;\n	color = RRTAndODTFit( color );\n	color = ACESOutputMat * color;\n	return saturate( color );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }";
var transmission_fragment = "#ifdef USE_TRANSMISSION\n	float transmissionAlpha = 1.0;\n	float transmissionFactor = transmission;\n	float thicknessFactor = thickness;\n	#ifdef USE_TRANSMISSIONMAP\n		transmissionFactor *= texture2D( transmissionMap, vUv ).r;\n	#endif\n	#ifdef USE_THICKNESSMAP\n		thicknessFactor *= texture2D( thicknessMap, vUv ).g;\n	#endif\n	vec3 pos = vWorldPosition;\n	vec3 v = normalize( cameraPosition - pos );\n	vec3 n = inverseTransformDirection( normal, viewMatrix );\n	vec4 transmission = getIBLVolumeRefraction(\n		n, v, roughnessFactor, material.diffuseColor, material.specularColor, material.specularF90,\n		pos, modelMatrix, viewMatrix, projectionMatrix, ior, thicknessFactor,\n		attenuationColor, attenuationDistance );\n	totalDiffuse = mix( totalDiffuse, transmission.rgb, transmissionFactor );\n	transmissionAlpha = mix( transmissionAlpha, transmission.a, transmissionFactor );\n#endif";
var transmission_pars_fragment = "#ifdef USE_TRANSMISSION\n	uniform float transmission;\n	uniform float thickness;\n	uniform float attenuationDistance;\n	uniform vec3 attenuationColor;\n	#ifdef USE_TRANSMISSIONMAP\n		uniform sampler2D transmissionMap;\n	#endif\n	#ifdef USE_THICKNESSMAP\n		uniform sampler2D thicknessMap;\n	#endif\n	uniform vec2 transmissionSamplerSize;\n	uniform sampler2D transmissionSamplerMap;\n	uniform mat4 modelMatrix;\n	uniform mat4 projectionMatrix;\n	varying vec3 vWorldPosition;\n	vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\n		vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n		vec3 modelScale;\n		modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n		modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n		modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n		return normalize( refractionVector ) * thickness * modelScale;\n	}\n	float applyIorToRoughness( const in float roughness, const in float ior ) {\n		return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n	}\n	vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\n		float framebufferLod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n		#ifdef texture2DLodEXT\n			return texture2DLodEXT( transmissionSamplerMap, fragCoord.xy, framebufferLod );\n		#else\n			return texture2D( transmissionSamplerMap, fragCoord.xy, framebufferLod );\n		#endif\n	}\n	vec3 applyVolumeAttenuation( const in vec3 radiance, const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n		if ( attenuationDistance == 0.0 ) {\n			return radiance;\n		} else {\n			vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n			vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );			return transmittance * radiance;\n		}\n	}\n	vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,\n		const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,\n		const in mat4 viewMatrix, const in mat4 projMatrix, const in float ior, const in float thickness,\n		const in vec3 attenuationColor, const in float attenuationDistance ) {\n		vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n		vec3 refractedRayExit = position + transmissionRay;\n		vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n		vec2 refractionCoords = ndcPos.xy / ndcPos.w;\n		refractionCoords += 1.0;\n		refractionCoords /= 2.0;\n		vec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n		vec3 attenuatedColor = applyVolumeAttenuation( transmittedLight.rgb, length( transmissionRay ), attenuationColor, attenuationDistance );\n		vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n		return vec4( ( 1.0 - F ) * attenuatedColor * diffuseColor, transmittedLight.a );\n	}\n#endif";
var uv_pars_fragment = "#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )\n	varying vec2 vUv;\n#endif";
var uv_pars_vertex = "#ifdef USE_UV\n	#ifdef UVS_VERTEX_ONLY\n		vec2 vUv;\n	#else\n		varying vec2 vUv;\n	#endif\n	uniform mat3 uvTransform;\n#endif";
var uv_vertex = "#ifdef USE_UV\n	vUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif";
var uv2_pars_fragment = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n	varying vec2 vUv2;\n#endif";
var uv2_pars_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n	attribute vec2 uv2;\n	varying vec2 vUv2;\n	uniform mat3 uv2Transform;\n#endif";
var uv2_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n	vUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;\n#endif";
var worldpos_vertex = "#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION )\n	vec4 worldPosition = vec4( transformed, 1.0 );\n	#ifdef USE_INSTANCING\n		worldPosition = instanceMatrix * worldPosition;\n	#endif\n	worldPosition = modelMatrix * worldPosition;\n#endif";
var vertex$g = "varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n	vUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n	gl_Position = vec4( position.xy, 1.0, 1.0 );\n}";
var fragment$g = "uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n	gl_FragColor = texture2D( t2D, vUv );\n	#ifdef DECODE_VIDEO_TEXTURE\n		gl_FragColor = vec4( mix( pow( gl_FragColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), gl_FragColor.rgb * 0.0773993808, vec3( lessThanEqual( gl_FragColor.rgb, vec3( 0.04045 ) ) ) ), gl_FragColor.w );\n	#endif\n	#include <tonemapping_fragment>\n	#include <encodings_fragment>\n}";
var vertex$f = "varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n	vWorldDirection = transformDirection( position, modelMatrix );\n	#include <begin_vertex>\n	#include <project_vertex>\n	gl_Position.z = gl_Position.w;\n}";
var fragment$f = "#include <envmap_common_pars_fragment>\nuniform float opacity;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n	vec3 vReflect = vWorldDirection;\n	#include <envmap_fragment>\n	gl_FragColor = envColor;\n	gl_FragColor.a *= opacity;\n	#include <tonemapping_fragment>\n	#include <encodings_fragment>\n}";
var vertex$e = "#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n	#include <uv_vertex>\n	#include <skinbase_vertex>\n	#ifdef USE_DISPLACEMENTMAP\n		#include <beginnormal_vertex>\n		#include <morphnormal_vertex>\n		#include <skinnormal_vertex>\n	#endif\n	#include <begin_vertex>\n	#include <morphtarget_vertex>\n	#include <skinning_vertex>\n	#include <displacementmap_vertex>\n	#include <project_vertex>\n	#include <logdepthbuf_vertex>\n	#include <clipping_planes_vertex>\n	vHighPrecisionZW = gl_Position.zw;\n}";
var fragment$e = "#if DEPTH_PACKING == 3200\n	uniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n	#include <clipping_planes_fragment>\n	vec4 diffuseColor = vec4( 1.0 );\n	#if DEPTH_PACKING == 3200\n		diffuseColor.a = opacity;\n	#endif\n	#include <map_fragment>\n	#include <alphamap_fragment>\n	#include <alphatest_fragment>\n	#include <logdepthbuf_fragment>\n	float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n	#if DEPTH_PACKING == 3200\n		gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n	#elif DEPTH_PACKING == 3201\n		gl_FragColor = packDepthToRGBA( fragCoordZ );\n	#endif\n}";
var vertex$d = "#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n	#include <uv_vertex>\n	#include <skinbase_vertex>\n	#ifdef USE_DISPLACEMENTMAP\n		#include <beginnormal_vertex>\n		#include <morphnormal_vertex>\n		#include <skinnormal_vertex>\n	#endif\n	#include <begin_vertex>\n	#include <morphtarget_vertex>\n	#include <skinning_vertex>\n	#include <displacementmap_vertex>\n	#include <project_vertex>\n	#include <worldpos_vertex>\n	#include <clipping_planes_vertex>\n	vWorldPosition = worldPosition.xyz;\n}";
var fragment$d = "#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n	#include <clipping_planes_fragment>\n	vec4 diffuseColor = vec4( 1.0 );\n	#include <map_fragment>\n	#include <alphamap_fragment>\n	#include <alphatest_fragment>\n	float dist = length( vWorldPosition - referencePosition );\n	dist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n	dist = saturate( dist );\n	gl_FragColor = packDepthToRGBA( dist );\n}";
var vertex$c = "varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n	vWorldDirection = transformDirection( position, modelMatrix );\n	#include <begin_vertex>\n	#include <project_vertex>\n}";
var fragment$c = "uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n	vec3 direction = normalize( vWorldDirection );\n	vec2 sampleUV = equirectUv( direction );\n	gl_FragColor = texture2D( tEquirect, sampleUV );\n	#include <tonemapping_fragment>\n	#include <encodings_fragment>\n}";
var vertex$b = "uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n	vLineDistance = scale * lineDistance;\n	#include <color_vertex>\n	#include <morphcolor_vertex>\n	#include <begin_vertex>\n	#include <morphtarget_vertex>\n	#include <project_vertex>\n	#include <logdepthbuf_vertex>\n	#include <clipping_planes_vertex>\n	#include <fog_vertex>\n}";
var fragment$b = "uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n	#include <clipping_planes_fragment>\n	if ( mod( vLineDistance, totalSize ) > dashSize ) {\n		discard;\n	}\n	vec3 outgoingLight = vec3( 0.0 );\n	vec4 diffuseColor = vec4( diffuse, opacity );\n	#include <logdepthbuf_fragment>\n	#include <color_fragment>\n	outgoingLight = diffuseColor.rgb;\n	#include <output_fragment>\n	#include <tonemapping_fragment>\n	#include <encodings_fragment>\n	#include <fog_fragment>\n	#include <premultiplied_alpha_fragment>\n}";
var vertex$a = "#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n	#include <uv_vertex>\n	#include <uv2_vertex>\n	#include <color_vertex>\n	#include <morphcolor_vertex>\n	#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n		#include <beginnormal_vertex>\n		#include <morphnormal_vertex>\n		#include <skinbase_vertex>\n		#include <skinnormal_vertex>\n		#include <defaultnormal_vertex>\n	#endif\n	#include <begin_vertex>\n	#include <morphtarget_vertex>\n	#include <skinning_vertex>\n	#include <project_vertex>\n	#include <logdepthbuf_vertex>\n	#include <clipping_planes_vertex>\n	#include <worldpos_vertex>\n	#include <envmap_vertex>\n	#include <fog_vertex>\n}";
var fragment$a = "uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n	varying vec3 vNormal;\n#endif\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n	#include <clipping_planes_fragment>\n	vec4 diffuseColor = vec4( diffuse, opacity );\n	#include <logdepthbuf_fragment>\n	#include <map_fragment>\n	#include <color_fragment>\n	#include <alphamap_fragment>\n	#include <alphatest_fragment>\n	#include <specularmap_fragment>\n	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n	#ifdef USE_LIGHTMAP\n		vec4 lightMapTexel = texture2D( lightMap, vUv2 );\n		reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\n	#else\n		reflectedLight.indirectDiffuse += vec3( 1.0 );\n	#endif\n	#include <aomap_fragment>\n	reflectedLight.indirectDiffuse *= diffuseColor.rgb;\n	vec3 outgoingLight = reflectedLight.indirectDiffuse;\n	#include <envmap_fragment>\n	#include <output_fragment>\n	#include <tonemapping_fragment>\n	#include <encodings_fragment>\n	#include <fog_fragment>\n	#include <premultiplied_alpha_fragment>\n	#include <dithering_fragment>\n}";
var vertex$9 = "#define LAMBERT\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n	varying vec3 vLightBack;\n	varying vec3 vIndirectBack;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n	#include <uv_vertex>\n	#include <uv2_vertex>\n	#include <color_vertex>\n	#include <morphcolor_vertex>\n	#include <beginnormal_vertex>\n	#include <morphnormal_vertex>\n	#include <skinbase_vertex>\n	#include <skinnormal_vertex>\n	#include <defaultnormal_vertex>\n	#include <begin_vertex>\n	#include <morphtarget_vertex>\n	#include <skinning_vertex>\n	#include <project_vertex>\n	#include <logdepthbuf_vertex>\n	#include <clipping_planes_vertex>\n	#include <worldpos_vertex>\n	#include <envmap_vertex>\n	#include <lights_lambert_vertex>\n	#include <shadowmap_vertex>\n	#include <fog_vertex>\n}";
var fragment$9 = "uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n	varying vec3 vLightBack;\n	varying vec3 vIndirectBack;\n#endif\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n	#include <clipping_planes_fragment>\n	vec4 diffuseColor = vec4( diffuse, opacity );\n	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n	vec3 totalEmissiveRadiance = emissive;\n	#include <logdepthbuf_fragment>\n	#include <map_fragment>\n	#include <color_fragment>\n	#include <alphamap_fragment>\n	#include <alphatest_fragment>\n	#include <specularmap_fragment>\n	#include <emissivemap_fragment>\n	#ifdef DOUBLE_SIDED\n		reflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;\n	#else\n		reflectedLight.indirectDiffuse += vIndirectFront;\n	#endif\n	#include <lightmap_fragment>\n	reflectedLight.indirectDiffuse *= BRDF_Lambert( diffuseColor.rgb );\n	#ifdef DOUBLE_SIDED\n		reflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n	#else\n		reflectedLight.directDiffuse = vLightFront;\n	#endif\n	reflectedLight.directDiffuse *= BRDF_Lambert( diffuseColor.rgb ) * getShadowMask();\n	#include <aomap_fragment>\n	vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n	#include <envmap_fragment>\n	#include <output_fragment>\n	#include <tonemapping_fragment>\n	#include <encodings_fragment>\n	#include <fog_fragment>\n	#include <premultiplied_alpha_fragment>\n	#include <dithering_fragment>\n}";
var vertex$8 = "#define MATCAP\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n	#include <uv_vertex>\n	#include <color_vertex>\n	#include <morphcolor_vertex>\n	#include <beginnormal_vertex>\n	#include <morphnormal_vertex>\n	#include <skinbase_vertex>\n	#include <skinnormal_vertex>\n	#include <defaultnormal_vertex>\n	#include <normal_vertex>\n	#include <begin_vertex>\n	#include <morphtarget_vertex>\n	#include <skinning_vertex>\n	#include <displacementmap_vertex>\n	#include <project_vertex>\n	#include <logdepthbuf_vertex>\n	#include <clipping_planes_vertex>\n	#include <fog_vertex>\n	vViewPosition = - mvPosition.xyz;\n}";
var fragment$8 = "#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n	#include <clipping_planes_fragment>\n	vec4 diffuseColor = vec4( diffuse, opacity );\n	#include <logdepthbuf_fragment>\n	#include <map_fragment>\n	#include <color_fragment>\n	#include <alphamap_fragment>\n	#include <alphatest_fragment>\n	#include <normal_fragment_begin>\n	#include <normal_fragment_maps>\n	vec3 viewDir = normalize( vViewPosition );\n	vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n	vec3 y = cross( viewDir, x );\n	vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n	#ifdef USE_MATCAP\n		vec4 matcapColor = texture2D( matcap, uv );\n	#else\n		vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );\n	#endif\n	vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n	#include <output_fragment>\n	#include <tonemapping_fragment>\n	#include <encodings_fragment>\n	#include <fog_fragment>\n	#include <premultiplied_alpha_fragment>\n	#include <dithering_fragment>\n}";
var vertex$7 = "#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n	varying vec3 vViewPosition;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n	#include <uv_vertex>\n	#include <beginnormal_vertex>\n	#include <morphnormal_vertex>\n	#include <skinbase_vertex>\n	#include <skinnormal_vertex>\n	#include <defaultnormal_vertex>\n	#include <normal_vertex>\n	#include <begin_vertex>\n	#include <morphtarget_vertex>\n	#include <skinning_vertex>\n	#include <displacementmap_vertex>\n	#include <project_vertex>\n	#include <logdepthbuf_vertex>\n	#include <clipping_planes_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n	vViewPosition = - mvPosition.xyz;\n#endif\n}";
var fragment$7 = "#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n	varying vec3 vViewPosition;\n#endif\n#include <packing>\n#include <uv_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n	#include <clipping_planes_fragment>\n	#include <logdepthbuf_fragment>\n	#include <normal_fragment_begin>\n	#include <normal_fragment_maps>\n	gl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n	#ifdef OPAQUE\n		gl_FragColor.a = 1.0;\n	#endif\n}";
var vertex$6 = "#define PHONG\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n	#include <uv_vertex>\n	#include <uv2_vertex>\n	#include <color_vertex>\n	#include <morphcolor_vertex>\n	#include <beginnormal_vertex>\n	#include <morphnormal_vertex>\n	#include <skinbase_vertex>\n	#include <skinnormal_vertex>\n	#include <defaultnormal_vertex>\n	#include <normal_vertex>\n	#include <begin_vertex>\n	#include <morphtarget_vertex>\n	#include <skinning_vertex>\n	#include <displacementmap_vertex>\n	#include <project_vertex>\n	#include <logdepthbuf_vertex>\n	#include <clipping_planes_vertex>\n	vViewPosition = - mvPosition.xyz;\n	#include <worldpos_vertex>\n	#include <envmap_vertex>\n	#include <shadowmap_vertex>\n	#include <fog_vertex>\n}";
var fragment$6 = "#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n	#include <clipping_planes_fragment>\n	vec4 diffuseColor = vec4( diffuse, opacity );\n	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n	vec3 totalEmissiveRadiance = emissive;\n	#include <logdepthbuf_fragment>\n	#include <map_fragment>\n	#include <color_fragment>\n	#include <alphamap_fragment>\n	#include <alphatest_fragment>\n	#include <specularmap_fragment>\n	#include <normal_fragment_begin>\n	#include <normal_fragment_maps>\n	#include <emissivemap_fragment>\n	#include <lights_phong_fragment>\n	#include <lights_fragment_begin>\n	#include <lights_fragment_maps>\n	#include <lights_fragment_end>\n	#include <aomap_fragment>\n	vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n	#include <envmap_fragment>\n	#include <output_fragment>\n	#include <tonemapping_fragment>\n	#include <encodings_fragment>\n	#include <fog_fragment>\n	#include <premultiplied_alpha_fragment>\n	#include <dithering_fragment>\n}";
var vertex$5 = "#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n	varying vec3 vWorldPosition;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n	#include <uv_vertex>\n	#include <uv2_vertex>\n	#include <color_vertex>\n	#include <morphcolor_vertex>\n	#include <beginnormal_vertex>\n	#include <morphnormal_vertex>\n	#include <skinbase_vertex>\n	#include <skinnormal_vertex>\n	#include <defaultnormal_vertex>\n	#include <normal_vertex>\n	#include <begin_vertex>\n	#include <morphtarget_vertex>\n	#include <skinning_vertex>\n	#include <displacementmap_vertex>\n	#include <project_vertex>\n	#include <logdepthbuf_vertex>\n	#include <clipping_planes_vertex>\n	vViewPosition = - mvPosition.xyz;\n	#include <worldpos_vertex>\n	#include <shadowmap_vertex>\n	#include <fog_vertex>\n#ifdef USE_TRANSMISSION\n	vWorldPosition = worldPosition.xyz;\n#endif\n}";
var fragment$5 = "#define STANDARD\n#ifdef PHYSICAL\n	#define IOR\n	#define SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n	uniform float ior;\n#endif\n#ifdef SPECULAR\n	uniform float specularIntensity;\n	uniform vec3 specularColor;\n	#ifdef USE_SPECULARINTENSITYMAP\n		uniform sampler2D specularIntensityMap;\n	#endif\n	#ifdef USE_SPECULARCOLORMAP\n		uniform sampler2D specularColorMap;\n	#endif\n#endif\n#ifdef USE_CLEARCOAT\n	uniform float clearcoat;\n	uniform float clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n	uniform vec3 sheenColor;\n	uniform float sheenRoughness;\n	#ifdef USE_SHEENCOLORMAP\n		uniform sampler2D sheenColorMap;\n	#endif\n	#ifdef USE_SHEENROUGHNESSMAP\n		uniform sampler2D sheenRoughnessMap;\n	#endif\n#endif\nvarying vec3 vViewPosition;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <bsdfs>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_physical_pars_fragment>\n#include <transmission_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n	#include <clipping_planes_fragment>\n	vec4 diffuseColor = vec4( diffuse, opacity );\n	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n	vec3 totalEmissiveRadiance = emissive;\n	#include <logdepthbuf_fragment>\n	#include <map_fragment>\n	#include <color_fragment>\n	#include <alphamap_fragment>\n	#include <alphatest_fragment>\n	#include <roughnessmap_fragment>\n	#include <metalnessmap_fragment>\n	#include <normal_fragment_begin>\n	#include <normal_fragment_maps>\n	#include <clearcoat_normal_fragment_begin>\n	#include <clearcoat_normal_fragment_maps>\n	#include <emissivemap_fragment>\n	#include <lights_physical_fragment>\n	#include <lights_fragment_begin>\n	#include <lights_fragment_maps>\n	#include <lights_fragment_end>\n	#include <aomap_fragment>\n	vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n	vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n	#include <transmission_fragment>\n	vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n	#ifdef USE_SHEEN\n		float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n		outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecular;\n	#endif\n	#ifdef USE_CLEARCOAT\n		float dotNVcc = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n		vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n		outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + clearcoatSpecular * material.clearcoat;\n	#endif\n	#include <output_fragment>\n	#include <tonemapping_fragment>\n	#include <encodings_fragment>\n	#include <fog_fragment>\n	#include <premultiplied_alpha_fragment>\n	#include <dithering_fragment>\n}";
var vertex$4 = "#define TOON\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n	#include <uv_vertex>\n	#include <uv2_vertex>\n	#include <color_vertex>\n	#include <morphcolor_vertex>\n	#include <beginnormal_vertex>\n	#include <morphnormal_vertex>\n	#include <skinbase_vertex>\n	#include <skinnormal_vertex>\n	#include <defaultnormal_vertex>\n	#include <normal_vertex>\n	#include <begin_vertex>\n	#include <morphtarget_vertex>\n	#include <skinning_vertex>\n	#include <displacementmap_vertex>\n	#include <project_vertex>\n	#include <logdepthbuf_vertex>\n	#include <clipping_planes_vertex>\n	vViewPosition = - mvPosition.xyz;\n	#include <worldpos_vertex>\n	#include <shadowmap_vertex>\n	#include <fog_vertex>\n}";
var fragment$4 = "#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_toon_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n	#include <clipping_planes_fragment>\n	vec4 diffuseColor = vec4( diffuse, opacity );\n	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n	vec3 totalEmissiveRadiance = emissive;\n	#include <logdepthbuf_fragment>\n	#include <map_fragment>\n	#include <color_fragment>\n	#include <alphamap_fragment>\n	#include <alphatest_fragment>\n	#include <normal_fragment_begin>\n	#include <normal_fragment_maps>\n	#include <emissivemap_fragment>\n	#include <lights_toon_fragment>\n	#include <lights_fragment_begin>\n	#include <lights_fragment_maps>\n	#include <lights_fragment_end>\n	#include <aomap_fragment>\n	vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n	#include <output_fragment>\n	#include <tonemapping_fragment>\n	#include <encodings_fragment>\n	#include <fog_fragment>\n	#include <premultiplied_alpha_fragment>\n	#include <dithering_fragment>\n}";
var vertex$3 = "uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n	#include <color_vertex>\n	#include <morphcolor_vertex>\n	#include <begin_vertex>\n	#include <morphtarget_vertex>\n	#include <project_vertex>\n	gl_PointSize = size;\n	#ifdef USE_SIZEATTENUATION\n		bool isPerspective = isPerspectiveMatrix( projectionMatrix );\n		if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n	#endif\n	#include <logdepthbuf_vertex>\n	#include <clipping_planes_vertex>\n	#include <worldpos_vertex>\n	#include <fog_vertex>\n}";
var fragment$3 = "uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n	#include <clipping_planes_fragment>\n	vec3 outgoingLight = vec3( 0.0 );\n	vec4 diffuseColor = vec4( diffuse, opacity );\n	#include <logdepthbuf_fragment>\n	#include <map_particle_fragment>\n	#include <color_fragment>\n	#include <alphatest_fragment>\n	outgoingLight = diffuseColor.rgb;\n	#include <output_fragment>\n	#include <tonemapping_fragment>\n	#include <encodings_fragment>\n	#include <fog_fragment>\n	#include <premultiplied_alpha_fragment>\n}";
var vertex$2 = "#include <common>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n	#include <beginnormal_vertex>\n	#include <morphnormal_vertex>\n	#include <skinbase_vertex>\n	#include <skinnormal_vertex>\n	#include <defaultnormal_vertex>\n	#include <begin_vertex>\n	#include <morphtarget_vertex>\n	#include <skinning_vertex>\n	#include <project_vertex>\n	#include <worldpos_vertex>\n	#include <shadowmap_vertex>\n	#include <fog_vertex>\n}";
var fragment$2 = "uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n	gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n	#include <tonemapping_fragment>\n	#include <encodings_fragment>\n	#include <fog_fragment>\n}";
var vertex$1 = "uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n	#include <uv_vertex>\n	vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n	vec2 scale;\n	scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n	scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n	#ifndef USE_SIZEATTENUATION\n		bool isPerspective = isPerspectiveMatrix( projectionMatrix );\n		if ( isPerspective ) scale *= - mvPosition.z;\n	#endif\n	vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n	vec2 rotatedPosition;\n	rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n	rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n	mvPosition.xy += rotatedPosition;\n	gl_Position = projectionMatrix * mvPosition;\n	#include <logdepthbuf_vertex>\n	#include <clipping_planes_vertex>\n	#include <fog_vertex>\n}";
var fragment$1 = "uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n	#include <clipping_planes_fragment>\n	vec3 outgoingLight = vec3( 0.0 );\n	vec4 diffuseColor = vec4( diffuse, opacity );\n	#include <logdepthbuf_fragment>\n	#include <map_fragment>\n	#include <alphamap_fragment>\n	#include <alphatest_fragment>\n	outgoingLight = diffuseColor.rgb;\n	#include <output_fragment>\n	#include <tonemapping_fragment>\n	#include <encodings_fragment>\n	#include <fog_fragment>\n}";
var ShaderChunk = {
  alphamap_fragment,
  alphamap_pars_fragment,
  alphatest_fragment,
  alphatest_pars_fragment,
  aomap_fragment,
  aomap_pars_fragment,
  begin_vertex,
  beginnormal_vertex,
  bsdfs,
  bumpmap_pars_fragment,
  clipping_planes_fragment,
  clipping_planes_pars_fragment,
  clipping_planes_pars_vertex,
  clipping_planes_vertex,
  color_fragment,
  color_pars_fragment,
  color_pars_vertex,
  color_vertex,
  common,
  cube_uv_reflection_fragment,
  defaultnormal_vertex,
  displacementmap_pars_vertex,
  displacementmap_vertex,
  emissivemap_fragment,
  emissivemap_pars_fragment,
  encodings_fragment,
  encodings_pars_fragment,
  envmap_fragment,
  envmap_common_pars_fragment,
  envmap_pars_fragment,
  envmap_pars_vertex,
  envmap_physical_pars_fragment,
  envmap_vertex,
  fog_vertex,
  fog_pars_vertex,
  fog_fragment,
  fog_pars_fragment,
  gradientmap_pars_fragment,
  lightmap_fragment,
  lightmap_pars_fragment,
  lights_lambert_vertex,
  lights_pars_begin,
  lights_toon_fragment,
  lights_toon_pars_fragment,
  lights_phong_fragment,
  lights_phong_pars_fragment,
  lights_physical_fragment,
  lights_physical_pars_fragment,
  lights_fragment_begin,
  lights_fragment_maps,
  lights_fragment_end,
  logdepthbuf_fragment,
  logdepthbuf_pars_fragment,
  logdepthbuf_pars_vertex,
  logdepthbuf_vertex,
  map_fragment,
  map_pars_fragment,
  map_particle_fragment,
  map_particle_pars_fragment,
  metalnessmap_fragment,
  metalnessmap_pars_fragment,
  morphcolor_vertex,
  morphnormal_vertex,
  morphtarget_pars_vertex,
  morphtarget_vertex,
  normal_fragment_begin,
  normal_fragment_maps,
  normal_pars_fragment,
  normal_pars_vertex,
  normal_vertex,
  normalmap_pars_fragment,
  clearcoat_normal_fragment_begin,
  clearcoat_normal_fragment_maps,
  clearcoat_pars_fragment,
  output_fragment,
  packing,
  premultiplied_alpha_fragment,
  project_vertex,
  dithering_fragment,
  dithering_pars_fragment,
  roughnessmap_fragment,
  roughnessmap_pars_fragment,
  shadowmap_pars_fragment,
  shadowmap_pars_vertex,
  shadowmap_vertex,
  shadowmask_pars_fragment,
  skinbase_vertex,
  skinning_pars_vertex,
  skinning_vertex,
  skinnormal_vertex,
  specularmap_fragment,
  specularmap_pars_fragment,
  tonemapping_fragment,
  tonemapping_pars_fragment,
  transmission_fragment,
  transmission_pars_fragment,
  uv_pars_fragment,
  uv_pars_vertex,
  uv_vertex,
  uv2_pars_fragment,
  uv2_pars_vertex,
  uv2_vertex,
  worldpos_vertex,
  background_vert: vertex$g,
  background_frag: fragment$g,
  cube_vert: vertex$f,
  cube_frag: fragment$f,
  depth_vert: vertex$e,
  depth_frag: fragment$e,
  distanceRGBA_vert: vertex$d,
  distanceRGBA_frag: fragment$d,
  equirect_vert: vertex$c,
  equirect_frag: fragment$c,
  linedashed_vert: vertex$b,
  linedashed_frag: fragment$b,
  meshbasic_vert: vertex$a,
  meshbasic_frag: fragment$a,
  meshlambert_vert: vertex$9,
  meshlambert_frag: fragment$9,
  meshmatcap_vert: vertex$8,
  meshmatcap_frag: fragment$8,
  meshnormal_vert: vertex$7,
  meshnormal_frag: fragment$7,
  meshphong_vert: vertex$6,
  meshphong_frag: fragment$6,
  meshphysical_vert: vertex$5,
  meshphysical_frag: fragment$5,
  meshtoon_vert: vertex$4,
  meshtoon_frag: fragment$4,
  points_vert: vertex$3,
  points_frag: fragment$3,
  shadow_vert: vertex$2,
  shadow_frag: fragment$2,
  sprite_vert: vertex$1,
  sprite_frag: fragment$1
};
var UniformsLib = {
  common: {
    diffuse: { value: new Color2(16777215) },
    opacity: { value: 1 },
    map: { value: null },
    uvTransform: { value: new Matrix3() },
    uv2Transform: { value: new Matrix3() },
    alphaMap: { value: null },
    alphaTest: { value: 0 }
  },
  specularmap: {
    specularMap: { value: null }
  },
  envmap: {
    envMap: { value: null },
    flipEnvMap: { value: -1 },
    reflectivity: { value: 1 },
    // basic, lambert, phong
    ior: { value: 1.5 },
    // physical
    refractionRatio: { value: 0.98 }
    // basic, lambert, phong
  },
  aomap: {
    aoMap: { value: null },
    aoMapIntensity: { value: 1 }
  },
  lightmap: {
    lightMap: { value: null },
    lightMapIntensity: { value: 1 }
  },
  emissivemap: {
    emissiveMap: { value: null }
  },
  bumpmap: {
    bumpMap: { value: null },
    bumpScale: { value: 1 }
  },
  normalmap: {
    normalMap: { value: null },
    normalScale: { value: new Vector2(1, 1) }
  },
  displacementmap: {
    displacementMap: { value: null },
    displacementScale: { value: 1 },
    displacementBias: { value: 0 }
  },
  roughnessmap: {
    roughnessMap: { value: null }
  },
  metalnessmap: {
    metalnessMap: { value: null }
  },
  gradientmap: {
    gradientMap: { value: null }
  },
  fog: {
    fogDensity: { value: 25e-5 },
    fogNear: { value: 1 },
    fogFar: { value: 2e3 },
    fogColor: { value: new Color2(16777215) }
  },
  lights: {
    ambientLightColor: { value: [] },
    lightProbe: { value: [] },
    directionalLights: { value: [], properties: {
      direction: {},
      color: {}
    } },
    directionalLightShadows: { value: [], properties: {
      shadowBias: {},
      shadowNormalBias: {},
      shadowRadius: {},
      shadowMapSize: {}
    } },
    directionalShadowMap: { value: [] },
    directionalShadowMatrix: { value: [] },
    spotLights: { value: [], properties: {
      color: {},
      position: {},
      direction: {},
      distance: {},
      coneCos: {},
      penumbraCos: {},
      decay: {}
    } },
    spotLightShadows: { value: [], properties: {
      shadowBias: {},
      shadowNormalBias: {},
      shadowRadius: {},
      shadowMapSize: {}
    } },
    spotShadowMap: { value: [] },
    spotShadowMatrix: { value: [] },
    pointLights: { value: [], properties: {
      color: {},
      position: {},
      decay: {},
      distance: {}
    } },
    pointLightShadows: { value: [], properties: {
      shadowBias: {},
      shadowNormalBias: {},
      shadowRadius: {},
      shadowMapSize: {},
      shadowCameraNear: {},
      shadowCameraFar: {}
    } },
    pointShadowMap: { value: [] },
    pointShadowMatrix: { value: [] },
    hemisphereLights: { value: [], properties: {
      direction: {},
      skyColor: {},
      groundColor: {}
    } },
    // TODO (abelnation): RectAreaLight BRDF data needs to be moved from example to main src
    rectAreaLights: { value: [], properties: {
      color: {},
      position: {},
      width: {},
      height: {}
    } },
    ltc_1: { value: null },
    ltc_2: { value: null }
  },
  points: {
    diffuse: { value: new Color2(16777215) },
    opacity: { value: 1 },
    size: { value: 1 },
    scale: { value: 1 },
    map: { value: null },
    alphaMap: { value: null },
    alphaTest: { value: 0 },
    uvTransform: { value: new Matrix3() }
  },
  sprite: {
    diffuse: { value: new Color2(16777215) },
    opacity: { value: 1 },
    center: { value: new Vector2(0.5, 0.5) },
    rotation: { value: 0 },
    map: { value: null },
    alphaMap: { value: null },
    alphaTest: { value: 0 },
    uvTransform: { value: new Matrix3() }
  }
};
var ShaderLib = {
  basic: {
    uniforms: mergeUniforms([
      UniformsLib.common,
      UniformsLib.specularmap,
      UniformsLib.envmap,
      UniformsLib.aomap,
      UniformsLib.lightmap,
      UniformsLib.fog
    ]),
    vertexShader: ShaderChunk.meshbasic_vert,
    fragmentShader: ShaderChunk.meshbasic_frag
  },
  lambert: {
    uniforms: mergeUniforms([
      UniformsLib.common,
      UniformsLib.specularmap,
      UniformsLib.envmap,
      UniformsLib.aomap,
      UniformsLib.lightmap,
      UniformsLib.emissivemap,
      UniformsLib.fog,
      UniformsLib.lights,
      {
        emissive: { value: new Color2(0) }
      }
    ]),
    vertexShader: ShaderChunk.meshlambert_vert,
    fragmentShader: ShaderChunk.meshlambert_frag
  },
  phong: {
    uniforms: mergeUniforms([
      UniformsLib.common,
      UniformsLib.specularmap,
      UniformsLib.envmap,
      UniformsLib.aomap,
      UniformsLib.lightmap,
      UniformsLib.emissivemap,
      UniformsLib.bumpmap,
      UniformsLib.normalmap,
      UniformsLib.displacementmap,
      UniformsLib.fog,
      UniformsLib.lights,
      {
        emissive: { value: new Color2(0) },
        specular: { value: new Color2(1118481) },
        shininess: { value: 30 }
      }
    ]),
    vertexShader: ShaderChunk.meshphong_vert,
    fragmentShader: ShaderChunk.meshphong_frag
  },
  standard: {
    uniforms: mergeUniforms([
      UniformsLib.common,
      UniformsLib.envmap,
      UniformsLib.aomap,
      UniformsLib.lightmap,
      UniformsLib.emissivemap,
      UniformsLib.bumpmap,
      UniformsLib.normalmap,
      UniformsLib.displacementmap,
      UniformsLib.roughnessmap,
      UniformsLib.metalnessmap,
      UniformsLib.fog,
      UniformsLib.lights,
      {
        emissive: { value: new Color2(0) },
        roughness: { value: 1 },
        metalness: { value: 0 },
        envMapIntensity: { value: 1 }
        // temporary
      }
    ]),
    vertexShader: ShaderChunk.meshphysical_vert,
    fragmentShader: ShaderChunk.meshphysical_frag
  },
  toon: {
    uniforms: mergeUniforms([
      UniformsLib.common,
      UniformsLib.aomap,
      UniformsLib.lightmap,
      UniformsLib.emissivemap,
      UniformsLib.bumpmap,
      UniformsLib.normalmap,
      UniformsLib.displacementmap,
      UniformsLib.gradientmap,
      UniformsLib.fog,
      UniformsLib.lights,
      {
        emissive: { value: new Color2(0) }
      }
    ]),
    vertexShader: ShaderChunk.meshtoon_vert,
    fragmentShader: ShaderChunk.meshtoon_frag
  },
  matcap: {
    uniforms: mergeUniforms([
      UniformsLib.common,
      UniformsLib.bumpmap,
      UniformsLib.normalmap,
      UniformsLib.displacementmap,
      UniformsLib.fog,
      {
        matcap: { value: null }
      }
    ]),
    vertexShader: ShaderChunk.meshmatcap_vert,
    fragmentShader: ShaderChunk.meshmatcap_frag
  },
  points: {
    uniforms: mergeUniforms([
      UniformsLib.points,
      UniformsLib.fog
    ]),
    vertexShader: ShaderChunk.points_vert,
    fragmentShader: ShaderChunk.points_frag
  },
  dashed: {
    uniforms: mergeUniforms([
      UniformsLib.common,
      UniformsLib.fog,
      {
        scale: { value: 1 },
        dashSize: { value: 1 },
        totalSize: { value: 2 }
      }
    ]),
    vertexShader: ShaderChunk.linedashed_vert,
    fragmentShader: ShaderChunk.linedashed_frag
  },
  depth: {
    uniforms: mergeUniforms([
      UniformsLib.common,
      UniformsLib.displacementmap
    ]),
    vertexShader: ShaderChunk.depth_vert,
    fragmentShader: ShaderChunk.depth_frag
  },
  normal: {
    uniforms: mergeUniforms([
      UniformsLib.common,
      UniformsLib.bumpmap,
      UniformsLib.normalmap,
      UniformsLib.displacementmap,
      {
        opacity: { value: 1 }
      }
    ]),
    vertexShader: ShaderChunk.meshnormal_vert,
    fragmentShader: ShaderChunk.meshnormal_frag
  },
  sprite: {
    uniforms: mergeUniforms([
      UniformsLib.sprite,
      UniformsLib.fog
    ]),
    vertexShader: ShaderChunk.sprite_vert,
    fragmentShader: ShaderChunk.sprite_frag
  },
  background: {
    uniforms: {
      uvTransform: { value: new Matrix3() },
      t2D: { value: null }
    },
    vertexShader: ShaderChunk.background_vert,
    fragmentShader: ShaderChunk.background_frag
  },
  /* -------------------------------------------------------------------------
  //	Cube map shader
   ------------------------------------------------------------------------- */
  cube: {
    uniforms: mergeUniforms([
      UniformsLib.envmap,
      {
        opacity: { value: 1 }
      }
    ]),
    vertexShader: ShaderChunk.cube_vert,
    fragmentShader: ShaderChunk.cube_frag
  },
  equirect: {
    uniforms: {
      tEquirect: { value: null }
    },
    vertexShader: ShaderChunk.equirect_vert,
    fragmentShader: ShaderChunk.equirect_frag
  },
  distanceRGBA: {
    uniforms: mergeUniforms([
      UniformsLib.common,
      UniformsLib.displacementmap,
      {
        referencePosition: { value: new Vector3() },
        nearDistance: { value: 1 },
        farDistance: { value: 1e3 }
      }
    ]),
    vertexShader: ShaderChunk.distanceRGBA_vert,
    fragmentShader: ShaderChunk.distanceRGBA_frag
  },
  shadow: {
    uniforms: mergeUniforms([
      UniformsLib.lights,
      UniformsLib.fog,
      {
        color: { value: new Color2(0) },
        opacity: { value: 1 }
      }
    ]),
    vertexShader: ShaderChunk.shadow_vert,
    fragmentShader: ShaderChunk.shadow_frag
  }
};
ShaderLib.physical = {
  uniforms: mergeUniforms([
    ShaderLib.standard.uniforms,
    {
      clearcoat: { value: 0 },
      clearcoatMap: { value: null },
      clearcoatRoughness: { value: 0 },
      clearcoatRoughnessMap: { value: null },
      clearcoatNormalScale: { value: new Vector2(1, 1) },
      clearcoatNormalMap: { value: null },
      sheen: { value: 0 },
      sheenColor: { value: new Color2(0) },
      sheenColorMap: { value: null },
      sheenRoughness: { value: 1 },
      sheenRoughnessMap: { value: null },
      transmission: { value: 0 },
      transmissionMap: { value: null },
      transmissionSamplerSize: { value: new Vector2() },
      transmissionSamplerMap: { value: null },
      thickness: { value: 0 },
      thicknessMap: { value: null },
      attenuationDistance: { value: 0 },
      attenuationColor: { value: new Color2(0) },
      specularIntensity: { value: 1 },
      specularIntensityMap: { value: null },
      specularColor: { value: new Color2(1, 1, 1) },
      specularColorMap: { value: null }
    }
  ]),
  vertexShader: ShaderChunk.meshphysical_vert,
  fragmentShader: ShaderChunk.meshphysical_frag
};
function WebGLBackground(renderer, cubemaps, state, objects, alpha3, premultipliedAlpha) {
  const clearColor = new Color2(0);
  let clearAlpha = alpha3 === true ? 0 : 1;
  let planeMesh;
  let boxMesh;
  let currentBackground = null;
  let currentBackgroundVersion = 0;
  let currentTonemapping = null;
  function render2(renderList, scene) {
    let forceClear = false;
    let background2 = scene.isScene === true ? scene.background : null;
    if (background2 && background2.isTexture) {
      background2 = cubemaps.get(background2);
    }
    const xr = renderer.xr;
    const session = xr.getSession && xr.getSession();
    if (session && session.environmentBlendMode === "additive") {
      background2 = null;
    }
    if (background2 === null) {
      setClear(clearColor, clearAlpha);
    } else if (background2 && background2.isColor) {
      setClear(background2, 1);
      forceClear = true;
    }
    if (renderer.autoClear || forceClear) {
      renderer.clear(renderer.autoClearColor, renderer.autoClearDepth, renderer.autoClearStencil);
    }
    if (background2 && (background2.isCubeTexture || background2.mapping === CubeUVReflectionMapping)) {
      if (boxMesh === void 0) {
        boxMesh = new Mesh(
          new BoxGeometry(1, 1, 1),
          new ShaderMaterial({
            name: "BackgroundCubeMaterial",
            uniforms: cloneUniforms(ShaderLib.cube.uniforms),
            vertexShader: ShaderLib.cube.vertexShader,
            fragmentShader: ShaderLib.cube.fragmentShader,
            side: BackSide,
            depthTest: false,
            depthWrite: false,
            fog: false
          })
        );
        boxMesh.geometry.deleteAttribute("normal");
        boxMesh.geometry.deleteAttribute("uv");
        boxMesh.onBeforeRender = function(renderer2, scene2, camera) {
          this.matrixWorld.copyPosition(camera.matrixWorld);
        };
        Object.defineProperty(boxMesh.material, "envMap", {
          get: function() {
            return this.uniforms.envMap.value;
          }
        });
        objects.update(boxMesh);
      }
      boxMesh.material.uniforms.envMap.value = background2;
      boxMesh.material.uniforms.flipEnvMap.value = background2.isCubeTexture && background2.isRenderTargetTexture === false ? -1 : 1;
      if (currentBackground !== background2 || currentBackgroundVersion !== background2.version || currentTonemapping !== renderer.toneMapping) {
        boxMesh.material.needsUpdate = true;
        currentBackground = background2;
        currentBackgroundVersion = background2.version;
        currentTonemapping = renderer.toneMapping;
      }
      renderList.unshift(boxMesh, boxMesh.geometry, boxMesh.material, 0, 0, null);
    } else if (background2 && background2.isTexture) {
      if (planeMesh === void 0) {
        planeMesh = new Mesh(
          new PlaneGeometry(2, 2),
          new ShaderMaterial({
            name: "BackgroundMaterial",
            uniforms: cloneUniforms(ShaderLib.background.uniforms),
            vertexShader: ShaderLib.background.vertexShader,
            fragmentShader: ShaderLib.background.fragmentShader,
            side: FrontSide,
            depthTest: false,
            depthWrite: false,
            fog: false
          })
        );
        planeMesh.geometry.deleteAttribute("normal");
        Object.defineProperty(planeMesh.material, "map", {
          get: function() {
            return this.uniforms.t2D.value;
          }
        });
        objects.update(planeMesh);
      }
      planeMesh.material.uniforms.t2D.value = background2;
      if (background2.matrixAutoUpdate === true) {
        background2.updateMatrix();
      }
      planeMesh.material.uniforms.uvTransform.value.copy(background2.matrix);
      if (currentBackground !== background2 || currentBackgroundVersion !== background2.version || currentTonemapping !== renderer.toneMapping) {
        planeMesh.material.needsUpdate = true;
        currentBackground = background2;
        currentBackgroundVersion = background2.version;
        currentTonemapping = renderer.toneMapping;
      }
      renderList.unshift(planeMesh, planeMesh.geometry, planeMesh.material, 0, 0, null);
    }
  }
  function setClear(color2, alpha4) {
    state.buffers.color.setClear(color2.r, color2.g, color2.b, alpha4, premultipliedAlpha);
  }
  return {
    getClearColor: function() {
      return clearColor;
    },
    setClearColor: function(color2, alpha4 = 1) {
      clearColor.set(color2);
      clearAlpha = alpha4;
      setClear(clearColor, clearAlpha);
    },
    getClearAlpha: function() {
      return clearAlpha;
    },
    setClearAlpha: function(alpha4) {
      clearAlpha = alpha4;
      setClear(clearColor, clearAlpha);
    },
    render: render2
  };
}
function WebGLBindingStates(gl, extensions2, attributes, capabilities) {
  const maxVertexAttributes = gl.getParameter(34921);
  const extension = capabilities.isWebGL2 ? null : extensions2.get("OES_vertex_array_object");
  const vaoAvailable = capabilities.isWebGL2 || extension !== null;
  const bindingStates = {};
  const defaultState = createBindingState(null);
  let currentState2 = defaultState;
  let forceUpdate = false;
  function setup(object, material, program, geometry, index) {
    let updateBuffers = false;
    if (vaoAvailable) {
      const state = getBindingState(geometry, program, material);
      if (currentState2 !== state) {
        currentState2 = state;
        bindVertexArrayObject(currentState2.object);
      }
      updateBuffers = needsUpdate(geometry, index);
      if (updateBuffers)
        saveCache(geometry, index);
    } else {
      const wireframe = material.wireframe === true;
      if (currentState2.geometry !== geometry.id || currentState2.program !== program.id || currentState2.wireframe !== wireframe) {
        currentState2.geometry = geometry.id;
        currentState2.program = program.id;
        currentState2.wireframe = wireframe;
        updateBuffers = true;
      }
    }
    if (object.isInstancedMesh === true) {
      updateBuffers = true;
    }
    if (index !== null) {
      attributes.update(index, 34963);
    }
    if (updateBuffers || forceUpdate) {
      forceUpdate = false;
      setupVertexAttributes(object, material, program, geometry);
      if (index !== null) {
        gl.bindBuffer(34963, attributes.get(index).buffer);
      }
    }
  }
  function createVertexArrayObject() {
    if (capabilities.isWebGL2)
      return gl.createVertexArray();
    return extension.createVertexArrayOES();
  }
  function bindVertexArrayObject(vao) {
    if (capabilities.isWebGL2)
      return gl.bindVertexArray(vao);
    return extension.bindVertexArrayOES(vao);
  }
  function deleteVertexArrayObject(vao) {
    if (capabilities.isWebGL2)
      return gl.deleteVertexArray(vao);
    return extension.deleteVertexArrayOES(vao);
  }
  function getBindingState(geometry, program, material) {
    const wireframe = material.wireframe === true;
    let programMap = bindingStates[geometry.id];
    if (programMap === void 0) {
      programMap = {};
      bindingStates[geometry.id] = programMap;
    }
    let stateMap = programMap[program.id];
    if (stateMap === void 0) {
      stateMap = {};
      programMap[program.id] = stateMap;
    }
    let state = stateMap[wireframe];
    if (state === void 0) {
      state = createBindingState(createVertexArrayObject());
      stateMap[wireframe] = state;
    }
    return state;
  }
  function createBindingState(vao) {
    const newAttributes = [];
    const enabledAttributes = [];
    const attributeDivisors = [];
    for (let i2 = 0; i2 < maxVertexAttributes; i2++) {
      newAttributes[i2] = 0;
      enabledAttributes[i2] = 0;
      attributeDivisors[i2] = 0;
    }
    return {
      // for backward compatibility on non-VAO support browser
      geometry: null,
      program: null,
      wireframe: false,
      newAttributes,
      enabledAttributes,
      attributeDivisors,
      object: vao,
      attributes: {},
      index: null
    };
  }
  function needsUpdate(geometry, index) {
    const cachedAttributes = currentState2.attributes;
    const geometryAttributes = geometry.attributes;
    let attributesNum = 0;
    for (const key in geometryAttributes) {
      const cachedAttribute = cachedAttributes[key];
      const geometryAttribute = geometryAttributes[key];
      if (cachedAttribute === void 0)
        return true;
      if (cachedAttribute.attribute !== geometryAttribute)
        return true;
      if (cachedAttribute.data !== geometryAttribute.data)
        return true;
      attributesNum++;
    }
    if (currentState2.attributesNum !== attributesNum)
      return true;
    if (currentState2.index !== index)
      return true;
    return false;
  }
  function saveCache(geometry, index) {
    const cache2 = {};
    const attributes2 = geometry.attributes;
    let attributesNum = 0;
    for (const key in attributes2) {
      const attribute = attributes2[key];
      const data = {};
      data.attribute = attribute;
      if (attribute.data) {
        data.data = attribute.data;
      }
      cache2[key] = data;
      attributesNum++;
    }
    currentState2.attributes = cache2;
    currentState2.attributesNum = attributesNum;
    currentState2.index = index;
  }
  function initAttributes() {
    const newAttributes = currentState2.newAttributes;
    for (let i2 = 0, il = newAttributes.length; i2 < il; i2++) {
      newAttributes[i2] = 0;
    }
  }
  function enableAttribute(attribute) {
    enableAttributeAndDivisor(attribute, 0);
  }
  function enableAttributeAndDivisor(attribute, meshPerAttribute) {
    const newAttributes = currentState2.newAttributes;
    const enabledAttributes = currentState2.enabledAttributes;
    const attributeDivisors = currentState2.attributeDivisors;
    newAttributes[attribute] = 1;
    if (enabledAttributes[attribute] === 0) {
      gl.enableVertexAttribArray(attribute);
      enabledAttributes[attribute] = 1;
    }
    if (attributeDivisors[attribute] !== meshPerAttribute) {
      const extension2 = capabilities.isWebGL2 ? gl : extensions2.get("ANGLE_instanced_arrays");
      extension2[capabilities.isWebGL2 ? "vertexAttribDivisor" : "vertexAttribDivisorANGLE"](attribute, meshPerAttribute);
      attributeDivisors[attribute] = meshPerAttribute;
    }
  }
  function disableUnusedAttributes() {
    const newAttributes = currentState2.newAttributes;
    const enabledAttributes = currentState2.enabledAttributes;
    for (let i2 = 0, il = enabledAttributes.length; i2 < il; i2++) {
      if (enabledAttributes[i2] !== newAttributes[i2]) {
        gl.disableVertexAttribArray(i2);
        enabledAttributes[i2] = 0;
      }
    }
  }
  function vertexAttribPointer(index, size, type, normalized, stride, offset) {
    if (capabilities.isWebGL2 === true && (type === 5124 || type === 5125)) {
      gl.vertexAttribIPointer(index, size, type, stride, offset);
    } else {
      gl.vertexAttribPointer(index, size, type, normalized, stride, offset);
    }
  }
  function setupVertexAttributes(object, material, program, geometry) {
    if (capabilities.isWebGL2 === false && (object.isInstancedMesh || geometry.isInstancedBufferGeometry)) {
      if (extensions2.get("ANGLE_instanced_arrays") === null)
        return;
    }
    initAttributes();
    const geometryAttributes = geometry.attributes;
    const programAttributes = program.getAttributes();
    const materialDefaultAttributeValues = material.defaultAttributeValues;
    for (const name2 in programAttributes) {
      const programAttribute = programAttributes[name2];
      if (programAttribute.location >= 0) {
        let geometryAttribute = geometryAttributes[name2];
        if (geometryAttribute === void 0) {
          if (name2 === "instanceMatrix" && object.instanceMatrix)
            geometryAttribute = object.instanceMatrix;
          if (name2 === "instanceColor" && object.instanceColor)
            geometryAttribute = object.instanceColor;
        }
        if (geometryAttribute !== void 0) {
          const normalized = geometryAttribute.normalized;
          const size = geometryAttribute.itemSize;
          const attribute = attributes.get(geometryAttribute);
          if (attribute === void 0)
            continue;
          const buffer = attribute.buffer;
          const type = attribute.type;
          const bytesPerElement = attribute.bytesPerElement;
          if (geometryAttribute.isInterleavedBufferAttribute) {
            const data = geometryAttribute.data;
            const stride = data.stride;
            const offset = geometryAttribute.offset;
            if (data.isInstancedInterleavedBuffer) {
              for (let i2 = 0; i2 < programAttribute.locationSize; i2++) {
                enableAttributeAndDivisor(programAttribute.location + i2, data.meshPerAttribute);
              }
              if (object.isInstancedMesh !== true && geometry._maxInstanceCount === void 0) {
                geometry._maxInstanceCount = data.meshPerAttribute * data.count;
              }
            } else {
              for (let i2 = 0; i2 < programAttribute.locationSize; i2++) {
                enableAttribute(programAttribute.location + i2);
              }
            }
            gl.bindBuffer(34962, buffer);
            for (let i2 = 0; i2 < programAttribute.locationSize; i2++) {
              vertexAttribPointer(
                programAttribute.location + i2,
                size / programAttribute.locationSize,
                type,
                normalized,
                stride * bytesPerElement,
                (offset + size / programAttribute.locationSize * i2) * bytesPerElement
              );
            }
          } else {
            if (geometryAttribute.isInstancedBufferAttribute) {
              for (let i2 = 0; i2 < programAttribute.locationSize; i2++) {
                enableAttributeAndDivisor(programAttribute.location + i2, geometryAttribute.meshPerAttribute);
              }
              if (object.isInstancedMesh !== true && geometry._maxInstanceCount === void 0) {
                geometry._maxInstanceCount = geometryAttribute.meshPerAttribute * geometryAttribute.count;
              }
            } else {
              for (let i2 = 0; i2 < programAttribute.locationSize; i2++) {
                enableAttribute(programAttribute.location + i2);
              }
            }
            gl.bindBuffer(34962, buffer);
            for (let i2 = 0; i2 < programAttribute.locationSize; i2++) {
              vertexAttribPointer(
                programAttribute.location + i2,
                size / programAttribute.locationSize,
                type,
                normalized,
                size * bytesPerElement,
                size / programAttribute.locationSize * i2 * bytesPerElement
              );
            }
          }
        } else if (materialDefaultAttributeValues !== void 0) {
          const value = materialDefaultAttributeValues[name2];
          if (value !== void 0) {
            switch (value.length) {
              case 2:
                gl.vertexAttrib2fv(programAttribute.location, value);
                break;
              case 3:
                gl.vertexAttrib3fv(programAttribute.location, value);
                break;
              case 4:
                gl.vertexAttrib4fv(programAttribute.location, value);
                break;
              default:
                gl.vertexAttrib1fv(programAttribute.location, value);
            }
          }
        }
      }
    }
    disableUnusedAttributes();
  }
  function dispose2() {
    reset();
    for (const geometryId in bindingStates) {
      const programMap = bindingStates[geometryId];
      for (const programId in programMap) {
        const stateMap = programMap[programId];
        for (const wireframe in stateMap) {
          deleteVertexArrayObject(stateMap[wireframe].object);
          delete stateMap[wireframe];
        }
        delete programMap[programId];
      }
      delete bindingStates[geometryId];
    }
  }
  function releaseStatesOfGeometry(geometry) {
    if (bindingStates[geometry.id] === void 0)
      return;
    const programMap = bindingStates[geometry.id];
    for (const programId in programMap) {
      const stateMap = programMap[programId];
      for (const wireframe in stateMap) {
        deleteVertexArrayObject(stateMap[wireframe].object);
        delete stateMap[wireframe];
      }
      delete programMap[programId];
    }
    delete bindingStates[geometry.id];
  }
  function releaseStatesOfProgram(program) {
    for (const geometryId in bindingStates) {
      const programMap = bindingStates[geometryId];
      if (programMap[program.id] === void 0)
        continue;
      const stateMap = programMap[program.id];
      for (const wireframe in stateMap) {
        deleteVertexArrayObject(stateMap[wireframe].object);
        delete stateMap[wireframe];
      }
      delete programMap[program.id];
    }
  }
  function reset() {
    resetDefaultState();
    forceUpdate = true;
    if (currentState2 === defaultState)
      return;
    currentState2 = defaultState;
    bindVertexArrayObject(currentState2.object);
  }
  function resetDefaultState() {
    defaultState.geometry = null;
    defaultState.program = null;
    defaultState.wireframe = false;
  }
  return {
    setup,
    reset,
    resetDefaultState,
    dispose: dispose2,
    releaseStatesOfGeometry,
    releaseStatesOfProgram,
    initAttributes,
    enableAttribute,
    disableUnusedAttributes
  };
}
function WebGLBufferRenderer(gl, extensions2, info, capabilities) {
  const isWebGL2 = capabilities.isWebGL2;
  let mode;
  function setMode(value) {
    mode = value;
  }
  function render2(start, count2) {
    gl.drawArrays(mode, start, count2);
    info.update(count2, mode, 1);
  }
  function renderInstances(start, count2, primcount) {
    if (primcount === 0)
      return;
    let extension, methodName;
    if (isWebGL2) {
      extension = gl;
      methodName = "drawArraysInstanced";
    } else {
      extension = extensions2.get("ANGLE_instanced_arrays");
      methodName = "drawArraysInstancedANGLE";
      if (extension === null) {
        console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
        return;
      }
    }
    extension[methodName](mode, start, count2, primcount);
    info.update(count2, mode, primcount);
  }
  this.setMode = setMode;
  this.render = render2;
  this.renderInstances = renderInstances;
}
function WebGLCapabilities(gl, extensions2, parameters) {
  let maxAnisotropy;
  function getMaxAnisotropy() {
    if (maxAnisotropy !== void 0)
      return maxAnisotropy;
    if (extensions2.has("EXT_texture_filter_anisotropic") === true) {
      const extension = extensions2.get("EXT_texture_filter_anisotropic");
      maxAnisotropy = gl.getParameter(extension.MAX_TEXTURE_MAX_ANISOTROPY_EXT);
    } else {
      maxAnisotropy = 0;
    }
    return maxAnisotropy;
  }
  function getMaxPrecision(precision2) {
    if (precision2 === "highp") {
      if (gl.getShaderPrecisionFormat(35633, 36338).precision > 0 && gl.getShaderPrecisionFormat(35632, 36338).precision > 0) {
        return "highp";
      }
      precision2 = "mediump";
    }
    if (precision2 === "mediump") {
      if (gl.getShaderPrecisionFormat(35633, 36337).precision > 0 && gl.getShaderPrecisionFormat(35632, 36337).precision > 0) {
        return "mediump";
      }
    }
    return "lowp";
  }
  const isWebGL2 = typeof WebGL2RenderingContext !== "undefined" && gl instanceof WebGL2RenderingContext || typeof WebGL2ComputeRenderingContext !== "undefined" && gl instanceof WebGL2ComputeRenderingContext;
  let precision = parameters.precision !== void 0 ? parameters.precision : "highp";
  const maxPrecision = getMaxPrecision(precision);
  if (maxPrecision !== precision) {
    console.warn("THREE.WebGLRenderer:", precision, "not supported, using", maxPrecision, "instead.");
    precision = maxPrecision;
  }
  const drawBuffers = isWebGL2 || extensions2.has("WEBGL_draw_buffers");
  const logarithmicDepthBuffer = parameters.logarithmicDepthBuffer === true;
  const maxTextures = gl.getParameter(34930);
  const maxVertexTextures = gl.getParameter(35660);
  const maxTextureSize = gl.getParameter(3379);
  const maxCubemapSize = gl.getParameter(34076);
  const maxAttributes = gl.getParameter(34921);
  const maxVertexUniforms = gl.getParameter(36347);
  const maxVaryings = gl.getParameter(36348);
  const maxFragmentUniforms = gl.getParameter(36349);
  const vertexTextures = maxVertexTextures > 0;
  const floatFragmentTextures = isWebGL2 || extensions2.has("OES_texture_float");
  const floatVertexTextures = vertexTextures && floatFragmentTextures;
  const maxSamples = isWebGL2 ? gl.getParameter(36183) : 0;
  return {
    isWebGL2,
    drawBuffers,
    getMaxAnisotropy,
    getMaxPrecision,
    precision,
    logarithmicDepthBuffer,
    maxTextures,
    maxVertexTextures,
    maxTextureSize,
    maxCubemapSize,
    maxAttributes,
    maxVertexUniforms,
    maxVaryings,
    maxFragmentUniforms,
    vertexTextures,
    floatFragmentTextures,
    floatVertexTextures,
    maxSamples
  };
}
function WebGLClipping(properties) {
  const scope = this;
  let globalState = null, numGlobalPlanes = 0, localClippingEnabled = false, renderingShadows = false;
  const plane = new Plane(), viewNormalMatrix = new Matrix3(), uniform = { value: null, needsUpdate: false };
  this.uniform = uniform;
  this.numPlanes = 0;
  this.numIntersection = 0;
  this.init = function(planes, enableLocalClipping, camera) {
    const enabled = planes.length !== 0 || enableLocalClipping || // enable state of previous frame - the clipping code has to
    // run another frame in order to reset the state:
    numGlobalPlanes !== 0 || localClippingEnabled;
    localClippingEnabled = enableLocalClipping;
    globalState = projectPlanes(planes, camera, 0);
    numGlobalPlanes = planes.length;
    return enabled;
  };
  this.beginShadows = function() {
    renderingShadows = true;
    projectPlanes(null);
  };
  this.endShadows = function() {
    renderingShadows = false;
    resetGlobalState();
  };
  this.setState = function(material, camera, useCache) {
    const planes = material.clippingPlanes, clipIntersection = material.clipIntersection, clipShadows = material.clipShadows;
    const materialProperties = properties.get(material);
    if (!localClippingEnabled || planes === null || planes.length === 0 || renderingShadows && !clipShadows) {
      if (renderingShadows) {
        projectPlanes(null);
      } else {
        resetGlobalState();
      }
    } else {
      const nGlobal = renderingShadows ? 0 : numGlobalPlanes, lGlobal = nGlobal * 4;
      let dstArray = materialProperties.clippingState || null;
      uniform.value = dstArray;
      dstArray = projectPlanes(planes, camera, lGlobal, useCache);
      for (let i2 = 0; i2 !== lGlobal; ++i2) {
        dstArray[i2] = globalState[i2];
      }
      materialProperties.clippingState = dstArray;
      this.numIntersection = clipIntersection ? this.numPlanes : 0;
      this.numPlanes += nGlobal;
    }
  };
  function resetGlobalState() {
    if (uniform.value !== globalState) {
      uniform.value = globalState;
      uniform.needsUpdate = numGlobalPlanes > 0;
    }
    scope.numPlanes = numGlobalPlanes;
    scope.numIntersection = 0;
  }
  function projectPlanes(planes, camera, dstOffset, skipTransform) {
    const nPlanes = planes !== null ? planes.length : 0;
    let dstArray = null;
    if (nPlanes !== 0) {
      dstArray = uniform.value;
      if (skipTransform !== true || dstArray === null) {
        const flatSize = dstOffset + nPlanes * 4, viewMatrix = camera.matrixWorldInverse;
        viewNormalMatrix.getNormalMatrix(viewMatrix);
        if (dstArray === null || dstArray.length < flatSize) {
          dstArray = new Float32Array(flatSize);
        }
        for (let i2 = 0, i4 = dstOffset; i2 !== nPlanes; ++i2, i4 += 4) {
          plane.copy(planes[i2]).applyMatrix4(viewMatrix, viewNormalMatrix);
          plane.normal.toArray(dstArray, i4);
          dstArray[i4 + 3] = plane.constant;
        }
      }
      uniform.value = dstArray;
      uniform.needsUpdate = true;
    }
    scope.numPlanes = nPlanes;
    scope.numIntersection = 0;
    return dstArray;
  }
}
function WebGLCubeMaps(renderer) {
  let cubemaps = /* @__PURE__ */ new WeakMap();
  function mapTextureMapping(texture, mapping) {
    if (mapping === EquirectangularReflectionMapping) {
      texture.mapping = CubeReflectionMapping;
    } else if (mapping === EquirectangularRefractionMapping) {
      texture.mapping = CubeRefractionMapping;
    }
    return texture;
  }
  function get3(texture) {
    if (texture && texture.isTexture && texture.isRenderTargetTexture === false) {
      const mapping = texture.mapping;
      if (mapping === EquirectangularReflectionMapping || mapping === EquirectangularRefractionMapping) {
        if (cubemaps.has(texture)) {
          const cubemap = cubemaps.get(texture).texture;
          return mapTextureMapping(cubemap, texture.mapping);
        } else {
          const image = texture.image;
          if (image && image.height > 0) {
            const renderTarget = new WebGLCubeRenderTarget(image.height / 2);
            renderTarget.fromEquirectangularTexture(renderer, texture);
            cubemaps.set(texture, renderTarget);
            texture.addEventListener("dispose", onTextureDispose);
            return mapTextureMapping(renderTarget.texture, texture.mapping);
          } else {
            return null;
          }
        }
      }
    }
    return texture;
  }
  function onTextureDispose(event) {
    const texture = event.target;
    texture.removeEventListener("dispose", onTextureDispose);
    const cubemap = cubemaps.get(texture);
    if (cubemap !== void 0) {
      cubemaps.delete(texture);
      cubemap.dispose();
    }
  }
  function dispose2() {
    cubemaps = /* @__PURE__ */ new WeakMap();
  }
  return {
    get: get3,
    dispose: dispose2
  };
}
var OrthographicCamera = class extends Camera {
  constructor(left = -1, right = 1, top2 = 1, bottom = -1, near = 0.1, far = 2e3) {
    super();
    this.type = "OrthographicCamera";
    this.zoom = 1;
    this.view = null;
    this.left = left;
    this.right = right;
    this.top = top2;
    this.bottom = bottom;
    this.near = near;
    this.far = far;
    this.updateProjectionMatrix();
  }
  copy(source, recursive) {
    super.copy(source, recursive);
    this.left = source.left;
    this.right = source.right;
    this.top = source.top;
    this.bottom = source.bottom;
    this.near = source.near;
    this.far = source.far;
    this.zoom = source.zoom;
    this.view = source.view === null ? null : Object.assign({}, source.view);
    return this;
  }
  setViewOffset(fullWidth, fullHeight, x2, y2, width, height) {
    if (this.view === null) {
      this.view = {
        enabled: true,
        fullWidth: 1,
        fullHeight: 1,
        offsetX: 0,
        offsetY: 0,
        width: 1,
        height: 1
      };
    }
    this.view.enabled = true;
    this.view.fullWidth = fullWidth;
    this.view.fullHeight = fullHeight;
    this.view.offsetX = x2;
    this.view.offsetY = y2;
    this.view.width = width;
    this.view.height = height;
    this.updateProjectionMatrix();
  }
  clearViewOffset() {
    if (this.view !== null) {
      this.view.enabled = false;
    }
    this.updateProjectionMatrix();
  }
  updateProjectionMatrix() {
    const dx = (this.right - this.left) / (2 * this.zoom);
    const dy = (this.top - this.bottom) / (2 * this.zoom);
    const cx = (this.right + this.left) / 2;
    const cy = (this.top + this.bottom) / 2;
    let left = cx - dx;
    let right = cx + dx;
    let top2 = cy + dy;
    let bottom = cy - dy;
    if (this.view !== null && this.view.enabled) {
      const scaleW = (this.right - this.left) / this.view.fullWidth / this.zoom;
      const scaleH = (this.top - this.bottom) / this.view.fullHeight / this.zoom;
      left += scaleW * this.view.offsetX;
      right = left + scaleW * this.view.width;
      top2 -= scaleH * this.view.offsetY;
      bottom = top2 - scaleH * this.view.height;
    }
    this.projectionMatrix.makeOrthographic(left, right, top2, bottom, this.near, this.far);
    this.projectionMatrixInverse.copy(this.projectionMatrix).invert();
  }
  toJSON(meta2) {
    const data = super.toJSON(meta2);
    data.object.zoom = this.zoom;
    data.object.left = this.left;
    data.object.right = this.right;
    data.object.top = this.top;
    data.object.bottom = this.bottom;
    data.object.near = this.near;
    data.object.far = this.far;
    if (this.view !== null)
      data.object.view = Object.assign({}, this.view);
    return data;
  }
};
OrthographicCamera.prototype.isOrthographicCamera = true;
var LOD_MIN = 4;
var EXTRA_LOD_SIGMA = [0.125, 0.215, 0.35, 0.446, 0.526, 0.582];
var MAX_SAMPLES = 20;
var _flatCamera = /* @__PURE__ */ new OrthographicCamera();
var _clearColor = /* @__PURE__ */ new Color2();
var _oldTarget = null;
var PHI = (1 + Math.sqrt(5)) / 2;
var INV_PHI = 1 / PHI;
var _axisDirections = [
  /* @__PURE__ */ new Vector3(1, 1, 1),
  /* @__PURE__ */ new Vector3(-1, 1, 1),
  /* @__PURE__ */ new Vector3(1, 1, -1),
  /* @__PURE__ */ new Vector3(-1, 1, -1),
  /* @__PURE__ */ new Vector3(0, PHI, INV_PHI),
  /* @__PURE__ */ new Vector3(0, PHI, -INV_PHI),
  /* @__PURE__ */ new Vector3(INV_PHI, 0, PHI),
  /* @__PURE__ */ new Vector3(-INV_PHI, 0, PHI),
  /* @__PURE__ */ new Vector3(PHI, INV_PHI, 0),
  /* @__PURE__ */ new Vector3(-PHI, INV_PHI, 0)
];
var PMREMGenerator = class {
  constructor(renderer) {
    this._renderer = renderer;
    this._pingPongRenderTarget = null;
    this._lodMax = 0;
    this._cubeSize = 0;
    this._lodPlanes = [];
    this._sizeLods = [];
    this._sigmas = [];
    this._blurMaterial = null;
    this._cubemapMaterial = null;
    this._equirectMaterial = null;
    this._compileMaterial(this._blurMaterial);
  }
  /**
   * Generates a PMREM from a supplied Scene, which can be faster than using an
   * image if networking bandwidth is low. Optional sigma specifies a blur radius
   * in radians to be applied to the scene before PMREM generation. Optional near
   * and far planes ensure the scene is rendered in its entirety (the cubeCamera
   * is placed at the origin).
   */
  fromScene(scene, sigma = 0, near = 0.1, far = 100) {
    _oldTarget = this._renderer.getRenderTarget();
    this._setSize(256);
    const cubeUVRenderTarget = this._allocateTargets();
    cubeUVRenderTarget.depthBuffer = true;
    this._sceneToCubeUV(scene, near, far, cubeUVRenderTarget);
    if (sigma > 0) {
      this._blur(cubeUVRenderTarget, 0, 0, sigma);
    }
    this._applyPMREM(cubeUVRenderTarget);
    this._cleanup(cubeUVRenderTarget);
    return cubeUVRenderTarget;
  }
  /**
   * Generates a PMREM from an equirectangular texture, which can be either LDR
   * or HDR. The ideal input image size is 1k (1024 x 512),
   * as this matches best with the 256 x 256 cubemap output.
   */
  fromEquirectangular(equirectangular, renderTarget = null) {
    return this._fromTexture(equirectangular, renderTarget);
  }
  /**
   * Generates a PMREM from an cubemap texture, which can be either LDR
   * or HDR. The ideal input cube size is 256 x 256,
   * as this matches best with the 256 x 256 cubemap output.
   */
  fromCubemap(cubemap, renderTarget = null) {
    return this._fromTexture(cubemap, renderTarget);
  }
  /**
   * Pre-compiles the cubemap shader. You can get faster start-up by invoking this method during
   * your texture's network fetch for increased concurrency.
   */
  compileCubemapShader() {
    if (this._cubemapMaterial === null) {
      this._cubemapMaterial = _getCubemapMaterial();
      this._compileMaterial(this._cubemapMaterial);
    }
  }
  /**
   * Pre-compiles the equirectangular shader. You can get faster start-up by invoking this method during
   * your texture's network fetch for increased concurrency.
   */
  compileEquirectangularShader() {
    if (this._equirectMaterial === null) {
      this._equirectMaterial = _getEquirectMaterial();
      this._compileMaterial(this._equirectMaterial);
    }
  }
  /**
   * Disposes of the PMREMGenerator's internal memory. Note that PMREMGenerator is a static class,
   * so you should not need more than one PMREMGenerator object. If you do, calling dispose() on
   * one of them will cause any others to also become unusable.
   */
  dispose() {
    this._dispose();
    if (this._cubemapMaterial !== null)
      this._cubemapMaterial.dispose();
    if (this._equirectMaterial !== null)
      this._equirectMaterial.dispose();
  }
  // private interface
  _setSize(cubeSize) {
    this._lodMax = Math.floor(Math.log2(cubeSize));
    this._cubeSize = Math.pow(2, this._lodMax);
  }
  _dispose() {
    if (this._blurMaterial !== null)
      this._blurMaterial.dispose();
    if (this._pingPongRenderTarget !== null)
      this._pingPongRenderTarget.dispose();
    for (let i2 = 0; i2 < this._lodPlanes.length; i2++) {
      this._lodPlanes[i2].dispose();
    }
  }
  _cleanup(outputTarget) {
    this._renderer.setRenderTarget(_oldTarget);
    outputTarget.scissorTest = false;
    _setViewport(outputTarget, 0, 0, outputTarget.width, outputTarget.height);
  }
  _fromTexture(texture, renderTarget) {
    if (texture.mapping === CubeReflectionMapping || texture.mapping === CubeRefractionMapping) {
      this._setSize(texture.image.length === 0 ? 16 : texture.image[0].width || texture.image[0].image.width);
    } else {
      this._setSize(texture.image.width / 4);
    }
    _oldTarget = this._renderer.getRenderTarget();
    const cubeUVRenderTarget = renderTarget || this._allocateTargets();
    this._textureToCubeUV(texture, cubeUVRenderTarget);
    this._applyPMREM(cubeUVRenderTarget);
    this._cleanup(cubeUVRenderTarget);
    return cubeUVRenderTarget;
  }
  _allocateTargets() {
    const width = 3 * Math.max(this._cubeSize, 16 * 7);
    const height = 4 * this._cubeSize - 32;
    const params = {
      magFilter: LinearFilter,
      minFilter: LinearFilter,
      generateMipmaps: false,
      type: HalfFloatType,
      format: RGBAFormat,
      encoding: LinearEncoding,
      depthBuffer: false
    };
    const cubeUVRenderTarget = _createRenderTarget(width, height, params);
    if (this._pingPongRenderTarget === null || this._pingPongRenderTarget.width !== width) {
      if (this._pingPongRenderTarget !== null) {
        this._dispose();
      }
      this._pingPongRenderTarget = _createRenderTarget(width, height, params);
      const { _lodMax } = this;
      ({ sizeLods: this._sizeLods, lodPlanes: this._lodPlanes, sigmas: this._sigmas } = _createPlanes(_lodMax));
      this._blurMaterial = _getBlurShader(_lodMax, width, height);
    }
    return cubeUVRenderTarget;
  }
  _compileMaterial(material) {
    const tmpMesh = new Mesh(this._lodPlanes[0], material);
    this._renderer.compile(tmpMesh, _flatCamera);
  }
  _sceneToCubeUV(scene, near, far, cubeUVRenderTarget) {
    const fov2 = 90;
    const aspect2 = 1;
    const cubeCamera = new PerspectiveCamera(fov2, aspect2, near, far);
    const upSign = [1, -1, 1, 1, 1, 1];
    const forwardSign = [1, 1, 1, -1, -1, -1];
    const renderer = this._renderer;
    const originalAutoClear = renderer.autoClear;
    const toneMapping = renderer.toneMapping;
    renderer.getClearColor(_clearColor);
    renderer.toneMapping = NoToneMapping;
    renderer.autoClear = false;
    const backgroundMaterial = new MeshBasicMaterial({
      name: "PMREM.Background",
      side: BackSide,
      depthWrite: false,
      depthTest: false
    });
    const backgroundBox = new Mesh(new BoxGeometry(), backgroundMaterial);
    let useSolidColor = false;
    const background2 = scene.background;
    if (background2) {
      if (background2.isColor) {
        backgroundMaterial.color.copy(background2);
        scene.background = null;
        useSolidColor = true;
      }
    } else {
      backgroundMaterial.color.copy(_clearColor);
      useSolidColor = true;
    }
    for (let i2 = 0; i2 < 6; i2++) {
      const col = i2 % 3;
      if (col === 0) {
        cubeCamera.up.set(0, upSign[i2], 0);
        cubeCamera.lookAt(forwardSign[i2], 0, 0);
      } else if (col === 1) {
        cubeCamera.up.set(0, 0, upSign[i2]);
        cubeCamera.lookAt(0, forwardSign[i2], 0);
      } else {
        cubeCamera.up.set(0, upSign[i2], 0);
        cubeCamera.lookAt(0, 0, forwardSign[i2]);
      }
      const size = this._cubeSize;
      _setViewport(cubeUVRenderTarget, col * size, i2 > 2 ? size : 0, size, size);
      renderer.setRenderTarget(cubeUVRenderTarget);
      if (useSolidColor) {
        renderer.render(backgroundBox, cubeCamera);
      }
      renderer.render(scene, cubeCamera);
    }
    backgroundBox.geometry.dispose();
    backgroundBox.material.dispose();
    renderer.toneMapping = toneMapping;
    renderer.autoClear = originalAutoClear;
    scene.background = background2;
  }
  _textureToCubeUV(texture, cubeUVRenderTarget) {
    const renderer = this._renderer;
    const isCubeTexture = texture.mapping === CubeReflectionMapping || texture.mapping === CubeRefractionMapping;
    if (isCubeTexture) {
      if (this._cubemapMaterial === null) {
        this._cubemapMaterial = _getCubemapMaterial();
      }
      this._cubemapMaterial.uniforms.flipEnvMap.value = texture.isRenderTargetTexture === false ? -1 : 1;
    } else {
      if (this._equirectMaterial === null) {
        this._equirectMaterial = _getEquirectMaterial();
      }
    }
    const material = isCubeTexture ? this._cubemapMaterial : this._equirectMaterial;
    const mesh = new Mesh(this._lodPlanes[0], material);
    const uniforms = material.uniforms;
    uniforms["envMap"].value = texture;
    const size = this._cubeSize;
    _setViewport(cubeUVRenderTarget, 0, 0, 3 * size, 2 * size);
    renderer.setRenderTarget(cubeUVRenderTarget);
    renderer.render(mesh, _flatCamera);
  }
  _applyPMREM(cubeUVRenderTarget) {
    const renderer = this._renderer;
    const autoClear = renderer.autoClear;
    renderer.autoClear = false;
    for (let i2 = 1; i2 < this._lodPlanes.length; i2++) {
      const sigma = Math.sqrt(this._sigmas[i2] * this._sigmas[i2] - this._sigmas[i2 - 1] * this._sigmas[i2 - 1]);
      const poleAxis = _axisDirections[(i2 - 1) % _axisDirections.length];
      this._blur(cubeUVRenderTarget, i2 - 1, i2, sigma, poleAxis);
    }
    renderer.autoClear = autoClear;
  }
  /**
   * This is a two-pass Gaussian blur for a cubemap. Normally this is done
   * vertically and horizontally, but this breaks down on a cube. Here we apply
   * the blur latitudinally (around the poles), and then longitudinally (towards
   * the poles) to approximate the orthogonally-separable blur. It is least
   * accurate at the poles, but still does a decent job.
   */
  _blur(cubeUVRenderTarget, lodIn, lodOut, sigma, poleAxis) {
    const pingPongRenderTarget = this._pingPongRenderTarget;
    this._halfBlur(
      cubeUVRenderTarget,
      pingPongRenderTarget,
      lodIn,
      lodOut,
      sigma,
      "latitudinal",
      poleAxis
    );
    this._halfBlur(
      pingPongRenderTarget,
      cubeUVRenderTarget,
      lodOut,
      lodOut,
      sigma,
      "longitudinal",
      poleAxis
    );
  }
  _halfBlur(targetIn, targetOut, lodIn, lodOut, sigmaRadians, direction, poleAxis) {
    const renderer = this._renderer;
    const blurMaterial = this._blurMaterial;
    if (direction !== "latitudinal" && direction !== "longitudinal") {
      console.error(
        "blur direction must be either latitudinal or longitudinal!"
      );
    }
    const STANDARD_DEVIATIONS = 3;
    const blurMesh = new Mesh(this._lodPlanes[lodOut], blurMaterial);
    const blurUniforms = blurMaterial.uniforms;
    const pixels = this._sizeLods[lodIn] - 1;
    const radiansPerPixel = isFinite(sigmaRadians) ? Math.PI / (2 * pixels) : 2 * Math.PI / (2 * MAX_SAMPLES - 1);
    const sigmaPixels = sigmaRadians / radiansPerPixel;
    const samples = isFinite(sigmaRadians) ? 1 + Math.floor(STANDARD_DEVIATIONS * sigmaPixels) : MAX_SAMPLES;
    if (samples > MAX_SAMPLES) {
      console.warn(`sigmaRadians, ${sigmaRadians}, is too large and will clip, as it requested ${samples} samples when the maximum is set to ${MAX_SAMPLES}`);
    }
    const weights2 = [];
    let sum2 = 0;
    for (let i2 = 0; i2 < MAX_SAMPLES; ++i2) {
      const x3 = i2 / sigmaPixels;
      const weight = Math.exp(-x3 * x3 / 2);
      weights2.push(weight);
      if (i2 === 0) {
        sum2 += weight;
      } else if (i2 < samples) {
        sum2 += 2 * weight;
      }
    }
    for (let i2 = 0; i2 < weights2.length; i2++) {
      weights2[i2] = weights2[i2] / sum2;
    }
    blurUniforms["envMap"].value = targetIn.texture;
    blurUniforms["samples"].value = samples;
    blurUniforms["weights"].value = weights2;
    blurUniforms["latitudinal"].value = direction === "latitudinal";
    if (poleAxis) {
      blurUniforms["poleAxis"].value = poleAxis;
    }
    const { _lodMax } = this;
    blurUniforms["dTheta"].value = radiansPerPixel;
    blurUniforms["mipInt"].value = _lodMax - lodIn;
    const outputSize = this._sizeLods[lodOut];
    const x2 = 3 * outputSize * (lodOut > _lodMax - LOD_MIN ? lodOut - _lodMax + LOD_MIN : 0);
    const y2 = 4 * (this._cubeSize - outputSize);
    _setViewport(targetOut, x2, y2, 3 * outputSize, 2 * outputSize);
    renderer.setRenderTarget(targetOut);
    renderer.render(blurMesh, _flatCamera);
  }
};
function _createPlanes(lodMax) {
  const lodPlanes = [];
  const sizeLods = [];
  const sigmas = [];
  let lod = lodMax;
  const totalLods = lodMax - LOD_MIN + 1 + EXTRA_LOD_SIGMA.length;
  for (let i2 = 0; i2 < totalLods; i2++) {
    const sizeLod = Math.pow(2, lod);
    sizeLods.push(sizeLod);
    let sigma = 1 / sizeLod;
    if (i2 > lodMax - LOD_MIN) {
      sigma = EXTRA_LOD_SIGMA[i2 - lodMax + LOD_MIN - 1];
    } else if (i2 === 0) {
      sigma = 0;
    }
    sigmas.push(sigma);
    const texelSize = 1 / (sizeLod - 1);
    const min3 = -texelSize / 2;
    const max3 = 1 + texelSize / 2;
    const uv1 = [min3, min3, max3, min3, max3, max3, min3, min3, max3, max3, min3, max3];
    const cubeFaces = 6;
    const vertices = 6;
    const positionSize = 3;
    const uvSize = 2;
    const faceIndexSize = 1;
    const position2 = new Float32Array(positionSize * vertices * cubeFaces);
    const uv = new Float32Array(uvSize * vertices * cubeFaces);
    const faceIndex = new Float32Array(faceIndexSize * vertices * cubeFaces);
    for (let face = 0; face < cubeFaces; face++) {
      const x2 = face % 3 * 2 / 3 - 1;
      const y2 = face > 2 ? 0 : -1;
      const coordinates = [
        x2,
        y2,
        0,
        x2 + 2 / 3,
        y2,
        0,
        x2 + 2 / 3,
        y2 + 1,
        0,
        x2,
        y2,
        0,
        x2 + 2 / 3,
        y2 + 1,
        0,
        x2,
        y2 + 1,
        0
      ];
      position2.set(coordinates, positionSize * vertices * face);
      uv.set(uv1, uvSize * vertices * face);
      const fill = [face, face, face, face, face, face];
      faceIndex.set(fill, faceIndexSize * vertices * face);
    }
    const planes = new BufferGeometry();
    planes.setAttribute("position", new BufferAttribute(position2, positionSize));
    planes.setAttribute("uv", new BufferAttribute(uv, uvSize));
    planes.setAttribute("faceIndex", new BufferAttribute(faceIndex, faceIndexSize));
    lodPlanes.push(planes);
    if (lod > LOD_MIN) {
      lod--;
    }
  }
  return { lodPlanes, sizeLods, sigmas };
}
function _createRenderTarget(width, height, params) {
  const cubeUVRenderTarget = new WebGLRenderTarget(width, height, params);
  cubeUVRenderTarget.texture.mapping = CubeUVReflectionMapping;
  cubeUVRenderTarget.texture.name = "PMREM.cubeUv";
  cubeUVRenderTarget.scissorTest = true;
  return cubeUVRenderTarget;
}
function _setViewport(target, x2, y2, width, height) {
  target.viewport.set(x2, y2, width, height);
  target.scissor.set(x2, y2, width, height);
}
function _getBlurShader(lodMax, width, height) {
  const weights2 = new Float32Array(MAX_SAMPLES);
  const poleAxis = new Vector3(0, 1, 0);
  const shaderMaterial = new ShaderMaterial({
    name: "SphericalGaussianBlur",
    defines: {
      "n": MAX_SAMPLES,
      "CUBEUV_TEXEL_WIDTH": 1 / width,
      "CUBEUV_TEXEL_HEIGHT": 1 / height,
      "CUBEUV_MAX_MIP": `${lodMax}.0`
    },
    uniforms: {
      "envMap": { value: null },
      "samples": { value: 1 },
      "weights": { value: weights2 },
      "latitudinal": { value: false },
      "dTheta": { value: 0 },
      "mipInt": { value: 0 },
      "poleAxis": { value: poleAxis }
    },
    vertexShader: _getCommonVertexShader(),
    fragmentShader: (
      /* glsl */
      `

			precision mediump float;
			precision mediump int;

			varying vec3 vOutputDirection;

			uniform sampler2D envMap;
			uniform int samples;
			uniform float weights[ n ];
			uniform bool latitudinal;
			uniform float dTheta;
			uniform float mipInt;
			uniform vec3 poleAxis;

			#define ENVMAP_TYPE_CUBE_UV
			#include <cube_uv_reflection_fragment>

			vec3 getSample( float theta, vec3 axis ) {

				float cosTheta = cos( theta );
				// Rodrigues' axis-angle rotation
				vec3 sampleDirection = vOutputDirection * cosTheta
					+ cross( axis, vOutputDirection ) * sin( theta )
					+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );

				return bilinearCubeUV( envMap, sampleDirection, mipInt );

			}

			void main() {

				vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );

				if ( all( equal( axis, vec3( 0.0 ) ) ) ) {

					axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );

				}

				axis = normalize( axis );

				gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );
				gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );

				for ( int i = 1; i < n; i++ ) {

					if ( i >= samples ) {

						break;

					}

					float theta = dTheta * float( i );
					gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );
					gl_FragColor.rgb += weights[ i ] * getSample( theta, axis );

				}

			}
		`
    ),
    blending: NoBlending,
    depthTest: false,
    depthWrite: false
  });
  return shaderMaterial;
}
function _getEquirectMaterial() {
  return new ShaderMaterial({
    name: "EquirectangularToCubeUV",
    uniforms: {
      "envMap": { value: null }
    },
    vertexShader: _getCommonVertexShader(),
    fragmentShader: (
      /* glsl */
      `

			precision mediump float;
			precision mediump int;

			varying vec3 vOutputDirection;

			uniform sampler2D envMap;

			#include <common>

			void main() {

				vec3 outputDirection = normalize( vOutputDirection );
				vec2 uv = equirectUv( outputDirection );

				gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );

			}
		`
    ),
    blending: NoBlending,
    depthTest: false,
    depthWrite: false
  });
}
function _getCubemapMaterial() {
  return new ShaderMaterial({
    name: "CubemapToCubeUV",
    uniforms: {
      "envMap": { value: null },
      "flipEnvMap": { value: -1 }
    },
    vertexShader: _getCommonVertexShader(),
    fragmentShader: (
      /* glsl */
      `

			precision mediump float;
			precision mediump int;

			uniform float flipEnvMap;

			varying vec3 vOutputDirection;

			uniform samplerCube envMap;

			void main() {

				gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );

			}
		`
    ),
    blending: NoBlending,
    depthTest: false,
    depthWrite: false
  });
}
function _getCommonVertexShader() {
  return (
    /* glsl */
    `

		precision mediump float;
		precision mediump int;

		attribute float faceIndex;

		varying vec3 vOutputDirection;

		// RH coordinate system; PMREM face-indexing convention
		vec3 getDirection( vec2 uv, float face ) {

			uv = 2.0 * uv - 1.0;

			vec3 direction = vec3( uv, 1.0 );

			if ( face == 0.0 ) {

				direction = direction.zyx; // ( 1, v, u ) pos x

			} else if ( face == 1.0 ) {

				direction = direction.xzy;
				direction.xz *= -1.0; // ( -u, 1, -v ) pos y

			} else if ( face == 2.0 ) {

				direction.x *= -1.0; // ( -u, v, 1 ) pos z

			} else if ( face == 3.0 ) {

				direction = direction.zyx;
				direction.xz *= -1.0; // ( -1, v, -u ) neg x

			} else if ( face == 4.0 ) {

				direction = direction.xzy;
				direction.xy *= -1.0; // ( -u, -1, v ) neg y

			} else if ( face == 5.0 ) {

				direction.z *= -1.0; // ( u, v, -1 ) neg z

			}

			return direction;

		}

		void main() {

			vOutputDirection = getDirection( uv, faceIndex );
			gl_Position = vec4( position, 1.0 );

		}
	`
  );
}
function WebGLCubeUVMaps(renderer) {
  let cubeUVmaps = /* @__PURE__ */ new WeakMap();
  let pmremGenerator = null;
  function get3(texture) {
    if (texture && texture.isTexture) {
      const mapping = texture.mapping;
      const isEquirectMap = mapping === EquirectangularReflectionMapping || mapping === EquirectangularRefractionMapping;
      const isCubeMap = mapping === CubeReflectionMapping || mapping === CubeRefractionMapping;
      if (isEquirectMap || isCubeMap) {
        if (texture.isRenderTargetTexture && texture.needsPMREMUpdate === true) {
          texture.needsPMREMUpdate = false;
          let renderTarget = cubeUVmaps.get(texture);
          if (pmremGenerator === null)
            pmremGenerator = new PMREMGenerator(renderer);
          renderTarget = isEquirectMap ? pmremGenerator.fromEquirectangular(texture, renderTarget) : pmremGenerator.fromCubemap(texture, renderTarget);
          cubeUVmaps.set(texture, renderTarget);
          return renderTarget.texture;
        } else {
          if (cubeUVmaps.has(texture)) {
            return cubeUVmaps.get(texture).texture;
          } else {
            const image = texture.image;
            if (isEquirectMap && image && image.height > 0 || isCubeMap && image && isCubeTextureComplete(image)) {
              if (pmremGenerator === null)
                pmremGenerator = new PMREMGenerator(renderer);
              const renderTarget = isEquirectMap ? pmremGenerator.fromEquirectangular(texture) : pmremGenerator.fromCubemap(texture);
              cubeUVmaps.set(texture, renderTarget);
              texture.addEventListener("dispose", onTextureDispose);
              return renderTarget.texture;
            } else {
              return null;
            }
          }
        }
      }
    }
    return texture;
  }
  function isCubeTextureComplete(image) {
    let count2 = 0;
    const length2 = 6;
    for (let i2 = 0; i2 < length2; i2++) {
      if (image[i2] !== void 0)
        count2++;
    }
    return count2 === length2;
  }
  function onTextureDispose(event) {
    const texture = event.target;
    texture.removeEventListener("dispose", onTextureDispose);
    const cubemapUV = cubeUVmaps.get(texture);
    if (cubemapUV !== void 0) {
      cubeUVmaps.delete(texture);
      cubemapUV.dispose();
    }
  }
  function dispose2() {
    cubeUVmaps = /* @__PURE__ */ new WeakMap();
    if (pmremGenerator !== null) {
      pmremGenerator.dispose();
      pmremGenerator = null;
    }
  }
  return {
    get: get3,
    dispose: dispose2
  };
}
function WebGLExtensions(gl) {
  const extensions2 = {};
  function getExtension(name2) {
    if (extensions2[name2] !== void 0) {
      return extensions2[name2];
    }
    let extension;
    switch (name2) {
      case "WEBGL_depth_texture":
        extension = gl.getExtension("WEBGL_depth_texture") || gl.getExtension("MOZ_WEBGL_depth_texture") || gl.getExtension("WEBKIT_WEBGL_depth_texture");
        break;
      case "EXT_texture_filter_anisotropic":
        extension = gl.getExtension("EXT_texture_filter_anisotropic") || gl.getExtension("MOZ_EXT_texture_filter_anisotropic") || gl.getExtension("WEBKIT_EXT_texture_filter_anisotropic");
        break;
      case "WEBGL_compressed_texture_s3tc":
        extension = gl.getExtension("WEBGL_compressed_texture_s3tc") || gl.getExtension("MOZ_WEBGL_compressed_texture_s3tc") || gl.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");
        break;
      case "WEBGL_compressed_texture_pvrtc":
        extension = gl.getExtension("WEBGL_compressed_texture_pvrtc") || gl.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");
        break;
      default:
        extension = gl.getExtension(name2);
    }
    extensions2[name2] = extension;
    return extension;
  }
  return {
    has: function(name2) {
      return getExtension(name2) !== null;
    },
    init: function(capabilities) {
      if (capabilities.isWebGL2) {
        getExtension("EXT_color_buffer_float");
      } else {
        getExtension("WEBGL_depth_texture");
        getExtension("OES_texture_float");
        getExtension("OES_texture_half_float");
        getExtension("OES_texture_half_float_linear");
        getExtension("OES_standard_derivatives");
        getExtension("OES_element_index_uint");
        getExtension("OES_vertex_array_object");
        getExtension("ANGLE_instanced_arrays");
      }
      getExtension("OES_texture_float_linear");
      getExtension("EXT_color_buffer_half_float");
      getExtension("WEBGL_multisampled_render_to_texture");
    },
    get: function(name2) {
      const extension = getExtension(name2);
      if (extension === null) {
        console.warn("THREE.WebGLRenderer: " + name2 + " extension not supported.");
      }
      return extension;
    }
  };
}
function WebGLGeometries(gl, attributes, info, bindingStates) {
  const geometries = {};
  const wireframeAttributes = /* @__PURE__ */ new WeakMap();
  function onGeometryDispose(event) {
    const geometry = event.target;
    if (geometry.index !== null) {
      attributes.remove(geometry.index);
    }
    for (const name2 in geometry.attributes) {
      attributes.remove(geometry.attributes[name2]);
    }
    geometry.removeEventListener("dispose", onGeometryDispose);
    delete geometries[geometry.id];
    const attribute = wireframeAttributes.get(geometry);
    if (attribute) {
      attributes.remove(attribute);
      wireframeAttributes.delete(geometry);
    }
    bindingStates.releaseStatesOfGeometry(geometry);
    if (geometry.isInstancedBufferGeometry === true) {
      delete geometry._maxInstanceCount;
    }
    info.memory.geometries--;
  }
  function get3(object, geometry) {
    if (geometries[geometry.id] === true)
      return geometry;
    geometry.addEventListener("dispose", onGeometryDispose);
    geometries[geometry.id] = true;
    info.memory.geometries++;
    return geometry;
  }
  function update(geometry) {
    const geometryAttributes = geometry.attributes;
    for (const name2 in geometryAttributes) {
      attributes.update(geometryAttributes[name2], 34962);
    }
    const morphAttributes = geometry.morphAttributes;
    for (const name2 in morphAttributes) {
      const array = morphAttributes[name2];
      for (let i2 = 0, l = array.length; i2 < l; i2++) {
        attributes.update(array[i2], 34962);
      }
    }
  }
  function updateWireframeAttribute(geometry) {
    const indices = [];
    const geometryIndex = geometry.index;
    const geometryPosition = geometry.attributes.position;
    let version = 0;
    if (geometryIndex !== null) {
      const array = geometryIndex.array;
      version = geometryIndex.version;
      for (let i2 = 0, l = array.length; i2 < l; i2 += 3) {
        const a2 = array[i2 + 0];
        const b = array[i2 + 1];
        const c4 = array[i2 + 2];
        indices.push(a2, b, b, c4, c4, a2);
      }
    } else {
      const array = geometryPosition.array;
      version = geometryPosition.version;
      for (let i2 = 0, l = array.length / 3 - 1; i2 < l; i2 += 3) {
        const a2 = i2 + 0;
        const b = i2 + 1;
        const c4 = i2 + 2;
        indices.push(a2, b, b, c4, c4, a2);
      }
    }
    const attribute = new (arrayNeedsUint32(indices) ? Uint32BufferAttribute : Uint16BufferAttribute)(indices, 1);
    attribute.version = version;
    const previousAttribute = wireframeAttributes.get(geometry);
    if (previousAttribute)
      attributes.remove(previousAttribute);
    wireframeAttributes.set(geometry, attribute);
  }
  function getWireframeAttribute(geometry) {
    const currentAttribute = wireframeAttributes.get(geometry);
    if (currentAttribute) {
      const geometryIndex = geometry.index;
      if (geometryIndex !== null) {
        if (currentAttribute.version < geometryIndex.version) {
          updateWireframeAttribute(geometry);
        }
      }
    } else {
      updateWireframeAttribute(geometry);
    }
    return wireframeAttributes.get(geometry);
  }
  return {
    get: get3,
    update,
    getWireframeAttribute
  };
}
function WebGLIndexedBufferRenderer(gl, extensions2, info, capabilities) {
  const isWebGL2 = capabilities.isWebGL2;
  let mode;
  function setMode(value) {
    mode = value;
  }
  let type, bytesPerElement;
  function setIndex(value) {
    type = value.type;
    bytesPerElement = value.bytesPerElement;
  }
  function render2(start, count2) {
    gl.drawElements(mode, count2, type, start * bytesPerElement);
    info.update(count2, mode, 1);
  }
  function renderInstances(start, count2, primcount) {
    if (primcount === 0)
      return;
    let extension, methodName;
    if (isWebGL2) {
      extension = gl;
      methodName = "drawElementsInstanced";
    } else {
      extension = extensions2.get("ANGLE_instanced_arrays");
      methodName = "drawElementsInstancedANGLE";
      if (extension === null) {
        console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
        return;
      }
    }
    extension[methodName](mode, count2, type, start * bytesPerElement, primcount);
    info.update(count2, mode, primcount);
  }
  this.setMode = setMode;
  this.setIndex = setIndex;
  this.render = render2;
  this.renderInstances = renderInstances;
}
function WebGLInfo(gl) {
  const memory = {
    geometries: 0,
    textures: 0
  };
  const render2 = {
    frame: 0,
    calls: 0,
    triangles: 0,
    points: 0,
    lines: 0
  };
  function update(count2, mode, instanceCount) {
    render2.calls++;
    switch (mode) {
      case 4:
        render2.triangles += instanceCount * (count2 / 3);
        break;
      case 1:
        render2.lines += instanceCount * (count2 / 2);
        break;
      case 3:
        render2.lines += instanceCount * (count2 - 1);
        break;
      case 2:
        render2.lines += instanceCount * count2;
        break;
      case 0:
        render2.points += instanceCount * count2;
        break;
      default:
        console.error("THREE.WebGLInfo: Unknown draw mode:", mode);
        break;
    }
  }
  function reset() {
    render2.frame++;
    render2.calls = 0;
    render2.triangles = 0;
    render2.points = 0;
    render2.lines = 0;
  }
  return {
    memory,
    render: render2,
    programs: null,
    autoReset: true,
    reset,
    update
  };
}
function numericalSort(a2, b) {
  return a2[0] - b[0];
}
function absNumericalSort(a2, b) {
  return Math.abs(b[1]) - Math.abs(a2[1]);
}
function denormalize(morph, attribute) {
  let denominator = 1;
  const array = attribute.isInterleavedBufferAttribute ? attribute.data.array : attribute.array;
  if (array instanceof Int8Array)
    denominator = 127;
  else if (array instanceof Int16Array)
    denominator = 32767;
  else if (array instanceof Int32Array)
    denominator = 2147483647;
  else
    console.error("THREE.WebGLMorphtargets: Unsupported morph attribute data type: ", array);
  morph.divideScalar(denominator);
}
function WebGLMorphtargets(gl, capabilities, textures) {
  const influencesList = {};
  const morphInfluences = new Float32Array(8);
  const morphTextures = /* @__PURE__ */ new WeakMap();
  const morph = new Vector4();
  const workInfluences = [];
  for (let i2 = 0; i2 < 8; i2++) {
    workInfluences[i2] = [i2, 0];
  }
  function update(object, geometry, material, program) {
    const objectInfluences = object.morphTargetInfluences;
    if (capabilities.isWebGL2 === true) {
      const morphAttribute = geometry.morphAttributes.position || geometry.morphAttributes.normal || geometry.morphAttributes.color;
      const morphTargetsCount = morphAttribute !== void 0 ? morphAttribute.length : 0;
      let entry = morphTextures.get(geometry);
      if (entry === void 0 || entry.count !== morphTargetsCount) {
        let disposeTexture = function() {
          texture.dispose();
          morphTextures.delete(geometry);
          geometry.removeEventListener("dispose", disposeTexture);
        };
        if (entry !== void 0)
          entry.texture.dispose();
        const hasMorphPosition = geometry.morphAttributes.position !== void 0;
        const hasMorphNormals = geometry.morphAttributes.normal !== void 0;
        const hasMorphColors = geometry.morphAttributes.color !== void 0;
        const morphTargets = geometry.morphAttributes.position || [];
        const morphNormals = geometry.morphAttributes.normal || [];
        const morphColors = geometry.morphAttributes.color || [];
        let vertexDataCount = 0;
        if (hasMorphPosition === true)
          vertexDataCount = 1;
        if (hasMorphNormals === true)
          vertexDataCount = 2;
        if (hasMorphColors === true)
          vertexDataCount = 3;
        let width = geometry.attributes.position.count * vertexDataCount;
        let height = 1;
        if (width > capabilities.maxTextureSize) {
          height = Math.ceil(width / capabilities.maxTextureSize);
          width = capabilities.maxTextureSize;
        }
        const buffer = new Float32Array(width * height * 4 * morphTargetsCount);
        const texture = new DataArrayTexture(buffer, width, height, morphTargetsCount);
        texture.type = FloatType;
        texture.needsUpdate = true;
        const vertexDataStride = vertexDataCount * 4;
        for (let i2 = 0; i2 < morphTargetsCount; i2++) {
          const morphTarget = morphTargets[i2];
          const morphNormal = morphNormals[i2];
          const morphColor = morphColors[i2];
          const offset = width * height * 4 * i2;
          for (let j = 0; j < morphTarget.count; j++) {
            const stride = j * vertexDataStride;
            if (hasMorphPosition === true) {
              morph.fromBufferAttribute(morphTarget, j);
              if (morphTarget.normalized === true)
                denormalize(morph, morphTarget);
              buffer[offset + stride + 0] = morph.x;
              buffer[offset + stride + 1] = morph.y;
              buffer[offset + stride + 2] = morph.z;
              buffer[offset + stride + 3] = 0;
            }
            if (hasMorphNormals === true) {
              morph.fromBufferAttribute(morphNormal, j);
              if (morphNormal.normalized === true)
                denormalize(morph, morphNormal);
              buffer[offset + stride + 4] = morph.x;
              buffer[offset + stride + 5] = morph.y;
              buffer[offset + stride + 6] = morph.z;
              buffer[offset + stride + 7] = 0;
            }
            if (hasMorphColors === true) {
              morph.fromBufferAttribute(morphColor, j);
              if (morphColor.normalized === true)
                denormalize(morph, morphColor);
              buffer[offset + stride + 8] = morph.x;
              buffer[offset + stride + 9] = morph.y;
              buffer[offset + stride + 10] = morph.z;
              buffer[offset + stride + 11] = morphColor.itemSize === 4 ? morph.w : 1;
            }
          }
        }
        entry = {
          count: morphTargetsCount,
          texture,
          size: new Vector2(width, height)
        };
        morphTextures.set(geometry, entry);
        geometry.addEventListener("dispose", disposeTexture);
      }
      let morphInfluencesSum = 0;
      for (let i2 = 0; i2 < objectInfluences.length; i2++) {
        morphInfluencesSum += objectInfluences[i2];
      }
      const morphBaseInfluence = geometry.morphTargetsRelative ? 1 : 1 - morphInfluencesSum;
      program.getUniforms().setValue(gl, "morphTargetBaseInfluence", morphBaseInfluence);
      program.getUniforms().setValue(gl, "morphTargetInfluences", objectInfluences);
      program.getUniforms().setValue(gl, "morphTargetsTexture", entry.texture, textures);
      program.getUniforms().setValue(gl, "morphTargetsTextureSize", entry.size);
    } else {
      const length2 = objectInfluences === void 0 ? 0 : objectInfluences.length;
      let influences = influencesList[geometry.id];
      if (influences === void 0 || influences.length !== length2) {
        influences = [];
        for (let i2 = 0; i2 < length2; i2++) {
          influences[i2] = [i2, 0];
        }
        influencesList[geometry.id] = influences;
      }
      for (let i2 = 0; i2 < length2; i2++) {
        const influence = influences[i2];
        influence[0] = i2;
        influence[1] = objectInfluences[i2];
      }
      influences.sort(absNumericalSort);
      for (let i2 = 0; i2 < 8; i2++) {
        if (i2 < length2 && influences[i2][1]) {
          workInfluences[i2][0] = influences[i2][0];
          workInfluences[i2][1] = influences[i2][1];
        } else {
          workInfluences[i2][0] = Number.MAX_SAFE_INTEGER;
          workInfluences[i2][1] = 0;
        }
      }
      workInfluences.sort(numericalSort);
      const morphTargets = geometry.morphAttributes.position;
      const morphNormals = geometry.morphAttributes.normal;
      let morphInfluencesSum = 0;
      for (let i2 = 0; i2 < 8; i2++) {
        const influence = workInfluences[i2];
        const index = influence[0];
        const value = influence[1];
        if (index !== Number.MAX_SAFE_INTEGER && value) {
          if (morphTargets && geometry.getAttribute("morphTarget" + i2) !== morphTargets[index]) {
            geometry.setAttribute("morphTarget" + i2, morphTargets[index]);
          }
          if (morphNormals && geometry.getAttribute("morphNormal" + i2) !== morphNormals[index]) {
            geometry.setAttribute("morphNormal" + i2, morphNormals[index]);
          }
          morphInfluences[i2] = value;
          morphInfluencesSum += value;
        } else {
          if (morphTargets && geometry.hasAttribute("morphTarget" + i2) === true) {
            geometry.deleteAttribute("morphTarget" + i2);
          }
          if (morphNormals && geometry.hasAttribute("morphNormal" + i2) === true) {
            geometry.deleteAttribute("morphNormal" + i2);
          }
          morphInfluences[i2] = 0;
        }
      }
      const morphBaseInfluence = geometry.morphTargetsRelative ? 1 : 1 - morphInfluencesSum;
      program.getUniforms().setValue(gl, "morphTargetBaseInfluence", morphBaseInfluence);
      program.getUniforms().setValue(gl, "morphTargetInfluences", morphInfluences);
    }
  }
  return {
    update
  };
}
function WebGLObjects(gl, geometries, attributes, info) {
  let updateMap = /* @__PURE__ */ new WeakMap();
  function update(object) {
    const frame = info.render.frame;
    const geometry = object.geometry;
    const buffergeometry = geometries.get(object, geometry);
    if (updateMap.get(buffergeometry) !== frame) {
      geometries.update(buffergeometry);
      updateMap.set(buffergeometry, frame);
    }
    if (object.isInstancedMesh) {
      if (object.hasEventListener("dispose", onInstancedMeshDispose) === false) {
        object.addEventListener("dispose", onInstancedMeshDispose);
      }
      attributes.update(object.instanceMatrix, 34962);
      if (object.instanceColor !== null) {
        attributes.update(object.instanceColor, 34962);
      }
    }
    return buffergeometry;
  }
  function dispose2() {
    updateMap = /* @__PURE__ */ new WeakMap();
  }
  function onInstancedMeshDispose(event) {
    const instancedMesh = event.target;
    instancedMesh.removeEventListener("dispose", onInstancedMeshDispose);
    attributes.remove(instancedMesh.instanceMatrix);
    if (instancedMesh.instanceColor !== null)
      attributes.remove(instancedMesh.instanceColor);
  }
  return {
    update,
    dispose: dispose2
  };
}
var emptyTexture = new Texture();
var emptyArrayTexture = new DataArrayTexture();
var empty3dTexture = new Data3DTexture();
var emptyCubeTexture = new CubeTexture();
var arrayCacheF32 = [];
var arrayCacheI32 = [];
var mat4array = new Float32Array(16);
var mat3array = new Float32Array(9);
var mat2array = new Float32Array(4);
function flatten(array, nBlocks, blockSize) {
  const firstElem = array[0];
  if (firstElem <= 0 || firstElem > 0)
    return array;
  const n2 = nBlocks * blockSize;
  let r3 = arrayCacheF32[n2];
  if (r3 === void 0) {
    r3 = new Float32Array(n2);
    arrayCacheF32[n2] = r3;
  }
  if (nBlocks !== 0) {
    firstElem.toArray(r3, 0);
    for (let i2 = 1, offset = 0; i2 !== nBlocks; ++i2) {
      offset += blockSize;
      array[i2].toArray(r3, offset);
    }
  }
  return r3;
}
function arraysEqual(a2, b) {
  if (a2.length !== b.length)
    return false;
  for (let i2 = 0, l = a2.length; i2 < l; i2++) {
    if (a2[i2] !== b[i2])
      return false;
  }
  return true;
}
function copyArray(a2, b) {
  for (let i2 = 0, l = b.length; i2 < l; i2++) {
    a2[i2] = b[i2];
  }
}
function allocTexUnits(textures, n2) {
  let r3 = arrayCacheI32[n2];
  if (r3 === void 0) {
    r3 = new Int32Array(n2);
    arrayCacheI32[n2] = r3;
  }
  for (let i2 = 0; i2 !== n2; ++i2) {
    r3[i2] = textures.allocateTextureUnit();
  }
  return r3;
}
function setValueV1f(gl, v4) {
  const cache2 = this.cache;
  if (cache2[0] === v4)
    return;
  gl.uniform1f(this.addr, v4);
  cache2[0] = v4;
}
function setValueV2f(gl, v4) {
  const cache2 = this.cache;
  if (v4.x !== void 0) {
    if (cache2[0] !== v4.x || cache2[1] !== v4.y) {
      gl.uniform2f(this.addr, v4.x, v4.y);
      cache2[0] = v4.x;
      cache2[1] = v4.y;
    }
  } else {
    if (arraysEqual(cache2, v4))
      return;
    gl.uniform2fv(this.addr, v4);
    copyArray(cache2, v4);
  }
}
function setValueV3f(gl, v4) {
  const cache2 = this.cache;
  if (v4.x !== void 0) {
    if (cache2[0] !== v4.x || cache2[1] !== v4.y || cache2[2] !== v4.z) {
      gl.uniform3f(this.addr, v4.x, v4.y, v4.z);
      cache2[0] = v4.x;
      cache2[1] = v4.y;
      cache2[2] = v4.z;
    }
  } else if (v4.r !== void 0) {
    if (cache2[0] !== v4.r || cache2[1] !== v4.g || cache2[2] !== v4.b) {
      gl.uniform3f(this.addr, v4.r, v4.g, v4.b);
      cache2[0] = v4.r;
      cache2[1] = v4.g;
      cache2[2] = v4.b;
    }
  } else {
    if (arraysEqual(cache2, v4))
      return;
    gl.uniform3fv(this.addr, v4);
    copyArray(cache2, v4);
  }
}
function setValueV4f(gl, v4) {
  const cache2 = this.cache;
  if (v4.x !== void 0) {
    if (cache2[0] !== v4.x || cache2[1] !== v4.y || cache2[2] !== v4.z || cache2[3] !== v4.w) {
      gl.uniform4f(this.addr, v4.x, v4.y, v4.z, v4.w);
      cache2[0] = v4.x;
      cache2[1] = v4.y;
      cache2[2] = v4.z;
      cache2[3] = v4.w;
    }
  } else {
    if (arraysEqual(cache2, v4))
      return;
    gl.uniform4fv(this.addr, v4);
    copyArray(cache2, v4);
  }
}
function setValueM2(gl, v4) {
  const cache2 = this.cache;
  const elements = v4.elements;
  if (elements === void 0) {
    if (arraysEqual(cache2, v4))
      return;
    gl.uniformMatrix2fv(this.addr, false, v4);
    copyArray(cache2, v4);
  } else {
    if (arraysEqual(cache2, elements))
      return;
    mat2array.set(elements);
    gl.uniformMatrix2fv(this.addr, false, mat2array);
    copyArray(cache2, elements);
  }
}
function setValueM3(gl, v4) {
  const cache2 = this.cache;
  const elements = v4.elements;
  if (elements === void 0) {
    if (arraysEqual(cache2, v4))
      return;
    gl.uniformMatrix3fv(this.addr, false, v4);
    copyArray(cache2, v4);
  } else {
    if (arraysEqual(cache2, elements))
      return;
    mat3array.set(elements);
    gl.uniformMatrix3fv(this.addr, false, mat3array);
    copyArray(cache2, elements);
  }
}
function setValueM4(gl, v4) {
  const cache2 = this.cache;
  const elements = v4.elements;
  if (elements === void 0) {
    if (arraysEqual(cache2, v4))
      return;
    gl.uniformMatrix4fv(this.addr, false, v4);
    copyArray(cache2, v4);
  } else {
    if (arraysEqual(cache2, elements))
      return;
    mat4array.set(elements);
    gl.uniformMatrix4fv(this.addr, false, mat4array);
    copyArray(cache2, elements);
  }
}
function setValueV1i(gl, v4) {
  const cache2 = this.cache;
  if (cache2[0] === v4)
    return;
  gl.uniform1i(this.addr, v4);
  cache2[0] = v4;
}
function setValueV2i(gl, v4) {
  const cache2 = this.cache;
  if (arraysEqual(cache2, v4))
    return;
  gl.uniform2iv(this.addr, v4);
  copyArray(cache2, v4);
}
function setValueV3i(gl, v4) {
  const cache2 = this.cache;
  if (arraysEqual(cache2, v4))
    return;
  gl.uniform3iv(this.addr, v4);
  copyArray(cache2, v4);
}
function setValueV4i(gl, v4) {
  const cache2 = this.cache;
  if (arraysEqual(cache2, v4))
    return;
  gl.uniform4iv(this.addr, v4);
  copyArray(cache2, v4);
}
function setValueV1ui(gl, v4) {
  const cache2 = this.cache;
  if (cache2[0] === v4)
    return;
  gl.uniform1ui(this.addr, v4);
  cache2[0] = v4;
}
function setValueV2ui(gl, v4) {
  const cache2 = this.cache;
  if (arraysEqual(cache2, v4))
    return;
  gl.uniform2uiv(this.addr, v4);
  copyArray(cache2, v4);
}
function setValueV3ui(gl, v4) {
  const cache2 = this.cache;
  if (arraysEqual(cache2, v4))
    return;
  gl.uniform3uiv(this.addr, v4);
  copyArray(cache2, v4);
}
function setValueV4ui(gl, v4) {
  const cache2 = this.cache;
  if (arraysEqual(cache2, v4))
    return;
  gl.uniform4uiv(this.addr, v4);
  copyArray(cache2, v4);
}
function setValueT1(gl, v4, textures) {
  const cache2 = this.cache;
  const unit2 = textures.allocateTextureUnit();
  if (cache2[0] !== unit2) {
    gl.uniform1i(this.addr, unit2);
    cache2[0] = unit2;
  }
  textures.setTexture2D(v4 || emptyTexture, unit2);
}
function setValueT3D1(gl, v4, textures) {
  const cache2 = this.cache;
  const unit2 = textures.allocateTextureUnit();
  if (cache2[0] !== unit2) {
    gl.uniform1i(this.addr, unit2);
    cache2[0] = unit2;
  }
  textures.setTexture3D(v4 || empty3dTexture, unit2);
}
function setValueT6(gl, v4, textures) {
  const cache2 = this.cache;
  const unit2 = textures.allocateTextureUnit();
  if (cache2[0] !== unit2) {
    gl.uniform1i(this.addr, unit2);
    cache2[0] = unit2;
  }
  textures.setTextureCube(v4 || emptyCubeTexture, unit2);
}
function setValueT2DArray1(gl, v4, textures) {
  const cache2 = this.cache;
  const unit2 = textures.allocateTextureUnit();
  if (cache2[0] !== unit2) {
    gl.uniform1i(this.addr, unit2);
    cache2[0] = unit2;
  }
  textures.setTexture2DArray(v4 || emptyArrayTexture, unit2);
}
function getSingularSetter(type) {
  switch (type) {
    case 5126:
      return setValueV1f;
    case 35664:
      return setValueV2f;
    case 35665:
      return setValueV3f;
    case 35666:
      return setValueV4f;
    case 35674:
      return setValueM2;
    case 35675:
      return setValueM3;
    case 35676:
      return setValueM4;
    case 5124:
    case 35670:
      return setValueV1i;
    case 35667:
    case 35671:
      return setValueV2i;
    case 35668:
    case 35672:
      return setValueV3i;
    case 35669:
    case 35673:
      return setValueV4i;
    case 5125:
      return setValueV1ui;
    case 36294:
      return setValueV2ui;
    case 36295:
      return setValueV3ui;
    case 36296:
      return setValueV4ui;
    case 35678:
    case 36198:
    case 36298:
    case 36306:
    case 35682:
      return setValueT1;
    case 35679:
    case 36299:
    case 36307:
      return setValueT3D1;
    case 35680:
    case 36300:
    case 36308:
    case 36293:
      return setValueT6;
    case 36289:
    case 36303:
    case 36311:
    case 36292:
      return setValueT2DArray1;
  }
}
function setValueV1fArray(gl, v4) {
  gl.uniform1fv(this.addr, v4);
}
function setValueV2fArray(gl, v4) {
  const data = flatten(v4, this.size, 2);
  gl.uniform2fv(this.addr, data);
}
function setValueV3fArray(gl, v4) {
  const data = flatten(v4, this.size, 3);
  gl.uniform3fv(this.addr, data);
}
function setValueV4fArray(gl, v4) {
  const data = flatten(v4, this.size, 4);
  gl.uniform4fv(this.addr, data);
}
function setValueM2Array(gl, v4) {
  const data = flatten(v4, this.size, 4);
  gl.uniformMatrix2fv(this.addr, false, data);
}
function setValueM3Array(gl, v4) {
  const data = flatten(v4, this.size, 9);
  gl.uniformMatrix3fv(this.addr, false, data);
}
function setValueM4Array(gl, v4) {
  const data = flatten(v4, this.size, 16);
  gl.uniformMatrix4fv(this.addr, false, data);
}
function setValueV1iArray(gl, v4) {
  gl.uniform1iv(this.addr, v4);
}
function setValueV2iArray(gl, v4) {
  gl.uniform2iv(this.addr, v4);
}
function setValueV3iArray(gl, v4) {
  gl.uniform3iv(this.addr, v4);
}
function setValueV4iArray(gl, v4) {
  gl.uniform4iv(this.addr, v4);
}
function setValueV1uiArray(gl, v4) {
  gl.uniform1uiv(this.addr, v4);
}
function setValueV2uiArray(gl, v4) {
  gl.uniform2uiv(this.addr, v4);
}
function setValueV3uiArray(gl, v4) {
  gl.uniform3uiv(this.addr, v4);
}
function setValueV4uiArray(gl, v4) {
  gl.uniform4uiv(this.addr, v4);
}
function setValueT1Array(gl, v4, textures) {
  const n2 = v4.length;
  const units = allocTexUnits(textures, n2);
  gl.uniform1iv(this.addr, units);
  for (let i2 = 0; i2 !== n2; ++i2) {
    textures.setTexture2D(v4[i2] || emptyTexture, units[i2]);
  }
}
function setValueT3DArray(gl, v4, textures) {
  const n2 = v4.length;
  const units = allocTexUnits(textures, n2);
  gl.uniform1iv(this.addr, units);
  for (let i2 = 0; i2 !== n2; ++i2) {
    textures.setTexture3D(v4[i2] || empty3dTexture, units[i2]);
  }
}
function setValueT6Array(gl, v4, textures) {
  const n2 = v4.length;
  const units = allocTexUnits(textures, n2);
  gl.uniform1iv(this.addr, units);
  for (let i2 = 0; i2 !== n2; ++i2) {
    textures.setTextureCube(v4[i2] || emptyCubeTexture, units[i2]);
  }
}
function setValueT2DArrayArray(gl, v4, textures) {
  const n2 = v4.length;
  const units = allocTexUnits(textures, n2);
  gl.uniform1iv(this.addr, units);
  for (let i2 = 0; i2 !== n2; ++i2) {
    textures.setTexture2DArray(v4[i2] || emptyArrayTexture, units[i2]);
  }
}
function getPureArraySetter(type) {
  switch (type) {
    case 5126:
      return setValueV1fArray;
    case 35664:
      return setValueV2fArray;
    case 35665:
      return setValueV3fArray;
    case 35666:
      return setValueV4fArray;
    case 35674:
      return setValueM2Array;
    case 35675:
      return setValueM3Array;
    case 35676:
      return setValueM4Array;
    case 5124:
    case 35670:
      return setValueV1iArray;
    case 35667:
    case 35671:
      return setValueV2iArray;
    case 35668:
    case 35672:
      return setValueV3iArray;
    case 35669:
    case 35673:
      return setValueV4iArray;
    case 5125:
      return setValueV1uiArray;
    case 36294:
      return setValueV2uiArray;
    case 36295:
      return setValueV3uiArray;
    case 36296:
      return setValueV4uiArray;
    case 35678:
    case 36198:
    case 36298:
    case 36306:
    case 35682:
      return setValueT1Array;
    case 35679:
    case 36299:
    case 36307:
      return setValueT3DArray;
    case 35680:
    case 36300:
    case 36308:
    case 36293:
      return setValueT6Array;
    case 36289:
    case 36303:
    case 36311:
    case 36292:
      return setValueT2DArrayArray;
  }
}
function SingleUniform(id2, activeInfo, addr) {
  this.id = id2;
  this.addr = addr;
  this.cache = [];
  this.setValue = getSingularSetter(activeInfo.type);
}
function PureArrayUniform(id2, activeInfo, addr) {
  this.id = id2;
  this.addr = addr;
  this.cache = [];
  this.size = activeInfo.size;
  this.setValue = getPureArraySetter(activeInfo.type);
}
PureArrayUniform.prototype.updateCache = function(data) {
  const cache2 = this.cache;
  if (data instanceof Float32Array && cache2.length !== data.length) {
    this.cache = new Float32Array(data.length);
  }
  copyArray(cache2, data);
};
function StructuredUniform(id2) {
  this.id = id2;
  this.seq = [];
  this.map = {};
}
StructuredUniform.prototype.setValue = function(gl, value, textures) {
  const seq = this.seq;
  for (let i2 = 0, n2 = seq.length; i2 !== n2; ++i2) {
    const u = seq[i2];
    u.setValue(gl, value[u.id], textures);
  }
};
var RePathPart = /(\w+)(\])?(\[|\.)?/g;
function addUniform(container, uniformObject) {
  container.seq.push(uniformObject);
  container.map[uniformObject.id] = uniformObject;
}
function parseUniform(activeInfo, addr, container) {
  const path2 = activeInfo.name, pathLength = path2.length;
  RePathPart.lastIndex = 0;
  while (true) {
    const match2 = RePathPart.exec(path2), matchEnd = RePathPart.lastIndex;
    let id2 = match2[1];
    const idIsIndex = match2[2] === "]", subscript2 = match2[3];
    if (idIsIndex)
      id2 = id2 | 0;
    if (subscript2 === void 0 || subscript2 === "[" && matchEnd + 2 === pathLength) {
      addUniform(container, subscript2 === void 0 ? new SingleUniform(id2, activeInfo, addr) : new PureArrayUniform(id2, activeInfo, addr));
      break;
    } else {
      const map3 = container.map;
      let next2 = map3[id2];
      if (next2 === void 0) {
        next2 = new StructuredUniform(id2);
        addUniform(container, next2);
      }
      container = next2;
    }
  }
}
function WebGLUniforms(gl, program) {
  this.seq = [];
  this.map = {};
  const n2 = gl.getProgramParameter(program, 35718);
  for (let i2 = 0; i2 < n2; ++i2) {
    const info = gl.getActiveUniform(program, i2), addr = gl.getUniformLocation(program, info.name);
    parseUniform(info, addr, this);
  }
}
WebGLUniforms.prototype.setValue = function(gl, name2, value, textures) {
  const u = this.map[name2];
  if (u !== void 0)
    u.setValue(gl, value, textures);
};
WebGLUniforms.prototype.setOptional = function(gl, object, name2) {
  const v4 = object[name2];
  if (v4 !== void 0)
    this.setValue(gl, name2, v4);
};
WebGLUniforms.upload = function(gl, seq, values2, textures) {
  for (let i2 = 0, n2 = seq.length; i2 !== n2; ++i2) {
    const u = seq[i2], v4 = values2[u.id];
    if (v4.needsUpdate !== false) {
      u.setValue(gl, v4.value, textures);
    }
  }
};
WebGLUniforms.seqWithValue = function(seq, values2) {
  const r3 = [];
  for (let i2 = 0, n2 = seq.length; i2 !== n2; ++i2) {
    const u = seq[i2];
    if (u.id in values2)
      r3.push(u);
  }
  return r3;
};
function WebGLShader(gl, type, string2) {
  const shader = gl.createShader(type);
  gl.shaderSource(shader, string2);
  gl.compileShader(shader);
  return shader;
}
var programIdCount = 0;
function handleSource(string2, errorLine) {
  const lines = string2.split("\n");
  const lines2 = [];
  const from2 = Math.max(errorLine - 6, 0);
  const to = Math.min(errorLine + 6, lines.length);
  for (let i2 = from2; i2 < to; i2++) {
    lines2.push(i2 + 1 + ": " + lines[i2]);
  }
  return lines2.join("\n");
}
function getEncodingComponents(encoding) {
  switch (encoding) {
    case LinearEncoding:
      return ["Linear", "( value )"];
    case sRGBEncoding:
      return ["sRGB", "( value )"];
    default:
      console.warn("THREE.WebGLProgram: Unsupported encoding:", encoding);
      return ["Linear", "( value )"];
  }
}
function getShaderErrors(gl, shader, type) {
  const status = gl.getShaderParameter(shader, 35713);
  const errors = gl.getShaderInfoLog(shader).trim();
  if (status && errors === "")
    return "";
  const errorLine = parseInt(/ERROR: 0:(\d+)/.exec(errors)[1]);
  return type.toUpperCase() + "\n\n" + errors + "\n\n" + handleSource(gl.getShaderSource(shader), errorLine);
}
function getTexelEncodingFunction(functionName, encoding) {
  const components = getEncodingComponents(encoding);
  return "vec4 " + functionName + "( vec4 value ) { return LinearTo" + components[0] + components[1] + "; }";
}
function getToneMappingFunction(functionName, toneMapping) {
  let toneMappingName;
  switch (toneMapping) {
    case LinearToneMapping:
      toneMappingName = "Linear";
      break;
    case ReinhardToneMapping:
      toneMappingName = "Reinhard";
      break;
    case CineonToneMapping:
      toneMappingName = "OptimizedCineon";
      break;
    case ACESFilmicToneMapping:
      toneMappingName = "ACESFilmic";
      break;
    case CustomToneMapping:
      toneMappingName = "Custom";
      break;
    default:
      console.warn("THREE.WebGLProgram: Unsupported toneMapping:", toneMapping);
      toneMappingName = "Linear";
  }
  return "vec3 " + functionName + "( vec3 color ) { return " + toneMappingName + "ToneMapping( color ); }";
}
function generateExtensions(parameters) {
  const chunks = [
    parameters.extensionDerivatives || !!parameters.envMapCubeUVHeight || parameters.bumpMap || parameters.tangentSpaceNormalMap || parameters.clearcoatNormalMap || parameters.flatShading || parameters.shaderID === "physical" ? "#extension GL_OES_standard_derivatives : enable" : "",
    (parameters.extensionFragDepth || parameters.logarithmicDepthBuffer) && parameters.rendererExtensionFragDepth ? "#extension GL_EXT_frag_depth : enable" : "",
    parameters.extensionDrawBuffers && parameters.rendererExtensionDrawBuffers ? "#extension GL_EXT_draw_buffers : require" : "",
    (parameters.extensionShaderTextureLOD || parameters.envMap || parameters.transmission) && parameters.rendererExtensionShaderTextureLod ? "#extension GL_EXT_shader_texture_lod : enable" : ""
  ];
  return chunks.filter(filterEmptyLine).join("\n");
}
function generateDefines(defines) {
  const chunks = [];
  for (const name2 in defines) {
    const value = defines[name2];
    if (value === false)
      continue;
    chunks.push("#define " + name2 + " " + value);
  }
  return chunks.join("\n");
}
function fetchAttributeLocations(gl, program) {
  const attributes = {};
  const n2 = gl.getProgramParameter(program, 35721);
  for (let i2 = 0; i2 < n2; i2++) {
    const info = gl.getActiveAttrib(program, i2);
    const name2 = info.name;
    let locationSize = 1;
    if (info.type === 35674)
      locationSize = 2;
    if (info.type === 35675)
      locationSize = 3;
    if (info.type === 35676)
      locationSize = 4;
    attributes[name2] = {
      type: info.type,
      location: gl.getAttribLocation(program, name2),
      locationSize
    };
  }
  return attributes;
}
function filterEmptyLine(string2) {
  return string2 !== "";
}
function replaceLightNums(string2, parameters) {
  return string2.replace(/NUM_DIR_LIGHTS/g, parameters.numDirLights).replace(/NUM_SPOT_LIGHTS/g, parameters.numSpotLights).replace(/NUM_RECT_AREA_LIGHTS/g, parameters.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g, parameters.numPointLights).replace(/NUM_HEMI_LIGHTS/g, parameters.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g, parameters.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS/g, parameters.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g, parameters.numPointLightShadows);
}
function replaceClippingPlaneNums(string2, parameters) {
  return string2.replace(/NUM_CLIPPING_PLANES/g, parameters.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g, parameters.numClippingPlanes - parameters.numClipIntersection);
}
var includePattern = /^[ \t]*#include +<([\w\d./]+)>/gm;
function resolveIncludes(string2) {
  return string2.replace(includePattern, includeReplacer);
}
function includeReplacer(match2, include) {
  const string2 = ShaderChunk[include];
  if (string2 === void 0) {
    throw new Error("Can not resolve #include <" + include + ">");
  }
  return resolveIncludes(string2);
}
var deprecatedUnrollLoopPattern = /#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g;
var unrollLoopPattern = /#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;
function unrollLoops(string2) {
  return string2.replace(unrollLoopPattern, loopReplacer).replace(deprecatedUnrollLoopPattern, deprecatedLoopReplacer);
}
function deprecatedLoopReplacer(match2, start, end, snippet2) {
  console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead.");
  return loopReplacer(match2, start, end, snippet2);
}
function loopReplacer(match2, start, end, snippet2) {
  let string2 = "";
  for (let i2 = parseInt(start); i2 < parseInt(end); i2++) {
    string2 += snippet2.replace(/\[\s*i\s*\]/g, "[ " + i2 + " ]").replace(/UNROLLED_LOOP_INDEX/g, i2);
  }
  return string2;
}
function generatePrecision(parameters) {
  let precisionstring = "precision " + parameters.precision + " float;\nprecision " + parameters.precision + " int;";
  if (parameters.precision === "highp") {
    precisionstring += "\n#define HIGH_PRECISION";
  } else if (parameters.precision === "mediump") {
    precisionstring += "\n#define MEDIUM_PRECISION";
  } else if (parameters.precision === "lowp") {
    precisionstring += "\n#define LOW_PRECISION";
  }
  return precisionstring;
}
function generateShadowMapTypeDefine(parameters) {
  let shadowMapTypeDefine = "SHADOWMAP_TYPE_BASIC";
  if (parameters.shadowMapType === PCFShadowMap) {
    shadowMapTypeDefine = "SHADOWMAP_TYPE_PCF";
  } else if (parameters.shadowMapType === PCFSoftShadowMap) {
    shadowMapTypeDefine = "SHADOWMAP_TYPE_PCF_SOFT";
  } else if (parameters.shadowMapType === VSMShadowMap) {
    shadowMapTypeDefine = "SHADOWMAP_TYPE_VSM";
  }
  return shadowMapTypeDefine;
}
function generateEnvMapTypeDefine(parameters) {
  let envMapTypeDefine = "ENVMAP_TYPE_CUBE";
  if (parameters.envMap) {
    switch (parameters.envMapMode) {
      case CubeReflectionMapping:
      case CubeRefractionMapping:
        envMapTypeDefine = "ENVMAP_TYPE_CUBE";
        break;
      case CubeUVReflectionMapping:
        envMapTypeDefine = "ENVMAP_TYPE_CUBE_UV";
        break;
    }
  }
  return envMapTypeDefine;
}
function generateEnvMapModeDefine(parameters) {
  let envMapModeDefine = "ENVMAP_MODE_REFLECTION";
  if (parameters.envMap) {
    switch (parameters.envMapMode) {
      case CubeRefractionMapping:
        envMapModeDefine = "ENVMAP_MODE_REFRACTION";
        break;
    }
  }
  return envMapModeDefine;
}
function generateEnvMapBlendingDefine(parameters) {
  let envMapBlendingDefine = "ENVMAP_BLENDING_NONE";
  if (parameters.envMap) {
    switch (parameters.combine) {
      case MultiplyOperation:
        envMapBlendingDefine = "ENVMAP_BLENDING_MULTIPLY";
        break;
      case MixOperation:
        envMapBlendingDefine = "ENVMAP_BLENDING_MIX";
        break;
      case AddOperation:
        envMapBlendingDefine = "ENVMAP_BLENDING_ADD";
        break;
    }
  }
  return envMapBlendingDefine;
}
function generateCubeUVSize(parameters) {
  const imageHeight = parameters.envMapCubeUVHeight;
  if (imageHeight === null)
    return null;
  const maxMip = Math.log2(imageHeight / 32 + 1) + 3;
  const texelHeight = 1 / imageHeight;
  const texelWidth = 1 / (3 * Math.max(Math.pow(2, maxMip), 7 * 16));
  return { texelWidth, texelHeight, maxMip };
}
function WebGLProgram(renderer, cacheKey, parameters, bindingStates) {
  const gl = renderer.getContext();
  const defines = parameters.defines;
  let vertexShader = parameters.vertexShader;
  let fragmentShader = parameters.fragmentShader;
  const shadowMapTypeDefine = generateShadowMapTypeDefine(parameters);
  const envMapTypeDefine = generateEnvMapTypeDefine(parameters);
  const envMapModeDefine = generateEnvMapModeDefine(parameters);
  const envMapBlendingDefine = generateEnvMapBlendingDefine(parameters);
  const envMapCubeUVSize = generateCubeUVSize(parameters);
  const customExtensions = parameters.isWebGL2 ? "" : generateExtensions(parameters);
  const customDefines = generateDefines(defines);
  const program = gl.createProgram();
  let prefixVertex, prefixFragment;
  let versionString = parameters.glslVersion ? "#version " + parameters.glslVersion + "\n" : "";
  if (parameters.isRawShaderMaterial) {
    prefixVertex = [
      customDefines
    ].filter(filterEmptyLine).join("\n");
    if (prefixVertex.length > 0) {
      prefixVertex += "\n";
    }
    prefixFragment = [
      customExtensions,
      customDefines
    ].filter(filterEmptyLine).join("\n");
    if (prefixFragment.length > 0) {
      prefixFragment += "\n";
    }
  } else {
    prefixVertex = [
      generatePrecision(parameters),
      "#define SHADER_NAME " + parameters.shaderName,
      customDefines,
      parameters.instancing ? "#define USE_INSTANCING" : "",
      parameters.instancingColor ? "#define USE_INSTANCING_COLOR" : "",
      parameters.supportsVertexTextures ? "#define VERTEX_TEXTURES" : "",
      "#define MAX_BONES " + parameters.maxBones,
      parameters.useFog && parameters.fog ? "#define USE_FOG" : "",
      parameters.useFog && parameters.fogExp2 ? "#define FOG_EXP2" : "",
      parameters.map ? "#define USE_MAP" : "",
      parameters.envMap ? "#define USE_ENVMAP" : "",
      parameters.envMap ? "#define " + envMapModeDefine : "",
      parameters.lightMap ? "#define USE_LIGHTMAP" : "",
      parameters.aoMap ? "#define USE_AOMAP" : "",
      parameters.emissiveMap ? "#define USE_EMISSIVEMAP" : "",
      parameters.bumpMap ? "#define USE_BUMPMAP" : "",
      parameters.normalMap ? "#define USE_NORMALMAP" : "",
      parameters.normalMap && parameters.objectSpaceNormalMap ? "#define OBJECTSPACE_NORMALMAP" : "",
      parameters.normalMap && parameters.tangentSpaceNormalMap ? "#define TANGENTSPACE_NORMALMAP" : "",
      parameters.clearcoatMap ? "#define USE_CLEARCOATMAP" : "",
      parameters.clearcoatRoughnessMap ? "#define USE_CLEARCOAT_ROUGHNESSMAP" : "",
      parameters.clearcoatNormalMap ? "#define USE_CLEARCOAT_NORMALMAP" : "",
      parameters.displacementMap && parameters.supportsVertexTextures ? "#define USE_DISPLACEMENTMAP" : "",
      parameters.specularMap ? "#define USE_SPECULARMAP" : "",
      parameters.specularIntensityMap ? "#define USE_SPECULARINTENSITYMAP" : "",
      parameters.specularColorMap ? "#define USE_SPECULARCOLORMAP" : "",
      parameters.roughnessMap ? "#define USE_ROUGHNESSMAP" : "",
      parameters.metalnessMap ? "#define USE_METALNESSMAP" : "",
      parameters.alphaMap ? "#define USE_ALPHAMAP" : "",
      parameters.transmission ? "#define USE_TRANSMISSION" : "",
      parameters.transmissionMap ? "#define USE_TRANSMISSIONMAP" : "",
      parameters.thicknessMap ? "#define USE_THICKNESSMAP" : "",
      parameters.sheenColorMap ? "#define USE_SHEENCOLORMAP" : "",
      parameters.sheenRoughnessMap ? "#define USE_SHEENROUGHNESSMAP" : "",
      parameters.vertexTangents ? "#define USE_TANGENT" : "",
      parameters.vertexColors ? "#define USE_COLOR" : "",
      parameters.vertexAlphas ? "#define USE_COLOR_ALPHA" : "",
      parameters.vertexUvs ? "#define USE_UV" : "",
      parameters.uvsVertexOnly ? "#define UVS_VERTEX_ONLY" : "",
      parameters.flatShading ? "#define FLAT_SHADED" : "",
      parameters.skinning ? "#define USE_SKINNING" : "",
      parameters.useVertexTexture ? "#define BONE_TEXTURE" : "",
      parameters.morphTargets ? "#define USE_MORPHTARGETS" : "",
      parameters.morphNormals && parameters.flatShading === false ? "#define USE_MORPHNORMALS" : "",
      parameters.morphColors && parameters.isWebGL2 ? "#define USE_MORPHCOLORS" : "",
      parameters.morphTargetsCount > 0 && parameters.isWebGL2 ? "#define MORPHTARGETS_TEXTURE" : "",
      parameters.morphTargetsCount > 0 && parameters.isWebGL2 ? "#define MORPHTARGETS_TEXTURE_STRIDE " + parameters.morphTextureStride : "",
      parameters.morphTargetsCount > 0 && parameters.isWebGL2 ? "#define MORPHTARGETS_COUNT " + parameters.morphTargetsCount : "",
      parameters.doubleSided ? "#define DOUBLE_SIDED" : "",
      parameters.flipSided ? "#define FLIP_SIDED" : "",
      parameters.shadowMapEnabled ? "#define USE_SHADOWMAP" : "",
      parameters.shadowMapEnabled ? "#define " + shadowMapTypeDefine : "",
      parameters.sizeAttenuation ? "#define USE_SIZEATTENUATION" : "",
      parameters.logarithmicDepthBuffer ? "#define USE_LOGDEPTHBUF" : "",
      parameters.logarithmicDepthBuffer && parameters.rendererExtensionFragDepth ? "#define USE_LOGDEPTHBUF_EXT" : "",
      "uniform mat4 modelMatrix;",
      "uniform mat4 modelViewMatrix;",
      "uniform mat4 projectionMatrix;",
      "uniform mat4 viewMatrix;",
      "uniform mat3 normalMatrix;",
      "uniform vec3 cameraPosition;",
      "uniform bool isOrthographic;",
      "#ifdef USE_INSTANCING",
      "	attribute mat4 instanceMatrix;",
      "#endif",
      "#ifdef USE_INSTANCING_COLOR",
      "	attribute vec3 instanceColor;",
      "#endif",
      "attribute vec3 position;",
      "attribute vec3 normal;",
      "attribute vec2 uv;",
      "#ifdef USE_TANGENT",
      "	attribute vec4 tangent;",
      "#endif",
      "#if defined( USE_COLOR_ALPHA )",
      "	attribute vec4 color;",
      "#elif defined( USE_COLOR )",
      "	attribute vec3 color;",
      "#endif",
      "#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )",
      "	attribute vec3 morphTarget0;",
      "	attribute vec3 morphTarget1;",
      "	attribute vec3 morphTarget2;",
      "	attribute vec3 morphTarget3;",
      "	#ifdef USE_MORPHNORMALS",
      "		attribute vec3 morphNormal0;",
      "		attribute vec3 morphNormal1;",
      "		attribute vec3 morphNormal2;",
      "		attribute vec3 morphNormal3;",
      "	#else",
      "		attribute vec3 morphTarget4;",
      "		attribute vec3 morphTarget5;",
      "		attribute vec3 morphTarget6;",
      "		attribute vec3 morphTarget7;",
      "	#endif",
      "#endif",
      "#ifdef USE_SKINNING",
      "	attribute vec4 skinIndex;",
      "	attribute vec4 skinWeight;",
      "#endif",
      "\n"
    ].filter(filterEmptyLine).join("\n");
    prefixFragment = [
      customExtensions,
      generatePrecision(parameters),
      "#define SHADER_NAME " + parameters.shaderName,
      customDefines,
      parameters.useFog && parameters.fog ? "#define USE_FOG" : "",
      parameters.useFog && parameters.fogExp2 ? "#define FOG_EXP2" : "",
      parameters.map ? "#define USE_MAP" : "",
      parameters.matcap ? "#define USE_MATCAP" : "",
      parameters.envMap ? "#define USE_ENVMAP" : "",
      parameters.envMap ? "#define " + envMapTypeDefine : "",
      parameters.envMap ? "#define " + envMapModeDefine : "",
      parameters.envMap ? "#define " + envMapBlendingDefine : "",
      envMapCubeUVSize ? "#define CUBEUV_TEXEL_WIDTH " + envMapCubeUVSize.texelWidth : "",
      envMapCubeUVSize ? "#define CUBEUV_TEXEL_HEIGHT " + envMapCubeUVSize.texelHeight : "",
      envMapCubeUVSize ? "#define CUBEUV_MAX_MIP " + envMapCubeUVSize.maxMip + ".0" : "",
      parameters.lightMap ? "#define USE_LIGHTMAP" : "",
      parameters.aoMap ? "#define USE_AOMAP" : "",
      parameters.emissiveMap ? "#define USE_EMISSIVEMAP" : "",
      parameters.bumpMap ? "#define USE_BUMPMAP" : "",
      parameters.normalMap ? "#define USE_NORMALMAP" : "",
      parameters.normalMap && parameters.objectSpaceNormalMap ? "#define OBJECTSPACE_NORMALMAP" : "",
      parameters.normalMap && parameters.tangentSpaceNormalMap ? "#define TANGENTSPACE_NORMALMAP" : "",
      parameters.clearcoat ? "#define USE_CLEARCOAT" : "",
      parameters.clearcoatMap ? "#define USE_CLEARCOATMAP" : "",
      parameters.clearcoatRoughnessMap ? "#define USE_CLEARCOAT_ROUGHNESSMAP" : "",
      parameters.clearcoatNormalMap ? "#define USE_CLEARCOAT_NORMALMAP" : "",
      parameters.specularMap ? "#define USE_SPECULARMAP" : "",
      parameters.specularIntensityMap ? "#define USE_SPECULARINTENSITYMAP" : "",
      parameters.specularColorMap ? "#define USE_SPECULARCOLORMAP" : "",
      parameters.roughnessMap ? "#define USE_ROUGHNESSMAP" : "",
      parameters.metalnessMap ? "#define USE_METALNESSMAP" : "",
      parameters.alphaMap ? "#define USE_ALPHAMAP" : "",
      parameters.alphaTest ? "#define USE_ALPHATEST" : "",
      parameters.sheen ? "#define USE_SHEEN" : "",
      parameters.sheenColorMap ? "#define USE_SHEENCOLORMAP" : "",
      parameters.sheenRoughnessMap ? "#define USE_SHEENROUGHNESSMAP" : "",
      parameters.transmission ? "#define USE_TRANSMISSION" : "",
      parameters.transmissionMap ? "#define USE_TRANSMISSIONMAP" : "",
      parameters.thicknessMap ? "#define USE_THICKNESSMAP" : "",
      parameters.decodeVideoTexture ? "#define DECODE_VIDEO_TEXTURE" : "",
      parameters.vertexTangents ? "#define USE_TANGENT" : "",
      parameters.vertexColors || parameters.instancingColor ? "#define USE_COLOR" : "",
      parameters.vertexAlphas ? "#define USE_COLOR_ALPHA" : "",
      parameters.vertexUvs ? "#define USE_UV" : "",
      parameters.uvsVertexOnly ? "#define UVS_VERTEX_ONLY" : "",
      parameters.gradientMap ? "#define USE_GRADIENTMAP" : "",
      parameters.flatShading ? "#define FLAT_SHADED" : "",
      parameters.doubleSided ? "#define DOUBLE_SIDED" : "",
      parameters.flipSided ? "#define FLIP_SIDED" : "",
      parameters.shadowMapEnabled ? "#define USE_SHADOWMAP" : "",
      parameters.shadowMapEnabled ? "#define " + shadowMapTypeDefine : "",
      parameters.premultipliedAlpha ? "#define PREMULTIPLIED_ALPHA" : "",
      parameters.physicallyCorrectLights ? "#define PHYSICALLY_CORRECT_LIGHTS" : "",
      parameters.logarithmicDepthBuffer ? "#define USE_LOGDEPTHBUF" : "",
      parameters.logarithmicDepthBuffer && parameters.rendererExtensionFragDepth ? "#define USE_LOGDEPTHBUF_EXT" : "",
      "uniform mat4 viewMatrix;",
      "uniform vec3 cameraPosition;",
      "uniform bool isOrthographic;",
      parameters.toneMapping !== NoToneMapping ? "#define TONE_MAPPING" : "",
      parameters.toneMapping !== NoToneMapping ? ShaderChunk["tonemapping_pars_fragment"] : "",
      // this code is required here because it is used by the toneMapping() function defined below
      parameters.toneMapping !== NoToneMapping ? getToneMappingFunction("toneMapping", parameters.toneMapping) : "",
      parameters.dithering ? "#define DITHERING" : "",
      parameters.opaque ? "#define OPAQUE" : "",
      ShaderChunk["encodings_pars_fragment"],
      // this code is required here because it is used by the various encoding/decoding function defined below
      getTexelEncodingFunction("linearToOutputTexel", parameters.outputEncoding),
      parameters.depthPacking ? "#define DEPTH_PACKING " + parameters.depthPacking : "",
      "\n"
    ].filter(filterEmptyLine).join("\n");
  }
  vertexShader = resolveIncludes(vertexShader);
  vertexShader = replaceLightNums(vertexShader, parameters);
  vertexShader = replaceClippingPlaneNums(vertexShader, parameters);
  fragmentShader = resolveIncludes(fragmentShader);
  fragmentShader = replaceLightNums(fragmentShader, parameters);
  fragmentShader = replaceClippingPlaneNums(fragmentShader, parameters);
  vertexShader = unrollLoops(vertexShader);
  fragmentShader = unrollLoops(fragmentShader);
  if (parameters.isWebGL2 && parameters.isRawShaderMaterial !== true) {
    versionString = "#version 300 es\n";
    prefixVertex = [
      "precision mediump sampler2DArray;",
      "#define attribute in",
      "#define varying out",
      "#define texture2D texture"
    ].join("\n") + "\n" + prefixVertex;
    prefixFragment = [
      "#define varying in",
      parameters.glslVersion === GLSL3 ? "" : "layout(location = 0) out highp vec4 pc_fragColor;",
      parameters.glslVersion === GLSL3 ? "" : "#define gl_FragColor pc_fragColor",
      "#define gl_FragDepthEXT gl_FragDepth",
      "#define texture2D texture",
      "#define textureCube texture",
      "#define texture2DProj textureProj",
      "#define texture2DLodEXT textureLod",
      "#define texture2DProjLodEXT textureProjLod",
      "#define textureCubeLodEXT textureLod",
      "#define texture2DGradEXT textureGrad",
      "#define texture2DProjGradEXT textureProjGrad",
      "#define textureCubeGradEXT textureGrad"
    ].join("\n") + "\n" + prefixFragment;
  }
  const vertexGlsl = versionString + prefixVertex + vertexShader;
  const fragmentGlsl = versionString + prefixFragment + fragmentShader;
  const glVertexShader = WebGLShader(gl, 35633, vertexGlsl);
  const glFragmentShader = WebGLShader(gl, 35632, fragmentGlsl);
  gl.attachShader(program, glVertexShader);
  gl.attachShader(program, glFragmentShader);
  if (parameters.index0AttributeName !== void 0) {
    gl.bindAttribLocation(program, 0, parameters.index0AttributeName);
  } else if (parameters.morphTargets === true) {
    gl.bindAttribLocation(program, 0, "position");
  }
  gl.linkProgram(program);
  if (renderer.debug.checkShaderErrors) {
    const programLog = gl.getProgramInfoLog(program).trim();
    const vertexLog = gl.getShaderInfoLog(glVertexShader).trim();
    const fragmentLog = gl.getShaderInfoLog(glFragmentShader).trim();
    let runnable = true;
    let haveDiagnostics = true;
    if (gl.getProgramParameter(program, 35714) === false) {
      runnable = false;
      const vertexErrors = getShaderErrors(gl, glVertexShader, "vertex");
      const fragmentErrors = getShaderErrors(gl, glFragmentShader, "fragment");
      console.error(
        "THREE.WebGLProgram: Shader Error " + gl.getError() + " - VALIDATE_STATUS " + gl.getProgramParameter(program, 35715) + "\n\nProgram Info Log: " + programLog + "\n" + vertexErrors + "\n" + fragmentErrors
      );
    } else if (programLog !== "") {
      console.warn("THREE.WebGLProgram: Program Info Log:", programLog);
    } else if (vertexLog === "" || fragmentLog === "") {
      haveDiagnostics = false;
    }
    if (haveDiagnostics) {
      this.diagnostics = {
        runnable,
        programLog,
        vertexShader: {
          log: vertexLog,
          prefix: prefixVertex
        },
        fragmentShader: {
          log: fragmentLog,
          prefix: prefixFragment
        }
      };
    }
  }
  gl.deleteShader(glVertexShader);
  gl.deleteShader(glFragmentShader);
  let cachedUniforms;
  this.getUniforms = function() {
    if (cachedUniforms === void 0) {
      cachedUniforms = new WebGLUniforms(gl, program);
    }
    return cachedUniforms;
  };
  let cachedAttributes;
  this.getAttributes = function() {
    if (cachedAttributes === void 0) {
      cachedAttributes = fetchAttributeLocations(gl, program);
    }
    return cachedAttributes;
  };
  this.destroy = function() {
    bindingStates.releaseStatesOfProgram(this);
    gl.deleteProgram(program);
    this.program = void 0;
  };
  this.name = parameters.shaderName;
  this.id = programIdCount++;
  this.cacheKey = cacheKey;
  this.usedTimes = 1;
  this.program = program;
  this.vertexShader = glVertexShader;
  this.fragmentShader = glFragmentShader;
  return this;
}
var _id = 0;
var WebGLShaderCache = class {
  constructor() {
    this.shaderCache = /* @__PURE__ */ new Map();
    this.materialCache = /* @__PURE__ */ new Map();
  }
  update(material) {
    const vertexShader = material.vertexShader;
    const fragmentShader = material.fragmentShader;
    const vertexShaderStage = this._getShaderStage(vertexShader);
    const fragmentShaderStage = this._getShaderStage(fragmentShader);
    const materialShaders = this._getShaderCacheForMaterial(material);
    if (materialShaders.has(vertexShaderStage) === false) {
      materialShaders.add(vertexShaderStage);
      vertexShaderStage.usedTimes++;
    }
    if (materialShaders.has(fragmentShaderStage) === false) {
      materialShaders.add(fragmentShaderStage);
      fragmentShaderStage.usedTimes++;
    }
    return this;
  }
  remove(material) {
    const materialShaders = this.materialCache.get(material);
    for (const shaderStage of materialShaders) {
      shaderStage.usedTimes--;
      if (shaderStage.usedTimes === 0)
        this.shaderCache.delete(shaderStage.code);
    }
    this.materialCache.delete(material);
    return this;
  }
  getVertexShaderID(material) {
    return this._getShaderStage(material.vertexShader).id;
  }
  getFragmentShaderID(material) {
    return this._getShaderStage(material.fragmentShader).id;
  }
  dispose() {
    this.shaderCache.clear();
    this.materialCache.clear();
  }
  _getShaderCacheForMaterial(material) {
    const cache2 = this.materialCache;
    if (cache2.has(material) === false) {
      cache2.set(material, /* @__PURE__ */ new Set());
    }
    return cache2.get(material);
  }
  _getShaderStage(code) {
    const cache2 = this.shaderCache;
    if (cache2.has(code) === false) {
      const stage = new WebGLShaderStage(code);
      cache2.set(code, stage);
    }
    return cache2.get(code);
  }
};
var WebGLShaderStage = class {
  constructor(code) {
    this.id = _id++;
    this.code = code;
    this.usedTimes = 0;
  }
};
function WebGLPrograms(renderer, cubemaps, cubeuvmaps, extensions2, capabilities, bindingStates, clipping) {
  const _programLayers = new Layers();
  const _customShaders = new WebGLShaderCache();
  const programs = [];
  const isWebGL2 = capabilities.isWebGL2;
  const logarithmicDepthBuffer = capabilities.logarithmicDepthBuffer;
  const floatVertexTextures = capabilities.floatVertexTextures;
  const maxVertexUniforms = capabilities.maxVertexUniforms;
  const vertexTextures = capabilities.vertexTextures;
  let precision = capabilities.precision;
  const shaderIDs = {
    MeshDepthMaterial: "depth",
    MeshDistanceMaterial: "distanceRGBA",
    MeshNormalMaterial: "normal",
    MeshBasicMaterial: "basic",
    MeshLambertMaterial: "lambert",
    MeshPhongMaterial: "phong",
    MeshToonMaterial: "toon",
    MeshStandardMaterial: "physical",
    MeshPhysicalMaterial: "physical",
    MeshMatcapMaterial: "matcap",
    LineBasicMaterial: "basic",
    LineDashedMaterial: "dashed",
    PointsMaterial: "points",
    ShadowMaterial: "shadow",
    SpriteMaterial: "sprite"
  };
  function getMaxBones(object) {
    const skeleton = object.skeleton;
    const bones = skeleton.bones;
    if (floatVertexTextures) {
      return 1024;
    } else {
      const nVertexUniforms = maxVertexUniforms;
      const nVertexMatrices = Math.floor((nVertexUniforms - 20) / 4);
      const maxBones = Math.min(nVertexMatrices, bones.length);
      if (maxBones < bones.length) {
        console.warn("THREE.WebGLRenderer: Skeleton has " + bones.length + " bones. This GPU supports " + maxBones + ".");
        return 0;
      }
      return maxBones;
    }
  }
  function getParameters(material, lights, shadows, scene, object) {
    const fog = scene.fog;
    const geometry = object.geometry;
    const environment = material.isMeshStandardMaterial ? scene.environment : null;
    const envMap = (material.isMeshStandardMaterial ? cubeuvmaps : cubemaps).get(material.envMap || environment);
    const envMapCubeUVHeight = !!envMap && envMap.mapping === CubeUVReflectionMapping ? envMap.image.height : null;
    const shaderID = shaderIDs[material.type];
    const maxBones = object.isSkinnedMesh ? getMaxBones(object) : 0;
    if (material.precision !== null) {
      precision = capabilities.getMaxPrecision(material.precision);
      if (precision !== material.precision) {
        console.warn("THREE.WebGLProgram.getParameters:", material.precision, "not supported, using", precision, "instead.");
      }
    }
    const morphAttribute = geometry.morphAttributes.position || geometry.morphAttributes.normal || geometry.morphAttributes.color;
    const morphTargetsCount = morphAttribute !== void 0 ? morphAttribute.length : 0;
    let morphTextureStride = 0;
    if (geometry.morphAttributes.position !== void 0)
      morphTextureStride = 1;
    if (geometry.morphAttributes.normal !== void 0)
      morphTextureStride = 2;
    if (geometry.morphAttributes.color !== void 0)
      morphTextureStride = 3;
    let vertexShader, fragmentShader;
    let customVertexShaderID, customFragmentShaderID;
    if (shaderID) {
      const shader = ShaderLib[shaderID];
      vertexShader = shader.vertexShader;
      fragmentShader = shader.fragmentShader;
    } else {
      vertexShader = material.vertexShader;
      fragmentShader = material.fragmentShader;
      _customShaders.update(material);
      customVertexShaderID = _customShaders.getVertexShaderID(material);
      customFragmentShaderID = _customShaders.getFragmentShaderID(material);
    }
    const currentRenderTarget = renderer.getRenderTarget();
    const useAlphaTest = material.alphaTest > 0;
    const useClearcoat = material.clearcoat > 0;
    const parameters = {
      isWebGL2,
      shaderID,
      shaderName: material.type,
      vertexShader,
      fragmentShader,
      defines: material.defines,
      customVertexShaderID,
      customFragmentShaderID,
      isRawShaderMaterial: material.isRawShaderMaterial === true,
      glslVersion: material.glslVersion,
      precision,
      instancing: object.isInstancedMesh === true,
      instancingColor: object.isInstancedMesh === true && object.instanceColor !== null,
      supportsVertexTextures: vertexTextures,
      outputEncoding: currentRenderTarget === null ? renderer.outputEncoding : currentRenderTarget.isXRRenderTarget === true ? currentRenderTarget.texture.encoding : LinearEncoding,
      map: !!material.map,
      matcap: !!material.matcap,
      envMap: !!envMap,
      envMapMode: envMap && envMap.mapping,
      envMapCubeUVHeight,
      lightMap: !!material.lightMap,
      aoMap: !!material.aoMap,
      emissiveMap: !!material.emissiveMap,
      bumpMap: !!material.bumpMap,
      normalMap: !!material.normalMap,
      objectSpaceNormalMap: material.normalMapType === ObjectSpaceNormalMap,
      tangentSpaceNormalMap: material.normalMapType === TangentSpaceNormalMap,
      decodeVideoTexture: !!material.map && material.map.isVideoTexture === true && material.map.encoding === sRGBEncoding,
      clearcoat: useClearcoat,
      clearcoatMap: useClearcoat && !!material.clearcoatMap,
      clearcoatRoughnessMap: useClearcoat && !!material.clearcoatRoughnessMap,
      clearcoatNormalMap: useClearcoat && !!material.clearcoatNormalMap,
      displacementMap: !!material.displacementMap,
      roughnessMap: !!material.roughnessMap,
      metalnessMap: !!material.metalnessMap,
      specularMap: !!material.specularMap,
      specularIntensityMap: !!material.specularIntensityMap,
      specularColorMap: !!material.specularColorMap,
      opaque: material.transparent === false && material.blending === NormalBlending,
      alphaMap: !!material.alphaMap,
      alphaTest: useAlphaTest,
      gradientMap: !!material.gradientMap,
      sheen: material.sheen > 0,
      sheenColorMap: !!material.sheenColorMap,
      sheenRoughnessMap: !!material.sheenRoughnessMap,
      transmission: material.transmission > 0,
      transmissionMap: !!material.transmissionMap,
      thicknessMap: !!material.thicknessMap,
      combine: material.combine,
      vertexTangents: !!material.normalMap && !!geometry.attributes.tangent,
      vertexColors: material.vertexColors,
      vertexAlphas: material.vertexColors === true && !!geometry.attributes.color && geometry.attributes.color.itemSize === 4,
      vertexUvs: !!material.map || !!material.bumpMap || !!material.normalMap || !!material.specularMap || !!material.alphaMap || !!material.emissiveMap || !!material.roughnessMap || !!material.metalnessMap || !!material.clearcoatMap || !!material.clearcoatRoughnessMap || !!material.clearcoatNormalMap || !!material.displacementMap || !!material.transmissionMap || !!material.thicknessMap || !!material.specularIntensityMap || !!material.specularColorMap || !!material.sheenColorMap || !!material.sheenRoughnessMap,
      uvsVertexOnly: !(!!material.map || !!material.bumpMap || !!material.normalMap || !!material.specularMap || !!material.alphaMap || !!material.emissiveMap || !!material.roughnessMap || !!material.metalnessMap || !!material.clearcoatNormalMap || material.transmission > 0 || !!material.transmissionMap || !!material.thicknessMap || !!material.specularIntensityMap || !!material.specularColorMap || material.sheen > 0 || !!material.sheenColorMap || !!material.sheenRoughnessMap) && !!material.displacementMap,
      fog: !!fog,
      useFog: material.fog,
      fogExp2: fog && fog.isFogExp2,
      flatShading: !!material.flatShading,
      sizeAttenuation: material.sizeAttenuation,
      logarithmicDepthBuffer,
      skinning: object.isSkinnedMesh === true && maxBones > 0,
      maxBones,
      useVertexTexture: floatVertexTextures,
      morphTargets: geometry.morphAttributes.position !== void 0,
      morphNormals: geometry.morphAttributes.normal !== void 0,
      morphColors: geometry.morphAttributes.color !== void 0,
      morphTargetsCount,
      morphTextureStride,
      numDirLights: lights.directional.length,
      numPointLights: lights.point.length,
      numSpotLights: lights.spot.length,
      numRectAreaLights: lights.rectArea.length,
      numHemiLights: lights.hemi.length,
      numDirLightShadows: lights.directionalShadowMap.length,
      numPointLightShadows: lights.pointShadowMap.length,
      numSpotLightShadows: lights.spotShadowMap.length,
      numClippingPlanes: clipping.numPlanes,
      numClipIntersection: clipping.numIntersection,
      dithering: material.dithering,
      shadowMapEnabled: renderer.shadowMap.enabled && shadows.length > 0,
      shadowMapType: renderer.shadowMap.type,
      toneMapping: material.toneMapped ? renderer.toneMapping : NoToneMapping,
      physicallyCorrectLights: renderer.physicallyCorrectLights,
      premultipliedAlpha: material.premultipliedAlpha,
      doubleSided: material.side === DoubleSide,
      flipSided: material.side === BackSide,
      depthPacking: material.depthPacking !== void 0 ? material.depthPacking : false,
      index0AttributeName: material.index0AttributeName,
      extensionDerivatives: material.extensions && material.extensions.derivatives,
      extensionFragDepth: material.extensions && material.extensions.fragDepth,
      extensionDrawBuffers: material.extensions && material.extensions.drawBuffers,
      extensionShaderTextureLOD: material.extensions && material.extensions.shaderTextureLOD,
      rendererExtensionFragDepth: isWebGL2 || extensions2.has("EXT_frag_depth"),
      rendererExtensionDrawBuffers: isWebGL2 || extensions2.has("WEBGL_draw_buffers"),
      rendererExtensionShaderTextureLod: isWebGL2 || extensions2.has("EXT_shader_texture_lod"),
      customProgramCacheKey: material.customProgramCacheKey()
    };
    return parameters;
  }
  function getProgramCacheKey(parameters) {
    const array = [];
    if (parameters.shaderID) {
      array.push(parameters.shaderID);
    } else {
      array.push(parameters.customVertexShaderID);
      array.push(parameters.customFragmentShaderID);
    }
    if (parameters.defines !== void 0) {
      for (const name2 in parameters.defines) {
        array.push(name2);
        array.push(parameters.defines[name2]);
      }
    }
    if (parameters.isRawShaderMaterial === false) {
      getProgramCacheKeyParameters(array, parameters);
      getProgramCacheKeyBooleans(array, parameters);
      array.push(renderer.outputEncoding);
    }
    array.push(parameters.customProgramCacheKey);
    return array.join();
  }
  function getProgramCacheKeyParameters(array, parameters) {
    array.push(parameters.precision);
    array.push(parameters.outputEncoding);
    array.push(parameters.envMapMode);
    array.push(parameters.envMapCubeUVHeight);
    array.push(parameters.combine);
    array.push(parameters.vertexUvs);
    array.push(parameters.fogExp2);
    array.push(parameters.sizeAttenuation);
    array.push(parameters.maxBones);
    array.push(parameters.morphTargetsCount);
    array.push(parameters.morphAttributeCount);
    array.push(parameters.numDirLights);
    array.push(parameters.numPointLights);
    array.push(parameters.numSpotLights);
    array.push(parameters.numHemiLights);
    array.push(parameters.numRectAreaLights);
    array.push(parameters.numDirLightShadows);
    array.push(parameters.numPointLightShadows);
    array.push(parameters.numSpotLightShadows);
    array.push(parameters.shadowMapType);
    array.push(parameters.toneMapping);
    array.push(parameters.numClippingPlanes);
    array.push(parameters.numClipIntersection);
  }
  function getProgramCacheKeyBooleans(array, parameters) {
    _programLayers.disableAll();
    if (parameters.isWebGL2)
      _programLayers.enable(0);
    if (parameters.supportsVertexTextures)
      _programLayers.enable(1);
    if (parameters.instancing)
      _programLayers.enable(2);
    if (parameters.instancingColor)
      _programLayers.enable(3);
    if (parameters.map)
      _programLayers.enable(4);
    if (parameters.matcap)
      _programLayers.enable(5);
    if (parameters.envMap)
      _programLayers.enable(6);
    if (parameters.lightMap)
      _programLayers.enable(7);
    if (parameters.aoMap)
      _programLayers.enable(8);
    if (parameters.emissiveMap)
      _programLayers.enable(9);
    if (parameters.bumpMap)
      _programLayers.enable(10);
    if (parameters.normalMap)
      _programLayers.enable(11);
    if (parameters.objectSpaceNormalMap)
      _programLayers.enable(12);
    if (parameters.tangentSpaceNormalMap)
      _programLayers.enable(13);
    if (parameters.clearcoat)
      _programLayers.enable(14);
    if (parameters.clearcoatMap)
      _programLayers.enable(15);
    if (parameters.clearcoatRoughnessMap)
      _programLayers.enable(16);
    if (parameters.clearcoatNormalMap)
      _programLayers.enable(17);
    if (parameters.displacementMap)
      _programLayers.enable(18);
    if (parameters.specularMap)
      _programLayers.enable(19);
    if (parameters.roughnessMap)
      _programLayers.enable(20);
    if (parameters.metalnessMap)
      _programLayers.enable(21);
    if (parameters.gradientMap)
      _programLayers.enable(22);
    if (parameters.alphaMap)
      _programLayers.enable(23);
    if (parameters.alphaTest)
      _programLayers.enable(24);
    if (parameters.vertexColors)
      _programLayers.enable(25);
    if (parameters.vertexAlphas)
      _programLayers.enable(26);
    if (parameters.vertexUvs)
      _programLayers.enable(27);
    if (parameters.vertexTangents)
      _programLayers.enable(28);
    if (parameters.uvsVertexOnly)
      _programLayers.enable(29);
    if (parameters.fog)
      _programLayers.enable(30);
    array.push(_programLayers.mask);
    _programLayers.disableAll();
    if (parameters.useFog)
      _programLayers.enable(0);
    if (parameters.flatShading)
      _programLayers.enable(1);
    if (parameters.logarithmicDepthBuffer)
      _programLayers.enable(2);
    if (parameters.skinning)
      _programLayers.enable(3);
    if (parameters.useVertexTexture)
      _programLayers.enable(4);
    if (parameters.morphTargets)
      _programLayers.enable(5);
    if (parameters.morphNormals)
      _programLayers.enable(6);
    if (parameters.morphColors)
      _programLayers.enable(7);
    if (parameters.premultipliedAlpha)
      _programLayers.enable(8);
    if (parameters.shadowMapEnabled)
      _programLayers.enable(9);
    if (parameters.physicallyCorrectLights)
      _programLayers.enable(10);
    if (parameters.doubleSided)
      _programLayers.enable(11);
    if (parameters.flipSided)
      _programLayers.enable(12);
    if (parameters.depthPacking)
      _programLayers.enable(13);
    if (parameters.dithering)
      _programLayers.enable(14);
    if (parameters.specularIntensityMap)
      _programLayers.enable(15);
    if (parameters.specularColorMap)
      _programLayers.enable(16);
    if (parameters.transmission)
      _programLayers.enable(17);
    if (parameters.transmissionMap)
      _programLayers.enable(18);
    if (parameters.thicknessMap)
      _programLayers.enable(19);
    if (parameters.sheen)
      _programLayers.enable(20);
    if (parameters.sheenColorMap)
      _programLayers.enable(21);
    if (parameters.sheenRoughnessMap)
      _programLayers.enable(22);
    if (parameters.decodeVideoTexture)
      _programLayers.enable(23);
    if (parameters.opaque)
      _programLayers.enable(24);
    array.push(_programLayers.mask);
  }
  function getUniforms(material) {
    const shaderID = shaderIDs[material.type];
    let uniforms;
    if (shaderID) {
      const shader = ShaderLib[shaderID];
      uniforms = UniformsUtils.clone(shader.uniforms);
    } else {
      uniforms = material.uniforms;
    }
    return uniforms;
  }
  function acquireProgram(parameters, cacheKey) {
    let program;
    for (let p = 0, pl = programs.length; p < pl; p++) {
      const preexistingProgram = programs[p];
      if (preexistingProgram.cacheKey === cacheKey) {
        program = preexistingProgram;
        ++program.usedTimes;
        break;
      }
    }
    if (program === void 0) {
      program = new WebGLProgram(renderer, cacheKey, parameters, bindingStates);
      programs.push(program);
    }
    return program;
  }
  function releaseProgram(program) {
    if (--program.usedTimes === 0) {
      const i2 = programs.indexOf(program);
      programs[i2] = programs[programs.length - 1];
      programs.pop();
      program.destroy();
    }
  }
  function releaseShaderCache(material) {
    _customShaders.remove(material);
  }
  function dispose2() {
    _customShaders.dispose();
  }
  return {
    getParameters,
    getProgramCacheKey,
    getUniforms,
    acquireProgram,
    releaseProgram,
    releaseShaderCache,
    // Exposed for resource monitoring & error feedback via renderer.info:
    programs,
    dispose: dispose2
  };
}
function WebGLProperties() {
  let properties = /* @__PURE__ */ new WeakMap();
  function get3(object) {
    let map3 = properties.get(object);
    if (map3 === void 0) {
      map3 = {};
      properties.set(object, map3);
    }
    return map3;
  }
  function remove2(object) {
    properties.delete(object);
  }
  function update(object, key, value) {
    properties.get(object)[key] = value;
  }
  function dispose2() {
    properties = /* @__PURE__ */ new WeakMap();
  }
  return {
    get: get3,
    remove: remove2,
    update,
    dispose: dispose2
  };
}
function painterSortStable(a2, b) {
  if (a2.groupOrder !== b.groupOrder) {
    return a2.groupOrder - b.groupOrder;
  } else if (a2.renderOrder !== b.renderOrder) {
    return a2.renderOrder - b.renderOrder;
  } else if (a2.material.id !== b.material.id) {
    return a2.material.id - b.material.id;
  } else if (a2.z !== b.z) {
    return a2.z - b.z;
  } else {
    return a2.id - b.id;
  }
}
function reversePainterSortStable(a2, b) {
  if (a2.groupOrder !== b.groupOrder) {
    return a2.groupOrder - b.groupOrder;
  } else if (a2.renderOrder !== b.renderOrder) {
    return a2.renderOrder - b.renderOrder;
  } else if (a2.z !== b.z) {
    return b.z - a2.z;
  } else {
    return a2.id - b.id;
  }
}
function WebGLRenderList() {
  const renderItems = [];
  let renderItemsIndex = 0;
  const opaque = [];
  const transmissive = [];
  const transparent = [];
  function init() {
    renderItemsIndex = 0;
    opaque.length = 0;
    transmissive.length = 0;
    transparent.length = 0;
  }
  function getNextRenderItem(object, geometry, material, groupOrder, z, group) {
    let renderItem = renderItems[renderItemsIndex];
    if (renderItem === void 0) {
      renderItem = {
        id: object.id,
        object,
        geometry,
        material,
        groupOrder,
        renderOrder: object.renderOrder,
        z,
        group
      };
      renderItems[renderItemsIndex] = renderItem;
    } else {
      renderItem.id = object.id;
      renderItem.object = object;
      renderItem.geometry = geometry;
      renderItem.material = material;
      renderItem.groupOrder = groupOrder;
      renderItem.renderOrder = object.renderOrder;
      renderItem.z = z;
      renderItem.group = group;
    }
    renderItemsIndex++;
    return renderItem;
  }
  function push(object, geometry, material, groupOrder, z, group) {
    const renderItem = getNextRenderItem(object, geometry, material, groupOrder, z, group);
    if (material.transmission > 0) {
      transmissive.push(renderItem);
    } else if (material.transparent === true) {
      transparent.push(renderItem);
    } else {
      opaque.push(renderItem);
    }
  }
  function unshift(object, geometry, material, groupOrder, z, group) {
    const renderItem = getNextRenderItem(object, geometry, material, groupOrder, z, group);
    if (material.transmission > 0) {
      transmissive.unshift(renderItem);
    } else if (material.transparent === true) {
      transparent.unshift(renderItem);
    } else {
      opaque.unshift(renderItem);
    }
  }
  function sort(customOpaqueSort, customTransparentSort) {
    if (opaque.length > 1)
      opaque.sort(customOpaqueSort || painterSortStable);
    if (transmissive.length > 1)
      transmissive.sort(customTransparentSort || reversePainterSortStable);
    if (transparent.length > 1)
      transparent.sort(customTransparentSort || reversePainterSortStable);
  }
  function finish() {
    for (let i2 = renderItemsIndex, il = renderItems.length; i2 < il; i2++) {
      const renderItem = renderItems[i2];
      if (renderItem.id === null)
        break;
      renderItem.id = null;
      renderItem.object = null;
      renderItem.geometry = null;
      renderItem.material = null;
      renderItem.group = null;
    }
  }
  return {
    opaque,
    transmissive,
    transparent,
    init,
    push,
    unshift,
    finish,
    sort
  };
}
function WebGLRenderLists() {
  let lists = /* @__PURE__ */ new WeakMap();
  function get3(scene, renderCallDepth) {
    let list;
    if (lists.has(scene) === false) {
      list = new WebGLRenderList();
      lists.set(scene, [list]);
    } else {
      if (renderCallDepth >= lists.get(scene).length) {
        list = new WebGLRenderList();
        lists.get(scene).push(list);
      } else {
        list = lists.get(scene)[renderCallDepth];
      }
    }
    return list;
  }
  function dispose2() {
    lists = /* @__PURE__ */ new WeakMap();
  }
  return {
    get: get3,
    dispose: dispose2
  };
}
function UniformsCache() {
  const lights = {};
  return {
    get: function(light) {
      if (lights[light.id] !== void 0) {
        return lights[light.id];
      }
      let uniforms;
      switch (light.type) {
        case "DirectionalLight":
          uniforms = {
            direction: new Vector3(),
            color: new Color2()
          };
          break;
        case "SpotLight":
          uniforms = {
            position: new Vector3(),
            direction: new Vector3(),
            color: new Color2(),
            distance: 0,
            coneCos: 0,
            penumbraCos: 0,
            decay: 0
          };
          break;
        case "PointLight":
          uniforms = {
            position: new Vector3(),
            color: new Color2(),
            distance: 0,
            decay: 0
          };
          break;
        case "HemisphereLight":
          uniforms = {
            direction: new Vector3(),
            skyColor: new Color2(),
            groundColor: new Color2()
          };
          break;
        case "RectAreaLight":
          uniforms = {
            color: new Color2(),
            position: new Vector3(),
            halfWidth: new Vector3(),
            halfHeight: new Vector3()
          };
          break;
      }
      lights[light.id] = uniforms;
      return uniforms;
    }
  };
}
function ShadowUniformsCache() {
  const lights = {};
  return {
    get: function(light) {
      if (lights[light.id] !== void 0) {
        return lights[light.id];
      }
      let uniforms;
      switch (light.type) {
        case "DirectionalLight":
          uniforms = {
            shadowBias: 0,
            shadowNormalBias: 0,
            shadowRadius: 1,
            shadowMapSize: new Vector2()
          };
          break;
        case "SpotLight":
          uniforms = {
            shadowBias: 0,
            shadowNormalBias: 0,
            shadowRadius: 1,
            shadowMapSize: new Vector2()
          };
          break;
        case "PointLight":
          uniforms = {
            shadowBias: 0,
            shadowNormalBias: 0,
            shadowRadius: 1,
            shadowMapSize: new Vector2(),
            shadowCameraNear: 1,
            shadowCameraFar: 1e3
          };
          break;
      }
      lights[light.id] = uniforms;
      return uniforms;
    }
  };
}
var nextVersion = 0;
function shadowCastingLightsFirst(lightA, lightB) {
  return (lightB.castShadow ? 1 : 0) - (lightA.castShadow ? 1 : 0);
}
function WebGLLights(extensions2, capabilities) {
  const cache2 = new UniformsCache();
  const shadowCache = ShadowUniformsCache();
  const state = {
    version: 0,
    hash: {
      directionalLength: -1,
      pointLength: -1,
      spotLength: -1,
      rectAreaLength: -1,
      hemiLength: -1,
      numDirectionalShadows: -1,
      numPointShadows: -1,
      numSpotShadows: -1
    },
    ambient: [0, 0, 0],
    probe: [],
    directional: [],
    directionalShadow: [],
    directionalShadowMap: [],
    directionalShadowMatrix: [],
    spot: [],
    spotShadow: [],
    spotShadowMap: [],
    spotShadowMatrix: [],
    rectArea: [],
    rectAreaLTC1: null,
    rectAreaLTC2: null,
    point: [],
    pointShadow: [],
    pointShadowMap: [],
    pointShadowMatrix: [],
    hemi: []
  };
  for (let i2 = 0; i2 < 9; i2++)
    state.probe.push(new Vector3());
  const vector3 = new Vector3();
  const matrix4 = new Matrix4();
  const matrix42 = new Matrix4();
  function setup(lights, physicallyCorrectLights) {
    let r3 = 0, g = 0, b = 0;
    for (let i2 = 0; i2 < 9; i2++)
      state.probe[i2].set(0, 0, 0);
    let directionalLength = 0;
    let pointLength = 0;
    let spotLength = 0;
    let rectAreaLength = 0;
    let hemiLength = 0;
    let numDirectionalShadows = 0;
    let numPointShadows = 0;
    let numSpotShadows = 0;
    lights.sort(shadowCastingLightsFirst);
    const scaleFactor = physicallyCorrectLights !== true ? Math.PI : 1;
    for (let i2 = 0, l = lights.length; i2 < l; i2++) {
      const light = lights[i2];
      const color2 = light.color;
      const intensity = light.intensity;
      const distance = light.distance;
      const shadowMap = light.shadow && light.shadow.map ? light.shadow.map.texture : null;
      if (light.isAmbientLight) {
        r3 += color2.r * intensity * scaleFactor;
        g += color2.g * intensity * scaleFactor;
        b += color2.b * intensity * scaleFactor;
      } else if (light.isLightProbe) {
        for (let j = 0; j < 9; j++) {
          state.probe[j].addScaledVector(light.sh.coefficients[j], intensity);
        }
      } else if (light.isDirectionalLight) {
        const uniforms = cache2.get(light);
        uniforms.color.copy(light.color).multiplyScalar(light.intensity * scaleFactor);
        if (light.castShadow) {
          const shadow = light.shadow;
          const shadowUniforms = shadowCache.get(light);
          shadowUniforms.shadowBias = shadow.bias;
          shadowUniforms.shadowNormalBias = shadow.normalBias;
          shadowUniforms.shadowRadius = shadow.radius;
          shadowUniforms.shadowMapSize = shadow.mapSize;
          state.directionalShadow[directionalLength] = shadowUniforms;
          state.directionalShadowMap[directionalLength] = shadowMap;
          state.directionalShadowMatrix[directionalLength] = light.shadow.matrix;
          numDirectionalShadows++;
        }
        state.directional[directionalLength] = uniforms;
        directionalLength++;
      } else if (light.isSpotLight) {
        const uniforms = cache2.get(light);
        uniforms.position.setFromMatrixPosition(light.matrixWorld);
        uniforms.color.copy(color2).multiplyScalar(intensity * scaleFactor);
        uniforms.distance = distance;
        uniforms.coneCos = Math.cos(light.angle);
        uniforms.penumbraCos = Math.cos(light.angle * (1 - light.penumbra));
        uniforms.decay = light.decay;
        if (light.castShadow) {
          const shadow = light.shadow;
          const shadowUniforms = shadowCache.get(light);
          shadowUniforms.shadowBias = shadow.bias;
          shadowUniforms.shadowNormalBias = shadow.normalBias;
          shadowUniforms.shadowRadius = shadow.radius;
          shadowUniforms.shadowMapSize = shadow.mapSize;
          state.spotShadow[spotLength] = shadowUniforms;
          state.spotShadowMap[spotLength] = shadowMap;
          state.spotShadowMatrix[spotLength] = light.shadow.matrix;
          numSpotShadows++;
        }
        state.spot[spotLength] = uniforms;
        spotLength++;
      } else if (light.isRectAreaLight) {
        const uniforms = cache2.get(light);
        uniforms.color.copy(color2).multiplyScalar(intensity);
        uniforms.halfWidth.set(light.width * 0.5, 0, 0);
        uniforms.halfHeight.set(0, light.height * 0.5, 0);
        state.rectArea[rectAreaLength] = uniforms;
        rectAreaLength++;
      } else if (light.isPointLight) {
        const uniforms = cache2.get(light);
        uniforms.color.copy(light.color).multiplyScalar(light.intensity * scaleFactor);
        uniforms.distance = light.distance;
        uniforms.decay = light.decay;
        if (light.castShadow) {
          const shadow = light.shadow;
          const shadowUniforms = shadowCache.get(light);
          shadowUniforms.shadowBias = shadow.bias;
          shadowUniforms.shadowNormalBias = shadow.normalBias;
          shadowUniforms.shadowRadius = shadow.radius;
          shadowUniforms.shadowMapSize = shadow.mapSize;
          shadowUniforms.shadowCameraNear = shadow.camera.near;
          shadowUniforms.shadowCameraFar = shadow.camera.far;
          state.pointShadow[pointLength] = shadowUniforms;
          state.pointShadowMap[pointLength] = shadowMap;
          state.pointShadowMatrix[pointLength] = light.shadow.matrix;
          numPointShadows++;
        }
        state.point[pointLength] = uniforms;
        pointLength++;
      } else if (light.isHemisphereLight) {
        const uniforms = cache2.get(light);
        uniforms.skyColor.copy(light.color).multiplyScalar(intensity * scaleFactor);
        uniforms.groundColor.copy(light.groundColor).multiplyScalar(intensity * scaleFactor);
        state.hemi[hemiLength] = uniforms;
        hemiLength++;
      }
    }
    if (rectAreaLength > 0) {
      if (capabilities.isWebGL2) {
        state.rectAreaLTC1 = UniformsLib.LTC_FLOAT_1;
        state.rectAreaLTC2 = UniformsLib.LTC_FLOAT_2;
      } else {
        if (extensions2.has("OES_texture_float_linear") === true) {
          state.rectAreaLTC1 = UniformsLib.LTC_FLOAT_1;
          state.rectAreaLTC2 = UniformsLib.LTC_FLOAT_2;
        } else if (extensions2.has("OES_texture_half_float_linear") === true) {
          state.rectAreaLTC1 = UniformsLib.LTC_HALF_1;
          state.rectAreaLTC2 = UniformsLib.LTC_HALF_2;
        } else {
          console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.");
        }
      }
    }
    state.ambient[0] = r3;
    state.ambient[1] = g;
    state.ambient[2] = b;
    const hash3 = state.hash;
    if (hash3.directionalLength !== directionalLength || hash3.pointLength !== pointLength || hash3.spotLength !== spotLength || hash3.rectAreaLength !== rectAreaLength || hash3.hemiLength !== hemiLength || hash3.numDirectionalShadows !== numDirectionalShadows || hash3.numPointShadows !== numPointShadows || hash3.numSpotShadows !== numSpotShadows) {
      state.directional.length = directionalLength;
      state.spot.length = spotLength;
      state.rectArea.length = rectAreaLength;
      state.point.length = pointLength;
      state.hemi.length = hemiLength;
      state.directionalShadow.length = numDirectionalShadows;
      state.directionalShadowMap.length = numDirectionalShadows;
      state.pointShadow.length = numPointShadows;
      state.pointShadowMap.length = numPointShadows;
      state.spotShadow.length = numSpotShadows;
      state.spotShadowMap.length = numSpotShadows;
      state.directionalShadowMatrix.length = numDirectionalShadows;
      state.pointShadowMatrix.length = numPointShadows;
      state.spotShadowMatrix.length = numSpotShadows;
      hash3.directionalLength = directionalLength;
      hash3.pointLength = pointLength;
      hash3.spotLength = spotLength;
      hash3.rectAreaLength = rectAreaLength;
      hash3.hemiLength = hemiLength;
      hash3.numDirectionalShadows = numDirectionalShadows;
      hash3.numPointShadows = numPointShadows;
      hash3.numSpotShadows = numSpotShadows;
      state.version = nextVersion++;
    }
  }
  function setupView(lights, camera) {
    let directionalLength = 0;
    let pointLength = 0;
    let spotLength = 0;
    let rectAreaLength = 0;
    let hemiLength = 0;
    const viewMatrix = camera.matrixWorldInverse;
    for (let i2 = 0, l = lights.length; i2 < l; i2++) {
      const light = lights[i2];
      if (light.isDirectionalLight) {
        const uniforms = state.directional[directionalLength];
        uniforms.direction.setFromMatrixPosition(light.matrixWorld);
        vector3.setFromMatrixPosition(light.target.matrixWorld);
        uniforms.direction.sub(vector3);
        uniforms.direction.transformDirection(viewMatrix);
        directionalLength++;
      } else if (light.isSpotLight) {
        const uniforms = state.spot[spotLength];
        uniforms.position.setFromMatrixPosition(light.matrixWorld);
        uniforms.position.applyMatrix4(viewMatrix);
        uniforms.direction.setFromMatrixPosition(light.matrixWorld);
        vector3.setFromMatrixPosition(light.target.matrixWorld);
        uniforms.direction.sub(vector3);
        uniforms.direction.transformDirection(viewMatrix);
        spotLength++;
      } else if (light.isRectAreaLight) {
        const uniforms = state.rectArea[rectAreaLength];
        uniforms.position.setFromMatrixPosition(light.matrixWorld);
        uniforms.position.applyMatrix4(viewMatrix);
        matrix42.identity();
        matrix4.copy(light.matrixWorld);
        matrix4.premultiply(viewMatrix);
        matrix42.extractRotation(matrix4);
        uniforms.halfWidth.set(light.width * 0.5, 0, 0);
        uniforms.halfHeight.set(0, light.height * 0.5, 0);
        uniforms.halfWidth.applyMatrix4(matrix42);
        uniforms.halfHeight.applyMatrix4(matrix42);
        rectAreaLength++;
      } else if (light.isPointLight) {
        const uniforms = state.point[pointLength];
        uniforms.position.setFromMatrixPosition(light.matrixWorld);
        uniforms.position.applyMatrix4(viewMatrix);
        pointLength++;
      } else if (light.isHemisphereLight) {
        const uniforms = state.hemi[hemiLength];
        uniforms.direction.setFromMatrixPosition(light.matrixWorld);
        uniforms.direction.transformDirection(viewMatrix);
        uniforms.direction.normalize();
        hemiLength++;
      }
    }
  }
  return {
    setup,
    setupView,
    state
  };
}
function WebGLRenderState(extensions2, capabilities) {
  const lights = new WebGLLights(extensions2, capabilities);
  const lightsArray = [];
  const shadowsArray = [];
  function init() {
    lightsArray.length = 0;
    shadowsArray.length = 0;
  }
  function pushLight(light) {
    lightsArray.push(light);
  }
  function pushShadow(shadowLight) {
    shadowsArray.push(shadowLight);
  }
  function setupLights(physicallyCorrectLights) {
    lights.setup(lightsArray, physicallyCorrectLights);
  }
  function setupLightsView(camera) {
    lights.setupView(lightsArray, camera);
  }
  const state = {
    lightsArray,
    shadowsArray,
    lights
  };
  return {
    init,
    state,
    setupLights,
    setupLightsView,
    pushLight,
    pushShadow
  };
}
function WebGLRenderStates(extensions2, capabilities) {
  let renderStates = /* @__PURE__ */ new WeakMap();
  function get3(scene, renderCallDepth = 0) {
    let renderState;
    if (renderStates.has(scene) === false) {
      renderState = new WebGLRenderState(extensions2, capabilities);
      renderStates.set(scene, [renderState]);
    } else {
      if (renderCallDepth >= renderStates.get(scene).length) {
        renderState = new WebGLRenderState(extensions2, capabilities);
        renderStates.get(scene).push(renderState);
      } else {
        renderState = renderStates.get(scene)[renderCallDepth];
      }
    }
    return renderState;
  }
  function dispose2() {
    renderStates = /* @__PURE__ */ new WeakMap();
  }
  return {
    get: get3,
    dispose: dispose2
  };
}
var MeshDepthMaterial = class extends Material {
  constructor(parameters) {
    super();
    this.type = "MeshDepthMaterial";
    this.depthPacking = BasicDepthPacking;
    this.map = null;
    this.alphaMap = null;
    this.displacementMap = null;
    this.displacementScale = 1;
    this.displacementBias = 0;
    this.wireframe = false;
    this.wireframeLinewidth = 1;
    this.fog = false;
    this.setValues(parameters);
  }
  copy(source) {
    super.copy(source);
    this.depthPacking = source.depthPacking;
    this.map = source.map;
    this.alphaMap = source.alphaMap;
    this.displacementMap = source.displacementMap;
    this.displacementScale = source.displacementScale;
    this.displacementBias = source.displacementBias;
    this.wireframe = source.wireframe;
    this.wireframeLinewidth = source.wireframeLinewidth;
    return this;
  }
};
MeshDepthMaterial.prototype.isMeshDepthMaterial = true;
var MeshDistanceMaterial = class extends Material {
  constructor(parameters) {
    super();
    this.type = "MeshDistanceMaterial";
    this.referencePosition = new Vector3();
    this.nearDistance = 1;
    this.farDistance = 1e3;
    this.map = null;
    this.alphaMap = null;
    this.displacementMap = null;
    this.displacementScale = 1;
    this.displacementBias = 0;
    this.fog = false;
    this.setValues(parameters);
  }
  copy(source) {
    super.copy(source);
    this.referencePosition.copy(source.referencePosition);
    this.nearDistance = source.nearDistance;
    this.farDistance = source.farDistance;
    this.map = source.map;
    this.alphaMap = source.alphaMap;
    this.displacementMap = source.displacementMap;
    this.displacementScale = source.displacementScale;
    this.displacementBias = source.displacementBias;
    return this;
  }
};
MeshDistanceMaterial.prototype.isMeshDistanceMaterial = true;
var vertex = "void main() {\n	gl_Position = vec4( position, 1.0 );\n}";
var fragment = "uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include <packing>\nvoid main() {\n	const float samples = float( VSM_SAMPLES );\n	float mean = 0.0;\n	float squared_mean = 0.0;\n	float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\n	float uvStart = samples <= 1.0 ? 0.0 : - 1.0;\n	for ( float i = 0.0; i < samples; i ++ ) {\n		float uvOffset = uvStart + i * uvStride;\n		#ifdef HORIZONTAL_PASS\n			vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );\n			mean += distribution.x;\n			squared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n		#else\n			float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );\n			mean += depth;\n			squared_mean += depth * depth;\n		#endif\n	}\n	mean = mean / samples;\n	squared_mean = squared_mean / samples;\n	float std_dev = sqrt( squared_mean - mean * mean );\n	gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}";
function WebGLShadowMap(_renderer, _objects, _capabilities) {
  let _frustum = new Frustum();
  const _shadowMapSize = new Vector2(), _viewportSize = new Vector2(), _viewport = new Vector4(), _depthMaterial = new MeshDepthMaterial({ depthPacking: RGBADepthPacking }), _distanceMaterial = new MeshDistanceMaterial(), _materialCache = {}, _maxTextureSize = _capabilities.maxTextureSize;
  const shadowSide = { 0: BackSide, 1: FrontSide, 2: DoubleSide };
  const shadowMaterialVertical = new ShaderMaterial({
    defines: {
      VSM_SAMPLES: 8
    },
    uniforms: {
      shadow_pass: { value: null },
      resolution: { value: new Vector2() },
      radius: { value: 4 }
    },
    vertexShader: vertex,
    fragmentShader: fragment
  });
  const shadowMaterialHorizontal = shadowMaterialVertical.clone();
  shadowMaterialHorizontal.defines.HORIZONTAL_PASS = 1;
  const fullScreenTri = new BufferGeometry();
  fullScreenTri.setAttribute(
    "position",
    new BufferAttribute(
      new Float32Array([-1, -1, 0.5, 3, -1, 0.5, -1, 3, 0.5]),
      3
    )
  );
  const fullScreenMesh = new Mesh(fullScreenTri, shadowMaterialVertical);
  const scope = this;
  this.enabled = false;
  this.autoUpdate = true;
  this.needsUpdate = false;
  this.type = PCFShadowMap;
  this.render = function(lights, scene, camera) {
    if (scope.enabled === false)
      return;
    if (scope.autoUpdate === false && scope.needsUpdate === false)
      return;
    if (lights.length === 0)
      return;
    const currentRenderTarget = _renderer.getRenderTarget();
    const activeCubeFace = _renderer.getActiveCubeFace();
    const activeMipmapLevel = _renderer.getActiveMipmapLevel();
    const _state = _renderer.state;
    _state.setBlending(NoBlending);
    _state.buffers.color.setClear(1, 1, 1, 1);
    _state.buffers.depth.setTest(true);
    _state.setScissorTest(false);
    for (let i2 = 0, il = lights.length; i2 < il; i2++) {
      const light = lights[i2];
      const shadow = light.shadow;
      if (shadow === void 0) {
        console.warn("THREE.WebGLShadowMap:", light, "has no shadow.");
        continue;
      }
      if (shadow.autoUpdate === false && shadow.needsUpdate === false)
        continue;
      _shadowMapSize.copy(shadow.mapSize);
      const shadowFrameExtents = shadow.getFrameExtents();
      _shadowMapSize.multiply(shadowFrameExtents);
      _viewportSize.copy(shadow.mapSize);
      if (_shadowMapSize.x > _maxTextureSize || _shadowMapSize.y > _maxTextureSize) {
        if (_shadowMapSize.x > _maxTextureSize) {
          _viewportSize.x = Math.floor(_maxTextureSize / shadowFrameExtents.x);
          _shadowMapSize.x = _viewportSize.x * shadowFrameExtents.x;
          shadow.mapSize.x = _viewportSize.x;
        }
        if (_shadowMapSize.y > _maxTextureSize) {
          _viewportSize.y = Math.floor(_maxTextureSize / shadowFrameExtents.y);
          _shadowMapSize.y = _viewportSize.y * shadowFrameExtents.y;
          shadow.mapSize.y = _viewportSize.y;
        }
      }
      if (shadow.map === null && !shadow.isPointLightShadow && this.type === VSMShadowMap) {
        shadow.map = new WebGLRenderTarget(_shadowMapSize.x, _shadowMapSize.y);
        shadow.map.texture.name = light.name + ".shadowMap";
        shadow.mapPass = new WebGLRenderTarget(_shadowMapSize.x, _shadowMapSize.y);
        shadow.camera.updateProjectionMatrix();
      }
      if (shadow.map === null) {
        const pars = { minFilter: NearestFilter, magFilter: NearestFilter, format: RGBAFormat };
        shadow.map = new WebGLRenderTarget(_shadowMapSize.x, _shadowMapSize.y, pars);
        shadow.map.texture.name = light.name + ".shadowMap";
        shadow.camera.updateProjectionMatrix();
      }
      _renderer.setRenderTarget(shadow.map);
      _renderer.clear();
      const viewportCount = shadow.getViewportCount();
      for (let vp = 0; vp < viewportCount; vp++) {
        const viewport = shadow.getViewport(vp);
        _viewport.set(
          _viewportSize.x * viewport.x,
          _viewportSize.y * viewport.y,
          _viewportSize.x * viewport.z,
          _viewportSize.y * viewport.w
        );
        _state.viewport(_viewport);
        shadow.updateMatrices(light, vp);
        _frustum = shadow.getFrustum();
        renderObject(scene, camera, shadow.camera, light, this.type);
      }
      if (!shadow.isPointLightShadow && this.type === VSMShadowMap) {
        VSMPass(shadow, camera);
      }
      shadow.needsUpdate = false;
    }
    scope.needsUpdate = false;
    _renderer.setRenderTarget(currentRenderTarget, activeCubeFace, activeMipmapLevel);
  };
  function VSMPass(shadow, camera) {
    const geometry = _objects.update(fullScreenMesh);
    if (shadowMaterialVertical.defines.VSM_SAMPLES !== shadow.blurSamples) {
      shadowMaterialVertical.defines.VSM_SAMPLES = shadow.blurSamples;
      shadowMaterialHorizontal.defines.VSM_SAMPLES = shadow.blurSamples;
      shadowMaterialVertical.needsUpdate = true;
      shadowMaterialHorizontal.needsUpdate = true;
    }
    shadowMaterialVertical.uniforms.shadow_pass.value = shadow.map.texture;
    shadowMaterialVertical.uniforms.resolution.value = shadow.mapSize;
    shadowMaterialVertical.uniforms.radius.value = shadow.radius;
    _renderer.setRenderTarget(shadow.mapPass);
    _renderer.clear();
    _renderer.renderBufferDirect(camera, null, geometry, shadowMaterialVertical, fullScreenMesh, null);
    shadowMaterialHorizontal.uniforms.shadow_pass.value = shadow.mapPass.texture;
    shadowMaterialHorizontal.uniforms.resolution.value = shadow.mapSize;
    shadowMaterialHorizontal.uniforms.radius.value = shadow.radius;
    _renderer.setRenderTarget(shadow.map);
    _renderer.clear();
    _renderer.renderBufferDirect(camera, null, geometry, shadowMaterialHorizontal, fullScreenMesh, null);
  }
  function getDepthMaterial(object, material, light, shadowCameraNear, shadowCameraFar, type) {
    let result = null;
    const customMaterial = light.isPointLight === true ? object.customDistanceMaterial : object.customDepthMaterial;
    if (customMaterial !== void 0) {
      result = customMaterial;
    } else {
      result = light.isPointLight === true ? _distanceMaterial : _depthMaterial;
    }
    if (_renderer.localClippingEnabled && material.clipShadows === true && material.clippingPlanes.length !== 0 || material.displacementMap && material.displacementScale !== 0 || material.alphaMap && material.alphaTest > 0) {
      const keyA = result.uuid, keyB = material.uuid;
      let materialsForVariant = _materialCache[keyA];
      if (materialsForVariant === void 0) {
        materialsForVariant = {};
        _materialCache[keyA] = materialsForVariant;
      }
      let cachedMaterial = materialsForVariant[keyB];
      if (cachedMaterial === void 0) {
        cachedMaterial = result.clone();
        materialsForVariant[keyB] = cachedMaterial;
      }
      result = cachedMaterial;
    }
    result.visible = material.visible;
    result.wireframe = material.wireframe;
    if (type === VSMShadowMap) {
      result.side = material.shadowSide !== null ? material.shadowSide : material.side;
    } else {
      result.side = material.shadowSide !== null ? material.shadowSide : shadowSide[material.side];
    }
    result.alphaMap = material.alphaMap;
    result.alphaTest = material.alphaTest;
    result.clipShadows = material.clipShadows;
    result.clippingPlanes = material.clippingPlanes;
    result.clipIntersection = material.clipIntersection;
    result.displacementMap = material.displacementMap;
    result.displacementScale = material.displacementScale;
    result.displacementBias = material.displacementBias;
    result.wireframeLinewidth = material.wireframeLinewidth;
    result.linewidth = material.linewidth;
    if (light.isPointLight === true && result.isMeshDistanceMaterial === true) {
      result.referencePosition.setFromMatrixPosition(light.matrixWorld);
      result.nearDistance = shadowCameraNear;
      result.farDistance = shadowCameraFar;
    }
    return result;
  }
  function renderObject(object, camera, shadowCamera, light, type) {
    if (object.visible === false)
      return;
    const visible = object.layers.test(camera.layers);
    if (visible && (object.isMesh || object.isLine || object.isPoints)) {
      if ((object.castShadow || object.receiveShadow && type === VSMShadowMap) && (!object.frustumCulled || _frustum.intersectsObject(object))) {
        object.modelViewMatrix.multiplyMatrices(shadowCamera.matrixWorldInverse, object.matrixWorld);
        const geometry = _objects.update(object);
        const material = object.material;
        if (Array.isArray(material)) {
          const groups = geometry.groups;
          for (let k2 = 0, kl = groups.length; k2 < kl; k2++) {
            const group = groups[k2];
            const groupMaterial = material[group.materialIndex];
            if (groupMaterial && groupMaterial.visible) {
              const depthMaterial = getDepthMaterial(object, groupMaterial, light, shadowCamera.near, shadowCamera.far, type);
              _renderer.renderBufferDirect(shadowCamera, null, geometry, depthMaterial, object, group);
            }
          }
        } else if (material.visible) {
          const depthMaterial = getDepthMaterial(object, material, light, shadowCamera.near, shadowCamera.far, type);
          _renderer.renderBufferDirect(shadowCamera, null, geometry, depthMaterial, object, null);
        }
      }
    }
    const children = object.children;
    for (let i2 = 0, l = children.length; i2 < l; i2++) {
      renderObject(children[i2], camera, shadowCamera, light, type);
    }
  }
}
function WebGLState(gl, extensions2, capabilities) {
  const isWebGL2 = capabilities.isWebGL2;
  function ColorBuffer() {
    let locked = false;
    const color2 = new Vector4();
    let currentColorMask = null;
    const currentColorClear = new Vector4(0, 0, 0, 0);
    return {
      setMask: function(colorMask) {
        if (currentColorMask !== colorMask && !locked) {
          gl.colorMask(colorMask, colorMask, colorMask, colorMask);
          currentColorMask = colorMask;
        }
      },
      setLocked: function(lock) {
        locked = lock;
      },
      setClear: function(r3, g, b, a2, premultipliedAlpha) {
        if (premultipliedAlpha === true) {
          r3 *= a2;
          g *= a2;
          b *= a2;
        }
        color2.set(r3, g, b, a2);
        if (currentColorClear.equals(color2) === false) {
          gl.clearColor(r3, g, b, a2);
          currentColorClear.copy(color2);
        }
      },
      reset: function() {
        locked = false;
        currentColorMask = null;
        currentColorClear.set(-1, 0, 0, 0);
      }
    };
  }
  function DepthBuffer() {
    let locked = false;
    let currentDepthMask = null;
    let currentDepthFunc = null;
    let currentDepthClear = null;
    return {
      setTest: function(depthTest) {
        if (depthTest) {
          enable(2929);
        } else {
          disable(2929);
        }
      },
      setMask: function(depthMask) {
        if (currentDepthMask !== depthMask && !locked) {
          gl.depthMask(depthMask);
          currentDepthMask = depthMask;
        }
      },
      setFunc: function(depthFunc) {
        if (currentDepthFunc !== depthFunc) {
          if (depthFunc) {
            switch (depthFunc) {
              case NeverDepth:
                gl.depthFunc(512);
                break;
              case AlwaysDepth:
                gl.depthFunc(519);
                break;
              case LessDepth:
                gl.depthFunc(513);
                break;
              case LessEqualDepth:
                gl.depthFunc(515);
                break;
              case EqualDepth:
                gl.depthFunc(514);
                break;
              case GreaterEqualDepth:
                gl.depthFunc(518);
                break;
              case GreaterDepth:
                gl.depthFunc(516);
                break;
              case NotEqualDepth:
                gl.depthFunc(517);
                break;
              default:
                gl.depthFunc(515);
            }
          } else {
            gl.depthFunc(515);
          }
          currentDepthFunc = depthFunc;
        }
      },
      setLocked: function(lock) {
        locked = lock;
      },
      setClear: function(depth) {
        if (currentDepthClear !== depth) {
          gl.clearDepth(depth);
          currentDepthClear = depth;
        }
      },
      reset: function() {
        locked = false;
        currentDepthMask = null;
        currentDepthFunc = null;
        currentDepthClear = null;
      }
    };
  }
  function StencilBuffer() {
    let locked = false;
    let currentStencilMask = null;
    let currentStencilFunc = null;
    let currentStencilRef = null;
    let currentStencilFuncMask = null;
    let currentStencilFail = null;
    let currentStencilZFail = null;
    let currentStencilZPass = null;
    let currentStencilClear = null;
    return {
      setTest: function(stencilTest) {
        if (!locked) {
          if (stencilTest) {
            enable(2960);
          } else {
            disable(2960);
          }
        }
      },
      setMask: function(stencilMask) {
        if (currentStencilMask !== stencilMask && !locked) {
          gl.stencilMask(stencilMask);
          currentStencilMask = stencilMask;
        }
      },
      setFunc: function(stencilFunc, stencilRef, stencilMask) {
        if (currentStencilFunc !== stencilFunc || currentStencilRef !== stencilRef || currentStencilFuncMask !== stencilMask) {
          gl.stencilFunc(stencilFunc, stencilRef, stencilMask);
          currentStencilFunc = stencilFunc;
          currentStencilRef = stencilRef;
          currentStencilFuncMask = stencilMask;
        }
      },
      setOp: function(stencilFail, stencilZFail, stencilZPass) {
        if (currentStencilFail !== stencilFail || currentStencilZFail !== stencilZFail || currentStencilZPass !== stencilZPass) {
          gl.stencilOp(stencilFail, stencilZFail, stencilZPass);
          currentStencilFail = stencilFail;
          currentStencilZFail = stencilZFail;
          currentStencilZPass = stencilZPass;
        }
      },
      setLocked: function(lock) {
        locked = lock;
      },
      setClear: function(stencil) {
        if (currentStencilClear !== stencil) {
          gl.clearStencil(stencil);
          currentStencilClear = stencil;
        }
      },
      reset: function() {
        locked = false;
        currentStencilMask = null;
        currentStencilFunc = null;
        currentStencilRef = null;
        currentStencilFuncMask = null;
        currentStencilFail = null;
        currentStencilZFail = null;
        currentStencilZPass = null;
        currentStencilClear = null;
      }
    };
  }
  const colorBuffer = new ColorBuffer();
  const depthBuffer = new DepthBuffer();
  const stencilBuffer = new StencilBuffer();
  let enabledCapabilities = {};
  let currentBoundFramebuffers = {};
  let currentDrawbuffers = /* @__PURE__ */ new WeakMap();
  let defaultDrawbuffers = [];
  let currentProgram = null;
  let currentBlendingEnabled = false;
  let currentBlending = null;
  let currentBlendEquation = null;
  let currentBlendSrc = null;
  let currentBlendDst = null;
  let currentBlendEquationAlpha = null;
  let currentBlendSrcAlpha = null;
  let currentBlendDstAlpha = null;
  let currentPremultipledAlpha = false;
  let currentFlipSided = null;
  let currentCullFace = null;
  let currentLineWidth = null;
  let currentPolygonOffsetFactor = null;
  let currentPolygonOffsetUnits = null;
  const maxTextures = gl.getParameter(35661);
  let lineWidthAvailable = false;
  let version = 0;
  const glVersion = gl.getParameter(7938);
  if (glVersion.indexOf("WebGL") !== -1) {
    version = parseFloat(/^WebGL (\d)/.exec(glVersion)[1]);
    lineWidthAvailable = version >= 1;
  } else if (glVersion.indexOf("OpenGL ES") !== -1) {
    version = parseFloat(/^OpenGL ES (\d)/.exec(glVersion)[1]);
    lineWidthAvailable = version >= 2;
  }
  let currentTextureSlot = null;
  let currentBoundTextures = {};
  const scissorParam = gl.getParameter(3088);
  const viewportParam = gl.getParameter(2978);
  const currentScissor = new Vector4().fromArray(scissorParam);
  const currentViewport = new Vector4().fromArray(viewportParam);
  function createTexture(type, target, count2) {
    const data = new Uint8Array(4);
    const texture = gl.createTexture();
    gl.bindTexture(type, texture);
    gl.texParameteri(type, 10241, 9728);
    gl.texParameteri(type, 10240, 9728);
    for (let i2 = 0; i2 < count2; i2++) {
      gl.texImage2D(target + i2, 0, 6408, 1, 1, 0, 6408, 5121, data);
    }
    return texture;
  }
  const emptyTextures = {};
  emptyTextures[3553] = createTexture(3553, 3553, 1);
  emptyTextures[34067] = createTexture(34067, 34069, 6);
  colorBuffer.setClear(0, 0, 0, 1);
  depthBuffer.setClear(1);
  stencilBuffer.setClear(0);
  enable(2929);
  depthBuffer.setFunc(LessEqualDepth);
  setFlipSided(false);
  setCullFace(CullFaceBack);
  enable(2884);
  setBlending(NoBlending);
  function enable(id2) {
    if (enabledCapabilities[id2] !== true) {
      gl.enable(id2);
      enabledCapabilities[id2] = true;
    }
  }
  function disable(id2) {
    if (enabledCapabilities[id2] !== false) {
      gl.disable(id2);
      enabledCapabilities[id2] = false;
    }
  }
  function bindFramebuffer(target, framebuffer) {
    if (currentBoundFramebuffers[target] !== framebuffer) {
      gl.bindFramebuffer(target, framebuffer);
      currentBoundFramebuffers[target] = framebuffer;
      if (isWebGL2) {
        if (target === 36009) {
          currentBoundFramebuffers[36160] = framebuffer;
        }
        if (target === 36160) {
          currentBoundFramebuffers[36009] = framebuffer;
        }
      }
      return true;
    }
    return false;
  }
  function drawBuffers(renderTarget, framebuffer) {
    let drawBuffers2 = defaultDrawbuffers;
    let needsUpdate = false;
    if (renderTarget) {
      drawBuffers2 = currentDrawbuffers.get(framebuffer);
      if (drawBuffers2 === void 0) {
        drawBuffers2 = [];
        currentDrawbuffers.set(framebuffer, drawBuffers2);
      }
      if (renderTarget.isWebGLMultipleRenderTargets) {
        const textures = renderTarget.texture;
        if (drawBuffers2.length !== textures.length || drawBuffers2[0] !== 36064) {
          for (let i2 = 0, il = textures.length; i2 < il; i2++) {
            drawBuffers2[i2] = 36064 + i2;
          }
          drawBuffers2.length = textures.length;
          needsUpdate = true;
        }
      } else {
        if (drawBuffers2[0] !== 36064) {
          drawBuffers2[0] = 36064;
          needsUpdate = true;
        }
      }
    } else {
      if (drawBuffers2[0] !== 1029) {
        drawBuffers2[0] = 1029;
        needsUpdate = true;
      }
    }
    if (needsUpdate) {
      if (capabilities.isWebGL2) {
        gl.drawBuffers(drawBuffers2);
      } else {
        extensions2.get("WEBGL_draw_buffers").drawBuffersWEBGL(drawBuffers2);
      }
    }
  }
  function useProgram(program) {
    if (currentProgram !== program) {
      gl.useProgram(program);
      currentProgram = program;
      return true;
    }
    return false;
  }
  const equationToGL = {
    [AddEquation]: 32774,
    [SubtractEquation]: 32778,
    [ReverseSubtractEquation]: 32779
  };
  if (isWebGL2) {
    equationToGL[MinEquation] = 32775;
    equationToGL[MaxEquation] = 32776;
  } else {
    const extension = extensions2.get("EXT_blend_minmax");
    if (extension !== null) {
      equationToGL[MinEquation] = extension.MIN_EXT;
      equationToGL[MaxEquation] = extension.MAX_EXT;
    }
  }
  const factorToGL = {
    [ZeroFactor]: 0,
    [OneFactor]: 1,
    [SrcColorFactor]: 768,
    [SrcAlphaFactor]: 770,
    [SrcAlphaSaturateFactor]: 776,
    [DstColorFactor]: 774,
    [DstAlphaFactor]: 772,
    [OneMinusSrcColorFactor]: 769,
    [OneMinusSrcAlphaFactor]: 771,
    [OneMinusDstColorFactor]: 775,
    [OneMinusDstAlphaFactor]: 773
  };
  function setBlending(blending, blendEquation, blendSrc, blendDst, blendEquationAlpha, blendSrcAlpha, blendDstAlpha, premultipliedAlpha) {
    if (blending === NoBlending) {
      if (currentBlendingEnabled === true) {
        disable(3042);
        currentBlendingEnabled = false;
      }
      return;
    }
    if (currentBlendingEnabled === false) {
      enable(3042);
      currentBlendingEnabled = true;
    }
    if (blending !== CustomBlending) {
      if (blending !== currentBlending || premultipliedAlpha !== currentPremultipledAlpha) {
        if (currentBlendEquation !== AddEquation || currentBlendEquationAlpha !== AddEquation) {
          gl.blendEquation(32774);
          currentBlendEquation = AddEquation;
          currentBlendEquationAlpha = AddEquation;
        }
        if (premultipliedAlpha) {
          switch (blending) {
            case NormalBlending:
              gl.blendFuncSeparate(1, 771, 1, 771);
              break;
            case AdditiveBlending:
              gl.blendFunc(1, 1);
              break;
            case SubtractiveBlending:
              gl.blendFuncSeparate(0, 769, 0, 1);
              break;
            case MultiplyBlending:
              gl.blendFuncSeparate(0, 768, 0, 770);
              break;
            default:
              console.error("THREE.WebGLState: Invalid blending: ", blending);
              break;
          }
        } else {
          switch (blending) {
            case NormalBlending:
              gl.blendFuncSeparate(770, 771, 1, 771);
              break;
            case AdditiveBlending:
              gl.blendFunc(770, 1);
              break;
            case SubtractiveBlending:
              gl.blendFuncSeparate(0, 769, 0, 1);
              break;
            case MultiplyBlending:
              gl.blendFunc(0, 768);
              break;
            default:
              console.error("THREE.WebGLState: Invalid blending: ", blending);
              break;
          }
        }
        currentBlendSrc = null;
        currentBlendDst = null;
        currentBlendSrcAlpha = null;
        currentBlendDstAlpha = null;
        currentBlending = blending;
        currentPremultipledAlpha = premultipliedAlpha;
      }
      return;
    }
    blendEquationAlpha = blendEquationAlpha || blendEquation;
    blendSrcAlpha = blendSrcAlpha || blendSrc;
    blendDstAlpha = blendDstAlpha || blendDst;
    if (blendEquation !== currentBlendEquation || blendEquationAlpha !== currentBlendEquationAlpha) {
      gl.blendEquationSeparate(equationToGL[blendEquation], equationToGL[blendEquationAlpha]);
      currentBlendEquation = blendEquation;
      currentBlendEquationAlpha = blendEquationAlpha;
    }
    if (blendSrc !== currentBlendSrc || blendDst !== currentBlendDst || blendSrcAlpha !== currentBlendSrcAlpha || blendDstAlpha !== currentBlendDstAlpha) {
      gl.blendFuncSeparate(factorToGL[blendSrc], factorToGL[blendDst], factorToGL[blendSrcAlpha], factorToGL[blendDstAlpha]);
      currentBlendSrc = blendSrc;
      currentBlendDst = blendDst;
      currentBlendSrcAlpha = blendSrcAlpha;
      currentBlendDstAlpha = blendDstAlpha;
    }
    currentBlending = blending;
    currentPremultipledAlpha = null;
  }
  function setMaterial(material, frontFaceCW) {
    material.side === DoubleSide ? disable(2884) : enable(2884);
    let flipSided = material.side === BackSide;
    if (frontFaceCW)
      flipSided = !flipSided;
    setFlipSided(flipSided);
    material.blending === NormalBlending && material.transparent === false ? setBlending(NoBlending) : setBlending(material.blending, material.blendEquation, material.blendSrc, material.blendDst, material.blendEquationAlpha, material.blendSrcAlpha, material.blendDstAlpha, material.premultipliedAlpha);
    depthBuffer.setFunc(material.depthFunc);
    depthBuffer.setTest(material.depthTest);
    depthBuffer.setMask(material.depthWrite);
    colorBuffer.setMask(material.colorWrite);
    const stencilWrite = material.stencilWrite;
    stencilBuffer.setTest(stencilWrite);
    if (stencilWrite) {
      stencilBuffer.setMask(material.stencilWriteMask);
      stencilBuffer.setFunc(material.stencilFunc, material.stencilRef, material.stencilFuncMask);
      stencilBuffer.setOp(material.stencilFail, material.stencilZFail, material.stencilZPass);
    }
    setPolygonOffset(material.polygonOffset, material.polygonOffsetFactor, material.polygonOffsetUnits);
    material.alphaToCoverage === true ? enable(32926) : disable(32926);
  }
  function setFlipSided(flipSided) {
    if (currentFlipSided !== flipSided) {
      if (flipSided) {
        gl.frontFace(2304);
      } else {
        gl.frontFace(2305);
      }
      currentFlipSided = flipSided;
    }
  }
  function setCullFace(cullFace) {
    if (cullFace !== CullFaceNone) {
      enable(2884);
      if (cullFace !== currentCullFace) {
        if (cullFace === CullFaceBack) {
          gl.cullFace(1029);
        } else if (cullFace === CullFaceFront) {
          gl.cullFace(1028);
        } else {
          gl.cullFace(1032);
        }
      }
    } else {
      disable(2884);
    }
    currentCullFace = cullFace;
  }
  function setLineWidth(width) {
    if (width !== currentLineWidth) {
      if (lineWidthAvailable)
        gl.lineWidth(width);
      currentLineWidth = width;
    }
  }
  function setPolygonOffset(polygonOffset, factor, units) {
    if (polygonOffset) {
      enable(32823);
      if (currentPolygonOffsetFactor !== factor || currentPolygonOffsetUnits !== units) {
        gl.polygonOffset(factor, units);
        currentPolygonOffsetFactor = factor;
        currentPolygonOffsetUnits = units;
      }
    } else {
      disable(32823);
    }
  }
  function setScissorTest(scissorTest) {
    if (scissorTest) {
      enable(3089);
    } else {
      disable(3089);
    }
  }
  function activeTexture(webglSlot) {
    if (webglSlot === void 0)
      webglSlot = 33984 + maxTextures - 1;
    if (currentTextureSlot !== webglSlot) {
      gl.activeTexture(webglSlot);
      currentTextureSlot = webglSlot;
    }
  }
  function bindTexture(webglType, webglTexture) {
    if (currentTextureSlot === null) {
      activeTexture();
    }
    let boundTexture = currentBoundTextures[currentTextureSlot];
    if (boundTexture === void 0) {
      boundTexture = { type: void 0, texture: void 0 };
      currentBoundTextures[currentTextureSlot] = boundTexture;
    }
    if (boundTexture.type !== webglType || boundTexture.texture !== webglTexture) {
      gl.bindTexture(webglType, webglTexture || emptyTextures[webglType]);
      boundTexture.type = webglType;
      boundTexture.texture = webglTexture;
    }
  }
  function unbindTexture() {
    const boundTexture = currentBoundTextures[currentTextureSlot];
    if (boundTexture !== void 0 && boundTexture.type !== void 0) {
      gl.bindTexture(boundTexture.type, null);
      boundTexture.type = void 0;
      boundTexture.texture = void 0;
    }
  }
  function compressedTexImage2D() {
    try {
      gl.compressedTexImage2D.apply(gl, arguments);
    } catch (error) {
      console.error("THREE.WebGLState:", error);
    }
  }
  function texSubImage2D() {
    try {
      gl.texSubImage2D.apply(gl, arguments);
    } catch (error) {
      console.error("THREE.WebGLState:", error);
    }
  }
  function texSubImage3D() {
    try {
      gl.texSubImage3D.apply(gl, arguments);
    } catch (error) {
      console.error("THREE.WebGLState:", error);
    }
  }
  function compressedTexSubImage2D() {
    try {
      gl.compressedTexSubImage2D.apply(gl, arguments);
    } catch (error) {
      console.error("THREE.WebGLState:", error);
    }
  }
  function texStorage2D() {
    try {
      gl.texStorage2D.apply(gl, arguments);
    } catch (error) {
      console.error("THREE.WebGLState:", error);
    }
  }
  function texStorage3D() {
    try {
      gl.texStorage3D.apply(gl, arguments);
    } catch (error) {
      console.error("THREE.WebGLState:", error);
    }
  }
  function texImage2D() {
    try {
      gl.texImage2D.apply(gl, arguments);
    } catch (error) {
      console.error("THREE.WebGLState:", error);
    }
  }
  function texImage3D() {
    try {
      gl.texImage3D.apply(gl, arguments);
    } catch (error) {
      console.error("THREE.WebGLState:", error);
    }
  }
  function scissor(scissor2) {
    if (currentScissor.equals(scissor2) === false) {
      gl.scissor(scissor2.x, scissor2.y, scissor2.z, scissor2.w);
      currentScissor.copy(scissor2);
    }
  }
  function viewport(viewport2) {
    if (currentViewport.equals(viewport2) === false) {
      gl.viewport(viewport2.x, viewport2.y, viewport2.z, viewport2.w);
      currentViewport.copy(viewport2);
    }
  }
  function reset() {
    gl.disable(3042);
    gl.disable(2884);
    gl.disable(2929);
    gl.disable(32823);
    gl.disable(3089);
    gl.disable(2960);
    gl.disable(32926);
    gl.blendEquation(32774);
    gl.blendFunc(1, 0);
    gl.blendFuncSeparate(1, 0, 1, 0);
    gl.colorMask(true, true, true, true);
    gl.clearColor(0, 0, 0, 0);
    gl.depthMask(true);
    gl.depthFunc(513);
    gl.clearDepth(1);
    gl.stencilMask(4294967295);
    gl.stencilFunc(519, 0, 4294967295);
    gl.stencilOp(7680, 7680, 7680);
    gl.clearStencil(0);
    gl.cullFace(1029);
    gl.frontFace(2305);
    gl.polygonOffset(0, 0);
    gl.activeTexture(33984);
    gl.bindFramebuffer(36160, null);
    if (isWebGL2 === true) {
      gl.bindFramebuffer(36009, null);
      gl.bindFramebuffer(36008, null);
    }
    gl.useProgram(null);
    gl.lineWidth(1);
    gl.scissor(0, 0, gl.canvas.width, gl.canvas.height);
    gl.viewport(0, 0, gl.canvas.width, gl.canvas.height);
    enabledCapabilities = {};
    currentTextureSlot = null;
    currentBoundTextures = {};
    currentBoundFramebuffers = {};
    currentDrawbuffers = /* @__PURE__ */ new WeakMap();
    defaultDrawbuffers = [];
    currentProgram = null;
    currentBlendingEnabled = false;
    currentBlending = null;
    currentBlendEquation = null;
    currentBlendSrc = null;
    currentBlendDst = null;
    currentBlendEquationAlpha = null;
    currentBlendSrcAlpha = null;
    currentBlendDstAlpha = null;
    currentPremultipledAlpha = false;
    currentFlipSided = null;
    currentCullFace = null;
    currentLineWidth = null;
    currentPolygonOffsetFactor = null;
    currentPolygonOffsetUnits = null;
    currentScissor.set(0, 0, gl.canvas.width, gl.canvas.height);
    currentViewport.set(0, 0, gl.canvas.width, gl.canvas.height);
    colorBuffer.reset();
    depthBuffer.reset();
    stencilBuffer.reset();
  }
  return {
    buffers: {
      color: colorBuffer,
      depth: depthBuffer,
      stencil: stencilBuffer
    },
    enable,
    disable,
    bindFramebuffer,
    drawBuffers,
    useProgram,
    setBlending,
    setMaterial,
    setFlipSided,
    setCullFace,
    setLineWidth,
    setPolygonOffset,
    setScissorTest,
    activeTexture,
    bindTexture,
    unbindTexture,
    compressedTexImage2D,
    texImage2D,
    texImage3D,
    texStorage2D,
    texStorage3D,
    texSubImage2D,
    texSubImage3D,
    compressedTexSubImage2D,
    scissor,
    viewport,
    reset
  };
}
function WebGLTextures(_gl, extensions2, state, properties, capabilities, utils, info) {
  const isWebGL2 = capabilities.isWebGL2;
  const maxTextures = capabilities.maxTextures;
  const maxCubemapSize = capabilities.maxCubemapSize;
  const maxTextureSize = capabilities.maxTextureSize;
  const maxSamples = capabilities.maxSamples;
  const multisampledRTTExt = extensions2.has("WEBGL_multisampled_render_to_texture") ? extensions2.get("WEBGL_multisampled_render_to_texture") : null;
  const supportsInvalidateFramebuffer = /OculusBrowser/g.test(navigator.userAgent);
  const _videoTextures = /* @__PURE__ */ new WeakMap();
  let _canvas2;
  const _sources = /* @__PURE__ */ new WeakMap();
  let useOffscreenCanvas = false;
  try {
    useOffscreenCanvas = typeof OffscreenCanvas !== "undefined" && new OffscreenCanvas(1, 1).getContext("2d") !== null;
  } catch (err) {
  }
  function createCanvas(width, height) {
    return useOffscreenCanvas ? (
      // eslint-disable-next-line compat/compat
      new OffscreenCanvas(width, height)
    ) : createElementNS("canvas");
  }
  function resizeImage(image, needsPowerOfTwo, needsNewCanvas, maxSize) {
    let scale = 1;
    if (image.width > maxSize || image.height > maxSize) {
      scale = maxSize / Math.max(image.width, image.height);
    }
    if (scale < 1 || needsPowerOfTwo === true) {
      if (typeof HTMLImageElement !== "undefined" && image instanceof HTMLImageElement || typeof HTMLCanvasElement !== "undefined" && image instanceof HTMLCanvasElement || typeof ImageBitmap !== "undefined" && image instanceof ImageBitmap) {
        const floor = needsPowerOfTwo ? floorPowerOfTwo : Math.floor;
        const width = floor(scale * image.width);
        const height = floor(scale * image.height);
        if (_canvas2 === void 0)
          _canvas2 = createCanvas(width, height);
        const canvas = needsNewCanvas ? createCanvas(width, height) : _canvas2;
        canvas.width = width;
        canvas.height = height;
        const context2 = canvas.getContext("2d");
        context2.drawImage(image, 0, 0, width, height);
        console.warn("THREE.WebGLRenderer: Texture has been resized from (" + image.width + "x" + image.height + ") to (" + width + "x" + height + ").");
        return canvas;
      } else {
        if ("data" in image) {
          console.warn("THREE.WebGLRenderer: Image in DataTexture is too big (" + image.width + "x" + image.height + ").");
        }
        return image;
      }
    }
    return image;
  }
  function isPowerOfTwo$1(image) {
    return isPowerOfTwo(image.width) && isPowerOfTwo(image.height);
  }
  function textureNeedsPowerOfTwo(texture) {
    if (isWebGL2)
      return false;
    return texture.wrapS !== ClampToEdgeWrapping || texture.wrapT !== ClampToEdgeWrapping || texture.minFilter !== NearestFilter && texture.minFilter !== LinearFilter;
  }
  function textureNeedsGenerateMipmaps(texture, supportsMips) {
    return texture.generateMipmaps && supportsMips && texture.minFilter !== NearestFilter && texture.minFilter !== LinearFilter;
  }
  function generateMipmap(target) {
    _gl.generateMipmap(target);
  }
  function getInternalFormat(internalFormatName, glFormat, glType, encoding, isVideoTexture = false) {
    if (isWebGL2 === false)
      return glFormat;
    if (internalFormatName !== null) {
      if (_gl[internalFormatName] !== void 0)
        return _gl[internalFormatName];
      console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '" + internalFormatName + "'");
    }
    let internalFormat = glFormat;
    if (glFormat === 6403) {
      if (glType === 5126)
        internalFormat = 33326;
      if (glType === 5131)
        internalFormat = 33325;
      if (glType === 5121)
        internalFormat = 33321;
    }
    if (glFormat === 33319) {
      if (glType === 5126)
        internalFormat = 33328;
      if (glType === 5131)
        internalFormat = 33327;
      if (glType === 5121)
        internalFormat = 33323;
    }
    if (glFormat === 6408) {
      if (glType === 5126)
        internalFormat = 34836;
      if (glType === 5131)
        internalFormat = 34842;
      if (glType === 5121)
        internalFormat = encoding === sRGBEncoding && isVideoTexture === false ? 35907 : 32856;
      if (glType === 32819)
        internalFormat = 32854;
      if (glType === 32820)
        internalFormat = 32855;
    }
    if (internalFormat === 33325 || internalFormat === 33326 || internalFormat === 33327 || internalFormat === 33328 || internalFormat === 34842 || internalFormat === 34836) {
      extensions2.get("EXT_color_buffer_float");
    }
    return internalFormat;
  }
  function getMipLevels(texture, image, supportsMips) {
    if (textureNeedsGenerateMipmaps(texture, supportsMips) === true || texture.isFramebufferTexture && texture.minFilter !== NearestFilter && texture.minFilter !== LinearFilter) {
      return Math.log2(Math.max(image.width, image.height)) + 1;
    } else if (texture.mipmaps !== void 0 && texture.mipmaps.length > 0) {
      return texture.mipmaps.length;
    } else if (texture.isCompressedTexture && Array.isArray(texture.image)) {
      return image.mipmaps.length;
    } else {
      return 1;
    }
  }
  function filterFallback(f) {
    if (f === NearestFilter || f === NearestMipmapNearestFilter || f === NearestMipmapLinearFilter) {
      return 9728;
    }
    return 9729;
  }
  function onTextureDispose(event) {
    const texture = event.target;
    texture.removeEventListener("dispose", onTextureDispose);
    deallocateTexture(texture);
    if (texture.isVideoTexture) {
      _videoTextures.delete(texture);
    }
  }
  function onRenderTargetDispose(event) {
    const renderTarget = event.target;
    renderTarget.removeEventListener("dispose", onRenderTargetDispose);
    deallocateRenderTarget(renderTarget);
  }
  function deallocateTexture(texture) {
    const textureProperties = properties.get(texture);
    if (textureProperties.__webglInit === void 0)
      return;
    const source = texture.source;
    const webglTextures = _sources.get(source);
    if (webglTextures) {
      const webglTexture = webglTextures[textureProperties.__cacheKey];
      webglTexture.usedTimes--;
      if (webglTexture.usedTimes === 0) {
        deleteTexture(texture);
      }
      if (Object.keys(webglTextures).length === 0) {
        _sources.delete(source);
      }
    }
    properties.remove(texture);
  }
  function deleteTexture(texture) {
    const textureProperties = properties.get(texture);
    _gl.deleteTexture(textureProperties.__webglTexture);
    const source = texture.source;
    const webglTextures = _sources.get(source);
    delete webglTextures[textureProperties.__cacheKey];
    info.memory.textures--;
  }
  function deallocateRenderTarget(renderTarget) {
    const texture = renderTarget.texture;
    const renderTargetProperties = properties.get(renderTarget);
    const textureProperties = properties.get(texture);
    if (textureProperties.__webglTexture !== void 0) {
      _gl.deleteTexture(textureProperties.__webglTexture);
      info.memory.textures--;
    }
    if (renderTarget.depthTexture) {
      renderTarget.depthTexture.dispose();
    }
    if (renderTarget.isWebGLCubeRenderTarget) {
      for (let i2 = 0; i2 < 6; i2++) {
        _gl.deleteFramebuffer(renderTargetProperties.__webglFramebuffer[i2]);
        if (renderTargetProperties.__webglDepthbuffer)
          _gl.deleteRenderbuffer(renderTargetProperties.__webglDepthbuffer[i2]);
      }
    } else {
      _gl.deleteFramebuffer(renderTargetProperties.__webglFramebuffer);
      if (renderTargetProperties.__webglDepthbuffer)
        _gl.deleteRenderbuffer(renderTargetProperties.__webglDepthbuffer);
      if (renderTargetProperties.__webglMultisampledFramebuffer)
        _gl.deleteFramebuffer(renderTargetProperties.__webglMultisampledFramebuffer);
      if (renderTargetProperties.__webglColorRenderbuffer)
        _gl.deleteRenderbuffer(renderTargetProperties.__webglColorRenderbuffer);
      if (renderTargetProperties.__webglDepthRenderbuffer)
        _gl.deleteRenderbuffer(renderTargetProperties.__webglDepthRenderbuffer);
    }
    if (renderTarget.isWebGLMultipleRenderTargets) {
      for (let i2 = 0, il = texture.length; i2 < il; i2++) {
        const attachmentProperties = properties.get(texture[i2]);
        if (attachmentProperties.__webglTexture) {
          _gl.deleteTexture(attachmentProperties.__webglTexture);
          info.memory.textures--;
        }
        properties.remove(texture[i2]);
      }
    }
    properties.remove(texture);
    properties.remove(renderTarget);
  }
  let textureUnits = 0;
  function resetTextureUnits() {
    textureUnits = 0;
  }
  function allocateTextureUnit() {
    const textureUnit = textureUnits;
    if (textureUnit >= maxTextures) {
      console.warn("THREE.WebGLTextures: Trying to use " + textureUnit + " texture units while this GPU supports only " + maxTextures);
    }
    textureUnits += 1;
    return textureUnit;
  }
  function getTextureCacheKey(texture) {
    const array = [];
    array.push(texture.wrapS);
    array.push(texture.wrapT);
    array.push(texture.magFilter);
    array.push(texture.minFilter);
    array.push(texture.anisotropy);
    array.push(texture.internalFormat);
    array.push(texture.format);
    array.push(texture.type);
    array.push(texture.generateMipmaps);
    array.push(texture.premultiplyAlpha);
    array.push(texture.flipY);
    array.push(texture.unpackAlignment);
    array.push(texture.encoding);
    return array.join();
  }
  function setTexture2D(texture, slot) {
    const textureProperties = properties.get(texture);
    if (texture.isVideoTexture)
      updateVideoTexture(texture);
    if (texture.isRenderTargetTexture === false && texture.version > 0 && textureProperties.__version !== texture.version) {
      const image = texture.image;
      if (image === null) {
        console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");
      } else if (image.complete === false) {
        console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");
      } else {
        uploadTexture(textureProperties, texture, slot);
        return;
      }
    }
    state.activeTexture(33984 + slot);
    state.bindTexture(3553, textureProperties.__webglTexture);
  }
  function setTexture2DArray(texture, slot) {
    const textureProperties = properties.get(texture);
    if (texture.version > 0 && textureProperties.__version !== texture.version) {
      uploadTexture(textureProperties, texture, slot);
      return;
    }
    state.activeTexture(33984 + slot);
    state.bindTexture(35866, textureProperties.__webglTexture);
  }
  function setTexture3D(texture, slot) {
    const textureProperties = properties.get(texture);
    if (texture.version > 0 && textureProperties.__version !== texture.version) {
      uploadTexture(textureProperties, texture, slot);
      return;
    }
    state.activeTexture(33984 + slot);
    state.bindTexture(32879, textureProperties.__webglTexture);
  }
  function setTextureCube(texture, slot) {
    const textureProperties = properties.get(texture);
    if (texture.version > 0 && textureProperties.__version !== texture.version) {
      uploadCubeTexture(textureProperties, texture, slot);
      return;
    }
    state.activeTexture(33984 + slot);
    state.bindTexture(34067, textureProperties.__webglTexture);
  }
  const wrappingToGL = {
    [RepeatWrapping]: 10497,
    [ClampToEdgeWrapping]: 33071,
    [MirroredRepeatWrapping]: 33648
  };
  const filterToGL = {
    [NearestFilter]: 9728,
    [NearestMipmapNearestFilter]: 9984,
    [NearestMipmapLinearFilter]: 9986,
    [LinearFilter]: 9729,
    [LinearMipmapNearestFilter]: 9985,
    [LinearMipmapLinearFilter]: 9987
  };
  function setTextureParameters(textureType, texture, supportsMips) {
    if (supportsMips) {
      _gl.texParameteri(textureType, 10242, wrappingToGL[texture.wrapS]);
      _gl.texParameteri(textureType, 10243, wrappingToGL[texture.wrapT]);
      if (textureType === 32879 || textureType === 35866) {
        _gl.texParameteri(textureType, 32882, wrappingToGL[texture.wrapR]);
      }
      _gl.texParameteri(textureType, 10240, filterToGL[texture.magFilter]);
      _gl.texParameteri(textureType, 10241, filterToGL[texture.minFilter]);
    } else {
      _gl.texParameteri(textureType, 10242, 33071);
      _gl.texParameteri(textureType, 10243, 33071);
      if (textureType === 32879 || textureType === 35866) {
        _gl.texParameteri(textureType, 32882, 33071);
      }
      if (texture.wrapS !== ClampToEdgeWrapping || texture.wrapT !== ClampToEdgeWrapping) {
        console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.");
      }
      _gl.texParameteri(textureType, 10240, filterFallback(texture.magFilter));
      _gl.texParameteri(textureType, 10241, filterFallback(texture.minFilter));
      if (texture.minFilter !== NearestFilter && texture.minFilter !== LinearFilter) {
        console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.");
      }
    }
    if (extensions2.has("EXT_texture_filter_anisotropic") === true) {
      const extension = extensions2.get("EXT_texture_filter_anisotropic");
      if (texture.type === FloatType && extensions2.has("OES_texture_float_linear") === false)
        return;
      if (isWebGL2 === false && (texture.type === HalfFloatType && extensions2.has("OES_texture_half_float_linear") === false))
        return;
      if (texture.anisotropy > 1 || properties.get(texture).__currentAnisotropy) {
        _gl.texParameterf(textureType, extension.TEXTURE_MAX_ANISOTROPY_EXT, Math.min(texture.anisotropy, capabilities.getMaxAnisotropy()));
        properties.get(texture).__currentAnisotropy = texture.anisotropy;
      }
    }
  }
  function initTexture(textureProperties, texture) {
    let forceUpload = false;
    if (textureProperties.__webglInit === void 0) {
      textureProperties.__webglInit = true;
      texture.addEventListener("dispose", onTextureDispose);
    }
    const source = texture.source;
    let webglTextures = _sources.get(source);
    if (webglTextures === void 0) {
      webglTextures = {};
      _sources.set(source, webglTextures);
    }
    const textureCacheKey = getTextureCacheKey(texture);
    if (textureCacheKey !== textureProperties.__cacheKey) {
      if (webglTextures[textureCacheKey] === void 0) {
        webglTextures[textureCacheKey] = {
          texture: _gl.createTexture(),
          usedTimes: 0
        };
        info.memory.textures++;
        forceUpload = true;
      }
      webglTextures[textureCacheKey].usedTimes++;
      const webglTexture = webglTextures[textureProperties.__cacheKey];
      if (webglTexture !== void 0) {
        webglTextures[textureProperties.__cacheKey].usedTimes--;
        if (webglTexture.usedTimes === 0) {
          deleteTexture(texture);
        }
      }
      textureProperties.__cacheKey = textureCacheKey;
      textureProperties.__webglTexture = webglTextures[textureCacheKey].texture;
    }
    return forceUpload;
  }
  function uploadTexture(textureProperties, texture, slot) {
    let textureType = 3553;
    if (texture.isDataArrayTexture)
      textureType = 35866;
    if (texture.isData3DTexture)
      textureType = 32879;
    const forceUpload = initTexture(textureProperties, texture);
    const source = texture.source;
    state.activeTexture(33984 + slot);
    state.bindTexture(textureType, textureProperties.__webglTexture);
    if (source.version !== source.__currentVersion || forceUpload === true) {
      _gl.pixelStorei(37440, texture.flipY);
      _gl.pixelStorei(37441, texture.premultiplyAlpha);
      _gl.pixelStorei(3317, texture.unpackAlignment);
      _gl.pixelStorei(37443, 0);
      const needsPowerOfTwo = textureNeedsPowerOfTwo(texture) && isPowerOfTwo$1(texture.image) === false;
      let image = resizeImage(texture.image, needsPowerOfTwo, false, maxTextureSize);
      image = verifyColorSpace(texture, image);
      const supportsMips = isPowerOfTwo$1(image) || isWebGL2, glFormat = utils.convert(texture.format, texture.encoding);
      let glType = utils.convert(texture.type), glInternalFormat = getInternalFormat(texture.internalFormat, glFormat, glType, texture.encoding, texture.isVideoTexture);
      setTextureParameters(textureType, texture, supportsMips);
      let mipmap;
      const mipmaps = texture.mipmaps;
      const useTexStorage = isWebGL2 && texture.isVideoTexture !== true;
      const allocateMemory = textureProperties.__version === void 0;
      const levels = getMipLevels(texture, image, supportsMips);
      if (texture.isDepthTexture) {
        glInternalFormat = 6402;
        if (isWebGL2) {
          if (texture.type === FloatType) {
            glInternalFormat = 36012;
          } else if (texture.type === UnsignedIntType) {
            glInternalFormat = 33190;
          } else if (texture.type === UnsignedInt248Type) {
            glInternalFormat = 35056;
          } else {
            glInternalFormat = 33189;
          }
        } else {
          if (texture.type === FloatType) {
            console.error("WebGLRenderer: Floating point depth texture requires WebGL2.");
          }
        }
        if (texture.format === DepthFormat && glInternalFormat === 6402) {
          if (texture.type !== UnsignedShortType && texture.type !== UnsignedIntType) {
            console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture.");
            texture.type = UnsignedShortType;
            glType = utils.convert(texture.type);
          }
        }
        if (texture.format === DepthStencilFormat && glInternalFormat === 6402) {
          glInternalFormat = 34041;
          if (texture.type !== UnsignedInt248Type) {
            console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture.");
            texture.type = UnsignedInt248Type;
            glType = utils.convert(texture.type);
          }
        }
        if (useTexStorage && allocateMemory) {
          state.texStorage2D(3553, 1, glInternalFormat, image.width, image.height);
        } else {
          state.texImage2D(3553, 0, glInternalFormat, image.width, image.height, 0, glFormat, glType, null);
        }
      } else if (texture.isDataTexture) {
        if (mipmaps.length > 0 && supportsMips) {
          if (useTexStorage && allocateMemory) {
            state.texStorage2D(3553, levels, glInternalFormat, mipmaps[0].width, mipmaps[0].height);
          }
          for (let i2 = 0, il = mipmaps.length; i2 < il; i2++) {
            mipmap = mipmaps[i2];
            if (useTexStorage) {
              state.texSubImage2D(3553, i2, 0, 0, mipmap.width, mipmap.height, glFormat, glType, mipmap.data);
            } else {
              state.texImage2D(3553, i2, glInternalFormat, mipmap.width, mipmap.height, 0, glFormat, glType, mipmap.data);
            }
          }
          texture.generateMipmaps = false;
        } else {
          if (useTexStorage) {
            if (allocateMemory) {
              state.texStorage2D(3553, levels, glInternalFormat, image.width, image.height);
            }
            state.texSubImage2D(3553, 0, 0, 0, image.width, image.height, glFormat, glType, image.data);
          } else {
            state.texImage2D(3553, 0, glInternalFormat, image.width, image.height, 0, glFormat, glType, image.data);
          }
        }
      } else if (texture.isCompressedTexture) {
        if (useTexStorage && allocateMemory) {
          state.texStorage2D(3553, levels, glInternalFormat, mipmaps[0].width, mipmaps[0].height);
        }
        for (let i2 = 0, il = mipmaps.length; i2 < il; i2++) {
          mipmap = mipmaps[i2];
          if (texture.format !== RGBAFormat) {
            if (glFormat !== null) {
              if (useTexStorage) {
                state.compressedTexSubImage2D(3553, i2, 0, 0, mipmap.width, mipmap.height, glFormat, mipmap.data);
              } else {
                state.compressedTexImage2D(3553, i2, glInternalFormat, mipmap.width, mipmap.height, 0, mipmap.data);
              }
            } else {
              console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");
            }
          } else {
            if (useTexStorage) {
              state.texSubImage2D(3553, i2, 0, 0, mipmap.width, mipmap.height, glFormat, glType, mipmap.data);
            } else {
              state.texImage2D(3553, i2, glInternalFormat, mipmap.width, mipmap.height, 0, glFormat, glType, mipmap.data);
            }
          }
        }
      } else if (texture.isDataArrayTexture) {
        if (useTexStorage) {
          if (allocateMemory) {
            state.texStorage3D(35866, levels, glInternalFormat, image.width, image.height, image.depth);
          }
          state.texSubImage3D(35866, 0, 0, 0, 0, image.width, image.height, image.depth, glFormat, glType, image.data);
        } else {
          state.texImage3D(35866, 0, glInternalFormat, image.width, image.height, image.depth, 0, glFormat, glType, image.data);
        }
      } else if (texture.isData3DTexture) {
        if (useTexStorage) {
          if (allocateMemory) {
            state.texStorage3D(32879, levels, glInternalFormat, image.width, image.height, image.depth);
          }
          state.texSubImage3D(32879, 0, 0, 0, 0, image.width, image.height, image.depth, glFormat, glType, image.data);
        } else {
          state.texImage3D(32879, 0, glInternalFormat, image.width, image.height, image.depth, 0, glFormat, glType, image.data);
        }
      } else if (texture.isFramebufferTexture) {
        if (useTexStorage && allocateMemory) {
          state.texStorage2D(3553, levels, glInternalFormat, image.width, image.height);
        } else {
          state.texImage2D(3553, 0, glInternalFormat, image.width, image.height, 0, glFormat, glType, null);
        }
      } else {
        if (mipmaps.length > 0 && supportsMips) {
          if (useTexStorage && allocateMemory) {
            state.texStorage2D(3553, levels, glInternalFormat, mipmaps[0].width, mipmaps[0].height);
          }
          for (let i2 = 0, il = mipmaps.length; i2 < il; i2++) {
            mipmap = mipmaps[i2];
            if (useTexStorage) {
              state.texSubImage2D(3553, i2, 0, 0, glFormat, glType, mipmap);
            } else {
              state.texImage2D(3553, i2, glInternalFormat, glFormat, glType, mipmap);
            }
          }
          texture.generateMipmaps = false;
        } else {
          if (useTexStorage) {
            if (allocateMemory) {
              state.texStorage2D(3553, levels, glInternalFormat, image.width, image.height);
            }
            state.texSubImage2D(3553, 0, 0, 0, glFormat, glType, image);
          } else {
            state.texImage2D(3553, 0, glInternalFormat, glFormat, glType, image);
          }
        }
      }
      if (textureNeedsGenerateMipmaps(texture, supportsMips)) {
        generateMipmap(textureType);
      }
      source.__currentVersion = source.version;
      if (texture.onUpdate)
        texture.onUpdate(texture);
    }
    textureProperties.__version = texture.version;
  }
  function uploadCubeTexture(textureProperties, texture, slot) {
    if (texture.image.length !== 6)
      return;
    const forceUpload = initTexture(textureProperties, texture);
    const source = texture.source;
    state.activeTexture(33984 + slot);
    state.bindTexture(34067, textureProperties.__webglTexture);
    if (source.version !== source.__currentVersion || forceUpload === true) {
      _gl.pixelStorei(37440, texture.flipY);
      _gl.pixelStorei(37441, texture.premultiplyAlpha);
      _gl.pixelStorei(3317, texture.unpackAlignment);
      _gl.pixelStorei(37443, 0);
      const isCompressed = texture.isCompressedTexture || texture.image[0].isCompressedTexture;
      const isDataTexture = texture.image[0] && texture.image[0].isDataTexture;
      const cubeImage = [];
      for (let i2 = 0; i2 < 6; i2++) {
        if (!isCompressed && !isDataTexture) {
          cubeImage[i2] = resizeImage(texture.image[i2], false, true, maxCubemapSize);
        } else {
          cubeImage[i2] = isDataTexture ? texture.image[i2].image : texture.image[i2];
        }
        cubeImage[i2] = verifyColorSpace(texture, cubeImage[i2]);
      }
      const image = cubeImage[0], supportsMips = isPowerOfTwo$1(image) || isWebGL2, glFormat = utils.convert(texture.format, texture.encoding), glType = utils.convert(texture.type), glInternalFormat = getInternalFormat(texture.internalFormat, glFormat, glType, texture.encoding);
      const useTexStorage = isWebGL2 && texture.isVideoTexture !== true;
      const allocateMemory = textureProperties.__version === void 0;
      let levels = getMipLevels(texture, image, supportsMips);
      setTextureParameters(34067, texture, supportsMips);
      let mipmaps;
      if (isCompressed) {
        if (useTexStorage && allocateMemory) {
          state.texStorage2D(34067, levels, glInternalFormat, image.width, image.height);
        }
        for (let i2 = 0; i2 < 6; i2++) {
          mipmaps = cubeImage[i2].mipmaps;
          for (let j = 0; j < mipmaps.length; j++) {
            const mipmap = mipmaps[j];
            if (texture.format !== RGBAFormat) {
              if (glFormat !== null) {
                if (useTexStorage) {
                  state.compressedTexSubImage2D(34069 + i2, j, 0, 0, mipmap.width, mipmap.height, glFormat, mipmap.data);
                } else {
                  state.compressedTexImage2D(34069 + i2, j, glInternalFormat, mipmap.width, mipmap.height, 0, mipmap.data);
                }
              } else {
                console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()");
              }
            } else {
              if (useTexStorage) {
                state.texSubImage2D(34069 + i2, j, 0, 0, mipmap.width, mipmap.height, glFormat, glType, mipmap.data);
              } else {
                state.texImage2D(34069 + i2, j, glInternalFormat, mipmap.width, mipmap.height, 0, glFormat, glType, mipmap.data);
              }
            }
          }
        }
      } else {
        mipmaps = texture.mipmaps;
        if (useTexStorage && allocateMemory) {
          if (mipmaps.length > 0)
            levels++;
          state.texStorage2D(34067, levels, glInternalFormat, cubeImage[0].width, cubeImage[0].height);
        }
        for (let i2 = 0; i2 < 6; i2++) {
          if (isDataTexture) {
            if (useTexStorage) {
              state.texSubImage2D(34069 + i2, 0, 0, 0, cubeImage[i2].width, cubeImage[i2].height, glFormat, glType, cubeImage[i2].data);
            } else {
              state.texImage2D(34069 + i2, 0, glInternalFormat, cubeImage[i2].width, cubeImage[i2].height, 0, glFormat, glType, cubeImage[i2].data);
            }
            for (let j = 0; j < mipmaps.length; j++) {
              const mipmap = mipmaps[j];
              const mipmapImage = mipmap.image[i2].image;
              if (useTexStorage) {
                state.texSubImage2D(34069 + i2, j + 1, 0, 0, mipmapImage.width, mipmapImage.height, glFormat, glType, mipmapImage.data);
              } else {
                state.texImage2D(34069 + i2, j + 1, glInternalFormat, mipmapImage.width, mipmapImage.height, 0, glFormat, glType, mipmapImage.data);
              }
            }
          } else {
            if (useTexStorage) {
              state.texSubImage2D(34069 + i2, 0, 0, 0, glFormat, glType, cubeImage[i2]);
            } else {
              state.texImage2D(34069 + i2, 0, glInternalFormat, glFormat, glType, cubeImage[i2]);
            }
            for (let j = 0; j < mipmaps.length; j++) {
              const mipmap = mipmaps[j];
              if (useTexStorage) {
                state.texSubImage2D(34069 + i2, j + 1, 0, 0, glFormat, glType, mipmap.image[i2]);
              } else {
                state.texImage2D(34069 + i2, j + 1, glInternalFormat, glFormat, glType, mipmap.image[i2]);
              }
            }
          }
        }
      }
      if (textureNeedsGenerateMipmaps(texture, supportsMips)) {
        generateMipmap(34067);
      }
      source.__currentVersion = source.version;
      if (texture.onUpdate)
        texture.onUpdate(texture);
    }
    textureProperties.__version = texture.version;
  }
  function setupFrameBufferTexture(framebuffer, renderTarget, texture, attachment, textureTarget) {
    const glFormat = utils.convert(texture.format, texture.encoding);
    const glType = utils.convert(texture.type);
    const glInternalFormat = getInternalFormat(texture.internalFormat, glFormat, glType, texture.encoding);
    const renderTargetProperties = properties.get(renderTarget);
    if (!renderTargetProperties.__hasExternalTextures) {
      if (textureTarget === 32879 || textureTarget === 35866) {
        state.texImage3D(textureTarget, 0, glInternalFormat, renderTarget.width, renderTarget.height, renderTarget.depth, 0, glFormat, glType, null);
      } else {
        state.texImage2D(textureTarget, 0, glInternalFormat, renderTarget.width, renderTarget.height, 0, glFormat, glType, null);
      }
    }
    state.bindFramebuffer(36160, framebuffer);
    if (useMultisampledRTT(renderTarget)) {
      multisampledRTTExt.framebufferTexture2DMultisampleEXT(36160, attachment, textureTarget, properties.get(texture).__webglTexture, 0, getRenderTargetSamples(renderTarget));
    } else {
      _gl.framebufferTexture2D(36160, attachment, textureTarget, properties.get(texture).__webglTexture, 0);
    }
    state.bindFramebuffer(36160, null);
  }
  function setupRenderBufferStorage(renderbuffer, renderTarget, isMultisample) {
    _gl.bindRenderbuffer(36161, renderbuffer);
    if (renderTarget.depthBuffer && !renderTarget.stencilBuffer) {
      let glInternalFormat = 33189;
      if (isMultisample || useMultisampledRTT(renderTarget)) {
        const depthTexture = renderTarget.depthTexture;
        if (depthTexture && depthTexture.isDepthTexture) {
          if (depthTexture.type === FloatType) {
            glInternalFormat = 36012;
          } else if (depthTexture.type === UnsignedIntType) {
            glInternalFormat = 33190;
          }
        }
        const samples = getRenderTargetSamples(renderTarget);
        if (useMultisampledRTT(renderTarget)) {
          multisampledRTTExt.renderbufferStorageMultisampleEXT(36161, samples, glInternalFormat, renderTarget.width, renderTarget.height);
        } else {
          _gl.renderbufferStorageMultisample(36161, samples, glInternalFormat, renderTarget.width, renderTarget.height);
        }
      } else {
        _gl.renderbufferStorage(36161, glInternalFormat, renderTarget.width, renderTarget.height);
      }
      _gl.framebufferRenderbuffer(36160, 36096, 36161, renderbuffer);
    } else if (renderTarget.depthBuffer && renderTarget.stencilBuffer) {
      const samples = getRenderTargetSamples(renderTarget);
      if (isMultisample && useMultisampledRTT(renderTarget) === false) {
        _gl.renderbufferStorageMultisample(36161, samples, 35056, renderTarget.width, renderTarget.height);
      } else if (useMultisampledRTT(renderTarget)) {
        multisampledRTTExt.renderbufferStorageMultisampleEXT(36161, samples, 35056, renderTarget.width, renderTarget.height);
      } else {
        _gl.renderbufferStorage(36161, 34041, renderTarget.width, renderTarget.height);
      }
      _gl.framebufferRenderbuffer(36160, 33306, 36161, renderbuffer);
    } else {
      const texture = renderTarget.isWebGLMultipleRenderTargets === true ? renderTarget.texture[0] : renderTarget.texture;
      const glFormat = utils.convert(texture.format, texture.encoding);
      const glType = utils.convert(texture.type);
      const glInternalFormat = getInternalFormat(texture.internalFormat, glFormat, glType, texture.encoding);
      const samples = getRenderTargetSamples(renderTarget);
      if (isMultisample && useMultisampledRTT(renderTarget) === false) {
        _gl.renderbufferStorageMultisample(36161, samples, glInternalFormat, renderTarget.width, renderTarget.height);
      } else if (useMultisampledRTT(renderTarget)) {
        multisampledRTTExt.renderbufferStorageMultisampleEXT(36161, samples, glInternalFormat, renderTarget.width, renderTarget.height);
      } else {
        _gl.renderbufferStorage(36161, glInternalFormat, renderTarget.width, renderTarget.height);
      }
    }
    _gl.bindRenderbuffer(36161, null);
  }
  function setupDepthTexture(framebuffer, renderTarget) {
    const isCube = renderTarget && renderTarget.isWebGLCubeRenderTarget;
    if (isCube)
      throw new Error("Depth Texture with cube render targets is not supported");
    state.bindFramebuffer(36160, framebuffer);
    if (!(renderTarget.depthTexture && renderTarget.depthTexture.isDepthTexture)) {
      throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");
    }
    if (!properties.get(renderTarget.depthTexture).__webglTexture || renderTarget.depthTexture.image.width !== renderTarget.width || renderTarget.depthTexture.image.height !== renderTarget.height) {
      renderTarget.depthTexture.image.width = renderTarget.width;
      renderTarget.depthTexture.image.height = renderTarget.height;
      renderTarget.depthTexture.needsUpdate = true;
    }
    setTexture2D(renderTarget.depthTexture, 0);
    const webglDepthTexture = properties.get(renderTarget.depthTexture).__webglTexture;
    const samples = getRenderTargetSamples(renderTarget);
    if (renderTarget.depthTexture.format === DepthFormat) {
      if (useMultisampledRTT(renderTarget)) {
        multisampledRTTExt.framebufferTexture2DMultisampleEXT(36160, 36096, 3553, webglDepthTexture, 0, samples);
      } else {
        _gl.framebufferTexture2D(36160, 36096, 3553, webglDepthTexture, 0);
      }
    } else if (renderTarget.depthTexture.format === DepthStencilFormat) {
      if (useMultisampledRTT(renderTarget)) {
        multisampledRTTExt.framebufferTexture2DMultisampleEXT(36160, 33306, 3553, webglDepthTexture, 0, samples);
      } else {
        _gl.framebufferTexture2D(36160, 33306, 3553, webglDepthTexture, 0);
      }
    } else {
      throw new Error("Unknown depthTexture format");
    }
  }
  function setupDepthRenderbuffer(renderTarget) {
    const renderTargetProperties = properties.get(renderTarget);
    const isCube = renderTarget.isWebGLCubeRenderTarget === true;
    if (renderTarget.depthTexture && !renderTargetProperties.__autoAllocateDepthBuffer) {
      if (isCube)
        throw new Error("target.depthTexture not supported in Cube render targets");
      setupDepthTexture(renderTargetProperties.__webglFramebuffer, renderTarget);
    } else {
      if (isCube) {
        renderTargetProperties.__webglDepthbuffer = [];
        for (let i2 = 0; i2 < 6; i2++) {
          state.bindFramebuffer(36160, renderTargetProperties.__webglFramebuffer[i2]);
          renderTargetProperties.__webglDepthbuffer[i2] = _gl.createRenderbuffer();
          setupRenderBufferStorage(renderTargetProperties.__webglDepthbuffer[i2], renderTarget, false);
        }
      } else {
        state.bindFramebuffer(36160, renderTargetProperties.__webglFramebuffer);
        renderTargetProperties.__webglDepthbuffer = _gl.createRenderbuffer();
        setupRenderBufferStorage(renderTargetProperties.__webglDepthbuffer, renderTarget, false);
      }
    }
    state.bindFramebuffer(36160, null);
  }
  function rebindTextures(renderTarget, colorTexture, depthTexture) {
    const renderTargetProperties = properties.get(renderTarget);
    if (colorTexture !== void 0) {
      setupFrameBufferTexture(renderTargetProperties.__webglFramebuffer, renderTarget, renderTarget.texture, 36064, 3553);
    }
    if (depthTexture !== void 0) {
      setupDepthRenderbuffer(renderTarget);
    }
  }
  function setupRenderTarget(renderTarget) {
    const texture = renderTarget.texture;
    const renderTargetProperties = properties.get(renderTarget);
    const textureProperties = properties.get(texture);
    renderTarget.addEventListener("dispose", onRenderTargetDispose);
    if (renderTarget.isWebGLMultipleRenderTargets !== true) {
      if (textureProperties.__webglTexture === void 0) {
        textureProperties.__webglTexture = _gl.createTexture();
      }
      textureProperties.__version = texture.version;
      info.memory.textures++;
    }
    const isCube = renderTarget.isWebGLCubeRenderTarget === true;
    const isMultipleRenderTargets = renderTarget.isWebGLMultipleRenderTargets === true;
    const supportsMips = isPowerOfTwo$1(renderTarget) || isWebGL2;
    if (isCube) {
      renderTargetProperties.__webglFramebuffer = [];
      for (let i2 = 0; i2 < 6; i2++) {
        renderTargetProperties.__webglFramebuffer[i2] = _gl.createFramebuffer();
      }
    } else {
      renderTargetProperties.__webglFramebuffer = _gl.createFramebuffer();
      if (isMultipleRenderTargets) {
        if (capabilities.drawBuffers) {
          const textures = renderTarget.texture;
          for (let i2 = 0, il = textures.length; i2 < il; i2++) {
            const attachmentProperties = properties.get(textures[i2]);
            if (attachmentProperties.__webglTexture === void 0) {
              attachmentProperties.__webglTexture = _gl.createTexture();
              info.memory.textures++;
            }
          }
        } else {
          console.warn("THREE.WebGLRenderer: WebGLMultipleRenderTargets can only be used with WebGL2 or WEBGL_draw_buffers extension.");
        }
      } else if (isWebGL2 && renderTarget.samples > 0 && useMultisampledRTT(renderTarget) === false) {
        renderTargetProperties.__webglMultisampledFramebuffer = _gl.createFramebuffer();
        renderTargetProperties.__webglColorRenderbuffer = _gl.createRenderbuffer();
        _gl.bindRenderbuffer(36161, renderTargetProperties.__webglColorRenderbuffer);
        const glFormat = utils.convert(texture.format, texture.encoding);
        const glType = utils.convert(texture.type);
        const glInternalFormat = getInternalFormat(texture.internalFormat, glFormat, glType, texture.encoding);
        const samples = getRenderTargetSamples(renderTarget);
        _gl.renderbufferStorageMultisample(36161, samples, glInternalFormat, renderTarget.width, renderTarget.height);
        state.bindFramebuffer(36160, renderTargetProperties.__webglMultisampledFramebuffer);
        _gl.framebufferRenderbuffer(36160, 36064, 36161, renderTargetProperties.__webglColorRenderbuffer);
        _gl.bindRenderbuffer(36161, null);
        if (renderTarget.depthBuffer) {
          renderTargetProperties.__webglDepthRenderbuffer = _gl.createRenderbuffer();
          setupRenderBufferStorage(renderTargetProperties.__webglDepthRenderbuffer, renderTarget, true);
        }
        state.bindFramebuffer(36160, null);
      }
    }
    if (isCube) {
      state.bindTexture(34067, textureProperties.__webglTexture);
      setTextureParameters(34067, texture, supportsMips);
      for (let i2 = 0; i2 < 6; i2++) {
        setupFrameBufferTexture(renderTargetProperties.__webglFramebuffer[i2], renderTarget, texture, 36064, 34069 + i2);
      }
      if (textureNeedsGenerateMipmaps(texture, supportsMips)) {
        generateMipmap(34067);
      }
      state.unbindTexture();
    } else if (isMultipleRenderTargets) {
      const textures = renderTarget.texture;
      for (let i2 = 0, il = textures.length; i2 < il; i2++) {
        const attachment = textures[i2];
        const attachmentProperties = properties.get(attachment);
        state.bindTexture(3553, attachmentProperties.__webglTexture);
        setTextureParameters(3553, attachment, supportsMips);
        setupFrameBufferTexture(renderTargetProperties.__webglFramebuffer, renderTarget, attachment, 36064 + i2, 3553);
        if (textureNeedsGenerateMipmaps(attachment, supportsMips)) {
          generateMipmap(3553);
        }
      }
      state.unbindTexture();
    } else {
      let glTextureType = 3553;
      if (renderTarget.isWebGL3DRenderTarget || renderTarget.isWebGLArrayRenderTarget) {
        if (isWebGL2) {
          glTextureType = renderTarget.isWebGL3DRenderTarget ? 32879 : 35866;
        } else {
          console.error("THREE.WebGLTextures: THREE.Data3DTexture and THREE.DataArrayTexture only supported with WebGL2.");
        }
      }
      state.bindTexture(glTextureType, textureProperties.__webglTexture);
      setTextureParameters(glTextureType, texture, supportsMips);
      setupFrameBufferTexture(renderTargetProperties.__webglFramebuffer, renderTarget, texture, 36064, glTextureType);
      if (textureNeedsGenerateMipmaps(texture, supportsMips)) {
        generateMipmap(glTextureType);
      }
      state.unbindTexture();
    }
    if (renderTarget.depthBuffer) {
      setupDepthRenderbuffer(renderTarget);
    }
  }
  function updateRenderTargetMipmap(renderTarget) {
    const supportsMips = isPowerOfTwo$1(renderTarget) || isWebGL2;
    const textures = renderTarget.isWebGLMultipleRenderTargets === true ? renderTarget.texture : [renderTarget.texture];
    for (let i2 = 0, il = textures.length; i2 < il; i2++) {
      const texture = textures[i2];
      if (textureNeedsGenerateMipmaps(texture, supportsMips)) {
        const target = renderTarget.isWebGLCubeRenderTarget ? 34067 : 3553;
        const webglTexture = properties.get(texture).__webglTexture;
        state.bindTexture(target, webglTexture);
        generateMipmap(target);
        state.unbindTexture();
      }
    }
  }
  function updateMultisampleRenderTarget(renderTarget) {
    if (isWebGL2 && renderTarget.samples > 0 && useMultisampledRTT(renderTarget) === false) {
      const width = renderTarget.width;
      const height = renderTarget.height;
      let mask = 16384;
      const invalidationArray = [36064];
      const depthStyle = renderTarget.stencilBuffer ? 33306 : 36096;
      if (renderTarget.depthBuffer) {
        invalidationArray.push(depthStyle);
      }
      const renderTargetProperties = properties.get(renderTarget);
      const ignoreDepthValues = renderTargetProperties.__ignoreDepthValues !== void 0 ? renderTargetProperties.__ignoreDepthValues : false;
      if (ignoreDepthValues === false) {
        if (renderTarget.depthBuffer)
          mask |= 256;
        if (renderTarget.stencilBuffer)
          mask |= 1024;
      }
      state.bindFramebuffer(36008, renderTargetProperties.__webglMultisampledFramebuffer);
      state.bindFramebuffer(36009, renderTargetProperties.__webglFramebuffer);
      if (ignoreDepthValues === true) {
        _gl.invalidateFramebuffer(36008, [depthStyle]);
        _gl.invalidateFramebuffer(36009, [depthStyle]);
      }
      _gl.blitFramebuffer(0, 0, width, height, 0, 0, width, height, mask, 9728);
      if (supportsInvalidateFramebuffer) {
        _gl.invalidateFramebuffer(36008, invalidationArray);
      }
      state.bindFramebuffer(36008, null);
      state.bindFramebuffer(36009, renderTargetProperties.__webglMultisampledFramebuffer);
    }
  }
  function getRenderTargetSamples(renderTarget) {
    return Math.min(maxSamples, renderTarget.samples);
  }
  function useMultisampledRTT(renderTarget) {
    const renderTargetProperties = properties.get(renderTarget);
    return isWebGL2 && renderTarget.samples > 0 && extensions2.has("WEBGL_multisampled_render_to_texture") === true && renderTargetProperties.__useRenderToTexture !== false;
  }
  function updateVideoTexture(texture) {
    const frame = info.render.frame;
    if (_videoTextures.get(texture) !== frame) {
      _videoTextures.set(texture, frame);
      texture.update();
    }
  }
  function verifyColorSpace(texture, image) {
    const encoding = texture.encoding;
    const format3 = texture.format;
    const type = texture.type;
    if (texture.isCompressedTexture === true || texture.isVideoTexture === true || texture.format === _SRGBAFormat)
      return image;
    if (encoding !== LinearEncoding) {
      if (encoding === sRGBEncoding) {
        if (isWebGL2 === false) {
          if (extensions2.has("EXT_sRGB") === true && format3 === RGBAFormat) {
            texture.format = _SRGBAFormat;
            texture.minFilter = LinearFilter;
            texture.generateMipmaps = false;
          } else {
            image = ImageUtils.sRGBToLinear(image);
          }
        } else {
          if (format3 !== RGBAFormat || type !== UnsignedByteType) {
            console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType.");
          }
        }
      } else {
        console.error("THREE.WebGLTextures: Unsupported texture encoding:", encoding);
      }
    }
    return image;
  }
  this.allocateTextureUnit = allocateTextureUnit;
  this.resetTextureUnits = resetTextureUnits;
  this.setTexture2D = setTexture2D;
  this.setTexture2DArray = setTexture2DArray;
  this.setTexture3D = setTexture3D;
  this.setTextureCube = setTextureCube;
  this.rebindTextures = rebindTextures;
  this.setupRenderTarget = setupRenderTarget;
  this.updateRenderTargetMipmap = updateRenderTargetMipmap;
  this.updateMultisampleRenderTarget = updateMultisampleRenderTarget;
  this.setupDepthRenderbuffer = setupDepthRenderbuffer;
  this.setupFrameBufferTexture = setupFrameBufferTexture;
  this.useMultisampledRTT = useMultisampledRTT;
}
function WebGLUtils(gl, extensions2, capabilities) {
  const isWebGL2 = capabilities.isWebGL2;
  function convert(p, encoding = null) {
    let extension;
    if (p === UnsignedByteType)
      return 5121;
    if (p === UnsignedShort4444Type)
      return 32819;
    if (p === UnsignedShort5551Type)
      return 32820;
    if (p === ByteType)
      return 5120;
    if (p === ShortType)
      return 5122;
    if (p === UnsignedShortType)
      return 5123;
    if (p === IntType)
      return 5124;
    if (p === UnsignedIntType)
      return 5125;
    if (p === FloatType)
      return 5126;
    if (p === HalfFloatType) {
      if (isWebGL2)
        return 5131;
      extension = extensions2.get("OES_texture_half_float");
      if (extension !== null) {
        return extension.HALF_FLOAT_OES;
      } else {
        return null;
      }
    }
    if (p === AlphaFormat)
      return 6406;
    if (p === RGBAFormat)
      return 6408;
    if (p === LuminanceFormat)
      return 6409;
    if (p === LuminanceAlphaFormat)
      return 6410;
    if (p === DepthFormat)
      return 6402;
    if (p === DepthStencilFormat)
      return 34041;
    if (p === RedFormat)
      return 6403;
    if (p === RGBFormat) {
      console.warn("THREE.WebGLRenderer: THREE.RGBFormat has been removed. Use THREE.RGBAFormat instead. https://github.com/mrdoob/three.js/pull/23228");
      return 6408;
    }
    if (p === _SRGBAFormat) {
      extension = extensions2.get("EXT_sRGB");
      if (extension !== null) {
        return extension.SRGB_ALPHA_EXT;
      } else {
        return null;
      }
    }
    if (p === RedIntegerFormat)
      return 36244;
    if (p === RGFormat)
      return 33319;
    if (p === RGIntegerFormat)
      return 33320;
    if (p === RGBAIntegerFormat)
      return 36249;
    if (p === RGB_S3TC_DXT1_Format || p === RGBA_S3TC_DXT1_Format || p === RGBA_S3TC_DXT3_Format || p === RGBA_S3TC_DXT5_Format) {
      if (encoding === sRGBEncoding) {
        extension = extensions2.get("WEBGL_compressed_texture_s3tc_srgb");
        if (extension !== null) {
          if (p === RGB_S3TC_DXT1_Format)
            return extension.COMPRESSED_SRGB_S3TC_DXT1_EXT;
          if (p === RGBA_S3TC_DXT1_Format)
            return extension.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;
          if (p === RGBA_S3TC_DXT3_Format)
            return extension.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;
          if (p === RGBA_S3TC_DXT5_Format)
            return extension.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT;
        } else {
          return null;
        }
      } else {
        extension = extensions2.get("WEBGL_compressed_texture_s3tc");
        if (extension !== null) {
          if (p === RGB_S3TC_DXT1_Format)
            return extension.COMPRESSED_RGB_S3TC_DXT1_EXT;
          if (p === RGBA_S3TC_DXT1_Format)
            return extension.COMPRESSED_RGBA_S3TC_DXT1_EXT;
          if (p === RGBA_S3TC_DXT3_Format)
            return extension.COMPRESSED_RGBA_S3TC_DXT3_EXT;
          if (p === RGBA_S3TC_DXT5_Format)
            return extension.COMPRESSED_RGBA_S3TC_DXT5_EXT;
        } else {
          return null;
        }
      }
    }
    if (p === RGB_PVRTC_4BPPV1_Format || p === RGB_PVRTC_2BPPV1_Format || p === RGBA_PVRTC_4BPPV1_Format || p === RGBA_PVRTC_2BPPV1_Format) {
      extension = extensions2.get("WEBGL_compressed_texture_pvrtc");
      if (extension !== null) {
        if (p === RGB_PVRTC_4BPPV1_Format)
          return extension.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
        if (p === RGB_PVRTC_2BPPV1_Format)
          return extension.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
        if (p === RGBA_PVRTC_4BPPV1_Format)
          return extension.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
        if (p === RGBA_PVRTC_2BPPV1_Format)
          return extension.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG;
      } else {
        return null;
      }
    }
    if (p === RGB_ETC1_Format) {
      extension = extensions2.get("WEBGL_compressed_texture_etc1");
      if (extension !== null) {
        return extension.COMPRESSED_RGB_ETC1_WEBGL;
      } else {
        return null;
      }
    }
    if (p === RGB_ETC2_Format || p === RGBA_ETC2_EAC_Format) {
      extension = extensions2.get("WEBGL_compressed_texture_etc");
      if (extension !== null) {
        if (p === RGB_ETC2_Format)
          return encoding === sRGBEncoding ? extension.COMPRESSED_SRGB8_ETC2 : extension.COMPRESSED_RGB8_ETC2;
        if (p === RGBA_ETC2_EAC_Format)
          return encoding === sRGBEncoding ? extension.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC : extension.COMPRESSED_RGBA8_ETC2_EAC;
      } else {
        return null;
      }
    }
    if (p === RGBA_ASTC_4x4_Format || p === RGBA_ASTC_5x4_Format || p === RGBA_ASTC_5x5_Format || p === RGBA_ASTC_6x5_Format || p === RGBA_ASTC_6x6_Format || p === RGBA_ASTC_8x5_Format || p === RGBA_ASTC_8x6_Format || p === RGBA_ASTC_8x8_Format || p === RGBA_ASTC_10x5_Format || p === RGBA_ASTC_10x6_Format || p === RGBA_ASTC_10x8_Format || p === RGBA_ASTC_10x10_Format || p === RGBA_ASTC_12x10_Format || p === RGBA_ASTC_12x12_Format) {
      extension = extensions2.get("WEBGL_compressed_texture_astc");
      if (extension !== null) {
        if (p === RGBA_ASTC_4x4_Format)
          return encoding === sRGBEncoding ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR : extension.COMPRESSED_RGBA_ASTC_4x4_KHR;
        if (p === RGBA_ASTC_5x4_Format)
          return encoding === sRGBEncoding ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR : extension.COMPRESSED_RGBA_ASTC_5x4_KHR;
        if (p === RGBA_ASTC_5x5_Format)
          return encoding === sRGBEncoding ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR : extension.COMPRESSED_RGBA_ASTC_5x5_KHR;
        if (p === RGBA_ASTC_6x5_Format)
          return encoding === sRGBEncoding ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR : extension.COMPRESSED_RGBA_ASTC_6x5_KHR;
        if (p === RGBA_ASTC_6x6_Format)
          return encoding === sRGBEncoding ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR : extension.COMPRESSED_RGBA_ASTC_6x6_KHR;
        if (p === RGBA_ASTC_8x5_Format)
          return encoding === sRGBEncoding ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR : extension.COMPRESSED_RGBA_ASTC_8x5_KHR;
        if (p === RGBA_ASTC_8x6_Format)
          return encoding === sRGBEncoding ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR : extension.COMPRESSED_RGBA_ASTC_8x6_KHR;
        if (p === RGBA_ASTC_8x8_Format)
          return encoding === sRGBEncoding ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR : extension.COMPRESSED_RGBA_ASTC_8x8_KHR;
        if (p === RGBA_ASTC_10x5_Format)
          return encoding === sRGBEncoding ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR : extension.COMPRESSED_RGBA_ASTC_10x5_KHR;
        if (p === RGBA_ASTC_10x6_Format)
          return encoding === sRGBEncoding ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR : extension.COMPRESSED_RGBA_ASTC_10x6_KHR;
        if (p === RGBA_ASTC_10x8_Format)
          return encoding === sRGBEncoding ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR : extension.COMPRESSED_RGBA_ASTC_10x8_KHR;
        if (p === RGBA_ASTC_10x10_Format)
          return encoding === sRGBEncoding ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR : extension.COMPRESSED_RGBA_ASTC_10x10_KHR;
        if (p === RGBA_ASTC_12x10_Format)
          return encoding === sRGBEncoding ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR : extension.COMPRESSED_RGBA_ASTC_12x10_KHR;
        if (p === RGBA_ASTC_12x12_Format)
          return encoding === sRGBEncoding ? extension.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR : extension.COMPRESSED_RGBA_ASTC_12x12_KHR;
      } else {
        return null;
      }
    }
    if (p === RGBA_BPTC_Format) {
      extension = extensions2.get("EXT_texture_compression_bptc");
      if (extension !== null) {
        if (p === RGBA_BPTC_Format)
          return encoding === sRGBEncoding ? extension.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT : extension.COMPRESSED_RGBA_BPTC_UNORM_EXT;
      } else {
        return null;
      }
    }
    if (p === UnsignedInt248Type) {
      if (isWebGL2)
        return 34042;
      extension = extensions2.get("WEBGL_depth_texture");
      if (extension !== null) {
        return extension.UNSIGNED_INT_24_8_WEBGL;
      } else {
        return null;
      }
    }
  }
  return { convert };
}
var ArrayCamera = class extends PerspectiveCamera {
  constructor(array = []) {
    super();
    this.cameras = array;
  }
};
ArrayCamera.prototype.isArrayCamera = true;
var Group = class extends Object3D {
  constructor() {
    super();
    this.type = "Group";
  }
};
Group.prototype.isGroup = true;
var _moveEvent = { type: "move" };
var WebXRController = class {
  constructor() {
    this._targetRay = null;
    this._grip = null;
    this._hand = null;
  }
  getHandSpace() {
    if (this._hand === null) {
      this._hand = new Group();
      this._hand.matrixAutoUpdate = false;
      this._hand.visible = false;
      this._hand.joints = {};
      this._hand.inputState = { pinching: false };
    }
    return this._hand;
  }
  getTargetRaySpace() {
    if (this._targetRay === null) {
      this._targetRay = new Group();
      this._targetRay.matrixAutoUpdate = false;
      this._targetRay.visible = false;
      this._targetRay.hasLinearVelocity = false;
      this._targetRay.linearVelocity = new Vector3();
      this._targetRay.hasAngularVelocity = false;
      this._targetRay.angularVelocity = new Vector3();
    }
    return this._targetRay;
  }
  getGripSpace() {
    if (this._grip === null) {
      this._grip = new Group();
      this._grip.matrixAutoUpdate = false;
      this._grip.visible = false;
      this._grip.hasLinearVelocity = false;
      this._grip.linearVelocity = new Vector3();
      this._grip.hasAngularVelocity = false;
      this._grip.angularVelocity = new Vector3();
    }
    return this._grip;
  }
  dispatchEvent(event) {
    if (this._targetRay !== null) {
      this._targetRay.dispatchEvent(event);
    }
    if (this._grip !== null) {
      this._grip.dispatchEvent(event);
    }
    if (this._hand !== null) {
      this._hand.dispatchEvent(event);
    }
    return this;
  }
  disconnect(inputSource) {
    this.dispatchEvent({ type: "disconnected", data: inputSource });
    if (this._targetRay !== null) {
      this._targetRay.visible = false;
    }
    if (this._grip !== null) {
      this._grip.visible = false;
    }
    if (this._hand !== null) {
      this._hand.visible = false;
    }
    return this;
  }
  update(inputSource, frame, referenceSpace) {
    let inputPose = null;
    let gripPose = null;
    let handPose = null;
    const targetRay = this._targetRay;
    const grip = this._grip;
    const hand = this._hand;
    if (inputSource && frame.session.visibilityState !== "visible-blurred") {
      if (targetRay !== null) {
        inputPose = frame.getPose(inputSource.targetRaySpace, referenceSpace);
        if (inputPose !== null) {
          targetRay.matrix.fromArray(inputPose.transform.matrix);
          targetRay.matrix.decompose(targetRay.position, targetRay.rotation, targetRay.scale);
          if (inputPose.linearVelocity) {
            targetRay.hasLinearVelocity = true;
            targetRay.linearVelocity.copy(inputPose.linearVelocity);
          } else {
            targetRay.hasLinearVelocity = false;
          }
          if (inputPose.angularVelocity) {
            targetRay.hasAngularVelocity = true;
            targetRay.angularVelocity.copy(inputPose.angularVelocity);
          } else {
            targetRay.hasAngularVelocity = false;
          }
          this.dispatchEvent(_moveEvent);
        }
      }
      if (hand && inputSource.hand) {
        handPose = true;
        for (const inputjoint of inputSource.hand.values()) {
          const jointPose = frame.getJointPose(inputjoint, referenceSpace);
          if (hand.joints[inputjoint.jointName] === void 0) {
            const joint2 = new Group();
            joint2.matrixAutoUpdate = false;
            joint2.visible = false;
            hand.joints[inputjoint.jointName] = joint2;
            hand.add(joint2);
          }
          const joint = hand.joints[inputjoint.jointName];
          if (jointPose !== null) {
            joint.matrix.fromArray(jointPose.transform.matrix);
            joint.matrix.decompose(joint.position, joint.rotation, joint.scale);
            joint.jointRadius = jointPose.radius;
          }
          joint.visible = jointPose !== null;
        }
        const indexTip = hand.joints["index-finger-tip"];
        const thumbTip = hand.joints["thumb-tip"];
        const distance = indexTip.position.distanceTo(thumbTip.position);
        const distanceToPinch = 0.02;
        const threshold2 = 5e-3;
        if (hand.inputState.pinching && distance > distanceToPinch + threshold2) {
          hand.inputState.pinching = false;
          this.dispatchEvent({
            type: "pinchend",
            handedness: inputSource.handedness,
            target: this
          });
        } else if (!hand.inputState.pinching && distance <= distanceToPinch - threshold2) {
          hand.inputState.pinching = true;
          this.dispatchEvent({
            type: "pinchstart",
            handedness: inputSource.handedness,
            target: this
          });
        }
      } else {
        if (grip !== null && inputSource.gripSpace) {
          gripPose = frame.getPose(inputSource.gripSpace, referenceSpace);
          if (gripPose !== null) {
            grip.matrix.fromArray(gripPose.transform.matrix);
            grip.matrix.decompose(grip.position, grip.rotation, grip.scale);
            if (gripPose.linearVelocity) {
              grip.hasLinearVelocity = true;
              grip.linearVelocity.copy(gripPose.linearVelocity);
            } else {
              grip.hasLinearVelocity = false;
            }
            if (gripPose.angularVelocity) {
              grip.hasAngularVelocity = true;
              grip.angularVelocity.copy(gripPose.angularVelocity);
            } else {
              grip.hasAngularVelocity = false;
            }
          }
        }
      }
    }
    if (targetRay !== null) {
      targetRay.visible = inputPose !== null;
    }
    if (grip !== null) {
      grip.visible = gripPose !== null;
    }
    if (hand !== null) {
      hand.visible = handPose !== null;
    }
    return this;
  }
};
var DepthTexture = class extends Texture {
  constructor(width, height, type, mapping, wrapS, wrapT, magFilter, minFilter, anisotropy, format3) {
    format3 = format3 !== void 0 ? format3 : DepthFormat;
    if (format3 !== DepthFormat && format3 !== DepthStencilFormat) {
      throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");
    }
    if (type === void 0 && format3 === DepthFormat)
      type = UnsignedShortType;
    if (type === void 0 && format3 === DepthStencilFormat)
      type = UnsignedInt248Type;
    super(null, mapping, wrapS, wrapT, magFilter, minFilter, format3, type, anisotropy);
    this.image = { width, height };
    this.magFilter = magFilter !== void 0 ? magFilter : NearestFilter;
    this.minFilter = minFilter !== void 0 ? minFilter : NearestFilter;
    this.flipY = false;
    this.generateMipmaps = false;
  }
};
DepthTexture.prototype.isDepthTexture = true;
var WebXRManager = class extends EventDispatcher {
  constructor(renderer, gl) {
    super();
    const scope = this;
    let session = null;
    let framebufferScaleFactor = 1;
    let referenceSpace = null;
    let referenceSpaceType = "local-floor";
    let pose = null;
    let glBinding = null;
    let glProjLayer = null;
    let glBaseLayer = null;
    let xrFrame = null;
    const attributes = gl.getContextAttributes();
    let initialRenderTarget = null;
    let newRenderTarget = null;
    const controllers = [];
    const inputSourcesMap = /* @__PURE__ */ new Map();
    const cameraL = new PerspectiveCamera();
    cameraL.layers.enable(1);
    cameraL.viewport = new Vector4();
    const cameraR = new PerspectiveCamera();
    cameraR.layers.enable(2);
    cameraR.viewport = new Vector4();
    const cameras = [cameraL, cameraR];
    const cameraVR = new ArrayCamera();
    cameraVR.layers.enable(1);
    cameraVR.layers.enable(2);
    let _currentDepthNear = null;
    let _currentDepthFar = null;
    this.cameraAutoUpdate = true;
    this.enabled = false;
    this.isPresenting = false;
    this.getController = function(index) {
      let controller = controllers[index];
      if (controller === void 0) {
        controller = new WebXRController();
        controllers[index] = controller;
      }
      return controller.getTargetRaySpace();
    };
    this.getControllerGrip = function(index) {
      let controller = controllers[index];
      if (controller === void 0) {
        controller = new WebXRController();
        controllers[index] = controller;
      }
      return controller.getGripSpace();
    };
    this.getHand = function(index) {
      let controller = controllers[index];
      if (controller === void 0) {
        controller = new WebXRController();
        controllers[index] = controller;
      }
      return controller.getHandSpace();
    };
    function onSessionEvent(event) {
      const controller = inputSourcesMap.get(event.inputSource);
      if (controller) {
        controller.dispatchEvent({ type: event.type, data: event.inputSource });
      }
    }
    function onSessionEnd() {
      inputSourcesMap.forEach(function(controller, inputSource) {
        controller.disconnect(inputSource);
      });
      inputSourcesMap.clear();
      _currentDepthNear = null;
      _currentDepthFar = null;
      renderer.setRenderTarget(initialRenderTarget);
      glBaseLayer = null;
      glProjLayer = null;
      glBinding = null;
      session = null;
      newRenderTarget = null;
      animation.stop();
      scope.isPresenting = false;
      scope.dispatchEvent({ type: "sessionend" });
    }
    this.setFramebufferScaleFactor = function(value) {
      framebufferScaleFactor = value;
      if (scope.isPresenting === true) {
        console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.");
      }
    };
    this.setReferenceSpaceType = function(value) {
      referenceSpaceType = value;
      if (scope.isPresenting === true) {
        console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.");
      }
    };
    this.getReferenceSpace = function() {
      return referenceSpace;
    };
    this.getBaseLayer = function() {
      return glProjLayer !== null ? glProjLayer : glBaseLayer;
    };
    this.getBinding = function() {
      return glBinding;
    };
    this.getFrame = function() {
      return xrFrame;
    };
    this.getSession = function() {
      return session;
    };
    this.setSession = async function(value) {
      session = value;
      if (session !== null) {
        initialRenderTarget = renderer.getRenderTarget();
        session.addEventListener("select", onSessionEvent);
        session.addEventListener("selectstart", onSessionEvent);
        session.addEventListener("selectend", onSessionEvent);
        session.addEventListener("squeeze", onSessionEvent);
        session.addEventListener("squeezestart", onSessionEvent);
        session.addEventListener("squeezeend", onSessionEvent);
        session.addEventListener("end", onSessionEnd);
        session.addEventListener("inputsourceschange", onInputSourcesChange);
        if (attributes.xrCompatible !== true) {
          await gl.makeXRCompatible();
        }
        if (session.renderState.layers === void 0 || renderer.capabilities.isWebGL2 === false) {
          const layerInit = {
            antialias: session.renderState.layers === void 0 ? attributes.antialias : true,
            alpha: attributes.alpha,
            depth: attributes.depth,
            stencil: attributes.stencil,
            framebufferScaleFactor
          };
          glBaseLayer = new XRWebGLLayer(session, gl, layerInit);
          session.updateRenderState({ baseLayer: glBaseLayer });
          newRenderTarget = new WebGLRenderTarget(
            glBaseLayer.framebufferWidth,
            glBaseLayer.framebufferHeight,
            {
              format: RGBAFormat,
              type: UnsignedByteType,
              encoding: renderer.outputEncoding
            }
          );
        } else {
          let depthFormat = null;
          let depthType = null;
          let glDepthFormat = null;
          if (attributes.depth) {
            glDepthFormat = attributes.stencil ? 35056 : 33190;
            depthFormat = attributes.stencil ? DepthStencilFormat : DepthFormat;
            depthType = attributes.stencil ? UnsignedInt248Type : UnsignedShortType;
          }
          const projectionlayerInit = {
            colorFormat: renderer.outputEncoding === sRGBEncoding ? 35907 : 32856,
            depthFormat: glDepthFormat,
            scaleFactor: framebufferScaleFactor
          };
          glBinding = new XRWebGLBinding(session, gl);
          glProjLayer = glBinding.createProjectionLayer(projectionlayerInit);
          session.updateRenderState({ layers: [glProjLayer] });
          newRenderTarget = new WebGLRenderTarget(
            glProjLayer.textureWidth,
            glProjLayer.textureHeight,
            {
              format: RGBAFormat,
              type: UnsignedByteType,
              depthTexture: new DepthTexture(glProjLayer.textureWidth, glProjLayer.textureHeight, depthType, void 0, void 0, void 0, void 0, void 0, void 0, depthFormat),
              stencilBuffer: attributes.stencil,
              encoding: renderer.outputEncoding,
              samples: attributes.antialias ? 4 : 0
            }
          );
          const renderTargetProperties = renderer.properties.get(newRenderTarget);
          renderTargetProperties.__ignoreDepthValues = glProjLayer.ignoreDepthValues;
        }
        newRenderTarget.isXRRenderTarget = true;
        this.setFoveation(1);
        referenceSpace = await session.requestReferenceSpace(referenceSpaceType);
        animation.setContext(session);
        animation.start();
        scope.isPresenting = true;
        scope.dispatchEvent({ type: "sessionstart" });
      }
    };
    function onInputSourcesChange(event) {
      const inputSources = session.inputSources;
      for (let i2 = 0; i2 < controllers.length; i2++) {
        inputSourcesMap.set(inputSources[i2], controllers[i2]);
      }
      for (let i2 = 0; i2 < event.removed.length; i2++) {
        const inputSource = event.removed[i2];
        const controller = inputSourcesMap.get(inputSource);
        if (controller) {
          controller.dispatchEvent({ type: "disconnected", data: inputSource });
          inputSourcesMap.delete(inputSource);
        }
      }
      for (let i2 = 0; i2 < event.added.length; i2++) {
        const inputSource = event.added[i2];
        const controller = inputSourcesMap.get(inputSource);
        if (controller) {
          controller.dispatchEvent({ type: "connected", data: inputSource });
        }
      }
    }
    const cameraLPos = new Vector3();
    const cameraRPos = new Vector3();
    function setProjectionFromUnion(camera, cameraL2, cameraR2) {
      cameraLPos.setFromMatrixPosition(cameraL2.matrixWorld);
      cameraRPos.setFromMatrixPosition(cameraR2.matrixWorld);
      const ipd = cameraLPos.distanceTo(cameraRPos);
      const projL = cameraL2.projectionMatrix.elements;
      const projR = cameraR2.projectionMatrix.elements;
      const near = projL[14] / (projL[10] - 1);
      const far = projL[14] / (projL[10] + 1);
      const topFov = (projL[9] + 1) / projL[5];
      const bottomFov = (projL[9] - 1) / projL[5];
      const leftFov = (projL[8] - 1) / projL[0];
      const rightFov = (projR[8] + 1) / projR[0];
      const left = near * leftFov;
      const right = near * rightFov;
      const zOffset = ipd / (-leftFov + rightFov);
      const xOffset = zOffset * -leftFov;
      cameraL2.matrixWorld.decompose(camera.position, camera.quaternion, camera.scale);
      camera.translateX(xOffset);
      camera.translateZ(zOffset);
      camera.matrixWorld.compose(camera.position, camera.quaternion, camera.scale);
      camera.matrixWorldInverse.copy(camera.matrixWorld).invert();
      const near2 = near + zOffset;
      const far2 = far + zOffset;
      const left2 = left - xOffset;
      const right2 = right + (ipd - xOffset);
      const top2 = topFov * far / far2 * near2;
      const bottom2 = bottomFov * far / far2 * near2;
      camera.projectionMatrix.makePerspective(left2, right2, top2, bottom2, near2, far2);
    }
    function updateCamera2(camera, parent) {
      if (parent === null) {
        camera.matrixWorld.copy(camera.matrix);
      } else {
        camera.matrixWorld.multiplyMatrices(parent.matrixWorld, camera.matrix);
      }
      camera.matrixWorldInverse.copy(camera.matrixWorld).invert();
    }
    this.updateCamera = function(camera) {
      if (session === null)
        return;
      cameraVR.near = cameraR.near = cameraL.near = camera.near;
      cameraVR.far = cameraR.far = cameraL.far = camera.far;
      if (_currentDepthNear !== cameraVR.near || _currentDepthFar !== cameraVR.far) {
        session.updateRenderState({
          depthNear: cameraVR.near,
          depthFar: cameraVR.far
        });
        _currentDepthNear = cameraVR.near;
        _currentDepthFar = cameraVR.far;
      }
      const parent = camera.parent;
      const cameras2 = cameraVR.cameras;
      updateCamera2(cameraVR, parent);
      for (let i2 = 0; i2 < cameras2.length; i2++) {
        updateCamera2(cameras2[i2], parent);
      }
      cameraVR.matrixWorld.decompose(cameraVR.position, cameraVR.quaternion, cameraVR.scale);
      camera.position.copy(cameraVR.position);
      camera.quaternion.copy(cameraVR.quaternion);
      camera.scale.copy(cameraVR.scale);
      camera.matrix.copy(cameraVR.matrix);
      camera.matrixWorld.copy(cameraVR.matrixWorld);
      const children = camera.children;
      for (let i2 = 0, l = children.length; i2 < l; i2++) {
        children[i2].updateMatrixWorld(true);
      }
      if (cameras2.length === 2) {
        setProjectionFromUnion(cameraVR, cameraL, cameraR);
      } else {
        cameraVR.projectionMatrix.copy(cameraL.projectionMatrix);
      }
    };
    this.getCamera = function() {
      return cameraVR;
    };
    this.getFoveation = function() {
      if (glProjLayer !== null) {
        return glProjLayer.fixedFoveation;
      }
      if (glBaseLayer !== null) {
        return glBaseLayer.fixedFoveation;
      }
      return void 0;
    };
    this.setFoveation = function(foveation) {
      if (glProjLayer !== null) {
        glProjLayer.fixedFoveation = foveation;
      }
      if (glBaseLayer !== null && glBaseLayer.fixedFoveation !== void 0) {
        glBaseLayer.fixedFoveation = foveation;
      }
    };
    let onAnimationFrameCallback = null;
    function onAnimationFrame(time2, frame) {
      pose = frame.getViewerPose(referenceSpace);
      xrFrame = frame;
      if (pose !== null) {
        const views = pose.views;
        if (glBaseLayer !== null) {
          renderer.setRenderTargetFramebuffer(newRenderTarget, glBaseLayer.framebuffer);
          renderer.setRenderTarget(newRenderTarget);
        }
        let cameraVRNeedsUpdate = false;
        if (views.length !== cameraVR.cameras.length) {
          cameraVR.cameras.length = 0;
          cameraVRNeedsUpdate = true;
        }
        for (let i2 = 0; i2 < views.length; i2++) {
          const view = views[i2];
          let viewport = null;
          if (glBaseLayer !== null) {
            viewport = glBaseLayer.getViewport(view);
          } else {
            const glSubImage = glBinding.getViewSubImage(glProjLayer, view);
            viewport = glSubImage.viewport;
            if (i2 === 0) {
              renderer.setRenderTargetTextures(
                newRenderTarget,
                glSubImage.colorTexture,
                glProjLayer.ignoreDepthValues ? void 0 : glSubImage.depthStencilTexture
              );
              renderer.setRenderTarget(newRenderTarget);
            }
          }
          const camera = cameras[i2];
          camera.matrix.fromArray(view.transform.matrix);
          camera.projectionMatrix.fromArray(view.projectionMatrix);
          camera.viewport.set(viewport.x, viewport.y, viewport.width, viewport.height);
          if (i2 === 0) {
            cameraVR.matrix.copy(camera.matrix);
          }
          if (cameraVRNeedsUpdate === true) {
            cameraVR.cameras.push(camera);
          }
        }
      }
      const inputSources = session.inputSources;
      for (let i2 = 0; i2 < controllers.length; i2++) {
        const controller = controllers[i2];
        const inputSource = inputSources[i2];
        controller.update(inputSource, frame, referenceSpace);
      }
      if (onAnimationFrameCallback)
        onAnimationFrameCallback(time2, frame);
      xrFrame = null;
    }
    const animation = new WebGLAnimation();
    animation.setAnimationLoop(onAnimationFrame);
    this.setAnimationLoop = function(callback) {
      onAnimationFrameCallback = callback;
    };
    this.dispose = function() {
    };
  }
};
function WebGLMaterials(renderer, properties) {
  function refreshFogUniforms(uniforms, fog) {
    uniforms.fogColor.value.copy(fog.color);
    if (fog.isFog) {
      uniforms.fogNear.value = fog.near;
      uniforms.fogFar.value = fog.far;
    } else if (fog.isFogExp2) {
      uniforms.fogDensity.value = fog.density;
    }
  }
  function refreshMaterialUniforms(uniforms, material, pixelRatio, height, transmissionRenderTarget) {
    if (material.isMeshBasicMaterial) {
      refreshUniformsCommon(uniforms, material);
    } else if (material.isMeshLambertMaterial) {
      refreshUniformsCommon(uniforms, material);
    } else if (material.isMeshToonMaterial) {
      refreshUniformsCommon(uniforms, material);
      refreshUniformsToon(uniforms, material);
    } else if (material.isMeshPhongMaterial) {
      refreshUniformsCommon(uniforms, material);
      refreshUniformsPhong(uniforms, material);
    } else if (material.isMeshStandardMaterial) {
      refreshUniformsCommon(uniforms, material);
      refreshUniformsStandard(uniforms, material);
      if (material.isMeshPhysicalMaterial) {
        refreshUniformsPhysical(uniforms, material, transmissionRenderTarget);
      }
    } else if (material.isMeshMatcapMaterial) {
      refreshUniformsCommon(uniforms, material);
      refreshUniformsMatcap(uniforms, material);
    } else if (material.isMeshDepthMaterial) {
      refreshUniformsCommon(uniforms, material);
    } else if (material.isMeshDistanceMaterial) {
      refreshUniformsCommon(uniforms, material);
      refreshUniformsDistance(uniforms, material);
    } else if (material.isMeshNormalMaterial) {
      refreshUniformsCommon(uniforms, material);
    } else if (material.isLineBasicMaterial) {
      refreshUniformsLine(uniforms, material);
      if (material.isLineDashedMaterial) {
        refreshUniformsDash(uniforms, material);
      }
    } else if (material.isPointsMaterial) {
      refreshUniformsPoints(uniforms, material, pixelRatio, height);
    } else if (material.isSpriteMaterial) {
      refreshUniformsSprites(uniforms, material);
    } else if (material.isShadowMaterial) {
      uniforms.color.value.copy(material.color);
      uniforms.opacity.value = material.opacity;
    } else if (material.isShaderMaterial) {
      material.uniformsNeedUpdate = false;
    }
  }
  function refreshUniformsCommon(uniforms, material) {
    uniforms.opacity.value = material.opacity;
    if (material.color) {
      uniforms.diffuse.value.copy(material.color);
    }
    if (material.emissive) {
      uniforms.emissive.value.copy(material.emissive).multiplyScalar(material.emissiveIntensity);
    }
    if (material.map) {
      uniforms.map.value = material.map;
    }
    if (material.alphaMap) {
      uniforms.alphaMap.value = material.alphaMap;
    }
    if (material.bumpMap) {
      uniforms.bumpMap.value = material.bumpMap;
      uniforms.bumpScale.value = material.bumpScale;
      if (material.side === BackSide)
        uniforms.bumpScale.value *= -1;
    }
    if (material.displacementMap) {
      uniforms.displacementMap.value = material.displacementMap;
      uniforms.displacementScale.value = material.displacementScale;
      uniforms.displacementBias.value = material.displacementBias;
    }
    if (material.emissiveMap) {
      uniforms.emissiveMap.value = material.emissiveMap;
    }
    if (material.normalMap) {
      uniforms.normalMap.value = material.normalMap;
      uniforms.normalScale.value.copy(material.normalScale);
      if (material.side === BackSide)
        uniforms.normalScale.value.negate();
    }
    if (material.specularMap) {
      uniforms.specularMap.value = material.specularMap;
    }
    if (material.alphaTest > 0) {
      uniforms.alphaTest.value = material.alphaTest;
    }
    const envMap = properties.get(material).envMap;
    if (envMap) {
      uniforms.envMap.value = envMap;
      uniforms.flipEnvMap.value = envMap.isCubeTexture && envMap.isRenderTargetTexture === false ? -1 : 1;
      uniforms.reflectivity.value = material.reflectivity;
      uniforms.ior.value = material.ior;
      uniforms.refractionRatio.value = material.refractionRatio;
    }
    if (material.lightMap) {
      uniforms.lightMap.value = material.lightMap;
      const scaleFactor = renderer.physicallyCorrectLights !== true ? Math.PI : 1;
      uniforms.lightMapIntensity.value = material.lightMapIntensity * scaleFactor;
    }
    if (material.aoMap) {
      uniforms.aoMap.value = material.aoMap;
      uniforms.aoMapIntensity.value = material.aoMapIntensity;
    }
    let uvScaleMap;
    if (material.map) {
      uvScaleMap = material.map;
    } else if (material.specularMap) {
      uvScaleMap = material.specularMap;
    } else if (material.displacementMap) {
      uvScaleMap = material.displacementMap;
    } else if (material.normalMap) {
      uvScaleMap = material.normalMap;
    } else if (material.bumpMap) {
      uvScaleMap = material.bumpMap;
    } else if (material.roughnessMap) {
      uvScaleMap = material.roughnessMap;
    } else if (material.metalnessMap) {
      uvScaleMap = material.metalnessMap;
    } else if (material.alphaMap) {
      uvScaleMap = material.alphaMap;
    } else if (material.emissiveMap) {
      uvScaleMap = material.emissiveMap;
    } else if (material.clearcoatMap) {
      uvScaleMap = material.clearcoatMap;
    } else if (material.clearcoatNormalMap) {
      uvScaleMap = material.clearcoatNormalMap;
    } else if (material.clearcoatRoughnessMap) {
      uvScaleMap = material.clearcoatRoughnessMap;
    } else if (material.specularIntensityMap) {
      uvScaleMap = material.specularIntensityMap;
    } else if (material.specularColorMap) {
      uvScaleMap = material.specularColorMap;
    } else if (material.transmissionMap) {
      uvScaleMap = material.transmissionMap;
    } else if (material.thicknessMap) {
      uvScaleMap = material.thicknessMap;
    } else if (material.sheenColorMap) {
      uvScaleMap = material.sheenColorMap;
    } else if (material.sheenRoughnessMap) {
      uvScaleMap = material.sheenRoughnessMap;
    }
    if (uvScaleMap !== void 0) {
      if (uvScaleMap.isWebGLRenderTarget) {
        uvScaleMap = uvScaleMap.texture;
      }
      if (uvScaleMap.matrixAutoUpdate === true) {
        uvScaleMap.updateMatrix();
      }
      uniforms.uvTransform.value.copy(uvScaleMap.matrix);
    }
    let uv2ScaleMap;
    if (material.aoMap) {
      uv2ScaleMap = material.aoMap;
    } else if (material.lightMap) {
      uv2ScaleMap = material.lightMap;
    }
    if (uv2ScaleMap !== void 0) {
      if (uv2ScaleMap.isWebGLRenderTarget) {
        uv2ScaleMap = uv2ScaleMap.texture;
      }
      if (uv2ScaleMap.matrixAutoUpdate === true) {
        uv2ScaleMap.updateMatrix();
      }
      uniforms.uv2Transform.value.copy(uv2ScaleMap.matrix);
    }
  }
  function refreshUniformsLine(uniforms, material) {
    uniforms.diffuse.value.copy(material.color);
    uniforms.opacity.value = material.opacity;
  }
  function refreshUniformsDash(uniforms, material) {
    uniforms.dashSize.value = material.dashSize;
    uniforms.totalSize.value = material.dashSize + material.gapSize;
    uniforms.scale.value = material.scale;
  }
  function refreshUniformsPoints(uniforms, material, pixelRatio, height) {
    uniforms.diffuse.value.copy(material.color);
    uniforms.opacity.value = material.opacity;
    uniforms.size.value = material.size * pixelRatio;
    uniforms.scale.value = height * 0.5;
    if (material.map) {
      uniforms.map.value = material.map;
    }
    if (material.alphaMap) {
      uniforms.alphaMap.value = material.alphaMap;
    }
    if (material.alphaTest > 0) {
      uniforms.alphaTest.value = material.alphaTest;
    }
    let uvScaleMap;
    if (material.map) {
      uvScaleMap = material.map;
    } else if (material.alphaMap) {
      uvScaleMap = material.alphaMap;
    }
    if (uvScaleMap !== void 0) {
      if (uvScaleMap.matrixAutoUpdate === true) {
        uvScaleMap.updateMatrix();
      }
      uniforms.uvTransform.value.copy(uvScaleMap.matrix);
    }
  }
  function refreshUniformsSprites(uniforms, material) {
    uniforms.diffuse.value.copy(material.color);
    uniforms.opacity.value = material.opacity;
    uniforms.rotation.value = material.rotation;
    if (material.map) {
      uniforms.map.value = material.map;
    }
    if (material.alphaMap) {
      uniforms.alphaMap.value = material.alphaMap;
    }
    if (material.alphaTest > 0) {
      uniforms.alphaTest.value = material.alphaTest;
    }
    let uvScaleMap;
    if (material.map) {
      uvScaleMap = material.map;
    } else if (material.alphaMap) {
      uvScaleMap = material.alphaMap;
    }
    if (uvScaleMap !== void 0) {
      if (uvScaleMap.matrixAutoUpdate === true) {
        uvScaleMap.updateMatrix();
      }
      uniforms.uvTransform.value.copy(uvScaleMap.matrix);
    }
  }
  function refreshUniformsPhong(uniforms, material) {
    uniforms.specular.value.copy(material.specular);
    uniforms.shininess.value = Math.max(material.shininess, 1e-4);
  }
  function refreshUniformsToon(uniforms, material) {
    if (material.gradientMap) {
      uniforms.gradientMap.value = material.gradientMap;
    }
  }
  function refreshUniformsStandard(uniforms, material) {
    uniforms.roughness.value = material.roughness;
    uniforms.metalness.value = material.metalness;
    if (material.roughnessMap) {
      uniforms.roughnessMap.value = material.roughnessMap;
    }
    if (material.metalnessMap) {
      uniforms.metalnessMap.value = material.metalnessMap;
    }
    const envMap = properties.get(material).envMap;
    if (envMap) {
      uniforms.envMapIntensity.value = material.envMapIntensity;
    }
  }
  function refreshUniformsPhysical(uniforms, material, transmissionRenderTarget) {
    uniforms.ior.value = material.ior;
    if (material.sheen > 0) {
      uniforms.sheenColor.value.copy(material.sheenColor).multiplyScalar(material.sheen);
      uniforms.sheenRoughness.value = material.sheenRoughness;
      if (material.sheenColorMap) {
        uniforms.sheenColorMap.value = material.sheenColorMap;
      }
      if (material.sheenRoughnessMap) {
        uniforms.sheenRoughnessMap.value = material.sheenRoughnessMap;
      }
    }
    if (material.clearcoat > 0) {
      uniforms.clearcoat.value = material.clearcoat;
      uniforms.clearcoatRoughness.value = material.clearcoatRoughness;
      if (material.clearcoatMap) {
        uniforms.clearcoatMap.value = material.clearcoatMap;
      }
      if (material.clearcoatRoughnessMap) {
        uniforms.clearcoatRoughnessMap.value = material.clearcoatRoughnessMap;
      }
      if (material.clearcoatNormalMap) {
        uniforms.clearcoatNormalScale.value.copy(material.clearcoatNormalScale);
        uniforms.clearcoatNormalMap.value = material.clearcoatNormalMap;
        if (material.side === BackSide) {
          uniforms.clearcoatNormalScale.value.negate();
        }
      }
    }
    if (material.transmission > 0) {
      uniforms.transmission.value = material.transmission;
      uniforms.transmissionSamplerMap.value = transmissionRenderTarget.texture;
      uniforms.transmissionSamplerSize.value.set(transmissionRenderTarget.width, transmissionRenderTarget.height);
      if (material.transmissionMap) {
        uniforms.transmissionMap.value = material.transmissionMap;
      }
      uniforms.thickness.value = material.thickness;
      if (material.thicknessMap) {
        uniforms.thicknessMap.value = material.thicknessMap;
      }
      uniforms.attenuationDistance.value = material.attenuationDistance;
      uniforms.attenuationColor.value.copy(material.attenuationColor);
    }
    uniforms.specularIntensity.value = material.specularIntensity;
    uniforms.specularColor.value.copy(material.specularColor);
    if (material.specularIntensityMap) {
      uniforms.specularIntensityMap.value = material.specularIntensityMap;
    }
    if (material.specularColorMap) {
      uniforms.specularColorMap.value = material.specularColorMap;
    }
  }
  function refreshUniformsMatcap(uniforms, material) {
    if (material.matcap) {
      uniforms.matcap.value = material.matcap;
    }
  }
  function refreshUniformsDistance(uniforms, material) {
    uniforms.referencePosition.value.copy(material.referencePosition);
    uniforms.nearDistance.value = material.nearDistance;
    uniforms.farDistance.value = material.farDistance;
  }
  return {
    refreshFogUniforms,
    refreshMaterialUniforms
  };
}
function createCanvasElement() {
  const canvas = createElementNS("canvas");
  canvas.style.display = "block";
  return canvas;
}
function WebGLRenderer(parameters = {}) {
  const _canvas2 = parameters.canvas !== void 0 ? parameters.canvas : createCanvasElement(), _context2 = parameters.context !== void 0 ? parameters.context : null, _depth = parameters.depth !== void 0 ? parameters.depth : true, _stencil = parameters.stencil !== void 0 ? parameters.stencil : true, _antialias = parameters.antialias !== void 0 ? parameters.antialias : false, _premultipliedAlpha = parameters.premultipliedAlpha !== void 0 ? parameters.premultipliedAlpha : true, _preserveDrawingBuffer = parameters.preserveDrawingBuffer !== void 0 ? parameters.preserveDrawingBuffer : false, _powerPreference = parameters.powerPreference !== void 0 ? parameters.powerPreference : "default", _failIfMajorPerformanceCaveat = parameters.failIfMajorPerformanceCaveat !== void 0 ? parameters.failIfMajorPerformanceCaveat : false;
  let _alpha;
  if (parameters.context !== void 0) {
    _alpha = _context2.getContextAttributes().alpha;
  } else {
    _alpha = parameters.alpha !== void 0 ? parameters.alpha : false;
  }
  let currentRenderList = null;
  let currentRenderState = null;
  const renderListStack = [];
  const renderStateStack = [];
  this.domElement = _canvas2;
  this.debug = {
    /**
     * Enables error checking and reporting when shader programs are being compiled
     * @type {boolean}
     */
    checkShaderErrors: true
  };
  this.autoClear = true;
  this.autoClearColor = true;
  this.autoClearDepth = true;
  this.autoClearStencil = true;
  this.sortObjects = true;
  this.clippingPlanes = [];
  this.localClippingEnabled = false;
  this.outputEncoding = LinearEncoding;
  this.physicallyCorrectLights = false;
  this.toneMapping = NoToneMapping;
  this.toneMappingExposure = 1;
  const _this = this;
  let _isContextLost = false;
  let _currentActiveCubeFace = 0;
  let _currentActiveMipmapLevel = 0;
  let _currentRenderTarget = null;
  let _currentMaterialId = -1;
  let _currentCamera = null;
  const _currentViewport = new Vector4();
  const _currentScissor = new Vector4();
  let _currentScissorTest = null;
  let _width = _canvas2.width;
  let _height = _canvas2.height;
  let _pixelRatio = 1;
  let _opaqueSort = null;
  let _transparentSort = null;
  const _viewport = new Vector4(0, 0, _width, _height);
  const _scissor = new Vector4(0, 0, _width, _height);
  let _scissorTest = false;
  const _frustum = new Frustum();
  let _clippingEnabled = false;
  let _localClippingEnabled = false;
  let _transmissionRenderTarget = null;
  const _projScreenMatrix2 = new Matrix4();
  const _vector22 = new Vector2();
  const _vector32 = new Vector3();
  const _emptyScene = { background: null, fog: null, environment: null, overrideMaterial: null, isScene: true };
  function getTargetPixelRatio() {
    return _currentRenderTarget === null ? _pixelRatio : 1;
  }
  let _gl = _context2;
  function getContext(contextNames, contextAttributes) {
    for (let i2 = 0; i2 < contextNames.length; i2++) {
      const contextName = contextNames[i2];
      const context2 = _canvas2.getContext(contextName, contextAttributes);
      if (context2 !== null)
        return context2;
    }
    return null;
  }
  try {
    const contextAttributes = {
      alpha: true,
      depth: _depth,
      stencil: _stencil,
      antialias: _antialias,
      premultipliedAlpha: _premultipliedAlpha,
      preserveDrawingBuffer: _preserveDrawingBuffer,
      powerPreference: _powerPreference,
      failIfMajorPerformanceCaveat: _failIfMajorPerformanceCaveat
    };
    if ("setAttribute" in _canvas2)
      _canvas2.setAttribute("data-engine", `three.js r${REVISION}`);
    _canvas2.addEventListener("webglcontextlost", onContextLost, false);
    _canvas2.addEventListener("webglcontextrestored", onContextRestore, false);
    if (_gl === null) {
      const contextNames = ["webgl2", "webgl", "experimental-webgl"];
      if (_this.isWebGL1Renderer === true) {
        contextNames.shift();
      }
      _gl = getContext(contextNames, contextAttributes);
      if (_gl === null) {
        if (getContext(contextNames)) {
          throw new Error("Error creating WebGL context with your selected attributes.");
        } else {
          throw new Error("Error creating WebGL context.");
        }
      }
    }
    if (_gl.getShaderPrecisionFormat === void 0) {
      _gl.getShaderPrecisionFormat = function() {
        return { "rangeMin": 1, "rangeMax": 1, "precision": 1 };
      };
    }
  } catch (error) {
    console.error("THREE.WebGLRenderer: " + error.message);
    throw error;
  }
  let extensions2, capabilities, state, info;
  let properties, textures, cubemaps, cubeuvmaps, attributes, geometries, objects;
  let programCache, materials, renderLists, renderStates, clipping, shadowMap;
  let background2, morphtargets, bufferRenderer, indexedBufferRenderer;
  let utils, bindingStates;
  function initGLContext() {
    extensions2 = new WebGLExtensions(_gl);
    capabilities = new WebGLCapabilities(_gl, extensions2, parameters);
    extensions2.init(capabilities);
    utils = new WebGLUtils(_gl, extensions2, capabilities);
    state = new WebGLState(_gl, extensions2, capabilities);
    info = new WebGLInfo(_gl);
    properties = new WebGLProperties();
    textures = new WebGLTextures(_gl, extensions2, state, properties, capabilities, utils, info);
    cubemaps = new WebGLCubeMaps(_this);
    cubeuvmaps = new WebGLCubeUVMaps(_this);
    attributes = new WebGLAttributes(_gl, capabilities);
    bindingStates = new WebGLBindingStates(_gl, extensions2, attributes, capabilities);
    geometries = new WebGLGeometries(_gl, attributes, info, bindingStates);
    objects = new WebGLObjects(_gl, geometries, attributes, info);
    morphtargets = new WebGLMorphtargets(_gl, capabilities, textures);
    clipping = new WebGLClipping(properties);
    programCache = new WebGLPrograms(_this, cubemaps, cubeuvmaps, extensions2, capabilities, bindingStates, clipping);
    materials = new WebGLMaterials(_this, properties);
    renderLists = new WebGLRenderLists();
    renderStates = new WebGLRenderStates(extensions2, capabilities);
    background2 = new WebGLBackground(_this, cubemaps, state, objects, _alpha, _premultipliedAlpha);
    shadowMap = new WebGLShadowMap(_this, objects, capabilities);
    bufferRenderer = new WebGLBufferRenderer(_gl, extensions2, info, capabilities);
    indexedBufferRenderer = new WebGLIndexedBufferRenderer(_gl, extensions2, info, capabilities);
    info.programs = programCache.programs;
    _this.capabilities = capabilities;
    _this.extensions = extensions2;
    _this.properties = properties;
    _this.renderLists = renderLists;
    _this.shadowMap = shadowMap;
    _this.state = state;
    _this.info = info;
  }
  initGLContext();
  const xr = new WebXRManager(_this, _gl);
  this.xr = xr;
  this.getContext = function() {
    return _gl;
  };
  this.getContextAttributes = function() {
    return _gl.getContextAttributes();
  };
  this.forceContextLoss = function() {
    const extension = extensions2.get("WEBGL_lose_context");
    if (extension)
      extension.loseContext();
  };
  this.forceContextRestore = function() {
    const extension = extensions2.get("WEBGL_lose_context");
    if (extension)
      extension.restoreContext();
  };
  this.getPixelRatio = function() {
    return _pixelRatio;
  };
  this.setPixelRatio = function(value) {
    if (value === void 0)
      return;
    _pixelRatio = value;
    this.setSize(_width, _height, false);
  };
  this.getSize = function(target) {
    return target.set(_width, _height);
  };
  this.setSize = function(width, height, updateStyle) {
    if (xr.isPresenting) {
      console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");
      return;
    }
    _width = width;
    _height = height;
    _canvas2.width = Math.floor(width * _pixelRatio);
    _canvas2.height = Math.floor(height * _pixelRatio);
    if (updateStyle !== false) {
      _canvas2.style.width = width + "px";
      _canvas2.style.height = height + "px";
    }
    this.setViewport(0, 0, width, height);
  };
  this.getDrawingBufferSize = function(target) {
    return target.set(_width * _pixelRatio, _height * _pixelRatio).floor();
  };
  this.setDrawingBufferSize = function(width, height, pixelRatio) {
    _width = width;
    _height = height;
    _pixelRatio = pixelRatio;
    _canvas2.width = Math.floor(width * pixelRatio);
    _canvas2.height = Math.floor(height * pixelRatio);
    this.setViewport(0, 0, width, height);
  };
  this.getCurrentViewport = function(target) {
    return target.copy(_currentViewport);
  };
  this.getViewport = function(target) {
    return target.copy(_viewport);
  };
  this.setViewport = function(x2, y2, width, height) {
    if (x2.isVector4) {
      _viewport.set(x2.x, x2.y, x2.z, x2.w);
    } else {
      _viewport.set(x2, y2, width, height);
    }
    state.viewport(_currentViewport.copy(_viewport).multiplyScalar(_pixelRatio).floor());
  };
  this.getScissor = function(target) {
    return target.copy(_scissor);
  };
  this.setScissor = function(x2, y2, width, height) {
    if (x2.isVector4) {
      _scissor.set(x2.x, x2.y, x2.z, x2.w);
    } else {
      _scissor.set(x2, y2, width, height);
    }
    state.scissor(_currentScissor.copy(_scissor).multiplyScalar(_pixelRatio).floor());
  };
  this.getScissorTest = function() {
    return _scissorTest;
  };
  this.setScissorTest = function(boolean) {
    state.setScissorTest(_scissorTest = boolean);
  };
  this.setOpaqueSort = function(method) {
    _opaqueSort = method;
  };
  this.setTransparentSort = function(method) {
    _transparentSort = method;
  };
  this.getClearColor = function(target) {
    return target.copy(background2.getClearColor());
  };
  this.setClearColor = function() {
    background2.setClearColor.apply(background2, arguments);
  };
  this.getClearAlpha = function() {
    return background2.getClearAlpha();
  };
  this.setClearAlpha = function() {
    background2.setClearAlpha.apply(background2, arguments);
  };
  this.clear = function(color2 = true, depth = true, stencil = true) {
    let bits = 0;
    if (color2)
      bits |= 16384;
    if (depth)
      bits |= 256;
    if (stencil)
      bits |= 1024;
    _gl.clear(bits);
  };
  this.clearColor = function() {
    this.clear(true, false, false);
  };
  this.clearDepth = function() {
    this.clear(false, true, false);
  };
  this.clearStencil = function() {
    this.clear(false, false, true);
  };
  this.dispose = function() {
    _canvas2.removeEventListener("webglcontextlost", onContextLost, false);
    _canvas2.removeEventListener("webglcontextrestored", onContextRestore, false);
    renderLists.dispose();
    renderStates.dispose();
    properties.dispose();
    cubemaps.dispose();
    cubeuvmaps.dispose();
    objects.dispose();
    bindingStates.dispose();
    programCache.dispose();
    xr.dispose();
    xr.removeEventListener("sessionstart", onXRSessionStart);
    xr.removeEventListener("sessionend", onXRSessionEnd);
    if (_transmissionRenderTarget) {
      _transmissionRenderTarget.dispose();
      _transmissionRenderTarget = null;
    }
    animation.stop();
  };
  function onContextLost(event) {
    event.preventDefault();
    console.log("THREE.WebGLRenderer: Context Lost.");
    _isContextLost = true;
  }
  function onContextRestore() {
    console.log("THREE.WebGLRenderer: Context Restored.");
    _isContextLost = false;
    const infoAutoReset = info.autoReset;
    const shadowMapEnabled = shadowMap.enabled;
    const shadowMapAutoUpdate = shadowMap.autoUpdate;
    const shadowMapNeedsUpdate = shadowMap.needsUpdate;
    const shadowMapType = shadowMap.type;
    initGLContext();
    info.autoReset = infoAutoReset;
    shadowMap.enabled = shadowMapEnabled;
    shadowMap.autoUpdate = shadowMapAutoUpdate;
    shadowMap.needsUpdate = shadowMapNeedsUpdate;
    shadowMap.type = shadowMapType;
  }
  function onMaterialDispose(event) {
    const material = event.target;
    material.removeEventListener("dispose", onMaterialDispose);
    deallocateMaterial(material);
  }
  function deallocateMaterial(material) {
    releaseMaterialProgramReferences(material);
    properties.remove(material);
  }
  function releaseMaterialProgramReferences(material) {
    const programs = properties.get(material).programs;
    if (programs !== void 0) {
      programs.forEach(function(program) {
        programCache.releaseProgram(program);
      });
      if (material.isShaderMaterial) {
        programCache.releaseShaderCache(material);
      }
    }
  }
  this.renderBufferDirect = function(camera, scene, geometry, material, object, group) {
    if (scene === null)
      scene = _emptyScene;
    const frontFaceCW = object.isMesh && object.matrixWorld.determinant() < 0;
    const program = setProgram(camera, scene, geometry, material, object);
    state.setMaterial(material, frontFaceCW);
    let index = geometry.index;
    const position2 = geometry.attributes.position;
    if (index === null) {
      if (position2 === void 0 || position2.count === 0)
        return;
    } else if (index.count === 0) {
      return;
    }
    let rangeFactor = 1;
    if (material.wireframe === true) {
      index = geometries.getWireframeAttribute(geometry);
      rangeFactor = 2;
    }
    bindingStates.setup(object, material, program, geometry, index);
    let attribute;
    let renderer = bufferRenderer;
    if (index !== null) {
      attribute = attributes.get(index);
      renderer = indexedBufferRenderer;
      renderer.setIndex(attribute);
    }
    const dataCount = index !== null ? index.count : position2.count;
    const rangeStart = geometry.drawRange.start * rangeFactor;
    const rangeCount = geometry.drawRange.count * rangeFactor;
    const groupStart = group !== null ? group.start * rangeFactor : 0;
    const groupCount = group !== null ? group.count * rangeFactor : Infinity;
    const drawStart = Math.max(rangeStart, groupStart);
    const drawEnd = Math.min(dataCount, rangeStart + rangeCount, groupStart + groupCount) - 1;
    const drawCount = Math.max(0, drawEnd - drawStart + 1);
    if (drawCount === 0)
      return;
    if (object.isMesh) {
      if (material.wireframe === true) {
        state.setLineWidth(material.wireframeLinewidth * getTargetPixelRatio());
        renderer.setMode(1);
      } else {
        renderer.setMode(4);
      }
    } else if (object.isLine) {
      let lineWidth2 = material.linewidth;
      if (lineWidth2 === void 0)
        lineWidth2 = 1;
      state.setLineWidth(lineWidth2 * getTargetPixelRatio());
      if (object.isLineSegments) {
        renderer.setMode(1);
      } else if (object.isLineLoop) {
        renderer.setMode(2);
      } else {
        renderer.setMode(3);
      }
    } else if (object.isPoints) {
      renderer.setMode(0);
    } else if (object.isSprite) {
      renderer.setMode(4);
    }
    if (object.isInstancedMesh) {
      renderer.renderInstances(drawStart, drawCount, object.count);
    } else if (geometry.isInstancedBufferGeometry) {
      const instanceCount = Math.min(geometry.instanceCount, geometry._maxInstanceCount);
      renderer.renderInstances(drawStart, drawCount, instanceCount);
    } else {
      renderer.render(drawStart, drawCount);
    }
  };
  this.compile = function(scene, camera) {
    currentRenderState = renderStates.get(scene);
    currentRenderState.init();
    renderStateStack.push(currentRenderState);
    scene.traverseVisible(function(object) {
      if (object.isLight && object.layers.test(camera.layers)) {
        currentRenderState.pushLight(object);
        if (object.castShadow) {
          currentRenderState.pushShadow(object);
        }
      }
    });
    currentRenderState.setupLights(_this.physicallyCorrectLights);
    scene.traverse(function(object) {
      const material = object.material;
      if (material) {
        if (Array.isArray(material)) {
          for (let i2 = 0; i2 < material.length; i2++) {
            const material2 = material[i2];
            getProgram(material2, scene, object);
          }
        } else {
          getProgram(material, scene, object);
        }
      }
    });
    renderStateStack.pop();
    currentRenderState = null;
  };
  let onAnimationFrameCallback = null;
  function onAnimationFrame(time2) {
    if (onAnimationFrameCallback)
      onAnimationFrameCallback(time2);
  }
  function onXRSessionStart() {
    animation.stop();
  }
  function onXRSessionEnd() {
    animation.start();
  }
  const animation = new WebGLAnimation();
  animation.setAnimationLoop(onAnimationFrame);
  if (typeof self !== "undefined")
    animation.setContext(self);
  this.setAnimationLoop = function(callback) {
    onAnimationFrameCallback = callback;
    xr.setAnimationLoop(callback);
    callback === null ? animation.stop() : animation.start();
  };
  xr.addEventListener("sessionstart", onXRSessionStart);
  xr.addEventListener("sessionend", onXRSessionEnd);
  this.render = function(scene, camera) {
    if (camera !== void 0 && camera.isCamera !== true) {
      console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");
      return;
    }
    if (_isContextLost === true)
      return;
    if (scene.autoUpdate === true)
      scene.updateMatrixWorld();
    if (camera.parent === null)
      camera.updateMatrixWorld();
    if (xr.enabled === true && xr.isPresenting === true) {
      if (xr.cameraAutoUpdate === true)
        xr.updateCamera(camera);
      camera = xr.getCamera();
    }
    if (scene.isScene === true)
      scene.onBeforeRender(_this, scene, camera, _currentRenderTarget);
    currentRenderState = renderStates.get(scene, renderStateStack.length);
    currentRenderState.init();
    renderStateStack.push(currentRenderState);
    _projScreenMatrix2.multiplyMatrices(camera.projectionMatrix, camera.matrixWorldInverse);
    _frustum.setFromProjectionMatrix(_projScreenMatrix2);
    _localClippingEnabled = this.localClippingEnabled;
    _clippingEnabled = clipping.init(this.clippingPlanes, _localClippingEnabled, camera);
    currentRenderList = renderLists.get(scene, renderListStack.length);
    currentRenderList.init();
    renderListStack.push(currentRenderList);
    projectObject(scene, camera, 0, _this.sortObjects);
    currentRenderList.finish();
    if (_this.sortObjects === true) {
      currentRenderList.sort(_opaqueSort, _transparentSort);
    }
    if (_clippingEnabled === true)
      clipping.beginShadows();
    const shadowsArray = currentRenderState.state.shadowsArray;
    shadowMap.render(shadowsArray, scene, camera);
    if (_clippingEnabled === true)
      clipping.endShadows();
    if (this.info.autoReset === true)
      this.info.reset();
    background2.render(currentRenderList, scene);
    currentRenderState.setupLights(_this.physicallyCorrectLights);
    if (camera.isArrayCamera) {
      const cameras = camera.cameras;
      for (let i2 = 0, l = cameras.length; i2 < l; i2++) {
        const camera2 = cameras[i2];
        renderScene(currentRenderList, scene, camera2, camera2.viewport);
      }
    } else {
      renderScene(currentRenderList, scene, camera);
    }
    if (_currentRenderTarget !== null) {
      textures.updateMultisampleRenderTarget(_currentRenderTarget);
      textures.updateRenderTargetMipmap(_currentRenderTarget);
    }
    if (scene.isScene === true)
      scene.onAfterRender(_this, scene, camera);
    bindingStates.resetDefaultState();
    _currentMaterialId = -1;
    _currentCamera = null;
    renderStateStack.pop();
    if (renderStateStack.length > 0) {
      currentRenderState = renderStateStack[renderStateStack.length - 1];
    } else {
      currentRenderState = null;
    }
    renderListStack.pop();
    if (renderListStack.length > 0) {
      currentRenderList = renderListStack[renderListStack.length - 1];
    } else {
      currentRenderList = null;
    }
  };
  function projectObject(object, camera, groupOrder, sortObjects) {
    if (object.visible === false)
      return;
    const visible = object.layers.test(camera.layers);
    if (visible) {
      if (object.isGroup) {
        groupOrder = object.renderOrder;
      } else if (object.isLOD) {
        if (object.autoUpdate === true)
          object.update(camera);
      } else if (object.isLight) {
        currentRenderState.pushLight(object);
        if (object.castShadow) {
          currentRenderState.pushShadow(object);
        }
      } else if (object.isSprite) {
        if (!object.frustumCulled || _frustum.intersectsSprite(object)) {
          if (sortObjects) {
            _vector32.setFromMatrixPosition(object.matrixWorld).applyMatrix4(_projScreenMatrix2);
          }
          const geometry = objects.update(object);
          const material = object.material;
          if (material.visible) {
            currentRenderList.push(object, geometry, material, groupOrder, _vector32.z, null);
          }
        }
      } else if (object.isMesh || object.isLine || object.isPoints) {
        if (object.isSkinnedMesh) {
          if (object.skeleton.frame !== info.render.frame) {
            object.skeleton.update();
            object.skeleton.frame = info.render.frame;
          }
        }
        if (!object.frustumCulled || _frustum.intersectsObject(object)) {
          if (sortObjects) {
            _vector32.setFromMatrixPosition(object.matrixWorld).applyMatrix4(_projScreenMatrix2);
          }
          const geometry = objects.update(object);
          const material = object.material;
          if (Array.isArray(material)) {
            const groups = geometry.groups;
            for (let i2 = 0, l = groups.length; i2 < l; i2++) {
              const group = groups[i2];
              const groupMaterial = material[group.materialIndex];
              if (groupMaterial && groupMaterial.visible) {
                currentRenderList.push(object, geometry, groupMaterial, groupOrder, _vector32.z, group);
              }
            }
          } else if (material.visible) {
            currentRenderList.push(object, geometry, material, groupOrder, _vector32.z, null);
          }
        }
      }
    }
    const children = object.children;
    for (let i2 = 0, l = children.length; i2 < l; i2++) {
      projectObject(children[i2], camera, groupOrder, sortObjects);
    }
  }
  function renderScene(currentRenderList2, scene, camera, viewport) {
    const opaqueObjects = currentRenderList2.opaque;
    const transmissiveObjects = currentRenderList2.transmissive;
    const transparentObjects = currentRenderList2.transparent;
    currentRenderState.setupLightsView(camera);
    if (transmissiveObjects.length > 0)
      renderTransmissionPass(opaqueObjects, scene, camera);
    if (viewport)
      state.viewport(_currentViewport.copy(viewport));
    if (opaqueObjects.length > 0)
      renderObjects(opaqueObjects, scene, camera);
    if (transmissiveObjects.length > 0)
      renderObjects(transmissiveObjects, scene, camera);
    if (transparentObjects.length > 0)
      renderObjects(transparentObjects, scene, camera);
    state.buffers.depth.setTest(true);
    state.buffers.depth.setMask(true);
    state.buffers.color.setMask(true);
    state.setPolygonOffset(false);
  }
  function renderTransmissionPass(opaqueObjects, scene, camera) {
    const isWebGL2 = capabilities.isWebGL2;
    if (_transmissionRenderTarget === null) {
      _transmissionRenderTarget = new WebGLRenderTarget(1, 1, {
        generateMipmaps: true,
        type: utils.convert(HalfFloatType) !== null ? HalfFloatType : UnsignedByteType,
        minFilter: LinearMipmapLinearFilter,
        samples: isWebGL2 && _antialias === true ? 4 : 0
      });
    }
    _this.getDrawingBufferSize(_vector22);
    if (isWebGL2) {
      _transmissionRenderTarget.setSize(_vector22.x, _vector22.y);
    } else {
      _transmissionRenderTarget.setSize(floorPowerOfTwo(_vector22.x), floorPowerOfTwo(_vector22.y));
    }
    const currentRenderTarget = _this.getRenderTarget();
    _this.setRenderTarget(_transmissionRenderTarget);
    _this.clear();
    const currentToneMapping = _this.toneMapping;
    _this.toneMapping = NoToneMapping;
    renderObjects(opaqueObjects, scene, camera);
    _this.toneMapping = currentToneMapping;
    textures.updateMultisampleRenderTarget(_transmissionRenderTarget);
    textures.updateRenderTargetMipmap(_transmissionRenderTarget);
    _this.setRenderTarget(currentRenderTarget);
  }
  function renderObjects(renderList, scene, camera) {
    const overrideMaterial = scene.isScene === true ? scene.overrideMaterial : null;
    for (let i2 = 0, l = renderList.length; i2 < l; i2++) {
      const renderItem = renderList[i2];
      const object = renderItem.object;
      const geometry = renderItem.geometry;
      const material = overrideMaterial === null ? renderItem.material : overrideMaterial;
      const group = renderItem.group;
      if (object.layers.test(camera.layers)) {
        renderObject(object, scene, camera, geometry, material, group);
      }
    }
  }
  function renderObject(object, scene, camera, geometry, material, group) {
    object.onBeforeRender(_this, scene, camera, geometry, material, group);
    object.modelViewMatrix.multiplyMatrices(camera.matrixWorldInverse, object.matrixWorld);
    object.normalMatrix.getNormalMatrix(object.modelViewMatrix);
    material.onBeforeRender(_this, scene, camera, geometry, object, group);
    if (material.transparent === true && material.side === DoubleSide) {
      material.side = BackSide;
      material.needsUpdate = true;
      _this.renderBufferDirect(camera, scene, geometry, material, object, group);
      material.side = FrontSide;
      material.needsUpdate = true;
      _this.renderBufferDirect(camera, scene, geometry, material, object, group);
      material.side = DoubleSide;
    } else {
      _this.renderBufferDirect(camera, scene, geometry, material, object, group);
    }
    object.onAfterRender(_this, scene, camera, geometry, material, group);
  }
  function getProgram(material, scene, object) {
    if (scene.isScene !== true)
      scene = _emptyScene;
    const materialProperties = properties.get(material);
    const lights = currentRenderState.state.lights;
    const shadowsArray = currentRenderState.state.shadowsArray;
    const lightsStateVersion = lights.state.version;
    const parameters2 = programCache.getParameters(material, lights.state, shadowsArray, scene, object);
    const programCacheKey = programCache.getProgramCacheKey(parameters2);
    let programs = materialProperties.programs;
    materialProperties.environment = material.isMeshStandardMaterial ? scene.environment : null;
    materialProperties.fog = scene.fog;
    materialProperties.envMap = (material.isMeshStandardMaterial ? cubeuvmaps : cubemaps).get(material.envMap || materialProperties.environment);
    if (programs === void 0) {
      material.addEventListener("dispose", onMaterialDispose);
      programs = /* @__PURE__ */ new Map();
      materialProperties.programs = programs;
    }
    let program = programs.get(programCacheKey);
    if (program !== void 0) {
      if (materialProperties.currentProgram === program && materialProperties.lightsStateVersion === lightsStateVersion) {
        updateCommonMaterialProperties(material, parameters2);
        return program;
      }
    } else {
      parameters2.uniforms = programCache.getUniforms(material);
      material.onBuild(object, parameters2, _this);
      material.onBeforeCompile(parameters2, _this);
      program = programCache.acquireProgram(parameters2, programCacheKey);
      programs.set(programCacheKey, program);
      materialProperties.uniforms = parameters2.uniforms;
    }
    const uniforms = materialProperties.uniforms;
    if (!material.isShaderMaterial && !material.isRawShaderMaterial || material.clipping === true) {
      uniforms.clippingPlanes = clipping.uniform;
    }
    updateCommonMaterialProperties(material, parameters2);
    materialProperties.needsLights = materialNeedsLights(material);
    materialProperties.lightsStateVersion = lightsStateVersion;
    if (materialProperties.needsLights) {
      uniforms.ambientLightColor.value = lights.state.ambient;
      uniforms.lightProbe.value = lights.state.probe;
      uniforms.directionalLights.value = lights.state.directional;
      uniforms.directionalLightShadows.value = lights.state.directionalShadow;
      uniforms.spotLights.value = lights.state.spot;
      uniforms.spotLightShadows.value = lights.state.spotShadow;
      uniforms.rectAreaLights.value = lights.state.rectArea;
      uniforms.ltc_1.value = lights.state.rectAreaLTC1;
      uniforms.ltc_2.value = lights.state.rectAreaLTC2;
      uniforms.pointLights.value = lights.state.point;
      uniforms.pointLightShadows.value = lights.state.pointShadow;
      uniforms.hemisphereLights.value = lights.state.hemi;
      uniforms.directionalShadowMap.value = lights.state.directionalShadowMap;
      uniforms.directionalShadowMatrix.value = lights.state.directionalShadowMatrix;
      uniforms.spotShadowMap.value = lights.state.spotShadowMap;
      uniforms.spotShadowMatrix.value = lights.state.spotShadowMatrix;
      uniforms.pointShadowMap.value = lights.state.pointShadowMap;
      uniforms.pointShadowMatrix.value = lights.state.pointShadowMatrix;
    }
    const progUniforms = program.getUniforms();
    const uniformsList = WebGLUniforms.seqWithValue(progUniforms.seq, uniforms);
    materialProperties.currentProgram = program;
    materialProperties.uniformsList = uniformsList;
    return program;
  }
  function updateCommonMaterialProperties(material, parameters2) {
    const materialProperties = properties.get(material);
    materialProperties.outputEncoding = parameters2.outputEncoding;
    materialProperties.instancing = parameters2.instancing;
    materialProperties.skinning = parameters2.skinning;
    materialProperties.morphTargets = parameters2.morphTargets;
    materialProperties.morphNormals = parameters2.morphNormals;
    materialProperties.morphColors = parameters2.morphColors;
    materialProperties.morphTargetsCount = parameters2.morphTargetsCount;
    materialProperties.numClippingPlanes = parameters2.numClippingPlanes;
    materialProperties.numIntersection = parameters2.numClipIntersection;
    materialProperties.vertexAlphas = parameters2.vertexAlphas;
    materialProperties.vertexTangents = parameters2.vertexTangents;
    materialProperties.toneMapping = parameters2.toneMapping;
  }
  function setProgram(camera, scene, geometry, material, object) {
    if (scene.isScene !== true)
      scene = _emptyScene;
    textures.resetTextureUnits();
    const fog = scene.fog;
    const environment = material.isMeshStandardMaterial ? scene.environment : null;
    const encoding = _currentRenderTarget === null ? _this.outputEncoding : _currentRenderTarget.isXRRenderTarget === true ? _currentRenderTarget.texture.encoding : LinearEncoding;
    const envMap = (material.isMeshStandardMaterial ? cubeuvmaps : cubemaps).get(material.envMap || environment);
    const vertexAlphas = material.vertexColors === true && !!geometry.attributes.color && geometry.attributes.color.itemSize === 4;
    const vertexTangents = !!material.normalMap && !!geometry.attributes.tangent;
    const morphTargets = !!geometry.morphAttributes.position;
    const morphNormals = !!geometry.morphAttributes.normal;
    const morphColors = !!geometry.morphAttributes.color;
    const toneMapping = material.toneMapped ? _this.toneMapping : NoToneMapping;
    const morphAttribute = geometry.morphAttributes.position || geometry.morphAttributes.normal || geometry.morphAttributes.color;
    const morphTargetsCount = morphAttribute !== void 0 ? morphAttribute.length : 0;
    const materialProperties = properties.get(material);
    const lights = currentRenderState.state.lights;
    if (_clippingEnabled === true) {
      if (_localClippingEnabled === true || camera !== _currentCamera) {
        const useCache = camera === _currentCamera && material.id === _currentMaterialId;
        clipping.setState(material, camera, useCache);
      }
    }
    let needsProgramChange = false;
    if (material.version === materialProperties.__version) {
      if (materialProperties.needsLights && materialProperties.lightsStateVersion !== lights.state.version) {
        needsProgramChange = true;
      } else if (materialProperties.outputEncoding !== encoding) {
        needsProgramChange = true;
      } else if (object.isInstancedMesh && materialProperties.instancing === false) {
        needsProgramChange = true;
      } else if (!object.isInstancedMesh && materialProperties.instancing === true) {
        needsProgramChange = true;
      } else if (object.isSkinnedMesh && materialProperties.skinning === false) {
        needsProgramChange = true;
      } else if (!object.isSkinnedMesh && materialProperties.skinning === true) {
        needsProgramChange = true;
      } else if (materialProperties.envMap !== envMap) {
        needsProgramChange = true;
      } else if (material.fog && materialProperties.fog !== fog) {
        needsProgramChange = true;
      } else if (materialProperties.numClippingPlanes !== void 0 && (materialProperties.numClippingPlanes !== clipping.numPlanes || materialProperties.numIntersection !== clipping.numIntersection)) {
        needsProgramChange = true;
      } else if (materialProperties.vertexAlphas !== vertexAlphas) {
        needsProgramChange = true;
      } else if (materialProperties.vertexTangents !== vertexTangents) {
        needsProgramChange = true;
      } else if (materialProperties.morphTargets !== morphTargets) {
        needsProgramChange = true;
      } else if (materialProperties.morphNormals !== morphNormals) {
        needsProgramChange = true;
      } else if (materialProperties.morphColors !== morphColors) {
        needsProgramChange = true;
      } else if (materialProperties.toneMapping !== toneMapping) {
        needsProgramChange = true;
      } else if (capabilities.isWebGL2 === true && materialProperties.morphTargetsCount !== morphTargetsCount) {
        needsProgramChange = true;
      }
    } else {
      needsProgramChange = true;
      materialProperties.__version = material.version;
    }
    let program = materialProperties.currentProgram;
    if (needsProgramChange === true) {
      program = getProgram(material, scene, object);
    }
    let refreshProgram = false;
    let refreshMaterial = false;
    let refreshLights = false;
    const p_uniforms = program.getUniforms(), m_uniforms = materialProperties.uniforms;
    if (state.useProgram(program.program)) {
      refreshProgram = true;
      refreshMaterial = true;
      refreshLights = true;
    }
    if (material.id !== _currentMaterialId) {
      _currentMaterialId = material.id;
      refreshMaterial = true;
    }
    if (refreshProgram || _currentCamera !== camera) {
      p_uniforms.setValue(_gl, "projectionMatrix", camera.projectionMatrix);
      if (capabilities.logarithmicDepthBuffer) {
        p_uniforms.setValue(
          _gl,
          "logDepthBufFC",
          2 / (Math.log(camera.far + 1) / Math.LN2)
        );
      }
      if (_currentCamera !== camera) {
        _currentCamera = camera;
        refreshMaterial = true;
        refreshLights = true;
      }
      if (material.isShaderMaterial || material.isMeshPhongMaterial || material.isMeshToonMaterial || material.isMeshStandardMaterial || material.envMap) {
        const uCamPos = p_uniforms.map.cameraPosition;
        if (uCamPos !== void 0) {
          uCamPos.setValue(
            _gl,
            _vector32.setFromMatrixPosition(camera.matrixWorld)
          );
        }
      }
      if (material.isMeshPhongMaterial || material.isMeshToonMaterial || material.isMeshLambertMaterial || material.isMeshBasicMaterial || material.isMeshStandardMaterial || material.isShaderMaterial) {
        p_uniforms.setValue(_gl, "isOrthographic", camera.isOrthographicCamera === true);
      }
      if (material.isMeshPhongMaterial || material.isMeshToonMaterial || material.isMeshLambertMaterial || material.isMeshBasicMaterial || material.isMeshStandardMaterial || material.isShaderMaterial || material.isShadowMaterial || object.isSkinnedMesh) {
        p_uniforms.setValue(_gl, "viewMatrix", camera.matrixWorldInverse);
      }
    }
    if (object.isSkinnedMesh) {
      p_uniforms.setOptional(_gl, object, "bindMatrix");
      p_uniforms.setOptional(_gl, object, "bindMatrixInverse");
      const skeleton = object.skeleton;
      if (skeleton) {
        if (capabilities.floatVertexTextures) {
          if (skeleton.boneTexture === null)
            skeleton.computeBoneTexture();
          p_uniforms.setValue(_gl, "boneTexture", skeleton.boneTexture, textures);
          p_uniforms.setValue(_gl, "boneTextureSize", skeleton.boneTextureSize);
        } else {
          p_uniforms.setOptional(_gl, skeleton, "boneMatrices");
        }
      }
    }
    const morphAttributes = geometry.morphAttributes;
    if (morphAttributes.position !== void 0 || morphAttributes.normal !== void 0 || morphAttributes.color !== void 0 && capabilities.isWebGL2 === true) {
      morphtargets.update(object, geometry, material, program);
    }
    if (refreshMaterial || materialProperties.receiveShadow !== object.receiveShadow) {
      materialProperties.receiveShadow = object.receiveShadow;
      p_uniforms.setValue(_gl, "receiveShadow", object.receiveShadow);
    }
    if (refreshMaterial) {
      p_uniforms.setValue(_gl, "toneMappingExposure", _this.toneMappingExposure);
      if (materialProperties.needsLights) {
        markUniformsLightsNeedsUpdate(m_uniforms, refreshLights);
      }
      if (fog && material.fog) {
        materials.refreshFogUniforms(m_uniforms, fog);
      }
      materials.refreshMaterialUniforms(m_uniforms, material, _pixelRatio, _height, _transmissionRenderTarget);
      WebGLUniforms.upload(_gl, materialProperties.uniformsList, m_uniforms, textures);
    }
    if (material.isShaderMaterial && material.uniformsNeedUpdate === true) {
      WebGLUniforms.upload(_gl, materialProperties.uniformsList, m_uniforms, textures);
      material.uniformsNeedUpdate = false;
    }
    if (material.isSpriteMaterial) {
      p_uniforms.setValue(_gl, "center", object.center);
    }
    p_uniforms.setValue(_gl, "modelViewMatrix", object.modelViewMatrix);
    p_uniforms.setValue(_gl, "normalMatrix", object.normalMatrix);
    p_uniforms.setValue(_gl, "modelMatrix", object.matrixWorld);
    return program;
  }
  function markUniformsLightsNeedsUpdate(uniforms, value) {
    uniforms.ambientLightColor.needsUpdate = value;
    uniforms.lightProbe.needsUpdate = value;
    uniforms.directionalLights.needsUpdate = value;
    uniforms.directionalLightShadows.needsUpdate = value;
    uniforms.pointLights.needsUpdate = value;
    uniforms.pointLightShadows.needsUpdate = value;
    uniforms.spotLights.needsUpdate = value;
    uniforms.spotLightShadows.needsUpdate = value;
    uniforms.rectAreaLights.needsUpdate = value;
    uniforms.hemisphereLights.needsUpdate = value;
  }
  function materialNeedsLights(material) {
    return material.isMeshLambertMaterial || material.isMeshToonMaterial || material.isMeshPhongMaterial || material.isMeshStandardMaterial || material.isShadowMaterial || material.isShaderMaterial && material.lights === true;
  }
  this.getActiveCubeFace = function() {
    return _currentActiveCubeFace;
  };
  this.getActiveMipmapLevel = function() {
    return _currentActiveMipmapLevel;
  };
  this.getRenderTarget = function() {
    return _currentRenderTarget;
  };
  this.setRenderTargetTextures = function(renderTarget, colorTexture, depthTexture) {
    properties.get(renderTarget.texture).__webglTexture = colorTexture;
    properties.get(renderTarget.depthTexture).__webglTexture = depthTexture;
    const renderTargetProperties = properties.get(renderTarget);
    renderTargetProperties.__hasExternalTextures = true;
    if (renderTargetProperties.__hasExternalTextures) {
      renderTargetProperties.__autoAllocateDepthBuffer = depthTexture === void 0;
      if (!renderTargetProperties.__autoAllocateDepthBuffer) {
        if (extensions2.has("WEBGL_multisampled_render_to_texture") === true) {
          console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided");
          renderTargetProperties.__useRenderToTexture = false;
        }
      }
    }
  };
  this.setRenderTargetFramebuffer = function(renderTarget, defaultFramebuffer) {
    const renderTargetProperties = properties.get(renderTarget);
    renderTargetProperties.__webglFramebuffer = defaultFramebuffer;
    renderTargetProperties.__useDefaultFramebuffer = defaultFramebuffer === void 0;
  };
  this.setRenderTarget = function(renderTarget, activeCubeFace = 0, activeMipmapLevel = 0) {
    _currentRenderTarget = renderTarget;
    _currentActiveCubeFace = activeCubeFace;
    _currentActiveMipmapLevel = activeMipmapLevel;
    let useDefaultFramebuffer = true;
    if (renderTarget) {
      const renderTargetProperties = properties.get(renderTarget);
      if (renderTargetProperties.__useDefaultFramebuffer !== void 0) {
        state.bindFramebuffer(36160, null);
        useDefaultFramebuffer = false;
      } else if (renderTargetProperties.__webglFramebuffer === void 0) {
        textures.setupRenderTarget(renderTarget);
      } else if (renderTargetProperties.__hasExternalTextures) {
        textures.rebindTextures(renderTarget, properties.get(renderTarget.texture).__webglTexture, properties.get(renderTarget.depthTexture).__webglTexture);
      }
    }
    let framebuffer = null;
    let isCube = false;
    let isRenderTarget3D = false;
    if (renderTarget) {
      const texture = renderTarget.texture;
      if (texture.isData3DTexture || texture.isDataArrayTexture) {
        isRenderTarget3D = true;
      }
      const __webglFramebuffer = properties.get(renderTarget).__webglFramebuffer;
      if (renderTarget.isWebGLCubeRenderTarget) {
        framebuffer = __webglFramebuffer[activeCubeFace];
        isCube = true;
      } else if (capabilities.isWebGL2 && renderTarget.samples > 0 && textures.useMultisampledRTT(renderTarget) === false) {
        framebuffer = properties.get(renderTarget).__webglMultisampledFramebuffer;
      } else {
        framebuffer = __webglFramebuffer;
      }
      _currentViewport.copy(renderTarget.viewport);
      _currentScissor.copy(renderTarget.scissor);
      _currentScissorTest = renderTarget.scissorTest;
    } else {
      _currentViewport.copy(_viewport).multiplyScalar(_pixelRatio).floor();
      _currentScissor.copy(_scissor).multiplyScalar(_pixelRatio).floor();
      _currentScissorTest = _scissorTest;
    }
    const framebufferBound = state.bindFramebuffer(36160, framebuffer);
    if (framebufferBound && capabilities.drawBuffers && useDefaultFramebuffer) {
      state.drawBuffers(renderTarget, framebuffer);
    }
    state.viewport(_currentViewport);
    state.scissor(_currentScissor);
    state.setScissorTest(_currentScissorTest);
    if (isCube) {
      const textureProperties = properties.get(renderTarget.texture);
      _gl.framebufferTexture2D(36160, 36064, 34069 + activeCubeFace, textureProperties.__webglTexture, activeMipmapLevel);
    } else if (isRenderTarget3D) {
      const textureProperties = properties.get(renderTarget.texture);
      const layer2 = activeCubeFace || 0;
      _gl.framebufferTextureLayer(36160, 36064, textureProperties.__webglTexture, activeMipmapLevel || 0, layer2);
    }
    _currentMaterialId = -1;
  };
  this.readRenderTargetPixels = function(renderTarget, x2, y2, width, height, buffer, activeCubeFaceIndex) {
    if (!(renderTarget && renderTarget.isWebGLRenderTarget)) {
      console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");
      return;
    }
    let framebuffer = properties.get(renderTarget).__webglFramebuffer;
    if (renderTarget.isWebGLCubeRenderTarget && activeCubeFaceIndex !== void 0) {
      framebuffer = framebuffer[activeCubeFaceIndex];
    }
    if (framebuffer) {
      state.bindFramebuffer(36160, framebuffer);
      try {
        const texture = renderTarget.texture;
        const textureFormat = texture.format;
        const textureType = texture.type;
        if (textureFormat !== RGBAFormat && utils.convert(textureFormat) !== _gl.getParameter(35739)) {
          console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");
          return;
        }
        const halfFloatSupportedByExt = textureType === HalfFloatType && (extensions2.has("EXT_color_buffer_half_float") || capabilities.isWebGL2 && extensions2.has("EXT_color_buffer_float"));
        if (textureType !== UnsignedByteType && utils.convert(textureType) !== _gl.getParameter(35738) && // Edge and Chrome Mac < 52 (#9513)
        !(textureType === FloatType && (capabilities.isWebGL2 || extensions2.has("OES_texture_float") || extensions2.has("WEBGL_color_buffer_float"))) && // Chrome Mac >= 52 and Firefox
        !halfFloatSupportedByExt) {
          console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");
          return;
        }
        if (x2 >= 0 && x2 <= renderTarget.width - width && (y2 >= 0 && y2 <= renderTarget.height - height)) {
          _gl.readPixels(x2, y2, width, height, utils.convert(textureFormat), utils.convert(textureType), buffer);
        }
      } finally {
        const framebuffer2 = _currentRenderTarget !== null ? properties.get(_currentRenderTarget).__webglFramebuffer : null;
        state.bindFramebuffer(36160, framebuffer2);
      }
    }
  };
  this.copyFramebufferToTexture = function(position2, texture, level = 0) {
    if (texture.isFramebufferTexture !== true) {
      console.error("THREE.WebGLRenderer: copyFramebufferToTexture() can only be used with FramebufferTexture.");
      return;
    }
    const levelScale = Math.pow(2, -level);
    const width = Math.floor(texture.image.width * levelScale);
    const height = Math.floor(texture.image.height * levelScale);
    textures.setTexture2D(texture, 0);
    _gl.copyTexSubImage2D(3553, level, 0, 0, position2.x, position2.y, width, height);
    state.unbindTexture();
  };
  this.copyTextureToTexture = function(position2, srcTexture, dstTexture, level = 0) {
    const width = srcTexture.image.width;
    const height = srcTexture.image.height;
    const glFormat = utils.convert(dstTexture.format);
    const glType = utils.convert(dstTexture.type);
    textures.setTexture2D(dstTexture, 0);
    _gl.pixelStorei(37440, dstTexture.flipY);
    _gl.pixelStorei(37441, dstTexture.premultiplyAlpha);
    _gl.pixelStorei(3317, dstTexture.unpackAlignment);
    if (srcTexture.isDataTexture) {
      _gl.texSubImage2D(3553, level, position2.x, position2.y, width, height, glFormat, glType, srcTexture.image.data);
    } else {
      if (srcTexture.isCompressedTexture) {
        _gl.compressedTexSubImage2D(3553, level, position2.x, position2.y, srcTexture.mipmaps[0].width, srcTexture.mipmaps[0].height, glFormat, srcTexture.mipmaps[0].data);
      } else {
        _gl.texSubImage2D(3553, level, position2.x, position2.y, glFormat, glType, srcTexture.image);
      }
    }
    if (level === 0 && dstTexture.generateMipmaps)
      _gl.generateMipmap(3553);
    state.unbindTexture();
  };
  this.copyTextureToTexture3D = function(sourceBox, position2, srcTexture, dstTexture, level = 0) {
    if (_this.isWebGL1Renderer) {
      console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");
      return;
    }
    const width = sourceBox.max.x - sourceBox.min.x + 1;
    const height = sourceBox.max.y - sourceBox.min.y + 1;
    const depth = sourceBox.max.z - sourceBox.min.z + 1;
    const glFormat = utils.convert(dstTexture.format);
    const glType = utils.convert(dstTexture.type);
    let glTarget;
    if (dstTexture.isData3DTexture) {
      textures.setTexture3D(dstTexture, 0);
      glTarget = 32879;
    } else if (dstTexture.isDataArrayTexture) {
      textures.setTexture2DArray(dstTexture, 0);
      glTarget = 35866;
    } else {
      console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");
      return;
    }
    _gl.pixelStorei(37440, dstTexture.flipY);
    _gl.pixelStorei(37441, dstTexture.premultiplyAlpha);
    _gl.pixelStorei(3317, dstTexture.unpackAlignment);
    const unpackRowLen = _gl.getParameter(3314);
    const unpackImageHeight = _gl.getParameter(32878);
    const unpackSkipPixels = _gl.getParameter(3316);
    const unpackSkipRows = _gl.getParameter(3315);
    const unpackSkipImages = _gl.getParameter(32877);
    const image = srcTexture.isCompressedTexture ? srcTexture.mipmaps[0] : srcTexture.image;
    _gl.pixelStorei(3314, image.width);
    _gl.pixelStorei(32878, image.height);
    _gl.pixelStorei(3316, sourceBox.min.x);
    _gl.pixelStorei(3315, sourceBox.min.y);
    _gl.pixelStorei(32877, sourceBox.min.z);
    if (srcTexture.isDataTexture || srcTexture.isData3DTexture) {
      _gl.texSubImage3D(glTarget, level, position2.x, position2.y, position2.z, width, height, depth, glFormat, glType, image.data);
    } else {
      if (srcTexture.isCompressedTexture) {
        console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture.");
        _gl.compressedTexSubImage3D(glTarget, level, position2.x, position2.y, position2.z, width, height, depth, glFormat, image.data);
      } else {
        _gl.texSubImage3D(glTarget, level, position2.x, position2.y, position2.z, width, height, depth, glFormat, glType, image);
      }
    }
    _gl.pixelStorei(3314, unpackRowLen);
    _gl.pixelStorei(32878, unpackImageHeight);
    _gl.pixelStorei(3316, unpackSkipPixels);
    _gl.pixelStorei(3315, unpackSkipRows);
    _gl.pixelStorei(32877, unpackSkipImages);
    if (level === 0 && dstTexture.generateMipmaps)
      _gl.generateMipmap(glTarget);
    state.unbindTexture();
  };
  this.initTexture = function(texture) {
    textures.setTexture2D(texture, 0);
    state.unbindTexture();
  };
  this.resetState = function() {
    _currentActiveCubeFace = 0;
    _currentActiveMipmapLevel = 0;
    _currentRenderTarget = null;
    state.reset();
    bindingStates.reset();
  };
  if (typeof __THREE_DEVTOOLS__ !== "undefined") {
    __THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe", { detail: this }));
  }
}
WebGLRenderer.prototype.isWebGLRenderer = true;
var WebGL1Renderer = class extends WebGLRenderer {
};
WebGL1Renderer.prototype.isWebGL1Renderer = true;
var FogExp2 = class _FogExp2 {
  constructor(color2, density = 25e-5) {
    this.name = "";
    this.color = new Color2(color2);
    this.density = density;
  }
  clone() {
    return new _FogExp2(this.color, this.density);
  }
  toJSON() {
    return {
      type: "FogExp2",
      color: this.color.getHex(),
      density: this.density
    };
  }
};
FogExp2.prototype.isFogExp2 = true;
var Fog = class _Fog {
  constructor(color2, near = 1, far = 1e3) {
    this.name = "";
    this.color = new Color2(color2);
    this.near = near;
    this.far = far;
  }
  clone() {
    return new _Fog(this.color, this.near, this.far);
  }
  toJSON() {
    return {
      type: "Fog",
      color: this.color.getHex(),
      near: this.near,
      far: this.far
    };
  }
};
Fog.prototype.isFog = true;
var Scene = class extends Object3D {
  constructor() {
    super();
    this.type = "Scene";
    this.background = null;
    this.environment = null;
    this.fog = null;
    this.overrideMaterial = null;
    this.autoUpdate = true;
    if (typeof __THREE_DEVTOOLS__ !== "undefined") {
      __THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe", { detail: this }));
    }
  }
  copy(source, recursive) {
    super.copy(source, recursive);
    if (source.background !== null)
      this.background = source.background.clone();
    if (source.environment !== null)
      this.environment = source.environment.clone();
    if (source.fog !== null)
      this.fog = source.fog.clone();
    if (source.overrideMaterial !== null)
      this.overrideMaterial = source.overrideMaterial.clone();
    this.autoUpdate = source.autoUpdate;
    this.matrixAutoUpdate = source.matrixAutoUpdate;
    return this;
  }
  toJSON(meta2) {
    const data = super.toJSON(meta2);
    if (this.fog !== null)
      data.object.fog = this.fog.toJSON();
    return data;
  }
};
Scene.prototype.isScene = true;
var InterleavedBuffer = class {
  constructor(array, stride) {
    this.array = array;
    this.stride = stride;
    this.count = array !== void 0 ? array.length / stride : 0;
    this.usage = StaticDrawUsage;
    this.updateRange = { offset: 0, count: -1 };
    this.version = 0;
    this.uuid = generateUUID();
  }
  onUploadCallback() {
  }
  set needsUpdate(value) {
    if (value === true)
      this.version++;
  }
  setUsage(value) {
    this.usage = value;
    return this;
  }
  copy(source) {
    this.array = new source.array.constructor(source.array);
    this.count = source.count;
    this.stride = source.stride;
    this.usage = source.usage;
    return this;
  }
  copyAt(index1, attribute, index2) {
    index1 *= this.stride;
    index2 *= attribute.stride;
    for (let i2 = 0, l = this.stride; i2 < l; i2++) {
      this.array[index1 + i2] = attribute.array[index2 + i2];
    }
    return this;
  }
  set(value, offset = 0) {
    this.array.set(value, offset);
    return this;
  }
  clone(data) {
    if (data.arrayBuffers === void 0) {
      data.arrayBuffers = {};
    }
    if (this.array.buffer._uuid === void 0) {
      this.array.buffer._uuid = generateUUID();
    }
    if (data.arrayBuffers[this.array.buffer._uuid] === void 0) {
      data.arrayBuffers[this.array.buffer._uuid] = this.array.slice(0).buffer;
    }
    const array = new this.array.constructor(data.arrayBuffers[this.array.buffer._uuid]);
    const ib = new this.constructor(array, this.stride);
    ib.setUsage(this.usage);
    return ib;
  }
  onUpload(callback) {
    this.onUploadCallback = callback;
    return this;
  }
  toJSON(data) {
    if (data.arrayBuffers === void 0) {
      data.arrayBuffers = {};
    }
    if (this.array.buffer._uuid === void 0) {
      this.array.buffer._uuid = generateUUID();
    }
    if (data.arrayBuffers[this.array.buffer._uuid] === void 0) {
      data.arrayBuffers[this.array.buffer._uuid] = Array.prototype.slice.call(new Uint32Array(this.array.buffer));
    }
    return {
      uuid: this.uuid,
      buffer: this.array.buffer._uuid,
      type: this.array.constructor.name,
      stride: this.stride
    };
  }
};
InterleavedBuffer.prototype.isInterleavedBuffer = true;
var _vector$6 = /* @__PURE__ */ new Vector3();
var InterleavedBufferAttribute = class _InterleavedBufferAttribute {
  constructor(interleavedBuffer, itemSize, offset, normalized = false) {
    this.name = "";
    this.data = interleavedBuffer;
    this.itemSize = itemSize;
    this.offset = offset;
    this.normalized = normalized === true;
  }
  get count() {
    return this.data.count;
  }
  get array() {
    return this.data.array;
  }
  set needsUpdate(value) {
    this.data.needsUpdate = value;
  }
  applyMatrix4(m) {
    for (let i2 = 0, l = this.data.count; i2 < l; i2++) {
      _vector$6.fromBufferAttribute(this, i2);
      _vector$6.applyMatrix4(m);
      this.setXYZ(i2, _vector$6.x, _vector$6.y, _vector$6.z);
    }
    return this;
  }
  applyNormalMatrix(m) {
    for (let i2 = 0, l = this.count; i2 < l; i2++) {
      _vector$6.fromBufferAttribute(this, i2);
      _vector$6.applyNormalMatrix(m);
      this.setXYZ(i2, _vector$6.x, _vector$6.y, _vector$6.z);
    }
    return this;
  }
  transformDirection(m) {
    for (let i2 = 0, l = this.count; i2 < l; i2++) {
      _vector$6.fromBufferAttribute(this, i2);
      _vector$6.transformDirection(m);
      this.setXYZ(i2, _vector$6.x, _vector$6.y, _vector$6.z);
    }
    return this;
  }
  setX(index, x2) {
    this.data.array[index * this.data.stride + this.offset] = x2;
    return this;
  }
  setY(index, y2) {
    this.data.array[index * this.data.stride + this.offset + 1] = y2;
    return this;
  }
  setZ(index, z) {
    this.data.array[index * this.data.stride + this.offset + 2] = z;
    return this;
  }
  setW(index, w) {
    this.data.array[index * this.data.stride + this.offset + 3] = w;
    return this;
  }
  getX(index) {
    return this.data.array[index * this.data.stride + this.offset];
  }
  getY(index) {
    return this.data.array[index * this.data.stride + this.offset + 1];
  }
  getZ(index) {
    return this.data.array[index * this.data.stride + this.offset + 2];
  }
  getW(index) {
    return this.data.array[index * this.data.stride + this.offset + 3];
  }
  setXY(index, x2, y2) {
    index = index * this.data.stride + this.offset;
    this.data.array[index + 0] = x2;
    this.data.array[index + 1] = y2;
    return this;
  }
  setXYZ(index, x2, y2, z) {
    index = index * this.data.stride + this.offset;
    this.data.array[index + 0] = x2;
    this.data.array[index + 1] = y2;
    this.data.array[index + 2] = z;
    return this;
  }
  setXYZW(index, x2, y2, z, w) {
    index = index * this.data.stride + this.offset;
    this.data.array[index + 0] = x2;
    this.data.array[index + 1] = y2;
    this.data.array[index + 2] = z;
    this.data.array[index + 3] = w;
    return this;
  }
  clone(data) {
    if (data === void 0) {
      console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interlaved buffer attribute will deinterleave buffer data.");
      const array = [];
      for (let i2 = 0; i2 < this.count; i2++) {
        const index = i2 * this.data.stride + this.offset;
        for (let j = 0; j < this.itemSize; j++) {
          array.push(this.data.array[index + j]);
        }
      }
      return new BufferAttribute(new this.array.constructor(array), this.itemSize, this.normalized);
    } else {
      if (data.interleavedBuffers === void 0) {
        data.interleavedBuffers = {};
      }
      if (data.interleavedBuffers[this.data.uuid] === void 0) {
        data.interleavedBuffers[this.data.uuid] = this.data.clone(data);
      }
      return new _InterleavedBufferAttribute(data.interleavedBuffers[this.data.uuid], this.itemSize, this.offset, this.normalized);
    }
  }
  toJSON(data) {
    if (data === void 0) {
      console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interlaved buffer attribute will deinterleave buffer data.");
      const array = [];
      for (let i2 = 0; i2 < this.count; i2++) {
        const index = i2 * this.data.stride + this.offset;
        for (let j = 0; j < this.itemSize; j++) {
          array.push(this.data.array[index + j]);
        }
      }
      return {
        itemSize: this.itemSize,
        type: this.array.constructor.name,
        array,
        normalized: this.normalized
      };
    } else {
      if (data.interleavedBuffers === void 0) {
        data.interleavedBuffers = {};
      }
      if (data.interleavedBuffers[this.data.uuid] === void 0) {
        data.interleavedBuffers[this.data.uuid] = this.data.toJSON(data);
      }
      return {
        isInterleavedBufferAttribute: true,
        itemSize: this.itemSize,
        data: this.data.uuid,
        offset: this.offset,
        normalized: this.normalized
      };
    }
  }
};
InterleavedBufferAttribute.prototype.isInterleavedBufferAttribute = true;
var SpriteMaterial = class extends Material {
  constructor(parameters) {
    super();
    this.type = "SpriteMaterial";
    this.color = new Color2(16777215);
    this.map = null;
    this.alphaMap = null;
    this.rotation = 0;
    this.sizeAttenuation = true;
    this.transparent = true;
    this.setValues(parameters);
  }
  copy(source) {
    super.copy(source);
    this.color.copy(source.color);
    this.map = source.map;
    this.alphaMap = source.alphaMap;
    this.rotation = source.rotation;
    this.sizeAttenuation = source.sizeAttenuation;
    return this;
  }
};
SpriteMaterial.prototype.isSpriteMaterial = true;
var _geometry;
var _intersectPoint = /* @__PURE__ */ new Vector3();
var _worldScale = /* @__PURE__ */ new Vector3();
var _mvPosition = /* @__PURE__ */ new Vector3();
var _alignedPosition = /* @__PURE__ */ new Vector2();
var _rotatedPosition = /* @__PURE__ */ new Vector2();
var _viewWorldMatrix = /* @__PURE__ */ new Matrix4();
var _vA = /* @__PURE__ */ new Vector3();
var _vB = /* @__PURE__ */ new Vector3();
var _vC = /* @__PURE__ */ new Vector3();
var _uvA = /* @__PURE__ */ new Vector2();
var _uvB = /* @__PURE__ */ new Vector2();
var _uvC = /* @__PURE__ */ new Vector2();
var Sprite = class extends Object3D {
  constructor(material) {
    super();
    this.type = "Sprite";
    if (_geometry === void 0) {
      _geometry = new BufferGeometry();
      const float32Array = new Float32Array([
        -0.5,
        -0.5,
        0,
        0,
        0,
        0.5,
        -0.5,
        0,
        1,
        0,
        0.5,
        0.5,
        0,
        1,
        1,
        -0.5,
        0.5,
        0,
        0,
        1
      ]);
      const interleavedBuffer = new InterleavedBuffer(float32Array, 5);
      _geometry.setIndex([0, 1, 2, 0, 2, 3]);
      _geometry.setAttribute("position", new InterleavedBufferAttribute(interleavedBuffer, 3, 0, false));
      _geometry.setAttribute("uv", new InterleavedBufferAttribute(interleavedBuffer, 2, 3, false));
    }
    this.geometry = _geometry;
    this.material = material !== void 0 ? material : new SpriteMaterial();
    this.center = new Vector2(0.5, 0.5);
  }
  raycast(raycaster, intersects2) {
    if (raycaster.camera === null) {
      console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.');
    }
    _worldScale.setFromMatrixScale(this.matrixWorld);
    _viewWorldMatrix.copy(raycaster.camera.matrixWorld);
    this.modelViewMatrix.multiplyMatrices(raycaster.camera.matrixWorldInverse, this.matrixWorld);
    _mvPosition.setFromMatrixPosition(this.modelViewMatrix);
    if (raycaster.camera.isPerspectiveCamera && this.material.sizeAttenuation === false) {
      _worldScale.multiplyScalar(-_mvPosition.z);
    }
    const rotation = this.material.rotation;
    let sin2, cos2;
    if (rotation !== 0) {
      cos2 = Math.cos(rotation);
      sin2 = Math.sin(rotation);
    }
    const center = this.center;
    transformVertex(_vA.set(-0.5, -0.5, 0), _mvPosition, center, _worldScale, sin2, cos2);
    transformVertex(_vB.set(0.5, -0.5, 0), _mvPosition, center, _worldScale, sin2, cos2);
    transformVertex(_vC.set(0.5, 0.5, 0), _mvPosition, center, _worldScale, sin2, cos2);
    _uvA.set(0, 0);
    _uvB.set(1, 0);
    _uvC.set(1, 1);
    let intersect = raycaster.ray.intersectTriangle(_vA, _vB, _vC, false, _intersectPoint);
    if (intersect === null) {
      transformVertex(_vB.set(-0.5, 0.5, 0), _mvPosition, center, _worldScale, sin2, cos2);
      _uvB.set(0, 1);
      intersect = raycaster.ray.intersectTriangle(_vA, _vC, _vB, false, _intersectPoint);
      if (intersect === null) {
        return;
      }
    }
    const distance = raycaster.ray.origin.distanceTo(_intersectPoint);
    if (distance < raycaster.near || distance > raycaster.far)
      return;
    intersects2.push({
      distance,
      point: _intersectPoint.clone(),
      uv: Triangle.getUV(_intersectPoint, _vA, _vB, _vC, _uvA, _uvB, _uvC, new Vector2()),
      face: null,
      object: this
    });
  }
  copy(source) {
    super.copy(source);
    if (source.center !== void 0)
      this.center.copy(source.center);
    this.material = source.material;
    return this;
  }
};
Sprite.prototype.isSprite = true;
function transformVertex(vertexPosition, mvPosition, center, scale, sin2, cos2) {
  _alignedPosition.subVectors(vertexPosition, center).addScalar(0.5).multiply(scale);
  if (sin2 !== void 0) {
    _rotatedPosition.x = cos2 * _alignedPosition.x - sin2 * _alignedPosition.y;
    _rotatedPosition.y = sin2 * _alignedPosition.x + cos2 * _alignedPosition.y;
  } else {
    _rotatedPosition.copy(_alignedPosition);
  }
  vertexPosition.copy(mvPosition);
  vertexPosition.x += _rotatedPosition.x;
  vertexPosition.y += _rotatedPosition.y;
  vertexPosition.applyMatrix4(_viewWorldMatrix);
}
var _v1$2 = /* @__PURE__ */ new Vector3();
var _v2$1 = /* @__PURE__ */ new Vector3();
var LOD = class extends Object3D {
  constructor() {
    super();
    this._currentLevel = 0;
    this.type = "LOD";
    Object.defineProperties(this, {
      levels: {
        enumerable: true,
        value: []
      },
      isLOD: {
        value: true
      }
    });
    this.autoUpdate = true;
  }
  copy(source) {
    super.copy(source, false);
    const levels = source.levels;
    for (let i2 = 0, l = levels.length; i2 < l; i2++) {
      const level = levels[i2];
      this.addLevel(level.object.clone(), level.distance);
    }
    this.autoUpdate = source.autoUpdate;
    return this;
  }
  addLevel(object, distance = 0) {
    distance = Math.abs(distance);
    const levels = this.levels;
    let l;
    for (l = 0; l < levels.length; l++) {
      if (distance < levels[l].distance) {
        break;
      }
    }
    levels.splice(l, 0, { distance, object });
    this.add(object);
    return this;
  }
  getCurrentLevel() {
    return this._currentLevel;
  }
  getObjectForDistance(distance) {
    const levels = this.levels;
    if (levels.length > 0) {
      let i2, l;
      for (i2 = 1, l = levels.length; i2 < l; i2++) {
        if (distance < levels[i2].distance) {
          break;
        }
      }
      return levels[i2 - 1].object;
    }
    return null;
  }
  raycast(raycaster, intersects2) {
    const levels = this.levels;
    if (levels.length > 0) {
      _v1$2.setFromMatrixPosition(this.matrixWorld);
      const distance = raycaster.ray.origin.distanceTo(_v1$2);
      this.getObjectForDistance(distance).raycast(raycaster, intersects2);
    }
  }
  update(camera) {
    const levels = this.levels;
    if (levels.length > 1) {
      _v1$2.setFromMatrixPosition(camera.matrixWorld);
      _v2$1.setFromMatrixPosition(this.matrixWorld);
      const distance = _v1$2.distanceTo(_v2$1) / camera.zoom;
      levels[0].object.visible = true;
      let i2, l;
      for (i2 = 1, l = levels.length; i2 < l; i2++) {
        if (distance >= levels[i2].distance) {
          levels[i2 - 1].object.visible = false;
          levels[i2].object.visible = true;
        } else {
          break;
        }
      }
      this._currentLevel = i2 - 1;
      for (; i2 < l; i2++) {
        levels[i2].object.visible = false;
      }
    }
  }
  toJSON(meta2) {
    const data = super.toJSON(meta2);
    if (this.autoUpdate === false)
      data.object.autoUpdate = false;
    data.object.levels = [];
    const levels = this.levels;
    for (let i2 = 0, l = levels.length; i2 < l; i2++) {
      const level = levels[i2];
      data.object.levels.push({
        object: level.object.uuid,
        distance: level.distance
      });
    }
    return data;
  }
};
var _basePosition = /* @__PURE__ */ new Vector3();
var _skinIndex = /* @__PURE__ */ new Vector4();
var _skinWeight = /* @__PURE__ */ new Vector4();
var _vector$5 = /* @__PURE__ */ new Vector3();
var _matrix = /* @__PURE__ */ new Matrix4();
var SkinnedMesh = class extends Mesh {
  constructor(geometry, material) {
    super(geometry, material);
    this.type = "SkinnedMesh";
    this.bindMode = "attached";
    this.bindMatrix = new Matrix4();
    this.bindMatrixInverse = new Matrix4();
  }
  copy(source) {
    super.copy(source);
    this.bindMode = source.bindMode;
    this.bindMatrix.copy(source.bindMatrix);
    this.bindMatrixInverse.copy(source.bindMatrixInverse);
    this.skeleton = source.skeleton;
    return this;
  }
  bind(skeleton, bindMatrix) {
    this.skeleton = skeleton;
    if (bindMatrix === void 0) {
      this.updateMatrixWorld(true);
      this.skeleton.calculateInverses();
      bindMatrix = this.matrixWorld;
    }
    this.bindMatrix.copy(bindMatrix);
    this.bindMatrixInverse.copy(bindMatrix).invert();
  }
  pose() {
    this.skeleton.pose();
  }
  normalizeSkinWeights() {
    const vector = new Vector4();
    const skinWeight = this.geometry.attributes.skinWeight;
    for (let i2 = 0, l = skinWeight.count; i2 < l; i2++) {
      vector.fromBufferAttribute(skinWeight, i2);
      const scale = 1 / vector.manhattanLength();
      if (scale !== Infinity) {
        vector.multiplyScalar(scale);
      } else {
        vector.set(1, 0, 0, 0);
      }
      skinWeight.setXYZW(i2, vector.x, vector.y, vector.z, vector.w);
    }
  }
  updateMatrixWorld(force) {
    super.updateMatrixWorld(force);
    if (this.bindMode === "attached") {
      this.bindMatrixInverse.copy(this.matrixWorld).invert();
    } else if (this.bindMode === "detached") {
      this.bindMatrixInverse.copy(this.bindMatrix).invert();
    } else {
      console.warn("THREE.SkinnedMesh: Unrecognized bindMode: " + this.bindMode);
    }
  }
  boneTransform(index, target) {
    const skeleton = this.skeleton;
    const geometry = this.geometry;
    _skinIndex.fromBufferAttribute(geometry.attributes.skinIndex, index);
    _skinWeight.fromBufferAttribute(geometry.attributes.skinWeight, index);
    _basePosition.copy(target).applyMatrix4(this.bindMatrix);
    target.set(0, 0, 0);
    for (let i2 = 0; i2 < 4; i2++) {
      const weight = _skinWeight.getComponent(i2);
      if (weight !== 0) {
        const boneIndex = _skinIndex.getComponent(i2);
        _matrix.multiplyMatrices(skeleton.bones[boneIndex].matrixWorld, skeleton.boneInverses[boneIndex]);
        target.addScaledVector(_vector$5.copy(_basePosition).applyMatrix4(_matrix), weight);
      }
    }
    return target.applyMatrix4(this.bindMatrixInverse);
  }
};
SkinnedMesh.prototype.isSkinnedMesh = true;
var Bone = class extends Object3D {
  constructor() {
    super();
    this.type = "Bone";
  }
};
Bone.prototype.isBone = true;
var DataTexture = class extends Texture {
  constructor(data = null, width = 1, height = 1, format3, type, mapping, wrapS, wrapT, magFilter = NearestFilter, minFilter = NearestFilter, anisotropy, encoding) {
    super(null, mapping, wrapS, wrapT, magFilter, minFilter, format3, type, anisotropy, encoding);
    this.image = { data, width, height };
    this.generateMipmaps = false;
    this.flipY = false;
    this.unpackAlignment = 1;
  }
};
DataTexture.prototype.isDataTexture = true;
var _offsetMatrix = /* @__PURE__ */ new Matrix4();
var _identityMatrix = /* @__PURE__ */ new Matrix4();
var Skeleton = class _Skeleton {
  constructor(bones = [], boneInverses = []) {
    this.uuid = generateUUID();
    this.bones = bones.slice(0);
    this.boneInverses = boneInverses;
    this.boneMatrices = null;
    this.boneTexture = null;
    this.boneTextureSize = 0;
    this.frame = -1;
    this.init();
  }
  init() {
    const bones = this.bones;
    const boneInverses = this.boneInverses;
    this.boneMatrices = new Float32Array(bones.length * 16);
    if (boneInverses.length === 0) {
      this.calculateInverses();
    } else {
      if (bones.length !== boneInverses.length) {
        console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones.");
        this.boneInverses = [];
        for (let i2 = 0, il = this.bones.length; i2 < il; i2++) {
          this.boneInverses.push(new Matrix4());
        }
      }
    }
  }
  calculateInverses() {
    this.boneInverses.length = 0;
    for (let i2 = 0, il = this.bones.length; i2 < il; i2++) {
      const inverse = new Matrix4();
      if (this.bones[i2]) {
        inverse.copy(this.bones[i2].matrixWorld).invert();
      }
      this.boneInverses.push(inverse);
    }
  }
  pose() {
    for (let i2 = 0, il = this.bones.length; i2 < il; i2++) {
      const bone = this.bones[i2];
      if (bone) {
        bone.matrixWorld.copy(this.boneInverses[i2]).invert();
      }
    }
    for (let i2 = 0, il = this.bones.length; i2 < il; i2++) {
      const bone = this.bones[i2];
      if (bone) {
        if (bone.parent && bone.parent.isBone) {
          bone.matrix.copy(bone.parent.matrixWorld).invert();
          bone.matrix.multiply(bone.matrixWorld);
        } else {
          bone.matrix.copy(bone.matrixWorld);
        }
        bone.matrix.decompose(bone.position, bone.quaternion, bone.scale);
      }
    }
  }
  update() {
    const bones = this.bones;
    const boneInverses = this.boneInverses;
    const boneMatrices = this.boneMatrices;
    const boneTexture = this.boneTexture;
    for (let i2 = 0, il = bones.length; i2 < il; i2++) {
      const matrix = bones[i2] ? bones[i2].matrixWorld : _identityMatrix;
      _offsetMatrix.multiplyMatrices(matrix, boneInverses[i2]);
      _offsetMatrix.toArray(boneMatrices, i2 * 16);
    }
    if (boneTexture !== null) {
      boneTexture.needsUpdate = true;
    }
  }
  clone() {
    return new _Skeleton(this.bones, this.boneInverses);
  }
  computeBoneTexture() {
    let size = Math.sqrt(this.bones.length * 4);
    size = ceilPowerOfTwo(size);
    size = Math.max(size, 4);
    const boneMatrices = new Float32Array(size * size * 4);
    boneMatrices.set(this.boneMatrices);
    const boneTexture = new DataTexture(boneMatrices, size, size, RGBAFormat, FloatType);
    boneTexture.needsUpdate = true;
    this.boneMatrices = boneMatrices;
    this.boneTexture = boneTexture;
    this.boneTextureSize = size;
    return this;
  }
  getBoneByName(name2) {
    for (let i2 = 0, il = this.bones.length; i2 < il; i2++) {
      const bone = this.bones[i2];
      if (bone.name === name2) {
        return bone;
      }
    }
    return void 0;
  }
  dispose() {
    if (this.boneTexture !== null) {
      this.boneTexture.dispose();
      this.boneTexture = null;
    }
  }
  fromJSON(json3, bones) {
    this.uuid = json3.uuid;
    for (let i2 = 0, l = json3.bones.length; i2 < l; i2++) {
      const uuid = json3.bones[i2];
      let bone = bones[uuid];
      if (bone === void 0) {
        console.warn("THREE.Skeleton: No bone found with UUID:", uuid);
        bone = new Bone();
      }
      this.bones.push(bone);
      this.boneInverses.push(new Matrix4().fromArray(json3.boneInverses[i2]));
    }
    this.init();
    return this;
  }
  toJSON() {
    const data = {
      metadata: {
        version: 4.5,
        type: "Skeleton",
        generator: "Skeleton.toJSON"
      },
      bones: [],
      boneInverses: []
    };
    data.uuid = this.uuid;
    const bones = this.bones;
    const boneInverses = this.boneInverses;
    for (let i2 = 0, l = bones.length; i2 < l; i2++) {
      const bone = bones[i2];
      data.bones.push(bone.uuid);
      const boneInverse = boneInverses[i2];
      data.boneInverses.push(boneInverse.toArray());
    }
    return data;
  }
};
var InstancedBufferAttribute = class extends BufferAttribute {
  constructor(array, itemSize, normalized, meshPerAttribute = 1) {
    if (typeof normalized === "number") {
      meshPerAttribute = normalized;
      normalized = false;
      console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.");
    }
    super(array, itemSize, normalized);
    this.meshPerAttribute = meshPerAttribute;
  }
  copy(source) {
    super.copy(source);
    this.meshPerAttribute = source.meshPerAttribute;
    return this;
  }
  toJSON() {
    const data = super.toJSON();
    data.meshPerAttribute = this.meshPerAttribute;
    data.isInstancedBufferAttribute = true;
    return data;
  }
};
InstancedBufferAttribute.prototype.isInstancedBufferAttribute = true;
var _instanceLocalMatrix = /* @__PURE__ */ new Matrix4();
var _instanceWorldMatrix = /* @__PURE__ */ new Matrix4();
var _instanceIntersects = [];
var _mesh = /* @__PURE__ */ new Mesh();
var InstancedMesh = class extends Mesh {
  constructor(geometry, material, count2) {
    super(geometry, material);
    this.instanceMatrix = new InstancedBufferAttribute(new Float32Array(count2 * 16), 16);
    this.instanceColor = null;
    this.count = count2;
    this.frustumCulled = false;
  }
  copy(source) {
    super.copy(source);
    this.instanceMatrix.copy(source.instanceMatrix);
    if (source.instanceColor !== null)
      this.instanceColor = source.instanceColor.clone();
    this.count = source.count;
    return this;
  }
  getColorAt(index, color2) {
    color2.fromArray(this.instanceColor.array, index * 3);
  }
  getMatrixAt(index, matrix) {
    matrix.fromArray(this.instanceMatrix.array, index * 16);
  }
  raycast(raycaster, intersects2) {
    const matrixWorld = this.matrixWorld;
    const raycastTimes = this.count;
    _mesh.geometry = this.geometry;
    _mesh.material = this.material;
    if (_mesh.material === void 0)
      return;
    for (let instanceId = 0; instanceId < raycastTimes; instanceId++) {
      this.getMatrixAt(instanceId, _instanceLocalMatrix);
      _instanceWorldMatrix.multiplyMatrices(matrixWorld, _instanceLocalMatrix);
      _mesh.matrixWorld = _instanceWorldMatrix;
      _mesh.raycast(raycaster, _instanceIntersects);
      for (let i2 = 0, l = _instanceIntersects.length; i2 < l; i2++) {
        const intersect = _instanceIntersects[i2];
        intersect.instanceId = instanceId;
        intersect.object = this;
        intersects2.push(intersect);
      }
      _instanceIntersects.length = 0;
    }
  }
  setColorAt(index, color2) {
    if (this.instanceColor === null) {
      this.instanceColor = new InstancedBufferAttribute(new Float32Array(this.instanceMatrix.count * 3), 3);
    }
    color2.toArray(this.instanceColor.array, index * 3);
  }
  setMatrixAt(index, matrix) {
    matrix.toArray(this.instanceMatrix.array, index * 16);
  }
  updateMorphTargets() {
  }
  dispose() {
    this.dispatchEvent({ type: "dispose" });
  }
};
InstancedMesh.prototype.isInstancedMesh = true;
var LineBasicMaterial = class extends Material {
  constructor(parameters) {
    super();
    this.type = "LineBasicMaterial";
    this.color = new Color2(16777215);
    this.linewidth = 1;
    this.linecap = "round";
    this.linejoin = "round";
    this.setValues(parameters);
  }
  copy(source) {
    super.copy(source);
    this.color.copy(source.color);
    this.linewidth = source.linewidth;
    this.linecap = source.linecap;
    this.linejoin = source.linejoin;
    return this;
  }
};
LineBasicMaterial.prototype.isLineBasicMaterial = true;
var _start$1 = /* @__PURE__ */ new Vector3();
var _end$1 = /* @__PURE__ */ new Vector3();
var _inverseMatrix$1 = /* @__PURE__ */ new Matrix4();
var _ray$1 = /* @__PURE__ */ new Ray();
var _sphere$1 = /* @__PURE__ */ new Sphere();
var Line = class extends Object3D {
  constructor(geometry = new BufferGeometry(), material = new LineBasicMaterial()) {
    super();
    this.type = "Line";
    this.geometry = geometry;
    this.material = material;
    this.updateMorphTargets();
  }
  copy(source) {
    super.copy(source);
    this.material = source.material;
    this.geometry = source.geometry;
    return this;
  }
  computeLineDistances() {
    const geometry = this.geometry;
    if (geometry.isBufferGeometry) {
      if (geometry.index === null) {
        const positionAttribute = geometry.attributes.position;
        const lineDistances = [0];
        for (let i2 = 1, l = positionAttribute.count; i2 < l; i2++) {
          _start$1.fromBufferAttribute(positionAttribute, i2 - 1);
          _end$1.fromBufferAttribute(positionAttribute, i2);
          lineDistances[i2] = lineDistances[i2 - 1];
          lineDistances[i2] += _start$1.distanceTo(_end$1);
        }
        geometry.setAttribute("lineDistance", new Float32BufferAttribute(lineDistances, 1));
      } else {
        console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");
      }
    } else if (geometry.isGeometry) {
      console.error("THREE.Line.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");
    }
    return this;
  }
  raycast(raycaster, intersects2) {
    const geometry = this.geometry;
    const matrixWorld = this.matrixWorld;
    const threshold2 = raycaster.params.Line.threshold;
    const drawRange = geometry.drawRange;
    if (geometry.boundingSphere === null)
      geometry.computeBoundingSphere();
    _sphere$1.copy(geometry.boundingSphere);
    _sphere$1.applyMatrix4(matrixWorld);
    _sphere$1.radius += threshold2;
    if (raycaster.ray.intersectsSphere(_sphere$1) === false)
      return;
    _inverseMatrix$1.copy(matrixWorld).invert();
    _ray$1.copy(raycaster.ray).applyMatrix4(_inverseMatrix$1);
    const localThreshold = threshold2 / ((this.scale.x + this.scale.y + this.scale.z) / 3);
    const localThresholdSq = localThreshold * localThreshold;
    const vStart = new Vector3();
    const vEnd = new Vector3();
    const interSegment = new Vector3();
    const interRay = new Vector3();
    const step = this.isLineSegments ? 2 : 1;
    if (geometry.isBufferGeometry) {
      const index = geometry.index;
      const attributes = geometry.attributes;
      const positionAttribute = attributes.position;
      if (index !== null) {
        const start = Math.max(0, drawRange.start);
        const end = Math.min(index.count, drawRange.start + drawRange.count);
        for (let i2 = start, l = end - 1; i2 < l; i2 += step) {
          const a2 = index.getX(i2);
          const b = index.getX(i2 + 1);
          vStart.fromBufferAttribute(positionAttribute, a2);
          vEnd.fromBufferAttribute(positionAttribute, b);
          const distSq = _ray$1.distanceSqToSegment(vStart, vEnd, interRay, interSegment);
          if (distSq > localThresholdSq)
            continue;
          interRay.applyMatrix4(this.matrixWorld);
          const distance = raycaster.ray.origin.distanceTo(interRay);
          if (distance < raycaster.near || distance > raycaster.far)
            continue;
          intersects2.push({
            distance,
            // What do we want? intersection point on the ray or on the segment??
            // point: raycaster.ray.at( distance ),
            point: interSegment.clone().applyMatrix4(this.matrixWorld),
            index: i2,
            face: null,
            faceIndex: null,
            object: this
          });
        }
      } else {
        const start = Math.max(0, drawRange.start);
        const end = Math.min(positionAttribute.count, drawRange.start + drawRange.count);
        for (let i2 = start, l = end - 1; i2 < l; i2 += step) {
          vStart.fromBufferAttribute(positionAttribute, i2);
          vEnd.fromBufferAttribute(positionAttribute, i2 + 1);
          const distSq = _ray$1.distanceSqToSegment(vStart, vEnd, interRay, interSegment);
          if (distSq > localThresholdSq)
            continue;
          interRay.applyMatrix4(this.matrixWorld);
          const distance = raycaster.ray.origin.distanceTo(interRay);
          if (distance < raycaster.near || distance > raycaster.far)
            continue;
          intersects2.push({
            distance,
            // What do we want? intersection point on the ray or on the segment??
            // point: raycaster.ray.at( distance ),
            point: interSegment.clone().applyMatrix4(this.matrixWorld),
            index: i2,
            face: null,
            faceIndex: null,
            object: this
          });
        }
      }
    } else if (geometry.isGeometry) {
      console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");
    }
  }
  updateMorphTargets() {
    const geometry = this.geometry;
    if (geometry.isBufferGeometry) {
      const morphAttributes = geometry.morphAttributes;
      const keys4 = Object.keys(morphAttributes);
      if (keys4.length > 0) {
        const morphAttribute = morphAttributes[keys4[0]];
        if (morphAttribute !== void 0) {
          this.morphTargetInfluences = [];
          this.morphTargetDictionary = {};
          for (let m = 0, ml = morphAttribute.length; m < ml; m++) {
            const name2 = morphAttribute[m].name || String(m);
            this.morphTargetInfluences.push(0);
            this.morphTargetDictionary[name2] = m;
          }
        }
      }
    } else {
      const morphTargets = geometry.morphTargets;
      if (morphTargets !== void 0 && morphTargets.length > 0) {
        console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.");
      }
    }
  }
};
Line.prototype.isLine = true;
var _start = /* @__PURE__ */ new Vector3();
var _end = /* @__PURE__ */ new Vector3();
var LineSegments = class extends Line {
  constructor(geometry, material) {
    super(geometry, material);
    this.type = "LineSegments";
  }
  computeLineDistances() {
    const geometry = this.geometry;
    if (geometry.isBufferGeometry) {
      if (geometry.index === null) {
        const positionAttribute = geometry.attributes.position;
        const lineDistances = [];
        for (let i2 = 0, l = positionAttribute.count; i2 < l; i2 += 2) {
          _start.fromBufferAttribute(positionAttribute, i2);
          _end.fromBufferAttribute(positionAttribute, i2 + 1);
          lineDistances[i2] = i2 === 0 ? 0 : lineDistances[i2 - 1];
          lineDistances[i2 + 1] = lineDistances[i2] + _start.distanceTo(_end);
        }
        geometry.setAttribute("lineDistance", new Float32BufferAttribute(lineDistances, 1));
      } else {
        console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");
      }
    } else if (geometry.isGeometry) {
      console.error("THREE.LineSegments.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");
    }
    return this;
  }
};
LineSegments.prototype.isLineSegments = true;
var LineLoop = class extends Line {
  constructor(geometry, material) {
    super(geometry, material);
    this.type = "LineLoop";
  }
};
LineLoop.prototype.isLineLoop = true;
var PointsMaterial = class extends Material {
  constructor(parameters) {
    super();
    this.type = "PointsMaterial";
    this.color = new Color2(16777215);
    this.map = null;
    this.alphaMap = null;
    this.size = 1;
    this.sizeAttenuation = true;
    this.setValues(parameters);
  }
  copy(source) {
    super.copy(source);
    this.color.copy(source.color);
    this.map = source.map;
    this.alphaMap = source.alphaMap;
    this.size = source.size;
    this.sizeAttenuation = source.sizeAttenuation;
    return this;
  }
};
PointsMaterial.prototype.isPointsMaterial = true;
var _inverseMatrix = /* @__PURE__ */ new Matrix4();
var _ray = /* @__PURE__ */ new Ray();
var _sphere = /* @__PURE__ */ new Sphere();
var _position$2 = /* @__PURE__ */ new Vector3();
var Points = class extends Object3D {
  constructor(geometry = new BufferGeometry(), material = new PointsMaterial()) {
    super();
    this.type = "Points";
    this.geometry = geometry;
    this.material = material;
    this.updateMorphTargets();
  }
  copy(source) {
    super.copy(source);
    this.material = source.material;
    this.geometry = source.geometry;
    return this;
  }
  raycast(raycaster, intersects2) {
    const geometry = this.geometry;
    const matrixWorld = this.matrixWorld;
    const threshold2 = raycaster.params.Points.threshold;
    const drawRange = geometry.drawRange;
    if (geometry.boundingSphere === null)
      geometry.computeBoundingSphere();
    _sphere.copy(geometry.boundingSphere);
    _sphere.applyMatrix4(matrixWorld);
    _sphere.radius += threshold2;
    if (raycaster.ray.intersectsSphere(_sphere) === false)
      return;
    _inverseMatrix.copy(matrixWorld).invert();
    _ray.copy(raycaster.ray).applyMatrix4(_inverseMatrix);
    const localThreshold = threshold2 / ((this.scale.x + this.scale.y + this.scale.z) / 3);
    const localThresholdSq = localThreshold * localThreshold;
    if (geometry.isBufferGeometry) {
      const index = geometry.index;
      const attributes = geometry.attributes;
      const positionAttribute = attributes.position;
      if (index !== null) {
        const start = Math.max(0, drawRange.start);
        const end = Math.min(index.count, drawRange.start + drawRange.count);
        for (let i2 = start, il = end; i2 < il; i2++) {
          const a2 = index.getX(i2);
          _position$2.fromBufferAttribute(positionAttribute, a2);
          testPoint(_position$2, a2, localThresholdSq, matrixWorld, raycaster, intersects2, this);
        }
      } else {
        const start = Math.max(0, drawRange.start);
        const end = Math.min(positionAttribute.count, drawRange.start + drawRange.count);
        for (let i2 = start, l = end; i2 < l; i2++) {
          _position$2.fromBufferAttribute(positionAttribute, i2);
          testPoint(_position$2, i2, localThresholdSq, matrixWorld, raycaster, intersects2, this);
        }
      }
    } else {
      console.error("THREE.Points.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");
    }
  }
  updateMorphTargets() {
    const geometry = this.geometry;
    if (geometry.isBufferGeometry) {
      const morphAttributes = geometry.morphAttributes;
      const keys4 = Object.keys(morphAttributes);
      if (keys4.length > 0) {
        const morphAttribute = morphAttributes[keys4[0]];
        if (morphAttribute !== void 0) {
          this.morphTargetInfluences = [];
          this.morphTargetDictionary = {};
          for (let m = 0, ml = morphAttribute.length; m < ml; m++) {
            const name2 = morphAttribute[m].name || String(m);
            this.morphTargetInfluences.push(0);
            this.morphTargetDictionary[name2] = m;
          }
        }
      }
    } else {
      const morphTargets = geometry.morphTargets;
      if (morphTargets !== void 0 && morphTargets.length > 0) {
        console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.");
      }
    }
  }
};
Points.prototype.isPoints = true;
function testPoint(point4, index, localThresholdSq, matrixWorld, raycaster, intersects2, object) {
  const rayPointDistanceSq = _ray.distanceSqToPoint(point4);
  if (rayPointDistanceSq < localThresholdSq) {
    const intersectPoint = new Vector3();
    _ray.closestPointToPoint(point4, intersectPoint);
    intersectPoint.applyMatrix4(matrixWorld);
    const distance = raycaster.ray.origin.distanceTo(intersectPoint);
    if (distance < raycaster.near || distance > raycaster.far)
      return;
    intersects2.push({
      distance,
      distanceToRay: Math.sqrt(rayPointDistanceSq),
      point: intersectPoint,
      index,
      face: null,
      object
    });
  }
}
var VideoTexture = class extends Texture {
  constructor(video, mapping, wrapS, wrapT, magFilter, minFilter, format3, type, anisotropy) {
    super(video, mapping, wrapS, wrapT, magFilter, minFilter, format3, type, anisotropy);
    this.minFilter = minFilter !== void 0 ? minFilter : LinearFilter;
    this.magFilter = magFilter !== void 0 ? magFilter : LinearFilter;
    this.generateMipmaps = false;
    const scope = this;
    function updateVideo() {
      scope.needsUpdate = true;
      video.requestVideoFrameCallback(updateVideo);
    }
    if ("requestVideoFrameCallback" in video) {
      video.requestVideoFrameCallback(updateVideo);
    }
  }
  clone() {
    return new this.constructor(this.image).copy(this);
  }
  update() {
    const video = this.image;
    const hasVideoFrameCallback = "requestVideoFrameCallback" in video;
    if (hasVideoFrameCallback === false && video.readyState >= video.HAVE_CURRENT_DATA) {
      this.needsUpdate = true;
    }
  }
};
VideoTexture.prototype.isVideoTexture = true;
var FramebufferTexture = class extends Texture {
  constructor(width, height, format3) {
    super({ width, height });
    this.format = format3;
    this.magFilter = NearestFilter;
    this.minFilter = NearestFilter;
    this.generateMipmaps = false;
    this.needsUpdate = true;
  }
};
FramebufferTexture.prototype.isFramebufferTexture = true;
var CompressedTexture = class extends Texture {
  constructor(mipmaps, width, height, format3, type, mapping, wrapS, wrapT, magFilter, minFilter, anisotropy, encoding) {
    super(null, mapping, wrapS, wrapT, magFilter, minFilter, format3, type, anisotropy, encoding);
    this.image = { width, height };
    this.mipmaps = mipmaps;
    this.flipY = false;
    this.generateMipmaps = false;
  }
};
CompressedTexture.prototype.isCompressedTexture = true;
var CanvasTexture = class extends Texture {
  constructor(canvas, mapping, wrapS, wrapT, magFilter, minFilter, format3, type, anisotropy) {
    super(canvas, mapping, wrapS, wrapT, magFilter, minFilter, format3, type, anisotropy);
    this.needsUpdate = true;
  }
};
CanvasTexture.prototype.isCanvasTexture = true;
var Curve = class {
  constructor() {
    this.type = "Curve";
    this.arcLengthDivisions = 200;
  }
  // Virtual base class method to overwrite and implement in subclasses
  //	- t [0 .. 1]
  getPoint() {
    console.warn("THREE.Curve: .getPoint() not implemented.");
    return null;
  }
  // Get point at relative position in curve according to arc length
  // - u [0 .. 1]
  getPointAt(u, optionalTarget) {
    const t3 = this.getUtoTmapping(u);
    return this.getPoint(t3, optionalTarget);
  }
  // Get sequence of points using getPoint( t )
  getPoints(divisions = 5) {
    const points = [];
    for (let d = 0; d <= divisions; d++) {
      points.push(this.getPoint(d / divisions));
    }
    return points;
  }
  // Get sequence of points using getPointAt( u )
  getSpacedPoints(divisions = 5) {
    const points = [];
    for (let d = 0; d <= divisions; d++) {
      points.push(this.getPointAt(d / divisions));
    }
    return points;
  }
  // Get total curve arc length
  getLength() {
    const lengths = this.getLengths();
    return lengths[lengths.length - 1];
  }
  // Get list of cumulative segment lengths
  getLengths(divisions = this.arcLengthDivisions) {
    if (this.cacheArcLengths && this.cacheArcLengths.length === divisions + 1 && !this.needsUpdate) {
      return this.cacheArcLengths;
    }
    this.needsUpdate = false;
    const cache2 = [];
    let current, last = this.getPoint(0);
    let sum2 = 0;
    cache2.push(0);
    for (let p = 1; p <= divisions; p++) {
      current = this.getPoint(p / divisions);
      sum2 += current.distanceTo(last);
      cache2.push(sum2);
      last = current;
    }
    this.cacheArcLengths = cache2;
    return cache2;
  }
  updateArcLengths() {
    this.needsUpdate = true;
    this.getLengths();
  }
  // Given u ( 0 .. 1 ), get a t to find p. This gives you points which are equidistant
  getUtoTmapping(u, distance) {
    const arcLengths = this.getLengths();
    let i2 = 0;
    const il = arcLengths.length;
    let targetArcLength;
    if (distance) {
      targetArcLength = distance;
    } else {
      targetArcLength = u * arcLengths[il - 1];
    }
    let low = 0, high = il - 1, comparison;
    while (low <= high) {
      i2 = Math.floor(low + (high - low) / 2);
      comparison = arcLengths[i2] - targetArcLength;
      if (comparison < 0) {
        low = i2 + 1;
      } else if (comparison > 0) {
        high = i2 - 1;
      } else {
        high = i2;
        break;
      }
    }
    i2 = high;
    if (arcLengths[i2] === targetArcLength) {
      return i2 / (il - 1);
    }
    const lengthBefore = arcLengths[i2];
    const lengthAfter = arcLengths[i2 + 1];
    const segmentLength = lengthAfter - lengthBefore;
    const segmentFraction = (targetArcLength - lengthBefore) / segmentLength;
    const t3 = (i2 + segmentFraction) / (il - 1);
    return t3;
  }
  // Returns a unit vector tangent at t
  // In case any sub curve does not implement its tangent derivation,
  // 2 points a small delta apart will be used to find its gradient
  // which seems to give a reasonable approximation
  getTangent(t3, optionalTarget) {
    const delta = 1e-4;
    let t12 = t3 - delta;
    let t22 = t3 + delta;
    if (t12 < 0)
      t12 = 0;
    if (t22 > 1)
      t22 = 1;
    const pt1 = this.getPoint(t12);
    const pt2 = this.getPoint(t22);
    const tangent = optionalTarget || (pt1.isVector2 ? new Vector2() : new Vector3());
    tangent.copy(pt2).sub(pt1).normalize();
    return tangent;
  }
  getTangentAt(u, optionalTarget) {
    const t3 = this.getUtoTmapping(u);
    return this.getTangent(t3, optionalTarget);
  }
  computeFrenetFrames(segments, closed) {
    const normal = new Vector3();
    const tangents = [];
    const normals = [];
    const binormals = [];
    const vec2 = new Vector3();
    const mat = new Matrix4();
    for (let i2 = 0; i2 <= segments; i2++) {
      const u = i2 / segments;
      tangents[i2] = this.getTangentAt(u, new Vector3());
    }
    normals[0] = new Vector3();
    binormals[0] = new Vector3();
    let min3 = Number.MAX_VALUE;
    const tx = Math.abs(tangents[0].x);
    const ty = Math.abs(tangents[0].y);
    const tz = Math.abs(tangents[0].z);
    if (tx <= min3) {
      min3 = tx;
      normal.set(1, 0, 0);
    }
    if (ty <= min3) {
      min3 = ty;
      normal.set(0, 1, 0);
    }
    if (tz <= min3) {
      normal.set(0, 0, 1);
    }
    vec2.crossVectors(tangents[0], normal).normalize();
    normals[0].crossVectors(tangents[0], vec2);
    binormals[0].crossVectors(tangents[0], normals[0]);
    for (let i2 = 1; i2 <= segments; i2++) {
      normals[i2] = normals[i2 - 1].clone();
      binormals[i2] = binormals[i2 - 1].clone();
      vec2.crossVectors(tangents[i2 - 1], tangents[i2]);
      if (vec2.length() > Number.EPSILON) {
        vec2.normalize();
        const theta = Math.acos(clamp(tangents[i2 - 1].dot(tangents[i2]), -1, 1));
        normals[i2].applyMatrix4(mat.makeRotationAxis(vec2, theta));
      }
      binormals[i2].crossVectors(tangents[i2], normals[i2]);
    }
    if (closed === true) {
      let theta = Math.acos(clamp(normals[0].dot(normals[segments]), -1, 1));
      theta /= segments;
      if (tangents[0].dot(vec2.crossVectors(normals[0], normals[segments])) > 0) {
        theta = -theta;
      }
      for (let i2 = 1; i2 <= segments; i2++) {
        normals[i2].applyMatrix4(mat.makeRotationAxis(tangents[i2], theta * i2));
        binormals[i2].crossVectors(tangents[i2], normals[i2]);
      }
    }
    return {
      tangents,
      normals,
      binormals
    };
  }
  clone() {
    return new this.constructor().copy(this);
  }
  copy(source) {
    this.arcLengthDivisions = source.arcLengthDivisions;
    return this;
  }
  toJSON() {
    const data = {
      metadata: {
        version: 4.5,
        type: "Curve",
        generator: "Curve.toJSON"
      }
    };
    data.arcLengthDivisions = this.arcLengthDivisions;
    data.type = this.type;
    return data;
  }
  fromJSON(json3) {
    this.arcLengthDivisions = json3.arcLengthDivisions;
    return this;
  }
};
var EllipseCurve = class extends Curve {
  constructor(aX = 0, aY = 0, xRadius = 1, yRadius = 1, aStartAngle = 0, aEndAngle = Math.PI * 2, aClockwise = false, aRotation = 0) {
    super();
    this.type = "EllipseCurve";
    this.aX = aX;
    this.aY = aY;
    this.xRadius = xRadius;
    this.yRadius = yRadius;
    this.aStartAngle = aStartAngle;
    this.aEndAngle = aEndAngle;
    this.aClockwise = aClockwise;
    this.aRotation = aRotation;
  }
  getPoint(t3, optionalTarget) {
    const point4 = optionalTarget || new Vector2();
    const twoPi = Math.PI * 2;
    let deltaAngle = this.aEndAngle - this.aStartAngle;
    const samePoints = Math.abs(deltaAngle) < Number.EPSILON;
    while (deltaAngle < 0)
      deltaAngle += twoPi;
    while (deltaAngle > twoPi)
      deltaAngle -= twoPi;
    if (deltaAngle < Number.EPSILON) {
      if (samePoints) {
        deltaAngle = 0;
      } else {
        deltaAngle = twoPi;
      }
    }
    if (this.aClockwise === true && !samePoints) {
      if (deltaAngle === twoPi) {
        deltaAngle = -twoPi;
      } else {
        deltaAngle = deltaAngle - twoPi;
      }
    }
    const angle = this.aStartAngle + t3 * deltaAngle;
    let x2 = this.aX + this.xRadius * Math.cos(angle);
    let y2 = this.aY + this.yRadius * Math.sin(angle);
    if (this.aRotation !== 0) {
      const cos2 = Math.cos(this.aRotation);
      const sin2 = Math.sin(this.aRotation);
      const tx = x2 - this.aX;
      const ty = y2 - this.aY;
      x2 = tx * cos2 - ty * sin2 + this.aX;
      y2 = tx * sin2 + ty * cos2 + this.aY;
    }
    return point4.set(x2, y2);
  }
  copy(source) {
    super.copy(source);
    this.aX = source.aX;
    this.aY = source.aY;
    this.xRadius = source.xRadius;
    this.yRadius = source.yRadius;
    this.aStartAngle = source.aStartAngle;
    this.aEndAngle = source.aEndAngle;
    this.aClockwise = source.aClockwise;
    this.aRotation = source.aRotation;
    return this;
  }
  toJSON() {
    const data = super.toJSON();
    data.aX = this.aX;
    data.aY = this.aY;
    data.xRadius = this.xRadius;
    data.yRadius = this.yRadius;
    data.aStartAngle = this.aStartAngle;
    data.aEndAngle = this.aEndAngle;
    data.aClockwise = this.aClockwise;
    data.aRotation = this.aRotation;
    return data;
  }
  fromJSON(json3) {
    super.fromJSON(json3);
    this.aX = json3.aX;
    this.aY = json3.aY;
    this.xRadius = json3.xRadius;
    this.yRadius = json3.yRadius;
    this.aStartAngle = json3.aStartAngle;
    this.aEndAngle = json3.aEndAngle;
    this.aClockwise = json3.aClockwise;
    this.aRotation = json3.aRotation;
    return this;
  }
};
EllipseCurve.prototype.isEllipseCurve = true;
var ArcCurve = class extends EllipseCurve {
  constructor(aX, aY, aRadius, aStartAngle, aEndAngle, aClockwise) {
    super(aX, aY, aRadius, aRadius, aStartAngle, aEndAngle, aClockwise);
    this.type = "ArcCurve";
  }
};
ArcCurve.prototype.isArcCurve = true;
function CubicPoly() {
  let c0 = 0, c1 = 0, c22 = 0, c32 = 0;
  function init(x0, x1, t02, t12) {
    c0 = x0;
    c1 = t02;
    c22 = -3 * x0 + 3 * x1 - 2 * t02 - t12;
    c32 = 2 * x0 - 2 * x1 + t02 + t12;
  }
  return {
    initCatmullRom: function(x0, x1, x2, x3, tension) {
      init(x1, x2, tension * (x2 - x0), tension * (x3 - x1));
    },
    initNonuniformCatmullRom: function(x0, x1, x2, x3, dt0, dt1, dt2) {
      let t12 = (x1 - x0) / dt0 - (x2 - x0) / (dt0 + dt1) + (x2 - x1) / dt1;
      let t22 = (x2 - x1) / dt1 - (x3 - x1) / (dt1 + dt2) + (x3 - x2) / dt2;
      t12 *= dt1;
      t22 *= dt1;
      init(x1, x2, t12, t22);
    },
    calc: function(t3) {
      const t22 = t3 * t3;
      const t32 = t22 * t3;
      return c0 + c1 * t3 + c22 * t22 + c32 * t32;
    }
  };
}
var tmp = new Vector3();
var px = new CubicPoly();
var py = new CubicPoly();
var pz = new CubicPoly();
var CatmullRomCurve3 = class extends Curve {
  constructor(points = [], closed = false, curveType = "centripetal", tension = 0.5) {
    super();
    this.type = "CatmullRomCurve3";
    this.points = points;
    this.closed = closed;
    this.curveType = curveType;
    this.tension = tension;
  }
  getPoint(t3, optionalTarget = new Vector3()) {
    const point4 = optionalTarget;
    const points = this.points;
    const l = points.length;
    const p = (l - (this.closed ? 0 : 1)) * t3;
    let intPoint = Math.floor(p);
    let weight = p - intPoint;
    if (this.closed) {
      intPoint += intPoint > 0 ? 0 : (Math.floor(Math.abs(intPoint) / l) + 1) * l;
    } else if (weight === 0 && intPoint === l - 1) {
      intPoint = l - 2;
      weight = 1;
    }
    let p0, p3;
    if (this.closed || intPoint > 0) {
      p0 = points[(intPoint - 1) % l];
    } else {
      tmp.subVectors(points[0], points[1]).add(points[0]);
      p0 = tmp;
    }
    const p1 = points[intPoint % l];
    const p2 = points[(intPoint + 1) % l];
    if (this.closed || intPoint + 2 < l) {
      p3 = points[(intPoint + 2) % l];
    } else {
      tmp.subVectors(points[l - 1], points[l - 2]).add(points[l - 1]);
      p3 = tmp;
    }
    if (this.curveType === "centripetal" || this.curveType === "chordal") {
      const pow2 = this.curveType === "chordal" ? 0.5 : 0.25;
      let dt0 = Math.pow(p0.distanceToSquared(p1), pow2);
      let dt1 = Math.pow(p1.distanceToSquared(p2), pow2);
      let dt2 = Math.pow(p2.distanceToSquared(p3), pow2);
      if (dt1 < 1e-4)
        dt1 = 1;
      if (dt0 < 1e-4)
        dt0 = dt1;
      if (dt2 < 1e-4)
        dt2 = dt1;
      px.initNonuniformCatmullRom(p0.x, p1.x, p2.x, p3.x, dt0, dt1, dt2);
      py.initNonuniformCatmullRom(p0.y, p1.y, p2.y, p3.y, dt0, dt1, dt2);
      pz.initNonuniformCatmullRom(p0.z, p1.z, p2.z, p3.z, dt0, dt1, dt2);
    } else if (this.curveType === "catmullrom") {
      px.initCatmullRom(p0.x, p1.x, p2.x, p3.x, this.tension);
      py.initCatmullRom(p0.y, p1.y, p2.y, p3.y, this.tension);
      pz.initCatmullRom(p0.z, p1.z, p2.z, p3.z, this.tension);
    }
    point4.set(
      px.calc(weight),
      py.calc(weight),
      pz.calc(weight)
    );
    return point4;
  }
  copy(source) {
    super.copy(source);
    this.points = [];
    for (let i2 = 0, l = source.points.length; i2 < l; i2++) {
      const point4 = source.points[i2];
      this.points.push(point4.clone());
    }
    this.closed = source.closed;
    this.curveType = source.curveType;
    this.tension = source.tension;
    return this;
  }
  toJSON() {
    const data = super.toJSON();
    data.points = [];
    for (let i2 = 0, l = this.points.length; i2 < l; i2++) {
      const point4 = this.points[i2];
      data.points.push(point4.toArray());
    }
    data.closed = this.closed;
    data.curveType = this.curveType;
    data.tension = this.tension;
    return data;
  }
  fromJSON(json3) {
    super.fromJSON(json3);
    this.points = [];
    for (let i2 = 0, l = json3.points.length; i2 < l; i2++) {
      const point4 = json3.points[i2];
      this.points.push(new Vector3().fromArray(point4));
    }
    this.closed = json3.closed;
    this.curveType = json3.curveType;
    this.tension = json3.tension;
    return this;
  }
};
CatmullRomCurve3.prototype.isCatmullRomCurve3 = true;
function CatmullRom(t3, p0, p1, p2, p3) {
  const v0 = (p2 - p0) * 0.5;
  const v12 = (p3 - p1) * 0.5;
  const t22 = t3 * t3;
  const t32 = t3 * t22;
  return (2 * p1 - 2 * p2 + v0 + v12) * t32 + (-3 * p1 + 3 * p2 - 2 * v0 - v12) * t22 + v0 * t3 + p1;
}
function QuadraticBezierP0(t3, p) {
  const k2 = 1 - t3;
  return k2 * k2 * p;
}
function QuadraticBezierP1(t3, p) {
  return 2 * (1 - t3) * t3 * p;
}
function QuadraticBezierP2(t3, p) {
  return t3 * t3 * p;
}
function QuadraticBezier(t3, p0, p1, p2) {
  return QuadraticBezierP0(t3, p0) + QuadraticBezierP1(t3, p1) + QuadraticBezierP2(t3, p2);
}
function CubicBezierP0(t3, p) {
  const k2 = 1 - t3;
  return k2 * k2 * k2 * p;
}
function CubicBezierP1(t3, p) {
  const k2 = 1 - t3;
  return 3 * k2 * k2 * t3 * p;
}
function CubicBezierP2(t3, p) {
  return 3 * (1 - t3) * t3 * t3 * p;
}
function CubicBezierP3(t3, p) {
  return t3 * t3 * t3 * p;
}
function CubicBezier(t3, p0, p1, p2, p3) {
  return CubicBezierP0(t3, p0) + CubicBezierP1(t3, p1) + CubicBezierP2(t3, p2) + CubicBezierP3(t3, p3);
}
var CubicBezierCurve = class extends Curve {
  constructor(v0 = new Vector2(), v12 = new Vector2(), v22 = new Vector2(), v32 = new Vector2()) {
    super();
    this.type = "CubicBezierCurve";
    this.v0 = v0;
    this.v1 = v12;
    this.v2 = v22;
    this.v3 = v32;
  }
  getPoint(t3, optionalTarget = new Vector2()) {
    const point4 = optionalTarget;
    const v0 = this.v0, v12 = this.v1, v22 = this.v2, v32 = this.v3;
    point4.set(
      CubicBezier(t3, v0.x, v12.x, v22.x, v32.x),
      CubicBezier(t3, v0.y, v12.y, v22.y, v32.y)
    );
    return point4;
  }
  copy(source) {
    super.copy(source);
    this.v0.copy(source.v0);
    this.v1.copy(source.v1);
    this.v2.copy(source.v2);
    this.v3.copy(source.v3);
    return this;
  }
  toJSON() {
    const data = super.toJSON();
    data.v0 = this.v0.toArray();
    data.v1 = this.v1.toArray();
    data.v2 = this.v2.toArray();
    data.v3 = this.v3.toArray();
    return data;
  }
  fromJSON(json3) {
    super.fromJSON(json3);
    this.v0.fromArray(json3.v0);
    this.v1.fromArray(json3.v1);
    this.v2.fromArray(json3.v2);
    this.v3.fromArray(json3.v3);
    return this;
  }
};
CubicBezierCurve.prototype.isCubicBezierCurve = true;
var CubicBezierCurve3 = class extends Curve {
  constructor(v0 = new Vector3(), v12 = new Vector3(), v22 = new Vector3(), v32 = new Vector3()) {
    super();
    this.type = "CubicBezierCurve3";
    this.v0 = v0;
    this.v1 = v12;
    this.v2 = v22;
    this.v3 = v32;
  }
  getPoint(t3, optionalTarget = new Vector3()) {
    const point4 = optionalTarget;
    const v0 = this.v0, v12 = this.v1, v22 = this.v2, v32 = this.v3;
    point4.set(
      CubicBezier(t3, v0.x, v12.x, v22.x, v32.x),
      CubicBezier(t3, v0.y, v12.y, v22.y, v32.y),
      CubicBezier(t3, v0.z, v12.z, v22.z, v32.z)
    );
    return point4;
  }
  copy(source) {
    super.copy(source);
    this.v0.copy(source.v0);
    this.v1.copy(source.v1);
    this.v2.copy(source.v2);
    this.v3.copy(source.v3);
    return this;
  }
  toJSON() {
    const data = super.toJSON();
    data.v0 = this.v0.toArray();
    data.v1 = this.v1.toArray();
    data.v2 = this.v2.toArray();
    data.v3 = this.v3.toArray();
    return data;
  }
  fromJSON(json3) {
    super.fromJSON(json3);
    this.v0.fromArray(json3.v0);
    this.v1.fromArray(json3.v1);
    this.v2.fromArray(json3.v2);
    this.v3.fromArray(json3.v3);
    return this;
  }
};
CubicBezierCurve3.prototype.isCubicBezierCurve3 = true;
var LineCurve = class extends Curve {
  constructor(v12 = new Vector2(), v22 = new Vector2()) {
    super();
    this.type = "LineCurve";
    this.v1 = v12;
    this.v2 = v22;
  }
  getPoint(t3, optionalTarget = new Vector2()) {
    const point4 = optionalTarget;
    if (t3 === 1) {
      point4.copy(this.v2);
    } else {
      point4.copy(this.v2).sub(this.v1);
      point4.multiplyScalar(t3).add(this.v1);
    }
    return point4;
  }
  // Line curve is linear, so we can overwrite default getPointAt
  getPointAt(u, optionalTarget) {
    return this.getPoint(u, optionalTarget);
  }
  getTangent(t3, optionalTarget) {
    const tangent = optionalTarget || new Vector2();
    tangent.copy(this.v2).sub(this.v1).normalize();
    return tangent;
  }
  copy(source) {
    super.copy(source);
    this.v1.copy(source.v1);
    this.v2.copy(source.v2);
    return this;
  }
  toJSON() {
    const data = super.toJSON();
    data.v1 = this.v1.toArray();
    data.v2 = this.v2.toArray();
    return data;
  }
  fromJSON(json3) {
    super.fromJSON(json3);
    this.v1.fromArray(json3.v1);
    this.v2.fromArray(json3.v2);
    return this;
  }
};
LineCurve.prototype.isLineCurve = true;
var LineCurve3 = class extends Curve {
  constructor(v12 = new Vector3(), v22 = new Vector3()) {
    super();
    this.type = "LineCurve3";
    this.isLineCurve3 = true;
    this.v1 = v12;
    this.v2 = v22;
  }
  getPoint(t3, optionalTarget = new Vector3()) {
    const point4 = optionalTarget;
    if (t3 === 1) {
      point4.copy(this.v2);
    } else {
      point4.copy(this.v2).sub(this.v1);
      point4.multiplyScalar(t3).add(this.v1);
    }
    return point4;
  }
  // Line curve is linear, so we can overwrite default getPointAt
  getPointAt(u, optionalTarget) {
    return this.getPoint(u, optionalTarget);
  }
  copy(source) {
    super.copy(source);
    this.v1.copy(source.v1);
    this.v2.copy(source.v2);
    return this;
  }
  toJSON() {
    const data = super.toJSON();
    data.v1 = this.v1.toArray();
    data.v2 = this.v2.toArray();
    return data;
  }
  fromJSON(json3) {
    super.fromJSON(json3);
    this.v1.fromArray(json3.v1);
    this.v2.fromArray(json3.v2);
    return this;
  }
};
var QuadraticBezierCurve = class extends Curve {
  constructor(v0 = new Vector2(), v12 = new Vector2(), v22 = new Vector2()) {
    super();
    this.type = "QuadraticBezierCurve";
    this.v0 = v0;
    this.v1 = v12;
    this.v2 = v22;
  }
  getPoint(t3, optionalTarget = new Vector2()) {
    const point4 = optionalTarget;
    const v0 = this.v0, v12 = this.v1, v22 = this.v2;
    point4.set(
      QuadraticBezier(t3, v0.x, v12.x, v22.x),
      QuadraticBezier(t3, v0.y, v12.y, v22.y)
    );
    return point4;
  }
  copy(source) {
    super.copy(source);
    this.v0.copy(source.v0);
    this.v1.copy(source.v1);
    this.v2.copy(source.v2);
    return this;
  }
  toJSON() {
    const data = super.toJSON();
    data.v0 = this.v0.toArray();
    data.v1 = this.v1.toArray();
    data.v2 = this.v2.toArray();
    return data;
  }
  fromJSON(json3) {
    super.fromJSON(json3);
    this.v0.fromArray(json3.v0);
    this.v1.fromArray(json3.v1);
    this.v2.fromArray(json3.v2);
    return this;
  }
};
QuadraticBezierCurve.prototype.isQuadraticBezierCurve = true;
var QuadraticBezierCurve3 = class extends Curve {
  constructor(v0 = new Vector3(), v12 = new Vector3(), v22 = new Vector3()) {
    super();
    this.type = "QuadraticBezierCurve3";
    this.v0 = v0;
    this.v1 = v12;
    this.v2 = v22;
  }
  getPoint(t3, optionalTarget = new Vector3()) {
    const point4 = optionalTarget;
    const v0 = this.v0, v12 = this.v1, v22 = this.v2;
    point4.set(
      QuadraticBezier(t3, v0.x, v12.x, v22.x),
      QuadraticBezier(t3, v0.y, v12.y, v22.y),
      QuadraticBezier(t3, v0.z, v12.z, v22.z)
    );
    return point4;
  }
  copy(source) {
    super.copy(source);
    this.v0.copy(source.v0);
    this.v1.copy(source.v1);
    this.v2.copy(source.v2);
    return this;
  }
  toJSON() {
    const data = super.toJSON();
    data.v0 = this.v0.toArray();
    data.v1 = this.v1.toArray();
    data.v2 = this.v2.toArray();
    return data;
  }
  fromJSON(json3) {
    super.fromJSON(json3);
    this.v0.fromArray(json3.v0);
    this.v1.fromArray(json3.v1);
    this.v2.fromArray(json3.v2);
    return this;
  }
};
QuadraticBezierCurve3.prototype.isQuadraticBezierCurve3 = true;
var SplineCurve = class extends Curve {
  constructor(points = []) {
    super();
    this.type = "SplineCurve";
    this.points = points;
  }
  getPoint(t3, optionalTarget = new Vector2()) {
    const point4 = optionalTarget;
    const points = this.points;
    const p = (points.length - 1) * t3;
    const intPoint = Math.floor(p);
    const weight = p - intPoint;
    const p0 = points[intPoint === 0 ? intPoint : intPoint - 1];
    const p1 = points[intPoint];
    const p2 = points[intPoint > points.length - 2 ? points.length - 1 : intPoint + 1];
    const p3 = points[intPoint > points.length - 3 ? points.length - 1 : intPoint + 2];
    point4.set(
      CatmullRom(weight, p0.x, p1.x, p2.x, p3.x),
      CatmullRom(weight, p0.y, p1.y, p2.y, p3.y)
    );
    return point4;
  }
  copy(source) {
    super.copy(source);
    this.points = [];
    for (let i2 = 0, l = source.points.length; i2 < l; i2++) {
      const point4 = source.points[i2];
      this.points.push(point4.clone());
    }
    return this;
  }
  toJSON() {
    const data = super.toJSON();
    data.points = [];
    for (let i2 = 0, l = this.points.length; i2 < l; i2++) {
      const point4 = this.points[i2];
      data.points.push(point4.toArray());
    }
    return data;
  }
  fromJSON(json3) {
    super.fromJSON(json3);
    this.points = [];
    for (let i2 = 0, l = json3.points.length; i2 < l; i2++) {
      const point4 = json3.points[i2];
      this.points.push(new Vector2().fromArray(point4));
    }
    return this;
  }
};
SplineCurve.prototype.isSplineCurve = true;
var Curves = /* @__PURE__ */ Object.freeze({
  __proto__: null,
  ArcCurve,
  CatmullRomCurve3,
  CubicBezierCurve,
  CubicBezierCurve3,
  EllipseCurve,
  LineCurve,
  LineCurve3,
  QuadraticBezierCurve,
  QuadraticBezierCurve3,
  SplineCurve
});
var CurvePath = class extends Curve {
  constructor() {
    super();
    this.type = "CurvePath";
    this.curves = [];
    this.autoClose = false;
  }
  add(curve) {
    this.curves.push(curve);
  }
  closePath() {
    const startPoint = this.curves[0].getPoint(0);
    const endPoint = this.curves[this.curves.length - 1].getPoint(1);
    if (!startPoint.equals(endPoint)) {
      this.curves.push(new LineCurve(endPoint, startPoint));
    }
  }
  // To get accurate point with reference to
  // entire path distance at time t,
  // following has to be done:
  // 1. Length of each sub path have to be known
  // 2. Locate and identify type of curve
  // 3. Get t for the curve
  // 4. Return curve.getPointAt(t')
  getPoint(t3, optionalTarget) {
    const d = t3 * this.getLength();
    const curveLengths = this.getCurveLengths();
    let i2 = 0;
    while (i2 < curveLengths.length) {
      if (curveLengths[i2] >= d) {
        const diff = curveLengths[i2] - d;
        const curve = this.curves[i2];
        const segmentLength = curve.getLength();
        const u = segmentLength === 0 ? 0 : 1 - diff / segmentLength;
        return curve.getPointAt(u, optionalTarget);
      }
      i2++;
    }
    return null;
  }
  // We cannot use the default THREE.Curve getPoint() with getLength() because in
  // THREE.Curve, getLength() depends on getPoint() but in THREE.CurvePath
  // getPoint() depends on getLength
  getLength() {
    const lens = this.getCurveLengths();
    return lens[lens.length - 1];
  }
  // cacheLengths must be recalculated.
  updateArcLengths() {
    this.needsUpdate = true;
    this.cacheLengths = null;
    this.getCurveLengths();
  }
  // Compute lengths and cache them
  // We cannot overwrite getLengths() because UtoT mapping uses it.
  getCurveLengths() {
    if (this.cacheLengths && this.cacheLengths.length === this.curves.length) {
      return this.cacheLengths;
    }
    const lengths = [];
    let sums = 0;
    for (let i2 = 0, l = this.curves.length; i2 < l; i2++) {
      sums += this.curves[i2].getLength();
      lengths.push(sums);
    }
    this.cacheLengths = lengths;
    return lengths;
  }
  getSpacedPoints(divisions = 40) {
    const points = [];
    for (let i2 = 0; i2 <= divisions; i2++) {
      points.push(this.getPoint(i2 / divisions));
    }
    if (this.autoClose) {
      points.push(points[0]);
    }
    return points;
  }
  getPoints(divisions = 12) {
    const points = [];
    let last;
    for (let i2 = 0, curves = this.curves; i2 < curves.length; i2++) {
      const curve = curves[i2];
      const resolution = curve.isEllipseCurve ? divisions * 2 : curve.isLineCurve || curve.isLineCurve3 ? 1 : curve.isSplineCurve ? divisions * curve.points.length : divisions;
      const pts = curve.getPoints(resolution);
      for (let j = 0; j < pts.length; j++) {
        const point4 = pts[j];
        if (last && last.equals(point4))
          continue;
        points.push(point4);
        last = point4;
      }
    }
    if (this.autoClose && points.length > 1 && !points[points.length - 1].equals(points[0])) {
      points.push(points[0]);
    }
    return points;
  }
  copy(source) {
    super.copy(source);
    this.curves = [];
    for (let i2 = 0, l = source.curves.length; i2 < l; i2++) {
      const curve = source.curves[i2];
      this.curves.push(curve.clone());
    }
    this.autoClose = source.autoClose;
    return this;
  }
  toJSON() {
    const data = super.toJSON();
    data.autoClose = this.autoClose;
    data.curves = [];
    for (let i2 = 0, l = this.curves.length; i2 < l; i2++) {
      const curve = this.curves[i2];
      data.curves.push(curve.toJSON());
    }
    return data;
  }
  fromJSON(json3) {
    super.fromJSON(json3);
    this.autoClose = json3.autoClose;
    this.curves = [];
    for (let i2 = 0, l = json3.curves.length; i2 < l; i2++) {
      const curve = json3.curves[i2];
      this.curves.push(new Curves[curve.type]().fromJSON(curve));
    }
    return this;
  }
};
var Path = class extends CurvePath {
  constructor(points) {
    super();
    this.type = "Path";
    this.currentPoint = new Vector2();
    if (points) {
      this.setFromPoints(points);
    }
  }
  setFromPoints(points) {
    this.moveTo(points[0].x, points[0].y);
    for (let i2 = 1, l = points.length; i2 < l; i2++) {
      this.lineTo(points[i2].x, points[i2].y);
    }
    return this;
  }
  moveTo(x2, y2) {
    this.currentPoint.set(x2, y2);
    return this;
  }
  lineTo(x2, y2) {
    const curve = new LineCurve(this.currentPoint.clone(), new Vector2(x2, y2));
    this.curves.push(curve);
    this.currentPoint.set(x2, y2);
    return this;
  }
  quadraticCurveTo(aCPx, aCPy, aX, aY) {
    const curve = new QuadraticBezierCurve(
      this.currentPoint.clone(),
      new Vector2(aCPx, aCPy),
      new Vector2(aX, aY)
    );
    this.curves.push(curve);
    this.currentPoint.set(aX, aY);
    return this;
  }
  bezierCurveTo(aCP1x, aCP1y, aCP2x, aCP2y, aX, aY) {
    const curve = new CubicBezierCurve(
      this.currentPoint.clone(),
      new Vector2(aCP1x, aCP1y),
      new Vector2(aCP2x, aCP2y),
      new Vector2(aX, aY)
    );
    this.curves.push(curve);
    this.currentPoint.set(aX, aY);
    return this;
  }
  splineThru(pts) {
    const npts = [this.currentPoint.clone()].concat(pts);
    const curve = new SplineCurve(npts);
    this.curves.push(curve);
    this.currentPoint.copy(pts[pts.length - 1]);
    return this;
  }
  arc(aX, aY, aRadius, aStartAngle, aEndAngle, aClockwise) {
    const x0 = this.currentPoint.x;
    const y0 = this.currentPoint.y;
    this.absarc(
      aX + x0,
      aY + y0,
      aRadius,
      aStartAngle,
      aEndAngle,
      aClockwise
    );
    return this;
  }
  absarc(aX, aY, aRadius, aStartAngle, aEndAngle, aClockwise) {
    this.absellipse(aX, aY, aRadius, aRadius, aStartAngle, aEndAngle, aClockwise);
    return this;
  }
  ellipse(aX, aY, xRadius, yRadius, aStartAngle, aEndAngle, aClockwise, aRotation) {
    const x0 = this.currentPoint.x;
    const y0 = this.currentPoint.y;
    this.absellipse(aX + x0, aY + y0, xRadius, yRadius, aStartAngle, aEndAngle, aClockwise, aRotation);
    return this;
  }
  absellipse(aX, aY, xRadius, yRadius, aStartAngle, aEndAngle, aClockwise, aRotation) {
    const curve = new EllipseCurve(aX, aY, xRadius, yRadius, aStartAngle, aEndAngle, aClockwise, aRotation);
    if (this.curves.length > 0) {
      const firstPoint = curve.getPoint(0);
      if (!firstPoint.equals(this.currentPoint)) {
        this.lineTo(firstPoint.x, firstPoint.y);
      }
    }
    this.curves.push(curve);
    const lastPoint = curve.getPoint(1);
    this.currentPoint.copy(lastPoint);
    return this;
  }
  copy(source) {
    super.copy(source);
    this.currentPoint.copy(source.currentPoint);
    return this;
  }
  toJSON() {
    const data = super.toJSON();
    data.currentPoint = this.currentPoint.toArray();
    return data;
  }
  fromJSON(json3) {
    super.fromJSON(json3);
    this.currentPoint.fromArray(json3.currentPoint);
    return this;
  }
};
var LatheGeometry = class _LatheGeometry extends BufferGeometry {
  constructor(points = [new Vector2(0, 0.5), new Vector2(0.5, 0), new Vector2(0, -0.5)], segments = 12, phiStart = 0, phiLength = Math.PI * 2) {
    super();
    this.type = "LatheGeometry";
    this.parameters = {
      points,
      segments,
      phiStart,
      phiLength
    };
    segments = Math.floor(segments);
    phiLength = clamp(phiLength, 0, Math.PI * 2);
    const indices = [];
    const vertices = [];
    const uvs = [];
    const initNormals = [];
    const normals = [];
    const inverseSegments = 1 / segments;
    const vertex2 = new Vector3();
    const uv = new Vector2();
    const normal = new Vector3();
    const curNormal = new Vector3();
    const prevNormal = new Vector3();
    let dx = 0;
    let dy = 0;
    for (let j = 0; j <= points.length - 1; j++) {
      switch (j) {
        case 0:
          dx = points[j + 1].x - points[j].x;
          dy = points[j + 1].y - points[j].y;
          normal.x = dy * 1;
          normal.y = -dx;
          normal.z = dy * 0;
          prevNormal.copy(normal);
          normal.normalize();
          initNormals.push(normal.x, normal.y, normal.z);
          break;
        case points.length - 1:
          initNormals.push(prevNormal.x, prevNormal.y, prevNormal.z);
          break;
        default:
          dx = points[j + 1].x - points[j].x;
          dy = points[j + 1].y - points[j].y;
          normal.x = dy * 1;
          normal.y = -dx;
          normal.z = dy * 0;
          curNormal.copy(normal);
          normal.x += prevNormal.x;
          normal.y += prevNormal.y;
          normal.z += prevNormal.z;
          normal.normalize();
          initNormals.push(normal.x, normal.y, normal.z);
          prevNormal.copy(curNormal);
      }
    }
    for (let i2 = 0; i2 <= segments; i2++) {
      const phi = phiStart + i2 * inverseSegments * phiLength;
      const sin2 = Math.sin(phi);
      const cos2 = Math.cos(phi);
      for (let j = 0; j <= points.length - 1; j++) {
        vertex2.x = points[j].x * sin2;
        vertex2.y = points[j].y;
        vertex2.z = points[j].x * cos2;
        vertices.push(vertex2.x, vertex2.y, vertex2.z);
        uv.x = i2 / segments;
        uv.y = j / (points.length - 1);
        uvs.push(uv.x, uv.y);
        const x2 = initNormals[3 * j + 0] * sin2;
        const y2 = initNormals[3 * j + 1];
        const z = initNormals[3 * j + 0] * cos2;
        normals.push(x2, y2, z);
      }
    }
    for (let i2 = 0; i2 < segments; i2++) {
      for (let j = 0; j < points.length - 1; j++) {
        const base2 = j + i2 * points.length;
        const a2 = base2;
        const b = base2 + points.length;
        const c4 = base2 + points.length + 1;
        const d = base2 + 1;
        indices.push(a2, b, d);
        indices.push(c4, d, b);
      }
    }
    this.setIndex(indices);
    this.setAttribute("position", new Float32BufferAttribute(vertices, 3));
    this.setAttribute("uv", new Float32BufferAttribute(uvs, 2));
    this.setAttribute("normal", new Float32BufferAttribute(normals, 3));
  }
  static fromJSON(data) {
    return new _LatheGeometry(data.points, data.segments, data.phiStart, data.phiLength);
  }
};
var CapsuleGeometry = class _CapsuleGeometry extends LatheGeometry {
  constructor(radius = 1, length2 = 1, capSegments = 4, radialSegments = 8) {
    const path2 = new Path();
    path2.absarc(0, -length2 / 2, radius, Math.PI * 1.5, 0);
    path2.absarc(0, length2 / 2, radius, 0, Math.PI * 0.5);
    super(path2.getPoints(capSegments), radialSegments);
    this.type = "CapsuleGeometry";
    this.parameters = {
      radius,
      height: length2,
      capSegments,
      radialSegments
    };
  }
  static fromJSON(data) {
    return new _CapsuleGeometry(data.radius, data.length, data.capSegments, data.radialSegments);
  }
};
var CircleGeometry = class _CircleGeometry extends BufferGeometry {
  constructor(radius = 1, segments = 8, thetaStart = 0, thetaLength = Math.PI * 2) {
    super();
    this.type = "CircleGeometry";
    this.parameters = {
      radius,
      segments,
      thetaStart,
      thetaLength
    };
    segments = Math.max(3, segments);
    const indices = [];
    const vertices = [];
    const normals = [];
    const uvs = [];
    const vertex2 = new Vector3();
    const uv = new Vector2();
    vertices.push(0, 0, 0);
    normals.push(0, 0, 1);
    uvs.push(0.5, 0.5);
    for (let s2 = 0, i2 = 3; s2 <= segments; s2++, i2 += 3) {
      const segment = thetaStart + s2 / segments * thetaLength;
      vertex2.x = radius * Math.cos(segment);
      vertex2.y = radius * Math.sin(segment);
      vertices.push(vertex2.x, vertex2.y, vertex2.z);
      normals.push(0, 0, 1);
      uv.x = (vertices[i2] / radius + 1) / 2;
      uv.y = (vertices[i2 + 1] / radius + 1) / 2;
      uvs.push(uv.x, uv.y);
    }
    for (let i2 = 1; i2 <= segments; i2++) {
      indices.push(i2, i2 + 1, 0);
    }
    this.setIndex(indices);
    this.setAttribute("position", new Float32BufferAttribute(vertices, 3));
    this.setAttribute("normal", new Float32BufferAttribute(normals, 3));
    this.setAttribute("uv", new Float32BufferAttribute(uvs, 2));
  }
  static fromJSON(data) {
    return new _CircleGeometry(data.radius, data.segments, data.thetaStart, data.thetaLength);
  }
};
var CylinderGeometry = class _CylinderGeometry extends BufferGeometry {
  constructor(radiusTop = 1, radiusBottom = 1, height = 1, radialSegments = 8, heightSegments = 1, openEnded = false, thetaStart = 0, thetaLength = Math.PI * 2) {
    super();
    this.type = "CylinderGeometry";
    this.parameters = {
      radiusTop,
      radiusBottom,
      height,
      radialSegments,
      heightSegments,
      openEnded,
      thetaStart,
      thetaLength
    };
    const scope = this;
    radialSegments = Math.floor(radialSegments);
    heightSegments = Math.floor(heightSegments);
    const indices = [];
    const vertices = [];
    const normals = [];
    const uvs = [];
    let index = 0;
    const indexArray = [];
    const halfHeight = height / 2;
    let groupStart = 0;
    generateTorso();
    if (openEnded === false) {
      if (radiusTop > 0)
        generateCap(true);
      if (radiusBottom > 0)
        generateCap(false);
    }
    this.setIndex(indices);
    this.setAttribute("position", new Float32BufferAttribute(vertices, 3));
    this.setAttribute("normal", new Float32BufferAttribute(normals, 3));
    this.setAttribute("uv", new Float32BufferAttribute(uvs, 2));
    function generateTorso() {
      const normal = new Vector3();
      const vertex2 = new Vector3();
      let groupCount = 0;
      const slope = (radiusBottom - radiusTop) / height;
      for (let y2 = 0; y2 <= heightSegments; y2++) {
        const indexRow = [];
        const v4 = y2 / heightSegments;
        const radius = v4 * (radiusBottom - radiusTop) + radiusTop;
        for (let x2 = 0; x2 <= radialSegments; x2++) {
          const u = x2 / radialSegments;
          const theta = u * thetaLength + thetaStart;
          const sinTheta = Math.sin(theta);
          const cosTheta = Math.cos(theta);
          vertex2.x = radius * sinTheta;
          vertex2.y = -v4 * height + halfHeight;
          vertex2.z = radius * cosTheta;
          vertices.push(vertex2.x, vertex2.y, vertex2.z);
          normal.set(sinTheta, slope, cosTheta).normalize();
          normals.push(normal.x, normal.y, normal.z);
          uvs.push(u, 1 - v4);
          indexRow.push(index++);
        }
        indexArray.push(indexRow);
      }
      for (let x2 = 0; x2 < radialSegments; x2++) {
        for (let y2 = 0; y2 < heightSegments; y2++) {
          const a2 = indexArray[y2][x2];
          const b = indexArray[y2 + 1][x2];
          const c4 = indexArray[y2 + 1][x2 + 1];
          const d = indexArray[y2][x2 + 1];
          indices.push(a2, b, d);
          indices.push(b, c4, d);
          groupCount += 6;
        }
      }
      scope.addGroup(groupStart, groupCount, 0);
      groupStart += groupCount;
    }
    function generateCap(top2) {
      const centerIndexStart = index;
      const uv = new Vector2();
      const vertex2 = new Vector3();
      let groupCount = 0;
      const radius = top2 === true ? radiusTop : radiusBottom;
      const sign3 = top2 === true ? 1 : -1;
      for (let x2 = 1; x2 <= radialSegments; x2++) {
        vertices.push(0, halfHeight * sign3, 0);
        normals.push(0, sign3, 0);
        uvs.push(0.5, 0.5);
        index++;
      }
      const centerIndexEnd = index;
      for (let x2 = 0; x2 <= radialSegments; x2++) {
        const u = x2 / radialSegments;
        const theta = u * thetaLength + thetaStart;
        const cosTheta = Math.cos(theta);
        const sinTheta = Math.sin(theta);
        vertex2.x = radius * sinTheta;
        vertex2.y = halfHeight * sign3;
        vertex2.z = radius * cosTheta;
        vertices.push(vertex2.x, vertex2.y, vertex2.z);
        normals.push(0, sign3, 0);
        uv.x = cosTheta * 0.5 + 0.5;
        uv.y = sinTheta * 0.5 * sign3 + 0.5;
        uvs.push(uv.x, uv.y);
        index++;
      }
      for (let x2 = 0; x2 < radialSegments; x2++) {
        const c4 = centerIndexStart + x2;
        const i2 = centerIndexEnd + x2;
        if (top2 === true) {
          indices.push(i2, i2 + 1, c4);
        } else {
          indices.push(i2 + 1, i2, c4);
        }
        groupCount += 3;
      }
      scope.addGroup(groupStart, groupCount, top2 === true ? 1 : 2);
      groupStart += groupCount;
    }
  }
  static fromJSON(data) {
    return new _CylinderGeometry(data.radiusTop, data.radiusBottom, data.height, data.radialSegments, data.heightSegments, data.openEnded, data.thetaStart, data.thetaLength);
  }
};
var ConeGeometry = class _ConeGeometry extends CylinderGeometry {
  constructor(radius = 1, height = 1, radialSegments = 8, heightSegments = 1, openEnded = false, thetaStart = 0, thetaLength = Math.PI * 2) {
    super(0, radius, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength);
    this.type = "ConeGeometry";
    this.parameters = {
      radius,
      height,
      radialSegments,
      heightSegments,
      openEnded,
      thetaStart,
      thetaLength
    };
  }
  static fromJSON(data) {
    return new _ConeGeometry(data.radius, data.height, data.radialSegments, data.heightSegments, data.openEnded, data.thetaStart, data.thetaLength);
  }
};
var PolyhedronGeometry = class _PolyhedronGeometry extends BufferGeometry {
  constructor(vertices = [], indices = [], radius = 1, detail = 0) {
    super();
    this.type = "PolyhedronGeometry";
    this.parameters = {
      vertices,
      indices,
      radius,
      detail
    };
    const vertexBuffer = [];
    const uvBuffer = [];
    subdivide(detail);
    applyRadius(radius);
    generateUVs();
    this.setAttribute("position", new Float32BufferAttribute(vertexBuffer, 3));
    this.setAttribute("normal", new Float32BufferAttribute(vertexBuffer.slice(), 3));
    this.setAttribute("uv", new Float32BufferAttribute(uvBuffer, 2));
    if (detail === 0) {
      this.computeVertexNormals();
    } else {
      this.normalizeNormals();
    }
    function subdivide(detail2) {
      const a2 = new Vector3();
      const b = new Vector3();
      const c4 = new Vector3();
      for (let i2 = 0; i2 < indices.length; i2 += 3) {
        getVertexByIndex(indices[i2 + 0], a2);
        getVertexByIndex(indices[i2 + 1], b);
        getVertexByIndex(indices[i2 + 2], c4);
        subdivideFace(a2, b, c4, detail2);
      }
    }
    function subdivideFace(a2, b, c4, detail2) {
      const cols = detail2 + 1;
      const v4 = [];
      for (let i2 = 0; i2 <= cols; i2++) {
        v4[i2] = [];
        const aj = a2.clone().lerp(c4, i2 / cols);
        const bj = b.clone().lerp(c4, i2 / cols);
        const rows = cols - i2;
        for (let j = 0; j <= rows; j++) {
          if (j === 0 && i2 === cols) {
            v4[i2][j] = aj;
          } else {
            v4[i2][j] = aj.clone().lerp(bj, j / rows);
          }
        }
      }
      for (let i2 = 0; i2 < cols; i2++) {
        for (let j = 0; j < 2 * (cols - i2) - 1; j++) {
          const k2 = Math.floor(j / 2);
          if (j % 2 === 0) {
            pushVertex(v4[i2][k2 + 1]);
            pushVertex(v4[i2 + 1][k2]);
            pushVertex(v4[i2][k2]);
          } else {
            pushVertex(v4[i2][k2 + 1]);
            pushVertex(v4[i2 + 1][k2 + 1]);
            pushVertex(v4[i2 + 1][k2]);
          }
        }
      }
    }
    function applyRadius(radius2) {
      const vertex2 = new Vector3();
      for (let i2 = 0; i2 < vertexBuffer.length; i2 += 3) {
        vertex2.x = vertexBuffer[i2 + 0];
        vertex2.y = vertexBuffer[i2 + 1];
        vertex2.z = vertexBuffer[i2 + 2];
        vertex2.normalize().multiplyScalar(radius2);
        vertexBuffer[i2 + 0] = vertex2.x;
        vertexBuffer[i2 + 1] = vertex2.y;
        vertexBuffer[i2 + 2] = vertex2.z;
      }
    }
    function generateUVs() {
      const vertex2 = new Vector3();
      for (let i2 = 0; i2 < vertexBuffer.length; i2 += 3) {
        vertex2.x = vertexBuffer[i2 + 0];
        vertex2.y = vertexBuffer[i2 + 1];
        vertex2.z = vertexBuffer[i2 + 2];
        const u = azimuth(vertex2) / 2 / Math.PI + 0.5;
        const v4 = inclination(vertex2) / Math.PI + 0.5;
        uvBuffer.push(u, 1 - v4);
      }
      correctUVs();
      correctSeam();
    }
    function correctSeam() {
      for (let i2 = 0; i2 < uvBuffer.length; i2 += 6) {
        const x0 = uvBuffer[i2 + 0];
        const x1 = uvBuffer[i2 + 2];
        const x2 = uvBuffer[i2 + 4];
        const max3 = Math.max(x0, x1, x2);
        const min3 = Math.min(x0, x1, x2);
        if (max3 > 0.9 && min3 < 0.1) {
          if (x0 < 0.2)
            uvBuffer[i2 + 0] += 1;
          if (x1 < 0.2)
            uvBuffer[i2 + 2] += 1;
          if (x2 < 0.2)
            uvBuffer[i2 + 4] += 1;
        }
      }
    }
    function pushVertex(vertex2) {
      vertexBuffer.push(vertex2.x, vertex2.y, vertex2.z);
    }
    function getVertexByIndex(index, vertex2) {
      const stride = index * 3;
      vertex2.x = vertices[stride + 0];
      vertex2.y = vertices[stride + 1];
      vertex2.z = vertices[stride + 2];
    }
    function correctUVs() {
      const a2 = new Vector3();
      const b = new Vector3();
      const c4 = new Vector3();
      const centroid = new Vector3();
      const uvA = new Vector2();
      const uvB = new Vector2();
      const uvC = new Vector2();
      for (let i2 = 0, j = 0; i2 < vertexBuffer.length; i2 += 9, j += 6) {
        a2.set(vertexBuffer[i2 + 0], vertexBuffer[i2 + 1], vertexBuffer[i2 + 2]);
        b.set(vertexBuffer[i2 + 3], vertexBuffer[i2 + 4], vertexBuffer[i2 + 5]);
        c4.set(vertexBuffer[i2 + 6], vertexBuffer[i2 + 7], vertexBuffer[i2 + 8]);
        uvA.set(uvBuffer[j + 0], uvBuffer[j + 1]);
        uvB.set(uvBuffer[j + 2], uvBuffer[j + 3]);
        uvC.set(uvBuffer[j + 4], uvBuffer[j + 5]);
        centroid.copy(a2).add(b).add(c4).divideScalar(3);
        const azi = azimuth(centroid);
        correctUV(uvA, j + 0, a2, azi);
        correctUV(uvB, j + 2, b, azi);
        correctUV(uvC, j + 4, c4, azi);
      }
    }
    function correctUV(uv, stride, vector, azimuth2) {
      if (azimuth2 < 0 && uv.x === 1) {
        uvBuffer[stride] = uv.x - 1;
      }
      if (vector.x === 0 && vector.z === 0) {
        uvBuffer[stride] = azimuth2 / 2 / Math.PI + 0.5;
      }
    }
    function azimuth(vector) {
      return Math.atan2(vector.z, -vector.x);
    }
    function inclination(vector) {
      return Math.atan2(-vector.y, Math.sqrt(vector.x * vector.x + vector.z * vector.z));
    }
  }
  static fromJSON(data) {
    return new _PolyhedronGeometry(data.vertices, data.indices, data.radius, data.details);
  }
};
var DodecahedronGeometry = class _DodecahedronGeometry extends PolyhedronGeometry {
  constructor(radius = 1, detail = 0) {
    const t3 = (1 + Math.sqrt(5)) / 2;
    const r3 = 1 / t3;
    const vertices = [
      // (±1, ±1, ±1)
      -1,
      -1,
      -1,
      -1,
      -1,
      1,
      -1,
      1,
      -1,
      -1,
      1,
      1,
      1,
      -1,
      -1,
      1,
      -1,
      1,
      1,
      1,
      -1,
      1,
      1,
      1,
      // (0, ±1/φ, ±φ)
      0,
      -r3,
      -t3,
      0,
      -r3,
      t3,
      0,
      r3,
      -t3,
      0,
      r3,
      t3,
      // (±1/φ, ±φ, 0)
      -r3,
      -t3,
      0,
      -r3,
      t3,
      0,
      r3,
      -t3,
      0,
      r3,
      t3,
      0,
      // (±φ, 0, ±1/φ)
      -t3,
      0,
      -r3,
      t3,
      0,
      -r3,
      -t3,
      0,
      r3,
      t3,
      0,
      r3
    ];
    const indices = [
      3,
      11,
      7,
      3,
      7,
      15,
      3,
      15,
      13,
      7,
      19,
      17,
      7,
      17,
      6,
      7,
      6,
      15,
      17,
      4,
      8,
      17,
      8,
      10,
      17,
      10,
      6,
      8,
      0,
      16,
      8,
      16,
      2,
      8,
      2,
      10,
      0,
      12,
      1,
      0,
      1,
      18,
      0,
      18,
      16,
      6,
      10,
      2,
      6,
      2,
      13,
      6,
      13,
      15,
      2,
      16,
      18,
      2,
      18,
      3,
      2,
      3,
      13,
      18,
      1,
      9,
      18,
      9,
      11,
      18,
      11,
      3,
      4,
      14,
      12,
      4,
      12,
      0,
      4,
      0,
      8,
      11,
      9,
      5,
      11,
      5,
      19,
      11,
      19,
      7,
      19,
      5,
      14,
      19,
      14,
      4,
      19,
      4,
      17,
      1,
      12,
      14,
      1,
      14,
      5,
      1,
      5,
      9
    ];
    super(vertices, indices, radius, detail);
    this.type = "DodecahedronGeometry";
    this.parameters = {
      radius,
      detail
    };
  }
  static fromJSON(data) {
    return new _DodecahedronGeometry(data.radius, data.detail);
  }
};
var _v0 = new Vector3();
var _v1$1 = new Vector3();
var _normal = new Vector3();
var _triangle = new Triangle();
var EdgesGeometry = class extends BufferGeometry {
  constructor(geometry = null, thresholdAngle = 1) {
    super();
    this.type = "EdgesGeometry";
    this.parameters = {
      geometry,
      thresholdAngle
    };
    if (geometry !== null) {
      const precisionPoints = 4;
      const precision = Math.pow(10, precisionPoints);
      const thresholdDot = Math.cos(DEG2RAD * thresholdAngle);
      const indexAttr = geometry.getIndex();
      const positionAttr = geometry.getAttribute("position");
      const indexCount = indexAttr ? indexAttr.count : positionAttr.count;
      const indexArr = [0, 0, 0];
      const vertKeys = ["a", "b", "c"];
      const hashes = new Array(3);
      const edgeData = {};
      const vertices = [];
      for (let i2 = 0; i2 < indexCount; i2 += 3) {
        if (indexAttr) {
          indexArr[0] = indexAttr.getX(i2);
          indexArr[1] = indexAttr.getX(i2 + 1);
          indexArr[2] = indexAttr.getX(i2 + 2);
        } else {
          indexArr[0] = i2;
          indexArr[1] = i2 + 1;
          indexArr[2] = i2 + 2;
        }
        const { a: a2, b, c: c4 } = _triangle;
        a2.fromBufferAttribute(positionAttr, indexArr[0]);
        b.fromBufferAttribute(positionAttr, indexArr[1]);
        c4.fromBufferAttribute(positionAttr, indexArr[2]);
        _triangle.getNormal(_normal);
        hashes[0] = `${Math.round(a2.x * precision)},${Math.round(a2.y * precision)},${Math.round(a2.z * precision)}`;
        hashes[1] = `${Math.round(b.x * precision)},${Math.round(b.y * precision)},${Math.round(b.z * precision)}`;
        hashes[2] = `${Math.round(c4.x * precision)},${Math.round(c4.y * precision)},${Math.round(c4.z * precision)}`;
        if (hashes[0] === hashes[1] || hashes[1] === hashes[2] || hashes[2] === hashes[0]) {
          continue;
        }
        for (let j = 0; j < 3; j++) {
          const jNext = (j + 1) % 3;
          const vecHash0 = hashes[j];
          const vecHash1 = hashes[jNext];
          const v0 = _triangle[vertKeys[j]];
          const v12 = _triangle[vertKeys[jNext]];
          const hash3 = `${vecHash0}_${vecHash1}`;
          const reverseHash = `${vecHash1}_${vecHash0}`;
          if (reverseHash in edgeData && edgeData[reverseHash]) {
            if (_normal.dot(edgeData[reverseHash].normal) <= thresholdDot) {
              vertices.push(v0.x, v0.y, v0.z);
              vertices.push(v12.x, v12.y, v12.z);
            }
            edgeData[reverseHash] = null;
          } else if (!(hash3 in edgeData)) {
            edgeData[hash3] = {
              index0: indexArr[j],
              index1: indexArr[jNext],
              normal: _normal.clone()
            };
          }
        }
      }
      for (const key in edgeData) {
        if (edgeData[key]) {
          const { index0, index1 } = edgeData[key];
          _v0.fromBufferAttribute(positionAttr, index0);
          _v1$1.fromBufferAttribute(positionAttr, index1);
          vertices.push(_v0.x, _v0.y, _v0.z);
          vertices.push(_v1$1.x, _v1$1.y, _v1$1.z);
        }
      }
      this.setAttribute("position", new Float32BufferAttribute(vertices, 3));
    }
  }
};
var Shape = class extends Path {
  constructor(points) {
    super(points);
    this.uuid = generateUUID();
    this.type = "Shape";
    this.holes = [];
  }
  getPointsHoles(divisions) {
    const holesPts = [];
    for (let i2 = 0, l = this.holes.length; i2 < l; i2++) {
      holesPts[i2] = this.holes[i2].getPoints(divisions);
    }
    return holesPts;
  }
  // get points of shape and holes (keypoints based on segments parameter)
  extractPoints(divisions) {
    return {
      shape: this.getPoints(divisions),
      holes: this.getPointsHoles(divisions)
    };
  }
  copy(source) {
    super.copy(source);
    this.holes = [];
    for (let i2 = 0, l = source.holes.length; i2 < l; i2++) {
      const hole = source.holes[i2];
      this.holes.push(hole.clone());
    }
    return this;
  }
  toJSON() {
    const data = super.toJSON();
    data.uuid = this.uuid;
    data.holes = [];
    for (let i2 = 0, l = this.holes.length; i2 < l; i2++) {
      const hole = this.holes[i2];
      data.holes.push(hole.toJSON());
    }
    return data;
  }
  fromJSON(json3) {
    super.fromJSON(json3);
    this.uuid = json3.uuid;
    this.holes = [];
    for (let i2 = 0, l = json3.holes.length; i2 < l; i2++) {
      const hole = json3.holes[i2];
      this.holes.push(new Path().fromJSON(hole));
    }
    return this;
  }
};
var Earcut = {
  triangulate: function(data, holeIndices, dim = 2) {
    const hasHoles = holeIndices && holeIndices.length;
    const outerLen = hasHoles ? holeIndices[0] * dim : data.length;
    let outerNode = linkedList(data, 0, outerLen, dim, true);
    const triangles = [];
    if (!outerNode || outerNode.next === outerNode.prev)
      return triangles;
    let minX, minY, maxX, maxY, x2, y2, invSize;
    if (hasHoles)
      outerNode = eliminateHoles(data, holeIndices, outerNode, dim);
    if (data.length > 80 * dim) {
      minX = maxX = data[0];
      minY = maxY = data[1];
      for (let i2 = dim; i2 < outerLen; i2 += dim) {
        x2 = data[i2];
        y2 = data[i2 + 1];
        if (x2 < minX)
          minX = x2;
        if (y2 < minY)
          minY = y2;
        if (x2 > maxX)
          maxX = x2;
        if (y2 > maxY)
          maxY = y2;
      }
      invSize = Math.max(maxX - minX, maxY - minY);
      invSize = invSize !== 0 ? 1 / invSize : 0;
    }
    earcutLinked(outerNode, triangles, dim, minX, minY, invSize);
    return triangles;
  }
};
function linkedList(data, start, end, dim, clockwise) {
  let i2, last;
  if (clockwise === signedArea(data, start, end, dim) > 0) {
    for (i2 = start; i2 < end; i2 += dim)
      last = insertNode(i2, data[i2], data[i2 + 1], last);
  } else {
    for (i2 = end - dim; i2 >= start; i2 -= dim)
      last = insertNode(i2, data[i2], data[i2 + 1], last);
  }
  if (last && equals(last, last.next)) {
    removeNode(last);
    last = last.next;
  }
  return last;
}
function filterPoints(start, end) {
  if (!start)
    return start;
  if (!end)
    end = start;
  let p = start, again;
  do {
    again = false;
    if (!p.steiner && (equals(p, p.next) || area(p.prev, p, p.next) === 0)) {
      removeNode(p);
      p = end = p.prev;
      if (p === p.next)
        break;
      again = true;
    } else {
      p = p.next;
    }
  } while (again || p !== end);
  return end;
}
function earcutLinked(ear, triangles, dim, minX, minY, invSize, pass) {
  if (!ear)
    return;
  if (!pass && invSize)
    indexCurve(ear, minX, minY, invSize);
  let stop = ear, prev2, next2;
  while (ear.prev !== ear.next) {
    prev2 = ear.prev;
    next2 = ear.next;
    if (invSize ? isEarHashed(ear, minX, minY, invSize) : isEar(ear)) {
      triangles.push(prev2.i / dim);
      triangles.push(ear.i / dim);
      triangles.push(next2.i / dim);
      removeNode(ear);
      ear = next2.next;
      stop = next2.next;
      continue;
    }
    ear = next2;
    if (ear === stop) {
      if (!pass) {
        earcutLinked(filterPoints(ear), triangles, dim, minX, minY, invSize, 1);
      } else if (pass === 1) {
        ear = cureLocalIntersections(filterPoints(ear), triangles, dim);
        earcutLinked(ear, triangles, dim, minX, minY, invSize, 2);
      } else if (pass === 2) {
        splitEarcut(ear, triangles, dim, minX, minY, invSize);
      }
      break;
    }
  }
}
function isEar(ear) {
  const a2 = ear.prev, b = ear, c4 = ear.next;
  if (area(a2, b, c4) >= 0)
    return false;
  let p = ear.next.next;
  while (p !== ear.prev) {
    if (pointInTriangle(a2.x, a2.y, b.x, b.y, c4.x, c4.y, p.x, p.y) && area(p.prev, p, p.next) >= 0)
      return false;
    p = p.next;
  }
  return true;
}
function isEarHashed(ear, minX, minY, invSize) {
  const a2 = ear.prev, b = ear, c4 = ear.next;
  if (area(a2, b, c4) >= 0)
    return false;
  const minTX = a2.x < b.x ? a2.x < c4.x ? a2.x : c4.x : b.x < c4.x ? b.x : c4.x, minTY = a2.y < b.y ? a2.y < c4.y ? a2.y : c4.y : b.y < c4.y ? b.y : c4.y, maxTX = a2.x > b.x ? a2.x > c4.x ? a2.x : c4.x : b.x > c4.x ? b.x : c4.x, maxTY = a2.y > b.y ? a2.y > c4.y ? a2.y : c4.y : b.y > c4.y ? b.y : c4.y;
  const minZ = zOrder(minTX, minTY, minX, minY, invSize), maxZ = zOrder(maxTX, maxTY, minX, minY, invSize);
  let p = ear.prevZ, n2 = ear.nextZ;
  while (p && p.z >= minZ && n2 && n2.z <= maxZ) {
    if (p !== ear.prev && p !== ear.next && pointInTriangle(a2.x, a2.y, b.x, b.y, c4.x, c4.y, p.x, p.y) && area(p.prev, p, p.next) >= 0)
      return false;
    p = p.prevZ;
    if (n2 !== ear.prev && n2 !== ear.next && pointInTriangle(a2.x, a2.y, b.x, b.y, c4.x, c4.y, n2.x, n2.y) && area(n2.prev, n2, n2.next) >= 0)
      return false;
    n2 = n2.nextZ;
  }
  while (p && p.z >= minZ) {
    if (p !== ear.prev && p !== ear.next && pointInTriangle(a2.x, a2.y, b.x, b.y, c4.x, c4.y, p.x, p.y) && area(p.prev, p, p.next) >= 0)
      return false;
    p = p.prevZ;
  }
  while (n2 && n2.z <= maxZ) {
    if (n2 !== ear.prev && n2 !== ear.next && pointInTriangle(a2.x, a2.y, b.x, b.y, c4.x, c4.y, n2.x, n2.y) && area(n2.prev, n2, n2.next) >= 0)
      return false;
    n2 = n2.nextZ;
  }
  return true;
}
function cureLocalIntersections(start, triangles, dim) {
  let p = start;
  do {
    const a2 = p.prev, b = p.next.next;
    if (!equals(a2, b) && intersects(a2, p, p.next, b) && locallyInside(a2, b) && locallyInside(b, a2)) {
      triangles.push(a2.i / dim);
      triangles.push(p.i / dim);
      triangles.push(b.i / dim);
      removeNode(p);
      removeNode(p.next);
      p = start = b;
    }
    p = p.next;
  } while (p !== start);
  return filterPoints(p);
}
function splitEarcut(start, triangles, dim, minX, minY, invSize) {
  let a2 = start;
  do {
    let b = a2.next.next;
    while (b !== a2.prev) {
      if (a2.i !== b.i && isValidDiagonal(a2, b)) {
        let c4 = splitPolygon(a2, b);
        a2 = filterPoints(a2, a2.next);
        c4 = filterPoints(c4, c4.next);
        earcutLinked(a2, triangles, dim, minX, minY, invSize);
        earcutLinked(c4, triangles, dim, minX, minY, invSize);
        return;
      }
      b = b.next;
    }
    a2 = a2.next;
  } while (a2 !== start);
}
function eliminateHoles(data, holeIndices, outerNode, dim) {
  const queue = [];
  let i2, len, start, end, list;
  for (i2 = 0, len = holeIndices.length; i2 < len; i2++) {
    start = holeIndices[i2] * dim;
    end = i2 < len - 1 ? holeIndices[i2 + 1] * dim : data.length;
    list = linkedList(data, start, end, dim, false);
    if (list === list.next)
      list.steiner = true;
    queue.push(getLeftmost(list));
  }
  queue.sort(compareX);
  for (i2 = 0; i2 < queue.length; i2++) {
    eliminateHole(queue[i2], outerNode);
    outerNode = filterPoints(outerNode, outerNode.next);
  }
  return outerNode;
}
function compareX(a2, b) {
  return a2.x - b.x;
}
function eliminateHole(hole, outerNode) {
  outerNode = findHoleBridge(hole, outerNode);
  if (outerNode) {
    const b = splitPolygon(outerNode, hole);
    filterPoints(outerNode, outerNode.next);
    filterPoints(b, b.next);
  }
}
function findHoleBridge(hole, outerNode) {
  let p = outerNode;
  const hx = hole.x;
  const hy = hole.y;
  let qx = -Infinity, m;
  do {
    if (hy <= p.y && hy >= p.next.y && p.next.y !== p.y) {
      const x2 = p.x + (hy - p.y) * (p.next.x - p.x) / (p.next.y - p.y);
      if (x2 <= hx && x2 > qx) {
        qx = x2;
        if (x2 === hx) {
          if (hy === p.y)
            return p;
          if (hy === p.next.y)
            return p.next;
        }
        m = p.x < p.next.x ? p : p.next;
      }
    }
    p = p.next;
  } while (p !== outerNode);
  if (!m)
    return null;
  if (hx === qx)
    return m;
  const stop = m, mx = m.x, my = m.y;
  let tanMin = Infinity, tan;
  p = m;
  do {
    if (hx >= p.x && p.x >= mx && hx !== p.x && pointInTriangle(hy < my ? hx : qx, hy, mx, my, hy < my ? qx : hx, hy, p.x, p.y)) {
      tan = Math.abs(hy - p.y) / (hx - p.x);
      if (locallyInside(p, hole) && (tan < tanMin || tan === tanMin && (p.x > m.x || p.x === m.x && sectorContainsSector(m, p)))) {
        m = p;
        tanMin = tan;
      }
    }
    p = p.next;
  } while (p !== stop);
  return m;
}
function sectorContainsSector(m, p) {
  return area(m.prev, m, p.prev) < 0 && area(p.next, m, m.next) < 0;
}
function indexCurve(start, minX, minY, invSize) {
  let p = start;
  do {
    if (p.z === null)
      p.z = zOrder(p.x, p.y, minX, minY, invSize);
    p.prevZ = p.prev;
    p.nextZ = p.next;
    p = p.next;
  } while (p !== start);
  p.prevZ.nextZ = null;
  p.prevZ = null;
  sortLinked(p);
}
function sortLinked(list) {
  let i2, p, q, e3, tail, numMerges, pSize, qSize, inSize = 1;
  do {
    p = list;
    list = null;
    tail = null;
    numMerges = 0;
    while (p) {
      numMerges++;
      q = p;
      pSize = 0;
      for (i2 = 0; i2 < inSize; i2++) {
        pSize++;
        q = q.nextZ;
        if (!q)
          break;
      }
      qSize = inSize;
      while (pSize > 0 || qSize > 0 && q) {
        if (pSize !== 0 && (qSize === 0 || !q || p.z <= q.z)) {
          e3 = p;
          p = p.nextZ;
          pSize--;
        } else {
          e3 = q;
          q = q.nextZ;
          qSize--;
        }
        if (tail)
          tail.nextZ = e3;
        else
          list = e3;
        e3.prevZ = tail;
        tail = e3;
      }
      p = q;
    }
    tail.nextZ = null;
    inSize *= 2;
  } while (numMerges > 1);
  return list;
}
function zOrder(x2, y2, minX, minY, invSize) {
  x2 = 32767 * (x2 - minX) * invSize;
  y2 = 32767 * (y2 - minY) * invSize;
  x2 = (x2 | x2 << 8) & 16711935;
  x2 = (x2 | x2 << 4) & 252645135;
  x2 = (x2 | x2 << 2) & 858993459;
  x2 = (x2 | x2 << 1) & 1431655765;
  y2 = (y2 | y2 << 8) & 16711935;
  y2 = (y2 | y2 << 4) & 252645135;
  y2 = (y2 | y2 << 2) & 858993459;
  y2 = (y2 | y2 << 1) & 1431655765;
  return x2 | y2 << 1;
}
function getLeftmost(start) {
  let p = start, leftmost = start;
  do {
    if (p.x < leftmost.x || p.x === leftmost.x && p.y < leftmost.y)
      leftmost = p;
    p = p.next;
  } while (p !== start);
  return leftmost;
}
function pointInTriangle(ax, ay, bx, by, cx, cy, px2, py2) {
  return (cx - px2) * (ay - py2) - (ax - px2) * (cy - py2) >= 0 && (ax - px2) * (by - py2) - (bx - px2) * (ay - py2) >= 0 && (bx - px2) * (cy - py2) - (cx - px2) * (by - py2) >= 0;
}
function isValidDiagonal(a2, b) {
  return a2.next.i !== b.i && a2.prev.i !== b.i && !intersectsPolygon(a2, b) && // doesn't intersect other edges
  (locallyInside(a2, b) && locallyInside(b, a2) && middleInside(a2, b) && // locally visible
  (area(a2.prev, a2, b.prev) || area(a2, b.prev, b)) || // does not create opposite-facing sectors
  equals(a2, b) && area(a2.prev, a2, a2.next) > 0 && area(b.prev, b, b.next) > 0);
}
function area(p, q, r3) {
  return (q.y - p.y) * (r3.x - q.x) - (q.x - p.x) * (r3.y - q.y);
}
function equals(p1, p2) {
  return p1.x === p2.x && p1.y === p2.y;
}
function intersects(p1, q1, p2, q2) {
  const o1 = sign(area(p1, q1, p2));
  const o2 = sign(area(p1, q1, q2));
  const o3 = sign(area(p2, q2, p1));
  const o4 = sign(area(p2, q2, q1));
  if (o1 !== o2 && o3 !== o4)
    return true;
  if (o1 === 0 && onSegment(p1, p2, q1))
    return true;
  if (o2 === 0 && onSegment(p1, q2, q1))
    return true;
  if (o3 === 0 && onSegment(p2, p1, q2))
    return true;
  if (o4 === 0 && onSegment(p2, q1, q2))
    return true;
  return false;
}
function onSegment(p, q, r3) {
  return q.x <= Math.max(p.x, r3.x) && q.x >= Math.min(p.x, r3.x) && q.y <= Math.max(p.y, r3.y) && q.y >= Math.min(p.y, r3.y);
}
function sign(num) {
  return num > 0 ? 1 : num < 0 ? -1 : 0;
}
function intersectsPolygon(a2, b) {
  let p = a2;
  do {
    if (p.i !== a2.i && p.next.i !== a2.i && p.i !== b.i && p.next.i !== b.i && intersects(p, p.next, a2, b))
      return true;
    p = p.next;
  } while (p !== a2);
  return false;
}
function locallyInside(a2, b) {
  return area(a2.prev, a2, a2.next) < 0 ? area(a2, b, a2.next) >= 0 && area(a2, a2.prev, b) >= 0 : area(a2, b, a2.prev) < 0 || area(a2, a2.next, b) < 0;
}
function middleInside(a2, b) {
  let p = a2, inside2 = false;
  const px2 = (a2.x + b.x) / 2, py2 = (a2.y + b.y) / 2;
  do {
    if (p.y > py2 !== p.next.y > py2 && p.next.y !== p.y && px2 < (p.next.x - p.x) * (py2 - p.y) / (p.next.y - p.y) + p.x)
      inside2 = !inside2;
    p = p.next;
  } while (p !== a2);
  return inside2;
}
function splitPolygon(a2, b) {
  const a22 = new Node2(a2.i, a2.x, a2.y), b2 = new Node2(b.i, b.x, b.y), an = a2.next, bp = b.prev;
  a2.next = b;
  b.prev = a2;
  a22.next = an;
  an.prev = a22;
  b2.next = a22;
  a22.prev = b2;
  bp.next = b2;
  b2.prev = bp;
  return b2;
}
function insertNode(i2, x2, y2, last) {
  const p = new Node2(i2, x2, y2);
  if (!last) {
    p.prev = p;
    p.next = p;
  } else {
    p.next = last.next;
    p.prev = last;
    last.next.prev = p;
    last.next = p;
  }
  return p;
}
function removeNode(p) {
  p.next.prev = p.prev;
  p.prev.next = p.next;
  if (p.prevZ)
    p.prevZ.nextZ = p.nextZ;
  if (p.nextZ)
    p.nextZ.prevZ = p.prevZ;
}
function Node2(i2, x2, y2) {
  this.i = i2;
  this.x = x2;
  this.y = y2;
  this.prev = null;
  this.next = null;
  this.z = null;
  this.prevZ = null;
  this.nextZ = null;
  this.steiner = false;
}
function signedArea(data, start, end, dim) {
  let sum2 = 0;
  for (let i2 = start, j = end - dim; i2 < end; i2 += dim) {
    sum2 += (data[j] - data[i2]) * (data[i2 + 1] + data[j + 1]);
    j = i2;
  }
  return sum2;
}
var ShapeUtils = class _ShapeUtils {
  // calculate area of the contour polygon
  static area(contour) {
    const n2 = contour.length;
    let a2 = 0;
    for (let p = n2 - 1, q = 0; q < n2; p = q++) {
      a2 += contour[p].x * contour[q].y - contour[q].x * contour[p].y;
    }
    return a2 * 0.5;
  }
  static isClockWise(pts) {
    return _ShapeUtils.area(pts) < 0;
  }
  static triangulateShape(contour, holes) {
    const vertices = [];
    const holeIndices = [];
    const faces = [];
    removeDupEndPts(contour);
    addContour(vertices, contour);
    let holeIndex = contour.length;
    holes.forEach(removeDupEndPts);
    for (let i2 = 0; i2 < holes.length; i2++) {
      holeIndices.push(holeIndex);
      holeIndex += holes[i2].length;
      addContour(vertices, holes[i2]);
    }
    const triangles = Earcut.triangulate(vertices, holeIndices);
    for (let i2 = 0; i2 < triangles.length; i2 += 3) {
      faces.push(triangles.slice(i2, i2 + 3));
    }
    return faces;
  }
};
function removeDupEndPts(points) {
  const l = points.length;
  if (l > 2 && points[l - 1].equals(points[0])) {
    points.pop();
  }
}
function addContour(vertices, contour) {
  for (let i2 = 0; i2 < contour.length; i2++) {
    vertices.push(contour[i2].x);
    vertices.push(contour[i2].y);
  }
}
var ExtrudeGeometry = class _ExtrudeGeometry extends BufferGeometry {
  constructor(shapes = new Shape([new Vector2(0.5, 0.5), new Vector2(-0.5, 0.5), new Vector2(-0.5, -0.5), new Vector2(0.5, -0.5)]), options = {}) {
    super();
    this.type = "ExtrudeGeometry";
    this.parameters = {
      shapes,
      options
    };
    shapes = Array.isArray(shapes) ? shapes : [shapes];
    const scope = this;
    const verticesArray = [];
    const uvArray = [];
    for (let i2 = 0, l = shapes.length; i2 < l; i2++) {
      const shape = shapes[i2];
      addShape(shape);
    }
    this.setAttribute("position", new Float32BufferAttribute(verticesArray, 3));
    this.setAttribute("uv", new Float32BufferAttribute(uvArray, 2));
    this.computeVertexNormals();
    function addShape(shape) {
      const placeholder2 = [];
      const curveSegments = options.curveSegments !== void 0 ? options.curveSegments : 12;
      const steps = options.steps !== void 0 ? options.steps : 1;
      let depth = options.depth !== void 0 ? options.depth : 1;
      let bevelEnabled = options.bevelEnabled !== void 0 ? options.bevelEnabled : true;
      let bevelThickness = options.bevelThickness !== void 0 ? options.bevelThickness : 0.2;
      let bevelSize = options.bevelSize !== void 0 ? options.bevelSize : bevelThickness - 0.1;
      let bevelOffset = options.bevelOffset !== void 0 ? options.bevelOffset : 0;
      let bevelSegments = options.bevelSegments !== void 0 ? options.bevelSegments : 3;
      const extrudePath = options.extrudePath;
      const uvgen = options.UVGenerator !== void 0 ? options.UVGenerator : WorldUVGenerator;
      if (options.amount !== void 0) {
        console.warn("THREE.ExtrudeBufferGeometry: amount has been renamed to depth.");
        depth = options.amount;
      }
      let extrudePts, extrudeByPath = false;
      let splineTube, binormal, normal, position2;
      if (extrudePath) {
        extrudePts = extrudePath.getSpacedPoints(steps);
        extrudeByPath = true;
        bevelEnabled = false;
        splineTube = extrudePath.computeFrenetFrames(steps, false);
        binormal = new Vector3();
        normal = new Vector3();
        position2 = new Vector3();
      }
      if (!bevelEnabled) {
        bevelSegments = 0;
        bevelThickness = 0;
        bevelSize = 0;
        bevelOffset = 0;
      }
      const shapePoints = shape.extractPoints(curveSegments);
      let vertices = shapePoints.shape;
      const holes = shapePoints.holes;
      const reverse3 = !ShapeUtils.isClockWise(vertices);
      if (reverse3) {
        vertices = vertices.reverse();
        for (let h = 0, hl = holes.length; h < hl; h++) {
          const ahole = holes[h];
          if (ShapeUtils.isClockWise(ahole)) {
            holes[h] = ahole.reverse();
          }
        }
      }
      const faces = ShapeUtils.triangulateShape(vertices, holes);
      const contour = vertices;
      for (let h = 0, hl = holes.length; h < hl; h++) {
        const ahole = holes[h];
        vertices = vertices.concat(ahole);
      }
      function scalePt2(pt, vec2, size) {
        if (!vec2)
          console.error("THREE.ExtrudeGeometry: vec does not exist");
        return vec2.clone().multiplyScalar(size).add(pt);
      }
      const vlen = vertices.length, flen = faces.length;
      function getBevelVec(inPt, inPrev, inNext) {
        let v_trans_x, v_trans_y, shrink_by;
        const v_prev_x = inPt.x - inPrev.x, v_prev_y = inPt.y - inPrev.y;
        const v_next_x = inNext.x - inPt.x, v_next_y = inNext.y - inPt.y;
        const v_prev_lensq = v_prev_x * v_prev_x + v_prev_y * v_prev_y;
        const collinear0 = v_prev_x * v_next_y - v_prev_y * v_next_x;
        if (Math.abs(collinear0) > Number.EPSILON) {
          const v_prev_len = Math.sqrt(v_prev_lensq);
          const v_next_len = Math.sqrt(v_next_x * v_next_x + v_next_y * v_next_y);
          const ptPrevShift_x = inPrev.x - v_prev_y / v_prev_len;
          const ptPrevShift_y = inPrev.y + v_prev_x / v_prev_len;
          const ptNextShift_x = inNext.x - v_next_y / v_next_len;
          const ptNextShift_y = inNext.y + v_next_x / v_next_len;
          const sf = ((ptNextShift_x - ptPrevShift_x) * v_next_y - (ptNextShift_y - ptPrevShift_y) * v_next_x) / (v_prev_x * v_next_y - v_prev_y * v_next_x);
          v_trans_x = ptPrevShift_x + v_prev_x * sf - inPt.x;
          v_trans_y = ptPrevShift_y + v_prev_y * sf - inPt.y;
          const v_trans_lensq = v_trans_x * v_trans_x + v_trans_y * v_trans_y;
          if (v_trans_lensq <= 2) {
            return new Vector2(v_trans_x, v_trans_y);
          } else {
            shrink_by = Math.sqrt(v_trans_lensq / 2);
          }
        } else {
          let direction_eq = false;
          if (v_prev_x > Number.EPSILON) {
            if (v_next_x > Number.EPSILON) {
              direction_eq = true;
            }
          } else {
            if (v_prev_x < -Number.EPSILON) {
              if (v_next_x < -Number.EPSILON) {
                direction_eq = true;
              }
            } else {
              if (Math.sign(v_prev_y) === Math.sign(v_next_y)) {
                direction_eq = true;
              }
            }
          }
          if (direction_eq) {
            v_trans_x = -v_prev_y;
            v_trans_y = v_prev_x;
            shrink_by = Math.sqrt(v_prev_lensq);
          } else {
            v_trans_x = v_prev_x;
            v_trans_y = v_prev_y;
            shrink_by = Math.sqrt(v_prev_lensq / 2);
          }
        }
        return new Vector2(v_trans_x / shrink_by, v_trans_y / shrink_by);
      }
      const contourMovements = [];
      for (let i2 = 0, il = contour.length, j = il - 1, k2 = i2 + 1; i2 < il; i2++, j++, k2++) {
        if (j === il)
          j = 0;
        if (k2 === il)
          k2 = 0;
        contourMovements[i2] = getBevelVec(contour[i2], contour[j], contour[k2]);
      }
      const holesMovements = [];
      let oneHoleMovements, verticesMovements = contourMovements.concat();
      for (let h = 0, hl = holes.length; h < hl; h++) {
        const ahole = holes[h];
        oneHoleMovements = [];
        for (let i2 = 0, il = ahole.length, j = il - 1, k2 = i2 + 1; i2 < il; i2++, j++, k2++) {
          if (j === il)
            j = 0;
          if (k2 === il)
            k2 = 0;
          oneHoleMovements[i2] = getBevelVec(ahole[i2], ahole[j], ahole[k2]);
        }
        holesMovements.push(oneHoleMovements);
        verticesMovements = verticesMovements.concat(oneHoleMovements);
      }
      for (let b = 0; b < bevelSegments; b++) {
        const t3 = b / bevelSegments;
        const z = bevelThickness * Math.cos(t3 * Math.PI / 2);
        const bs2 = bevelSize * Math.sin(t3 * Math.PI / 2) + bevelOffset;
        for (let i2 = 0, il = contour.length; i2 < il; i2++) {
          const vert = scalePt2(contour[i2], contourMovements[i2], bs2);
          v4(vert.x, vert.y, -z);
        }
        for (let h = 0, hl = holes.length; h < hl; h++) {
          const ahole = holes[h];
          oneHoleMovements = holesMovements[h];
          for (let i2 = 0, il = ahole.length; i2 < il; i2++) {
            const vert = scalePt2(ahole[i2], oneHoleMovements[i2], bs2);
            v4(vert.x, vert.y, -z);
          }
        }
      }
      const bs = bevelSize + bevelOffset;
      for (let i2 = 0; i2 < vlen; i2++) {
        const vert = bevelEnabled ? scalePt2(vertices[i2], verticesMovements[i2], bs) : vertices[i2];
        if (!extrudeByPath) {
          v4(vert.x, vert.y, 0);
        } else {
          normal.copy(splineTube.normals[0]).multiplyScalar(vert.x);
          binormal.copy(splineTube.binormals[0]).multiplyScalar(vert.y);
          position2.copy(extrudePts[0]).add(normal).add(binormal);
          v4(position2.x, position2.y, position2.z);
        }
      }
      for (let s2 = 1; s2 <= steps; s2++) {
        for (let i2 = 0; i2 < vlen; i2++) {
          const vert = bevelEnabled ? scalePt2(vertices[i2], verticesMovements[i2], bs) : vertices[i2];
          if (!extrudeByPath) {
            v4(vert.x, vert.y, depth / steps * s2);
          } else {
            normal.copy(splineTube.normals[s2]).multiplyScalar(vert.x);
            binormal.copy(splineTube.binormals[s2]).multiplyScalar(vert.y);
            position2.copy(extrudePts[s2]).add(normal).add(binormal);
            v4(position2.x, position2.y, position2.z);
          }
        }
      }
      for (let b = bevelSegments - 1; b >= 0; b--) {
        const t3 = b / bevelSegments;
        const z = bevelThickness * Math.cos(t3 * Math.PI / 2);
        const bs2 = bevelSize * Math.sin(t3 * Math.PI / 2) + bevelOffset;
        for (let i2 = 0, il = contour.length; i2 < il; i2++) {
          const vert = scalePt2(contour[i2], contourMovements[i2], bs2);
          v4(vert.x, vert.y, depth + z);
        }
        for (let h = 0, hl = holes.length; h < hl; h++) {
          const ahole = holes[h];
          oneHoleMovements = holesMovements[h];
          for (let i2 = 0, il = ahole.length; i2 < il; i2++) {
            const vert = scalePt2(ahole[i2], oneHoleMovements[i2], bs2);
            if (!extrudeByPath) {
              v4(vert.x, vert.y, depth + z);
            } else {
              v4(vert.x, vert.y + extrudePts[steps - 1].y, extrudePts[steps - 1].x + z);
            }
          }
        }
      }
      buildLidFaces();
      buildSideFaces();
      function buildLidFaces() {
        const start = verticesArray.length / 3;
        if (bevelEnabled) {
          let layer2 = 0;
          let offset = vlen * layer2;
          for (let i2 = 0; i2 < flen; i2++) {
            const face = faces[i2];
            f3(face[2] + offset, face[1] + offset, face[0] + offset);
          }
          layer2 = steps + bevelSegments * 2;
          offset = vlen * layer2;
          for (let i2 = 0; i2 < flen; i2++) {
            const face = faces[i2];
            f3(face[0] + offset, face[1] + offset, face[2] + offset);
          }
        } else {
          for (let i2 = 0; i2 < flen; i2++) {
            const face = faces[i2];
            f3(face[2], face[1], face[0]);
          }
          for (let i2 = 0; i2 < flen; i2++) {
            const face = faces[i2];
            f3(face[0] + vlen * steps, face[1] + vlen * steps, face[2] + vlen * steps);
          }
        }
        scope.addGroup(start, verticesArray.length / 3 - start, 0);
      }
      function buildSideFaces() {
        const start = verticesArray.length / 3;
        let layeroffset = 0;
        sidewalls(contour, layeroffset);
        layeroffset += contour.length;
        for (let h = 0, hl = holes.length; h < hl; h++) {
          const ahole = holes[h];
          sidewalls(ahole, layeroffset);
          layeroffset += ahole.length;
        }
        scope.addGroup(start, verticesArray.length / 3 - start, 1);
      }
      function sidewalls(contour2, layeroffset) {
        let i2 = contour2.length;
        while (--i2 >= 0) {
          const j = i2;
          let k2 = i2 - 1;
          if (k2 < 0)
            k2 = contour2.length - 1;
          for (let s2 = 0, sl = steps + bevelSegments * 2; s2 < sl; s2++) {
            const slen1 = vlen * s2;
            const slen2 = vlen * (s2 + 1);
            const a2 = layeroffset + j + slen1, b = layeroffset + k2 + slen1, c4 = layeroffset + k2 + slen2, d = layeroffset + j + slen2;
            f4(a2, b, c4, d);
          }
        }
      }
      function v4(x2, y2, z) {
        placeholder2.push(x2);
        placeholder2.push(y2);
        placeholder2.push(z);
      }
      function f3(a2, b, c4) {
        addVertex(a2);
        addVertex(b);
        addVertex(c4);
        const nextIndex = verticesArray.length / 3;
        const uvs = uvgen.generateTopUV(scope, verticesArray, nextIndex - 3, nextIndex - 2, nextIndex - 1);
        addUV(uvs[0]);
        addUV(uvs[1]);
        addUV(uvs[2]);
      }
      function f4(a2, b, c4, d) {
        addVertex(a2);
        addVertex(b);
        addVertex(d);
        addVertex(b);
        addVertex(c4);
        addVertex(d);
        const nextIndex = verticesArray.length / 3;
        const uvs = uvgen.generateSideWallUV(scope, verticesArray, nextIndex - 6, nextIndex - 3, nextIndex - 2, nextIndex - 1);
        addUV(uvs[0]);
        addUV(uvs[1]);
        addUV(uvs[3]);
        addUV(uvs[1]);
        addUV(uvs[2]);
        addUV(uvs[3]);
      }
      function addVertex(index) {
        verticesArray.push(placeholder2[index * 3 + 0]);
        verticesArray.push(placeholder2[index * 3 + 1]);
        verticesArray.push(placeholder2[index * 3 + 2]);
      }
      function addUV(vector2) {
        uvArray.push(vector2.x);
        uvArray.push(vector2.y);
      }
    }
  }
  toJSON() {
    const data = super.toJSON();
    const shapes = this.parameters.shapes;
    const options = this.parameters.options;
    return toJSON$1(shapes, options, data);
  }
  static fromJSON(data, shapes) {
    const geometryShapes = [];
    for (let j = 0, jl = data.shapes.length; j < jl; j++) {
      const shape = shapes[data.shapes[j]];
      geometryShapes.push(shape);
    }
    const extrudePath = data.options.extrudePath;
    if (extrudePath !== void 0) {
      data.options.extrudePath = new Curves[extrudePath.type]().fromJSON(extrudePath);
    }
    return new _ExtrudeGeometry(geometryShapes, data.options);
  }
};
var WorldUVGenerator = {
  generateTopUV: function(geometry, vertices, indexA, indexB, indexC) {
    const a_x = vertices[indexA * 3];
    const a_y = vertices[indexA * 3 + 1];
    const b_x = vertices[indexB * 3];
    const b_y = vertices[indexB * 3 + 1];
    const c_x = vertices[indexC * 3];
    const c_y = vertices[indexC * 3 + 1];
    return [
      new Vector2(a_x, a_y),
      new Vector2(b_x, b_y),
      new Vector2(c_x, c_y)
    ];
  },
  generateSideWallUV: function(geometry, vertices, indexA, indexB, indexC, indexD) {
    const a_x = vertices[indexA * 3];
    const a_y = vertices[indexA * 3 + 1];
    const a_z = vertices[indexA * 3 + 2];
    const b_x = vertices[indexB * 3];
    const b_y = vertices[indexB * 3 + 1];
    const b_z = vertices[indexB * 3 + 2];
    const c_x = vertices[indexC * 3];
    const c_y = vertices[indexC * 3 + 1];
    const c_z = vertices[indexC * 3 + 2];
    const d_x = vertices[indexD * 3];
    const d_y = vertices[indexD * 3 + 1];
    const d_z = vertices[indexD * 3 + 2];
    if (Math.abs(a_y - b_y) < Math.abs(a_x - b_x)) {
      return [
        new Vector2(a_x, 1 - a_z),
        new Vector2(b_x, 1 - b_z),
        new Vector2(c_x, 1 - c_z),
        new Vector2(d_x, 1 - d_z)
      ];
    } else {
      return [
        new Vector2(a_y, 1 - a_z),
        new Vector2(b_y, 1 - b_z),
        new Vector2(c_y, 1 - c_z),
        new Vector2(d_y, 1 - d_z)
      ];
    }
  }
};
function toJSON$1(shapes, options, data) {
  data.shapes = [];
  if (Array.isArray(shapes)) {
    for (let i2 = 0, l = shapes.length; i2 < l; i2++) {
      const shape = shapes[i2];
      data.shapes.push(shape.uuid);
    }
  } else {
    data.shapes.push(shapes.uuid);
  }
  if (options.extrudePath !== void 0)
    data.options.extrudePath = options.extrudePath.toJSON();
  return data;
}
var IcosahedronGeometry = class _IcosahedronGeometry extends PolyhedronGeometry {
  constructor(radius = 1, detail = 0) {
    const t3 = (1 + Math.sqrt(5)) / 2;
    const vertices = [
      -1,
      t3,
      0,
      1,
      t3,
      0,
      -1,
      -t3,
      0,
      1,
      -t3,
      0,
      0,
      -1,
      t3,
      0,
      1,
      t3,
      0,
      -1,
      -t3,
      0,
      1,
      -t3,
      t3,
      0,
      -1,
      t3,
      0,
      1,
      -t3,
      0,
      -1,
      -t3,
      0,
      1
    ];
    const indices = [
      0,
      11,
      5,
      0,
      5,
      1,
      0,
      1,
      7,
      0,
      7,
      10,
      0,
      10,
      11,
      1,
      5,
      9,
      5,
      11,
      4,
      11,
      10,
      2,
      10,
      7,
      6,
      7,
      1,
      8,
      3,
      9,
      4,
      3,
      4,
      2,
      3,
      2,
      6,
      3,
      6,
      8,
      3,
      8,
      9,
      4,
      9,
      5,
      2,
      4,
      11,
      6,
      2,
      10,
      8,
      6,
      7,
      9,
      8,
      1
    ];
    super(vertices, indices, radius, detail);
    this.type = "IcosahedronGeometry";
    this.parameters = {
      radius,
      detail
    };
  }
  static fromJSON(data) {
    return new _IcosahedronGeometry(data.radius, data.detail);
  }
};
var OctahedronGeometry = class _OctahedronGeometry extends PolyhedronGeometry {
  constructor(radius = 1, detail = 0) {
    const vertices = [
      1,
      0,
      0,
      -1,
      0,
      0,
      0,
      1,
      0,
      0,
      -1,
      0,
      0,
      0,
      1,
      0,
      0,
      -1
    ];
    const indices = [
      0,
      2,
      4,
      0,
      4,
      3,
      0,
      3,
      5,
      0,
      5,
      2,
      1,
      2,
      5,
      1,
      5,
      3,
      1,
      3,
      4,
      1,
      4,
      2
    ];
    super(vertices, indices, radius, detail);
    this.type = "OctahedronGeometry";
    this.parameters = {
      radius,
      detail
    };
  }
  static fromJSON(data) {
    return new _OctahedronGeometry(data.radius, data.detail);
  }
};
var RingGeometry = class _RingGeometry extends BufferGeometry {
  constructor(innerRadius = 0.5, outerRadius = 1, thetaSegments = 8, phiSegments = 1, thetaStart = 0, thetaLength = Math.PI * 2) {
    super();
    this.type = "RingGeometry";
    this.parameters = {
      innerRadius,
      outerRadius,
      thetaSegments,
      phiSegments,
      thetaStart,
      thetaLength
    };
    thetaSegments = Math.max(3, thetaSegments);
    phiSegments = Math.max(1, phiSegments);
    const indices = [];
    const vertices = [];
    const normals = [];
    const uvs = [];
    let radius = innerRadius;
    const radiusStep = (outerRadius - innerRadius) / phiSegments;
    const vertex2 = new Vector3();
    const uv = new Vector2();
    for (let j = 0; j <= phiSegments; j++) {
      for (let i2 = 0; i2 <= thetaSegments; i2++) {
        const segment = thetaStart + i2 / thetaSegments * thetaLength;
        vertex2.x = radius * Math.cos(segment);
        vertex2.y = radius * Math.sin(segment);
        vertices.push(vertex2.x, vertex2.y, vertex2.z);
        normals.push(0, 0, 1);
        uv.x = (vertex2.x / outerRadius + 1) / 2;
        uv.y = (vertex2.y / outerRadius + 1) / 2;
        uvs.push(uv.x, uv.y);
      }
      radius += radiusStep;
    }
    for (let j = 0; j < phiSegments; j++) {
      const thetaSegmentLevel = j * (thetaSegments + 1);
      for (let i2 = 0; i2 < thetaSegments; i2++) {
        const segment = i2 + thetaSegmentLevel;
        const a2 = segment;
        const b = segment + thetaSegments + 1;
        const c4 = segment + thetaSegments + 2;
        const d = segment + 1;
        indices.push(a2, b, d);
        indices.push(b, c4, d);
      }
    }
    this.setIndex(indices);
    this.setAttribute("position", new Float32BufferAttribute(vertices, 3));
    this.setAttribute("normal", new Float32BufferAttribute(normals, 3));
    this.setAttribute("uv", new Float32BufferAttribute(uvs, 2));
  }
  static fromJSON(data) {
    return new _RingGeometry(data.innerRadius, data.outerRadius, data.thetaSegments, data.phiSegments, data.thetaStart, data.thetaLength);
  }
};
var ShapeGeometry = class _ShapeGeometry extends BufferGeometry {
  constructor(shapes = new Shape([new Vector2(0, 0.5), new Vector2(-0.5, -0.5), new Vector2(0.5, -0.5)]), curveSegments = 12) {
    super();
    this.type = "ShapeGeometry";
    this.parameters = {
      shapes,
      curveSegments
    };
    const indices = [];
    const vertices = [];
    const normals = [];
    const uvs = [];
    let groupStart = 0;
    let groupCount = 0;
    if (Array.isArray(shapes) === false) {
      addShape(shapes);
    } else {
      for (let i2 = 0; i2 < shapes.length; i2++) {
        addShape(shapes[i2]);
        this.addGroup(groupStart, groupCount, i2);
        groupStart += groupCount;
        groupCount = 0;
      }
    }
    this.setIndex(indices);
    this.setAttribute("position", new Float32BufferAttribute(vertices, 3));
    this.setAttribute("normal", new Float32BufferAttribute(normals, 3));
    this.setAttribute("uv", new Float32BufferAttribute(uvs, 2));
    function addShape(shape) {
      const indexOffset = vertices.length / 3;
      const points = shape.extractPoints(curveSegments);
      let shapeVertices = points.shape;
      const shapeHoles = points.holes;
      if (ShapeUtils.isClockWise(shapeVertices) === false) {
        shapeVertices = shapeVertices.reverse();
      }
      for (let i2 = 0, l = shapeHoles.length; i2 < l; i2++) {
        const shapeHole = shapeHoles[i2];
        if (ShapeUtils.isClockWise(shapeHole) === true) {
          shapeHoles[i2] = shapeHole.reverse();
        }
      }
      const faces = ShapeUtils.triangulateShape(shapeVertices, shapeHoles);
      for (let i2 = 0, l = shapeHoles.length; i2 < l; i2++) {
        const shapeHole = shapeHoles[i2];
        shapeVertices = shapeVertices.concat(shapeHole);
      }
      for (let i2 = 0, l = shapeVertices.length; i2 < l; i2++) {
        const vertex2 = shapeVertices[i2];
        vertices.push(vertex2.x, vertex2.y, 0);
        normals.push(0, 0, 1);
        uvs.push(vertex2.x, vertex2.y);
      }
      for (let i2 = 0, l = faces.length; i2 < l; i2++) {
        const face = faces[i2];
        const a2 = face[0] + indexOffset;
        const b = face[1] + indexOffset;
        const c4 = face[2] + indexOffset;
        indices.push(a2, b, c4);
        groupCount += 3;
      }
    }
  }
  toJSON() {
    const data = super.toJSON();
    const shapes = this.parameters.shapes;
    return toJSON(shapes, data);
  }
  static fromJSON(data, shapes) {
    const geometryShapes = [];
    for (let j = 0, jl = data.shapes.length; j < jl; j++) {
      const shape = shapes[data.shapes[j]];
      geometryShapes.push(shape);
    }
    return new _ShapeGeometry(geometryShapes, data.curveSegments);
  }
};
function toJSON(shapes, data) {
  data.shapes = [];
  if (Array.isArray(shapes)) {
    for (let i2 = 0, l = shapes.length; i2 < l; i2++) {
      const shape = shapes[i2];
      data.shapes.push(shape.uuid);
    }
  } else {
    data.shapes.push(shapes.uuid);
  }
  return data;
}
var SphereGeometry = class _SphereGeometry extends BufferGeometry {
  constructor(radius = 1, widthSegments = 32, heightSegments = 16, phiStart = 0, phiLength = Math.PI * 2, thetaStart = 0, thetaLength = Math.PI) {
    super();
    this.type = "SphereGeometry";
    this.parameters = {
      radius,
      widthSegments,
      heightSegments,
      phiStart,
      phiLength,
      thetaStart,
      thetaLength
    };
    widthSegments = Math.max(3, Math.floor(widthSegments));
    heightSegments = Math.max(2, Math.floor(heightSegments));
    const thetaEnd = Math.min(thetaStart + thetaLength, Math.PI);
    let index = 0;
    const grid = [];
    const vertex2 = new Vector3();
    const normal = new Vector3();
    const indices = [];
    const vertices = [];
    const normals = [];
    const uvs = [];
    for (let iy = 0; iy <= heightSegments; iy++) {
      const verticesRow = [];
      const v4 = iy / heightSegments;
      let uOffset = 0;
      if (iy == 0 && thetaStart == 0) {
        uOffset = 0.5 / widthSegments;
      } else if (iy == heightSegments && thetaEnd == Math.PI) {
        uOffset = -0.5 / widthSegments;
      }
      for (let ix = 0; ix <= widthSegments; ix++) {
        const u = ix / widthSegments;
        vertex2.x = -radius * Math.cos(phiStart + u * phiLength) * Math.sin(thetaStart + v4 * thetaLength);
        vertex2.y = radius * Math.cos(thetaStart + v4 * thetaLength);
        vertex2.z = radius * Math.sin(phiStart + u * phiLength) * Math.sin(thetaStart + v4 * thetaLength);
        vertices.push(vertex2.x, vertex2.y, vertex2.z);
        normal.copy(vertex2).normalize();
        normals.push(normal.x, normal.y, normal.z);
        uvs.push(u + uOffset, 1 - v4);
        verticesRow.push(index++);
      }
      grid.push(verticesRow);
    }
    for (let iy = 0; iy < heightSegments; iy++) {
      for (let ix = 0; ix < widthSegments; ix++) {
        const a2 = grid[iy][ix + 1];
        const b = grid[iy][ix];
        const c4 = grid[iy + 1][ix];
        const d = grid[iy + 1][ix + 1];
        if (iy !== 0 || thetaStart > 0)
          indices.push(a2, b, d);
        if (iy !== heightSegments - 1 || thetaEnd < Math.PI)
          indices.push(b, c4, d);
      }
    }
    this.setIndex(indices);
    this.setAttribute("position", new Float32BufferAttribute(vertices, 3));
    this.setAttribute("normal", new Float32BufferAttribute(normals, 3));
    this.setAttribute("uv", new Float32BufferAttribute(uvs, 2));
  }
  static fromJSON(data) {
    return new _SphereGeometry(data.radius, data.widthSegments, data.heightSegments, data.phiStart, data.phiLength, data.thetaStart, data.thetaLength);
  }
};
var TetrahedronGeometry = class _TetrahedronGeometry extends PolyhedronGeometry {
  constructor(radius = 1, detail = 0) {
    const vertices = [
      1,
      1,
      1,
      -1,
      -1,
      1,
      -1,
      1,
      -1,
      1,
      -1,
      -1
    ];
    const indices = [
      2,
      1,
      0,
      0,
      3,
      2,
      1,
      3,
      0,
      2,
      3,
      1
    ];
    super(vertices, indices, radius, detail);
    this.type = "TetrahedronGeometry";
    this.parameters = {
      radius,
      detail
    };
  }
  static fromJSON(data) {
    return new _TetrahedronGeometry(data.radius, data.detail);
  }
};
var TorusGeometry = class _TorusGeometry extends BufferGeometry {
  constructor(radius = 1, tube = 0.4, radialSegments = 8, tubularSegments = 6, arc = Math.PI * 2) {
    super();
    this.type = "TorusGeometry";
    this.parameters = {
      radius,
      tube,
      radialSegments,
      tubularSegments,
      arc
    };
    radialSegments = Math.floor(radialSegments);
    tubularSegments = Math.floor(tubularSegments);
    const indices = [];
    const vertices = [];
    const normals = [];
    const uvs = [];
    const center = new Vector3();
    const vertex2 = new Vector3();
    const normal = new Vector3();
    for (let j = 0; j <= radialSegments; j++) {
      for (let i2 = 0; i2 <= tubularSegments; i2++) {
        const u = i2 / tubularSegments * arc;
        const v4 = j / radialSegments * Math.PI * 2;
        vertex2.x = (radius + tube * Math.cos(v4)) * Math.cos(u);
        vertex2.y = (radius + tube * Math.cos(v4)) * Math.sin(u);
        vertex2.z = tube * Math.sin(v4);
        vertices.push(vertex2.x, vertex2.y, vertex2.z);
        center.x = radius * Math.cos(u);
        center.y = radius * Math.sin(u);
        normal.subVectors(vertex2, center).normalize();
        normals.push(normal.x, normal.y, normal.z);
        uvs.push(i2 / tubularSegments);
        uvs.push(j / radialSegments);
      }
    }
    for (let j = 1; j <= radialSegments; j++) {
      for (let i2 = 1; i2 <= tubularSegments; i2++) {
        const a2 = (tubularSegments + 1) * j + i2 - 1;
        const b = (tubularSegments + 1) * (j - 1) + i2 - 1;
        const c4 = (tubularSegments + 1) * (j - 1) + i2;
        const d = (tubularSegments + 1) * j + i2;
        indices.push(a2, b, d);
        indices.push(b, c4, d);
      }
    }
    this.setIndex(indices);
    this.setAttribute("position", new Float32BufferAttribute(vertices, 3));
    this.setAttribute("normal", new Float32BufferAttribute(normals, 3));
    this.setAttribute("uv", new Float32BufferAttribute(uvs, 2));
  }
  static fromJSON(data) {
    return new _TorusGeometry(data.radius, data.tube, data.radialSegments, data.tubularSegments, data.arc);
  }
};
var TorusKnotGeometry = class _TorusKnotGeometry extends BufferGeometry {
  constructor(radius = 1, tube = 0.4, tubularSegments = 64, radialSegments = 8, p = 2, q = 3) {
    super();
    this.type = "TorusKnotGeometry";
    this.parameters = {
      radius,
      tube,
      tubularSegments,
      radialSegments,
      p,
      q
    };
    tubularSegments = Math.floor(tubularSegments);
    radialSegments = Math.floor(radialSegments);
    const indices = [];
    const vertices = [];
    const normals = [];
    const uvs = [];
    const vertex2 = new Vector3();
    const normal = new Vector3();
    const P1 = new Vector3();
    const P2 = new Vector3();
    const B2 = new Vector3();
    const T = new Vector3();
    const N = new Vector3();
    for (let i2 = 0; i2 <= tubularSegments; ++i2) {
      const u = i2 / tubularSegments * p * Math.PI * 2;
      calculatePositionOnCurve(u, p, q, radius, P1);
      calculatePositionOnCurve(u + 0.01, p, q, radius, P2);
      T.subVectors(P2, P1);
      N.addVectors(P2, P1);
      B2.crossVectors(T, N);
      N.crossVectors(B2, T);
      B2.normalize();
      N.normalize();
      for (let j = 0; j <= radialSegments; ++j) {
        const v4 = j / radialSegments * Math.PI * 2;
        const cx = -tube * Math.cos(v4);
        const cy = tube * Math.sin(v4);
        vertex2.x = P1.x + (cx * N.x + cy * B2.x);
        vertex2.y = P1.y + (cx * N.y + cy * B2.y);
        vertex2.z = P1.z + (cx * N.z + cy * B2.z);
        vertices.push(vertex2.x, vertex2.y, vertex2.z);
        normal.subVectors(vertex2, P1).normalize();
        normals.push(normal.x, normal.y, normal.z);
        uvs.push(i2 / tubularSegments);
        uvs.push(j / radialSegments);
      }
    }
    for (let j = 1; j <= tubularSegments; j++) {
      for (let i2 = 1; i2 <= radialSegments; i2++) {
        const a2 = (radialSegments + 1) * (j - 1) + (i2 - 1);
        const b = (radialSegments + 1) * j + (i2 - 1);
        const c4 = (radialSegments + 1) * j + i2;
        const d = (radialSegments + 1) * (j - 1) + i2;
        indices.push(a2, b, d);
        indices.push(b, c4, d);
      }
    }
    this.setIndex(indices);
    this.setAttribute("position", new Float32BufferAttribute(vertices, 3));
    this.setAttribute("normal", new Float32BufferAttribute(normals, 3));
    this.setAttribute("uv", new Float32BufferAttribute(uvs, 2));
    function calculatePositionOnCurve(u, p2, q2, radius2, position2) {
      const cu = Math.cos(u);
      const su = Math.sin(u);
      const quOverP = q2 / p2 * u;
      const cs = Math.cos(quOverP);
      position2.x = radius2 * (2 + cs) * 0.5 * cu;
      position2.y = radius2 * (2 + cs) * su * 0.5;
      position2.z = radius2 * Math.sin(quOverP) * 0.5;
    }
  }
  static fromJSON(data) {
    return new _TorusKnotGeometry(data.radius, data.tube, data.tubularSegments, data.radialSegments, data.p, data.q);
  }
};
var TubeGeometry = class _TubeGeometry extends BufferGeometry {
  constructor(path2 = new QuadraticBezierCurve3(new Vector3(-1, -1, 0), new Vector3(-1, 1, 0), new Vector3(1, 1, 0)), tubularSegments = 64, radius = 1, radialSegments = 8, closed = false) {
    super();
    this.type = "TubeGeometry";
    this.parameters = {
      path: path2,
      tubularSegments,
      radius,
      radialSegments,
      closed
    };
    const frames = path2.computeFrenetFrames(tubularSegments, closed);
    this.tangents = frames.tangents;
    this.normals = frames.normals;
    this.binormals = frames.binormals;
    const vertex2 = new Vector3();
    const normal = new Vector3();
    const uv = new Vector2();
    let P = new Vector3();
    const vertices = [];
    const normals = [];
    const uvs = [];
    const indices = [];
    generateBufferData();
    this.setIndex(indices);
    this.setAttribute("position", new Float32BufferAttribute(vertices, 3));
    this.setAttribute("normal", new Float32BufferAttribute(normals, 3));
    this.setAttribute("uv", new Float32BufferAttribute(uvs, 2));
    function generateBufferData() {
      for (let i2 = 0; i2 < tubularSegments; i2++) {
        generateSegment(i2);
      }
      generateSegment(closed === false ? tubularSegments : 0);
      generateUVs();
      generateIndices();
    }
    function generateSegment(i2) {
      P = path2.getPointAt(i2 / tubularSegments, P);
      const N = frames.normals[i2];
      const B2 = frames.binormals[i2];
      for (let j = 0; j <= radialSegments; j++) {
        const v4 = j / radialSegments * Math.PI * 2;
        const sin2 = Math.sin(v4);
        const cos2 = -Math.cos(v4);
        normal.x = cos2 * N.x + sin2 * B2.x;
        normal.y = cos2 * N.y + sin2 * B2.y;
        normal.z = cos2 * N.z + sin2 * B2.z;
        normal.normalize();
        normals.push(normal.x, normal.y, normal.z);
        vertex2.x = P.x + radius * normal.x;
        vertex2.y = P.y + radius * normal.y;
        vertex2.z = P.z + radius * normal.z;
        vertices.push(vertex2.x, vertex2.y, vertex2.z);
      }
    }
    function generateIndices() {
      for (let j = 1; j <= tubularSegments; j++) {
        for (let i2 = 1; i2 <= radialSegments; i2++) {
          const a2 = (radialSegments + 1) * (j - 1) + (i2 - 1);
          const b = (radialSegments + 1) * j + (i2 - 1);
          const c4 = (radialSegments + 1) * j + i2;
          const d = (radialSegments + 1) * (j - 1) + i2;
          indices.push(a2, b, d);
          indices.push(b, c4, d);
        }
      }
    }
    function generateUVs() {
      for (let i2 = 0; i2 <= tubularSegments; i2++) {
        for (let j = 0; j <= radialSegments; j++) {
          uv.x = i2 / tubularSegments;
          uv.y = j / radialSegments;
          uvs.push(uv.x, uv.y);
        }
      }
    }
  }
  toJSON() {
    const data = super.toJSON();
    data.path = this.parameters.path.toJSON();
    return data;
  }
  static fromJSON(data) {
    return new _TubeGeometry(
      new Curves[data.path.type]().fromJSON(data.path),
      data.tubularSegments,
      data.radius,
      data.radialSegments,
      data.closed
    );
  }
};
var WireframeGeometry = class extends BufferGeometry {
  constructor(geometry = null) {
    super();
    this.type = "WireframeGeometry";
    this.parameters = {
      geometry
    };
    if (geometry !== null) {
      const vertices = [];
      const edges = /* @__PURE__ */ new Set();
      const start = new Vector3();
      const end = new Vector3();
      if (geometry.index !== null) {
        const position2 = geometry.attributes.position;
        const indices = geometry.index;
        let groups = geometry.groups;
        if (groups.length === 0) {
          groups = [{ start: 0, count: indices.count, materialIndex: 0 }];
        }
        for (let o = 0, ol = groups.length; o < ol; ++o) {
          const group = groups[o];
          const groupStart = group.start;
          const groupCount = group.count;
          for (let i2 = groupStart, l = groupStart + groupCount; i2 < l; i2 += 3) {
            for (let j = 0; j < 3; j++) {
              const index1 = indices.getX(i2 + j);
              const index2 = indices.getX(i2 + (j + 1) % 3);
              start.fromBufferAttribute(position2, index1);
              end.fromBufferAttribute(position2, index2);
              if (isUniqueEdge(start, end, edges) === true) {
                vertices.push(start.x, start.y, start.z);
                vertices.push(end.x, end.y, end.z);
              }
            }
          }
        }
      } else {
        const position2 = geometry.attributes.position;
        for (let i2 = 0, l = position2.count / 3; i2 < l; i2++) {
          for (let j = 0; j < 3; j++) {
            const index1 = 3 * i2 + j;
            const index2 = 3 * i2 + (j + 1) % 3;
            start.fromBufferAttribute(position2, index1);
            end.fromBufferAttribute(position2, index2);
            if (isUniqueEdge(start, end, edges) === true) {
              vertices.push(start.x, start.y, start.z);
              vertices.push(end.x, end.y, end.z);
            }
          }
        }
      }
      this.setAttribute("position", new Float32BufferAttribute(vertices, 3));
    }
  }
};
function isUniqueEdge(start, end, edges) {
  const hash1 = `${start.x},${start.y},${start.z}-${end.x},${end.y},${end.z}`;
  const hash22 = `${end.x},${end.y},${end.z}-${start.x},${start.y},${start.z}`;
  if (edges.has(hash1) === true || edges.has(hash22) === true) {
    return false;
  } else {
    edges.add(hash1);
    edges.add(hash22);
    return true;
  }
}
var Geometries = /* @__PURE__ */ Object.freeze({
  __proto__: null,
  BoxGeometry,
  BoxBufferGeometry: BoxGeometry,
  CapsuleGeometry,
  CapsuleBufferGeometry: CapsuleGeometry,
  CircleGeometry,
  CircleBufferGeometry: CircleGeometry,
  ConeGeometry,
  ConeBufferGeometry: ConeGeometry,
  CylinderGeometry,
  CylinderBufferGeometry: CylinderGeometry,
  DodecahedronGeometry,
  DodecahedronBufferGeometry: DodecahedronGeometry,
  EdgesGeometry,
  ExtrudeGeometry,
  ExtrudeBufferGeometry: ExtrudeGeometry,
  IcosahedronGeometry,
  IcosahedronBufferGeometry: IcosahedronGeometry,
  LatheGeometry,
  LatheBufferGeometry: LatheGeometry,
  OctahedronGeometry,
  OctahedronBufferGeometry: OctahedronGeometry,
  PlaneGeometry,
  PlaneBufferGeometry: PlaneGeometry,
  PolyhedronGeometry,
  PolyhedronBufferGeometry: PolyhedronGeometry,
  RingGeometry,
  RingBufferGeometry: RingGeometry,
  ShapeGeometry,
  ShapeBufferGeometry: ShapeGeometry,
  SphereGeometry,
  SphereBufferGeometry: SphereGeometry,
  TetrahedronGeometry,
  TetrahedronBufferGeometry: TetrahedronGeometry,
  TorusGeometry,
  TorusBufferGeometry: TorusGeometry,
  TorusKnotGeometry,
  TorusKnotBufferGeometry: TorusKnotGeometry,
  TubeGeometry,
  TubeBufferGeometry: TubeGeometry,
  WireframeGeometry
});
var ShadowMaterial = class extends Material {
  constructor(parameters) {
    super();
    this.type = "ShadowMaterial";
    this.color = new Color2(0);
    this.transparent = true;
    this.setValues(parameters);
  }
  copy(source) {
    super.copy(source);
    this.color.copy(source.color);
    return this;
  }
};
ShadowMaterial.prototype.isShadowMaterial = true;
var RawShaderMaterial = class extends ShaderMaterial {
  constructor(parameters) {
    super(parameters);
    this.type = "RawShaderMaterial";
  }
};
RawShaderMaterial.prototype.isRawShaderMaterial = true;
var MeshStandardMaterial = class extends Material {
  constructor(parameters) {
    super();
    this.defines = { "STANDARD": "" };
    this.type = "MeshStandardMaterial";
    this.color = new Color2(16777215);
    this.roughness = 1;
    this.metalness = 0;
    this.map = null;
    this.lightMap = null;
    this.lightMapIntensity = 1;
    this.aoMap = null;
    this.aoMapIntensity = 1;
    this.emissive = new Color2(0);
    this.emissiveIntensity = 1;
    this.emissiveMap = null;
    this.bumpMap = null;
    this.bumpScale = 1;
    this.normalMap = null;
    this.normalMapType = TangentSpaceNormalMap;
    this.normalScale = new Vector2(1, 1);
    this.displacementMap = null;
    this.displacementScale = 1;
    this.displacementBias = 0;
    this.roughnessMap = null;
    this.metalnessMap = null;
    this.alphaMap = null;
    this.envMap = null;
    this.envMapIntensity = 1;
    this.wireframe = false;
    this.wireframeLinewidth = 1;
    this.wireframeLinecap = "round";
    this.wireframeLinejoin = "round";
    this.flatShading = false;
    this.setValues(parameters);
  }
  copy(source) {
    super.copy(source);
    this.defines = { "STANDARD": "" };
    this.color.copy(source.color);
    this.roughness = source.roughness;
    this.metalness = source.metalness;
    this.map = source.map;
    this.lightMap = source.lightMap;
    this.lightMapIntensity = source.lightMapIntensity;
    this.aoMap = source.aoMap;
    this.aoMapIntensity = source.aoMapIntensity;
    this.emissive.copy(source.emissive);
    this.emissiveMap = source.emissiveMap;
    this.emissiveIntensity = source.emissiveIntensity;
    this.bumpMap = source.bumpMap;
    this.bumpScale = source.bumpScale;
    this.normalMap = source.normalMap;
    this.normalMapType = source.normalMapType;
    this.normalScale.copy(source.normalScale);
    this.displacementMap = source.displacementMap;
    this.displacementScale = source.displacementScale;
    this.displacementBias = source.displacementBias;
    this.roughnessMap = source.roughnessMap;
    this.metalnessMap = source.metalnessMap;
    this.alphaMap = source.alphaMap;
    this.envMap = source.envMap;
    this.envMapIntensity = source.envMapIntensity;
    this.wireframe = source.wireframe;
    this.wireframeLinewidth = source.wireframeLinewidth;
    this.wireframeLinecap = source.wireframeLinecap;
    this.wireframeLinejoin = source.wireframeLinejoin;
    this.flatShading = source.flatShading;
    return this;
  }
};
MeshStandardMaterial.prototype.isMeshStandardMaterial = true;
var MeshPhysicalMaterial = class extends MeshStandardMaterial {
  constructor(parameters) {
    super();
    this.defines = {
      "STANDARD": "",
      "PHYSICAL": ""
    };
    this.type = "MeshPhysicalMaterial";
    this.clearcoatMap = null;
    this.clearcoatRoughness = 0;
    this.clearcoatRoughnessMap = null;
    this.clearcoatNormalScale = new Vector2(1, 1);
    this.clearcoatNormalMap = null;
    this.ior = 1.5;
    Object.defineProperty(this, "reflectivity", {
      get: function() {
        return clamp(2.5 * (this.ior - 1) / (this.ior + 1), 0, 1);
      },
      set: function(reflectivity) {
        this.ior = (1 + 0.4 * reflectivity) / (1 - 0.4 * reflectivity);
      }
    });
    this.sheenColor = new Color2(0);
    this.sheenColorMap = null;
    this.sheenRoughness = 1;
    this.sheenRoughnessMap = null;
    this.transmissionMap = null;
    this.thickness = 0;
    this.thicknessMap = null;
    this.attenuationDistance = 0;
    this.attenuationColor = new Color2(1, 1, 1);
    this.specularIntensity = 1;
    this.specularIntensityMap = null;
    this.specularColor = new Color2(1, 1, 1);
    this.specularColorMap = null;
    this._sheen = 0;
    this._clearcoat = 0;
    this._transmission = 0;
    this.setValues(parameters);
  }
  get sheen() {
    return this._sheen;
  }
  set sheen(value) {
    if (this._sheen > 0 !== value > 0) {
      this.version++;
    }
    this._sheen = value;
  }
  get clearcoat() {
    return this._clearcoat;
  }
  set clearcoat(value) {
    if (this._clearcoat > 0 !== value > 0) {
      this.version++;
    }
    this._clearcoat = value;
  }
  get transmission() {
    return this._transmission;
  }
  set transmission(value) {
    if (this._transmission > 0 !== value > 0) {
      this.version++;
    }
    this._transmission = value;
  }
  copy(source) {
    super.copy(source);
    this.defines = {
      "STANDARD": "",
      "PHYSICAL": ""
    };
    this.clearcoat = source.clearcoat;
    this.clearcoatMap = source.clearcoatMap;
    this.clearcoatRoughness = source.clearcoatRoughness;
    this.clearcoatRoughnessMap = source.clearcoatRoughnessMap;
    this.clearcoatNormalMap = source.clearcoatNormalMap;
    this.clearcoatNormalScale.copy(source.clearcoatNormalScale);
    this.ior = source.ior;
    this.sheen = source.sheen;
    this.sheenColor.copy(source.sheenColor);
    this.sheenColorMap = source.sheenColorMap;
    this.sheenRoughness = source.sheenRoughness;
    this.sheenRoughnessMap = source.sheenRoughnessMap;
    this.transmission = source.transmission;
    this.transmissionMap = source.transmissionMap;
    this.thickness = source.thickness;
    this.thicknessMap = source.thicknessMap;
    this.attenuationDistance = source.attenuationDistance;
    this.attenuationColor.copy(source.attenuationColor);
    this.specularIntensity = source.specularIntensity;
    this.specularIntensityMap = source.specularIntensityMap;
    this.specularColor.copy(source.specularColor);
    this.specularColorMap = source.specularColorMap;
    return this;
  }
};
MeshPhysicalMaterial.prototype.isMeshPhysicalMaterial = true;
var MeshPhongMaterial = class extends Material {
  constructor(parameters) {
    super();
    this.type = "MeshPhongMaterial";
    this.color = new Color2(16777215);
    this.specular = new Color2(1118481);
    this.shininess = 30;
    this.map = null;
    this.lightMap = null;
    this.lightMapIntensity = 1;
    this.aoMap = null;
    this.aoMapIntensity = 1;
    this.emissive = new Color2(0);
    this.emissiveIntensity = 1;
    this.emissiveMap = null;
    this.bumpMap = null;
    this.bumpScale = 1;
    this.normalMap = null;
    this.normalMapType = TangentSpaceNormalMap;
    this.normalScale = new Vector2(1, 1);
    this.displacementMap = null;
    this.displacementScale = 1;
    this.displacementBias = 0;
    this.specularMap = null;
    this.alphaMap = null;
    this.envMap = null;
    this.combine = MultiplyOperation;
    this.reflectivity = 1;
    this.refractionRatio = 0.98;
    this.wireframe = false;
    this.wireframeLinewidth = 1;
    this.wireframeLinecap = "round";
    this.wireframeLinejoin = "round";
    this.flatShading = false;
    this.setValues(parameters);
  }
  copy(source) {
    super.copy(source);
    this.color.copy(source.color);
    this.specular.copy(source.specular);
    this.shininess = source.shininess;
    this.map = source.map;
    this.lightMap = source.lightMap;
    this.lightMapIntensity = source.lightMapIntensity;
    this.aoMap = source.aoMap;
    this.aoMapIntensity = source.aoMapIntensity;
    this.emissive.copy(source.emissive);
    this.emissiveMap = source.emissiveMap;
    this.emissiveIntensity = source.emissiveIntensity;
    this.bumpMap = source.bumpMap;
    this.bumpScale = source.bumpScale;
    this.normalMap = source.normalMap;
    this.normalMapType = source.normalMapType;
    this.normalScale.copy(source.normalScale);
    this.displacementMap = source.displacementMap;
    this.displacementScale = source.displacementScale;
    this.displacementBias = source.displacementBias;
    this.specularMap = source.specularMap;
    this.alphaMap = source.alphaMap;
    this.envMap = source.envMap;
    this.combine = source.combine;
    this.reflectivity = source.reflectivity;
    this.refractionRatio = source.refractionRatio;
    this.wireframe = source.wireframe;
    this.wireframeLinewidth = source.wireframeLinewidth;
    this.wireframeLinecap = source.wireframeLinecap;
    this.wireframeLinejoin = source.wireframeLinejoin;
    this.flatShading = source.flatShading;
    return this;
  }
};
MeshPhongMaterial.prototype.isMeshPhongMaterial = true;
var MeshToonMaterial = class extends Material {
  constructor(parameters) {
    super();
    this.defines = { "TOON": "" };
    this.type = "MeshToonMaterial";
    this.color = new Color2(16777215);
    this.map = null;
    this.gradientMap = null;
    this.lightMap = null;
    this.lightMapIntensity = 1;
    this.aoMap = null;
    this.aoMapIntensity = 1;
    this.emissive = new Color2(0);
    this.emissiveIntensity = 1;
    this.emissiveMap = null;
    this.bumpMap = null;
    this.bumpScale = 1;
    this.normalMap = null;
    this.normalMapType = TangentSpaceNormalMap;
    this.normalScale = new Vector2(1, 1);
    this.displacementMap = null;
    this.displacementScale = 1;
    this.displacementBias = 0;
    this.alphaMap = null;
    this.wireframe = false;
    this.wireframeLinewidth = 1;
    this.wireframeLinecap = "round";
    this.wireframeLinejoin = "round";
    this.setValues(parameters);
  }
  copy(source) {
    super.copy(source);
    this.color.copy(source.color);
    this.map = source.map;
    this.gradientMap = source.gradientMap;
    this.lightMap = source.lightMap;
    this.lightMapIntensity = source.lightMapIntensity;
    this.aoMap = source.aoMap;
    this.aoMapIntensity = source.aoMapIntensity;
    this.emissive.copy(source.emissive);
    this.emissiveMap = source.emissiveMap;
    this.emissiveIntensity = source.emissiveIntensity;
    this.bumpMap = source.bumpMap;
    this.bumpScale = source.bumpScale;
    this.normalMap = source.normalMap;
    this.normalMapType = source.normalMapType;
    this.normalScale.copy(source.normalScale);
    this.displacementMap = source.displacementMap;
    this.displacementScale = source.displacementScale;
    this.displacementBias = source.displacementBias;
    this.alphaMap = source.alphaMap;
    this.wireframe = source.wireframe;
    this.wireframeLinewidth = source.wireframeLinewidth;
    this.wireframeLinecap = source.wireframeLinecap;
    this.wireframeLinejoin = source.wireframeLinejoin;
    return this;
  }
};
MeshToonMaterial.prototype.isMeshToonMaterial = true;
var MeshNormalMaterial = class extends Material {
  constructor(parameters) {
    super();
    this.type = "MeshNormalMaterial";
    this.bumpMap = null;
    this.bumpScale = 1;
    this.normalMap = null;
    this.normalMapType = TangentSpaceNormalMap;
    this.normalScale = new Vector2(1, 1);
    this.displacementMap = null;
    this.displacementScale = 1;
    this.displacementBias = 0;
    this.wireframe = false;
    this.wireframeLinewidth = 1;
    this.fog = false;
    this.flatShading = false;
    this.setValues(parameters);
  }
  copy(source) {
    super.copy(source);
    this.bumpMap = source.bumpMap;
    this.bumpScale = source.bumpScale;
    this.normalMap = source.normalMap;
    this.normalMapType = source.normalMapType;
    this.normalScale.copy(source.normalScale);
    this.displacementMap = source.displacementMap;
    this.displacementScale = source.displacementScale;
    this.displacementBias = source.displacementBias;
    this.wireframe = source.wireframe;
    this.wireframeLinewidth = source.wireframeLinewidth;
    this.flatShading = source.flatShading;
    return this;
  }
};
MeshNormalMaterial.prototype.isMeshNormalMaterial = true;
var MeshLambertMaterial = class extends Material {
  constructor(parameters) {
    super();
    this.type = "MeshLambertMaterial";
    this.color = new Color2(16777215);
    this.map = null;
    this.lightMap = null;
    this.lightMapIntensity = 1;
    this.aoMap = null;
    this.aoMapIntensity = 1;
    this.emissive = new Color2(0);
    this.emissiveIntensity = 1;
    this.emissiveMap = null;
    this.specularMap = null;
    this.alphaMap = null;
    this.envMap = null;
    this.combine = MultiplyOperation;
    this.reflectivity = 1;
    this.refractionRatio = 0.98;
    this.wireframe = false;
    this.wireframeLinewidth = 1;
    this.wireframeLinecap = "round";
    this.wireframeLinejoin = "round";
    this.setValues(parameters);
  }
  copy(source) {
    super.copy(source);
    this.color.copy(source.color);
    this.map = source.map;
    this.lightMap = source.lightMap;
    this.lightMapIntensity = source.lightMapIntensity;
    this.aoMap = source.aoMap;
    this.aoMapIntensity = source.aoMapIntensity;
    this.emissive.copy(source.emissive);
    this.emissiveMap = source.emissiveMap;
    this.emissiveIntensity = source.emissiveIntensity;
    this.specularMap = source.specularMap;
    this.alphaMap = source.alphaMap;
    this.envMap = source.envMap;
    this.combine = source.combine;
    this.reflectivity = source.reflectivity;
    this.refractionRatio = source.refractionRatio;
    this.wireframe = source.wireframe;
    this.wireframeLinewidth = source.wireframeLinewidth;
    this.wireframeLinecap = source.wireframeLinecap;
    this.wireframeLinejoin = source.wireframeLinejoin;
    return this;
  }
};
MeshLambertMaterial.prototype.isMeshLambertMaterial = true;
var MeshMatcapMaterial = class extends Material {
  constructor(parameters) {
    super();
    this.defines = { "MATCAP": "" };
    this.type = "MeshMatcapMaterial";
    this.color = new Color2(16777215);
    this.matcap = null;
    this.map = null;
    this.bumpMap = null;
    this.bumpScale = 1;
    this.normalMap = null;
    this.normalMapType = TangentSpaceNormalMap;
    this.normalScale = new Vector2(1, 1);
    this.displacementMap = null;
    this.displacementScale = 1;
    this.displacementBias = 0;
    this.alphaMap = null;
    this.flatShading = false;
    this.setValues(parameters);
  }
  copy(source) {
    super.copy(source);
    this.defines = { "MATCAP": "" };
    this.color.copy(source.color);
    this.matcap = source.matcap;
    this.map = source.map;
    this.bumpMap = source.bumpMap;
    this.bumpScale = source.bumpScale;
    this.normalMap = source.normalMap;
    this.normalMapType = source.normalMapType;
    this.normalScale.copy(source.normalScale);
    this.displacementMap = source.displacementMap;
    this.displacementScale = source.displacementScale;
    this.displacementBias = source.displacementBias;
    this.alphaMap = source.alphaMap;
    this.flatShading = source.flatShading;
    return this;
  }
};
MeshMatcapMaterial.prototype.isMeshMatcapMaterial = true;
var LineDashedMaterial = class extends LineBasicMaterial {
  constructor(parameters) {
    super();
    this.type = "LineDashedMaterial";
    this.scale = 1;
    this.dashSize = 3;
    this.gapSize = 1;
    this.setValues(parameters);
  }
  copy(source) {
    super.copy(source);
    this.scale = source.scale;
    this.dashSize = source.dashSize;
    this.gapSize = source.gapSize;
    return this;
  }
};
LineDashedMaterial.prototype.isLineDashedMaterial = true;
var materialLib = {
  ShadowMaterial,
  SpriteMaterial,
  RawShaderMaterial,
  ShaderMaterial,
  PointsMaterial,
  MeshPhysicalMaterial,
  MeshStandardMaterial,
  MeshPhongMaterial,
  MeshToonMaterial,
  MeshNormalMaterial,
  MeshLambertMaterial,
  MeshDepthMaterial,
  MeshDistanceMaterial,
  MeshBasicMaterial,
  MeshMatcapMaterial,
  LineDashedMaterial,
  LineBasicMaterial,
  Material
};
Material.fromType = function(type) {
  return new materialLib[type]();
};
var AnimationUtils = {
  // same as Array.prototype.slice, but also works on typed arrays
  arraySlice: function(array, from2, to) {
    if (AnimationUtils.isTypedArray(array)) {
      return new array.constructor(array.subarray(from2, to !== void 0 ? to : array.length));
    }
    return array.slice(from2, to);
  },
  // converts an array to a specific type
  convertArray: function(array, type, forceClone) {
    if (!array || // let 'undefined' and 'null' pass
    !forceClone && array.constructor === type)
      return array;
    if (typeof type.BYTES_PER_ELEMENT === "number") {
      return new type(array);
    }
    return Array.prototype.slice.call(array);
  },
  isTypedArray: function(object) {
    return ArrayBuffer.isView(object) && !(object instanceof DataView);
  },
  // returns an array by which times and values can be sorted
  getKeyframeOrder: function(times) {
    function compareTime(i2, j) {
      return times[i2] - times[j];
    }
    const n2 = times.length;
    const result = new Array(n2);
    for (let i2 = 0; i2 !== n2; ++i2)
      result[i2] = i2;
    result.sort(compareTime);
    return result;
  },
  // uses the array previously returned by 'getKeyframeOrder' to sort data
  sortedArray: function(values2, stride, order) {
    const nValues = values2.length;
    const result = new values2.constructor(nValues);
    for (let i2 = 0, dstOffset = 0; dstOffset !== nValues; ++i2) {
      const srcOffset = order[i2] * stride;
      for (let j = 0; j !== stride; ++j) {
        result[dstOffset++] = values2[srcOffset + j];
      }
    }
    return result;
  },
  // function for parsing AOS keyframe formats
  flattenJSON: function(jsonKeys, times, values2, valuePropertyName) {
    let i2 = 1, key = jsonKeys[0];
    while (key !== void 0 && key[valuePropertyName] === void 0) {
      key = jsonKeys[i2++];
    }
    if (key === void 0)
      return;
    let value = key[valuePropertyName];
    if (value === void 0)
      return;
    if (Array.isArray(value)) {
      do {
        value = key[valuePropertyName];
        if (value !== void 0) {
          times.push(key.time);
          values2.push.apply(values2, value);
        }
        key = jsonKeys[i2++];
      } while (key !== void 0);
    } else if (value.toArray !== void 0) {
      do {
        value = key[valuePropertyName];
        if (value !== void 0) {
          times.push(key.time);
          value.toArray(values2, values2.length);
        }
        key = jsonKeys[i2++];
      } while (key !== void 0);
    } else {
      do {
        value = key[valuePropertyName];
        if (value !== void 0) {
          times.push(key.time);
          values2.push(value);
        }
        key = jsonKeys[i2++];
      } while (key !== void 0);
    }
  },
  subclip: function(sourceClip, name2, startFrame, endFrame, fps = 30) {
    const clip = sourceClip.clone();
    clip.name = name2;
    const tracks = [];
    for (let i2 = 0; i2 < clip.tracks.length; ++i2) {
      const track = clip.tracks[i2];
      const valueSize = track.getValueSize();
      const times = [];
      const values2 = [];
      for (let j = 0; j < track.times.length; ++j) {
        const frame = track.times[j] * fps;
        if (frame < startFrame || frame >= endFrame)
          continue;
        times.push(track.times[j]);
        for (let k2 = 0; k2 < valueSize; ++k2) {
          values2.push(track.values[j * valueSize + k2]);
        }
      }
      if (times.length === 0)
        continue;
      track.times = AnimationUtils.convertArray(times, track.times.constructor);
      track.values = AnimationUtils.convertArray(values2, track.values.constructor);
      tracks.push(track);
    }
    clip.tracks = tracks;
    let minStartTime = Infinity;
    for (let i2 = 0; i2 < clip.tracks.length; ++i2) {
      if (minStartTime > clip.tracks[i2].times[0]) {
        minStartTime = clip.tracks[i2].times[0];
      }
    }
    for (let i2 = 0; i2 < clip.tracks.length; ++i2) {
      clip.tracks[i2].shift(-1 * minStartTime);
    }
    clip.resetDuration();
    return clip;
  },
  makeClipAdditive: function(targetClip, referenceFrame = 0, referenceClip = targetClip, fps = 30) {
    if (fps <= 0)
      fps = 30;
    const numTracks = referenceClip.tracks.length;
    const referenceTime = referenceFrame / fps;
    for (let i2 = 0; i2 < numTracks; ++i2) {
      const referenceTrack = referenceClip.tracks[i2];
      const referenceTrackType = referenceTrack.ValueTypeName;
      if (referenceTrackType === "bool" || referenceTrackType === "string")
        continue;
      const targetTrack = targetClip.tracks.find(function(track) {
        return track.name === referenceTrack.name && track.ValueTypeName === referenceTrackType;
      });
      if (targetTrack === void 0)
        continue;
      let referenceOffset = 0;
      const referenceValueSize = referenceTrack.getValueSize();
      if (referenceTrack.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline) {
        referenceOffset = referenceValueSize / 3;
      }
      let targetOffset = 0;
      const targetValueSize = targetTrack.getValueSize();
      if (targetTrack.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline) {
        targetOffset = targetValueSize / 3;
      }
      const lastIndex = referenceTrack.times.length - 1;
      let referenceValue;
      if (referenceTime <= referenceTrack.times[0]) {
        const startIndex = referenceOffset;
        const endIndex = referenceValueSize - referenceOffset;
        referenceValue = AnimationUtils.arraySlice(referenceTrack.values, startIndex, endIndex);
      } else if (referenceTime >= referenceTrack.times[lastIndex]) {
        const startIndex = lastIndex * referenceValueSize + referenceOffset;
        const endIndex = startIndex + referenceValueSize - referenceOffset;
        referenceValue = AnimationUtils.arraySlice(referenceTrack.values, startIndex, endIndex);
      } else {
        const interpolant = referenceTrack.createInterpolant();
        const startIndex = referenceOffset;
        const endIndex = referenceValueSize - referenceOffset;
        interpolant.evaluate(referenceTime);
        referenceValue = AnimationUtils.arraySlice(interpolant.resultBuffer, startIndex, endIndex);
      }
      if (referenceTrackType === "quaternion") {
        const referenceQuat = new Quaternion().fromArray(referenceValue).normalize().conjugate();
        referenceQuat.toArray(referenceValue);
      }
      const numTimes = targetTrack.times.length;
      for (let j = 0; j < numTimes; ++j) {
        const valueStart = j * targetValueSize + targetOffset;
        if (referenceTrackType === "quaternion") {
          Quaternion.multiplyQuaternionsFlat(
            targetTrack.values,
            valueStart,
            referenceValue,
            0,
            targetTrack.values,
            valueStart
          );
        } else {
          const valueEnd = targetValueSize - targetOffset * 2;
          for (let k2 = 0; k2 < valueEnd; ++k2) {
            targetTrack.values[valueStart + k2] -= referenceValue[k2];
          }
        }
      }
    }
    targetClip.blendMode = AdditiveAnimationBlendMode;
    return targetClip;
  }
};
var Interpolant = class {
  constructor(parameterPositions, sampleValues, sampleSize, resultBuffer) {
    this.parameterPositions = parameterPositions;
    this._cachedIndex = 0;
    this.resultBuffer = resultBuffer !== void 0 ? resultBuffer : new sampleValues.constructor(sampleSize);
    this.sampleValues = sampleValues;
    this.valueSize = sampleSize;
    this.settings = null;
    this.DefaultSettings_ = {};
  }
  evaluate(t3) {
    const pp = this.parameterPositions;
    let i1 = this._cachedIndex, t12 = pp[i1], t02 = pp[i1 - 1];
    validate_interval: {
      seek: {
        let right;
        linear_scan: {
          forward_scan:
            if (!(t3 < t12)) {
              for (let giveUpAt = i1 + 2; ; ) {
                if (t12 === void 0) {
                  if (t3 < t02)
                    break forward_scan;
                  i1 = pp.length;
                  this._cachedIndex = i1;
                  return this.afterEnd_(i1 - 1, t3, t02);
                }
                if (i1 === giveUpAt)
                  break;
                t02 = t12;
                t12 = pp[++i1];
                if (t3 < t12) {
                  break seek;
                }
              }
              right = pp.length;
              break linear_scan;
            }
          if (!(t3 >= t02)) {
            const t1global = pp[1];
            if (t3 < t1global) {
              i1 = 2;
              t02 = t1global;
            }
            for (let giveUpAt = i1 - 2; ; ) {
              if (t02 === void 0) {
                this._cachedIndex = 0;
                return this.beforeStart_(0, t3, t12);
              }
              if (i1 === giveUpAt)
                break;
              t12 = t02;
              t02 = pp[--i1 - 1];
              if (t3 >= t02) {
                break seek;
              }
            }
            right = i1;
            i1 = 0;
            break linear_scan;
          }
          break validate_interval;
        }
        while (i1 < right) {
          const mid = i1 + right >>> 1;
          if (t3 < pp[mid]) {
            right = mid;
          } else {
            i1 = mid + 1;
          }
        }
        t12 = pp[i1];
        t02 = pp[i1 - 1];
        if (t02 === void 0) {
          this._cachedIndex = 0;
          return this.beforeStart_(0, t3, t12);
        }
        if (t12 === void 0) {
          i1 = pp.length;
          this._cachedIndex = i1;
          return this.afterEnd_(i1 - 1, t02, t3);
        }
      }
      this._cachedIndex = i1;
      this.intervalChanged_(i1, t02, t12);
    }
    return this.interpolate_(i1, t02, t3, t12);
  }
  getSettings_() {
    return this.settings || this.DefaultSettings_;
  }
  copySampleValue_(index) {
    const result = this.resultBuffer, values2 = this.sampleValues, stride = this.valueSize, offset = index * stride;
    for (let i2 = 0; i2 !== stride; ++i2) {
      result[i2] = values2[offset + i2];
    }
    return result;
  }
  // Template methods for derived classes:
  interpolate_() {
    throw new Error("call to abstract method");
  }
  intervalChanged_() {
  }
};
Interpolant.prototype.beforeStart_ = Interpolant.prototype.copySampleValue_;
Interpolant.prototype.afterEnd_ = Interpolant.prototype.copySampleValue_;
var CubicInterpolant = class extends Interpolant {
  constructor(parameterPositions, sampleValues, sampleSize, resultBuffer) {
    super(parameterPositions, sampleValues, sampleSize, resultBuffer);
    this._weightPrev = -0;
    this._offsetPrev = -0;
    this._weightNext = -0;
    this._offsetNext = -0;
    this.DefaultSettings_ = {
      endingStart: ZeroCurvatureEnding,
      endingEnd: ZeroCurvatureEnding
    };
  }
  intervalChanged_(i1, t02, t12) {
    const pp = this.parameterPositions;
    let iPrev = i1 - 2, iNext = i1 + 1, tPrev = pp[iPrev], tNext = pp[iNext];
    if (tPrev === void 0) {
      switch (this.getSettings_().endingStart) {
        case ZeroSlopeEnding:
          iPrev = i1;
          tPrev = 2 * t02 - t12;
          break;
        case WrapAroundEnding:
          iPrev = pp.length - 2;
          tPrev = t02 + pp[iPrev] - pp[iPrev + 1];
          break;
        default:
          iPrev = i1;
          tPrev = t12;
      }
    }
    if (tNext === void 0) {
      switch (this.getSettings_().endingEnd) {
        case ZeroSlopeEnding:
          iNext = i1;
          tNext = 2 * t12 - t02;
          break;
        case WrapAroundEnding:
          iNext = 1;
          tNext = t12 + pp[1] - pp[0];
          break;
        default:
          iNext = i1 - 1;
          tNext = t02;
      }
    }
    const halfDt = (t12 - t02) * 0.5, stride = this.valueSize;
    this._weightPrev = halfDt / (t02 - tPrev);
    this._weightNext = halfDt / (tNext - t12);
    this._offsetPrev = iPrev * stride;
    this._offsetNext = iNext * stride;
  }
  interpolate_(i1, t02, t3, t12) {
    const result = this.resultBuffer, values2 = this.sampleValues, stride = this.valueSize, o1 = i1 * stride, o0 = o1 - stride, oP = this._offsetPrev, oN = this._offsetNext, wP = this._weightPrev, wN = this._weightNext, p = (t3 - t02) / (t12 - t02), pp = p * p, ppp = pp * p;
    const sP = -wP * ppp + 2 * wP * pp - wP * p;
    const s0 = (1 + wP) * ppp + (-1.5 - 2 * wP) * pp + (-0.5 + wP) * p + 1;
    const s1 = (-1 - wN) * ppp + (1.5 + wN) * pp + 0.5 * p;
    const sN = wN * ppp - wN * pp;
    for (let i2 = 0; i2 !== stride; ++i2) {
      result[i2] = sP * values2[oP + i2] + s0 * values2[o0 + i2] + s1 * values2[o1 + i2] + sN * values2[oN + i2];
    }
    return result;
  }
};
var LinearInterpolant = class extends Interpolant {
  constructor(parameterPositions, sampleValues, sampleSize, resultBuffer) {
    super(parameterPositions, sampleValues, sampleSize, resultBuffer);
  }
  interpolate_(i1, t02, t3, t12) {
    const result = this.resultBuffer, values2 = this.sampleValues, stride = this.valueSize, offset1 = i1 * stride, offset0 = offset1 - stride, weight1 = (t3 - t02) / (t12 - t02), weight0 = 1 - weight1;
    for (let i2 = 0; i2 !== stride; ++i2) {
      result[i2] = values2[offset0 + i2] * weight0 + values2[offset1 + i2] * weight1;
    }
    return result;
  }
};
var DiscreteInterpolant = class extends Interpolant {
  constructor(parameterPositions, sampleValues, sampleSize, resultBuffer) {
    super(parameterPositions, sampleValues, sampleSize, resultBuffer);
  }
  interpolate_(i1) {
    return this.copySampleValue_(i1 - 1);
  }
};
var KeyframeTrack = class {
  constructor(name2, times, values2, interpolation) {
    if (name2 === void 0)
      throw new Error("THREE.KeyframeTrack: track name is undefined");
    if (times === void 0 || times.length === 0)
      throw new Error("THREE.KeyframeTrack: no keyframes in track named " + name2);
    this.name = name2;
    this.times = AnimationUtils.convertArray(times, this.TimeBufferType);
    this.values = AnimationUtils.convertArray(values2, this.ValueBufferType);
    this.setInterpolation(interpolation || this.DefaultInterpolation);
  }
  // Serialization (in static context, because of constructor invocation
  // and automatic invocation of .toJSON):
  static toJSON(track) {
    const trackType = track.constructor;
    let json3;
    if (trackType.toJSON !== this.toJSON) {
      json3 = trackType.toJSON(track);
    } else {
      json3 = {
        "name": track.name,
        "times": AnimationUtils.convertArray(track.times, Array),
        "values": AnimationUtils.convertArray(track.values, Array)
      };
      const interpolation = track.getInterpolation();
      if (interpolation !== track.DefaultInterpolation) {
        json3.interpolation = interpolation;
      }
    }
    json3.type = track.ValueTypeName;
    return json3;
  }
  InterpolantFactoryMethodDiscrete(result) {
    return new DiscreteInterpolant(this.times, this.values, this.getValueSize(), result);
  }
  InterpolantFactoryMethodLinear(result) {
    return new LinearInterpolant(this.times, this.values, this.getValueSize(), result);
  }
  InterpolantFactoryMethodSmooth(result) {
    return new CubicInterpolant(this.times, this.values, this.getValueSize(), result);
  }
  setInterpolation(interpolation) {
    let factoryMethod;
    switch (interpolation) {
      case InterpolateDiscrete:
        factoryMethod = this.InterpolantFactoryMethodDiscrete;
        break;
      case InterpolateLinear:
        factoryMethod = this.InterpolantFactoryMethodLinear;
        break;
      case InterpolateSmooth:
        factoryMethod = this.InterpolantFactoryMethodSmooth;
        break;
    }
    if (factoryMethod === void 0) {
      const message = "unsupported interpolation for " + this.ValueTypeName + " keyframe track named " + this.name;
      if (this.createInterpolant === void 0) {
        if (interpolation !== this.DefaultInterpolation) {
          this.setInterpolation(this.DefaultInterpolation);
        } else {
          throw new Error(message);
        }
      }
      console.warn("THREE.KeyframeTrack:", message);
      return this;
    }
    this.createInterpolant = factoryMethod;
    return this;
  }
  getInterpolation() {
    switch (this.createInterpolant) {
      case this.InterpolantFactoryMethodDiscrete:
        return InterpolateDiscrete;
      case this.InterpolantFactoryMethodLinear:
        return InterpolateLinear;
      case this.InterpolantFactoryMethodSmooth:
        return InterpolateSmooth;
    }
  }
  getValueSize() {
    return this.values.length / this.times.length;
  }
  // move all keyframes either forwards or backwards in time
  shift(timeOffset) {
    if (timeOffset !== 0) {
      const times = this.times;
      for (let i2 = 0, n2 = times.length; i2 !== n2; ++i2) {
        times[i2] += timeOffset;
      }
    }
    return this;
  }
  // scale all keyframe times by a factor (useful for frame <-> seconds conversions)
  scale(timeScale) {
    if (timeScale !== 1) {
      const times = this.times;
      for (let i2 = 0, n2 = times.length; i2 !== n2; ++i2) {
        times[i2] *= timeScale;
      }
    }
    return this;
  }
  // removes keyframes before and after animation without changing any values within the range [startTime, endTime].
  // IMPORTANT: We do not shift around keys to the start of the track time, because for interpolated keys this will change their values
  trim(startTime, endTime) {
    const times = this.times, nKeys = times.length;
    let from2 = 0, to = nKeys - 1;
    while (from2 !== nKeys && times[from2] < startTime) {
      ++from2;
    }
    while (to !== -1 && times[to] > endTime) {
      --to;
    }
    ++to;
    if (from2 !== 0 || to !== nKeys) {
      if (from2 >= to) {
        to = Math.max(to, 1);
        from2 = to - 1;
      }
      const stride = this.getValueSize();
      this.times = AnimationUtils.arraySlice(times, from2, to);
      this.values = AnimationUtils.arraySlice(this.values, from2 * stride, to * stride);
    }
    return this;
  }
  // ensure we do not get a GarbageInGarbageOut situation, make sure tracks are at least minimally viable
  validate() {
    let valid = true;
    const valueSize = this.getValueSize();
    if (valueSize - Math.floor(valueSize) !== 0) {
      console.error("THREE.KeyframeTrack: Invalid value size in track.", this);
      valid = false;
    }
    const times = this.times, values2 = this.values, nKeys = times.length;
    if (nKeys === 0) {
      console.error("THREE.KeyframeTrack: Track is empty.", this);
      valid = false;
    }
    let prevTime = null;
    for (let i2 = 0; i2 !== nKeys; i2++) {
      const currTime = times[i2];
      if (typeof currTime === "number" && isNaN(currTime)) {
        console.error("THREE.KeyframeTrack: Time is not a valid number.", this, i2, currTime);
        valid = false;
        break;
      }
      if (prevTime !== null && prevTime > currTime) {
        console.error("THREE.KeyframeTrack: Out of order keys.", this, i2, currTime, prevTime);
        valid = false;
        break;
      }
      prevTime = currTime;
    }
    if (values2 !== void 0) {
      if (AnimationUtils.isTypedArray(values2)) {
        for (let i2 = 0, n2 = values2.length; i2 !== n2; ++i2) {
          const value = values2[i2];
          if (isNaN(value)) {
            console.error("THREE.KeyframeTrack: Value is not a valid number.", this, i2, value);
            valid = false;
            break;
          }
        }
      }
    }
    return valid;
  }
  // removes equivalent sequential keys as common in morph target sequences
  // (0,0,0,0,1,1,1,0,0,0,0,0,0,0) --> (0,0,1,1,0,0)
  optimize() {
    const times = AnimationUtils.arraySlice(this.times), values2 = AnimationUtils.arraySlice(this.values), stride = this.getValueSize(), smoothInterpolation = this.getInterpolation() === InterpolateSmooth, lastIndex = times.length - 1;
    let writeIndex = 1;
    for (let i2 = 1; i2 < lastIndex; ++i2) {
      let keep = false;
      const time2 = times[i2];
      const timeNext = times[i2 + 1];
      if (time2 !== timeNext && (i2 !== 1 || time2 !== times[0])) {
        if (!smoothInterpolation) {
          const offset = i2 * stride, offsetP = offset - stride, offsetN = offset + stride;
          for (let j = 0; j !== stride; ++j) {
            const value = values2[offset + j];
            if (value !== values2[offsetP + j] || value !== values2[offsetN + j]) {
              keep = true;
              break;
            }
          }
        } else {
          keep = true;
        }
      }
      if (keep) {
        if (i2 !== writeIndex) {
          times[writeIndex] = times[i2];
          const readOffset = i2 * stride, writeOffset = writeIndex * stride;
          for (let j = 0; j !== stride; ++j) {
            values2[writeOffset + j] = values2[readOffset + j];
          }
        }
        ++writeIndex;
      }
    }
    if (lastIndex > 0) {
      times[writeIndex] = times[lastIndex];
      for (let readOffset = lastIndex * stride, writeOffset = writeIndex * stride, j = 0; j !== stride; ++j) {
        values2[writeOffset + j] = values2[readOffset + j];
      }
      ++writeIndex;
    }
    if (writeIndex !== times.length) {
      this.times = AnimationUtils.arraySlice(times, 0, writeIndex);
      this.values = AnimationUtils.arraySlice(values2, 0, writeIndex * stride);
    } else {
      this.times = times;
      this.values = values2;
    }
    return this;
  }
  clone() {
    const times = AnimationUtils.arraySlice(this.times, 0);
    const values2 = AnimationUtils.arraySlice(this.values, 0);
    const TypedKeyframeTrack = this.constructor;
    const track = new TypedKeyframeTrack(this.name, times, values2);
    track.createInterpolant = this.createInterpolant;
    return track;
  }
};
KeyframeTrack.prototype.TimeBufferType = Float32Array;
KeyframeTrack.prototype.ValueBufferType = Float32Array;
KeyframeTrack.prototype.DefaultInterpolation = InterpolateLinear;
var BooleanKeyframeTrack = class extends KeyframeTrack {
};
BooleanKeyframeTrack.prototype.ValueTypeName = "bool";
BooleanKeyframeTrack.prototype.ValueBufferType = Array;
BooleanKeyframeTrack.prototype.DefaultInterpolation = InterpolateDiscrete;
BooleanKeyframeTrack.prototype.InterpolantFactoryMethodLinear = void 0;
BooleanKeyframeTrack.prototype.InterpolantFactoryMethodSmooth = void 0;
var ColorKeyframeTrack = class extends KeyframeTrack {
};
ColorKeyframeTrack.prototype.ValueTypeName = "color";
var NumberKeyframeTrack = class extends KeyframeTrack {
};
NumberKeyframeTrack.prototype.ValueTypeName = "number";
var QuaternionLinearInterpolant = class extends Interpolant {
  constructor(parameterPositions, sampleValues, sampleSize, resultBuffer) {
    super(parameterPositions, sampleValues, sampleSize, resultBuffer);
  }
  interpolate_(i1, t02, t3, t12) {
    const result = this.resultBuffer, values2 = this.sampleValues, stride = this.valueSize, alpha3 = (t3 - t02) / (t12 - t02);
    let offset = i1 * stride;
    for (let end = offset + stride; offset !== end; offset += 4) {
      Quaternion.slerpFlat(result, 0, values2, offset - stride, values2, offset, alpha3);
    }
    return result;
  }
};
var QuaternionKeyframeTrack = class extends KeyframeTrack {
  InterpolantFactoryMethodLinear(result) {
    return new QuaternionLinearInterpolant(this.times, this.values, this.getValueSize(), result);
  }
};
QuaternionKeyframeTrack.prototype.ValueTypeName = "quaternion";
QuaternionKeyframeTrack.prototype.DefaultInterpolation = InterpolateLinear;
QuaternionKeyframeTrack.prototype.InterpolantFactoryMethodSmooth = void 0;
var StringKeyframeTrack = class extends KeyframeTrack {
};
StringKeyframeTrack.prototype.ValueTypeName = "string";
StringKeyframeTrack.prototype.ValueBufferType = Array;
StringKeyframeTrack.prototype.DefaultInterpolation = InterpolateDiscrete;
StringKeyframeTrack.prototype.InterpolantFactoryMethodLinear = void 0;
StringKeyframeTrack.prototype.InterpolantFactoryMethodSmooth = void 0;
var VectorKeyframeTrack = class extends KeyframeTrack {
};
VectorKeyframeTrack.prototype.ValueTypeName = "vector";
var AnimationClip = class {
  constructor(name2, duration = -1, tracks, blendMode = NormalAnimationBlendMode) {
    this.name = name2;
    this.tracks = tracks;
    this.duration = duration;
    this.blendMode = blendMode;
    this.uuid = generateUUID();
    if (this.duration < 0) {
      this.resetDuration();
    }
  }
  static parse(json3) {
    const tracks = [], jsonTracks = json3.tracks, frameTime = 1 / (json3.fps || 1);
    for (let i2 = 0, n2 = jsonTracks.length; i2 !== n2; ++i2) {
      tracks.push(parseKeyframeTrack(jsonTracks[i2]).scale(frameTime));
    }
    const clip = new this(json3.name, json3.duration, tracks, json3.blendMode);
    clip.uuid = json3.uuid;
    return clip;
  }
  static toJSON(clip) {
    const tracks = [], clipTracks = clip.tracks;
    const json3 = {
      "name": clip.name,
      "duration": clip.duration,
      "tracks": tracks,
      "uuid": clip.uuid,
      "blendMode": clip.blendMode
    };
    for (let i2 = 0, n2 = clipTracks.length; i2 !== n2; ++i2) {
      tracks.push(KeyframeTrack.toJSON(clipTracks[i2]));
    }
    return json3;
  }
  static CreateFromMorphTargetSequence(name2, morphTargetSequence, fps, noLoop) {
    const numMorphTargets = morphTargetSequence.length;
    const tracks = [];
    for (let i2 = 0; i2 < numMorphTargets; i2++) {
      let times = [];
      let values2 = [];
      times.push(
        (i2 + numMorphTargets - 1) % numMorphTargets,
        i2,
        (i2 + 1) % numMorphTargets
      );
      values2.push(0, 1, 0);
      const order = AnimationUtils.getKeyframeOrder(times);
      times = AnimationUtils.sortedArray(times, 1, order);
      values2 = AnimationUtils.sortedArray(values2, 1, order);
      if (!noLoop && times[0] === 0) {
        times.push(numMorphTargets);
        values2.push(values2[0]);
      }
      tracks.push(
        new NumberKeyframeTrack(
          ".morphTargetInfluences[" + morphTargetSequence[i2].name + "]",
          times,
          values2
        ).scale(1 / fps)
      );
    }
    return new this(name2, -1, tracks);
  }
  static findByName(objectOrClipArray, name2) {
    let clipArray = objectOrClipArray;
    if (!Array.isArray(objectOrClipArray)) {
      const o = objectOrClipArray;
      clipArray = o.geometry && o.geometry.animations || o.animations;
    }
    for (let i2 = 0; i2 < clipArray.length; i2++) {
      if (clipArray[i2].name === name2) {
        return clipArray[i2];
      }
    }
    return null;
  }
  static CreateClipsFromMorphTargetSequences(morphTargets, fps, noLoop) {
    const animationToMorphTargets = {};
    const pattern = /^([\w-]*?)([\d]+)$/;
    for (let i2 = 0, il = morphTargets.length; i2 < il; i2++) {
      const morphTarget = morphTargets[i2];
      const parts = morphTarget.name.match(pattern);
      if (parts && parts.length > 1) {
        const name2 = parts[1];
        let animationMorphTargets = animationToMorphTargets[name2];
        if (!animationMorphTargets) {
          animationToMorphTargets[name2] = animationMorphTargets = [];
        }
        animationMorphTargets.push(morphTarget);
      }
    }
    const clips = [];
    for (const name2 in animationToMorphTargets) {
      clips.push(this.CreateFromMorphTargetSequence(name2, animationToMorphTargets[name2], fps, noLoop));
    }
    return clips;
  }
  // parse the animation.hierarchy format
  static parseAnimation(animation, bones) {
    if (!animation) {
      console.error("THREE.AnimationClip: No animation in JSONLoader data.");
      return null;
    }
    const addNonemptyTrack = function(trackType, trackName, animationKeys, propertyName2, destTracks) {
      if (animationKeys.length !== 0) {
        const times = [];
        const values2 = [];
        AnimationUtils.flattenJSON(animationKeys, times, values2, propertyName2);
        if (times.length !== 0) {
          destTracks.push(new trackType(trackName, times, values2));
        }
      }
    };
    const tracks = [];
    const clipName = animation.name || "default";
    const fps = animation.fps || 30;
    const blendMode = animation.blendMode;
    let duration = animation.length || -1;
    const hierarchyTracks = animation.hierarchy || [];
    for (let h = 0; h < hierarchyTracks.length; h++) {
      const animationKeys = hierarchyTracks[h].keys;
      if (!animationKeys || animationKeys.length === 0)
        continue;
      if (animationKeys[0].morphTargets) {
        const morphTargetNames = {};
        let k2;
        for (k2 = 0; k2 < animationKeys.length; k2++) {
          if (animationKeys[k2].morphTargets) {
            for (let m = 0; m < animationKeys[k2].morphTargets.length; m++) {
              morphTargetNames[animationKeys[k2].morphTargets[m]] = -1;
            }
          }
        }
        for (const morphTargetName in morphTargetNames) {
          const times = [];
          const values2 = [];
          for (let m = 0; m !== animationKeys[k2].morphTargets.length; ++m) {
            const animationKey = animationKeys[k2];
            times.push(animationKey.time);
            values2.push(animationKey.morphTarget === morphTargetName ? 1 : 0);
          }
          tracks.push(new NumberKeyframeTrack(".morphTargetInfluence[" + morphTargetName + "]", times, values2));
        }
        duration = morphTargetNames.length * fps;
      } else {
        const boneName = ".bones[" + bones[h].name + "]";
        addNonemptyTrack(
          VectorKeyframeTrack,
          boneName + ".position",
          animationKeys,
          "pos",
          tracks
        );
        addNonemptyTrack(
          QuaternionKeyframeTrack,
          boneName + ".quaternion",
          animationKeys,
          "rot",
          tracks
        );
        addNonemptyTrack(
          VectorKeyframeTrack,
          boneName + ".scale",
          animationKeys,
          "scl",
          tracks
        );
      }
    }
    if (tracks.length === 0) {
      return null;
    }
    const clip = new this(clipName, duration, tracks, blendMode);
    return clip;
  }
  resetDuration() {
    const tracks = this.tracks;
    let duration = 0;
    for (let i2 = 0, n2 = tracks.length; i2 !== n2; ++i2) {
      const track = this.tracks[i2];
      duration = Math.max(duration, track.times[track.times.length - 1]);
    }
    this.duration = duration;
    return this;
  }
  trim() {
    for (let i2 = 0; i2 < this.tracks.length; i2++) {
      this.tracks[i2].trim(0, this.duration);
    }
    return this;
  }
  validate() {
    let valid = true;
    for (let i2 = 0; i2 < this.tracks.length; i2++) {
      valid = valid && this.tracks[i2].validate();
    }
    return valid;
  }
  optimize() {
    for (let i2 = 0; i2 < this.tracks.length; i2++) {
      this.tracks[i2].optimize();
    }
    return this;
  }
  clone() {
    const tracks = [];
    for (let i2 = 0; i2 < this.tracks.length; i2++) {
      tracks.push(this.tracks[i2].clone());
    }
    return new this.constructor(this.name, this.duration, tracks, this.blendMode);
  }
  toJSON() {
    return this.constructor.toJSON(this);
  }
};
function getTrackTypeForValueTypeName(typeName2) {
  switch (typeName2.toLowerCase()) {
    case "scalar":
    case "double":
    case "float":
    case "number":
    case "integer":
      return NumberKeyframeTrack;
    case "vector":
    case "vector2":
    case "vector3":
    case "vector4":
      return VectorKeyframeTrack;
    case "color":
      return ColorKeyframeTrack;
    case "quaternion":
      return QuaternionKeyframeTrack;
    case "bool":
    case "boolean":
      return BooleanKeyframeTrack;
    case "string":
      return StringKeyframeTrack;
  }
  throw new Error("THREE.KeyframeTrack: Unsupported typeName: " + typeName2);
}
function parseKeyframeTrack(json3) {
  if (json3.type === void 0) {
    throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");
  }
  const trackType = getTrackTypeForValueTypeName(json3.type);
  if (json3.times === void 0) {
    const times = [], values2 = [];
    AnimationUtils.flattenJSON(json3.keys, times, values2, "value");
    json3.times = times;
    json3.values = values2;
  }
  if (trackType.parse !== void 0) {
    return trackType.parse(json3);
  } else {
    return new trackType(json3.name, json3.times, json3.values, json3.interpolation);
  }
}
var Cache = {
  enabled: false,
  files: {},
  add: function(key, file) {
    if (this.enabled === false)
      return;
    this.files[key] = file;
  },
  get: function(key) {
    if (this.enabled === false)
      return;
    return this.files[key];
  },
  remove: function(key) {
    delete this.files[key];
  },
  clear: function() {
    this.files = {};
  }
};
var LoadingManager = class {
  constructor(onLoad, onProgress, onError) {
    const scope = this;
    let isLoading = false;
    let itemsLoaded = 0;
    let itemsTotal = 0;
    let urlModifier = void 0;
    const handlers2 = [];
    this.onStart = void 0;
    this.onLoad = onLoad;
    this.onProgress = onProgress;
    this.onError = onError;
    this.itemStart = function(url) {
      itemsTotal++;
      if (isLoading === false) {
        if (scope.onStart !== void 0) {
          scope.onStart(url, itemsLoaded, itemsTotal);
        }
      }
      isLoading = true;
    };
    this.itemEnd = function(url) {
      itemsLoaded++;
      if (scope.onProgress !== void 0) {
        scope.onProgress(url, itemsLoaded, itemsTotal);
      }
      if (itemsLoaded === itemsTotal) {
        isLoading = false;
        if (scope.onLoad !== void 0) {
          scope.onLoad();
        }
      }
    };
    this.itemError = function(url) {
      if (scope.onError !== void 0) {
        scope.onError(url);
      }
    };
    this.resolveURL = function(url) {
      if (urlModifier) {
        return urlModifier(url);
      }
      return url;
    };
    this.setURLModifier = function(transform) {
      urlModifier = transform;
      return this;
    };
    this.addHandler = function(regex, loader) {
      handlers2.push(regex, loader);
      return this;
    };
    this.removeHandler = function(regex) {
      const index = handlers2.indexOf(regex);
      if (index !== -1) {
        handlers2.splice(index, 2);
      }
      return this;
    };
    this.getHandler = function(file) {
      for (let i2 = 0, l = handlers2.length; i2 < l; i2 += 2) {
        const regex = handlers2[i2];
        const loader = handlers2[i2 + 1];
        if (regex.global)
          regex.lastIndex = 0;
        if (regex.test(file)) {
          return loader;
        }
      }
      return null;
    };
  }
};
var DefaultLoadingManager = new LoadingManager();
var Loader = class {
  constructor(manager) {
    this.manager = manager !== void 0 ? manager : DefaultLoadingManager;
    this.crossOrigin = "anonymous";
    this.withCredentials = false;
    this.path = "";
    this.resourcePath = "";
    this.requestHeader = {};
  }
  load() {
  }
  loadAsync(url, onProgress) {
    const scope = this;
    return new Promise(function(resolve2, reject) {
      scope.load(url, resolve2, onProgress, reject);
    });
  }
  parse() {
  }
  setCrossOrigin(crossOrigin) {
    this.crossOrigin = crossOrigin;
    return this;
  }
  setWithCredentials(value) {
    this.withCredentials = value;
    return this;
  }
  setPath(path2) {
    this.path = path2;
    return this;
  }
  setResourcePath(resourcePath) {
    this.resourcePath = resourcePath;
    return this;
  }
  setRequestHeader(requestHeader) {
    this.requestHeader = requestHeader;
    return this;
  }
};
var loading = {};
var FileLoader = class extends Loader {
  constructor(manager) {
    super(manager);
  }
  load(url, onLoad, onProgress, onError) {
    if (url === void 0)
      url = "";
    if (this.path !== void 0)
      url = this.path + url;
    url = this.manager.resolveURL(url);
    const cached = Cache.get(url);
    if (cached !== void 0) {
      this.manager.itemStart(url);
      setTimeout(() => {
        if (onLoad)
          onLoad(cached);
        this.manager.itemEnd(url);
      }, 0);
      return cached;
    }
    if (loading[url] !== void 0) {
      loading[url].push({
        onLoad,
        onProgress,
        onError
      });
      return;
    }
    loading[url] = [];
    loading[url].push({
      onLoad,
      onProgress,
      onError
    });
    const req = new Request(url, {
      headers: new Headers(this.requestHeader),
      credentials: this.withCredentials ? "include" : "same-origin"
      // An abort controller could be added within a future PR
    });
    const mimeType = this.mimeType;
    const responseType = this.responseType;
    fetch(req).then((response) => {
      if (response.status === 200 || response.status === 0) {
        if (response.status === 0) {
          console.warn("THREE.FileLoader: HTTP Status 0 received.");
        }
        if (typeof ReadableStream === "undefined" || response.body === void 0 || response.body.getReader === void 0) {
          return response;
        }
        const callbacks = loading[url];
        const reader = response.body.getReader();
        const contentLength = response.headers.get("Content-Length");
        const total = contentLength ? parseInt(contentLength) : 0;
        const lengthComputable = total !== 0;
        let loaded = 0;
        const stream = new ReadableStream({
          start(controller) {
            readData();
            function readData() {
              reader.read().then(({ done, value }) => {
                if (done) {
                  controller.close();
                } else {
                  loaded += value.byteLength;
                  const event = new ProgressEvent("progress", { lengthComputable, loaded, total });
                  for (let i2 = 0, il = callbacks.length; i2 < il; i2++) {
                    const callback = callbacks[i2];
                    if (callback.onProgress)
                      callback.onProgress(event);
                  }
                  controller.enqueue(value);
                  readData();
                }
              });
            }
          }
        });
        return new Response(stream);
      } else {
        throw Error(`fetch for "${response.url}" responded with ${response.status}: ${response.statusText}`);
      }
    }).then((response) => {
      switch (responseType) {
        case "arraybuffer":
          return response.arrayBuffer();
        case "blob":
          return response.blob();
        case "document":
          return response.text().then((text2) => {
            const parser3 = new DOMParser();
            return parser3.parseFromString(text2, mimeType);
          });
        case "json":
          return response.json();
        default:
          if (mimeType === void 0) {
            return response.text();
          } else {
            const re2 = /charset="?([^;"\s]*)"?/i;
            const exec = re2.exec(mimeType);
            const label = exec && exec[1] ? exec[1].toLowerCase() : void 0;
            const decoder = new TextDecoder(label);
            return response.arrayBuffer().then((ab) => decoder.decode(ab));
          }
      }
    }).then((data) => {
      Cache.add(url, data);
      const callbacks = loading[url];
      delete loading[url];
      for (let i2 = 0, il = callbacks.length; i2 < il; i2++) {
        const callback = callbacks[i2];
        if (callback.onLoad)
          callback.onLoad(data);
      }
    }).catch((err) => {
      const callbacks = loading[url];
      if (callbacks === void 0) {
        this.manager.itemError(url);
        throw err;
      }
      delete loading[url];
      for (let i2 = 0, il = callbacks.length; i2 < il; i2++) {
        const callback = callbacks[i2];
        if (callback.onError)
          callback.onError(err);
      }
      this.manager.itemError(url);
    }).finally(() => {
      this.manager.itemEnd(url);
    });
    this.manager.itemStart(url);
  }
  setResponseType(value) {
    this.responseType = value;
    return this;
  }
  setMimeType(value) {
    this.mimeType = value;
    return this;
  }
};
var AnimationLoader = class extends Loader {
  constructor(manager) {
    super(manager);
  }
  load(url, onLoad, onProgress, onError) {
    const scope = this;
    const loader = new FileLoader(this.manager);
    loader.setPath(this.path);
    loader.setRequestHeader(this.requestHeader);
    loader.setWithCredentials(this.withCredentials);
    loader.load(url, function(text2) {
      try {
        onLoad(scope.parse(JSON.parse(text2)));
      } catch (e3) {
        if (onError) {
          onError(e3);
        } else {
          console.error(e3);
        }
        scope.manager.itemError(url);
      }
    }, onProgress, onError);
  }
  parse(json3) {
    const animations = [];
    for (let i2 = 0; i2 < json3.length; i2++) {
      const clip = AnimationClip.parse(json3[i2]);
      animations.push(clip);
    }
    return animations;
  }
};
var CompressedTextureLoader = class extends Loader {
  constructor(manager) {
    super(manager);
  }
  load(url, onLoad, onProgress, onError) {
    const scope = this;
    const images = [];
    const texture = new CompressedTexture();
    const loader = new FileLoader(this.manager);
    loader.setPath(this.path);
    loader.setResponseType("arraybuffer");
    loader.setRequestHeader(this.requestHeader);
    loader.setWithCredentials(scope.withCredentials);
    let loaded = 0;
    function loadTexture(i2) {
      loader.load(url[i2], function(buffer) {
        const texDatas = scope.parse(buffer, true);
        images[i2] = {
          width: texDatas.width,
          height: texDatas.height,
          format: texDatas.format,
          mipmaps: texDatas.mipmaps
        };
        loaded += 1;
        if (loaded === 6) {
          if (texDatas.mipmapCount === 1)
            texture.minFilter = LinearFilter;
          texture.image = images;
          texture.format = texDatas.format;
          texture.needsUpdate = true;
          if (onLoad)
            onLoad(texture);
        }
      }, onProgress, onError);
    }
    if (Array.isArray(url)) {
      for (let i2 = 0, il = url.length; i2 < il; ++i2) {
        loadTexture(i2);
      }
    } else {
      loader.load(url, function(buffer) {
        const texDatas = scope.parse(buffer, true);
        if (texDatas.isCubemap) {
          const faces = texDatas.mipmaps.length / texDatas.mipmapCount;
          for (let f = 0; f < faces; f++) {
            images[f] = { mipmaps: [] };
            for (let i2 = 0; i2 < texDatas.mipmapCount; i2++) {
              images[f].mipmaps.push(texDatas.mipmaps[f * texDatas.mipmapCount + i2]);
              images[f].format = texDatas.format;
              images[f].width = texDatas.width;
              images[f].height = texDatas.height;
            }
          }
          texture.image = images;
        } else {
          texture.image.width = texDatas.width;
          texture.image.height = texDatas.height;
          texture.mipmaps = texDatas.mipmaps;
        }
        if (texDatas.mipmapCount === 1) {
          texture.minFilter = LinearFilter;
        }
        texture.format = texDatas.format;
        texture.needsUpdate = true;
        if (onLoad)
          onLoad(texture);
      }, onProgress, onError);
    }
    return texture;
  }
};
var ImageLoader = class extends Loader {
  constructor(manager) {
    super(manager);
  }
  load(url, onLoad, onProgress, onError) {
    if (this.path !== void 0)
      url = this.path + url;
    url = this.manager.resolveURL(url);
    const scope = this;
    const cached = Cache.get(url);
    if (cached !== void 0) {
      scope.manager.itemStart(url);
      setTimeout(function() {
        if (onLoad)
          onLoad(cached);
        scope.manager.itemEnd(url);
      }, 0);
      return cached;
    }
    const image = createElementNS("img");
    function onImageLoad() {
      removeEventListeners();
      Cache.add(url, this);
      if (onLoad)
        onLoad(this);
      scope.manager.itemEnd(url);
    }
    function onImageError(event) {
      removeEventListeners();
      if (onError)
        onError(event);
      scope.manager.itemError(url);
      scope.manager.itemEnd(url);
    }
    function removeEventListeners() {
      image.removeEventListener("load", onImageLoad, false);
      image.removeEventListener("error", onImageError, false);
    }
    image.addEventListener("load", onImageLoad, false);
    image.addEventListener("error", onImageError, false);
    if (url.slice(0, 5) !== "data:") {
      if (this.crossOrigin !== void 0)
        image.crossOrigin = this.crossOrigin;
    }
    scope.manager.itemStart(url);
    image.src = url;
    return image;
  }
};
var CubeTextureLoader = class extends Loader {
  constructor(manager) {
    super(manager);
  }
  load(urls, onLoad, onProgress, onError) {
    const texture = new CubeTexture();
    const loader = new ImageLoader(this.manager);
    loader.setCrossOrigin(this.crossOrigin);
    loader.setPath(this.path);
    let loaded = 0;
    function loadTexture(i2) {
      loader.load(urls[i2], function(image) {
        texture.images[i2] = image;
        loaded++;
        if (loaded === 6) {
          texture.needsUpdate = true;
          if (onLoad)
            onLoad(texture);
        }
      }, void 0, onError);
    }
    for (let i2 = 0; i2 < urls.length; ++i2) {
      loadTexture(i2);
    }
    return texture;
  }
};
var DataTextureLoader = class extends Loader {
  constructor(manager) {
    super(manager);
  }
  load(url, onLoad, onProgress, onError) {
    const scope = this;
    const texture = new DataTexture();
    const loader = new FileLoader(this.manager);
    loader.setResponseType("arraybuffer");
    loader.setRequestHeader(this.requestHeader);
    loader.setPath(this.path);
    loader.setWithCredentials(scope.withCredentials);
    loader.load(url, function(buffer) {
      const texData = scope.parse(buffer);
      if (!texData)
        return;
      if (texData.image !== void 0) {
        texture.image = texData.image;
      } else if (texData.data !== void 0) {
        texture.image.width = texData.width;
        texture.image.height = texData.height;
        texture.image.data = texData.data;
      }
      texture.wrapS = texData.wrapS !== void 0 ? texData.wrapS : ClampToEdgeWrapping;
      texture.wrapT = texData.wrapT !== void 0 ? texData.wrapT : ClampToEdgeWrapping;
      texture.magFilter = texData.magFilter !== void 0 ? texData.magFilter : LinearFilter;
      texture.minFilter = texData.minFilter !== void 0 ? texData.minFilter : LinearFilter;
      texture.anisotropy = texData.anisotropy !== void 0 ? texData.anisotropy : 1;
      if (texData.encoding !== void 0) {
        texture.encoding = texData.encoding;
      }
      if (texData.flipY !== void 0) {
        texture.flipY = texData.flipY;
      }
      if (texData.format !== void 0) {
        texture.format = texData.format;
      }
      if (texData.type !== void 0) {
        texture.type = texData.type;
      }
      if (texData.mipmaps !== void 0) {
        texture.mipmaps = texData.mipmaps;
        texture.minFilter = LinearMipmapLinearFilter;
      }
      if (texData.mipmapCount === 1) {
        texture.minFilter = LinearFilter;
      }
      if (texData.generateMipmaps !== void 0) {
        texture.generateMipmaps = texData.generateMipmaps;
      }
      texture.needsUpdate = true;
      if (onLoad)
        onLoad(texture, texData);
    }, onProgress, onError);
    return texture;
  }
};
var TextureLoader = class extends Loader {
  constructor(manager) {
    super(manager);
  }
  load(url, onLoad, onProgress, onError) {
    const texture = new Texture();
    const loader = new ImageLoader(this.manager);
    loader.setCrossOrigin(this.crossOrigin);
    loader.setPath(this.path);
    loader.load(url, function(image) {
      texture.image = image;
      texture.needsUpdate = true;
      if (onLoad !== void 0) {
        onLoad(texture);
      }
    }, onProgress, onError);
    return texture;
  }
};
var Light = class extends Object3D {
  constructor(color2, intensity = 1) {
    super();
    this.type = "Light";
    this.color = new Color2(color2);
    this.intensity = intensity;
  }
  dispose() {
  }
  copy(source) {
    super.copy(source);
    this.color.copy(source.color);
    this.intensity = source.intensity;
    return this;
  }
  toJSON(meta2) {
    const data = super.toJSON(meta2);
    data.object.color = this.color.getHex();
    data.object.intensity = this.intensity;
    if (this.groundColor !== void 0)
      data.object.groundColor = this.groundColor.getHex();
    if (this.distance !== void 0)
      data.object.distance = this.distance;
    if (this.angle !== void 0)
      data.object.angle = this.angle;
    if (this.decay !== void 0)
      data.object.decay = this.decay;
    if (this.penumbra !== void 0)
      data.object.penumbra = this.penumbra;
    if (this.shadow !== void 0)
      data.object.shadow = this.shadow.toJSON();
    return data;
  }
};
Light.prototype.isLight = true;
var HemisphereLight = class extends Light {
  constructor(skyColor, groundColor, intensity) {
    super(skyColor, intensity);
    this.type = "HemisphereLight";
    this.position.copy(Object3D.DefaultUp);
    this.updateMatrix();
    this.groundColor = new Color2(groundColor);
  }
  copy(source) {
    Light.prototype.copy.call(this, source);
    this.groundColor.copy(source.groundColor);
    return this;
  }
};
HemisphereLight.prototype.isHemisphereLight = true;
var _projScreenMatrix$1 = /* @__PURE__ */ new Matrix4();
var _lightPositionWorld$1 = /* @__PURE__ */ new Vector3();
var _lookTarget$1 = /* @__PURE__ */ new Vector3();
var LightShadow = class {
  constructor(camera) {
    this.camera = camera;
    this.bias = 0;
    this.normalBias = 0;
    this.radius = 1;
    this.blurSamples = 8;
    this.mapSize = new Vector2(512, 512);
    this.map = null;
    this.mapPass = null;
    this.matrix = new Matrix4();
    this.autoUpdate = true;
    this.needsUpdate = false;
    this._frustum = new Frustum();
    this._frameExtents = new Vector2(1, 1);
    this._viewportCount = 1;
    this._viewports = [
      new Vector4(0, 0, 1, 1)
    ];
  }
  getViewportCount() {
    return this._viewportCount;
  }
  getFrustum() {
    return this._frustum;
  }
  updateMatrices(light) {
    const shadowCamera = this.camera;
    const shadowMatrix = this.matrix;
    _lightPositionWorld$1.setFromMatrixPosition(light.matrixWorld);
    shadowCamera.position.copy(_lightPositionWorld$1);
    _lookTarget$1.setFromMatrixPosition(light.target.matrixWorld);
    shadowCamera.lookAt(_lookTarget$1);
    shadowCamera.updateMatrixWorld();
    _projScreenMatrix$1.multiplyMatrices(shadowCamera.projectionMatrix, shadowCamera.matrixWorldInverse);
    this._frustum.setFromProjectionMatrix(_projScreenMatrix$1);
    shadowMatrix.set(
      0.5,
      0,
      0,
      0.5,
      0,
      0.5,
      0,
      0.5,
      0,
      0,
      0.5,
      0.5,
      0,
      0,
      0,
      1
    );
    shadowMatrix.multiply(shadowCamera.projectionMatrix);
    shadowMatrix.multiply(shadowCamera.matrixWorldInverse);
  }
  getViewport(viewportIndex) {
    return this._viewports[viewportIndex];
  }
  getFrameExtents() {
    return this._frameExtents;
  }
  dispose() {
    if (this.map) {
      this.map.dispose();
    }
    if (this.mapPass) {
      this.mapPass.dispose();
    }
  }
  copy(source) {
    this.camera = source.camera.clone();
    this.bias = source.bias;
    this.radius = source.radius;
    this.mapSize.copy(source.mapSize);
    return this;
  }
  clone() {
    return new this.constructor().copy(this);
  }
  toJSON() {
    const object = {};
    if (this.bias !== 0)
      object.bias = this.bias;
    if (this.normalBias !== 0)
      object.normalBias = this.normalBias;
    if (this.radius !== 1)
      object.radius = this.radius;
    if (this.mapSize.x !== 512 || this.mapSize.y !== 512)
      object.mapSize = this.mapSize.toArray();
    object.camera = this.camera.toJSON(false).object;
    delete object.camera.matrix;
    return object;
  }
};
var SpotLightShadow = class extends LightShadow {
  constructor() {
    super(new PerspectiveCamera(50, 1, 0.5, 500));
    this.focus = 1;
  }
  updateMatrices(light) {
    const camera = this.camera;
    const fov2 = RAD2DEG * 2 * light.angle * this.focus;
    const aspect2 = this.mapSize.width / this.mapSize.height;
    const far = light.distance || camera.far;
    if (fov2 !== camera.fov || aspect2 !== camera.aspect || far !== camera.far) {
      camera.fov = fov2;
      camera.aspect = aspect2;
      camera.far = far;
      camera.updateProjectionMatrix();
    }
    super.updateMatrices(light);
  }
  copy(source) {
    super.copy(source);
    this.focus = source.focus;
    return this;
  }
};
SpotLightShadow.prototype.isSpotLightShadow = true;
var SpotLight = class extends Light {
  constructor(color2, intensity, distance = 0, angle = Math.PI / 3, penumbra = 0, decay = 1) {
    super(color2, intensity);
    this.type = "SpotLight";
    this.position.copy(Object3D.DefaultUp);
    this.updateMatrix();
    this.target = new Object3D();
    this.distance = distance;
    this.angle = angle;
    this.penumbra = penumbra;
    this.decay = decay;
    this.shadow = new SpotLightShadow();
  }
  get power() {
    return this.intensity * Math.PI;
  }
  set power(power) {
    this.intensity = power / Math.PI;
  }
  dispose() {
    this.shadow.dispose();
  }
  copy(source) {
    super.copy(source);
    this.distance = source.distance;
    this.angle = source.angle;
    this.penumbra = source.penumbra;
    this.decay = source.decay;
    this.target = source.target.clone();
    this.shadow = source.shadow.clone();
    return this;
  }
};
SpotLight.prototype.isSpotLight = true;
var _projScreenMatrix = /* @__PURE__ */ new Matrix4();
var _lightPositionWorld = /* @__PURE__ */ new Vector3();
var _lookTarget = /* @__PURE__ */ new Vector3();
var PointLightShadow = class extends LightShadow {
  constructor() {
    super(new PerspectiveCamera(90, 1, 0.5, 500));
    this._frameExtents = new Vector2(4, 2);
    this._viewportCount = 6;
    this._viewports = [
      // These viewports map a cube-map onto a 2D texture with the
      // following orientation:
      //
      //  xzXZ
      //   y Y
      //
      // X - Positive x direction
      // x - Negative x direction
      // Y - Positive y direction
      // y - Negative y direction
      // Z - Positive z direction
      // z - Negative z direction
      // positive X
      new Vector4(2, 1, 1, 1),
      // negative X
      new Vector4(0, 1, 1, 1),
      // positive Z
      new Vector4(3, 1, 1, 1),
      // negative Z
      new Vector4(1, 1, 1, 1),
      // positive Y
      new Vector4(3, 0, 1, 1),
      // negative Y
      new Vector4(1, 0, 1, 1)
    ];
    this._cubeDirections = [
      new Vector3(1, 0, 0),
      new Vector3(-1, 0, 0),
      new Vector3(0, 0, 1),
      new Vector3(0, 0, -1),
      new Vector3(0, 1, 0),
      new Vector3(0, -1, 0)
    ];
    this._cubeUps = [
      new Vector3(0, 1, 0),
      new Vector3(0, 1, 0),
      new Vector3(0, 1, 0),
      new Vector3(0, 1, 0),
      new Vector3(0, 0, 1),
      new Vector3(0, 0, -1)
    ];
  }
  updateMatrices(light, viewportIndex = 0) {
    const camera = this.camera;
    const shadowMatrix = this.matrix;
    const far = light.distance || camera.far;
    if (far !== camera.far) {
      camera.far = far;
      camera.updateProjectionMatrix();
    }
    _lightPositionWorld.setFromMatrixPosition(light.matrixWorld);
    camera.position.copy(_lightPositionWorld);
    _lookTarget.copy(camera.position);
    _lookTarget.add(this._cubeDirections[viewportIndex]);
    camera.up.copy(this._cubeUps[viewportIndex]);
    camera.lookAt(_lookTarget);
    camera.updateMatrixWorld();
    shadowMatrix.makeTranslation(-_lightPositionWorld.x, -_lightPositionWorld.y, -_lightPositionWorld.z);
    _projScreenMatrix.multiplyMatrices(camera.projectionMatrix, camera.matrixWorldInverse);
    this._frustum.setFromProjectionMatrix(_projScreenMatrix);
  }
};
PointLightShadow.prototype.isPointLightShadow = true;
var PointLight = class extends Light {
  constructor(color2, intensity, distance = 0, decay = 1) {
    super(color2, intensity);
    this.type = "PointLight";
    this.distance = distance;
    this.decay = decay;
    this.shadow = new PointLightShadow();
  }
  get power() {
    return this.intensity * 4 * Math.PI;
  }
  set power(power) {
    this.intensity = power / (4 * Math.PI);
  }
  dispose() {
    this.shadow.dispose();
  }
  copy(source) {
    super.copy(source);
    this.distance = source.distance;
    this.decay = source.decay;
    this.shadow = source.shadow.clone();
    return this;
  }
};
PointLight.prototype.isPointLight = true;
var DirectionalLightShadow = class extends LightShadow {
  constructor() {
    super(new OrthographicCamera(-5, 5, 5, -5, 0.5, 500));
  }
};
DirectionalLightShadow.prototype.isDirectionalLightShadow = true;
var DirectionalLight = class extends Light {
  constructor(color2, intensity) {
    super(color2, intensity);
    this.type = "DirectionalLight";
    this.position.copy(Object3D.DefaultUp);
    this.updateMatrix();
    this.target = new Object3D();
    this.shadow = new DirectionalLightShadow();
  }
  dispose() {
    this.shadow.dispose();
  }
  copy(source) {
    super.copy(source);
    this.target = source.target.clone();
    this.shadow = source.shadow.clone();
    return this;
  }
};
DirectionalLight.prototype.isDirectionalLight = true;
var AmbientLight = class extends Light {
  constructor(color2, intensity) {
    super(color2, intensity);
    this.type = "AmbientLight";
  }
};
AmbientLight.prototype.isAmbientLight = true;
var RectAreaLight = class extends Light {
  constructor(color2, intensity, width = 10, height = 10) {
    super(color2, intensity);
    this.type = "RectAreaLight";
    this.width = width;
    this.height = height;
  }
  get power() {
    return this.intensity * this.width * this.height * Math.PI;
  }
  set power(power) {
    this.intensity = power / (this.width * this.height * Math.PI);
  }
  copy(source) {
    super.copy(source);
    this.width = source.width;
    this.height = source.height;
    return this;
  }
  toJSON(meta2) {
    const data = super.toJSON(meta2);
    data.object.width = this.width;
    data.object.height = this.height;
    return data;
  }
};
RectAreaLight.prototype.isRectAreaLight = true;
var SphericalHarmonics3 = class {
  constructor() {
    this.coefficients = [];
    for (let i2 = 0; i2 < 9; i2++) {
      this.coefficients.push(new Vector3());
    }
  }
  set(coefficients) {
    for (let i2 = 0; i2 < 9; i2++) {
      this.coefficients[i2].copy(coefficients[i2]);
    }
    return this;
  }
  zero() {
    for (let i2 = 0; i2 < 9; i2++) {
      this.coefficients[i2].set(0, 0, 0);
    }
    return this;
  }
  // get the radiance in the direction of the normal
  // target is a Vector3
  getAt(normal, target) {
    const x2 = normal.x, y2 = normal.y, z = normal.z;
    const coeff = this.coefficients;
    target.copy(coeff[0]).multiplyScalar(0.282095);
    target.addScaledVector(coeff[1], 0.488603 * y2);
    target.addScaledVector(coeff[2], 0.488603 * z);
    target.addScaledVector(coeff[3], 0.488603 * x2);
    target.addScaledVector(coeff[4], 1.092548 * (x2 * y2));
    target.addScaledVector(coeff[5], 1.092548 * (y2 * z));
    target.addScaledVector(coeff[6], 0.315392 * (3 * z * z - 1));
    target.addScaledVector(coeff[7], 1.092548 * (x2 * z));
    target.addScaledVector(coeff[8], 0.546274 * (x2 * x2 - y2 * y2));
    return target;
  }
  // get the irradiance (radiance convolved with cosine lobe) in the direction of the normal
  // target is a Vector3
  // https://graphics.stanford.edu/papers/envmap/envmap.pdf
  getIrradianceAt(normal, target) {
    const x2 = normal.x, y2 = normal.y, z = normal.z;
    const coeff = this.coefficients;
    target.copy(coeff[0]).multiplyScalar(0.886227);
    target.addScaledVector(coeff[1], 2 * 0.511664 * y2);
    target.addScaledVector(coeff[2], 2 * 0.511664 * z);
    target.addScaledVector(coeff[3], 2 * 0.511664 * x2);
    target.addScaledVector(coeff[4], 2 * 0.429043 * x2 * y2);
    target.addScaledVector(coeff[5], 2 * 0.429043 * y2 * z);
    target.addScaledVector(coeff[6], 0.743125 * z * z - 0.247708);
    target.addScaledVector(coeff[7], 2 * 0.429043 * x2 * z);
    target.addScaledVector(coeff[8], 0.429043 * (x2 * x2 - y2 * y2));
    return target;
  }
  add(sh) {
    for (let i2 = 0; i2 < 9; i2++) {
      this.coefficients[i2].add(sh.coefficients[i2]);
    }
    return this;
  }
  addScaledSH(sh, s2) {
    for (let i2 = 0; i2 < 9; i2++) {
      this.coefficients[i2].addScaledVector(sh.coefficients[i2], s2);
    }
    return this;
  }
  scale(s2) {
    for (let i2 = 0; i2 < 9; i2++) {
      this.coefficients[i2].multiplyScalar(s2);
    }
    return this;
  }
  lerp(sh, alpha3) {
    for (let i2 = 0; i2 < 9; i2++) {
      this.coefficients[i2].lerp(sh.coefficients[i2], alpha3);
    }
    return this;
  }
  equals(sh) {
    for (let i2 = 0; i2 < 9; i2++) {
      if (!this.coefficients[i2].equals(sh.coefficients[i2])) {
        return false;
      }
    }
    return true;
  }
  copy(sh) {
    return this.set(sh.coefficients);
  }
  clone() {
    return new this.constructor().copy(this);
  }
  fromArray(array, offset = 0) {
    const coefficients = this.coefficients;
    for (let i2 = 0; i2 < 9; i2++) {
      coefficients[i2].fromArray(array, offset + i2 * 3);
    }
    return this;
  }
  toArray(array = [], offset = 0) {
    const coefficients = this.coefficients;
    for (let i2 = 0; i2 < 9; i2++) {
      coefficients[i2].toArray(array, offset + i2 * 3);
    }
    return array;
  }
  // evaluate the basis functions
  // shBasis is an Array[ 9 ]
  static getBasisAt(normal, shBasis) {
    const x2 = normal.x, y2 = normal.y, z = normal.z;
    shBasis[0] = 0.282095;
    shBasis[1] = 0.488603 * y2;
    shBasis[2] = 0.488603 * z;
    shBasis[3] = 0.488603 * x2;
    shBasis[4] = 1.092548 * x2 * y2;
    shBasis[5] = 1.092548 * y2 * z;
    shBasis[6] = 0.315392 * (3 * z * z - 1);
    shBasis[7] = 1.092548 * x2 * z;
    shBasis[8] = 0.546274 * (x2 * x2 - y2 * y2);
  }
};
SphericalHarmonics3.prototype.isSphericalHarmonics3 = true;
var LightProbe = class extends Light {
  constructor(sh = new SphericalHarmonics3(), intensity = 1) {
    super(void 0, intensity);
    this.sh = sh;
  }
  copy(source) {
    super.copy(source);
    this.sh.copy(source.sh);
    return this;
  }
  fromJSON(json3) {
    this.intensity = json3.intensity;
    this.sh.fromArray(json3.sh);
    return this;
  }
  toJSON(meta2) {
    const data = super.toJSON(meta2);
    data.object.sh = this.sh.toArray();
    return data;
  }
};
LightProbe.prototype.isLightProbe = true;
var MaterialLoader = class extends Loader {
  constructor(manager) {
    super(manager);
    this.textures = {};
  }
  load(url, onLoad, onProgress, onError) {
    const scope = this;
    const loader = new FileLoader(scope.manager);
    loader.setPath(scope.path);
    loader.setRequestHeader(scope.requestHeader);
    loader.setWithCredentials(scope.withCredentials);
    loader.load(url, function(text2) {
      try {
        onLoad(scope.parse(JSON.parse(text2)));
      } catch (e3) {
        if (onError) {
          onError(e3);
        } else {
          console.error(e3);
        }
        scope.manager.itemError(url);
      }
    }, onProgress, onError);
  }
  parse(json3) {
    const textures = this.textures;
    function getTexture(name2) {
      if (textures[name2] === void 0) {
        console.warn("THREE.MaterialLoader: Undefined texture", name2);
      }
      return textures[name2];
    }
    const material = Material.fromType(json3.type);
    if (json3.uuid !== void 0)
      material.uuid = json3.uuid;
    if (json3.name !== void 0)
      material.name = json3.name;
    if (json3.color !== void 0 && material.color !== void 0)
      material.color.setHex(json3.color);
    if (json3.roughness !== void 0)
      material.roughness = json3.roughness;
    if (json3.metalness !== void 0)
      material.metalness = json3.metalness;
    if (json3.sheen !== void 0)
      material.sheen = json3.sheen;
    if (json3.sheenColor !== void 0)
      material.sheenColor = new Color2().setHex(json3.sheenColor);
    if (json3.sheenRoughness !== void 0)
      material.sheenRoughness = json3.sheenRoughness;
    if (json3.emissive !== void 0 && material.emissive !== void 0)
      material.emissive.setHex(json3.emissive);
    if (json3.specular !== void 0 && material.specular !== void 0)
      material.specular.setHex(json3.specular);
    if (json3.specularIntensity !== void 0)
      material.specularIntensity = json3.specularIntensity;
    if (json3.specularColor !== void 0 && material.specularColor !== void 0)
      material.specularColor.setHex(json3.specularColor);
    if (json3.shininess !== void 0)
      material.shininess = json3.shininess;
    if (json3.clearcoat !== void 0)
      material.clearcoat = json3.clearcoat;
    if (json3.clearcoatRoughness !== void 0)
      material.clearcoatRoughness = json3.clearcoatRoughness;
    if (json3.transmission !== void 0)
      material.transmission = json3.transmission;
    if (json3.thickness !== void 0)
      material.thickness = json3.thickness;
    if (json3.attenuationDistance !== void 0)
      material.attenuationDistance = json3.attenuationDistance;
    if (json3.attenuationColor !== void 0 && material.attenuationColor !== void 0)
      material.attenuationColor.setHex(json3.attenuationColor);
    if (json3.fog !== void 0)
      material.fog = json3.fog;
    if (json3.flatShading !== void 0)
      material.flatShading = json3.flatShading;
    if (json3.blending !== void 0)
      material.blending = json3.blending;
    if (json3.combine !== void 0)
      material.combine = json3.combine;
    if (json3.side !== void 0)
      material.side = json3.side;
    if (json3.shadowSide !== void 0)
      material.shadowSide = json3.shadowSide;
    if (json3.opacity !== void 0)
      material.opacity = json3.opacity;
    if (json3.transparent !== void 0)
      material.transparent = json3.transparent;
    if (json3.alphaTest !== void 0)
      material.alphaTest = json3.alphaTest;
    if (json3.depthTest !== void 0)
      material.depthTest = json3.depthTest;
    if (json3.depthWrite !== void 0)
      material.depthWrite = json3.depthWrite;
    if (json3.colorWrite !== void 0)
      material.colorWrite = json3.colorWrite;
    if (json3.stencilWrite !== void 0)
      material.stencilWrite = json3.stencilWrite;
    if (json3.stencilWriteMask !== void 0)
      material.stencilWriteMask = json3.stencilWriteMask;
    if (json3.stencilFunc !== void 0)
      material.stencilFunc = json3.stencilFunc;
    if (json3.stencilRef !== void 0)
      material.stencilRef = json3.stencilRef;
    if (json3.stencilFuncMask !== void 0)
      material.stencilFuncMask = json3.stencilFuncMask;
    if (json3.stencilFail !== void 0)
      material.stencilFail = json3.stencilFail;
    if (json3.stencilZFail !== void 0)
      material.stencilZFail = json3.stencilZFail;
    if (json3.stencilZPass !== void 0)
      material.stencilZPass = json3.stencilZPass;
    if (json3.wireframe !== void 0)
      material.wireframe = json3.wireframe;
    if (json3.wireframeLinewidth !== void 0)
      material.wireframeLinewidth = json3.wireframeLinewidth;
    if (json3.wireframeLinecap !== void 0)
      material.wireframeLinecap = json3.wireframeLinecap;
    if (json3.wireframeLinejoin !== void 0)
      material.wireframeLinejoin = json3.wireframeLinejoin;
    if (json3.rotation !== void 0)
      material.rotation = json3.rotation;
    if (json3.linewidth !== 1)
      material.linewidth = json3.linewidth;
    if (json3.dashSize !== void 0)
      material.dashSize = json3.dashSize;
    if (json3.gapSize !== void 0)
      material.gapSize = json3.gapSize;
    if (json3.scale !== void 0)
      material.scale = json3.scale;
    if (json3.polygonOffset !== void 0)
      material.polygonOffset = json3.polygonOffset;
    if (json3.polygonOffsetFactor !== void 0)
      material.polygonOffsetFactor = json3.polygonOffsetFactor;
    if (json3.polygonOffsetUnits !== void 0)
      material.polygonOffsetUnits = json3.polygonOffsetUnits;
    if (json3.dithering !== void 0)
      material.dithering = json3.dithering;
    if (json3.alphaToCoverage !== void 0)
      material.alphaToCoverage = json3.alphaToCoverage;
    if (json3.premultipliedAlpha !== void 0)
      material.premultipliedAlpha = json3.premultipliedAlpha;
    if (json3.visible !== void 0)
      material.visible = json3.visible;
    if (json3.toneMapped !== void 0)
      material.toneMapped = json3.toneMapped;
    if (json3.userData !== void 0)
      material.userData = json3.userData;
    if (json3.vertexColors !== void 0) {
      if (typeof json3.vertexColors === "number") {
        material.vertexColors = json3.vertexColors > 0 ? true : false;
      } else {
        material.vertexColors = json3.vertexColors;
      }
    }
    if (json3.uniforms !== void 0) {
      for (const name2 in json3.uniforms) {
        const uniform = json3.uniforms[name2];
        material.uniforms[name2] = {};
        switch (uniform.type) {
          case "t":
            material.uniforms[name2].value = getTexture(uniform.value);
            break;
          case "c":
            material.uniforms[name2].value = new Color2().setHex(uniform.value);
            break;
          case "v2":
            material.uniforms[name2].value = new Vector2().fromArray(uniform.value);
            break;
          case "v3":
            material.uniforms[name2].value = new Vector3().fromArray(uniform.value);
            break;
          case "v4":
            material.uniforms[name2].value = new Vector4().fromArray(uniform.value);
            break;
          case "m3":
            material.uniforms[name2].value = new Matrix3().fromArray(uniform.value);
            break;
          case "m4":
            material.uniforms[name2].value = new Matrix4().fromArray(uniform.value);
            break;
          default:
            material.uniforms[name2].value = uniform.value;
        }
      }
    }
    if (json3.defines !== void 0)
      material.defines = json3.defines;
    if (json3.vertexShader !== void 0)
      material.vertexShader = json3.vertexShader;
    if (json3.fragmentShader !== void 0)
      material.fragmentShader = json3.fragmentShader;
    if (json3.extensions !== void 0) {
      for (const key in json3.extensions) {
        material.extensions[key] = json3.extensions[key];
      }
    }
    if (json3.shading !== void 0)
      material.flatShading = json3.shading === 1;
    if (json3.size !== void 0)
      material.size = json3.size;
    if (json3.sizeAttenuation !== void 0)
      material.sizeAttenuation = json3.sizeAttenuation;
    if (json3.map !== void 0)
      material.map = getTexture(json3.map);
    if (json3.matcap !== void 0)
      material.matcap = getTexture(json3.matcap);
    if (json3.alphaMap !== void 0)
      material.alphaMap = getTexture(json3.alphaMap);
    if (json3.bumpMap !== void 0)
      material.bumpMap = getTexture(json3.bumpMap);
    if (json3.bumpScale !== void 0)
      material.bumpScale = json3.bumpScale;
    if (json3.normalMap !== void 0)
      material.normalMap = getTexture(json3.normalMap);
    if (json3.normalMapType !== void 0)
      material.normalMapType = json3.normalMapType;
    if (json3.normalScale !== void 0) {
      let normalScale = json3.normalScale;
      if (Array.isArray(normalScale) === false) {
        normalScale = [normalScale, normalScale];
      }
      material.normalScale = new Vector2().fromArray(normalScale);
    }
    if (json3.displacementMap !== void 0)
      material.displacementMap = getTexture(json3.displacementMap);
    if (json3.displacementScale !== void 0)
      material.displacementScale = json3.displacementScale;
    if (json3.displacementBias !== void 0)
      material.displacementBias = json3.displacementBias;
    if (json3.roughnessMap !== void 0)
      material.roughnessMap = getTexture(json3.roughnessMap);
    if (json3.metalnessMap !== void 0)
      material.metalnessMap = getTexture(json3.metalnessMap);
    if (json3.emissiveMap !== void 0)
      material.emissiveMap = getTexture(json3.emissiveMap);
    if (json3.emissiveIntensity !== void 0)
      material.emissiveIntensity = json3.emissiveIntensity;
    if (json3.specularMap !== void 0)
      material.specularMap = getTexture(json3.specularMap);
    if (json3.specularIntensityMap !== void 0)
      material.specularIntensityMap = getTexture(json3.specularIntensityMap);
    if (json3.specularColorMap !== void 0)
      material.specularColorMap = getTexture(json3.specularColorMap);
    if (json3.envMap !== void 0)
      material.envMap = getTexture(json3.envMap);
    if (json3.envMapIntensity !== void 0)
      material.envMapIntensity = json3.envMapIntensity;
    if (json3.reflectivity !== void 0)
      material.reflectivity = json3.reflectivity;
    if (json3.refractionRatio !== void 0)
      material.refractionRatio = json3.refractionRatio;
    if (json3.lightMap !== void 0)
      material.lightMap = getTexture(json3.lightMap);
    if (json3.lightMapIntensity !== void 0)
      material.lightMapIntensity = json3.lightMapIntensity;
    if (json3.aoMap !== void 0)
      material.aoMap = getTexture(json3.aoMap);
    if (json3.aoMapIntensity !== void 0)
      material.aoMapIntensity = json3.aoMapIntensity;
    if (json3.gradientMap !== void 0)
      material.gradientMap = getTexture(json3.gradientMap);
    if (json3.clearcoatMap !== void 0)
      material.clearcoatMap = getTexture(json3.clearcoatMap);
    if (json3.clearcoatRoughnessMap !== void 0)
      material.clearcoatRoughnessMap = getTexture(json3.clearcoatRoughnessMap);
    if (json3.clearcoatNormalMap !== void 0)
      material.clearcoatNormalMap = getTexture(json3.clearcoatNormalMap);
    if (json3.clearcoatNormalScale !== void 0)
      material.clearcoatNormalScale = new Vector2().fromArray(json3.clearcoatNormalScale);
    if (json3.transmissionMap !== void 0)
      material.transmissionMap = getTexture(json3.transmissionMap);
    if (json3.thicknessMap !== void 0)
      material.thicknessMap = getTexture(json3.thicknessMap);
    if (json3.sheenColorMap !== void 0)
      material.sheenColorMap = getTexture(json3.sheenColorMap);
    if (json3.sheenRoughnessMap !== void 0)
      material.sheenRoughnessMap = getTexture(json3.sheenRoughnessMap);
    return material;
  }
  setTextures(value) {
    this.textures = value;
    return this;
  }
};
var LoaderUtils = class {
  static decodeText(array) {
    if (typeof TextDecoder !== "undefined") {
      return new TextDecoder().decode(array);
    }
    let s2 = "";
    for (let i2 = 0, il = array.length; i2 < il; i2++) {
      s2 += String.fromCharCode(array[i2]);
    }
    try {
      return decodeURIComponent(escape(s2));
    } catch (e3) {
      return s2;
    }
  }
  static extractUrlBase(url) {
    const index = url.lastIndexOf("/");
    if (index === -1)
      return "./";
    return url.slice(0, index + 1);
  }
  static resolveURL(url, path2) {
    if (typeof url !== "string" || url === "")
      return "";
    if (/^https?:\/\//i.test(path2) && /^\//.test(url)) {
      path2 = path2.replace(/(^https?:\/\/[^\/]+).*/i, "$1");
    }
    if (/^(https?:)?\/\//i.test(url))
      return url;
    if (/^data:.*,.*$/i.test(url))
      return url;
    if (/^blob:.*$/i.test(url))
      return url;
    return path2 + url;
  }
};
var InstancedBufferGeometry = class extends BufferGeometry {
  constructor() {
    super();
    this.type = "InstancedBufferGeometry";
    this.instanceCount = Infinity;
  }
  copy(source) {
    super.copy(source);
    this.instanceCount = source.instanceCount;
    return this;
  }
  clone() {
    return new this.constructor().copy(this);
  }
  toJSON() {
    const data = super.toJSON(this);
    data.instanceCount = this.instanceCount;
    data.isInstancedBufferGeometry = true;
    return data;
  }
};
InstancedBufferGeometry.prototype.isInstancedBufferGeometry = true;
var BufferGeometryLoader = class extends Loader {
  constructor(manager) {
    super(manager);
  }
  load(url, onLoad, onProgress, onError) {
    const scope = this;
    const loader = new FileLoader(scope.manager);
    loader.setPath(scope.path);
    loader.setRequestHeader(scope.requestHeader);
    loader.setWithCredentials(scope.withCredentials);
    loader.load(url, function(text2) {
      try {
        onLoad(scope.parse(JSON.parse(text2)));
      } catch (e3) {
        if (onError) {
          onError(e3);
        } else {
          console.error(e3);
        }
        scope.manager.itemError(url);
      }
    }, onProgress, onError);
  }
  parse(json3) {
    const interleavedBufferMap = {};
    const arrayBufferMap = {};
    function getInterleavedBuffer(json4, uuid) {
      if (interleavedBufferMap[uuid] !== void 0)
        return interleavedBufferMap[uuid];
      const interleavedBuffers = json4.interleavedBuffers;
      const interleavedBuffer = interleavedBuffers[uuid];
      const buffer = getArrayBuffer(json4, interleavedBuffer.buffer);
      const array = getTypedArray(interleavedBuffer.type, buffer);
      const ib = new InterleavedBuffer(array, interleavedBuffer.stride);
      ib.uuid = interleavedBuffer.uuid;
      interleavedBufferMap[uuid] = ib;
      return ib;
    }
    function getArrayBuffer(json4, uuid) {
      if (arrayBufferMap[uuid] !== void 0)
        return arrayBufferMap[uuid];
      const arrayBuffers = json4.arrayBuffers;
      const arrayBuffer = arrayBuffers[uuid];
      const ab = new Uint32Array(arrayBuffer).buffer;
      arrayBufferMap[uuid] = ab;
      return ab;
    }
    const geometry = json3.isInstancedBufferGeometry ? new InstancedBufferGeometry() : new BufferGeometry();
    const index = json3.data.index;
    if (index !== void 0) {
      const typedArray = getTypedArray(index.type, index.array);
      geometry.setIndex(new BufferAttribute(typedArray, 1));
    }
    const attributes = json3.data.attributes;
    for (const key in attributes) {
      const attribute = attributes[key];
      let bufferAttribute;
      if (attribute.isInterleavedBufferAttribute) {
        const interleavedBuffer = getInterleavedBuffer(json3.data, attribute.data);
        bufferAttribute = new InterleavedBufferAttribute(interleavedBuffer, attribute.itemSize, attribute.offset, attribute.normalized);
      } else {
        const typedArray = getTypedArray(attribute.type, attribute.array);
        const bufferAttributeConstr = attribute.isInstancedBufferAttribute ? InstancedBufferAttribute : BufferAttribute;
        bufferAttribute = new bufferAttributeConstr(typedArray, attribute.itemSize, attribute.normalized);
      }
      if (attribute.name !== void 0)
        bufferAttribute.name = attribute.name;
      if (attribute.usage !== void 0)
        bufferAttribute.setUsage(attribute.usage);
      if (attribute.updateRange !== void 0) {
        bufferAttribute.updateRange.offset = attribute.updateRange.offset;
        bufferAttribute.updateRange.count = attribute.updateRange.count;
      }
      geometry.setAttribute(key, bufferAttribute);
    }
    const morphAttributes = json3.data.morphAttributes;
    if (morphAttributes) {
      for (const key in morphAttributes) {
        const attributeArray = morphAttributes[key];
        const array = [];
        for (let i2 = 0, il = attributeArray.length; i2 < il; i2++) {
          const attribute = attributeArray[i2];
          let bufferAttribute;
          if (attribute.isInterleavedBufferAttribute) {
            const interleavedBuffer = getInterleavedBuffer(json3.data, attribute.data);
            bufferAttribute = new InterleavedBufferAttribute(interleavedBuffer, attribute.itemSize, attribute.offset, attribute.normalized);
          } else {
            const typedArray = getTypedArray(attribute.type, attribute.array);
            bufferAttribute = new BufferAttribute(typedArray, attribute.itemSize, attribute.normalized);
          }
          if (attribute.name !== void 0)
            bufferAttribute.name = attribute.name;
          array.push(bufferAttribute);
        }
        geometry.morphAttributes[key] = array;
      }
    }
    const morphTargetsRelative = json3.data.morphTargetsRelative;
    if (morphTargetsRelative) {
      geometry.morphTargetsRelative = true;
    }
    const groups = json3.data.groups || json3.data.drawcalls || json3.data.offsets;
    if (groups !== void 0) {
      for (let i2 = 0, n2 = groups.length; i2 !== n2; ++i2) {
        const group = groups[i2];
        geometry.addGroup(group.start, group.count, group.materialIndex);
      }
    }
    const boundingSphere = json3.data.boundingSphere;
    if (boundingSphere !== void 0) {
      const center = new Vector3();
      if (boundingSphere.center !== void 0) {
        center.fromArray(boundingSphere.center);
      }
      geometry.boundingSphere = new Sphere(center, boundingSphere.radius);
    }
    if (json3.name)
      geometry.name = json3.name;
    if (json3.userData)
      geometry.userData = json3.userData;
    return geometry;
  }
};
var ObjectLoader = class extends Loader {
  constructor(manager) {
    super(manager);
  }
  load(url, onLoad, onProgress, onError) {
    const scope = this;
    const path2 = this.path === "" ? LoaderUtils.extractUrlBase(url) : this.path;
    this.resourcePath = this.resourcePath || path2;
    const loader = new FileLoader(this.manager);
    loader.setPath(this.path);
    loader.setRequestHeader(this.requestHeader);
    loader.setWithCredentials(this.withCredentials);
    loader.load(url, function(text2) {
      let json3 = null;
      try {
        json3 = JSON.parse(text2);
      } catch (error) {
        if (onError !== void 0)
          onError(error);
        console.error("THREE:ObjectLoader: Can't parse " + url + ".", error.message);
        return;
      }
      const metadata = json3.metadata;
      if (metadata === void 0 || metadata.type === void 0 || metadata.type.toLowerCase() === "geometry") {
        console.error("THREE.ObjectLoader: Can't load " + url);
        return;
      }
      scope.parse(json3, onLoad);
    }, onProgress, onError);
  }
  async loadAsync(url, onProgress) {
    const scope = this;
    const path2 = this.path === "" ? LoaderUtils.extractUrlBase(url) : this.path;
    this.resourcePath = this.resourcePath || path2;
    const loader = new FileLoader(this.manager);
    loader.setPath(this.path);
    loader.setRequestHeader(this.requestHeader);
    loader.setWithCredentials(this.withCredentials);
    const text2 = await loader.loadAsync(url, onProgress);
    const json3 = JSON.parse(text2);
    const metadata = json3.metadata;
    if (metadata === void 0 || metadata.type === void 0 || metadata.type.toLowerCase() === "geometry") {
      throw new Error("THREE.ObjectLoader: Can't load " + url);
    }
    return await scope.parseAsync(json3);
  }
  parse(json3, onLoad) {
    const animations = this.parseAnimations(json3.animations);
    const shapes = this.parseShapes(json3.shapes);
    const geometries = this.parseGeometries(json3.geometries, shapes);
    const images = this.parseImages(json3.images, function() {
      if (onLoad !== void 0)
        onLoad(object);
    });
    const textures = this.parseTextures(json3.textures, images);
    const materials = this.parseMaterials(json3.materials, textures);
    const object = this.parseObject(json3.object, geometries, materials, textures, animations);
    const skeletons = this.parseSkeletons(json3.skeletons, object);
    this.bindSkeletons(object, skeletons);
    if (onLoad !== void 0) {
      let hasImages = false;
      for (const uuid in images) {
        if (images[uuid] instanceof HTMLImageElement) {
          hasImages = true;
          break;
        }
      }
      if (hasImages === false)
        onLoad(object);
    }
    return object;
  }
  async parseAsync(json3) {
    const animations = this.parseAnimations(json3.animations);
    const shapes = this.parseShapes(json3.shapes);
    const geometries = this.parseGeometries(json3.geometries, shapes);
    const images = await this.parseImagesAsync(json3.images);
    const textures = this.parseTextures(json3.textures, images);
    const materials = this.parseMaterials(json3.materials, textures);
    const object = this.parseObject(json3.object, geometries, materials, textures, animations);
    const skeletons = this.parseSkeletons(json3.skeletons, object);
    this.bindSkeletons(object, skeletons);
    return object;
  }
  parseShapes(json3) {
    const shapes = {};
    if (json3 !== void 0) {
      for (let i2 = 0, l = json3.length; i2 < l; i2++) {
        const shape = new Shape().fromJSON(json3[i2]);
        shapes[shape.uuid] = shape;
      }
    }
    return shapes;
  }
  parseSkeletons(json3, object) {
    const skeletons = {};
    const bones = {};
    object.traverse(function(child) {
      if (child.isBone)
        bones[child.uuid] = child;
    });
    if (json3 !== void 0) {
      for (let i2 = 0, l = json3.length; i2 < l; i2++) {
        const skeleton = new Skeleton().fromJSON(json3[i2], bones);
        skeletons[skeleton.uuid] = skeleton;
      }
    }
    return skeletons;
  }
  parseGeometries(json3, shapes) {
    const geometries = {};
    if (json3 !== void 0) {
      const bufferGeometryLoader = new BufferGeometryLoader();
      for (let i2 = 0, l = json3.length; i2 < l; i2++) {
        let geometry;
        const data = json3[i2];
        switch (data.type) {
          case "BufferGeometry":
          case "InstancedBufferGeometry":
            geometry = bufferGeometryLoader.parse(data);
            break;
          case "Geometry":
            console.error("THREE.ObjectLoader: The legacy Geometry type is no longer supported.");
            break;
          default:
            if (data.type in Geometries) {
              geometry = Geometries[data.type].fromJSON(data, shapes);
            } else {
              console.warn(`THREE.ObjectLoader: Unsupported geometry type "${data.type}"`);
            }
        }
        geometry.uuid = data.uuid;
        if (data.name !== void 0)
          geometry.name = data.name;
        if (geometry.isBufferGeometry === true && data.userData !== void 0)
          geometry.userData = data.userData;
        geometries[data.uuid] = geometry;
      }
    }
    return geometries;
  }
  parseMaterials(json3, textures) {
    const cache2 = {};
    const materials = {};
    if (json3 !== void 0) {
      const loader = new MaterialLoader();
      loader.setTextures(textures);
      for (let i2 = 0, l = json3.length; i2 < l; i2++) {
        const data = json3[i2];
        if (data.type === "MultiMaterial") {
          const array = [];
          for (let j = 0; j < data.materials.length; j++) {
            const material = data.materials[j];
            if (cache2[material.uuid] === void 0) {
              cache2[material.uuid] = loader.parse(material);
            }
            array.push(cache2[material.uuid]);
          }
          materials[data.uuid] = array;
        } else {
          if (cache2[data.uuid] === void 0) {
            cache2[data.uuid] = loader.parse(data);
          }
          materials[data.uuid] = cache2[data.uuid];
        }
      }
    }
    return materials;
  }
  parseAnimations(json3) {
    const animations = {};
    if (json3 !== void 0) {
      for (let i2 = 0; i2 < json3.length; i2++) {
        const data = json3[i2];
        const clip = AnimationClip.parse(data);
        animations[clip.uuid] = clip;
      }
    }
    return animations;
  }
  parseImages(json3, onLoad) {
    const scope = this;
    const images = {};
    let loader;
    function loadImage(url) {
      scope.manager.itemStart(url);
      return loader.load(url, function() {
        scope.manager.itemEnd(url);
      }, void 0, function() {
        scope.manager.itemError(url);
        scope.manager.itemEnd(url);
      });
    }
    function deserializeImage(image) {
      if (typeof image === "string") {
        const url = image;
        const path2 = /^(\/\/)|([a-z]+:(\/\/)?)/i.test(url) ? url : scope.resourcePath + url;
        return loadImage(path2);
      } else {
        if (image.data) {
          return {
            data: getTypedArray(image.type, image.data),
            width: image.width,
            height: image.height
          };
        } else {
          return null;
        }
      }
    }
    if (json3 !== void 0 && json3.length > 0) {
      const manager = new LoadingManager(onLoad);
      loader = new ImageLoader(manager);
      loader.setCrossOrigin(this.crossOrigin);
      for (let i2 = 0, il = json3.length; i2 < il; i2++) {
        const image = json3[i2];
        const url = image.url;
        if (Array.isArray(url)) {
          const imageArray = [];
          for (let j = 0, jl = url.length; j < jl; j++) {
            const currentUrl = url[j];
            const deserializedImage = deserializeImage(currentUrl);
            if (deserializedImage !== null) {
              if (deserializedImage instanceof HTMLImageElement) {
                imageArray.push(deserializedImage);
              } else {
                imageArray.push(new DataTexture(deserializedImage.data, deserializedImage.width, deserializedImage.height));
              }
            }
          }
          images[image.uuid] = new Source(imageArray);
        } else {
          const deserializedImage = deserializeImage(image.url);
          images[image.uuid] = new Source(deserializedImage);
        }
      }
    }
    return images;
  }
  async parseImagesAsync(json3) {
    const scope = this;
    const images = {};
    let loader;
    async function deserializeImage(image) {
      if (typeof image === "string") {
        const url = image;
        const path2 = /^(\/\/)|([a-z]+:(\/\/)?)/i.test(url) ? url : scope.resourcePath + url;
        return await loader.loadAsync(path2);
      } else {
        if (image.data) {
          return {
            data: getTypedArray(image.type, image.data),
            width: image.width,
            height: image.height
          };
        } else {
          return null;
        }
      }
    }
    if (json3 !== void 0 && json3.length > 0) {
      loader = new ImageLoader(this.manager);
      loader.setCrossOrigin(this.crossOrigin);
      for (let i2 = 0, il = json3.length; i2 < il; i2++) {
        const image = json3[i2];
        const url = image.url;
        if (Array.isArray(url)) {
          const imageArray = [];
          for (let j = 0, jl = url.length; j < jl; j++) {
            const currentUrl = url[j];
            const deserializedImage = await deserializeImage(currentUrl);
            if (deserializedImage !== null) {
              if (deserializedImage instanceof HTMLImageElement) {
                imageArray.push(deserializedImage);
              } else {
                imageArray.push(new DataTexture(deserializedImage.data, deserializedImage.width, deserializedImage.height));
              }
            }
          }
          images[image.uuid] = new Source(imageArray);
        } else {
          const deserializedImage = await deserializeImage(image.url);
          images[image.uuid] = new Source(deserializedImage);
        }
      }
    }
    return images;
  }
  parseTextures(json3, images) {
    function parseConstant(value, type) {
      if (typeof value === "number")
        return value;
      console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.", value);
      return type[value];
    }
    const textures = {};
    if (json3 !== void 0) {
      for (let i2 = 0, l = json3.length; i2 < l; i2++) {
        const data = json3[i2];
        if (data.image === void 0) {
          console.warn('THREE.ObjectLoader: No "image" specified for', data.uuid);
        }
        if (images[data.image] === void 0) {
          console.warn("THREE.ObjectLoader: Undefined image", data.image);
        }
        const source = images[data.image];
        const image = source.data;
        let texture;
        if (Array.isArray(image)) {
          texture = new CubeTexture();
          if (image.length === 6)
            texture.needsUpdate = true;
        } else {
          if (image && image.data) {
            texture = new DataTexture();
          } else {
            texture = new Texture();
          }
          if (image)
            texture.needsUpdate = true;
        }
        texture.source = source;
        texture.uuid = data.uuid;
        if (data.name !== void 0)
          texture.name = data.name;
        if (data.mapping !== void 0)
          texture.mapping = parseConstant(data.mapping, TEXTURE_MAPPING);
        if (data.offset !== void 0)
          texture.offset.fromArray(data.offset);
        if (data.repeat !== void 0)
          texture.repeat.fromArray(data.repeat);
        if (data.center !== void 0)
          texture.center.fromArray(data.center);
        if (data.rotation !== void 0)
          texture.rotation = data.rotation;
        if (data.wrap !== void 0) {
          texture.wrapS = parseConstant(data.wrap[0], TEXTURE_WRAPPING);
          texture.wrapT = parseConstant(data.wrap[1], TEXTURE_WRAPPING);
        }
        if (data.format !== void 0)
          texture.format = data.format;
        if (data.type !== void 0)
          texture.type = data.type;
        if (data.encoding !== void 0)
          texture.encoding = data.encoding;
        if (data.minFilter !== void 0)
          texture.minFilter = parseConstant(data.minFilter, TEXTURE_FILTER);
        if (data.magFilter !== void 0)
          texture.magFilter = parseConstant(data.magFilter, TEXTURE_FILTER);
        if (data.anisotropy !== void 0)
          texture.anisotropy = data.anisotropy;
        if (data.flipY !== void 0)
          texture.flipY = data.flipY;
        if (data.premultiplyAlpha !== void 0)
          texture.premultiplyAlpha = data.premultiplyAlpha;
        if (data.unpackAlignment !== void 0)
          texture.unpackAlignment = data.unpackAlignment;
        if (data.userData !== void 0)
          texture.userData = data.userData;
        textures[data.uuid] = texture;
      }
    }
    return textures;
  }
  parseObject(data, geometries, materials, textures, animations) {
    let object;
    function getGeometry(name2) {
      if (geometries[name2] === void 0) {
        console.warn("THREE.ObjectLoader: Undefined geometry", name2);
      }
      return geometries[name2];
    }
    function getMaterial(name2) {
      if (name2 === void 0)
        return void 0;
      if (Array.isArray(name2)) {
        const array = [];
        for (let i2 = 0, l = name2.length; i2 < l; i2++) {
          const uuid = name2[i2];
          if (materials[uuid] === void 0) {
            console.warn("THREE.ObjectLoader: Undefined material", uuid);
          }
          array.push(materials[uuid]);
        }
        return array;
      }
      if (materials[name2] === void 0) {
        console.warn("THREE.ObjectLoader: Undefined material", name2);
      }
      return materials[name2];
    }
    function getTexture(uuid) {
      if (textures[uuid] === void 0) {
        console.warn("THREE.ObjectLoader: Undefined texture", uuid);
      }
      return textures[uuid];
    }
    let geometry, material;
    switch (data.type) {
      case "Scene":
        object = new Scene();
        if (data.background !== void 0) {
          if (Number.isInteger(data.background)) {
            object.background = new Color2(data.background);
          } else {
            object.background = getTexture(data.background);
          }
        }
        if (data.environment !== void 0) {
          object.environment = getTexture(data.environment);
        }
        if (data.fog !== void 0) {
          if (data.fog.type === "Fog") {
            object.fog = new Fog(data.fog.color, data.fog.near, data.fog.far);
          } else if (data.fog.type === "FogExp2") {
            object.fog = new FogExp2(data.fog.color, data.fog.density);
          }
        }
        break;
      case "PerspectiveCamera":
        object = new PerspectiveCamera(data.fov, data.aspect, data.near, data.far);
        if (data.focus !== void 0)
          object.focus = data.focus;
        if (data.zoom !== void 0)
          object.zoom = data.zoom;
        if (data.filmGauge !== void 0)
          object.filmGauge = data.filmGauge;
        if (data.filmOffset !== void 0)
          object.filmOffset = data.filmOffset;
        if (data.view !== void 0)
          object.view = Object.assign({}, data.view);
        break;
      case "OrthographicCamera":
        object = new OrthographicCamera(data.left, data.right, data.top, data.bottom, data.near, data.far);
        if (data.zoom !== void 0)
          object.zoom = data.zoom;
        if (data.view !== void 0)
          object.view = Object.assign({}, data.view);
        break;
      case "AmbientLight":
        object = new AmbientLight(data.color, data.intensity);
        break;
      case "DirectionalLight":
        object = new DirectionalLight(data.color, data.intensity);
        break;
      case "PointLight":
        object = new PointLight(data.color, data.intensity, data.distance, data.decay);
        break;
      case "RectAreaLight":
        object = new RectAreaLight(data.color, data.intensity, data.width, data.height);
        break;
      case "SpotLight":
        object = new SpotLight(data.color, data.intensity, data.distance, data.angle, data.penumbra, data.decay);
        break;
      case "HemisphereLight":
        object = new HemisphereLight(data.color, data.groundColor, data.intensity);
        break;
      case "LightProbe":
        object = new LightProbe().fromJSON(data);
        break;
      case "SkinnedMesh":
        geometry = getGeometry(data.geometry);
        material = getMaterial(data.material);
        object = new SkinnedMesh(geometry, material);
        if (data.bindMode !== void 0)
          object.bindMode = data.bindMode;
        if (data.bindMatrix !== void 0)
          object.bindMatrix.fromArray(data.bindMatrix);
        if (data.skeleton !== void 0)
          object.skeleton = data.skeleton;
        break;
      case "Mesh":
        geometry = getGeometry(data.geometry);
        material = getMaterial(data.material);
        object = new Mesh(geometry, material);
        break;
      case "InstancedMesh":
        geometry = getGeometry(data.geometry);
        material = getMaterial(data.material);
        const count2 = data.count;
        const instanceMatrix = data.instanceMatrix;
        const instanceColor = data.instanceColor;
        object = new InstancedMesh(geometry, material, count2);
        object.instanceMatrix = new InstancedBufferAttribute(new Float32Array(instanceMatrix.array), 16);
        if (instanceColor !== void 0)
          object.instanceColor = new InstancedBufferAttribute(new Float32Array(instanceColor.array), instanceColor.itemSize);
        break;
      case "LOD":
        object = new LOD();
        break;
      case "Line":
        object = new Line(getGeometry(data.geometry), getMaterial(data.material));
        break;
      case "LineLoop":
        object = new LineLoop(getGeometry(data.geometry), getMaterial(data.material));
        break;
      case "LineSegments":
        object = new LineSegments(getGeometry(data.geometry), getMaterial(data.material));
        break;
      case "PointCloud":
      case "Points":
        object = new Points(getGeometry(data.geometry), getMaterial(data.material));
        break;
      case "Sprite":
        object = new Sprite(getMaterial(data.material));
        break;
      case "Group":
        object = new Group();
        break;
      case "Bone":
        object = new Bone();
        break;
      default:
        object = new Object3D();
    }
    object.uuid = data.uuid;
    if (data.name !== void 0)
      object.name = data.name;
    if (data.matrix !== void 0) {
      object.matrix.fromArray(data.matrix);
      if (data.matrixAutoUpdate !== void 0)
        object.matrixAutoUpdate = data.matrixAutoUpdate;
      if (object.matrixAutoUpdate)
        object.matrix.decompose(object.position, object.quaternion, object.scale);
    } else {
      if (data.position !== void 0)
        object.position.fromArray(data.position);
      if (data.rotation !== void 0)
        object.rotation.fromArray(data.rotation);
      if (data.quaternion !== void 0)
        object.quaternion.fromArray(data.quaternion);
      if (data.scale !== void 0)
        object.scale.fromArray(data.scale);
    }
    if (data.castShadow !== void 0)
      object.castShadow = data.castShadow;
    if (data.receiveShadow !== void 0)
      object.receiveShadow = data.receiveShadow;
    if (data.shadow) {
      if (data.shadow.bias !== void 0)
        object.shadow.bias = data.shadow.bias;
      if (data.shadow.normalBias !== void 0)
        object.shadow.normalBias = data.shadow.normalBias;
      if (data.shadow.radius !== void 0)
        object.shadow.radius = data.shadow.radius;
      if (data.shadow.mapSize !== void 0)
        object.shadow.mapSize.fromArray(data.shadow.mapSize);
      if (data.shadow.camera !== void 0)
        object.shadow.camera = this.parseObject(data.shadow.camera);
    }
    if (data.visible !== void 0)
      object.visible = data.visible;
    if (data.frustumCulled !== void 0)
      object.frustumCulled = data.frustumCulled;
    if (data.renderOrder !== void 0)
      object.renderOrder = data.renderOrder;
    if (data.userData !== void 0)
      object.userData = data.userData;
    if (data.layers !== void 0)
      object.layers.mask = data.layers;
    if (data.children !== void 0) {
      const children = data.children;
      for (let i2 = 0; i2 < children.length; i2++) {
        object.add(this.parseObject(children[i2], geometries, materials, textures, animations));
      }
    }
    if (data.animations !== void 0) {
      const objectAnimations = data.animations;
      for (let i2 = 0; i2 < objectAnimations.length; i2++) {
        const uuid = objectAnimations[i2];
        object.animations.push(animations[uuid]);
      }
    }
    if (data.type === "LOD") {
      if (data.autoUpdate !== void 0)
        object.autoUpdate = data.autoUpdate;
      const levels = data.levels;
      for (let l = 0; l < levels.length; l++) {
        const level = levels[l];
        const child = object.getObjectByProperty("uuid", level.object);
        if (child !== void 0) {
          object.addLevel(child, level.distance);
        }
      }
    }
    return object;
  }
  bindSkeletons(object, skeletons) {
    if (Object.keys(skeletons).length === 0)
      return;
    object.traverse(function(child) {
      if (child.isSkinnedMesh === true && child.skeleton !== void 0) {
        const skeleton = skeletons[child.skeleton];
        if (skeleton === void 0) {
          console.warn("THREE.ObjectLoader: No skeleton found with UUID:", child.skeleton);
        } else {
          child.bind(skeleton, child.bindMatrix);
        }
      }
    });
  }
  /* DEPRECATED */
  setTexturePath(value) {
    console.warn("THREE.ObjectLoader: .setTexturePath() has been renamed to .setResourcePath().");
    return this.setResourcePath(value);
  }
};
var TEXTURE_MAPPING = {
  UVMapping,
  CubeReflectionMapping,
  CubeRefractionMapping,
  EquirectangularReflectionMapping,
  EquirectangularRefractionMapping,
  CubeUVReflectionMapping
};
var TEXTURE_WRAPPING = {
  RepeatWrapping,
  ClampToEdgeWrapping,
  MirroredRepeatWrapping
};
var TEXTURE_FILTER = {
  NearestFilter,
  NearestMipmapNearestFilter,
  NearestMipmapLinearFilter,
  LinearFilter,
  LinearMipmapNearestFilter,
  LinearMipmapLinearFilter
};
var ImageBitmapLoader = class extends Loader {
  constructor(manager) {
    super(manager);
    if (typeof createImageBitmap === "undefined") {
      console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported.");
    }
    if (typeof fetch === "undefined") {
      console.warn("THREE.ImageBitmapLoader: fetch() not supported.");
    }
    this.options = { premultiplyAlpha: "none" };
  }
  setOptions(options) {
    this.options = options;
    return this;
  }
  load(url, onLoad, onProgress, onError) {
    if (url === void 0)
      url = "";
    if (this.path !== void 0)
      url = this.path + url;
    url = this.manager.resolveURL(url);
    const scope = this;
    const cached = Cache.get(url);
    if (cached !== void 0) {
      scope.manager.itemStart(url);
      setTimeout(function() {
        if (onLoad)
          onLoad(cached);
        scope.manager.itemEnd(url);
      }, 0);
      return cached;
    }
    const fetchOptions = {};
    fetchOptions.credentials = this.crossOrigin === "anonymous" ? "same-origin" : "include";
    fetchOptions.headers = this.requestHeader;
    fetch(url, fetchOptions).then(function(res) {
      return res.blob();
    }).then(function(blob) {
      return createImageBitmap(blob, Object.assign(scope.options, { colorSpaceConversion: "none" }));
    }).then(function(imageBitmap) {
      Cache.add(url, imageBitmap);
      if (onLoad)
        onLoad(imageBitmap);
      scope.manager.itemEnd(url);
    }).catch(function(e3) {
      if (onError)
        onError(e3);
      scope.manager.itemError(url);
      scope.manager.itemEnd(url);
    });
    scope.manager.itemStart(url);
  }
};
ImageBitmapLoader.prototype.isImageBitmapLoader = true;
var _context;
var AudioContext = {
  getContext: function() {
    if (_context === void 0) {
      _context = new (window.AudioContext || window.webkitAudioContext)();
    }
    return _context;
  },
  setContext: function(value) {
    _context = value;
  }
};
var AudioLoader = class extends Loader {
  constructor(manager) {
    super(manager);
  }
  load(url, onLoad, onProgress, onError) {
    const scope = this;
    const loader = new FileLoader(this.manager);
    loader.setResponseType("arraybuffer");
    loader.setPath(this.path);
    loader.setRequestHeader(this.requestHeader);
    loader.setWithCredentials(this.withCredentials);
    loader.load(url, function(buffer) {
      try {
        const bufferCopy = buffer.slice(0);
        const context2 = AudioContext.getContext();
        context2.decodeAudioData(bufferCopy, function(audioBuffer) {
          onLoad(audioBuffer);
        });
      } catch (e3) {
        if (onError) {
          onError(e3);
        } else {
          console.error(e3);
        }
        scope.manager.itemError(url);
      }
    }, onProgress, onError);
  }
};
var HemisphereLightProbe = class extends LightProbe {
  constructor(skyColor, groundColor, intensity = 1) {
    super(void 0, intensity);
    const color1 = new Color2().set(skyColor);
    const color2 = new Color2().set(groundColor);
    const sky = new Vector3(color1.r, color1.g, color1.b);
    const ground = new Vector3(color2.r, color2.g, color2.b);
    const c0 = Math.sqrt(Math.PI);
    const c1 = c0 * Math.sqrt(0.75);
    this.sh.coefficients[0].copy(sky).add(ground).multiplyScalar(c0);
    this.sh.coefficients[1].copy(sky).sub(ground).multiplyScalar(c1);
  }
};
HemisphereLightProbe.prototype.isHemisphereLightProbe = true;
var AmbientLightProbe = class extends LightProbe {
  constructor(color2, intensity = 1) {
    super(void 0, intensity);
    const color1 = new Color2().set(color2);
    this.sh.coefficients[0].set(color1.r, color1.g, color1.b).multiplyScalar(2 * Math.sqrt(Math.PI));
  }
};
AmbientLightProbe.prototype.isAmbientLightProbe = true;
var _eyeRight = /* @__PURE__ */ new Matrix4();
var _eyeLeft = /* @__PURE__ */ new Matrix4();
var _projectionMatrix = /* @__PURE__ */ new Matrix4();
var StereoCamera = class {
  constructor() {
    this.type = "StereoCamera";
    this.aspect = 1;
    this.eyeSep = 0.064;
    this.cameraL = new PerspectiveCamera();
    this.cameraL.layers.enable(1);
    this.cameraL.matrixAutoUpdate = false;
    this.cameraR = new PerspectiveCamera();
    this.cameraR.layers.enable(2);
    this.cameraR.matrixAutoUpdate = false;
    this._cache = {
      focus: null,
      fov: null,
      aspect: null,
      near: null,
      far: null,
      zoom: null,
      eyeSep: null
    };
  }
  update(camera) {
    const cache2 = this._cache;
    const needsUpdate = cache2.focus !== camera.focus || cache2.fov !== camera.fov || cache2.aspect !== camera.aspect * this.aspect || cache2.near !== camera.near || cache2.far !== camera.far || cache2.zoom !== camera.zoom || cache2.eyeSep !== this.eyeSep;
    if (needsUpdate) {
      cache2.focus = camera.focus;
      cache2.fov = camera.fov;
      cache2.aspect = camera.aspect * this.aspect;
      cache2.near = camera.near;
      cache2.far = camera.far;
      cache2.zoom = camera.zoom;
      cache2.eyeSep = this.eyeSep;
      _projectionMatrix.copy(camera.projectionMatrix);
      const eyeSepHalf = cache2.eyeSep / 2;
      const eyeSepOnProjection = eyeSepHalf * cache2.near / cache2.focus;
      const ymax = cache2.near * Math.tan(DEG2RAD * cache2.fov * 0.5) / cache2.zoom;
      let xmin, xmax;
      _eyeLeft.elements[12] = -eyeSepHalf;
      _eyeRight.elements[12] = eyeSepHalf;
      xmin = -ymax * cache2.aspect + eyeSepOnProjection;
      xmax = ymax * cache2.aspect + eyeSepOnProjection;
      _projectionMatrix.elements[0] = 2 * cache2.near / (xmax - xmin);
      _projectionMatrix.elements[8] = (xmax + xmin) / (xmax - xmin);
      this.cameraL.projectionMatrix.copy(_projectionMatrix);
      xmin = -ymax * cache2.aspect - eyeSepOnProjection;
      xmax = ymax * cache2.aspect - eyeSepOnProjection;
      _projectionMatrix.elements[0] = 2 * cache2.near / (xmax - xmin);
      _projectionMatrix.elements[8] = (xmax + xmin) / (xmax - xmin);
      this.cameraR.projectionMatrix.copy(_projectionMatrix);
    }
    this.cameraL.matrixWorld.copy(camera.matrixWorld).multiply(_eyeLeft);
    this.cameraR.matrixWorld.copy(camera.matrixWorld).multiply(_eyeRight);
  }
};
var Clock = class {
  constructor(autoStart = true) {
    this.autoStart = autoStart;
    this.startTime = 0;
    this.oldTime = 0;
    this.elapsedTime = 0;
    this.running = false;
  }
  start() {
    this.startTime = now();
    this.oldTime = this.startTime;
    this.elapsedTime = 0;
    this.running = true;
  }
  stop() {
    this.getElapsedTime();
    this.running = false;
    this.autoStart = false;
  }
  getElapsedTime() {
    this.getDelta();
    return this.elapsedTime;
  }
  getDelta() {
    let diff = 0;
    if (this.autoStart && !this.running) {
      this.start();
      return 0;
    }
    if (this.running) {
      const newTime = now();
      diff = (newTime - this.oldTime) / 1e3;
      this.oldTime = newTime;
      this.elapsedTime += diff;
    }
    return diff;
  }
};
function now() {
  return (typeof performance === "undefined" ? Date : performance).now();
}
var _position$1 = /* @__PURE__ */ new Vector3();
var _quaternion$1 = /* @__PURE__ */ new Quaternion();
var _scale$1 = /* @__PURE__ */ new Vector3();
var _orientation$1 = /* @__PURE__ */ new Vector3();
var AudioListener = class extends Object3D {
  constructor() {
    super();
    this.type = "AudioListener";
    this.context = AudioContext.getContext();
    this.gain = this.context.createGain();
    this.gain.connect(this.context.destination);
    this.filter = null;
    this.timeDelta = 0;
    this._clock = new Clock();
  }
  getInput() {
    return this.gain;
  }
  removeFilter() {
    if (this.filter !== null) {
      this.gain.disconnect(this.filter);
      this.filter.disconnect(this.context.destination);
      this.gain.connect(this.context.destination);
      this.filter = null;
    }
    return this;
  }
  getFilter() {
    return this.filter;
  }
  setFilter(value) {
    if (this.filter !== null) {
      this.gain.disconnect(this.filter);
      this.filter.disconnect(this.context.destination);
    } else {
      this.gain.disconnect(this.context.destination);
    }
    this.filter = value;
    this.gain.connect(this.filter);
    this.filter.connect(this.context.destination);
    return this;
  }
  getMasterVolume() {
    return this.gain.gain.value;
  }
  setMasterVolume(value) {
    this.gain.gain.setTargetAtTime(value, this.context.currentTime, 0.01);
    return this;
  }
  updateMatrixWorld(force) {
    super.updateMatrixWorld(force);
    const listener = this.context.listener;
    const up = this.up;
    this.timeDelta = this._clock.getDelta();
    this.matrixWorld.decompose(_position$1, _quaternion$1, _scale$1);
    _orientation$1.set(0, 0, -1).applyQuaternion(_quaternion$1);
    if (listener.positionX) {
      const endTime = this.context.currentTime + this.timeDelta;
      listener.positionX.linearRampToValueAtTime(_position$1.x, endTime);
      listener.positionY.linearRampToValueAtTime(_position$1.y, endTime);
      listener.positionZ.linearRampToValueAtTime(_position$1.z, endTime);
      listener.forwardX.linearRampToValueAtTime(_orientation$1.x, endTime);
      listener.forwardY.linearRampToValueAtTime(_orientation$1.y, endTime);
      listener.forwardZ.linearRampToValueAtTime(_orientation$1.z, endTime);
      listener.upX.linearRampToValueAtTime(up.x, endTime);
      listener.upY.linearRampToValueAtTime(up.y, endTime);
      listener.upZ.linearRampToValueAtTime(up.z, endTime);
    } else {
      listener.setPosition(_position$1.x, _position$1.y, _position$1.z);
      listener.setOrientation(_orientation$1.x, _orientation$1.y, _orientation$1.z, up.x, up.y, up.z);
    }
  }
};
var Audio = class extends Object3D {
  constructor(listener) {
    super();
    this.type = "Audio";
    this.listener = listener;
    this.context = listener.context;
    this.gain = this.context.createGain();
    this.gain.connect(listener.getInput());
    this.autoplay = false;
    this.buffer = null;
    this.detune = 0;
    this.loop = false;
    this.loopStart = 0;
    this.loopEnd = 0;
    this.offset = 0;
    this.duration = void 0;
    this.playbackRate = 1;
    this.isPlaying = false;
    this.hasPlaybackControl = true;
    this.source = null;
    this.sourceType = "empty";
    this._startedAt = 0;
    this._progress = 0;
    this._connected = false;
    this.filters = [];
  }
  getOutput() {
    return this.gain;
  }
  setNodeSource(audioNode) {
    this.hasPlaybackControl = false;
    this.sourceType = "audioNode";
    this.source = audioNode;
    this.connect();
    return this;
  }
  setMediaElementSource(mediaElement) {
    this.hasPlaybackControl = false;
    this.sourceType = "mediaNode";
    this.source = this.context.createMediaElementSource(mediaElement);
    this.connect();
    return this;
  }
  setMediaStreamSource(mediaStream) {
    this.hasPlaybackControl = false;
    this.sourceType = "mediaStreamNode";
    this.source = this.context.createMediaStreamSource(mediaStream);
    this.connect();
    return this;
  }
  setBuffer(audioBuffer) {
    this.buffer = audioBuffer;
    this.sourceType = "buffer";
    if (this.autoplay)
      this.play();
    return this;
  }
  play(delay = 0) {
    if (this.isPlaying === true) {
      console.warn("THREE.Audio: Audio is already playing.");
      return;
    }
    if (this.hasPlaybackControl === false) {
      console.warn("THREE.Audio: this Audio has no playback control.");
      return;
    }
    this._startedAt = this.context.currentTime + delay;
    const source = this.context.createBufferSource();
    source.buffer = this.buffer;
    source.loop = this.loop;
    source.loopStart = this.loopStart;
    source.loopEnd = this.loopEnd;
    source.onended = this.onEnded.bind(this);
    source.start(this._startedAt, this._progress + this.offset, this.duration);
    this.isPlaying = true;
    this.source = source;
    this.setDetune(this.detune);
    this.setPlaybackRate(this.playbackRate);
    return this.connect();
  }
  pause() {
    if (this.hasPlaybackControl === false) {
      console.warn("THREE.Audio: this Audio has no playback control.");
      return;
    }
    if (this.isPlaying === true) {
      this._progress += Math.max(this.context.currentTime - this._startedAt, 0) * this.playbackRate;
      if (this.loop === true) {
        this._progress = this._progress % (this.duration || this.buffer.duration);
      }
      this.source.stop();
      this.source.onended = null;
      this.isPlaying = false;
    }
    return this;
  }
  stop() {
    if (this.hasPlaybackControl === false) {
      console.warn("THREE.Audio: this Audio has no playback control.");
      return;
    }
    this._progress = 0;
    this.source.stop();
    this.source.onended = null;
    this.isPlaying = false;
    return this;
  }
  connect() {
    if (this.filters.length > 0) {
      this.source.connect(this.filters[0]);
      for (let i2 = 1, l = this.filters.length; i2 < l; i2++) {
        this.filters[i2 - 1].connect(this.filters[i2]);
      }
      this.filters[this.filters.length - 1].connect(this.getOutput());
    } else {
      this.source.connect(this.getOutput());
    }
    this._connected = true;
    return this;
  }
  disconnect() {
    if (this.filters.length > 0) {
      this.source.disconnect(this.filters[0]);
      for (let i2 = 1, l = this.filters.length; i2 < l; i2++) {
        this.filters[i2 - 1].disconnect(this.filters[i2]);
      }
      this.filters[this.filters.length - 1].disconnect(this.getOutput());
    } else {
      this.source.disconnect(this.getOutput());
    }
    this._connected = false;
    return this;
  }
  getFilters() {
    return this.filters;
  }
  setFilters(value) {
    if (!value)
      value = [];
    if (this._connected === true) {
      this.disconnect();
      this.filters = value.slice();
      this.connect();
    } else {
      this.filters = value.slice();
    }
    return this;
  }
  setDetune(value) {
    this.detune = value;
    if (this.source.detune === void 0)
      return;
    if (this.isPlaying === true) {
      this.source.detune.setTargetAtTime(this.detune, this.context.currentTime, 0.01);
    }
    return this;
  }
  getDetune() {
    return this.detune;
  }
  getFilter() {
    return this.getFilters()[0];
  }
  setFilter(filter) {
    return this.setFilters(filter ? [filter] : []);
  }
  setPlaybackRate(value) {
    if (this.hasPlaybackControl === false) {
      console.warn("THREE.Audio: this Audio has no playback control.");
      return;
    }
    this.playbackRate = value;
    if (this.isPlaying === true) {
      this.source.playbackRate.setTargetAtTime(this.playbackRate, this.context.currentTime, 0.01);
    }
    return this;
  }
  getPlaybackRate() {
    return this.playbackRate;
  }
  onEnded() {
    this.isPlaying = false;
  }
  getLoop() {
    if (this.hasPlaybackControl === false) {
      console.warn("THREE.Audio: this Audio has no playback control.");
      return false;
    }
    return this.loop;
  }
  setLoop(value) {
    if (this.hasPlaybackControl === false) {
      console.warn("THREE.Audio: this Audio has no playback control.");
      return;
    }
    this.loop = value;
    if (this.isPlaying === true) {
      this.source.loop = this.loop;
    }
    return this;
  }
  setLoopStart(value) {
    this.loopStart = value;
    return this;
  }
  setLoopEnd(value) {
    this.loopEnd = value;
    return this;
  }
  getVolume() {
    return this.gain.gain.value;
  }
  setVolume(value) {
    this.gain.gain.setTargetAtTime(value, this.context.currentTime, 0.01);
    return this;
  }
};
var _position = /* @__PURE__ */ new Vector3();
var _quaternion = /* @__PURE__ */ new Quaternion();
var _scale = /* @__PURE__ */ new Vector3();
var _orientation = /* @__PURE__ */ new Vector3();
var PositionalAudio = class extends Audio {
  constructor(listener) {
    super(listener);
    this.panner = this.context.createPanner();
    this.panner.panningModel = "HRTF";
    this.panner.connect(this.gain);
  }
  disconnect() {
    super.disconnect();
    this.panner.disconnect(this.gain);
  }
  getOutput() {
    return this.panner;
  }
  getRefDistance() {
    return this.panner.refDistance;
  }
  setRefDistance(value) {
    this.panner.refDistance = value;
    return this;
  }
  getRolloffFactor() {
    return this.panner.rolloffFactor;
  }
  setRolloffFactor(value) {
    this.panner.rolloffFactor = value;
    return this;
  }
  getDistanceModel() {
    return this.panner.distanceModel;
  }
  setDistanceModel(value) {
    this.panner.distanceModel = value;
    return this;
  }
  getMaxDistance() {
    return this.panner.maxDistance;
  }
  setMaxDistance(value) {
    this.panner.maxDistance = value;
    return this;
  }
  setDirectionalCone(coneInnerAngle, coneOuterAngle, coneOuterGain) {
    this.panner.coneInnerAngle = coneInnerAngle;
    this.panner.coneOuterAngle = coneOuterAngle;
    this.panner.coneOuterGain = coneOuterGain;
    return this;
  }
  updateMatrixWorld(force) {
    super.updateMatrixWorld(force);
    if (this.hasPlaybackControl === true && this.isPlaying === false)
      return;
    this.matrixWorld.decompose(_position, _quaternion, _scale);
    _orientation.set(0, 0, 1).applyQuaternion(_quaternion);
    const panner = this.panner;
    if (panner.positionX) {
      const endTime = this.context.currentTime + this.listener.timeDelta;
      panner.positionX.linearRampToValueAtTime(_position.x, endTime);
      panner.positionY.linearRampToValueAtTime(_position.y, endTime);
      panner.positionZ.linearRampToValueAtTime(_position.z, endTime);
      panner.orientationX.linearRampToValueAtTime(_orientation.x, endTime);
      panner.orientationY.linearRampToValueAtTime(_orientation.y, endTime);
      panner.orientationZ.linearRampToValueAtTime(_orientation.z, endTime);
    } else {
      panner.setPosition(_position.x, _position.y, _position.z);
      panner.setOrientation(_orientation.x, _orientation.y, _orientation.z);
    }
  }
};
var AudioAnalyser = class {
  constructor(audio, fftSize = 2048) {
    this.analyser = audio.context.createAnalyser();
    this.analyser.fftSize = fftSize;
    this.data = new Uint8Array(this.analyser.frequencyBinCount);
    audio.getOutput().connect(this.analyser);
  }
  getFrequencyData() {
    this.analyser.getByteFrequencyData(this.data);
    return this.data;
  }
  getAverageFrequency() {
    let value = 0;
    const data = this.getFrequencyData();
    for (let i2 = 0; i2 < data.length; i2++) {
      value += data[i2];
    }
    return value / data.length;
  }
};
var PropertyMixer = class {
  constructor(binding, typeName2, valueSize) {
    this.binding = binding;
    this.valueSize = valueSize;
    let mixFunction, mixFunctionAdditive, setIdentity;
    switch (typeName2) {
      case "quaternion":
        mixFunction = this._slerp;
        mixFunctionAdditive = this._slerpAdditive;
        setIdentity = this._setAdditiveIdentityQuaternion;
        this.buffer = new Float64Array(valueSize * 6);
        this._workIndex = 5;
        break;
      case "string":
      case "bool":
        mixFunction = this._select;
        mixFunctionAdditive = this._select;
        setIdentity = this._setAdditiveIdentityOther;
        this.buffer = new Array(valueSize * 5);
        break;
      default:
        mixFunction = this._lerp;
        mixFunctionAdditive = this._lerpAdditive;
        setIdentity = this._setAdditiveIdentityNumeric;
        this.buffer = new Float64Array(valueSize * 5);
    }
    this._mixBufferRegion = mixFunction;
    this._mixBufferRegionAdditive = mixFunctionAdditive;
    this._setIdentity = setIdentity;
    this._origIndex = 3;
    this._addIndex = 4;
    this.cumulativeWeight = 0;
    this.cumulativeWeightAdditive = 0;
    this.useCount = 0;
    this.referenceCount = 0;
  }
  // accumulate data in the 'incoming' region into 'accu<i>'
  accumulate(accuIndex, weight) {
    const buffer = this.buffer, stride = this.valueSize, offset = accuIndex * stride + stride;
    let currentWeight = this.cumulativeWeight;
    if (currentWeight === 0) {
      for (let i2 = 0; i2 !== stride; ++i2) {
        buffer[offset + i2] = buffer[i2];
      }
      currentWeight = weight;
    } else {
      currentWeight += weight;
      const mix2 = weight / currentWeight;
      this._mixBufferRegion(buffer, offset, 0, mix2, stride);
    }
    this.cumulativeWeight = currentWeight;
  }
  // accumulate data in the 'incoming' region into 'add'
  accumulateAdditive(weight) {
    const buffer = this.buffer, stride = this.valueSize, offset = stride * this._addIndex;
    if (this.cumulativeWeightAdditive === 0) {
      this._setIdentity();
    }
    this._mixBufferRegionAdditive(buffer, offset, 0, weight, stride);
    this.cumulativeWeightAdditive += weight;
  }
  // apply the state of 'accu<i>' to the binding when accus differ
  apply(accuIndex) {
    const stride = this.valueSize, buffer = this.buffer, offset = accuIndex * stride + stride, weight = this.cumulativeWeight, weightAdditive = this.cumulativeWeightAdditive, binding = this.binding;
    this.cumulativeWeight = 0;
    this.cumulativeWeightAdditive = 0;
    if (weight < 1) {
      const originalValueOffset = stride * this._origIndex;
      this._mixBufferRegion(
        buffer,
        offset,
        originalValueOffset,
        1 - weight,
        stride
      );
    }
    if (weightAdditive > 0) {
      this._mixBufferRegionAdditive(buffer, offset, this._addIndex * stride, 1, stride);
    }
    for (let i2 = stride, e3 = stride + stride; i2 !== e3; ++i2) {
      if (buffer[i2] !== buffer[i2 + stride]) {
        binding.setValue(buffer, offset);
        break;
      }
    }
  }
  // remember the state of the bound property and copy it to both accus
  saveOriginalState() {
    const binding = this.binding;
    const buffer = this.buffer, stride = this.valueSize, originalValueOffset = stride * this._origIndex;
    binding.getValue(buffer, originalValueOffset);
    for (let i2 = stride, e3 = originalValueOffset; i2 !== e3; ++i2) {
      buffer[i2] = buffer[originalValueOffset + i2 % stride];
    }
    this._setIdentity();
    this.cumulativeWeight = 0;
    this.cumulativeWeightAdditive = 0;
  }
  // apply the state previously taken via 'saveOriginalState' to the binding
  restoreOriginalState() {
    const originalValueOffset = this.valueSize * 3;
    this.binding.setValue(this.buffer, originalValueOffset);
  }
  _setAdditiveIdentityNumeric() {
    const startIndex = this._addIndex * this.valueSize;
    const endIndex = startIndex + this.valueSize;
    for (let i2 = startIndex; i2 < endIndex; i2++) {
      this.buffer[i2] = 0;
    }
  }
  _setAdditiveIdentityQuaternion() {
    this._setAdditiveIdentityNumeric();
    this.buffer[this._addIndex * this.valueSize + 3] = 1;
  }
  _setAdditiveIdentityOther() {
    const startIndex = this._origIndex * this.valueSize;
    const targetIndex = this._addIndex * this.valueSize;
    for (let i2 = 0; i2 < this.valueSize; i2++) {
      this.buffer[targetIndex + i2] = this.buffer[startIndex + i2];
    }
  }
  // mix functions
  _select(buffer, dstOffset, srcOffset, t3, stride) {
    if (t3 >= 0.5) {
      for (let i2 = 0; i2 !== stride; ++i2) {
        buffer[dstOffset + i2] = buffer[srcOffset + i2];
      }
    }
  }
  _slerp(buffer, dstOffset, srcOffset, t3) {
    Quaternion.slerpFlat(buffer, dstOffset, buffer, dstOffset, buffer, srcOffset, t3);
  }
  _slerpAdditive(buffer, dstOffset, srcOffset, t3, stride) {
    const workOffset = this._workIndex * stride;
    Quaternion.multiplyQuaternionsFlat(buffer, workOffset, buffer, dstOffset, buffer, srcOffset);
    Quaternion.slerpFlat(buffer, dstOffset, buffer, dstOffset, buffer, workOffset, t3);
  }
  _lerp(buffer, dstOffset, srcOffset, t3, stride) {
    const s2 = 1 - t3;
    for (let i2 = 0; i2 !== stride; ++i2) {
      const j = dstOffset + i2;
      buffer[j] = buffer[j] * s2 + buffer[srcOffset + i2] * t3;
    }
  }
  _lerpAdditive(buffer, dstOffset, srcOffset, t3, stride) {
    for (let i2 = 0; i2 !== stride; ++i2) {
      const j = dstOffset + i2;
      buffer[j] = buffer[j] + buffer[srcOffset + i2] * t3;
    }
  }
};
var _RESERVED_CHARS_RE = "\\[\\]\\.:\\/";
var _reservedRe = new RegExp("[" + _RESERVED_CHARS_RE + "]", "g");
var _wordChar = "[^" + _RESERVED_CHARS_RE + "]";
var _wordCharOrDot = "[^" + _RESERVED_CHARS_RE.replace("\\.", "") + "]";
var _directoryRe = /((?:WC+[\/:])*)/.source.replace("WC", _wordChar);
var _nodeRe = /(WCOD+)?/.source.replace("WCOD", _wordCharOrDot);
var _objectRe = /(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC", _wordChar);
var _propertyRe = /\.(WC+)(?:\[(.+)\])?/.source.replace("WC", _wordChar);
var _trackRe = new RegExp(
  "^" + _directoryRe + _nodeRe + _objectRe + _propertyRe + "$"
);
var _supportedObjectNames = ["material", "materials", "bones"];
var Composite = class {
  constructor(targetGroup, path2, optionalParsedPath) {
    const parsedPath = optionalParsedPath || PropertyBinding.parseTrackName(path2);
    this._targetGroup = targetGroup;
    this._bindings = targetGroup.subscribe_(path2, parsedPath);
  }
  getValue(array, offset) {
    this.bind();
    const firstValidIndex = this._targetGroup.nCachedObjects_, binding = this._bindings[firstValidIndex];
    if (binding !== void 0)
      binding.getValue(array, offset);
  }
  setValue(array, offset) {
    const bindings = this._bindings;
    for (let i2 = this._targetGroup.nCachedObjects_, n2 = bindings.length; i2 !== n2; ++i2) {
      bindings[i2].setValue(array, offset);
    }
  }
  bind() {
    const bindings = this._bindings;
    for (let i2 = this._targetGroup.nCachedObjects_, n2 = bindings.length; i2 !== n2; ++i2) {
      bindings[i2].bind();
    }
  }
  unbind() {
    const bindings = this._bindings;
    for (let i2 = this._targetGroup.nCachedObjects_, n2 = bindings.length; i2 !== n2; ++i2) {
      bindings[i2].unbind();
    }
  }
};
var PropertyBinding = class _PropertyBinding {
  constructor(rootNode, path2, parsedPath) {
    this.path = path2;
    this.parsedPath = parsedPath || _PropertyBinding.parseTrackName(path2);
    this.node = _PropertyBinding.findNode(rootNode, this.parsedPath.nodeName) || rootNode;
    this.rootNode = rootNode;
    this.getValue = this._getValue_unbound;
    this.setValue = this._setValue_unbound;
  }
  static create(root2, path2, parsedPath) {
    if (!(root2 && root2.isAnimationObjectGroup)) {
      return new _PropertyBinding(root2, path2, parsedPath);
    } else {
      return new _PropertyBinding.Composite(root2, path2, parsedPath);
    }
  }
  /**
   * Replaces spaces with underscores and removes unsupported characters from
   * node names, to ensure compatibility with parseTrackName().
   *
   * @param {string} name Node name to be sanitized.
   * @return {string}
   */
  static sanitizeNodeName(name2) {
    return name2.replace(/\s/g, "_").replace(_reservedRe, "");
  }
  static parseTrackName(trackName) {
    const matches = _trackRe.exec(trackName);
    if (matches === null) {
      throw new Error("PropertyBinding: Cannot parse trackName: " + trackName);
    }
    const results = {
      // directoryName: matches[ 1 ], // (tschw) currently unused
      nodeName: matches[2],
      objectName: matches[3],
      objectIndex: matches[4],
      propertyName: matches[5],
      // required
      propertyIndex: matches[6]
    };
    const lastDot = results.nodeName && results.nodeName.lastIndexOf(".");
    if (lastDot !== void 0 && lastDot !== -1) {
      const objectName = results.nodeName.substring(lastDot + 1);
      if (_supportedObjectNames.indexOf(objectName) !== -1) {
        results.nodeName = results.nodeName.substring(0, lastDot);
        results.objectName = objectName;
      }
    }
    if (results.propertyName === null || results.propertyName.length === 0) {
      throw new Error("PropertyBinding: can not parse propertyName from trackName: " + trackName);
    }
    return results;
  }
  static findNode(root2, nodeName) {
    if (nodeName === void 0 || nodeName === "" || nodeName === "." || nodeName === -1 || nodeName === root2.name || nodeName === root2.uuid) {
      return root2;
    }
    if (root2.skeleton) {
      const bone = root2.skeleton.getBoneByName(nodeName);
      if (bone !== void 0) {
        return bone;
      }
    }
    if (root2.children) {
      const searchNodeSubtree = function(children) {
        for (let i2 = 0; i2 < children.length; i2++) {
          const childNode = children[i2];
          if (childNode.name === nodeName || childNode.uuid === nodeName) {
            return childNode;
          }
          const result = searchNodeSubtree(childNode.children);
          if (result)
            return result;
        }
        return null;
      };
      const subTreeNode = searchNodeSubtree(root2.children);
      if (subTreeNode) {
        return subTreeNode;
      }
    }
    return null;
  }
  // these are used to "bind" a nonexistent property
  _getValue_unavailable() {
  }
  _setValue_unavailable() {
  }
  // Getters
  _getValue_direct(buffer, offset) {
    buffer[offset] = this.targetObject[this.propertyName];
  }
  _getValue_array(buffer, offset) {
    const source = this.resolvedProperty;
    for (let i2 = 0, n2 = source.length; i2 !== n2; ++i2) {
      buffer[offset++] = source[i2];
    }
  }
  _getValue_arrayElement(buffer, offset) {
    buffer[offset] = this.resolvedProperty[this.propertyIndex];
  }
  _getValue_toArray(buffer, offset) {
    this.resolvedProperty.toArray(buffer, offset);
  }
  // Direct
  _setValue_direct(buffer, offset) {
    this.targetObject[this.propertyName] = buffer[offset];
  }
  _setValue_direct_setNeedsUpdate(buffer, offset) {
    this.targetObject[this.propertyName] = buffer[offset];
    this.targetObject.needsUpdate = true;
  }
  _setValue_direct_setMatrixWorldNeedsUpdate(buffer, offset) {
    this.targetObject[this.propertyName] = buffer[offset];
    this.targetObject.matrixWorldNeedsUpdate = true;
  }
  // EntireArray
  _setValue_array(buffer, offset) {
    const dest = this.resolvedProperty;
    for (let i2 = 0, n2 = dest.length; i2 !== n2; ++i2) {
      dest[i2] = buffer[offset++];
    }
  }
  _setValue_array_setNeedsUpdate(buffer, offset) {
    const dest = this.resolvedProperty;
    for (let i2 = 0, n2 = dest.length; i2 !== n2; ++i2) {
      dest[i2] = buffer[offset++];
    }
    this.targetObject.needsUpdate = true;
  }
  _setValue_array_setMatrixWorldNeedsUpdate(buffer, offset) {
    const dest = this.resolvedProperty;
    for (let i2 = 0, n2 = dest.length; i2 !== n2; ++i2) {
      dest[i2] = buffer[offset++];
    }
    this.targetObject.matrixWorldNeedsUpdate = true;
  }
  // ArrayElement
  _setValue_arrayElement(buffer, offset) {
    this.resolvedProperty[this.propertyIndex] = buffer[offset];
  }
  _setValue_arrayElement_setNeedsUpdate(buffer, offset) {
    this.resolvedProperty[this.propertyIndex] = buffer[offset];
    this.targetObject.needsUpdate = true;
  }
  _setValue_arrayElement_setMatrixWorldNeedsUpdate(buffer, offset) {
    this.resolvedProperty[this.propertyIndex] = buffer[offset];
    this.targetObject.matrixWorldNeedsUpdate = true;
  }
  // HasToFromArray
  _setValue_fromArray(buffer, offset) {
    this.resolvedProperty.fromArray(buffer, offset);
  }
  _setValue_fromArray_setNeedsUpdate(buffer, offset) {
    this.resolvedProperty.fromArray(buffer, offset);
    this.targetObject.needsUpdate = true;
  }
  _setValue_fromArray_setMatrixWorldNeedsUpdate(buffer, offset) {
    this.resolvedProperty.fromArray(buffer, offset);
    this.targetObject.matrixWorldNeedsUpdate = true;
  }
  _getValue_unbound(targetArray, offset) {
    this.bind();
    this.getValue(targetArray, offset);
  }
  _setValue_unbound(sourceArray, offset) {
    this.bind();
    this.setValue(sourceArray, offset);
  }
  // create getter / setter pair for a property in the scene graph
  bind() {
    let targetObject = this.node;
    const parsedPath = this.parsedPath;
    const objectName = parsedPath.objectName;
    const propertyName2 = parsedPath.propertyName;
    let propertyIndex = parsedPath.propertyIndex;
    if (!targetObject) {
      targetObject = _PropertyBinding.findNode(this.rootNode, parsedPath.nodeName) || this.rootNode;
      this.node = targetObject;
    }
    this.getValue = this._getValue_unavailable;
    this.setValue = this._setValue_unavailable;
    if (!targetObject) {
      console.error("THREE.PropertyBinding: Trying to update node for track: " + this.path + " but it wasn't found.");
      return;
    }
    if (objectName) {
      let objectIndex = parsedPath.objectIndex;
      switch (objectName) {
        case "materials":
          if (!targetObject.material) {
            console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.", this);
            return;
          }
          if (!targetObject.material.materials) {
            console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.", this);
            return;
          }
          targetObject = targetObject.material.materials;
          break;
        case "bones":
          if (!targetObject.skeleton) {
            console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.", this);
            return;
          }
          targetObject = targetObject.skeleton.bones;
          for (let i2 = 0; i2 < targetObject.length; i2++) {
            if (targetObject[i2].name === objectIndex) {
              objectIndex = i2;
              break;
            }
          }
          break;
        default:
          if (targetObject[objectName] === void 0) {
            console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.", this);
            return;
          }
          targetObject = targetObject[objectName];
      }
      if (objectIndex !== void 0) {
        if (targetObject[objectIndex] === void 0) {
          console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.", this, targetObject);
          return;
        }
        targetObject = targetObject[objectIndex];
      }
    }
    const nodeProperty = targetObject[propertyName2];
    if (nodeProperty === void 0) {
      const nodeName = parsedPath.nodeName;
      console.error("THREE.PropertyBinding: Trying to update property for track: " + nodeName + "." + propertyName2 + " but it wasn't found.", targetObject);
      return;
    }
    let versioning = this.Versioning.None;
    this.targetObject = targetObject;
    if (targetObject.needsUpdate !== void 0) {
      versioning = this.Versioning.NeedsUpdate;
    } else if (targetObject.matrixWorldNeedsUpdate !== void 0) {
      versioning = this.Versioning.MatrixWorldNeedsUpdate;
    }
    let bindingType = this.BindingType.Direct;
    if (propertyIndex !== void 0) {
      if (propertyName2 === "morphTargetInfluences") {
        if (!targetObject.geometry) {
          console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.", this);
          return;
        }
        if (targetObject.geometry.isBufferGeometry) {
          if (!targetObject.geometry.morphAttributes) {
            console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.", this);
            return;
          }
          if (targetObject.morphTargetDictionary[propertyIndex] !== void 0) {
            propertyIndex = targetObject.morphTargetDictionary[propertyIndex];
          }
        } else {
          console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences on THREE.Geometry. Use THREE.BufferGeometry instead.", this);
          return;
        }
      }
      bindingType = this.BindingType.ArrayElement;
      this.resolvedProperty = nodeProperty;
      this.propertyIndex = propertyIndex;
    } else if (nodeProperty.fromArray !== void 0 && nodeProperty.toArray !== void 0) {
      bindingType = this.BindingType.HasFromToArray;
      this.resolvedProperty = nodeProperty;
    } else if (Array.isArray(nodeProperty)) {
      bindingType = this.BindingType.EntireArray;
      this.resolvedProperty = nodeProperty;
    } else {
      this.propertyName = propertyName2;
    }
    this.getValue = this.GetterByBindingType[bindingType];
    this.setValue = this.SetterByBindingTypeAndVersioning[bindingType][versioning];
  }
  unbind() {
    this.node = null;
    this.getValue = this._getValue_unbound;
    this.setValue = this._setValue_unbound;
  }
};
PropertyBinding.Composite = Composite;
PropertyBinding.prototype.BindingType = {
  Direct: 0,
  EntireArray: 1,
  ArrayElement: 2,
  HasFromToArray: 3
};
PropertyBinding.prototype.Versioning = {
  None: 0,
  NeedsUpdate: 1,
  MatrixWorldNeedsUpdate: 2
};
PropertyBinding.prototype.GetterByBindingType = [
  PropertyBinding.prototype._getValue_direct,
  PropertyBinding.prototype._getValue_array,
  PropertyBinding.prototype._getValue_arrayElement,
  PropertyBinding.prototype._getValue_toArray
];
PropertyBinding.prototype.SetterByBindingTypeAndVersioning = [
  [
    // Direct
    PropertyBinding.prototype._setValue_direct,
    PropertyBinding.prototype._setValue_direct_setNeedsUpdate,
    PropertyBinding.prototype._setValue_direct_setMatrixWorldNeedsUpdate
  ],
  [
    // EntireArray
    PropertyBinding.prototype._setValue_array,
    PropertyBinding.prototype._setValue_array_setNeedsUpdate,
    PropertyBinding.prototype._setValue_array_setMatrixWorldNeedsUpdate
  ],
  [
    // ArrayElement
    PropertyBinding.prototype._setValue_arrayElement,
    PropertyBinding.prototype._setValue_arrayElement_setNeedsUpdate,
    PropertyBinding.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate
  ],
  [
    // HasToFromArray
    PropertyBinding.prototype._setValue_fromArray,
    PropertyBinding.prototype._setValue_fromArray_setNeedsUpdate,
    PropertyBinding.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate
  ]
];
var AnimationObjectGroup = class {
  constructor() {
    this.uuid = generateUUID();
    this._objects = Array.prototype.slice.call(arguments);
    this.nCachedObjects_ = 0;
    const indices = {};
    this._indicesByUUID = indices;
    for (let i2 = 0, n2 = arguments.length; i2 !== n2; ++i2) {
      indices[arguments[i2].uuid] = i2;
    }
    this._paths = [];
    this._parsedPaths = [];
    this._bindings = [];
    this._bindingsIndicesByPath = {};
    const scope = this;
    this.stats = {
      objects: {
        get total() {
          return scope._objects.length;
        },
        get inUse() {
          return this.total - scope.nCachedObjects_;
        }
      },
      get bindingsPerObject() {
        return scope._bindings.length;
      }
    };
  }
  add() {
    const objects = this._objects, indicesByUUID = this._indicesByUUID, paths = this._paths, parsedPaths = this._parsedPaths, bindings = this._bindings, nBindings = bindings.length;
    let knownObject = void 0, nObjects = objects.length, nCachedObjects = this.nCachedObjects_;
    for (let i2 = 0, n2 = arguments.length; i2 !== n2; ++i2) {
      const object = arguments[i2], uuid = object.uuid;
      let index = indicesByUUID[uuid];
      if (index === void 0) {
        index = nObjects++;
        indicesByUUID[uuid] = index;
        objects.push(object);
        for (let j = 0, m = nBindings; j !== m; ++j) {
          bindings[j].push(new PropertyBinding(object, paths[j], parsedPaths[j]));
        }
      } else if (index < nCachedObjects) {
        knownObject = objects[index];
        const firstActiveIndex = --nCachedObjects, lastCachedObject = objects[firstActiveIndex];
        indicesByUUID[lastCachedObject.uuid] = index;
        objects[index] = lastCachedObject;
        indicesByUUID[uuid] = firstActiveIndex;
        objects[firstActiveIndex] = object;
        for (let j = 0, m = nBindings; j !== m; ++j) {
          const bindingsForPath = bindings[j], lastCached = bindingsForPath[firstActiveIndex];
          let binding = bindingsForPath[index];
          bindingsForPath[index] = lastCached;
          if (binding === void 0) {
            binding = new PropertyBinding(object, paths[j], parsedPaths[j]);
          }
          bindingsForPath[firstActiveIndex] = binding;
        }
      } else if (objects[index] !== knownObject) {
        console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.");
      }
    }
    this.nCachedObjects_ = nCachedObjects;
  }
  remove() {
    const objects = this._objects, indicesByUUID = this._indicesByUUID, bindings = this._bindings, nBindings = bindings.length;
    let nCachedObjects = this.nCachedObjects_;
    for (let i2 = 0, n2 = arguments.length; i2 !== n2; ++i2) {
      const object = arguments[i2], uuid = object.uuid, index = indicesByUUID[uuid];
      if (index !== void 0 && index >= nCachedObjects) {
        const lastCachedIndex = nCachedObjects++, firstActiveObject = objects[lastCachedIndex];
        indicesByUUID[firstActiveObject.uuid] = index;
        objects[index] = firstActiveObject;
        indicesByUUID[uuid] = lastCachedIndex;
        objects[lastCachedIndex] = object;
        for (let j = 0, m = nBindings; j !== m; ++j) {
          const bindingsForPath = bindings[j], firstActive = bindingsForPath[lastCachedIndex], binding = bindingsForPath[index];
          bindingsForPath[index] = firstActive;
          bindingsForPath[lastCachedIndex] = binding;
        }
      }
    }
    this.nCachedObjects_ = nCachedObjects;
  }
  // remove & forget
  uncache() {
    const objects = this._objects, indicesByUUID = this._indicesByUUID, bindings = this._bindings, nBindings = bindings.length;
    let nCachedObjects = this.nCachedObjects_, nObjects = objects.length;
    for (let i2 = 0, n2 = arguments.length; i2 !== n2; ++i2) {
      const object = arguments[i2], uuid = object.uuid, index = indicesByUUID[uuid];
      if (index !== void 0) {
        delete indicesByUUID[uuid];
        if (index < nCachedObjects) {
          const firstActiveIndex = --nCachedObjects, lastCachedObject = objects[firstActiveIndex], lastIndex = --nObjects, lastObject = objects[lastIndex];
          indicesByUUID[lastCachedObject.uuid] = index;
          objects[index] = lastCachedObject;
          indicesByUUID[lastObject.uuid] = firstActiveIndex;
          objects[firstActiveIndex] = lastObject;
          objects.pop();
          for (let j = 0, m = nBindings; j !== m; ++j) {
            const bindingsForPath = bindings[j], lastCached = bindingsForPath[firstActiveIndex], last = bindingsForPath[lastIndex];
            bindingsForPath[index] = lastCached;
            bindingsForPath[firstActiveIndex] = last;
            bindingsForPath.pop();
          }
        } else {
          const lastIndex = --nObjects, lastObject = objects[lastIndex];
          if (lastIndex > 0) {
            indicesByUUID[lastObject.uuid] = index;
          }
          objects[index] = lastObject;
          objects.pop();
          for (let j = 0, m = nBindings; j !== m; ++j) {
            const bindingsForPath = bindings[j];
            bindingsForPath[index] = bindingsForPath[lastIndex];
            bindingsForPath.pop();
          }
        }
      }
    }
    this.nCachedObjects_ = nCachedObjects;
  }
  // Internal interface used by befriended PropertyBinding.Composite:
  subscribe_(path2, parsedPath) {
    const indicesByPath = this._bindingsIndicesByPath;
    let index = indicesByPath[path2];
    const bindings = this._bindings;
    if (index !== void 0)
      return bindings[index];
    const paths = this._paths, parsedPaths = this._parsedPaths, objects = this._objects, nObjects = objects.length, nCachedObjects = this.nCachedObjects_, bindingsForPath = new Array(nObjects);
    index = bindings.length;
    indicesByPath[path2] = index;
    paths.push(path2);
    parsedPaths.push(parsedPath);
    bindings.push(bindingsForPath);
    for (let i2 = nCachedObjects, n2 = objects.length; i2 !== n2; ++i2) {
      const object = objects[i2];
      bindingsForPath[i2] = new PropertyBinding(object, path2, parsedPath);
    }
    return bindingsForPath;
  }
  unsubscribe_(path2) {
    const indicesByPath = this._bindingsIndicesByPath, index = indicesByPath[path2];
    if (index !== void 0) {
      const paths = this._paths, parsedPaths = this._parsedPaths, bindings = this._bindings, lastBindingsIndex = bindings.length - 1, lastBindings = bindings[lastBindingsIndex], lastBindingsPath = path2[lastBindingsIndex];
      indicesByPath[lastBindingsPath] = index;
      bindings[index] = lastBindings;
      bindings.pop();
      parsedPaths[index] = parsedPaths[lastBindingsIndex];
      parsedPaths.pop();
      paths[index] = paths[lastBindingsIndex];
      paths.pop();
    }
  }
};
AnimationObjectGroup.prototype.isAnimationObjectGroup = true;
var AnimationAction = class {
  constructor(mixer, clip, localRoot = null, blendMode = clip.blendMode) {
    this._mixer = mixer;
    this._clip = clip;
    this._localRoot = localRoot;
    this.blendMode = blendMode;
    const tracks = clip.tracks, nTracks = tracks.length, interpolants = new Array(nTracks);
    const interpolantSettings = {
      endingStart: ZeroCurvatureEnding,
      endingEnd: ZeroCurvatureEnding
    };
    for (let i2 = 0; i2 !== nTracks; ++i2) {
      const interpolant = tracks[i2].createInterpolant(null);
      interpolants[i2] = interpolant;
      interpolant.settings = interpolantSettings;
    }
    this._interpolantSettings = interpolantSettings;
    this._interpolants = interpolants;
    this._propertyBindings = new Array(nTracks);
    this._cacheIndex = null;
    this._byClipCacheIndex = null;
    this._timeScaleInterpolant = null;
    this._weightInterpolant = null;
    this.loop = LoopRepeat;
    this._loopCount = -1;
    this._startTime = null;
    this.time = 0;
    this.timeScale = 1;
    this._effectiveTimeScale = 1;
    this.weight = 1;
    this._effectiveWeight = 1;
    this.repetitions = Infinity;
    this.paused = false;
    this.enabled = true;
    this.clampWhenFinished = false;
    this.zeroSlopeAtStart = true;
    this.zeroSlopeAtEnd = true;
  }
  // State & Scheduling
  play() {
    this._mixer._activateAction(this);
    return this;
  }
  stop() {
    this._mixer._deactivateAction(this);
    return this.reset();
  }
  reset() {
    this.paused = false;
    this.enabled = true;
    this.time = 0;
    this._loopCount = -1;
    this._startTime = null;
    return this.stopFading().stopWarping();
  }
  isRunning() {
    return this.enabled && !this.paused && this.timeScale !== 0 && this._startTime === null && this._mixer._isActiveAction(this);
  }
  // return true when play has been called
  isScheduled() {
    return this._mixer._isActiveAction(this);
  }
  startAt(time2) {
    this._startTime = time2;
    return this;
  }
  setLoop(mode, repetitions) {
    this.loop = mode;
    this.repetitions = repetitions;
    return this;
  }
  // Weight
  // set the weight stopping any scheduled fading
  // although .enabled = false yields an effective weight of zero, this
  // method does *not* change .enabled, because it would be confusing
  setEffectiveWeight(weight) {
    this.weight = weight;
    this._effectiveWeight = this.enabled ? weight : 0;
    return this.stopFading();
  }
  // return the weight considering fading and .enabled
  getEffectiveWeight() {
    return this._effectiveWeight;
  }
  fadeIn(duration) {
    return this._scheduleFading(duration, 0, 1);
  }
  fadeOut(duration) {
    return this._scheduleFading(duration, 1, 0);
  }
  crossFadeFrom(fadeOutAction, duration, warp) {
    fadeOutAction.fadeOut(duration);
    this.fadeIn(duration);
    if (warp) {
      const fadeInDuration = this._clip.duration, fadeOutDuration = fadeOutAction._clip.duration, startEndRatio = fadeOutDuration / fadeInDuration, endStartRatio = fadeInDuration / fadeOutDuration;
      fadeOutAction.warp(1, startEndRatio, duration);
      this.warp(endStartRatio, 1, duration);
    }
    return this;
  }
  crossFadeTo(fadeInAction, duration, warp) {
    return fadeInAction.crossFadeFrom(this, duration, warp);
  }
  stopFading() {
    const weightInterpolant = this._weightInterpolant;
    if (weightInterpolant !== null) {
      this._weightInterpolant = null;
      this._mixer._takeBackControlInterpolant(weightInterpolant);
    }
    return this;
  }
  // Time Scale Control
  // set the time scale stopping any scheduled warping
  // although .paused = true yields an effective time scale of zero, this
  // method does *not* change .paused, because it would be confusing
  setEffectiveTimeScale(timeScale) {
    this.timeScale = timeScale;
    this._effectiveTimeScale = this.paused ? 0 : timeScale;
    return this.stopWarping();
  }
  // return the time scale considering warping and .paused
  getEffectiveTimeScale() {
    return this._effectiveTimeScale;
  }
  setDuration(duration) {
    this.timeScale = this._clip.duration / duration;
    return this.stopWarping();
  }
  syncWith(action) {
    this.time = action.time;
    this.timeScale = action.timeScale;
    return this.stopWarping();
  }
  halt(duration) {
    return this.warp(this._effectiveTimeScale, 0, duration);
  }
  warp(startTimeScale, endTimeScale, duration) {
    const mixer = this._mixer, now2 = mixer.time, timeScale = this.timeScale;
    let interpolant = this._timeScaleInterpolant;
    if (interpolant === null) {
      interpolant = mixer._lendControlInterpolant();
      this._timeScaleInterpolant = interpolant;
    }
    const times = interpolant.parameterPositions, values2 = interpolant.sampleValues;
    times[0] = now2;
    times[1] = now2 + duration;
    values2[0] = startTimeScale / timeScale;
    values2[1] = endTimeScale / timeScale;
    return this;
  }
  stopWarping() {
    const timeScaleInterpolant = this._timeScaleInterpolant;
    if (timeScaleInterpolant !== null) {
      this._timeScaleInterpolant = null;
      this._mixer._takeBackControlInterpolant(timeScaleInterpolant);
    }
    return this;
  }
  // Object Accessors
  getMixer() {
    return this._mixer;
  }
  getClip() {
    return this._clip;
  }
  getRoot() {
    return this._localRoot || this._mixer._root;
  }
  // Interna
  _update(time2, deltaTime, timeDirection, accuIndex) {
    if (!this.enabled) {
      this._updateWeight(time2);
      return;
    }
    const startTime = this._startTime;
    if (startTime !== null) {
      const timeRunning = (time2 - startTime) * timeDirection;
      if (timeRunning < 0 || timeDirection === 0) {
        return;
      }
      this._startTime = null;
      deltaTime = timeDirection * timeRunning;
    }
    deltaTime *= this._updateTimeScale(time2);
    const clipTime = this._updateTime(deltaTime);
    const weight = this._updateWeight(time2);
    if (weight > 0) {
      const interpolants = this._interpolants;
      const propertyMixers = this._propertyBindings;
      switch (this.blendMode) {
        case AdditiveAnimationBlendMode:
          for (let j = 0, m = interpolants.length; j !== m; ++j) {
            interpolants[j].evaluate(clipTime);
            propertyMixers[j].accumulateAdditive(weight);
          }
          break;
        case NormalAnimationBlendMode:
        default:
          for (let j = 0, m = interpolants.length; j !== m; ++j) {
            interpolants[j].evaluate(clipTime);
            propertyMixers[j].accumulate(accuIndex, weight);
          }
      }
    }
  }
  _updateWeight(time2) {
    let weight = 0;
    if (this.enabled) {
      weight = this.weight;
      const interpolant = this._weightInterpolant;
      if (interpolant !== null) {
        const interpolantValue = interpolant.evaluate(time2)[0];
        weight *= interpolantValue;
        if (time2 > interpolant.parameterPositions[1]) {
          this.stopFading();
          if (interpolantValue === 0) {
            this.enabled = false;
          }
        }
      }
    }
    this._effectiveWeight = weight;
    return weight;
  }
  _updateTimeScale(time2) {
    let timeScale = 0;
    if (!this.paused) {
      timeScale = this.timeScale;
      const interpolant = this._timeScaleInterpolant;
      if (interpolant !== null) {
        const interpolantValue = interpolant.evaluate(time2)[0];
        timeScale *= interpolantValue;
        if (time2 > interpolant.parameterPositions[1]) {
          this.stopWarping();
          if (timeScale === 0) {
            this.paused = true;
          } else {
            this.timeScale = timeScale;
          }
        }
      }
    }
    this._effectiveTimeScale = timeScale;
    return timeScale;
  }
  _updateTime(deltaTime) {
    const duration = this._clip.duration;
    const loop = this.loop;
    let time2 = this.time + deltaTime;
    let loopCount = this._loopCount;
    const pingPong = loop === LoopPingPong;
    if (deltaTime === 0) {
      if (loopCount === -1)
        return time2;
      return pingPong && (loopCount & 1) === 1 ? duration - time2 : time2;
    }
    if (loop === LoopOnce) {
      if (loopCount === -1) {
        this._loopCount = 0;
        this._setEndings(true, true, false);
      }
      handle_stop: {
        if (time2 >= duration) {
          time2 = duration;
        } else if (time2 < 0) {
          time2 = 0;
        } else {
          this.time = time2;
          break handle_stop;
        }
        if (this.clampWhenFinished)
          this.paused = true;
        else
          this.enabled = false;
        this.time = time2;
        this._mixer.dispatchEvent({
          type: "finished",
          action: this,
          direction: deltaTime < 0 ? -1 : 1
        });
      }
    } else {
      if (loopCount === -1) {
        if (deltaTime >= 0) {
          loopCount = 0;
          this._setEndings(true, this.repetitions === 0, pingPong);
        } else {
          this._setEndings(this.repetitions === 0, true, pingPong);
        }
      }
      if (time2 >= duration || time2 < 0) {
        const loopDelta = Math.floor(time2 / duration);
        time2 -= duration * loopDelta;
        loopCount += Math.abs(loopDelta);
        const pending = this.repetitions - loopCount;
        if (pending <= 0) {
          if (this.clampWhenFinished)
            this.paused = true;
          else
            this.enabled = false;
          time2 = deltaTime > 0 ? duration : 0;
          this.time = time2;
          this._mixer.dispatchEvent({
            type: "finished",
            action: this,
            direction: deltaTime > 0 ? 1 : -1
          });
        } else {
          if (pending === 1) {
            const atStart = deltaTime < 0;
            this._setEndings(atStart, !atStart, pingPong);
          } else {
            this._setEndings(false, false, pingPong);
          }
          this._loopCount = loopCount;
          this.time = time2;
          this._mixer.dispatchEvent({
            type: "loop",
            action: this,
            loopDelta
          });
        }
      } else {
        this.time = time2;
      }
      if (pingPong && (loopCount & 1) === 1) {
        return duration - time2;
      }
    }
    return time2;
  }
  _setEndings(atStart, atEnd, pingPong) {
    const settings = this._interpolantSettings;
    if (pingPong) {
      settings.endingStart = ZeroSlopeEnding;
      settings.endingEnd = ZeroSlopeEnding;
    } else {
      if (atStart) {
        settings.endingStart = this.zeroSlopeAtStart ? ZeroSlopeEnding : ZeroCurvatureEnding;
      } else {
        settings.endingStart = WrapAroundEnding;
      }
      if (atEnd) {
        settings.endingEnd = this.zeroSlopeAtEnd ? ZeroSlopeEnding : ZeroCurvatureEnding;
      } else {
        settings.endingEnd = WrapAroundEnding;
      }
    }
  }
  _scheduleFading(duration, weightNow, weightThen) {
    const mixer = this._mixer, now2 = mixer.time;
    let interpolant = this._weightInterpolant;
    if (interpolant === null) {
      interpolant = mixer._lendControlInterpolant();
      this._weightInterpolant = interpolant;
    }
    const times = interpolant.parameterPositions, values2 = interpolant.sampleValues;
    times[0] = now2;
    values2[0] = weightNow;
    times[1] = now2 + duration;
    values2[1] = weightThen;
    return this;
  }
};
var AnimationMixer = class extends EventDispatcher {
  constructor(root2) {
    super();
    this._root = root2;
    this._initMemoryManager();
    this._accuIndex = 0;
    this.time = 0;
    this.timeScale = 1;
  }
  _bindAction(action, prototypeAction) {
    const root2 = action._localRoot || this._root, tracks = action._clip.tracks, nTracks = tracks.length, bindings = action._propertyBindings, interpolants = action._interpolants, rootUuid = root2.uuid, bindingsByRoot = this._bindingsByRootAndName;
    let bindingsByName = bindingsByRoot[rootUuid];
    if (bindingsByName === void 0) {
      bindingsByName = {};
      bindingsByRoot[rootUuid] = bindingsByName;
    }
    for (let i2 = 0; i2 !== nTracks; ++i2) {
      const track = tracks[i2], trackName = track.name;
      let binding = bindingsByName[trackName];
      if (binding !== void 0) {
        ++binding.referenceCount;
        bindings[i2] = binding;
      } else {
        binding = bindings[i2];
        if (binding !== void 0) {
          if (binding._cacheIndex === null) {
            ++binding.referenceCount;
            this._addInactiveBinding(binding, rootUuid, trackName);
          }
          continue;
        }
        const path2 = prototypeAction && prototypeAction._propertyBindings[i2].binding.parsedPath;
        binding = new PropertyMixer(
          PropertyBinding.create(root2, trackName, path2),
          track.ValueTypeName,
          track.getValueSize()
        );
        ++binding.referenceCount;
        this._addInactiveBinding(binding, rootUuid, trackName);
        bindings[i2] = binding;
      }
      interpolants[i2].resultBuffer = binding.buffer;
    }
  }
  _activateAction(action) {
    if (!this._isActiveAction(action)) {
      if (action._cacheIndex === null) {
        const rootUuid = (action._localRoot || this._root).uuid, clipUuid = action._clip.uuid, actionsForClip = this._actionsByClip[clipUuid];
        this._bindAction(
          action,
          actionsForClip && actionsForClip.knownActions[0]
        );
        this._addInactiveAction(action, clipUuid, rootUuid);
      }
      const bindings = action._propertyBindings;
      for (let i2 = 0, n2 = bindings.length; i2 !== n2; ++i2) {
        const binding = bindings[i2];
        if (binding.useCount++ === 0) {
          this._lendBinding(binding);
          binding.saveOriginalState();
        }
      }
      this._lendAction(action);
    }
  }
  _deactivateAction(action) {
    if (this._isActiveAction(action)) {
      const bindings = action._propertyBindings;
      for (let i2 = 0, n2 = bindings.length; i2 !== n2; ++i2) {
        const binding = bindings[i2];
        if (--binding.useCount === 0) {
          binding.restoreOriginalState();
          this._takeBackBinding(binding);
        }
      }
      this._takeBackAction(action);
    }
  }
  // Memory manager
  _initMemoryManager() {
    this._actions = [];
    this._nActiveActions = 0;
    this._actionsByClip = {};
    this._bindings = [];
    this._nActiveBindings = 0;
    this._bindingsByRootAndName = {};
    this._controlInterpolants = [];
    this._nActiveControlInterpolants = 0;
    const scope = this;
    this.stats = {
      actions: {
        get total() {
          return scope._actions.length;
        },
        get inUse() {
          return scope._nActiveActions;
        }
      },
      bindings: {
        get total() {
          return scope._bindings.length;
        },
        get inUse() {
          return scope._nActiveBindings;
        }
      },
      controlInterpolants: {
        get total() {
          return scope._controlInterpolants.length;
        },
        get inUse() {
          return scope._nActiveControlInterpolants;
        }
      }
    };
  }
  // Memory management for AnimationAction objects
  _isActiveAction(action) {
    const index = action._cacheIndex;
    return index !== null && index < this._nActiveActions;
  }
  _addInactiveAction(action, clipUuid, rootUuid) {
    const actions = this._actions, actionsByClip = this._actionsByClip;
    let actionsForClip = actionsByClip[clipUuid];
    if (actionsForClip === void 0) {
      actionsForClip = {
        knownActions: [action],
        actionByRoot: {}
      };
      action._byClipCacheIndex = 0;
      actionsByClip[clipUuid] = actionsForClip;
    } else {
      const knownActions = actionsForClip.knownActions;
      action._byClipCacheIndex = knownActions.length;
      knownActions.push(action);
    }
    action._cacheIndex = actions.length;
    actions.push(action);
    actionsForClip.actionByRoot[rootUuid] = action;
  }
  _removeInactiveAction(action) {
    const actions = this._actions, lastInactiveAction = actions[actions.length - 1], cacheIndex = action._cacheIndex;
    lastInactiveAction._cacheIndex = cacheIndex;
    actions[cacheIndex] = lastInactiveAction;
    actions.pop();
    action._cacheIndex = null;
    const clipUuid = action._clip.uuid, actionsByClip = this._actionsByClip, actionsForClip = actionsByClip[clipUuid], knownActionsForClip = actionsForClip.knownActions, lastKnownAction = knownActionsForClip[knownActionsForClip.length - 1], byClipCacheIndex = action._byClipCacheIndex;
    lastKnownAction._byClipCacheIndex = byClipCacheIndex;
    knownActionsForClip[byClipCacheIndex] = lastKnownAction;
    knownActionsForClip.pop();
    action._byClipCacheIndex = null;
    const actionByRoot = actionsForClip.actionByRoot, rootUuid = (action._localRoot || this._root).uuid;
    delete actionByRoot[rootUuid];
    if (knownActionsForClip.length === 0) {
      delete actionsByClip[clipUuid];
    }
    this._removeInactiveBindingsForAction(action);
  }
  _removeInactiveBindingsForAction(action) {
    const bindings = action._propertyBindings;
    for (let i2 = 0, n2 = bindings.length; i2 !== n2; ++i2) {
      const binding = bindings[i2];
      if (--binding.referenceCount === 0) {
        this._removeInactiveBinding(binding);
      }
    }
  }
  _lendAction(action) {
    const actions = this._actions, prevIndex = action._cacheIndex, lastActiveIndex = this._nActiveActions++, firstInactiveAction = actions[lastActiveIndex];
    action._cacheIndex = lastActiveIndex;
    actions[lastActiveIndex] = action;
    firstInactiveAction._cacheIndex = prevIndex;
    actions[prevIndex] = firstInactiveAction;
  }
  _takeBackAction(action) {
    const actions = this._actions, prevIndex = action._cacheIndex, firstInactiveIndex = --this._nActiveActions, lastActiveAction = actions[firstInactiveIndex];
    action._cacheIndex = firstInactiveIndex;
    actions[firstInactiveIndex] = action;
    lastActiveAction._cacheIndex = prevIndex;
    actions[prevIndex] = lastActiveAction;
  }
  // Memory management for PropertyMixer objects
  _addInactiveBinding(binding, rootUuid, trackName) {
    const bindingsByRoot = this._bindingsByRootAndName, bindings = this._bindings;
    let bindingByName = bindingsByRoot[rootUuid];
    if (bindingByName === void 0) {
      bindingByName = {};
      bindingsByRoot[rootUuid] = bindingByName;
    }
    bindingByName[trackName] = binding;
    binding._cacheIndex = bindings.length;
    bindings.push(binding);
  }
  _removeInactiveBinding(binding) {
    const bindings = this._bindings, propBinding = binding.binding, rootUuid = propBinding.rootNode.uuid, trackName = propBinding.path, bindingsByRoot = this._bindingsByRootAndName, bindingByName = bindingsByRoot[rootUuid], lastInactiveBinding = bindings[bindings.length - 1], cacheIndex = binding._cacheIndex;
    lastInactiveBinding._cacheIndex = cacheIndex;
    bindings[cacheIndex] = lastInactiveBinding;
    bindings.pop();
    delete bindingByName[trackName];
    if (Object.keys(bindingByName).length === 0) {
      delete bindingsByRoot[rootUuid];
    }
  }
  _lendBinding(binding) {
    const bindings = this._bindings, prevIndex = binding._cacheIndex, lastActiveIndex = this._nActiveBindings++, firstInactiveBinding = bindings[lastActiveIndex];
    binding._cacheIndex = lastActiveIndex;
    bindings[lastActiveIndex] = binding;
    firstInactiveBinding._cacheIndex = prevIndex;
    bindings[prevIndex] = firstInactiveBinding;
  }
  _takeBackBinding(binding) {
    const bindings = this._bindings, prevIndex = binding._cacheIndex, firstInactiveIndex = --this._nActiveBindings, lastActiveBinding = bindings[firstInactiveIndex];
    binding._cacheIndex = firstInactiveIndex;
    bindings[firstInactiveIndex] = binding;
    lastActiveBinding._cacheIndex = prevIndex;
    bindings[prevIndex] = lastActiveBinding;
  }
  // Memory management of Interpolants for weight and time scale
  _lendControlInterpolant() {
    const interpolants = this._controlInterpolants, lastActiveIndex = this._nActiveControlInterpolants++;
    let interpolant = interpolants[lastActiveIndex];
    if (interpolant === void 0) {
      interpolant = new LinearInterpolant(
        new Float32Array(2),
        new Float32Array(2),
        1,
        this._controlInterpolantsResultBuffer
      );
      interpolant.__cacheIndex = lastActiveIndex;
      interpolants[lastActiveIndex] = interpolant;
    }
    return interpolant;
  }
  _takeBackControlInterpolant(interpolant) {
    const interpolants = this._controlInterpolants, prevIndex = interpolant.__cacheIndex, firstInactiveIndex = --this._nActiveControlInterpolants, lastActiveInterpolant = interpolants[firstInactiveIndex];
    interpolant.__cacheIndex = firstInactiveIndex;
    interpolants[firstInactiveIndex] = interpolant;
    lastActiveInterpolant.__cacheIndex = prevIndex;
    interpolants[prevIndex] = lastActiveInterpolant;
  }
  // return an action for a clip optionally using a custom root target
  // object (this method allocates a lot of dynamic memory in case a
  // previously unknown clip/root combination is specified)
  clipAction(clip, optionalRoot, blendMode) {
    const root2 = optionalRoot || this._root, rootUuid = root2.uuid;
    let clipObject = typeof clip === "string" ? AnimationClip.findByName(root2, clip) : clip;
    const clipUuid = clipObject !== null ? clipObject.uuid : clip;
    const actionsForClip = this._actionsByClip[clipUuid];
    let prototypeAction = null;
    if (blendMode === void 0) {
      if (clipObject !== null) {
        blendMode = clipObject.blendMode;
      } else {
        blendMode = NormalAnimationBlendMode;
      }
    }
    if (actionsForClip !== void 0) {
      const existingAction = actionsForClip.actionByRoot[rootUuid];
      if (existingAction !== void 0 && existingAction.blendMode === blendMode) {
        return existingAction;
      }
      prototypeAction = actionsForClip.knownActions[0];
      if (clipObject === null)
        clipObject = prototypeAction._clip;
    }
    if (clipObject === null)
      return null;
    const newAction = new AnimationAction(this, clipObject, optionalRoot, blendMode);
    this._bindAction(newAction, prototypeAction);
    this._addInactiveAction(newAction, clipUuid, rootUuid);
    return newAction;
  }
  // get an existing action
  existingAction(clip, optionalRoot) {
    const root2 = optionalRoot || this._root, rootUuid = root2.uuid, clipObject = typeof clip === "string" ? AnimationClip.findByName(root2, clip) : clip, clipUuid = clipObject ? clipObject.uuid : clip, actionsForClip = this._actionsByClip[clipUuid];
    if (actionsForClip !== void 0) {
      return actionsForClip.actionByRoot[rootUuid] || null;
    }
    return null;
  }
  // deactivates all previously scheduled actions
  stopAllAction() {
    const actions = this._actions, nActions = this._nActiveActions;
    for (let i2 = nActions - 1; i2 >= 0; --i2) {
      actions[i2].stop();
    }
    return this;
  }
  // advance the time and update apply the animation
  update(deltaTime) {
    deltaTime *= this.timeScale;
    const actions = this._actions, nActions = this._nActiveActions, time2 = this.time += deltaTime, timeDirection = Math.sign(deltaTime), accuIndex = this._accuIndex ^= 1;
    for (let i2 = 0; i2 !== nActions; ++i2) {
      const action = actions[i2];
      action._update(time2, deltaTime, timeDirection, accuIndex);
    }
    const bindings = this._bindings, nBindings = this._nActiveBindings;
    for (let i2 = 0; i2 !== nBindings; ++i2) {
      bindings[i2].apply(accuIndex);
    }
    return this;
  }
  // Allows you to seek to a specific time in an animation.
  setTime(timeInSeconds) {
    this.time = 0;
    for (let i2 = 0; i2 < this._actions.length; i2++) {
      this._actions[i2].time = 0;
    }
    return this.update(timeInSeconds);
  }
  // return this mixer's root target object
  getRoot() {
    return this._root;
  }
  // free all resources specific to a particular clip
  uncacheClip(clip) {
    const actions = this._actions, clipUuid = clip.uuid, actionsByClip = this._actionsByClip, actionsForClip = actionsByClip[clipUuid];
    if (actionsForClip !== void 0) {
      const actionsToRemove = actionsForClip.knownActions;
      for (let i2 = 0, n2 = actionsToRemove.length; i2 !== n2; ++i2) {
        const action = actionsToRemove[i2];
        this._deactivateAction(action);
        const cacheIndex = action._cacheIndex, lastInactiveAction = actions[actions.length - 1];
        action._cacheIndex = null;
        action._byClipCacheIndex = null;
        lastInactiveAction._cacheIndex = cacheIndex;
        actions[cacheIndex] = lastInactiveAction;
        actions.pop();
        this._removeInactiveBindingsForAction(action);
      }
      delete actionsByClip[clipUuid];
    }
  }
  // free all resources specific to a particular root target object
  uncacheRoot(root2) {
    const rootUuid = root2.uuid, actionsByClip = this._actionsByClip;
    for (const clipUuid in actionsByClip) {
      const actionByRoot = actionsByClip[clipUuid].actionByRoot, action = actionByRoot[rootUuid];
      if (action !== void 0) {
        this._deactivateAction(action);
        this._removeInactiveAction(action);
      }
    }
    const bindingsByRoot = this._bindingsByRootAndName, bindingByName = bindingsByRoot[rootUuid];
    if (bindingByName !== void 0) {
      for (const trackName in bindingByName) {
        const binding = bindingByName[trackName];
        binding.restoreOriginalState();
        this._removeInactiveBinding(binding);
      }
    }
  }
  // remove a targeted clip from the cache
  uncacheAction(clip, optionalRoot) {
    const action = this.existingAction(clip, optionalRoot);
    if (action !== null) {
      this._deactivateAction(action);
      this._removeInactiveAction(action);
    }
  }
};
AnimationMixer.prototype._controlInterpolantsResultBuffer = new Float32Array(1);
var Uniform = class _Uniform {
  constructor(value) {
    if (typeof value === "string") {
      console.warn("THREE.Uniform: Type parameter is no longer needed.");
      value = arguments[1];
    }
    this.value = value;
  }
  clone() {
    return new _Uniform(this.value.clone === void 0 ? this.value : this.value.clone());
  }
};
var InstancedInterleavedBuffer = class extends InterleavedBuffer {
  constructor(array, stride, meshPerAttribute = 1) {
    super(array, stride);
    this.meshPerAttribute = meshPerAttribute;
  }
  copy(source) {
    super.copy(source);
    this.meshPerAttribute = source.meshPerAttribute;
    return this;
  }
  clone(data) {
    const ib = super.clone(data);
    ib.meshPerAttribute = this.meshPerAttribute;
    return ib;
  }
  toJSON(data) {
    const json3 = super.toJSON(data);
    json3.isInstancedInterleavedBuffer = true;
    json3.meshPerAttribute = this.meshPerAttribute;
    return json3;
  }
};
InstancedInterleavedBuffer.prototype.isInstancedInterleavedBuffer = true;
var GLBufferAttribute = class {
  constructor(buffer, type, itemSize, elementSize, count2) {
    this.buffer = buffer;
    this.type = type;
    this.itemSize = itemSize;
    this.elementSize = elementSize;
    this.count = count2;
    this.version = 0;
  }
  set needsUpdate(value) {
    if (value === true)
      this.version++;
  }
  setBuffer(buffer) {
    this.buffer = buffer;
    return this;
  }
  setType(type, elementSize) {
    this.type = type;
    this.elementSize = elementSize;
    return this;
  }
  setItemSize(itemSize) {
    this.itemSize = itemSize;
    return this;
  }
  setCount(count2) {
    this.count = count2;
    return this;
  }
};
GLBufferAttribute.prototype.isGLBufferAttribute = true;
var Raycaster = class {
  constructor(origin, direction, near = 0, far = Infinity) {
    this.ray = new Ray(origin, direction);
    this.near = near;
    this.far = far;
    this.camera = null;
    this.layers = new Layers();
    this.params = {
      Mesh: {},
      Line: { threshold: 1 },
      LOD: {},
      Points: { threshold: 1 },
      Sprite: {}
    };
  }
  set(origin, direction) {
    this.ray.set(origin, direction);
  }
  setFromCamera(coords, camera) {
    if (camera.isPerspectiveCamera) {
      this.ray.origin.setFromMatrixPosition(camera.matrixWorld);
      this.ray.direction.set(coords.x, coords.y, 0.5).unproject(camera).sub(this.ray.origin).normalize();
      this.camera = camera;
    } else if (camera.isOrthographicCamera) {
      this.ray.origin.set(coords.x, coords.y, (camera.near + camera.far) / (camera.near - camera.far)).unproject(camera);
      this.ray.direction.set(0, 0, -1).transformDirection(camera.matrixWorld);
      this.camera = camera;
    } else {
      console.error("THREE.Raycaster: Unsupported camera type: " + camera.type);
    }
  }
  intersectObject(object, recursive = true, intersects2 = []) {
    intersectObject(object, this, intersects2, recursive);
    intersects2.sort(ascSort);
    return intersects2;
  }
  intersectObjects(objects, recursive = true, intersects2 = []) {
    for (let i2 = 0, l = objects.length; i2 < l; i2++) {
      intersectObject(objects[i2], this, intersects2, recursive);
    }
    intersects2.sort(ascSort);
    return intersects2;
  }
};
function ascSort(a2, b) {
  return a2.distance - b.distance;
}
function intersectObject(object, raycaster, intersects2, recursive) {
  if (object.layers.test(raycaster.layers)) {
    object.raycast(raycaster, intersects2);
  }
  if (recursive === true) {
    const children = object.children;
    for (let i2 = 0, l = children.length; i2 < l; i2++) {
      intersectObject(children[i2], raycaster, intersects2, true);
    }
  }
}
var Spherical = class {
  constructor(radius = 1, phi = 0, theta = 0) {
    this.radius = radius;
    this.phi = phi;
    this.theta = theta;
    return this;
  }
  set(radius, phi, theta) {
    this.radius = radius;
    this.phi = phi;
    this.theta = theta;
    return this;
  }
  copy(other) {
    this.radius = other.radius;
    this.phi = other.phi;
    this.theta = other.theta;
    return this;
  }
  // restrict phi to be between EPS and PI-EPS
  makeSafe() {
    const EPS4 = 1e-6;
    this.phi = Math.max(EPS4, Math.min(Math.PI - EPS4, this.phi));
    return this;
  }
  setFromVector3(v4) {
    return this.setFromCartesianCoords(v4.x, v4.y, v4.z);
  }
  setFromCartesianCoords(x2, y2, z) {
    this.radius = Math.sqrt(x2 * x2 + y2 * y2 + z * z);
    if (this.radius === 0) {
      this.theta = 0;
      this.phi = 0;
    } else {
      this.theta = Math.atan2(x2, z);
      this.phi = Math.acos(clamp(y2 / this.radius, -1, 1));
    }
    return this;
  }
  clone() {
    return new this.constructor().copy(this);
  }
};
var Cylindrical = class {
  constructor(radius = 1, theta = 0, y2 = 0) {
    this.radius = radius;
    this.theta = theta;
    this.y = y2;
    return this;
  }
  set(radius, theta, y2) {
    this.radius = radius;
    this.theta = theta;
    this.y = y2;
    return this;
  }
  copy(other) {
    this.radius = other.radius;
    this.theta = other.theta;
    this.y = other.y;
    return this;
  }
  setFromVector3(v4) {
    return this.setFromCartesianCoords(v4.x, v4.y, v4.z);
  }
  setFromCartesianCoords(x2, y2, z) {
    this.radius = Math.sqrt(x2 * x2 + z * z);
    this.theta = Math.atan2(x2, z);
    this.y = y2;
    return this;
  }
  clone() {
    return new this.constructor().copy(this);
  }
};
var _vector$4 = /* @__PURE__ */ new Vector2();
var Box2 = class {
  constructor(min3 = new Vector2(Infinity, Infinity), max3 = new Vector2(-Infinity, -Infinity)) {
    this.min = min3;
    this.max = max3;
  }
  set(min3, max3) {
    this.min.copy(min3);
    this.max.copy(max3);
    return this;
  }
  setFromPoints(points) {
    this.makeEmpty();
    for (let i2 = 0, il = points.length; i2 < il; i2++) {
      this.expandByPoint(points[i2]);
    }
    return this;
  }
  setFromCenterAndSize(center, size) {
    const halfSize = _vector$4.copy(size).multiplyScalar(0.5);
    this.min.copy(center).sub(halfSize);
    this.max.copy(center).add(halfSize);
    return this;
  }
  clone() {
    return new this.constructor().copy(this);
  }
  copy(box) {
    this.min.copy(box.min);
    this.max.copy(box.max);
    return this;
  }
  makeEmpty() {
    this.min.x = this.min.y = Infinity;
    this.max.x = this.max.y = -Infinity;
    return this;
  }
  isEmpty() {
    return this.max.x < this.min.x || this.max.y < this.min.y;
  }
  getCenter(target) {
    return this.isEmpty() ? target.set(0, 0) : target.addVectors(this.min, this.max).multiplyScalar(0.5);
  }
  getSize(target) {
    return this.isEmpty() ? target.set(0, 0) : target.subVectors(this.max, this.min);
  }
  expandByPoint(point4) {
    this.min.min(point4);
    this.max.max(point4);
    return this;
  }
  expandByVector(vector) {
    this.min.sub(vector);
    this.max.add(vector);
    return this;
  }
  expandByScalar(scalar) {
    this.min.addScalar(-scalar);
    this.max.addScalar(scalar);
    return this;
  }
  containsPoint(point4) {
    return point4.x < this.min.x || point4.x > this.max.x || point4.y < this.min.y || point4.y > this.max.y ? false : true;
  }
  containsBox(box) {
    return this.min.x <= box.min.x && box.max.x <= this.max.x && this.min.y <= box.min.y && box.max.y <= this.max.y;
  }
  getParameter(point4, target) {
    return target.set(
      (point4.x - this.min.x) / (this.max.x - this.min.x),
      (point4.y - this.min.y) / (this.max.y - this.min.y)
    );
  }
  intersectsBox(box) {
    return box.max.x < this.min.x || box.min.x > this.max.x || box.max.y < this.min.y || box.min.y > this.max.y ? false : true;
  }
  clampPoint(point4, target) {
    return target.copy(point4).clamp(this.min, this.max);
  }
  distanceToPoint(point4) {
    const clampedPoint = _vector$4.copy(point4).clamp(this.min, this.max);
    return clampedPoint.sub(point4).length();
  }
  intersect(box) {
    this.min.max(box.min);
    this.max.min(box.max);
    return this;
  }
  union(box) {
    this.min.min(box.min);
    this.max.max(box.max);
    return this;
  }
  translate(offset) {
    this.min.add(offset);
    this.max.add(offset);
    return this;
  }
  equals(box) {
    return box.min.equals(this.min) && box.max.equals(this.max);
  }
};
Box2.prototype.isBox2 = true;
var _startP = /* @__PURE__ */ new Vector3();
var _startEnd = /* @__PURE__ */ new Vector3();
var Line3 = class {
  constructor(start = new Vector3(), end = new Vector3()) {
    this.start = start;
    this.end = end;
  }
  set(start, end) {
    this.start.copy(start);
    this.end.copy(end);
    return this;
  }
  copy(line2) {
    this.start.copy(line2.start);
    this.end.copy(line2.end);
    return this;
  }
  getCenter(target) {
    return target.addVectors(this.start, this.end).multiplyScalar(0.5);
  }
  delta(target) {
    return target.subVectors(this.end, this.start);
  }
  distanceSq() {
    return this.start.distanceToSquared(this.end);
  }
  distance() {
    return this.start.distanceTo(this.end);
  }
  at(t3, target) {
    return this.delta(target).multiplyScalar(t3).add(this.start);
  }
  closestPointToPointParameter(point4, clampToLine) {
    _startP.subVectors(point4, this.start);
    _startEnd.subVectors(this.end, this.start);
    const startEnd2 = _startEnd.dot(_startEnd);
    const startEnd_startP = _startEnd.dot(_startP);
    let t3 = startEnd_startP / startEnd2;
    if (clampToLine) {
      t3 = clamp(t3, 0, 1);
    }
    return t3;
  }
  closestPointToPoint(point4, clampToLine, target) {
    const t3 = this.closestPointToPointParameter(point4, clampToLine);
    return this.delta(target).multiplyScalar(t3).add(this.start);
  }
  applyMatrix4(matrix) {
    this.start.applyMatrix4(matrix);
    this.end.applyMatrix4(matrix);
    return this;
  }
  equals(line2) {
    return line2.start.equals(this.start) && line2.end.equals(this.end);
  }
  clone() {
    return new this.constructor().copy(this);
  }
};
var _vector$3 = /* @__PURE__ */ new Vector3();
var SpotLightHelper = class extends Object3D {
  constructor(light, color2) {
    super();
    this.light = light;
    this.light.updateMatrixWorld();
    this.matrix = light.matrixWorld;
    this.matrixAutoUpdate = false;
    this.color = color2;
    const geometry = new BufferGeometry();
    const positions = [
      0,
      0,
      0,
      0,
      0,
      1,
      0,
      0,
      0,
      1,
      0,
      1,
      0,
      0,
      0,
      -1,
      0,
      1,
      0,
      0,
      0,
      0,
      1,
      1,
      0,
      0,
      0,
      0,
      -1,
      1
    ];
    for (let i2 = 0, j = 1, l = 32; i2 < l; i2++, j++) {
      const p1 = i2 / l * Math.PI * 2;
      const p2 = j / l * Math.PI * 2;
      positions.push(
        Math.cos(p1),
        Math.sin(p1),
        1,
        Math.cos(p2),
        Math.sin(p2),
        1
      );
    }
    geometry.setAttribute("position", new Float32BufferAttribute(positions, 3));
    const material = new LineBasicMaterial({ fog: false, toneMapped: false });
    this.cone = new LineSegments(geometry, material);
    this.add(this.cone);
    this.update();
  }
  dispose() {
    this.cone.geometry.dispose();
    this.cone.material.dispose();
  }
  update() {
    this.light.updateMatrixWorld();
    const coneLength = this.light.distance ? this.light.distance : 1e3;
    const coneWidth = coneLength * Math.tan(this.light.angle);
    this.cone.scale.set(coneWidth, coneWidth, coneLength);
    _vector$3.setFromMatrixPosition(this.light.target.matrixWorld);
    this.cone.lookAt(_vector$3);
    if (this.color !== void 0) {
      this.cone.material.color.set(this.color);
    } else {
      this.cone.material.color.copy(this.light.color);
    }
  }
};
var _vector$2 = /* @__PURE__ */ new Vector3();
var _boneMatrix = /* @__PURE__ */ new Matrix4();
var _matrixWorldInv = /* @__PURE__ */ new Matrix4();
var SkeletonHelper = class extends LineSegments {
  constructor(object) {
    const bones = getBoneList(object);
    const geometry = new BufferGeometry();
    const vertices = [];
    const colors = [];
    const color1 = new Color2(0, 0, 1);
    const color2 = new Color2(0, 1, 0);
    for (let i2 = 0; i2 < bones.length; i2++) {
      const bone = bones[i2];
      if (bone.parent && bone.parent.isBone) {
        vertices.push(0, 0, 0);
        vertices.push(0, 0, 0);
        colors.push(color1.r, color1.g, color1.b);
        colors.push(color2.r, color2.g, color2.b);
      }
    }
    geometry.setAttribute("position", new Float32BufferAttribute(vertices, 3));
    geometry.setAttribute("color", new Float32BufferAttribute(colors, 3));
    const material = new LineBasicMaterial({ vertexColors: true, depthTest: false, depthWrite: false, toneMapped: false, transparent: true });
    super(geometry, material);
    this.type = "SkeletonHelper";
    this.isSkeletonHelper = true;
    this.root = object;
    this.bones = bones;
    this.matrix = object.matrixWorld;
    this.matrixAutoUpdate = false;
  }
  updateMatrixWorld(force) {
    const bones = this.bones;
    const geometry = this.geometry;
    const position2 = geometry.getAttribute("position");
    _matrixWorldInv.copy(this.root.matrixWorld).invert();
    for (let i2 = 0, j = 0; i2 < bones.length; i2++) {
      const bone = bones[i2];
      if (bone.parent && bone.parent.isBone) {
        _boneMatrix.multiplyMatrices(_matrixWorldInv, bone.matrixWorld);
        _vector$2.setFromMatrixPosition(_boneMatrix);
        position2.setXYZ(j, _vector$2.x, _vector$2.y, _vector$2.z);
        _boneMatrix.multiplyMatrices(_matrixWorldInv, bone.parent.matrixWorld);
        _vector$2.setFromMatrixPosition(_boneMatrix);
        position2.setXYZ(j + 1, _vector$2.x, _vector$2.y, _vector$2.z);
        j += 2;
      }
    }
    geometry.getAttribute("position").needsUpdate = true;
    super.updateMatrixWorld(force);
  }
};
function getBoneList(object) {
  const boneList = [];
  if (object.isBone === true) {
    boneList.push(object);
  }
  for (let i2 = 0; i2 < object.children.length; i2++) {
    boneList.push.apply(boneList, getBoneList(object.children[i2]));
  }
  return boneList;
}
var PointLightHelper = class extends Mesh {
  constructor(light, sphereSize, color2) {
    const geometry = new SphereGeometry(sphereSize, 4, 2);
    const material = new MeshBasicMaterial({ wireframe: true, fog: false, toneMapped: false });
    super(geometry, material);
    this.light = light;
    this.light.updateMatrixWorld();
    this.color = color2;
    this.type = "PointLightHelper";
    this.matrix = this.light.matrixWorld;
    this.matrixAutoUpdate = false;
    this.update();
  }
  dispose() {
    this.geometry.dispose();
    this.material.dispose();
  }
  update() {
    if (this.color !== void 0) {
      this.material.color.set(this.color);
    } else {
      this.material.color.copy(this.light.color);
    }
  }
};
var _vector$1 = /* @__PURE__ */ new Vector3();
var _color1 = /* @__PURE__ */ new Color2();
var _color2 = /* @__PURE__ */ new Color2();
var HemisphereLightHelper = class extends Object3D {
  constructor(light, size, color2) {
    super();
    this.light = light;
    this.light.updateMatrixWorld();
    this.matrix = light.matrixWorld;
    this.matrixAutoUpdate = false;
    this.color = color2;
    const geometry = new OctahedronGeometry(size);
    geometry.rotateY(Math.PI * 0.5);
    this.material = new MeshBasicMaterial({ wireframe: true, fog: false, toneMapped: false });
    if (this.color === void 0)
      this.material.vertexColors = true;
    const position2 = geometry.getAttribute("position");
    const colors = new Float32Array(position2.count * 3);
    geometry.setAttribute("color", new BufferAttribute(colors, 3));
    this.add(new Mesh(geometry, this.material));
    this.update();
  }
  dispose() {
    this.children[0].geometry.dispose();
    this.children[0].material.dispose();
  }
  update() {
    const mesh = this.children[0];
    if (this.color !== void 0) {
      this.material.color.set(this.color);
    } else {
      const colors = mesh.geometry.getAttribute("color");
      _color1.copy(this.light.color);
      _color2.copy(this.light.groundColor);
      for (let i2 = 0, l = colors.count; i2 < l; i2++) {
        const color2 = i2 < l / 2 ? _color1 : _color2;
        colors.setXYZ(i2, color2.r, color2.g, color2.b);
      }
      colors.needsUpdate = true;
    }
    mesh.lookAt(_vector$1.setFromMatrixPosition(this.light.matrixWorld).negate());
  }
};
var GridHelper = class extends LineSegments {
  constructor(size = 10, divisions = 10, color1 = 4473924, color2 = 8947848) {
    color1 = new Color2(color1);
    color2 = new Color2(color2);
    const center = divisions / 2;
    const step = size / divisions;
    const halfSize = size / 2;
    const vertices = [], colors = [];
    for (let i2 = 0, j = 0, k2 = -halfSize; i2 <= divisions; i2++, k2 += step) {
      vertices.push(-halfSize, 0, k2, halfSize, 0, k2);
      vertices.push(k2, 0, -halfSize, k2, 0, halfSize);
      const color3 = i2 === center ? color1 : color2;
      color3.toArray(colors, j);
      j += 3;
      color3.toArray(colors, j);
      j += 3;
      color3.toArray(colors, j);
      j += 3;
      color3.toArray(colors, j);
      j += 3;
    }
    const geometry = new BufferGeometry();
    geometry.setAttribute("position", new Float32BufferAttribute(vertices, 3));
    geometry.setAttribute("color", new Float32BufferAttribute(colors, 3));
    const material = new LineBasicMaterial({ vertexColors: true, toneMapped: false });
    super(geometry, material);
    this.type = "GridHelper";
  }
};
var PolarGridHelper = class extends LineSegments {
  constructor(radius = 10, radials = 16, circles = 8, divisions = 64, color1 = 4473924, color2 = 8947848) {
    color1 = new Color2(color1);
    color2 = new Color2(color2);
    const vertices = [];
    const colors = [];
    for (let i2 = 0; i2 <= radials; i2++) {
      const v4 = i2 / radials * (Math.PI * 2);
      const x2 = Math.sin(v4) * radius;
      const z = Math.cos(v4) * radius;
      vertices.push(0, 0, 0);
      vertices.push(x2, 0, z);
      const color3 = i2 & 1 ? color1 : color2;
      colors.push(color3.r, color3.g, color3.b);
      colors.push(color3.r, color3.g, color3.b);
    }
    for (let i2 = 0; i2 <= circles; i2++) {
      const color3 = i2 & 1 ? color1 : color2;
      const r3 = radius - radius / circles * i2;
      for (let j = 0; j < divisions; j++) {
        let v4 = j / divisions * (Math.PI * 2);
        let x2 = Math.sin(v4) * r3;
        let z = Math.cos(v4) * r3;
        vertices.push(x2, 0, z);
        colors.push(color3.r, color3.g, color3.b);
        v4 = (j + 1) / divisions * (Math.PI * 2);
        x2 = Math.sin(v4) * r3;
        z = Math.cos(v4) * r3;
        vertices.push(x2, 0, z);
        colors.push(color3.r, color3.g, color3.b);
      }
    }
    const geometry = new BufferGeometry();
    geometry.setAttribute("position", new Float32BufferAttribute(vertices, 3));
    geometry.setAttribute("color", new Float32BufferAttribute(colors, 3));
    const material = new LineBasicMaterial({ vertexColors: true, toneMapped: false });
    super(geometry, material);
    this.type = "PolarGridHelper";
  }
};
var _v1 = /* @__PURE__ */ new Vector3();
var _v2 = /* @__PURE__ */ new Vector3();
var _v3 = /* @__PURE__ */ new Vector3();
var DirectionalLightHelper = class extends Object3D {
  constructor(light, size, color2) {
    super();
    this.light = light;
    this.light.updateMatrixWorld();
    this.matrix = light.matrixWorld;
    this.matrixAutoUpdate = false;
    this.color = color2;
    if (size === void 0)
      size = 1;
    let geometry = new BufferGeometry();
    geometry.setAttribute("position", new Float32BufferAttribute([
      -size,
      size,
      0,
      size,
      size,
      0,
      size,
      -size,
      0,
      -size,
      -size,
      0,
      -size,
      size,
      0
    ], 3));
    const material = new LineBasicMaterial({ fog: false, toneMapped: false });
    this.lightPlane = new Line(geometry, material);
    this.add(this.lightPlane);
    geometry = new BufferGeometry();
    geometry.setAttribute("position", new Float32BufferAttribute([0, 0, 0, 0, 0, 1], 3));
    this.targetLine = new Line(geometry, material);
    this.add(this.targetLine);
    this.update();
  }
  dispose() {
    this.lightPlane.geometry.dispose();
    this.lightPlane.material.dispose();
    this.targetLine.geometry.dispose();
    this.targetLine.material.dispose();
  }
  update() {
    _v1.setFromMatrixPosition(this.light.matrixWorld);
    _v2.setFromMatrixPosition(this.light.target.matrixWorld);
    _v3.subVectors(_v2, _v1);
    this.lightPlane.lookAt(_v2);
    if (this.color !== void 0) {
      this.lightPlane.material.color.set(this.color);
      this.targetLine.material.color.set(this.color);
    } else {
      this.lightPlane.material.color.copy(this.light.color);
      this.targetLine.material.color.copy(this.light.color);
    }
    this.targetLine.lookAt(_v2);
    this.targetLine.scale.z = _v3.length();
  }
};
var _vector = /* @__PURE__ */ new Vector3();
var _camera = /* @__PURE__ */ new Camera();
var CameraHelper = class extends LineSegments {
  constructor(camera) {
    const geometry = new BufferGeometry();
    const material = new LineBasicMaterial({ color: 16777215, vertexColors: true, toneMapped: false });
    const vertices = [];
    const colors = [];
    const pointMap = {};
    const colorFrustum = new Color2(16755200);
    const colorCone = new Color2(16711680);
    const colorUp = new Color2(43775);
    const colorTarget = new Color2(16777215);
    const colorCross = new Color2(3355443);
    addLine("n1", "n2", colorFrustum);
    addLine("n2", "n4", colorFrustum);
    addLine("n4", "n3", colorFrustum);
    addLine("n3", "n1", colorFrustum);
    addLine("f1", "f2", colorFrustum);
    addLine("f2", "f4", colorFrustum);
    addLine("f4", "f3", colorFrustum);
    addLine("f3", "f1", colorFrustum);
    addLine("n1", "f1", colorFrustum);
    addLine("n2", "f2", colorFrustum);
    addLine("n3", "f3", colorFrustum);
    addLine("n4", "f4", colorFrustum);
    addLine("p", "n1", colorCone);
    addLine("p", "n2", colorCone);
    addLine("p", "n3", colorCone);
    addLine("p", "n4", colorCone);
    addLine("u1", "u2", colorUp);
    addLine("u2", "u3", colorUp);
    addLine("u3", "u1", colorUp);
    addLine("c", "t", colorTarget);
    addLine("p", "c", colorCross);
    addLine("cn1", "cn2", colorCross);
    addLine("cn3", "cn4", colorCross);
    addLine("cf1", "cf2", colorCross);
    addLine("cf3", "cf4", colorCross);
    function addLine(a2, b, color2) {
      addPoint(a2, color2);
      addPoint(b, color2);
    }
    function addPoint(id2, color2) {
      vertices.push(0, 0, 0);
      colors.push(color2.r, color2.g, color2.b);
      if (pointMap[id2] === void 0) {
        pointMap[id2] = [];
      }
      pointMap[id2].push(vertices.length / 3 - 1);
    }
    geometry.setAttribute("position", new Float32BufferAttribute(vertices, 3));
    geometry.setAttribute("color", new Float32BufferAttribute(colors, 3));
    super(geometry, material);
    this.type = "CameraHelper";
    this.camera = camera;
    if (this.camera.updateProjectionMatrix)
      this.camera.updateProjectionMatrix();
    this.matrix = camera.matrixWorld;
    this.matrixAutoUpdate = false;
    this.pointMap = pointMap;
    this.update();
  }
  update() {
    const geometry = this.geometry;
    const pointMap = this.pointMap;
    const w = 1, h = 1;
    _camera.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse);
    setPoint("c", pointMap, geometry, _camera, 0, 0, -1);
    setPoint("t", pointMap, geometry, _camera, 0, 0, 1);
    setPoint("n1", pointMap, geometry, _camera, -w, -h, -1);
    setPoint("n2", pointMap, geometry, _camera, w, -h, -1);
    setPoint("n3", pointMap, geometry, _camera, -w, h, -1);
    setPoint("n4", pointMap, geometry, _camera, w, h, -1);
    setPoint("f1", pointMap, geometry, _camera, -w, -h, 1);
    setPoint("f2", pointMap, geometry, _camera, w, -h, 1);
    setPoint("f3", pointMap, geometry, _camera, -w, h, 1);
    setPoint("f4", pointMap, geometry, _camera, w, h, 1);
    setPoint("u1", pointMap, geometry, _camera, w * 0.7, h * 1.1, -1);
    setPoint("u2", pointMap, geometry, _camera, -w * 0.7, h * 1.1, -1);
    setPoint("u3", pointMap, geometry, _camera, 0, h * 2, -1);
    setPoint("cf1", pointMap, geometry, _camera, -w, 0, 1);
    setPoint("cf2", pointMap, geometry, _camera, w, 0, 1);
    setPoint("cf3", pointMap, geometry, _camera, 0, -h, 1);
    setPoint("cf4", pointMap, geometry, _camera, 0, h, 1);
    setPoint("cn1", pointMap, geometry, _camera, -w, 0, -1);
    setPoint("cn2", pointMap, geometry, _camera, w, 0, -1);
    setPoint("cn3", pointMap, geometry, _camera, 0, -h, -1);
    setPoint("cn4", pointMap, geometry, _camera, 0, h, -1);
    geometry.getAttribute("position").needsUpdate = true;
  }
  dispose() {
    this.geometry.dispose();
    this.material.dispose();
  }
};
function setPoint(point4, pointMap, geometry, camera, x2, y2, z) {
  _vector.set(x2, y2, z).unproject(camera);
  const points = pointMap[point4];
  if (points !== void 0) {
    const position2 = geometry.getAttribute("position");
    for (let i2 = 0, l = points.length; i2 < l; i2++) {
      position2.setXYZ(points[i2], _vector.x, _vector.y, _vector.z);
    }
  }
}
var _box = /* @__PURE__ */ new Box3();
var BoxHelper = class extends LineSegments {
  constructor(object, color2 = 16776960) {
    const indices = new Uint16Array([0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 4, 1, 5, 2, 6, 3, 7]);
    const positions = new Float32Array(8 * 3);
    const geometry = new BufferGeometry();
    geometry.setIndex(new BufferAttribute(indices, 1));
    geometry.setAttribute("position", new BufferAttribute(positions, 3));
    super(geometry, new LineBasicMaterial({ color: color2, toneMapped: false }));
    this.object = object;
    this.type = "BoxHelper";
    this.matrixAutoUpdate = false;
    this.update();
  }
  update(object) {
    if (object !== void 0) {
      console.warn("THREE.BoxHelper: .update() has no longer arguments.");
    }
    if (this.object !== void 0) {
      _box.setFromObject(this.object);
    }
    if (_box.isEmpty())
      return;
    const min3 = _box.min;
    const max3 = _box.max;
    const position2 = this.geometry.attributes.position;
    const array = position2.array;
    array[0] = max3.x;
    array[1] = max3.y;
    array[2] = max3.z;
    array[3] = min3.x;
    array[4] = max3.y;
    array[5] = max3.z;
    array[6] = min3.x;
    array[7] = min3.y;
    array[8] = max3.z;
    array[9] = max3.x;
    array[10] = min3.y;
    array[11] = max3.z;
    array[12] = max3.x;
    array[13] = max3.y;
    array[14] = min3.z;
    array[15] = min3.x;
    array[16] = max3.y;
    array[17] = min3.z;
    array[18] = min3.x;
    array[19] = min3.y;
    array[20] = min3.z;
    array[21] = max3.x;
    array[22] = min3.y;
    array[23] = min3.z;
    position2.needsUpdate = true;
    this.geometry.computeBoundingSphere();
  }
  setFromObject(object) {
    this.object = object;
    this.update();
    return this;
  }
  copy(source) {
    LineSegments.prototype.copy.call(this, source);
    this.object = source.object;
    return this;
  }
};
var Box3Helper = class extends LineSegments {
  constructor(box, color2 = 16776960) {
    const indices = new Uint16Array([0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 4, 1, 5, 2, 6, 3, 7]);
    const positions = [1, 1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1, 1, 1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1];
    const geometry = new BufferGeometry();
    geometry.setIndex(new BufferAttribute(indices, 1));
    geometry.setAttribute("position", new Float32BufferAttribute(positions, 3));
    super(geometry, new LineBasicMaterial({ color: color2, toneMapped: false }));
    this.box = box;
    this.type = "Box3Helper";
    this.geometry.computeBoundingSphere();
  }
  updateMatrixWorld(force) {
    const box = this.box;
    if (box.isEmpty())
      return;
    box.getCenter(this.position);
    box.getSize(this.scale);
    this.scale.multiplyScalar(0.5);
    super.updateMatrixWorld(force);
  }
};
var PlaneHelper = class extends Line {
  constructor(plane, size = 1, hex2 = 16776960) {
    const color2 = hex2;
    const positions = [1, -1, 1, -1, 1, 1, -1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0];
    const geometry = new BufferGeometry();
    geometry.setAttribute("position", new Float32BufferAttribute(positions, 3));
    geometry.computeBoundingSphere();
    super(geometry, new LineBasicMaterial({ color: color2, toneMapped: false }));
    this.type = "PlaneHelper";
    this.plane = plane;
    this.size = size;
    const positions2 = [1, 1, 1, -1, 1, 1, -1, -1, 1, 1, 1, 1, -1, -1, 1, 1, -1, 1];
    const geometry2 = new BufferGeometry();
    geometry2.setAttribute("position", new Float32BufferAttribute(positions2, 3));
    geometry2.computeBoundingSphere();
    this.add(new Mesh(geometry2, new MeshBasicMaterial({ color: color2, opacity: 0.2, transparent: true, depthWrite: false, toneMapped: false })));
  }
  updateMatrixWorld(force) {
    let scale = -this.plane.constant;
    if (Math.abs(scale) < 1e-8)
      scale = 1e-8;
    this.scale.set(0.5 * this.size, 0.5 * this.size, scale);
    this.children[0].material.side = scale < 0 ? BackSide : FrontSide;
    this.lookAt(this.plane.normal);
    super.updateMatrixWorld(force);
  }
};
var _axis = /* @__PURE__ */ new Vector3();
var _lineGeometry;
var _coneGeometry;
var ArrowHelper = class extends Object3D {
  // dir is assumed to be normalized
  constructor(dir = new Vector3(0, 0, 1), origin = new Vector3(0, 0, 0), length2 = 1, color2 = 16776960, headLength = length2 * 0.2, headWidth = headLength * 0.2) {
    super();
    this.type = "ArrowHelper";
    if (_lineGeometry === void 0) {
      _lineGeometry = new BufferGeometry();
      _lineGeometry.setAttribute("position", new Float32BufferAttribute([0, 0, 0, 0, 1, 0], 3));
      _coneGeometry = new CylinderGeometry(0, 0.5, 1, 5, 1);
      _coneGeometry.translate(0, -0.5, 0);
    }
    this.position.copy(origin);
    this.line = new Line(_lineGeometry, new LineBasicMaterial({ color: color2, toneMapped: false }));
    this.line.matrixAutoUpdate = false;
    this.add(this.line);
    this.cone = new Mesh(_coneGeometry, new MeshBasicMaterial({ color: color2, toneMapped: false }));
    this.cone.matrixAutoUpdate = false;
    this.add(this.cone);
    this.setDirection(dir);
    this.setLength(length2, headLength, headWidth);
  }
  setDirection(dir) {
    if (dir.y > 0.99999) {
      this.quaternion.set(0, 0, 0, 1);
    } else if (dir.y < -0.99999) {
      this.quaternion.set(1, 0, 0, 0);
    } else {
      _axis.set(dir.z, 0, -dir.x).normalize();
      const radians2 = Math.acos(dir.y);
      this.quaternion.setFromAxisAngle(_axis, radians2);
    }
  }
  setLength(length2, headLength = length2 * 0.2, headWidth = headLength * 0.2) {
    this.line.scale.set(1, Math.max(1e-4, length2 - headLength), 1);
    this.line.updateMatrix();
    this.cone.scale.set(headWidth, headLength, headWidth);
    this.cone.position.y = length2;
    this.cone.updateMatrix();
  }
  setColor(color2) {
    this.line.material.color.set(color2);
    this.cone.material.color.set(color2);
  }
  copy(source) {
    super.copy(source, false);
    this.line.copy(source.line);
    this.cone.copy(source.cone);
    return this;
  }
};
var AxesHelper = class extends LineSegments {
  constructor(size = 1) {
    const vertices = [
      0,
      0,
      0,
      size,
      0,
      0,
      0,
      0,
      0,
      0,
      size,
      0,
      0,
      0,
      0,
      0,
      0,
      size
    ];
    const colors = [
      1,
      0,
      0,
      1,
      0.6,
      0,
      0,
      1,
      0,
      0.6,
      1,
      0,
      0,
      0,
      1,
      0,
      0.6,
      1
    ];
    const geometry = new BufferGeometry();
    geometry.setAttribute("position", new Float32BufferAttribute(vertices, 3));
    geometry.setAttribute("color", new Float32BufferAttribute(colors, 3));
    const material = new LineBasicMaterial({ vertexColors: true, toneMapped: false });
    super(geometry, material);
    this.type = "AxesHelper";
  }
  setColors(xAxisColor, yAxisColor, zAxisColor) {
    const color2 = new Color2();
    const array = this.geometry.attributes.color.array;
    color2.set(xAxisColor);
    color2.toArray(array, 0);
    color2.toArray(array, 3);
    color2.set(yAxisColor);
    color2.toArray(array, 6);
    color2.toArray(array, 9);
    color2.set(zAxisColor);
    color2.toArray(array, 12);
    color2.toArray(array, 15);
    this.geometry.attributes.color.needsUpdate = true;
    return this;
  }
  dispose() {
    this.geometry.dispose();
    this.material.dispose();
  }
};
var ShapePath = class {
  constructor() {
    this.type = "ShapePath";
    this.color = new Color2();
    this.subPaths = [];
    this.currentPath = null;
  }
  moveTo(x2, y2) {
    this.currentPath = new Path();
    this.subPaths.push(this.currentPath);
    this.currentPath.moveTo(x2, y2);
    return this;
  }
  lineTo(x2, y2) {
    this.currentPath.lineTo(x2, y2);
    return this;
  }
  quadraticCurveTo(aCPx, aCPy, aX, aY) {
    this.currentPath.quadraticCurveTo(aCPx, aCPy, aX, aY);
    return this;
  }
  bezierCurveTo(aCP1x, aCP1y, aCP2x, aCP2y, aX, aY) {
    this.currentPath.bezierCurveTo(aCP1x, aCP1y, aCP2x, aCP2y, aX, aY);
    return this;
  }
  splineThru(pts) {
    this.currentPath.splineThru(pts);
    return this;
  }
  toShapes(isCCW, noHoles) {
    function toShapesNoHoles(inSubpaths) {
      const shapes2 = [];
      for (let i2 = 0, l = inSubpaths.length; i2 < l; i2++) {
        const tmpPath2 = inSubpaths[i2];
        const tmpShape2 = new Shape();
        tmpShape2.curves = tmpPath2.curves;
        shapes2.push(tmpShape2);
      }
      return shapes2;
    }
    function isPointInsidePolygon2(inPt, inPolygon) {
      const polyLen = inPolygon.length;
      let inside2 = false;
      for (let p = polyLen - 1, q = 0; q < polyLen; p = q++) {
        let edgeLowPt = inPolygon[p];
        let edgeHighPt = inPolygon[q];
        let edgeDx = edgeHighPt.x - edgeLowPt.x;
        let edgeDy = edgeHighPt.y - edgeLowPt.y;
        if (Math.abs(edgeDy) > Number.EPSILON) {
          if (edgeDy < 0) {
            edgeLowPt = inPolygon[q];
            edgeDx = -edgeDx;
            edgeHighPt = inPolygon[p];
            edgeDy = -edgeDy;
          }
          if (inPt.y < edgeLowPt.y || inPt.y > edgeHighPt.y)
            continue;
          if (inPt.y === edgeLowPt.y) {
            if (inPt.x === edgeLowPt.x)
              return true;
          } else {
            const perpEdge = edgeDy * (inPt.x - edgeLowPt.x) - edgeDx * (inPt.y - edgeLowPt.y);
            if (perpEdge === 0)
              return true;
            if (perpEdge < 0)
              continue;
            inside2 = !inside2;
          }
        } else {
          if (inPt.y !== edgeLowPt.y)
            continue;
          if (edgeHighPt.x <= inPt.x && inPt.x <= edgeLowPt.x || edgeLowPt.x <= inPt.x && inPt.x <= edgeHighPt.x)
            return true;
        }
      }
      return inside2;
    }
    const isClockWise = ShapeUtils.isClockWise;
    const subPaths = this.subPaths;
    if (subPaths.length === 0)
      return [];
    if (noHoles === true)
      return toShapesNoHoles(subPaths);
    let solid, tmpPath, tmpShape;
    const shapes = [];
    if (subPaths.length === 1) {
      tmpPath = subPaths[0];
      tmpShape = new Shape();
      tmpShape.curves = tmpPath.curves;
      shapes.push(tmpShape);
      return shapes;
    }
    let holesFirst = !isClockWise(subPaths[0].getPoints());
    holesFirst = isCCW ? !holesFirst : holesFirst;
    const betterShapeHoles = [];
    const newShapes = [];
    let newShapeHoles = [];
    let mainIdx = 0;
    let tmpPoints;
    newShapes[mainIdx] = void 0;
    newShapeHoles[mainIdx] = [];
    for (let i2 = 0, l = subPaths.length; i2 < l; i2++) {
      tmpPath = subPaths[i2];
      tmpPoints = tmpPath.getPoints();
      solid = isClockWise(tmpPoints);
      solid = isCCW ? !solid : solid;
      if (solid) {
        if (!holesFirst && newShapes[mainIdx])
          mainIdx++;
        newShapes[mainIdx] = { s: new Shape(), p: tmpPoints };
        newShapes[mainIdx].s.curves = tmpPath.curves;
        if (holesFirst)
          mainIdx++;
        newShapeHoles[mainIdx] = [];
      } else {
        newShapeHoles[mainIdx].push({ h: tmpPath, p: tmpPoints[0] });
      }
    }
    if (!newShapes[0])
      return toShapesNoHoles(subPaths);
    if (newShapes.length > 1) {
      let ambiguous = false;
      let toChange = 0;
      for (let sIdx = 0, sLen = newShapes.length; sIdx < sLen; sIdx++) {
        betterShapeHoles[sIdx] = [];
      }
      for (let sIdx = 0, sLen = newShapes.length; sIdx < sLen; sIdx++) {
        const sho = newShapeHoles[sIdx];
        for (let hIdx = 0; hIdx < sho.length; hIdx++) {
          const ho = sho[hIdx];
          let hole_unassigned = true;
          for (let s2Idx = 0; s2Idx < newShapes.length; s2Idx++) {
            if (isPointInsidePolygon2(ho.p, newShapes[s2Idx].p)) {
              if (sIdx !== s2Idx)
                toChange++;
              if (hole_unassigned) {
                hole_unassigned = false;
                betterShapeHoles[s2Idx].push(ho);
              } else {
                ambiguous = true;
              }
            }
          }
          if (hole_unassigned) {
            betterShapeHoles[sIdx].push(ho);
          }
        }
      }
      if (toChange > 0 && ambiguous === false) {
        newShapeHoles = betterShapeHoles;
      }
    }
    let tmpHoles;
    for (let i2 = 0, il = newShapes.length; i2 < il; i2++) {
      tmpShape = newShapes[i2].s;
      shapes.push(tmpShape);
      tmpHoles = newShapeHoles[i2];
      for (let j = 0, jl = tmpHoles.length; j < jl; j++) {
        tmpShape.holes.push(tmpHoles[j].h);
      }
    }
    return shapes;
  }
};
var DataUtils = class {
  // float32 to float16
  static toHalfFloat(val) {
    if (Math.abs(val) > 65504)
      console.warn("THREE.DataUtils.toHalfFloat(): Value out of range.");
    val = clamp(val, -65504, 65504);
    _floatView[0] = val;
    const f = _uint32View[0];
    const e3 = f >> 23 & 511;
    return _baseTable[e3] + ((f & 8388607) >> _shiftTable[e3]);
  }
  // float16 to float32
  static fromHalfFloat(val) {
    const m = val >> 10;
    _uint32View[0] = _mantissaTable[_offsetTable[m] + (val & 1023)] + _exponentTable[m];
    return _floatView[0];
  }
};
var _buffer = new ArrayBuffer(4);
var _floatView = new Float32Array(_buffer);
var _uint32View = new Uint32Array(_buffer);
var _baseTable = new Uint32Array(512);
var _shiftTable = new Uint32Array(512);
for (let i2 = 0; i2 < 256; ++i2) {
  const e3 = i2 - 127;
  if (e3 < -27) {
    _baseTable[i2] = 0;
    _baseTable[i2 | 256] = 32768;
    _shiftTable[i2] = 24;
    _shiftTable[i2 | 256] = 24;
  } else if (e3 < -14) {
    _baseTable[i2] = 1024 >> -e3 - 14;
    _baseTable[i2 | 256] = 1024 >> -e3 - 14 | 32768;
    _shiftTable[i2] = -e3 - 1;
    _shiftTable[i2 | 256] = -e3 - 1;
  } else if (e3 <= 15) {
    _baseTable[i2] = e3 + 15 << 10;
    _baseTable[i2 | 256] = e3 + 15 << 10 | 32768;
    _shiftTable[i2] = 13;
    _shiftTable[i2 | 256] = 13;
  } else if (e3 < 128) {
    _baseTable[i2] = 31744;
    _baseTable[i2 | 256] = 64512;
    _shiftTable[i2] = 24;
    _shiftTable[i2 | 256] = 24;
  } else {
    _baseTable[i2] = 31744;
    _baseTable[i2 | 256] = 64512;
    _shiftTable[i2] = 13;
    _shiftTable[i2 | 256] = 13;
  }
}
var _mantissaTable = new Uint32Array(2048);
var _exponentTable = new Uint32Array(64);
var _offsetTable = new Uint32Array(64);
for (let i2 = 1; i2 < 1024; ++i2) {
  let m = i2 << 13;
  let e3 = 0;
  while ((m & 8388608) === 0) {
    m <<= 1;
    e3 -= 8388608;
  }
  m &= ~8388608;
  e3 += 947912704;
  _mantissaTable[i2] = m | e3;
}
for (let i2 = 1024; i2 < 2048; ++i2) {
  _mantissaTable[i2] = 939524096 + (i2 - 1024 << 13);
}
for (let i2 = 1; i2 < 31; ++i2) {
  _exponentTable[i2] = i2 << 23;
}
_exponentTable[31] = 1199570944;
_exponentTable[32] = 2147483648;
for (let i2 = 33; i2 < 63; ++i2) {
  _exponentTable[i2] = 2147483648 + (i2 - 32 << 23);
}
_exponentTable[63] = 3347054592;
for (let i2 = 1; i2 < 64; ++i2) {
  if (i2 !== 32) {
    _offsetTable[i2] = 1024;
  }
}
var LineStrip = 0;
var LinePieces = 1;
var NoColors = 0;
var FaceColors = 1;
var VertexColors = 2;
function MeshFaceMaterial(materials) {
  console.warn("THREE.MeshFaceMaterial has been removed. Use an Array instead.");
  return materials;
}
function MultiMaterial(materials = []) {
  console.warn("THREE.MultiMaterial has been removed. Use an Array instead.");
  materials.isMultiMaterial = true;
  materials.materials = materials;
  materials.clone = function() {
    return materials.slice();
  };
  return materials;
}
var PointCloud = class extends Points {
  constructor(geometry, material) {
    console.warn("THREE.PointCloud has been renamed to THREE.Points.");
    super(geometry, material);
  }
};
var Particle = class extends Sprite {
  constructor(material) {
    console.warn("THREE.Particle has been renamed to THREE.Sprite.");
    super(material);
  }
};
var ParticleSystem = class extends Points {
  constructor(geometry, material) {
    console.warn("THREE.ParticleSystem has been renamed to THREE.Points.");
    super(geometry, material);
  }
};
var PointCloudMaterial = class extends PointsMaterial {
  constructor(parameters) {
    console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial.");
    super(parameters);
  }
};
var ParticleBasicMaterial = class extends PointsMaterial {
  constructor(parameters) {
    console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial.");
    super(parameters);
  }
};
var ParticleSystemMaterial = class extends PointsMaterial {
  constructor(parameters) {
    console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial.");
    super(parameters);
  }
};
var Vertex = class extends Vector3 {
  constructor(x2, y2, z) {
    console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead.");
    super(x2, y2, z);
  }
};
var DynamicBufferAttribute = class extends BufferAttribute {
  constructor(array, itemSize) {
    console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setUsage( THREE.DynamicDrawUsage ) instead.");
    super(array, itemSize);
    this.setUsage(DynamicDrawUsage);
  }
};
var Int8Attribute = class extends Int8BufferAttribute {
  constructor(array, itemSize) {
    console.warn("THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead.");
    super(array, itemSize);
  }
};
var Uint8Attribute = class extends Uint8BufferAttribute {
  constructor(array, itemSize) {
    console.warn("THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead.");
    super(array, itemSize);
  }
};
var Uint8ClampedAttribute = class extends Uint8ClampedBufferAttribute {
  constructor(array, itemSize) {
    console.warn("THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead.");
    super(array, itemSize);
  }
};
var Int16Attribute = class extends Int16BufferAttribute {
  constructor(array, itemSize) {
    console.warn("THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead.");
    super(array, itemSize);
  }
};
var Uint16Attribute = class extends Uint16BufferAttribute {
  constructor(array, itemSize) {
    console.warn("THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead.");
    super(array, itemSize);
  }
};
var Int32Attribute = class extends Int32BufferAttribute {
  constructor(array, itemSize) {
    console.warn("THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead.");
    super(array, itemSize);
  }
};
var Uint32Attribute = class extends Uint32BufferAttribute {
  constructor(array, itemSize) {
    console.warn("THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead.");
    super(array, itemSize);
  }
};
var Float32Attribute = class extends Float32BufferAttribute {
  constructor(array, itemSize) {
    console.warn("THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead.");
    super(array, itemSize);
  }
};
var Float64Attribute = class extends Float64BufferAttribute {
  constructor(array, itemSize) {
    console.warn("THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead.");
    super(array, itemSize);
  }
};
Curve.create = function(construct, getPoint) {
  console.log("THREE.Curve.create() has been deprecated");
  construct.prototype = Object.create(Curve.prototype);
  construct.prototype.constructor = construct;
  construct.prototype.getPoint = getPoint;
  return construct;
};
Path.prototype.fromPoints = function(points) {
  console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints().");
  return this.setFromPoints(points);
};
var AxisHelper = class extends AxesHelper {
  constructor(size) {
    console.warn("THREE.AxisHelper has been renamed to THREE.AxesHelper.");
    super(size);
  }
};
var BoundingBoxHelper = class extends BoxHelper {
  constructor(object, color2) {
    console.warn("THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead.");
    super(object, color2);
  }
};
var EdgesHelper = class extends LineSegments {
  constructor(object, hex2) {
    console.warn("THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead.");
    super(new EdgesGeometry(object.geometry), new LineBasicMaterial({ color: hex2 !== void 0 ? hex2 : 16777215 }));
  }
};
GridHelper.prototype.setColors = function() {
  console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.");
};
SkeletonHelper.prototype.update = function() {
  console.error("THREE.SkeletonHelper: update() no longer needs to be called.");
};
var WireframeHelper = class extends LineSegments {
  constructor(object, hex2) {
    console.warn("THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead.");
    super(new WireframeGeometry(object.geometry), new LineBasicMaterial({ color: hex2 !== void 0 ? hex2 : 16777215 }));
  }
};
Loader.prototype.extractUrlBase = function(url) {
  console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead.");
  return LoaderUtils.extractUrlBase(url);
};
Loader.Handlers = {
  add: function() {
    console.error("THREE.Loader: Handlers.add() has been removed. Use LoadingManager.addHandler() instead.");
  },
  get: function() {
    console.error("THREE.Loader: Handlers.get() has been removed. Use LoadingManager.getHandler() instead.");
  }
};
var XHRLoader = class extends FileLoader {
  constructor(manager) {
    console.warn("THREE.XHRLoader has been renamed to THREE.FileLoader.");
    super(manager);
  }
};
var BinaryTextureLoader = class extends DataTextureLoader {
  constructor(manager) {
    console.warn("THREE.BinaryTextureLoader has been renamed to THREE.DataTextureLoader.");
    super(manager);
  }
};
Box2.prototype.center = function(optionalTarget) {
  console.warn("THREE.Box2: .center() has been renamed to .getCenter().");
  return this.getCenter(optionalTarget);
};
Box2.prototype.empty = function() {
  console.warn("THREE.Box2: .empty() has been renamed to .isEmpty().");
  return this.isEmpty();
};
Box2.prototype.isIntersectionBox = function(box) {
  console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox().");
  return this.intersectsBox(box);
};
Box2.prototype.size = function(optionalTarget) {
  console.warn("THREE.Box2: .size() has been renamed to .getSize().");
  return this.getSize(optionalTarget);
};
Box3.prototype.center = function(optionalTarget) {
  console.warn("THREE.Box3: .center() has been renamed to .getCenter().");
  return this.getCenter(optionalTarget);
};
Box3.prototype.empty = function() {
  console.warn("THREE.Box3: .empty() has been renamed to .isEmpty().");
  return this.isEmpty();
};
Box3.prototype.isIntersectionBox = function(box) {
  console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox().");
  return this.intersectsBox(box);
};
Box3.prototype.isIntersectionSphere = function(sphere) {
  console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere().");
  return this.intersectsSphere(sphere);
};
Box3.prototype.size = function(optionalTarget) {
  console.warn("THREE.Box3: .size() has been renamed to .getSize().");
  return this.getSize(optionalTarget);
};
Euler.prototype.toVector3 = function() {
  console.error("THREE.Euler: .toVector3() has been removed. Use Vector3.setFromEuler() instead");
};
Sphere.prototype.empty = function() {
  console.warn("THREE.Sphere: .empty() has been renamed to .isEmpty().");
  return this.isEmpty();
};
Frustum.prototype.setFromMatrix = function(m) {
  console.warn("THREE.Frustum: .setFromMatrix() has been renamed to .setFromProjectionMatrix().");
  return this.setFromProjectionMatrix(m);
};
Line3.prototype.center = function(optionalTarget) {
  console.warn("THREE.Line3: .center() has been renamed to .getCenter().");
  return this.getCenter(optionalTarget);
};
Matrix3.prototype.flattenToArrayOffset = function(array, offset) {
  console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead.");
  return this.toArray(array, offset);
};
Matrix3.prototype.multiplyVector3 = function(vector) {
  console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead.");
  return vector.applyMatrix3(this);
};
Matrix3.prototype.multiplyVector3Array = function() {
  console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.");
};
Matrix3.prototype.applyToBufferAttribute = function(attribute) {
  console.warn("THREE.Matrix3: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix3( matrix ) instead.");
  return attribute.applyMatrix3(this);
};
Matrix3.prototype.applyToVector3Array = function() {
  console.error("THREE.Matrix3: .applyToVector3Array() has been removed.");
};
Matrix3.prototype.getInverse = function(matrix) {
  console.warn("THREE.Matrix3: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead.");
  return this.copy(matrix).invert();
};
Matrix4.prototype.extractPosition = function(m) {
  console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition().");
  return this.copyPosition(m);
};
Matrix4.prototype.flattenToArrayOffset = function(array, offset) {
  console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead.");
  return this.toArray(array, offset);
};
Matrix4.prototype.getPosition = function() {
  console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead.");
  return new Vector3().setFromMatrixColumn(this, 3);
};
Matrix4.prototype.setRotationFromQuaternion = function(q) {
  console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion().");
  return this.makeRotationFromQuaternion(q);
};
Matrix4.prototype.multiplyToArray = function() {
  console.warn("THREE.Matrix4: .multiplyToArray() has been removed.");
};
Matrix4.prototype.multiplyVector3 = function(vector) {
  console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead.");
  return vector.applyMatrix4(this);
};
Matrix4.prototype.multiplyVector4 = function(vector) {
  console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead.");
  return vector.applyMatrix4(this);
};
Matrix4.prototype.multiplyVector3Array = function() {
  console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.");
};
Matrix4.prototype.rotateAxis = function(v4) {
  console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead.");
  v4.transformDirection(this);
};
Matrix4.prototype.crossVector = function(vector) {
  console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead.");
  return vector.applyMatrix4(this);
};
Matrix4.prototype.translate = function() {
  console.error("THREE.Matrix4: .translate() has been removed.");
};
Matrix4.prototype.rotateX = function() {
  console.error("THREE.Matrix4: .rotateX() has been removed.");
};
Matrix4.prototype.rotateY = function() {
  console.error("THREE.Matrix4: .rotateY() has been removed.");
};
Matrix4.prototype.rotateZ = function() {
  console.error("THREE.Matrix4: .rotateZ() has been removed.");
};
Matrix4.prototype.rotateByAxis = function() {
  console.error("THREE.Matrix4: .rotateByAxis() has been removed.");
};
Matrix4.prototype.applyToBufferAttribute = function(attribute) {
  console.warn("THREE.Matrix4: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix4( matrix ) instead.");
  return attribute.applyMatrix4(this);
};
Matrix4.prototype.applyToVector3Array = function() {
  console.error("THREE.Matrix4: .applyToVector3Array() has been removed.");
};
Matrix4.prototype.makeFrustum = function(left, right, bottom, top2, near, far) {
  console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead.");
  return this.makePerspective(left, right, top2, bottom, near, far);
};
Matrix4.prototype.getInverse = function(matrix) {
  console.warn("THREE.Matrix4: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead.");
  return this.copy(matrix).invert();
};
Plane.prototype.isIntersectionLine = function(line2) {
  console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine().");
  return this.intersectsLine(line2);
};
Quaternion.prototype.multiplyVector3 = function(vector) {
  console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead.");
  return vector.applyQuaternion(this);
};
Quaternion.prototype.inverse = function() {
  console.warn("THREE.Quaternion: .inverse() has been renamed to invert().");
  return this.invert();
};
Ray.prototype.isIntersectionBox = function(box) {
  console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox().");
  return this.intersectsBox(box);
};
Ray.prototype.isIntersectionPlane = function(plane) {
  console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane().");
  return this.intersectsPlane(plane);
};
Ray.prototype.isIntersectionSphere = function(sphere) {
  console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere().");
  return this.intersectsSphere(sphere);
};
Triangle.prototype.area = function() {
  console.warn("THREE.Triangle: .area() has been renamed to .getArea().");
  return this.getArea();
};
Triangle.prototype.barycoordFromPoint = function(point4, target) {
  console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord().");
  return this.getBarycoord(point4, target);
};
Triangle.prototype.midpoint = function(target) {
  console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint().");
  return this.getMidpoint(target);
};
Triangle.prototypenormal = function(target) {
  console.warn("THREE.Triangle: .normal() has been renamed to .getNormal().");
  return this.getNormal(target);
};
Triangle.prototype.plane = function(target) {
  console.warn("THREE.Triangle: .plane() has been renamed to .getPlane().");
  return this.getPlane(target);
};
Triangle.barycoordFromPoint = function(point4, a2, b, c4, target) {
  console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord().");
  return Triangle.getBarycoord(point4, a2, b, c4, target);
};
Triangle.normal = function(a2, b, c4, target) {
  console.warn("THREE.Triangle: .normal() has been renamed to .getNormal().");
  return Triangle.getNormal(a2, b, c4, target);
};
Shape.prototype.extractAllPoints = function(divisions) {
  console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead.");
  return this.extractPoints(divisions);
};
Shape.prototype.extrude = function(options) {
  console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead.");
  return new ExtrudeGeometry(this, options);
};
Shape.prototype.makeGeometry = function(options) {
  console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead.");
  return new ShapeGeometry(this, options);
};
Vector2.prototype.fromAttribute = function(attribute, index, offset) {
  console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute().");
  return this.fromBufferAttribute(attribute, index, offset);
};
Vector2.prototype.distanceToManhattan = function(v4) {
  console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo().");
  return this.manhattanDistanceTo(v4);
};
Vector2.prototype.lengthManhattan = function() {
  console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength().");
  return this.manhattanLength();
};
Vector3.prototype.setEulerFromRotationMatrix = function() {
  console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.");
};
Vector3.prototype.setEulerFromQuaternion = function() {
  console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.");
};
Vector3.prototype.getPositionFromMatrix = function(m) {
  console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition().");
  return this.setFromMatrixPosition(m);
};
Vector3.prototype.getScaleFromMatrix = function(m) {
  console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale().");
  return this.setFromMatrixScale(m);
};
Vector3.prototype.getColumnFromMatrix = function(index, matrix) {
  console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn().");
  return this.setFromMatrixColumn(matrix, index);
};
Vector3.prototype.applyProjection = function(m) {
  console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead.");
  return this.applyMatrix4(m);
};
Vector3.prototype.fromAttribute = function(attribute, index, offset) {
  console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute().");
  return this.fromBufferAttribute(attribute, index, offset);
};
Vector3.prototype.distanceToManhattan = function(v4) {
  console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo().");
  return this.manhattanDistanceTo(v4);
};
Vector3.prototype.lengthManhattan = function() {
  console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength().");
  return this.manhattanLength();
};
Vector4.prototype.fromAttribute = function(attribute, index, offset) {
  console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute().");
  return this.fromBufferAttribute(attribute, index, offset);
};
Vector4.prototype.lengthManhattan = function() {
  console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength().");
  return this.manhattanLength();
};
Object3D.prototype.getChildByName = function(name2) {
  console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName().");
  return this.getObjectByName(name2);
};
Object3D.prototype.renderDepth = function() {
  console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.");
};
Object3D.prototype.translate = function(distance, axis) {
  console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead.");
  return this.translateOnAxis(axis, distance);
};
Object3D.prototype.getWorldRotation = function() {
  console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.");
};
Object3D.prototype.applyMatrix = function(matrix) {
  console.warn("THREE.Object3D: .applyMatrix() has been renamed to .applyMatrix4().");
  return this.applyMatrix4(matrix);
};
Object.defineProperties(Object3D.prototype, {
  eulerOrder: {
    get: function() {
      console.warn("THREE.Object3D: .eulerOrder is now .rotation.order.");
      return this.rotation.order;
    },
    set: function(value) {
      console.warn("THREE.Object3D: .eulerOrder is now .rotation.order.");
      this.rotation.order = value;
    }
  },
  useQuaternion: {
    get: function() {
      console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.");
    },
    set: function() {
      console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.");
    }
  }
});
Mesh.prototype.setDrawMode = function() {
  console.error("THREE.Mesh: .setDrawMode() has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.");
};
Object.defineProperties(Mesh.prototype, {
  drawMode: {
    get: function() {
      console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode.");
      return TrianglesDrawMode;
    },
    set: function() {
      console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.");
    }
  }
});
SkinnedMesh.prototype.initBones = function() {
  console.error("THREE.SkinnedMesh: initBones() has been removed.");
};
PerspectiveCamera.prototype.setLens = function(focalLength, filmGauge) {
  console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup.");
  if (filmGauge !== void 0)
    this.filmGauge = filmGauge;
  this.setFocalLength(focalLength);
};
Object.defineProperties(Light.prototype, {
  onlyShadow: {
    set: function() {
      console.warn("THREE.Light: .onlyShadow has been removed.");
    }
  },
  shadowCameraFov: {
    set: function(value) {
      console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov.");
      this.shadow.camera.fov = value;
    }
  },
  shadowCameraLeft: {
    set: function(value) {
      console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left.");
      this.shadow.camera.left = value;
    }
  },
  shadowCameraRight: {
    set: function(value) {
      console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right.");
      this.shadow.camera.right = value;
    }
  },
  shadowCameraTop: {
    set: function(value) {
      console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top.");
      this.shadow.camera.top = value;
    }
  },
  shadowCameraBottom: {
    set: function(value) {
      console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom.");
      this.shadow.camera.bottom = value;
    }
  },
  shadowCameraNear: {
    set: function(value) {
      console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near.");
      this.shadow.camera.near = value;
    }
  },
  shadowCameraFar: {
    set: function(value) {
      console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far.");
      this.shadow.camera.far = value;
    }
  },
  shadowCameraVisible: {
    set: function() {
      console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.");
    }
  },
  shadowBias: {
    set: function(value) {
      console.warn("THREE.Light: .shadowBias is now .shadow.bias.");
      this.shadow.bias = value;
    }
  },
  shadowDarkness: {
    set: function() {
      console.warn("THREE.Light: .shadowDarkness has been removed.");
    }
  },
  shadowMapWidth: {
    set: function(value) {
      console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width.");
      this.shadow.mapSize.width = value;
    }
  },
  shadowMapHeight: {
    set: function(value) {
      console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height.");
      this.shadow.mapSize.height = value;
    }
  }
});
Object.defineProperties(BufferAttribute.prototype, {
  length: {
    get: function() {
      console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead.");
      return this.array.length;
    }
  },
  dynamic: {
    get: function() {
      console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead.");
      return this.usage === DynamicDrawUsage;
    },
    set: function() {
      console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead.");
      this.setUsage(DynamicDrawUsage);
    }
  }
});
BufferAttribute.prototype.setDynamic = function(value) {
  console.warn("THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead.");
  this.setUsage(value === true ? DynamicDrawUsage : StaticDrawUsage);
  return this;
};
BufferAttribute.prototype.copyIndicesArray = function() {
  console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed.");
}, BufferAttribute.prototype.setArray = function() {
  console.error("THREE.BufferAttribute: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers");
};
BufferGeometry.prototype.addIndex = function(index) {
  console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex().");
  this.setIndex(index);
};
BufferGeometry.prototype.addAttribute = function(name2, attribute) {
  console.warn("THREE.BufferGeometry: .addAttribute() has been renamed to .setAttribute().");
  if (!(attribute && attribute.isBufferAttribute) && !(attribute && attribute.isInterleavedBufferAttribute)) {
    console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute ).");
    return this.setAttribute(name2, new BufferAttribute(arguments[1], arguments[2]));
  }
  if (name2 === "index") {
    console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute.");
    this.setIndex(attribute);
    return this;
  }
  return this.setAttribute(name2, attribute);
};
BufferGeometry.prototype.addDrawCall = function(start, count2, indexOffset) {
  if (indexOffset !== void 0) {
    console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset.");
  }
  console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup().");
  this.addGroup(start, count2);
};
BufferGeometry.prototype.clearDrawCalls = function() {
  console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups().");
  this.clearGroups();
};
BufferGeometry.prototype.computeOffsets = function() {
  console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.");
};
BufferGeometry.prototype.removeAttribute = function(name2) {
  console.warn("THREE.BufferGeometry: .removeAttribute() has been renamed to .deleteAttribute().");
  return this.deleteAttribute(name2);
};
BufferGeometry.prototype.applyMatrix = function(matrix) {
  console.warn("THREE.BufferGeometry: .applyMatrix() has been renamed to .applyMatrix4().");
  return this.applyMatrix4(matrix);
};
Object.defineProperties(BufferGeometry.prototype, {
  drawcalls: {
    get: function() {
      console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups.");
      return this.groups;
    }
  },
  offsets: {
    get: function() {
      console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups.");
      return this.groups;
    }
  }
});
InterleavedBuffer.prototype.setDynamic = function(value) {
  console.warn("THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead.");
  this.setUsage(value === true ? DynamicDrawUsage : StaticDrawUsage);
  return this;
};
InterleavedBuffer.prototype.setArray = function() {
  console.error("THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers");
};
ExtrudeGeometry.prototype.getArrays = function() {
  console.error("THREE.ExtrudeGeometry: .getArrays() has been removed.");
};
ExtrudeGeometry.prototype.addShapeList = function() {
  console.error("THREE.ExtrudeGeometry: .addShapeList() has been removed.");
};
ExtrudeGeometry.prototype.addShape = function() {
  console.error("THREE.ExtrudeGeometry: .addShape() has been removed.");
};
Scene.prototype.dispose = function() {
  console.error("THREE.Scene: .dispose() has been removed.");
};
Uniform.prototype.onUpdate = function() {
  console.warn("THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead.");
  return this;
};
Object.defineProperties(Material.prototype, {
  wrapAround: {
    get: function() {
      console.warn("THREE.Material: .wrapAround has been removed.");
    },
    set: function() {
      console.warn("THREE.Material: .wrapAround has been removed.");
    }
  },
  overdraw: {
    get: function() {
      console.warn("THREE.Material: .overdraw has been removed.");
    },
    set: function() {
      console.warn("THREE.Material: .overdraw has been removed.");
    }
  },
  wrapRGB: {
    get: function() {
      console.warn("THREE.Material: .wrapRGB has been removed.");
      return new Color2();
    }
  },
  shading: {
    get: function() {
      console.error("THREE." + this.type + ": .shading has been removed. Use the boolean .flatShading instead.");
    },
    set: function(value) {
      console.warn("THREE." + this.type + ": .shading has been removed. Use the boolean .flatShading instead.");
      this.flatShading = value === FlatShading;
    }
  },
  stencilMask: {
    get: function() {
      console.warn("THREE." + this.type + ": .stencilMask has been removed. Use .stencilFuncMask instead.");
      return this.stencilFuncMask;
    },
    set: function(value) {
      console.warn("THREE." + this.type + ": .stencilMask has been removed. Use .stencilFuncMask instead.");
      this.stencilFuncMask = value;
    }
  },
  vertexTangents: {
    get: function() {
      console.warn("THREE." + this.type + ": .vertexTangents has been removed.");
    },
    set: function() {
      console.warn("THREE." + this.type + ": .vertexTangents has been removed.");
    }
  }
});
Object.defineProperties(ShaderMaterial.prototype, {
  derivatives: {
    get: function() {
      console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives.");
      return this.extensions.derivatives;
    },
    set: function(value) {
      console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives.");
      this.extensions.derivatives = value;
    }
  }
});
WebGLRenderer.prototype.clearTarget = function(renderTarget, color2, depth, stencil) {
  console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead.");
  this.setRenderTarget(renderTarget);
  this.clear(color2, depth, stencil);
};
WebGLRenderer.prototype.animate = function(callback) {
  console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop().");
  this.setAnimationLoop(callback);
};
WebGLRenderer.prototype.getCurrentRenderTarget = function() {
  console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget().");
  return this.getRenderTarget();
};
WebGLRenderer.prototype.getMaxAnisotropy = function() {
  console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy().");
  return this.capabilities.getMaxAnisotropy();
};
WebGLRenderer.prototype.getPrecision = function() {
  console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision.");
  return this.capabilities.precision;
};
WebGLRenderer.prototype.resetGLState = function() {
  console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset().");
  return this.state.reset();
};
WebGLRenderer.prototype.supportsFloatTextures = function() {
  console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' ).");
  return this.extensions.get("OES_texture_float");
};
WebGLRenderer.prototype.supportsHalfFloatTextures = function() {
  console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' ).");
  return this.extensions.get("OES_texture_half_float");
};
WebGLRenderer.prototype.supportsStandardDerivatives = function() {
  console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' ).");
  return this.extensions.get("OES_standard_derivatives");
};
WebGLRenderer.prototype.supportsCompressedTextureS3TC = function() {
  console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' ).");
  return this.extensions.get("WEBGL_compressed_texture_s3tc");
};
WebGLRenderer.prototype.supportsCompressedTexturePVRTC = function() {
  console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' ).");
  return this.extensions.get("WEBGL_compressed_texture_pvrtc");
};
WebGLRenderer.prototype.supportsBlendMinMax = function() {
  console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' ).");
  return this.extensions.get("EXT_blend_minmax");
};
WebGLRenderer.prototype.supportsVertexTextures = function() {
  console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures.");
  return this.capabilities.vertexTextures;
};
WebGLRenderer.prototype.supportsInstancedArrays = function() {
  console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' ).");
  return this.extensions.get("ANGLE_instanced_arrays");
};
WebGLRenderer.prototype.enableScissorTest = function(boolean) {
  console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest().");
  this.setScissorTest(boolean);
};
WebGLRenderer.prototype.initMaterial = function() {
  console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.");
};
WebGLRenderer.prototype.addPrePlugin = function() {
  console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.");
};
WebGLRenderer.prototype.addPostPlugin = function() {
  console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.");
};
WebGLRenderer.prototype.updateShadowMap = function() {
  console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.");
};
WebGLRenderer.prototype.setFaceCulling = function() {
  console.warn("THREE.WebGLRenderer: .setFaceCulling() has been removed.");
};
WebGLRenderer.prototype.allocTextureUnit = function() {
  console.warn("THREE.WebGLRenderer: .allocTextureUnit() has been removed.");
};
WebGLRenderer.prototype.setTexture = function() {
  console.warn("THREE.WebGLRenderer: .setTexture() has been removed.");
};
WebGLRenderer.prototype.setTexture2D = function() {
  console.warn("THREE.WebGLRenderer: .setTexture2D() has been removed.");
};
WebGLRenderer.prototype.setTextureCube = function() {
  console.warn("THREE.WebGLRenderer: .setTextureCube() has been removed.");
};
WebGLRenderer.prototype.getActiveMipMapLevel = function() {
  console.warn("THREE.WebGLRenderer: .getActiveMipMapLevel() is now .getActiveMipmapLevel().");
  return this.getActiveMipmapLevel();
};
Object.defineProperties(WebGLRenderer.prototype, {
  shadowMapEnabled: {
    get: function() {
      return this.shadowMap.enabled;
    },
    set: function(value) {
      console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled.");
      this.shadowMap.enabled = value;
    }
  },
  shadowMapType: {
    get: function() {
      return this.shadowMap.type;
    },
    set: function(value) {
      console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type.");
      this.shadowMap.type = value;
    }
  },
  shadowMapCullFace: {
    get: function() {
      console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.");
      return void 0;
    },
    set: function() {
      console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.");
    }
  },
  context: {
    get: function() {
      console.warn("THREE.WebGLRenderer: .context has been removed. Use .getContext() instead.");
      return this.getContext();
    }
  },
  vr: {
    get: function() {
      console.warn("THREE.WebGLRenderer: .vr has been renamed to .xr");
      return this.xr;
    }
  },
  gammaInput: {
    get: function() {
      console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead.");
      return false;
    },
    set: function() {
      console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead.");
    }
  },
  gammaOutput: {
    get: function() {
      console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead.");
      return false;
    },
    set: function(value) {
      console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead.");
      this.outputEncoding = value === true ? sRGBEncoding : LinearEncoding;
    }
  },
  toneMappingWhitePoint: {
    get: function() {
      console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed.");
      return 1;
    },
    set: function() {
      console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed.");
    }
  },
  gammaFactor: {
    get: function() {
      console.warn("THREE.WebGLRenderer: .gammaFactor has been removed.");
      return 2;
    },
    set: function() {
      console.warn("THREE.WebGLRenderer: .gammaFactor has been removed.");
    }
  }
});
Object.defineProperties(WebGLShadowMap.prototype, {
  cullFace: {
    get: function() {
      console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.");
      return void 0;
    },
    set: function() {
      console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.");
    }
  },
  renderReverseSided: {
    get: function() {
      console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.");
      return void 0;
    },
    set: function() {
      console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.");
    }
  },
  renderSingleSided: {
    get: function() {
      console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.");
      return void 0;
    },
    set: function() {
      console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.");
    }
  }
});
var WebGLRenderTargetCube = class extends WebGLCubeRenderTarget {
  constructor(width, height, options) {
    console.warn("THREE.WebGLRenderTargetCube( width, height, options ) is now WebGLCubeRenderTarget( size, options ).");
    super(width, options);
  }
};
Object.defineProperties(WebGLRenderTarget.prototype, {
  wrapS: {
    get: function() {
      console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS.");
      return this.texture.wrapS;
    },
    set: function(value) {
      console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS.");
      this.texture.wrapS = value;
    }
  },
  wrapT: {
    get: function() {
      console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT.");
      return this.texture.wrapT;
    },
    set: function(value) {
      console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT.");
      this.texture.wrapT = value;
    }
  },
  magFilter: {
    get: function() {
      console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter.");
      return this.texture.magFilter;
    },
    set: function(value) {
      console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter.");
      this.texture.magFilter = value;
    }
  },
  minFilter: {
    get: function() {
      console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter.");
      return this.texture.minFilter;
    },
    set: function(value) {
      console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter.");
      this.texture.minFilter = value;
    }
  },
  anisotropy: {
    get: function() {
      console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy.");
      return this.texture.anisotropy;
    },
    set: function(value) {
      console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy.");
      this.texture.anisotropy = value;
    }
  },
  offset: {
    get: function() {
      console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset.");
      return this.texture.offset;
    },
    set: function(value) {
      console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset.");
      this.texture.offset = value;
    }
  },
  repeat: {
    get: function() {
      console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat.");
      return this.texture.repeat;
    },
    set: function(value) {
      console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat.");
      this.texture.repeat = value;
    }
  },
  format: {
    get: function() {
      console.warn("THREE.WebGLRenderTarget: .format is now .texture.format.");
      return this.texture.format;
    },
    set: function(value) {
      console.warn("THREE.WebGLRenderTarget: .format is now .texture.format.");
      this.texture.format = value;
    }
  },
  type: {
    get: function() {
      console.warn("THREE.WebGLRenderTarget: .type is now .texture.type.");
      return this.texture.type;
    },
    set: function(value) {
      console.warn("THREE.WebGLRenderTarget: .type is now .texture.type.");
      this.texture.type = value;
    }
  },
  generateMipmaps: {
    get: function() {
      console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps.");
      return this.texture.generateMipmaps;
    },
    set: function(value) {
      console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps.");
      this.texture.generateMipmaps = value;
    }
  }
});
Audio.prototype.load = function(file) {
  console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");
  const scope = this;
  const audioLoader = new AudioLoader();
  audioLoader.load(file, function(buffer) {
    scope.setBuffer(buffer);
  });
  return this;
};
AudioAnalyser.prototype.getData = function() {
  console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData().");
  return this.getFrequencyData();
};
CubeCamera.prototype.updateCubeMap = function(renderer, scene) {
  console.warn("THREE.CubeCamera: .updateCubeMap() is now .update().");
  return this.update(renderer, scene);
};
CubeCamera.prototype.clear = function(renderer, color2, depth, stencil) {
  console.warn("THREE.CubeCamera: .clear() is now .renderTarget.clear().");
  return this.renderTarget.clear(renderer, color2, depth, stencil);
};
ImageUtils.crossOrigin = void 0;
ImageUtils.loadTexture = function(url, mapping, onLoad, onError) {
  console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");
  const loader = new TextureLoader();
  loader.setCrossOrigin(this.crossOrigin);
  const texture = loader.load(url, onLoad, void 0, onError);
  if (mapping)
    texture.mapping = mapping;
  return texture;
};
ImageUtils.loadTextureCube = function(urls, mapping, onLoad, onError) {
  console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");
  const loader = new CubeTextureLoader();
  loader.setCrossOrigin(this.crossOrigin);
  const texture = loader.load(urls, onLoad, void 0, onError);
  if (mapping)
    texture.mapping = mapping;
  return texture;
};
ImageUtils.loadCompressedTexture = function() {
  console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.");
};
ImageUtils.loadCompressedTextureCube = function() {
  console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.");
};
function CanvasRenderer() {
  console.error("THREE.CanvasRenderer has been removed");
}
function JSONLoader() {
  console.error("THREE.JSONLoader has been removed.");
}
var SceneUtils = {
  createMultiMaterialObject: function() {
    console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js");
  },
  detach: function() {
    console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js");
  },
  attach: function() {
    console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js");
  }
};
function LensFlare() {
  console.error("THREE.LensFlare has been moved to /examples/jsm/objects/Lensflare.js");
}
var ParametricGeometry = class extends BufferGeometry {
  constructor() {
    console.error("THREE.ParametricGeometry has been moved to /examples/jsm/geometries/ParametricGeometry.js");
    super();
  }
};
var TextGeometry = class extends BufferGeometry {
  constructor() {
    console.error("THREE.TextGeometry has been moved to /examples/jsm/geometries/TextGeometry.js");
    super();
  }
};
function FontLoader() {
  console.error("THREE.FontLoader has been moved to /examples/jsm/loaders/FontLoader.js");
}
function Font() {
  console.error("THREE.Font has been moved to /examples/jsm/loaders/FontLoader.js");
}
function ImmediateRenderObject() {
  console.error("THREE.ImmediateRenderObject has been removed.");
}
var WebGLMultisampleRenderTarget = class extends WebGLRenderTarget {
  constructor(width, height, options) {
    console.error('THREE.WebGLMultisampleRenderTarget has been removed. Use a normal render target and set the "samples" property to greater 0 to enable multisampling.');
    super(width, height, options);
    this.samples = 4;
  }
};
var DataTexture2DArray = class extends DataArrayTexture {
  constructor(data, width, height, depth) {
    console.warn("THREE.DataTexture2DArray has been renamed to DataArrayTexture.");
    super(data, width, height, depth);
  }
};
var DataTexture3D = class extends Data3DTexture {
  constructor(data, width, height, depth) {
    console.warn("THREE.DataTexture3D has been renamed to Data3DTexture.");
    super(data, width, height, depth);
  }
};
if (typeof __THREE_DEVTOOLS__ !== "undefined") {
  __THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register", { detail: {
    revision: REVISION
  } }));
}
if (typeof window !== "undefined") {
  if (window.__THREE__) {
    console.warn("WARNING: Multiple instances of Three.js being imported.");
  } else {
    window.__THREE__ = REVISION;
  }
}

// node_modules/@react-three/fiber/dist/index-38c121a8.esm.js
var React11 = __toESM(require_react());
var import_constants = __toESM(require_constants());

// node_modules/@react-three/fiber/node_modules/zustand/esm/index.js
var import_react43 = __toESM(require_react());
function createStore2(createState) {
  let state;
  const listeners = /* @__PURE__ */ new Set();
  const setState = (partial, replace2) => {
    const nextState = typeof partial === "function" ? partial(state) : partial;
    if (nextState !== state) {
      const previousState = state;
      state = replace2 ? nextState : Object.assign({}, state, nextState);
      listeners.forEach((listener) => listener(state, previousState));
    }
  };
  const getState = () => state;
  const subscribeWithSelector = (listener, selector = getState, equalityFn = Object.is) => {
    console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");
    let currentSlice = selector(state);
    function listenerToAdd() {
      const nextSlice = selector(state);
      if (!equalityFn(currentSlice, nextSlice)) {
        const previousSlice = currentSlice;
        listener(currentSlice = nextSlice, previousSlice);
      }
    }
    listeners.add(listenerToAdd);
    return () => listeners.delete(listenerToAdd);
  };
  const subscribe = (listener, selector, equalityFn) => {
    if (selector || equalityFn) {
      return subscribeWithSelector(listener, selector, equalityFn);
    }
    listeners.add(listener);
    return () => listeners.delete(listener);
  };
  const destroy = () => listeners.clear();
  const api = { setState, getState, subscribe, destroy };
  state = createState(setState, getState, api);
  return api;
}
var isSSR = typeof window === "undefined" || !window.navigator || /ServerSideRendering|^Deno\//.test(window.navigator.userAgent);
var useIsomorphicLayoutEffect = isSSR ? import_react43.useEffect : import_react43.useLayoutEffect;
function create2(createState) {
  const api = typeof createState === "function" ? createStore2(createState) : createState;
  const useStore3 = (selector = api.getState, equalityFn = Object.is) => {
    const [, forceUpdate] = (0, import_react43.useReducer)((c4) => c4 + 1, 0);
    const state = api.getState();
    const stateRef = (0, import_react43.useRef)(state);
    const selectorRef = (0, import_react43.useRef)(selector);
    const equalityFnRef = (0, import_react43.useRef)(equalityFn);
    const erroredRef = (0, import_react43.useRef)(false);
    const currentSliceRef = (0, import_react43.useRef)();
    if (currentSliceRef.current === void 0) {
      currentSliceRef.current = selector(state);
    }
    let newStateSlice;
    let hasNewStateSlice = false;
    if (stateRef.current !== state || selectorRef.current !== selector || equalityFnRef.current !== equalityFn || erroredRef.current) {
      newStateSlice = selector(state);
      hasNewStateSlice = !equalityFn(currentSliceRef.current, newStateSlice);
    }
    useIsomorphicLayoutEffect(() => {
      if (hasNewStateSlice) {
        currentSliceRef.current = newStateSlice;
      }
      stateRef.current = state;
      selectorRef.current = selector;
      equalityFnRef.current = equalityFn;
      erroredRef.current = false;
    });
    const stateBeforeSubscriptionRef = (0, import_react43.useRef)(state);
    useIsomorphicLayoutEffect(() => {
      const listener = () => {
        try {
          const nextState = api.getState();
          const nextStateSlice = selectorRef.current(nextState);
          if (!equalityFnRef.current(currentSliceRef.current, nextStateSlice)) {
            stateRef.current = nextState;
            currentSliceRef.current = nextStateSlice;
            forceUpdate();
          }
        } catch (error) {
          erroredRef.current = true;
          forceUpdate();
        }
      };
      const unsubscribe = api.subscribe(listener);
      if (api.getState() !== stateBeforeSubscriptionRef.current) {
        listener();
      }
      return unsubscribe;
    }, []);
    const sliceToReturn = hasNewStateSlice ? newStateSlice : currentSliceRef.current;
    (0, import_react43.useDebugValue)(sliceToReturn);
    return sliceToReturn;
  };
  Object.assign(useStore3, api);
  useStore3[Symbol.iterator] = function() {
    console.warn("[useStore, api] = create() is deprecated and will be removed in v4");
    const items = [useStore3, api];
    return {
      next() {
        const done = items.length <= 0;
        return { value: items.shift(), done };
      }
    };
  };
  return useStore3;
}

// node_modules/@react-three/fiber/dist/index-38c121a8.esm.js
var import_react_reconciler = __toESM(require_react_reconciler());
var import_scheduler = __toESM(require_scheduler2());

// node_modules/suspend-react/dist/index.js
function shallowEqualArrays(arrA, arrB, equal = (a2, b) => a2 === b) {
  if (arrA === arrB)
    return true;
  if (!arrA || !arrB)
    return false;
  const len = arrA.length;
  if (arrB.length !== len)
    return false;
  for (let i2 = 0; i2 < len; i2++)
    if (!equal(arrA[i2], arrB[i2]))
      return false;
  return true;
}
var globalCache = [];
function query(fn, keys4, preload2 = false, config2 = {}) {
  for (const entry2 of globalCache) {
    if (shallowEqualArrays(keys4, entry2.keys, entry2.equal)) {
      if (preload2)
        return void 0;
      if (Object.prototype.hasOwnProperty.call(entry2, "error"))
        throw entry2.error;
      if (Object.prototype.hasOwnProperty.call(entry2, "response"))
        return entry2.response;
      if (!preload2)
        throw entry2.promise;
    }
  }
  const entry = {
    keys: keys4,
    equal: config2.equal,
    promise: (
      // Execute the promise
      fn(...keys4).then((response) => entry.response = response).then(() => {
        if (config2.lifespan && config2.lifespan > 0) {
          setTimeout(() => {
            const index = globalCache.indexOf(entry);
            if (index !== -1)
              globalCache.splice(index, 1);
          }, config2.lifespan);
        }
      }).catch((error) => entry.error = error)
    )
  };
  globalCache.push(entry);
  if (!preload2)
    throw entry.promise;
  return void 0;
}
var suspend = (fn, keys4, config2) => query(fn, keys4, false, config2);
var preload = (fn, keys4, config2) => void query(fn, keys4, true, config2);
var clear = (keys4) => {
  if (keys4 === void 0 || keys4.length === 0)
    globalCache.splice(0, globalCache.length);
  else {
    const entry = globalCache.find((entry2) => shallowEqualArrays(keys4, entry2.keys, entry2.equal));
    if (entry) {
      const index = globalCache.indexOf(entry);
      if (index !== -1)
        globalCache.splice(index, 1);
    }
  }
};

// node_modules/@react-three/fiber/dist/index-38c121a8.esm.js
var isOrthographicCamera = (def) => def && def.isOrthographicCamera;
var isSSR2 = typeof window === "undefined" || !window.navigator || /ServerSideRendering|^Deno\//.test(window.navigator.userAgent);
var useIsomorphicLayoutEffect2 = isSSR2 ? React11.useEffect : React11.useLayoutEffect;
function useMutableCallback(fn) {
  const ref = React11.useRef(fn);
  useIsomorphicLayoutEffect2(() => void (ref.current = fn), [fn]);
  return ref;
}
function Block({
  set: set3
}) {
  useIsomorphicLayoutEffect2(() => {
    set3(new Promise(() => null));
    return () => set3(false);
  }, [set3]);
  return null;
}
var ErrorBoundary = class extends React11.Component {
  constructor(...args) {
    super(...args);
    this.state = {
      error: false
    };
  }
  componentDidCatch(error) {
    this.props.set(error);
  }
  render() {
    return this.state.error ? null : this.props.children;
  }
};
ErrorBoundary.getDerivedStateFromError = () => ({
  error: true
});
var DEFAULT = "__default";
var isDiffSet = (def) => def && !!def.memoized && !!def.changes;
function calculateDpr(dpr) {
  return Array.isArray(dpr) ? Math.min(Math.max(dpr[0], window.devicePixelRatio), dpr[1]) : dpr;
}
var getRootState = (obj) => {
  var _r3f;
  return (_r3f = obj.__r3f) == null ? void 0 : _r3f.root.getState();
};
var is = {
  obj: (a2) => a2 === Object(a2) && !is.arr(a2) && typeof a2 !== "function",
  fun: (a2) => typeof a2 === "function",
  str: (a2) => typeof a2 === "string",
  num: (a2) => typeof a2 === "number",
  boo: (a2) => typeof a2 === "boolean",
  und: (a2) => a2 === void 0,
  arr: (a2) => Array.isArray(a2),
  equ(a2, b, {
    arrays = "shallow",
    objects = "reference",
    strict = true
  } = {}) {
    if (typeof a2 !== typeof b || !!a2 !== !!b)
      return false;
    if (is.str(a2) || is.num(a2))
      return a2 === b;
    const isObj = is.obj(a2);
    if (isObj && objects === "reference")
      return a2 === b;
    const isArr = is.arr(a2);
    if (isArr && arrays === "reference")
      return a2 === b;
    if ((isArr || isObj) && a2 === b)
      return true;
    let i2;
    for (i2 in a2)
      if (!(i2 in b))
        return false;
    for (i2 in strict ? b : a2)
      if (a2[i2] !== b[i2])
        return false;
    if (is.und(i2)) {
      if (isArr && a2.length === 0 && b.length === 0)
        return true;
      if (isObj && Object.keys(a2).length === 0 && Object.keys(b).length === 0)
        return true;
      if (a2 !== b)
        return false;
    }
    return true;
  }
};
function buildGraph(object) {
  const data = {
    nodes: {},
    materials: {}
  };
  if (object) {
    object.traverse((obj) => {
      if (obj.name)
        data.nodes[obj.name] = obj;
      if (obj.material && !data.materials[obj.material.name])
        data.materials[obj.material.name] = obj.material;
    });
  }
  return data;
}
function dispose(obj) {
  if (obj.dispose && obj.type !== "Scene")
    obj.dispose();
  for (const p in obj) {
    p.dispose == null ? void 0 : p.dispose();
    delete obj[p];
  }
}
function prepare(object, state) {
  const instance = object;
  if (state != null && state.primitive || !instance.__r3f) {
    instance.__r3f = {
      type: "",
      root: null,
      previousAttach: null,
      memoizedProps: {},
      eventCount: 0,
      handlers: {},
      objects: [],
      parent: null,
      ...state
    };
  }
  return object;
}
function resolve(instance, key) {
  let target = instance;
  if (key.includes("-")) {
    const entries = key.split("-");
    const last = entries.pop();
    target = entries.reduce((acc, key2) => acc[key2], instance);
    return {
      target,
      key: last
    };
  } else
    return {
      target,
      key
    };
}
var INDEX_REGEX = /-\d+$/;
function attach(parent, child, type) {
  if (is.str(type)) {
    if (INDEX_REGEX.test(type)) {
      const root2 = type.replace(INDEX_REGEX, "");
      const {
        target: target2,
        key: key2
      } = resolve(parent, root2);
      if (!Array.isArray(target2[key2]))
        target2[key2] = [];
    }
    const {
      target,
      key
    } = resolve(parent, type);
    child.__r3f.previousAttach = target[key];
    target[key] = child;
  } else
    child.__r3f.previousAttach = type(parent, child);
}
function detach(parent, child, type) {
  var _child$__r3f, _child$__r3f2;
  if (is.str(type)) {
    const {
      target,
      key
    } = resolve(parent, type);
    target[key] = child.__r3f.previousAttach;
  } else
    (_child$__r3f = child.__r3f) == null ? void 0 : _child$__r3f.previousAttach == null ? void 0 : _child$__r3f.previousAttach(parent, child);
  (_child$__r3f2 = child.__r3f) == null ? true : delete _child$__r3f2.previousAttach;
}
function diffProps(instance, {
  children: cN,
  key: kN,
  ref: rN,
  ...props
}, {
  children: cP,
  key: kP,
  ref: rP,
  ...previous
} = {}, remove2 = false) {
  var _instance$__r3f;
  const localState = (_instance$__r3f = instance == null ? void 0 : instance.__r3f) != null ? _instance$__r3f : {};
  const entries = Object.entries(props);
  const changes = [];
  if (remove2) {
    const previousKeys = Object.keys(previous);
    for (let i2 = 0; i2 < previousKeys.length; i2++) {
      if (!props.hasOwnProperty(previousKeys[i2]))
        entries.unshift([previousKeys[i2], DEFAULT + "remove"]);
    }
  }
  entries.forEach(([key, value]) => {
    var _instance$__r3f2;
    if ((_instance$__r3f2 = instance.__r3f) != null && _instance$__r3f2.primitive && key === "object")
      return;
    if (is.equ(value, previous[key]))
      return;
    if (/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/.test(key))
      return changes.push([key, value, true, []]);
    let entries2 = [];
    if (key.includes("-"))
      entries2 = key.split("-");
    changes.push([key, value, false, entries2]);
  });
  const memoized = {
    ...props
  };
  if (localState.memoizedProps && localState.memoizedProps.args)
    memoized.args = localState.memoizedProps.args;
  if (localState.memoizedProps && localState.memoizedProps.attach)
    memoized.attach = localState.memoizedProps.attach;
  return {
    memoized,
    changes
  };
}
function applyProps$1(instance, data) {
  var _instance$__r3f3, _root$getState;
  const localState = (_instance$__r3f3 = instance == null ? void 0 : instance.__r3f) != null ? _instance$__r3f3 : {};
  const root2 = localState.root;
  const rootState = (_root$getState = root2 == null ? void 0 : root2.getState == null ? void 0 : root2.getState()) != null ? _root$getState : {};
  const {
    memoized,
    changes
  } = isDiffSet(data) ? data : diffProps(instance, data);
  const prevHandlers = localState.eventCount;
  if (instance.__r3f)
    instance.__r3f.memoizedProps = memoized;
  changes.forEach(([key, value, isEvent, keys4]) => {
    let currentInstance = instance;
    let targetProp = currentInstance[key];
    if (keys4.length) {
      targetProp = keys4.reduce((acc, key2) => acc[key2], instance);
      if (!(targetProp && targetProp.set)) {
        const [name2, ...reverseEntries] = keys4.reverse();
        currentInstance = reverseEntries.reverse().reduce((acc, key2) => acc[key2], instance);
        key = name2;
      }
    }
    if (value === DEFAULT + "remove") {
      if (targetProp && targetProp.constructor) {
        var _memoized$args;
        value = new targetProp.constructor(...(_memoized$args = memoized.args) != null ? _memoized$args : []);
      } else if (currentInstance.constructor) {
        var _currentInstance$__r;
        const defaultClassCall = new currentInstance.constructor(...(_currentInstance$__r = currentInstance.__r3f.memoizedProps.args) != null ? _currentInstance$__r : []);
        value = defaultClassCall[targetProp];
        if (defaultClassCall.dispose)
          defaultClassCall.dispose();
      } else {
        value = 0;
      }
    }
    if (isEvent) {
      if (value)
        localState.handlers[key] = value;
      else
        delete localState.handlers[key];
      localState.eventCount = Object.keys(localState.handlers).length;
    } else if (targetProp && targetProp.set && (targetProp.copy || targetProp instanceof Layers)) {
      if (Array.isArray(value)) {
        if (targetProp.fromArray)
          targetProp.fromArray(value);
        else
          targetProp.set(...value);
      } else if (targetProp.copy && value && value.constructor && targetProp.constructor.name === value.constructor.name) {
        targetProp.copy(value);
      } else if (value !== void 0) {
        const isColor = targetProp instanceof Color2;
        if (!isColor && targetProp.setScalar)
          targetProp.setScalar(value);
        else if (targetProp instanceof Layers && value instanceof Layers)
          targetProp.mask = value.mask;
        else
          targetProp.set(value);
        const supportsColorManagement = ColorManagement;
        if (!supportsColorManagement && !rootState.linear && isColor)
          targetProp.convertSRGBToLinear();
      }
    } else {
      currentInstance[key] = value;
      if (!rootState.linear && currentInstance[key] instanceof Texture) {
        currentInstance[key].encoding = sRGBEncoding;
      }
    }
    invalidateInstance(instance);
  });
  if (localState.parent && rootState.internal && instance.raycast && prevHandlers !== localState.eventCount) {
    const index = rootState.internal.interaction.indexOf(instance);
    if (index > -1)
      rootState.internal.interaction.splice(index, 1);
    if (localState.eventCount)
      rootState.internal.interaction.push(instance);
  }
  if (changes.length && instance.parent)
    updateInstance(instance);
  return instance;
}
function invalidateInstance(instance) {
  var _instance$__r3f4, _instance$__r3f4$root;
  const state = (_instance$__r3f4 = instance.__r3f) == null ? void 0 : (_instance$__r3f4$root = _instance$__r3f4.root) == null ? void 0 : _instance$__r3f4$root.getState == null ? void 0 : _instance$__r3f4$root.getState();
  if (state && state.internal.frames === 0)
    state.invalidate();
}
function updateInstance(instance) {
  instance.onUpdate == null ? void 0 : instance.onUpdate(instance);
}
function updateCamera(camera, size) {
  if (!camera.manual) {
    if (isOrthographicCamera(camera)) {
      camera.left = size.width / -2;
      camera.right = size.width / 2;
      camera.top = size.height / 2;
      camera.bottom = size.height / -2;
    } else {
      camera.aspect = size.width / size.height;
    }
    camera.updateProjectionMatrix();
    camera.updateMatrixWorld();
  }
}
function makeId(event) {
  return (event.eventObject || event.object).uuid + "/" + event.index + event.instanceId;
}
function getEventPriority() {
  var _window, _window$event;
  let name2 = (_window = window) == null ? void 0 : (_window$event = _window.event) == null ? void 0 : _window$event.type;
  switch (name2) {
    case "click":
    case "contextmenu":
    case "dblclick":
    case "pointercancel":
    case "pointerdown":
    case "pointerup":
      return import_constants.DiscreteEventPriority;
    case "pointermove":
    case "pointerout":
    case "pointerover":
    case "pointerenter":
    case "pointerleave":
    case "wheel":
      return import_constants.ContinuousEventPriority;
    default:
      return import_constants.DefaultEventPriority;
  }
}
function releaseInternalPointerCapture(capturedMap, obj, captures, pointerId) {
  const captureData = captures.get(obj);
  if (captureData) {
    captures.delete(obj);
    if (captures.size === 0) {
      capturedMap.delete(pointerId);
      captureData.target.releasePointerCapture(pointerId);
    }
  }
}
function removeInteractivity(store, object) {
  const {
    events,
    internal
  } = store.getState();
  internal.interaction = internal.interaction.filter((o) => o !== object);
  internal.initialHits = internal.initialHits.filter((o) => o !== object);
  internal.hovered.forEach((value, key) => {
    if (value.eventObject === object || value.object === object) {
      internal.hovered.delete(key);
    }
  });
  internal.capturedMap.forEach((captures, pointerId) => {
    releaseInternalPointerCapture(internal.capturedMap, object, captures, pointerId);
  });
}
function createEvents(store) {
  const temp = new Vector3();
  function calculateDistance(event) {
    const {
      internal
    } = store.getState();
    const dx = event.offsetX - internal.initialClick[0];
    const dy = event.offsetY - internal.initialClick[1];
    return Math.round(Math.sqrt(dx * dx + dy * dy));
  }
  function filterPointerEvents(objects) {
    return objects.filter((obj) => ["Move", "Over", "Enter", "Out", "Leave"].some((name2) => {
      var _r3f;
      return (_r3f = obj.__r3f) == null ? void 0 : _r3f.handlers["onPointer" + name2];
    }));
  }
  function intersect(event, filter) {
    const state = store.getState();
    const duplicates = /* @__PURE__ */ new Set();
    const intersections = [];
    const eventsObjects = filter ? filter(state.internal.interaction) : state.internal.interaction;
    eventsObjects.forEach((obj) => {
      const state2 = getRootState(obj);
      if (state2) {
        state2.raycaster.camera = void 0;
      }
    });
    if (!state.previousRoot) {
      state.events.compute == null ? void 0 : state.events.compute(event, state);
    }
    let hits = eventsObjects.flatMap((obj) => {
      const state2 = getRootState(obj);
      if (!state2 || !state2.events.enabled || state2.raycaster.camera === null)
        return [];
      if (state2.raycaster.camera === void 0) {
        var _state$previousRoot;
        state2.events.compute == null ? void 0 : state2.events.compute(event, state2, (_state$previousRoot = state2.previousRoot) == null ? void 0 : _state$previousRoot.getState());
        if (state2.raycaster.camera === void 0)
          state2.raycaster.camera = null;
      }
      return state2.raycaster.camera ? state2.raycaster.intersectObject(obj, true) : [];
    }).sort((a2, b) => {
      const aState = getRootState(a2.object);
      const bState = getRootState(b.object);
      if (!aState || !bState)
        return 0;
      return bState.events.priority - aState.events.priority || a2.distance - b.distance;
    }).filter((item) => {
      const id2 = makeId(item);
      if (duplicates.has(id2))
        return false;
      duplicates.add(id2);
      return true;
    });
    if (state.events.filter)
      hits = state.events.filter(hits, state);
    for (const hit of hits) {
      let eventObject = hit.object;
      while (eventObject) {
        var _r3f2;
        if ((_r3f2 = eventObject.__r3f) != null && _r3f2.eventCount)
          intersections.push({
            ...hit,
            eventObject
          });
        eventObject = eventObject.parent;
      }
    }
    if ("pointerId" in event && state.internal.capturedMap.has(event.pointerId)) {
      for (let captureData of state.internal.capturedMap.get(event.pointerId).values()) {
        intersections.push(captureData.intersection);
      }
    }
    return intersections;
  }
  function handleIntersects(intersections, event, delta, callback) {
    const {
      raycaster,
      pointer,
      camera,
      internal
    } = store.getState();
    if (intersections.length) {
      const unprojectedPoint = temp.set(pointer.x, pointer.y, 0).unproject(camera);
      const localState = {
        stopped: false
      };
      for (const hit of intersections) {
        const hasPointerCapture = (id2) => {
          var _internal$capturedMap, _internal$capturedMap2;
          return (_internal$capturedMap = (_internal$capturedMap2 = internal.capturedMap.get(id2)) == null ? void 0 : _internal$capturedMap2.has(hit.eventObject)) != null ? _internal$capturedMap : false;
        };
        const setPointerCapture = (id2) => {
          const captureData = {
            intersection: hit,
            target: event.target
          };
          if (internal.capturedMap.has(id2)) {
            internal.capturedMap.get(id2).set(hit.eventObject, captureData);
          } else {
            internal.capturedMap.set(id2, /* @__PURE__ */ new Map([[hit.eventObject, captureData]]));
          }
          event.target.setPointerCapture(id2);
        };
        const releasePointerCapture = (id2) => {
          const captures = internal.capturedMap.get(id2);
          if (captures) {
            releaseInternalPointerCapture(internal.capturedMap, hit.eventObject, captures, id2);
          }
        };
        let extractEventProps = {};
        for (let prop in event) {
          let property = event[prop];
          if (typeof property !== "function")
            extractEventProps[prop] = property;
        }
        let raycastEvent = {
          ...hit,
          ...extractEventProps,
          pointer,
          intersections,
          stopped: localState.stopped,
          delta,
          unprojectedPoint,
          ray: raycaster.ray,
          camera,
          // Hijack stopPropagation, which just sets a flag
          stopPropagation: () => {
            const capturesForPointer = "pointerId" in event && internal.capturedMap.get(event.pointerId);
            if (
              // ...if this pointer hasn't been captured
              !capturesForPointer || // ... or if the hit object is capturing the pointer
              capturesForPointer.has(hit.eventObject)
            ) {
              raycastEvent.stopped = localState.stopped = true;
              if (internal.hovered.size && Array.from(internal.hovered.values()).find((i2) => i2.eventObject === hit.eventObject)) {
                const higher = intersections.slice(0, intersections.indexOf(hit));
                cancelPointer([...higher, hit]);
              }
            }
          },
          // there should be a distinction between target and currentTarget
          target: {
            hasPointerCapture,
            setPointerCapture,
            releasePointerCapture
          },
          currentTarget: {
            hasPointerCapture,
            setPointerCapture,
            releasePointerCapture
          },
          nativeEvent: event
        };
        callback(raycastEvent);
        if (localState.stopped === true)
          break;
      }
    }
    return intersections;
  }
  function cancelPointer(hits) {
    const {
      internal
    } = store.getState();
    Array.from(internal.hovered.values()).forEach((hoveredObj) => {
      if (!hits.length || !hits.find((hit) => hit.object === hoveredObj.object && hit.index === hoveredObj.index && hit.instanceId === hoveredObj.instanceId)) {
        const eventObject = hoveredObj.eventObject;
        const instance = eventObject.__r3f;
        const handlers2 = instance == null ? void 0 : instance.handlers;
        internal.hovered.delete(makeId(hoveredObj));
        if (instance != null && instance.eventCount) {
          const data = {
            ...hoveredObj,
            intersections: hits || []
          };
          handlers2.onPointerOut == null ? void 0 : handlers2.onPointerOut(data);
          handlers2.onPointerLeave == null ? void 0 : handlers2.onPointerLeave(data);
        }
      }
    });
  }
  const handlePointer = (name2) => {
    switch (name2) {
      case "onPointerLeave":
      case "onPointerCancel":
        return () => cancelPointer([]);
      case "onLostPointerCapture":
        return (event) => {
          const {
            internal
          } = store.getState();
          if ("pointerId" in event && !internal.capturedMap.has(event.pointerId)) {
            internal.capturedMap.delete(event.pointerId);
            cancelPointer([]);
          }
        };
    }
    return (event) => {
      const {
        onPointerMissed,
        internal
      } = store.getState();
      internal.lastEvent.current = event;
      const isPointerMove = name2 === "onPointerMove";
      const isClickEvent = name2 === "onClick" || name2 === "onContextMenu" || name2 === "onDoubleClick";
      const filter = isPointerMove ? filterPointerEvents : void 0;
      const hits = intersect(event, filter);
      const delta = isClickEvent ? calculateDistance(event) : 0;
      if (name2 === "onPointerDown") {
        internal.initialClick = [event.offsetX, event.offsetY];
        internal.initialHits = hits.map((hit) => hit.eventObject);
      }
      if (isClickEvent && !hits.length) {
        if (delta <= 2) {
          pointerMissed(event, internal.interaction);
          if (onPointerMissed)
            onPointerMissed(event);
        }
      }
      if (isPointerMove)
        cancelPointer(hits);
      handleIntersects(hits, event, delta, (data) => {
        const eventObject = data.eventObject;
        const instance = eventObject.__r3f;
        const handlers2 = instance == null ? void 0 : instance.handlers;
        if (!(instance != null && instance.eventCount))
          return;
        if (isPointerMove) {
          if (handlers2.onPointerOver || handlers2.onPointerEnter || handlers2.onPointerOut || handlers2.onPointerLeave) {
            const id2 = makeId(data);
            const hoveredItem = internal.hovered.get(id2);
            if (!hoveredItem) {
              internal.hovered.set(id2, data);
              handlers2.onPointerOver == null ? void 0 : handlers2.onPointerOver(data);
              handlers2.onPointerEnter == null ? void 0 : handlers2.onPointerEnter(data);
            } else if (hoveredItem.stopped) {
              data.stopPropagation();
            }
          }
          handlers2.onPointerMove == null ? void 0 : handlers2.onPointerMove(data);
        } else {
          const handler = handlers2[name2];
          if (handler) {
            if (!isClickEvent || internal.initialHits.includes(eventObject)) {
              pointerMissed(event, internal.interaction.filter((object) => !internal.initialHits.includes(object)));
              handler(data);
            }
          } else {
            if (isClickEvent && internal.initialHits.includes(eventObject)) {
              pointerMissed(event, internal.interaction.filter((object) => !internal.initialHits.includes(object)));
            }
          }
        }
      });
    };
  };
  function pointerMissed(event, objects) {
    objects.forEach((object) => {
      var _r3f3;
      return (_r3f3 = object.__r3f) == null ? void 0 : _r3f3.handlers.onPointerMissed == null ? void 0 : _r3f3.handlers.onPointerMissed(event);
    });
  }
  return {
    handlePointer
  };
}
var catalogue = {};
var extend2 = (objects) => void (catalogue = {
  ...catalogue,
  ...objects
});
function createRenderer(roots2, getEventPriority2) {
  function createInstance(type, {
    args = [],
    attach: attach2,
    ...props
  }, root2) {
    let name2 = `${type[0].toUpperCase()}${type.slice(1)}`;
    let instance;
    if (attach2 === void 0) {
      if (name2.endsWith("Geometry"))
        attach2 = "geometry";
      else if (name2.endsWith("Material"))
        attach2 = "material";
    }
    if (type === "primitive") {
      if (props.object === void 0)
        throw `Primitives without 'object' are invalid!`;
      const object = props.object;
      instance = prepare(object, {
        type,
        root: root2,
        attach: attach2,
        primitive: true
      });
    } else {
      const target = catalogue[name2];
      if (!target) {
        throw `${name2} is not part of the THREE namespace! Did you forget to extend? See: https://github.com/pmndrs/react-three-fiber/blob/master/markdown/api.md#using-3rd-party-objects-declaratively`;
      }
      if (!Array.isArray(args))
        throw "The args prop must be an array!";
      instance = prepare(new target(...args), {
        type,
        root: root2,
        attach: attach2,
        // TODO: Figure out what this is for
        memoizedProps: {
          args
        }
      });
    }
    if (name2 !== "inject")
      applyProps$1(instance, props);
    return instance;
  }
  function appendChild(parentInstance, child) {
    let added = false;
    if (child) {
      var _child$__r3f, _parentInstance$__r3f;
      if ((_child$__r3f = child.__r3f) != null && _child$__r3f.attach) {
        attach(parentInstance, child, child.__r3f.attach);
      } else if (child.isObject3D && parentInstance.isObject3D) {
        parentInstance.add(child);
        added = true;
      }
      if (!added)
        (_parentInstance$__r3f = parentInstance.__r3f) == null ? void 0 : _parentInstance$__r3f.objects.push(child);
      if (!child.__r3f)
        prepare(child, {});
      child.__r3f.parent = parentInstance;
      updateInstance(child);
      invalidateInstance(child);
    }
  }
  function insertBefore(parentInstance, child, beforeChild) {
    let added = false;
    if (child) {
      var _child$__r3f2, _parentInstance$__r3f2;
      if ((_child$__r3f2 = child.__r3f) != null && _child$__r3f2.attach) {
        attach(parentInstance, child, child.__r3f.attach);
      } else if (child.isObject3D && parentInstance.isObject3D) {
        child.parent = parentInstance;
        child.dispatchEvent({
          type: "added"
        });
        const restSiblings = parentInstance.children.filter((sibling) => sibling !== child);
        const index = restSiblings.indexOf(beforeChild);
        parentInstance.children = [...restSiblings.slice(0, index), child, ...restSiblings.slice(index)];
        added = true;
      }
      if (!added)
        (_parentInstance$__r3f2 = parentInstance.__r3f) == null ? void 0 : _parentInstance$__r3f2.objects.push(child);
      if (!child.__r3f)
        prepare(child, {});
      child.__r3f.parent = parentInstance;
      updateInstance(child);
      invalidateInstance(child);
    }
  }
  function removeRecursive(array, parent, dispose2 = false) {
    if (array)
      [...array].forEach((child) => removeChild(parent, child, dispose2));
  }
  function removeChild(parentInstance, child, dispose2) {
    if (child) {
      var _parentInstance$__r3f3, _child$__r3f3, _child$__r3f5;
      if (child.__r3f)
        child.__r3f.parent = null;
      if ((_parentInstance$__r3f3 = parentInstance.__r3f) != null && _parentInstance$__r3f3.objects)
        parentInstance.__r3f.objects = parentInstance.__r3f.objects.filter((x2) => x2 !== child);
      if ((_child$__r3f3 = child.__r3f) != null && _child$__r3f3.attach) {
        detach(parentInstance, child, child.__r3f.attach);
      } else if (child.isObject3D && parentInstance.isObject3D) {
        var _child$__r3f4;
        parentInstance.remove(child);
        if ((_child$__r3f4 = child.__r3f) != null && _child$__r3f4.root) {
          removeInteractivity(child.__r3f.root, child);
        }
      }
      const isPrimitive3 = (_child$__r3f5 = child.__r3f) == null ? void 0 : _child$__r3f5.primitive;
      const shouldDispose = dispose2 === void 0 ? child.dispose !== null && !isPrimitive3 : dispose2;
      if (!isPrimitive3) {
        var _child$__r3f6;
        removeRecursive((_child$__r3f6 = child.__r3f) == null ? void 0 : _child$__r3f6.objects, child, shouldDispose);
        removeRecursive(child.children, child, shouldDispose);
      }
      if (child.__r3f) {
        delete child.__r3f.root;
        delete child.__r3f.objects;
        delete child.__r3f.handlers;
        delete child.__r3f.memoizedProps;
        if (!isPrimitive3)
          delete child.__r3f;
      }
      if (shouldDispose && child.dispose && child.type !== "Scene") {
        (0, import_scheduler.unstable_scheduleCallback)(import_scheduler.unstable_IdlePriority, () => {
          try {
            child.dispose();
          } catch (e3) {
          }
        });
      }
      invalidateInstance(parentInstance);
    }
  }
  function switchInstance(instance, type, newProps, fiber) {
    var _instance$__r3f, _instance$__r3f2;
    const parent = (_instance$__r3f = instance.__r3f) == null ? void 0 : _instance$__r3f.parent;
    if (!parent)
      return;
    const newInstance = createInstance(type, newProps, (_instance$__r3f2 = instance.__r3f) == null ? void 0 : _instance$__r3f2.root);
    if (type !== "primitive" && instance.children) {
      instance.children.forEach((child) => appendChild(newInstance, child));
      instance.children = [];
    }
    instance.__r3f.objects.forEach((child) => appendChild(newInstance, child));
    instance.__r3f.objects = [];
    removeChild(parent, instance);
    appendChild(parent, newInstance);
    if (newInstance.raycast && newInstance.__r3f.eventCount) {
      const rootState = newInstance.__r3f.root.getState();
      rootState.internal.interaction.push(newInstance);
    }
    [fiber, fiber.alternate].forEach((fiber2) => {
      if (fiber2 !== null) {
        fiber2.stateNode = newInstance;
        if (fiber2.ref) {
          if (typeof fiber2.ref === "function")
            fiber2.ref(newInstance);
          else
            fiber2.ref.current = newInstance;
        }
      }
    });
  }
  const reconciler2 = (0, import_react_reconciler.default)({
    createInstance,
    removeChild,
    appendChild,
    appendInitialChild: appendChild,
    insertBefore,
    supportsMicrotask: true,
    warnsIfNotActing: true,
    supportsMutation: true,
    isPrimaryRenderer: false,
    noTimeout: -1,
    appendChildToContainer: (container, child) => {
      const scene = container.getState().scene;
      scene.__r3f.root = container;
      appendChild(scene, child);
    },
    removeChildFromContainer: (container, child) => removeChild(container.getState().scene, child),
    insertInContainerBefore: (container, child, beforeChild) => insertBefore(container.getState().scene, child, beforeChild),
    getRootHostContext: () => null,
    getChildHostContext: (parentHostContext) => parentHostContext,
    finalizeInitialChildren(instance) {
      var _instance$__r3f3;
      const localState = (_instance$__r3f3 = instance == null ? void 0 : instance.__r3f) != null ? _instance$__r3f3 : {};
      return !!localState.handlers;
    },
    prepareUpdate(instance, type, oldProps, newProps) {
      if (instance.__r3f.primitive && newProps.object && newProps.object !== instance) {
        return [true];
      } else {
        const {
          args: argsNew = [],
          children: cN,
          ...restNew
        } = newProps;
        const {
          args: argsOld = [],
          children: cO,
          ...restOld
        } = oldProps;
        if (!Array.isArray(argsNew))
          throw "The args prop must be an array!";
        if (argsNew.some((value, index) => value !== argsOld[index]))
          return [true];
        const diff = diffProps(instance, restNew, restOld, true);
        if (diff.changes.length)
          return [false, diff];
        return null;
      }
    },
    commitUpdate(instance, [reconstruct, diff], type, oldProps, newProps, fiber) {
      if (reconstruct)
        switchInstance(instance, type, newProps, fiber);
      else
        applyProps$1(instance, diff);
    },
    commitMount(instance, type, props, int) {
      var _instance$__r3f4;
      const localState = (_instance$__r3f4 = instance == null ? void 0 : instance.__r3f) != null ? _instance$__r3f4 : {};
      if (instance.raycast && localState.handlers && localState.eventCount) {
        instance.__r3f.root.getState().internal.interaction.push(instance);
      }
    },
    getPublicInstance: (instance) => instance,
    shouldDeprioritizeSubtree: () => false,
    prepareForCommit: () => null,
    preparePortalMount: (container) => prepare(container.getState().scene),
    resetAfterCommit: () => {
    },
    shouldSetTextContent: () => false,
    clearContainer: () => false,
    detachDeletedInstance: () => {
    },
    createTextInstance: () => {
    },
    hideInstance(instance) {
      var _instance$__r3f5;
      const {
        attach: type,
        parent
      } = (_instance$__r3f5 = instance == null ? void 0 : instance.__r3f) != null ? _instance$__r3f5 : {};
      if (type && parent)
        detach(parent, instance, type);
      if (instance.isObject3D)
        instance.visible = false;
      invalidateInstance(instance);
    },
    unhideInstance(instance, props) {
      var _instance$__r3f6;
      const {
        attach: type,
        parent
      } = (_instance$__r3f6 = instance == null ? void 0 : instance.__r3f) != null ? _instance$__r3f6 : {};
      if (type && parent)
        attach(parent, instance, type);
      if (instance.isObject3D && props.visible == null || props.visible)
        instance.visible = true;
      invalidateInstance(instance);
    },
    hideTextInstance: () => {
      throw new Error("Text is not allowed in the R3F tree.");
    },
    // prettier-ignore
    getCurrentEventPriority: () => getEventPriority2 ? getEventPriority2() : import_constants.DefaultEventPriority,
    // @ts-ignore
    now: typeof performance !== "undefined" && is.fun(performance.now) ? performance.now : is.fun(Date.now) ? Date.now : void 0,
    // @ts-ignore
    scheduleTimeout: is.fun(setTimeout) ? setTimeout : void 0,
    // @ts-ignore
    cancelTimeout: is.fun(clearTimeout) ? clearTimeout : void 0,
    setTimeout: is.fun(setTimeout) ? setTimeout : void 0,
    clearTimeout: is.fun(clearTimeout) ? clearTimeout : void 0
  });
  return {
    reconciler: reconciler2,
    applyProps: applyProps$1
  };
}
var isRenderer = (def) => !!(def != null && def.render);
var context = /* @__PURE__ */ React11.createContext(null);
var createStore3 = (invalidate2, advance2) => {
  const rootState = create2((set3, get3) => {
    const position2 = new Vector3();
    const defaultTarget = new Vector3();
    const tempTarget = new Vector3();
    function getCurrentViewport(camera = get3().camera, target = defaultTarget, size = get3().size) {
      const {
        width,
        height
      } = size;
      const aspect2 = width / height;
      if (target instanceof Vector3)
        tempTarget.copy(target);
      else
        tempTarget.set(...target);
      const distance = camera.getWorldPosition(position2).distanceTo(tempTarget);
      if (isOrthographicCamera(camera)) {
        return {
          width: width / camera.zoom,
          height: height / camera.zoom,
          factor: 1,
          distance,
          aspect: aspect2
        };
      } else {
        const fov2 = camera.fov * Math.PI / 180;
        const h = 2 * Math.tan(fov2 / 2) * distance;
        const w = h * (width / height);
        return {
          width: w,
          height: h,
          factor: width / w,
          distance,
          aspect: aspect2
        };
      }
    }
    let performanceTimeout = void 0;
    const setPerformanceCurrent = (current) => set3((state2) => ({
      performance: {
        ...state2.performance,
        current
      }
    }));
    const pointer = new Vector2();
    return {
      set: set3,
      get: get3,
      // Mock objects that have to be configured
      gl: null,
      camera: null,
      raycaster: null,
      events: {
        priority: 1,
        enabled: true,
        connected: false
      },
      xr: null,
      invalidate: () => invalidate2(get3()),
      advance: (timestamp, runGlobalEffects) => advance2(timestamp, runGlobalEffects, get3()),
      legacy: false,
      linear: false,
      flat: false,
      scene: prepare(new Scene()),
      controls: null,
      clock: new Clock(),
      pointer,
      mouse: pointer,
      frameloop: "always",
      onPointerMissed: void 0,
      performance: {
        current: 1,
        min: 0.5,
        max: 1,
        debounce: 200,
        regress: () => {
          const state2 = get3();
          if (performanceTimeout)
            clearTimeout(performanceTimeout);
          if (state2.performance.current !== state2.performance.min)
            setPerformanceCurrent(state2.performance.min);
          performanceTimeout = setTimeout(() => setPerformanceCurrent(get3().performance.max), state2.performance.debounce);
        }
      },
      size: {
        width: 0,
        height: 0
      },
      viewport: {
        initialDpr: 0,
        dpr: 0,
        width: 0,
        height: 0,
        aspect: 0,
        distance: 0,
        factor: 0,
        getCurrentViewport
      },
      setEvents: (events) => set3((state2) => ({
        ...state2,
        events: {
          ...state2.events,
          ...events
        }
      })),
      setSize: (width, height) => {
        const camera = get3().camera;
        const size = {
          width,
          height
        };
        set3((state2) => ({
          size,
          viewport: {
            ...state2.viewport,
            ...getCurrentViewport(camera, defaultTarget, size)
          }
        }));
      },
      setDpr: (dpr) => set3((state2) => {
        const resolved = calculateDpr(dpr);
        return {
          viewport: {
            ...state2.viewport,
            dpr: resolved,
            initialDpr: state2.viewport.initialDpr || resolved
          }
        };
      }),
      setFrameloop: (frameloop = "always") => {
        const clock = get3().clock;
        clock.stop();
        clock.elapsedTime = 0;
        if (frameloop !== "never") {
          clock.start();
          clock.elapsedTime = 0;
        }
        set3(() => ({
          frameloop
        }));
      },
      previousRoot: void 0,
      internal: {
        active: false,
        priority: 0,
        frames: 0,
        lastEvent: /* @__PURE__ */ React11.createRef(),
        interaction: [],
        hovered: /* @__PURE__ */ new Map(),
        subscribers: [],
        initialClick: [0, 0],
        initialHits: [],
        capturedMap: /* @__PURE__ */ new Map(),
        subscribe: (ref, priority, store) => {
          set3(({
            internal
          }) => ({
            internal: {
              ...internal,
              // If this subscription was given a priority, it takes rendering into its own hands
              // For that reason we switch off automatic rendering and increase the manual flag
              // As long as this flag is positive there can be no internal rendering at all
              // because there could be multiple render subscriptions
              priority: internal.priority + (priority > 0 ? 1 : 0),
              // Register subscriber and sort layers from lowest to highest, meaning,
              // highest priority renders last (on top of the other frames)
              subscribers: [...internal.subscribers, {
                ref,
                priority,
                store
              }].sort((a2, b) => a2.priority - b.priority)
            }
          }));
          return () => {
            set3(({
              internal
            }) => ({
              internal: {
                ...internal,
                // Decrease manual flag if this subscription had a priority
                priority: internal.priority - (priority > 0 ? 1 : 0),
                // Remove subscriber from list
                subscribers: internal.subscribers.filter((s2) => s2.ref !== ref)
              }
            }));
          };
        }
      }
    };
  });
  const state = rootState.getState();
  let oldSize = state.size;
  let oldDpr = state.viewport.dpr;
  rootState.subscribe(() => {
    const {
      camera,
      size,
      viewport,
      gl
    } = rootState.getState();
    if (size !== oldSize || viewport.dpr !== oldDpr) {
      updateCamera(camera, size);
      gl.setPixelRatio(viewport.dpr);
      gl.setSize(size.width, size.height);
      oldSize = size;
      oldDpr = viewport.dpr;
    }
  });
  rootState.subscribe((state2) => invalidate2(state2));
  return rootState;
};
var i;
var globalEffects = [];
var globalAfterEffects = [];
var globalTailEffects = [];
function run(effects, timestamp) {
  for (i = 0; i < effects.length; i++)
    effects[i](timestamp);
}
var subscribers;
var subscription;
function render$1(timestamp, state, frame) {
  let delta = state.clock.getDelta();
  if (state.frameloop === "never" && typeof timestamp === "number") {
    delta = timestamp - state.clock.elapsedTime;
    state.clock.oldTime = state.clock.elapsedTime;
    state.clock.elapsedTime = timestamp;
  }
  subscribers = state.internal.subscribers;
  for (i = 0; i < subscribers.length; i++) {
    subscription = subscribers[i];
    subscription.ref.current(subscription.store.getState(), delta, frame);
  }
  if (!state.internal.priority && state.gl.render)
    state.gl.render(state.scene, state.camera);
  state.internal.frames = Math.max(0, state.internal.frames - 1);
  return state.frameloop === "always" ? 1 : state.internal.frames;
}
function createLoop(roots2) {
  let running = false;
  let repeat;
  let frame;
  let state;
  function loop(timestamp) {
    frame = requestAnimationFrame(loop);
    running = true;
    repeat = 0;
    if (globalEffects.length)
      run(globalEffects, timestamp);
    roots2.forEach((root2) => {
      var _state$gl$xr;
      state = root2.store.getState();
      if (state.internal.active && (state.frameloop === "always" || state.internal.frames > 0) && !((_state$gl$xr = state.gl.xr) != null && _state$gl$xr.isPresenting)) {
        repeat += render$1(timestamp, state);
      }
    });
    if (globalAfterEffects.length)
      run(globalAfterEffects, timestamp);
    if (repeat === 0) {
      if (globalTailEffects.length)
        run(globalTailEffects, timestamp);
      running = false;
      return cancelAnimationFrame(frame);
    }
  }
  function invalidate2(state2) {
    var _state$gl$xr2;
    if (!state2)
      return roots2.forEach((root2) => invalidate2(root2.store.getState()));
    if ((_state$gl$xr2 = state2.gl.xr) != null && _state$gl$xr2.isPresenting || !state2.internal.active || state2.frameloop === "never")
      return;
    state2.internal.frames = Math.min(60, state2.internal.frames + 1);
    if (!running) {
      running = true;
      requestAnimationFrame(loop);
    }
  }
  function advance2(timestamp, runGlobalEffects = true, state2, frame2) {
    if (runGlobalEffects)
      run(globalEffects, timestamp);
    if (!state2)
      roots2.forEach((root2) => render$1(timestamp, root2.store.getState()));
    else
      render$1(timestamp, state2, frame2);
    if (runGlobalEffects)
      run(globalAfterEffects, timestamp);
  }
  return {
    loop,
    /**
     * Invalidates the view, requesting a frame to be rendered. Will globally invalidate unless passed a root's state.
     * @see https://docs.pmnd.rs/react-three-fiber/api/additional-exports#invalidate
     */
    invalidate: invalidate2,
    /**
     * Advances the frameloop and runs render effects, useful for when manually rendering via `frameloop="never"`.
     * @see https://docs.pmnd.rs/react-three-fiber/api/additional-exports#advance
     */
    advance: advance2
  };
}
function useStore2() {
  const store = React11.useContext(context);
  if (!store)
    throw `R3F hooks can only be used within the Canvas component!`;
  return store;
}
function useThree(selector = (state) => state, equalityFn) {
  return useStore2()(selector, equalityFn);
}
function useFrame(callback, renderPriority = 0) {
  const store = useStore2();
  const subscribe = store.getState().internal.subscribe;
  const ref = useMutableCallback(callback);
  useIsomorphicLayoutEffect2(() => subscribe(ref, renderPriority, store), [renderPriority, subscribe, store]);
  return null;
}
function loadingFn(extensions2, onProgress) {
  return function(Proto, ...input) {
    const loader = new Proto();
    if (extensions2)
      extensions2(loader);
    return Promise.all(input.map((input2) => new Promise((res, reject) => loader.load(input2, (data) => {
      if (data.scene)
        Object.assign(data, buildGraph(data.scene));
      res(data);
    }, onProgress, (error) => reject(`Could not load ${input2}: ${error.message}`)))));
  };
}
function useLoader(Proto, input, extensions2, onProgress) {
  const keys4 = Array.isArray(input) ? input : [input];
  const results = suspend(loadingFn(extensions2, onProgress), [Proto, ...keys4], {
    equal: is.equ
  });
  return Array.isArray(input) ? results : results[0];
}
useLoader.preload = function(Proto, input, extensions2) {
  const keys4 = Array.isArray(input) ? input : [input];
  return preload(loadingFn(extensions2), [Proto, ...keys4]);
};
useLoader.clear = function(Proto, input) {
  const keys4 = Array.isArray(input) ? input : [input];
  return clear([Proto, ...keys4]);
};
var roots = /* @__PURE__ */ new Map();
var {
  invalidate,
  advance
} = createLoop(roots);
var {
  reconciler,
  applyProps
} = createRenderer(roots, getEventPriority);
var shallowLoose = {
  objects: "shallow",
  strict: false
};
var createRendererInstance = (gl, canvas) => {
  const customRenderer = typeof gl === "function" ? gl(canvas) : gl;
  if (isRenderer(customRenderer))
    return customRenderer;
  else
    return new WebGLRenderer({
      powerPreference: "high-performance",
      canvas,
      antialias: true,
      alpha: true,
      ...gl
    });
};
function createRoot(canvas) {
  let prevRoot = roots.get(canvas);
  let prevFiber = prevRoot == null ? void 0 : prevRoot.fiber;
  let prevStore = prevRoot == null ? void 0 : prevRoot.store;
  if (prevRoot)
    console.warn("R3F.createRoot should only be called once!");
  const store = prevStore || createStore3(invalidate, advance);
  const fiber = prevFiber || reconciler.createContainer(store, import_constants.ConcurrentRoot, false, null);
  if (!prevRoot)
    roots.set(canvas, {
      fiber,
      store
    });
  let onCreated;
  let configured = false;
  return {
    configure(props = {}) {
      var _canvas$parentElement, _canvas$parentElement2, _canvas$parentElement3, _canvas$parentElement4;
      let {
        gl: glConfig,
        size,
        events,
        onCreated: onCreatedCallback,
        shadows = false,
        linear: linear3 = false,
        flat = false,
        legacy = false,
        orthographic = false,
        frameloop = "always",
        dpr = [1, 2],
        performance: performance2,
        raycaster: raycastOptions,
        camera: cameraOptions,
        onPointerMissed
      } = props;
      let state = store.getState();
      let gl = state.gl;
      if (!state.gl)
        state.set({
          gl: gl = createRendererInstance(glConfig, canvas)
        });
      let raycaster = state.raycaster;
      if (!raycaster)
        state.set({
          raycaster: raycaster = new Raycaster()
        });
      const {
        params,
        ...options
      } = raycastOptions || {};
      if (!is.equ(options, raycaster, shallowLoose))
        applyProps(raycaster, {
          ...options
        });
      if (!is.equ(params, raycaster.params, shallowLoose))
        applyProps(raycaster, {
          params: {
            ...raycaster.params,
            ...params
          }
        });
      if (!state.camera) {
        const isCamera = cameraOptions instanceof Camera;
        const camera = isCamera ? cameraOptions : orthographic ? new OrthographicCamera(0, 0, 0, 0, 0.1, 1e3) : new PerspectiveCamera(75, 0, 0.1, 1e3);
        if (!isCamera) {
          camera.position.z = 5;
          if (cameraOptions)
            applyProps(camera, cameraOptions);
          if (!(cameraOptions != null && cameraOptions.rotation))
            camera.lookAt(0, 0, 0);
        }
        state.set({
          camera
        });
      }
      if (!state.xr) {
        const handleXRFrame = (timestamp, frame) => {
          const state2 = store.getState();
          if (state2.frameloop === "never")
            return;
          advance(timestamp, true, state2, frame);
        };
        const handleSessionChange = () => {
          const gl2 = store.getState().gl;
          gl2.xr.enabled = gl2.xr.isPresenting;
          gl2.xr.setAnimationLoop(gl2.xr.isPresenting ? handleXRFrame : null);
        };
        const xr = {
          connect() {
            const gl2 = store.getState().gl;
            gl2.xr.addEventListener("sessionstart", handleSessionChange);
            gl2.xr.addEventListener("sessionend", handleSessionChange);
          },
          disconnect() {
            const gl2 = store.getState().gl;
            gl2.xr.removeEventListener("sessionstart", handleSessionChange);
            gl2.xr.removeEventListener("sessionend", handleSessionChange);
          }
        };
        if (gl.xr)
          xr.connect();
        state.set({
          xr
        });
      }
      if (gl.shadowMap) {
        const isBoolean2 = is.boo(shadows);
        if (isBoolean2 && gl.shadowMap.enabled !== shadows || !is.equ(shadows, gl.shadowMap, shallowLoose)) {
          const old = gl.shadowMap.enabled;
          gl.shadowMap.enabled = !!shadows;
          if (!isBoolean2)
            Object.assign(gl.shadowMap, shadows);
          else
            gl.shadowMap.type = PCFSoftShadowMap;
          if (old !== gl.shadowMap.enabled)
            gl.shadowMap.needsUpdate = true;
        }
      }
      if (ColorManagement) {
        ColorManagement.legacyMode = legacy;
      }
      const outputEncoding = linear3 ? LinearEncoding : sRGBEncoding;
      const toneMapping = flat ? NoToneMapping : ACESFilmicToneMapping;
      if (gl.outputEncoding !== outputEncoding)
        gl.outputEncoding = outputEncoding;
      if (gl.toneMapping !== toneMapping)
        gl.toneMapping = toneMapping;
      if (state.legacy !== legacy)
        state.set(() => ({
          legacy
        }));
      if (state.linear !== linear3)
        state.set(() => ({
          linear: linear3
        }));
      if (state.flat !== flat)
        state.set(() => ({
          flat
        }));
      if (glConfig && !is.fun(glConfig) && !isRenderer(glConfig) && !is.equ(glConfig, gl, shallowLoose))
        applyProps(gl, glConfig);
      if (events && !state.events.handlers)
        state.set({
          events: events(store)
        });
      if (dpr && state.viewport.dpr !== calculateDpr(dpr))
        state.setDpr(dpr);
      size = size || {
        width: (_canvas$parentElement = (_canvas$parentElement2 = canvas.parentElement) == null ? void 0 : _canvas$parentElement2.clientWidth) != null ? _canvas$parentElement : 0,
        height: (_canvas$parentElement3 = (_canvas$parentElement4 = canvas.parentElement) == null ? void 0 : _canvas$parentElement4.clientHeight) != null ? _canvas$parentElement3 : 0
      };
      if (!is.equ(size, state.size, shallowLoose))
        state.setSize(size.width, size.height);
      if (state.frameloop !== frameloop)
        state.setFrameloop(frameloop);
      if (!state.onPointerMissed)
        state.set({
          onPointerMissed
        });
      if (performance2 && !is.equ(performance2, state.performance, shallowLoose))
        state.set((state2) => ({
          performance: {
            ...state2.performance,
            ...performance2
          }
        }));
      onCreated = onCreatedCallback;
      configured = true;
      return this;
    },
    render(children) {
      if (!configured)
        this.configure();
      reconciler.updateContainer(/* @__PURE__ */ React11.createElement(Provider2, {
        store,
        children,
        onCreated,
        rootElement: canvas
      }), fiber, null, () => void 0);
      return store;
    },
    unmount() {
      unmountComponentAtNode(canvas);
    }
  };
}
function Provider2({
  store,
  children,
  onCreated,
  rootElement
}) {
  useIsomorphicLayoutEffect2(() => {
    const state = store.getState();
    state.set((state2) => ({
      internal: {
        ...state2.internal,
        active: true
      }
    }));
    if (onCreated)
      onCreated(state);
    if (!store.getState().events.connected)
      state.events.connect == null ? void 0 : state.events.connect(rootElement);
  }, []);
  return /* @__PURE__ */ React11.createElement(context.Provider, {
    value: store
  }, children);
}
function unmountComponentAtNode(canvas, callback) {
  const root2 = roots.get(canvas);
  const fiber = root2 == null ? void 0 : root2.fiber;
  if (fiber) {
    const state = root2 == null ? void 0 : root2.store.getState();
    if (state)
      state.internal.active = false;
    reconciler.updateContainer(null, fiber, null, () => {
      if (state) {
        setTimeout(() => {
          try {
            var _state$gl, _state$gl$renderLists, _state$gl2, _state$gl3;
            state.events.disconnect == null ? void 0 : state.events.disconnect();
            (_state$gl = state.gl) == null ? void 0 : (_state$gl$renderLists = _state$gl.renderLists) == null ? void 0 : _state$gl$renderLists.dispose == null ? void 0 : _state$gl$renderLists.dispose();
            (_state$gl2 = state.gl) == null ? void 0 : _state$gl2.forceContextLoss == null ? void 0 : _state$gl2.forceContextLoss();
            if ((_state$gl3 = state.gl) != null && _state$gl3.xr)
              state.xr.disconnect();
            dispose(state);
            roots.delete(canvas);
            if (callback)
              callback(canvas);
          } catch (e3) {
          }
        }, 500);
      }
    });
  }
}
reconciler.injectIntoDevTools({
  bundleType: false ? 0 : 1,
  rendererPackageName: "@react-three/fiber",
  version: "18.0.0"
});

// node_modules/@react-three/fiber/dist/react-three-fiber.esm.js
var React12 = __toESM(require_react());

// node_modules/react-merge-refs/dist/react-merge-refs.esm.js
function mergeRefs(refs) {
  return function(value) {
    refs.forEach(function(ref) {
      if (typeof ref === "function") {
        ref(value);
      } else if (ref != null) {
        ref.current = value;
      }
    });
  };
}
var react_merge_refs_esm_default = mergeRefs;

// node_modules/react-use-measure/dist/web.js
var import_react44 = __toESM(require_react());
var import_debounce = __toESM(require_debounce());
function useMeasure(_temp) {
  let {
    debounce: debounce4,
    scroll,
    polyfill,
    offsetSize
  } = _temp === void 0 ? {
    debounce: 0,
    scroll: false,
    offsetSize: false
  } : _temp;
  const ResizeObserver2 = polyfill || (typeof window === "undefined" ? class ResizeObserver {
  } : window.ResizeObserver);
  if (!ResizeObserver2) {
    throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");
  }
  const [bounds, set3] = (0, import_react44.useState)({
    left: 0,
    top: 0,
    width: 0,
    height: 0,
    bottom: 0,
    right: 0,
    x: 0,
    y: 0
  });
  const state = (0, import_react44.useRef)({
    element: null,
    scrollContainers: null,
    resizeObserver: null,
    lastBounds: bounds
  });
  const scrollDebounce = debounce4 ? typeof debounce4 === "number" ? debounce4 : debounce4.scroll : null;
  const resizeDebounce = debounce4 ? typeof debounce4 === "number" ? debounce4 : debounce4.resize : null;
  const mounted = (0, import_react44.useRef)(false);
  (0, import_react44.useEffect)(() => {
    mounted.current = true;
    return () => void (mounted.current = false);
  });
  const [forceRefresh, resizeChange, scrollChange] = (0, import_react44.useMemo)(() => {
    const callback = () => {
      if (!state.current.element)
        return;
      const {
        left,
        top: top2,
        width,
        height,
        bottom,
        right,
        x: x2,
        y: y2
      } = state.current.element.getBoundingClientRect();
      const size = {
        left,
        top: top2,
        width,
        height,
        bottom,
        right,
        x: x2,
        y: y2
      };
      if (state.current.element instanceof HTMLElement && offsetSize) {
        size.height = state.current.element.offsetHeight;
        size.width = state.current.element.offsetWidth;
      }
      Object.freeze(size);
      if (mounted.current && !areBoundsEqual(state.current.lastBounds, size))
        set3(state.current.lastBounds = size);
    };
    return [callback, resizeDebounce ? (0, import_debounce.default)(callback, resizeDebounce) : callback, scrollDebounce ? (0, import_debounce.default)(callback, scrollDebounce) : callback];
  }, [set3, offsetSize, scrollDebounce, resizeDebounce]);
  function removeListeners() {
    if (state.current.scrollContainers) {
      state.current.scrollContainers.forEach((element2) => element2.removeEventListener("scroll", scrollChange, true));
      state.current.scrollContainers = null;
    }
    if (state.current.resizeObserver) {
      state.current.resizeObserver.disconnect();
      state.current.resizeObserver = null;
    }
  }
  function addListeners() {
    if (!state.current.element)
      return;
    state.current.resizeObserver = new ResizeObserver2(scrollChange);
    state.current.resizeObserver.observe(state.current.element);
    if (scroll && state.current.scrollContainers) {
      state.current.scrollContainers.forEach((scrollContainer) => scrollContainer.addEventListener("scroll", scrollChange, {
        capture: true,
        passive: true
      }));
    }
  }
  const ref = (node56) => {
    if (!node56 || node56 === state.current.element)
      return;
    removeListeners();
    state.current.element = node56;
    state.current.scrollContainers = findScrollContainers(node56);
    addListeners();
  };
  useOnWindowScroll(scrollChange, Boolean(scroll));
  useOnWindowResize(resizeChange);
  (0, import_react44.useEffect)(() => {
    removeListeners();
    addListeners();
  }, [scroll, scrollChange, resizeChange]);
  (0, import_react44.useEffect)(() => removeListeners, []);
  return [ref, bounds, forceRefresh];
}
function useOnWindowResize(onWindowResize) {
  (0, import_react44.useEffect)(() => {
    const cb = onWindowResize;
    window.addEventListener("resize", cb);
    return () => void window.removeEventListener("resize", cb);
  }, [onWindowResize]);
}
function useOnWindowScroll(onScroll, enabled) {
  (0, import_react44.useEffect)(() => {
    if (enabled) {
      const cb = onScroll;
      window.addEventListener("scroll", cb, {
        capture: true,
        passive: true
      });
      return () => void window.removeEventListener("scroll", cb, true);
    }
  }, [onScroll, enabled]);
}
function findScrollContainers(element2) {
  const result = [];
  if (!element2 || element2 === document.body)
    return result;
  const {
    overflow,
    overflowX,
    overflowY
  } = window.getComputedStyle(element2);
  if ([overflow, overflowX, overflowY].some((prop) => prop === "auto" || prop === "scroll"))
    result.push(element2);
  return [...result, ...findScrollContainers(element2.parentElement)];
}
var keys = ["x", "y", "top", "bottom", "left", "right", "width", "height"];
var areBoundsEqual = (a2, b) => keys.every((key) => a2[key] === b[key]);

// node_modules/@react-three/fiber/dist/react-three-fiber.esm.js
var import_constants2 = __toESM(require_constants());
var import_react_reconciler2 = __toESM(require_react_reconciler());
var import_scheduler2 = __toESM(require_scheduler2());
var DOM_EVENTS = {
  onClick: ["click", false],
  onContextMenu: ["contextmenu", false],
  onDoubleClick: ["dblclick", false],
  onWheel: ["wheel", true],
  onPointerDown: ["pointerdown", true],
  onPointerUp: ["pointerup", true],
  onPointerLeave: ["pointerleave", true],
  onPointerMove: ["pointermove", true],
  onPointerCancel: ["pointercancel", true],
  onLostPointerCapture: ["lostpointercapture", true]
};
function createPointerEvents(store) {
  const {
    handlePointer
  } = createEvents(store);
  return {
    priority: 1,
    enabled: true,
    compute(event, state, previous) {
      state.pointer.set(event.offsetX / state.size.width * 2 - 1, -(event.offsetY / state.size.height) * 2 + 1);
      state.raycaster.setFromCamera(state.pointer, state.camera);
    },
    connected: void 0,
    handlers: Object.keys(DOM_EVENTS).reduce((acc, key) => ({
      ...acc,
      [key]: handlePointer(key)
    }), {}),
    connect: (target) => {
      var _events$handlers;
      const {
        set: set3,
        events
      } = store.getState();
      events.disconnect == null ? void 0 : events.disconnect();
      set3((state) => ({
        events: {
          ...state.events,
          connected: target
        }
      }));
      Object.entries((_events$handlers = events == null ? void 0 : events.handlers) != null ? _events$handlers : []).forEach(([name2, event]) => {
        const [eventName, passive] = DOM_EVENTS[name2];
        target.addEventListener(eventName, event, {
          passive
        });
      });
    },
    disconnect: () => {
      const {
        set: set3,
        events
      } = store.getState();
      if (events.connected) {
        var _events$handlers2;
        Object.entries((_events$handlers2 = events.handlers) != null ? _events$handlers2 : []).forEach(([name2, event]) => {
          if (events && events.connected instanceof HTMLElement) {
            const [eventName] = DOM_EVENTS[name2];
            events.connected.removeEventListener(eventName, event);
          }
        });
        set3((state) => ({
          events: {
            ...state.events,
            connected: void 0
          }
        }));
      }
    }
  };
}
var Canvas = /* @__PURE__ */ React12.forwardRef(function Canvas2({
  children,
  fallback,
  resize,
  style,
  gl,
  events = createPointerEvents,
  shadows,
  linear: linear3,
  flat,
  legacy,
  orthographic,
  frameloop,
  dpr,
  performance: performance2,
  raycaster,
  camera,
  onPointerMissed,
  onCreated,
  ...props
}, forwardedRef) {
  React12.useMemo(() => extend2(three_module_exports), []);
  const [containerRef, {
    width,
    height
  }] = useMeasure({
    scroll: true,
    debounce: {
      scroll: 50,
      resize: 0
    },
    ...resize
  });
  const canvasRef = React12.useRef(null);
  const meshRef = React12.useRef(null);
  const [canvas, setCanvas] = React12.useState(null);
  const handlePointerMissed = useMutableCallback(onPointerMissed);
  const [block, setBlock] = React12.useState(false);
  const [error, setError] = React12.useState(false);
  if (block)
    throw block;
  if (error)
    throw error;
  const root2 = React12.useRef(null);
  if (width > 0 && height > 0 && canvas) {
    if (!root2.current)
      root2.current = createRoot(canvas);
    root2.current.configure({
      gl,
      events,
      shadows,
      linear: linear3,
      flat,
      legacy,
      orthographic,
      frameloop,
      dpr,
      performance: performance2,
      raycaster,
      camera,
      size: {
        width,
        height
      },
      // Pass mutable reference to onPointerMissed so it's free to update
      onPointerMissed: (...args) => handlePointerMissed.current == null ? void 0 : handlePointerMissed.current(...args),
      onCreated: (state) => {
        state.events.connect == null ? void 0 : state.events.connect(meshRef.current);
        onCreated == null ? void 0 : onCreated(state);
      }
    });
    root2.current.render(/* @__PURE__ */ React12.createElement(ErrorBoundary, {
      set: setError
    }, /* @__PURE__ */ React12.createElement(React12.Suspense, {
      fallback: /* @__PURE__ */ React12.createElement(Block, {
        set: setBlock
      })
    }, children)));
  }
  useIsomorphicLayoutEffect2(() => {
    setCanvas(canvasRef.current);
  }, []);
  React12.useEffect(() => {
    if (canvas)
      return () => unmountComponentAtNode(canvas);
  }, [canvas]);
  return /* @__PURE__ */ React12.createElement("div", _extends({
    ref: react_merge_refs_esm_default([meshRef, containerRef]),
    style: {
      position: "relative",
      width: "100%",
      height: "100%",
      overflow: "hidden",
      ...style
    }
  }, props), /* @__PURE__ */ React12.createElement("canvas", {
    ref: react_merge_refs_esm_default([canvasRef, forwardedRef]),
    style: {
      display: "block"
    }
  }, fallback));
});

// node_modules/@react-three/drei/web/Html.js
var React13 = __toESM(require_react());
var ReactDOM3 = __toESM(require_client());
var v1 = new Vector3();
var v2 = new Vector3();
var v3 = new Vector3();
function defaultCalculatePosition(el, camera, size) {
  const objectPos = v1.setFromMatrixPosition(el.matrixWorld);
  objectPos.project(camera);
  const widthHalf = size.width / 2;
  const heightHalf = size.height / 2;
  return [objectPos.x * widthHalf + widthHalf, -(objectPos.y * heightHalf) + heightHalf];
}
function isObjectBehindCamera(el, camera) {
  const objectPos = v1.setFromMatrixPosition(el.matrixWorld);
  const cameraPos = v2.setFromMatrixPosition(camera.matrixWorld);
  const deltaCamObj = objectPos.sub(cameraPos);
  const camDir = camera.getWorldDirection(v3);
  return deltaCamObj.angleTo(camDir) > Math.PI / 2;
}
function isObjectVisible(el, camera, raycaster, occlude) {
  const elPos = v1.setFromMatrixPosition(el.matrixWorld);
  const screenPos = elPos.clone();
  screenPos.project(camera);
  raycaster.setFromCamera(screenPos, camera);
  const intersects2 = raycaster.intersectObjects(occlude, true);
  if (intersects2.length) {
    const intersectionDistance = intersects2[0].distance;
    const pointDistance = elPos.distanceTo(raycaster.ray.origin);
    return pointDistance < intersectionDistance;
  }
  return true;
}
function objectScale(el, camera) {
  if (camera instanceof OrthographicCamera) {
    return camera.zoom;
  } else if (camera instanceof PerspectiveCamera) {
    const objectPos = v1.setFromMatrixPosition(el.matrixWorld);
    const cameraPos = v2.setFromMatrixPosition(camera.matrixWorld);
    const vFOV = camera.fov * Math.PI / 180;
    const dist2 = objectPos.distanceTo(cameraPos);
    const scaleFOV = 2 * Math.tan(vFOV / 2) * dist2;
    return 1 / scaleFOV;
  } else {
    return 1;
  }
}
function objectZIndex(el, camera, zIndexRange) {
  if (camera instanceof PerspectiveCamera || camera instanceof OrthographicCamera) {
    const objectPos = v1.setFromMatrixPosition(el.matrixWorld);
    const cameraPos = v2.setFromMatrixPosition(camera.matrixWorld);
    const dist2 = objectPos.distanceTo(cameraPos);
    const A2 = (zIndexRange[1] - zIndexRange[0]) / (camera.far - camera.near);
    const B2 = zIndexRange[1] - A2 * camera.far;
    return Math.round(A2 * dist2 + B2);
  }
  return void 0;
}
var epsilon = (value) => Math.abs(value) < 1e-10 ? 0 : value;
function getCSSMatrix(matrix, multipliers, prepend = "") {
  let matrix3d = "matrix3d(";
  for (let i2 = 0; i2 !== 16; i2++) {
    matrix3d += epsilon(multipliers[i2] * matrix.elements[i2]) + (i2 !== 15 ? "," : ")");
  }
  return prepend + matrix3d;
}
var getCameraCSSMatrix = ((multipliers) => {
  return (matrix) => getCSSMatrix(matrix, multipliers);
})([1, -1, 1, 1, 1, -1, 1, 1, 1, -1, 1, 1, 1, -1, 1, 1]);
var getObjectCSSMatrix = ((scaleMultipliers) => {
  return (matrix, factor) => getCSSMatrix(matrix, scaleMultipliers(factor), "translate(-50%,-50%)");
})((f) => [1 / f, 1 / f, 1 / f, 1, -1 / f, -1 / f, -1 / f, -1, 1 / f, 1 / f, 1 / f, 1, 1, 1, 1, 1]);
var Html = /* @__PURE__ */ React13.forwardRef(({
  children,
  eps: eps2 = 1e-3,
  style,
  className,
  prepend,
  center,
  fullscreen,
  portal,
  distanceFactor,
  sprite = false,
  transform = false,
  occlude,
  onOcclude,
  zIndexRange = [16777271, 0],
  calculatePosition = defaultCalculatePosition,
  as = "div",
  wrapperClass,
  pointerEvents = "auto",
  ...props
}, ref) => {
  var _portal$current;
  const gl = useThree(({
    gl: gl2
  }) => gl2);
  const camera = useThree(({
    camera: camera2
  }) => camera2);
  const scene = useThree(({
    scene: scene2
  }) => scene2);
  const size = useThree(({
    size: size2
  }) => size2);
  const raycaster = useThree(({
    raycaster: raycaster2
  }) => raycaster2);
  const [el] = React13.useState(() => document.createElement(as));
  const root2 = React13.useMemo(() => ReactDOM3.createRoot(el), [el]);
  const group = React13.useRef(null);
  const oldZoom = React13.useRef(0);
  const oldPosition = React13.useRef([0, 0]);
  const transformOuterRef = React13.useRef(null);
  const transformInnerRef = React13.useRef(null);
  const target = (_portal$current = portal == null ? void 0 : portal.current) !== null && _portal$current !== void 0 ? _portal$current : gl.domElement.parentNode;
  React13.useEffect(() => {
    if (group.current) {
      scene.updateMatrixWorld();
      if (transform) {
        el.style.cssText = `position:absolute;top:0;left:0;pointer-events:none;overflow:hidden;`;
      } else {
        const vec2 = calculatePosition(group.current, camera, size);
        el.style.cssText = `position:absolute;top:0;left:0;transform:translate3d(${vec2[0]}px,${vec2[1]}px,0);transform-origin:0 0;`;
      }
      if (target) {
        if (prepend)
          target.prepend(el);
        else
          target.appendChild(el);
      }
      return () => {
        if (target)
          target.removeChild(el);
        root2.unmount();
      };
    }
  }, [target, transform]);
  React13.useLayoutEffect(() => {
    if (wrapperClass)
      el.className = wrapperClass;
  }, [wrapperClass]);
  const styles = React13.useMemo(() => {
    if (transform) {
      return {
        position: "absolute",
        top: 0,
        left: 0,
        width: size.width,
        height: size.height,
        transformStyle: "preserve-3d",
        pointerEvents: "none"
      };
    } else {
      return {
        position: "absolute",
        transform: center ? "translate3d(-50%,-50%,0)" : "none",
        ...fullscreen && {
          top: -size.height / 2,
          left: -size.width / 2,
          width: size.width,
          height: size.height
        },
        ...style
      };
    }
  }, [style, center, fullscreen, size, transform]);
  const transformInnerStyles = React13.useMemo(() => ({
    position: "absolute",
    pointerEvents
  }), [pointerEvents]);
  React13.useLayoutEffect(() => {
    if (transform) {
      root2.render(/* @__PURE__ */ React13.createElement("div", {
        ref: transformOuterRef,
        style: styles
      }, /* @__PURE__ */ React13.createElement("div", {
        ref: transformInnerRef,
        style: transformInnerStyles
      }, /* @__PURE__ */ React13.createElement("div", {
        ref,
        className,
        style,
        children
      }))));
    } else {
      root2.render(/* @__PURE__ */ React13.createElement("div", {
        ref,
        style: styles,
        className,
        children
      }));
    }
  });
  const visible = React13.useRef(true);
  useFrame(() => {
    if (group.current) {
      camera.updateMatrixWorld();
      group.current.updateWorldMatrix(true, false);
      const vec2 = transform ? oldPosition.current : calculatePosition(group.current, camera, size);
      if (transform || Math.abs(oldZoom.current - camera.zoom) > eps2 || Math.abs(oldPosition.current[0] - vec2[0]) > eps2 || Math.abs(oldPosition.current[1] - vec2[1]) > eps2) {
        const isBehindCamera = isObjectBehindCamera(group.current, camera);
        let raytraceTarget = false;
        if (typeof occlude === "boolean") {
          if (occlude === true) {
            raytraceTarget = [scene];
          }
        } else if (Array.isArray(occlude)) {
          raytraceTarget = occlude.map((item) => item.current);
        }
        const previouslyVisible = visible.current;
        if (raytraceTarget) {
          const isvisible = isObjectVisible(group.current, camera, raycaster, raytraceTarget);
          visible.current = isvisible && !isBehindCamera;
        } else {
          visible.current = !isBehindCamera;
        }
        if (previouslyVisible !== visible.current) {
          if (onOcclude)
            onOcclude(!visible.current);
          else
            el.style.display = visible.current ? "block" : "none";
        }
        el.style.zIndex = `${objectZIndex(group.current, camera, zIndexRange)}`;
        if (transform) {
          const [widthHalf, heightHalf] = [size.width / 2, size.height / 2];
          const fov2 = camera.projectionMatrix.elements[5] * heightHalf;
          const {
            isOrthographicCamera: isOrthographicCamera3,
            top: top2,
            left,
            bottom,
            right
          } = camera;
          const cameraMatrix = getCameraCSSMatrix(camera.matrixWorldInverse);
          const cameraTransform = isOrthographicCamera3 ? `scale(${fov2})translate(${epsilon(-(right + left) / 2)}px,${epsilon((top2 + bottom) / 2)}px)` : `translateZ(${fov2}px)`;
          let matrix = group.current.matrixWorld;
          if (sprite) {
            matrix = camera.matrixWorldInverse.clone().transpose().copyPosition(matrix).scale(group.current.scale);
            matrix.elements[3] = matrix.elements[7] = matrix.elements[11] = 0;
            matrix.elements[15] = 1;
          }
          el.style.width = size.width + "px";
          el.style.height = size.height + "px";
          el.style.perspective = isOrthographicCamera3 ? "" : `${fov2}px`;
          if (transformOuterRef.current && transformInnerRef.current) {
            transformOuterRef.current.style.transform = `${cameraTransform}${cameraMatrix}translate(${widthHalf}px,${heightHalf}px)`;
            transformInnerRef.current.style.transform = getObjectCSSMatrix(matrix, 1 / ((distanceFactor || 10) / 400));
          }
        } else {
          const scale = distanceFactor === void 0 ? 1 : objectScale(group.current, camera) * distanceFactor;
          el.style.transform = `translate3d(${vec2[0]}px,${vec2[1]}px,0) scale(${scale})`;
        }
        oldPosition.current = vec2;
        oldZoom.current = camera.zoom;
      }
    }
  });
  return /* @__PURE__ */ React13.createElement("group", _extends({}, props, {
    ref: group
  }));
});

// node_modules/three-stdlib/utils/BufferGeometryUtils.js
var mergeBufferGeometries = (geometries, useGroups) => {
  const isIndexed = geometries[0].index !== null;
  const attributesUsed = new Set(Object.keys(geometries[0].attributes));
  const morphAttributesUsed = new Set(Object.keys(geometries[0].morphAttributes));
  const attributes = {};
  const morphAttributes = {};
  const morphTargetsRelative = geometries[0].morphTargetsRelative;
  const mergedGeometry = new BufferGeometry();
  let offset = 0;
  geometries.forEach((geom, i2) => {
    let attributesCount = 0;
    if (isIndexed !== (geom.index !== null)) {
      console.error(
        "THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index " + i2 + ". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them."
      );
      return null;
    }
    for (let name2 in geom.attributes) {
      if (!attributesUsed.has(name2)) {
        console.error(
          "THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index " + i2 + '. All geometries must have compatible attributes; make sure "' + name2 + '" attribute exists among all geometries, or in none of them.'
        );
        return null;
      }
      if (attributes[name2] === void 0) {
        attributes[name2] = [];
      }
      attributes[name2].push(geom.attributes[name2]);
      attributesCount++;
    }
    if (attributesCount !== attributesUsed.size) {
      console.error(
        "THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index " + i2 + ". Make sure all geometries have the same number of attributes."
      );
      return null;
    }
    if (morphTargetsRelative !== geom.morphTargetsRelative) {
      console.error(
        "THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index " + i2 + ". .morphTargetsRelative must be consistent throughout all geometries."
      );
      return null;
    }
    for (let name2 in geom.morphAttributes) {
      if (!morphAttributesUsed.has(name2)) {
        console.error(
          "THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index " + i2 + ".  .morphAttributes must be consistent throughout all geometries."
        );
        return null;
      }
      if (morphAttributes[name2] === void 0)
        morphAttributes[name2] = [];
      morphAttributes[name2].push(geom.morphAttributes[name2]);
    }
    mergedGeometry.userData.mergedUserData = mergedGeometry.userData.mergedUserData || [];
    mergedGeometry.userData.mergedUserData.push(geom.userData);
    if (useGroups) {
      let count2;
      if (geom.index) {
        count2 = geom.index.count;
      } else if (geom.attributes.position !== void 0) {
        count2 = geom.attributes.position.count;
      } else {
        console.error(
          "THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index " + i2 + ". The geometry must have either an index or a position attribute"
        );
        return null;
      }
      mergedGeometry.addGroup(offset, count2, i2);
      offset += count2;
    }
  });
  if (isIndexed) {
    let indexOffset = 0;
    const mergedIndex = [];
    geometries.forEach((geom) => {
      const index = geom.index;
      for (let j = 0; j < index.count; ++j) {
        mergedIndex.push(index.getX(j) + indexOffset);
      }
      indexOffset += geom.attributes.position.count;
    });
    mergedGeometry.setIndex(mergedIndex);
  }
  for (let name2 in attributes) {
    const mergedAttribute = mergeBufferAttributes(attributes[name2]);
    if (!mergedAttribute) {
      console.error(
        "THREE.BufferGeometryUtils: .mergeBufferGeometries() failed while trying to merge the " + name2 + " attribute."
      );
      return null;
    }
    mergedGeometry.setAttribute(name2, mergedAttribute);
  }
  for (let name2 in morphAttributes) {
    const numMorphTargets = morphAttributes[name2][0].length;
    if (numMorphTargets === 0)
      break;
    mergedGeometry.morphAttributes = mergedGeometry.morphAttributes || {};
    mergedGeometry.morphAttributes[name2] = [];
    for (let i2 = 0; i2 < numMorphTargets; ++i2) {
      const morphAttributesToMerge = [];
      for (let j = 0; j < morphAttributes[name2].length; ++j) {
        morphAttributesToMerge.push(morphAttributes[name2][j][i2]);
      }
      const mergedMorphAttribute = mergeBufferAttributes(morphAttributesToMerge);
      if (!mergedMorphAttribute) {
        console.error(
          "THREE.BufferGeometryUtils: .mergeBufferGeometries() failed while trying to merge the " + name2 + " morphAttribute."
        );
        return null;
      }
      mergedGeometry.morphAttributes[name2].push(mergedMorphAttribute);
    }
  }
  return mergedGeometry;
};
var mergeBufferAttributes = (attributes) => {
  let TypedArray = void 0;
  let itemSize = void 0;
  let normalized = void 0;
  let arrayLength = 0;
  attributes.forEach((attr) => {
    if (TypedArray === void 0) {
      TypedArray = attr.array.constructor;
    }
    if (TypedArray !== attr.array.constructor) {
      console.error(
        "THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes."
      );
      return null;
    }
    if (itemSize === void 0)
      itemSize = attr.itemSize;
    if (itemSize !== attr.itemSize) {
      console.error(
        "THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes."
      );
      return null;
    }
    if (normalized === void 0)
      normalized = attr.normalized;
    if (normalized !== attr.normalized) {
      console.error(
        "THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes."
      );
      return null;
    }
    arrayLength += attr.array.length;
  });
  if (TypedArray && itemSize) {
    const array = new TypedArray(arrayLength);
    let offset = 0;
    attributes.forEach((attr) => {
      array.set(attr.array, offset);
      offset += attr.array.length;
    });
    return new BufferAttribute(array, itemSize, normalized);
  }
};

// node_modules/three-stdlib/controls/OrbitControls.js
var __defProp2 = Object.defineProperty;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __publicField = (obj, key, value) => {
  __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
  return value;
};
var moduloWrapAround = (offset, capacity) => (offset % capacity + capacity) % capacity;
var OrbitControls = class extends EventDispatcher {
  constructor(object, domElement) {
    super();
    __publicField(this, "object");
    __publicField(this, "domElement");
    __publicField(this, "enabled", true);
    __publicField(this, "target", new Vector3());
    __publicField(this, "minDistance", 0);
    __publicField(this, "maxDistance", Infinity);
    __publicField(this, "minZoom", 0);
    __publicField(this, "maxZoom", Infinity);
    __publicField(this, "minPolarAngle", 0);
    __publicField(this, "maxPolarAngle", Math.PI);
    __publicField(this, "minAzimuthAngle", -Infinity);
    __publicField(this, "maxAzimuthAngle", Infinity);
    __publicField(this, "enableDamping", false);
    __publicField(this, "dampingFactor", 0.05);
    __publicField(this, "enableZoom", true);
    __publicField(this, "zoomSpeed", 1);
    __publicField(this, "enableRotate", true);
    __publicField(this, "rotateSpeed", 1);
    __publicField(this, "enablePan", true);
    __publicField(this, "panSpeed", 1);
    __publicField(this, "screenSpacePanning", true);
    __publicField(this, "keyPanSpeed", 7);
    __publicField(this, "autoRotate", false);
    __publicField(this, "autoRotateSpeed", 2);
    __publicField(this, "reverseOrbit", false);
    __publicField(this, "keys", { LEFT: "ArrowLeft", UP: "ArrowUp", RIGHT: "ArrowRight", BOTTOM: "ArrowDown" });
    __publicField(this, "mouseButtons", {
      LEFT: MOUSE.ROTATE,
      MIDDLE: MOUSE.DOLLY,
      RIGHT: MOUSE.PAN
    });
    __publicField(this, "touches", { ONE: TOUCH.ROTATE, TWO: TOUCH.DOLLY_PAN });
    __publicField(this, "target0");
    __publicField(this, "position0");
    __publicField(this, "zoom0");
    __publicField(this, "_domElementKeyEvents", null);
    __publicField(this, "getPolarAngle");
    __publicField(this, "getAzimuthalAngle");
    __publicField(this, "setPolarAngle");
    __publicField(this, "setAzimuthalAngle");
    __publicField(this, "getDistance");
    __publicField(this, "listenToKeyEvents");
    __publicField(this, "saveState");
    __publicField(this, "reset");
    __publicField(this, "update");
    __publicField(this, "connect");
    __publicField(this, "dispose");
    this.object = object;
    this.domElement = domElement;
    this.target0 = this.target.clone();
    this.position0 = this.object.position.clone();
    this.zoom0 = this.object.zoom;
    this.getPolarAngle = () => spherical.phi;
    this.getAzimuthalAngle = () => spherical.theta;
    this.setPolarAngle = (value) => {
      let phi = moduloWrapAround(value, 2 * Math.PI);
      let currentPhi = spherical.phi;
      if (currentPhi < 0)
        currentPhi += 2 * Math.PI;
      if (phi < 0)
        phi += 2 * Math.PI;
      let phiDist = Math.abs(phi - currentPhi);
      if (2 * Math.PI - phiDist < phiDist) {
        if (phi < currentPhi) {
          phi += 2 * Math.PI;
        } else {
          currentPhi += 2 * Math.PI;
        }
      }
      sphericalDelta.phi = phi - currentPhi;
      scope.update();
    };
    this.setAzimuthalAngle = (value) => {
      let theta = moduloWrapAround(value, 2 * Math.PI);
      let currentTheta = spherical.theta;
      if (currentTheta < 0)
        currentTheta += 2 * Math.PI;
      if (theta < 0)
        theta += 2 * Math.PI;
      let thetaDist = Math.abs(theta - currentTheta);
      if (2 * Math.PI - thetaDist < thetaDist) {
        if (theta < currentTheta) {
          theta += 2 * Math.PI;
        } else {
          currentTheta += 2 * Math.PI;
        }
      }
      sphericalDelta.theta = theta - currentTheta;
      scope.update();
    };
    this.getDistance = () => scope.object.position.distanceTo(scope.target);
    this.listenToKeyEvents = (domElement2) => {
      domElement2.addEventListener("keydown", onKeyDown);
      this._domElementKeyEvents = domElement2;
    };
    this.saveState = () => {
      scope.target0.copy(scope.target);
      scope.position0.copy(scope.object.position);
      scope.zoom0 = scope.object.zoom;
    };
    this.reset = () => {
      scope.target.copy(scope.target0);
      scope.object.position.copy(scope.position0);
      scope.object.zoom = scope.zoom0;
      scope.object.updateProjectionMatrix();
      scope.dispatchEvent(changeEvent);
      scope.update();
      state = STATE.NONE;
    };
    this.update = (() => {
      const offset = new Vector3();
      const quat = new Quaternion().setFromUnitVectors(object.up, new Vector3(0, 1, 0));
      const quatInverse = quat.clone().invert();
      const lastPosition = new Vector3();
      const lastQuaternion = new Quaternion();
      const twoPI = 2 * Math.PI;
      return function update() {
        const position2 = scope.object.position;
        offset.copy(position2).sub(scope.target);
        offset.applyQuaternion(quat);
        spherical.setFromVector3(offset);
        if (scope.autoRotate && state === STATE.NONE) {
          rotateLeft(getAutoRotationAngle());
        }
        if (scope.enableDamping) {
          spherical.theta += sphericalDelta.theta * scope.dampingFactor;
          spherical.phi += sphericalDelta.phi * scope.dampingFactor;
        } else {
          spherical.theta += sphericalDelta.theta;
          spherical.phi += sphericalDelta.phi;
        }
        let min3 = scope.minAzimuthAngle;
        let max3 = scope.maxAzimuthAngle;
        if (isFinite(min3) && isFinite(max3)) {
          if (min3 < -Math.PI)
            min3 += twoPI;
          else if (min3 > Math.PI)
            min3 -= twoPI;
          if (max3 < -Math.PI)
            max3 += twoPI;
          else if (max3 > Math.PI)
            max3 -= twoPI;
          if (min3 <= max3) {
            spherical.theta = Math.max(min3, Math.min(max3, spherical.theta));
          } else {
            spherical.theta = spherical.theta > (min3 + max3) / 2 ? Math.max(min3, spherical.theta) : Math.min(max3, spherical.theta);
          }
        }
        spherical.phi = Math.max(scope.minPolarAngle, Math.min(scope.maxPolarAngle, spherical.phi));
        spherical.makeSafe();
        spherical.radius *= scale;
        spherical.radius = Math.max(scope.minDistance, Math.min(scope.maxDistance, spherical.radius));
        if (scope.enableDamping === true) {
          scope.target.addScaledVector(panOffset, scope.dampingFactor);
        } else {
          scope.target.add(panOffset);
        }
        offset.setFromSpherical(spherical);
        offset.applyQuaternion(quatInverse);
        position2.copy(scope.target).add(offset);
        scope.object.lookAt(scope.target);
        if (scope.enableDamping === true) {
          sphericalDelta.theta *= 1 - scope.dampingFactor;
          sphericalDelta.phi *= 1 - scope.dampingFactor;
          panOffset.multiplyScalar(1 - scope.dampingFactor);
        } else {
          sphericalDelta.set(0, 0, 0);
          panOffset.set(0, 0, 0);
        }
        scale = 1;
        if (zoomChanged || lastPosition.distanceToSquared(scope.object.position) > EPS4 || 8 * (1 - lastQuaternion.dot(scope.object.quaternion)) > EPS4) {
          scope.dispatchEvent(changeEvent);
          lastPosition.copy(scope.object.position);
          lastQuaternion.copy(scope.object.quaternion);
          zoomChanged = false;
          return true;
        }
        return false;
      };
    })();
    this.connect = (domElement2) => {
      if (domElement2 === document) {
        console.error(
          'THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'
        );
      }
      scope.domElement = domElement2;
      scope.domElement.style.touchAction = "none";
      scope.domElement.addEventListener("contextmenu", onContextMenu);
      scope.domElement.addEventListener("pointerdown", onPointerDown);
      scope.domElement.addEventListener("pointercancel", onPointerCancel);
      scope.domElement.addEventListener("wheel", onMouseWheel);
    };
    this.dispose = () => {
      var _a2, _b, _c, _d, _e, _f;
      (_a2 = scope.domElement) == null ? void 0 : _a2.removeEventListener("contextmenu", onContextMenu);
      (_b = scope.domElement) == null ? void 0 : _b.removeEventListener("pointerdown", onPointerDown);
      (_c = scope.domElement) == null ? void 0 : _c.removeEventListener("pointercancel", onPointerCancel);
      (_d = scope.domElement) == null ? void 0 : _d.removeEventListener("wheel", onMouseWheel);
      (_e = scope.domElement) == null ? void 0 : _e.ownerDocument.removeEventListener("pointermove", onPointerMove);
      (_f = scope.domElement) == null ? void 0 : _f.ownerDocument.removeEventListener("pointerup", onPointerUp);
      if (scope._domElementKeyEvents !== null) {
        scope._domElementKeyEvents.removeEventListener("keydown", onKeyDown);
      }
    };
    const scope = this;
    const changeEvent = { type: "change" };
    const startEvent = { type: "start" };
    const endEvent = { type: "end" };
    const STATE = {
      NONE: -1,
      ROTATE: 0,
      DOLLY: 1,
      PAN: 2,
      TOUCH_ROTATE: 3,
      TOUCH_PAN: 4,
      TOUCH_DOLLY_PAN: 5,
      TOUCH_DOLLY_ROTATE: 6
    };
    let state = STATE.NONE;
    const EPS4 = 1e-6;
    const spherical = new Spherical();
    const sphericalDelta = new Spherical();
    let scale = 1;
    const panOffset = new Vector3();
    let zoomChanged = false;
    const rotateStart = new Vector2();
    const rotateEnd = new Vector2();
    const rotateDelta = new Vector2();
    const panStart = new Vector2();
    const panEnd = new Vector2();
    const panDelta = new Vector2();
    const dollyStart = new Vector2();
    const dollyEnd = new Vector2();
    const dollyDelta = new Vector2();
    const pointers = [];
    const pointerPositions = {};
    function getAutoRotationAngle() {
      return 2 * Math.PI / 60 / 60 * scope.autoRotateSpeed;
    }
    function getZoomScale() {
      return Math.pow(0.95, scope.zoomSpeed);
    }
    function rotateLeft(angle) {
      if (scope.reverseOrbit) {
        sphericalDelta.theta += angle;
      } else {
        sphericalDelta.theta -= angle;
      }
    }
    function rotateUp(angle) {
      if (scope.reverseOrbit) {
        sphericalDelta.phi += angle;
      } else {
        sphericalDelta.phi -= angle;
      }
    }
    const panLeft = (() => {
      const v4 = new Vector3();
      return function panLeft2(distance, objectMatrix) {
        v4.setFromMatrixColumn(objectMatrix, 0);
        v4.multiplyScalar(-distance);
        panOffset.add(v4);
      };
    })();
    const panUp = (() => {
      const v4 = new Vector3();
      return function panUp2(distance, objectMatrix) {
        if (scope.screenSpacePanning === true) {
          v4.setFromMatrixColumn(objectMatrix, 1);
        } else {
          v4.setFromMatrixColumn(objectMatrix, 0);
          v4.crossVectors(scope.object.up, v4);
        }
        v4.multiplyScalar(distance);
        panOffset.add(v4);
      };
    })();
    const pan = (() => {
      const offset = new Vector3();
      return function pan2(deltaX, deltaY) {
        const element2 = scope.domElement;
        if (element2 && scope.object instanceof PerspectiveCamera && scope.object.isPerspectiveCamera) {
          const position2 = scope.object.position;
          offset.copy(position2).sub(scope.target);
          let targetDistance = offset.length();
          targetDistance *= Math.tan(scope.object.fov / 2 * Math.PI / 180);
          panLeft(2 * deltaX * targetDistance / element2.clientHeight, scope.object.matrix);
          panUp(2 * deltaY * targetDistance / element2.clientHeight, scope.object.matrix);
        } else if (element2 && scope.object instanceof OrthographicCamera && scope.object.isOrthographicCamera) {
          panLeft(
            deltaX * (scope.object.right - scope.object.left) / scope.object.zoom / element2.clientWidth,
            scope.object.matrix
          );
          panUp(
            deltaY * (scope.object.top - scope.object.bottom) / scope.object.zoom / element2.clientHeight,
            scope.object.matrix
          );
        } else {
          console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled.");
          scope.enablePan = false;
        }
      };
    })();
    function dollyOut(dollyScale) {
      if (scope.object instanceof PerspectiveCamera && scope.object.isPerspectiveCamera) {
        scale /= dollyScale;
      } else if (scope.object instanceof OrthographicCamera && scope.object.isOrthographicCamera) {
        scope.object.zoom = Math.max(scope.minZoom, Math.min(scope.maxZoom, scope.object.zoom * dollyScale));
        scope.object.updateProjectionMatrix();
        zoomChanged = true;
      } else {
        console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.");
        scope.enableZoom = false;
      }
    }
    function dollyIn(dollyScale) {
      if (scope.object instanceof PerspectiveCamera && scope.object.isPerspectiveCamera) {
        scale *= dollyScale;
      } else if (scope.object instanceof OrthographicCamera && scope.object.isOrthographicCamera) {
        scope.object.zoom = Math.max(scope.minZoom, Math.min(scope.maxZoom, scope.object.zoom / dollyScale));
        scope.object.updateProjectionMatrix();
        zoomChanged = true;
      } else {
        console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.");
        scope.enableZoom = false;
      }
    }
    function handleMouseDownRotate(event) {
      rotateStart.set(event.clientX, event.clientY);
    }
    function handleMouseDownDolly(event) {
      dollyStart.set(event.clientX, event.clientY);
    }
    function handleMouseDownPan(event) {
      panStart.set(event.clientX, event.clientY);
    }
    function handleMouseMoveRotate(event) {
      rotateEnd.set(event.clientX, event.clientY);
      rotateDelta.subVectors(rotateEnd, rotateStart).multiplyScalar(scope.rotateSpeed);
      const element2 = scope.domElement;
      if (element2) {
        rotateLeft(2 * Math.PI * rotateDelta.x / element2.clientHeight);
        rotateUp(2 * Math.PI * rotateDelta.y / element2.clientHeight);
      }
      rotateStart.copy(rotateEnd);
      scope.update();
    }
    function handleMouseMoveDolly(event) {
      dollyEnd.set(event.clientX, event.clientY);
      dollyDelta.subVectors(dollyEnd, dollyStart);
      if (dollyDelta.y > 0) {
        dollyOut(getZoomScale());
      } else if (dollyDelta.y < 0) {
        dollyIn(getZoomScale());
      }
      dollyStart.copy(dollyEnd);
      scope.update();
    }
    function handleMouseMovePan(event) {
      panEnd.set(event.clientX, event.clientY);
      panDelta.subVectors(panEnd, panStart).multiplyScalar(scope.panSpeed);
      pan(panDelta.x, panDelta.y);
      panStart.copy(panEnd);
      scope.update();
    }
    function handleMouseWheel(event) {
      if (event.deltaY < 0) {
        dollyIn(getZoomScale());
      } else if (event.deltaY > 0) {
        dollyOut(getZoomScale());
      }
      scope.update();
    }
    function handleKeyDown(event) {
      let needsUpdate = false;
      switch (event.code) {
        case scope.keys.UP:
          pan(0, scope.keyPanSpeed);
          needsUpdate = true;
          break;
        case scope.keys.BOTTOM:
          pan(0, -scope.keyPanSpeed);
          needsUpdate = true;
          break;
        case scope.keys.LEFT:
          pan(scope.keyPanSpeed, 0);
          needsUpdate = true;
          break;
        case scope.keys.RIGHT:
          pan(-scope.keyPanSpeed, 0);
          needsUpdate = true;
          break;
      }
      if (needsUpdate) {
        event.preventDefault();
        scope.update();
      }
    }
    function handleTouchStartRotate() {
      if (pointers.length == 1) {
        rotateStart.set(pointers[0].pageX, pointers[0].pageY);
      } else {
        const x2 = 0.5 * (pointers[0].pageX + pointers[1].pageX);
        const y2 = 0.5 * (pointers[0].pageY + pointers[1].pageY);
        rotateStart.set(x2, y2);
      }
    }
    function handleTouchStartPan() {
      if (pointers.length == 1) {
        panStart.set(pointers[0].pageX, pointers[0].pageY);
      } else {
        const x2 = 0.5 * (pointers[0].pageX + pointers[1].pageX);
        const y2 = 0.5 * (pointers[0].pageY + pointers[1].pageY);
        panStart.set(x2, y2);
      }
    }
    function handleTouchStartDolly() {
      const dx = pointers[0].pageX - pointers[1].pageX;
      const dy = pointers[0].pageY - pointers[1].pageY;
      const distance = Math.sqrt(dx * dx + dy * dy);
      dollyStart.set(0, distance);
    }
    function handleTouchStartDollyPan() {
      if (scope.enableZoom)
        handleTouchStartDolly();
      if (scope.enablePan)
        handleTouchStartPan();
    }
    function handleTouchStartDollyRotate() {
      if (scope.enableZoom)
        handleTouchStartDolly();
      if (scope.enableRotate)
        handleTouchStartRotate();
    }
    function handleTouchMoveRotate(event) {
      if (pointers.length == 1) {
        rotateEnd.set(event.pageX, event.pageY);
      } else {
        const position2 = getSecondPointerPosition(event);
        const x2 = 0.5 * (event.pageX + position2.x);
        const y2 = 0.5 * (event.pageY + position2.y);
        rotateEnd.set(x2, y2);
      }
      rotateDelta.subVectors(rotateEnd, rotateStart).multiplyScalar(scope.rotateSpeed);
      const element2 = scope.domElement;
      if (element2) {
        rotateLeft(2 * Math.PI * rotateDelta.x / element2.clientHeight);
        rotateUp(2 * Math.PI * rotateDelta.y / element2.clientHeight);
      }
      rotateStart.copy(rotateEnd);
    }
    function handleTouchMovePan(event) {
      if (pointers.length == 1) {
        panEnd.set(event.pageX, event.pageY);
      } else {
        const position2 = getSecondPointerPosition(event);
        const x2 = 0.5 * (event.pageX + position2.x);
        const y2 = 0.5 * (event.pageY + position2.y);
        panEnd.set(x2, y2);
      }
      panDelta.subVectors(panEnd, panStart).multiplyScalar(scope.panSpeed);
      pan(panDelta.x, panDelta.y);
      panStart.copy(panEnd);
    }
    function handleTouchMoveDolly(event) {
      const position2 = getSecondPointerPosition(event);
      const dx = event.pageX - position2.x;
      const dy = event.pageY - position2.y;
      const distance = Math.sqrt(dx * dx + dy * dy);
      dollyEnd.set(0, distance);
      dollyDelta.set(0, Math.pow(dollyEnd.y / dollyStart.y, scope.zoomSpeed));
      dollyOut(dollyDelta.y);
      dollyStart.copy(dollyEnd);
    }
    function handleTouchMoveDollyPan(event) {
      if (scope.enableZoom)
        handleTouchMoveDolly(event);
      if (scope.enablePan)
        handleTouchMovePan(event);
    }
    function handleTouchMoveDollyRotate(event) {
      if (scope.enableZoom)
        handleTouchMoveDolly(event);
      if (scope.enableRotate)
        handleTouchMoveRotate(event);
    }
    function onPointerDown(event) {
      var _a2, _b;
      if (scope.enabled === false)
        return;
      if (pointers.length === 0) {
        (_a2 = scope.domElement) == null ? void 0 : _a2.ownerDocument.addEventListener("pointermove", onPointerMove);
        (_b = scope.domElement) == null ? void 0 : _b.ownerDocument.addEventListener("pointerup", onPointerUp);
      }
      addPointer(event);
      if (event.pointerType === "touch") {
        onTouchStart(event);
      } else {
        onMouseDown(event);
      }
    }
    function onPointerMove(event) {
      if (scope.enabled === false)
        return;
      if (event.pointerType === "touch") {
        onTouchMove(event);
      } else {
        onMouseMove(event);
      }
    }
    function onPointerUp(event) {
      var _a2, _b, _c;
      removePointer(event);
      if (pointers.length === 0) {
        (_a2 = scope.domElement) == null ? void 0 : _a2.releasePointerCapture(event.pointerId);
        (_b = scope.domElement) == null ? void 0 : _b.ownerDocument.removeEventListener("pointermove", onPointerMove);
        (_c = scope.domElement) == null ? void 0 : _c.ownerDocument.removeEventListener("pointerup", onPointerUp);
      }
      scope.dispatchEvent(endEvent);
      state = STATE.NONE;
    }
    function onPointerCancel(event) {
      removePointer(event);
    }
    function onMouseDown(event) {
      let mouseAction;
      switch (event.button) {
        case 0:
          mouseAction = scope.mouseButtons.LEFT;
          break;
        case 1:
          mouseAction = scope.mouseButtons.MIDDLE;
          break;
        case 2:
          mouseAction = scope.mouseButtons.RIGHT;
          break;
        default:
          mouseAction = -1;
      }
      switch (mouseAction) {
        case MOUSE.DOLLY:
          if (scope.enableZoom === false)
            return;
          handleMouseDownDolly(event);
          state = STATE.DOLLY;
          break;
        case MOUSE.ROTATE:
          if (event.ctrlKey || event.metaKey || event.shiftKey) {
            if (scope.enablePan === false)
              return;
            handleMouseDownPan(event);
            state = STATE.PAN;
          } else {
            if (scope.enableRotate === false)
              return;
            handleMouseDownRotate(event);
            state = STATE.ROTATE;
          }
          break;
        case MOUSE.PAN:
          if (event.ctrlKey || event.metaKey || event.shiftKey) {
            if (scope.enableRotate === false)
              return;
            handleMouseDownRotate(event);
            state = STATE.ROTATE;
          } else {
            if (scope.enablePan === false)
              return;
            handleMouseDownPan(event);
            state = STATE.PAN;
          }
          break;
        default:
          state = STATE.NONE;
      }
      if (state !== STATE.NONE) {
        scope.dispatchEvent(startEvent);
      }
    }
    function onMouseMove(event) {
      if (scope.enabled === false)
        return;
      switch (state) {
        case STATE.ROTATE:
          if (scope.enableRotate === false)
            return;
          handleMouseMoveRotate(event);
          break;
        case STATE.DOLLY:
          if (scope.enableZoom === false)
            return;
          handleMouseMoveDolly(event);
          break;
        case STATE.PAN:
          if (scope.enablePan === false)
            return;
          handleMouseMovePan(event);
          break;
      }
    }
    function onMouseWheel(event) {
      if (scope.enabled === false || scope.enableZoom === false || state !== STATE.NONE && state !== STATE.ROTATE) {
        return;
      }
      event.preventDefault();
      scope.dispatchEvent(startEvent);
      handleMouseWheel(event);
      scope.dispatchEvent(endEvent);
    }
    function onKeyDown(event) {
      if (scope.enabled === false || scope.enablePan === false)
        return;
      handleKeyDown(event);
    }
    function onTouchStart(event) {
      trackPointer(event);
      switch (pointers.length) {
        case 1:
          switch (scope.touches.ONE) {
            case TOUCH.ROTATE:
              if (scope.enableRotate === false)
                return;
              handleTouchStartRotate();
              state = STATE.TOUCH_ROTATE;
              break;
            case TOUCH.PAN:
              if (scope.enablePan === false)
                return;
              handleTouchStartPan();
              state = STATE.TOUCH_PAN;
              break;
            default:
              state = STATE.NONE;
          }
          break;
        case 2:
          switch (scope.touches.TWO) {
            case TOUCH.DOLLY_PAN:
              if (scope.enableZoom === false && scope.enablePan === false)
                return;
              handleTouchStartDollyPan();
              state = STATE.TOUCH_DOLLY_PAN;
              break;
            case TOUCH.DOLLY_ROTATE:
              if (scope.enableZoom === false && scope.enableRotate === false)
                return;
              handleTouchStartDollyRotate();
              state = STATE.TOUCH_DOLLY_ROTATE;
              break;
            default:
              state = STATE.NONE;
          }
          break;
        default:
          state = STATE.NONE;
      }
      if (state !== STATE.NONE) {
        scope.dispatchEvent(startEvent);
      }
    }
    function onTouchMove(event) {
      trackPointer(event);
      switch (state) {
        case STATE.TOUCH_ROTATE:
          if (scope.enableRotate === false)
            return;
          handleTouchMoveRotate(event);
          scope.update();
          break;
        case STATE.TOUCH_PAN:
          if (scope.enablePan === false)
            return;
          handleTouchMovePan(event);
          scope.update();
          break;
        case STATE.TOUCH_DOLLY_PAN:
          if (scope.enableZoom === false && scope.enablePan === false)
            return;
          handleTouchMoveDollyPan(event);
          scope.update();
          break;
        case STATE.TOUCH_DOLLY_ROTATE:
          if (scope.enableZoom === false && scope.enableRotate === false)
            return;
          handleTouchMoveDollyRotate(event);
          scope.update();
          break;
        default:
          state = STATE.NONE;
      }
    }
    function onContextMenu(event) {
      if (scope.enabled === false)
        return;
      event.preventDefault();
    }
    function addPointer(event) {
      pointers.push(event);
    }
    function removePointer(event) {
      delete pointerPositions[event.pointerId];
      for (let i2 = 0; i2 < pointers.length; i2++) {
        if (pointers[i2].pointerId == event.pointerId) {
          pointers.splice(i2, 1);
          return;
        }
      }
    }
    function trackPointer(event) {
      let position2 = pointerPositions[event.pointerId];
      if (position2 === void 0) {
        position2 = new Vector2();
        pointerPositions[event.pointerId] = position2;
      }
      position2.set(event.pageX, event.pageY);
    }
    function getSecondPointerPosition(event) {
      const pointer = event.pointerId === pointers[0].pointerId ? pointers[1] : pointers[0];
      return pointerPositions[pointer.pointerId];
    }
    if (domElement !== void 0)
      this.connect(domElement);
    this.update();
  }
};

// node_modules/three-stdlib/lines/LineSegmentsGeometry.js
var _box2 = /* @__PURE__ */ new Box3();
var _vector3 = /* @__PURE__ */ new Vector3();
var LineSegmentsGeometry = class extends InstancedBufferGeometry {
  constructor() {
    super();
    this.isLineSegmentsGeometry = true;
    this.type = "LineSegmentsGeometry";
    const positions = [-1, 2, 0, 1, 2, 0, -1, 1, 0, 1, 1, 0, -1, 0, 0, 1, 0, 0, -1, -1, 0, 1, -1, 0];
    const uvs = [-1, 2, 1, 2, -1, 1, 1, 1, -1, -1, 1, -1, -1, -2, 1, -2];
    const index = [0, 2, 1, 2, 3, 1, 2, 4, 3, 4, 5, 3, 4, 6, 5, 6, 7, 5];
    this.setIndex(index);
    this.setAttribute("position", new Float32BufferAttribute(positions, 3));
    this.setAttribute("uv", new Float32BufferAttribute(uvs, 2));
  }
  applyMatrix4(matrix) {
    const start = this.attributes.instanceStart;
    const end = this.attributes.instanceEnd;
    if (start !== void 0) {
      start.applyMatrix4(matrix);
      end.applyMatrix4(matrix);
      start.needsUpdate = true;
    }
    if (this.boundingBox !== null) {
      this.computeBoundingBox();
    }
    if (this.boundingSphere !== null) {
      this.computeBoundingSphere();
    }
    return this;
  }
  setPositions(array) {
    let lineSegments;
    if (array instanceof Float32Array) {
      lineSegments = array;
    } else if (Array.isArray(array)) {
      lineSegments = new Float32Array(array);
    }
    const instanceBuffer = new InstancedInterleavedBuffer(lineSegments, 6, 1);
    this.setAttribute("instanceStart", new InterleavedBufferAttribute(instanceBuffer, 3, 0));
    this.setAttribute("instanceEnd", new InterleavedBufferAttribute(instanceBuffer, 3, 3));
    this.computeBoundingBox();
    this.computeBoundingSphere();
    return this;
  }
  setColors(array) {
    let colors;
    if (array instanceof Float32Array) {
      colors = array;
    } else if (Array.isArray(array)) {
      colors = new Float32Array(array);
    }
    const instanceColorBuffer = new InstancedInterleavedBuffer(colors, 6, 1);
    this.setAttribute("instanceColorStart", new InterleavedBufferAttribute(instanceColorBuffer, 3, 0));
    this.setAttribute("instanceColorEnd", new InterleavedBufferAttribute(instanceColorBuffer, 3, 3));
    return this;
  }
  fromWireframeGeometry(geometry) {
    this.setPositions(geometry.attributes.position.array);
    return this;
  }
  fromEdgesGeometry(geometry) {
    this.setPositions(geometry.attributes.position.array);
    return this;
  }
  fromMesh(mesh) {
    this.fromWireframeGeometry(new WireframeGeometry(mesh.geometry));
    return this;
  }
  fromLineSegments(lineSegments) {
    const geometry = lineSegments.geometry;
    this.setPositions(geometry.attributes.position.array);
    return this;
  }
  computeBoundingBox() {
    if (this.boundingBox === null) {
      this.boundingBox = new Box3();
    }
    const start = this.attributes.instanceStart;
    const end = this.attributes.instanceEnd;
    if (start !== void 0 && end !== void 0) {
      this.boundingBox.setFromBufferAttribute(start);
      _box2.setFromBufferAttribute(end);
      this.boundingBox.union(_box2);
    }
  }
  computeBoundingSphere() {
    if (this.boundingSphere === null) {
      this.boundingSphere = new Sphere();
    }
    if (this.boundingBox === null) {
      this.computeBoundingBox();
    }
    const start = this.attributes.instanceStart;
    const end = this.attributes.instanceEnd;
    if (start !== void 0 && end !== void 0) {
      const center = this.boundingSphere.center;
      this.boundingBox.getCenter(center);
      let maxRadiusSq = 0;
      for (let i2 = 0, il = start.count; i2 < il; i2++) {
        _vector3.fromBufferAttribute(start, i2);
        maxRadiusSq = Math.max(maxRadiusSq, center.distanceToSquared(_vector3));
        _vector3.fromBufferAttribute(end, i2);
        maxRadiusSq = Math.max(maxRadiusSq, center.distanceToSquared(_vector3));
      }
      this.boundingSphere.radius = Math.sqrt(maxRadiusSq);
      if (isNaN(this.boundingSphere.radius)) {
        console.error(
          "THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",
          this
        );
      }
    }
  }
  toJSON() {
  }
  applyMatrix(matrix) {
    console.warn("THREE.LineSegmentsGeometry: applyMatrix() has been renamed to applyMatrix4().");
    return this.applyMatrix4(matrix);
  }
};

// node_modules/three-stdlib/lines/LineGeometry.js
var LineGeometry = class extends LineSegmentsGeometry {
  constructor() {
    super();
    this.isLineGeometry = true;
    this.type = "LineGeometry";
  }
  setPositions(array) {
    const length2 = array.length - 3;
    const points = new Float32Array(2 * length2);
    for (let i2 = 0; i2 < length2; i2 += 3) {
      points[2 * i2] = array[i2];
      points[2 * i2 + 1] = array[i2 + 1];
      points[2 * i2 + 2] = array[i2 + 2];
      points[2 * i2 + 3] = array[i2 + 3];
      points[2 * i2 + 4] = array[i2 + 4];
      points[2 * i2 + 5] = array[i2 + 5];
    }
    super.setPositions(points);
    return this;
  }
  setColors(array) {
    const length2 = array.length - 3;
    const colors = new Float32Array(2 * length2);
    for (let i2 = 0; i2 < length2; i2 += 3) {
      colors[2 * i2] = array[i2];
      colors[2 * i2 + 1] = array[i2 + 1];
      colors[2 * i2 + 2] = array[i2 + 2];
      colors[2 * i2 + 3] = array[i2 + 3];
      colors[2 * i2 + 4] = array[i2 + 4];
      colors[2 * i2 + 5] = array[i2 + 5];
    }
    super.setColors(colors);
    return this;
  }
  fromLine(line2) {
    const geometry = line2.geometry;
    this.setPositions(geometry.attributes.position.array);
    return this;
  }
};

// node_modules/three-stdlib/lines/LineMaterial.js
var LineMaterial = class extends ShaderMaterial {
  constructor(parameters) {
    super({
      type: "LineMaterial",
      uniforms: UniformsUtils.clone(
        UniformsUtils.merge([
          UniformsLib.common,
          UniformsLib.fog,
          {
            worldUnits: { value: 1 },
            linewidth: { value: 1 },
            resolution: { value: new Vector2(1, 1) },
            dashOffset: { value: 0 },
            dashScale: { value: 1 },
            dashSize: { value: 1 },
            gapSize: { value: 1 }
            // todo FIX - maybe change to totalSize
          }
        ])
      ),
      vertexShader: (
        /* glsl */
        `
				#include <common>
				#include <color_pars_vertex>
				#include <fog_pars_vertex>
				#include <logdepthbuf_pars_vertex>
				#include <clipping_planes_pars_vertex>

				uniform float linewidth;
				uniform vec2 resolution;

				attribute vec3 instanceStart;
				attribute vec3 instanceEnd;

				attribute vec3 instanceColorStart;
				attribute vec3 instanceColorEnd;

				#ifdef WORLD_UNITS

					varying vec4 worldPos;
					varying vec3 worldStart;
					varying vec3 worldEnd;

					#ifdef USE_DASH

						varying vec2 vUv;

					#endif

				#else

					varying vec2 vUv;

				#endif

				#ifdef USE_DASH

					uniform float dashScale;
					attribute float instanceDistanceStart;
					attribute float instanceDistanceEnd;
					varying float vLineDistance;

				#endif

				void trimSegment( const in vec4 start, inout vec4 end ) {

					// trim end segment so it terminates between the camera plane and the near plane

					// conservative estimate of the near plane
					float a = projectionMatrix[ 2 ][ 2 ]; // 3nd entry in 3th column
					float b = projectionMatrix[ 3 ][ 2 ]; // 3nd entry in 4th column
					float nearEstimate = - 0.5 * b / a;

					float alpha = ( nearEstimate - start.z ) / ( end.z - start.z );

					end.xyz = mix( start.xyz, end.xyz, alpha );

				}

				void main() {

					#ifdef USE_COLOR

						vColor.xyz = ( position.y < 0.5 ) ? instanceColorStart : instanceColorEnd;

					#endif

					#ifdef USE_DASH

						vLineDistance = ( position.y < 0.5 ) ? dashScale * instanceDistanceStart : dashScale * instanceDistanceEnd;
						vUv = uv;

					#endif

					float aspect = resolution.x / resolution.y;

					// camera space
					vec4 start = modelViewMatrix * vec4( instanceStart, 1.0 );
					vec4 end = modelViewMatrix * vec4( instanceEnd, 1.0 );

					#ifdef WORLD_UNITS

						worldStart = start.xyz;
						worldEnd = end.xyz;

					#else

						vUv = uv;

					#endif

					// special case for perspective projection, and segments that terminate either in, or behind, the camera plane
					// clearly the gpu firmware has a way of addressing this issue when projecting into ndc space
					// but we need to perform ndc-space calculations in the shader, so we must address this issue directly
					// perhaps there is a more elegant solution -- WestLangley

					bool perspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 ); // 4th entry in the 3rd column

					if ( perspective ) {

						if ( start.z < 0.0 && end.z >= 0.0 ) {

							trimSegment( start, end );

						} else if ( end.z < 0.0 && start.z >= 0.0 ) {

							trimSegment( end, start );

						}

					}

					// clip space
					vec4 clipStart = projectionMatrix * start;
					vec4 clipEnd = projectionMatrix * end;

					// ndc space
					vec3 ndcStart = clipStart.xyz / clipStart.w;
					vec3 ndcEnd = clipEnd.xyz / clipEnd.w;

					// direction
					vec2 dir = ndcEnd.xy - ndcStart.xy;

					// account for clip-space aspect ratio
					dir.x *= aspect;
					dir = normalize( dir );

					#ifdef WORLD_UNITS

						// get the offset direction as perpendicular to the view vector
						vec3 worldDir = normalize( end.xyz - start.xyz );
						vec3 offset;
						if ( position.y < 0.5 ) {

							offset = normalize( cross( start.xyz, worldDir ) );

						} else {

							offset = normalize( cross( end.xyz, worldDir ) );

						}

						// sign flip
						if ( position.x < 0.0 ) offset *= - 1.0;

						float forwardOffset = dot( worldDir, vec3( 0.0, 0.0, 1.0 ) );

						// don't extend the line if we're rendering dashes because we
						// won't be rendering the endcaps
						#ifndef USE_DASH

							// extend the line bounds to encompass  endcaps
							start.xyz += - worldDir * linewidth * 0.5;
							end.xyz += worldDir * linewidth * 0.5;

							// shift the position of the quad so it hugs the forward edge of the line
							offset.xy -= dir * forwardOffset;
							offset.z += 0.5;

						#endif

						// endcaps
						if ( position.y > 1.0 || position.y < 0.0 ) {

							offset.xy += dir * 2.0 * forwardOffset;

						}

						// adjust for linewidth
						offset *= linewidth * 0.5;

						// set the world position
						worldPos = ( position.y < 0.5 ) ? start : end;
						worldPos.xyz += offset;

						// project the worldpos
						vec4 clip = projectionMatrix * worldPos;

						// shift the depth of the projected points so the line
						// segments overlap neatly
						vec3 clipPose = ( position.y < 0.5 ) ? ndcStart : ndcEnd;
						clip.z = clipPose.z * clip.w;

					#else

						vec2 offset = vec2( dir.y, - dir.x );
						// undo aspect ratio adjustment
						dir.x /= aspect;
						offset.x /= aspect;

						// sign flip
						if ( position.x < 0.0 ) offset *= - 1.0;

						// endcaps
						if ( position.y < 0.0 ) {

							offset += - dir;

						} else if ( position.y > 1.0 ) {

							offset += dir;

						}

						// adjust for linewidth
						offset *= linewidth;

						// adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ...
						offset /= resolution.y;

						// select end
						vec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd;

						// back to clip space
						offset *= clip.w;

						clip.xy += offset;

					#endif

					gl_Position = clip;

					vec4 mvPosition = ( position.y < 0.5 ) ? start : end; // this is an approximation

					#include <logdepthbuf_vertex>
					#include <clipping_planes_vertex>
					#include <fog_vertex>

				}
			`
      ),
      fragmentShader: (
        /* glsl */
        `
				uniform vec3 diffuse;
				uniform float opacity;
				uniform float linewidth;

				#ifdef USE_DASH

					uniform float dashOffset;
					uniform float dashSize;
					uniform float gapSize;

				#endif

				varying float vLineDistance;

				#ifdef WORLD_UNITS

					varying vec4 worldPos;
					varying vec3 worldStart;
					varying vec3 worldEnd;

					#ifdef USE_DASH

						varying vec2 vUv;

					#endif

				#else

					varying vec2 vUv;

				#endif

				#include <common>
				#include <color_pars_fragment>
				#include <fog_pars_fragment>
				#include <logdepthbuf_pars_fragment>
				#include <clipping_planes_pars_fragment>

				vec2 closestLineToLine(vec3 p1, vec3 p2, vec3 p3, vec3 p4) {

					float mua;
					float mub;

					vec3 p13 = p1 - p3;
					vec3 p43 = p4 - p3;

					vec3 p21 = p2 - p1;

					float d1343 = dot( p13, p43 );
					float d4321 = dot( p43, p21 );
					float d1321 = dot( p13, p21 );
					float d4343 = dot( p43, p43 );
					float d2121 = dot( p21, p21 );

					float denom = d2121 * d4343 - d4321 * d4321;

					float numer = d1343 * d4321 - d1321 * d4343;

					mua = numer / denom;
					mua = clamp( mua, 0.0, 1.0 );
					mub = ( d1343 + d4321 * ( mua ) ) / d4343;
					mub = clamp( mub, 0.0, 1.0 );

					return vec2( mua, mub );

				}

				void main() {

					#include <clipping_planes_fragment>

					#ifdef USE_DASH

						if ( vUv.y < - 1.0 || vUv.y > 1.0 ) discard; // discard endcaps

						if ( mod( vLineDistance + dashOffset, dashSize + gapSize ) > dashSize ) discard; // todo - FIX

					#endif

					float alpha = opacity;

					#ifdef WORLD_UNITS

						// Find the closest points on the view ray and the line segment
						vec3 rayEnd = normalize( worldPos.xyz ) * 1e5;
						vec3 lineDir = worldEnd - worldStart;
						vec2 params = closestLineToLine( worldStart, worldEnd, vec3( 0.0, 0.0, 0.0 ), rayEnd );

						vec3 p1 = worldStart + lineDir * params.x;
						vec3 p2 = rayEnd * params.y;
						vec3 delta = p1 - p2;
						float len = length( delta );
						float norm = len / linewidth;

						#ifndef USE_DASH

							#ifdef USE_ALPHA_TO_COVERAGE

								float dnorm = fwidth( norm );
								alpha = 1.0 - smoothstep( 0.5 - dnorm, 0.5 + dnorm, norm );

							#else

								if ( norm > 0.5 ) {

									discard;

								}

							#endif

						#endif

					#else

						#ifdef USE_ALPHA_TO_COVERAGE

							// artifacts appear on some hardware if a derivative is taken within a conditional
							float a = vUv.x;
							float b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;
							float len2 = a * a + b * b;
							float dlen = fwidth( len2 );

							if ( abs( vUv.y ) > 1.0 ) {

								alpha = 1.0 - smoothstep( 1.0 - dlen, 1.0 + dlen, len2 );

							}

						#else

							if ( abs( vUv.y ) > 1.0 ) {

								float a = vUv.x;
								float b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;
								float len2 = a * a + b * b;

								if ( len2 > 1.0 ) discard;

							}

						#endif

					#endif

					vec4 diffuseColor = vec4( diffuse, alpha );

					#include <logdepthbuf_fragment>
					#include <color_fragment>

					gl_FragColor = vec4( diffuseColor.rgb, alpha );

					#include <tonemapping_fragment>
					#include <encodings_fragment>
					#include <fog_fragment>
					#include <premultiplied_alpha_fragment>

				}
			`
      ),
      clipping: true
      // required for clipping support
    });
    this.isLineMaterial = true;
    Object.defineProperties(this, {
      color: {
        enumerable: true,
        get: function() {
          return this.uniforms.diffuse.value;
        },
        set: function(value) {
          this.uniforms.diffuse.value = value;
        }
      },
      worldUnits: {
        enumerable: true,
        get: function() {
          return "WORLD_UNITS" in this.defines;
        },
        set: function(value) {
          if (value === true) {
            this.defines.WORLD_UNITS = "";
          } else {
            delete this.defines.WORLD_UNITS;
          }
        }
      },
      linewidth: {
        enumerable: true,
        get: function() {
          return this.uniforms.linewidth.value;
        },
        set: function(value) {
          this.uniforms.linewidth.value = value;
        }
      },
      dashed: {
        enumerable: true,
        get: function() {
          return Boolean("USE_DASH" in this.defines);
        },
        set(value) {
          if (Boolean(value) !== Boolean("USE_DASH" in this.defines)) {
            this.needsUpdate = true;
          }
          if (value === true) {
            this.defines.USE_DASH = "";
          } else {
            delete this.defines.USE_DASH;
          }
        }
      },
      dashScale: {
        enumerable: true,
        get: function() {
          return this.uniforms.dashScale.value;
        },
        set: function(value) {
          this.uniforms.dashScale.value = value;
        }
      },
      dashSize: {
        enumerable: true,
        get: function() {
          return this.uniforms.dashSize.value;
        },
        set: function(value) {
          this.uniforms.dashSize.value = value;
        }
      },
      dashOffset: {
        enumerable: true,
        get: function() {
          return this.uniforms.dashOffset.value;
        },
        set: function(value) {
          this.uniforms.dashOffset.value = value;
        }
      },
      gapSize: {
        enumerable: true,
        get: function() {
          return this.uniforms.gapSize.value;
        },
        set: function(value) {
          this.uniforms.gapSize.value = value;
        }
      },
      opacity: {
        enumerable: true,
        get: function() {
          return this.uniforms.opacity.value;
        },
        set: function(value) {
          this.uniforms.opacity.value = value;
        }
      },
      resolution: {
        enumerable: true,
        get: function() {
          return this.uniforms.resolution.value;
        },
        set: function(value) {
          this.uniforms.resolution.value.copy(value);
        }
      },
      alphaToCoverage: {
        enumerable: true,
        get: function() {
          return Boolean("USE_ALPHA_TO_COVERAGE" in this.defines);
        },
        set: function(value) {
          if (Boolean(value) !== Boolean("USE_ALPHA_TO_COVERAGE" in this.defines)) {
            this.needsUpdate = true;
          }
          if (value === true) {
            this.defines.USE_ALPHA_TO_COVERAGE = "";
            this.extensions.derivatives = true;
          } else {
            delete this.defines.USE_ALPHA_TO_COVERAGE;
            this.extensions.derivatives = false;
          }
        }
      }
    });
    this.setValues(parameters);
  }
};

// node_modules/three-stdlib/lines/LineSegments2.js
var _start2 = /* @__PURE__ */ new Vector3();
var _end2 = /* @__PURE__ */ new Vector3();
var _start4 = /* @__PURE__ */ new Vector4();
var _end4 = /* @__PURE__ */ new Vector4();
var _ssOrigin = /* @__PURE__ */ new Vector4();
var _ssOrigin3 = /* @__PURE__ */ new Vector3();
var _mvMatrix = /* @__PURE__ */ new Matrix4();
var _line = /* @__PURE__ */ new Line3();
var _closestPoint = /* @__PURE__ */ new Vector3();
var _box3 = /* @__PURE__ */ new Box3();
var _sphere2 = /* @__PURE__ */ new Sphere();
var _clipToWorldVector = /* @__PURE__ */ new Vector4();
var _ray2;
var _instanceStart;
var _instanceEnd;
var _lineWidth;
function getWorldSpaceHalfWidth(camera, distance, resolution) {
  _clipToWorldVector.set(0, 0, -distance, 1).applyMatrix4(camera.projectionMatrix);
  _clipToWorldVector.multiplyScalar(1 / _clipToWorldVector.w);
  _clipToWorldVector.x = _lineWidth / resolution.width;
  _clipToWorldVector.y = _lineWidth / resolution.height;
  _clipToWorldVector.applyMatrix4(camera.projectionMatrixInverse);
  _clipToWorldVector.multiplyScalar(1 / _clipToWorldVector.w);
  return Math.abs(Math.max(_clipToWorldVector.x, _clipToWorldVector.y));
}
function raycastWorldUnits(lineSegments, intersects2) {
  for (let i2 = 0, l = _instanceStart.count; i2 < l; i2++) {
    _line.start.fromBufferAttribute(_instanceStart, i2);
    _line.end.fromBufferAttribute(_instanceEnd, i2);
    const pointOnLine = new Vector3();
    const point4 = new Vector3();
    _ray2.distanceSqToSegment(_line.start, _line.end, point4, pointOnLine);
    const isInside = point4.distanceTo(pointOnLine) < _lineWidth * 0.5;
    if (isInside) {
      intersects2.push({
        point: point4,
        pointOnLine,
        distance: _ray2.origin.distanceTo(point4),
        object: lineSegments,
        face: null,
        faceIndex: i2,
        uv: null,
        uv2: null
      });
    }
  }
}
function raycastScreenSpace(lineSegments, camera, intersects2) {
  const projectionMatrix = camera.projectionMatrix;
  const material = lineSegments.material;
  const resolution = material.resolution;
  const matrixWorld = lineSegments.matrixWorld;
  const geometry = lineSegments.geometry;
  const instanceStart = geometry.attributes.instanceStart;
  const instanceEnd = geometry.attributes.instanceEnd;
  const near = -camera.near;
  _ray2.at(1, _ssOrigin);
  _ssOrigin.w = 1;
  _ssOrigin.applyMatrix4(camera.matrixWorldInverse);
  _ssOrigin.applyMatrix4(projectionMatrix);
  _ssOrigin.multiplyScalar(1 / _ssOrigin.w);
  _ssOrigin.x *= resolution.x / 2;
  _ssOrigin.y *= resolution.y / 2;
  _ssOrigin.z = 0;
  _ssOrigin3.copy(_ssOrigin);
  _mvMatrix.multiplyMatrices(camera.matrixWorldInverse, matrixWorld);
  for (let i2 = 0, l = instanceStart.count; i2 < l; i2++) {
    _start4.fromBufferAttribute(instanceStart, i2);
    _end4.fromBufferAttribute(instanceEnd, i2);
    _start4.w = 1;
    _end4.w = 1;
    _start4.applyMatrix4(_mvMatrix);
    _end4.applyMatrix4(_mvMatrix);
    const isBehindCameraNear = _start4.z > near && _end4.z > near;
    if (isBehindCameraNear) {
      continue;
    }
    if (_start4.z > near) {
      const deltaDist = _start4.z - _end4.z;
      const t3 = (_start4.z - near) / deltaDist;
      _start4.lerp(_end4, t3);
    } else if (_end4.z > near) {
      const deltaDist = _end4.z - _start4.z;
      const t3 = (_end4.z - near) / deltaDist;
      _end4.lerp(_start4, t3);
    }
    _start4.applyMatrix4(projectionMatrix);
    _end4.applyMatrix4(projectionMatrix);
    _start4.multiplyScalar(1 / _start4.w);
    _end4.multiplyScalar(1 / _end4.w);
    _start4.x *= resolution.x / 2;
    _start4.y *= resolution.y / 2;
    _end4.x *= resolution.x / 2;
    _end4.y *= resolution.y / 2;
    _line.start.copy(_start4);
    _line.start.z = 0;
    _line.end.copy(_end4);
    _line.end.z = 0;
    const param = _line.closestPointToPointParameter(_ssOrigin3, true);
    _line.at(param, _closestPoint);
    const zPos = MathUtils.lerp(_start4.z, _end4.z, param);
    const isInClipSpace = zPos >= -1 && zPos <= 1;
    const isInside = _ssOrigin3.distanceTo(_closestPoint) < _lineWidth * 0.5;
    if (isInClipSpace && isInside) {
      _line.start.fromBufferAttribute(instanceStart, i2);
      _line.end.fromBufferAttribute(instanceEnd, i2);
      _line.start.applyMatrix4(matrixWorld);
      _line.end.applyMatrix4(matrixWorld);
      const pointOnLine = new Vector3();
      const point4 = new Vector3();
      _ray2.distanceSqToSegment(_line.start, _line.end, point4, pointOnLine);
      intersects2.push({
        point: point4,
        pointOnLine,
        distance: _ray2.origin.distanceTo(point4),
        object: lineSegments,
        face: null,
        faceIndex: i2,
        uv: null,
        uv2: null
      });
    }
  }
}
var LineSegments2 = class extends Mesh {
  constructor(geometry = new LineSegmentsGeometry(), material = new LineMaterial({ color: Math.random() * 16777215 })) {
    super(geometry, material);
    this.isLineSegments2 = true;
    this.type = "LineSegments2";
  }
  // for backwards-compatibility, but could be a method of LineSegmentsGeometry...
  computeLineDistances() {
    const geometry = this.geometry;
    const instanceStart = geometry.attributes.instanceStart;
    const instanceEnd = geometry.attributes.instanceEnd;
    const lineDistances = new Float32Array(2 * instanceStart.count);
    for (let i2 = 0, j = 0, l = instanceStart.count; i2 < l; i2++, j += 2) {
      _start2.fromBufferAttribute(instanceStart, i2);
      _end2.fromBufferAttribute(instanceEnd, i2);
      lineDistances[j] = j === 0 ? 0 : lineDistances[j - 1];
      lineDistances[j + 1] = lineDistances[j] + _start2.distanceTo(_end2);
    }
    const instanceDistanceBuffer = new InstancedInterleavedBuffer(lineDistances, 2, 1);
    geometry.setAttribute("instanceDistanceStart", new InterleavedBufferAttribute(instanceDistanceBuffer, 1, 0));
    geometry.setAttribute("instanceDistanceEnd", new InterleavedBufferAttribute(instanceDistanceBuffer, 1, 1));
    return this;
  }
  raycast(raycaster, intersects2) {
    const worldUnits = this.material.worldUnits;
    const camera = raycaster.camera;
    if (camera === null && !worldUnits) {
      console.error(
        'LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2 while worldUnits is set to false.'
      );
    }
    const threshold2 = raycaster.params.Line2 !== void 0 ? raycaster.params.Line2.threshold || 0 : 0;
    _ray2 = raycaster.ray;
    const matrixWorld = this.matrixWorld;
    const geometry = this.geometry;
    const material = this.material;
    _lineWidth = material.linewidth + threshold2;
    _instanceStart = geometry.attributes.instanceStart;
    _instanceEnd = geometry.attributes.instanceEnd;
    if (geometry.boundingSphere === null) {
      geometry.computeBoundingSphere();
    }
    _sphere2.copy(geometry.boundingSphere).applyMatrix4(matrixWorld);
    let sphereMargin;
    if (worldUnits) {
      sphereMargin = _lineWidth * 0.5;
    } else {
      const distanceToSphere = Math.max(camera.near, _sphere2.distanceToPoint(_ray2.origin));
      sphereMargin = getWorldSpaceHalfWidth(camera, distanceToSphere, material.resolution);
    }
    _sphere2.radius += sphereMargin;
    if (_ray2.intersectsSphere(_sphere2) === false) {
      return;
    }
    if (geometry.boundingBox === null) {
      geometry.computeBoundingBox();
    }
    _box3.copy(geometry.boundingBox).applyMatrix4(matrixWorld);
    let boxMargin;
    if (worldUnits) {
      boxMargin = _lineWidth * 0.5;
    } else {
      const distanceToBox = Math.max(camera.near, _box3.distanceToPoint(_ray2.origin));
      boxMargin = getWorldSpaceHalfWidth(camera, distanceToBox, material.resolution);
    }
    _box3.expandByScalar(boxMargin);
    if (_ray2.intersectsBox(_box3) === false) {
      return;
    }
    if (worldUnits) {
      raycastWorldUnits(this, intersects2);
    } else {
      raycastScreenSpace(this, camera, intersects2);
    }
  }
};

// node_modules/three-stdlib/lines/Line2.js
var Line2 = class extends LineSegments2 {
  constructor(geometry = new LineGeometry(), material = new LineMaterial({ color: Math.random() * 16777215 })) {
    super(geometry, material);
    this.isLine2 = true;
    this.type = "Line2";
  }
};

// node_modules/@react-three/drei/core/QuadraticBezierLine.js
var React15 = __toESM(require_react());

// node_modules/@react-three/drei/core/Line.js
var React14 = __toESM(require_react());
var Line4 = /* @__PURE__ */ React14.forwardRef(function Line5({
  points,
  color: color2 = "black",
  vertexColors,
  lineWidth: lineWidth2,
  dashed,
  ...rest
}, ref) {
  const [line2] = React14.useState(() => new Line2());
  const [lineMaterial] = React14.useState(() => new LineMaterial());
  const [resolution] = React14.useState(() => new Vector2(512, 512));
  const lineGeom = React14.useMemo(() => {
    const geom = new LineGeometry();
    const pValues = points.map((p) => p instanceof Vector3 ? p.toArray() : p);
    geom.setPositions(pValues.flat());
    if (vertexColors) {
      const cValues = vertexColors.map((c4) => c4 instanceof Color2 ? c4.toArray() : c4);
      geom.setColors(cValues.flat());
    }
    return geom;
  }, [points, vertexColors]);
  React14.useLayoutEffect(() => {
    line2.computeLineDistances();
  }, [points, line2]);
  React14.useLayoutEffect(() => {
    if (dashed) {
      lineMaterial.defines.USE_DASH = "";
    } else {
      delete lineMaterial.defines.USE_DASH;
    }
    lineMaterial.needsUpdate = true;
  }, [dashed, lineMaterial]);
  React14.useEffect(() => {
    return () => lineGeom.dispose();
  }, [lineGeom]);
  return /* @__PURE__ */ React14.createElement("primitive", _extends({
    object: line2,
    ref
  }, rest), /* @__PURE__ */ React14.createElement("primitive", {
    object: lineGeom,
    attach: "geometry"
  }), /* @__PURE__ */ React14.createElement("primitive", _extends({
    object: lineMaterial,
    attach: "material",
    color: color2,
    vertexColors: Boolean(vertexColors),
    resolution,
    linewidth: lineWidth2,
    dashed
  }, rest)));
});

// node_modules/@react-three/drei/core/QuadraticBezierLine.js
var v = new Vector3();
var QuadraticBezierLine = /* @__PURE__ */ React15.forwardRef(function QuadraticBezierLine2({
  start = [0, 0, 0],
  end = [0, 0, 0],
  mid,
  segments = 20,
  ...rest
}, forwardref) {
  const ref = React15.useRef(null);
  const [curve] = React15.useState(() => new QuadraticBezierCurve3(void 0, void 0, void 0));
  const getPoints = React15.useCallback((start2, end2, mid2, segments2 = 20) => {
    if (start2 instanceof Vector3)
      curve.v0.copy(start2);
    else
      curve.v0.set(...start2);
    if (end2 instanceof Vector3)
      curve.v2.copy(end2);
    else
      curve.v2.set(...end2);
    if (mid2 instanceof Vector3) {
      curve.v1.copy(mid2);
    } else {
      curve.v1.copy(curve.v0.clone().add(curve.v2.clone().sub(curve.v0)).add(v.set(0, curve.v0.y - curve.v2.y, 0)));
    }
    return curve.getPoints(segments2);
  }, []);
  React15.useLayoutEffect(() => {
    ref.current.setPoints = (start2, end2, mid2) => {
      const points2 = getPoints(start2, end2, mid2);
      if (ref.current.geometry)
        ref.current.geometry.setPositions(points2.map((p) => p.toArray()).flat());
    };
  }, []);
  const points = React15.useMemo(() => getPoints(start, end, mid, segments), [start, end, mid, segments]);
  return /* @__PURE__ */ React15.createElement(Line4, _extends({
    ref: react_merge_refs_esm_default([ref, forwardref]),
    points
  }, rest));
});

// node_modules/@react-three/drei/core/OrbitControls.js
var React16 = __toESM(require_react());
var OrbitControls2 = /* @__PURE__ */ React16.forwardRef(({
  makeDefault,
  camera,
  regress,
  domElement,
  enableDamping = true,
  onChange,
  onStart,
  onEnd,
  ...restProps
}, ref) => {
  const invalidate2 = useThree((state) => state.invalidate);
  const defaultCamera = useThree((state) => state.camera);
  const gl = useThree((state) => state.gl);
  const events = useThree((state) => state.events);
  const set3 = useThree((state) => state.set);
  const get3 = useThree((state) => state.get);
  const performance2 = useThree((state) => state.performance);
  const explCamera = camera || defaultCamera;
  const explDomElement = domElement || events.connected || gl.domElement;
  const controls = React16.useMemo(() => new OrbitControls(explCamera), [explCamera]);
  useFrame(() => {
    if (controls.enabled)
      controls.update();
  }, -1);
  React16.useEffect(() => {
    controls.connect(explDomElement);
    return () => void controls.dispose();
  }, [explDomElement, regress, controls, invalidate2]);
  React16.useEffect(() => {
    const callback = (e3) => {
      invalidate2();
      if (regress)
        performance2.regress();
      if (onChange)
        onChange(e3);
    };
    controls.addEventListener("change", callback);
    if (onStart)
      controls.addEventListener("start", onStart);
    if (onEnd)
      controls.addEventListener("end", onEnd);
    return () => {
      if (onStart)
        controls.removeEventListener("start", onStart);
      if (onEnd)
        controls.removeEventListener("end", onEnd);
      controls.removeEventListener("change", callback);
    };
  }, [onChange, onStart, onEnd]);
  React16.useEffect(() => {
    if (makeDefault) {
      const old = get3().controls;
      set3({
        controls
      });
      return () => set3({
        controls: old
      });
    }
  }, [makeDefault, controls]);
  return /* @__PURE__ */ React16.createElement("primitive", _extends({
    ref,
    object: controls,
    enableDamping
  }, restProps));
});

// node_modules/@react-three/drei/core/useContextBridge.js
var React17 = __toESM(require_react());
function useContextBridge(...contexts) {
  const cRef = React17.useRef([]);
  cRef.current = contexts.map((context2) => React17.useContext(context2));
  return React17.useMemo(() => ({
    children
  }) => contexts.reduceRight(
    (acc, Context2, i2) => /* @__PURE__ */ React17.createElement(Context2.Provider, {
      value: cRef.current[i2],
      children: acc
    }),
    children
    /*
     * done this way in reference to:
     * https://github.com/DefinitelyTyped/DefinitelyTyped/issues/44572#issuecomment-625878049
     * https://github.com/microsoft/TypeScript/issues/14729
     */
  ), []);
}

// node_modules/@react-three/drei/core/shapes.js
var React18 = __toESM(require_react());
function create3(type) {
  const El = type + "BufferGeometry";
  return /* @__PURE__ */ React18.forwardRef(({
    args,
    children,
    ...props
  }, ref) => /* @__PURE__ */ React18.createElement("mesh", _extends({
    ref
  }, props), /* @__PURE__ */ React18.createElement(El, {
    attach: "geometry",
    args
  }), children));
}
var Box = create3("box");
var Circle = create3("circle");
var Cone = create3("cone");
var Cylinder = create3("cylinder");
var Sphere2 = create3("sphere");
var Plane2 = create3("plane");
var Tube = create3("tube");
var Torus = create3("torus");
var TorusKnot = create3("torusKnot");
var Tetrahedron = create3("tetrahedron");
var Ring = create3("ring");
var Polyhedron = create3("polyhedron");
var Icosahedron = create3("icosahedron");
var Octahedron = create3("octahedron");
var Dodecahedron = create3("dodecahedron");
var Extrude = create3("extrude");
var Lathe = create3("lathe");

// node_modules/@arizeai/point-cloud/dist/point-cloud.esm.js
function _extends4() {
  _extends4 = Object.assign || function(target) {
    for (var i2 = 1; i2 < arguments.length; i2++) {
      var source = arguments[i2];
      for (var key in source) {
        if (Object.prototype.hasOwnProperty.call(source, key)) {
          target[key] = source[key];
        }
      }
    }
    return target;
  };
  return _extends4.apply(this, arguments);
}
function _objectWithoutPropertiesLoose3(source, excluded) {
  if (source == null)
    return {};
  var target = {};
  var sourceKeys = Object.keys(source);
  var key, i2;
  for (i2 = 0; i2 < sourceKeys.length; i2++) {
    key = sourceKeys[i2];
    if (excluded.indexOf(key) >= 0)
      continue;
    target[key] = source[key];
  }
  return target;
}
function isPointInsidePolygon(point4, polygonPoints) {
  var x2 = point4[0], y2 = point4[1];
  var inside2 = false;
  for (var i2 = 0, j = polygonPoints.length - 1; i2 < polygonPoints.length; j = i2++) {
    var xi = polygonPoints[i2][0], yi = polygonPoints[i2][1];
    var xj = polygonPoints[j][0], yj = polygonPoints[j][1];
    var intersect = yi > y2 != yj > y2 && x2 < (xj - xi) * (y2 - yi) / (yj - yi) + xi;
    if (intersect)
      inside2 = !inside2;
  }
  return inside2;
}
var DEFAULT_FALLBACK_BOUNDS$1 = {
  minX: 0,
  maxX: 0,
  minY: 0,
  maxY: 0,
  minZ: 0,
  maxZ: 0
};
function getThreeDimensionalBounds(points, options) {
  if (points.length === 0) {
    var fallbackBounds = (options == null ? void 0 : options.fallbackBounds) || DEFAULT_FALLBACK_BOUNDS$1;
    return fallbackBounds;
  }
  var minX = Infinity, minY = Infinity, maxX = -Infinity, maxY = -Infinity, minZ = Infinity, maxZ = -Infinity;
  points.forEach(function(p) {
    minX = Math.min(minX, p[0]);
    minY = Math.min(minY, p[1]);
    minZ = Math.min(minZ, p[2]);
    maxX = Math.max(maxX, p[0]);
    maxY = Math.max(maxY, p[1]);
    maxZ = Math.max(maxZ, p[2]);
  });
  return {
    minX,
    maxX,
    minY,
    maxY,
    minZ,
    maxZ
  };
}
function getCenterFromThreeDimensionalBounds(_ref18) {
  var minX = _ref18.minX, maxX = _ref18.maxX, minY = _ref18.minY, maxY = _ref18.maxY, minZ = _ref18.minZ, maxZ = _ref18.maxZ;
  return [minX + (maxX - minX) / 2, minY + (maxY - minY) / 2, minZ + (maxZ - minZ) / 2];
}
function getMaxDimensionFromThreeDimensionalBounds(_ref22) {
  var minX = _ref22.minX, maxX = _ref22.maxX, minY = _ref22.minY, maxY = _ref22.maxY, minZ = _ref22.minZ, maxZ = _ref22.maxZ;
  return Math.max(Math.abs(minX), Math.abs(maxX), Math.abs(minY), Math.abs(maxY), Math.abs(minZ), Math.abs(maxZ));
}
function isOrthographicCamera2(c4) {
  return c4.isOrthographicCamera;
}
var _excluded$12 = ["children", "camera", "orthographic"];
function ThreeDimensionalCanvas(_ref18) {
  var children = _ref18.children, camera = _ref18.camera, _ref$orthographic = _ref18.orthographic, orthographic = _ref$orthographic === void 0 ? false : _ref$orthographic, passThroughProps = _objectWithoutPropertiesLoose3(_ref18, _excluded$12);
  return import_react45.default.createElement(Canvas, Object.assign({
    orthographic,
    camera: _extends4({
      position: [0, 0, 1],
      zoom: 1,
      up: [0, 1, 0]
    }, camera)
  }, passThroughProps), children);
}
var _excluded$22 = ["enabled", "zoomSpeed", "enableZoom", "enablePan", "enableRotate", "autoRotate", "autoRotateSpeed"];
function ThreeDimensionalControls(_ref18) {
  var _ref$enabled = _ref18.enabled, enabled = _ref$enabled === void 0 ? true : _ref$enabled, _ref$zoomSpeed = _ref18.zoomSpeed, zoomSpeed = _ref$zoomSpeed === void 0 ? 1 : _ref$zoomSpeed, _ref$enableZoom = _ref18.enableZoom, enableZoom = _ref$enableZoom === void 0 ? true : _ref$enableZoom, _ref$enablePan = _ref18.enablePan, enablePan = _ref$enablePan === void 0 ? true : _ref$enablePan, _ref$enableRotate = _ref18.enableRotate, enableRotate = _ref$enableRotate === void 0 ? true : _ref$enableRotate, _ref$autoRotate = _ref18.autoRotate, autoRotate = _ref$autoRotate === void 0 ? false : _ref$autoRotate, _ref$autoRotateSpeed = _ref18.autoRotateSpeed, autoRotateSpeed = _ref$autoRotateSpeed === void 0 ? 5 : _ref$autoRotateSpeed, passThroughProps = _objectWithoutPropertiesLoose3(_ref18, _excluded$22);
  return import_react45.default.createElement(OrbitControls2, Object.assign({
    enabled,
    zoomSpeed,
    enableZoom,
    enablePan,
    enableRotate,
    autoRotate,
    autoRotateSpeed
  }, passThroughProps));
}
var BoundsContext$1 = /* @__PURE__ */ (0, import_react45.createContext)({
  bounds: {
    minX: -10,
    maxX: 10,
    minY: -10,
    maxY: 10,
    minZ: -10,
    maxZ: 10
  },
  center: [0, 0, 0]
});
var ORTHOGRAPHIC_CAMERA_Z_OFFSET = 10;
function ThreeDimensionalBounds(_ref18) {
  var bounds = _ref18.bounds, children = _ref18.children, _ref$offset = _ref18.offset, offset = _ref$offset === void 0 ? 1.5 : _ref$offset, _ref$boundsZoomPaddin = _ref18.boundsZoomPaddingFactor, boundsZoomPaddingFactor = _ref$boundsZoomPaddin === void 0 ? 0.9 : _ref$boundsZoomPaddin;
  var center = getCenterFromThreeDimensionalBounds(bounds);
  var _useThree = useThree(), camera = _useThree.camera, _useThree$size = _useThree.size, width = _useThree$size.width, height = _useThree$size.height;
  (0, import_react45.useEffect)(function() {
    var minX = bounds.minX, maxX = bounds.maxX, minY = bounds.minY, maxY = bounds.maxY, minZ = bounds.minZ, maxZ = bounds.maxZ;
    var boundsWidth = maxX - minX;
    var boundsHeight = maxY - minY;
    var boundsDepth = maxZ - minZ;
    var maxDim = Math.max(boundsWidth, boundsHeight, boundsDepth);
    camera.position.x = boundsWidth / 2 + minX;
    camera.position.y = boundsHeight / 2 + minY;
    if (isOrthographicCamera2(camera)) {
      camera.zoom = Math.min(width / boundsWidth, height / boundsHeight) * boundsZoomPaddingFactor;
      var furthestPointDim = getMaxDimensionFromThreeDimensionalBounds(bounds);
      var cameraZ = Math.abs(furthestPointDim) + ORTHOGRAPHIC_CAMERA_Z_OFFSET;
      camera.position.z = cameraZ;
      var cameraToFarEdge = Math.max(camera.far, cameraZ + furthestPointDim + ORTHOGRAPHIC_CAMERA_Z_OFFSET);
      camera.far = cameraToFarEdge;
    } else {
      var fov2 = camera.fov * (Math.PI / 180);
      var _cameraZ = maxDim / (2 * Math.tan(fov2 / 2));
      camera.position.z = (_cameraZ + center[2]) * offset;
      var _cameraToFarEdge = minZ < 0 ? -minZ + camera.position.z : camera.position.z - minZ;
      camera.far = _cameraToFarEdge * 3;
    }
    camera.updateProjectionMatrix();
    camera.lookAt.apply(camera, center);
  }, [bounds]);
  return import_react45.default.createElement(BoundsContext$1.Provider, {
    value: {
      bounds,
      center
    }
  }, children);
}
var Axes = function Axes2(_ref18) {
  var size = _ref18.size, _ref$color = _ref18.color, color2 = _ref$color === void 0 ? "#ffffff" : _ref$color;
  var ref = (0, import_react45.useRef)(null);
  (0, import_react45.useEffect)(function() {
    if (ref.current) {
      var colorObj = new Color2(color2);
      ref.current.setColors(colorObj, colorObj, colorObj);
    }
  }, [color2]);
  return import_react45.default.createElement("axesHelper", {
    ref,
    args: [size]
  });
};
var defaultPointMeshProps = {
  color: "blue",
  scale: 1
};
var tempObject = /* @__PURE__ */ new Object3D();
var tempColor = /* @__PURE__ */ new Color2();
function Points2(_ref18) {
  var data = _ref18.data, _ref$pointProps = _ref18.pointProps, pointProps = _ref$pointProps === void 0 ? defaultPointMeshProps : _ref$pointProps, onPointsClicked = _ref18.onPointsClicked, onPointClicked = _ref18.onPointClicked, onPointHovered = _ref18.onPointHovered, _onPointerLeave = _ref18.onPointerLeave, _ref$pointShape = _ref18.pointShape, pointShape = _ref$pointShape === void 0 ? "sphere" : _ref$pointShape, _ref$opacity = _ref18.opacity, opacity = _ref$opacity === void 0 ? 1 : _ref$opacity, _ref$material = _ref18.material, material = _ref$material === void 0 ? "meshMatcap" : _ref$material;
  var getColorPoint = (0, import_react45.useCallback)(function(data2) {
    var colorString = typeof pointProps.color === "function" ? pointProps.color(data2) : pointProps.color;
    return colorString;
  }, [pointProps.color]);
  var colorArray = (0, import_react45.useMemo)(function() {
    return Float32Array.from(new Array(data.length).fill(null).flatMap(function(_, idx) {
      return tempColor.set(getColorPoint(data[idx])).toArray();
    }));
  }, [data]);
  var meshRef = (0, import_react45.useRef)(null);
  useFrame(function() {
    data.forEach(function(_ref22, id2) {
      var position2 = _ref22.position;
      tempObject.position.set(position2[0], position2[1], position2[2] || 0);
      if (pointProps.scale) {
        tempObject.scale.set(pointProps.scale, pointProps.scale, pointProps.scale);
      }
      if (meshRef.current) {
        meshRef.current.setMatrixAt(id2, tempObject.matrix);
        meshRef.current.instanceMatrix.needsUpdate = true;
        var colorString = getColorPoint(data[id2]);
        tempColor.set(colorString);
        tempColor.toArray(colorArray, id2 * 3);
        meshRef.current.geometry.attributes.color.needsUpdate = true;
        tempObject.updateMatrix();
        meshRef.current.setMatrixAt(id2, tempObject.matrix);
      }
    });
  });
  var geometryEl = (0, import_react45.useMemo)(function() {
    switch (pointShape) {
      case "sphere": {
        return import_react45.default.createElement("sphereGeometry", {
          args: [pointProps.radius || 0.02, 20, 20]
        }, import_react45.default.createElement("instancedBufferAttribute", {
          attach: "attributes-color",
          args: [colorArray, 3]
        }));
      }
      case "cube": {
        var args = typeof (pointProps == null ? void 0 : pointProps.size) === "number" ? [pointProps.size, pointProps.size, pointProps.size] : [0.03, 0.03, 0.03];
        return import_react45.default.createElement("boxGeometry", {
          args
        }, import_react45.default.createElement("instancedBufferAttribute", {
          attach: "attributes-color",
          args: [colorArray, 3]
        }));
      }
      case "octahedron": {
        return import_react45.default.createElement("octahedronGeometry", {
          args: [pointProps.radius || 0.02, 0]
        }, import_react45.default.createElement("instancedBufferAttribute", {
          attach: "attributes-color",
          args: [colorArray, 3]
        }));
      }
      default: {
        throw new Error("Unsupported point shape: " + pointShape);
      }
    }
  }, [pointShape, pointProps]);
  var materialEl = (0, import_react45.useMemo)(function() {
    switch (material) {
      case "meshMatcap":
        return import_react45.default.createElement("meshMatcapMaterial", {
          vertexColors: true,
          opacity,
          transparent: opacity < 1
        });
      default:
        return import_react45.default.createElement("meshStandardMaterial", {
          vertexColors: true,
          opacity,
          transparent: opacity < 1
        });
    }
  }, [material]);
  return import_react45.default.createElement("instancedMesh", {
    args: [void 0, void 0, data.length],
    ref: meshRef,
    onPointerUp: function onPointerUp(e3) {
      if (e3.intersections) {
        var instanceIds = e3.intersections.map(function(e4) {
          return e4 == null ? void 0 : e4.instanceId;
        }).filter(function(i2) {
          return i2 != null;
        });
        onPointsClicked && onPointsClicked(instanceIds.map(function(i2) {
          return data[i2];
        }));
        instanceIds.length > 0 && onPointClicked && onPointClicked(data[instanceIds[0]]);
      }
    },
    onPointerOver: function onPointerOver(e3) {
      if (e3.intersections) {
        var instanceIds = e3.intersections.map(function(e4) {
          return e4 == null ? void 0 : e4.instanceId;
        }).filter(function(i2) {
          return i2 != null;
        });
        instanceIds.length > 0 && onPointHovered && onPointHovered(data[instanceIds[0]]);
      }
    },
    onPointerLeave: function onPointerLeave() {
      _onPointerLeave && _onPointerLeave();
    }
  }, geometryEl, materialEl);
}
var DEFAULT_RADIUS = 0.1;
function Cluster(_ref18) {
  var data = _ref18.data, _ref$pointRadius = _ref18.pointRadius, pointRadius = _ref$pointRadius === void 0 ? DEFAULT_RADIUS : _ref$pointRadius, _ref$color = _ref18.color, color2 = _ref$color === void 0 ? "#999999" : _ref$color, _ref$opacity = _ref18.opacity, opacity = _ref$opacity === void 0 ? 0.2 : _ref$opacity, _ref$wireframe = _ref18.wireframe, wireframe = _ref$wireframe === void 0 ? false : _ref$wireframe;
  var singleGeometry = (0, import_react45.useMemo)(function() {
    var geometries = [];
    var pointSet = /* @__PURE__ */ new Set();
    data.forEach(function(point4) {
      var position2 = point4.position;
      if (!pointSet.has(position2.join(","))) {
        var _geometry2 = new SphereGeometry(pointRadius, 12, 12);
        _geometry2.translate(position2[0], position2[1], position2[2] || 0);
        geometries.push(_geometry2);
        pointSet.add(position2.join(","));
      }
    });
    var geometry = mergeBufferGeometries(geometries);
    return geometry;
  }, [data]);
  return import_react45.default.createElement("mesh", {
    geometry: singleGeometry != null ? singleGeometry : void 0,
    visible: opacity > 0
  }, import_react45.default.createElement("meshBasicMaterial", {
    opacity,
    transparent: opacity < 1,
    color: color2,
    wireframe
  }));
}
function initializeSelectionShape() {
  var selectionShape = new Line();
  selectionShape.renderOrder = 1;
  selectionShape.position.z = -0.2;
  selectionShape.depthTest = false;
  selectionShape.scale.setScalar(1);
  return selectionShape;
}
function LassoSelect(_ref18) {
  var children = _ref18.children, _ref$lineColor = _ref18.lineColor, lineColor = _ref$lineColor === void 0 ? "#53d7fb" : _ref$lineColor, onChange = _ref18.onChange, points = _ref18.points, enabled = _ref18.enabled;
  var _useThree = useThree(), camera = _useThree.camera, raycaster = _useThree.raycaster, gl = _useThree.gl, controls = _useThree.controls, size = _useThree.size, scene = _useThree.scene;
  var selectionShape = (0, import_react45.useRef)(initializeSelectionShape());
  var selectionState = (0, import_react45.useRef)({
    selectionPoints: [],
    isDragging: false,
    selectionNeedsUpdate: false,
    selectionShapeNeedsUpdate: false
  });
  (0, import_react45.useEffect)(function() {
    selectionShape.current.material.color.set(lineColor).convertSRGBToLinear();
    camera.add(selectionShape.current);
    scene.add(camera);
  }, []);
  (0, import_react45.useEffect)(function() {
    var prevX = -Infinity;
    var prevY = -Infinity;
    var tempVec0 = new Vector2();
    var tempVec1 = new Vector2();
    var tempVec2 = new Vector2();
    function pointerDown(e3) {
      if (enabled) {
        var canvasRect = gl.domElement.getClientRects()[0];
        prevX = e3.clientX - canvasRect.left;
        prevY = e3.clientY - canvasRect.top;
        selectionState.current.selectionPoints.length = 0;
        selectionState.current.isDragging = true;
      }
    }
    function pointerMove(e3) {
      if (selectionState.current.isDragging) {
        var selectionPoints2 = selectionState.current.selectionPoints;
        var canvasRect = gl.domElement.getClientRects()[0];
        var ex = e3.clientX - canvasRect.left;
        var ey = e3.clientY - canvasRect.top;
        var nx = ex / canvasRect.width * 2 - 1;
        var ny = -(ey / canvasRect.height * 2 - 1);
        if (Math.abs(ex - prevX) >= 3 || Math.abs(ey - prevY) >= 3) {
          var i2 = selectionPoints2.length / 3 - 1;
          var i3 = i2 * 3;
          var doReplace = false;
          if (selectionPoints2.length > 3) {
            tempVec0.set(selectionPoints2[i3 - 3], selectionPoints2[i3 - 3 + 1]);
            tempVec1.set(selectionPoints2[i3], selectionPoints2[i3 + 1]);
            tempVec1.sub(tempVec0).normalize();
            tempVec0.set(selectionPoints2[i3], selectionPoints2[i3 + 1]);
            tempVec2.set(nx, ny);
            tempVec2.sub(tempVec0).normalize();
            var dot2 = tempVec1.dot(tempVec2);
            doReplace = dot2 > 0.99;
          }
          if (doReplace) {
            selectionPoints2[i3] = nx;
            selectionPoints2[i3 + 1] = ny;
          } else {
            selectionPoints2.push(nx, ny, 0);
          }
          selectionState.current.selectionShapeNeedsUpdate = true;
          selectionShape.current.visible = true;
          prevX = ex;
          prevY = ey;
        }
      }
    }
    function pointerUp() {
      if (enabled && selectionState.current.isDragging && selectionState.current.selectionPoints.length) {
        selectionState.current.selectionShapeNeedsUpdate = true;
        selectionState.current.selectionNeedsUpdate = true;
      }
      selectionShape.current.visible = false;
      selectionState.current.isDragging = false;
    }
    gl.domElement.addEventListener("pointerdown", pointerDown, {
      passive: true
    });
    document.addEventListener("pointermove", pointerMove, {
      passive: true,
      capture: true
    });
    document.addEventListener("pointerup", pointerUp, {
      passive: true
    });
    return function() {
      gl.domElement.removeEventListener("pointerdown", pointerDown);
      document.removeEventListener("pointermove", pointerMove);
      document.removeEventListener("pointerup", pointerUp);
    };
  }, [size, raycaster, camera, controls, gl, enabled]);
  useFrame(function(_ref22) {
    var camera2 = _ref22.camera;
    var _selectionState$curre = selectionState.current, selectionShapeNeedsUpdate = _selectionState$curre.selectionShapeNeedsUpdate, selectionPoints2 = _selectionState$curre.selectionPoints;
    if (selectionShapeNeedsUpdate) {
      var ogLength = selectionPoints2.length;
      selectionPoints2.push(selectionPoints2[0], selectionPoints2[1], selectionPoints2[2]);
      selectionShape.current.geometry.setAttribute("position", new Float32BufferAttribute(selectionPoints2, 3, false));
      selectionPoints2.length = ogLength;
      selectionShape.current.frustumCulled = false;
      selectionState.current.selectionShapeNeedsUpdate = false;
    }
    if (selectionState.current.selectionNeedsUpdate && selectionPoints2.length > 0) {
      selectionState.current.selectionNeedsUpdate = false;
      onChange(updateSelection({
        points,
        camera: camera2,
        selectionPoints: selectionState.current.selectionPoints
      }));
    }
    if (!isOrthographicCamera2(camera2)) {
      var yScale = Math.tan(MathUtils.DEG2RAD * camera2.fov / 2) * selectionShape.current.position.z;
      selectionShape.current.scale.set(-yScale * camera2.aspect, -yScale, 1);
    } else {
      selectionShape.current.scale.set((camera2.right - camera2.left) / camera2.zoom / 2, (camera2.top - camera2.bottom) / camera2.zoom / 2, 1);
    }
  });
  return import_react45.default.createElement(import_react45.default.Fragment, null, children);
}
function updateSelection(_ref32) {
  var points = _ref32.points, camera = _ref32.camera, selectionPoints2 = _ref32.selectionPoints;
  var selection2 = [];
  var lassoPolygon = [];
  for (var i2 = 0; i2 < selectionPoints2.length; i2 += 3) {
    lassoPolygon.push([selectionPoints2[i2], selectionPoints2[i2 + 1]]);
  }
  var pointVector = new Vector3();
  points.forEach(function(point4) {
    var isThreeD = point4.position.length === 3;
    var pointPosition = isThreeD ? point4.position : [point4.position[0], point4.position[1], 0];
    pointVector.fromArray(pointPosition);
    if (!isThreeD) {
      pointVector.sub(camera.position).applyMatrix4(camera.matrixWorld);
    }
    pointVector.project(camera);
    if (isPointInsidePolygon([pointVector.x, pointVector.y], lassoPolygon)) {
      selection2.push(point4);
    }
  });
  return selection2;
}
var Rainbow11 = {
  Purple: "#6e40aa",
  LightPurple: "#bf3caf",
  Pink: "#fe4b83",
  Orange: "#ff7847",
  LightOrange: "#e2b72f",
  Lime: "#aff05b",
  LightGreen: "#52f667",
  Green: "#1ddfa3",
  LightBlue: "#23abd8",
  Blue: "#4c6edb",
  White: "#ffffff"
};
var Discrete2 = {
  PinkLightGreen: [Rainbow11.Pink, Rainbow11.LightGreen],
  BlueOrange: [Rainbow11.Blue, Rainbow11.Orange],
  LightBlueOrange: [Rainbow11.LightBlue, Rainbow11.Orange],
  LightBlueLightOrange: [Rainbow11.LightBlue, Rainbow11.LightOrange],
  LimePurple: [Rainbow11.Lime, Rainbow11.Purple],
  LimeLightPurple: [Rainbow11.Lime, Rainbow11.LightPurple],
  BlueLime: [Rainbow11.Blue, Rainbow11.Lime],
  LightBlueLime: [Rainbow11.LightBlue, Rainbow11.Lime],
  WhiteLime: [Rainbow11.White, Rainbow11.Lime],
  WhiteLightBlue: [Rainbow11.White, Rainbow11.LightBlue],
  WhiteOrange: [Rainbow11.White, Rainbow11.Orange]
};
var ColorSchemes = {
  Discrete2
};

// src/constants/pointCloudConstants.tsx
var DEFAULT_N_NEIGHBORS = 30;
var MIN_N_NEIGHBORS = 5;
var MAX_N_NEIGHBORS = 100;
var DEFAULT_MIN_DIST = 0;
var MIN_MIN_DIST = 0;
var MAX_MIN_DIST = 0.99;
var DEFAULT_DATASET_SAMPLE_SIZE = 500;
var MIN_DATASET_SAMPLE_SIZE = 300;
var MAX_DATASET_SAMPLE_SIZE = 1e5;
var DEFAULT_MIN_CLUSTER_SIZE = 10;
var MIN_CLUSTER_MIN_SAMPLES = 1;
var MIN_MIN_CLUSTER_SIZE = 2;
var DEFAULT_CLUSTER_MIN_SAMPLES = 1;
var DEFAULT_CLUSTER_SELECTION_EPSILON = 0;
var ColoringStrategy = /* @__PURE__ */ ((ColoringStrategy2) => {
  ColoringStrategy2["dataset"] = "dataset";
  ColoringStrategy2["correctness"] = "correctness";
  ColoringStrategy2["dimension"] = "dimension";
  return ColoringStrategy2;
})(ColoringStrategy || {});
var SelectionDisplay = /* @__PURE__ */ ((SelectionDisplay2) => {
  SelectionDisplay2["list"] = "list";
  SelectionDisplay2["gallery"] = "gallery";
  return SelectionDisplay2;
})(SelectionDisplay || {});
var SelectionGridSize = /* @__PURE__ */ ((SelectionGridSize2) => {
  SelectionGridSize2["small"] = "small";
  SelectionGridSize2["medium"] = "medium";
  SelectionGridSize2["large"] = "large";
  return SelectionGridSize2;
})(SelectionGridSize || {});
var DEFAULT_DARK_COLOR_SCHEME = ["#05fbff", "#cb8afd"];
var DEFAULT_LIGHT_COLOR_SCHEME = ["#00add0", "#4500d9"];
var FALLBACK_COLOR = "#a5a5a5";
var UNKNOWN_COLOR = FALLBACK_COLOR;

// src/RelayEnvironment.ts
var import_relay_runtime = __toESM(require_relay_runtime2());
var graphQLPath = window.Config.basename + "/graphql";
var fetchRelay = async (params, variables, _cacheConfig) => {
  const response = await fetch(graphQLPath, {
    method: "POST",
    headers: {
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      query: params.text,
      variables
    })
  });
  const json3 = await response.json();
  if (Array.isArray(json3.errors)) {
    throw new Error(
      `Error fetching GraphQL query '${params.name}' with variables '${JSON.stringify(variables)}': ${JSON.stringify(
        json3.errors
      )}`
    );
  }
  return json3;
};
var RelayEnvironment_default = new import_relay_runtime.Environment({
  network: import_relay_runtime.Network.create(fetchRelay),
  store: new import_relay_runtime.Store(new import_relay_runtime.RecordSource(), {
    // This property tells Relay to not immediately clear its cache when the user
    // navigates around the app. Relay will hold onto the specified number of
    // query results, allowing the user to return to recently visited pages
    // and reusing cached data if its available/fresh.
    gcReleaseBufferSize: 10
  })
});

// src/utils/pointCloudUtils.ts
function getDatasetRoleFromEventId(eventId) {
  if (eventId.includes("PRIMARY")) {
    return "primary" /* primary */;
  } else if (eventId.includes("CORPUS")) {
    return "corpus" /* corpus */;
  } else {
    return "reference" /* reference */;
  }
}
function splitEventIdsByDataset(eventIds) {
  const primaryEventIds = [];
  const referenceEventIds = [];
  const corpusEventIds = [];
  eventIds.forEach((id2) => {
    const datasetRole = getDatasetRoleFromEventId(id2);
    if (datasetRole == "primary" /* primary */) {
      primaryEventIds.push(id2);
    } else if (datasetRole == "corpus" /* corpus */) {
      corpusEventIds.push(id2);
    } else {
      referenceEventIds.push(id2);
    }
  });
  return { primaryEventIds, referenceEventIds, corpusEventIds };
}

// src/store/pointCloudStore.ts
var NUM_NUMERIC_GROUPS = 10;
var UNKNOWN_GROUP = "unknown";
var sequentialColorScale = cool;
var discreteColorScaleCategories = category10_default;
var discreteColorScale = (value) => discreteColorScaleCategories[value];
var numericColorScale = (idx) => sequentialColorScale(idx / NUM_NUMERIC_GROUPS);
var CanvasMode = /* @__PURE__ */ ((CanvasMode2) => {
  CanvasMode2["move"] = "move";
  CanvasMode2["select"] = "select";
  return CanvasMode2;
})(CanvasMode || {});
var getDefaultColorScheme = () => {
  const theme3 = getCurrentTheme();
  return theme3 === "light" ? DEFAULT_LIGHT_COLOR_SCHEME : DEFAULT_DARK_COLOR_SCHEME;
};
function getDefaultDriftPointCloudProps() {
  const defaultColorScheme = getDefaultColorScheme();
  return {
    coloringStrategy: "dataset" /* dataset */,
    pointGroupVisibility: {
      ["primary" /* primary */]: true,
      ["reference" /* reference */]: true
    },
    pointGroupColors: {
      ["primary" /* primary */]: defaultColorScheme[0],
      ["reference" /* reference */]: defaultColorScheme[1],
      ["corpus" /* corpus */]: FALLBACK_COLOR
    },
    metric: {
      type: "drift",
      metric: "euclideanDistance"
    }
  };
}
function getDefaultRetrievalTroubleshootingPointCloudProps() {
  const defaultColorScheme = getDefaultColorScheme();
  return {
    coloringStrategy: "dataset" /* dataset */,
    pointGroupVisibility: {
      ["primary" /* primary */]: true,
      ["corpus" /* corpus */]: true
    },
    pointGroupColors: {
      ["primary" /* primary */]: defaultColorScheme[0],
      ["corpus" /* corpus */]: FALLBACK_COLOR
    },
    metric: {
      type: "retrieval",
      metric: "queryDistance"
    },
    // Since we are showing clusters by percent query, sort from highest query density to lowest
    clusterSort: { dir: "desc", column: "primaryMetricValue" }
  };
}
function getDefaultSingleDatasetPointCloudProps() {
  return {
    coloringStrategy: "correctness" /* correctness */,
    pointGroupVisibility: {
      ["correct" /* correct */]: true,
      ["incorrect" /* incorrect */]: true,
      ["unknown" /* unknown */]: true
    },
    pointGroupColors: {
      ["correct" /* correct */]: ColorSchemes.Discrete2.LightBlueOrange[0],
      ["incorrect" /* incorrect */]: ColorSchemes.Discrete2.LightBlueOrange[1],
      ["unknown" /* unknown */]: UNKNOWN_COLOR
    },
    metric: {
      type: "performance",
      metric: "accuracyScore"
    },
    // Since we are showing clusters by accuracy, sort from lowest accuracy to highest
    clusterSort: { dir: "asc", column: "primaryMetricValue" }
  };
}
var createPointCloudStore = (initProps) => {
  const defaultProps5 = {
    loading: false,
    errorMessage: null,
    points: [],
    eventIdToDataMap: /* @__PURE__ */ new Map(),
    clusters: [],
    clusterSort: { dir: "desc", column: "driftRatio" },
    pointData: null,
    selectedEventIds: /* @__PURE__ */ new Set(),
    hoveredEventId: null,
    highlightedClusterId: null,
    selectedClusterId: null,
    canvasMode: "move" /* move */,
    pointSizeScale: 1,
    clusterColorMode: "default" /* default */,
    coloringStrategy: "dataset" /* dataset */,
    datasetVisibility: { primary: true, reference: true, corpus: true },
    pointGroupVisibility: {
      ["primary" /* primary */]: true,
      ["reference" /* reference */]: true,
      ["corpus" /* corpus */]: true
    },
    pointGroupColors: {
      // TODO move to a single source of truth
      ["primary" /* primary */]: getDefaultColorScheme()[0],
      ["reference" /* reference */]: getDefaultColorScheme()[1],
      ["corpus" /* corpus */]: FALLBACK_COLOR
    },
    eventIdToGroup: {},
    selectionDisplay: "gallery" /* gallery */,
    selectionGridSize: "large" /* large */,
    dimension: null,
    dimensionMetadata: null,
    umapParameters: {
      minDist: DEFAULT_MIN_DIST,
      nNeighbors: DEFAULT_N_NEIGHBORS,
      nSamples: DEFAULT_DATASET_SAMPLE_SIZE
    },
    hdbscanParameters: {
      minClusterSize: DEFAULT_MIN_CLUSTER_SIZE,
      clusterMinSamples: DEFAULT_CLUSTER_MIN_SAMPLES,
      clusterSelectionEpsilon: DEFAULT_CLUSTER_SELECTION_EPSILON
    },
    clustersLoading: false,
    metric: {
      type: "drift",
      metric: "euclideanDistance"
    }
  };
  const pointCloudStore = (set3, get3) => ({
    ...defaultProps5,
    ...initProps,
    setInitialData: async ({ points, clusters, retrievals }) => {
      const pointCloud = get3();
      const eventIdToDataMap = /* @__PURE__ */ new Map();
      const eventIdToRetrievals = retrievals.reduce((acc, retrieval) => {
        const { queryId } = retrieval;
        if (acc[queryId]) {
          acc[queryId].push(retrieval);
        } else {
          acc[queryId] = [retrieval];
        }
        return acc;
      }, {});
      points.forEach((p) => {
        p = {
          ...p,
          retrievals: eventIdToRetrievals[p.eventId] ?? []
        };
        eventIdToDataMap.set(p.eventId, p);
      });
      const sortedClusters = clusters.map(normalizeCluster).sort(clusterSortFn(pointCloud.clusterSort));
      set3({
        loading: false,
        points,
        eventIdToDataMap,
        clusters: sortedClusters,
        clustersLoading: false,
        selectedEventIds: /* @__PURE__ */ new Set(),
        selectedClusterId: null,
        pointData: null,
        eventIdToGroup: getEventIdToGroup({
          points,
          coloringStrategy: pointCloud.coloringStrategy,
          pointsData: pointCloud.pointData ?? {},
          dimension: pointCloud.dimension || null,
          dimensionMetadata: pointCloud.dimensionMetadata
        })
      });
      const pointData = await fetchPointEvents(
        points.map((p) => p.eventId)
      ).catch(() => set3({ errorMessage: "Failed to load the point events" }));
      if (!pointData)
        return;
      set3({
        pointData,
        // TODO(mikeldking): For some reason the point-cloud doesn't rerender clusters unless this exists
        clusters: sortedClusters,
        clustersLoading: false,
        eventIdToGroup: getEventIdToGroup({
          points,
          coloringStrategy: pointCloud.coloringStrategy,
          pointsData: pointData ?? {},
          dimension: pointCloud.dimension || null,
          dimensionMetadata: pointCloud.dimensionMetadata
        })
      });
    },
    setClusters: (clusters) => {
      const pointCloud = get3();
      const sortedClusters = clusters.map(normalizeCluster).sort(clusterSortFn(pointCloud.clusterSort));
      set3({
        clusters: sortedClusters,
        clustersLoading: false,
        selectedClusterId: null,
        highlightedClusterId: null
      });
    },
    setClusterSort: (sort) => {
      const pointCloud = get3();
      const sortedClusters = [...pointCloud.clusters].sort(clusterSortFn(sort));
      set3({ clusterSort: sort, clusters: sortedClusters });
    },
    setSelectedEventIds: (ids) => set3({ selectedEventIds: ids }),
    setHoveredEventId: (id2) => set3({ hoveredEventId: id2 }),
    setHighlightedClusterId: (id2) => set3({ highlightedClusterId: id2 }),
    setSelectedClusterId: (id2) => set3({ selectedClusterId: id2, highlightedClusterId: null }),
    setPointSizeScale: (scale) => set3({ pointSizeScale: scale }),
    setCanvasMode: (mode) => set3({ canvasMode: mode }),
    setClusterColorMode: (mode) => set3({ clusterColorMode: mode }),
    setColoringStrategy: (strategy) => {
      const pointCloudState = get3();
      set3({ coloringStrategy: strategy });
      switch (strategy) {
        case "correctness" /* correctness */:
          set3({
            pointGroupVisibility: {
              ["correct" /* correct */]: true,
              ["incorrect" /* incorrect */]: true,
              ["unknown" /* unknown */]: true
            },
            pointGroupColors: {
              ["correct" /* correct */]: ColorSchemes.Discrete2.LightBlueOrange[0],
              ["incorrect" /* incorrect */]: ColorSchemes.Discrete2.LightBlueOrange[1],
              ["unknown" /* unknown */]: UNKNOWN_COLOR
            },
            dimension: null,
            dimensionMetadata: null,
            eventIdToGroup: getEventIdToGroup({
              points: pointCloudState.points,
              coloringStrategy: strategy,
              pointsData: pointCloudState.pointData ?? {},
              dimension: pointCloudState.dimension || null,
              dimensionMetadata: pointCloudState.dimensionMetadata
            })
          });
          break;
        case "dataset" /* dataset */: {
          set3({
            pointGroupVisibility: {
              ["primary" /* primary */]: true,
              ["reference" /* reference */]: true,
              ["corpus" /* corpus */]: true
            },
            pointGroupColors: {
              // TODO move these colors to a constants file
              ["primary" /* primary */]: getDefaultColorScheme()[0],
              ["reference" /* reference */]: getDefaultColorScheme()[1],
              ["corpus" /* corpus */]: FALLBACK_COLOR
            },
            dimension: null,
            dimensionMetadata: null,
            eventIdToGroup: getEventIdToGroup({
              points: pointCloudState.points,
              coloringStrategy: strategy,
              pointsData: pointCloudState.pointData ?? {},
              dimension: pointCloudState.dimension || null,
              dimensionMetadata: pointCloudState.dimensionMetadata
            })
          });
          break;
        }
        case "dimension" /* dimension */: {
          set3({
            pointGroupVisibility: {
              unknown: true
            },
            pointGroupColors: {
              unknown: UNKNOWN_COLOR
            },
            dimension: null,
            dimensionMetadata: null,
            eventIdToGroup: getEventIdToGroup({
              points: pointCloudState.points,
              coloringStrategy: strategy,
              pointsData: pointCloudState.pointData ?? {},
              dimension: pointCloudState.dimension || null,
              dimensionMetadata: pointCloudState.dimensionMetadata
            })
          });
          break;
        }
        default:
          assertUnreachable2(strategy);
      }
    },
    datasetVisibility: { primary: true, reference: true, corpus: true },
    setDatasetVisibility: (visibility) => set3({ datasetVisibility: visibility }),
    setPointGroupVisibility: (visibility) => set3({ pointGroupVisibility: visibility }),
    selectionDisplay: "gallery" /* gallery */,
    setSelectionDisplay: (display) => set3({ selectionDisplay: display }),
    setSelectionGridSize: (size) => set3({ selectionGridSize: size }),
    reset: () => {
      set3({
        points: [],
        clusters: [],
        selectedEventIds: /* @__PURE__ */ new Set(),
        selectedClusterId: null,
        eventIdToGroup: {}
      });
    },
    setDimension: async (dimension) => {
      const pointCloudState = get3();
      set3({ dimension, dimensionMetadata: null });
      const dimensionMetadata = await fetchDimensionMetadata(dimension).catch(
        () => set3({ errorMessage: "Failed to load the dimension metadata" })
      );
      if (!dimensionMetadata)
        return;
      set3({ dimensionMetadata });
      if (dimensionMetadata.categories && dimensionMetadata.categories.length) {
        const numCategories = dimensionMetadata.categories.length;
        const useDiscreteColorScale = numCategories <= discreteColorScaleCategories.length;
        const colorScaleFn = useDiscreteColorScale ? discreteColorScale : (index) => sequentialColorScale(index / numCategories);
        set3({
          pointGroupVisibility: {
            ...dimensionMetadata.categories.reduce(
              (acc, category) => ({
                ...acc,
                [category]: true
              }),
              {}
            ),
            unknown: true
          },
          pointGroupColors: {
            ...dimensionMetadata.categories.reduce(
              (acc, category, idx) => ({
                ...acc,
                [category]: colorScaleFn(idx)
              }),
              {}
            ),
            unknown: UNKNOWN_COLOR
          },
          eventIdToGroup: getEventIdToGroup({
            points: pointCloudState.points,
            coloringStrategy: pointCloudState.coloringStrategy,
            pointsData: pointCloudState.pointData ?? {},
            dimension,
            dimensionMetadata
          })
        });
      } else if (dimensionMetadata.interval !== null) {
        const groups = getNumericGroupsFromInterval(dimensionMetadata.interval);
        set3({
          pointGroupVisibility: {
            ...groups.reduce(
              (acc, group) => ({
                ...acc,
                [group.name]: true
              }),
              {}
            ),
            unknown: true
          },
          pointGroupColors: {
            ...groups.reduce(
              (acc, group, idx) => ({
                ...acc,
                [group.name]: numericColorScale(idx)
              }),
              {}
            ),
            unknown: UNKNOWN_COLOR
          },
          eventIdToGroup: getEventIdToGroup({
            points: pointCloudState.points,
            coloringStrategy: pointCloudState.coloringStrategy,
            pointsData: pointCloudState.pointData ?? {},
            dimension,
            dimensionMetadata
          })
        });
      }
    },
    setDimensionMetadata: (dimensionMetadata) => set3({ dimensionMetadata }),
    setUMAPParameters: (umapParameters) => set3({ umapParameters }),
    setHDBSCANParameters: async (hdbscanParameters) => {
      const pointCloud = get3();
      set3({ hdbscanParameters, clustersLoading: true });
      const clusters = await fetchClusters({
        metric: pointCloud.metric,
        points: pointCloud.points,
        hdbscanParameters
      });
      pointCloud.setClusters(clusters);
    },
    getHDSCANParameters: () => get3().hdbscanParameters,
    getMetric: () => get3().metric,
    setErrorMessage: (errorMessage) => set3({ errorMessage }),
    setLoading: (loading2) => set3({ loading: loading2 }),
    setMetric: async (metric) => {
      const pointCloud = get3();
      set3({ metric, clustersLoading: true });
      const clusters = await fetchClusterMetrics({
        metric,
        clusters: pointCloud.clusters,
        hdbscanParameters: pointCloud.hdbscanParameters
      });
      pointCloud.setClusters(clusters);
    }
  });
  return create()(devtools(pointCloudStore));
};
var numberFormatter = new Intl.NumberFormat([], {
  maximumFractionDigits: 2
});
function intervalToString({ min: min3, max: max3 }) {
  return `${numberFormatter.format(min3)} - ${numberFormatter.format(max3)}`;
}
function getNumericGroupsFromInterval({
  min: min3,
  max: max3
}) {
  const range4 = max3 - min3;
  const groupSliceSize = range4 / NUM_NUMERIC_GROUPS;
  const groups = [];
  for (let i2 = 0; i2 < NUM_NUMERIC_GROUPS; i2++) {
    const groupMin = min3 + i2 * groupSliceSize;
    const groupMax = min3 + (i2 + 1) * groupSliceSize;
    groups.push({
      min: groupMin,
      max: groupMax,
      name: intervalToString({ min: groupMin, max: groupMax })
    });
  }
  return groups;
}
function getEventGroupForNumericValue({
  numericGroupIntervals,
  numericValue
}) {
  let eventGroup = UNKNOWN_GROUP;
  let groupIndex = numericGroupIntervals.findIndex(
    (group) => numericValue >= group.min && numericValue < group.max
  );
  groupIndex = groupIndex === -1 ? NUM_NUMERIC_GROUPS - 1 : groupIndex;
  eventGroup = numericGroupIntervals[groupIndex].name;
  return eventGroup;
}
function getEventIdToGroup(params) {
  const { points, coloringStrategy, pointsData, dimension, dimensionMetadata } = params;
  const eventIdToGroup = {};
  const eventIds = points.map((point4) => point4.eventId);
  switch (coloringStrategy) {
    case "dataset" /* dataset */: {
      const { primaryEventIds, referenceEventIds, corpusEventIds } = splitEventIdsByDataset(eventIds);
      primaryEventIds.forEach((eventId) => {
        eventIdToGroup[eventId] = "primary" /* primary */;
      });
      referenceEventIds.forEach((eventId) => {
        eventIdToGroup[eventId] = "reference" /* reference */;
      });
      corpusEventIds.forEach((eventId) => {
        eventIdToGroup[eventId] = "corpus" /* corpus */;
      });
      break;
    }
    case "correctness" /* correctness */: {
      points.forEach((point4) => {
        let group = "unknown" /* unknown */;
        const { predictionLabel, actualLabel } = point4.eventMetadata;
        if (predictionLabel !== null && actualLabel !== null) {
          group = predictionLabel === actualLabel ? "correct" /* correct */ : "incorrect" /* incorrect */;
        }
        eventIdToGroup[point4.eventId] = group;
      });
      break;
    }
    case "dimension" /* dimension */: {
      let numericGroupIntervals;
      if (dimensionMetadata && dimensionMetadata?.interval !== null) {
        numericGroupIntervals = getNumericGroupsFromInterval(
          dimensionMetadata.interval
        );
      }
      const isColorByPredictionLabel = dimension?.type === "prediction" && dimension?.dataType === "categorical";
      const isColorByPredictionScore = dimension?.type === "prediction" && dimension?.dataType === "numeric";
      const isColorByActualLabel = dimension?.type === "actual" && dimension?.dataType === "categorical";
      const isColorByActualScore = dimension?.type === "actual" && dimension?.dataType === "numeric";
      points.forEach((point4) => {
        let group = UNKNOWN_GROUP;
        const pointData = pointsData[point4.eventId];
        const haveSufficientDataToColorByDimension = dimension != null && pointData != null;
        if (haveSufficientDataToColorByDimension) {
          if (isColorByPredictionLabel) {
            group = pointData.eventMetadata.predictionLabel ?? UNKNOWN_GROUP;
          } else if (isColorByPredictionScore) {
            if (numericGroupIntervals == null) {
              throw new Error(
                "Cannot color by prediction score without numeric group intervals"
              );
            }
            const numericValue = pointData.eventMetadata.predictionScore;
            if (typeof numericValue === "number") {
              group = getEventGroupForNumericValue({
                numericGroupIntervals,
                numericValue
              });
            }
          } else if (isColorByActualScore) {
            if (numericGroupIntervals == null) {
              throw new Error(
                "Cannot color by actual score without numeric group intervals"
              );
            }
            const numericValue = pointData.eventMetadata.actualScore;
            if (typeof numericValue === "number") {
              group = getEventGroupForNumericValue({
                numericGroupIntervals,
                numericValue
              });
            }
          } else if (isColorByActualLabel) {
            group = pointData.eventMetadata.actualLabel ?? UNKNOWN_GROUP;
          } else {
            const dimensionWithValue = pointData.dimensions.find(
              (dimensionWithValue2) => dimensionWithValue2.dimension.name === dimension.name
            );
            if (dimensionWithValue != null && dimension.dataType === "categorical") {
              group = dimensionWithValue.value ?? UNKNOWN_GROUP;
            } else if (dimensionWithValue != null && dimension.dataType === "numeric" && numericGroupIntervals != null) {
              const numericValue = typeof dimensionWithValue?.value === "string" ? parseFloat(dimensionWithValue.value) : null;
              if (typeof numericValue === "number") {
                group = getEventGroupForNumericValue({
                  numericGroupIntervals,
                  numericValue
                });
              }
            }
          }
        }
        eventIdToGroup[point4.eventId] = group;
      });
      break;
    }
    default:
      assertUnreachable2(coloringStrategy);
  }
  return eventIdToGroup;
}
async function fetchDimensionMetadata(dimension) {
  const data = await (0, import_react_relay.fetchQuery)(
    RelayEnvironment_default,
    pointCloudStore_dimensionMetadataQuery_graphql_default,
    {
      id: dimension.id,
      getDimensionMinMax: dimension.dataType === "numeric",
      getDimensionCategories: dimension.dataType === "categorical"
    }
  ).toPromise();
  const dimensionData = data?.dimension;
  if (!dimension) {
    throw new Error("Dimension not found");
  }
  let interval = null;
  if (typeof dimensionData?.min === "number" && typeof dimensionData?.max === "number") {
    interval = { min: dimensionData.min, max: dimensionData.max };
  }
  return {
    interval,
    categories: dimensionData?.categories ?? null
  };
}
async function fetchPointEvents(eventIds) {
  const { primaryEventIds, referenceEventIds, corpusEventIds } = splitEventIdsByDataset([...eventIds]);
  const data = await (0, import_react_relay.fetchQuery)(
    RelayEnvironment_default,
    pointCloudStore_eventsQuery_graphql_default,
    {
      primaryEventIds,
      referenceEventIds,
      corpusEventIds
    }
  ).toPromise();
  const primaryEvents = data?.model?.primaryDataset?.events ?? [];
  const referenceEvents = data?.model?.referenceDataset?.events ?? [];
  const corpusEvents = data?.model?.corpusDataset?.events ?? [];
  const allEvents = [...primaryEvents, ...referenceEvents, ...corpusEvents];
  return allEvents.reduce((acc, event) => {
    acc[event.id] = event;
    return acc;
  }, {});
}
async function fetchClusters({
  metric,
  points,
  hdbscanParameters
}) {
  const data = await (0, import_react_relay.fetchQuery)(
    RelayEnvironment_default,
    pointCloudStore_clustersQuery_graphql_default,
    {
      eventIds: points.map((point4) => point4.eventId),
      coordinates: points.map((p) => ({
        x: p.position[0],
        y: p.position[1],
        z: p.position[2]
      })),
      fetchDataQualityMetric: metric.type === "dataQuality",
      dataQualityMetricColumnName: metric.type === "dataQuality" ? metric.dimension.name : null,
      fetchPerformanceMetric: metric.type === "performance",
      // NB: fallback should never happen due to the conditional above
      performanceMetric: metric.type === "performance" ? metric.metric : "accuracyScore",
      ...hdbscanParameters
    },
    {
      fetchPolicy: "network-only"
    }
  ).toPromise();
  return data?.hdbscanClustering ?? [];
}
async function fetchClusterMetrics({
  metric,
  clusters,
  hdbscanParameters
}) {
  const data = await (0, import_react_relay.fetchQuery)(
    RelayEnvironment_default,
    pointCloudStore_clusterMetricsQuery_graphql_default,
    {
      clusters: clusters.map((cluster) => ({
        id: cluster.id,
        eventIds: cluster.eventIds
      })),
      fetchDataQualityMetric: metric.type === "dataQuality",
      dataQualityMetricColumnName: metric.type === "dataQuality" ? metric.dimension.name : null,
      fetchPerformanceMetric: metric.type === "performance",
      performanceMetric: metric.type === "performance" ? metric.metric : "accuracyScore",
      ...hdbscanParameters
    },
    {
      fetchPolicy: "network-only"
    }
  ).toPromise();
  return data?.clusters ?? [];
}
var clusterSortFn = (sort) => (clusterA, clusterB) => {
  const { dir, column: column2 } = sort;
  const isAsc = dir === "asc";
  const valueA = clusterA[column2];
  const valueB = clusterB[column2];
  if (valueA == null) {
    return 1;
  } else if (valueB == null) {
    return -1;
  } else if (valueA > valueB) {
    return isAsc ? 1 : -1;
  } else if (valueA < valueB) {
    return isAsc ? -1 : 1;
  }
  return 0;
};
function normalizeCluster(cluster) {
  let primaryMetricValue = cluster.driftRatio, referenceMetricValue = null;
  if (cluster.dataQualityMetric) {
    primaryMetricValue = cluster.dataQualityMetric.primaryValue;
    referenceMetricValue = cluster.dataQualityMetric.referenceValue;
  } else if (cluster.performanceMetric) {
    primaryMetricValue = cluster.performanceMetric.primaryValue;
    referenceMetricValue = cluster.performanceMetric.referenceValue;
  } else if (cluster.primaryToCorpusRatio != null) {
    primaryMetricValue = (cluster.primaryToCorpusRatio + 1) / 2 * 100;
  }
  return {
    ...cluster,
    size: cluster.eventIds.length,
    primaryMetricValue,
    referenceMetricValue
  };
}

// src/contexts/PointCloudContext.tsx
var PointCloudContext = (0, import_react46.createContext)(null);
function PointCloudProvider({
  children,
  ...props
}) {
  const storeRef = (0, import_react46.useRef)();
  if (!storeRef.current) {
    storeRef.current = createPointCloudStore(props);
  }
  return /* @__PURE__ */ jsx5(PointCloudContext.Provider, { value: storeRef.current, children });
}
function usePointCloudContext(selector, equalityFn) {
  const store = (0, import_react46.useContext)(PointCloudContext);
  if (!store)
    throw new Error("Missing PointCloudContext.Provider in the tree");
  return n(store, selector, equalityFn);
}

// src/contexts/TimeRangeContext.tsx
var import_react47 = __toESM(require_react());

// node_modules/@babel/runtime/helpers/esm/typeof.js
function _typeof(o) {
  "@babel/helpers - typeof";
  return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
    return typeof o2;
  } : function(o2) {
    return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
  }, _typeof(o);
}

// node_modules/date-fns/esm/_lib/toInteger/index.js
function toInteger(dirtyNumber) {
  if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {
    return NaN;
  }
  var number5 = Number(dirtyNumber);
  if (isNaN(number5)) {
    return number5;
  }
  return number5 < 0 ? Math.ceil(number5) : Math.floor(number5);
}

// node_modules/date-fns/esm/_lib/requiredArgs/index.js
function requiredArgs(required, args) {
  if (args.length < required) {
    throw new TypeError(required + " argument" + (required > 1 ? "s" : "") + " required, but only " + args.length + " present");
  }
}

// node_modules/date-fns/esm/toDate/index.js
function toDate(argument) {
  requiredArgs(1, arguments);
  var argStr = Object.prototype.toString.call(argument);
  if (argument instanceof Date || _typeof(argument) === "object" && argStr === "[object Date]") {
    return new Date(argument.getTime());
  } else if (typeof argument === "number" || argStr === "[object Number]") {
    return new Date(argument);
  } else {
    if ((typeof argument === "string" || argStr === "[object String]") && typeof console !== "undefined") {
      console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments");
      console.warn(new Error().stack);
    }
    return /* @__PURE__ */ new Date(NaN);
  }
}

// node_modules/date-fns/esm/addDays/index.js
function addDays(dirtyDate, dirtyAmount) {
  requiredArgs(2, arguments);
  var date2 = toDate(dirtyDate);
  var amount = toInteger(dirtyAmount);
  if (isNaN(amount)) {
    return /* @__PURE__ */ new Date(NaN);
  }
  if (!amount) {
    return date2;
  }
  date2.setDate(date2.getDate() + amount);
  return date2;
}

// node_modules/date-fns/esm/startOfDay/index.js
function startOfDay(dirtyDate) {
  requiredArgs(1, arguments);
  var date2 = toDate(dirtyDate);
  date2.setHours(0, 0, 0, 0);
  return date2;
}

// node_modules/date-fns/esm/_lib/roundingMethods/index.js
var roundingMap = {
  ceil: Math.ceil,
  round: Math.round,
  floor: Math.floor,
  trunc: function trunc(value) {
    return value < 0 ? Math.ceil(value) : Math.floor(value);
  }
  // Math.trunc is not supported by IE
};
var defaultRoundingMethod = "trunc";
function getRoundingMethod(method) {
  return method ? roundingMap[method] : roundingMap[defaultRoundingMethod];
}

// node_modules/date-fns/esm/endOfDay/index.js
function endOfDay(dirtyDate) {
  requiredArgs(1, arguments);
  var date2 = toDate(dirtyDate);
  date2.setHours(23, 59, 59, 999);
  return date2;
}

// node_modules/date-fns/esm/endOfHour/index.js
function endOfHour(dirtyDate) {
  requiredArgs(1, arguments);
  var date2 = toDate(dirtyDate);
  date2.setMinutes(59, 59, 999);
  return date2;
}

// node_modules/date-fns/esm/startOfHour/index.js
function startOfHour(dirtyDate) {
  requiredArgs(1, arguments);
  var date2 = toDate(dirtyDate);
  date2.setMinutes(0, 0, 0);
  return date2;
}

// node_modules/date-fns/esm/subDays/index.js
function subDays(dirtyDate, dirtyAmount) {
  requiredArgs(2, arguments);
  var amount = toInteger(dirtyAmount);
  return addDays(dirtyDate, -amount);
}

// node_modules/date-fns/esm/roundToNearestMinutes/index.js
function roundToNearestMinutes(dirtyDate, options) {
  var _options$nearestTo;
  if (arguments.length < 1) {
    throw new TypeError("1 argument required, but only none provided present");
  }
  var nearestTo = toInteger((_options$nearestTo = options === null || options === void 0 ? void 0 : options.nearestTo) !== null && _options$nearestTo !== void 0 ? _options$nearestTo : 1);
  if (nearestTo < 1 || nearestTo > 30) {
    throw new RangeError("`options.nearestTo` must be between 1 and 30");
  }
  var date2 = toDate(dirtyDate);
  var seconds2 = date2.getSeconds();
  var minutes = date2.getMinutes() + seconds2 / 60;
  var roundingMethod = getRoundingMethod(options === null || options === void 0 ? void 0 : options.roundingMethod);
  var roundedMinutes = roundingMethod(minutes / nearestTo) * nearestTo;
  var remainderMinutes = minutes % nearestTo;
  var addedMinutes = Math.round(remainderMinutes / nearestTo) * nearestTo;
  return new Date(date2.getFullYear(), date2.getMonth(), date2.getDate(), date2.getHours(), roundedMinutes + addedMinutes);
}

// src/contexts/TimeRangeContext.tsx
var TimeRangeContext = (0, import_react47.createContext)(
  null
);
function useTimeRange() {
  const context2 = (0, import_react47.useContext)(TimeRangeContext);
  if (context2 === null) {
    throw new Error("useTimeRange must be used within a TimeRangeProvider");
  }
  return context2;
}
function useTimeRangeMemo(timePreset, timeRangeBounds) {
  const timeRange = (0, import_react47.useMemo)(() => {
    switch (timePreset) {
      case "Last Day" /* last_day */: {
        const endTimeBounds = roundToNearestMinutes(
          endOfHour(timeRangeBounds.end),
          { roundingMethod: "floor" }
        );
        return {
          start: subDays(endTimeBounds, 1),
          end: endTimeBounds
        };
      }
      case "Last Week" /* last_week */: {
        const endTimeBounds = roundToNearestMinutes(
          endOfDay(timeRangeBounds.end),
          { roundingMethod: "floor" }
        );
        return {
          start: subDays(endTimeBounds, 7),
          end: endTimeBounds
        };
      }
      case "Last Month" /* last_month */: {
        const endTimeBounds = roundToNearestMinutes(
          endOfDay(timeRangeBounds.end),
          { roundingMethod: "floor" }
        );
        return {
          start: subDays(endTimeBounds, 30),
          end: endTimeBounds
        };
      }
      case "Last 3 Months" /* last_3_months */: {
        const endTimeBounds = roundToNearestMinutes(
          endOfDay(timeRangeBounds.end),
          { roundingMethod: "floor" }
        );
        return {
          start: subDays(endTimeBounds, 90),
          end: endTimeBounds
        };
      }
      case "First Day" /* first_day */: {
        const startTimeBounds = startOfHour(timeRangeBounds.start);
        return {
          start: startTimeBounds,
          end: addDays(startTimeBounds, 1)
        };
      }
      case "First Week" /* first_week */: {
        const startTimeBounds = startOfDay(timeRangeBounds.start);
        return {
          start: startTimeBounds,
          end: addDays(startTimeBounds, 7)
        };
      }
      case "First Month" /* first_month */: {
        const startTimeBounds = startOfDay(timeRangeBounds.start);
        return {
          start: startTimeBounds,
          end: addDays(startTimeBounds, 30)
        };
      }
      case "All" /* all */: {
        const endTimeBounds = roundToNearestMinutes(
          endOfDay(timeRangeBounds.end),
          { roundingMethod: "floor" }
        );
        const startTimeBounds = startOfDay(timeRangeBounds.start);
        return {
          start: startTimeBounds,
          end: endTimeBounds
        };
      }
      default:
        assertUnreachable2(timePreset);
    }
  }, [timePreset, timeRangeBounds]);
  return timeRange;
}
function TimeRangeProvider(props) {
  const [timePreset, _setTimePreset] = (0, import_react47.useState)("Last Month" /* last_month */);
  const timeRange = useTimeRangeMemo(timePreset, props.timeRangeBounds);
  const setTimePreset = (0, import_react47.useCallback)((preset) => {
    (0, import_react47.startTransition)(() => {
      _setTimePreset(preset);
    });
  }, []);
  return /* @__PURE__ */ jsx5(TimeRangeContext.Provider, { value: { timeRange, timePreset, setTimePreset }, children: props.children });
}

// src/contexts/NotificationContext.tsx
var import_react48 = __toESM(require_react());
var NotificationContext = (0, import_react48.createContext)(null);
function NotificationProvider({
  children
}) {
  const [notify, holder] = useNotification();
  const notifyError = (0, import_react48.useCallback)(
    (notice) => {
      notify({
        variant: "danger",
        ...notice
      });
    },
    [notify]
  );
  const notifySuccess = (0, import_react48.useCallback)(
    (notice) => {
      notify({
        variant: "success",
        ...notice
      });
    },
    [notify]
  );
  return /* @__PURE__ */ jsxs2(
    NotificationContext.Provider,
    {
      value: { notify, notifyError, notifySuccess },
      children: [
        children,
        holder
      ]
    }
  );
}
function useGlobalNotification() {
  const context2 = (0, import_react48.useContext)(NotificationContext);
  if (context2 === null) {
    throw new Error(
      "useGlobalNotification must be used within a NotificationProvider"
    );
  }
  return context2;
}

// src/contexts/ThemeContext.tsx
var import_react49 = __toESM(require_react());
var LOCAL_STORAGE_THEME_KEY = "arize-phoenix-theme";
function getCurrentTheme() {
  const themeFromLocalStorage = localStorage.getItem(LOCAL_STORAGE_THEME_KEY);
  return themeFromLocalStorage === "light" ? "light" : "dark";
}
var ThemeContext2 = (0, import_react49.createContext)(null);
function useTheme2() {
  const context2 = (0, import_react49.useContext)(ThemeContext2);
  if (context2 === null) {
    throw new Error("useTheme must be used within a ThemeProvider");
  }
  return context2;
}
function ThemeProvider3(props) {
  const [theme3, _setTheme] = (0, import_react49.useState)(getCurrentTheme());
  const setTheme = (0, import_react49.useCallback)((theme4) => {
    localStorage.setItem(LOCAL_STORAGE_THEME_KEY, theme4);
    _setTheme(theme4);
  }, []);
  return /* @__PURE__ */ jsx5(ThemeContext2.Provider, { value: { theme: theme3, setTheme }, children: props.children });
}

// src/GlobalStyles.tsx
function GlobalStyles2() {
  return /* @__PURE__ */ jsx5(
    Global,
    {
      styles: (theme3) => css`
        body {
          background-color: var(--ac-global-color-grey-75);
          color: var(--ac-global-text-color-900);
          font-family: "Roboto";
          font-size: ${theme3.typography.sizes.medium.fontSize}px;
          margin: 0;
          #root,
          #root > div[data-overlay-container="true"],
          #root > div[data-overlay-container="true"] > .ac-theme {
            height: 100vh;
          }
        }

        /* Remove list styling */
        ul {
          display: block;
          list-style-type: none;
          margin-block-start: none;
          margin-block-end: 0;
          padding-inline-start: 0;
          margin-block-start: 0;
        }

        /* A reset style for buttons */
        .button--reset {
          background: none;
          border: none;
          padding: 0;
        }
        /* this css class is added to html via modernizr @see modernizr.js */
        .no-hiddenscroll {
          /* Works on Firefox */
          * {
            scrollbar-width: thin;
            scrollbar-color: var(--ac-global-color-grey-300)
              var(--ac-global-color-grey-400);
          }

          /* Works on Chrome, Edge, and Safari */
          *::-webkit-scrollbar {
            width: 14px;
          }

          *::-webkit-scrollbar-track {
            background: var(--ac-global-color-grey-100);
          }

          *::-webkit-scrollbar-thumb {
            background-color: var(--ac-global-color-grey-75);
            border-radius: 8px;
            border: 1px solid var(--ac-global-color-grey-300);
          }
        }

        :root {
          --px-blue-color: ${theme3.colors.arizeBlue};

          --px-flex-gap-sm: ${theme3.spacing.margin4}px;
          --px-flex-gap-sm: ${theme3.spacing.margin8}px;

          --px-section-background-color: ${theme3.colors.gray500};

          /* An item is a typically something in a list */
          --px-item-background-color: ${theme3.colors.gray800};
          --px-item-border-color: ${theme3.colors.gray600};

          --px-spacing-sm: ${theme3.spacing.padding4}px;
          --px-spacing-med: ${theme3.spacing.padding8}px;
          --px-spacing-lg: ${theme3.spacing.padding16}px;

          --px-border-radius-med: ${theme3.borderRadius.medium}px;

          --px-font-size-sm: ${theme3.typography.sizes.small.fontSize}px;
          --px-font-size-med: ${theme3.typography.sizes.medium.fontSize}px;
          --px-font-size-lg: ${theme3.typography.sizes.large.fontSize}px;

          --px-gradient-bar-height: 8px;
        }

        .ac-theme--dark {
          --px-primary-color: #9efcfd;
          --px-primary-color--transparent: rgb(158, 252, 253, 0.2);
          --px-reference-color: #baa1f9;
          --px-reference-color--transparent: #baa1f982;
          --px-corpus-color: #92969c;
          --px-corpus-color--transparent: #92969c63;
        }
        .ac-theme--light {
          --px-primary-color: #00add0;
          --px-primary-color--transparent: rgba(0, 173, 208, 0.2);
          --px-reference-color: #4500d9;
          --px-reference-color--transparent: rgba(69, 0, 217, 0.2);
          --px-corpus-color: #92969c;
          --px-corpus-color--transparent: #92969c63;
        }
      `
    }
  );
}

// node_modules/react-router/dist/index.js
var React24 = __toESM(require_react());

// node_modules/@remix-run/router/dist/router.js
function _extends5() {
  _extends5 = Object.assign ? Object.assign.bind() : function(target) {
    for (var i2 = 1; i2 < arguments.length; i2++) {
      var source = arguments[i2];
      for (var key in source) {
        if (Object.prototype.hasOwnProperty.call(source, key)) {
          target[key] = source[key];
        }
      }
    }
    return target;
  };
  return _extends5.apply(this, arguments);
}
var Action;
(function(Action2) {
  Action2["Pop"] = "POP";
  Action2["Push"] = "PUSH";
  Action2["Replace"] = "REPLACE";
})(Action || (Action = {}));
var PopStateEventType = "popstate";
function createBrowserHistory(options) {
  if (options === void 0) {
    options = {};
  }
  function createBrowserLocation(window2, globalHistory) {
    let {
      pathname,
      search,
      hash: hash3
    } = window2.location;
    return createLocation(
      "",
      {
        pathname,
        search,
        hash: hash3
      },
      // state defaults to `null` because `window.history.state` does
      globalHistory.state && globalHistory.state.usr || null,
      globalHistory.state && globalHistory.state.key || "default"
    );
  }
  function createBrowserHref(window2, to) {
    return typeof to === "string" ? to : createPath(to);
  }
  return getUrlBasedHistory(createBrowserLocation, createBrowserHref, null, options);
}
function invariant(value, message) {
  if (value === false || value === null || typeof value === "undefined") {
    throw new Error(message);
  }
}
function warning(cond, message) {
  if (!cond) {
    if (typeof console !== "undefined")
      console.warn(message);
    try {
      throw new Error(message);
    } catch (e3) {
    }
  }
}
function createKey() {
  return Math.random().toString(36).substr(2, 8);
}
function getHistoryState(location2, index) {
  return {
    usr: location2.state,
    key: location2.key,
    idx: index
  };
}
function createLocation(current, to, state, key) {
  if (state === void 0) {
    state = null;
  }
  let location2 = _extends5({
    pathname: typeof current === "string" ? current : current.pathname,
    search: "",
    hash: ""
  }, typeof to === "string" ? parsePath(to) : to, {
    state,
    // TODO: This could be cleaned up.  push/replace should probably just take
    // full Locations now and avoid the need to run through this flow at all
    // But that's a pretty big refactor to the current test suite so going to
    // keep as is for the time being and just let any incoming keys take precedence
    key: to && to.key || key || createKey()
  });
  return location2;
}
function createPath(_ref18) {
  let {
    pathname = "/",
    search = "",
    hash: hash3 = ""
  } = _ref18;
  if (search && search !== "?")
    pathname += search.charAt(0) === "?" ? search : "?" + search;
  if (hash3 && hash3 !== "#")
    pathname += hash3.charAt(0) === "#" ? hash3 : "#" + hash3;
  return pathname;
}
function parsePath(path2) {
  let parsedPath = {};
  if (path2) {
    let hashIndex = path2.indexOf("#");
    if (hashIndex >= 0) {
      parsedPath.hash = path2.substr(hashIndex);
      path2 = path2.substr(0, hashIndex);
    }
    let searchIndex = path2.indexOf("?");
    if (searchIndex >= 0) {
      parsedPath.search = path2.substr(searchIndex);
      path2 = path2.substr(0, searchIndex);
    }
    if (path2) {
      parsedPath.pathname = path2;
    }
  }
  return parsedPath;
}
function getUrlBasedHistory(getLocation, createHref, validateLocation, options) {
  if (options === void 0) {
    options = {};
  }
  let {
    window: window2 = document.defaultView,
    v5Compat = false
  } = options;
  let globalHistory = window2.history;
  let action = Action.Pop;
  let listener = null;
  let index = getIndex();
  if (index == null) {
    index = 0;
    globalHistory.replaceState(_extends5({}, globalHistory.state, {
      idx: index
    }), "");
  }
  function getIndex() {
    let state = globalHistory.state || {
      idx: null
    };
    return state.idx;
  }
  function handlePop() {
    action = Action.Pop;
    let nextIndex = getIndex();
    let delta = nextIndex == null ? null : nextIndex - index;
    index = nextIndex;
    if (listener) {
      listener({
        action,
        location: history2.location,
        delta
      });
    }
  }
  function push(to, state) {
    action = Action.Push;
    let location2 = createLocation(history2.location, to, state);
    if (validateLocation)
      validateLocation(location2, to);
    index = getIndex() + 1;
    let historyState = getHistoryState(location2, index);
    let url = history2.createHref(location2);
    try {
      globalHistory.pushState(historyState, "", url);
    } catch (error) {
      if (error instanceof DOMException && error.name === "DataCloneError") {
        throw error;
      }
      window2.location.assign(url);
    }
    if (v5Compat && listener) {
      listener({
        action,
        location: history2.location,
        delta: 1
      });
    }
  }
  function replace2(to, state) {
    action = Action.Replace;
    let location2 = createLocation(history2.location, to, state);
    if (validateLocation)
      validateLocation(location2, to);
    index = getIndex();
    let historyState = getHistoryState(location2, index);
    let url = history2.createHref(location2);
    globalHistory.replaceState(historyState, "", url);
    if (v5Compat && listener) {
      listener({
        action,
        location: history2.location,
        delta: 0
      });
    }
  }
  function createURL(to) {
    let base2 = window2.location.origin !== "null" ? window2.location.origin : window2.location.href;
    let href = typeof to === "string" ? to : createPath(to);
    invariant(base2, "No window.location.(origin|href) available to create URL for href: " + href);
    return new URL(href, base2);
  }
  let history2 = {
    get action() {
      return action;
    },
    get location() {
      return getLocation(window2, globalHistory);
    },
    listen(fn) {
      if (listener) {
        throw new Error("A history only accepts one active listener");
      }
      window2.addEventListener(PopStateEventType, handlePop);
      listener = fn;
      return () => {
        window2.removeEventListener(PopStateEventType, handlePop);
        listener = null;
      };
    },
    createHref(to) {
      return createHref(window2, to);
    },
    createURL,
    encodeLocation(to) {
      let url = createURL(to);
      return {
        pathname: url.pathname,
        search: url.search,
        hash: url.hash
      };
    },
    push,
    replace: replace2,
    go(n2) {
      return globalHistory.go(n2);
    }
  };
  return history2;
}
var ResultType;
(function(ResultType2) {
  ResultType2["data"] = "data";
  ResultType2["deferred"] = "deferred";
  ResultType2["redirect"] = "redirect";
  ResultType2["error"] = "error";
})(ResultType || (ResultType = {}));
var immutableRouteKeys = /* @__PURE__ */ new Set(["lazy", "caseSensitive", "path", "id", "index", "children"]);
function isIndexRoute(route) {
  return route.index === true;
}
function convertRoutesToDataRoutes(routes, mapRouteProperties2, parentPath, manifest) {
  if (parentPath === void 0) {
    parentPath = [];
  }
  if (manifest === void 0) {
    manifest = {};
  }
  return routes.map((route, index) => {
    let treePath = [...parentPath, index];
    let id2 = typeof route.id === "string" ? route.id : treePath.join("-");
    invariant(route.index !== true || !route.children, "Cannot specify children on an index route");
    invariant(!manifest[id2], 'Found a route id collision on id "' + id2 + `".  Route id's must be globally unique within Data Router usages`);
    if (isIndexRoute(route)) {
      let indexRoute = _extends5({}, route, mapRouteProperties2(route), {
        id: id2
      });
      manifest[id2] = indexRoute;
      return indexRoute;
    } else {
      let pathOrLayoutRoute = _extends5({}, route, mapRouteProperties2(route), {
        id: id2,
        children: void 0
      });
      manifest[id2] = pathOrLayoutRoute;
      if (route.children) {
        pathOrLayoutRoute.children = convertRoutesToDataRoutes(route.children, mapRouteProperties2, treePath, manifest);
      }
      return pathOrLayoutRoute;
    }
  });
}
function matchRoutes(routes, locationArg, basename) {
  if (basename === void 0) {
    basename = "/";
  }
  let location2 = typeof locationArg === "string" ? parsePath(locationArg) : locationArg;
  let pathname = stripBasename(location2.pathname || "/", basename);
  if (pathname == null) {
    return null;
  }
  let branches = flattenRoutes(routes);
  rankRouteBranches(branches);
  let matches = null;
  for (let i2 = 0; matches == null && i2 < branches.length; ++i2) {
    matches = matchRouteBranch(
      branches[i2],
      // Incoming pathnames are generally encoded from either window.location
      // or from router.navigate, but we want to match against the unencoded
      // paths in the route definitions.  Memory router locations won't be
      // encoded here but there also shouldn't be anything to decode so this
      // should be a safe operation.  This avoids needing matchRoutes to be
      // history-aware.
      safelyDecodeURI(pathname)
    );
  }
  return matches;
}
function convertRouteMatchToUiMatch(match2, loaderData) {
  let {
    route,
    pathname,
    params
  } = match2;
  return {
    id: route.id,
    pathname,
    params,
    data: loaderData[route.id],
    handle: route.handle
  };
}
function flattenRoutes(routes, branches, parentsMeta, parentPath) {
  if (branches === void 0) {
    branches = [];
  }
  if (parentsMeta === void 0) {
    parentsMeta = [];
  }
  if (parentPath === void 0) {
    parentPath = "";
  }
  let flattenRoute = (route, index, relativePath) => {
    let meta2 = {
      relativePath: relativePath === void 0 ? route.path || "" : relativePath,
      caseSensitive: route.caseSensitive === true,
      childrenIndex: index,
      route
    };
    if (meta2.relativePath.startsWith("/")) {
      invariant(meta2.relativePath.startsWith(parentPath), 'Absolute route path "' + meta2.relativePath + '" nested under path ' + ('"' + parentPath + '" is not valid. An absolute child route path ') + "must start with the combined path of all its parent routes.");
      meta2.relativePath = meta2.relativePath.slice(parentPath.length);
    }
    let path2 = joinPaths([parentPath, meta2.relativePath]);
    let routesMeta = parentsMeta.concat(meta2);
    if (route.children && route.children.length > 0) {
      invariant(
        // Our types know better, but runtime JS may not!
        // @ts-expect-error
        route.index !== true,
        "Index routes must not have child routes. Please remove " + ('all child routes from route path "' + path2 + '".')
      );
      flattenRoutes(route.children, branches, routesMeta, path2);
    }
    if (route.path == null && !route.index) {
      return;
    }
    branches.push({
      path: path2,
      score: computeScore(path2, route.index),
      routesMeta
    });
  };
  routes.forEach((route, index) => {
    var _route$path;
    if (route.path === "" || !((_route$path = route.path) != null && _route$path.includes("?"))) {
      flattenRoute(route, index);
    } else {
      for (let exploded of explodeOptionalSegments(route.path)) {
        flattenRoute(route, index, exploded);
      }
    }
  });
  return branches;
}
function explodeOptionalSegments(path2) {
  let segments = path2.split("/");
  if (segments.length === 0)
    return [];
  let [first, ...rest] = segments;
  let isOptional = first.endsWith("?");
  let required = first.replace(/\?$/, "");
  if (rest.length === 0) {
    return isOptional ? [required, ""] : [required];
  }
  let restExploded = explodeOptionalSegments(rest.join("/"));
  let result = [];
  result.push(...restExploded.map((subpath) => subpath === "" ? required : [required, subpath].join("/")));
  if (isOptional) {
    result.push(...restExploded);
  }
  return result.map((exploded) => path2.startsWith("/") && exploded === "" ? "/" : exploded);
}
function rankRouteBranches(branches) {
  branches.sort((a2, b) => a2.score !== b.score ? b.score - a2.score : compareIndexes(a2.routesMeta.map((meta2) => meta2.childrenIndex), b.routesMeta.map((meta2) => meta2.childrenIndex)));
}
var paramRe = /^:\w+$/;
var dynamicSegmentValue = 3;
var indexRouteValue = 2;
var emptySegmentValue = 1;
var staticSegmentValue = 10;
var splatPenalty = -2;
var isSplat = (s2) => s2 === "*";
function computeScore(path2, index) {
  let segments = path2.split("/");
  let initialScore = segments.length;
  if (segments.some(isSplat)) {
    initialScore += splatPenalty;
  }
  if (index) {
    initialScore += indexRouteValue;
  }
  return segments.filter((s2) => !isSplat(s2)).reduce((score2, segment) => score2 + (paramRe.test(segment) ? dynamicSegmentValue : segment === "" ? emptySegmentValue : staticSegmentValue), initialScore);
}
function compareIndexes(a2, b) {
  let siblings = a2.length === b.length && a2.slice(0, -1).every((n2, i2) => n2 === b[i2]);
  return siblings ? (
    // If two routes are siblings, we should try to match the earlier sibling
    // first. This allows people to have fine-grained control over the matching
    // behavior by simply putting routes with identical paths in the order they
    // want them tried.
    a2[a2.length - 1] - b[b.length - 1]
  ) : (
    // Otherwise, it doesn't really make sense to rank non-siblings by index,
    // so they sort equally.
    0
  );
}
function matchRouteBranch(branch, pathname) {
  let {
    routesMeta
  } = branch;
  let matchedParams = {};
  let matchedPathname = "/";
  let matches = [];
  for (let i2 = 0; i2 < routesMeta.length; ++i2) {
    let meta2 = routesMeta[i2];
    let end = i2 === routesMeta.length - 1;
    let remainingPathname = matchedPathname === "/" ? pathname : pathname.slice(matchedPathname.length) || "/";
    let match2 = matchPath({
      path: meta2.relativePath,
      caseSensitive: meta2.caseSensitive,
      end
    }, remainingPathname);
    if (!match2)
      return null;
    Object.assign(matchedParams, match2.params);
    let route = meta2.route;
    matches.push({
      // TODO: Can this as be avoided?
      params: matchedParams,
      pathname: joinPaths([matchedPathname, match2.pathname]),
      pathnameBase: normalizePathname(joinPaths([matchedPathname, match2.pathnameBase])),
      route
    });
    if (match2.pathnameBase !== "/") {
      matchedPathname = joinPaths([matchedPathname, match2.pathnameBase]);
    }
  }
  return matches;
}
function matchPath(pattern, pathname) {
  if (typeof pattern === "string") {
    pattern = {
      path: pattern,
      caseSensitive: false,
      end: true
    };
  }
  let [matcher, compiledParams] = compilePath(pattern.path, pattern.caseSensitive, pattern.end);
  let match2 = pathname.match(matcher);
  if (!match2)
    return null;
  let matchedPathname = match2[0];
  let pathnameBase = matchedPathname.replace(/(.)\/+$/, "$1");
  let captureGroups = match2.slice(1);
  let params = compiledParams.reduce((memo2, _ref18, index) => {
    let {
      paramName,
      isOptional
    } = _ref18;
    if (paramName === "*") {
      let splatValue = captureGroups[index] || "";
      pathnameBase = matchedPathname.slice(0, matchedPathname.length - splatValue.length).replace(/(.)\/+$/, "$1");
    }
    const value = captureGroups[index];
    if (isOptional && !value) {
      memo2[paramName] = void 0;
    } else {
      memo2[paramName] = safelyDecodeURIComponent(value || "", paramName);
    }
    return memo2;
  }, {});
  return {
    params,
    pathname: matchedPathname,
    pathnameBase,
    pattern
  };
}
function compilePath(path2, caseSensitive, end) {
  if (caseSensitive === void 0) {
    caseSensitive = false;
  }
  if (end === void 0) {
    end = true;
  }
  warning(path2 === "*" || !path2.endsWith("*") || path2.endsWith("/*"), 'Route path "' + path2 + '" will be treated as if it were ' + ('"' + path2.replace(/\*$/, "/*") + '" because the `*` character must ') + "always follow a `/` in the pattern. To get rid of this warning, " + ('please change the route path to "' + path2.replace(/\*$/, "/*") + '".'));
  let params = [];
  let regexpSource = "^" + path2.replace(/\/*\*?$/, "").replace(/^\/*/, "/").replace(/[\\.*+^${}|()[\]]/g, "\\$&").replace(/\/:(\w+)(\?)?/g, (_, paramName, isOptional) => {
    params.push({
      paramName,
      isOptional: isOptional != null
    });
    return isOptional ? "/?([^\\/]+)?" : "/([^\\/]+)";
  });
  if (path2.endsWith("*")) {
    params.push({
      paramName: "*"
    });
    regexpSource += path2 === "*" || path2 === "/*" ? "(.*)$" : "(?:\\/(.+)|\\/*)$";
  } else if (end) {
    regexpSource += "\\/*$";
  } else if (path2 !== "" && path2 !== "/") {
    regexpSource += "(?:(?=\\/|$))";
  } else
    ;
  let matcher = new RegExp(regexpSource, caseSensitive ? void 0 : "i");
  return [matcher, params];
}
function safelyDecodeURI(value) {
  try {
    return decodeURI(value);
  } catch (error) {
    warning(false, 'The URL path "' + value + '" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent ' + ("encoding (" + error + ")."));
    return value;
  }
}
function safelyDecodeURIComponent(value, paramName) {
  try {
    return decodeURIComponent(value);
  } catch (error) {
    warning(false, 'The value for the URL param "' + paramName + '" will not be decoded because' + (' the string "' + value + '" is a malformed URL segment. This is probably') + (" due to a bad percent encoding (" + error + ")."));
    return value;
  }
}
function stripBasename(pathname, basename) {
  if (basename === "/")
    return pathname;
  if (!pathname.toLowerCase().startsWith(basename.toLowerCase())) {
    return null;
  }
  let startIndex = basename.endsWith("/") ? basename.length - 1 : basename.length;
  let nextChar2 = pathname.charAt(startIndex);
  if (nextChar2 && nextChar2 !== "/") {
    return null;
  }
  return pathname.slice(startIndex) || "/";
}
function resolvePath(to, fromPathname) {
  if (fromPathname === void 0) {
    fromPathname = "/";
  }
  let {
    pathname: toPathname,
    search = "",
    hash: hash3 = ""
  } = typeof to === "string" ? parsePath(to) : to;
  let pathname = toPathname ? toPathname.startsWith("/") ? toPathname : resolvePathname(toPathname, fromPathname) : fromPathname;
  return {
    pathname,
    search: normalizeSearch(search),
    hash: normalizeHash(hash3)
  };
}
function resolvePathname(relativePath, fromPathname) {
  let segments = fromPathname.replace(/\/+$/, "").split("/");
  let relativeSegments = relativePath.split("/");
  relativeSegments.forEach((segment) => {
    if (segment === "..") {
      if (segments.length > 1)
        segments.pop();
    } else if (segment !== ".") {
      segments.push(segment);
    }
  });
  return segments.length > 1 ? segments.join("/") : "/";
}
function getInvalidPathError(char2, field, dest, path2) {
  return "Cannot include a '" + char2 + "' character in a manually specified " + ("`to." + field + "` field [" + JSON.stringify(path2) + "].  Please separate it out to the ") + ("`to." + dest + "` field. Alternatively you may provide the full path as ") + 'a string in <Link to="..."> and the router will parse it for you.';
}
function getPathContributingMatches(matches) {
  return matches.filter((match2, index) => index === 0 || match2.route.path && match2.route.path.length > 0);
}
function resolveTo(toArg, routePathnames, locationPathname, isPathRelative) {
  if (isPathRelative === void 0) {
    isPathRelative = false;
  }
  let to;
  if (typeof toArg === "string") {
    to = parsePath(toArg);
  } else {
    to = _extends5({}, toArg);
    invariant(!to.pathname || !to.pathname.includes("?"), getInvalidPathError("?", "pathname", "search", to));
    invariant(!to.pathname || !to.pathname.includes("#"), getInvalidPathError("#", "pathname", "hash", to));
    invariant(!to.search || !to.search.includes("#"), getInvalidPathError("#", "search", "hash", to));
  }
  let isEmptyPath = toArg === "" || to.pathname === "";
  let toPathname = isEmptyPath ? "/" : to.pathname;
  let from2;
  if (isPathRelative || toPathname == null) {
    from2 = locationPathname;
  } else {
    let routePathnameIndex = routePathnames.length - 1;
    if (toPathname.startsWith("..")) {
      let toSegments = toPathname.split("/");
      while (toSegments[0] === "..") {
        toSegments.shift();
        routePathnameIndex -= 1;
      }
      to.pathname = toSegments.join("/");
    }
    from2 = routePathnameIndex >= 0 ? routePathnames[routePathnameIndex] : "/";
  }
  let path2 = resolvePath(to, from2);
  let hasExplicitTrailingSlash = toPathname && toPathname !== "/" && toPathname.endsWith("/");
  let hasCurrentTrailingSlash = (isEmptyPath || toPathname === ".") && locationPathname.endsWith("/");
  if (!path2.pathname.endsWith("/") && (hasExplicitTrailingSlash || hasCurrentTrailingSlash)) {
    path2.pathname += "/";
  }
  return path2;
}
var joinPaths = (paths) => paths.join("/").replace(/\/\/+/g, "/");
var normalizePathname = (pathname) => pathname.replace(/\/+$/, "").replace(/^\/*/, "/");
var normalizeSearch = (search) => !search || search === "?" ? "" : search.startsWith("?") ? search : "?" + search;
var normalizeHash = (hash3) => !hash3 || hash3 === "#" ? "" : hash3.startsWith("#") ? hash3 : "#" + hash3;
var redirect = function redirect2(url, init) {
  if (init === void 0) {
    init = 302;
  }
  let responseInit = init;
  if (typeof responseInit === "number") {
    responseInit = {
      status: responseInit
    };
  } else if (typeof responseInit.status === "undefined") {
    responseInit.status = 302;
  }
  let headers = new Headers(responseInit.headers);
  headers.set("Location", url);
  return new Response(null, _extends5({}, responseInit, {
    headers
  }));
};
var ErrorResponseImpl = class {
  constructor(status, statusText, data, internal) {
    if (internal === void 0) {
      internal = false;
    }
    this.status = status;
    this.statusText = statusText || "";
    this.internal = internal;
    if (data instanceof Error) {
      this.data = data.toString();
      this.error = data;
    } else {
      this.data = data;
    }
  }
};
function isRouteErrorResponse(error) {
  return error != null && typeof error.status === "number" && typeof error.statusText === "string" && typeof error.internal === "boolean" && "data" in error;
}
var validMutationMethodsArr = ["post", "put", "patch", "delete"];
var validMutationMethods = new Set(validMutationMethodsArr);
var validRequestMethodsArr = ["get", ...validMutationMethodsArr];
var validRequestMethods = new Set(validRequestMethodsArr);
var redirectStatusCodes = /* @__PURE__ */ new Set([301, 302, 303, 307, 308]);
var redirectPreserveMethodStatusCodes = /* @__PURE__ */ new Set([307, 308]);
var IDLE_NAVIGATION = {
  state: "idle",
  location: void 0,
  formMethod: void 0,
  formAction: void 0,
  formEncType: void 0,
  formData: void 0,
  json: void 0,
  text: void 0
};
var IDLE_FETCHER = {
  state: "idle",
  data: void 0,
  formMethod: void 0,
  formAction: void 0,
  formEncType: void 0,
  formData: void 0,
  json: void 0,
  text: void 0
};
var IDLE_BLOCKER = {
  state: "unblocked",
  proceed: void 0,
  reset: void 0,
  location: void 0
};
var ABSOLUTE_URL_REGEX = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;
var defaultMapRouteProperties = (route) => ({
  hasErrorBoundary: Boolean(route.hasErrorBoundary)
});
var TRANSITIONS_STORAGE_KEY = "remix-router-transitions";
function createRouter(init) {
  const routerWindow = init.window ? init.window : typeof window !== "undefined" ? window : void 0;
  const isBrowser4 = typeof routerWindow !== "undefined" && typeof routerWindow.document !== "undefined" && typeof routerWindow.document.createElement !== "undefined";
  const isServer = !isBrowser4;
  invariant(init.routes.length > 0, "You must provide a non-empty routes array to createRouter");
  let mapRouteProperties2;
  if (init.mapRouteProperties) {
    mapRouteProperties2 = init.mapRouteProperties;
  } else if (init.detectErrorBoundary) {
    let detectErrorBoundary = init.detectErrorBoundary;
    mapRouteProperties2 = (route) => ({
      hasErrorBoundary: detectErrorBoundary(route)
    });
  } else {
    mapRouteProperties2 = defaultMapRouteProperties;
  }
  let manifest = {};
  let dataRoutes = convertRoutesToDataRoutes(init.routes, mapRouteProperties2, void 0, manifest);
  let inFlightDataRoutes;
  let basename = init.basename || "/";
  let future = _extends5({
    v7_fetcherPersist: false,
    v7_normalizeFormMethod: false,
    v7_prependBasename: false
  }, init.future);
  let unlistenHistory = null;
  let subscribers2 = /* @__PURE__ */ new Set();
  let savedScrollPositions2 = null;
  let getScrollRestorationKey = null;
  let getScrollPosition = null;
  let initialScrollRestored = init.hydrationData != null;
  let initialMatches = matchRoutes(dataRoutes, init.history.location, basename);
  let initialErrors = null;
  if (initialMatches == null) {
    let error = getInternalRouterError(404, {
      pathname: init.history.location.pathname
    });
    let {
      matches,
      route
    } = getShortCircuitMatches(dataRoutes);
    initialMatches = matches;
    initialErrors = {
      [route.id]: error
    };
  }
  let initialized = (
    // All initialMatches need to be loaded before we're ready.  If we have lazy
    // functions around still then we'll need to run them in initialize()
    !initialMatches.some((m) => m.route.lazy) && // And we have to either have no loaders or have been provided hydrationData
    (!initialMatches.some((m) => m.route.loader) || init.hydrationData != null)
  );
  let router2;
  let state = {
    historyAction: init.history.action,
    location: init.history.location,
    matches: initialMatches,
    initialized,
    navigation: IDLE_NAVIGATION,
    // Don't restore on initial updateState() if we were SSR'd
    restoreScrollPosition: init.hydrationData != null ? false : null,
    preventScrollReset: false,
    revalidation: "idle",
    loaderData: init.hydrationData && init.hydrationData.loaderData || {},
    actionData: init.hydrationData && init.hydrationData.actionData || null,
    errors: init.hydrationData && init.hydrationData.errors || initialErrors,
    fetchers: /* @__PURE__ */ new Map(),
    blockers: /* @__PURE__ */ new Map()
  };
  let pendingAction = Action.Pop;
  let pendingPreventScrollReset = false;
  let pendingNavigationController;
  let pendingViewTransitionEnabled = false;
  let appliedViewTransitions = /* @__PURE__ */ new Map();
  let removePageHideEventListener = null;
  let isUninterruptedRevalidation = false;
  let isRevalidationRequired = false;
  let cancelledDeferredRoutes = [];
  let cancelledFetcherLoads = [];
  let fetchControllers = /* @__PURE__ */ new Map();
  let incrementingLoadId = 0;
  let pendingNavigationLoadId = -1;
  let fetchReloadIds = /* @__PURE__ */ new Map();
  let fetchRedirectIds = /* @__PURE__ */ new Set();
  let fetchLoadMatches = /* @__PURE__ */ new Map();
  let activeFetchers = /* @__PURE__ */ new Map();
  let deletedFetchers = /* @__PURE__ */ new Set();
  let activeDeferreds = /* @__PURE__ */ new Map();
  let blockerFunctions = /* @__PURE__ */ new Map();
  let ignoreNextHistoryUpdate = false;
  function initialize() {
    unlistenHistory = init.history.listen((_ref18) => {
      let {
        action: historyAction,
        location: location2,
        delta
      } = _ref18;
      if (ignoreNextHistoryUpdate) {
        ignoreNextHistoryUpdate = false;
        return;
      }
      warning(blockerFunctions.size === 0 || delta != null, "You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs.  This can also happen if you are using createHashRouter and the user manually changes the URL.");
      let blockerKey = shouldBlockNavigation({
        currentLocation: state.location,
        nextLocation: location2,
        historyAction
      });
      if (blockerKey && delta != null) {
        ignoreNextHistoryUpdate = true;
        init.history.go(delta * -1);
        updateBlocker(blockerKey, {
          state: "blocked",
          location: location2,
          proceed() {
            updateBlocker(blockerKey, {
              state: "proceeding",
              proceed: void 0,
              reset: void 0,
              location: location2
            });
            init.history.go(delta);
          },
          reset() {
            let blockers = new Map(state.blockers);
            blockers.set(blockerKey, IDLE_BLOCKER);
            updateState({
              blockers
            });
          }
        });
        return;
      }
      return startNavigation(historyAction, location2);
    });
    if (isBrowser4) {
      restoreAppliedTransitions(routerWindow, appliedViewTransitions);
      let _saveAppliedTransitions = () => persistAppliedTransitions(routerWindow, appliedViewTransitions);
      routerWindow.addEventListener("pagehide", _saveAppliedTransitions);
      removePageHideEventListener = () => routerWindow.removeEventListener("pagehide", _saveAppliedTransitions);
    }
    if (!state.initialized) {
      startNavigation(Action.Pop, state.location);
    }
    return router2;
  }
  function dispose2() {
    if (unlistenHistory) {
      unlistenHistory();
    }
    if (removePageHideEventListener) {
      removePageHideEventListener();
    }
    subscribers2.clear();
    pendingNavigationController && pendingNavigationController.abort();
    state.fetchers.forEach((_, key) => deleteFetcher(key));
    state.blockers.forEach((_, key) => deleteBlocker(key));
  }
  function subscribe(fn) {
    subscribers2.add(fn);
    return () => subscribers2.delete(fn);
  }
  function updateState(newState, viewTransitionOpts) {
    state = _extends5({}, state, newState);
    let completedFetchers = [];
    let deletedFetchersKeys = [];
    if (future.v7_fetcherPersist) {
      state.fetchers.forEach((fetcher, key) => {
        if (fetcher.state === "idle") {
          if (deletedFetchers.has(key)) {
            deletedFetchersKeys.push(key);
          } else {
            completedFetchers.push(key);
          }
        }
      });
    }
    subscribers2.forEach((subscriber) => subscriber(state, {
      deletedFetchers: deletedFetchersKeys,
      unstable_viewTransitionOpts: viewTransitionOpts
    }));
    if (future.v7_fetcherPersist) {
      completedFetchers.forEach((key) => state.fetchers.delete(key));
      deletedFetchersKeys.forEach((key) => deleteFetcher(key));
    }
  }
  function completeNavigation(location2, newState) {
    var _location$state, _location$state2;
    let isActionReload = state.actionData != null && state.navigation.formMethod != null && isMutationMethod(state.navigation.formMethod) && state.navigation.state === "loading" && ((_location$state = location2.state) == null ? void 0 : _location$state._isRedirect) !== true;
    let actionData;
    if (newState.actionData) {
      if (Object.keys(newState.actionData).length > 0) {
        actionData = newState.actionData;
      } else {
        actionData = null;
      }
    } else if (isActionReload) {
      actionData = state.actionData;
    } else {
      actionData = null;
    }
    let loaderData = newState.loaderData ? mergeLoaderData(state.loaderData, newState.loaderData, newState.matches || [], newState.errors) : state.loaderData;
    let blockers = state.blockers;
    if (blockers.size > 0) {
      blockers = new Map(blockers);
      blockers.forEach((_, k2) => blockers.set(k2, IDLE_BLOCKER));
    }
    let preventScrollReset = pendingPreventScrollReset === true || state.navigation.formMethod != null && isMutationMethod(state.navigation.formMethod) && ((_location$state2 = location2.state) == null ? void 0 : _location$state2._isRedirect) !== true;
    if (inFlightDataRoutes) {
      dataRoutes = inFlightDataRoutes;
      inFlightDataRoutes = void 0;
    }
    if (isUninterruptedRevalidation)
      ;
    else if (pendingAction === Action.Pop)
      ;
    else if (pendingAction === Action.Push) {
      init.history.push(location2, location2.state);
    } else if (pendingAction === Action.Replace) {
      init.history.replace(location2, location2.state);
    }
    let viewTransitionOpts;
    if (pendingAction === Action.Pop) {
      let priorPaths = appliedViewTransitions.get(state.location.pathname);
      if (priorPaths && priorPaths.has(location2.pathname)) {
        viewTransitionOpts = {
          currentLocation: state.location,
          nextLocation: location2
        };
      } else if (appliedViewTransitions.has(location2.pathname)) {
        viewTransitionOpts = {
          currentLocation: location2,
          nextLocation: state.location
        };
      }
    } else if (pendingViewTransitionEnabled) {
      let toPaths = appliedViewTransitions.get(state.location.pathname);
      if (toPaths) {
        toPaths.add(location2.pathname);
      } else {
        toPaths = /* @__PURE__ */ new Set([location2.pathname]);
        appliedViewTransitions.set(state.location.pathname, toPaths);
      }
      viewTransitionOpts = {
        currentLocation: state.location,
        nextLocation: location2
      };
    }
    updateState(_extends5({}, newState, {
      actionData,
      loaderData,
      historyAction: pendingAction,
      location: location2,
      initialized: true,
      navigation: IDLE_NAVIGATION,
      revalidation: "idle",
      restoreScrollPosition: getSavedScrollPosition(location2, newState.matches || state.matches),
      preventScrollReset,
      blockers
    }), viewTransitionOpts);
    pendingAction = Action.Pop;
    pendingPreventScrollReset = false;
    pendingViewTransitionEnabled = false;
    isUninterruptedRevalidation = false;
    isRevalidationRequired = false;
    cancelledDeferredRoutes = [];
    cancelledFetcherLoads = [];
  }
  async function navigate(to, opts) {
    if (typeof to === "number") {
      init.history.go(to);
      return;
    }
    let normalizedPath = normalizeTo(state.location, state.matches, basename, future.v7_prependBasename, to, opts == null ? void 0 : opts.fromRouteId, opts == null ? void 0 : opts.relative);
    let {
      path: path2,
      submission,
      error
    } = normalizeNavigateOptions(future.v7_normalizeFormMethod, false, normalizedPath, opts);
    let currentLocation = state.location;
    let nextLocation = createLocation(state.location, path2, opts && opts.state);
    nextLocation = _extends5({}, nextLocation, init.history.encodeLocation(nextLocation));
    let userReplace = opts && opts.replace != null ? opts.replace : void 0;
    let historyAction = Action.Push;
    if (userReplace === true) {
      historyAction = Action.Replace;
    } else if (userReplace === false)
      ;
    else if (submission != null && isMutationMethod(submission.formMethod) && submission.formAction === state.location.pathname + state.location.search) {
      historyAction = Action.Replace;
    }
    let preventScrollReset = opts && "preventScrollReset" in opts ? opts.preventScrollReset === true : void 0;
    let blockerKey = shouldBlockNavigation({
      currentLocation,
      nextLocation,
      historyAction
    });
    if (blockerKey) {
      updateBlocker(blockerKey, {
        state: "blocked",
        location: nextLocation,
        proceed() {
          updateBlocker(blockerKey, {
            state: "proceeding",
            proceed: void 0,
            reset: void 0,
            location: nextLocation
          });
          navigate(to, opts);
        },
        reset() {
          let blockers = new Map(state.blockers);
          blockers.set(blockerKey, IDLE_BLOCKER);
          updateState({
            blockers
          });
        }
      });
      return;
    }
    return await startNavigation(historyAction, nextLocation, {
      submission,
      // Send through the formData serialization error if we have one so we can
      // render at the right error boundary after we match routes
      pendingError: error,
      preventScrollReset,
      replace: opts && opts.replace,
      enableViewTransition: opts && opts.unstable_viewTransition
    });
  }
  function revalidate() {
    interruptActiveLoads();
    updateState({
      revalidation: "loading"
    });
    if (state.navigation.state === "submitting") {
      return;
    }
    if (state.navigation.state === "idle") {
      startNavigation(state.historyAction, state.location, {
        startUninterruptedRevalidation: true
      });
      return;
    }
    startNavigation(pendingAction || state.historyAction, state.navigation.location, {
      overrideNavigation: state.navigation
    });
  }
  async function startNavigation(historyAction, location2, opts) {
    pendingNavigationController && pendingNavigationController.abort();
    pendingNavigationController = null;
    pendingAction = historyAction;
    isUninterruptedRevalidation = (opts && opts.startUninterruptedRevalidation) === true;
    saveScrollPosition(state.location, state.matches);
    pendingPreventScrollReset = (opts && opts.preventScrollReset) === true;
    pendingViewTransitionEnabled = (opts && opts.enableViewTransition) === true;
    let routesToUse = inFlightDataRoutes || dataRoutes;
    let loadingNavigation = opts && opts.overrideNavigation;
    let matches = matchRoutes(routesToUse, location2, basename);
    if (!matches) {
      let error = getInternalRouterError(404, {
        pathname: location2.pathname
      });
      let {
        matches: notFoundMatches,
        route
      } = getShortCircuitMatches(routesToUse);
      cancelActiveDeferreds();
      completeNavigation(location2, {
        matches: notFoundMatches,
        loaderData: {},
        errors: {
          [route.id]: error
        }
      });
      return;
    }
    if (state.initialized && !isRevalidationRequired && isHashChangeOnly(state.location, location2) && !(opts && opts.submission && isMutationMethod(opts.submission.formMethod))) {
      completeNavigation(location2, {
        matches
      });
      return;
    }
    pendingNavigationController = new AbortController();
    let request = createClientSideRequest(init.history, location2, pendingNavigationController.signal, opts && opts.submission);
    let pendingActionData;
    let pendingError;
    if (opts && opts.pendingError) {
      pendingError = {
        [findNearestBoundary(matches).route.id]: opts.pendingError
      };
    } else if (opts && opts.submission && isMutationMethod(opts.submission.formMethod)) {
      let actionOutput = await handleAction(request, location2, opts.submission, matches, {
        replace: opts.replace
      });
      if (actionOutput.shortCircuited) {
        return;
      }
      pendingActionData = actionOutput.pendingActionData;
      pendingError = actionOutput.pendingActionError;
      loadingNavigation = getLoadingNavigation(location2, opts.submission);
      request = new Request(request.url, {
        signal: request.signal
      });
    }
    let {
      shortCircuited,
      loaderData,
      errors
    } = await handleLoaders(request, location2, matches, loadingNavigation, opts && opts.submission, opts && opts.fetcherSubmission, opts && opts.replace, pendingActionData, pendingError);
    if (shortCircuited) {
      return;
    }
    pendingNavigationController = null;
    completeNavigation(location2, _extends5({
      matches
    }, pendingActionData ? {
      actionData: pendingActionData
    } : {}, {
      loaderData,
      errors
    }));
  }
  async function handleAction(request, location2, submission, matches, opts) {
    if (opts === void 0) {
      opts = {};
    }
    interruptActiveLoads();
    let navigation = getSubmittingNavigation(location2, submission);
    updateState({
      navigation
    });
    let result;
    let actionMatch = getTargetMatch(matches, location2);
    if (!actionMatch.route.action && !actionMatch.route.lazy) {
      result = {
        type: ResultType.error,
        error: getInternalRouterError(405, {
          method: request.method,
          pathname: location2.pathname,
          routeId: actionMatch.route.id
        })
      };
    } else {
      result = await callLoaderOrAction("action", request, actionMatch, matches, manifest, mapRouteProperties2, basename);
      if (request.signal.aborted) {
        return {
          shortCircuited: true
        };
      }
    }
    if (isRedirectResult(result)) {
      let replace2;
      if (opts && opts.replace != null) {
        replace2 = opts.replace;
      } else {
        replace2 = result.location === state.location.pathname + state.location.search;
      }
      await startRedirectNavigation(state, result, {
        submission,
        replace: replace2
      });
      return {
        shortCircuited: true
      };
    }
    if (isErrorResult(result)) {
      let boundaryMatch = findNearestBoundary(matches, actionMatch.route.id);
      if ((opts && opts.replace) !== true) {
        pendingAction = Action.Push;
      }
      return {
        // Send back an empty object we can use to clear out any prior actionData
        pendingActionData: {},
        pendingActionError: {
          [boundaryMatch.route.id]: result.error
        }
      };
    }
    if (isDeferredResult(result)) {
      throw getInternalRouterError(400, {
        type: "defer-action"
      });
    }
    return {
      pendingActionData: {
        [actionMatch.route.id]: result.data
      }
    };
  }
  async function handleLoaders(request, location2, matches, overrideNavigation, submission, fetcherSubmission, replace2, pendingActionData, pendingError) {
    let loadingNavigation = overrideNavigation || getLoadingNavigation(location2, submission);
    let activeSubmission = submission || fetcherSubmission || getSubmissionFromNavigation(loadingNavigation);
    let routesToUse = inFlightDataRoutes || dataRoutes;
    let [matchesToLoad, revalidatingFetchers] = getMatchesToLoad(init.history, state, matches, activeSubmission, location2, isRevalidationRequired, cancelledDeferredRoutes, cancelledFetcherLoads, fetchLoadMatches, fetchRedirectIds, routesToUse, basename, pendingActionData, pendingError);
    cancelActiveDeferreds((routeId) => !(matches && matches.some((m) => m.route.id === routeId)) || matchesToLoad && matchesToLoad.some((m) => m.route.id === routeId));
    pendingNavigationLoadId = ++incrementingLoadId;
    if (matchesToLoad.length === 0 && revalidatingFetchers.length === 0) {
      let updatedFetchers2 = markFetchRedirectsDone();
      completeNavigation(location2, _extends5({
        matches,
        loaderData: {},
        // Commit pending error if we're short circuiting
        errors: pendingError || null
      }, pendingActionData ? {
        actionData: pendingActionData
      } : {}, updatedFetchers2 ? {
        fetchers: new Map(state.fetchers)
      } : {}));
      return {
        shortCircuited: true
      };
    }
    if (!isUninterruptedRevalidation) {
      revalidatingFetchers.forEach((rf) => {
        let fetcher = state.fetchers.get(rf.key);
        let revalidatingFetcher = getLoadingFetcher(void 0, fetcher ? fetcher.data : void 0);
        state.fetchers.set(rf.key, revalidatingFetcher);
      });
      let actionData = pendingActionData || state.actionData;
      updateState(_extends5({
        navigation: loadingNavigation
      }, actionData ? Object.keys(actionData).length === 0 ? {
        actionData: null
      } : {
        actionData
      } : {}, revalidatingFetchers.length > 0 ? {
        fetchers: new Map(state.fetchers)
      } : {}));
    }
    revalidatingFetchers.forEach((rf) => {
      if (fetchControllers.has(rf.key)) {
        abortFetcher(rf.key);
      }
      if (rf.controller) {
        fetchControllers.set(rf.key, rf.controller);
      }
    });
    let abortPendingFetchRevalidations = () => revalidatingFetchers.forEach((f) => abortFetcher(f.key));
    if (pendingNavigationController) {
      pendingNavigationController.signal.addEventListener("abort", abortPendingFetchRevalidations);
    }
    let {
      results,
      loaderResults,
      fetcherResults
    } = await callLoadersAndMaybeResolveData(state.matches, matches, matchesToLoad, revalidatingFetchers, request);
    if (request.signal.aborted) {
      return {
        shortCircuited: true
      };
    }
    if (pendingNavigationController) {
      pendingNavigationController.signal.removeEventListener("abort", abortPendingFetchRevalidations);
    }
    revalidatingFetchers.forEach((rf) => fetchControllers.delete(rf.key));
    let redirect3 = findRedirect(results);
    if (redirect3) {
      if (redirect3.idx >= matchesToLoad.length) {
        let fetcherKey = revalidatingFetchers[redirect3.idx - matchesToLoad.length].key;
        fetchRedirectIds.add(fetcherKey);
      }
      await startRedirectNavigation(state, redirect3.result, {
        replace: replace2
      });
      return {
        shortCircuited: true
      };
    }
    let {
      loaderData,
      errors
    } = processLoaderData(state, matches, matchesToLoad, loaderResults, pendingError, revalidatingFetchers, fetcherResults, activeDeferreds);
    activeDeferreds.forEach((deferredData, routeId) => {
      deferredData.subscribe((aborted) => {
        if (aborted || deferredData.done) {
          activeDeferreds.delete(routeId);
        }
      });
    });
    let updatedFetchers = markFetchRedirectsDone();
    let didAbortFetchLoads = abortStaleFetchLoads(pendingNavigationLoadId);
    let shouldUpdateFetchers = updatedFetchers || didAbortFetchLoads || revalidatingFetchers.length > 0;
    return _extends5({
      loaderData,
      errors
    }, shouldUpdateFetchers ? {
      fetchers: new Map(state.fetchers)
    } : {});
  }
  function getFetcher(key) {
    if (future.v7_fetcherPersist) {
      activeFetchers.set(key, (activeFetchers.get(key) || 0) + 1);
      if (deletedFetchers.has(key)) {
        deletedFetchers.delete(key);
      }
    }
    return state.fetchers.get(key) || IDLE_FETCHER;
  }
  function fetch2(key, routeId, href, opts) {
    if (isServer) {
      throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");
    }
    if (fetchControllers.has(key))
      abortFetcher(key);
    let routesToUse = inFlightDataRoutes || dataRoutes;
    let normalizedPath = normalizeTo(state.location, state.matches, basename, future.v7_prependBasename, href, routeId, opts == null ? void 0 : opts.relative);
    let matches = matchRoutes(routesToUse, normalizedPath, basename);
    if (!matches) {
      setFetcherError(key, routeId, getInternalRouterError(404, {
        pathname: normalizedPath
      }));
      return;
    }
    let {
      path: path2,
      submission,
      error
    } = normalizeNavigateOptions(future.v7_normalizeFormMethod, true, normalizedPath, opts);
    if (error) {
      setFetcherError(key, routeId, error);
      return;
    }
    let match2 = getTargetMatch(matches, path2);
    pendingPreventScrollReset = (opts && opts.preventScrollReset) === true;
    if (submission && isMutationMethod(submission.formMethod)) {
      handleFetcherAction(key, routeId, path2, match2, matches, submission);
      return;
    }
    fetchLoadMatches.set(key, {
      routeId,
      path: path2
    });
    handleFetcherLoader(key, routeId, path2, match2, matches, submission);
  }
  async function handleFetcherAction(key, routeId, path2, match2, requestMatches, submission) {
    interruptActiveLoads();
    fetchLoadMatches.delete(key);
    if (!match2.route.action && !match2.route.lazy) {
      let error = getInternalRouterError(405, {
        method: submission.formMethod,
        pathname: path2,
        routeId
      });
      setFetcherError(key, routeId, error);
      return;
    }
    let existingFetcher = state.fetchers.get(key);
    let fetcher = getSubmittingFetcher(submission, existingFetcher);
    state.fetchers.set(key, fetcher);
    updateState({
      fetchers: new Map(state.fetchers)
    });
    let abortController = new AbortController();
    let fetchRequest = createClientSideRequest(init.history, path2, abortController.signal, submission);
    fetchControllers.set(key, abortController);
    let originatingLoadId = incrementingLoadId;
    let actionResult = await callLoaderOrAction("action", fetchRequest, match2, requestMatches, manifest, mapRouteProperties2, basename);
    if (fetchRequest.signal.aborted) {
      if (fetchControllers.get(key) === abortController) {
        fetchControllers.delete(key);
      }
      return;
    }
    if (deletedFetchers.has(key)) {
      state.fetchers.set(key, getDoneFetcher(void 0));
      updateState({
        fetchers: new Map(state.fetchers)
      });
      return;
    }
    if (isRedirectResult(actionResult)) {
      fetchControllers.delete(key);
      if (pendingNavigationLoadId > originatingLoadId) {
        let doneFetcher = getDoneFetcher(void 0);
        state.fetchers.set(key, doneFetcher);
        updateState({
          fetchers: new Map(state.fetchers)
        });
        return;
      } else {
        fetchRedirectIds.add(key);
        let loadingFetcher = getLoadingFetcher(submission);
        state.fetchers.set(key, loadingFetcher);
        updateState({
          fetchers: new Map(state.fetchers)
        });
        return startRedirectNavigation(state, actionResult, {
          fetcherSubmission: submission
        });
      }
    }
    if (isErrorResult(actionResult)) {
      setFetcherError(key, routeId, actionResult.error);
      return;
    }
    if (isDeferredResult(actionResult)) {
      throw getInternalRouterError(400, {
        type: "defer-action"
      });
    }
    let nextLocation = state.navigation.location || state.location;
    let revalidationRequest = createClientSideRequest(init.history, nextLocation, abortController.signal);
    let routesToUse = inFlightDataRoutes || dataRoutes;
    let matches = state.navigation.state !== "idle" ? matchRoutes(routesToUse, state.navigation.location, basename) : state.matches;
    invariant(matches, "Didn't find any matches after fetcher action");
    let loadId = ++incrementingLoadId;
    fetchReloadIds.set(key, loadId);
    let loadFetcher = getLoadingFetcher(submission, actionResult.data);
    state.fetchers.set(key, loadFetcher);
    let [matchesToLoad, revalidatingFetchers] = getMatchesToLoad(
      init.history,
      state,
      matches,
      submission,
      nextLocation,
      isRevalidationRequired,
      cancelledDeferredRoutes,
      cancelledFetcherLoads,
      fetchLoadMatches,
      fetchRedirectIds,
      routesToUse,
      basename,
      {
        [match2.route.id]: actionResult.data
      },
      void 0
      // No need to send through errors since we short circuit above
    );
    revalidatingFetchers.filter((rf) => rf.key !== key).forEach((rf) => {
      let staleKey = rf.key;
      let existingFetcher2 = state.fetchers.get(staleKey);
      let revalidatingFetcher = getLoadingFetcher(void 0, existingFetcher2 ? existingFetcher2.data : void 0);
      state.fetchers.set(staleKey, revalidatingFetcher);
      if (fetchControllers.has(staleKey)) {
        abortFetcher(staleKey);
      }
      if (rf.controller) {
        fetchControllers.set(staleKey, rf.controller);
      }
    });
    updateState({
      fetchers: new Map(state.fetchers)
    });
    let abortPendingFetchRevalidations = () => revalidatingFetchers.forEach((rf) => abortFetcher(rf.key));
    abortController.signal.addEventListener("abort", abortPendingFetchRevalidations);
    let {
      results,
      loaderResults,
      fetcherResults
    } = await callLoadersAndMaybeResolveData(state.matches, matches, matchesToLoad, revalidatingFetchers, revalidationRequest);
    if (abortController.signal.aborted) {
      return;
    }
    abortController.signal.removeEventListener("abort", abortPendingFetchRevalidations);
    fetchReloadIds.delete(key);
    fetchControllers.delete(key);
    revalidatingFetchers.forEach((r3) => fetchControllers.delete(r3.key));
    let redirect3 = findRedirect(results);
    if (redirect3) {
      if (redirect3.idx >= matchesToLoad.length) {
        let fetcherKey = revalidatingFetchers[redirect3.idx - matchesToLoad.length].key;
        fetchRedirectIds.add(fetcherKey);
      }
      return startRedirectNavigation(state, redirect3.result);
    }
    let {
      loaderData,
      errors
    } = processLoaderData(state, state.matches, matchesToLoad, loaderResults, void 0, revalidatingFetchers, fetcherResults, activeDeferreds);
    if (state.fetchers.has(key)) {
      let doneFetcher = getDoneFetcher(actionResult.data);
      state.fetchers.set(key, doneFetcher);
    }
    abortStaleFetchLoads(loadId);
    if (state.navigation.state === "loading" && loadId > pendingNavigationLoadId) {
      invariant(pendingAction, "Expected pending action");
      pendingNavigationController && pendingNavigationController.abort();
      completeNavigation(state.navigation.location, {
        matches,
        loaderData,
        errors,
        fetchers: new Map(state.fetchers)
      });
    } else {
      updateState({
        errors,
        loaderData: mergeLoaderData(state.loaderData, loaderData, matches, errors),
        fetchers: new Map(state.fetchers)
      });
      isRevalidationRequired = false;
    }
  }
  async function handleFetcherLoader(key, routeId, path2, match2, matches, submission) {
    let existingFetcher = state.fetchers.get(key);
    let loadingFetcher = getLoadingFetcher(submission, existingFetcher ? existingFetcher.data : void 0);
    state.fetchers.set(key, loadingFetcher);
    updateState({
      fetchers: new Map(state.fetchers)
    });
    let abortController = new AbortController();
    let fetchRequest = createClientSideRequest(init.history, path2, abortController.signal);
    fetchControllers.set(key, abortController);
    let originatingLoadId = incrementingLoadId;
    let result = await callLoaderOrAction("loader", fetchRequest, match2, matches, manifest, mapRouteProperties2, basename);
    if (isDeferredResult(result)) {
      result = await resolveDeferredData(result, fetchRequest.signal, true) || result;
    }
    if (fetchControllers.get(key) === abortController) {
      fetchControllers.delete(key);
    }
    if (fetchRequest.signal.aborted) {
      return;
    }
    if (deletedFetchers.has(key)) {
      state.fetchers.set(key, getDoneFetcher(void 0));
      updateState({
        fetchers: new Map(state.fetchers)
      });
      return;
    }
    if (isRedirectResult(result)) {
      if (pendingNavigationLoadId > originatingLoadId) {
        let doneFetcher2 = getDoneFetcher(void 0);
        state.fetchers.set(key, doneFetcher2);
        updateState({
          fetchers: new Map(state.fetchers)
        });
        return;
      } else {
        fetchRedirectIds.add(key);
        await startRedirectNavigation(state, result);
        return;
      }
    }
    if (isErrorResult(result)) {
      setFetcherError(key, routeId, result.error);
      return;
    }
    invariant(!isDeferredResult(result), "Unhandled fetcher deferred data");
    let doneFetcher = getDoneFetcher(result.data);
    state.fetchers.set(key, doneFetcher);
    updateState({
      fetchers: new Map(state.fetchers)
    });
  }
  async function startRedirectNavigation(state2, redirect3, _temp) {
    let {
      submission,
      fetcherSubmission,
      replace: replace2
    } = _temp === void 0 ? {} : _temp;
    if (redirect3.revalidate) {
      isRevalidationRequired = true;
    }
    let redirectLocation = createLocation(state2.location, redirect3.location, {
      _isRedirect: true
    });
    invariant(redirectLocation, "Expected a location on the redirect navigation");
    if (isBrowser4) {
      let isDocumentReload = false;
      if (redirect3.reloadDocument) {
        isDocumentReload = true;
      } else if (ABSOLUTE_URL_REGEX.test(redirect3.location)) {
        const url = init.history.createURL(redirect3.location);
        isDocumentReload = // Hard reload if it's an absolute URL to a new origin
        url.origin !== routerWindow.location.origin || // Hard reload if it's an absolute URL that does not match our basename
        stripBasename(url.pathname, basename) == null;
      }
      if (isDocumentReload) {
        if (replace2) {
          routerWindow.location.replace(redirect3.location);
        } else {
          routerWindow.location.assign(redirect3.location);
        }
        return;
      }
    }
    pendingNavigationController = null;
    let redirectHistoryAction = replace2 === true ? Action.Replace : Action.Push;
    let {
      formMethod,
      formAction,
      formEncType
    } = state2.navigation;
    if (!submission && !fetcherSubmission && formMethod && formAction && formEncType) {
      submission = getSubmissionFromNavigation(state2.navigation);
    }
    let activeSubmission = submission || fetcherSubmission;
    if (redirectPreserveMethodStatusCodes.has(redirect3.status) && activeSubmission && isMutationMethod(activeSubmission.formMethod)) {
      await startNavigation(redirectHistoryAction, redirectLocation, {
        submission: _extends5({}, activeSubmission, {
          formAction: redirect3.location
        }),
        // Preserve this flag across redirects
        preventScrollReset: pendingPreventScrollReset
      });
    } else {
      let overrideNavigation = getLoadingNavigation(redirectLocation, submission);
      await startNavigation(redirectHistoryAction, redirectLocation, {
        overrideNavigation,
        // Send fetcher submissions through for shouldRevalidate
        fetcherSubmission,
        // Preserve this flag across redirects
        preventScrollReset: pendingPreventScrollReset
      });
    }
  }
  async function callLoadersAndMaybeResolveData(currentMatches, matches, matchesToLoad, fetchersToLoad, request) {
    let results = await Promise.all([...matchesToLoad.map((match2) => callLoaderOrAction("loader", request, match2, matches, manifest, mapRouteProperties2, basename)), ...fetchersToLoad.map((f) => {
      if (f.matches && f.match && f.controller) {
        return callLoaderOrAction("loader", createClientSideRequest(init.history, f.path, f.controller.signal), f.match, f.matches, manifest, mapRouteProperties2, basename);
      } else {
        let error = {
          type: ResultType.error,
          error: getInternalRouterError(404, {
            pathname: f.path
          })
        };
        return error;
      }
    })]);
    let loaderResults = results.slice(0, matchesToLoad.length);
    let fetcherResults = results.slice(matchesToLoad.length);
    await Promise.all([resolveDeferredResults(currentMatches, matchesToLoad, loaderResults, loaderResults.map(() => request.signal), false, state.loaderData), resolveDeferredResults(currentMatches, fetchersToLoad.map((f) => f.match), fetcherResults, fetchersToLoad.map((f) => f.controller ? f.controller.signal : null), true)]);
    return {
      results,
      loaderResults,
      fetcherResults
    };
  }
  function interruptActiveLoads() {
    isRevalidationRequired = true;
    cancelledDeferredRoutes.push(...cancelActiveDeferreds());
    fetchLoadMatches.forEach((_, key) => {
      if (fetchControllers.has(key)) {
        cancelledFetcherLoads.push(key);
        abortFetcher(key);
      }
    });
  }
  function setFetcherError(key, routeId, error) {
    let boundaryMatch = findNearestBoundary(state.matches, routeId);
    deleteFetcher(key);
    updateState({
      errors: {
        [boundaryMatch.route.id]: error
      },
      fetchers: new Map(state.fetchers)
    });
  }
  function deleteFetcher(key) {
    let fetcher = state.fetchers.get(key);
    if (fetchControllers.has(key) && !(fetcher && fetcher.state === "loading" && fetchReloadIds.has(key))) {
      abortFetcher(key);
    }
    fetchLoadMatches.delete(key);
    fetchReloadIds.delete(key);
    fetchRedirectIds.delete(key);
    deletedFetchers.delete(key);
    state.fetchers.delete(key);
  }
  function deleteFetcherAndUpdateState(key) {
    if (future.v7_fetcherPersist) {
      let count2 = (activeFetchers.get(key) || 0) - 1;
      if (count2 <= 0) {
        activeFetchers.delete(key);
        deletedFetchers.add(key);
      } else {
        activeFetchers.set(key, count2);
      }
    } else {
      deleteFetcher(key);
    }
    updateState({
      fetchers: new Map(state.fetchers)
    });
  }
  function abortFetcher(key) {
    let controller = fetchControllers.get(key);
    invariant(controller, "Expected fetch controller: " + key);
    controller.abort();
    fetchControllers.delete(key);
  }
  function markFetchersDone(keys4) {
    for (let key of keys4) {
      let fetcher = getFetcher(key);
      let doneFetcher = getDoneFetcher(fetcher.data);
      state.fetchers.set(key, doneFetcher);
    }
  }
  function markFetchRedirectsDone() {
    let doneKeys = [];
    let updatedFetchers = false;
    for (let key of fetchRedirectIds) {
      let fetcher = state.fetchers.get(key);
      invariant(fetcher, "Expected fetcher: " + key);
      if (fetcher.state === "loading") {
        fetchRedirectIds.delete(key);
        doneKeys.push(key);
        updatedFetchers = true;
      }
    }
    markFetchersDone(doneKeys);
    return updatedFetchers;
  }
  function abortStaleFetchLoads(landedId) {
    let yeetedKeys = [];
    for (let [key, id2] of fetchReloadIds) {
      if (id2 < landedId) {
        let fetcher = state.fetchers.get(key);
        invariant(fetcher, "Expected fetcher: " + key);
        if (fetcher.state === "loading") {
          abortFetcher(key);
          fetchReloadIds.delete(key);
          yeetedKeys.push(key);
        }
      }
    }
    markFetchersDone(yeetedKeys);
    return yeetedKeys.length > 0;
  }
  function getBlocker(key, fn) {
    let blocker = state.blockers.get(key) || IDLE_BLOCKER;
    if (blockerFunctions.get(key) !== fn) {
      blockerFunctions.set(key, fn);
    }
    return blocker;
  }
  function deleteBlocker(key) {
    state.blockers.delete(key);
    blockerFunctions.delete(key);
  }
  function updateBlocker(key, newBlocker) {
    let blocker = state.blockers.get(key) || IDLE_BLOCKER;
    invariant(blocker.state === "unblocked" && newBlocker.state === "blocked" || blocker.state === "blocked" && newBlocker.state === "blocked" || blocker.state === "blocked" && newBlocker.state === "proceeding" || blocker.state === "blocked" && newBlocker.state === "unblocked" || blocker.state === "proceeding" && newBlocker.state === "unblocked", "Invalid blocker state transition: " + blocker.state + " -> " + newBlocker.state);
    let blockers = new Map(state.blockers);
    blockers.set(key, newBlocker);
    updateState({
      blockers
    });
  }
  function shouldBlockNavigation(_ref22) {
    let {
      currentLocation,
      nextLocation,
      historyAction
    } = _ref22;
    if (blockerFunctions.size === 0) {
      return;
    }
    if (blockerFunctions.size > 1) {
      warning(false, "A router only supports one blocker at a time");
    }
    let entries = Array.from(blockerFunctions.entries());
    let [blockerKey, blockerFunction] = entries[entries.length - 1];
    let blocker = state.blockers.get(blockerKey);
    if (blocker && blocker.state === "proceeding") {
      return;
    }
    if (blockerFunction({
      currentLocation,
      nextLocation,
      historyAction
    })) {
      return blockerKey;
    }
  }
  function cancelActiveDeferreds(predicate) {
    let cancelledRouteIds = [];
    activeDeferreds.forEach((dfd, routeId) => {
      if (!predicate || predicate(routeId)) {
        dfd.cancel();
        cancelledRouteIds.push(routeId);
        activeDeferreds.delete(routeId);
      }
    });
    return cancelledRouteIds;
  }
  function enableScrollRestoration(positions, getPosition, getKey) {
    savedScrollPositions2 = positions;
    getScrollPosition = getPosition;
    getScrollRestorationKey = getKey || null;
    if (!initialScrollRestored && state.navigation === IDLE_NAVIGATION) {
      initialScrollRestored = true;
      let y2 = getSavedScrollPosition(state.location, state.matches);
      if (y2 != null) {
        updateState({
          restoreScrollPosition: y2
        });
      }
    }
    return () => {
      savedScrollPositions2 = null;
      getScrollPosition = null;
      getScrollRestorationKey = null;
    };
  }
  function getScrollKey(location2, matches) {
    if (getScrollRestorationKey) {
      let key = getScrollRestorationKey(location2, matches.map((m) => convertRouteMatchToUiMatch(m, state.loaderData)));
      return key || location2.key;
    }
    return location2.key;
  }
  function saveScrollPosition(location2, matches) {
    if (savedScrollPositions2 && getScrollPosition) {
      let key = getScrollKey(location2, matches);
      savedScrollPositions2[key] = getScrollPosition();
    }
  }
  function getSavedScrollPosition(location2, matches) {
    if (savedScrollPositions2) {
      let key = getScrollKey(location2, matches);
      let y2 = savedScrollPositions2[key];
      if (typeof y2 === "number") {
        return y2;
      }
    }
    return null;
  }
  function _internalSetRoutes(newRoutes) {
    manifest = {};
    inFlightDataRoutes = convertRoutesToDataRoutes(newRoutes, mapRouteProperties2, void 0, manifest);
  }
  router2 = {
    get basename() {
      return basename;
    },
    get state() {
      return state;
    },
    get routes() {
      return dataRoutes;
    },
    get window() {
      return routerWindow;
    },
    initialize,
    subscribe,
    enableScrollRestoration,
    navigate,
    fetch: fetch2,
    revalidate,
    // Passthrough to history-aware createHref used by useHref so we get proper
    // hash-aware URLs in DOM paths
    createHref: (to) => init.history.createHref(to),
    encodeLocation: (to) => init.history.encodeLocation(to),
    getFetcher,
    deleteFetcher: deleteFetcherAndUpdateState,
    dispose: dispose2,
    getBlocker,
    deleteBlocker,
    _internalFetchControllers: fetchControllers,
    _internalActiveDeferreds: activeDeferreds,
    // TODO: Remove setRoutes, it's temporary to avoid dealing with
    // updating the tree while validating the update algorithm.
    _internalSetRoutes
  };
  return router2;
}
var UNSAFE_DEFERRED_SYMBOL = Symbol("deferred");
function isSubmissionNavigation(opts) {
  return opts != null && ("formData" in opts && opts.formData != null || "body" in opts && opts.body !== void 0);
}
function normalizeTo(location2, matches, basename, prependBasename, to, fromRouteId, relative) {
  let contextualMatches;
  let activeRouteMatch;
  if (fromRouteId != null && relative !== "path") {
    contextualMatches = [];
    for (let match2 of matches) {
      contextualMatches.push(match2);
      if (match2.route.id === fromRouteId) {
        activeRouteMatch = match2;
        break;
      }
    }
  } else {
    contextualMatches = matches;
    activeRouteMatch = matches[matches.length - 1];
  }
  let path2 = resolveTo(to ? to : ".", getPathContributingMatches(contextualMatches).map((m) => m.pathnameBase), stripBasename(location2.pathname, basename) || location2.pathname, relative === "path");
  if (to == null) {
    path2.search = location2.search;
    path2.hash = location2.hash;
  }
  if ((to == null || to === "" || to === ".") && activeRouteMatch && activeRouteMatch.route.index && !hasNakedIndexQuery(path2.search)) {
    path2.search = path2.search ? path2.search.replace(/^\?/, "?index&") : "?index";
  }
  if (prependBasename && basename !== "/") {
    path2.pathname = path2.pathname === "/" ? basename : joinPaths([basename, path2.pathname]);
  }
  return createPath(path2);
}
function normalizeNavigateOptions(normalizeFormMethod, isFetcher, path2, opts) {
  if (!opts || !isSubmissionNavigation(opts)) {
    return {
      path: path2
    };
  }
  if (opts.formMethod && !isValidMethod(opts.formMethod)) {
    return {
      path: path2,
      error: getInternalRouterError(405, {
        method: opts.formMethod
      })
    };
  }
  let getInvalidBodyError = () => ({
    path: path2,
    error: getInternalRouterError(400, {
      type: "invalid-body"
    })
  });
  let rawFormMethod = opts.formMethod || "get";
  let formMethod = normalizeFormMethod ? rawFormMethod.toUpperCase() : rawFormMethod.toLowerCase();
  let formAction = stripHashFromPath(path2);
  if (opts.body !== void 0) {
    if (opts.formEncType === "text/plain") {
      if (!isMutationMethod(formMethod)) {
        return getInvalidBodyError();
      }
      let text2 = typeof opts.body === "string" ? opts.body : opts.body instanceof FormData || opts.body instanceof URLSearchParams ? (
        // https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#plain-text-form-data
        Array.from(opts.body.entries()).reduce((acc, _ref32) => {
          let [name2, value] = _ref32;
          return "" + acc + name2 + "=" + value + "\n";
        }, "")
      ) : String(opts.body);
      return {
        path: path2,
        submission: {
          formMethod,
          formAction,
          formEncType: opts.formEncType,
          formData: void 0,
          json: void 0,
          text: text2
        }
      };
    } else if (opts.formEncType === "application/json") {
      if (!isMutationMethod(formMethod)) {
        return getInvalidBodyError();
      }
      try {
        let json3 = typeof opts.body === "string" ? JSON.parse(opts.body) : opts.body;
        return {
          path: path2,
          submission: {
            formMethod,
            formAction,
            formEncType: opts.formEncType,
            formData: void 0,
            json: json3,
            text: void 0
          }
        };
      } catch (e3) {
        return getInvalidBodyError();
      }
    }
  }
  invariant(typeof FormData === "function", "FormData is not available in this environment");
  let searchParams;
  let formData;
  if (opts.formData) {
    searchParams = convertFormDataToSearchParams(opts.formData);
    formData = opts.formData;
  } else if (opts.body instanceof FormData) {
    searchParams = convertFormDataToSearchParams(opts.body);
    formData = opts.body;
  } else if (opts.body instanceof URLSearchParams) {
    searchParams = opts.body;
    formData = convertSearchParamsToFormData(searchParams);
  } else if (opts.body == null) {
    searchParams = new URLSearchParams();
    formData = new FormData();
  } else {
    try {
      searchParams = new URLSearchParams(opts.body);
      formData = convertSearchParamsToFormData(searchParams);
    } catch (e3) {
      return getInvalidBodyError();
    }
  }
  let submission = {
    formMethod,
    formAction,
    formEncType: opts && opts.formEncType || "application/x-www-form-urlencoded",
    formData,
    json: void 0,
    text: void 0
  };
  if (isMutationMethod(submission.formMethod)) {
    return {
      path: path2,
      submission
    };
  }
  let parsedPath = parsePath(path2);
  if (isFetcher && parsedPath.search && hasNakedIndexQuery(parsedPath.search)) {
    searchParams.append("index", "");
  }
  parsedPath.search = "?" + searchParams;
  return {
    path: createPath(parsedPath),
    submission
  };
}
function getLoaderMatchesUntilBoundary(matches, boundaryId) {
  let boundaryMatches = matches;
  if (boundaryId) {
    let index = matches.findIndex((m) => m.route.id === boundaryId);
    if (index >= 0) {
      boundaryMatches = matches.slice(0, index);
    }
  }
  return boundaryMatches;
}
function getMatchesToLoad(history2, state, matches, submission, location2, isRevalidationRequired, cancelledDeferredRoutes, cancelledFetcherLoads, fetchLoadMatches, fetchRedirectIds, routesToUse, basename, pendingActionData, pendingError) {
  let actionResult = pendingError ? Object.values(pendingError)[0] : pendingActionData ? Object.values(pendingActionData)[0] : void 0;
  let currentUrl = history2.createURL(state.location);
  let nextUrl = history2.createURL(location2);
  let boundaryId = pendingError ? Object.keys(pendingError)[0] : void 0;
  let boundaryMatches = getLoaderMatchesUntilBoundary(matches, boundaryId);
  let navigationMatches = boundaryMatches.filter((match2, index) => {
    if (match2.route.lazy) {
      return true;
    }
    if (match2.route.loader == null) {
      return false;
    }
    if (isNewLoader(state.loaderData, state.matches[index], match2) || cancelledDeferredRoutes.some((id2) => id2 === match2.route.id)) {
      return true;
    }
    let currentRouteMatch = state.matches[index];
    let nextRouteMatch = match2;
    return shouldRevalidateLoader(match2, _extends5({
      currentUrl,
      currentParams: currentRouteMatch.params,
      nextUrl,
      nextParams: nextRouteMatch.params
    }, submission, {
      actionResult,
      defaultShouldRevalidate: (
        // Forced revalidation due to submission, useRevalidator, or X-Remix-Revalidate
        isRevalidationRequired || // Clicked the same link, resubmitted a GET form
        currentUrl.pathname + currentUrl.search === nextUrl.pathname + nextUrl.search || // Search params affect all loaders
        currentUrl.search !== nextUrl.search || isNewRouteInstance(currentRouteMatch, nextRouteMatch)
      )
    }));
  });
  let revalidatingFetchers = [];
  fetchLoadMatches.forEach((f, key) => {
    if (!matches.some((m) => m.route.id === f.routeId)) {
      return;
    }
    let fetcherMatches = matchRoutes(routesToUse, f.path, basename);
    if (!fetcherMatches) {
      revalidatingFetchers.push({
        key,
        routeId: f.routeId,
        path: f.path,
        matches: null,
        match: null,
        controller: null
      });
      return;
    }
    let fetcher = state.fetchers.get(key);
    let fetcherMatch = getTargetMatch(fetcherMatches, f.path);
    let shouldRevalidate = false;
    if (fetchRedirectIds.has(key)) {
      shouldRevalidate = false;
    } else if (cancelledFetcherLoads.includes(key)) {
      shouldRevalidate = true;
    } else if (fetcher && fetcher.state !== "idle" && fetcher.data === void 0) {
      shouldRevalidate = isRevalidationRequired;
    } else {
      shouldRevalidate = shouldRevalidateLoader(fetcherMatch, _extends5({
        currentUrl,
        currentParams: state.matches[state.matches.length - 1].params,
        nextUrl,
        nextParams: matches[matches.length - 1].params
      }, submission, {
        actionResult,
        defaultShouldRevalidate: isRevalidationRequired
      }));
    }
    if (shouldRevalidate) {
      revalidatingFetchers.push({
        key,
        routeId: f.routeId,
        path: f.path,
        matches: fetcherMatches,
        match: fetcherMatch,
        controller: new AbortController()
      });
    }
  });
  return [navigationMatches, revalidatingFetchers];
}
function isNewLoader(currentLoaderData, currentMatch, match2) {
  let isNew = (
    // [a] -> [a, b]
    !currentMatch || // [a, b] -> [a, c]
    match2.route.id !== currentMatch.route.id
  );
  let isMissingData = currentLoaderData[match2.route.id] === void 0;
  return isNew || isMissingData;
}
function isNewRouteInstance(currentMatch, match2) {
  let currentPath = currentMatch.route.path;
  return (
    // param change for this match, /users/123 -> /users/456
    currentMatch.pathname !== match2.pathname || // splat param changed, which is not present in match.path
    // e.g. /files/images/avatar.jpg -> files/finances.xls
    currentPath != null && currentPath.endsWith("*") && currentMatch.params["*"] !== match2.params["*"]
  );
}
function shouldRevalidateLoader(loaderMatch, arg) {
  if (loaderMatch.route.shouldRevalidate) {
    let routeChoice = loaderMatch.route.shouldRevalidate(arg);
    if (typeof routeChoice === "boolean") {
      return routeChoice;
    }
  }
  return arg.defaultShouldRevalidate;
}
async function loadLazyRouteModule(route, mapRouteProperties2, manifest) {
  if (!route.lazy) {
    return;
  }
  let lazyRoute = await route.lazy();
  if (!route.lazy) {
    return;
  }
  let routeToUpdate = manifest[route.id];
  invariant(routeToUpdate, "No route found in manifest");
  let routeUpdates = {};
  for (let lazyRouteProperty in lazyRoute) {
    let staticRouteValue = routeToUpdate[lazyRouteProperty];
    let isPropertyStaticallyDefined = staticRouteValue !== void 0 && // This property isn't static since it should always be updated based
    // on the route updates
    lazyRouteProperty !== "hasErrorBoundary";
    warning(!isPropertyStaticallyDefined, 'Route "' + routeToUpdate.id + '" has a static property "' + lazyRouteProperty + '" defined but its lazy function is also returning a value for this property. ' + ('The lazy route property "' + lazyRouteProperty + '" will be ignored.'));
    if (!isPropertyStaticallyDefined && !immutableRouteKeys.has(lazyRouteProperty)) {
      routeUpdates[lazyRouteProperty] = lazyRoute[lazyRouteProperty];
    }
  }
  Object.assign(routeToUpdate, routeUpdates);
  Object.assign(routeToUpdate, _extends5({}, mapRouteProperties2(routeToUpdate), {
    lazy: void 0
  }));
}
async function callLoaderOrAction(type, request, match2, matches, manifest, mapRouteProperties2, basename, opts) {
  if (opts === void 0) {
    opts = {};
  }
  let resultType;
  let result;
  let onReject;
  let runHandler = (handler) => {
    let reject;
    let abortPromise = new Promise((_, r3) => reject = r3);
    onReject = () => reject();
    request.signal.addEventListener("abort", onReject);
    return Promise.race([handler({
      request,
      params: match2.params,
      context: opts.requestContext
    }), abortPromise]);
  };
  try {
    let handler = match2.route[type];
    if (match2.route.lazy) {
      if (handler) {
        let handlerError;
        let values2 = await Promise.all([
          // If the handler throws, don't let it immediately bubble out,
          // since we need to let the lazy() execution finish so we know if this
          // route has a boundary that can handle the error
          runHandler(handler).catch((e3) => {
            handlerError = e3;
          }),
          loadLazyRouteModule(match2.route, mapRouteProperties2, manifest)
        ]);
        if (handlerError) {
          throw handlerError;
        }
        result = values2[0];
      } else {
        await loadLazyRouteModule(match2.route, mapRouteProperties2, manifest);
        handler = match2.route[type];
        if (handler) {
          result = await runHandler(handler);
        } else if (type === "action") {
          let url = new URL(request.url);
          let pathname = url.pathname + url.search;
          throw getInternalRouterError(405, {
            method: request.method,
            pathname,
            routeId: match2.route.id
          });
        } else {
          return {
            type: ResultType.data,
            data: void 0
          };
        }
      }
    } else if (!handler) {
      let url = new URL(request.url);
      let pathname = url.pathname + url.search;
      throw getInternalRouterError(404, {
        pathname
      });
    } else {
      result = await runHandler(handler);
    }
    invariant(result !== void 0, "You defined " + (type === "action" ? "an action" : "a loader") + " for route " + ('"' + match2.route.id + "\" but didn't return anything from your `" + type + "` ") + "function. Please return a value or `null`.");
  } catch (e3) {
    resultType = ResultType.error;
    result = e3;
  } finally {
    if (onReject) {
      request.signal.removeEventListener("abort", onReject);
    }
  }
  if (isResponse(result)) {
    let status = result.status;
    if (redirectStatusCodes.has(status)) {
      let location2 = result.headers.get("Location");
      invariant(location2, "Redirects returned/thrown from loaders/actions must have a Location header");
      if (!ABSOLUTE_URL_REGEX.test(location2)) {
        location2 = normalizeTo(new URL(request.url), matches.slice(0, matches.indexOf(match2) + 1), basename, true, location2);
      } else if (!opts.isStaticRequest) {
        let currentUrl = new URL(request.url);
        let url = location2.startsWith("//") ? new URL(currentUrl.protocol + location2) : new URL(location2);
        let isSameBasename = stripBasename(url.pathname, basename) != null;
        if (url.origin === currentUrl.origin && isSameBasename) {
          location2 = url.pathname + url.search + url.hash;
        }
      }
      if (opts.isStaticRequest) {
        result.headers.set("Location", location2);
        throw result;
      }
      return {
        type: ResultType.redirect,
        status,
        location: location2,
        revalidate: result.headers.get("X-Remix-Revalidate") !== null,
        reloadDocument: result.headers.get("X-Remix-Reload-Document") !== null
      };
    }
    if (opts.isRouteRequest) {
      let queryRouteResponse = {
        type: resultType === ResultType.error ? ResultType.error : ResultType.data,
        response: result
      };
      throw queryRouteResponse;
    }
    let data;
    let contentType = result.headers.get("Content-Type");
    if (contentType && /\bapplication\/json\b/.test(contentType)) {
      data = await result.json();
    } else {
      data = await result.text();
    }
    if (resultType === ResultType.error) {
      return {
        type: resultType,
        error: new ErrorResponseImpl(status, result.statusText, data),
        headers: result.headers
      };
    }
    return {
      type: ResultType.data,
      data,
      statusCode: result.status,
      headers: result.headers
    };
  }
  if (resultType === ResultType.error) {
    return {
      type: resultType,
      error: result
    };
  }
  if (isDeferredData(result)) {
    var _result$init, _result$init2;
    return {
      type: ResultType.deferred,
      deferredData: result,
      statusCode: (_result$init = result.init) == null ? void 0 : _result$init.status,
      headers: ((_result$init2 = result.init) == null ? void 0 : _result$init2.headers) && new Headers(result.init.headers)
    };
  }
  return {
    type: ResultType.data,
    data: result
  };
}
function createClientSideRequest(history2, location2, signal, submission) {
  let url = history2.createURL(stripHashFromPath(location2)).toString();
  let init = {
    signal
  };
  if (submission && isMutationMethod(submission.formMethod)) {
    let {
      formMethod,
      formEncType
    } = submission;
    init.method = formMethod.toUpperCase();
    if (formEncType === "application/json") {
      init.headers = new Headers({
        "Content-Type": formEncType
      });
      init.body = JSON.stringify(submission.json);
    } else if (formEncType === "text/plain") {
      init.body = submission.text;
    } else if (formEncType === "application/x-www-form-urlencoded" && submission.formData) {
      init.body = convertFormDataToSearchParams(submission.formData);
    } else {
      init.body = submission.formData;
    }
  }
  return new Request(url, init);
}
function convertFormDataToSearchParams(formData) {
  let searchParams = new URLSearchParams();
  for (let [key, value] of formData.entries()) {
    searchParams.append(key, typeof value === "string" ? value : value.name);
  }
  return searchParams;
}
function convertSearchParamsToFormData(searchParams) {
  let formData = new FormData();
  for (let [key, value] of searchParams.entries()) {
    formData.append(key, value);
  }
  return formData;
}
function processRouteLoaderData(matches, matchesToLoad, results, pendingError, activeDeferreds) {
  let loaderData = {};
  let errors = null;
  let statusCode;
  let foundError = false;
  let loaderHeaders = {};
  results.forEach((result, index) => {
    let id2 = matchesToLoad[index].route.id;
    invariant(!isRedirectResult(result), "Cannot handle redirect results in processLoaderData");
    if (isErrorResult(result)) {
      let boundaryMatch = findNearestBoundary(matches, id2);
      let error = result.error;
      if (pendingError) {
        error = Object.values(pendingError)[0];
        pendingError = void 0;
      }
      errors = errors || {};
      if (errors[boundaryMatch.route.id] == null) {
        errors[boundaryMatch.route.id] = error;
      }
      loaderData[id2] = void 0;
      if (!foundError) {
        foundError = true;
        statusCode = isRouteErrorResponse(result.error) ? result.error.status : 500;
      }
      if (result.headers) {
        loaderHeaders[id2] = result.headers;
      }
    } else {
      if (isDeferredResult(result)) {
        activeDeferreds.set(id2, result.deferredData);
        loaderData[id2] = result.deferredData.data;
      } else {
        loaderData[id2] = result.data;
      }
      if (result.statusCode != null && result.statusCode !== 200 && !foundError) {
        statusCode = result.statusCode;
      }
      if (result.headers) {
        loaderHeaders[id2] = result.headers;
      }
    }
  });
  if (pendingError) {
    errors = pendingError;
    loaderData[Object.keys(pendingError)[0]] = void 0;
  }
  return {
    loaderData,
    errors,
    statusCode: statusCode || 200,
    loaderHeaders
  };
}
function processLoaderData(state, matches, matchesToLoad, results, pendingError, revalidatingFetchers, fetcherResults, activeDeferreds) {
  let {
    loaderData,
    errors
  } = processRouteLoaderData(matches, matchesToLoad, results, pendingError, activeDeferreds);
  for (let index = 0; index < revalidatingFetchers.length; index++) {
    let {
      key,
      match: match2,
      controller
    } = revalidatingFetchers[index];
    invariant(fetcherResults !== void 0 && fetcherResults[index] !== void 0, "Did not find corresponding fetcher result");
    let result = fetcherResults[index];
    if (controller && controller.signal.aborted) {
      continue;
    } else if (isErrorResult(result)) {
      let boundaryMatch = findNearestBoundary(state.matches, match2 == null ? void 0 : match2.route.id);
      if (!(errors && errors[boundaryMatch.route.id])) {
        errors = _extends5({}, errors, {
          [boundaryMatch.route.id]: result.error
        });
      }
      state.fetchers.delete(key);
    } else if (isRedirectResult(result)) {
      invariant(false, "Unhandled fetcher revalidation redirect");
    } else if (isDeferredResult(result)) {
      invariant(false, "Unhandled fetcher deferred data");
    } else {
      let doneFetcher = getDoneFetcher(result.data);
      state.fetchers.set(key, doneFetcher);
    }
  }
  return {
    loaderData,
    errors
  };
}
function mergeLoaderData(loaderData, newLoaderData, matches, errors) {
  let mergedLoaderData = _extends5({}, newLoaderData);
  for (let match2 of matches) {
    let id2 = match2.route.id;
    if (newLoaderData.hasOwnProperty(id2)) {
      if (newLoaderData[id2] !== void 0) {
        mergedLoaderData[id2] = newLoaderData[id2];
      }
    } else if (loaderData[id2] !== void 0 && match2.route.loader) {
      mergedLoaderData[id2] = loaderData[id2];
    }
    if (errors && errors.hasOwnProperty(id2)) {
      break;
    }
  }
  return mergedLoaderData;
}
function findNearestBoundary(matches, routeId) {
  let eligibleMatches = routeId ? matches.slice(0, matches.findIndex((m) => m.route.id === routeId) + 1) : [...matches];
  return eligibleMatches.reverse().find((m) => m.route.hasErrorBoundary === true) || matches[0];
}
function getShortCircuitMatches(routes) {
  let route = routes.length === 1 ? routes[0] : routes.find((r3) => r3.index || !r3.path || r3.path === "/") || {
    id: "__shim-error-route__"
  };
  return {
    matches: [{
      params: {},
      pathname: "",
      pathnameBase: "",
      route
    }],
    route
  };
}
function getInternalRouterError(status, _temp4) {
  let {
    pathname,
    routeId,
    method,
    type
  } = _temp4 === void 0 ? {} : _temp4;
  let statusText = "Unknown Server Error";
  let errorMessage = "Unknown @remix-run/router error";
  if (status === 400) {
    statusText = "Bad Request";
    if (method && pathname && routeId) {
      errorMessage = "You made a " + method + ' request to "' + pathname + '" but ' + ('did not provide a `loader` for route "' + routeId + '", ') + "so there is no way to handle the request.";
    } else if (type === "defer-action") {
      errorMessage = "defer() is not supported in actions";
    } else if (type === "invalid-body") {
      errorMessage = "Unable to encode submission body";
    }
  } else if (status === 403) {
    statusText = "Forbidden";
    errorMessage = 'Route "' + routeId + '" does not match URL "' + pathname + '"';
  } else if (status === 404) {
    statusText = "Not Found";
    errorMessage = 'No route matches URL "' + pathname + '"';
  } else if (status === 405) {
    statusText = "Method Not Allowed";
    if (method && pathname && routeId) {
      errorMessage = "You made a " + method.toUpperCase() + ' request to "' + pathname + '" but ' + ('did not provide an `action` for route "' + routeId + '", ') + "so there is no way to handle the request.";
    } else if (method) {
      errorMessage = 'Invalid request method "' + method.toUpperCase() + '"';
    }
  }
  return new ErrorResponseImpl(status || 500, statusText, new Error(errorMessage), true);
}
function findRedirect(results) {
  for (let i2 = results.length - 1; i2 >= 0; i2--) {
    let result = results[i2];
    if (isRedirectResult(result)) {
      return {
        result,
        idx: i2
      };
    }
  }
}
function stripHashFromPath(path2) {
  let parsedPath = typeof path2 === "string" ? parsePath(path2) : path2;
  return createPath(_extends5({}, parsedPath, {
    hash: ""
  }));
}
function isHashChangeOnly(a2, b) {
  if (a2.pathname !== b.pathname || a2.search !== b.search) {
    return false;
  }
  if (a2.hash === "") {
    return b.hash !== "";
  } else if (a2.hash === b.hash) {
    return true;
  } else if (b.hash !== "") {
    return true;
  }
  return false;
}
function isDeferredResult(result) {
  return result.type === ResultType.deferred;
}
function isErrorResult(result) {
  return result.type === ResultType.error;
}
function isRedirectResult(result) {
  return (result && result.type) === ResultType.redirect;
}
function isDeferredData(value) {
  let deferred = value;
  return deferred && typeof deferred === "object" && typeof deferred.data === "object" && typeof deferred.subscribe === "function" && typeof deferred.cancel === "function" && typeof deferred.resolveData === "function";
}
function isResponse(value) {
  return value != null && typeof value.status === "number" && typeof value.statusText === "string" && typeof value.headers === "object" && typeof value.body !== "undefined";
}
function isValidMethod(method) {
  return validRequestMethods.has(method.toLowerCase());
}
function isMutationMethod(method) {
  return validMutationMethods.has(method.toLowerCase());
}
async function resolveDeferredResults(currentMatches, matchesToLoad, results, signals, isFetcher, currentLoaderData) {
  for (let index = 0; index < results.length; index++) {
    let result = results[index];
    let match2 = matchesToLoad[index];
    if (!match2) {
      continue;
    }
    let currentMatch = currentMatches.find((m) => m.route.id === match2.route.id);
    let isRevalidatingLoader = currentMatch != null && !isNewRouteInstance(currentMatch, match2) && (currentLoaderData && currentLoaderData[match2.route.id]) !== void 0;
    if (isDeferredResult(result) && (isFetcher || isRevalidatingLoader)) {
      let signal = signals[index];
      invariant(signal, "Expected an AbortSignal for revalidating fetcher deferred result");
      await resolveDeferredData(result, signal, isFetcher).then((result2) => {
        if (result2) {
          results[index] = result2 || results[index];
        }
      });
    }
  }
}
async function resolveDeferredData(result, signal, unwrap) {
  if (unwrap === void 0) {
    unwrap = false;
  }
  let aborted = await result.deferredData.resolveData(signal);
  if (aborted) {
    return;
  }
  if (unwrap) {
    try {
      return {
        type: ResultType.data,
        data: result.deferredData.unwrappedData
      };
    } catch (e3) {
      return {
        type: ResultType.error,
        error: e3
      };
    }
  }
  return {
    type: ResultType.data,
    data: result.deferredData.data
  };
}
function hasNakedIndexQuery(search) {
  return new URLSearchParams(search).getAll("index").some((v4) => v4 === "");
}
function getTargetMatch(matches, location2) {
  let search = typeof location2 === "string" ? parsePath(location2).search : location2.search;
  if (matches[matches.length - 1].route.index && hasNakedIndexQuery(search || "")) {
    return matches[matches.length - 1];
  }
  let pathMatches = getPathContributingMatches(matches);
  return pathMatches[pathMatches.length - 1];
}
function getSubmissionFromNavigation(navigation) {
  let {
    formMethod,
    formAction,
    formEncType,
    text: text2,
    formData,
    json: json3
  } = navigation;
  if (!formMethod || !formAction || !formEncType) {
    return;
  }
  if (text2 != null) {
    return {
      formMethod,
      formAction,
      formEncType,
      formData: void 0,
      json: void 0,
      text: text2
    };
  } else if (formData != null) {
    return {
      formMethod,
      formAction,
      formEncType,
      formData,
      json: void 0,
      text: void 0
    };
  } else if (json3 !== void 0) {
    return {
      formMethod,
      formAction,
      formEncType,
      formData: void 0,
      json: json3,
      text: void 0
    };
  }
}
function getLoadingNavigation(location2, submission) {
  if (submission) {
    let navigation = {
      state: "loading",
      location: location2,
      formMethod: submission.formMethod,
      formAction: submission.formAction,
      formEncType: submission.formEncType,
      formData: submission.formData,
      json: submission.json,
      text: submission.text
    };
    return navigation;
  } else {
    let navigation = {
      state: "loading",
      location: location2,
      formMethod: void 0,
      formAction: void 0,
      formEncType: void 0,
      formData: void 0,
      json: void 0,
      text: void 0
    };
    return navigation;
  }
}
function getSubmittingNavigation(location2, submission) {
  let navigation = {
    state: "submitting",
    location: location2,
    formMethod: submission.formMethod,
    formAction: submission.formAction,
    formEncType: submission.formEncType,
    formData: submission.formData,
    json: submission.json,
    text: submission.text
  };
  return navigation;
}
function getLoadingFetcher(submission, data) {
  if (submission) {
    let fetcher = {
      state: "loading",
      formMethod: submission.formMethod,
      formAction: submission.formAction,
      formEncType: submission.formEncType,
      formData: submission.formData,
      json: submission.json,
      text: submission.text,
      data
    };
    return fetcher;
  } else {
    let fetcher = {
      state: "loading",
      formMethod: void 0,
      formAction: void 0,
      formEncType: void 0,
      formData: void 0,
      json: void 0,
      text: void 0,
      data
    };
    return fetcher;
  }
}
function getSubmittingFetcher(submission, existingFetcher) {
  let fetcher = {
    state: "submitting",
    formMethod: submission.formMethod,
    formAction: submission.formAction,
    formEncType: submission.formEncType,
    formData: submission.formData,
    json: submission.json,
    text: submission.text,
    data: existingFetcher ? existingFetcher.data : void 0
  };
  return fetcher;
}
function getDoneFetcher(data) {
  let fetcher = {
    state: "idle",
    formMethod: void 0,
    formAction: void 0,
    formEncType: void 0,
    formData: void 0,
    json: void 0,
    text: void 0,
    data
  };
  return fetcher;
}
function restoreAppliedTransitions(_window, transitions) {
  try {
    let sessionPositions = _window.sessionStorage.getItem(TRANSITIONS_STORAGE_KEY);
    if (sessionPositions) {
      let json3 = JSON.parse(sessionPositions);
      for (let [k2, v4] of Object.entries(json3 || {})) {
        if (v4 && Array.isArray(v4)) {
          transitions.set(k2, new Set(v4 || []));
        }
      }
    }
  } catch (e3) {
  }
}
function persistAppliedTransitions(_window, transitions) {
  if (transitions.size > 0) {
    let json3 = {};
    for (let [k2, v4] of transitions) {
      json3[k2] = [...v4];
    }
    try {
      _window.sessionStorage.setItem(TRANSITIONS_STORAGE_KEY, JSON.stringify(json3));
    } catch (error) {
      warning(false, "Failed to save applied view transitions in sessionStorage (" + error + ").");
    }
  }
}

// node_modules/react-router/dist/index.js
function _extends6() {
  _extends6 = Object.assign ? Object.assign.bind() : function(target) {
    for (var i2 = 1; i2 < arguments.length; i2++) {
      var source = arguments[i2];
      for (var key in source) {
        if (Object.prototype.hasOwnProperty.call(source, key)) {
          target[key] = source[key];
        }
      }
    }
    return target;
  };
  return _extends6.apply(this, arguments);
}
var DataRouterContext = /* @__PURE__ */ React24.createContext(null);
if (true) {
  DataRouterContext.displayName = "DataRouter";
}
var DataRouterStateContext = /* @__PURE__ */ React24.createContext(null);
if (true) {
  DataRouterStateContext.displayName = "DataRouterState";
}
var AwaitContext = /* @__PURE__ */ React24.createContext(null);
if (true) {
  AwaitContext.displayName = "Await";
}
var NavigationContext = /* @__PURE__ */ React24.createContext(null);
if (true) {
  NavigationContext.displayName = "Navigation";
}
var LocationContext = /* @__PURE__ */ React24.createContext(null);
if (true) {
  LocationContext.displayName = "Location";
}
var RouteContext = /* @__PURE__ */ React24.createContext({
  outlet: null,
  matches: [],
  isDataRoute: false
});
if (true) {
  RouteContext.displayName = "Route";
}
var RouteErrorContext = /* @__PURE__ */ React24.createContext(null);
if (true) {
  RouteErrorContext.displayName = "RouteError";
}
function useHref(to, _temp) {
  let {
    relative
  } = _temp === void 0 ? {} : _temp;
  !useInRouterContext() ? true ? invariant(
    false,
    // TODO: This error is probably because they somehow have 2 versions of the
    // router loaded. We can help them understand how to avoid that.
    "useHref() may be used only in the context of a <Router> component."
  ) : invariant(false) : void 0;
  let {
    basename,
    navigator: navigator2
  } = React24.useContext(NavigationContext);
  let {
    hash: hash3,
    pathname,
    search
  } = useResolvedPath(to, {
    relative
  });
  let joinedPathname = pathname;
  if (basename !== "/") {
    joinedPathname = pathname === "/" ? basename : joinPaths([basename, pathname]);
  }
  return navigator2.createHref({
    pathname: joinedPathname,
    search,
    hash: hash3
  });
}
function useInRouterContext() {
  return React24.useContext(LocationContext) != null;
}
function useLocation() {
  !useInRouterContext() ? true ? invariant(
    false,
    // TODO: This error is probably because they somehow have 2 versions of the
    // router loaded. We can help them understand how to avoid that.
    "useLocation() may be used only in the context of a <Router> component."
  ) : invariant(false) : void 0;
  return React24.useContext(LocationContext).location;
}
var navigateEffectWarning = "You should call navigate() in a React.useEffect(), not when your component is first rendered.";
function useIsomorphicLayoutEffect3(cb) {
  let isStatic = React24.useContext(NavigationContext).static;
  if (!isStatic) {
    React24.useLayoutEffect(cb);
  }
}
function useNavigate() {
  let {
    isDataRoute
  } = React24.useContext(RouteContext);
  return isDataRoute ? useNavigateStable() : useNavigateUnstable();
}
function useNavigateUnstable() {
  !useInRouterContext() ? true ? invariant(
    false,
    // TODO: This error is probably because they somehow have 2 versions of the
    // router loaded. We can help them understand how to avoid that.
    "useNavigate() may be used only in the context of a <Router> component."
  ) : invariant(false) : void 0;
  let dataRouterContext = React24.useContext(DataRouterContext);
  let {
    basename,
    navigator: navigator2
  } = React24.useContext(NavigationContext);
  let {
    matches
  } = React24.useContext(RouteContext);
  let {
    pathname: locationPathname
  } = useLocation();
  let routePathnamesJson = JSON.stringify(getPathContributingMatches(matches).map((match2) => match2.pathnameBase));
  let activeRef = React24.useRef(false);
  useIsomorphicLayoutEffect3(() => {
    activeRef.current = true;
  });
  let navigate = React24.useCallback(function(to, options) {
    if (options === void 0) {
      options = {};
    }
    true ? warning(activeRef.current, navigateEffectWarning) : void 0;
    if (!activeRef.current)
      return;
    if (typeof to === "number") {
      navigator2.go(to);
      return;
    }
    let path2 = resolveTo(to, JSON.parse(routePathnamesJson), locationPathname, options.relative === "path");
    if (dataRouterContext == null && basename !== "/") {
      path2.pathname = path2.pathname === "/" ? basename : joinPaths([basename, path2.pathname]);
    }
    (!!options.replace ? navigator2.replace : navigator2.push)(path2, options.state, options);
  }, [basename, navigator2, routePathnamesJson, locationPathname, dataRouterContext]);
  return navigate;
}
var OutletContext = /* @__PURE__ */ React24.createContext(null);
function useOutlet(context2) {
  let outlet = React24.useContext(RouteContext).outlet;
  if (outlet) {
    return /* @__PURE__ */ React24.createElement(OutletContext.Provider, {
      value: context2
    }, outlet);
  }
  return outlet;
}
function useParams() {
  let {
    matches
  } = React24.useContext(RouteContext);
  let routeMatch = matches[matches.length - 1];
  return routeMatch ? routeMatch.params : {};
}
function useResolvedPath(to, _temp2) {
  let {
    relative
  } = _temp2 === void 0 ? {} : _temp2;
  let {
    matches
  } = React24.useContext(RouteContext);
  let {
    pathname: locationPathname
  } = useLocation();
  let routePathnamesJson = JSON.stringify(getPathContributingMatches(matches).map((match2) => match2.pathnameBase));
  return React24.useMemo(() => resolveTo(to, JSON.parse(routePathnamesJson), locationPathname, relative === "path"), [to, routePathnamesJson, locationPathname, relative]);
}
function useRoutesImpl(routes, locationArg, dataRouterState) {
  !useInRouterContext() ? true ? invariant(
    false,
    // TODO: This error is probably because they somehow have 2 versions of the
    // router loaded. We can help them understand how to avoid that.
    "useRoutes() may be used only in the context of a <Router> component."
  ) : invariant(false) : void 0;
  let {
    navigator: navigator2
  } = React24.useContext(NavigationContext);
  let {
    matches: parentMatches
  } = React24.useContext(RouteContext);
  let routeMatch = parentMatches[parentMatches.length - 1];
  let parentParams = routeMatch ? routeMatch.params : {};
  let parentPathname = routeMatch ? routeMatch.pathname : "/";
  let parentPathnameBase = routeMatch ? routeMatch.pathnameBase : "/";
  let parentRoute = routeMatch && routeMatch.route;
  if (true) {
    let parentPath = parentRoute && parentRoute.path || "";
    warningOnce(parentPathname, !parentRoute || parentPath.endsWith("*"), "You rendered descendant <Routes> (or called `useRoutes()`) at " + ('"' + parentPathname + '" (under <Route path="' + parentPath + '">) but the ') + `parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.

` + ('Please change the parent <Route path="' + parentPath + '"> to <Route ') + ('path="' + (parentPath === "/" ? "*" : parentPath + "/*") + '">.'));
  }
  let locationFromContext = useLocation();
  let location2;
  if (locationArg) {
    var _parsedLocationArg$pa;
    let parsedLocationArg = typeof locationArg === "string" ? parsePath(locationArg) : locationArg;
    !(parentPathnameBase === "/" || ((_parsedLocationArg$pa = parsedLocationArg.pathname) == null ? void 0 : _parsedLocationArg$pa.startsWith(parentPathnameBase))) ? true ? invariant(false, "When overriding the location using `<Routes location>` or `useRoutes(routes, location)`, the location pathname must begin with the portion of the URL pathname that was " + ('matched by all parent routes. The current pathname base is "' + parentPathnameBase + '" ') + ('but pathname "' + parsedLocationArg.pathname + '" was given in the `location` prop.')) : invariant(false) : void 0;
    location2 = parsedLocationArg;
  } else {
    location2 = locationFromContext;
  }
  let pathname = location2.pathname || "/";
  let remainingPathname = parentPathnameBase === "/" ? pathname : pathname.slice(parentPathnameBase.length) || "/";
  let matches = matchRoutes(routes, {
    pathname: remainingPathname
  });
  if (true) {
    true ? warning(parentRoute || matches != null, 'No routes matched location "' + location2.pathname + location2.search + location2.hash + '" ') : void 0;
    true ? warning(matches == null || matches[matches.length - 1].route.element !== void 0 || matches[matches.length - 1].route.Component !== void 0, 'Matched leaf route at location "' + location2.pathname + location2.search + location2.hash + '" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.') : void 0;
  }
  let renderedMatches = _renderMatches(matches && matches.map((match2) => Object.assign({}, match2, {
    params: Object.assign({}, parentParams, match2.params),
    pathname: joinPaths([
      parentPathnameBase,
      // Re-encode pathnames that were decoded inside matchRoutes
      navigator2.encodeLocation ? navigator2.encodeLocation(match2.pathname).pathname : match2.pathname
    ]),
    pathnameBase: match2.pathnameBase === "/" ? parentPathnameBase : joinPaths([
      parentPathnameBase,
      // Re-encode pathnames that were decoded inside matchRoutes
      navigator2.encodeLocation ? navigator2.encodeLocation(match2.pathnameBase).pathname : match2.pathnameBase
    ])
  })), parentMatches, dataRouterState);
  if (locationArg && renderedMatches) {
    return /* @__PURE__ */ React24.createElement(LocationContext.Provider, {
      value: {
        location: _extends6({
          pathname: "/",
          search: "",
          hash: "",
          state: null,
          key: "default"
        }, location2),
        navigationType: Action.Pop
      }
    }, renderedMatches);
  }
  return renderedMatches;
}
function DefaultErrorComponent() {
  let error = useRouteError();
  let message = isRouteErrorResponse(error) ? error.status + " " + error.statusText : error instanceof Error ? error.message : JSON.stringify(error);
  let stack = error instanceof Error ? error.stack : null;
  let lightgrey = "rgba(200,200,200, 0.5)";
  let preStyles = {
    padding: "0.5rem",
    backgroundColor: lightgrey
  };
  let codeStyles = {
    padding: "2px 4px",
    backgroundColor: lightgrey
  };
  let devInfo = null;
  if (true) {
    console.error("Error handled by React Router default ErrorBoundary:", error);
    devInfo = /* @__PURE__ */ React24.createElement(React24.Fragment, null, /* @__PURE__ */ React24.createElement("p", null, "\u{1F4BF} Hey developer \u{1F44B}"), /* @__PURE__ */ React24.createElement("p", null, "You can provide a way better UX than this when your app throws errors by providing your own ", /* @__PURE__ */ React24.createElement("code", {
      style: codeStyles
    }, "ErrorBoundary"), " or", " ", /* @__PURE__ */ React24.createElement("code", {
      style: codeStyles
    }, "errorElement"), " prop on your route."));
  }
  return /* @__PURE__ */ React24.createElement(React24.Fragment, null, /* @__PURE__ */ React24.createElement("h2", null, "Unexpected Application Error!"), /* @__PURE__ */ React24.createElement("h3", {
    style: {
      fontStyle: "italic"
    }
  }, message), stack ? /* @__PURE__ */ React24.createElement("pre", {
    style: preStyles
  }, stack) : null, devInfo);
}
var defaultErrorElement = /* @__PURE__ */ React24.createElement(DefaultErrorComponent, null);
var RenderErrorBoundary = class extends React24.Component {
  constructor(props) {
    super(props);
    this.state = {
      location: props.location,
      revalidation: props.revalidation,
      error: props.error
    };
  }
  static getDerivedStateFromError(error) {
    return {
      error
    };
  }
  static getDerivedStateFromProps(props, state) {
    if (state.location !== props.location || state.revalidation !== "idle" && props.revalidation === "idle") {
      return {
        error: props.error,
        location: props.location,
        revalidation: props.revalidation
      };
    }
    return {
      error: props.error || state.error,
      location: state.location,
      revalidation: props.revalidation || state.revalidation
    };
  }
  componentDidCatch(error, errorInfo) {
    console.error("React Router caught the following error during render", error, errorInfo);
  }
  render() {
    return this.state.error ? /* @__PURE__ */ React24.createElement(RouteContext.Provider, {
      value: this.props.routeContext
    }, /* @__PURE__ */ React24.createElement(RouteErrorContext.Provider, {
      value: this.state.error,
      children: this.props.component
    })) : this.props.children;
  }
};
function RenderedRoute(_ref18) {
  let {
    routeContext,
    match: match2,
    children
  } = _ref18;
  let dataRouterContext = React24.useContext(DataRouterContext);
  if (dataRouterContext && dataRouterContext.static && dataRouterContext.staticContext && (match2.route.errorElement || match2.route.ErrorBoundary)) {
    dataRouterContext.staticContext._deepestRenderedBoundaryId = match2.route.id;
  }
  return /* @__PURE__ */ React24.createElement(RouteContext.Provider, {
    value: routeContext
  }, children);
}
function _renderMatches(matches, parentMatches, dataRouterState) {
  var _dataRouterState2;
  if (parentMatches === void 0) {
    parentMatches = [];
  }
  if (dataRouterState === void 0) {
    dataRouterState = null;
  }
  if (matches == null) {
    var _dataRouterState;
    if ((_dataRouterState = dataRouterState) != null && _dataRouterState.errors) {
      matches = dataRouterState.matches;
    } else {
      return null;
    }
  }
  let renderedMatches = matches;
  let errors = (_dataRouterState2 = dataRouterState) == null ? void 0 : _dataRouterState2.errors;
  if (errors != null) {
    let errorIndex = renderedMatches.findIndex((m) => m.route.id && (errors == null ? void 0 : errors[m.route.id]));
    !(errorIndex >= 0) ? true ? invariant(false, "Could not find a matching route for errors on route IDs: " + Object.keys(errors).join(",")) : invariant(false) : void 0;
    renderedMatches = renderedMatches.slice(0, Math.min(renderedMatches.length, errorIndex + 1));
  }
  return renderedMatches.reduceRight((outlet, match2, index) => {
    let error = match2.route.id ? errors == null ? void 0 : errors[match2.route.id] : null;
    let errorElement = null;
    if (dataRouterState) {
      errorElement = match2.route.errorElement || defaultErrorElement;
    }
    let matches2 = parentMatches.concat(renderedMatches.slice(0, index + 1));
    let getChildren2 = () => {
      let children;
      if (error) {
        children = errorElement;
      } else if (match2.route.Component) {
        children = /* @__PURE__ */ React24.createElement(match2.route.Component, null);
      } else if (match2.route.element) {
        children = match2.route.element;
      } else {
        children = outlet;
      }
      return /* @__PURE__ */ React24.createElement(RenderedRoute, {
        match: match2,
        routeContext: {
          outlet,
          matches: matches2,
          isDataRoute: dataRouterState != null
        },
        children
      });
    };
    return dataRouterState && (match2.route.ErrorBoundary || match2.route.errorElement || index === 0) ? /* @__PURE__ */ React24.createElement(RenderErrorBoundary, {
      location: dataRouterState.location,
      revalidation: dataRouterState.revalidation,
      component: errorElement,
      error,
      children: getChildren2(),
      routeContext: {
        outlet: null,
        matches: matches2,
        isDataRoute: true
      }
    }) : getChildren2();
  }, null);
}
var DataRouterHook = /* @__PURE__ */ function(DataRouterHook3) {
  DataRouterHook3["UseBlocker"] = "useBlocker";
  DataRouterHook3["UseRevalidator"] = "useRevalidator";
  DataRouterHook3["UseNavigateStable"] = "useNavigate";
  return DataRouterHook3;
}(DataRouterHook || {});
var DataRouterStateHook = /* @__PURE__ */ function(DataRouterStateHook3) {
  DataRouterStateHook3["UseBlocker"] = "useBlocker";
  DataRouterStateHook3["UseLoaderData"] = "useLoaderData";
  DataRouterStateHook3["UseActionData"] = "useActionData";
  DataRouterStateHook3["UseRouteError"] = "useRouteError";
  DataRouterStateHook3["UseNavigation"] = "useNavigation";
  DataRouterStateHook3["UseRouteLoaderData"] = "useRouteLoaderData";
  DataRouterStateHook3["UseMatches"] = "useMatches";
  DataRouterStateHook3["UseRevalidator"] = "useRevalidator";
  DataRouterStateHook3["UseNavigateStable"] = "useNavigate";
  DataRouterStateHook3["UseRouteId"] = "useRouteId";
  return DataRouterStateHook3;
}(DataRouterStateHook || {});
function getDataRouterConsoleError(hookName) {
  return hookName + " must be used within a data router.  See https://reactrouter.com/routers/picking-a-router.";
}
function useDataRouterContext(hookName) {
  let ctx = React24.useContext(DataRouterContext);
  !ctx ? true ? invariant(false, getDataRouterConsoleError(hookName)) : invariant(false) : void 0;
  return ctx;
}
function useDataRouterState(hookName) {
  let state = React24.useContext(DataRouterStateContext);
  !state ? true ? invariant(false, getDataRouterConsoleError(hookName)) : invariant(false) : void 0;
  return state;
}
function useRouteContext(hookName) {
  let route = React24.useContext(RouteContext);
  !route ? true ? invariant(false, getDataRouterConsoleError(hookName)) : invariant(false) : void 0;
  return route;
}
function useCurrentRouteId(hookName) {
  let route = useRouteContext(hookName);
  let thisRoute = route.matches[route.matches.length - 1];
  !thisRoute.route.id ? true ? invariant(false, hookName + ' can only be used on routes that contain a unique "id"') : invariant(false) : void 0;
  return thisRoute.route.id;
}
function useRouteId() {
  return useCurrentRouteId(DataRouterStateHook.UseRouteId);
}
function useNavigation() {
  let state = useDataRouterState(DataRouterStateHook.UseNavigation);
  return state.navigation;
}
function useMatches() {
  let {
    matches,
    loaderData
  } = useDataRouterState(DataRouterStateHook.UseMatches);
  return React24.useMemo(() => matches.map((m) => convertRouteMatchToUiMatch(m, loaderData)), [matches, loaderData]);
}
function useLoaderData() {
  let state = useDataRouterState(DataRouterStateHook.UseLoaderData);
  let routeId = useCurrentRouteId(DataRouterStateHook.UseLoaderData);
  if (state.errors && state.errors[routeId] != null) {
    console.error("You cannot `useLoaderData` in an errorElement (routeId: " + routeId + ")");
    return void 0;
  }
  return state.loaderData[routeId];
}
function useRouteError() {
  var _state$errors;
  let error = React24.useContext(RouteErrorContext);
  let state = useDataRouterState(DataRouterStateHook.UseRouteError);
  let routeId = useCurrentRouteId(DataRouterStateHook.UseRouteError);
  if (error) {
    return error;
  }
  return (_state$errors = state.errors) == null ? void 0 : _state$errors[routeId];
}
function useNavigateStable() {
  let {
    router: router2
  } = useDataRouterContext(DataRouterHook.UseNavigateStable);
  let id2 = useCurrentRouteId(DataRouterStateHook.UseNavigateStable);
  let activeRef = React24.useRef(false);
  useIsomorphicLayoutEffect3(() => {
    activeRef.current = true;
  });
  let navigate = React24.useCallback(function(to, options) {
    if (options === void 0) {
      options = {};
    }
    true ? warning(activeRef.current, navigateEffectWarning) : void 0;
    if (!activeRef.current)
      return;
    if (typeof to === "number") {
      router2.navigate(to);
    } else {
      router2.navigate(to, _extends6({
        fromRouteId: id2
      }, options));
    }
  }, [router2, id2]);
  return navigate;
}
var alreadyWarned = {};
function warningOnce(key, cond, message) {
  if (!cond && !alreadyWarned[key]) {
    alreadyWarned[key] = true;
    true ? warning(false, message) : void 0;
  }
}
var START_TRANSITION = "startTransition";
var startTransitionImpl = React24[START_TRANSITION];
function RouterProvider(_ref18) {
  let {
    fallbackElement,
    router: router2,
    future
  } = _ref18;
  let [state, setStateImpl] = React24.useState(router2.state);
  let {
    v7_startTransition
  } = future || {};
  let setState = React24.useCallback((newState) => {
    if (v7_startTransition && startTransitionImpl) {
      startTransitionImpl(() => setStateImpl(newState));
    } else {
      setStateImpl(newState);
    }
  }, [setStateImpl, v7_startTransition]);
  React24.useLayoutEffect(() => router2.subscribe(setState), [router2, setState]);
  let navigator2 = React24.useMemo(() => {
    return {
      createHref: router2.createHref,
      encodeLocation: router2.encodeLocation,
      go: (n2) => router2.navigate(n2),
      push: (to, state2, opts) => router2.navigate(to, {
        state: state2,
        preventScrollReset: opts == null ? void 0 : opts.preventScrollReset
      }),
      replace: (to, state2, opts) => router2.navigate(to, {
        replace: true,
        state: state2,
        preventScrollReset: opts == null ? void 0 : opts.preventScrollReset
      })
    };
  }, [router2]);
  let basename = router2.basename || "/";
  let dataRouterContext = React24.useMemo(() => ({
    router: router2,
    navigator: navigator2,
    static: false,
    basename
  }), [router2, navigator2, basename]);
  return /* @__PURE__ */ React24.createElement(React24.Fragment, null, /* @__PURE__ */ React24.createElement(DataRouterContext.Provider, {
    value: dataRouterContext
  }, /* @__PURE__ */ React24.createElement(DataRouterStateContext.Provider, {
    value: state
  }, /* @__PURE__ */ React24.createElement(Router, {
    basename,
    location: state.location,
    navigationType: state.historyAction,
    navigator: navigator2
  }, state.initialized ? /* @__PURE__ */ React24.createElement(DataRoutes, {
    routes: router2.routes,
    state
  }) : fallbackElement))), null);
}
function DataRoutes(_ref22) {
  let {
    routes,
    state
  } = _ref22;
  return useRoutesImpl(routes, void 0, state);
}
function Outlet(props) {
  return useOutlet(props.context);
}
function Route(_props) {
  true ? invariant(false, "A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.") : invariant(false);
}
function Router(_ref52) {
  let {
    basename: basenameProp = "/",
    children = null,
    location: locationProp,
    navigationType = Action.Pop,
    navigator: navigator2,
    static: staticProp = false
  } = _ref52;
  !!useInRouterContext() ? true ? invariant(false, "You cannot render a <Router> inside another <Router>. You should never have more than one in your app.") : invariant(false) : void 0;
  let basename = basenameProp.replace(/^\/*/, "/");
  let navigationContext = React24.useMemo(() => ({
    basename,
    navigator: navigator2,
    static: staticProp
  }), [basename, navigator2, staticProp]);
  if (typeof locationProp === "string") {
    locationProp = parsePath(locationProp);
  }
  let {
    pathname = "/",
    search = "",
    hash: hash3 = "",
    state = null,
    key = "default"
  } = locationProp;
  let locationContext = React24.useMemo(() => {
    let trailingPathname = stripBasename(pathname, basename);
    if (trailingPathname == null) {
      return null;
    }
    return {
      location: {
        pathname: trailingPathname,
        search,
        hash: hash3,
        state,
        key
      },
      navigationType
    };
  }, [basename, pathname, search, hash3, state, key, navigationType]);
  true ? warning(locationContext != null, '<Router basename="' + basename + '"> is not able to match the URL ' + ('"' + pathname + search + hash3 + '" because it does not start with the ') + "basename, so the <Router> won't render anything.") : void 0;
  if (locationContext == null) {
    return null;
  }
  return /* @__PURE__ */ React24.createElement(NavigationContext.Provider, {
    value: navigationContext
  }, /* @__PURE__ */ React24.createElement(LocationContext.Provider, {
    children,
    value: locationContext
  }));
}
var neverSettledPromise = new Promise(() => {
});
function createRoutesFromChildren(children, parentPath) {
  if (parentPath === void 0) {
    parentPath = [];
  }
  let routes = [];
  React24.Children.forEach(children, (element2, index) => {
    if (!/* @__PURE__ */ React24.isValidElement(element2)) {
      return;
    }
    let treePath = [...parentPath, index];
    if (element2.type === React24.Fragment) {
      routes.push.apply(routes, createRoutesFromChildren(element2.props.children, treePath));
      return;
    }
    !(element2.type === Route) ? true ? invariant(false, "[" + (typeof element2.type === "string" ? element2.type : element2.type.name) + "] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>") : invariant(false) : void 0;
    !(!element2.props.index || !element2.props.children) ? true ? invariant(false, "An index route cannot have child routes.") : invariant(false) : void 0;
    let route = {
      id: element2.props.id || treePath.join("-"),
      caseSensitive: element2.props.caseSensitive,
      element: element2.props.element,
      Component: element2.props.Component,
      index: element2.props.index,
      path: element2.props.path,
      loader: element2.props.loader,
      action: element2.props.action,
      errorElement: element2.props.errorElement,
      ErrorBoundary: element2.props.ErrorBoundary,
      hasErrorBoundary: element2.props.ErrorBoundary != null || element2.props.errorElement != null,
      shouldRevalidate: element2.props.shouldRevalidate,
      handle: element2.props.handle,
      lazy: element2.props.lazy
    };
    if (element2.props.children) {
      route.children = createRoutesFromChildren(element2.props.children, treePath);
    }
    routes.push(route);
  });
  return routes;
}
function mapRouteProperties(route) {
  let updates = {
    // Note: this check also occurs in createRoutesFromChildren so update
    // there if you change this -- please and thank you!
    hasErrorBoundary: route.ErrorBoundary != null || route.errorElement != null
  };
  if (route.Component) {
    if (true) {
      if (route.element) {
        true ? warning(false, "You should not include both `Component` and `element` on your route - `Component` will be used.") : void 0;
      }
    }
    Object.assign(updates, {
      element: /* @__PURE__ */ React24.createElement(route.Component),
      Component: void 0
    });
  }
  if (route.ErrorBoundary) {
    if (true) {
      if (route.errorElement) {
        true ? warning(false, "You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used.") : void 0;
      }
    }
    Object.assign(updates, {
      errorElement: /* @__PURE__ */ React24.createElement(route.ErrorBoundary),
      ErrorBoundary: void 0
    });
  }
  return updates;
}

// node_modules/react-router-dom/dist/index.js
var React25 = __toESM(require_react());
function _extends7() {
  _extends7 = Object.assign ? Object.assign.bind() : function(target) {
    for (var i2 = 1; i2 < arguments.length; i2++) {
      var source = arguments[i2];
      for (var key in source) {
        if (Object.prototype.hasOwnProperty.call(source, key)) {
          target[key] = source[key];
        }
      }
    }
    return target;
  };
  return _extends7.apply(this, arguments);
}
function _objectWithoutPropertiesLoose4(source, excluded) {
  if (source == null)
    return {};
  var target = {};
  var sourceKeys = Object.keys(source);
  var key, i2;
  for (i2 = 0; i2 < sourceKeys.length; i2++) {
    key = sourceKeys[i2];
    if (excluded.indexOf(key) >= 0)
      continue;
    target[key] = source[key];
  }
  return target;
}
var defaultMethod = "get";
var defaultEncType = "application/x-www-form-urlencoded";
function isHtmlElement(object) {
  return object != null && typeof object.tagName === "string";
}
function isButtonElement(object) {
  return isHtmlElement(object) && object.tagName.toLowerCase() === "button";
}
function isFormElement(object) {
  return isHtmlElement(object) && object.tagName.toLowerCase() === "form";
}
function isInputElement(object) {
  return isHtmlElement(object) && object.tagName.toLowerCase() === "input";
}
function isModifiedEvent(event) {
  return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey);
}
function shouldProcessLinkClick(event, target) {
  return event.button === 0 && // Ignore everything but left clicks
  (!target || target === "_self") && // Let browser handle "target=_blank" etc.
  !isModifiedEvent(event);
}
function createSearchParams(init) {
  if (init === void 0) {
    init = "";
  }
  return new URLSearchParams(typeof init === "string" || Array.isArray(init) || init instanceof URLSearchParams ? init : Object.keys(init).reduce((memo2, key) => {
    let value = init[key];
    return memo2.concat(Array.isArray(value) ? value.map((v4) => [key, v4]) : [[key, value]]);
  }, []));
}
function getSearchParamsForLocation(locationSearch, defaultSearchParams) {
  let searchParams = createSearchParams(locationSearch);
  if (defaultSearchParams) {
    defaultSearchParams.forEach((_, key) => {
      if (!searchParams.has(key)) {
        defaultSearchParams.getAll(key).forEach((value) => {
          searchParams.append(key, value);
        });
      }
    });
  }
  return searchParams;
}
var _formDataSupportsSubmitter = null;
function isFormDataSubmitterSupported() {
  if (_formDataSupportsSubmitter === null) {
    try {
      new FormData(
        document.createElement("form"),
        // @ts-expect-error if FormData supports the submitter parameter, this will throw
        0
      );
      _formDataSupportsSubmitter = false;
    } catch (e3) {
      _formDataSupportsSubmitter = true;
    }
  }
  return _formDataSupportsSubmitter;
}
var supportedFormEncTypes = /* @__PURE__ */ new Set(["application/x-www-form-urlencoded", "multipart/form-data", "text/plain"]);
function getFormEncType(encType) {
  if (encType != null && !supportedFormEncTypes.has(encType)) {
    true ? warning(false, '"' + encType + '" is not a valid `encType` for `<Form>`/`<fetcher.Form>` ' + ('and will default to "' + defaultEncType + '"')) : void 0;
    return null;
  }
  return encType;
}
function getFormSubmissionInfo(target, basename) {
  let method;
  let action;
  let encType;
  let formData;
  let body;
  if (isFormElement(target)) {
    let attr = target.getAttribute("action");
    action = attr ? stripBasename(attr, basename) : null;
    method = target.getAttribute("method") || defaultMethod;
    encType = getFormEncType(target.getAttribute("enctype")) || defaultEncType;
    formData = new FormData(target);
  } else if (isButtonElement(target) || isInputElement(target) && (target.type === "submit" || target.type === "image")) {
    let form = target.form;
    if (form == null) {
      throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');
    }
    let attr = target.getAttribute("formaction") || form.getAttribute("action");
    action = attr ? stripBasename(attr, basename) : null;
    method = target.getAttribute("formmethod") || form.getAttribute("method") || defaultMethod;
    encType = getFormEncType(target.getAttribute("formenctype")) || getFormEncType(form.getAttribute("enctype")) || defaultEncType;
    formData = new FormData(form, target);
    if (!isFormDataSubmitterSupported()) {
      let {
        name: name2,
        type,
        value
      } = target;
      if (type === "image") {
        let prefix3 = name2 ? name2 + "." : "";
        formData.append(prefix3 + "x", "0");
        formData.append(prefix3 + "y", "0");
      } else if (name2) {
        formData.append(name2, value);
      }
    }
  } else if (isHtmlElement(target)) {
    throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');
  } else {
    method = defaultMethod;
    action = null;
    encType = defaultEncType;
    body = target;
  }
  if (formData && encType === "text/plain") {
    body = formData;
    formData = void 0;
  }
  return {
    action,
    method: method.toLowerCase(),
    encType,
    formData,
    body
  };
}
var _excluded3 = ["onClick", "relative", "reloadDocument", "replace", "state", "target", "to", "preventScrollReset", "unstable_viewTransition"];
var _excluded22 = ["aria-current", "caseSensitive", "className", "end", "style", "to", "unstable_viewTransition", "children"];
var _excluded32 = ["fetcherKey", "navigate", "reloadDocument", "replace", "state", "method", "action", "onSubmit", "relative", "preventScrollReset", "unstable_viewTransition"];
function createBrowserRouter(routes, opts) {
  return createRouter({
    basename: opts == null ? void 0 : opts.basename,
    future: _extends7({}, opts == null ? void 0 : opts.future, {
      v7_prependBasename: true
    }),
    history: createBrowserHistory({
      window: opts == null ? void 0 : opts.window
    }),
    hydrationData: (opts == null ? void 0 : opts.hydrationData) || parseHydrationData(),
    routes,
    mapRouteProperties,
    window: opts == null ? void 0 : opts.window
  }).initialize();
}
function parseHydrationData() {
  var _window;
  let state = (_window = window) == null ? void 0 : _window.__staticRouterHydrationData;
  if (state && state.errors) {
    state = _extends7({}, state, {
      errors: deserializeErrors(state.errors)
    });
  }
  return state;
}
function deserializeErrors(errors) {
  if (!errors)
    return null;
  let entries = Object.entries(errors);
  let serialized = {};
  for (let [key, val] of entries) {
    if (val && val.__type === "RouteErrorResponse") {
      serialized[key] = new ErrorResponseImpl(val.status, val.statusText, val.data, val.internal === true);
    } else if (val && val.__type === "Error") {
      if (val.__subType) {
        let ErrorConstructor = window[val.__subType];
        if (typeof ErrorConstructor === "function") {
          try {
            let error = new ErrorConstructor(val.message);
            error.stack = "";
            serialized[key] = error;
          } catch (e3) {
          }
        }
      }
      if (serialized[key] == null) {
        let error = new Error(val.message);
        error.stack = "";
        serialized[key] = error;
      }
    } else {
      serialized[key] = val;
    }
  }
  return serialized;
}
var ViewTransitionContext = /* @__PURE__ */ React25.createContext({
  isTransitioning: false
});
if (true) {
  ViewTransitionContext.displayName = "ViewTransition";
}
var FetchersContext = /* @__PURE__ */ React25.createContext(/* @__PURE__ */ new Map());
if (true) {
  FetchersContext.displayName = "Fetchers";
}
var START_TRANSITION2 = "startTransition";
var startTransitionImpl2 = React25[START_TRANSITION2];
function HistoryRouter(_ref62) {
  let {
    basename,
    children,
    future,
    history: history2
  } = _ref62;
  let [state, setStateImpl] = React25.useState({
    action: history2.action,
    location: history2.location
  });
  let {
    v7_startTransition
  } = future || {};
  let setState = React25.useCallback((newState) => {
    v7_startTransition && startTransitionImpl2 ? startTransitionImpl2(() => setStateImpl(newState)) : setStateImpl(newState);
  }, [setStateImpl, v7_startTransition]);
  React25.useLayoutEffect(() => history2.listen(setState), [history2, setState]);
  return /* @__PURE__ */ React25.createElement(Router, {
    basename,
    children,
    location: state.location,
    navigationType: state.action,
    navigator: history2
  });
}
if (true) {
  HistoryRouter.displayName = "unstable_HistoryRouter";
}
var isBrowser3 = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
var ABSOLUTE_URL_REGEX2 = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;
var Link = /* @__PURE__ */ React25.forwardRef(function LinkWithRef(_ref72, ref) {
  let {
    onClick,
    relative,
    reloadDocument,
    replace: replace2,
    state,
    target,
    to,
    preventScrollReset,
    unstable_viewTransition
  } = _ref72, rest = _objectWithoutPropertiesLoose4(_ref72, _excluded3);
  let {
    basename
  } = React25.useContext(NavigationContext);
  let absoluteHref;
  let isExternal = false;
  if (typeof to === "string" && ABSOLUTE_URL_REGEX2.test(to)) {
    absoluteHref = to;
    if (isBrowser3) {
      try {
        let currentUrl = new URL(window.location.href);
        let targetUrl = to.startsWith("//") ? new URL(currentUrl.protocol + to) : new URL(to);
        let path2 = stripBasename(targetUrl.pathname, basename);
        if (targetUrl.origin === currentUrl.origin && path2 != null) {
          to = path2 + targetUrl.search + targetUrl.hash;
        } else {
          isExternal = true;
        }
      } catch (e3) {
        true ? warning(false, '<Link to="' + to + '"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.') : void 0;
      }
    }
  }
  let href = useHref(to, {
    relative
  });
  let internalOnClick = useLinkClickHandler(to, {
    replace: replace2,
    state,
    target,
    preventScrollReset,
    relative,
    unstable_viewTransition
  });
  function handleClick(event) {
    if (onClick)
      onClick(event);
    if (!event.defaultPrevented) {
      internalOnClick(event);
    }
  }
  return (
    // eslint-disable-next-line jsx-a11y/anchor-has-content
    /* @__PURE__ */ React25.createElement("a", _extends7({}, rest, {
      href: absoluteHref || href,
      onClick: isExternal || reloadDocument ? onClick : handleClick,
      ref,
      target
    }))
  );
});
if (true) {
  Link.displayName = "Link";
}
var NavLink = /* @__PURE__ */ React25.forwardRef(function NavLinkWithRef(_ref82, ref) {
  let {
    "aria-current": ariaCurrentProp = "page",
    caseSensitive = false,
    className: classNameProp = "",
    end = false,
    style: styleProp,
    to,
    unstable_viewTransition,
    children
  } = _ref82, rest = _objectWithoutPropertiesLoose4(_ref82, _excluded22);
  let path2 = useResolvedPath(to, {
    relative: rest.relative
  });
  let location2 = useLocation();
  let routerState = React25.useContext(DataRouterStateContext);
  let {
    navigator: navigator2
  } = React25.useContext(NavigationContext);
  let isTransitioning = routerState != null && // Conditional usage is OK here because the usage of a data router is static
  // eslint-disable-next-line react-hooks/rules-of-hooks
  useViewTransitionState(path2) && unstable_viewTransition === true;
  let toPathname = navigator2.encodeLocation ? navigator2.encodeLocation(path2).pathname : path2.pathname;
  let locationPathname = location2.pathname;
  let nextLocationPathname = routerState && routerState.navigation && routerState.navigation.location ? routerState.navigation.location.pathname : null;
  if (!caseSensitive) {
    locationPathname = locationPathname.toLowerCase();
    nextLocationPathname = nextLocationPathname ? nextLocationPathname.toLowerCase() : null;
    toPathname = toPathname.toLowerCase();
  }
  let isActive = locationPathname === toPathname || !end && locationPathname.startsWith(toPathname) && locationPathname.charAt(toPathname.length) === "/";
  let isPending = nextLocationPathname != null && (nextLocationPathname === toPathname || !end && nextLocationPathname.startsWith(toPathname) && nextLocationPathname.charAt(toPathname.length) === "/");
  let renderProps = {
    isActive,
    isPending,
    isTransitioning
  };
  let ariaCurrent = isActive ? ariaCurrentProp : void 0;
  let className;
  if (typeof classNameProp === "function") {
    className = classNameProp(renderProps);
  } else {
    className = [classNameProp, isActive ? "active" : null, isPending ? "pending" : null, isTransitioning ? "transitioning" : null].filter(Boolean).join(" ");
  }
  let style = typeof styleProp === "function" ? styleProp(renderProps) : styleProp;
  return /* @__PURE__ */ React25.createElement(Link, _extends7({}, rest, {
    "aria-current": ariaCurrent,
    className,
    ref,
    style,
    to,
    unstable_viewTransition
  }), typeof children === "function" ? children(renderProps) : children);
});
if (true) {
  NavLink.displayName = "NavLink";
}
var Form2 = /* @__PURE__ */ React25.forwardRef((_ref92, forwardedRef) => {
  let {
    fetcherKey,
    navigate,
    reloadDocument,
    replace: replace2,
    state,
    method = defaultMethod,
    action,
    onSubmit,
    relative,
    preventScrollReset,
    unstable_viewTransition
  } = _ref92, props = _objectWithoutPropertiesLoose4(_ref92, _excluded32);
  let submit = useSubmit();
  let formAction = useFormAction(action, {
    relative
  });
  let formMethod = method.toLowerCase() === "get" ? "get" : "post";
  let submitHandler = (event) => {
    onSubmit && onSubmit(event);
    if (event.defaultPrevented)
      return;
    event.preventDefault();
    let submitter = event.nativeEvent.submitter;
    let submitMethod = (submitter == null ? void 0 : submitter.getAttribute("formmethod")) || method;
    submit(submitter || event.currentTarget, {
      fetcherKey,
      method: submitMethod,
      navigate,
      replace: replace2,
      state,
      relative,
      preventScrollReset,
      unstable_viewTransition
    });
  };
  return /* @__PURE__ */ React25.createElement("form", _extends7({
    ref: forwardedRef,
    method: formMethod,
    action: formAction,
    onSubmit: reloadDocument ? onSubmit : submitHandler
  }, props));
});
if (true) {
  Form2.displayName = "Form";
}
function ScrollRestoration(_ref102) {
  let {
    getKey,
    storageKey
  } = _ref102;
  useScrollRestoration({
    getKey,
    storageKey
  });
  return null;
}
if (true) {
  ScrollRestoration.displayName = "ScrollRestoration";
}
var DataRouterHook2;
(function(DataRouterHook3) {
  DataRouterHook3["UseScrollRestoration"] = "useScrollRestoration";
  DataRouterHook3["UseSubmit"] = "useSubmit";
  DataRouterHook3["UseSubmitFetcher"] = "useSubmitFetcher";
  DataRouterHook3["UseFetcher"] = "useFetcher";
  DataRouterHook3["useViewTransitionState"] = "useViewTransitionState";
})(DataRouterHook2 || (DataRouterHook2 = {}));
var DataRouterStateHook2;
(function(DataRouterStateHook3) {
  DataRouterStateHook3["UseFetcher"] = "useFetcher";
  DataRouterStateHook3["UseFetchers"] = "useFetchers";
  DataRouterStateHook3["UseScrollRestoration"] = "useScrollRestoration";
})(DataRouterStateHook2 || (DataRouterStateHook2 = {}));
function getDataRouterConsoleError2(hookName) {
  return hookName + " must be used within a data router.  See https://reactrouter.com/routers/picking-a-router.";
}
function useDataRouterContext2(hookName) {
  let ctx = React25.useContext(DataRouterContext);
  !ctx ? true ? invariant(false, getDataRouterConsoleError2(hookName)) : invariant(false) : void 0;
  return ctx;
}
function useDataRouterState2(hookName) {
  let state = React25.useContext(DataRouterStateContext);
  !state ? true ? invariant(false, getDataRouterConsoleError2(hookName)) : invariant(false) : void 0;
  return state;
}
function useLinkClickHandler(to, _temp) {
  let {
    target,
    replace: replaceProp,
    state,
    preventScrollReset,
    relative,
    unstable_viewTransition
  } = _temp === void 0 ? {} : _temp;
  let navigate = useNavigate();
  let location2 = useLocation();
  let path2 = useResolvedPath(to, {
    relative
  });
  return React25.useCallback((event) => {
    if (shouldProcessLinkClick(event, target)) {
      event.preventDefault();
      let replace2 = replaceProp !== void 0 ? replaceProp : createPath(location2) === createPath(path2);
      navigate(to, {
        replace: replace2,
        state,
        preventScrollReset,
        relative,
        unstable_viewTransition
      });
    }
  }, [location2, navigate, path2, replaceProp, state, target, to, preventScrollReset, relative, unstable_viewTransition]);
}
function useSearchParams(defaultInit) {
  true ? warning(typeof URLSearchParams !== "undefined", "You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params\n\nIf you're unsure how to load polyfills, we recommend you check out https://polyfill.io/v3/ which provides some recommendations about how to load polyfills only for users that need them, instead of for every user.") : void 0;
  let defaultSearchParamsRef = React25.useRef(createSearchParams(defaultInit));
  let hasSetSearchParamsRef = React25.useRef(false);
  let location2 = useLocation();
  let searchParams = React25.useMemo(() => (
    // Only merge in the defaults if we haven't yet called setSearchParams.
    // Once we call that we want those to take precedence, otherwise you can't
    // remove a param with setSearchParams({}) if it has an initial value
    getSearchParamsForLocation(location2.search, hasSetSearchParamsRef.current ? null : defaultSearchParamsRef.current)
  ), [location2.search]);
  let navigate = useNavigate();
  let setSearchParams = React25.useCallback((nextInit, navigateOptions) => {
    const newSearchParams = createSearchParams(typeof nextInit === "function" ? nextInit(searchParams) : nextInit);
    hasSetSearchParamsRef.current = true;
    navigate("?" + newSearchParams, navigateOptions);
  }, [navigate, searchParams]);
  return [searchParams, setSearchParams];
}
function validateClientSideSubmission() {
  if (typeof document === "undefined") {
    throw new Error("You are calling submit during the server render. Try calling submit within a `useEffect` or callback instead.");
  }
}
var fetcherId = 0;
var getUniqueFetcherId = () => "__" + String(++fetcherId) + "__";
function useSubmit() {
  let {
    router: router2
  } = useDataRouterContext2(DataRouterHook2.UseSubmit);
  let {
    basename
  } = React25.useContext(NavigationContext);
  let currentRouteId = useRouteId();
  return React25.useCallback(function(target, options) {
    if (options === void 0) {
      options = {};
    }
    validateClientSideSubmission();
    let {
      action,
      method,
      encType,
      formData,
      body
    } = getFormSubmissionInfo(target, basename);
    if (options.navigate === false) {
      let key = options.fetcherKey || getUniqueFetcherId();
      router2.fetch(key, currentRouteId, options.action || action, {
        preventScrollReset: options.preventScrollReset,
        formData,
        body,
        formMethod: options.method || method,
        formEncType: options.encType || encType
      });
    } else {
      router2.navigate(options.action || action, {
        preventScrollReset: options.preventScrollReset,
        formData,
        body,
        formMethod: options.method || method,
        formEncType: options.encType || encType,
        replace: options.replace,
        state: options.state,
        fromRouteId: currentRouteId,
        unstable_viewTransition: options.unstable_viewTransition
      });
    }
  }, [router2, basename, currentRouteId]);
}
function useFormAction(action, _temp2) {
  let {
    relative
  } = _temp2 === void 0 ? {} : _temp2;
  let {
    basename
  } = React25.useContext(NavigationContext);
  let routeContext = React25.useContext(RouteContext);
  !routeContext ? true ? invariant(false, "useFormAction must be used inside a RouteContext") : invariant(false) : void 0;
  let [match2] = routeContext.matches.slice(-1);
  let path2 = _extends7({}, useResolvedPath(action ? action : ".", {
    relative
  }));
  let location2 = useLocation();
  if (action == null) {
    path2.search = location2.search;
    if (match2.route.index) {
      let params = new URLSearchParams(path2.search);
      params.delete("index");
      path2.search = params.toString() ? "?" + params.toString() : "";
    }
  }
  if ((!action || action === ".") && match2.route.index) {
    path2.search = path2.search ? path2.search.replace(/^\?/, "?index&") : "?index";
  }
  if (basename !== "/") {
    path2.pathname = path2.pathname === "/" ? basename : joinPaths([basename, path2.pathname]);
  }
  return createPath(path2);
}
var SCROLL_RESTORATION_STORAGE_KEY = "react-router-scroll-positions";
var savedScrollPositions = {};
function useScrollRestoration(_temp4) {
  let {
    getKey,
    storageKey
  } = _temp4 === void 0 ? {} : _temp4;
  let {
    router: router2
  } = useDataRouterContext2(DataRouterHook2.UseScrollRestoration);
  let {
    restoreScrollPosition,
    preventScrollReset
  } = useDataRouterState2(DataRouterStateHook2.UseScrollRestoration);
  let {
    basename
  } = React25.useContext(NavigationContext);
  let location2 = useLocation();
  let matches = useMatches();
  let navigation = useNavigation();
  React25.useEffect(() => {
    window.history.scrollRestoration = "manual";
    return () => {
      window.history.scrollRestoration = "auto";
    };
  }, []);
  usePageHide(React25.useCallback(() => {
    if (navigation.state === "idle") {
      let key = (getKey ? getKey(location2, matches) : null) || location2.key;
      savedScrollPositions[key] = window.scrollY;
    }
    try {
      sessionStorage.setItem(storageKey || SCROLL_RESTORATION_STORAGE_KEY, JSON.stringify(savedScrollPositions));
    } catch (error) {
      true ? warning(false, "Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (" + error + ").") : void 0;
    }
    window.history.scrollRestoration = "auto";
  }, [storageKey, getKey, navigation.state, location2, matches]));
  if (typeof document !== "undefined") {
    React25.useLayoutEffect(() => {
      try {
        let sessionPositions = sessionStorage.getItem(storageKey || SCROLL_RESTORATION_STORAGE_KEY);
        if (sessionPositions) {
          savedScrollPositions = JSON.parse(sessionPositions);
        }
      } catch (e3) {
      }
    }, [storageKey]);
    React25.useLayoutEffect(() => {
      let getKeyWithoutBasename = getKey && basename !== "/" ? (location3, matches2) => getKey(
        // Strip the basename to match useLocation()
        _extends7({}, location3, {
          pathname: stripBasename(location3.pathname, basename) || location3.pathname
        }),
        matches2
      ) : getKey;
      let disableScrollRestoration = router2 == null ? void 0 : router2.enableScrollRestoration(savedScrollPositions, () => window.scrollY, getKeyWithoutBasename);
      return () => disableScrollRestoration && disableScrollRestoration();
    }, [router2, basename, getKey]);
    React25.useLayoutEffect(() => {
      if (restoreScrollPosition === false) {
        return;
      }
      if (typeof restoreScrollPosition === "number") {
        window.scrollTo(0, restoreScrollPosition);
        return;
      }
      if (location2.hash) {
        let el = document.getElementById(decodeURIComponent(location2.hash.slice(1)));
        if (el) {
          el.scrollIntoView();
          return;
        }
      }
      if (preventScrollReset === true) {
        return;
      }
      window.scrollTo(0, 0);
    }, [location2, restoreScrollPosition, preventScrollReset]);
  }
}
function usePageHide(callback, options) {
  let {
    capture
  } = options || {};
  React25.useEffect(() => {
    let opts = capture != null ? {
      capture
    } : void 0;
    window.addEventListener("pagehide", callback, opts);
    return () => {
      window.removeEventListener("pagehide", callback, opts);
    };
  }, [callback, capture]);
}
function useViewTransitionState(to, opts) {
  if (opts === void 0) {
    opts = {};
  }
  let vtContext = React25.useContext(ViewTransitionContext);
  !(vtContext != null) ? true ? invariant(false, "`unstable_useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`.  Did you accidentally import `RouterProvider` from `react-router`?") : invariant(false) : void 0;
  let {
    basename
  } = useDataRouterContext2(DataRouterHook2.useViewTransitionState);
  let path2 = useResolvedPath(to, {
    relative: opts.relative
  });
  if (!vtContext.isTransitioning) {
    return false;
  }
  let currentPath = stripBasename(vtContext.currentLocation.pathname, basename) || vtContext.currentLocation.pathname;
  let nextPath = stripBasename(vtContext.nextLocation.pathname, basename) || vtContext.nextLocation.pathname;
  return matchPath(path2.pathname, nextPath) != null || matchPath(path2.pathname, currentPath) != null;
}

// src/pages/tracing/__generated__/TracingHomePageQuery.graphql.ts
var node6 = function() {
  var v0 = {
    "kind": "Literal",
    "name": "first",
    "value": 100
  }, v12 = {
    "kind": "Literal",
    "name": "sort",
    "value": {
      "col": "startTime",
      "dir": "desc"
    }
  }, v22 = [
    v0,
    v12
  ], v32 = {
    "alias": null,
    "args": null,
    "kind": "ScalarField",
    "name": "spanKind",
    "storageKey": null
  }, v4 = {
    "alias": null,
    "args": null,
    "kind": "ScalarField",
    "name": "name",
    "storageKey": null
  }, v5 = {
    "alias": null,
    "args": null,
    "kind": "ScalarField",
    "name": "startTime",
    "storageKey": null
  }, v6 = {
    "alias": null,
    "args": null,
    "kind": "ScalarField",
    "name": "latencyMs",
    "storageKey": null
  }, v7 = {
    "alias": null,
    "args": null,
    "kind": "ScalarField",
    "name": "tokenCountTotal",
    "storageKey": null
  }, v8 = {
    "alias": null,
    "args": null,
    "kind": "ScalarField",
    "name": "tokenCountPrompt",
    "storageKey": null
  }, v9 = {
    "alias": null,
    "args": null,
    "kind": "ScalarField",
    "name": "tokenCountCompletion",
    "storageKey": null
  }, v10 = {
    "alias": null,
    "args": null,
    "concreteType": "SpanContext",
    "kind": "LinkedField",
    "name": "context",
    "plural": false,
    "selections": [
      {
        "alias": null,
        "args": null,
        "kind": "ScalarField",
        "name": "spanId",
        "storageKey": null
      },
      {
        "alias": null,
        "args": null,
        "kind": "ScalarField",
        "name": "traceId",
        "storageKey": null
      }
    ],
    "storageKey": null
  }, v11 = {
    "alias": null,
    "args": null,
    "kind": "ScalarField",
    "name": "value",
    "storageKey": null
  }, v122 = [
    v11,
    {
      "alias": null,
      "args": null,
      "kind": "ScalarField",
      "name": "mimeType",
      "storageKey": null
    }
  ], v13 = {
    "alias": null,
    "args": null,
    "concreteType": "SpanEvaluation",
    "kind": "LinkedField",
    "name": "spanEvaluations",
    "plural": true,
    "selections": [
      v4,
      {
        "alias": null,
        "args": null,
        "kind": "ScalarField",
        "name": "label",
        "storageKey": null
      },
      {
        "alias": null,
        "args": null,
        "kind": "ScalarField",
        "name": "score",
        "storageKey": null
      }
    ],
    "storageKey": null
  }, v14 = {
    "alias": null,
    "args": null,
    "concreteType": "DocumentRetrievalMetrics",
    "kind": "LinkedField",
    "name": "documentRetrievalMetrics",
    "plural": true,
    "selections": [
      {
        "alias": null,
        "args": null,
        "kind": "ScalarField",
        "name": "evaluationName",
        "storageKey": null
      },
      {
        "alias": null,
        "args": null,
        "kind": "ScalarField",
        "name": "ndcg",
        "storageKey": null
      },
      {
        "alias": null,
        "args": null,
        "kind": "ScalarField",
        "name": "precision",
        "storageKey": null
      },
      {
        "alias": null,
        "args": null,
        "kind": "ScalarField",
        "name": "hit",
        "storageKey": null
      }
    ],
    "storageKey": null
  }, v15 = {
    "alias": null,
    "args": null,
    "kind": "ScalarField",
    "name": "cursor",
    "storageKey": null
  }, v16 = {
    "alias": null,
    "args": null,
    "concreteType": "Span",
    "kind": "LinkedField",
    "name": "node",
    "plural": false,
    "selections": [
      {
        "alias": null,
        "args": null,
        "kind": "ScalarField",
        "name": "__typename",
        "storageKey": null
      }
    ],
    "storageKey": null
  }, v17 = {
    "alias": null,
    "args": null,
    "concreteType": "PageInfo",
    "kind": "LinkedField",
    "name": "pageInfo",
    "plural": false,
    "selections": [
      {
        "alias": null,
        "args": null,
        "kind": "ScalarField",
        "name": "endCursor",
        "storageKey": null
      },
      {
        "alias": null,
        "args": null,
        "kind": "ScalarField",
        "name": "hasNextPage",
        "storageKey": null
      }
    ],
    "storageKey": null
  }, v18 = {
    "kind": "Literal",
    "name": "rootSpansOnly",
    "value": true
  }, v19 = [
    v0,
    v18,
    v12
  ], v20 = {
    "alias": "statusCode",
    "args": null,
    "kind": "ScalarField",
    "name": "propagatedStatusCode",
    "storageKey": null
  }, v21 = {
    "alias": null,
    "args": null,
    "kind": "ScalarField",
    "name": "parentId",
    "storageKey": null
  }, v222 = [
    v11
  ], v23 = {
    "alias": null,
    "args": null,
    "concreteType": "SpanIOValue",
    "kind": "LinkedField",
    "name": "input",
    "plural": false,
    "selections": v222,
    "storageKey": null
  }, v24 = {
    "alias": null,
    "args": null,
    "concreteType": "SpanIOValue",
    "kind": "LinkedField",
    "name": "output",
    "plural": false,
    "selections": v222,
    "storageKey": null
  };
  return {
    "fragment": {
      "argumentDefinitions": [],
      "kind": "Fragment",
      "metadata": null,
      "name": "TracingHomePageQuery",
      "selections": [
        {
          "args": null,
          "kind": "FragmentSpread",
          "name": "SpansTable_spans"
        },
        {
          "args": null,
          "kind": "FragmentSpread",
          "name": "TracesTable_spans"
        },
        {
          "args": null,
          "kind": "FragmentSpread",
          "name": "TracingHomePageHeader_stats"
        },
        {
          "args": null,
          "kind": "FragmentSpread",
          "name": "StreamToggle_data"
        }
      ],
      "type": "Query",
      "abstractKey": null
    },
    "kind": "Request",
    "operation": {
      "argumentDefinitions": [],
      "kind": "Operation",
      "name": "TracingHomePageQuery",
      "selections": [
        {
          "alias": null,
          "args": null,
          "kind": "ScalarField",
          "name": "spanEvaluationNames",
          "storageKey": null
        },
        {
          "alias": null,
          "args": v22,
          "concreteType": "SpanConnection",
          "kind": "LinkedField",
          "name": "spans",
          "plural": false,
          "selections": [
            {
              "alias": null,
              "args": null,
              "concreteType": "SpanEdge",
              "kind": "LinkedField",
              "name": "edges",
              "plural": true,
              "selections": [
                {
                  "alias": "span",
                  "args": null,
                  "concreteType": "Span",
                  "kind": "LinkedField",
                  "name": "node",
                  "plural": false,
                  "selections": [
                    v32,
                    v4,
                    {
                      "alias": null,
                      "args": null,
                      "kind": "ScalarField",
                      "name": "statusCode",
                      "storageKey": null
                    },
                    v5,
                    v6,
                    v7,
                    v8,
                    v9,
                    v10,
                    {
                      "alias": null,
                      "args": null,
                      "concreteType": "SpanIOValue",
                      "kind": "LinkedField",
                      "name": "input",
                      "plural": false,
                      "selections": v122,
                      "storageKey": null
                    },
                    {
                      "alias": null,
                      "args": null,
                      "concreteType": "SpanIOValue",
                      "kind": "LinkedField",
                      "name": "output",
                      "plural": false,
                      "selections": v122,
                      "storageKey": null
                    },
                    v13,
                    v14
                  ],
                  "storageKey": null
                },
                v15,
                v16
              ],
              "storageKey": null
            },
            v17
          ],
          "storageKey": 'spans(first:100,sort:{"col":"startTime","dir":"desc"})'
        },
        {
          "alias": null,
          "args": v22,
          "filters": [
            "sort",
            "filterCondition"
          ],
          "handle": "connection",
          "key": "SpansTable_spans",
          "kind": "LinkedHandle",
          "name": "spans"
        },
        {
          "alias": "rootSpans",
          "args": v19,
          "concreteType": "SpanConnection",
          "kind": "LinkedField",
          "name": "spans",
          "plural": false,
          "selections": [
            {
              "alias": null,
              "args": null,
              "concreteType": "SpanEdge",
              "kind": "LinkedField",
              "name": "edges",
              "plural": true,
              "selections": [
                {
                  "alias": "rootSpan",
                  "args": null,
                  "concreteType": "Span",
                  "kind": "LinkedField",
                  "name": "node",
                  "plural": false,
                  "selections": [
                    v32,
                    v4,
                    v20,
                    v5,
                    v6,
                    {
                      "alias": "tokenCountTotal",
                      "args": null,
                      "kind": "ScalarField",
                      "name": "cumulativeTokenCountTotal",
                      "storageKey": null
                    },
                    {
                      "alias": "tokenCountPrompt",
                      "args": null,
                      "kind": "ScalarField",
                      "name": "cumulativeTokenCountPrompt",
                      "storageKey": null
                    },
                    {
                      "alias": "tokenCountCompletion",
                      "args": null,
                      "kind": "ScalarField",
                      "name": "cumulativeTokenCountCompletion",
                      "storageKey": null
                    },
                    v21,
                    v23,
                    v24,
                    v10,
                    v13,
                    v14,
                    {
                      "alias": null,
                      "args": null,
                      "concreteType": "Span",
                      "kind": "LinkedField",
                      "name": "descendants",
                      "plural": true,
                      "selections": [
                        v32,
                        v4,
                        v20,
                        v5,
                        v6,
                        v21,
                        v7,
                        v8,
                        v9,
                        v23,
                        v24,
                        v10,
                        v13,
                        v14
                      ],
                      "storageKey": null
                    }
                  ],
                  "storageKey": null
                },
                v15,
                v16
              ],
              "storageKey": null
            },
            v17
          ],
          "storageKey": 'spans(first:100,rootSpansOnly:true,sort:{"col":"startTime","dir":"desc"})'
        },
        {
          "alias": "rootSpans",
          "args": v19,
          "filters": [
            "sort",
            "rootSpansOnly",
            "filterCondition"
          ],
          "handle": "connection",
          "key": "TracesTable_rootSpans",
          "kind": "LinkedHandle",
          "name": "spans"
        },
        {
          "alias": "totalTraces",
          "args": [
            v18
          ],
          "concreteType": "SpanConnection",
          "kind": "LinkedField",
          "name": "spans",
          "plural": false,
          "selections": [
            {
              "alias": null,
              "args": null,
              "concreteType": "PageInfo",
              "kind": "LinkedField",
              "name": "pageInfo",
              "plural": false,
              "selections": [
                {
                  "alias": null,
                  "args": null,
                  "kind": "ScalarField",
                  "name": "totalCount",
                  "storageKey": null
                }
              ],
              "storageKey": null
            }
          ],
          "storageKey": "spans(rootSpansOnly:true)"
        },
        {
          "alias": null,
          "args": null,
          "concreteType": "TraceDatasetInfo",
          "kind": "LinkedField",
          "name": "traceDatasetInfo",
          "plural": false,
          "selections": [
            v5,
            {
              "alias": null,
              "args": null,
              "kind": "ScalarField",
              "name": "endTime",
              "storageKey": null
            },
            v7,
            {
              "alias": null,
              "args": null,
              "kind": "ScalarField",
              "name": "latencyMsP50",
              "storageKey": null
            },
            {
              "alias": null,
              "args": null,
              "kind": "ScalarField",
              "name": "latencyMsP99",
              "storageKey": null
            }
          ],
          "storageKey": null
        },
        {
          "alias": null,
          "args": null,
          "kind": "ScalarField",
          "name": "documentEvaluationNames",
          "storageKey": null
        },
        {
          "alias": null,
          "args": null,
          "kind": "ScalarField",
          "name": "streamingLastUpdatedAt",
          "storageKey": null
        }
      ]
    },
    "params": {
      "cacheID": "4fc5bd82750a179def3f70aa534568ff",
      "id": null,
      "metadata": {},
      "name": "TracingHomePageQuery",
      "operationKind": "query",
      "text": "query TracingHomePageQuery {\n  ...SpansTable_spans\n  ...TracesTable_spans\n  ...TracingHomePageHeader_stats\n  ...StreamToggle_data\n}\n\nfragment SpanColumnSelector_evaluations on Query {\n  spanEvaluationNames\n}\n\nfragment SpansTable_spans on Query {\n  ...SpanColumnSelector_evaluations\n  spans(first: 100, sort: {col: startTime, dir: desc}) {\n    edges {\n      span: node {\n        spanKind\n        name\n        statusCode\n        startTime\n        latencyMs\n        tokenCountTotal\n        tokenCountPrompt\n        tokenCountCompletion\n        context {\n          spanId\n          traceId\n        }\n        input {\n          value\n          mimeType\n        }\n        output {\n          value\n          mimeType\n        }\n        spanEvaluations {\n          name\n          label\n          score\n        }\n        documentRetrievalMetrics {\n          evaluationName\n          ndcg\n          precision\n          hit\n        }\n      }\n      cursor\n      node {\n        __typename\n      }\n    }\n    pageInfo {\n      endCursor\n      hasNextPage\n    }\n  }\n}\n\nfragment StreamToggle_data on Query {\n  streamingLastUpdatedAt\n}\n\nfragment TracesTable_spans on Query {\n  ...SpanColumnSelector_evaluations\n  rootSpans: spans(first: 100, sort: {col: startTime, dir: desc}, rootSpansOnly: true) {\n    edges {\n      rootSpan: node {\n        spanKind\n        name\n        statusCode: propagatedStatusCode\n        startTime\n        latencyMs\n        tokenCountTotal: cumulativeTokenCountTotal\n        tokenCountPrompt: cumulativeTokenCountPrompt\n        tokenCountCompletion: cumulativeTokenCountCompletion\n        parentId\n        input {\n          value\n        }\n        output {\n          value\n        }\n        context {\n          spanId\n          traceId\n        }\n        spanEvaluations {\n          name\n          label\n          score\n        }\n        documentRetrievalMetrics {\n          evaluationName\n          ndcg\n          precision\n          hit\n        }\n        descendants {\n          spanKind\n          name\n          statusCode: propagatedStatusCode\n          startTime\n          latencyMs\n          parentId\n          tokenCountTotal\n          tokenCountPrompt\n          tokenCountCompletion\n          input {\n            value\n          }\n          output {\n            value\n          }\n          context {\n            spanId\n            traceId\n          }\n          spanEvaluations {\n            name\n            label\n            score\n          }\n          documentRetrievalMetrics {\n            evaluationName\n            ndcg\n            precision\n            hit\n          }\n        }\n      }\n      cursor\n      node {\n        __typename\n      }\n    }\n    pageInfo {\n      endCursor\n      hasNextPage\n    }\n  }\n}\n\nfragment TracingHomePageHeader_stats on Query {\n  totalTraces: spans(rootSpansOnly: true) {\n    pageInfo {\n      totalCount\n    }\n  }\n  traceDatasetInfo {\n    startTime\n    endTime\n    tokenCountTotal\n    latencyMsP50\n    latencyMsP99\n  }\n  spanEvaluationNames\n  documentEvaluationNames\n}\n"
    }
  };
}();
node6.hash = "8aad6a015e16f29da0b15ec83e06e396";
var TracingHomePageQuery_graphql_default = node6;

// src/pages/tracing/TracingHomePage.tsx
var import_react124 = __toESM(require_react());
var import_react_relay9 = __toESM(require_react_relay());

// src/pages/tracing/__generated__/SpansTable_spans.graphql.ts
var node8 = function() {
  var v0 = [
    "spans"
  ], v12 = {
    "alias": null,
    "args": null,
    "kind": "ScalarField",
    "name": "name",
    "storageKey": null
  }, v22 = [
    {
      "alias": null,
      "args": null,
      "kind": "ScalarField",
      "name": "value",
      "storageKey": null
    },
    {
      "alias": null,
      "args": null,
      "kind": "ScalarField",
      "name": "mimeType",
      "storageKey": null
    }
  ];
  return {
    "argumentDefinitions": [
      {
        "defaultValue": null,
        "kind": "LocalArgument",
        "name": "after"
      },
      {
        "defaultValue": null,
        "kind": "LocalArgument",
        "name": "filterCondition"
      },
      {
        "defaultValue": 100,
        "kind": "LocalArgument",
        "name": "first"
      },
      {
        "defaultValue": {
          "col": "startTime",
          "dir": "desc"
        },
        "kind": "LocalArgument",
        "name": "sort"
      }
    ],
    "kind": "Fragment",
    "metadata": {
      "connection": [
        {
          "count": "first",
          "cursor": "after",
          "direction": "forward",
          "path": v0
        }
      ],
      "refetch": {
        "connection": {
          "forward": {
            "count": "first",
            "cursor": "after"
          },
          "backward": null,
          "path": v0
        },
        "fragmentPathInResult": [],
        "operation": (init_SpansTableSpansQuery_graphql(), __toCommonJS(SpansTableSpansQuery_graphql_exports))
      }
    },
    "name": "SpansTable_spans",
    "selections": [
      {
        "args": null,
        "kind": "FragmentSpread",
        "name": "SpanColumnSelector_evaluations"
      },
      {
        "alias": "spans",
        "args": [
          {
            "kind": "Variable",
            "name": "filterCondition",
            "variableName": "filterCondition"
          },
          {
            "kind": "Variable",
            "name": "sort",
            "variableName": "sort"
          }
        ],
        "concreteType": "SpanConnection",
        "kind": "LinkedField",
        "name": "__SpansTable_spans_connection",
        "plural": false,
        "selections": [
          {
            "alias": null,
            "args": null,
            "concreteType": "SpanEdge",
            "kind": "LinkedField",
            "name": "edges",
            "plural": true,
            "selections": [
              {
                "alias": "span",
                "args": null,
                "concreteType": "Span",
                "kind": "LinkedField",
                "name": "node",
                "plural": false,
                "selections": [
                  {
                    "alias": null,
                    "args": null,
                    "kind": "ScalarField",
                    "name": "spanKind",
                    "storageKey": null
                  },
                  v12,
                  {
                    "alias": null,
                    "args": null,
                    "kind": "ScalarField",
                    "name": "statusCode",
                    "storageKey": null
                  },
                  {
                    "alias": null,
                    "args": null,
                    "kind": "ScalarField",
                    "name": "startTime",
                    "storageKey": null
                  },
                  {
                    "alias": null,
                    "args": null,
                    "kind": "ScalarField",
                    "name": "latencyMs",
                    "storageKey": null
                  },
                  {
                    "alias": null,
                    "args": null,
                    "kind": "ScalarField",
                    "name": "tokenCountTotal",
                    "storageKey": null
                  },
                  {
                    "alias": null,
                    "args": null,
                    "kind": "ScalarField",
                    "name": "tokenCountPrompt",
                    "storageKey": null
                  },
                  {
                    "alias": null,
                    "args": null,
                    "kind": "ScalarField",
                    "name": "tokenCountCompletion",
                    "storageKey": null
                  },
                  {
                    "alias": null,
                    "args": null,
                    "concreteType": "SpanContext",
                    "kind": "LinkedField",
                    "name": "context",
                    "plural": false,
                    "selections": [
                      {
                        "alias": null,
                        "args": null,
                        "kind": "ScalarField",
                        "name": "spanId",
                        "storageKey": null
                      },
                      {
                        "alias": null,
                        "args": null,
                        "kind": "ScalarField",
                        "name": "traceId",
                        "storageKey": null
                      }
                    ],
                    "storageKey": null
                  },
                  {
                    "alias": null,
                    "args": null,
                    "concreteType": "SpanIOValue",
                    "kind": "LinkedField",
                    "name": "input",
                    "plural": false,
                    "selections": v22,
                    "storageKey": null
                  },
                  {
                    "alias": null,
                    "args": null,
                    "concreteType": "SpanIOValue",
                    "kind": "LinkedField",
                    "name": "output",
                    "plural": false,
                    "selections": v22,
                    "storageKey": null
                  },
                  {
                    "alias": null,
                    "args": null,
                    "concreteType": "SpanEvaluation",
                    "kind": "LinkedField",
                    "name": "spanEvaluations",
                    "plural": true,
                    "selections": [
                      v12,
                      {
                        "alias": null,
                        "args": null,
                        "kind": "ScalarField",
                        "name": "label",
                        "storageKey": null
                      },
                      {
                        "alias": null,
                        "args": null,
                        "kind": "ScalarField",
                        "name": "score",
                        "storageKey": null
                      }
                    ],
                    "storageKey": null
                  },
                  {
                    "alias": null,
                    "args": null,
                    "concreteType": "DocumentRetrievalMetrics",
                    "kind": "LinkedField",
                    "name": "documentRetrievalMetrics",
                    "plural": true,
                    "selections": [
                      {
                        "alias": null,
                        "args": null,
                        "kind": "ScalarField",
                        "name": "evaluationName",
                        "storageKey": null
                      },
                      {
                        "alias": null,
                        "args": null,
                        "kind": "ScalarField",
                        "name": "ndcg",
                        "storageKey": null
                      },
                      {
                        "alias": null,
                        "args": null,
                        "kind": "ScalarField",
                        "name": "precision",
                        "storageKey": null
                      },
                      {
                        "alias": null,
                        "args": null,
                        "kind": "ScalarField",
                        "name": "hit",
                        "storageKey": null
                      }
                    ],
                    "storageKey": null
                  }
                ],
                "storageKey": null
              },
              {
                "alias": null,
                "args": null,
                "kind": "ScalarField",
                "name": "cursor",
                "storageKey": null
              },
              {
                "alias": null,
                "args": null,
                "concreteType": "Span",
                "kind": "LinkedField",
                "name": "node",
                "plural": false,
                "selections": [
                  {
                    "alias": null,
                    "args": null,
                    "kind": "ScalarField",
                    "name": "__typename",
                    "storageKey": null
                  }
                ],
                "storageKey": null
              }
            ],
            "storageKey": null
          },
          {
            "alias": null,
            "args": null,
            "concreteType": "PageInfo",
            "kind": "LinkedField",
            "name": "pageInfo",
            "plural": false,
            "selections": [
              {
                "alias": null,
                "args": null,
                "kind": "ScalarField",
                "name": "endCursor",
                "storageKey": null
              },
              {
                "alias": null,
                "args": null,
                "kind": "ScalarField",
                "name": "hasNextPage",
                "storageKey": null
              }
            ],
            "storageKey": null
          }
        ],
        "storageKey": null
      }
    ],
    "type": "Query",
    "abstractKey": null
  };
}();
node8.hash = "8d3fa17cdca050881d99ff36537ac42b";
var SpansTable_spans_graphql_default = node8;

// src/pages/tracing/SpansTable.tsx
var import_react67 = __toESM(require_react());
var import_react_relay3 = __toESM(require_react_relay());

// node_modules/@tanstack/react-table/build/lib/index.mjs
var React26 = __toESM(require_react(), 1);

// node_modules/@tanstack/table-core/build/lib/index.mjs
function functionalUpdate(updater, input) {
  return typeof updater === "function" ? updater(input) : updater;
}
function makeStateUpdater(key, instance) {
  return (updater) => {
    instance.setState((old) => {
      return {
        ...old,
        [key]: functionalUpdate(updater, old[key])
      };
    });
  };
}
function isFunction(d) {
  return d instanceof Function;
}
function isNumberArray2(d) {
  return Array.isArray(d) && d.every((val) => typeof val === "number");
}
function flattenBy(arr, getChildren2) {
  const flat = [];
  const recurse = (subArr) => {
    subArr.forEach((item) => {
      flat.push(item);
      const children = getChildren2(item);
      if (children != null && children.length) {
        recurse(children);
      }
    });
  };
  recurse(arr);
  return flat;
}
function memo(getDeps, fn, opts) {
  let deps = [];
  let result;
  return () => {
    let depTime;
    if (opts.key && opts.debug)
      depTime = Date.now();
    const newDeps = getDeps();
    const depsChanged = newDeps.length !== deps.length || newDeps.some((dep, index) => deps[index] !== dep);
    if (!depsChanged) {
      return result;
    }
    deps = newDeps;
    let resultTime;
    if (opts.key && opts.debug)
      resultTime = Date.now();
    result = fn(...newDeps);
    opts == null || opts.onChange == null || opts.onChange(result);
    if (opts.key && opts.debug) {
      if (opts != null && opts.debug()) {
        const depEndTime = Math.round((Date.now() - depTime) * 100) / 100;
        const resultEndTime = Math.round((Date.now() - resultTime) * 100) / 100;
        const resultFpsPercentage = resultEndTime / 16;
        const pad2 = (str, num) => {
          str = String(str);
          while (str.length < num) {
            str = " " + str;
          }
          return str;
        };
        console.info(`%c\u23F1 ${pad2(resultEndTime, 5)} /${pad2(depEndTime, 5)} ms`, `
            font-size: .6rem;
            font-weight: bold;
            color: hsl(${Math.max(0, Math.min(120 - 120 * resultFpsPercentage, 120))}deg 100% 31%);`, opts == null ? void 0 : opts.key);
      }
    }
    return result;
  };
}
function createColumn(table, columnDef, depth, parent) {
  var _ref18, _resolvedColumnDef$id;
  const defaultColumn = table._getDefaultColumnDef();
  const resolvedColumnDef = {
    ...defaultColumn,
    ...columnDef
  };
  const accessorKey = resolvedColumnDef.accessorKey;
  let id2 = (_ref18 = (_resolvedColumnDef$id = resolvedColumnDef.id) != null ? _resolvedColumnDef$id : accessorKey ? accessorKey.replace(".", "_") : void 0) != null ? _ref18 : typeof resolvedColumnDef.header === "string" ? resolvedColumnDef.header : void 0;
  let accessorFn;
  if (resolvedColumnDef.accessorFn) {
    accessorFn = resolvedColumnDef.accessorFn;
  } else if (accessorKey) {
    if (accessorKey.includes(".")) {
      accessorFn = (originalRow) => {
        let result = originalRow;
        for (const key of accessorKey.split(".")) {
          var _result;
          result = (_result = result) == null ? void 0 : _result[key];
          if (result === void 0) {
            console.warn(`"${key}" in deeply nested key "${accessorKey}" returned undefined.`);
          }
        }
        return result;
      };
    } else {
      accessorFn = (originalRow) => originalRow[resolvedColumnDef.accessorKey];
    }
  }
  if (!id2) {
    if (true) {
      throw new Error(resolvedColumnDef.accessorFn ? `Columns require an id when using an accessorFn` : `Columns require an id when using a non-string header`);
    }
    throw new Error();
  }
  let column2 = {
    id: `${String(id2)}`,
    accessorFn,
    parent,
    depth,
    columnDef: resolvedColumnDef,
    columns: [],
    getFlatColumns: memo(() => [true], () => {
      var _column$columns;
      return [column2, ...(_column$columns = column2.columns) == null ? void 0 : _column$columns.flatMap((d) => d.getFlatColumns())];
    }, {
      key: false,
      debug: () => {
        var _table$options$debugA;
        return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugColumns;
      }
    }),
    getLeafColumns: memo(() => [table._getOrderColumnsFn()], (orderColumns2) => {
      var _column$columns2;
      if ((_column$columns2 = column2.columns) != null && _column$columns2.length) {
        let leafColumns = column2.columns.flatMap((column3) => column3.getLeafColumns());
        return orderColumns2(leafColumns);
      }
      return [column2];
    }, {
      key: false,
      debug: () => {
        var _table$options$debugA2;
        return (_table$options$debugA2 = table.options.debugAll) != null ? _table$options$debugA2 : table.options.debugColumns;
      }
    })
  };
  for (const feature of table._features) {
    feature.createColumn == null || feature.createColumn(column2, table);
  }
  return column2;
}
function createHeader(table, column2, options) {
  var _options$id;
  const id2 = (_options$id = options.id) != null ? _options$id : column2.id;
  let header = {
    id: id2,
    column: column2,
    index: options.index,
    isPlaceholder: !!options.isPlaceholder,
    placeholderId: options.placeholderId,
    depth: options.depth,
    subHeaders: [],
    colSpan: 0,
    rowSpan: 0,
    headerGroup: null,
    getLeafHeaders: () => {
      const leafHeaders = [];
      const recurseHeader = (h) => {
        if (h.subHeaders && h.subHeaders.length) {
          h.subHeaders.map(recurseHeader);
        }
        leafHeaders.push(h);
      };
      recurseHeader(header);
      return leafHeaders;
    },
    getContext: () => ({
      table,
      header,
      column: column2
    })
  };
  table._features.forEach((feature) => {
    feature.createHeader == null || feature.createHeader(header, table);
  });
  return header;
}
var Headers2 = {
  createTable: (table) => {
    table.getHeaderGroups = memo(() => [table.getAllColumns(), table.getVisibleLeafColumns(), table.getState().columnPinning.left, table.getState().columnPinning.right], (allColumns, leafColumns, left, right) => {
      var _left$map$filter, _right$map$filter;
      const leftColumns = (_left$map$filter = left == null ? void 0 : left.map((columnId) => leafColumns.find((d) => d.id === columnId)).filter(Boolean)) != null ? _left$map$filter : [];
      const rightColumns = (_right$map$filter = right == null ? void 0 : right.map((columnId) => leafColumns.find((d) => d.id === columnId)).filter(Boolean)) != null ? _right$map$filter : [];
      const centerColumns = leafColumns.filter((column2) => !(left != null && left.includes(column2.id)) && !(right != null && right.includes(column2.id)));
      const headerGroups = buildHeaderGroups(allColumns, [...leftColumns, ...centerColumns, ...rightColumns], table);
      return headerGroups;
    }, {
      key: "getHeaderGroups",
      debug: () => {
        var _table$options$debugA;
        return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugHeaders;
      }
    });
    table.getCenterHeaderGroups = memo(() => [table.getAllColumns(), table.getVisibleLeafColumns(), table.getState().columnPinning.left, table.getState().columnPinning.right], (allColumns, leafColumns, left, right) => {
      leafColumns = leafColumns.filter((column2) => !(left != null && left.includes(column2.id)) && !(right != null && right.includes(column2.id)));
      return buildHeaderGroups(allColumns, leafColumns, table, "center");
    }, {
      key: "getCenterHeaderGroups",
      debug: () => {
        var _table$options$debugA2;
        return (_table$options$debugA2 = table.options.debugAll) != null ? _table$options$debugA2 : table.options.debugHeaders;
      }
    });
    table.getLeftHeaderGroups = memo(() => [table.getAllColumns(), table.getVisibleLeafColumns(), table.getState().columnPinning.left], (allColumns, leafColumns, left) => {
      var _left$map$filter2;
      const orderedLeafColumns = (_left$map$filter2 = left == null ? void 0 : left.map((columnId) => leafColumns.find((d) => d.id === columnId)).filter(Boolean)) != null ? _left$map$filter2 : [];
      return buildHeaderGroups(allColumns, orderedLeafColumns, table, "left");
    }, {
      key: "getLeftHeaderGroups",
      debug: () => {
        var _table$options$debugA3;
        return (_table$options$debugA3 = table.options.debugAll) != null ? _table$options$debugA3 : table.options.debugHeaders;
      }
    });
    table.getRightHeaderGroups = memo(() => [table.getAllColumns(), table.getVisibleLeafColumns(), table.getState().columnPinning.right], (allColumns, leafColumns, right) => {
      var _right$map$filter2;
      const orderedLeafColumns = (_right$map$filter2 = right == null ? void 0 : right.map((columnId) => leafColumns.find((d) => d.id === columnId)).filter(Boolean)) != null ? _right$map$filter2 : [];
      return buildHeaderGroups(allColumns, orderedLeafColumns, table, "right");
    }, {
      key: "getRightHeaderGroups",
      debug: () => {
        var _table$options$debugA4;
        return (_table$options$debugA4 = table.options.debugAll) != null ? _table$options$debugA4 : table.options.debugHeaders;
      }
    });
    table.getFooterGroups = memo(() => [table.getHeaderGroups()], (headerGroups) => {
      return [...headerGroups].reverse();
    }, {
      key: "getFooterGroups",
      debug: () => {
        var _table$options$debugA5;
        return (_table$options$debugA5 = table.options.debugAll) != null ? _table$options$debugA5 : table.options.debugHeaders;
      }
    });
    table.getLeftFooterGroups = memo(() => [table.getLeftHeaderGroups()], (headerGroups) => {
      return [...headerGroups].reverse();
    }, {
      key: "getLeftFooterGroups",
      debug: () => {
        var _table$options$debugA6;
        return (_table$options$debugA6 = table.options.debugAll) != null ? _table$options$debugA6 : table.options.debugHeaders;
      }
    });
    table.getCenterFooterGroups = memo(() => [table.getCenterHeaderGroups()], (headerGroups) => {
      return [...headerGroups].reverse();
    }, {
      key: "getCenterFooterGroups",
      debug: () => {
        var _table$options$debugA7;
        return (_table$options$debugA7 = table.options.debugAll) != null ? _table$options$debugA7 : table.options.debugHeaders;
      }
    });
    table.getRightFooterGroups = memo(() => [table.getRightHeaderGroups()], (headerGroups) => {
      return [...headerGroups].reverse();
    }, {
      key: "getRightFooterGroups",
      debug: () => {
        var _table$options$debugA8;
        return (_table$options$debugA8 = table.options.debugAll) != null ? _table$options$debugA8 : table.options.debugHeaders;
      }
    });
    table.getFlatHeaders = memo(() => [table.getHeaderGroups()], (headerGroups) => {
      return headerGroups.map((headerGroup) => {
        return headerGroup.headers;
      }).flat();
    }, {
      key: "getFlatHeaders",
      debug: () => {
        var _table$options$debugA9;
        return (_table$options$debugA9 = table.options.debugAll) != null ? _table$options$debugA9 : table.options.debugHeaders;
      }
    });
    table.getLeftFlatHeaders = memo(() => [table.getLeftHeaderGroups()], (left) => {
      return left.map((headerGroup) => {
        return headerGroup.headers;
      }).flat();
    }, {
      key: "getLeftFlatHeaders",
      debug: () => {
        var _table$options$debugA10;
        return (_table$options$debugA10 = table.options.debugAll) != null ? _table$options$debugA10 : table.options.debugHeaders;
      }
    });
    table.getCenterFlatHeaders = memo(() => [table.getCenterHeaderGroups()], (left) => {
      return left.map((headerGroup) => {
        return headerGroup.headers;
      }).flat();
    }, {
      key: "getCenterFlatHeaders",
      debug: () => {
        var _table$options$debugA11;
        return (_table$options$debugA11 = table.options.debugAll) != null ? _table$options$debugA11 : table.options.debugHeaders;
      }
    });
    table.getRightFlatHeaders = memo(() => [table.getRightHeaderGroups()], (left) => {
      return left.map((headerGroup) => {
        return headerGroup.headers;
      }).flat();
    }, {
      key: "getRightFlatHeaders",
      debug: () => {
        var _table$options$debugA12;
        return (_table$options$debugA12 = table.options.debugAll) != null ? _table$options$debugA12 : table.options.debugHeaders;
      }
    });
    table.getCenterLeafHeaders = memo(() => [table.getCenterFlatHeaders()], (flatHeaders) => {
      return flatHeaders.filter((header) => {
        var _header$subHeaders;
        return !((_header$subHeaders = header.subHeaders) != null && _header$subHeaders.length);
      });
    }, {
      key: "getCenterLeafHeaders",
      debug: () => {
        var _table$options$debugA13;
        return (_table$options$debugA13 = table.options.debugAll) != null ? _table$options$debugA13 : table.options.debugHeaders;
      }
    });
    table.getLeftLeafHeaders = memo(() => [table.getLeftFlatHeaders()], (flatHeaders) => {
      return flatHeaders.filter((header) => {
        var _header$subHeaders2;
        return !((_header$subHeaders2 = header.subHeaders) != null && _header$subHeaders2.length);
      });
    }, {
      key: "getLeftLeafHeaders",
      debug: () => {
        var _table$options$debugA14;
        return (_table$options$debugA14 = table.options.debugAll) != null ? _table$options$debugA14 : table.options.debugHeaders;
      }
    });
    table.getRightLeafHeaders = memo(() => [table.getRightFlatHeaders()], (flatHeaders) => {
      return flatHeaders.filter((header) => {
        var _header$subHeaders3;
        return !((_header$subHeaders3 = header.subHeaders) != null && _header$subHeaders3.length);
      });
    }, {
      key: "getRightLeafHeaders",
      debug: () => {
        var _table$options$debugA15;
        return (_table$options$debugA15 = table.options.debugAll) != null ? _table$options$debugA15 : table.options.debugHeaders;
      }
    });
    table.getLeafHeaders = memo(() => [table.getLeftHeaderGroups(), table.getCenterHeaderGroups(), table.getRightHeaderGroups()], (left, center, right) => {
      var _left$0$headers, _left$, _center$0$headers, _center$, _right$0$headers, _right$;
      return [...(_left$0$headers = (_left$ = left[0]) == null ? void 0 : _left$.headers) != null ? _left$0$headers : [], ...(_center$0$headers = (_center$ = center[0]) == null ? void 0 : _center$.headers) != null ? _center$0$headers : [], ...(_right$0$headers = (_right$ = right[0]) == null ? void 0 : _right$.headers) != null ? _right$0$headers : []].map((header) => {
        return header.getLeafHeaders();
      }).flat();
    }, {
      key: "getLeafHeaders",
      debug: () => {
        var _table$options$debugA16;
        return (_table$options$debugA16 = table.options.debugAll) != null ? _table$options$debugA16 : table.options.debugHeaders;
      }
    });
  }
};
function buildHeaderGroups(allColumns, columnsToGroup, table, headerFamily) {
  var _headerGroups$0$heade, _headerGroups$;
  let maxDepth = 0;
  const findMaxDepth = function(columns2, depth) {
    if (depth === void 0) {
      depth = 1;
    }
    maxDepth = Math.max(maxDepth, depth);
    columns2.filter((column2) => column2.getIsVisible()).forEach((column2) => {
      var _column$columns;
      if ((_column$columns = column2.columns) != null && _column$columns.length) {
        findMaxDepth(column2.columns, depth + 1);
      }
    }, 0);
  };
  findMaxDepth(allColumns);
  let headerGroups = [];
  const createHeaderGroup = (headersToGroup, depth) => {
    const headerGroup = {
      depth,
      id: [headerFamily, `${depth}`].filter(Boolean).join("_"),
      headers: []
    };
    const pendingParentHeaders = [];
    headersToGroup.forEach((headerToGroup) => {
      const latestPendingParentHeader = [...pendingParentHeaders].reverse()[0];
      const isLeafHeader = headerToGroup.column.depth === headerGroup.depth;
      let column2;
      let isPlaceholder = false;
      if (isLeafHeader && headerToGroup.column.parent) {
        column2 = headerToGroup.column.parent;
      } else {
        column2 = headerToGroup.column;
        isPlaceholder = true;
      }
      if (latestPendingParentHeader && (latestPendingParentHeader == null ? void 0 : latestPendingParentHeader.column) === column2) {
        latestPendingParentHeader.subHeaders.push(headerToGroup);
      } else {
        const header = createHeader(table, column2, {
          id: [headerFamily, depth, column2.id, headerToGroup == null ? void 0 : headerToGroup.id].filter(Boolean).join("_"),
          isPlaceholder,
          placeholderId: isPlaceholder ? `${pendingParentHeaders.filter((d) => d.column === column2).length}` : void 0,
          depth,
          index: pendingParentHeaders.length
        });
        header.subHeaders.push(headerToGroup);
        pendingParentHeaders.push(header);
      }
      headerGroup.headers.push(headerToGroup);
      headerToGroup.headerGroup = headerGroup;
    });
    headerGroups.push(headerGroup);
    if (depth > 0) {
      createHeaderGroup(pendingParentHeaders, depth - 1);
    }
  };
  const bottomHeaders = columnsToGroup.map((column2, index) => createHeader(table, column2, {
    depth: maxDepth,
    index
  }));
  createHeaderGroup(bottomHeaders, maxDepth - 1);
  headerGroups.reverse();
  const recurseHeadersForSpans = (headers) => {
    const filteredHeaders = headers.filter((header) => header.column.getIsVisible());
    return filteredHeaders.map((header) => {
      let colSpan = 0;
      let rowSpan = 0;
      let childRowSpans = [0];
      if (header.subHeaders && header.subHeaders.length) {
        childRowSpans = [];
        recurseHeadersForSpans(header.subHeaders).forEach((_ref18) => {
          let {
            colSpan: childColSpan,
            rowSpan: childRowSpan
          } = _ref18;
          colSpan += childColSpan;
          childRowSpans.push(childRowSpan);
        });
      } else {
        colSpan = 1;
      }
      const minChildRowSpan = Math.min(...childRowSpans);
      rowSpan = rowSpan + minChildRowSpan;
      header.colSpan = colSpan;
      header.rowSpan = rowSpan;
      return {
        colSpan,
        rowSpan
      };
    });
  };
  recurseHeadersForSpans((_headerGroups$0$heade = (_headerGroups$ = headerGroups[0]) == null ? void 0 : _headerGroups$.headers) != null ? _headerGroups$0$heade : []);
  return headerGroups;
}
var defaultColumnSizing = {
  size: 150,
  minSize: 20,
  maxSize: Number.MAX_SAFE_INTEGER
};
var getDefaultColumnSizingInfoState = () => ({
  startOffset: null,
  startSize: null,
  deltaOffset: null,
  deltaPercentage: null,
  isResizingColumn: false,
  columnSizingStart: []
});
var ColumnSizing = {
  getDefaultColumnDef: () => {
    return defaultColumnSizing;
  },
  getInitialState: (state) => {
    return {
      columnSizing: {},
      columnSizingInfo: getDefaultColumnSizingInfoState(),
      ...state
    };
  },
  getDefaultOptions: (table) => {
    return {
      columnResizeMode: "onEnd",
      onColumnSizingChange: makeStateUpdater("columnSizing", table),
      onColumnSizingInfoChange: makeStateUpdater("columnSizingInfo", table)
    };
  },
  createColumn: (column2, table) => {
    column2.getSize = () => {
      var _column$columnDef$min, _ref18, _column$columnDef$max;
      const columnSize = table.getState().columnSizing[column2.id];
      return Math.min(Math.max((_column$columnDef$min = column2.columnDef.minSize) != null ? _column$columnDef$min : defaultColumnSizing.minSize, (_ref18 = columnSize != null ? columnSize : column2.columnDef.size) != null ? _ref18 : defaultColumnSizing.size), (_column$columnDef$max = column2.columnDef.maxSize) != null ? _column$columnDef$max : defaultColumnSizing.maxSize);
    };
    column2.getStart = (position2) => {
      const columns2 = !position2 ? table.getVisibleLeafColumns() : position2 === "left" ? table.getLeftVisibleLeafColumns() : table.getRightVisibleLeafColumns();
      const index = columns2.findIndex((d) => d.id === column2.id);
      if (index > 0) {
        const prevSiblingColumn = columns2[index - 1];
        return prevSiblingColumn.getStart(position2) + prevSiblingColumn.getSize();
      }
      return 0;
    };
    column2.resetSize = () => {
      table.setColumnSizing((_ref22) => {
        let {
          [column2.id]: _,
          ...rest
        } = _ref22;
        return rest;
      });
    };
    column2.getCanResize = () => {
      var _column$columnDef$ena, _table$options$enable;
      return ((_column$columnDef$ena = column2.columnDef.enableResizing) != null ? _column$columnDef$ena : true) && ((_table$options$enable = table.options.enableColumnResizing) != null ? _table$options$enable : true);
    };
    column2.getIsResizing = () => {
      return table.getState().columnSizingInfo.isResizingColumn === column2.id;
    };
  },
  createHeader: (header, table) => {
    header.getSize = () => {
      let sum2 = 0;
      const recurse = (header2) => {
        if (header2.subHeaders.length) {
          header2.subHeaders.forEach(recurse);
        } else {
          var _header$column$getSiz;
          sum2 += (_header$column$getSiz = header2.column.getSize()) != null ? _header$column$getSiz : 0;
        }
      };
      recurse(header);
      return sum2;
    };
    header.getStart = () => {
      if (header.index > 0) {
        const prevSiblingHeader = header.headerGroup.headers[header.index - 1];
        return prevSiblingHeader.getStart() + prevSiblingHeader.getSize();
      }
      return 0;
    };
    header.getResizeHandler = () => {
      const column2 = table.getColumn(header.column.id);
      const canResize = column2 == null ? void 0 : column2.getCanResize();
      return (e3) => {
        if (!column2 || !canResize) {
          return;
        }
        e3.persist == null || e3.persist();
        if (isTouchStartEvent(e3)) {
          if (e3.touches && e3.touches.length > 1) {
            return;
          }
        }
        const startSize = header.getSize();
        const columnSizingStart = header ? header.getLeafHeaders().map((d) => [d.column.id, d.column.getSize()]) : [[column2.id, column2.getSize()]];
        const clientX = isTouchStartEvent(e3) ? Math.round(e3.touches[0].clientX) : e3.clientX;
        const newColumnSizing = {};
        const updateOffset = (eventType, clientXPos) => {
          if (typeof clientXPos !== "number") {
            return;
          }
          table.setColumnSizingInfo((old) => {
            var _old$startOffset, _old$startSize;
            const deltaOffset = clientXPos - ((_old$startOffset = old == null ? void 0 : old.startOffset) != null ? _old$startOffset : 0);
            const deltaPercentage = Math.max(deltaOffset / ((_old$startSize = old == null ? void 0 : old.startSize) != null ? _old$startSize : 0), -0.999999);
            old.columnSizingStart.forEach((_ref32) => {
              let [columnId, headerSize] = _ref32;
              newColumnSizing[columnId] = Math.round(Math.max(headerSize + headerSize * deltaPercentage, 0) * 100) / 100;
            });
            return {
              ...old,
              deltaOffset,
              deltaPercentage
            };
          });
          if (table.options.columnResizeMode === "onChange" || eventType === "end") {
            table.setColumnSizing((old) => ({
              ...old,
              ...newColumnSizing
            }));
          }
        };
        const onMove = (clientXPos) => updateOffset("move", clientXPos);
        const onEnd = (clientXPos) => {
          updateOffset("end", clientXPos);
          table.setColumnSizingInfo((old) => ({
            ...old,
            isResizingColumn: false,
            startOffset: null,
            startSize: null,
            deltaOffset: null,
            deltaPercentage: null,
            columnSizingStart: []
          }));
        };
        const mouseEvents = {
          moveHandler: (e4) => onMove(e4.clientX),
          upHandler: (e4) => {
            document.removeEventListener("mousemove", mouseEvents.moveHandler);
            document.removeEventListener("mouseup", mouseEvents.upHandler);
            onEnd(e4.clientX);
          }
        };
        const touchEvents = {
          moveHandler: (e4) => {
            if (e4.cancelable) {
              e4.preventDefault();
              e4.stopPropagation();
            }
            onMove(e4.touches[0].clientX);
            return false;
          },
          upHandler: (e4) => {
            var _e$touches$;
            document.removeEventListener("touchmove", touchEvents.moveHandler);
            document.removeEventListener("touchend", touchEvents.upHandler);
            if (e4.cancelable) {
              e4.preventDefault();
              e4.stopPropagation();
            }
            onEnd((_e$touches$ = e4.touches[0]) == null ? void 0 : _e$touches$.clientX);
          }
        };
        const passiveIfSupported = passiveEventSupported() ? {
          passive: false
        } : false;
        if (isTouchStartEvent(e3)) {
          document.addEventListener("touchmove", touchEvents.moveHandler, passiveIfSupported);
          document.addEventListener("touchend", touchEvents.upHandler, passiveIfSupported);
        } else {
          document.addEventListener("mousemove", mouseEvents.moveHandler, passiveIfSupported);
          document.addEventListener("mouseup", mouseEvents.upHandler, passiveIfSupported);
        }
        table.setColumnSizingInfo((old) => ({
          ...old,
          startOffset: clientX,
          startSize,
          deltaOffset: 0,
          deltaPercentage: 0,
          columnSizingStart,
          isResizingColumn: column2.id
        }));
      };
    };
  },
  createTable: (table) => {
    table.setColumnSizing = (updater) => table.options.onColumnSizingChange == null ? void 0 : table.options.onColumnSizingChange(updater);
    table.setColumnSizingInfo = (updater) => table.options.onColumnSizingInfoChange == null ? void 0 : table.options.onColumnSizingInfoChange(updater);
    table.resetColumnSizing = (defaultState) => {
      var _table$initialState$c;
      table.setColumnSizing(defaultState ? {} : (_table$initialState$c = table.initialState.columnSizing) != null ? _table$initialState$c : {});
    };
    table.resetHeaderSizeInfo = (defaultState) => {
      var _table$initialState$c2;
      table.setColumnSizingInfo(defaultState ? getDefaultColumnSizingInfoState() : (_table$initialState$c2 = table.initialState.columnSizingInfo) != null ? _table$initialState$c2 : getDefaultColumnSizingInfoState());
    };
    table.getTotalSize = () => {
      var _table$getHeaderGroup, _table$getHeaderGroup2;
      return (_table$getHeaderGroup = (_table$getHeaderGroup2 = table.getHeaderGroups()[0]) == null ? void 0 : _table$getHeaderGroup2.headers.reduce((sum2, header) => {
        return sum2 + header.getSize();
      }, 0)) != null ? _table$getHeaderGroup : 0;
    };
    table.getLeftTotalSize = () => {
      var _table$getLeftHeaderG, _table$getLeftHeaderG2;
      return (_table$getLeftHeaderG = (_table$getLeftHeaderG2 = table.getLeftHeaderGroups()[0]) == null ? void 0 : _table$getLeftHeaderG2.headers.reduce((sum2, header) => {
        return sum2 + header.getSize();
      }, 0)) != null ? _table$getLeftHeaderG : 0;
    };
    table.getCenterTotalSize = () => {
      var _table$getCenterHeade, _table$getCenterHeade2;
      return (_table$getCenterHeade = (_table$getCenterHeade2 = table.getCenterHeaderGroups()[0]) == null ? void 0 : _table$getCenterHeade2.headers.reduce((sum2, header) => {
        return sum2 + header.getSize();
      }, 0)) != null ? _table$getCenterHeade : 0;
    };
    table.getRightTotalSize = () => {
      var _table$getRightHeader, _table$getRightHeader2;
      return (_table$getRightHeader = (_table$getRightHeader2 = table.getRightHeaderGroups()[0]) == null ? void 0 : _table$getRightHeader2.headers.reduce((sum2, header) => {
        return sum2 + header.getSize();
      }, 0)) != null ? _table$getRightHeader : 0;
    };
  }
};
var passiveSupported = null;
function passiveEventSupported() {
  if (typeof passiveSupported === "boolean")
    return passiveSupported;
  let supported = false;
  try {
    const options = {
      get passive() {
        supported = true;
        return false;
      }
    };
    const noop2 = () => {
    };
    window.addEventListener("test", noop2, options);
    window.removeEventListener("test", noop2);
  } catch (err) {
    supported = false;
  }
  passiveSupported = supported;
  return passiveSupported;
}
function isTouchStartEvent(e3) {
  return e3.type === "touchstart";
}
var Expanding = {
  getInitialState: (state) => {
    return {
      expanded: {},
      ...state
    };
  },
  getDefaultOptions: (table) => {
    return {
      onExpandedChange: makeStateUpdater("expanded", table),
      paginateExpandedRows: true
    };
  },
  createTable: (table) => {
    let registered = false;
    let queued = false;
    table._autoResetExpanded = () => {
      var _ref18, _table$options$autoRe;
      if (!registered) {
        table._queue(() => {
          registered = true;
        });
        return;
      }
      if ((_ref18 = (_table$options$autoRe = table.options.autoResetAll) != null ? _table$options$autoRe : table.options.autoResetExpanded) != null ? _ref18 : !table.options.manualExpanding) {
        if (queued)
          return;
        queued = true;
        table._queue(() => {
          table.resetExpanded();
          queued = false;
        });
      }
    };
    table.setExpanded = (updater) => table.options.onExpandedChange == null ? void 0 : table.options.onExpandedChange(updater);
    table.toggleAllRowsExpanded = (expanded) => {
      if (expanded != null ? expanded : !table.getIsAllRowsExpanded()) {
        table.setExpanded(true);
      } else {
        table.setExpanded({});
      }
    };
    table.resetExpanded = (defaultState) => {
      var _table$initialState$e, _table$initialState;
      table.setExpanded(defaultState ? {} : (_table$initialState$e = (_table$initialState = table.initialState) == null ? void 0 : _table$initialState.expanded) != null ? _table$initialState$e : {});
    };
    table.getCanSomeRowsExpand = () => {
      return table.getPrePaginationRowModel().flatRows.some((row) => row.getCanExpand());
    };
    table.getToggleAllRowsExpandedHandler = () => {
      return (e3) => {
        e3.persist == null || e3.persist();
        table.toggleAllRowsExpanded();
      };
    };
    table.getIsSomeRowsExpanded = () => {
      const expanded = table.getState().expanded;
      return expanded === true || Object.values(expanded).some(Boolean);
    };
    table.getIsAllRowsExpanded = () => {
      const expanded = table.getState().expanded;
      if (typeof expanded === "boolean") {
        return expanded === true;
      }
      if (!Object.keys(expanded).length) {
        return false;
      }
      if (table.getRowModel().flatRows.some((row) => !row.getIsExpanded())) {
        return false;
      }
      return true;
    };
    table.getExpandedDepth = () => {
      let maxDepth = 0;
      const rowIds = table.getState().expanded === true ? Object.keys(table.getRowModel().rowsById) : Object.keys(table.getState().expanded);
      rowIds.forEach((id2) => {
        const splitId = id2.split(".");
        maxDepth = Math.max(maxDepth, splitId.length);
      });
      return maxDepth;
    };
    table.getPreExpandedRowModel = () => table.getSortedRowModel();
    table.getExpandedRowModel = () => {
      if (!table._getExpandedRowModel && table.options.getExpandedRowModel) {
        table._getExpandedRowModel = table.options.getExpandedRowModel(table);
      }
      if (table.options.manualExpanding || !table._getExpandedRowModel) {
        return table.getPreExpandedRowModel();
      }
      return table._getExpandedRowModel();
    };
  },
  createRow: (row, table) => {
    row.toggleExpanded = (expanded) => {
      table.setExpanded((old) => {
        var _expanded;
        const exists = old === true ? true : !!(old != null && old[row.id]);
        let oldExpanded = {};
        if (old === true) {
          Object.keys(table.getRowModel().rowsById).forEach((rowId) => {
            oldExpanded[rowId] = true;
          });
        } else {
          oldExpanded = old;
        }
        expanded = (_expanded = expanded) != null ? _expanded : !exists;
        if (!exists && expanded) {
          return {
            ...oldExpanded,
            [row.id]: true
          };
        }
        if (exists && !expanded) {
          const {
            [row.id]: _,
            ...rest
          } = oldExpanded;
          return rest;
        }
        return old;
      });
    };
    row.getIsExpanded = () => {
      var _table$options$getIsR;
      const expanded = table.getState().expanded;
      return !!((_table$options$getIsR = table.options.getIsRowExpanded == null ? void 0 : table.options.getIsRowExpanded(row)) != null ? _table$options$getIsR : expanded === true || (expanded == null ? void 0 : expanded[row.id]));
    };
    row.getCanExpand = () => {
      var _table$options$getRow, _table$options$enable, _row$subRows;
      return (_table$options$getRow = table.options.getRowCanExpand == null ? void 0 : table.options.getRowCanExpand(row)) != null ? _table$options$getRow : ((_table$options$enable = table.options.enableExpanding) != null ? _table$options$enable : true) && !!((_row$subRows = row.subRows) != null && _row$subRows.length);
    };
    row.getIsAllParentsExpanded = () => {
      let isFullyExpanded = true;
      let currentRow = row;
      while (isFullyExpanded && currentRow.parentId) {
        currentRow = table.getRow(currentRow.parentId, true);
        isFullyExpanded = currentRow.getIsExpanded();
      }
      return isFullyExpanded;
    };
    row.getToggleExpandedHandler = () => {
      const canExpand = row.getCanExpand();
      return () => {
        if (!canExpand)
          return;
        row.toggleExpanded();
      };
    };
  }
};
var includesString = (row, columnId, filterValue) => {
  var _row$getValue;
  const search = filterValue.toLowerCase();
  return Boolean((_row$getValue = row.getValue(columnId)) == null || (_row$getValue = _row$getValue.toString()) == null || (_row$getValue = _row$getValue.toLowerCase()) == null ? void 0 : _row$getValue.includes(search));
};
includesString.autoRemove = (val) => testFalsey(val);
var includesStringSensitive = (row, columnId, filterValue) => {
  var _row$getValue2;
  return Boolean((_row$getValue2 = row.getValue(columnId)) == null || (_row$getValue2 = _row$getValue2.toString()) == null ? void 0 : _row$getValue2.includes(filterValue));
};
includesStringSensitive.autoRemove = (val) => testFalsey(val);
var equalsString = (row, columnId, filterValue) => {
  var _row$getValue3;
  return ((_row$getValue3 = row.getValue(columnId)) == null || (_row$getValue3 = _row$getValue3.toString()) == null ? void 0 : _row$getValue3.toLowerCase()) === (filterValue == null ? void 0 : filterValue.toLowerCase());
};
equalsString.autoRemove = (val) => testFalsey(val);
var arrIncludes = (row, columnId, filterValue) => {
  var _row$getValue4;
  return (_row$getValue4 = row.getValue(columnId)) == null ? void 0 : _row$getValue4.includes(filterValue);
};
arrIncludes.autoRemove = (val) => testFalsey(val) || !(val != null && val.length);
var arrIncludesAll = (row, columnId, filterValue) => {
  return !filterValue.some((val) => {
    var _row$getValue5;
    return !((_row$getValue5 = row.getValue(columnId)) != null && _row$getValue5.includes(val));
  });
};
arrIncludesAll.autoRemove = (val) => testFalsey(val) || !(val != null && val.length);
var arrIncludesSome = (row, columnId, filterValue) => {
  return filterValue.some((val) => {
    var _row$getValue6;
    return (_row$getValue6 = row.getValue(columnId)) == null ? void 0 : _row$getValue6.includes(val);
  });
};
arrIncludesSome.autoRemove = (val) => testFalsey(val) || !(val != null && val.length);
var equals2 = (row, columnId, filterValue) => {
  return row.getValue(columnId) === filterValue;
};
equals2.autoRemove = (val) => testFalsey(val);
var weakEquals = (row, columnId, filterValue) => {
  return row.getValue(columnId) == filterValue;
};
weakEquals.autoRemove = (val) => testFalsey(val);
var inNumberRange = (row, columnId, filterValue) => {
  let [min3, max3] = filterValue;
  const rowValue = row.getValue(columnId);
  return rowValue >= min3 && rowValue <= max3;
};
inNumberRange.resolveFilterValue = (val) => {
  let [unsafeMin, unsafeMax] = val;
  let parsedMin = typeof unsafeMin !== "number" ? parseFloat(unsafeMin) : unsafeMin;
  let parsedMax = typeof unsafeMax !== "number" ? parseFloat(unsafeMax) : unsafeMax;
  let min3 = unsafeMin === null || Number.isNaN(parsedMin) ? -Infinity : parsedMin;
  let max3 = unsafeMax === null || Number.isNaN(parsedMax) ? Infinity : parsedMax;
  if (min3 > max3) {
    const temp = min3;
    min3 = max3;
    max3 = temp;
  }
  return [min3, max3];
};
inNumberRange.autoRemove = (val) => testFalsey(val) || testFalsey(val[0]) && testFalsey(val[1]);
var filterFns = {
  includesString,
  includesStringSensitive,
  equalsString,
  arrIncludes,
  arrIncludesAll,
  arrIncludesSome,
  equals: equals2,
  weakEquals,
  inNumberRange
};
function testFalsey(val) {
  return val === void 0 || val === null || val === "";
}
var Filters = {
  getDefaultColumnDef: () => {
    return {
      filterFn: "auto"
    };
  },
  getInitialState: (state) => {
    return {
      columnFilters: [],
      globalFilter: void 0,
      // filtersProgress: 1,
      // facetProgress: {},
      ...state
    };
  },
  getDefaultOptions: (table) => {
    return {
      onColumnFiltersChange: makeStateUpdater("columnFilters", table),
      onGlobalFilterChange: makeStateUpdater("globalFilter", table),
      filterFromLeafRows: false,
      maxLeafRowFilterDepth: 100,
      globalFilterFn: "auto",
      getColumnCanGlobalFilter: (column2) => {
        var _table$getCoreRowMode;
        const value = (_table$getCoreRowMode = table.getCoreRowModel().flatRows[0]) == null || (_table$getCoreRowMode = _table$getCoreRowMode._getAllCellsByColumnId()[column2.id]) == null ? void 0 : _table$getCoreRowMode.getValue();
        return typeof value === "string" || typeof value === "number";
      }
    };
  },
  createColumn: (column2, table) => {
    column2.getAutoFilterFn = () => {
      const firstRow = table.getCoreRowModel().flatRows[0];
      const value = firstRow == null ? void 0 : firstRow.getValue(column2.id);
      if (typeof value === "string") {
        return filterFns.includesString;
      }
      if (typeof value === "number") {
        return filterFns.inNumberRange;
      }
      if (typeof value === "boolean") {
        return filterFns.equals;
      }
      if (value !== null && typeof value === "object") {
        return filterFns.equals;
      }
      if (Array.isArray(value)) {
        return filterFns.arrIncludes;
      }
      return filterFns.weakEquals;
    };
    column2.getFilterFn = () => {
      var _table$options$filter, _table$options$filter2;
      return isFunction(column2.columnDef.filterFn) ? column2.columnDef.filterFn : column2.columnDef.filterFn === "auto" ? column2.getAutoFilterFn() : (
        // @ts-ignore
        (_table$options$filter = (_table$options$filter2 = table.options.filterFns) == null ? void 0 : _table$options$filter2[column2.columnDef.filterFn]) != null ? _table$options$filter : filterFns[column2.columnDef.filterFn]
      );
    };
    column2.getCanFilter = () => {
      var _column$columnDef$ena, _table$options$enable, _table$options$enable2;
      return ((_column$columnDef$ena = column2.columnDef.enableColumnFilter) != null ? _column$columnDef$ena : true) && ((_table$options$enable = table.options.enableColumnFilters) != null ? _table$options$enable : true) && ((_table$options$enable2 = table.options.enableFilters) != null ? _table$options$enable2 : true) && !!column2.accessorFn;
    };
    column2.getCanGlobalFilter = () => {
      var _column$columnDef$ena2, _table$options$enable3, _table$options$enable4, _table$options$getCol;
      return ((_column$columnDef$ena2 = column2.columnDef.enableGlobalFilter) != null ? _column$columnDef$ena2 : true) && ((_table$options$enable3 = table.options.enableGlobalFilter) != null ? _table$options$enable3 : true) && ((_table$options$enable4 = table.options.enableFilters) != null ? _table$options$enable4 : true) && ((_table$options$getCol = table.options.getColumnCanGlobalFilter == null ? void 0 : table.options.getColumnCanGlobalFilter(column2)) != null ? _table$options$getCol : true) && !!column2.accessorFn;
    };
    column2.getIsFiltered = () => column2.getFilterIndex() > -1;
    column2.getFilterValue = () => {
      var _table$getState$colum;
      return (_table$getState$colum = table.getState().columnFilters) == null || (_table$getState$colum = _table$getState$colum.find((d) => d.id === column2.id)) == null ? void 0 : _table$getState$colum.value;
    };
    column2.getFilterIndex = () => {
      var _table$getState$colum2, _table$getState$colum3;
      return (_table$getState$colum2 = (_table$getState$colum3 = table.getState().columnFilters) == null ? void 0 : _table$getState$colum3.findIndex((d) => d.id === column2.id)) != null ? _table$getState$colum2 : -1;
    };
    column2.setFilterValue = (value) => {
      table.setColumnFilters((old) => {
        const filterFn = column2.getFilterFn();
        const previousfilter = old == null ? void 0 : old.find((d) => d.id === column2.id);
        const newFilter = functionalUpdate(value, previousfilter ? previousfilter.value : void 0);
        if (shouldAutoRemoveFilter(filterFn, newFilter, column2)) {
          var _old$filter;
          return (_old$filter = old == null ? void 0 : old.filter((d) => d.id !== column2.id)) != null ? _old$filter : [];
        }
        const newFilterObj = {
          id: column2.id,
          value: newFilter
        };
        if (previousfilter) {
          var _old$map;
          return (_old$map = old == null ? void 0 : old.map((d) => {
            if (d.id === column2.id) {
              return newFilterObj;
            }
            return d;
          })) != null ? _old$map : [];
        }
        if (old != null && old.length) {
          return [...old, newFilterObj];
        }
        return [newFilterObj];
      });
    };
    column2._getFacetedRowModel = table.options.getFacetedRowModel && table.options.getFacetedRowModel(table, column2.id);
    column2.getFacetedRowModel = () => {
      if (!column2._getFacetedRowModel) {
        return table.getPreFilteredRowModel();
      }
      return column2._getFacetedRowModel();
    };
    column2._getFacetedUniqueValues = table.options.getFacetedUniqueValues && table.options.getFacetedUniqueValues(table, column2.id);
    column2.getFacetedUniqueValues = () => {
      if (!column2._getFacetedUniqueValues) {
        return /* @__PURE__ */ new Map();
      }
      return column2._getFacetedUniqueValues();
    };
    column2._getFacetedMinMaxValues = table.options.getFacetedMinMaxValues && table.options.getFacetedMinMaxValues(table, column2.id);
    column2.getFacetedMinMaxValues = () => {
      if (!column2._getFacetedMinMaxValues) {
        return void 0;
      }
      return column2._getFacetedMinMaxValues();
    };
  },
  createRow: (row, table) => {
    row.columnFilters = {};
    row.columnFiltersMeta = {};
  },
  createTable: (table) => {
    table.getGlobalAutoFilterFn = () => {
      return filterFns.includesString;
    };
    table.getGlobalFilterFn = () => {
      var _table$options$filter3, _table$options$filter4;
      const {
        globalFilterFn
      } = table.options;
      return isFunction(globalFilterFn) ? globalFilterFn : globalFilterFn === "auto" ? table.getGlobalAutoFilterFn() : (
        // @ts-ignore
        (_table$options$filter3 = (_table$options$filter4 = table.options.filterFns) == null ? void 0 : _table$options$filter4[globalFilterFn]) != null ? _table$options$filter3 : filterFns[globalFilterFn]
      );
    };
    table.setColumnFilters = (updater) => {
      const leafColumns = table.getAllLeafColumns();
      const updateFn = (old) => {
        var _functionalUpdate;
        return (_functionalUpdate = functionalUpdate(updater, old)) == null ? void 0 : _functionalUpdate.filter((filter) => {
          const column2 = leafColumns.find((d) => d.id === filter.id);
          if (column2) {
            const filterFn = column2.getFilterFn();
            if (shouldAutoRemoveFilter(filterFn, filter.value, column2)) {
              return false;
            }
          }
          return true;
        });
      };
      table.options.onColumnFiltersChange == null || table.options.onColumnFiltersChange(updateFn);
    };
    table.setGlobalFilter = (updater) => {
      table.options.onGlobalFilterChange == null || table.options.onGlobalFilterChange(updater);
    };
    table.resetGlobalFilter = (defaultState) => {
      table.setGlobalFilter(defaultState ? void 0 : table.initialState.globalFilter);
    };
    table.resetColumnFilters = (defaultState) => {
      var _table$initialState$c, _table$initialState;
      table.setColumnFilters(defaultState ? [] : (_table$initialState$c = (_table$initialState = table.initialState) == null ? void 0 : _table$initialState.columnFilters) != null ? _table$initialState$c : []);
    };
    table.getPreFilteredRowModel = () => table.getCoreRowModel();
    table.getFilteredRowModel = () => {
      if (!table._getFilteredRowModel && table.options.getFilteredRowModel) {
        table._getFilteredRowModel = table.options.getFilteredRowModel(table);
      }
      if (table.options.manualFiltering || !table._getFilteredRowModel) {
        return table.getPreFilteredRowModel();
      }
      return table._getFilteredRowModel();
    };
    table._getGlobalFacetedRowModel = table.options.getFacetedRowModel && table.options.getFacetedRowModel(table, "__global__");
    table.getGlobalFacetedRowModel = () => {
      if (table.options.manualFiltering || !table._getGlobalFacetedRowModel) {
        return table.getPreFilteredRowModel();
      }
      return table._getGlobalFacetedRowModel();
    };
    table._getGlobalFacetedUniqueValues = table.options.getFacetedUniqueValues && table.options.getFacetedUniqueValues(table, "__global__");
    table.getGlobalFacetedUniqueValues = () => {
      if (!table._getGlobalFacetedUniqueValues) {
        return /* @__PURE__ */ new Map();
      }
      return table._getGlobalFacetedUniqueValues();
    };
    table._getGlobalFacetedMinMaxValues = table.options.getFacetedMinMaxValues && table.options.getFacetedMinMaxValues(table, "__global__");
    table.getGlobalFacetedMinMaxValues = () => {
      if (!table._getGlobalFacetedMinMaxValues) {
        return;
      }
      return table._getGlobalFacetedMinMaxValues();
    };
  }
};
function shouldAutoRemoveFilter(filterFn, value, column2) {
  return (filterFn && filterFn.autoRemove ? filterFn.autoRemove(value, column2) : false) || typeof value === "undefined" || typeof value === "string" && !value;
}
var sum = (columnId, _leafRows, childRows) => {
  return childRows.reduce((sum2, next2) => {
    const nextValue = next2.getValue(columnId);
    return sum2 + (typeof nextValue === "number" ? nextValue : 0);
  }, 0);
};
var min = (columnId, _leafRows, childRows) => {
  let min3;
  childRows.forEach((row) => {
    const value = row.getValue(columnId);
    if (value != null && (min3 > value || min3 === void 0 && value >= value)) {
      min3 = value;
    }
  });
  return min3;
};
var max = (columnId, _leafRows, childRows) => {
  let max3;
  childRows.forEach((row) => {
    const value = row.getValue(columnId);
    if (value != null && (max3 < value || max3 === void 0 && value >= value)) {
      max3 = value;
    }
  });
  return max3;
};
var extent = (columnId, _leafRows, childRows) => {
  let min3;
  let max3;
  childRows.forEach((row) => {
    const value = row.getValue(columnId);
    if (value != null) {
      if (min3 === void 0) {
        if (value >= value)
          min3 = max3 = value;
      } else {
        if (min3 > value)
          min3 = value;
        if (max3 < value)
          max3 = value;
      }
    }
  });
  return [min3, max3];
};
var mean = (columnId, leafRows) => {
  let count2 = 0;
  let sum2 = 0;
  leafRows.forEach((row) => {
    let value = row.getValue(columnId);
    if (value != null && (value = +value) >= value) {
      ++count2, sum2 += value;
    }
  });
  if (count2)
    return sum2 / count2;
  return;
};
var median = (columnId, leafRows) => {
  if (!leafRows.length) {
    return;
  }
  const values2 = leafRows.map((row) => row.getValue(columnId));
  if (!isNumberArray2(values2)) {
    return;
  }
  if (values2.length === 1) {
    return values2[0];
  }
  const mid = Math.floor(values2.length / 2);
  const nums = values2.sort((a2, b) => a2 - b);
  return values2.length % 2 !== 0 ? nums[mid] : (nums[mid - 1] + nums[mid]) / 2;
};
var unique = (columnId, leafRows) => {
  return Array.from(new Set(leafRows.map((d) => d.getValue(columnId))).values());
};
var uniqueCount = (columnId, leafRows) => {
  return new Set(leafRows.map((d) => d.getValue(columnId))).size;
};
var count = (_columnId, leafRows) => {
  return leafRows.length;
};
var aggregationFns = {
  sum,
  min,
  max,
  extent,
  mean,
  median,
  unique,
  uniqueCount,
  count
};
var Grouping = {
  getDefaultColumnDef: () => {
    return {
      aggregatedCell: (props) => {
        var _toString, _props$getValue;
        return (_toString = (_props$getValue = props.getValue()) == null || _props$getValue.toString == null ? void 0 : _props$getValue.toString()) != null ? _toString : null;
      },
      aggregationFn: "auto"
    };
  },
  getInitialState: (state) => {
    return {
      grouping: [],
      ...state
    };
  },
  getDefaultOptions: (table) => {
    return {
      onGroupingChange: makeStateUpdater("grouping", table),
      groupedColumnMode: "reorder"
    };
  },
  createColumn: (column2, table) => {
    column2.toggleGrouping = () => {
      table.setGrouping((old) => {
        if (old != null && old.includes(column2.id)) {
          return old.filter((d) => d !== column2.id);
        }
        return [...old != null ? old : [], column2.id];
      });
    };
    column2.getCanGroup = () => {
      var _ref18, _ref22, _ref32, _column$columnDef$ena;
      return (_ref18 = (_ref22 = (_ref32 = (_column$columnDef$ena = column2.columnDef.enableGrouping) != null ? _column$columnDef$ena : true) != null ? _ref32 : table.options.enableGrouping) != null ? _ref22 : true) != null ? _ref18 : !!column2.accessorFn;
    };
    column2.getIsGrouped = () => {
      var _table$getState$group;
      return (_table$getState$group = table.getState().grouping) == null ? void 0 : _table$getState$group.includes(column2.id);
    };
    column2.getGroupedIndex = () => {
      var _table$getState$group2;
      return (_table$getState$group2 = table.getState().grouping) == null ? void 0 : _table$getState$group2.indexOf(column2.id);
    };
    column2.getToggleGroupingHandler = () => {
      const canGroup = column2.getCanGroup();
      return () => {
        if (!canGroup)
          return;
        column2.toggleGrouping();
      };
    };
    column2.getAutoAggregationFn = () => {
      const firstRow = table.getCoreRowModel().flatRows[0];
      const value = firstRow == null ? void 0 : firstRow.getValue(column2.id);
      if (typeof value === "number") {
        return aggregationFns.sum;
      }
      if (Object.prototype.toString.call(value) === "[object Date]") {
        return aggregationFns.extent;
      }
    };
    column2.getAggregationFn = () => {
      var _table$options$aggreg, _table$options$aggreg2;
      if (!column2) {
        throw new Error();
      }
      return isFunction(column2.columnDef.aggregationFn) ? column2.columnDef.aggregationFn : column2.columnDef.aggregationFn === "auto" ? column2.getAutoAggregationFn() : (_table$options$aggreg = (_table$options$aggreg2 = table.options.aggregationFns) == null ? void 0 : _table$options$aggreg2[column2.columnDef.aggregationFn]) != null ? _table$options$aggreg : aggregationFns[column2.columnDef.aggregationFn];
    };
  },
  createTable: (table) => {
    table.setGrouping = (updater) => table.options.onGroupingChange == null ? void 0 : table.options.onGroupingChange(updater);
    table.resetGrouping = (defaultState) => {
      var _table$initialState$g, _table$initialState;
      table.setGrouping(defaultState ? [] : (_table$initialState$g = (_table$initialState = table.initialState) == null ? void 0 : _table$initialState.grouping) != null ? _table$initialState$g : []);
    };
    table.getPreGroupedRowModel = () => table.getFilteredRowModel();
    table.getGroupedRowModel = () => {
      if (!table._getGroupedRowModel && table.options.getGroupedRowModel) {
        table._getGroupedRowModel = table.options.getGroupedRowModel(table);
      }
      if (table.options.manualGrouping || !table._getGroupedRowModel) {
        return table.getPreGroupedRowModel();
      }
      return table._getGroupedRowModel();
    };
  },
  createRow: (row, table) => {
    row.getIsGrouped = () => !!row.groupingColumnId;
    row.getGroupingValue = (columnId) => {
      if (row._groupingValuesCache.hasOwnProperty(columnId)) {
        return row._groupingValuesCache[columnId];
      }
      const column2 = table.getColumn(columnId);
      if (!(column2 != null && column2.columnDef.getGroupingValue)) {
        return row.getValue(columnId);
      }
      row._groupingValuesCache[columnId] = column2.columnDef.getGroupingValue(row.original);
      return row._groupingValuesCache[columnId];
    };
    row._groupingValuesCache = {};
  },
  createCell: (cell, column2, row, table) => {
    cell.getIsGrouped = () => column2.getIsGrouped() && column2.id === row.groupingColumnId;
    cell.getIsPlaceholder = () => !cell.getIsGrouped() && column2.getIsGrouped();
    cell.getIsAggregated = () => {
      var _row$subRows;
      return !cell.getIsGrouped() && !cell.getIsPlaceholder() && !!((_row$subRows = row.subRows) != null && _row$subRows.length);
    };
  }
};
function orderColumns(leafColumns, grouping, groupedColumnMode) {
  if (!(grouping != null && grouping.length) || !groupedColumnMode) {
    return leafColumns;
  }
  const nonGroupingColumns = leafColumns.filter((col) => !grouping.includes(col.id));
  if (groupedColumnMode === "remove") {
    return nonGroupingColumns;
  }
  const groupingColumns = grouping.map((g) => leafColumns.find((col) => col.id === g)).filter(Boolean);
  return [...groupingColumns, ...nonGroupingColumns];
}
var Ordering = {
  getInitialState: (state) => {
    return {
      columnOrder: [],
      ...state
    };
  },
  getDefaultOptions: (table) => {
    return {
      onColumnOrderChange: makeStateUpdater("columnOrder", table)
    };
  },
  createTable: (table) => {
    table.setColumnOrder = (updater) => table.options.onColumnOrderChange == null ? void 0 : table.options.onColumnOrderChange(updater);
    table.resetColumnOrder = (defaultState) => {
      var _table$initialState$c;
      table.setColumnOrder(defaultState ? [] : (_table$initialState$c = table.initialState.columnOrder) != null ? _table$initialState$c : []);
    };
    table._getOrderColumnsFn = memo(() => [table.getState().columnOrder, table.getState().grouping, table.options.groupedColumnMode], (columnOrder, grouping, groupedColumnMode) => (columns2) => {
      let orderedColumns = [];
      if (!(columnOrder != null && columnOrder.length)) {
        orderedColumns = columns2;
      } else {
        const columnOrderCopy = [...columnOrder];
        const columnsCopy = [...columns2];
        while (columnsCopy.length && columnOrderCopy.length) {
          const targetColumnId = columnOrderCopy.shift();
          const foundIndex = columnsCopy.findIndex((d) => d.id === targetColumnId);
          if (foundIndex > -1) {
            orderedColumns.push(columnsCopy.splice(foundIndex, 1)[0]);
          }
        }
        orderedColumns = [...orderedColumns, ...columnsCopy];
      }
      return orderColumns(orderedColumns, grouping, groupedColumnMode);
    }, {
      key: "getOrderColumnsFn"
      // debug: () => table.options.debugAll ?? table.options.debugTable,
    });
  }
};
var defaultPageIndex = 0;
var defaultPageSize = 10;
var getDefaultPaginationState = () => ({
  pageIndex: defaultPageIndex,
  pageSize: defaultPageSize
});
var Pagination = {
  getInitialState: (state) => {
    return {
      ...state,
      pagination: {
        ...getDefaultPaginationState(),
        ...state == null ? void 0 : state.pagination
      }
    };
  },
  getDefaultOptions: (table) => {
    return {
      onPaginationChange: makeStateUpdater("pagination", table)
    };
  },
  createTable: (table) => {
    let registered = false;
    let queued = false;
    table._autoResetPageIndex = () => {
      var _ref18, _table$options$autoRe;
      if (!registered) {
        table._queue(() => {
          registered = true;
        });
        return;
      }
      if ((_ref18 = (_table$options$autoRe = table.options.autoResetAll) != null ? _table$options$autoRe : table.options.autoResetPageIndex) != null ? _ref18 : !table.options.manualPagination) {
        if (queued)
          return;
        queued = true;
        table._queue(() => {
          table.resetPageIndex();
          queued = false;
        });
      }
    };
    table.setPagination = (updater) => {
      const safeUpdater = (old) => {
        let newState = functionalUpdate(updater, old);
        return newState;
      };
      return table.options.onPaginationChange == null ? void 0 : table.options.onPaginationChange(safeUpdater);
    };
    table.resetPagination = (defaultState) => {
      var _table$initialState$p;
      table.setPagination(defaultState ? getDefaultPaginationState() : (_table$initialState$p = table.initialState.pagination) != null ? _table$initialState$p : getDefaultPaginationState());
    };
    table.setPageIndex = (updater) => {
      table.setPagination((old) => {
        let pageIndex = functionalUpdate(updater, old.pageIndex);
        const maxPageIndex = typeof table.options.pageCount === "undefined" || table.options.pageCount === -1 ? Number.MAX_SAFE_INTEGER : table.options.pageCount - 1;
        pageIndex = Math.max(0, Math.min(pageIndex, maxPageIndex));
        return {
          ...old,
          pageIndex
        };
      });
    };
    table.resetPageIndex = (defaultState) => {
      var _table$initialState$p2, _table$initialState;
      table.setPageIndex(defaultState ? defaultPageIndex : (_table$initialState$p2 = (_table$initialState = table.initialState) == null || (_table$initialState = _table$initialState.pagination) == null ? void 0 : _table$initialState.pageIndex) != null ? _table$initialState$p2 : defaultPageIndex);
    };
    table.resetPageSize = (defaultState) => {
      var _table$initialState$p3, _table$initialState2;
      table.setPageSize(defaultState ? defaultPageSize : (_table$initialState$p3 = (_table$initialState2 = table.initialState) == null || (_table$initialState2 = _table$initialState2.pagination) == null ? void 0 : _table$initialState2.pageSize) != null ? _table$initialState$p3 : defaultPageSize);
    };
    table.setPageSize = (updater) => {
      table.setPagination((old) => {
        const pageSize = Math.max(1, functionalUpdate(updater, old.pageSize));
        const topRowIndex = old.pageSize * old.pageIndex;
        const pageIndex = Math.floor(topRowIndex / pageSize);
        return {
          ...old,
          pageIndex,
          pageSize
        };
      });
    };
    table.setPageCount = (updater) => table.setPagination((old) => {
      var _table$options$pageCo;
      let newPageCount = functionalUpdate(updater, (_table$options$pageCo = table.options.pageCount) != null ? _table$options$pageCo : -1);
      if (typeof newPageCount === "number") {
        newPageCount = Math.max(-1, newPageCount);
      }
      return {
        ...old,
        pageCount: newPageCount
      };
    });
    table.getPageOptions = memo(() => [table.getPageCount()], (pageCount) => {
      let pageOptions = [];
      if (pageCount && pageCount > 0) {
        pageOptions = [...new Array(pageCount)].fill(null).map((_, i2) => i2);
      }
      return pageOptions;
    }, {
      key: "getPageOptions",
      debug: () => {
        var _table$options$debugA;
        return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugTable;
      }
    });
    table.getCanPreviousPage = () => table.getState().pagination.pageIndex > 0;
    table.getCanNextPage = () => {
      const {
        pageIndex
      } = table.getState().pagination;
      const pageCount = table.getPageCount();
      if (pageCount === -1) {
        return true;
      }
      if (pageCount === 0) {
        return false;
      }
      return pageIndex < pageCount - 1;
    };
    table.previousPage = () => {
      return table.setPageIndex((old) => old - 1);
    };
    table.nextPage = () => {
      return table.setPageIndex((old) => {
        return old + 1;
      });
    };
    table.getPrePaginationRowModel = () => table.getExpandedRowModel();
    table.getPaginationRowModel = () => {
      if (!table._getPaginationRowModel && table.options.getPaginationRowModel) {
        table._getPaginationRowModel = table.options.getPaginationRowModel(table);
      }
      if (table.options.manualPagination || !table._getPaginationRowModel) {
        return table.getPrePaginationRowModel();
      }
      return table._getPaginationRowModel();
    };
    table.getPageCount = () => {
      var _table$options$pageCo2;
      return (_table$options$pageCo2 = table.options.pageCount) != null ? _table$options$pageCo2 : Math.ceil(table.getPrePaginationRowModel().rows.length / table.getState().pagination.pageSize);
    };
  }
};
var getDefaultColumnPinningState = () => ({
  left: [],
  right: []
});
var getDefaultRowPinningState = () => ({
  top: [],
  bottom: []
});
var Pinning = {
  getInitialState: (state) => {
    return {
      columnPinning: getDefaultColumnPinningState(),
      rowPinning: getDefaultRowPinningState(),
      ...state
    };
  },
  getDefaultOptions: (table) => {
    return {
      onColumnPinningChange: makeStateUpdater("columnPinning", table),
      onRowPinningChange: makeStateUpdater("rowPinning", table)
    };
  },
  createColumn: (column2, table) => {
    column2.pin = (position2) => {
      const columnIds = column2.getLeafColumns().map((d) => d.id).filter(Boolean);
      table.setColumnPinning((old) => {
        var _old$left3, _old$right3;
        if (position2 === "right") {
          var _old$left, _old$right;
          return {
            left: ((_old$left = old == null ? void 0 : old.left) != null ? _old$left : []).filter((d) => !(columnIds != null && columnIds.includes(d))),
            right: [...((_old$right = old == null ? void 0 : old.right) != null ? _old$right : []).filter((d) => !(columnIds != null && columnIds.includes(d))), ...columnIds]
          };
        }
        if (position2 === "left") {
          var _old$left2, _old$right2;
          return {
            left: [...((_old$left2 = old == null ? void 0 : old.left) != null ? _old$left2 : []).filter((d) => !(columnIds != null && columnIds.includes(d))), ...columnIds],
            right: ((_old$right2 = old == null ? void 0 : old.right) != null ? _old$right2 : []).filter((d) => !(columnIds != null && columnIds.includes(d)))
          };
        }
        return {
          left: ((_old$left3 = old == null ? void 0 : old.left) != null ? _old$left3 : []).filter((d) => !(columnIds != null && columnIds.includes(d))),
          right: ((_old$right3 = old == null ? void 0 : old.right) != null ? _old$right3 : []).filter((d) => !(columnIds != null && columnIds.includes(d)))
        };
      });
    };
    column2.getCanPin = () => {
      const leafColumns = column2.getLeafColumns();
      return leafColumns.some((d) => {
        var _d$columnDef$enablePi, _ref18, _table$options$enable;
        return ((_d$columnDef$enablePi = d.columnDef.enablePinning) != null ? _d$columnDef$enablePi : true) && ((_ref18 = (_table$options$enable = table.options.enableColumnPinning) != null ? _table$options$enable : table.options.enablePinning) != null ? _ref18 : true);
      });
    };
    column2.getIsPinned = () => {
      const leafColumnIds = column2.getLeafColumns().map((d) => d.id);
      const {
        left,
        right
      } = table.getState().columnPinning;
      const isLeft = leafColumnIds.some((d) => left == null ? void 0 : left.includes(d));
      const isRight = leafColumnIds.some((d) => right == null ? void 0 : right.includes(d));
      return isLeft ? "left" : isRight ? "right" : false;
    };
    column2.getPinnedIndex = () => {
      var _table$getState$colum, _table$getState$colum2;
      const position2 = column2.getIsPinned();
      return position2 ? (_table$getState$colum = (_table$getState$colum2 = table.getState().columnPinning) == null || (_table$getState$colum2 = _table$getState$colum2[position2]) == null ? void 0 : _table$getState$colum2.indexOf(column2.id)) != null ? _table$getState$colum : -1 : 0;
    };
  },
  createRow: (row, table) => {
    row.pin = (position2, includeLeafRows, includeParentRows) => {
      const leafRowIds = includeLeafRows ? row.getLeafRows().map((_ref22) => {
        let {
          id: id2
        } = _ref22;
        return id2;
      }) : [];
      const parentRowIds = includeParentRows ? row.getParentRows().map((_ref32) => {
        let {
          id: id2
        } = _ref32;
        return id2;
      }) : [];
      const rowIds = /* @__PURE__ */ new Set([...parentRowIds, row.id, ...leafRowIds]);
      table.setRowPinning((old) => {
        var _old$top3, _old$bottom3;
        if (position2 === "bottom") {
          var _old$top, _old$bottom;
          return {
            top: ((_old$top = old == null ? void 0 : old.top) != null ? _old$top : []).filter((d) => !(rowIds != null && rowIds.has(d))),
            bottom: [...((_old$bottom = old == null ? void 0 : old.bottom) != null ? _old$bottom : []).filter((d) => !(rowIds != null && rowIds.has(d))), ...Array.from(rowIds)]
          };
        }
        if (position2 === "top") {
          var _old$top2, _old$bottom2;
          return {
            top: [...((_old$top2 = old == null ? void 0 : old.top) != null ? _old$top2 : []).filter((d) => !(rowIds != null && rowIds.has(d))), ...Array.from(rowIds)],
            bottom: ((_old$bottom2 = old == null ? void 0 : old.bottom) != null ? _old$bottom2 : []).filter((d) => !(rowIds != null && rowIds.has(d)))
          };
        }
        return {
          top: ((_old$top3 = old == null ? void 0 : old.top) != null ? _old$top3 : []).filter((d) => !(rowIds != null && rowIds.has(d))),
          bottom: ((_old$bottom3 = old == null ? void 0 : old.bottom) != null ? _old$bottom3 : []).filter((d) => !(rowIds != null && rowIds.has(d)))
        };
      });
    };
    row.getCanPin = () => {
      var _ref42;
      const {
        enableRowPinning,
        enablePinning
      } = table.options;
      if (typeof enableRowPinning === "function") {
        return enableRowPinning(row);
      }
      return (_ref42 = enableRowPinning != null ? enableRowPinning : enablePinning) != null ? _ref42 : true;
    };
    row.getIsPinned = () => {
      const rowIds = [row.id];
      const {
        top: top2,
        bottom
      } = table.getState().rowPinning;
      const isTop = rowIds.some((d) => top2 == null ? void 0 : top2.includes(d));
      const isBottom = rowIds.some((d) => bottom == null ? void 0 : bottom.includes(d));
      return isTop ? "top" : isBottom ? "bottom" : false;
    };
    row.getPinnedIndex = () => {
      var _table$_getPinnedRows, _visiblePinnedRowIds$;
      const position2 = row.getIsPinned();
      if (!position2)
        return -1;
      const visiblePinnedRowIds = (_table$_getPinnedRows = table._getPinnedRows(position2)) == null ? void 0 : _table$_getPinnedRows.map((_ref52) => {
        let {
          id: id2
        } = _ref52;
        return id2;
      });
      return (_visiblePinnedRowIds$ = visiblePinnedRowIds == null ? void 0 : visiblePinnedRowIds.indexOf(row.id)) != null ? _visiblePinnedRowIds$ : -1;
    };
    row.getCenterVisibleCells = memo(() => [row._getAllVisibleCells(), table.getState().columnPinning.left, table.getState().columnPinning.right], (allCells, left, right) => {
      const leftAndRight = [...left != null ? left : [], ...right != null ? right : []];
      return allCells.filter((d) => !leftAndRight.includes(d.column.id));
    }, {
      key: "row.getCenterVisibleCells",
      debug: () => {
        var _table$options$debugA;
        return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugRows;
      }
    });
    row.getLeftVisibleCells = memo(() => [row._getAllVisibleCells(), table.getState().columnPinning.left, ,], (allCells, left) => {
      const cells = (left != null ? left : []).map((columnId) => allCells.find((cell) => cell.column.id === columnId)).filter(Boolean).map((d) => ({
        ...d,
        position: "left"
      }));
      return cells;
    }, {
      key: "row.getLeftVisibleCells",
      debug: () => {
        var _table$options$debugA2;
        return (_table$options$debugA2 = table.options.debugAll) != null ? _table$options$debugA2 : table.options.debugRows;
      }
    });
    row.getRightVisibleCells = memo(() => [row._getAllVisibleCells(), table.getState().columnPinning.right], (allCells, right) => {
      const cells = (right != null ? right : []).map((columnId) => allCells.find((cell) => cell.column.id === columnId)).filter(Boolean).map((d) => ({
        ...d,
        position: "right"
      }));
      return cells;
    }, {
      key: "row.getRightVisibleCells",
      debug: () => {
        var _table$options$debugA3;
        return (_table$options$debugA3 = table.options.debugAll) != null ? _table$options$debugA3 : table.options.debugRows;
      }
    });
  },
  createTable: (table) => {
    table.setColumnPinning = (updater) => table.options.onColumnPinningChange == null ? void 0 : table.options.onColumnPinningChange(updater);
    table.resetColumnPinning = (defaultState) => {
      var _table$initialState$c, _table$initialState;
      return table.setColumnPinning(defaultState ? getDefaultColumnPinningState() : (_table$initialState$c = (_table$initialState = table.initialState) == null ? void 0 : _table$initialState.columnPinning) != null ? _table$initialState$c : getDefaultColumnPinningState());
    };
    table.getIsSomeColumnsPinned = (position2) => {
      var _pinningState$positio;
      const pinningState = table.getState().columnPinning;
      if (!position2) {
        var _pinningState$left, _pinningState$right;
        return Boolean(((_pinningState$left = pinningState.left) == null ? void 0 : _pinningState$left.length) || ((_pinningState$right = pinningState.right) == null ? void 0 : _pinningState$right.length));
      }
      return Boolean((_pinningState$positio = pinningState[position2]) == null ? void 0 : _pinningState$positio.length);
    };
    table.getLeftLeafColumns = memo(() => [table.getAllLeafColumns(), table.getState().columnPinning.left], (allColumns, left) => {
      return (left != null ? left : []).map((columnId) => allColumns.find((column2) => column2.id === columnId)).filter(Boolean);
    }, {
      key: "getLeftLeafColumns",
      debug: () => {
        var _table$options$debugA4;
        return (_table$options$debugA4 = table.options.debugAll) != null ? _table$options$debugA4 : table.options.debugColumns;
      }
    });
    table.getRightLeafColumns = memo(() => [table.getAllLeafColumns(), table.getState().columnPinning.right], (allColumns, right) => {
      return (right != null ? right : []).map((columnId) => allColumns.find((column2) => column2.id === columnId)).filter(Boolean);
    }, {
      key: "getRightLeafColumns",
      debug: () => {
        var _table$options$debugA5;
        return (_table$options$debugA5 = table.options.debugAll) != null ? _table$options$debugA5 : table.options.debugColumns;
      }
    });
    table.getCenterLeafColumns = memo(() => [table.getAllLeafColumns(), table.getState().columnPinning.left, table.getState().columnPinning.right], (allColumns, left, right) => {
      const leftAndRight = [...left != null ? left : [], ...right != null ? right : []];
      return allColumns.filter((d) => !leftAndRight.includes(d.id));
    }, {
      key: "getCenterLeafColumns",
      debug: () => {
        var _table$options$debugA6;
        return (_table$options$debugA6 = table.options.debugAll) != null ? _table$options$debugA6 : table.options.debugColumns;
      }
    });
    table.setRowPinning = (updater) => table.options.onRowPinningChange == null ? void 0 : table.options.onRowPinningChange(updater);
    table.resetRowPinning = (defaultState) => {
      var _table$initialState$r, _table$initialState2;
      return table.setRowPinning(defaultState ? getDefaultRowPinningState() : (_table$initialState$r = (_table$initialState2 = table.initialState) == null ? void 0 : _table$initialState2.rowPinning) != null ? _table$initialState$r : getDefaultRowPinningState());
    };
    table.getIsSomeRowsPinned = (position2) => {
      var _pinningState$positio2;
      const pinningState = table.getState().rowPinning;
      if (!position2) {
        var _pinningState$top, _pinningState$bottom;
        return Boolean(((_pinningState$top = pinningState.top) == null ? void 0 : _pinningState$top.length) || ((_pinningState$bottom = pinningState.bottom) == null ? void 0 : _pinningState$bottom.length));
      }
      return Boolean((_pinningState$positio2 = pinningState[position2]) == null ? void 0 : _pinningState$positio2.length);
    };
    table._getPinnedRows = (position2) => memo(() => [table.getRowModel().rows, table.getState().rowPinning[position2]], (visibleRows, pinnedRowIds) => {
      var _table$options$keepPi;
      const rows = ((_table$options$keepPi = table.options.keepPinnedRows) != null ? _table$options$keepPi : true) ? (
        //get all rows that are pinned even if they would not be otherwise visible
        //account for expanded parent rows, but not pagination or filtering
        (pinnedRowIds != null ? pinnedRowIds : []).map((rowId) => {
          const row = table.getRow(rowId, true);
          return row.getIsAllParentsExpanded() ? row : null;
        })
      ) : (
        //else get only visible rows that are pinned
        (pinnedRowIds != null ? pinnedRowIds : []).map((rowId) => visibleRows.find((row) => row.id === rowId))
      );
      return rows.filter(Boolean).map((d) => ({
        ...d,
        position: position2
      }));
    }, {
      key: `row.get${position2 === "top" ? "Top" : "Bottom"}Rows`,
      debug: () => {
        var _table$options$debugA7;
        return (_table$options$debugA7 = table.options.debugAll) != null ? _table$options$debugA7 : table.options.debugRows;
      }
    })();
    table.getTopRows = () => table._getPinnedRows("top");
    table.getBottomRows = () => table._getPinnedRows("bottom");
    table.getCenterRows = memo(() => [table.getRowModel().rows, table.getState().rowPinning.top, table.getState().rowPinning.bottom], (allRows, top2, bottom) => {
      const topAndBottom = /* @__PURE__ */ new Set([...top2 != null ? top2 : [], ...bottom != null ? bottom : []]);
      return allRows.filter((d) => !topAndBottom.has(d.id));
    }, {
      key: "row.getCenterRows",
      debug: () => {
        var _table$options$debugA8;
        return (_table$options$debugA8 = table.options.debugAll) != null ? _table$options$debugA8 : table.options.debugRows;
      }
    });
  }
};
var RowSelection = {
  getInitialState: (state) => {
    return {
      rowSelection: {},
      ...state
    };
  },
  getDefaultOptions: (table) => {
    return {
      onRowSelectionChange: makeStateUpdater("rowSelection", table),
      enableRowSelection: true,
      enableMultiRowSelection: true,
      enableSubRowSelection: true
      // enableGroupingRowSelection: false,
      // isAdditiveSelectEvent: (e: unknown) => !!e.metaKey,
      // isInclusiveSelectEvent: (e: unknown) => !!e.shiftKey,
    };
  },
  createTable: (table) => {
    table.setRowSelection = (updater) => table.options.onRowSelectionChange == null ? void 0 : table.options.onRowSelectionChange(updater);
    table.resetRowSelection = (defaultState) => {
      var _table$initialState$r;
      return table.setRowSelection(defaultState ? {} : (_table$initialState$r = table.initialState.rowSelection) != null ? _table$initialState$r : {});
    };
    table.toggleAllRowsSelected = (value) => {
      table.setRowSelection((old) => {
        value = typeof value !== "undefined" ? value : !table.getIsAllRowsSelected();
        const rowSelection = {
          ...old
        };
        const preGroupedFlatRows = table.getPreGroupedRowModel().flatRows;
        if (value) {
          preGroupedFlatRows.forEach((row) => {
            if (!row.getCanSelect()) {
              return;
            }
            rowSelection[row.id] = true;
          });
        } else {
          preGroupedFlatRows.forEach((row) => {
            delete rowSelection[row.id];
          });
        }
        return rowSelection;
      });
    };
    table.toggleAllPageRowsSelected = (value) => table.setRowSelection((old) => {
      const resolvedValue = typeof value !== "undefined" ? value : !table.getIsAllPageRowsSelected();
      const rowSelection = {
        ...old
      };
      table.getRowModel().rows.forEach((row) => {
        mutateRowIsSelected(rowSelection, row.id, resolvedValue, true, table);
      });
      return rowSelection;
    });
    table.getPreSelectedRowModel = () => table.getCoreRowModel();
    table.getSelectedRowModel = memo(() => [table.getState().rowSelection, table.getCoreRowModel()], (rowSelection, rowModel) => {
      if (!Object.keys(rowSelection).length) {
        return {
          rows: [],
          flatRows: [],
          rowsById: {}
        };
      }
      return selectRowsFn(table, rowModel);
    }, {
      key: "getSelectedRowModel",
      debug: () => {
        var _table$options$debugA;
        return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugTable;
      }
    });
    table.getFilteredSelectedRowModel = memo(() => [table.getState().rowSelection, table.getFilteredRowModel()], (rowSelection, rowModel) => {
      if (!Object.keys(rowSelection).length) {
        return {
          rows: [],
          flatRows: [],
          rowsById: {}
        };
      }
      return selectRowsFn(table, rowModel);
    }, {
      key: false,
      debug: () => {
        var _table$options$debugA2;
        return (_table$options$debugA2 = table.options.debugAll) != null ? _table$options$debugA2 : table.options.debugTable;
      }
    });
    table.getGroupedSelectedRowModel = memo(() => [table.getState().rowSelection, table.getSortedRowModel()], (rowSelection, rowModel) => {
      if (!Object.keys(rowSelection).length) {
        return {
          rows: [],
          flatRows: [],
          rowsById: {}
        };
      }
      return selectRowsFn(table, rowModel);
    }, {
      key: false,
      debug: () => {
        var _table$options$debugA3;
        return (_table$options$debugA3 = table.options.debugAll) != null ? _table$options$debugA3 : table.options.debugTable;
      }
    });
    table.getIsAllRowsSelected = () => {
      const preGroupedFlatRows = table.getFilteredRowModel().flatRows;
      const {
        rowSelection
      } = table.getState();
      let isAllRowsSelected = Boolean(preGroupedFlatRows.length && Object.keys(rowSelection).length);
      if (isAllRowsSelected) {
        if (preGroupedFlatRows.some((row) => row.getCanSelect() && !rowSelection[row.id])) {
          isAllRowsSelected = false;
        }
      }
      return isAllRowsSelected;
    };
    table.getIsAllPageRowsSelected = () => {
      const paginationFlatRows = table.getPaginationRowModel().flatRows.filter((row) => row.getCanSelect());
      const {
        rowSelection
      } = table.getState();
      let isAllPageRowsSelected = !!paginationFlatRows.length;
      if (isAllPageRowsSelected && paginationFlatRows.some((row) => !rowSelection[row.id])) {
        isAllPageRowsSelected = false;
      }
      return isAllPageRowsSelected;
    };
    table.getIsSomeRowsSelected = () => {
      var _table$getState$rowSe;
      const totalSelected = Object.keys((_table$getState$rowSe = table.getState().rowSelection) != null ? _table$getState$rowSe : {}).length;
      return totalSelected > 0 && totalSelected < table.getFilteredRowModel().flatRows.length;
    };
    table.getIsSomePageRowsSelected = () => {
      const paginationFlatRows = table.getPaginationRowModel().flatRows;
      return table.getIsAllPageRowsSelected() ? false : paginationFlatRows.filter((row) => row.getCanSelect()).some((d) => d.getIsSelected() || d.getIsSomeSelected());
    };
    table.getToggleAllRowsSelectedHandler = () => {
      return (e3) => {
        table.toggleAllRowsSelected(e3.target.checked);
      };
    };
    table.getToggleAllPageRowsSelectedHandler = () => {
      return (e3) => {
        table.toggleAllPageRowsSelected(e3.target.checked);
      };
    };
  },
  createRow: (row, table) => {
    row.toggleSelected = (value, opts) => {
      const isSelected = row.getIsSelected();
      table.setRowSelection((old) => {
        var _opts$selectChildren;
        value = typeof value !== "undefined" ? value : !isSelected;
        if (row.getCanSelect() && isSelected === value) {
          return old;
        }
        const selectedRowIds = {
          ...old
        };
        mutateRowIsSelected(selectedRowIds, row.id, value, (_opts$selectChildren = opts == null ? void 0 : opts.selectChildren) != null ? _opts$selectChildren : true, table);
        return selectedRowIds;
      });
    };
    row.getIsSelected = () => {
      const {
        rowSelection
      } = table.getState();
      return isRowSelected(row, rowSelection);
    };
    row.getIsSomeSelected = () => {
      const {
        rowSelection
      } = table.getState();
      return isSubRowSelected(row, rowSelection) === "some";
    };
    row.getIsAllSubRowsSelected = () => {
      const {
        rowSelection
      } = table.getState();
      return isSubRowSelected(row, rowSelection) === "all";
    };
    row.getCanSelect = () => {
      var _table$options$enable;
      if (typeof table.options.enableRowSelection === "function") {
        return table.options.enableRowSelection(row);
      }
      return (_table$options$enable = table.options.enableRowSelection) != null ? _table$options$enable : true;
    };
    row.getCanSelectSubRows = () => {
      var _table$options$enable2;
      if (typeof table.options.enableSubRowSelection === "function") {
        return table.options.enableSubRowSelection(row);
      }
      return (_table$options$enable2 = table.options.enableSubRowSelection) != null ? _table$options$enable2 : true;
    };
    row.getCanMultiSelect = () => {
      var _table$options$enable3;
      if (typeof table.options.enableMultiRowSelection === "function") {
        return table.options.enableMultiRowSelection(row);
      }
      return (_table$options$enable3 = table.options.enableMultiRowSelection) != null ? _table$options$enable3 : true;
    };
    row.getToggleSelectedHandler = () => {
      const canSelect = row.getCanSelect();
      return (e3) => {
        var _target2;
        if (!canSelect)
          return;
        row.toggleSelected((_target2 = e3.target) == null ? void 0 : _target2.checked);
      };
    };
  }
};
var mutateRowIsSelected = (selectedRowIds, id2, value, includeChildren, table) => {
  var _row$subRows;
  const row = table.getRow(id2);
  if (value) {
    if (!row.getCanMultiSelect()) {
      Object.keys(selectedRowIds).forEach((key) => delete selectedRowIds[key]);
    }
    if (row.getCanSelect()) {
      selectedRowIds[id2] = true;
    }
  } else {
    delete selectedRowIds[id2];
  }
  if (includeChildren && (_row$subRows = row.subRows) != null && _row$subRows.length && row.getCanSelectSubRows()) {
    row.subRows.forEach((row2) => mutateRowIsSelected(selectedRowIds, row2.id, value, includeChildren, table));
  }
};
function selectRowsFn(table, rowModel) {
  const rowSelection = table.getState().rowSelection;
  const newSelectedFlatRows = [];
  const newSelectedRowsById = {};
  const recurseRows = function(rows, depth) {
    return rows.map((row) => {
      var _row$subRows2;
      const isSelected = isRowSelected(row, rowSelection);
      if (isSelected) {
        newSelectedFlatRows.push(row);
        newSelectedRowsById[row.id] = row;
      }
      if ((_row$subRows2 = row.subRows) != null && _row$subRows2.length) {
        row = {
          ...row,
          subRows: recurseRows(row.subRows)
        };
      }
      if (isSelected) {
        return row;
      }
    }).filter(Boolean);
  };
  return {
    rows: recurseRows(rowModel.rows),
    flatRows: newSelectedFlatRows,
    rowsById: newSelectedRowsById
  };
}
function isRowSelected(row, selection2) {
  var _selection$row$id;
  return (_selection$row$id = selection2[row.id]) != null ? _selection$row$id : false;
}
function isSubRowSelected(row, selection2, table) {
  var _row$subRows3;
  if (!((_row$subRows3 = row.subRows) != null && _row$subRows3.length))
    return false;
  let allChildrenSelected = true;
  let someSelected = false;
  row.subRows.forEach((subRow) => {
    if (someSelected && !allChildrenSelected) {
      return;
    }
    if (subRow.getCanSelect()) {
      if (isRowSelected(subRow, selection2)) {
        someSelected = true;
      } else {
        allChildrenSelected = false;
      }
    }
    if (subRow.subRows && subRow.subRows.length) {
      const subRowChildrenSelected = isSubRowSelected(subRow, selection2);
      if (subRowChildrenSelected === "all") {
        someSelected = true;
      } else if (subRowChildrenSelected === "some") {
        someSelected = true;
        allChildrenSelected = false;
      } else {
        allChildrenSelected = false;
      }
    }
  });
  return allChildrenSelected ? "all" : someSelected ? "some" : false;
}
var reSplitAlphaNumeric = /([0-9]+)/gm;
var alphanumeric = (rowA, rowB, columnId) => {
  return compareAlphanumeric(toString(rowA.getValue(columnId)).toLowerCase(), toString(rowB.getValue(columnId)).toLowerCase());
};
var alphanumericCaseSensitive = (rowA, rowB, columnId) => {
  return compareAlphanumeric(toString(rowA.getValue(columnId)), toString(rowB.getValue(columnId)));
};
var text = (rowA, rowB, columnId) => {
  return compareBasic(toString(rowA.getValue(columnId)).toLowerCase(), toString(rowB.getValue(columnId)).toLowerCase());
};
var textCaseSensitive = (rowA, rowB, columnId) => {
  return compareBasic(toString(rowA.getValue(columnId)), toString(rowB.getValue(columnId)));
};
var datetime = (rowA, rowB, columnId) => {
  const a2 = rowA.getValue(columnId);
  const b = rowB.getValue(columnId);
  return a2 > b ? 1 : a2 < b ? -1 : 0;
};
var basic = (rowA, rowB, columnId) => {
  return compareBasic(rowA.getValue(columnId), rowB.getValue(columnId));
};
function compareBasic(a2, b) {
  return a2 === b ? 0 : a2 > b ? 1 : -1;
}
function toString(a2) {
  if (typeof a2 === "number") {
    if (isNaN(a2) || a2 === Infinity || a2 === -Infinity) {
      return "";
    }
    return String(a2);
  }
  if (typeof a2 === "string") {
    return a2;
  }
  return "";
}
function compareAlphanumeric(aStr, bStr) {
  const a2 = aStr.split(reSplitAlphaNumeric).filter(Boolean);
  const b = bStr.split(reSplitAlphaNumeric).filter(Boolean);
  while (a2.length && b.length) {
    const aa = a2.shift();
    const bb = b.shift();
    const an = parseInt(aa, 10);
    const bn = parseInt(bb, 10);
    const combo = [an, bn].sort();
    if (isNaN(combo[0])) {
      if (aa > bb) {
        return 1;
      }
      if (bb > aa) {
        return -1;
      }
      continue;
    }
    if (isNaN(combo[1])) {
      return isNaN(an) ? -1 : 1;
    }
    if (an > bn) {
      return 1;
    }
    if (bn > an) {
      return -1;
    }
  }
  return a2.length - b.length;
}
var sortingFns = {
  alphanumeric,
  alphanumericCaseSensitive,
  text,
  textCaseSensitive,
  datetime,
  basic
};
var Sorting = {
  getInitialState: (state) => {
    return {
      sorting: [],
      ...state
    };
  },
  getDefaultColumnDef: () => {
    return {
      sortingFn: "auto",
      sortUndefined: 1
    };
  },
  getDefaultOptions: (table) => {
    return {
      onSortingChange: makeStateUpdater("sorting", table),
      isMultiSortEvent: (e3) => {
        return e3.shiftKey;
      }
    };
  },
  createColumn: (column2, table) => {
    column2.getAutoSortingFn = () => {
      const firstRows = table.getFilteredRowModel().flatRows.slice(10);
      let isString2 = false;
      for (const row of firstRows) {
        const value = row == null ? void 0 : row.getValue(column2.id);
        if (Object.prototype.toString.call(value) === "[object Date]") {
          return sortingFns.datetime;
        }
        if (typeof value === "string") {
          isString2 = true;
          if (value.split(reSplitAlphaNumeric).length > 1) {
            return sortingFns.alphanumeric;
          }
        }
      }
      if (isString2) {
        return sortingFns.text;
      }
      return sortingFns.basic;
    };
    column2.getAutoSortDir = () => {
      const firstRow = table.getFilteredRowModel().flatRows[0];
      const value = firstRow == null ? void 0 : firstRow.getValue(column2.id);
      if (typeof value === "string") {
        return "asc";
      }
      return "desc";
    };
    column2.getSortingFn = () => {
      var _table$options$sortin, _table$options$sortin2;
      if (!column2) {
        throw new Error();
      }
      return isFunction(column2.columnDef.sortingFn) ? column2.columnDef.sortingFn : column2.columnDef.sortingFn === "auto" ? column2.getAutoSortingFn() : (_table$options$sortin = (_table$options$sortin2 = table.options.sortingFns) == null ? void 0 : _table$options$sortin2[column2.columnDef.sortingFn]) != null ? _table$options$sortin : sortingFns[column2.columnDef.sortingFn];
    };
    column2.toggleSorting = (desc, multi) => {
      const nextSortingOrder = column2.getNextSortingOrder();
      const hasManualValue = typeof desc !== "undefined" && desc !== null;
      table.setSorting((old) => {
        const existingSorting = old == null ? void 0 : old.find((d) => d.id === column2.id);
        const existingIndex = old == null ? void 0 : old.findIndex((d) => d.id === column2.id);
        let newSorting = [];
        let sortAction;
        let nextDesc = hasManualValue ? desc : nextSortingOrder === "desc";
        if (old != null && old.length && column2.getCanMultiSort() && multi) {
          if (existingSorting) {
            sortAction = "toggle";
          } else {
            sortAction = "add";
          }
        } else {
          if (old != null && old.length && existingIndex !== old.length - 1) {
            sortAction = "replace";
          } else if (existingSorting) {
            sortAction = "toggle";
          } else {
            sortAction = "replace";
          }
        }
        if (sortAction === "toggle") {
          if (!hasManualValue) {
            if (!nextSortingOrder) {
              sortAction = "remove";
            }
          }
        }
        if (sortAction === "add") {
          var _table$options$maxMul;
          newSorting = [...old, {
            id: column2.id,
            desc: nextDesc
          }];
          newSorting.splice(0, newSorting.length - ((_table$options$maxMul = table.options.maxMultiSortColCount) != null ? _table$options$maxMul : Number.MAX_SAFE_INTEGER));
        } else if (sortAction === "toggle") {
          newSorting = old.map((d) => {
            if (d.id === column2.id) {
              return {
                ...d,
                desc: nextDesc
              };
            }
            return d;
          });
        } else if (sortAction === "remove") {
          newSorting = old.filter((d) => d.id !== column2.id);
        } else {
          newSorting = [{
            id: column2.id,
            desc: nextDesc
          }];
        }
        return newSorting;
      });
    };
    column2.getFirstSortDir = () => {
      var _ref18, _column$columnDef$sor;
      const sortDescFirst = (_ref18 = (_column$columnDef$sor = column2.columnDef.sortDescFirst) != null ? _column$columnDef$sor : table.options.sortDescFirst) != null ? _ref18 : column2.getAutoSortDir() === "desc";
      return sortDescFirst ? "desc" : "asc";
    };
    column2.getNextSortingOrder = (multi) => {
      var _table$options$enable, _table$options$enable2;
      const firstSortDirection = column2.getFirstSortDir();
      const isSorted = column2.getIsSorted();
      if (!isSorted) {
        return firstSortDirection;
      }
      if (isSorted !== firstSortDirection && ((_table$options$enable = table.options.enableSortingRemoval) != null ? _table$options$enable : true) && // If enableSortRemove, enable in general
      (multi ? (_table$options$enable2 = table.options.enableMultiRemove) != null ? _table$options$enable2 : true : true)) {
        return false;
      }
      return isSorted === "desc" ? "asc" : "desc";
    };
    column2.getCanSort = () => {
      var _column$columnDef$ena, _table$options$enable3;
      return ((_column$columnDef$ena = column2.columnDef.enableSorting) != null ? _column$columnDef$ena : true) && ((_table$options$enable3 = table.options.enableSorting) != null ? _table$options$enable3 : true) && !!column2.accessorFn;
    };
    column2.getCanMultiSort = () => {
      var _ref22, _column$columnDef$ena2;
      return (_ref22 = (_column$columnDef$ena2 = column2.columnDef.enableMultiSort) != null ? _column$columnDef$ena2 : table.options.enableMultiSort) != null ? _ref22 : !!column2.accessorFn;
    };
    column2.getIsSorted = () => {
      var _table$getState$sorti;
      const columnSort = (_table$getState$sorti = table.getState().sorting) == null ? void 0 : _table$getState$sorti.find((d) => d.id === column2.id);
      return !columnSort ? false : columnSort.desc ? "desc" : "asc";
    };
    column2.getSortIndex = () => {
      var _table$getState$sorti2, _table$getState$sorti3;
      return (_table$getState$sorti2 = (_table$getState$sorti3 = table.getState().sorting) == null ? void 0 : _table$getState$sorti3.findIndex((d) => d.id === column2.id)) != null ? _table$getState$sorti2 : -1;
    };
    column2.clearSorting = () => {
      table.setSorting((old) => old != null && old.length ? old.filter((d) => d.id !== column2.id) : []);
    };
    column2.getToggleSortingHandler = () => {
      const canSort = column2.getCanSort();
      return (e3) => {
        if (!canSort)
          return;
        e3.persist == null || e3.persist();
        column2.toggleSorting == null || column2.toggleSorting(void 0, column2.getCanMultiSort() ? table.options.isMultiSortEvent == null ? void 0 : table.options.isMultiSortEvent(e3) : false);
      };
    };
  },
  createTable: (table) => {
    table.setSorting = (updater) => table.options.onSortingChange == null ? void 0 : table.options.onSortingChange(updater);
    table.resetSorting = (defaultState) => {
      var _table$initialState$s, _table$initialState;
      table.setSorting(defaultState ? [] : (_table$initialState$s = (_table$initialState = table.initialState) == null ? void 0 : _table$initialState.sorting) != null ? _table$initialState$s : []);
    };
    table.getPreSortedRowModel = () => table.getGroupedRowModel();
    table.getSortedRowModel = () => {
      if (!table._getSortedRowModel && table.options.getSortedRowModel) {
        table._getSortedRowModel = table.options.getSortedRowModel(table);
      }
      if (table.options.manualSorting || !table._getSortedRowModel) {
        return table.getPreSortedRowModel();
      }
      return table._getSortedRowModel();
    };
  }
};
var Visibility = {
  getInitialState: (state) => {
    return {
      columnVisibility: {},
      ...state
    };
  },
  getDefaultOptions: (table) => {
    return {
      onColumnVisibilityChange: makeStateUpdater("columnVisibility", table)
    };
  },
  createColumn: (column2, table) => {
    column2.toggleVisibility = (value) => {
      if (column2.getCanHide()) {
        table.setColumnVisibility((old) => ({
          ...old,
          [column2.id]: value != null ? value : !column2.getIsVisible()
        }));
      }
    };
    column2.getIsVisible = () => {
      var _table$getState$colum, _table$getState$colum2;
      return (_table$getState$colum = (_table$getState$colum2 = table.getState().columnVisibility) == null ? void 0 : _table$getState$colum2[column2.id]) != null ? _table$getState$colum : true;
    };
    column2.getCanHide = () => {
      var _column$columnDef$ena, _table$options$enable;
      return ((_column$columnDef$ena = column2.columnDef.enableHiding) != null ? _column$columnDef$ena : true) && ((_table$options$enable = table.options.enableHiding) != null ? _table$options$enable : true);
    };
    column2.getToggleVisibilityHandler = () => {
      return (e3) => {
        column2.toggleVisibility == null || column2.toggleVisibility(e3.target.checked);
      };
    };
  },
  createRow: (row, table) => {
    row._getAllVisibleCells = memo(() => [row.getAllCells(), table.getState().columnVisibility], (cells) => {
      return cells.filter((cell) => cell.column.getIsVisible());
    }, {
      key: false,
      debug: () => {
        var _table$options$debugA;
        return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugRows;
      }
    });
    row.getVisibleCells = memo(() => [row.getLeftVisibleCells(), row.getCenterVisibleCells(), row.getRightVisibleCells()], (left, center, right) => [...left, ...center, ...right], {
      key: "row.getVisibleCells",
      debug: () => {
        var _table$options$debugA2;
        return (_table$options$debugA2 = table.options.debugAll) != null ? _table$options$debugA2 : table.options.debugRows;
      }
    });
  },
  createTable: (table) => {
    const makeVisibleColumnsMethod = (key, getColumns) => {
      return memo(() => [getColumns(), getColumns().filter((d) => d.getIsVisible()).map((d) => d.id).join("_")], (columns2) => {
        return columns2.filter((d) => d.getIsVisible == null ? void 0 : d.getIsVisible());
      }, {
        key,
        debug: () => {
          var _table$options$debugA3;
          return (_table$options$debugA3 = table.options.debugAll) != null ? _table$options$debugA3 : table.options.debugColumns;
        }
      });
    };
    table.getVisibleFlatColumns = makeVisibleColumnsMethod("getVisibleFlatColumns", () => table.getAllFlatColumns());
    table.getVisibleLeafColumns = makeVisibleColumnsMethod("getVisibleLeafColumns", () => table.getAllLeafColumns());
    table.getLeftVisibleLeafColumns = makeVisibleColumnsMethod("getLeftVisibleLeafColumns", () => table.getLeftLeafColumns());
    table.getRightVisibleLeafColumns = makeVisibleColumnsMethod("getRightVisibleLeafColumns", () => table.getRightLeafColumns());
    table.getCenterVisibleLeafColumns = makeVisibleColumnsMethod("getCenterVisibleLeafColumns", () => table.getCenterLeafColumns());
    table.setColumnVisibility = (updater) => table.options.onColumnVisibilityChange == null ? void 0 : table.options.onColumnVisibilityChange(updater);
    table.resetColumnVisibility = (defaultState) => {
      var _table$initialState$c;
      table.setColumnVisibility(defaultState ? {} : (_table$initialState$c = table.initialState.columnVisibility) != null ? _table$initialState$c : {});
    };
    table.toggleAllColumnsVisible = (value) => {
      var _value;
      value = (_value = value) != null ? _value : !table.getIsAllColumnsVisible();
      table.setColumnVisibility(table.getAllLeafColumns().reduce((obj, column2) => ({
        ...obj,
        [column2.id]: !value ? !(column2.getCanHide != null && column2.getCanHide()) : value
      }), {}));
    };
    table.getIsAllColumnsVisible = () => !table.getAllLeafColumns().some((column2) => !(column2.getIsVisible != null && column2.getIsVisible()));
    table.getIsSomeColumnsVisible = () => table.getAllLeafColumns().some((column2) => column2.getIsVisible == null ? void 0 : column2.getIsVisible());
    table.getToggleAllColumnsVisibilityHandler = () => {
      return (e3) => {
        var _target2;
        table.toggleAllColumnsVisible((_target2 = e3.target) == null ? void 0 : _target2.checked);
      };
    };
  }
};
var features = [Headers2, Visibility, Ordering, Pinning, Filters, Sorting, Grouping, Expanding, Pagination, RowSelection, ColumnSizing];
function createTable(options) {
  var _options$initialState;
  if (options.debugAll || options.debugTable) {
    console.info("Creating Table Instance...");
  }
  let table = {
    _features: features
  };
  const defaultOptions2 = table._features.reduce((obj, feature) => {
    return Object.assign(obj, feature.getDefaultOptions == null ? void 0 : feature.getDefaultOptions(table));
  }, {});
  const mergeOptions = (options2) => {
    if (table.options.mergeOptions) {
      return table.options.mergeOptions(defaultOptions2, options2);
    }
    return {
      ...defaultOptions2,
      ...options2
    };
  };
  const coreInitialState = {};
  let initialState = {
    ...coreInitialState,
    ...(_options$initialState = options.initialState) != null ? _options$initialState : {}
  };
  table._features.forEach((feature) => {
    var _feature$getInitialSt;
    initialState = (_feature$getInitialSt = feature.getInitialState == null ? void 0 : feature.getInitialState(initialState)) != null ? _feature$getInitialSt : initialState;
  });
  const queued = [];
  let queuedTimeout = false;
  const coreInstance = {
    _features: features,
    options: {
      ...defaultOptions2,
      ...options
    },
    initialState,
    _queue: (cb) => {
      queued.push(cb);
      if (!queuedTimeout) {
        queuedTimeout = true;
        Promise.resolve().then(() => {
          while (queued.length) {
            queued.shift()();
          }
          queuedTimeout = false;
        }).catch((error) => setTimeout(() => {
          throw error;
        }));
      }
    },
    reset: () => {
      table.setState(table.initialState);
    },
    setOptions: (updater) => {
      const newOptions = functionalUpdate(updater, table.options);
      table.options = mergeOptions(newOptions);
    },
    getState: () => {
      return table.options.state;
    },
    setState: (updater) => {
      table.options.onStateChange == null || table.options.onStateChange(updater);
    },
    _getRowId: (row, index, parent) => {
      var _table$options$getRow;
      return (_table$options$getRow = table.options.getRowId == null ? void 0 : table.options.getRowId(row, index, parent)) != null ? _table$options$getRow : `${parent ? [parent.id, index].join(".") : index}`;
    },
    getCoreRowModel: () => {
      if (!table._getCoreRowModel) {
        table._getCoreRowModel = table.options.getCoreRowModel(table);
      }
      return table._getCoreRowModel();
    },
    // The final calls start at the bottom of the model,
    // expanded rows, which then work their way up
    getRowModel: () => {
      return table.getPaginationRowModel();
    },
    getRow: (id2, searchAll) => {
      const row = (searchAll ? table.getCoreRowModel() : table.getRowModel()).rowsById[id2];
      if (!row) {
        if (true) {
          throw new Error(`getRow expected an ID, but got ${id2}`);
        }
        throw new Error();
      }
      return row;
    },
    _getDefaultColumnDef: memo(() => [table.options.defaultColumn], (defaultColumn) => {
      var _defaultColumn;
      defaultColumn = (_defaultColumn = defaultColumn) != null ? _defaultColumn : {};
      return {
        header: (props) => {
          const resolvedColumnDef = props.header.column.columnDef;
          if (resolvedColumnDef.accessorKey) {
            return resolvedColumnDef.accessorKey;
          }
          if (resolvedColumnDef.accessorFn) {
            return resolvedColumnDef.id;
          }
          return null;
        },
        // footer: props => props.header.column.id,
        cell: (props) => {
          var _props$renderValue$to, _props$renderValue;
          return (_props$renderValue$to = (_props$renderValue = props.renderValue()) == null || _props$renderValue.toString == null ? void 0 : _props$renderValue.toString()) != null ? _props$renderValue$to : null;
        },
        ...table._features.reduce((obj, feature) => {
          return Object.assign(obj, feature.getDefaultColumnDef == null ? void 0 : feature.getDefaultColumnDef());
        }, {}),
        ...defaultColumn
      };
    }, {
      debug: () => {
        var _table$options$debugA;
        return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugColumns;
      },
      key: "getDefaultColumnDef"
    }),
    _getColumnDefs: () => table.options.columns,
    getAllColumns: memo(() => [table._getColumnDefs()], (columnDefs) => {
      const recurseColumns = function(columnDefs2, parent, depth) {
        if (depth === void 0) {
          depth = 0;
        }
        return columnDefs2.map((columnDef) => {
          const column2 = createColumn(table, columnDef, depth, parent);
          const groupingColumnDef = columnDef;
          column2.columns = groupingColumnDef.columns ? recurseColumns(groupingColumnDef.columns, column2, depth + 1) : [];
          return column2;
        });
      };
      return recurseColumns(columnDefs);
    }, {
      key: "getAllColumns",
      debug: () => {
        var _table$options$debugA2;
        return (_table$options$debugA2 = table.options.debugAll) != null ? _table$options$debugA2 : table.options.debugColumns;
      }
    }),
    getAllFlatColumns: memo(() => [table.getAllColumns()], (allColumns) => {
      return allColumns.flatMap((column2) => {
        return column2.getFlatColumns();
      });
    }, {
      key: "getAllFlatColumns",
      debug: () => {
        var _table$options$debugA3;
        return (_table$options$debugA3 = table.options.debugAll) != null ? _table$options$debugA3 : table.options.debugColumns;
      }
    }),
    _getAllFlatColumnsById: memo(() => [table.getAllFlatColumns()], (flatColumns) => {
      return flatColumns.reduce((acc, column2) => {
        acc[column2.id] = column2;
        return acc;
      }, {});
    }, {
      key: "getAllFlatColumnsById",
      debug: () => {
        var _table$options$debugA4;
        return (_table$options$debugA4 = table.options.debugAll) != null ? _table$options$debugA4 : table.options.debugColumns;
      }
    }),
    getAllLeafColumns: memo(() => [table.getAllColumns(), table._getOrderColumnsFn()], (allColumns, orderColumns2) => {
      let leafColumns = allColumns.flatMap((column2) => column2.getLeafColumns());
      return orderColumns2(leafColumns);
    }, {
      key: "getAllLeafColumns",
      debug: () => {
        var _table$options$debugA5;
        return (_table$options$debugA5 = table.options.debugAll) != null ? _table$options$debugA5 : table.options.debugColumns;
      }
    }),
    getColumn: (columnId) => {
      const column2 = table._getAllFlatColumnsById()[columnId];
      if (!column2) {
        console.error(`[Table] Column with id '${columnId}' does not exist.`);
      }
      return column2;
    }
  };
  Object.assign(table, coreInstance);
  for (let index = 0; index < table._features.length; index++) {
    const feature = table._features[index];
    feature == null || feature.createTable == null || feature.createTable(table);
  }
  return table;
}
function createCell(table, row, column2, columnId) {
  const getRenderValue = () => {
    var _cell$getValue;
    return (_cell$getValue = cell.getValue()) != null ? _cell$getValue : table.options.renderFallbackValue;
  };
  const cell = {
    id: `${row.id}_${column2.id}`,
    row,
    column: column2,
    getValue: () => row.getValue(columnId),
    renderValue: getRenderValue,
    getContext: memo(() => [table, column2, row, cell], (table2, column3, row2, cell2) => ({
      table: table2,
      column: column3,
      row: row2,
      cell: cell2,
      getValue: cell2.getValue,
      renderValue: cell2.renderValue
    }), {
      key: "cell.getContext",
      debug: () => table.options.debugAll
    })
  };
  table._features.forEach((feature) => {
    feature.createCell == null || feature.createCell(cell, column2, row, table);
  }, {});
  return cell;
}
var createRow = (table, id2, original, rowIndex, depth, subRows, parentId) => {
  let row = {
    id: id2,
    index: rowIndex,
    original,
    depth,
    parentId,
    _valuesCache: {},
    _uniqueValuesCache: {},
    getValue: (columnId) => {
      if (row._valuesCache.hasOwnProperty(columnId)) {
        return row._valuesCache[columnId];
      }
      const column2 = table.getColumn(columnId);
      if (!(column2 != null && column2.accessorFn)) {
        return void 0;
      }
      row._valuesCache[columnId] = column2.accessorFn(row.original, rowIndex);
      return row._valuesCache[columnId];
    },
    getUniqueValues: (columnId) => {
      if (row._uniqueValuesCache.hasOwnProperty(columnId)) {
        return row._uniqueValuesCache[columnId];
      }
      const column2 = table.getColumn(columnId);
      if (!(column2 != null && column2.accessorFn)) {
        return void 0;
      }
      if (!column2.columnDef.getUniqueValues) {
        row._uniqueValuesCache[columnId] = [row.getValue(columnId)];
        return row._uniqueValuesCache[columnId];
      }
      row._uniqueValuesCache[columnId] = column2.columnDef.getUniqueValues(row.original, rowIndex);
      return row._uniqueValuesCache[columnId];
    },
    renderValue: (columnId) => {
      var _row$getValue;
      return (_row$getValue = row.getValue(columnId)) != null ? _row$getValue : table.options.renderFallbackValue;
    },
    subRows: subRows != null ? subRows : [],
    getLeafRows: () => flattenBy(row.subRows, (d) => d.subRows),
    getParentRow: () => row.parentId ? table.getRow(row.parentId, true) : void 0,
    getParentRows: () => {
      let parentRows = [];
      let currentRow = row;
      while (true) {
        const parentRow = currentRow.getParentRow();
        if (!parentRow)
          break;
        parentRows.push(parentRow);
        currentRow = parentRow;
      }
      return parentRows.reverse();
    },
    getAllCells: memo(() => [table.getAllLeafColumns()], (leafColumns) => {
      return leafColumns.map((column2) => {
        return createCell(table, row, column2, column2.id);
      });
    }, {
      key: "row.getAllCells",
      debug: () => {
        var _table$options$debugA;
        return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugRows;
      }
    }),
    _getAllCellsByColumnId: memo(() => [row.getAllCells()], (allCells) => {
      return allCells.reduce((acc, cell) => {
        acc[cell.column.id] = cell;
        return acc;
      }, {});
    }, {
      key: false,
      debug: () => {
        var _table$options$debugA2;
        return (_table$options$debugA2 = table.options.debugAll) != null ? _table$options$debugA2 : table.options.debugRows;
      }
    })
  };
  for (let i2 = 0; i2 < table._features.length; i2++) {
    const feature = table._features[i2];
    feature == null || feature.createRow == null || feature.createRow(row, table);
  }
  return row;
};
function getCoreRowModel() {
  return (table) => memo(() => [table.options.data], (data) => {
    const rowModel = {
      rows: [],
      flatRows: [],
      rowsById: {}
    };
    const accessRows = function(originalRows, depth, parentRow) {
      if (depth === void 0) {
        depth = 0;
      }
      const rows = [];
      for (let i2 = 0; i2 < originalRows.length; i2++) {
        const row = createRow(table, table._getRowId(originalRows[i2], i2, parentRow), originalRows[i2], i2, depth, void 0, parentRow == null ? void 0 : parentRow.id);
        rowModel.flatRows.push(row);
        rowModel.rowsById[row.id] = row;
        rows.push(row);
        if (table.options.getSubRows) {
          var _row$originalSubRows;
          row.originalSubRows = table.options.getSubRows(originalRows[i2], i2);
          if ((_row$originalSubRows = row.originalSubRows) != null && _row$originalSubRows.length) {
            row.subRows = accessRows(row.originalSubRows, depth + 1, row);
          }
        }
      }
      return rows;
    };
    rowModel.rows = accessRows(data);
    return rowModel;
  }, {
    key: "getRowModel",
    debug: () => {
      var _table$options$debugA;
      return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugTable;
    },
    onChange: () => {
      table._autoResetPageIndex();
    }
  });
}
function getSortedRowModel() {
  return (table) => memo(() => [table.getState().sorting, table.getPreSortedRowModel()], (sorting, rowModel) => {
    if (!rowModel.rows.length || !(sorting != null && sorting.length)) {
      return rowModel;
    }
    const sortingState = table.getState().sorting;
    const sortedFlatRows = [];
    const availableSorting = sortingState.filter((sort) => {
      var _table$getColumn;
      return (_table$getColumn = table.getColumn(sort.id)) == null ? void 0 : _table$getColumn.getCanSort();
    });
    const columnInfoById = {};
    availableSorting.forEach((sortEntry) => {
      const column2 = table.getColumn(sortEntry.id);
      if (!column2)
        return;
      columnInfoById[sortEntry.id] = {
        sortUndefined: column2.columnDef.sortUndefined,
        invertSorting: column2.columnDef.invertSorting,
        sortingFn: column2.getSortingFn()
      };
    });
    const sortData = (rows) => {
      const sortedData = rows.map((row) => ({
        ...row
      }));
      sortedData.sort((rowA, rowB) => {
        for (let i2 = 0; i2 < availableSorting.length; i2 += 1) {
          var _sortEntry$desc;
          const sortEntry = availableSorting[i2];
          const columnInfo = columnInfoById[sortEntry.id];
          const isDesc = (_sortEntry$desc = sortEntry == null ? void 0 : sortEntry.desc) != null ? _sortEntry$desc : false;
          let sortInt = 0;
          if (columnInfo.sortUndefined) {
            const aValue = rowA.getValue(sortEntry.id);
            const bValue = rowB.getValue(sortEntry.id);
            const aUndefined = aValue === void 0;
            const bUndefined = bValue === void 0;
            if (aUndefined || bUndefined) {
              sortInt = aUndefined && bUndefined ? 0 : aUndefined ? columnInfo.sortUndefined : -columnInfo.sortUndefined;
            }
          }
          if (sortInt === 0) {
            sortInt = columnInfo.sortingFn(rowA, rowB, sortEntry.id);
          }
          if (sortInt !== 0) {
            if (isDesc) {
              sortInt *= -1;
            }
            if (columnInfo.invertSorting) {
              sortInt *= -1;
            }
            return sortInt;
          }
        }
        return rowA.index - rowB.index;
      });
      sortedData.forEach((row) => {
        var _row$subRows;
        sortedFlatRows.push(row);
        if ((_row$subRows = row.subRows) != null && _row$subRows.length) {
          row.subRows = sortData(row.subRows);
        }
      });
      return sortedData;
    };
    return {
      rows: sortData(rowModel.rows),
      flatRows: sortedFlatRows,
      rowsById: rowModel.rowsById
    };
  }, {
    key: "getSortedRowModel",
    debug: () => {
      var _table$options$debugA;
      return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugTable;
    },
    onChange: () => {
      table._autoResetPageIndex();
    }
  });
}
function getExpandedRowModel() {
  return (table) => memo(() => [table.getState().expanded, table.getPreExpandedRowModel(), table.options.paginateExpandedRows], (expanded, rowModel, paginateExpandedRows) => {
    if (!rowModel.rows.length || expanded !== true && !Object.keys(expanded != null ? expanded : {}).length) {
      return rowModel;
    }
    if (!paginateExpandedRows) {
      return rowModel;
    }
    return expandRows(rowModel);
  }, {
    key: "getExpandedRowModel",
    debug: () => {
      var _table$options$debugA;
      return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugTable;
    }
  });
}
function expandRows(rowModel) {
  const expandedRows = [];
  const handleRow = (row) => {
    var _row$subRows;
    expandedRows.push(row);
    if ((_row$subRows = row.subRows) != null && _row$subRows.length && row.getIsExpanded()) {
      row.subRows.forEach(handleRow);
    }
  };
  rowModel.rows.forEach(handleRow);
  return {
    rows: expandedRows,
    flatRows: rowModel.flatRows,
    rowsById: rowModel.rowsById
  };
}
function getPaginationRowModel(opts) {
  return (table) => memo(() => [table.getState().pagination, table.getPrePaginationRowModel(), table.options.paginateExpandedRows ? void 0 : table.getState().expanded], (pagination, rowModel) => {
    if (!rowModel.rows.length) {
      return rowModel;
    }
    const {
      pageSize,
      pageIndex
    } = pagination;
    let {
      rows,
      flatRows,
      rowsById
    } = rowModel;
    const pageStart = pageSize * pageIndex;
    const pageEnd = pageStart + pageSize;
    rows = rows.slice(pageStart, pageEnd);
    let paginatedRowModel;
    if (!table.options.paginateExpandedRows) {
      paginatedRowModel = expandRows({
        rows,
        flatRows,
        rowsById
      });
    } else {
      paginatedRowModel = {
        rows,
        flatRows,
        rowsById
      };
    }
    paginatedRowModel.flatRows = [];
    const handleRow = (row) => {
      paginatedRowModel.flatRows.push(row);
      if (row.subRows.length) {
        row.subRows.forEach(handleRow);
      }
    };
    paginatedRowModel.rows.forEach(handleRow);
    return paginatedRowModel;
  }, {
    key: "getPaginationRowModel",
    debug: () => {
      var _table$options$debugA;
      return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugTable;
    }
  });
}

// node_modules/@tanstack/react-table/build/lib/index.mjs
function flexRender(Comp, props) {
  return !Comp ? null : isReactComponent(Comp) ? /* @__PURE__ */ React26.createElement(Comp, props) : Comp;
}
function isReactComponent(component) {
  return isClassComponent(component) || typeof component === "function" || isExoticComponent(component);
}
function isClassComponent(component) {
  return typeof component === "function" && (() => {
    const proto = Object.getPrototypeOf(component);
    return proto.prototype && proto.prototype.isReactComponent;
  })();
}
function isExoticComponent(component) {
  return typeof component === "object" && typeof component.$$typeof === "symbol" && ["react.memo", "react.forward_ref"].includes(component.$$typeof.description);
}
function useReactTable(options) {
  const resolvedOptions = {
    state: {},
    // Dummy state
    onStateChange: () => {
    },
    // noop
    renderFallbackValue: null,
    ...options
  };
  const [tableRef] = React26.useState(() => ({
    current: createTable(resolvedOptions)
  }));
  const [state, setState] = React26.useState(() => tableRef.current.initialState);
  tableRef.current.setOptions((prev2) => ({
    ...prev2,
    ...options,
    state: {
      ...state,
      ...options.state
    },
    // Similarly, we'll maintain both our internal state and any user-provided
    // state.
    onStateChange: (updater) => {
      setState(updater);
      options.onStateChange == null || options.onStateChange(updater);
    }
  }));
  return tableRef.current;
}

// src/components/Link.tsx
function Link2(props) {
  return (
    // Stop propagation to prevent the click from being handled by the parent
    /* @__PURE__ */ jsx5("div", { onClick: (e3) => e3.stopPropagation(), children: /* @__PURE__ */ jsx5(
      Link,
      {
        css: css`
          color: var(--ac-global-color-primary);
          &:not(:hover) {
            text-decoration: none;
          }
        `,
        ...props
      }
    ) })
  );
}

// src/components/table/styles.ts
var tableCSS = (theme3) => css`
  font-size: ${theme3.typography.sizes.medium.fontSize}px;
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  thead {
    position: sticky;
    top: 0;
    tr {
      th {
        padding: ${theme3.spacing.margin4}px ${theme3.spacing.margin16}px;
        background-color: var(--ac-global-color-grey-100);
        position: relative;
        text-align: left;
        border-bottom: 1px solid var(--ac-global-border-color-default);
        &:not(:last-of-type) {
          border-right: 1px solid var(--ac-global-border-color-default);
        }
        .cursor-pointer {
          cursor: pointer;
        }
        .sort-icon {
          margin-left: ${theme3.spacing.margin4}px;
          font-size: ${theme3.typography.sizes.small.fontSize}px;
          vertical-align: middle;
          display: inline-block;
        }
        &:hover .resizer {
          background: var(--ac-global-color-grey-300);
        }
        div.resizer {
          display: inline-block;

          width: 2px;
          height: 100%;
          position: absolute;
          right: 0;
          top: 0;
          cursor: grab;
          z-index: 1;
          touch-action: none;
          &.isResizing,
          &:hover {
            background: var(--ac-global-color-primary);
          }
        }
      }
    }
  }
  tbody:not(.is-empty) {
    tr {
      &:not(:last-of-type) {
        & > td {
          border-bottom: 1px solid var(--ac-global-border-color-default);
        }
      }
      &:hover {
        background-color: rgba(var(--ac-global-color-grey-300-rgb), 0.5);
      }
      & > td {
        padding: ${theme3.spacing.margin8}px ${theme3.spacing.margin16}px;
      }
    }
  }
`;
var selectableTableCSS = (theme3) => css(
  tableCSS(theme3),
  css`
      tbody:not(.is-empty) {
        tr {
          cursor: pointer;
        }
      }
    `
);
var paginationCSS = (theme3) => css`
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: ${theme3.spacing.margin8}px;
  gap: ${theme3.spacing.margin4}px;
  border-top: 1px solid var(--ac-global-color-grey-300);
`;

// src/components/table/TableEmpty.tsx
function TableEmpty() {
  return /* @__PURE__ */ jsx5("tbody", { className: "is-empty", children: /* @__PURE__ */ jsx5("tr", { children: /* @__PURE__ */ jsx5(
    "td",
    {
      colSpan: 100,
      css: (theme3) => css`
            text-align: center;
            padding: ${theme3.spacing.margin24}px ${theme3.spacing.margin24}px !important;
          `,
      children: "No Data"
    }
  ) }) });
}

// src/components/table/TextCell.tsx
var MAX_LENGTH = 100;
function formatText(text2) {
  if (text2.length > MAX_LENGTH) {
    return `${text2.slice(0, MAX_LENGTH)}...`;
  }
  return text2;
}
function TextCell({
  getValue
}) {
  const value = getValue();
  const str = value != null && typeof value === "string" ? formatText(value) : "--";
  return /* @__PURE__ */ jsx5("span", { title: String(value), children: str });
}

// src/components/table/TimestampCell.tsx
function TimestampCell({
  getValue
}) {
  const value = getValue();
  if (!isStringOrNull(value)) {
    throw new Error("TimestampCell only supports number or null values.");
  }
  const timestamp = value != null ? new Date(value).toLocaleString([], {
    year: "numeric",
    month: "numeric",
    day: "numeric",
    hour: "2-digit",
    minute: "2-digit"
  }) : "--";
  return /* @__PURE__ */ jsx5("time", { title: value != null ? String(value) : "", children: timestamp });
}

// src/components/trace/LatencyText.tsx
var import_react54 = __toESM(require_react());

// node_modules/d3-format/src/formatDecimal.js
function formatDecimal_default(x2) {
  return Math.abs(x2 = Math.round(x2)) >= 1e21 ? x2.toLocaleString("en").replace(/,/g, "") : x2.toString(10);
}
function formatDecimalParts(x2, p) {
  if ((i2 = (x2 = p ? x2.toExponential(p - 1) : x2.toExponential()).indexOf("e")) < 0)
    return null;
  var i2, coefficient = x2.slice(0, i2);
  return [
    coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient,
    +x2.slice(i2 + 1)
  ];
}

// node_modules/d3-format/src/exponent.js
function exponent_default(x2) {
  return x2 = formatDecimalParts(Math.abs(x2)), x2 ? x2[1] : NaN;
}

// node_modules/d3-format/src/formatGroup.js
function formatGroup_default(grouping, thousands) {
  return function(value, width) {
    var i2 = value.length, t3 = [], j = 0, g = grouping[0], length2 = 0;
    while (i2 > 0 && g > 0) {
      if (length2 + g + 1 > width)
        g = Math.max(1, width - length2);
      t3.push(value.substring(i2 -= g, i2 + g));
      if ((length2 += g + 1) > width)
        break;
      g = grouping[j = (j + 1) % grouping.length];
    }
    return t3.reverse().join(thousands);
  };
}

// node_modules/d3-format/src/formatNumerals.js
function formatNumerals_default(numerals) {
  return function(value) {
    return value.replace(/[0-9]/g, function(i2) {
      return numerals[+i2];
    });
  };
}

// node_modules/d3-format/src/formatSpecifier.js
var re = /^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;
function formatSpecifier(specifier) {
  if (!(match2 = re.exec(specifier)))
    throw new Error("invalid format: " + specifier);
  var match2;
  return new FormatSpecifier({
    fill: match2[1],
    align: match2[2],
    sign: match2[3],
    symbol: match2[4],
    zero: match2[5],
    width: match2[6],
    comma: match2[7],
    precision: match2[8] && match2[8].slice(1),
    trim: match2[9],
    type: match2[10]
  });
}
formatSpecifier.prototype = FormatSpecifier.prototype;
function FormatSpecifier(specifier) {
  this.fill = specifier.fill === void 0 ? " " : specifier.fill + "";
  this.align = specifier.align === void 0 ? ">" : specifier.align + "";
  this.sign = specifier.sign === void 0 ? "-" : specifier.sign + "";
  this.symbol = specifier.symbol === void 0 ? "" : specifier.symbol + "";
  this.zero = !!specifier.zero;
  this.width = specifier.width === void 0 ? void 0 : +specifier.width;
  this.comma = !!specifier.comma;
  this.precision = specifier.precision === void 0 ? void 0 : +specifier.precision;
  this.trim = !!specifier.trim;
  this.type = specifier.type === void 0 ? "" : specifier.type + "";
}
FormatSpecifier.prototype.toString = function() {
  return this.fill + this.align + this.sign + this.symbol + (this.zero ? "0" : "") + (this.width === void 0 ? "" : Math.max(1, this.width | 0)) + (this.comma ? "," : "") + (this.precision === void 0 ? "" : "." + Math.max(0, this.precision | 0)) + (this.trim ? "~" : "") + this.type;
};

// node_modules/d3-format/src/formatTrim.js
function formatTrim_default(s2) {
  out:
    for (var n2 = s2.length, i2 = 1, i0 = -1, i1; i2 < n2; ++i2) {
      switch (s2[i2]) {
        case ".":
          i0 = i1 = i2;
          break;
        case "0":
          if (i0 === 0)
            i0 = i2;
          i1 = i2;
          break;
        default:
          if (!+s2[i2])
            break out;
          if (i0 > 0)
            i0 = 0;
          break;
      }
    }
  return i0 > 0 ? s2.slice(0, i0) + s2.slice(i1 + 1) : s2;
}

// node_modules/d3-format/src/formatPrefixAuto.js
var prefixExponent;
function formatPrefixAuto_default(x2, p) {
  var d = formatDecimalParts(x2, p);
  if (!d)
    return x2 + "";
  var coefficient = d[0], exponent = d[1], i2 = exponent - (prefixExponent = Math.max(-8, Math.min(8, Math.floor(exponent / 3))) * 3) + 1, n2 = coefficient.length;
  return i2 === n2 ? coefficient : i2 > n2 ? coefficient + new Array(i2 - n2 + 1).join("0") : i2 > 0 ? coefficient.slice(0, i2) + "." + coefficient.slice(i2) : "0." + new Array(1 - i2).join("0") + formatDecimalParts(x2, Math.max(0, p + i2 - 1))[0];
}

// node_modules/d3-format/src/formatRounded.js
function formatRounded_default(x2, p) {
  var d = formatDecimalParts(x2, p);
  if (!d)
    return x2 + "";
  var coefficient = d[0], exponent = d[1];
  return exponent < 0 ? "0." + new Array(-exponent).join("0") + coefficient : coefficient.length > exponent + 1 ? coefficient.slice(0, exponent + 1) + "." + coefficient.slice(exponent + 1) : coefficient + new Array(exponent - coefficient.length + 2).join("0");
}

// node_modules/d3-format/src/formatTypes.js
var formatTypes_default = {
  "%": (x2, p) => (x2 * 100).toFixed(p),
  "b": (x2) => Math.round(x2).toString(2),
  "c": (x2) => x2 + "",
  "d": formatDecimal_default,
  "e": (x2, p) => x2.toExponential(p),
  "f": (x2, p) => x2.toFixed(p),
  "g": (x2, p) => x2.toPrecision(p),
  "o": (x2) => Math.round(x2).toString(8),
  "p": (x2, p) => formatRounded_default(x2 * 100, p),
  "r": formatRounded_default,
  "s": formatPrefixAuto_default,
  "X": (x2) => Math.round(x2).toString(16).toUpperCase(),
  "x": (x2) => Math.round(x2).toString(16)
};

// node_modules/d3-format/src/identity.js
function identity_default(x2) {
  return x2;
}

// node_modules/d3-format/src/locale.js
var map = Array.prototype.map;
var prefixes = ["y", "z", "a", "f", "p", "n", "\xB5", "m", "", "k", "M", "G", "T", "P", "E", "Z", "Y"];
function locale_default(locale3) {
  var group = locale3.grouping === void 0 || locale3.thousands === void 0 ? identity_default : formatGroup_default(map.call(locale3.grouping, Number), locale3.thousands + ""), currencyPrefix = locale3.currency === void 0 ? "" : locale3.currency[0] + "", currencySuffix = locale3.currency === void 0 ? "" : locale3.currency[1] + "", decimal = locale3.decimal === void 0 ? "." : locale3.decimal + "", numerals = locale3.numerals === void 0 ? identity_default : formatNumerals_default(map.call(locale3.numerals, String)), percent = locale3.percent === void 0 ? "%" : locale3.percent + "", minus = locale3.minus === void 0 ? "\u2212" : locale3.minus + "", nan = locale3.nan === void 0 ? "NaN" : locale3.nan + "";
  function newFormat(specifier) {
    specifier = formatSpecifier(specifier);
    var fill = specifier.fill, align = specifier.align, sign3 = specifier.sign, symbol = specifier.symbol, zero3 = specifier.zero, width = specifier.width, comma = specifier.comma, precision = specifier.precision, trim2 = specifier.trim, type = specifier.type;
    if (type === "n")
      comma = true, type = "g";
    else if (!formatTypes_default[type])
      precision === void 0 && (precision = 12), trim2 = true, type = "g";
    if (zero3 || fill === "0" && align === "=")
      zero3 = true, fill = "0", align = "=";
    var prefix3 = symbol === "$" ? currencyPrefix : symbol === "#" && /[boxX]/.test(type) ? "0" + type.toLowerCase() : "", suffix = symbol === "$" ? currencySuffix : /[%p]/.test(type) ? percent : "";
    var formatType = formatTypes_default[type], maybeSuffix = /[defgprs%]/.test(type);
    precision = precision === void 0 ? 6 : /[gprs]/.test(type) ? Math.max(1, Math.min(21, precision)) : Math.max(0, Math.min(20, precision));
    function format3(value) {
      var valuePrefix = prefix3, valueSuffix = suffix, i2, n2, c4;
      if (type === "c") {
        valueSuffix = formatType(value) + valueSuffix;
        value = "";
      } else {
        value = +value;
        var valueNegative = value < 0 || 1 / value < 0;
        value = isNaN(value) ? nan : formatType(Math.abs(value), precision);
        if (trim2)
          value = formatTrim_default(value);
        if (valueNegative && +value === 0 && sign3 !== "+")
          valueNegative = false;
        valuePrefix = (valueNegative ? sign3 === "(" ? sign3 : minus : sign3 === "-" || sign3 === "(" ? "" : sign3) + valuePrefix;
        valueSuffix = (type === "s" ? prefixes[8 + prefixExponent / 3] : "") + valueSuffix + (valueNegative && sign3 === "(" ? ")" : "");
        if (maybeSuffix) {
          i2 = -1, n2 = value.length;
          while (++i2 < n2) {
            if (c4 = value.charCodeAt(i2), 48 > c4 || c4 > 57) {
              valueSuffix = (c4 === 46 ? decimal + value.slice(i2 + 1) : value.slice(i2)) + valueSuffix;
              value = value.slice(0, i2);
              break;
            }
          }
        }
      }
      if (comma && !zero3)
        value = group(value, Infinity);
      var length2 = valuePrefix.length + value.length + valueSuffix.length, padding = length2 < width ? new Array(width - length2 + 1).join(fill) : "";
      if (comma && zero3)
        value = group(padding + value, padding.length ? width - valueSuffix.length : Infinity), padding = "";
      switch (align) {
        case "<":
          value = valuePrefix + value + valueSuffix + padding;
          break;
        case "=":
          value = valuePrefix + padding + value + valueSuffix;
          break;
        case "^":
          value = padding.slice(0, length2 = padding.length >> 1) + valuePrefix + value + valueSuffix + padding.slice(length2);
          break;
        default:
          value = padding + valuePrefix + value + valueSuffix;
          break;
      }
      return numerals(value);
    }
    format3.toString = function() {
      return specifier + "";
    };
    return format3;
  }
  function formatPrefix2(specifier, value) {
    var f = newFormat((specifier = formatSpecifier(specifier), specifier.type = "f", specifier)), e3 = Math.max(-8, Math.min(8, Math.floor(exponent_default(value) / 3))) * 3, k2 = Math.pow(10, -e3), prefix3 = prefixes[8 + e3 / 3];
    return function(value2) {
      return f(k2 * value2) + prefix3;
    };
  }
  return {
    format: newFormat,
    formatPrefix: formatPrefix2
  };
}

// node_modules/d3-format/src/defaultLocale.js
var locale;
var format2;
var formatPrefix;
defaultLocale({
  thousands: ",",
  grouping: [3],
  currency: ["$", ""]
});
function defaultLocale(definition) {
  locale = locale_default(definition);
  format2 = locale.format;
  formatPrefix = locale.formatPrefix;
  return locale;
}

// node_modules/d3-format/src/precisionFixed.js
function precisionFixed_default(step) {
  return Math.max(0, -exponent_default(Math.abs(step)));
}

// node_modules/d3-format/src/precisionPrefix.js
function precisionPrefix_default(step, value) {
  return Math.max(0, Math.max(-8, Math.min(8, Math.floor(exponent_default(value) / 3))) * 3 - exponent_default(Math.abs(step)));
}

// node_modules/d3-format/src/precisionRound.js
function precisionRound_default(step, max3) {
  step = Math.abs(step), max3 = Math.abs(max3) - step;
  return Math.max(0, exponent_default(max3) - exponent_default(step)) + 1;
}

// src/utils/numberFormatUtils.ts
function formatInt(int) {
  const absInt = Math.abs(int);
  if (absInt < 1e6)
    return format2(",")(int);
  return format2("0.2s")(int);
}
function formatFloat(float) {
  const absValue = Math.abs(float);
  if (absValue === 0)
    return "0.00";
  else if (absValue < 0.01)
    return format2(".2e")(float);
  else if (absValue < 1e3)
    return format2("0.2f")(float);
  return format2("0.2s")(float);
}
function formatPercent(float) {
  return format2(".2f")(float) + "%";
}
function formatNumber(number5) {
  if (Number.isInteger(number5))
    return formatInt(number5);
  return formatFloat(number5);
}
function createNumberFormatter(formatFn) {
  return (maybeNumber) => {
    if (typeof maybeNumber !== "number")
      return "--";
    return formatFn(maybeNumber);
  };
}
var intFormatter = createNumberFormatter(formatInt);
var floatFormatter = createNumberFormatter(formatFloat);
var numberFormatter2 = createNumberFormatter(formatNumber);
var percentFormatter = createNumberFormatter(formatPercent);

// src/components/trace/LatencyText.tsx
function LatencyText({
  latencyMs,
  textSize = "medium"
}) {
  const color2 = (0, import_react54.useMemo)(() => {
    if (latencyMs < 3e3) {
      return "green-1200";
    } else if (latencyMs < 8e3) {
      return "yellow-1200";
    } else if (latencyMs < 12e3) {
      return "orange-1200";
    } else {
      return "red-1200";
    }
  }, [latencyMs]);
  const latencyText = (0, import_react54.useMemo)(() => {
    if (latencyMs < 10) {
      return formatFloat(latencyMs) + "ms";
    }
    return formatFloat(latencyMs / 1e3) + "s";
  }, [latencyMs]);
  return /* @__PURE__ */ jsxs2(
    _Flex,
    {
      direction: "row",
      alignItems: "center",
      justifyContent: "start",
      gap: "size-25",
      children: [
        /* @__PURE__ */ jsx5(_Text, { color: color2, textSize, children: /* @__PURE__ */ jsx5(Icon, { svg: /* @__PURE__ */ jsx5(Icons.ClockOutline, {}) }) }),
        /* @__PURE__ */ jsx5(_Text, { color: color2, textSize, children: latencyText })
      ]
    }
  );
}

// src/components/trace/SpanKindLabel.tsx
var import_react55 = __toESM(require_react());
function SpanKindLabel(props) {
  const { spanKind } = props;
  const color2 = (0, import_react55.useMemo)(() => {
    let color3 = "grey-500";
    switch (spanKind) {
      case "llm":
        color3 = "orange-1000";
        break;
      case "chain":
        color3 = "blue-1000";
        break;
      case "retriever":
        color3 = "seafoam-1000";
        break;
      case "reranker":
        color3 = "celery-1000";
        break;
      case "embedding":
        color3 = "indigo-1000";
        break;
      case "agent":
        color3 = "grey-900";
        break;
      case "tool":
        color3 = "yellow-1200";
        break;
    }
    return color3;
  }, [spanKind]);
  return /* @__PURE__ */ jsx5(Label, { color: color2, children: spanKind });
}

// src/components/trace/useSpanStatusCodeColor.ts
function useSpanStatusCodeColor(statusCode) {
  switch (statusCode) {
    case "OK":
      return "success";
    case "ERROR":
      return "danger";
      break;
    case "UNSET":
      return "grey-500";
    default:
      assertUnreachable2(statusCode);
  }
}

// src/components/trace/SpanStatusCodeIcon.tsx
function SpanStatusCodeIcon({
  statusCode
}) {
  let iconSVG = /* @__PURE__ */ jsx5(Icons.MinusCircleOutline, {});
  const color2 = useSpanStatusCodeColor(statusCode);
  switch (statusCode) {
    case "OK":
      iconSVG = /* @__PURE__ */ jsx5(Icons.CheckmarkCircleOutline, {});
      break;
    case "ERROR":
      iconSVG = /* @__PURE__ */ jsx5(Icons.AlertCircleOutline, {});
      break;
    case "UNSET":
      iconSVG = /* @__PURE__ */ jsx5(Icons.MinusCircleOutline, {});
      break;
    default:
      assertUnreachable2(statusCode);
  }
  return /* @__PURE__ */ jsx5(Icon, { svg: iconSVG, color: color2, "aria-label": statusCode });
}

// src/contexts/StreamStateContext.tsx
var import_react56 = __toESM(require_react());
var StreamStateContext = (0, import_react56.createContext)(
  null
);
function useStreamState() {
  const context2 = import_react56.default.useContext(StreamStateContext);
  if (context2 === null) {
    throw new Error("useStreamState must be used within a StreamStateProvider");
  }
  return context2;
}
function StreamStateProvider({
  initialFetchKey = "initial",
  children
}) {
  const [isStreaming, setIsStreaming] = (0, import_react56.useState)(true);
  const [fetchKey, _setFetchKey] = (0, import_react56.useState)(initialFetchKey);
  const setFetchKey = (0, import_react56.useCallback)(
    (fetchKey2) => {
      (0, import_react56.startTransition)(() => {
        _setFetchKey(fetchKey2);
      });
    },
    [_setFetchKey]
  );
  return /* @__PURE__ */ jsx5(
    StreamStateContext.Provider,
    {
      value: { isStreaming, setIsStreaming, fetchKey, setFetchKey },
      children
    }
  );
}

// src/contexts/TracingContext.tsx
var import_react57 = __toESM(require_react());

// src/store/tracingStore.tsx
var createTracingStore = (initialProps) => {
  const tracingStore = (set3) => ({
    ...initialProps,
    columnVisibility: {},
    evaluationVisibility: {},
    setColumnVisibility: (columnVisibility) => {
      set3({ columnVisibility });
    },
    setEvaluationVisibility: (evaluationVisibility) => {
      set3({ evaluationVisibility });
    }
  });
  return create()(devtools(tracingStore));
};

// src/contexts/TracingContext.tsx
var TracingContext = (0, import_react57.createContext)(null);
function TracingProvider({
  children,
  ...props
}) {
  const storeRef = (0, import_react57.useRef)();
  if (!storeRef.current) {
    storeRef.current = createTracingStore(props);
  }
  return /* @__PURE__ */ jsx5(TracingContext.Provider, { value: storeRef.current, children });
}
function useTracingContext(selector, equalityFn) {
  const store = import_react57.default.useContext(TracingContext);
  if (!store)
    throw new Error("Missing TracingContext.Provider in the tree");
  return n(store, selector, equalityFn);
}

// src/pages/tracing/EvaluationLabel.tsx
function EvaluationLabel({ evaluation }) {
  const labelValue = evaluation.label || typeof evaluation.score == "number" && formatFloat(evaluation.score) || "n/a";
  return /* @__PURE__ */ jsx5(Label, { color: "cyan-1000", shape: "badge", children: /* @__PURE__ */ jsxs2(_Flex, { direction: "row", gap: "size-50", children: [
    /* @__PURE__ */ jsx5(_Text, { weight: "heavy", textSize: "small", color: "inherit", children: evaluation.name }),
    /* @__PURE__ */ jsx5(_Text, { textSize: "small", children: labelValue })
  ] }) });
}

// src/pages/tracing/RetrievalEvaluationLabel.tsx
var import_react58 = __toESM(require_react());
function RetrievalEvaluationLabel(props) {
  const { name: name2, metric, k: k2, score: score2 } = props;
  const label = typeof k2 === "number" ? `${metric}@${k2}` : metric;
  const labelValue = (0, import_react58.useMemo)(() => {
    if (metric === "hit") {
      return score2 ? "true" : "false";
    }
    return typeof score2 == "number" && formatFloat(score2) || "n/a";
  }, [score2, metric]);
  return /* @__PURE__ */ jsx5(Label, { color: "seafoam-1000", shape: "badge", children: /* @__PURE__ */ jsxs2(_Flex, { direction: "row", gap: "size-50", children: [
    name2 ? /* @__PURE__ */ jsx5(_Text, { weight: "heavy", textSize: "small", color: "inherit", children: name2 }) : null,
    /* @__PURE__ */ jsx5(_Text, { textSize: "small", color: "inherit", children: label }),
    /* @__PURE__ */ jsx5(_Text, { textSize: "small", children: labelValue })
  ] }) });
}

// src/pages/tracing/__generated__/SpanColumnSelector_evaluations.graphql.ts
var node9 = {
  "argumentDefinitions": [],
  "kind": "Fragment",
  "metadata": null,
  "name": "SpanColumnSelector_evaluations",
  "selections": [
    {
      "alias": null,
      "args": null,
      "kind": "ScalarField",
      "name": "spanEvaluationNames",
      "storageKey": null
    }
  ],
  "type": "Query",
  "abstractKey": null
};
node9.hash = "6cb10f157751687d641be9002cfb97a8";
var SpanColumnSelector_evaluations_graphql_default = node9;

// src/pages/tracing/SpanColumnSelector.tsx
var import_react59 = __toESM(require_react());
var import_react_relay2 = __toESM(require_react_relay());
var UN_HIDABLE_COLUMN_IDS = ["spanKind", "name"];
function SpanColumnSelector(props) {
  return /* @__PURE__ */ jsx5(
    Dropdown,
    {
      menu: /* @__PURE__ */ jsx5(ColumnSelectorMenu, { ...props }),
      triggerProps: {
        placement: "bottom end"
      },
      children: /* @__PURE__ */ jsxs2(_Flex, { direction: "row", alignItems: "center", gap: "size-100", children: [
        /* @__PURE__ */ jsx5(Icon, { svg: /* @__PURE__ */ jsx5(Icons.Column, {}) }),
        "Columns"
      ] })
    }
  );
}
var columCheckboxItemCSS = css`
  padding: var(--ac-global-dimension-static-size-50)
    var(--ac-global-dimension-static-size-100);
  label {
    display: flex;
    align-items: center;
    gap: var(--ac-global-dimension-static-size-100);
  }
`;
function ColumnSelectorMenu(props) {
  const { columns: propsColumns } = props;
  const columnVisibility = useTracingContext((state) => state.columnVisibility);
  const setColumnVisibility = useTracingContext(
    (state) => state.setColumnVisibility
  );
  const columns2 = (0, import_react59.useMemo)(() => {
    return propsColumns.filter((column2) => {
      return !UN_HIDABLE_COLUMN_IDS.includes(column2.id);
    });
  }, [propsColumns]);
  const allVisible = (0, import_react59.useMemo)(() => {
    return columns2.every((column2) => {
      const stateValue = columnVisibility[column2.id];
      const isVisible2 = stateValue == null ? true : stateValue;
      return isVisible2;
    });
  }, [columns2, columnVisibility]);
  const onCheckboxChange = (0, import_react59.useCallback)(
    (event) => {
      const { name: name2, checked } = event.target;
      setColumnVisibility({ ...columnVisibility, [name2]: checked });
    },
    [columnVisibility, setColumnVisibility]
  );
  const onToggleAll = (0, import_react59.useCallback)(
    (event) => {
      const { checked } = event.target;
      const newVisibilityState = columns2.reduce((acc, column2) => {
        return { ...acc, [column2.id]: checked };
      }, {});
      setColumnVisibility(newVisibilityState);
    },
    [columns2, setColumnVisibility]
  );
  return /* @__PURE__ */ jsxs2(_View, { paddingTop: "size-50", paddingBottom: "size-50", children: [
    /* @__PURE__ */ jsx5(
      _View,
      {
        borderBottomColor: "dark",
        borderBottomWidth: "thin",
        paddingBottom: "size-50",
        children: /* @__PURE__ */ jsx5("div", { css: columCheckboxItemCSS, children: /* @__PURE__ */ jsxs2("label", { children: [
          /* @__PURE__ */ jsx5(
            "input",
            {
              type: "checkbox",
              name: "toggle-all",
              checked: allVisible,
              onChange: onToggleAll
            }
          ),
          "span columns"
        ] }) })
      }
    ),
    /* @__PURE__ */ jsx5("ul", { children: columns2.map((column2) => {
      const stateValue = columnVisibility[column2.id];
      const isVisible2 = stateValue == null ? true : stateValue;
      const name2 = typeof column2.columnDef.header == "string" ? column2.columnDef.header : column2.id;
      return /* @__PURE__ */ jsx5("li", { css: columCheckboxItemCSS, children: /* @__PURE__ */ jsxs2("label", { children: [
        /* @__PURE__ */ jsx5(
          "input",
          {
            type: "checkbox",
            name: column2.id,
            checked: isVisible2,
            onChange: onCheckboxChange
          }
        ),
        name2
      ] }) }, column2.id);
    }) }),
    /* @__PURE__ */ jsx5(EvaluationColumnSelector, { ...props })
  ] });
}
function EvaluationColumnSelector({
  query: query2
}) {
  const data = (0, import_react_relay2.useFragment)(
    SpanColumnSelector_evaluations_graphql_default,
    query2
  );
  const evaluationVisibility = useTracingContext(
    (state) => state.evaluationVisibility
  );
  const setEvaluationVisibility = useTracingContext(
    (state) => state.setEvaluationVisibility
  );
  const allVisible = (0, import_react59.useMemo)(() => {
    return data.spanEvaluationNames.every((name2) => {
      const stateValue = evaluationVisibility[name2];
      return stateValue || false;
    });
  }, [evaluationVisibility, data.spanEvaluationNames]);
  const onToggleEvaluations = (0, import_react59.useCallback)(() => {
    const newVisibilityState = data.spanEvaluationNames.reduce((acc, name2) => {
      return { ...acc, [name2]: !allVisible };
    }, {});
    setEvaluationVisibility(newVisibilityState);
  }, [setEvaluationVisibility, allVisible, data.spanEvaluationNames]);
  return /* @__PURE__ */ jsxs2("section", { children: [
    /* @__PURE__ */ jsx5(
      _View,
      {
        paddingTop: "size-50",
        paddingBottom: "size-50",
        borderColor: "dark",
        borderTopWidth: "thin",
        borderBottomWidth: "thin",
        children: /* @__PURE__ */ jsx5("div", { css: columCheckboxItemCSS, children: /* @__PURE__ */ jsxs2("label", { children: [
          /* @__PURE__ */ jsx5(
            "input",
            {
              type: "checkbox",
              name: "toggle-evaluations-all",
              checked: allVisible,
              onChange: onToggleEvaluations
            }
          ),
          "evaluations"
        ] }) })
      }
    ),
    /* @__PURE__ */ jsx5("ul", { children: data.spanEvaluationNames.map((name2) => {
      const isVisible2 = evaluationVisibility[name2];
      return /* @__PURE__ */ jsx5("li", { css: columCheckboxItemCSS, children: /* @__PURE__ */ jsxs2("label", { children: [
        /* @__PURE__ */ jsx5(
          "input",
          {
            type: "checkbox",
            name: name2,
            checked: isVisible2,
            onChange: () => {
              setEvaluationVisibility({
                ...evaluationVisibility,
                [name2]: !isVisible2
              });
            }
          }
        ),
        name2
      ] }) }, name2);
    }) })
  ] });
}

// src/pages/tracing/__generated__/SpanFilterConditionFieldValidationQuery.graphql.ts
var node10 = function() {
  var v0 = [
    {
      "defaultValue": null,
      "kind": "LocalArgument",
      "name": "condition"
    }
  ], v12 = [
    {
      "alias": null,
      "args": [
        {
          "kind": "Variable",
          "name": "condition",
          "variableName": "condition"
        }
      ],
      "concreteType": "ValidationResult",
      "kind": "LinkedField",
      "name": "validateSpanFilterCondition",
      "plural": false,
      "selections": [
        {
          "alias": null,
          "args": null,
          "kind": "ScalarField",
          "name": "isValid",
          "storageKey": null
        },
        {
          "alias": null,
          "args": null,
          "kind": "ScalarField",
          "name": "errorMessage",
          "storageKey": null
        }
      ],
      "storageKey": null
    }
  ];
  return {
    "fragment": {
      "argumentDefinitions": v0,
      "kind": "Fragment",
      "metadata": null,
      "name": "SpanFilterConditionFieldValidationQuery",
      "selections": v12,
      "type": "Query",
      "abstractKey": null
    },
    "kind": "Request",
    "operation": {
      "argumentDefinitions": v0,
      "kind": "Operation",
      "name": "SpanFilterConditionFieldValidationQuery",
      "selections": v12
    },
    "params": {
      "cacheID": "fed4b7622ea88f9f5db037a6e32f03e2",
      "id": null,
      "metadata": {},
      "name": "SpanFilterConditionFieldValidationQuery",
      "operationKind": "query",
      "text": "query SpanFilterConditionFieldValidationQuery(\n  $condition: String!\n) {\n  validateSpanFilterCondition(condition: $condition) {\n    isValid\n    errorMessage\n  }\n}\n"
    }
  };
}();
node10.hash = "90f49b2d20000eda00e3374d9b4988e3";
var SpanFilterConditionFieldValidationQuery_graphql_default = node10;

// src/pages/tracing/SpanFilterConditionField.tsx
var import_react63 = __toESM(require_react());

// node_modules/@codemirror/state/dist/index.js
var Text2 = class _Text2 {
  /**
  Get the line description around the given position.
  */
  lineAt(pos) {
    if (pos < 0 || pos > this.length)
      throw new RangeError(`Invalid position ${pos} in document of length ${this.length}`);
    return this.lineInner(pos, false, 1, 0);
  }
  /**
  Get the description for the given (1-based) line number.
  */
  line(n2) {
    if (n2 < 1 || n2 > this.lines)
      throw new RangeError(`Invalid line number ${n2} in ${this.lines}-line document`);
    return this.lineInner(n2, true, 1, 0);
  }
  /**
  Replace a range of the text with the given content.
  */
  replace(from2, to, text2) {
    let parts = [];
    this.decompose(
      0,
      from2,
      parts,
      2
      /* Open.To */
    );
    if (text2.length)
      text2.decompose(
        0,
        text2.length,
        parts,
        1 | 2
        /* Open.To */
      );
    this.decompose(
      to,
      this.length,
      parts,
      1
      /* Open.From */
    );
    return TextNode.from(parts, this.length - (to - from2) + text2.length);
  }
  /**
  Append another document to this one.
  */
  append(other) {
    return this.replace(this.length, this.length, other);
  }
  /**
  Retrieve the text between the given points.
  */
  slice(from2, to = this.length) {
    let parts = [];
    this.decompose(from2, to, parts, 0);
    return TextNode.from(parts, to - from2);
  }
  /**
  Test whether this text is equal to another instance.
  */
  eq(other) {
    if (other == this)
      return true;
    if (other.length != this.length || other.lines != this.lines)
      return false;
    let start = this.scanIdentical(other, 1), end = this.length - this.scanIdentical(other, -1);
    let a2 = new RawTextCursor(this), b = new RawTextCursor(other);
    for (let skip = start, pos = start; ; ) {
      a2.next(skip);
      b.next(skip);
      skip = 0;
      if (a2.lineBreak != b.lineBreak || a2.done != b.done || a2.value != b.value)
        return false;
      pos += a2.value.length;
      if (a2.done || pos >= end)
        return true;
    }
  }
  /**
  Iterate over the text. When `dir` is `-1`, iteration happens
  from end to start. This will return lines and the breaks between
  them as separate strings.
  */
  iter(dir = 1) {
    return new RawTextCursor(this, dir);
  }
  /**
  Iterate over a range of the text. When `from` > `to`, the
  iterator will run in reverse.
  */
  iterRange(from2, to = this.length) {
    return new PartialTextCursor(this, from2, to);
  }
  /**
  Return a cursor that iterates over the given range of lines,
  _without_ returning the line breaks between, and yielding empty
  strings for empty lines.
  
  When `from` and `to` are given, they should be 1-based line numbers.
  */
  iterLines(from2, to) {
    let inner;
    if (from2 == null) {
      inner = this.iter();
    } else {
      if (to == null)
        to = this.lines + 1;
      let start = this.line(from2).from;
      inner = this.iterRange(start, Math.max(start, to == this.lines + 1 ? this.length : to <= 1 ? 0 : this.line(to - 1).to));
    }
    return new LineCursor(inner);
  }
  /**
  Return the document as a string, using newline characters to
  separate lines.
  */
  toString() {
    return this.sliceString(0);
  }
  /**
  Convert the document to an array of lines (which can be
  deserialized again via [`Text.of`](https://codemirror.net/6/docs/ref/#state.Text^of)).
  */
  toJSON() {
    let lines = [];
    this.flatten(lines);
    return lines;
  }
  /**
  @internal
  */
  constructor() {
  }
  /**
  Create a `Text` instance for the given array of lines.
  */
  static of(text2) {
    if (text2.length == 0)
      throw new RangeError("A document must have at least one line");
    if (text2.length == 1 && !text2[0])
      return _Text2.empty;
    return text2.length <= 32 ? new TextLeaf(text2) : TextNode.from(TextLeaf.split(text2, []));
  }
};
var TextLeaf = class _TextLeaf extends Text2 {
  constructor(text2, length2 = textLength(text2)) {
    super();
    this.text = text2;
    this.length = length2;
  }
  get lines() {
    return this.text.length;
  }
  get children() {
    return null;
  }
  lineInner(target, isLine, line2, offset) {
    for (let i2 = 0; ; i2++) {
      let string2 = this.text[i2], end = offset + string2.length;
      if ((isLine ? line2 : end) >= target)
        return new Line6(offset, end, line2, string2);
      offset = end + 1;
      line2++;
    }
  }
  decompose(from2, to, target, open) {
    let text2 = from2 <= 0 && to >= this.length ? this : new _TextLeaf(sliceText(this.text, from2, to), Math.min(to, this.length) - Math.max(0, from2));
    if (open & 1) {
      let prev2 = target.pop();
      let joined = appendText(text2.text, prev2.text.slice(), 0, text2.length);
      if (joined.length <= 32) {
        target.push(new _TextLeaf(joined, prev2.length + text2.length));
      } else {
        let mid = joined.length >> 1;
        target.push(new _TextLeaf(joined.slice(0, mid)), new _TextLeaf(joined.slice(mid)));
      }
    } else {
      target.push(text2);
    }
  }
  replace(from2, to, text2) {
    if (!(text2 instanceof _TextLeaf))
      return super.replace(from2, to, text2);
    let lines = appendText(this.text, appendText(text2.text, sliceText(this.text, 0, from2)), to);
    let newLen = this.length + text2.length - (to - from2);
    if (lines.length <= 32)
      return new _TextLeaf(lines, newLen);
    return TextNode.from(_TextLeaf.split(lines, []), newLen);
  }
  sliceString(from2, to = this.length, lineSep = "\n") {
    let result = "";
    for (let pos = 0, i2 = 0; pos <= to && i2 < this.text.length; i2++) {
      let line2 = this.text[i2], end = pos + line2.length;
      if (pos > from2 && i2)
        result += lineSep;
      if (from2 < end && to > pos)
        result += line2.slice(Math.max(0, from2 - pos), to - pos);
      pos = end + 1;
    }
    return result;
  }
  flatten(target) {
    for (let line2 of this.text)
      target.push(line2);
  }
  scanIdentical() {
    return 0;
  }
  static split(text2, target) {
    let part = [], len = -1;
    for (let line2 of text2) {
      part.push(line2);
      len += line2.length + 1;
      if (part.length == 32) {
        target.push(new _TextLeaf(part, len));
        part = [];
        len = -1;
      }
    }
    if (len > -1)
      target.push(new _TextLeaf(part, len));
    return target;
  }
};
var TextNode = class _TextNode extends Text2 {
  constructor(children, length2) {
    super();
    this.children = children;
    this.length = length2;
    this.lines = 0;
    for (let child of children)
      this.lines += child.lines;
  }
  lineInner(target, isLine, line2, offset) {
    for (let i2 = 0; ; i2++) {
      let child = this.children[i2], end = offset + child.length, endLine = line2 + child.lines - 1;
      if ((isLine ? endLine : end) >= target)
        return child.lineInner(target, isLine, line2, offset);
      offset = end + 1;
      line2 = endLine + 1;
    }
  }
  decompose(from2, to, target, open) {
    for (let i2 = 0, pos = 0; pos <= to && i2 < this.children.length; i2++) {
      let child = this.children[i2], end = pos + child.length;
      if (from2 <= end && to >= pos) {
        let childOpen = open & ((pos <= from2 ? 1 : 0) | (end >= to ? 2 : 0));
        if (pos >= from2 && end <= to && !childOpen)
          target.push(child);
        else
          child.decompose(from2 - pos, to - pos, target, childOpen);
      }
      pos = end + 1;
    }
  }
  replace(from2, to, text2) {
    if (text2.lines < this.lines)
      for (let i2 = 0, pos = 0; i2 < this.children.length; i2++) {
        let child = this.children[i2], end = pos + child.length;
        if (from2 >= pos && to <= end) {
          let updated = child.replace(from2 - pos, to - pos, text2);
          let totalLines = this.lines - child.lines + updated.lines;
          if (updated.lines < totalLines >> 5 - 1 && updated.lines > totalLines >> 5 + 1) {
            let copy4 = this.children.slice();
            copy4[i2] = updated;
            return new _TextNode(copy4, this.length - (to - from2) + text2.length);
          }
          return super.replace(pos, end, updated);
        }
        pos = end + 1;
      }
    return super.replace(from2, to, text2);
  }
  sliceString(from2, to = this.length, lineSep = "\n") {
    let result = "";
    for (let i2 = 0, pos = 0; i2 < this.children.length && pos <= to; i2++) {
      let child = this.children[i2], end = pos + child.length;
      if (pos > from2 && i2)
        result += lineSep;
      if (from2 < end && to > pos)
        result += child.sliceString(from2 - pos, to - pos, lineSep);
      pos = end + 1;
    }
    return result;
  }
  flatten(target) {
    for (let child of this.children)
      child.flatten(target);
  }
  scanIdentical(other, dir) {
    if (!(other instanceof _TextNode))
      return 0;
    let length2 = 0;
    let [iA, iB, eA, eB] = dir > 0 ? [0, 0, this.children.length, other.children.length] : [this.children.length - 1, other.children.length - 1, -1, -1];
    for (; ; iA += dir, iB += dir) {
      if (iA == eA || iB == eB)
        return length2;
      let chA = this.children[iA], chB = other.children[iB];
      if (chA != chB)
        return length2 + chA.scanIdentical(chB, dir);
      length2 += chA.length + 1;
    }
  }
  static from(children, length2 = children.reduce((l, ch) => l + ch.length + 1, -1)) {
    let lines = 0;
    for (let ch of children)
      lines += ch.lines;
    if (lines < 32) {
      let flat = [];
      for (let ch of children)
        ch.flatten(flat);
      return new TextLeaf(flat, length2);
    }
    let chunk = Math.max(
      32,
      lines >> 5
      /* Tree.BranchShift */
    ), maxChunk = chunk << 1, minChunk = chunk >> 1;
    let chunked = [], currentLines = 0, currentLen = -1, currentChunk = [];
    function add2(child) {
      let last;
      if (child.lines > maxChunk && child instanceof _TextNode) {
        for (let node56 of child.children)
          add2(node56);
      } else if (child.lines > minChunk && (currentLines > minChunk || !currentLines)) {
        flush();
        chunked.push(child);
      } else if (child instanceof TextLeaf && currentLines && (last = currentChunk[currentChunk.length - 1]) instanceof TextLeaf && child.lines + last.lines <= 32) {
        currentLines += child.lines;
        currentLen += child.length + 1;
        currentChunk[currentChunk.length - 1] = new TextLeaf(last.text.concat(child.text), last.length + 1 + child.length);
      } else {
        if (currentLines + child.lines > chunk)
          flush();
        currentLines += child.lines;
        currentLen += child.length + 1;
        currentChunk.push(child);
      }
    }
    function flush() {
      if (currentLines == 0)
        return;
      chunked.push(currentChunk.length == 1 ? currentChunk[0] : _TextNode.from(currentChunk, currentLen));
      currentLen = -1;
      currentLines = currentChunk.length = 0;
    }
    for (let child of children)
      add2(child);
    flush();
    return chunked.length == 1 ? chunked[0] : new _TextNode(chunked, length2);
  }
};
Text2.empty = /* @__PURE__ */ new TextLeaf([""], 0);
function textLength(text2) {
  let length2 = -1;
  for (let line2 of text2)
    length2 += line2.length + 1;
  return length2;
}
function appendText(text2, target, from2 = 0, to = 1e9) {
  for (let pos = 0, i2 = 0, first = true; i2 < text2.length && pos <= to; i2++) {
    let line2 = text2[i2], end = pos + line2.length;
    if (end >= from2) {
      if (end > to)
        line2 = line2.slice(0, to - pos);
      if (pos < from2)
        line2 = line2.slice(from2 - pos);
      if (first) {
        target[target.length - 1] += line2;
        first = false;
      } else
        target.push(line2);
    }
    pos = end + 1;
  }
  return target;
}
function sliceText(text2, from2, to) {
  return appendText(text2, [""], from2, to);
}
var RawTextCursor = class {
  constructor(text2, dir = 1) {
    this.dir = dir;
    this.done = false;
    this.lineBreak = false;
    this.value = "";
    this.nodes = [text2];
    this.offsets = [dir > 0 ? 1 : (text2 instanceof TextLeaf ? text2.text.length : text2.children.length) << 1];
  }
  nextInner(skip, dir) {
    this.done = this.lineBreak = false;
    for (; ; ) {
      let last = this.nodes.length - 1;
      let top2 = this.nodes[last], offsetValue = this.offsets[last], offset = offsetValue >> 1;
      let size = top2 instanceof TextLeaf ? top2.text.length : top2.children.length;
      if (offset == (dir > 0 ? size : 0)) {
        if (last == 0) {
          this.done = true;
          this.value = "";
          return this;
        }
        if (dir > 0)
          this.offsets[last - 1]++;
        this.nodes.pop();
        this.offsets.pop();
      } else if ((offsetValue & 1) == (dir > 0 ? 0 : 1)) {
        this.offsets[last] += dir;
        if (skip == 0) {
          this.lineBreak = true;
          this.value = "\n";
          return this;
        }
        skip--;
      } else if (top2 instanceof TextLeaf) {
        let next2 = top2.text[offset + (dir < 0 ? -1 : 0)];
        this.offsets[last] += dir;
        if (next2.length > Math.max(0, skip)) {
          this.value = skip == 0 ? next2 : dir > 0 ? next2.slice(skip) : next2.slice(0, next2.length - skip);
          return this;
        }
        skip -= next2.length;
      } else {
        let next2 = top2.children[offset + (dir < 0 ? -1 : 0)];
        if (skip > next2.length) {
          skip -= next2.length;
          this.offsets[last] += dir;
        } else {
          if (dir < 0)
            this.offsets[last]--;
          this.nodes.push(next2);
          this.offsets.push(dir > 0 ? 1 : (next2 instanceof TextLeaf ? next2.text.length : next2.children.length) << 1);
        }
      }
    }
  }
  next(skip = 0) {
    if (skip < 0) {
      this.nextInner(-skip, -this.dir);
      skip = this.value.length;
    }
    return this.nextInner(skip, this.dir);
  }
};
var PartialTextCursor = class {
  constructor(text2, start, end) {
    this.value = "";
    this.done = false;
    this.cursor = new RawTextCursor(text2, start > end ? -1 : 1);
    this.pos = start > end ? text2.length : 0;
    this.from = Math.min(start, end);
    this.to = Math.max(start, end);
  }
  nextInner(skip, dir) {
    if (dir < 0 ? this.pos <= this.from : this.pos >= this.to) {
      this.value = "";
      this.done = true;
      return this;
    }
    skip += Math.max(0, dir < 0 ? this.pos - this.to : this.from - this.pos);
    let limit = dir < 0 ? this.pos - this.from : this.to - this.pos;
    if (skip > limit)
      skip = limit;
    limit -= skip;
    let { value } = this.cursor.next(skip);
    this.pos += (value.length + skip) * dir;
    this.value = value.length <= limit ? value : dir < 0 ? value.slice(value.length - limit) : value.slice(0, limit);
    this.done = !this.value;
    return this;
  }
  next(skip = 0) {
    if (skip < 0)
      skip = Math.max(skip, this.from - this.pos);
    else if (skip > 0)
      skip = Math.min(skip, this.to - this.pos);
    return this.nextInner(skip, this.cursor.dir);
  }
  get lineBreak() {
    return this.cursor.lineBreak && this.value != "";
  }
};
var LineCursor = class {
  constructor(inner) {
    this.inner = inner;
    this.afterBreak = true;
    this.value = "";
    this.done = false;
  }
  next(skip = 0) {
    let { done, lineBreak, value } = this.inner.next(skip);
    if (done) {
      this.done = true;
      this.value = "";
    } else if (lineBreak) {
      if (this.afterBreak) {
        this.value = "";
      } else {
        this.afterBreak = true;
        this.next();
      }
    } else {
      this.value = value;
      this.afterBreak = false;
    }
    return this;
  }
  get lineBreak() {
    return false;
  }
};
if (typeof Symbol != "undefined") {
  Text2.prototype[Symbol.iterator] = function() {
    return this.iter();
  };
  RawTextCursor.prototype[Symbol.iterator] = PartialTextCursor.prototype[Symbol.iterator] = LineCursor.prototype[Symbol.iterator] = function() {
    return this;
  };
}
var Line6 = class {
  /**
  @internal
  */
  constructor(from2, to, number5, text2) {
    this.from = from2;
    this.to = to;
    this.number = number5;
    this.text = text2;
  }
  /**
  The length of the line (not including any line break after it).
  */
  get length() {
    return this.to - this.from;
  }
};
var extend3 = /* @__PURE__ */ "lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map((s2) => s2 ? parseInt(s2, 36) : 1);
for (let i2 = 1; i2 < extend3.length; i2++)
  extend3[i2] += extend3[i2 - 1];
function isExtendingChar(code) {
  for (let i2 = 1; i2 < extend3.length; i2 += 2)
    if (extend3[i2] > code)
      return extend3[i2 - 1] <= code;
  return false;
}
function isRegionalIndicator(code) {
  return code >= 127462 && code <= 127487;
}
var ZWJ = 8205;
function findClusterBreak(str, pos, forward = true, includeExtending = true) {
  return (forward ? nextClusterBreak : prevClusterBreak)(str, pos, includeExtending);
}
function nextClusterBreak(str, pos, includeExtending) {
  if (pos == str.length)
    return pos;
  if (pos && surrogateLow(str.charCodeAt(pos)) && surrogateHigh(str.charCodeAt(pos - 1)))
    pos--;
  let prev2 = codePointAt(str, pos);
  pos += codePointSize(prev2);
  while (pos < str.length) {
    let next2 = codePointAt(str, pos);
    if (prev2 == ZWJ || next2 == ZWJ || includeExtending && isExtendingChar(next2)) {
      pos += codePointSize(next2);
      prev2 = next2;
    } else if (isRegionalIndicator(next2)) {
      let countBefore = 0, i2 = pos - 2;
      while (i2 >= 0 && isRegionalIndicator(codePointAt(str, i2))) {
        countBefore++;
        i2 -= 2;
      }
      if (countBefore % 2 == 0)
        break;
      else
        pos += 2;
    } else {
      break;
    }
  }
  return pos;
}
function prevClusterBreak(str, pos, includeExtending) {
  while (pos > 0) {
    let found = nextClusterBreak(str, pos - 2, includeExtending);
    if (found < pos)
      return found;
    pos--;
  }
  return 0;
}
function surrogateLow(ch) {
  return ch >= 56320 && ch < 57344;
}
function surrogateHigh(ch) {
  return ch >= 55296 && ch < 56320;
}
function codePointAt(str, pos) {
  let code0 = str.charCodeAt(pos);
  if (!surrogateHigh(code0) || pos + 1 == str.length)
    return code0;
  let code1 = str.charCodeAt(pos + 1);
  if (!surrogateLow(code1))
    return code0;
  return (code0 - 55296 << 10) + (code1 - 56320) + 65536;
}
function fromCodePoint(code) {
  if (code <= 65535)
    return String.fromCharCode(code);
  code -= 65536;
  return String.fromCharCode((code >> 10) + 55296, (code & 1023) + 56320);
}
function codePointSize(code) {
  return code < 65536 ? 1 : 2;
}
var DefaultSplit = /\r\n?|\n/;
var MapMode = /* @__PURE__ */ function(MapMode2) {
  MapMode2[MapMode2["Simple"] = 0] = "Simple";
  MapMode2[MapMode2["TrackDel"] = 1] = "TrackDel";
  MapMode2[MapMode2["TrackBefore"] = 2] = "TrackBefore";
  MapMode2[MapMode2["TrackAfter"] = 3] = "TrackAfter";
  return MapMode2;
}(MapMode || (MapMode = {}));
var ChangeDesc = class _ChangeDesc {
  // Sections are encoded as pairs of integers. The first is the
  // length in the current document, and the second is -1 for
  // unaffected sections, and the length of the replacement content
  // otherwise. So an insertion would be (0, n>0), a deletion (n>0,
  // 0), and a replacement two positive numbers.
  /**
  @internal
  */
  constructor(sections) {
    this.sections = sections;
  }
  /**
  The length of the document before the change.
  */
  get length() {
    let result = 0;
    for (let i2 = 0; i2 < this.sections.length; i2 += 2)
      result += this.sections[i2];
    return result;
  }
  /**
  The length of the document after the change.
  */
  get newLength() {
    let result = 0;
    for (let i2 = 0; i2 < this.sections.length; i2 += 2) {
      let ins = this.sections[i2 + 1];
      result += ins < 0 ? this.sections[i2] : ins;
    }
    return result;
  }
  /**
  False when there are actual changes in this set.
  */
  get empty() {
    return this.sections.length == 0 || this.sections.length == 2 && this.sections[1] < 0;
  }
  /**
  Iterate over the unchanged parts left by these changes. `posA`
  provides the position of the range in the old document, `posB`
  the new position in the changed document.
  */
  iterGaps(f) {
    for (let i2 = 0, posA = 0, posB = 0; i2 < this.sections.length; ) {
      let len = this.sections[i2++], ins = this.sections[i2++];
      if (ins < 0) {
        f(posA, posB, len);
        posB += len;
      } else {
        posB += ins;
      }
      posA += len;
    }
  }
  /**
  Iterate over the ranges changed by these changes. (See
  [`ChangeSet.iterChanges`](https://codemirror.net/6/docs/ref/#state.ChangeSet.iterChanges) for a
  variant that also provides you with the inserted text.)
  `fromA`/`toA` provides the extent of the change in the starting
  document, `fromB`/`toB` the extent of the replacement in the
  changed document.
  
  When `individual` is true, adjacent changes (which are kept
  separate for [position mapping](https://codemirror.net/6/docs/ref/#state.ChangeDesc.mapPos)) are
  reported separately.
  */
  iterChangedRanges(f, individual = false) {
    iterChanges(this, f, individual);
  }
  /**
  Get a description of the inverted form of these changes.
  */
  get invertedDesc() {
    let sections = [];
    for (let i2 = 0; i2 < this.sections.length; ) {
      let len = this.sections[i2++], ins = this.sections[i2++];
      if (ins < 0)
        sections.push(len, ins);
      else
        sections.push(ins, len);
    }
    return new _ChangeDesc(sections);
  }
  /**
  Compute the combined effect of applying another set of changes
  after this one. The length of the document after this set should
  match the length before `other`.
  */
  composeDesc(other) {
    return this.empty ? other : other.empty ? this : composeSets(this, other);
  }
  /**
  Map this description, which should start with the same document
  as `other`, over another set of changes, so that it can be
  applied after it. When `before` is true, map as if the changes
  in `other` happened before the ones in `this`.
  */
  mapDesc(other, before = false) {
    return other.empty ? this : mapSet(this, other, before);
  }
  mapPos(pos, assoc = -1, mode = MapMode.Simple) {
    let posA = 0, posB = 0;
    for (let i2 = 0; i2 < this.sections.length; ) {
      let len = this.sections[i2++], ins = this.sections[i2++], endA = posA + len;
      if (ins < 0) {
        if (endA > pos)
          return posB + (pos - posA);
        posB += len;
      } else {
        if (mode != MapMode.Simple && endA >= pos && (mode == MapMode.TrackDel && posA < pos && endA > pos || mode == MapMode.TrackBefore && posA < pos || mode == MapMode.TrackAfter && endA > pos))
          return null;
        if (endA > pos || endA == pos && assoc < 0 && !len)
          return pos == posA || assoc < 0 ? posB : posB + ins;
        posB += ins;
      }
      posA = endA;
    }
    if (pos > posA)
      throw new RangeError(`Position ${pos} is out of range for changeset of length ${posA}`);
    return posB;
  }
  /**
  Check whether these changes touch a given range. When one of the
  changes entirely covers the range, the string `"cover"` is
  returned.
  */
  touchesRange(from2, to = from2) {
    for (let i2 = 0, pos = 0; i2 < this.sections.length && pos <= to; ) {
      let len = this.sections[i2++], ins = this.sections[i2++], end = pos + len;
      if (ins >= 0 && pos <= to && end >= from2)
        return pos < from2 && end > to ? "cover" : true;
      pos = end;
    }
    return false;
  }
  /**
  @internal
  */
  toString() {
    let result = "";
    for (let i2 = 0; i2 < this.sections.length; ) {
      let len = this.sections[i2++], ins = this.sections[i2++];
      result += (result ? " " : "") + len + (ins >= 0 ? ":" + ins : "");
    }
    return result;
  }
  /**
  Serialize this change desc to a JSON-representable value.
  */
  toJSON() {
    return this.sections;
  }
  /**
  Create a change desc from its JSON representation (as produced
  by [`toJSON`](https://codemirror.net/6/docs/ref/#state.ChangeDesc.toJSON).
  */
  static fromJSON(json3) {
    if (!Array.isArray(json3) || json3.length % 2 || json3.some((a2) => typeof a2 != "number"))
      throw new RangeError("Invalid JSON representation of ChangeDesc");
    return new _ChangeDesc(json3);
  }
  /**
  @internal
  */
  static create(sections) {
    return new _ChangeDesc(sections);
  }
};
var ChangeSet = class _ChangeSet extends ChangeDesc {
  constructor(sections, inserted) {
    super(sections);
    this.inserted = inserted;
  }
  /**
  Apply the changes to a document, returning the modified
  document.
  */
  apply(doc2) {
    if (this.length != doc2.length)
      throw new RangeError("Applying change set to a document with the wrong length");
    iterChanges(this, (fromA, toA, fromB, _toB, text2) => doc2 = doc2.replace(fromB, fromB + (toA - fromA), text2), false);
    return doc2;
  }
  mapDesc(other, before = false) {
    return mapSet(this, other, before, true);
  }
  /**
  Given the document as it existed _before_ the changes, return a
  change set that represents the inverse of this set, which could
  be used to go from the document created by the changes back to
  the document as it existed before the changes.
  */
  invert(doc2) {
    let sections = this.sections.slice(), inserted = [];
    for (let i2 = 0, pos = 0; i2 < sections.length; i2 += 2) {
      let len = sections[i2], ins = sections[i2 + 1];
      if (ins >= 0) {
        sections[i2] = ins;
        sections[i2 + 1] = len;
        let index = i2 >> 1;
        while (inserted.length < index)
          inserted.push(Text2.empty);
        inserted.push(len ? doc2.slice(pos, pos + len) : Text2.empty);
      }
      pos += len;
    }
    return new _ChangeSet(sections, inserted);
  }
  /**
  Combine two subsequent change sets into a single set. `other`
  must start in the document produced by `this`. If `this` goes
  `docA` → `docB` and `other` represents `docB` → `docC`, the
  returned value will represent the change `docA` → `docC`.
  */
  compose(other) {
    return this.empty ? other : other.empty ? this : composeSets(this, other, true);
  }
  /**
  Given another change set starting in the same document, maps this
  change set over the other, producing a new change set that can be
  applied to the document produced by applying `other`. When
  `before` is `true`, order changes as if `this` comes before
  `other`, otherwise (the default) treat `other` as coming first.
  
  Given two changes `A` and `B`, `A.compose(B.map(A))` and
  `B.compose(A.map(B, true))` will produce the same document. This
  provides a basic form of [operational
  transformation](https://en.wikipedia.org/wiki/Operational_transformation),
  and can be used for collaborative editing.
  */
  map(other, before = false) {
    return other.empty ? this : mapSet(this, other, before, true);
  }
  /**
  Iterate over the changed ranges in the document, calling `f` for
  each, with the range in the original document (`fromA`-`toA`)
  and the range that replaces it in the new document
  (`fromB`-`toB`).
  
  When `individual` is true, adjacent changes are reported
  separately.
  */
  iterChanges(f, individual = false) {
    iterChanges(this, f, individual);
  }
  /**
  Get a [change description](https://codemirror.net/6/docs/ref/#state.ChangeDesc) for this change
  set.
  */
  get desc() {
    return ChangeDesc.create(this.sections);
  }
  /**
  @internal
  */
  filter(ranges) {
    let resultSections = [], resultInserted = [], filteredSections = [];
    let iter = new SectionIter(this);
    done:
      for (let i2 = 0, pos = 0; ; ) {
        let next2 = i2 == ranges.length ? 1e9 : ranges[i2++];
        while (pos < next2 || pos == next2 && iter.len == 0) {
          if (iter.done)
            break done;
          let len = Math.min(iter.len, next2 - pos);
          addSection(filteredSections, len, -1);
          let ins = iter.ins == -1 ? -1 : iter.off == 0 ? iter.ins : 0;
          addSection(resultSections, len, ins);
          if (ins > 0)
            addInsert(resultInserted, resultSections, iter.text);
          iter.forward(len);
          pos += len;
        }
        let end = ranges[i2++];
        while (pos < end) {
          if (iter.done)
            break done;
          let len = Math.min(iter.len, end - pos);
          addSection(resultSections, len, -1);
          addSection(filteredSections, len, iter.ins == -1 ? -1 : iter.off == 0 ? iter.ins : 0);
          iter.forward(len);
          pos += len;
        }
      }
    return {
      changes: new _ChangeSet(resultSections, resultInserted),
      filtered: ChangeDesc.create(filteredSections)
    };
  }
  /**
  Serialize this change set to a JSON-representable value.
  */
  toJSON() {
    let parts = [];
    for (let i2 = 0; i2 < this.sections.length; i2 += 2) {
      let len = this.sections[i2], ins = this.sections[i2 + 1];
      if (ins < 0)
        parts.push(len);
      else if (ins == 0)
        parts.push([len]);
      else
        parts.push([len].concat(this.inserted[i2 >> 1].toJSON()));
    }
    return parts;
  }
  /**
  Create a change set for the given changes, for a document of the
  given length, using `lineSep` as line separator.
  */
  static of(changes, length2, lineSep) {
    let sections = [], inserted = [], pos = 0;
    let total = null;
    function flush(force = false) {
      if (!force && !sections.length)
        return;
      if (pos < length2)
        addSection(sections, length2 - pos, -1);
      let set3 = new _ChangeSet(sections, inserted);
      total = total ? total.compose(set3.map(total)) : set3;
      sections = [];
      inserted = [];
      pos = 0;
    }
    function process2(spec) {
      if (Array.isArray(spec)) {
        for (let sub of spec)
          process2(sub);
      } else if (spec instanceof _ChangeSet) {
        if (spec.length != length2)
          throw new RangeError(`Mismatched change set length (got ${spec.length}, expected ${length2})`);
        flush();
        total = total ? total.compose(spec.map(total)) : spec;
      } else {
        let { from: from2, to = from2, insert: insert2 } = spec;
        if (from2 > to || from2 < 0 || to > length2)
          throw new RangeError(`Invalid change range ${from2} to ${to} (in doc of length ${length2})`);
        let insText = !insert2 ? Text2.empty : typeof insert2 == "string" ? Text2.of(insert2.split(lineSep || DefaultSplit)) : insert2;
        let insLen = insText.length;
        if (from2 == to && insLen == 0)
          return;
        if (from2 < pos)
          flush();
        if (from2 > pos)
          addSection(sections, from2 - pos, -1);
        addSection(sections, to - from2, insLen);
        addInsert(inserted, sections, insText);
        pos = to;
      }
    }
    process2(changes);
    flush(!total);
    return total;
  }
  /**
  Create an empty changeset of the given length.
  */
  static empty(length2) {
    return new _ChangeSet(length2 ? [length2, -1] : [], []);
  }
  /**
  Create a changeset from its JSON representation (as produced by
  [`toJSON`](https://codemirror.net/6/docs/ref/#state.ChangeSet.toJSON).
  */
  static fromJSON(json3) {
    if (!Array.isArray(json3))
      throw new RangeError("Invalid JSON representation of ChangeSet");
    let sections = [], inserted = [];
    for (let i2 = 0; i2 < json3.length; i2++) {
      let part = json3[i2];
      if (typeof part == "number") {
        sections.push(part, -1);
      } else if (!Array.isArray(part) || typeof part[0] != "number" || part.some((e3, i3) => i3 && typeof e3 != "string")) {
        throw new RangeError("Invalid JSON representation of ChangeSet");
      } else if (part.length == 1) {
        sections.push(part[0], 0);
      } else {
        while (inserted.length < i2)
          inserted.push(Text2.empty);
        inserted[i2] = Text2.of(part.slice(1));
        sections.push(part[0], inserted[i2].length);
      }
    }
    return new _ChangeSet(sections, inserted);
  }
  /**
  @internal
  */
  static createSet(sections, inserted) {
    return new _ChangeSet(sections, inserted);
  }
};
function addSection(sections, len, ins, forceJoin = false) {
  if (len == 0 && ins <= 0)
    return;
  let last = sections.length - 2;
  if (last >= 0 && ins <= 0 && ins == sections[last + 1])
    sections[last] += len;
  else if (len == 0 && sections[last] == 0)
    sections[last + 1] += ins;
  else if (forceJoin) {
    sections[last] += len;
    sections[last + 1] += ins;
  } else
    sections.push(len, ins);
}
function addInsert(values2, sections, value) {
  if (value.length == 0)
    return;
  let index = sections.length - 2 >> 1;
  if (index < values2.length) {
    values2[values2.length - 1] = values2[values2.length - 1].append(value);
  } else {
    while (values2.length < index)
      values2.push(Text2.empty);
    values2.push(value);
  }
}
function iterChanges(desc, f, individual) {
  let inserted = desc.inserted;
  for (let posA = 0, posB = 0, i2 = 0; i2 < desc.sections.length; ) {
    let len = desc.sections[i2++], ins = desc.sections[i2++];
    if (ins < 0) {
      posA += len;
      posB += len;
    } else {
      let endA = posA, endB = posB, text2 = Text2.empty;
      for (; ; ) {
        endA += len;
        endB += ins;
        if (ins && inserted)
          text2 = text2.append(inserted[i2 - 2 >> 1]);
        if (individual || i2 == desc.sections.length || desc.sections[i2 + 1] < 0)
          break;
        len = desc.sections[i2++];
        ins = desc.sections[i2++];
      }
      f(posA, endA, posB, endB, text2);
      posA = endA;
      posB = endB;
    }
  }
}
function mapSet(setA, setB, before, mkSet = false) {
  let sections = [], insert2 = mkSet ? [] : null;
  let a2 = new SectionIter(setA), b = new SectionIter(setB);
  for (let inserted = -1; ; ) {
    if (a2.ins == -1 && b.ins == -1) {
      let len = Math.min(a2.len, b.len);
      addSection(sections, len, -1);
      a2.forward(len);
      b.forward(len);
    } else if (b.ins >= 0 && (a2.ins < 0 || inserted == a2.i || a2.off == 0 && (b.len < a2.len || b.len == a2.len && !before))) {
      let len = b.len;
      addSection(sections, b.ins, -1);
      while (len) {
        let piece = Math.min(a2.len, len);
        if (a2.ins >= 0 && inserted < a2.i && a2.len <= piece) {
          addSection(sections, 0, a2.ins);
          if (insert2)
            addInsert(insert2, sections, a2.text);
          inserted = a2.i;
        }
        a2.forward(piece);
        len -= piece;
      }
      b.next();
    } else if (a2.ins >= 0) {
      let len = 0, left = a2.len;
      while (left) {
        if (b.ins == -1) {
          let piece = Math.min(left, b.len);
          len += piece;
          left -= piece;
          b.forward(piece);
        } else if (b.ins == 0 && b.len < left) {
          left -= b.len;
          b.next();
        } else {
          break;
        }
      }
      addSection(sections, len, inserted < a2.i ? a2.ins : 0);
      if (insert2 && inserted < a2.i)
        addInsert(insert2, sections, a2.text);
      inserted = a2.i;
      a2.forward(a2.len - left);
    } else if (a2.done && b.done) {
      return insert2 ? ChangeSet.createSet(sections, insert2) : ChangeDesc.create(sections);
    } else {
      throw new Error("Mismatched change set lengths");
    }
  }
}
function composeSets(setA, setB, mkSet = false) {
  let sections = [];
  let insert2 = mkSet ? [] : null;
  let a2 = new SectionIter(setA), b = new SectionIter(setB);
  for (let open = false; ; ) {
    if (a2.done && b.done) {
      return insert2 ? ChangeSet.createSet(sections, insert2) : ChangeDesc.create(sections);
    } else if (a2.ins == 0) {
      addSection(sections, a2.len, 0, open);
      a2.next();
    } else if (b.len == 0 && !b.done) {
      addSection(sections, 0, b.ins, open);
      if (insert2)
        addInsert(insert2, sections, b.text);
      b.next();
    } else if (a2.done || b.done) {
      throw new Error("Mismatched change set lengths");
    } else {
      let len = Math.min(a2.len2, b.len), sectionLen = sections.length;
      if (a2.ins == -1) {
        let insB = b.ins == -1 ? -1 : b.off ? 0 : b.ins;
        addSection(sections, len, insB, open);
        if (insert2 && insB)
          addInsert(insert2, sections, b.text);
      } else if (b.ins == -1) {
        addSection(sections, a2.off ? 0 : a2.len, len, open);
        if (insert2)
          addInsert(insert2, sections, a2.textBit(len));
      } else {
        addSection(sections, a2.off ? 0 : a2.len, b.off ? 0 : b.ins, open);
        if (insert2 && !b.off)
          addInsert(insert2, sections, b.text);
      }
      open = (a2.ins > len || b.ins >= 0 && b.len > len) && (open || sections.length > sectionLen);
      a2.forward2(len);
      b.forward(len);
    }
  }
}
var SectionIter = class {
  constructor(set3) {
    this.set = set3;
    this.i = 0;
    this.next();
  }
  next() {
    let { sections } = this.set;
    if (this.i < sections.length) {
      this.len = sections[this.i++];
      this.ins = sections[this.i++];
    } else {
      this.len = 0;
      this.ins = -2;
    }
    this.off = 0;
  }
  get done() {
    return this.ins == -2;
  }
  get len2() {
    return this.ins < 0 ? this.len : this.ins;
  }
  get text() {
    let { inserted } = this.set, index = this.i - 2 >> 1;
    return index >= inserted.length ? Text2.empty : inserted[index];
  }
  textBit(len) {
    let { inserted } = this.set, index = this.i - 2 >> 1;
    return index >= inserted.length && !len ? Text2.empty : inserted[index].slice(this.off, len == null ? void 0 : this.off + len);
  }
  forward(len) {
    if (len == this.len)
      this.next();
    else {
      this.len -= len;
      this.off += len;
    }
  }
  forward2(len) {
    if (this.ins == -1)
      this.forward(len);
    else if (len == this.ins)
      this.next();
    else {
      this.ins -= len;
      this.off += len;
    }
  }
};
var SelectionRange = class _SelectionRange {
  constructor(from2, to, flags) {
    this.from = from2;
    this.to = to;
    this.flags = flags;
  }
  /**
  The anchor of the range—the side that doesn't move when you
  extend it.
  */
  get anchor() {
    return this.flags & 32 ? this.to : this.from;
  }
  /**
  The head of the range, which is moved when the range is
  [extended](https://codemirror.net/6/docs/ref/#state.SelectionRange.extend).
  */
  get head() {
    return this.flags & 32 ? this.from : this.to;
  }
  /**
  True when `anchor` and `head` are at the same position.
  */
  get empty() {
    return this.from == this.to;
  }
  /**
  If this is a cursor that is explicitly associated with the
  character on one of its sides, this returns the side. -1 means
  the character before its position, 1 the character after, and 0
  means no association.
  */
  get assoc() {
    return this.flags & 8 ? -1 : this.flags & 16 ? 1 : 0;
  }
  /**
  The bidirectional text level associated with this cursor, if
  any.
  */
  get bidiLevel() {
    let level = this.flags & 7;
    return level == 7 ? null : level;
  }
  /**
  The goal column (stored vertical offset) associated with a
  cursor. This is used to preserve the vertical position when
  [moving](https://codemirror.net/6/docs/ref/#view.EditorView.moveVertically) across
  lines of different length.
  */
  get goalColumn() {
    let value = this.flags >> 6;
    return value == 16777215 ? void 0 : value;
  }
  /**
  Map this range through a change, producing a valid range in the
  updated document.
  */
  map(change, assoc = -1) {
    let from2, to;
    if (this.empty) {
      from2 = to = change.mapPos(this.from, assoc);
    } else {
      from2 = change.mapPos(this.from, 1);
      to = change.mapPos(this.to, -1);
    }
    return from2 == this.from && to == this.to ? this : new _SelectionRange(from2, to, this.flags);
  }
  /**
  Extend this range to cover at least `from` to `to`.
  */
  extend(from2, to = from2) {
    if (from2 <= this.anchor && to >= this.anchor)
      return EditorSelection.range(from2, to);
    let head = Math.abs(from2 - this.anchor) > Math.abs(to - this.anchor) ? from2 : to;
    return EditorSelection.range(this.anchor, head);
  }
  /**
  Compare this range to another range.
  */
  eq(other) {
    return this.anchor == other.anchor && this.head == other.head;
  }
  /**
  Return a JSON-serializable object representing the range.
  */
  toJSON() {
    return { anchor: this.anchor, head: this.head };
  }
  /**
  Convert a JSON representation of a range to a `SelectionRange`
  instance.
  */
  static fromJSON(json3) {
    if (!json3 || typeof json3.anchor != "number" || typeof json3.head != "number")
      throw new RangeError("Invalid JSON representation for SelectionRange");
    return EditorSelection.range(json3.anchor, json3.head);
  }
  /**
  @internal
  */
  static create(from2, to, flags) {
    return new _SelectionRange(from2, to, flags);
  }
};
var EditorSelection = class _EditorSelection {
  constructor(ranges, mainIndex) {
    this.ranges = ranges;
    this.mainIndex = mainIndex;
  }
  /**
  Map a selection through a change. Used to adjust the selection
  position for changes.
  */
  map(change, assoc = -1) {
    if (change.empty)
      return this;
    return _EditorSelection.create(this.ranges.map((r3) => r3.map(change, assoc)), this.mainIndex);
  }
  /**
  Compare this selection to another selection.
  */
  eq(other) {
    if (this.ranges.length != other.ranges.length || this.mainIndex != other.mainIndex)
      return false;
    for (let i2 = 0; i2 < this.ranges.length; i2++)
      if (!this.ranges[i2].eq(other.ranges[i2]))
        return false;
    return true;
  }
  /**
  Get the primary selection range. Usually, you should make sure
  your code applies to _all_ ranges, by using methods like
  [`changeByRange`](https://codemirror.net/6/docs/ref/#state.EditorState.changeByRange).
  */
  get main() {
    return this.ranges[this.mainIndex];
  }
  /**
  Make sure the selection only has one range. Returns a selection
  holding only the main range from this selection.
  */
  asSingle() {
    return this.ranges.length == 1 ? this : new _EditorSelection([this.main], 0);
  }
  /**
  Extend this selection with an extra range.
  */
  addRange(range4, main = true) {
    return _EditorSelection.create([range4].concat(this.ranges), main ? 0 : this.mainIndex + 1);
  }
  /**
  Replace a given range with another range, and then normalize the
  selection to merge and sort ranges if necessary.
  */
  replaceRange(range4, which = this.mainIndex) {
    let ranges = this.ranges.slice();
    ranges[which] = range4;
    return _EditorSelection.create(ranges, this.mainIndex);
  }
  /**
  Convert this selection to an object that can be serialized to
  JSON.
  */
  toJSON() {
    return { ranges: this.ranges.map((r3) => r3.toJSON()), main: this.mainIndex };
  }
  /**
  Create a selection from a JSON representation.
  */
  static fromJSON(json3) {
    if (!json3 || !Array.isArray(json3.ranges) || typeof json3.main != "number" || json3.main >= json3.ranges.length)
      throw new RangeError("Invalid JSON representation for EditorSelection");
    return new _EditorSelection(json3.ranges.map((r3) => SelectionRange.fromJSON(r3)), json3.main);
  }
  /**
  Create a selection holding a single range.
  */
  static single(anchor, head = anchor) {
    return new _EditorSelection([_EditorSelection.range(anchor, head)], 0);
  }
  /**
  Sort and merge the given set of ranges, creating a valid
  selection.
  */
  static create(ranges, mainIndex = 0) {
    if (ranges.length == 0)
      throw new RangeError("A selection needs at least one range");
    for (let pos = 0, i2 = 0; i2 < ranges.length; i2++) {
      let range4 = ranges[i2];
      if (range4.empty ? range4.from <= pos : range4.from < pos)
        return _EditorSelection.normalized(ranges.slice(), mainIndex);
      pos = range4.to;
    }
    return new _EditorSelection(ranges, mainIndex);
  }
  /**
  Create a cursor selection range at the given position. You can
  safely ignore the optional arguments in most situations.
  */
  static cursor(pos, assoc = 0, bidiLevel, goalColumn) {
    return SelectionRange.create(pos, pos, (assoc == 0 ? 0 : assoc < 0 ? 8 : 16) | (bidiLevel == null ? 7 : Math.min(6, bidiLevel)) | (goalColumn !== null && goalColumn !== void 0 ? goalColumn : 16777215) << 6);
  }
  /**
  Create a selection range.
  */
  static range(anchor, head, goalColumn, bidiLevel) {
    let flags = (goalColumn !== null && goalColumn !== void 0 ? goalColumn : 16777215) << 6 | (bidiLevel == null ? 7 : Math.min(6, bidiLevel));
    return head < anchor ? SelectionRange.create(head, anchor, 32 | 16 | flags) : SelectionRange.create(anchor, head, (head > anchor ? 8 : 0) | flags);
  }
  /**
  @internal
  */
  static normalized(ranges, mainIndex = 0) {
    let main = ranges[mainIndex];
    ranges.sort((a2, b) => a2.from - b.from);
    mainIndex = ranges.indexOf(main);
    for (let i2 = 1; i2 < ranges.length; i2++) {
      let range4 = ranges[i2], prev2 = ranges[i2 - 1];
      if (range4.empty ? range4.from <= prev2.to : range4.from < prev2.to) {
        let from2 = prev2.from, to = Math.max(range4.to, prev2.to);
        if (i2 <= mainIndex)
          mainIndex--;
        ranges.splice(--i2, 2, range4.anchor > range4.head ? _EditorSelection.range(to, from2) : _EditorSelection.range(from2, to));
      }
    }
    return new _EditorSelection(ranges, mainIndex);
  }
};
function checkSelection(selection2, docLength) {
  for (let range4 of selection2.ranges)
    if (range4.to > docLength)
      throw new RangeError("Selection points outside of document");
}
var nextID = 0;
var Facet = class _Facet {
  constructor(combine2, compareInput, compare2, isStatic, enables) {
    this.combine = combine2;
    this.compareInput = compareInput;
    this.compare = compare2;
    this.isStatic = isStatic;
    this.id = nextID++;
    this.default = combine2([]);
    this.extensions = typeof enables == "function" ? enables(this) : enables;
  }
  /**
  Returns a facet reader for this facet, which can be used to
  [read](https://codemirror.net/6/docs/ref/#state.EditorState.facet) it but not to define values for it.
  */
  get reader() {
    return this;
  }
  /**
  Define a new facet.
  */
  static define(config2 = {}) {
    return new _Facet(config2.combine || ((a2) => a2), config2.compareInput || ((a2, b) => a2 === b), config2.compare || (!config2.combine ? sameArray : (a2, b) => a2 === b), !!config2.static, config2.enables);
  }
  /**
  Returns an extension that adds the given value to this facet.
  */
  of(value) {
    return new FacetProvider([], this, 0, value);
  }
  /**
  Create an extension that computes a value for the facet from a
  state. You must take care to declare the parts of the state that
  this value depends on, since your function is only called again
  for a new state when one of those parts changed.
  
  In cases where your value depends only on a single field, you'll
  want to use the [`from`](https://codemirror.net/6/docs/ref/#state.Facet.from) method instead.
  */
  compute(deps, get3) {
    if (this.isStatic)
      throw new Error("Can't compute a static facet");
    return new FacetProvider(deps, this, 1, get3);
  }
  /**
  Create an extension that computes zero or more values for this
  facet from a state.
  */
  computeN(deps, get3) {
    if (this.isStatic)
      throw new Error("Can't compute a static facet");
    return new FacetProvider(deps, this, 2, get3);
  }
  from(field, get3) {
    if (!get3)
      get3 = (x2) => x2;
    return this.compute([field], (state) => get3(state.field(field)));
  }
};
function sameArray(a2, b) {
  return a2 == b || a2.length == b.length && a2.every((e3, i2) => e3 === b[i2]);
}
var FacetProvider = class {
  constructor(dependencies, facet, type, value) {
    this.dependencies = dependencies;
    this.facet = facet;
    this.type = type;
    this.value = value;
    this.id = nextID++;
  }
  dynamicSlot(addresses) {
    var _a2;
    let getter = this.value;
    let compare2 = this.facet.compareInput;
    let id2 = this.id, idx = addresses[id2] >> 1, multi = this.type == 2;
    let depDoc = false, depSel = false, depAddrs = [];
    for (let dep of this.dependencies) {
      if (dep == "doc")
        depDoc = true;
      else if (dep == "selection")
        depSel = true;
      else if ((((_a2 = addresses[dep.id]) !== null && _a2 !== void 0 ? _a2 : 1) & 1) == 0)
        depAddrs.push(addresses[dep.id]);
    }
    return {
      create(state) {
        state.values[idx] = getter(state);
        return 1;
      },
      update(state, tr) {
        if (depDoc && tr.docChanged || depSel && (tr.docChanged || tr.selection) || ensureAll(state, depAddrs)) {
          let newVal = getter(state);
          if (multi ? !compareArray(newVal, state.values[idx], compare2) : !compare2(newVal, state.values[idx])) {
            state.values[idx] = newVal;
            return 1;
          }
        }
        return 0;
      },
      reconfigure: (state, oldState) => {
        let newVal, oldAddr = oldState.config.address[id2];
        if (oldAddr != null) {
          let oldVal = getAddr(oldState, oldAddr);
          if (this.dependencies.every((dep) => {
            return dep instanceof Facet ? oldState.facet(dep) === state.facet(dep) : dep instanceof StateField ? oldState.field(dep, false) == state.field(dep, false) : true;
          }) || (multi ? compareArray(newVal = getter(state), oldVal, compare2) : compare2(newVal = getter(state), oldVal))) {
            state.values[idx] = oldVal;
            return 0;
          }
        } else {
          newVal = getter(state);
        }
        state.values[idx] = newVal;
        return 1;
      }
    };
  }
};
function compareArray(a2, b, compare2) {
  if (a2.length != b.length)
    return false;
  for (let i2 = 0; i2 < a2.length; i2++)
    if (!compare2(a2[i2], b[i2]))
      return false;
  return true;
}
function ensureAll(state, addrs) {
  let changed = false;
  for (let addr of addrs)
    if (ensureAddr(state, addr) & 1)
      changed = true;
  return changed;
}
function dynamicFacetSlot(addresses, facet, providers) {
  let providerAddrs = providers.map((p) => addresses[p.id]);
  let providerTypes = providers.map((p) => p.type);
  let dynamic = providerAddrs.filter((p) => !(p & 1));
  let idx = addresses[facet.id] >> 1;
  function get3(state) {
    let values2 = [];
    for (let i2 = 0; i2 < providerAddrs.length; i2++) {
      let value = getAddr(state, providerAddrs[i2]);
      if (providerTypes[i2] == 2)
        for (let val of value)
          values2.push(val);
      else
        values2.push(value);
    }
    return facet.combine(values2);
  }
  return {
    create(state) {
      for (let addr of providerAddrs)
        ensureAddr(state, addr);
      state.values[idx] = get3(state);
      return 1;
    },
    update(state, tr) {
      if (!ensureAll(state, dynamic))
        return 0;
      let value = get3(state);
      if (facet.compare(value, state.values[idx]))
        return 0;
      state.values[idx] = value;
      return 1;
    },
    reconfigure(state, oldState) {
      let depChanged = ensureAll(state, providerAddrs);
      let oldProviders = oldState.config.facets[facet.id], oldValue = oldState.facet(facet);
      if (oldProviders && !depChanged && sameArray(providers, oldProviders)) {
        state.values[idx] = oldValue;
        return 0;
      }
      let value = get3(state);
      if (facet.compare(value, oldValue)) {
        state.values[idx] = oldValue;
        return 0;
      }
      state.values[idx] = value;
      return 1;
    }
  };
}
var initField = /* @__PURE__ */ Facet.define({ static: true });
var StateField = class _StateField {
  constructor(id2, createF, updateF, compareF, spec) {
    this.id = id2;
    this.createF = createF;
    this.updateF = updateF;
    this.compareF = compareF;
    this.spec = spec;
    this.provides = void 0;
  }
  /**
  Define a state field.
  */
  static define(config2) {
    let field = new _StateField(nextID++, config2.create, config2.update, config2.compare || ((a2, b) => a2 === b), config2);
    if (config2.provide)
      field.provides = config2.provide(field);
    return field;
  }
  create(state) {
    let init = state.facet(initField).find((i2) => i2.field == this);
    return ((init === null || init === void 0 ? void 0 : init.create) || this.createF)(state);
  }
  /**
  @internal
  */
  slot(addresses) {
    let idx = addresses[this.id] >> 1;
    return {
      create: (state) => {
        state.values[idx] = this.create(state);
        return 1;
      },
      update: (state, tr) => {
        let oldVal = state.values[idx];
        let value = this.updateF(oldVal, tr);
        if (this.compareF(oldVal, value))
          return 0;
        state.values[idx] = value;
        return 1;
      },
      reconfigure: (state, oldState) => {
        if (oldState.config.address[this.id] != null) {
          state.values[idx] = oldState.field(this);
          return 0;
        }
        state.values[idx] = this.create(state);
        return 1;
      }
    };
  }
  /**
  Returns an extension that enables this field and overrides the
  way it is initialized. Can be useful when you need to provide a
  non-default starting value for the field.
  */
  init(create4) {
    return [this, initField.of({ field: this, create: create4 })];
  }
  /**
  State field instances can be used as
  [`Extension`](https://codemirror.net/6/docs/ref/#state.Extension) values to enable the field in a
  given state.
  */
  get extension() {
    return this;
  }
};
var Prec_ = { lowest: 4, low: 3, default: 2, high: 1, highest: 0 };
function prec(value) {
  return (ext) => new PrecExtension(ext, value);
}
var Prec = {
  /**
  The highest precedence level, for extensions that should end up
  near the start of the precedence ordering.
  */
  highest: /* @__PURE__ */ prec(Prec_.highest),
  /**
  A higher-than-default precedence, for extensions that should
  come before those with default precedence.
  */
  high: /* @__PURE__ */ prec(Prec_.high),
  /**
  The default precedence, which is also used for extensions
  without an explicit precedence.
  */
  default: /* @__PURE__ */ prec(Prec_.default),
  /**
  A lower-than-default precedence.
  */
  low: /* @__PURE__ */ prec(Prec_.low),
  /**
  The lowest precedence level. Meant for things that should end up
  near the end of the extension order.
  */
  lowest: /* @__PURE__ */ prec(Prec_.lowest)
};
var PrecExtension = class {
  constructor(inner, prec2) {
    this.inner = inner;
    this.prec = prec2;
  }
};
var Compartment = class _Compartment {
  /**
  Create an instance of this compartment to add to your [state
  configuration](https://codemirror.net/6/docs/ref/#state.EditorStateConfig.extensions).
  */
  of(ext) {
    return new CompartmentInstance(this, ext);
  }
  /**
  Create an [effect](https://codemirror.net/6/docs/ref/#state.TransactionSpec.effects) that
  reconfigures this compartment.
  */
  reconfigure(content2) {
    return _Compartment.reconfigure.of({ compartment: this, extension: content2 });
  }
  /**
  Get the current content of the compartment in the state, or
  `undefined` if it isn't present.
  */
  get(state) {
    return state.config.compartments.get(this);
  }
};
var CompartmentInstance = class {
  constructor(compartment, inner) {
    this.compartment = compartment;
    this.inner = inner;
  }
};
var Configuration = class _Configuration {
  constructor(base2, compartments, dynamicSlots, address, staticValues, facets) {
    this.base = base2;
    this.compartments = compartments;
    this.dynamicSlots = dynamicSlots;
    this.address = address;
    this.staticValues = staticValues;
    this.facets = facets;
    this.statusTemplate = [];
    while (this.statusTemplate.length < dynamicSlots.length)
      this.statusTemplate.push(
        0
        /* SlotStatus.Unresolved */
      );
  }
  staticFacet(facet) {
    let addr = this.address[facet.id];
    return addr == null ? facet.default : this.staticValues[addr >> 1];
  }
  static resolve(base2, compartments, oldState) {
    let fields = [];
    let facets = /* @__PURE__ */ Object.create(null);
    let newCompartments = /* @__PURE__ */ new Map();
    for (let ext of flatten2(base2, compartments, newCompartments)) {
      if (ext instanceof StateField)
        fields.push(ext);
      else
        (facets[ext.facet.id] || (facets[ext.facet.id] = [])).push(ext);
    }
    let address = /* @__PURE__ */ Object.create(null);
    let staticValues = [];
    let dynamicSlots = [];
    for (let field of fields) {
      address[field.id] = dynamicSlots.length << 1;
      dynamicSlots.push((a2) => field.slot(a2));
    }
    let oldFacets = oldState === null || oldState === void 0 ? void 0 : oldState.config.facets;
    for (let id2 in facets) {
      let providers = facets[id2], facet = providers[0].facet;
      let oldProviders = oldFacets && oldFacets[id2] || [];
      if (providers.every(
        (p) => p.type == 0
        /* Provider.Static */
      )) {
        address[facet.id] = staticValues.length << 1 | 1;
        if (sameArray(oldProviders, providers)) {
          staticValues.push(oldState.facet(facet));
        } else {
          let value = facet.combine(providers.map((p) => p.value));
          staticValues.push(oldState && facet.compare(value, oldState.facet(facet)) ? oldState.facet(facet) : value);
        }
      } else {
        for (let p of providers) {
          if (p.type == 0) {
            address[p.id] = staticValues.length << 1 | 1;
            staticValues.push(p.value);
          } else {
            address[p.id] = dynamicSlots.length << 1;
            dynamicSlots.push((a2) => p.dynamicSlot(a2));
          }
        }
        address[facet.id] = dynamicSlots.length << 1;
        dynamicSlots.push((a2) => dynamicFacetSlot(a2, facet, providers));
      }
    }
    let dynamic = dynamicSlots.map((f) => f(address));
    return new _Configuration(base2, newCompartments, dynamic, address, staticValues, facets);
  }
};
function flatten2(extension, compartments, newCompartments) {
  let result = [[], [], [], [], []];
  let seen = /* @__PURE__ */ new Map();
  function inner(ext, prec2) {
    let known = seen.get(ext);
    if (known != null) {
      if (known <= prec2)
        return;
      let found = result[known].indexOf(ext);
      if (found > -1)
        result[known].splice(found, 1);
      if (ext instanceof CompartmentInstance)
        newCompartments.delete(ext.compartment);
    }
    seen.set(ext, prec2);
    if (Array.isArray(ext)) {
      for (let e3 of ext)
        inner(e3, prec2);
    } else if (ext instanceof CompartmentInstance) {
      if (newCompartments.has(ext.compartment))
        throw new RangeError(`Duplicate use of compartment in extensions`);
      let content2 = compartments.get(ext.compartment) || ext.inner;
      newCompartments.set(ext.compartment, content2);
      inner(content2, prec2);
    } else if (ext instanceof PrecExtension) {
      inner(ext.inner, ext.prec);
    } else if (ext instanceof StateField) {
      result[prec2].push(ext);
      if (ext.provides)
        inner(ext.provides, prec2);
    } else if (ext instanceof FacetProvider) {
      result[prec2].push(ext);
      if (ext.facet.extensions)
        inner(ext.facet.extensions, Prec_.default);
    } else {
      let content2 = ext.extension;
      if (!content2)
        throw new Error(`Unrecognized extension value in extension set (${ext}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);
      inner(content2, prec2);
    }
  }
  inner(extension, Prec_.default);
  return result.reduce((a2, b) => a2.concat(b));
}
function ensureAddr(state, addr) {
  if (addr & 1)
    return 2;
  let idx = addr >> 1;
  let status = state.status[idx];
  if (status == 4)
    throw new Error("Cyclic dependency between fields and/or facets");
  if (status & 2)
    return status;
  state.status[idx] = 4;
  let changed = state.computeSlot(state, state.config.dynamicSlots[idx]);
  return state.status[idx] = 2 | changed;
}
function getAddr(state, addr) {
  return addr & 1 ? state.config.staticValues[addr >> 1] : state.values[addr >> 1];
}
var languageData = /* @__PURE__ */ Facet.define();
var allowMultipleSelections = /* @__PURE__ */ Facet.define({
  combine: (values2) => values2.some((v4) => v4),
  static: true
});
var lineSeparator = /* @__PURE__ */ Facet.define({
  combine: (values2) => values2.length ? values2[0] : void 0,
  static: true
});
var changeFilter = /* @__PURE__ */ Facet.define();
var transactionFilter = /* @__PURE__ */ Facet.define();
var transactionExtender = /* @__PURE__ */ Facet.define();
var readOnly = /* @__PURE__ */ Facet.define({
  combine: (values2) => values2.length ? values2[0] : false
});
var Annotation = class {
  /**
  @internal
  */
  constructor(type, value) {
    this.type = type;
    this.value = value;
  }
  /**
  Define a new type of annotation.
  */
  static define() {
    return new AnnotationType();
  }
};
var AnnotationType = class {
  /**
  Create an instance of this annotation.
  */
  of(value) {
    return new Annotation(this, value);
  }
};
var StateEffectType = class {
  /**
  @internal
  */
  constructor(map3) {
    this.map = map3;
  }
  /**
  Create a [state effect](https://codemirror.net/6/docs/ref/#state.StateEffect) instance of this
  type.
  */
  of(value) {
    return new StateEffect(this, value);
  }
};
var StateEffect = class _StateEffect {
  /**
  @internal
  */
  constructor(type, value) {
    this.type = type;
    this.value = value;
  }
  /**
  Map this effect through a position mapping. Will return
  `undefined` when that ends up deleting the effect.
  */
  map(mapping) {
    let mapped = this.type.map(this.value, mapping);
    return mapped === void 0 ? void 0 : mapped == this.value ? this : new _StateEffect(this.type, mapped);
  }
  /**
  Tells you whether this effect object is of a given
  [type](https://codemirror.net/6/docs/ref/#state.StateEffectType).
  */
  is(type) {
    return this.type == type;
  }
  /**
  Define a new effect type. The type parameter indicates the type
  of values that his effect holds. It should be a type that
  doesn't include `undefined`, since that is used in
  [mapping](https://codemirror.net/6/docs/ref/#state.StateEffect.map) to indicate that an effect is
  removed.
  */
  static define(spec = {}) {
    return new StateEffectType(spec.map || ((v4) => v4));
  }
  /**
  Map an array of effects through a change set.
  */
  static mapEffects(effects, mapping) {
    if (!effects.length)
      return effects;
    let result = [];
    for (let effect of effects) {
      let mapped = effect.map(mapping);
      if (mapped)
        result.push(mapped);
    }
    return result;
  }
};
StateEffect.reconfigure = /* @__PURE__ */ StateEffect.define();
StateEffect.appendConfig = /* @__PURE__ */ StateEffect.define();
var Transaction = class _Transaction {
  constructor(startState, changes, selection2, effects, annotations, scrollIntoView3) {
    this.startState = startState;
    this.changes = changes;
    this.selection = selection2;
    this.effects = effects;
    this.annotations = annotations;
    this.scrollIntoView = scrollIntoView3;
    this._doc = null;
    this._state = null;
    if (selection2)
      checkSelection(selection2, changes.newLength);
    if (!annotations.some((a2) => a2.type == _Transaction.time))
      this.annotations = annotations.concat(_Transaction.time.of(Date.now()));
  }
  /**
  @internal
  */
  static create(startState, changes, selection2, effects, annotations, scrollIntoView3) {
    return new _Transaction(startState, changes, selection2, effects, annotations, scrollIntoView3);
  }
  /**
  The new document produced by the transaction. Contrary to
  [`.state`](https://codemirror.net/6/docs/ref/#state.Transaction.state)`.doc`, accessing this won't
  force the entire new state to be computed right away, so it is
  recommended that [transaction
  filters](https://codemirror.net/6/docs/ref/#state.EditorState^transactionFilter) use this getter
  when they need to look at the new document.
  */
  get newDoc() {
    return this._doc || (this._doc = this.changes.apply(this.startState.doc));
  }
  /**
  The new selection produced by the transaction. If
  [`this.selection`](https://codemirror.net/6/docs/ref/#state.Transaction.selection) is undefined,
  this will [map](https://codemirror.net/6/docs/ref/#state.EditorSelection.map) the start state's
  current selection through the changes made by the transaction.
  */
  get newSelection() {
    return this.selection || this.startState.selection.map(this.changes);
  }
  /**
  The new state created by the transaction. Computed on demand
  (but retained for subsequent access), so it is recommended not to
  access it in [transaction
  filters](https://codemirror.net/6/docs/ref/#state.EditorState^transactionFilter) when possible.
  */
  get state() {
    if (!this._state)
      this.startState.applyTransaction(this);
    return this._state;
  }
  /**
  Get the value of the given annotation type, if any.
  */
  annotation(type) {
    for (let ann of this.annotations)
      if (ann.type == type)
        return ann.value;
    return void 0;
  }
  /**
  Indicates whether the transaction changed the document.
  */
  get docChanged() {
    return !this.changes.empty;
  }
  /**
  Indicates whether this transaction reconfigures the state
  (through a [configuration compartment](https://codemirror.net/6/docs/ref/#state.Compartment) or
  with a top-level configuration
  [effect](https://codemirror.net/6/docs/ref/#state.StateEffect^reconfigure).
  */
  get reconfigured() {
    return this.startState.config != this.state.config;
  }
  /**
  Returns true if the transaction has a [user
  event](https://codemirror.net/6/docs/ref/#state.Transaction^userEvent) annotation that is equal to
  or more specific than `event`. For example, if the transaction
  has `"select.pointer"` as user event, `"select"` and
  `"select.pointer"` will match it.
  */
  isUserEvent(event) {
    let e3 = this.annotation(_Transaction.userEvent);
    return !!(e3 && (e3 == event || e3.length > event.length && e3.slice(0, event.length) == event && e3[event.length] == "."));
  }
};
Transaction.time = /* @__PURE__ */ Annotation.define();
Transaction.userEvent = /* @__PURE__ */ Annotation.define();
Transaction.addToHistory = /* @__PURE__ */ Annotation.define();
Transaction.remote = /* @__PURE__ */ Annotation.define();
function joinRanges(a2, b) {
  let result = [];
  for (let iA = 0, iB = 0; ; ) {
    let from2, to;
    if (iA < a2.length && (iB == b.length || b[iB] >= a2[iA])) {
      from2 = a2[iA++];
      to = a2[iA++];
    } else if (iB < b.length) {
      from2 = b[iB++];
      to = b[iB++];
    } else
      return result;
    if (!result.length || result[result.length - 1] < from2)
      result.push(from2, to);
    else if (result[result.length - 1] < to)
      result[result.length - 1] = to;
  }
}
function mergeTransaction(a2, b, sequential2) {
  var _a2;
  let mapForA, mapForB, changes;
  if (sequential2) {
    mapForA = b.changes;
    mapForB = ChangeSet.empty(b.changes.length);
    changes = a2.changes.compose(b.changes);
  } else {
    mapForA = b.changes.map(a2.changes);
    mapForB = a2.changes.mapDesc(b.changes, true);
    changes = a2.changes.compose(mapForA);
  }
  return {
    changes,
    selection: b.selection ? b.selection.map(mapForB) : (_a2 = a2.selection) === null || _a2 === void 0 ? void 0 : _a2.map(mapForA),
    effects: StateEffect.mapEffects(a2.effects, mapForA).concat(StateEffect.mapEffects(b.effects, mapForB)),
    annotations: a2.annotations.length ? a2.annotations.concat(b.annotations) : b.annotations,
    scrollIntoView: a2.scrollIntoView || b.scrollIntoView
  };
}
function resolveTransactionInner(state, spec, docSize) {
  let sel = spec.selection, annotations = asArray(spec.annotations);
  if (spec.userEvent)
    annotations = annotations.concat(Transaction.userEvent.of(spec.userEvent));
  return {
    changes: spec.changes instanceof ChangeSet ? spec.changes : ChangeSet.of(spec.changes || [], docSize, state.facet(lineSeparator)),
    selection: sel && (sel instanceof EditorSelection ? sel : EditorSelection.single(sel.anchor, sel.head)),
    effects: asArray(spec.effects),
    annotations,
    scrollIntoView: !!spec.scrollIntoView
  };
}
function resolveTransaction(state, specs, filter) {
  let s2 = resolveTransactionInner(state, specs.length ? specs[0] : {}, state.doc.length);
  if (specs.length && specs[0].filter === false)
    filter = false;
  for (let i2 = 1; i2 < specs.length; i2++) {
    if (specs[i2].filter === false)
      filter = false;
    let seq = !!specs[i2].sequential;
    s2 = mergeTransaction(s2, resolveTransactionInner(state, specs[i2], seq ? s2.changes.newLength : state.doc.length), seq);
  }
  let tr = Transaction.create(state, s2.changes, s2.selection, s2.effects, s2.annotations, s2.scrollIntoView);
  return extendTransaction(filter ? filterTransaction(tr) : tr);
}
function filterTransaction(tr) {
  let state = tr.startState;
  let result = true;
  for (let filter of state.facet(changeFilter)) {
    let value = filter(tr);
    if (value === false) {
      result = false;
      break;
    }
    if (Array.isArray(value))
      result = result === true ? value : joinRanges(result, value);
  }
  if (result !== true) {
    let changes, back;
    if (result === false) {
      back = tr.changes.invertedDesc;
      changes = ChangeSet.empty(state.doc.length);
    } else {
      let filtered = tr.changes.filter(result);
      changes = filtered.changes;
      back = filtered.filtered.mapDesc(filtered.changes).invertedDesc;
    }
    tr = Transaction.create(state, changes, tr.selection && tr.selection.map(back), StateEffect.mapEffects(tr.effects, back), tr.annotations, tr.scrollIntoView);
  }
  let filters = state.facet(transactionFilter);
  for (let i2 = filters.length - 1; i2 >= 0; i2--) {
    let filtered = filters[i2](tr);
    if (filtered instanceof Transaction)
      tr = filtered;
    else if (Array.isArray(filtered) && filtered.length == 1 && filtered[0] instanceof Transaction)
      tr = filtered[0];
    else
      tr = resolveTransaction(state, asArray(filtered), false);
  }
  return tr;
}
function extendTransaction(tr) {
  let state = tr.startState, extenders = state.facet(transactionExtender), spec = tr;
  for (let i2 = extenders.length - 1; i2 >= 0; i2--) {
    let extension = extenders[i2](tr);
    if (extension && Object.keys(extension).length)
      spec = mergeTransaction(spec, resolveTransactionInner(state, extension, tr.changes.newLength), true);
  }
  return spec == tr ? tr : Transaction.create(state, tr.changes, tr.selection, spec.effects, spec.annotations, spec.scrollIntoView);
}
var none = [];
function asArray(value) {
  return value == null ? none : Array.isArray(value) ? value : [value];
}
var CharCategory = /* @__PURE__ */ function(CharCategory2) {
  CharCategory2[CharCategory2["Word"] = 0] = "Word";
  CharCategory2[CharCategory2["Space"] = 1] = "Space";
  CharCategory2[CharCategory2["Other"] = 2] = "Other";
  return CharCategory2;
}(CharCategory || (CharCategory = {}));
var nonASCIISingleCaseWordChar = /[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;
var wordChar;
try {
  wordChar = /* @__PURE__ */ new RegExp("[\\p{Alphabetic}\\p{Number}_]", "u");
} catch (_) {
}
function hasWordChar(str) {
  if (wordChar)
    return wordChar.test(str);
  for (let i2 = 0; i2 < str.length; i2++) {
    let ch = str[i2];
    if (/\w/.test(ch) || ch > "\x80" && (ch.toUpperCase() != ch.toLowerCase() || nonASCIISingleCaseWordChar.test(ch)))
      return true;
  }
  return false;
}
function makeCategorizer(wordChars) {
  return (char2) => {
    if (!/\S/.test(char2))
      return CharCategory.Space;
    if (hasWordChar(char2))
      return CharCategory.Word;
    for (let i2 = 0; i2 < wordChars.length; i2++)
      if (char2.indexOf(wordChars[i2]) > -1)
        return CharCategory.Word;
    return CharCategory.Other;
  };
}
var EditorState = class _EditorState {
  constructor(config2, doc2, selection2, values2, computeSlot, tr) {
    this.config = config2;
    this.doc = doc2;
    this.selection = selection2;
    this.values = values2;
    this.status = config2.statusTemplate.slice();
    this.computeSlot = computeSlot;
    if (tr)
      tr._state = this;
    for (let i2 = 0; i2 < this.config.dynamicSlots.length; i2++)
      ensureAddr(this, i2 << 1);
    this.computeSlot = null;
  }
  field(field, require2 = true) {
    let addr = this.config.address[field.id];
    if (addr == null) {
      if (require2)
        throw new RangeError("Field is not present in this state");
      return void 0;
    }
    ensureAddr(this, addr);
    return getAddr(this, addr);
  }
  /**
  Create a [transaction](https://codemirror.net/6/docs/ref/#state.Transaction) that updates this
  state. Any number of [transaction specs](https://codemirror.net/6/docs/ref/#state.TransactionSpec)
  can be passed. Unless
  [`sequential`](https://codemirror.net/6/docs/ref/#state.TransactionSpec.sequential) is set, the
  [changes](https://codemirror.net/6/docs/ref/#state.TransactionSpec.changes) (if any) of each spec
  are assumed to start in the _current_ document (not the document
  produced by previous specs), and its
  [selection](https://codemirror.net/6/docs/ref/#state.TransactionSpec.selection) and
  [effects](https://codemirror.net/6/docs/ref/#state.TransactionSpec.effects) are assumed to refer
  to the document created by its _own_ changes. The resulting
  transaction contains the combined effect of all the different
  specs. For [selection](https://codemirror.net/6/docs/ref/#state.TransactionSpec.selection), later
  specs take precedence over earlier ones.
  */
  update(...specs) {
    return resolveTransaction(this, specs, true);
  }
  /**
  @internal
  */
  applyTransaction(tr) {
    let conf = this.config, { base: base2, compartments } = conf;
    for (let effect of tr.effects) {
      if (effect.is(Compartment.reconfigure)) {
        if (conf) {
          compartments = /* @__PURE__ */ new Map();
          conf.compartments.forEach((val, key) => compartments.set(key, val));
          conf = null;
        }
        compartments.set(effect.value.compartment, effect.value.extension);
      } else if (effect.is(StateEffect.reconfigure)) {
        conf = null;
        base2 = effect.value;
      } else if (effect.is(StateEffect.appendConfig)) {
        conf = null;
        base2 = asArray(base2).concat(effect.value);
      }
    }
    let startValues;
    if (!conf) {
      conf = Configuration.resolve(base2, compartments, this);
      let intermediateState = new _EditorState(conf, this.doc, this.selection, conf.dynamicSlots.map(() => null), (state, slot) => slot.reconfigure(state, this), null);
      startValues = intermediateState.values;
    } else {
      startValues = tr.startState.values.slice();
    }
    new _EditorState(conf, tr.newDoc, tr.newSelection, startValues, (state, slot) => slot.update(state, tr), tr);
  }
  /**
  Create a [transaction spec](https://codemirror.net/6/docs/ref/#state.TransactionSpec) that
  replaces every selection range with the given content.
  */
  replaceSelection(text2) {
    if (typeof text2 == "string")
      text2 = this.toText(text2);
    return this.changeByRange((range4) => ({
      changes: { from: range4.from, to: range4.to, insert: text2 },
      range: EditorSelection.cursor(range4.from + text2.length)
    }));
  }
  /**
  Create a set of changes and a new selection by running the given
  function for each range in the active selection. The function
  can return an optional set of changes (in the coordinate space
  of the start document), plus an updated range (in the coordinate
  space of the document produced by the call's own changes). This
  method will merge all the changes and ranges into a single
  changeset and selection, and return it as a [transaction
  spec](https://codemirror.net/6/docs/ref/#state.TransactionSpec), which can be passed to
  [`update`](https://codemirror.net/6/docs/ref/#state.EditorState.update).
  */
  changeByRange(f) {
    let sel = this.selection;
    let result1 = f(sel.ranges[0]);
    let changes = this.changes(result1.changes), ranges = [result1.range];
    let effects = asArray(result1.effects);
    for (let i2 = 1; i2 < sel.ranges.length; i2++) {
      let result = f(sel.ranges[i2]);
      let newChanges = this.changes(result.changes), newMapped = newChanges.map(changes);
      for (let j = 0; j < i2; j++)
        ranges[j] = ranges[j].map(newMapped);
      let mapBy = changes.mapDesc(newChanges, true);
      ranges.push(result.range.map(mapBy));
      changes = changes.compose(newMapped);
      effects = StateEffect.mapEffects(effects, newMapped).concat(StateEffect.mapEffects(asArray(result.effects), mapBy));
    }
    return {
      changes,
      selection: EditorSelection.create(ranges, sel.mainIndex),
      effects
    };
  }
  /**
  Create a [change set](https://codemirror.net/6/docs/ref/#state.ChangeSet) from the given change
  description, taking the state's document length and line
  separator into account.
  */
  changes(spec = []) {
    if (spec instanceof ChangeSet)
      return spec;
    return ChangeSet.of(spec, this.doc.length, this.facet(_EditorState.lineSeparator));
  }
  /**
  Using the state's [line
  separator](https://codemirror.net/6/docs/ref/#state.EditorState^lineSeparator), create a
  [`Text`](https://codemirror.net/6/docs/ref/#state.Text) instance from the given string.
  */
  toText(string2) {
    return Text2.of(string2.split(this.facet(_EditorState.lineSeparator) || DefaultSplit));
  }
  /**
  Return the given range of the document as a string.
  */
  sliceDoc(from2 = 0, to = this.doc.length) {
    return this.doc.sliceString(from2, to, this.lineBreak);
  }
  /**
  Get the value of a state [facet](https://codemirror.net/6/docs/ref/#state.Facet).
  */
  facet(facet) {
    let addr = this.config.address[facet.id];
    if (addr == null)
      return facet.default;
    ensureAddr(this, addr);
    return getAddr(this, addr);
  }
  /**
  Convert this state to a JSON-serializable object. When custom
  fields should be serialized, you can pass them in as an object
  mapping property names (in the resulting object, which should
  not use `doc` or `selection`) to fields.
  */
  toJSON(fields) {
    let result = {
      doc: this.sliceDoc(),
      selection: this.selection.toJSON()
    };
    if (fields)
      for (let prop in fields) {
        let value = fields[prop];
        if (value instanceof StateField && this.config.address[value.id] != null)
          result[prop] = value.spec.toJSON(this.field(fields[prop]), this);
      }
    return result;
  }
  /**
  Deserialize a state from its JSON representation. When custom
  fields should be deserialized, pass the same object you passed
  to [`toJSON`](https://codemirror.net/6/docs/ref/#state.EditorState.toJSON) when serializing as
  third argument.
  */
  static fromJSON(json3, config2 = {}, fields) {
    if (!json3 || typeof json3.doc != "string")
      throw new RangeError("Invalid JSON representation for EditorState");
    let fieldInit = [];
    if (fields)
      for (let prop in fields) {
        if (Object.prototype.hasOwnProperty.call(json3, prop)) {
          let field = fields[prop], value = json3[prop];
          fieldInit.push(field.init((state) => field.spec.fromJSON(value, state)));
        }
      }
    return _EditorState.create({
      doc: json3.doc,
      selection: EditorSelection.fromJSON(json3.selection),
      extensions: config2.extensions ? fieldInit.concat([config2.extensions]) : fieldInit
    });
  }
  /**
  Create a new state. You'll usually only need this when
  initializing an editor—updated states are created by applying
  transactions.
  */
  static create(config2 = {}) {
    let configuration = Configuration.resolve(config2.extensions || [], /* @__PURE__ */ new Map());
    let doc2 = config2.doc instanceof Text2 ? config2.doc : Text2.of((config2.doc || "").split(configuration.staticFacet(_EditorState.lineSeparator) || DefaultSplit));
    let selection2 = !config2.selection ? EditorSelection.single(0) : config2.selection instanceof EditorSelection ? config2.selection : EditorSelection.single(config2.selection.anchor, config2.selection.head);
    checkSelection(selection2, doc2.length);
    if (!configuration.staticFacet(allowMultipleSelections))
      selection2 = selection2.asSingle();
    return new _EditorState(configuration, doc2, selection2, configuration.dynamicSlots.map(() => null), (state, slot) => slot.create(state), null);
  }
  /**
  The size (in columns) of a tab in the document, determined by
  the [`tabSize`](https://codemirror.net/6/docs/ref/#state.EditorState^tabSize) facet.
  */
  get tabSize() {
    return this.facet(_EditorState.tabSize);
  }
  /**
  Get the proper [line-break](https://codemirror.net/6/docs/ref/#state.EditorState^lineSeparator)
  string for this state.
  */
  get lineBreak() {
    return this.facet(_EditorState.lineSeparator) || "\n";
  }
  /**
  Returns true when the editor is
  [configured](https://codemirror.net/6/docs/ref/#state.EditorState^readOnly) to be read-only.
  */
  get readOnly() {
    return this.facet(readOnly);
  }
  /**
  Look up a translation for the given phrase (via the
  [`phrases`](https://codemirror.net/6/docs/ref/#state.EditorState^phrases) facet), or return the
  original string if no translation is found.
  
  If additional arguments are passed, they will be inserted in
  place of markers like `$1` (for the first value) and `$2`, etc.
  A single `$` is equivalent to `$1`, and `$$` will produce a
  literal dollar sign.
  */
  phrase(phrase2, ...insert2) {
    for (let map3 of this.facet(_EditorState.phrases))
      if (Object.prototype.hasOwnProperty.call(map3, phrase2)) {
        phrase2 = map3[phrase2];
        break;
      }
    if (insert2.length)
      phrase2 = phrase2.replace(/\$(\$|\d*)/g, (m, i2) => {
        if (i2 == "$")
          return "$";
        let n2 = +(i2 || 1);
        return !n2 || n2 > insert2.length ? m : insert2[n2 - 1];
      });
    return phrase2;
  }
  /**
  Find the values for a given language data field, provided by the
  the [`languageData`](https://codemirror.net/6/docs/ref/#state.EditorState^languageData) facet.
  
  Examples of language data fields are...
  
  - [`"commentTokens"`](https://codemirror.net/6/docs/ref/#commands.CommentTokens) for specifying
    comment syntax.
  - [`"autocomplete"`](https://codemirror.net/6/docs/ref/#autocomplete.autocompletion^config.override)
    for providing language-specific completion sources.
  - [`"wordChars"`](https://codemirror.net/6/docs/ref/#state.EditorState.charCategorizer) for adding
    characters that should be considered part of words in this
    language.
  - [`"closeBrackets"`](https://codemirror.net/6/docs/ref/#autocomplete.CloseBracketConfig) controls
    bracket closing behavior.
  */
  languageDataAt(name2, pos, side = -1) {
    let values2 = [];
    for (let provider of this.facet(languageData)) {
      for (let result of provider(this, pos, side)) {
        if (Object.prototype.hasOwnProperty.call(result, name2))
          values2.push(result[name2]);
      }
    }
    return values2;
  }
  /**
  Return a function that can categorize strings (expected to
  represent a single [grapheme cluster](https://codemirror.net/6/docs/ref/#state.findClusterBreak))
  into one of:
  
   - Word (contains an alphanumeric character or a character
     explicitly listed in the local language's `"wordChars"`
     language data, which should be a string)
   - Space (contains only whitespace)
   - Other (anything else)
  */
  charCategorizer(at) {
    return makeCategorizer(this.languageDataAt("wordChars", at).join(""));
  }
  /**
  Find the word at the given position, meaning the range
  containing all [word](https://codemirror.net/6/docs/ref/#state.CharCategory.Word) characters
  around it. If no word characters are adjacent to the position,
  this returns null.
  */
  wordAt(pos) {
    let { text: text2, from: from2, length: length2 } = this.doc.lineAt(pos);
    let cat = this.charCategorizer(pos);
    let start = pos - from2, end = pos - from2;
    while (start > 0) {
      let prev2 = findClusterBreak(text2, start, false);
      if (cat(text2.slice(prev2, start)) != CharCategory.Word)
        break;
      start = prev2;
    }
    while (end < length2) {
      let next2 = findClusterBreak(text2, end);
      if (cat(text2.slice(end, next2)) != CharCategory.Word)
        break;
      end = next2;
    }
    return start == end ? null : EditorSelection.range(start + from2, end + from2);
  }
};
EditorState.allowMultipleSelections = allowMultipleSelections;
EditorState.tabSize = /* @__PURE__ */ Facet.define({
  combine: (values2) => values2.length ? values2[0] : 4
});
EditorState.lineSeparator = lineSeparator;
EditorState.readOnly = readOnly;
EditorState.phrases = /* @__PURE__ */ Facet.define({
  compare(a2, b) {
    let kA = Object.keys(a2), kB = Object.keys(b);
    return kA.length == kB.length && kA.every((k2) => a2[k2] == b[k2]);
  }
});
EditorState.languageData = languageData;
EditorState.changeFilter = changeFilter;
EditorState.transactionFilter = transactionFilter;
EditorState.transactionExtender = transactionExtender;
Compartment.reconfigure = /* @__PURE__ */ StateEffect.define();
function combineConfig(configs, defaults3, combine2 = {}) {
  let result = {};
  for (let config2 of configs)
    for (let key of Object.keys(config2)) {
      let value = config2[key], current = result[key];
      if (current === void 0)
        result[key] = value;
      else if (current === value || value === void 0)
        ;
      else if (Object.hasOwnProperty.call(combine2, key))
        result[key] = combine2[key](current, value);
      else
        throw new Error("Config merge conflict for field " + key);
    }
  for (let key in defaults3)
    if (result[key] === void 0)
      result[key] = defaults3[key];
  return result;
}
var RangeValue = class {
  /**
  Compare this value with another value. Used when comparing
  rangesets. The default implementation compares by identity.
  Unless you are only creating a fixed number of unique instances
  of your value type, it is a good idea to implement this
  properly.
  */
  eq(other) {
    return this == other;
  }
  /**
  Create a [range](https://codemirror.net/6/docs/ref/#state.Range) with this value.
  */
  range(from2, to = from2) {
    return Range.create(from2, to, this);
  }
};
RangeValue.prototype.startSide = RangeValue.prototype.endSide = 0;
RangeValue.prototype.point = false;
RangeValue.prototype.mapMode = MapMode.TrackDel;
var Range = class _Range {
  constructor(from2, to, value) {
    this.from = from2;
    this.to = to;
    this.value = value;
  }
  /**
  @internal
  */
  static create(from2, to, value) {
    return new _Range(from2, to, value);
  }
};
function cmpRange(a2, b) {
  return a2.from - b.from || a2.value.startSide - b.value.startSide;
}
var Chunk = class _Chunk {
  constructor(from2, to, value, maxPoint) {
    this.from = from2;
    this.to = to;
    this.value = value;
    this.maxPoint = maxPoint;
  }
  get length() {
    return this.to[this.to.length - 1];
  }
  // Find the index of the given position and side. Use the ranges'
  // `from` pos when `end == false`, `to` when `end == true`.
  findIndex(pos, side, end, startAt = 0) {
    let arr = end ? this.to : this.from;
    for (let lo = startAt, hi = arr.length; ; ) {
      if (lo == hi)
        return lo;
      let mid = lo + hi >> 1;
      let diff = arr[mid] - pos || (end ? this.value[mid].endSide : this.value[mid].startSide) - side;
      if (mid == lo)
        return diff >= 0 ? lo : hi;
      if (diff >= 0)
        hi = mid;
      else
        lo = mid + 1;
    }
  }
  between(offset, from2, to, f) {
    for (let i2 = this.findIndex(from2, -1e9, true), e3 = this.findIndex(to, 1e9, false, i2); i2 < e3; i2++)
      if (f(this.from[i2] + offset, this.to[i2] + offset, this.value[i2]) === false)
        return false;
  }
  map(offset, changes) {
    let value = [], from2 = [], to = [], newPos = -1, maxPoint = -1;
    for (let i2 = 0; i2 < this.value.length; i2++) {
      let val = this.value[i2], curFrom = this.from[i2] + offset, curTo = this.to[i2] + offset, newFrom, newTo;
      if (curFrom == curTo) {
        let mapped = changes.mapPos(curFrom, val.startSide, val.mapMode);
        if (mapped == null)
          continue;
        newFrom = newTo = mapped;
        if (val.startSide != val.endSide) {
          newTo = changes.mapPos(curFrom, val.endSide);
          if (newTo < newFrom)
            continue;
        }
      } else {
        newFrom = changes.mapPos(curFrom, val.startSide);
        newTo = changes.mapPos(curTo, val.endSide);
        if (newFrom > newTo || newFrom == newTo && val.startSide > 0 && val.endSide <= 0)
          continue;
      }
      if ((newTo - newFrom || val.endSide - val.startSide) < 0)
        continue;
      if (newPos < 0)
        newPos = newFrom;
      if (val.point)
        maxPoint = Math.max(maxPoint, newTo - newFrom);
      value.push(val);
      from2.push(newFrom - newPos);
      to.push(newTo - newPos);
    }
    return { mapped: value.length ? new _Chunk(from2, to, value, maxPoint) : null, pos: newPos };
  }
};
var RangeSet = class _RangeSet {
  constructor(chunkPos, chunk, nextLayer, maxPoint) {
    this.chunkPos = chunkPos;
    this.chunk = chunk;
    this.nextLayer = nextLayer;
    this.maxPoint = maxPoint;
  }
  /**
  @internal
  */
  static create(chunkPos, chunk, nextLayer, maxPoint) {
    return new _RangeSet(chunkPos, chunk, nextLayer, maxPoint);
  }
  /**
  @internal
  */
  get length() {
    let last = this.chunk.length - 1;
    return last < 0 ? 0 : Math.max(this.chunkEnd(last), this.nextLayer.length);
  }
  /**
  The number of ranges in the set.
  */
  get size() {
    if (this.isEmpty)
      return 0;
    let size = this.nextLayer.size;
    for (let chunk of this.chunk)
      size += chunk.value.length;
    return size;
  }
  /**
  @internal
  */
  chunkEnd(index) {
    return this.chunkPos[index] + this.chunk[index].length;
  }
  /**
  Update the range set, optionally adding new ranges or filtering
  out existing ones.
  
  (Note: The type parameter is just there as a kludge to work
  around TypeScript variance issues that prevented `RangeSet<X>`
  from being a subtype of `RangeSet<Y>` when `X` is a subtype of
  `Y`.)
  */
  update(updateSpec) {
    let { add: add2 = [], sort = false, filterFrom = 0, filterTo = this.length } = updateSpec;
    let filter = updateSpec.filter;
    if (add2.length == 0 && !filter)
      return this;
    if (sort)
      add2 = add2.slice().sort(cmpRange);
    if (this.isEmpty)
      return add2.length ? _RangeSet.of(add2) : this;
    let cur2 = new LayerCursor(this, null, -1).goto(0), i2 = 0, spill = [];
    let builder = new RangeSetBuilder();
    while (cur2.value || i2 < add2.length) {
      if (i2 < add2.length && (cur2.from - add2[i2].from || cur2.startSide - add2[i2].value.startSide) >= 0) {
        let range4 = add2[i2++];
        if (!builder.addInner(range4.from, range4.to, range4.value))
          spill.push(range4);
      } else if (cur2.rangeIndex == 1 && cur2.chunkIndex < this.chunk.length && (i2 == add2.length || this.chunkEnd(cur2.chunkIndex) < add2[i2].from) && (!filter || filterFrom > this.chunkEnd(cur2.chunkIndex) || filterTo < this.chunkPos[cur2.chunkIndex]) && builder.addChunk(this.chunkPos[cur2.chunkIndex], this.chunk[cur2.chunkIndex])) {
        cur2.nextChunk();
      } else {
        if (!filter || filterFrom > cur2.to || filterTo < cur2.from || filter(cur2.from, cur2.to, cur2.value)) {
          if (!builder.addInner(cur2.from, cur2.to, cur2.value))
            spill.push(Range.create(cur2.from, cur2.to, cur2.value));
        }
        cur2.next();
      }
    }
    return builder.finishInner(this.nextLayer.isEmpty && !spill.length ? _RangeSet.empty : this.nextLayer.update({ add: spill, filter, filterFrom, filterTo }));
  }
  /**
  Map this range set through a set of changes, return the new set.
  */
  map(changes) {
    if (changes.empty || this.isEmpty)
      return this;
    let chunks = [], chunkPos = [], maxPoint = -1;
    for (let i2 = 0; i2 < this.chunk.length; i2++) {
      let start = this.chunkPos[i2], chunk = this.chunk[i2];
      let touch = changes.touchesRange(start, start + chunk.length);
      if (touch === false) {
        maxPoint = Math.max(maxPoint, chunk.maxPoint);
        chunks.push(chunk);
        chunkPos.push(changes.mapPos(start));
      } else if (touch === true) {
        let { mapped, pos } = chunk.map(start, changes);
        if (mapped) {
          maxPoint = Math.max(maxPoint, mapped.maxPoint);
          chunks.push(mapped);
          chunkPos.push(pos);
        }
      }
    }
    let next2 = this.nextLayer.map(changes);
    return chunks.length == 0 ? next2 : new _RangeSet(chunkPos, chunks, next2 || _RangeSet.empty, maxPoint);
  }
  /**
  Iterate over the ranges that touch the region `from` to `to`,
  calling `f` for each. There is no guarantee that the ranges will
  be reported in any specific order. When the callback returns
  `false`, iteration stops.
  */
  between(from2, to, f) {
    if (this.isEmpty)
      return;
    for (let i2 = 0; i2 < this.chunk.length; i2++) {
      let start = this.chunkPos[i2], chunk = this.chunk[i2];
      if (to >= start && from2 <= start + chunk.length && chunk.between(start, from2 - start, to - start, f) === false)
        return;
    }
    this.nextLayer.between(from2, to, f);
  }
  /**
  Iterate over the ranges in this set, in order, including all
  ranges that end at or after `from`.
  */
  iter(from2 = 0) {
    return HeapCursor.from([this]).goto(from2);
  }
  /**
  @internal
  */
  get isEmpty() {
    return this.nextLayer == this;
  }
  /**
  Iterate over the ranges in a collection of sets, in order,
  starting from `from`.
  */
  static iter(sets, from2 = 0) {
    return HeapCursor.from(sets).goto(from2);
  }
  /**
  Iterate over two groups of sets, calling methods on `comparator`
  to notify it of possible differences.
  */
  static compare(oldSets, newSets, textDiff, comparator, minPointSize = -1) {
    let a2 = oldSets.filter((set3) => set3.maxPoint > 0 || !set3.isEmpty && set3.maxPoint >= minPointSize);
    let b = newSets.filter((set3) => set3.maxPoint > 0 || !set3.isEmpty && set3.maxPoint >= minPointSize);
    let sharedChunks = findSharedChunks(a2, b, textDiff);
    let sideA = new SpanCursor(a2, sharedChunks, minPointSize);
    let sideB = new SpanCursor(b, sharedChunks, minPointSize);
    textDiff.iterGaps((fromA, fromB, length2) => compare(sideA, fromA, sideB, fromB, length2, comparator));
    if (textDiff.empty && textDiff.length == 0)
      compare(sideA, 0, sideB, 0, 0, comparator);
  }
  /**
  Compare the contents of two groups of range sets, returning true
  if they are equivalent in the given range.
  */
  static eq(oldSets, newSets, from2 = 0, to) {
    if (to == null)
      to = 1e9 - 1;
    let a2 = oldSets.filter((set3) => !set3.isEmpty && newSets.indexOf(set3) < 0);
    let b = newSets.filter((set3) => !set3.isEmpty && oldSets.indexOf(set3) < 0);
    if (a2.length != b.length)
      return false;
    if (!a2.length)
      return true;
    let sharedChunks = findSharedChunks(a2, b);
    let sideA = new SpanCursor(a2, sharedChunks, 0).goto(from2), sideB = new SpanCursor(b, sharedChunks, 0).goto(from2);
    for (; ; ) {
      if (sideA.to != sideB.to || !sameValues(sideA.active, sideB.active) || sideA.point && (!sideB.point || !sideA.point.eq(sideB.point)))
        return false;
      if (sideA.to > to)
        return true;
      sideA.next();
      sideB.next();
    }
  }
  /**
  Iterate over a group of range sets at the same time, notifying
  the iterator about the ranges covering every given piece of
  content. Returns the open count (see
  [`SpanIterator.span`](https://codemirror.net/6/docs/ref/#state.SpanIterator.span)) at the end
  of the iteration.
  */
  static spans(sets, from2, to, iterator, minPointSize = -1) {
    let cursor3 = new SpanCursor(sets, null, minPointSize).goto(from2), pos = from2;
    let openRanges = cursor3.openStart;
    for (; ; ) {
      let curTo = Math.min(cursor3.to, to);
      if (cursor3.point) {
        let active = cursor3.activeForPoint(cursor3.to);
        let openCount = cursor3.pointFrom < from2 ? active.length + 1 : Math.min(active.length, openRanges);
        iterator.point(pos, curTo, cursor3.point, active, openCount, cursor3.pointRank);
        openRanges = Math.min(cursor3.openEnd(curTo), active.length);
      } else if (curTo > pos) {
        iterator.span(pos, curTo, cursor3.active, openRanges);
        openRanges = cursor3.openEnd(curTo);
      }
      if (cursor3.to > to)
        return openRanges + (cursor3.point && cursor3.to > to ? 1 : 0);
      pos = cursor3.to;
      cursor3.next();
    }
  }
  /**
  Create a range set for the given range or array of ranges. By
  default, this expects the ranges to be _sorted_ (by start
  position and, if two start at the same position,
  `value.startSide`). You can pass `true` as second argument to
  cause the method to sort them.
  */
  static of(ranges, sort = false) {
    let build = new RangeSetBuilder();
    for (let range4 of ranges instanceof Range ? [ranges] : sort ? lazySort(ranges) : ranges)
      build.add(range4.from, range4.to, range4.value);
    return build.finish();
  }
};
RangeSet.empty = /* @__PURE__ */ new RangeSet([], [], null, -1);
function lazySort(ranges) {
  if (ranges.length > 1)
    for (let prev2 = ranges[0], i2 = 1; i2 < ranges.length; i2++) {
      let cur2 = ranges[i2];
      if (cmpRange(prev2, cur2) > 0)
        return ranges.slice().sort(cmpRange);
      prev2 = cur2;
    }
  return ranges;
}
RangeSet.empty.nextLayer = RangeSet.empty;
var RangeSetBuilder = class _RangeSetBuilder {
  finishChunk(newArrays) {
    this.chunks.push(new Chunk(this.from, this.to, this.value, this.maxPoint));
    this.chunkPos.push(this.chunkStart);
    this.chunkStart = -1;
    this.setMaxPoint = Math.max(this.setMaxPoint, this.maxPoint);
    this.maxPoint = -1;
    if (newArrays) {
      this.from = [];
      this.to = [];
      this.value = [];
    }
  }
  /**
  Create an empty builder.
  */
  constructor() {
    this.chunks = [];
    this.chunkPos = [];
    this.chunkStart = -1;
    this.last = null;
    this.lastFrom = -1e9;
    this.lastTo = -1e9;
    this.from = [];
    this.to = [];
    this.value = [];
    this.maxPoint = -1;
    this.setMaxPoint = -1;
    this.nextLayer = null;
  }
  /**
  Add a range. Ranges should be added in sorted (by `from` and
  `value.startSide`) order.
  */
  add(from2, to, value) {
    if (!this.addInner(from2, to, value))
      (this.nextLayer || (this.nextLayer = new _RangeSetBuilder())).add(from2, to, value);
  }
  /**
  @internal
  */
  addInner(from2, to, value) {
    let diff = from2 - this.lastTo || value.startSide - this.last.endSide;
    if (diff <= 0 && (from2 - this.lastFrom || value.startSide - this.last.startSide) < 0)
      throw new Error("Ranges must be added sorted by `from` position and `startSide`");
    if (diff < 0)
      return false;
    if (this.from.length == 250)
      this.finishChunk(true);
    if (this.chunkStart < 0)
      this.chunkStart = from2;
    this.from.push(from2 - this.chunkStart);
    this.to.push(to - this.chunkStart);
    this.last = value;
    this.lastFrom = from2;
    this.lastTo = to;
    this.value.push(value);
    if (value.point)
      this.maxPoint = Math.max(this.maxPoint, to - from2);
    return true;
  }
  /**
  @internal
  */
  addChunk(from2, chunk) {
    if ((from2 - this.lastTo || chunk.value[0].startSide - this.last.endSide) < 0)
      return false;
    if (this.from.length)
      this.finishChunk(true);
    this.setMaxPoint = Math.max(this.setMaxPoint, chunk.maxPoint);
    this.chunks.push(chunk);
    this.chunkPos.push(from2);
    let last = chunk.value.length - 1;
    this.last = chunk.value[last];
    this.lastFrom = chunk.from[last] + from2;
    this.lastTo = chunk.to[last] + from2;
    return true;
  }
  /**
  Finish the range set. Returns the new set. The builder can't be
  used anymore after this has been called.
  */
  finish() {
    return this.finishInner(RangeSet.empty);
  }
  /**
  @internal
  */
  finishInner(next2) {
    if (this.from.length)
      this.finishChunk(false);
    if (this.chunks.length == 0)
      return next2;
    let result = RangeSet.create(this.chunkPos, this.chunks, this.nextLayer ? this.nextLayer.finishInner(next2) : next2, this.setMaxPoint);
    this.from = null;
    return result;
  }
};
function findSharedChunks(a2, b, textDiff) {
  let inA = /* @__PURE__ */ new Map();
  for (let set3 of a2)
    for (let i2 = 0; i2 < set3.chunk.length; i2++)
      if (set3.chunk[i2].maxPoint <= 0)
        inA.set(set3.chunk[i2], set3.chunkPos[i2]);
  let shared = /* @__PURE__ */ new Set();
  for (let set3 of b)
    for (let i2 = 0; i2 < set3.chunk.length; i2++) {
      let known = inA.get(set3.chunk[i2]);
      if (known != null && (textDiff ? textDiff.mapPos(known) : known) == set3.chunkPos[i2] && !(textDiff === null || textDiff === void 0 ? void 0 : textDiff.touchesRange(known, known + set3.chunk[i2].length)))
        shared.add(set3.chunk[i2]);
    }
  return shared;
}
var LayerCursor = class {
  constructor(layer2, skip, minPoint, rank = 0) {
    this.layer = layer2;
    this.skip = skip;
    this.minPoint = minPoint;
    this.rank = rank;
  }
  get startSide() {
    return this.value ? this.value.startSide : 0;
  }
  get endSide() {
    return this.value ? this.value.endSide : 0;
  }
  goto(pos, side = -1e9) {
    this.chunkIndex = this.rangeIndex = 0;
    this.gotoInner(pos, side, false);
    return this;
  }
  gotoInner(pos, side, forward) {
    while (this.chunkIndex < this.layer.chunk.length) {
      let next2 = this.layer.chunk[this.chunkIndex];
      if (!(this.skip && this.skip.has(next2) || this.layer.chunkEnd(this.chunkIndex) < pos || next2.maxPoint < this.minPoint))
        break;
      this.chunkIndex++;
      forward = false;
    }
    if (this.chunkIndex < this.layer.chunk.length) {
      let rangeIndex = this.layer.chunk[this.chunkIndex].findIndex(pos - this.layer.chunkPos[this.chunkIndex], side, true);
      if (!forward || this.rangeIndex < rangeIndex)
        this.setRangeIndex(rangeIndex);
    }
    this.next();
  }
  forward(pos, side) {
    if ((this.to - pos || this.endSide - side) < 0)
      this.gotoInner(pos, side, true);
  }
  next() {
    for (; ; ) {
      if (this.chunkIndex == this.layer.chunk.length) {
        this.from = this.to = 1e9;
        this.value = null;
        break;
      } else {
        let chunkPos = this.layer.chunkPos[this.chunkIndex], chunk = this.layer.chunk[this.chunkIndex];
        let from2 = chunkPos + chunk.from[this.rangeIndex];
        this.from = from2;
        this.to = chunkPos + chunk.to[this.rangeIndex];
        this.value = chunk.value[this.rangeIndex];
        this.setRangeIndex(this.rangeIndex + 1);
        if (this.minPoint < 0 || this.value.point && this.to - this.from >= this.minPoint)
          break;
      }
    }
  }
  setRangeIndex(index) {
    if (index == this.layer.chunk[this.chunkIndex].value.length) {
      this.chunkIndex++;
      if (this.skip) {
        while (this.chunkIndex < this.layer.chunk.length && this.skip.has(this.layer.chunk[this.chunkIndex]))
          this.chunkIndex++;
      }
      this.rangeIndex = 0;
    } else {
      this.rangeIndex = index;
    }
  }
  nextChunk() {
    this.chunkIndex++;
    this.rangeIndex = 0;
    this.next();
  }
  compare(other) {
    return this.from - other.from || this.startSide - other.startSide || this.rank - other.rank || this.to - other.to || this.endSide - other.endSide;
  }
};
var HeapCursor = class _HeapCursor {
  constructor(heap) {
    this.heap = heap;
  }
  static from(sets, skip = null, minPoint = -1) {
    let heap = [];
    for (let i2 = 0; i2 < sets.length; i2++) {
      for (let cur2 = sets[i2]; !cur2.isEmpty; cur2 = cur2.nextLayer) {
        if (cur2.maxPoint >= minPoint)
          heap.push(new LayerCursor(cur2, skip, minPoint, i2));
      }
    }
    return heap.length == 1 ? heap[0] : new _HeapCursor(heap);
  }
  get startSide() {
    return this.value ? this.value.startSide : 0;
  }
  goto(pos, side = -1e9) {
    for (let cur2 of this.heap)
      cur2.goto(pos, side);
    for (let i2 = this.heap.length >> 1; i2 >= 0; i2--)
      heapBubble(this.heap, i2);
    this.next();
    return this;
  }
  forward(pos, side) {
    for (let cur2 of this.heap)
      cur2.forward(pos, side);
    for (let i2 = this.heap.length >> 1; i2 >= 0; i2--)
      heapBubble(this.heap, i2);
    if ((this.to - pos || this.value.endSide - side) < 0)
      this.next();
  }
  next() {
    if (this.heap.length == 0) {
      this.from = this.to = 1e9;
      this.value = null;
      this.rank = -1;
    } else {
      let top2 = this.heap[0];
      this.from = top2.from;
      this.to = top2.to;
      this.value = top2.value;
      this.rank = top2.rank;
      if (top2.value)
        top2.next();
      heapBubble(this.heap, 0);
    }
  }
};
function heapBubble(heap, index) {
  for (let cur2 = heap[index]; ; ) {
    let childIndex = (index << 1) + 1;
    if (childIndex >= heap.length)
      break;
    let child = heap[childIndex];
    if (childIndex + 1 < heap.length && child.compare(heap[childIndex + 1]) >= 0) {
      child = heap[childIndex + 1];
      childIndex++;
    }
    if (cur2.compare(child) < 0)
      break;
    heap[childIndex] = cur2;
    heap[index] = child;
    index = childIndex;
  }
}
var SpanCursor = class {
  constructor(sets, skip, minPoint) {
    this.minPoint = minPoint;
    this.active = [];
    this.activeTo = [];
    this.activeRank = [];
    this.minActive = -1;
    this.point = null;
    this.pointFrom = 0;
    this.pointRank = 0;
    this.to = -1e9;
    this.endSide = 0;
    this.openStart = -1;
    this.cursor = HeapCursor.from(sets, skip, minPoint);
  }
  goto(pos, side = -1e9) {
    this.cursor.goto(pos, side);
    this.active.length = this.activeTo.length = this.activeRank.length = 0;
    this.minActive = -1;
    this.to = pos;
    this.endSide = side;
    this.openStart = -1;
    this.next();
    return this;
  }
  forward(pos, side) {
    while (this.minActive > -1 && (this.activeTo[this.minActive] - pos || this.active[this.minActive].endSide - side) < 0)
      this.removeActive(this.minActive);
    this.cursor.forward(pos, side);
  }
  removeActive(index) {
    remove(this.active, index);
    remove(this.activeTo, index);
    remove(this.activeRank, index);
    this.minActive = findMinIndex(this.active, this.activeTo);
  }
  addActive(trackOpen) {
    let i2 = 0, { value, to, rank } = this.cursor;
    while (i2 < this.activeRank.length && this.activeRank[i2] <= rank)
      i2++;
    insert(this.active, i2, value);
    insert(this.activeTo, i2, to);
    insert(this.activeRank, i2, rank);
    if (trackOpen)
      insert(trackOpen, i2, this.cursor.from);
    this.minActive = findMinIndex(this.active, this.activeTo);
  }
  // After calling this, if `this.point` != null, the next range is a
  // point. Otherwise, it's a regular range, covered by `this.active`.
  next() {
    let from2 = this.to, wasPoint = this.point;
    this.point = null;
    let trackOpen = this.openStart < 0 ? [] : null;
    for (; ; ) {
      let a2 = this.minActive;
      if (a2 > -1 && (this.activeTo[a2] - this.cursor.from || this.active[a2].endSide - this.cursor.startSide) < 0) {
        if (this.activeTo[a2] > from2) {
          this.to = this.activeTo[a2];
          this.endSide = this.active[a2].endSide;
          break;
        }
        this.removeActive(a2);
        if (trackOpen)
          remove(trackOpen, a2);
      } else if (!this.cursor.value) {
        this.to = this.endSide = 1e9;
        break;
      } else if (this.cursor.from > from2) {
        this.to = this.cursor.from;
        this.endSide = this.cursor.startSide;
        break;
      } else {
        let nextVal = this.cursor.value;
        if (!nextVal.point) {
          this.addActive(trackOpen);
          this.cursor.next();
        } else if (wasPoint && this.cursor.to == this.to && this.cursor.from < this.cursor.to) {
          this.cursor.next();
        } else {
          this.point = nextVal;
          this.pointFrom = this.cursor.from;
          this.pointRank = this.cursor.rank;
          this.to = this.cursor.to;
          this.endSide = nextVal.endSide;
          this.cursor.next();
          this.forward(this.to, this.endSide);
          break;
        }
      }
    }
    if (trackOpen) {
      this.openStart = 0;
      for (let i2 = trackOpen.length - 1; i2 >= 0 && trackOpen[i2] < from2; i2--)
        this.openStart++;
    }
  }
  activeForPoint(to) {
    if (!this.active.length)
      return this.active;
    let active = [];
    for (let i2 = this.active.length - 1; i2 >= 0; i2--) {
      if (this.activeRank[i2] < this.pointRank)
        break;
      if (this.activeTo[i2] > to || this.activeTo[i2] == to && this.active[i2].endSide >= this.point.endSide)
        active.push(this.active[i2]);
    }
    return active.reverse();
  }
  openEnd(to) {
    let open = 0;
    for (let i2 = this.activeTo.length - 1; i2 >= 0 && this.activeTo[i2] > to; i2--)
      open++;
    return open;
  }
};
function compare(a2, startA, b, startB, length2, comparator) {
  a2.goto(startA);
  b.goto(startB);
  let endB = startB + length2;
  let pos = startB, dPos = startB - startA;
  for (; ; ) {
    let diff = a2.to + dPos - b.to || a2.endSide - b.endSide;
    let end = diff < 0 ? a2.to + dPos : b.to, clipEnd = Math.min(end, endB);
    if (a2.point || b.point) {
      if (!(a2.point && b.point && (a2.point == b.point || a2.point.eq(b.point)) && sameValues(a2.activeForPoint(a2.to), b.activeForPoint(b.to))))
        comparator.comparePoint(pos, clipEnd, a2.point, b.point);
    } else {
      if (clipEnd > pos && !sameValues(a2.active, b.active))
        comparator.compareRange(pos, clipEnd, a2.active, b.active);
    }
    if (end > endB)
      break;
    pos = end;
    if (diff <= 0)
      a2.next();
    if (diff >= 0)
      b.next();
  }
}
function sameValues(a2, b) {
  if (a2.length != b.length)
    return false;
  for (let i2 = 0; i2 < a2.length; i2++)
    if (a2[i2] != b[i2] && !a2[i2].eq(b[i2]))
      return false;
  return true;
}
function remove(array, index) {
  for (let i2 = index, e3 = array.length - 1; i2 < e3; i2++)
    array[i2] = array[i2 + 1];
  array.pop();
}
function insert(array, index, value) {
  for (let i2 = array.length - 1; i2 >= index; i2--)
    array[i2 + 1] = array[i2];
  array[index] = value;
}
function findMinIndex(value, array) {
  let found = -1, foundPos = 1e9;
  for (let i2 = 0; i2 < array.length; i2++)
    if ((array[i2] - foundPos || value[i2].endSide - value[found].endSide) < 0) {
      found = i2;
      foundPos = array[i2];
    }
  return found;
}
function countColumn(string2, tabSize, to = string2.length) {
  let n2 = 0;
  for (let i2 = 0; i2 < to; ) {
    if (string2.charCodeAt(i2) == 9) {
      n2 += tabSize - n2 % tabSize;
      i2++;
    } else {
      n2++;
      i2 = findClusterBreak(string2, i2);
    }
  }
  return n2;
}
function findColumn(string2, col, tabSize, strict) {
  for (let i2 = 0, n2 = 0; ; ) {
    if (n2 >= col)
      return i2;
    if (i2 == string2.length)
      break;
    n2 += string2.charCodeAt(i2) == 9 ? tabSize - n2 % tabSize : 1;
    i2 = findClusterBreak(string2, i2);
  }
  return strict === true ? -1 : string2.length;
}

// node_modules/style-mod/src/style-mod.js
var C2 = "\u037C";
var COUNT = typeof Symbol == "undefined" ? "__" + C2 : Symbol.for(C2);
var SET = typeof Symbol == "undefined" ? "__styleSet" + Math.floor(Math.random() * 1e8) : Symbol("styleSet");
var top = typeof globalThis != "undefined" ? globalThis : typeof window != "undefined" ? window : {};
var StyleModule = class {
  // :: (Object<Style>, ?{finish: ?(string) → string})
  // Create a style module from the given spec.
  //
  // When `finish` is given, it is called on regular (non-`@`)
  // selectors (after `&` expansion) to compute the final selector.
  constructor(spec, options) {
    this.rules = [];
    let { finish } = options || {};
    function splitSelector(selector) {
      return /^@/.test(selector) ? [selector] : selector.split(/,\s*/);
    }
    function render2(selectors, spec2, target, isKeyframes) {
      let local = [], isAt = /^@(\w+)\b/.exec(selectors[0]), keyframes3 = isAt && isAt[1] == "keyframes";
      if (isAt && spec2 == null)
        return target.push(selectors[0] + ";");
      for (let prop in spec2) {
        let value = spec2[prop];
        if (/&/.test(prop)) {
          render2(
            prop.split(/,\s*/).map((part) => selectors.map((sel) => part.replace(/&/, sel))).reduce((a2, b) => a2.concat(b)),
            value,
            target
          );
        } else if (value && typeof value == "object") {
          if (!isAt)
            throw new RangeError("The value of a property (" + prop + ") should be a primitive value.");
          render2(splitSelector(prop), value, local, keyframes3);
        } else if (value != null) {
          local.push(prop.replace(/_.*/, "").replace(/[A-Z]/g, (l) => "-" + l.toLowerCase()) + ": " + value + ";");
        }
      }
      if (local.length || keyframes3) {
        target.push((finish && !isAt && !isKeyframes ? selectors.map(finish) : selectors).join(", ") + " {" + local.join(" ") + "}");
      }
    }
    for (let prop in spec)
      render2(splitSelector(prop), spec[prop], this.rules);
  }
  // :: () → string
  // Returns a string containing the module's CSS rules.
  getRules() {
    return this.rules.join("\n");
  }
  // :: () → string
  // Generate a new unique CSS class name.
  static newName() {
    let id2 = top[COUNT] || 1;
    top[COUNT] = id2 + 1;
    return C2 + id2.toString(36);
  }
  // :: (union<Document, ShadowRoot>, union<[StyleModule], StyleModule>, ?{nonce: ?string})
  //
  // Mount the given set of modules in the given DOM root, which ensures
  // that the CSS rules defined by the module are available in that
  // context.
  //
  // Rules are only added to the document once per root.
  //
  // Rule order will follow the order of the modules, so that rules from
  // modules later in the array take precedence of those from earlier
  // modules. If you call this function multiple times for the same root
  // in a way that changes the order of already mounted modules, the old
  // order will be changed.
  //
  // If a Content Security Policy nonce is provided, it is added to
  // the `<style>` tag generated by the library.
  static mount(root2, modules, options) {
    let set3 = root2[SET], nonce = options && options.nonce;
    if (!set3)
      set3 = new StyleSet(root2, nonce);
    else if (nonce)
      set3.setNonce(nonce);
    set3.mount(Array.isArray(modules) ? modules : [modules]);
  }
};
var adoptedSet = /* @__PURE__ */ new Map();
var StyleSet = class {
  constructor(root2, nonce) {
    let doc2 = root2.ownerDocument || root2, win = doc2.defaultView;
    if (!root2.head && root2.adoptedStyleSheets && win.CSSStyleSheet) {
      let adopted = adoptedSet.get(doc2);
      if (adopted) {
        root2.adoptedStyleSheets = [adopted.sheet, ...root2.adoptedStyleSheets];
        return root2[SET] = adopted;
      }
      this.sheet = new win.CSSStyleSheet();
      root2.adoptedStyleSheets = [this.sheet, ...root2.adoptedStyleSheets];
      adoptedSet.set(doc2, this);
    } else {
      this.styleTag = doc2.createElement("style");
      if (nonce)
        this.styleTag.setAttribute("nonce", nonce);
      let target = root2.head || root2;
      target.insertBefore(this.styleTag, target.firstChild);
    }
    this.modules = [];
    root2[SET] = this;
  }
  mount(modules) {
    let sheet = this.sheet;
    let pos = 0, j = 0;
    for (let i2 = 0; i2 < modules.length; i2++) {
      let mod = modules[i2], index = this.modules.indexOf(mod);
      if (index < j && index > -1) {
        this.modules.splice(index, 1);
        j--;
        index = -1;
      }
      if (index == -1) {
        this.modules.splice(j++, 0, mod);
        if (sheet)
          for (let k2 = 0; k2 < mod.rules.length; k2++)
            sheet.insertRule(mod.rules[k2], pos++);
      } else {
        while (j < index)
          pos += this.modules[j++].rules.length;
        pos += mod.rules.length;
        j++;
      }
    }
    if (!sheet) {
      let text2 = "";
      for (let i2 = 0; i2 < this.modules.length; i2++)
        text2 += this.modules[i2].getRules() + "\n";
      this.styleTag.textContent = text2;
    }
  }
  setNonce(nonce) {
    if (this.styleTag && this.styleTag.getAttribute("nonce") != nonce)
      this.styleTag.setAttribute("nonce", nonce);
  }
};

// node_modules/w3c-keyname/index.js
var base = {
  8: "Backspace",
  9: "Tab",
  10: "Enter",
  12: "NumLock",
  13: "Enter",
  16: "Shift",
  17: "Control",
  18: "Alt",
  20: "CapsLock",
  27: "Escape",
  32: " ",
  33: "PageUp",
  34: "PageDown",
  35: "End",
  36: "Home",
  37: "ArrowLeft",
  38: "ArrowUp",
  39: "ArrowRight",
  40: "ArrowDown",
  44: "PrintScreen",
  45: "Insert",
  46: "Delete",
  59: ";",
  61: "=",
  91: "Meta",
  92: "Meta",
  106: "*",
  107: "+",
  108: ",",
  109: "-",
  110: ".",
  111: "/",
  144: "NumLock",
  145: "ScrollLock",
  160: "Shift",
  161: "Shift",
  162: "Control",
  163: "Control",
  164: "Alt",
  165: "Alt",
  173: "-",
  186: ";",
  187: "=",
  188: ",",
  189: "-",
  190: ".",
  191: "/",
  192: "`",
  219: "[",
  220: "\\",
  221: "]",
  222: "'"
};
var shift = {
  48: ")",
  49: "!",
  50: "@",
  51: "#",
  52: "$",
  53: "%",
  54: "^",
  55: "&",
  56: "*",
  57: "(",
  59: ":",
  61: "+",
  173: "_",
  186: ":",
  187: "+",
  188: "<",
  189: "_",
  190: ">",
  191: "?",
  192: "~",
  219: "{",
  220: "|",
  221: "}",
  222: '"'
};
var mac = typeof navigator != "undefined" && /Mac/.test(navigator.platform);
var ie = typeof navigator != "undefined" && /MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);
for (i2 = 0; i2 < 10; i2++)
  base[48 + i2] = base[96 + i2] = String(i2);
var i2;
for (i2 = 1; i2 <= 24; i2++)
  base[i2 + 111] = "F" + i2;
var i2;
for (i2 = 65; i2 <= 90; i2++) {
  base[i2] = String.fromCharCode(i2 + 32);
  shift[i2] = String.fromCharCode(i2);
}
var i2;
for (code in base)
  if (!shift.hasOwnProperty(code))
    shift[code] = base[code];
var code;
function keyName(event) {
  var ignoreKey = mac && event.metaKey && event.shiftKey && !event.ctrlKey && !event.altKey || ie && event.shiftKey && event.key && event.key.length == 1 || event.key == "Unidentified";
  var name2 = !ignoreKey && event.key || (event.shiftKey ? shift : base)[event.keyCode] || event.key || "Unidentified";
  if (name2 == "Esc")
    name2 = "Escape";
  if (name2 == "Del")
    name2 = "Delete";
  if (name2 == "Left")
    name2 = "ArrowLeft";
  if (name2 == "Up")
    name2 = "ArrowUp";
  if (name2 == "Right")
    name2 = "ArrowRight";
  if (name2 == "Down")
    name2 = "ArrowDown";
  return name2;
}

// node_modules/@codemirror/view/dist/index.js
function getSelection(root2) {
  let target;
  if (root2.nodeType == 11) {
    target = root2.getSelection ? root2 : root2.ownerDocument;
  } else {
    target = root2;
  }
  return target.getSelection();
}
function contains(dom, node56) {
  return node56 ? dom == node56 || dom.contains(node56.nodeType != 1 ? node56.parentNode : node56) : false;
}
function deepActiveElement(doc2) {
  let elt = doc2.activeElement;
  while (elt && elt.shadowRoot)
    elt = elt.shadowRoot.activeElement;
  return elt;
}
function hasSelection(dom, selection2) {
  if (!selection2.anchorNode)
    return false;
  try {
    return contains(dom, selection2.anchorNode);
  } catch (_) {
    return false;
  }
}
function clientRectsFor(dom) {
  if (dom.nodeType == 3)
    return textRange(dom, 0, dom.nodeValue.length).getClientRects();
  else if (dom.nodeType == 1)
    return dom.getClientRects();
  else
    return [];
}
function isEquivalentPosition(node56, off, targetNode, targetOff) {
  return targetNode ? scanFor(node56, off, targetNode, targetOff, -1) || scanFor(node56, off, targetNode, targetOff, 1) : false;
}
function domIndex(node56) {
  for (var index = 0; ; index++) {
    node56 = node56.previousSibling;
    if (!node56)
      return index;
  }
}
function scanFor(node56, off, targetNode, targetOff, dir) {
  for (; ; ) {
    if (node56 == targetNode && off == targetOff)
      return true;
    if (off == (dir < 0 ? 0 : maxOffset(node56))) {
      if (node56.nodeName == "DIV")
        return false;
      let parent = node56.parentNode;
      if (!parent || parent.nodeType != 1)
        return false;
      off = domIndex(node56) + (dir < 0 ? 0 : 1);
      node56 = parent;
    } else if (node56.nodeType == 1) {
      node56 = node56.childNodes[off + (dir < 0 ? -1 : 0)];
      if (node56.nodeType == 1 && node56.contentEditable == "false")
        return false;
      off = dir < 0 ? maxOffset(node56) : 0;
    } else {
      return false;
    }
  }
}
function maxOffset(node56) {
  return node56.nodeType == 3 ? node56.nodeValue.length : node56.childNodes.length;
}
function flattenRect(rect, left) {
  let x2 = left ? rect.left : rect.right;
  return { left: x2, right: x2, top: rect.top, bottom: rect.bottom };
}
function windowRect(win) {
  return {
    left: 0,
    right: win.innerWidth,
    top: 0,
    bottom: win.innerHeight
  };
}
function scrollRectIntoView(dom, rect, side, x2, y2, xMargin, yMargin, ltr) {
  let doc2 = dom.ownerDocument, win = doc2.defaultView || window;
  for (let cur2 = dom, stop = false; cur2 && !stop; ) {
    if (cur2.nodeType == 1) {
      let bounding, top2 = cur2 == doc2.body;
      let scaleX = 1, scaleY = 1;
      if (top2) {
        bounding = windowRect(win);
      } else {
        if (/^(fixed|sticky)$/.test(getComputedStyle(cur2).position))
          stop = true;
        if (cur2.scrollHeight <= cur2.clientHeight && cur2.scrollWidth <= cur2.clientWidth) {
          cur2 = cur2.assignedSlot || cur2.parentNode;
          continue;
        }
        let rect2 = cur2.getBoundingClientRect();
        scaleX = rect2.width / cur2.offsetWidth;
        scaleY = rect2.height / cur2.offsetHeight;
        bounding = {
          left: rect2.left,
          right: rect2.left + cur2.clientWidth * scaleX,
          top: rect2.top,
          bottom: rect2.top + cur2.clientHeight * scaleY
        };
      }
      let moveX = 0, moveY = 0;
      if (y2 == "nearest") {
        if (rect.top < bounding.top) {
          moveY = -(bounding.top - rect.top + yMargin);
          if (side > 0 && rect.bottom > bounding.bottom + moveY)
            moveY = rect.bottom - bounding.bottom + moveY + yMargin;
        } else if (rect.bottom > bounding.bottom) {
          moveY = rect.bottom - bounding.bottom + yMargin;
          if (side < 0 && rect.top - moveY < bounding.top)
            moveY = -(bounding.top + moveY - rect.top + yMargin);
        }
      } else {
        let rectHeight = rect.bottom - rect.top, boundingHeight = bounding.bottom - bounding.top;
        let targetTop = y2 == "center" && rectHeight <= boundingHeight ? rect.top + rectHeight / 2 - boundingHeight / 2 : y2 == "start" || y2 == "center" && side < 0 ? rect.top - yMargin : rect.bottom - boundingHeight + yMargin;
        moveY = targetTop - bounding.top;
      }
      if (x2 == "nearest") {
        if (rect.left < bounding.left) {
          moveX = -(bounding.left - rect.left + xMargin);
          if (side > 0 && rect.right > bounding.right + moveX)
            moveX = rect.right - bounding.right + moveX + xMargin;
        } else if (rect.right > bounding.right) {
          moveX = rect.right - bounding.right + xMargin;
          if (side < 0 && rect.left < bounding.left + moveX)
            moveX = -(bounding.left + moveX - rect.left + xMargin);
        }
      } else {
        let targetLeft = x2 == "center" ? rect.left + (rect.right - rect.left) / 2 - (bounding.right - bounding.left) / 2 : x2 == "start" == ltr ? rect.left - xMargin : rect.right - (bounding.right - bounding.left) + xMargin;
        moveX = targetLeft - bounding.left;
      }
      if (moveX || moveY) {
        if (top2) {
          win.scrollBy(moveX, moveY);
        } else {
          let movedX = 0, movedY = 0;
          if (moveY) {
            let start = cur2.scrollTop;
            cur2.scrollTop += moveY / scaleY;
            movedY = (cur2.scrollTop - start) * scaleY;
          }
          if (moveX) {
            let start = cur2.scrollLeft;
            cur2.scrollLeft += moveX / scaleX;
            movedX = (cur2.scrollLeft - start) * scaleX;
          }
          rect = {
            left: rect.left - movedX,
            top: rect.top - movedY,
            right: rect.right - movedX,
            bottom: rect.bottom - movedY
          };
          if (movedX && Math.abs(movedX - moveX) < 1)
            x2 = "nearest";
          if (movedY && Math.abs(movedY - moveY) < 1)
            y2 = "nearest";
        }
      }
      if (top2)
        break;
      cur2 = cur2.assignedSlot || cur2.parentNode;
    } else if (cur2.nodeType == 11) {
      cur2 = cur2.host;
    } else {
      break;
    }
  }
}
function scrollableParent(dom) {
  let doc2 = dom.ownerDocument;
  for (let cur2 = dom.parentNode; cur2; ) {
    if (cur2 == doc2.body) {
      break;
    } else if (cur2.nodeType == 1) {
      if (cur2.scrollHeight > cur2.clientHeight || cur2.scrollWidth > cur2.clientWidth)
        return cur2;
      cur2 = cur2.assignedSlot || cur2.parentNode;
    } else if (cur2.nodeType == 11) {
      cur2 = cur2.host;
    } else {
      break;
    }
  }
  return null;
}
var DOMSelectionState = class {
  constructor() {
    this.anchorNode = null;
    this.anchorOffset = 0;
    this.focusNode = null;
    this.focusOffset = 0;
  }
  eq(domSel) {
    return this.anchorNode == domSel.anchorNode && this.anchorOffset == domSel.anchorOffset && this.focusNode == domSel.focusNode && this.focusOffset == domSel.focusOffset;
  }
  setRange(range4) {
    let { anchorNode, focusNode } = range4;
    this.set(anchorNode, Math.min(range4.anchorOffset, anchorNode ? maxOffset(anchorNode) : 0), focusNode, Math.min(range4.focusOffset, focusNode ? maxOffset(focusNode) : 0));
  }
  set(anchorNode, anchorOffset, focusNode, focusOffset) {
    this.anchorNode = anchorNode;
    this.anchorOffset = anchorOffset;
    this.focusNode = focusNode;
    this.focusOffset = focusOffset;
  }
};
var preventScrollSupported = null;
function focusPreventScroll(dom) {
  if (dom.setActive)
    return dom.setActive();
  if (preventScrollSupported)
    return dom.focus(preventScrollSupported);
  let stack = [];
  for (let cur2 = dom; cur2; cur2 = cur2.parentNode) {
    stack.push(cur2, cur2.scrollTop, cur2.scrollLeft);
    if (cur2 == cur2.ownerDocument)
      break;
  }
  dom.focus(preventScrollSupported == null ? {
    get preventScroll() {
      preventScrollSupported = { preventScroll: true };
      return true;
    }
  } : void 0);
  if (!preventScrollSupported) {
    preventScrollSupported = false;
    for (let i2 = 0; i2 < stack.length; ) {
      let elt = stack[i2++], top2 = stack[i2++], left = stack[i2++];
      if (elt.scrollTop != top2)
        elt.scrollTop = top2;
      if (elt.scrollLeft != left)
        elt.scrollLeft = left;
    }
  }
}
var scratchRange;
function textRange(node56, from2, to = from2) {
  let range4 = scratchRange || (scratchRange = document.createRange());
  range4.setEnd(node56, to);
  range4.setStart(node56, from2);
  return range4;
}
function dispatchKey(elt, name2, code) {
  let options = { key: name2, code: name2, keyCode: code, which: code, cancelable: true };
  let down = new KeyboardEvent("keydown", options);
  down.synthetic = true;
  elt.dispatchEvent(down);
  let up = new KeyboardEvent("keyup", options);
  up.synthetic = true;
  elt.dispatchEvent(up);
  return down.defaultPrevented || up.defaultPrevented;
}
function getRoot(node56) {
  while (node56) {
    if (node56 && (node56.nodeType == 9 || node56.nodeType == 11 && node56.host))
      return node56;
    node56 = node56.assignedSlot || node56.parentNode;
  }
  return null;
}
function clearAttributes(node56) {
  while (node56.attributes.length)
    node56.removeAttributeNode(node56.attributes[0]);
}
function atElementStart(doc2, selection2) {
  let node56 = selection2.focusNode, offset = selection2.focusOffset;
  if (!node56 || selection2.anchorNode != node56 || selection2.anchorOffset != offset)
    return false;
  offset = Math.min(offset, maxOffset(node56));
  for (; ; ) {
    if (offset) {
      if (node56.nodeType != 1)
        return false;
      let prev2 = node56.childNodes[offset - 1];
      if (prev2.contentEditable == "false")
        offset--;
      else {
        node56 = prev2;
        offset = maxOffset(node56);
      }
    } else if (node56 == doc2) {
      return true;
    } else {
      offset = domIndex(node56);
      node56 = node56.parentNode;
    }
  }
}
function isScrolledToBottom(elt) {
  return elt.scrollTop > Math.max(1, elt.scrollHeight - elt.clientHeight - 4);
}
var DOMPos = class _DOMPos {
  constructor(node56, offset, precise = true) {
    this.node = node56;
    this.offset = offset;
    this.precise = precise;
  }
  static before(dom, precise) {
    return new _DOMPos(dom.parentNode, domIndex(dom), precise);
  }
  static after(dom, precise) {
    return new _DOMPos(dom.parentNode, domIndex(dom) + 1, precise);
  }
};
var noChildren = [];
var ContentView = class _ContentView {
  constructor() {
    this.parent = null;
    this.dom = null;
    this.flags = 2;
  }
  get overrideDOMText() {
    return null;
  }
  get posAtStart() {
    return this.parent ? this.parent.posBefore(this) : 0;
  }
  get posAtEnd() {
    return this.posAtStart + this.length;
  }
  posBefore(view) {
    let pos = this.posAtStart;
    for (let child of this.children) {
      if (child == view)
        return pos;
      pos += child.length + child.breakAfter;
    }
    throw new RangeError("Invalid child in posBefore");
  }
  posAfter(view) {
    return this.posBefore(view) + view.length;
  }
  sync(view, track) {
    if (this.flags & 2) {
      let parent = this.dom;
      let prev2 = null, next2;
      for (let child of this.children) {
        if (child.flags & 7) {
          if (!child.dom && (next2 = prev2 ? prev2.nextSibling : parent.firstChild)) {
            let contentView = _ContentView.get(next2);
            if (!contentView || !contentView.parent && contentView.canReuseDOM(child))
              child.reuseDOM(next2);
          }
          child.sync(view, track);
          child.flags &= ~7;
        }
        next2 = prev2 ? prev2.nextSibling : parent.firstChild;
        if (track && !track.written && track.node == parent && next2 != child.dom)
          track.written = true;
        if (child.dom.parentNode == parent) {
          while (next2 && next2 != child.dom)
            next2 = rm$1(next2);
        } else {
          parent.insertBefore(child.dom, next2);
        }
        prev2 = child.dom;
      }
      next2 = prev2 ? prev2.nextSibling : parent.firstChild;
      if (next2 && track && track.node == parent)
        track.written = true;
      while (next2)
        next2 = rm$1(next2);
    } else if (this.flags & 1) {
      for (let child of this.children)
        if (child.flags & 7) {
          child.sync(view, track);
          child.flags &= ~7;
        }
    }
  }
  reuseDOM(_dom) {
  }
  localPosFromDOM(node56, offset) {
    let after;
    if (node56 == this.dom) {
      after = this.dom.childNodes[offset];
    } else {
      let bias = maxOffset(node56) == 0 ? 0 : offset == 0 ? -1 : 1;
      for (; ; ) {
        let parent = node56.parentNode;
        if (parent == this.dom)
          break;
        if (bias == 0 && parent.firstChild != parent.lastChild) {
          if (node56 == parent.firstChild)
            bias = -1;
          else
            bias = 1;
        }
        node56 = parent;
      }
      if (bias < 0)
        after = node56;
      else
        after = node56.nextSibling;
    }
    if (after == this.dom.firstChild)
      return 0;
    while (after && !_ContentView.get(after))
      after = after.nextSibling;
    if (!after)
      return this.length;
    for (let i2 = 0, pos = 0; ; i2++) {
      let child = this.children[i2];
      if (child.dom == after)
        return pos;
      pos += child.length + child.breakAfter;
    }
  }
  domBoundsAround(from2, to, offset = 0) {
    let fromI = -1, fromStart = -1, toI = -1, toEnd = -1;
    for (let i2 = 0, pos = offset, prevEnd = offset; i2 < this.children.length; i2++) {
      let child = this.children[i2], end = pos + child.length;
      if (pos < from2 && end > to)
        return child.domBoundsAround(from2, to, pos);
      if (end >= from2 && fromI == -1) {
        fromI = i2;
        fromStart = pos;
      }
      if (pos > to && child.dom.parentNode == this.dom) {
        toI = i2;
        toEnd = prevEnd;
        break;
      }
      prevEnd = end;
      pos = end + child.breakAfter;
    }
    return {
      from: fromStart,
      to: toEnd < 0 ? offset + this.length : toEnd,
      startDOM: (fromI ? this.children[fromI - 1].dom.nextSibling : null) || this.dom.firstChild,
      endDOM: toI < this.children.length && toI >= 0 ? this.children[toI].dom : null
    };
  }
  markDirty(andParent = false) {
    this.flags |= 2;
    this.markParentsDirty(andParent);
  }
  markParentsDirty(childList) {
    for (let parent = this.parent; parent; parent = parent.parent) {
      if (childList)
        parent.flags |= 2;
      if (parent.flags & 1)
        return;
      parent.flags |= 1;
      childList = false;
    }
  }
  setParent(parent) {
    if (this.parent != parent) {
      this.parent = parent;
      if (this.flags & 7)
        this.markParentsDirty(true);
    }
  }
  setDOM(dom) {
    if (this.dom == dom)
      return;
    if (this.dom)
      this.dom.cmView = null;
    this.dom = dom;
    dom.cmView = this;
  }
  get rootView() {
    for (let v4 = this; ; ) {
      let parent = v4.parent;
      if (!parent)
        return v4;
      v4 = parent;
    }
  }
  replaceChildren(from2, to, children = noChildren) {
    this.markDirty();
    for (let i2 = from2; i2 < to; i2++) {
      let child = this.children[i2];
      if (child.parent == this)
        child.destroy();
    }
    this.children.splice(from2, to - from2, ...children);
    for (let i2 = 0; i2 < children.length; i2++)
      children[i2].setParent(this);
  }
  ignoreMutation(_rec) {
    return false;
  }
  ignoreEvent(_event) {
    return false;
  }
  childCursor(pos = this.length) {
    return new ChildCursor(this.children, pos, this.children.length);
  }
  childPos(pos, bias = 1) {
    return this.childCursor().findPos(pos, bias);
  }
  toString() {
    let name2 = this.constructor.name.replace("View", "");
    return name2 + (this.children.length ? "(" + this.children.join() + ")" : this.length ? "[" + (name2 == "Text" ? this.text : this.length) + "]" : "") + (this.breakAfter ? "#" : "");
  }
  static get(node56) {
    return node56.cmView;
  }
  get isEditable() {
    return true;
  }
  get isWidget() {
    return false;
  }
  get isHidden() {
    return false;
  }
  merge(from2, to, source, hasStart, openStart, openEnd) {
    return false;
  }
  become(other) {
    return false;
  }
  canReuseDOM(other) {
    return other.constructor == this.constructor && !((this.flags | other.flags) & 8);
  }
  // When this is a zero-length view with a side, this should return a
  // number <= 0 to indicate it is before its position, or a
  // number > 0 when after its position.
  getSide() {
    return 0;
  }
  destroy() {
    this.parent = null;
  }
};
ContentView.prototype.breakAfter = 0;
function rm$1(dom) {
  let next2 = dom.nextSibling;
  dom.parentNode.removeChild(dom);
  return next2;
}
var ChildCursor = class {
  constructor(children, pos, i2) {
    this.children = children;
    this.pos = pos;
    this.i = i2;
    this.off = 0;
  }
  findPos(pos, bias = 1) {
    for (; ; ) {
      if (pos > this.pos || pos == this.pos && (bias > 0 || this.i == 0 || this.children[this.i - 1].breakAfter)) {
        this.off = pos - this.pos;
        return this;
      }
      let next2 = this.children[--this.i];
      this.pos -= next2.length + next2.breakAfter;
    }
  }
};
function replaceRange(parent, fromI, fromOff, toI, toOff, insert2, breakAtStart, openStart, openEnd) {
  let { children } = parent;
  let before = children.length ? children[fromI] : null;
  let last = insert2.length ? insert2[insert2.length - 1] : null;
  let breakAtEnd = last ? last.breakAfter : breakAtStart;
  if (fromI == toI && before && !breakAtStart && !breakAtEnd && insert2.length < 2 && before.merge(fromOff, toOff, insert2.length ? last : null, fromOff == 0, openStart, openEnd))
    return;
  if (toI < children.length) {
    let after = children[toI];
    if (after && (toOff < after.length || after.breakAfter && (last === null || last === void 0 ? void 0 : last.breakAfter))) {
      if (fromI == toI) {
        after = after.split(toOff);
        toOff = 0;
      }
      if (!breakAtEnd && last && after.merge(0, toOff, last, true, 0, openEnd)) {
        insert2[insert2.length - 1] = after;
      } else {
        if (toOff || after.children.length && !after.children[0].length)
          after.merge(0, toOff, null, false, 0, openEnd);
        insert2.push(after);
      }
    } else if (after === null || after === void 0 ? void 0 : after.breakAfter) {
      if (last)
        last.breakAfter = 1;
      else
        breakAtStart = 1;
    }
    toI++;
  }
  if (before) {
    before.breakAfter = breakAtStart;
    if (fromOff > 0) {
      if (!breakAtStart && insert2.length && before.merge(fromOff, before.length, insert2[0], false, openStart, 0)) {
        before.breakAfter = insert2.shift().breakAfter;
      } else if (fromOff < before.length || before.children.length && before.children[before.children.length - 1].length == 0) {
        before.merge(fromOff, before.length, null, false, openStart, 0);
      }
      fromI++;
    }
  }
  while (fromI < toI && insert2.length) {
    if (children[toI - 1].become(insert2[insert2.length - 1])) {
      toI--;
      insert2.pop();
      openEnd = insert2.length ? 0 : openStart;
    } else if (children[fromI].become(insert2[0])) {
      fromI++;
      insert2.shift();
      openStart = insert2.length ? 0 : openEnd;
    } else {
      break;
    }
  }
  if (!insert2.length && fromI && toI < children.length && !children[fromI - 1].breakAfter && children[toI].merge(0, 0, children[fromI - 1], false, openStart, openEnd))
    fromI--;
  if (fromI < toI || insert2.length)
    parent.replaceChildren(fromI, toI, insert2);
}
function mergeChildrenInto(parent, from2, to, insert2, openStart, openEnd) {
  let cur2 = parent.childCursor();
  let { i: toI, off: toOff } = cur2.findPos(to, 1);
  let { i: fromI, off: fromOff } = cur2.findPos(from2, -1);
  let dLen = from2 - to;
  for (let view of insert2)
    dLen += view.length;
  parent.length += dLen;
  replaceRange(parent, fromI, fromOff, toI, toOff, insert2, 0, openStart, openEnd);
}
var nav = typeof navigator != "undefined" ? navigator : { userAgent: "", vendor: "", platform: "" };
var doc = typeof document != "undefined" ? document : { documentElement: { style: {} } };
var ie_edge = /* @__PURE__ */ /Edge\/(\d+)/.exec(nav.userAgent);
var ie_upto10 = /* @__PURE__ */ /MSIE \d/.test(nav.userAgent);
var ie_11up = /* @__PURE__ */ /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(nav.userAgent);
var ie2 = !!(ie_upto10 || ie_11up || ie_edge);
var gecko = !ie2 && /* @__PURE__ */ /gecko\/(\d+)/i.test(nav.userAgent);
var chrome = !ie2 && /* @__PURE__ */ /Chrome\/(\d+)/.exec(nav.userAgent);
var webkit = "webkitFontSmoothing" in doc.documentElement.style;
var safari = !ie2 && /* @__PURE__ */ /Apple Computer/.test(nav.vendor);
var ios = safari && (/* @__PURE__ */ /Mobile\/\w+/.test(nav.userAgent) || nav.maxTouchPoints > 2);
var browser = {
  mac: ios || /* @__PURE__ */ /Mac/.test(nav.platform),
  windows: /* @__PURE__ */ /Win/.test(nav.platform),
  linux: /* @__PURE__ */ /Linux|X11/.test(nav.platform),
  ie: ie2,
  ie_version: ie_upto10 ? doc.documentMode || 6 : ie_11up ? +ie_11up[1] : ie_edge ? +ie_edge[1] : 0,
  gecko,
  gecko_version: gecko ? +(/* @__PURE__ */ /Firefox\/(\d+)/.exec(nav.userAgent) || [0, 0])[1] : 0,
  chrome: !!chrome,
  chrome_version: chrome ? +chrome[1] : 0,
  ios,
  android: /* @__PURE__ */ /Android\b/.test(nav.userAgent),
  webkit,
  safari,
  webkit_version: webkit ? +(/* @__PURE__ */ /\bAppleWebKit\/(\d+)/.exec(navigator.userAgent) || [0, 0])[1] : 0,
  tabSize: doc.documentElement.style.tabSize != null ? "tab-size" : "-moz-tab-size"
};
var MaxJoinLen = 256;
var TextView = class _TextView extends ContentView {
  constructor(text2) {
    super();
    this.text = text2;
  }
  get length() {
    return this.text.length;
  }
  createDOM(textDOM) {
    this.setDOM(textDOM || document.createTextNode(this.text));
  }
  sync(view, track) {
    if (!this.dom)
      this.createDOM();
    if (this.dom.nodeValue != this.text) {
      if (track && track.node == this.dom)
        track.written = true;
      this.dom.nodeValue = this.text;
    }
  }
  reuseDOM(dom) {
    if (dom.nodeType == 3)
      this.createDOM(dom);
  }
  merge(from2, to, source) {
    if (this.flags & 8 || source && (!(source instanceof _TextView) || this.length - (to - from2) + source.length > MaxJoinLen || source.flags & 8))
      return false;
    this.text = this.text.slice(0, from2) + (source ? source.text : "") + this.text.slice(to);
    this.markDirty();
    return true;
  }
  split(from2) {
    let result = new _TextView(this.text.slice(from2));
    this.text = this.text.slice(0, from2);
    this.markDirty();
    result.flags |= this.flags & 8;
    return result;
  }
  localPosFromDOM(node56, offset) {
    return node56 == this.dom ? offset : offset ? this.text.length : 0;
  }
  domAtPos(pos) {
    return new DOMPos(this.dom, pos);
  }
  domBoundsAround(_from, _to, offset) {
    return { from: offset, to: offset + this.length, startDOM: this.dom, endDOM: this.dom.nextSibling };
  }
  coordsAt(pos, side) {
    return textCoords(this.dom, pos, side);
  }
};
var MarkView = class _MarkView extends ContentView {
  constructor(mark, children = [], length2 = 0) {
    super();
    this.mark = mark;
    this.children = children;
    this.length = length2;
    for (let ch of children)
      ch.setParent(this);
  }
  setAttrs(dom) {
    clearAttributes(dom);
    if (this.mark.class)
      dom.className = this.mark.class;
    if (this.mark.attrs)
      for (let name2 in this.mark.attrs)
        dom.setAttribute(name2, this.mark.attrs[name2]);
    return dom;
  }
  canReuseDOM(other) {
    return super.canReuseDOM(other) && !((this.flags | other.flags) & 8);
  }
  reuseDOM(node56) {
    if (node56.nodeName == this.mark.tagName.toUpperCase()) {
      this.setDOM(node56);
      this.flags |= 4 | 2;
    }
  }
  sync(view, track) {
    if (!this.dom)
      this.setDOM(this.setAttrs(document.createElement(this.mark.tagName)));
    else if (this.flags & 4)
      this.setAttrs(this.dom);
    super.sync(view, track);
  }
  merge(from2, to, source, _hasStart, openStart, openEnd) {
    if (source && (!(source instanceof _MarkView && source.mark.eq(this.mark)) || from2 && openStart <= 0 || to < this.length && openEnd <= 0))
      return false;
    mergeChildrenInto(this, from2, to, source ? source.children : [], openStart - 1, openEnd - 1);
    this.markDirty();
    return true;
  }
  split(from2) {
    let result = [], off = 0, detachFrom = -1, i2 = 0;
    for (let elt of this.children) {
      let end = off + elt.length;
      if (end > from2)
        result.push(off < from2 ? elt.split(from2 - off) : elt);
      if (detachFrom < 0 && off >= from2)
        detachFrom = i2;
      off = end;
      i2++;
    }
    let length2 = this.length - from2;
    this.length = from2;
    if (detachFrom > -1) {
      this.children.length = detachFrom;
      this.markDirty();
    }
    return new _MarkView(this.mark, result, length2);
  }
  domAtPos(pos) {
    return inlineDOMAtPos(this, pos);
  }
  coordsAt(pos, side) {
    return coordsInChildren(this, pos, side);
  }
};
function textCoords(text2, pos, side) {
  let length2 = text2.nodeValue.length;
  if (pos > length2)
    pos = length2;
  let from2 = pos, to = pos, flatten3 = 0;
  if (pos == 0 && side < 0 || pos == length2 && side >= 0) {
    if (!(browser.chrome || browser.gecko)) {
      if (pos) {
        from2--;
        flatten3 = 1;
      } else if (to < length2) {
        to++;
        flatten3 = -1;
      }
    }
  } else {
    if (side < 0)
      from2--;
    else if (to < length2)
      to++;
  }
  let rects = textRange(text2, from2, to).getClientRects();
  if (!rects.length)
    return null;
  let rect = rects[(flatten3 ? flatten3 < 0 : side >= 0) ? 0 : rects.length - 1];
  if (browser.safari && !flatten3 && rect.width == 0)
    rect = Array.prototype.find.call(rects, (r3) => r3.width) || rect;
  return flatten3 ? flattenRect(rect, flatten3 < 0) : rect || null;
}
var WidgetView = class _WidgetView extends ContentView {
  static create(widget, length2, side) {
    return new _WidgetView(widget, length2, side);
  }
  constructor(widget, length2, side) {
    super();
    this.widget = widget;
    this.length = length2;
    this.side = side;
    this.prevWidget = null;
  }
  split(from2) {
    let result = _WidgetView.create(this.widget, this.length - from2, this.side);
    this.length -= from2;
    return result;
  }
  sync(view) {
    if (!this.dom || !this.widget.updateDOM(this.dom, view)) {
      if (this.dom && this.prevWidget)
        this.prevWidget.destroy(this.dom);
      this.prevWidget = null;
      this.setDOM(this.widget.toDOM(view));
      this.dom.contentEditable = "false";
    }
  }
  getSide() {
    return this.side;
  }
  merge(from2, to, source, hasStart, openStart, openEnd) {
    if (source && (!(source instanceof _WidgetView) || !this.widget.compare(source.widget) || from2 > 0 && openStart <= 0 || to < this.length && openEnd <= 0))
      return false;
    this.length = from2 + (source ? source.length : 0) + (this.length - to);
    return true;
  }
  become(other) {
    if (other instanceof _WidgetView && other.side == this.side && this.widget.constructor == other.widget.constructor) {
      if (!this.widget.compare(other.widget))
        this.markDirty(true);
      if (this.dom && !this.prevWidget)
        this.prevWidget = this.widget;
      this.widget = other.widget;
      this.length = other.length;
      return true;
    }
    return false;
  }
  ignoreMutation() {
    return true;
  }
  ignoreEvent(event) {
    return this.widget.ignoreEvent(event);
  }
  get overrideDOMText() {
    if (this.length == 0)
      return Text2.empty;
    let top2 = this;
    while (top2.parent)
      top2 = top2.parent;
    let { view } = top2, text2 = view && view.state.doc, start = this.posAtStart;
    return text2 ? text2.slice(start, start + this.length) : Text2.empty;
  }
  domAtPos(pos) {
    return (this.length ? pos == 0 : this.side > 0) ? DOMPos.before(this.dom) : DOMPos.after(this.dom, pos == this.length);
  }
  domBoundsAround() {
    return null;
  }
  coordsAt(pos, side) {
    let custom = this.widget.coordsAt(this.dom, pos, side);
    if (custom)
      return custom;
    let rects = this.dom.getClientRects(), rect = null;
    if (!rects.length)
      return null;
    let fromBack = this.side ? this.side < 0 : pos > 0;
    for (let i2 = fromBack ? rects.length - 1 : 0; ; i2 += fromBack ? -1 : 1) {
      rect = rects[i2];
      if (pos > 0 ? i2 == 0 : i2 == rects.length - 1 || rect.top < rect.bottom)
        break;
    }
    return flattenRect(rect, !fromBack);
  }
  get isEditable() {
    return false;
  }
  get isWidget() {
    return true;
  }
  get isHidden() {
    return this.widget.isHidden;
  }
  destroy() {
    super.destroy();
    if (this.dom)
      this.widget.destroy(this.dom);
  }
};
var WidgetBufferView = class _WidgetBufferView extends ContentView {
  constructor(side) {
    super();
    this.side = side;
  }
  get length() {
    return 0;
  }
  merge() {
    return false;
  }
  become(other) {
    return other instanceof _WidgetBufferView && other.side == this.side;
  }
  split() {
    return new _WidgetBufferView(this.side);
  }
  sync() {
    if (!this.dom) {
      let dom = document.createElement("img");
      dom.className = "cm-widgetBuffer";
      dom.setAttribute("aria-hidden", "true");
      this.setDOM(dom);
    }
  }
  getSide() {
    return this.side;
  }
  domAtPos(pos) {
    return this.side > 0 ? DOMPos.before(this.dom) : DOMPos.after(this.dom);
  }
  localPosFromDOM() {
    return 0;
  }
  domBoundsAround() {
    return null;
  }
  coordsAt(pos) {
    return this.dom.getBoundingClientRect();
  }
  get overrideDOMText() {
    return Text2.empty;
  }
  get isHidden() {
    return true;
  }
};
TextView.prototype.children = WidgetView.prototype.children = WidgetBufferView.prototype.children = noChildren;
function inlineDOMAtPos(parent, pos) {
  let dom = parent.dom, { children } = parent, i2 = 0;
  for (let off = 0; i2 < children.length; i2++) {
    let child = children[i2], end = off + child.length;
    if (end == off && child.getSide() <= 0)
      continue;
    if (pos > off && pos < end && child.dom.parentNode == dom)
      return child.domAtPos(pos - off);
    if (pos <= off)
      break;
    off = end;
  }
  for (let j = i2; j > 0; j--) {
    let prev2 = children[j - 1];
    if (prev2.dom.parentNode == dom)
      return prev2.domAtPos(prev2.length);
  }
  for (let j = i2; j < children.length; j++) {
    let next2 = children[j];
    if (next2.dom.parentNode == dom)
      return next2.domAtPos(0);
  }
  return new DOMPos(dom, 0);
}
function joinInlineInto(parent, view, open) {
  let last, { children } = parent;
  if (open > 0 && view instanceof MarkView && children.length && (last = children[children.length - 1]) instanceof MarkView && last.mark.eq(view.mark)) {
    joinInlineInto(last, view.children[0], open - 1);
  } else {
    children.push(view);
    view.setParent(parent);
  }
  parent.length += view.length;
}
function coordsInChildren(view, pos, side) {
  let before = null, beforePos = -1, after = null, afterPos = -1;
  function scan(view2, pos2) {
    for (let i2 = 0, off = 0; i2 < view2.children.length && off <= pos2; i2++) {
      let child = view2.children[i2], end = off + child.length;
      if (end >= pos2) {
        if (child.children.length) {
          scan(child, pos2 - off);
        } else if ((!after || after.isHidden && side > 0) && (end > pos2 || off == end && child.getSide() > 0)) {
          after = child;
          afterPos = pos2 - off;
        } else if (off < pos2 || off == end && child.getSide() < 0 && !child.isHidden) {
          before = child;
          beforePos = pos2 - off;
        }
      }
      off = end;
    }
  }
  scan(view, pos);
  let target = (side < 0 ? before : after) || before || after;
  if (target)
    return target.coordsAt(Math.max(0, target == before ? beforePos : afterPos), side);
  return fallbackRect(view);
}
function fallbackRect(view) {
  let last = view.dom.lastChild;
  if (!last)
    return view.dom.getBoundingClientRect();
  let rects = clientRectsFor(last);
  return rects[rects.length - 1] || null;
}
function combineAttrs(source, target) {
  for (let name2 in source) {
    if (name2 == "class" && target.class)
      target.class += " " + source.class;
    else if (name2 == "style" && target.style)
      target.style += ";" + source.style;
    else
      target[name2] = source[name2];
  }
  return target;
}
var noAttrs = /* @__PURE__ */ Object.create(null);
function attrsEq(a2, b, ignore) {
  if (a2 == b)
    return true;
  if (!a2)
    a2 = noAttrs;
  if (!b)
    b = noAttrs;
  let keysA = Object.keys(a2), keysB = Object.keys(b);
  if (keysA.length - (ignore && keysA.indexOf(ignore) > -1 ? 1 : 0) != keysB.length - (ignore && keysB.indexOf(ignore) > -1 ? 1 : 0))
    return false;
  for (let key of keysA) {
    if (key != ignore && (keysB.indexOf(key) == -1 || a2[key] !== b[key]))
      return false;
  }
  return true;
}
function updateAttrs(dom, prev2, attrs) {
  let changed = false;
  if (prev2) {
    for (let name2 in prev2)
      if (!(attrs && name2 in attrs)) {
        changed = true;
        if (name2 == "style")
          dom.style.cssText = "";
        else
          dom.removeAttribute(name2);
      }
  }
  if (attrs) {
    for (let name2 in attrs)
      if (!(prev2 && prev2[name2] == attrs[name2])) {
        changed = true;
        if (name2 == "style")
          dom.style.cssText = attrs[name2];
        else
          dom.setAttribute(name2, attrs[name2]);
      }
  }
  return changed;
}
function getAttrs(dom) {
  let attrs = /* @__PURE__ */ Object.create(null);
  for (let i2 = 0; i2 < dom.attributes.length; i2++) {
    let attr = dom.attributes[i2];
    attrs[attr.name] = attr.value;
  }
  return attrs;
}
var LineView = class _LineView extends ContentView {
  constructor() {
    super(...arguments);
    this.children = [];
    this.length = 0;
    this.prevAttrs = void 0;
    this.attrs = null;
    this.breakAfter = 0;
  }
  // Consumes source
  merge(from2, to, source, hasStart, openStart, openEnd) {
    if (source) {
      if (!(source instanceof _LineView))
        return false;
      if (!this.dom)
        source.transferDOM(this);
    }
    if (hasStart)
      this.setDeco(source ? source.attrs : null);
    mergeChildrenInto(this, from2, to, source ? source.children : [], openStart, openEnd);
    return true;
  }
  split(at) {
    let end = new _LineView();
    end.breakAfter = this.breakAfter;
    if (this.length == 0)
      return end;
    let { i: i2, off } = this.childPos(at);
    if (off) {
      end.append(this.children[i2].split(off), 0);
      this.children[i2].merge(off, this.children[i2].length, null, false, 0, 0);
      i2++;
    }
    for (let j = i2; j < this.children.length; j++)
      end.append(this.children[j], 0);
    while (i2 > 0 && this.children[i2 - 1].length == 0)
      this.children[--i2].destroy();
    this.children.length = i2;
    this.markDirty();
    this.length = at;
    return end;
  }
  transferDOM(other) {
    if (!this.dom)
      return;
    this.markDirty();
    other.setDOM(this.dom);
    other.prevAttrs = this.prevAttrs === void 0 ? this.attrs : this.prevAttrs;
    this.prevAttrs = void 0;
    this.dom = null;
  }
  setDeco(attrs) {
    if (!attrsEq(this.attrs, attrs)) {
      if (this.dom) {
        this.prevAttrs = this.attrs;
        this.markDirty();
      }
      this.attrs = attrs;
    }
  }
  append(child, openStart) {
    joinInlineInto(this, child, openStart);
  }
  // Only called when building a line view in ContentBuilder
  addLineDeco(deco) {
    let attrs = deco.spec.attributes, cls = deco.spec.class;
    if (attrs)
      this.attrs = combineAttrs(attrs, this.attrs || {});
    if (cls)
      this.attrs = combineAttrs({ class: cls }, this.attrs || {});
  }
  domAtPos(pos) {
    return inlineDOMAtPos(this, pos);
  }
  reuseDOM(node56) {
    if (node56.nodeName == "DIV") {
      this.setDOM(node56);
      this.flags |= 4 | 2;
    }
  }
  sync(view, track) {
    var _a2;
    if (!this.dom) {
      this.setDOM(document.createElement("div"));
      this.dom.className = "cm-line";
      this.prevAttrs = this.attrs ? null : void 0;
    } else if (this.flags & 4) {
      clearAttributes(this.dom);
      this.dom.className = "cm-line";
      this.prevAttrs = this.attrs ? null : void 0;
    }
    if (this.prevAttrs !== void 0) {
      updateAttrs(this.dom, this.prevAttrs, this.attrs);
      this.dom.classList.add("cm-line");
      this.prevAttrs = void 0;
    }
    super.sync(view, track);
    let last = this.dom.lastChild;
    while (last && ContentView.get(last) instanceof MarkView)
      last = last.lastChild;
    if (!last || !this.length || last.nodeName != "BR" && ((_a2 = ContentView.get(last)) === null || _a2 === void 0 ? void 0 : _a2.isEditable) == false && (!browser.ios || !this.children.some((ch) => ch instanceof TextView))) {
      let hack = document.createElement("BR");
      hack.cmIgnore = true;
      this.dom.appendChild(hack);
    }
  }
  measureTextSize() {
    if (this.children.length == 0 || this.length > 20)
      return null;
    let totalWidth = 0, textHeight;
    for (let child of this.children) {
      if (!(child instanceof TextView) || /[^ -~]/.test(child.text))
        return null;
      let rects = clientRectsFor(child.dom);
      if (rects.length != 1)
        return null;
      totalWidth += rects[0].width;
      textHeight = rects[0].height;
    }
    return !totalWidth ? null : {
      lineHeight: this.dom.getBoundingClientRect().height,
      charWidth: totalWidth / this.length,
      textHeight
    };
  }
  coordsAt(pos, side) {
    let rect = coordsInChildren(this, pos, side);
    if (!this.children.length && rect && this.parent) {
      let { heightOracle } = this.parent.view.viewState, height = rect.bottom - rect.top;
      if (Math.abs(height - heightOracle.lineHeight) < 2 && heightOracle.textHeight < height) {
        let dist2 = (height - heightOracle.textHeight) / 2;
        return { top: rect.top + dist2, bottom: rect.bottom - dist2, left: rect.left, right: rect.left };
      }
    }
    return rect;
  }
  become(_other) {
    return false;
  }
  covers() {
    return true;
  }
  static find(docView, pos) {
    for (let i2 = 0, off = 0; i2 < docView.children.length; i2++) {
      let block = docView.children[i2], end = off + block.length;
      if (end >= pos) {
        if (block instanceof _LineView)
          return block;
        if (end > pos)
          break;
      }
      off = end + block.breakAfter;
    }
    return null;
  }
};
var BlockWidgetView = class _BlockWidgetView extends ContentView {
  constructor(widget, length2, deco) {
    super();
    this.widget = widget;
    this.length = length2;
    this.deco = deco;
    this.breakAfter = 0;
    this.prevWidget = null;
  }
  merge(from2, to, source, _takeDeco, openStart, openEnd) {
    if (source && (!(source instanceof _BlockWidgetView) || !this.widget.compare(source.widget) || from2 > 0 && openStart <= 0 || to < this.length && openEnd <= 0))
      return false;
    this.length = from2 + (source ? source.length : 0) + (this.length - to);
    return true;
  }
  domAtPos(pos) {
    return pos == 0 ? DOMPos.before(this.dom) : DOMPos.after(this.dom, pos == this.length);
  }
  split(at) {
    let len = this.length - at;
    this.length = at;
    let end = new _BlockWidgetView(this.widget, len, this.deco);
    end.breakAfter = this.breakAfter;
    return end;
  }
  get children() {
    return noChildren;
  }
  sync(view) {
    if (!this.dom || !this.widget.updateDOM(this.dom, view)) {
      if (this.dom && this.prevWidget)
        this.prevWidget.destroy(this.dom);
      this.prevWidget = null;
      this.setDOM(this.widget.toDOM(view));
      this.dom.contentEditable = "false";
    }
  }
  get overrideDOMText() {
    return this.parent ? this.parent.view.state.doc.slice(this.posAtStart, this.posAtEnd) : Text2.empty;
  }
  domBoundsAround() {
    return null;
  }
  become(other) {
    if (other instanceof _BlockWidgetView && other.widget.constructor == this.widget.constructor) {
      if (!other.widget.compare(this.widget))
        this.markDirty(true);
      if (this.dom && !this.prevWidget)
        this.prevWidget = this.widget;
      this.widget = other.widget;
      this.length = other.length;
      this.deco = other.deco;
      this.breakAfter = other.breakAfter;
      return true;
    }
    return false;
  }
  ignoreMutation() {
    return true;
  }
  ignoreEvent(event) {
    return this.widget.ignoreEvent(event);
  }
  get isEditable() {
    return false;
  }
  get isWidget() {
    return true;
  }
  coordsAt(pos, side) {
    return this.widget.coordsAt(this.dom, pos, side);
  }
  destroy() {
    super.destroy();
    if (this.dom)
      this.widget.destroy(this.dom);
  }
  covers(side) {
    let { startSide, endSide } = this.deco;
    return startSide == endSide ? false : side < 0 ? startSide < 0 : endSide > 0;
  }
};
var WidgetType = class {
  /**
  Compare this instance to another instance of the same type.
  (TypeScript can't express this, but only instances of the same
  specific class will be passed to this method.) This is used to
  avoid redrawing widgets when they are replaced by a new
  decoration of the same type. The default implementation just
  returns `false`, which will cause new instances of the widget to
  always be redrawn.
  */
  eq(widget) {
    return false;
  }
  /**
  Update a DOM element created by a widget of the same type (but
  different, non-`eq` content) to reflect this widget. May return
  true to indicate that it could update, false to indicate it
  couldn't (in which case the widget will be redrawn). The default
  implementation just returns false.
  */
  updateDOM(dom, view) {
    return false;
  }
  /**
  @internal
  */
  compare(other) {
    return this == other || this.constructor == other.constructor && this.eq(other);
  }
  /**
  The estimated height this widget will have, to be used when
  estimating the height of content that hasn't been drawn. May
  return -1 to indicate you don't know. The default implementation
  returns -1.
  */
  get estimatedHeight() {
    return -1;
  }
  /**
  For inline widgets that are displayed inline (as opposed to
  `inline-block`) and introduce line breaks (through `<br>` tags
  or textual newlines), this must indicate the amount of line
  breaks they introduce. Defaults to 0.
  */
  get lineBreaks() {
    return 0;
  }
  /**
  Can be used to configure which kinds of events inside the widget
  should be ignored by the editor. The default is to ignore all
  events.
  */
  ignoreEvent(event) {
    return true;
  }
  /**
  Override the way screen coordinates for positions at/in the
  widget are found. `pos` will be the offset into the widget, and
  `side` the side of the position that is being queried—less than
  zero for before, greater than zero for after, and zero for
  directly at that position.
  */
  coordsAt(dom, pos, side) {
    return null;
  }
  /**
  @internal
  */
  get isHidden() {
    return false;
  }
  /**
  This is called when the an instance of the widget is removed
  from the editor view.
  */
  destroy(dom) {
  }
};
var BlockType = /* @__PURE__ */ function(BlockType2) {
  BlockType2[BlockType2["Text"] = 0] = "Text";
  BlockType2[BlockType2["WidgetBefore"] = 1] = "WidgetBefore";
  BlockType2[BlockType2["WidgetAfter"] = 2] = "WidgetAfter";
  BlockType2[BlockType2["WidgetRange"] = 3] = "WidgetRange";
  return BlockType2;
}(BlockType || (BlockType = {}));
var Decoration = class extends RangeValue {
  constructor(startSide, endSide, widget, spec) {
    super();
    this.startSide = startSide;
    this.endSide = endSide;
    this.widget = widget;
    this.spec = spec;
  }
  /**
  @internal
  */
  get heightRelevant() {
    return false;
  }
  /**
  Create a mark decoration, which influences the styling of the
  content in its range. Nested mark decorations will cause nested
  DOM elements to be created. Nesting order is determined by
  precedence of the [facet](https://codemirror.net/6/docs/ref/#view.EditorView^decorations), with
  the higher-precedence decorations creating the inner DOM nodes.
  Such elements are split on line boundaries and on the boundaries
  of lower-precedence decorations.
  */
  static mark(spec) {
    return new MarkDecoration(spec);
  }
  /**
  Create a widget decoration, which displays a DOM element at the
  given position.
  */
  static widget(spec) {
    let side = Math.max(-1e4, Math.min(1e4, spec.side || 0)), block = !!spec.block;
    side += block && !spec.inlineOrder ? side > 0 ? 3e8 : -4e8 : side > 0 ? 1e8 : -1e8;
    return new PointDecoration(spec, side, side, block, spec.widget || null, false);
  }
  /**
  Create a replace decoration which replaces the given range with
  a widget, or simply hides it.
  */
  static replace(spec) {
    let block = !!spec.block, startSide, endSide;
    if (spec.isBlockGap) {
      startSide = -5e8;
      endSide = 4e8;
    } else {
      let { start, end } = getInclusive(spec, block);
      startSide = (start ? block ? -3e8 : -1 : 5e8) - 1;
      endSide = (end ? block ? 2e8 : 1 : -6e8) + 1;
    }
    return new PointDecoration(spec, startSide, endSide, block, spec.widget || null, true);
  }
  /**
  Create a line decoration, which can add DOM attributes to the
  line starting at the given position.
  */
  static line(spec) {
    return new LineDecoration(spec);
  }
  /**
  Build a [`DecorationSet`](https://codemirror.net/6/docs/ref/#view.DecorationSet) from the given
  decorated range or ranges. If the ranges aren't already sorted,
  pass `true` for `sort` to make the library sort them for you.
  */
  static set(of, sort = false) {
    return RangeSet.of(of, sort);
  }
  /**
  @internal
  */
  hasHeight() {
    return this.widget ? this.widget.estimatedHeight > -1 : false;
  }
};
Decoration.none = RangeSet.empty;
var MarkDecoration = class _MarkDecoration extends Decoration {
  constructor(spec) {
    let { start, end } = getInclusive(spec);
    super(start ? -1 : 5e8, end ? 1 : -6e8, null, spec);
    this.tagName = spec.tagName || "span";
    this.class = spec.class || "";
    this.attrs = spec.attributes || null;
  }
  eq(other) {
    var _a2, _b;
    return this == other || other instanceof _MarkDecoration && this.tagName == other.tagName && (this.class || ((_a2 = this.attrs) === null || _a2 === void 0 ? void 0 : _a2.class)) == (other.class || ((_b = other.attrs) === null || _b === void 0 ? void 0 : _b.class)) && attrsEq(this.attrs, other.attrs, "class");
  }
  range(from2, to = from2) {
    if (from2 >= to)
      throw new RangeError("Mark decorations may not be empty");
    return super.range(from2, to);
  }
};
MarkDecoration.prototype.point = false;
var LineDecoration = class _LineDecoration extends Decoration {
  constructor(spec) {
    super(-2e8, -2e8, null, spec);
  }
  eq(other) {
    return other instanceof _LineDecoration && this.spec.class == other.spec.class && attrsEq(this.spec.attributes, other.spec.attributes);
  }
  range(from2, to = from2) {
    if (to != from2)
      throw new RangeError("Line decoration ranges must be zero-length");
    return super.range(from2, to);
  }
};
LineDecoration.prototype.mapMode = MapMode.TrackBefore;
LineDecoration.prototype.point = true;
var PointDecoration = class _PointDecoration extends Decoration {
  constructor(spec, startSide, endSide, block, widget, isReplace) {
    super(startSide, endSide, widget, spec);
    this.block = block;
    this.isReplace = isReplace;
    this.mapMode = !block ? MapMode.TrackDel : startSide <= 0 ? MapMode.TrackBefore : MapMode.TrackAfter;
  }
  // Only relevant when this.block == true
  get type() {
    return this.startSide != this.endSide ? BlockType.WidgetRange : this.startSide <= 0 ? BlockType.WidgetBefore : BlockType.WidgetAfter;
  }
  get heightRelevant() {
    return this.block || !!this.widget && (this.widget.estimatedHeight >= 5 || this.widget.lineBreaks > 0);
  }
  eq(other) {
    return other instanceof _PointDecoration && widgetsEq(this.widget, other.widget) && this.block == other.block && this.startSide == other.startSide && this.endSide == other.endSide;
  }
  range(from2, to = from2) {
    if (this.isReplace && (from2 > to || from2 == to && this.startSide > 0 && this.endSide <= 0))
      throw new RangeError("Invalid range for replacement decoration");
    if (!this.isReplace && to != from2)
      throw new RangeError("Widget decorations can only have zero-length ranges");
    return super.range(from2, to);
  }
};
PointDecoration.prototype.point = true;
function getInclusive(spec, block = false) {
  let { inclusiveStart: start, inclusiveEnd: end } = spec;
  if (start == null)
    start = spec.inclusive;
  if (end == null)
    end = spec.inclusive;
  return { start: start !== null && start !== void 0 ? start : block, end: end !== null && end !== void 0 ? end : block };
}
function widgetsEq(a2, b) {
  return a2 == b || !!(a2 && b && a2.compare(b));
}
function addRange(from2, to, ranges, margin = 0) {
  let last = ranges.length - 1;
  if (last >= 0 && ranges[last] + margin >= from2)
    ranges[last] = Math.max(ranges[last], to);
  else
    ranges.push(from2, to);
}
var ContentBuilder = class _ContentBuilder {
  constructor(doc2, pos, end, disallowBlockEffectsFor) {
    this.doc = doc2;
    this.pos = pos;
    this.end = end;
    this.disallowBlockEffectsFor = disallowBlockEffectsFor;
    this.content = [];
    this.curLine = null;
    this.breakAtStart = 0;
    this.pendingBuffer = 0;
    this.bufferMarks = [];
    this.atCursorPos = true;
    this.openStart = -1;
    this.openEnd = -1;
    this.text = "";
    this.textOff = 0;
    this.cursor = doc2.iter();
    this.skip = pos;
  }
  posCovered() {
    if (this.content.length == 0)
      return !this.breakAtStart && this.doc.lineAt(this.pos).from != this.pos;
    let last = this.content[this.content.length - 1];
    return !(last.breakAfter || last instanceof BlockWidgetView && last.deco.endSide < 0);
  }
  getLine() {
    if (!this.curLine) {
      this.content.push(this.curLine = new LineView());
      this.atCursorPos = true;
    }
    return this.curLine;
  }
  flushBuffer(active = this.bufferMarks) {
    if (this.pendingBuffer) {
      this.curLine.append(wrapMarks(new WidgetBufferView(-1), active), active.length);
      this.pendingBuffer = 0;
    }
  }
  addBlockWidget(view) {
    this.flushBuffer();
    this.curLine = null;
    this.content.push(view);
  }
  finish(openEnd) {
    if (this.pendingBuffer && openEnd <= this.bufferMarks.length)
      this.flushBuffer();
    else
      this.pendingBuffer = 0;
    if (!this.posCovered() && !(openEnd && this.content.length && this.content[this.content.length - 1] instanceof BlockWidgetView))
      this.getLine();
  }
  buildText(length2, active, openStart) {
    while (length2 > 0) {
      if (this.textOff == this.text.length) {
        let { value, lineBreak, done } = this.cursor.next(this.skip);
        this.skip = 0;
        if (done)
          throw new Error("Ran out of text content when drawing inline views");
        if (lineBreak) {
          if (!this.posCovered())
            this.getLine();
          if (this.content.length)
            this.content[this.content.length - 1].breakAfter = 1;
          else
            this.breakAtStart = 1;
          this.flushBuffer();
          this.curLine = null;
          this.atCursorPos = true;
          length2--;
          continue;
        } else {
          this.text = value;
          this.textOff = 0;
        }
      }
      let take = Math.min(
        this.text.length - this.textOff,
        length2,
        512
        /* T.Chunk */
      );
      this.flushBuffer(active.slice(active.length - openStart));
      this.getLine().append(wrapMarks(new TextView(this.text.slice(this.textOff, this.textOff + take)), active), openStart);
      this.atCursorPos = true;
      this.textOff += take;
      length2 -= take;
      openStart = 0;
    }
  }
  span(from2, to, active, openStart) {
    this.buildText(to - from2, active, openStart);
    this.pos = to;
    if (this.openStart < 0)
      this.openStart = openStart;
  }
  point(from2, to, deco, active, openStart, index) {
    if (this.disallowBlockEffectsFor[index] && deco instanceof PointDecoration) {
      if (deco.block)
        throw new RangeError("Block decorations may not be specified via plugins");
      if (to > this.doc.lineAt(this.pos).to)
        throw new RangeError("Decorations that replace line breaks may not be specified via plugins");
    }
    let len = to - from2;
    if (deco instanceof PointDecoration) {
      if (deco.block) {
        if (deco.startSide > 0 && !this.posCovered())
          this.getLine();
        this.addBlockWidget(new BlockWidgetView(deco.widget || new NullWidget("div"), len, deco));
      } else {
        let view = WidgetView.create(deco.widget || new NullWidget("span"), len, len ? 0 : deco.startSide);
        let cursorBefore = this.atCursorPos && !view.isEditable && openStart <= active.length && (from2 < to || deco.startSide > 0);
        let cursorAfter = !view.isEditable && (from2 < to || openStart > active.length || deco.startSide <= 0);
        let line2 = this.getLine();
        if (this.pendingBuffer == 2 && !cursorBefore && !view.isEditable)
          this.pendingBuffer = 0;
        this.flushBuffer(active);
        if (cursorBefore) {
          line2.append(wrapMarks(new WidgetBufferView(1), active), openStart);
          openStart = active.length + Math.max(0, openStart - active.length);
        }
        line2.append(wrapMarks(view, active), openStart);
        this.atCursorPos = cursorAfter;
        this.pendingBuffer = !cursorAfter ? 0 : from2 < to || openStart > active.length ? 1 : 2;
        if (this.pendingBuffer)
          this.bufferMarks = active.slice();
      }
    } else if (this.doc.lineAt(this.pos).from == this.pos) {
      this.getLine().addLineDeco(deco);
    }
    if (len) {
      if (this.textOff + len <= this.text.length) {
        this.textOff += len;
      } else {
        this.skip += len - (this.text.length - this.textOff);
        this.text = "";
        this.textOff = 0;
      }
      this.pos = to;
    }
    if (this.openStart < 0)
      this.openStart = openStart;
  }
  static build(text2, from2, to, decorations2, dynamicDecorationMap) {
    let builder = new _ContentBuilder(text2, from2, to, dynamicDecorationMap);
    builder.openEnd = RangeSet.spans(decorations2, from2, to, builder);
    if (builder.openStart < 0)
      builder.openStart = builder.openEnd;
    builder.finish(builder.openEnd);
    return builder;
  }
};
function wrapMarks(view, active) {
  for (let mark of active)
    view = new MarkView(mark, [view], view.length);
  return view;
}
var NullWidget = class extends WidgetType {
  constructor(tag) {
    super();
    this.tag = tag;
  }
  eq(other) {
    return other.tag == this.tag;
  }
  toDOM() {
    return document.createElement(this.tag);
  }
  updateDOM(elt) {
    return elt.nodeName.toLowerCase() == this.tag;
  }
  get isHidden() {
    return true;
  }
};
var clickAddsSelectionRange = /* @__PURE__ */ Facet.define();
var dragMovesSelection$1 = /* @__PURE__ */ Facet.define();
var mouseSelectionStyle = /* @__PURE__ */ Facet.define();
var exceptionSink = /* @__PURE__ */ Facet.define();
var updateListener = /* @__PURE__ */ Facet.define();
var inputHandler = /* @__PURE__ */ Facet.define();
var focusChangeEffect = /* @__PURE__ */ Facet.define();
var perLineTextDirection = /* @__PURE__ */ Facet.define({
  combine: (values2) => values2.some((x2) => x2)
});
var nativeSelectionHidden = /* @__PURE__ */ Facet.define({
  combine: (values2) => values2.some((x2) => x2)
});
var ScrollTarget = class _ScrollTarget {
  constructor(range4, y2 = "nearest", x2 = "nearest", yMargin = 5, xMargin = 5) {
    this.range = range4;
    this.y = y2;
    this.x = x2;
    this.yMargin = yMargin;
    this.xMargin = xMargin;
  }
  map(changes) {
    return changes.empty ? this : new _ScrollTarget(this.range.map(changes), this.y, this.x, this.yMargin, this.xMargin);
  }
};
var scrollIntoView = /* @__PURE__ */ StateEffect.define({ map: (t3, ch) => t3.map(ch) });
function logException(state, exception, context2) {
  let handler = state.facet(exceptionSink);
  if (handler.length)
    handler[0](exception);
  else if (window.onerror)
    window.onerror(String(exception), context2, void 0, void 0, exception);
  else if (context2)
    console.error(context2 + ":", exception);
  else
    console.error(exception);
}
var editable = /* @__PURE__ */ Facet.define({ combine: (values2) => values2.length ? values2[0] : true });
var nextPluginID = 0;
var viewPlugin = /* @__PURE__ */ Facet.define();
var ViewPlugin = class _ViewPlugin {
  constructor(id2, create4, domEventHandlers, domEventObservers, buildExtensions) {
    this.id = id2;
    this.create = create4;
    this.domEventHandlers = domEventHandlers;
    this.domEventObservers = domEventObservers;
    this.extension = buildExtensions(this);
  }
  /**
  Define a plugin from a constructor function that creates the
  plugin's value, given an editor view.
  */
  static define(create4, spec) {
    const { eventHandlers, eventObservers, provide, decorations: deco } = spec || {};
    return new _ViewPlugin(nextPluginID++, create4, eventHandlers, eventObservers, (plugin) => {
      let ext = [viewPlugin.of(plugin)];
      if (deco)
        ext.push(decorations.of((view) => {
          let pluginInst = view.plugin(plugin);
          return pluginInst ? deco(pluginInst) : Decoration.none;
        }));
      if (provide)
        ext.push(provide(plugin));
      return ext;
    });
  }
  /**
  Create a plugin for a class whose constructor takes a single
  editor view as argument.
  */
  static fromClass(cls, spec) {
    return _ViewPlugin.define((view) => new cls(view), spec);
  }
};
var PluginInstance = class {
  constructor(spec) {
    this.spec = spec;
    this.mustUpdate = null;
    this.value = null;
  }
  update(view) {
    if (!this.value) {
      if (this.spec) {
        try {
          this.value = this.spec.create(view);
        } catch (e3) {
          logException(view.state, e3, "CodeMirror plugin crashed");
          this.deactivate();
        }
      }
    } else if (this.mustUpdate) {
      let update = this.mustUpdate;
      this.mustUpdate = null;
      if (this.value.update) {
        try {
          this.value.update(update);
        } catch (e3) {
          logException(update.state, e3, "CodeMirror plugin crashed");
          if (this.value.destroy)
            try {
              this.value.destroy();
            } catch (_) {
            }
          this.deactivate();
        }
      }
    }
    return this;
  }
  destroy(view) {
    var _a2;
    if ((_a2 = this.value) === null || _a2 === void 0 ? void 0 : _a2.destroy) {
      try {
        this.value.destroy();
      } catch (e3) {
        logException(view.state, e3, "CodeMirror plugin crashed");
      }
    }
  }
  deactivate() {
    this.spec = this.value = null;
  }
};
var editorAttributes = /* @__PURE__ */ Facet.define();
var contentAttributes = /* @__PURE__ */ Facet.define();
var decorations = /* @__PURE__ */ Facet.define();
var atomicRanges = /* @__PURE__ */ Facet.define();
var bidiIsolatedRanges = /* @__PURE__ */ Facet.define();
function getIsolatedRanges(view, from2, to) {
  let isolates = view.state.facet(bidiIsolatedRanges);
  if (!isolates.length)
    return isolates;
  let sets = isolates.map((i2) => i2 instanceof Function ? i2(view) : i2);
  let result = [];
  RangeSet.spans(sets, from2, to, {
    point() {
    },
    span(from3, to2, active, open) {
      let level = result;
      for (let i2 = active.length - 1; i2 >= 0; i2--, open--) {
        let iso = active[i2].spec.bidiIsolate, update;
        if (iso == null)
          continue;
        if (open > 0 && level.length && (update = level[level.length - 1]).to == from3 && update.direction == iso) {
          update.to = to2;
          level = update.inner;
        } else {
          let add2 = { from: from3, to: to2, direction: iso, inner: [] };
          level.push(add2);
          level = add2.inner;
        }
      }
    }
  });
  return result;
}
var scrollMargins = /* @__PURE__ */ Facet.define();
function getScrollMargins(view) {
  let left = 0, right = 0, top2 = 0, bottom = 0;
  for (let source of view.state.facet(scrollMargins)) {
    let m = source(view);
    if (m) {
      if (m.left != null)
        left = Math.max(left, m.left);
      if (m.right != null)
        right = Math.max(right, m.right);
      if (m.top != null)
        top2 = Math.max(top2, m.top);
      if (m.bottom != null)
        bottom = Math.max(bottom, m.bottom);
    }
  }
  return { left, right, top: top2, bottom };
}
var styleModule = /* @__PURE__ */ Facet.define();
var ChangedRange = class _ChangedRange {
  constructor(fromA, toA, fromB, toB) {
    this.fromA = fromA;
    this.toA = toA;
    this.fromB = fromB;
    this.toB = toB;
  }
  join(other) {
    return new _ChangedRange(Math.min(this.fromA, other.fromA), Math.max(this.toA, other.toA), Math.min(this.fromB, other.fromB), Math.max(this.toB, other.toB));
  }
  addToSet(set3) {
    let i2 = set3.length, me = this;
    for (; i2 > 0; i2--) {
      let range4 = set3[i2 - 1];
      if (range4.fromA > me.toA)
        continue;
      if (range4.toA < me.fromA)
        break;
      me = me.join(range4);
      set3.splice(i2 - 1, 1);
    }
    set3.splice(i2, 0, me);
    return set3;
  }
  static extendWithRanges(diff, ranges) {
    if (ranges.length == 0)
      return diff;
    let result = [];
    for (let dI = 0, rI = 0, posA = 0, posB = 0; ; dI++) {
      let next2 = dI == diff.length ? null : diff[dI], off = posA - posB;
      let end = next2 ? next2.fromB : 1e9;
      while (rI < ranges.length && ranges[rI] < end) {
        let from2 = ranges[rI], to = ranges[rI + 1];
        let fromB = Math.max(posB, from2), toB = Math.min(end, to);
        if (fromB <= toB)
          new _ChangedRange(fromB + off, toB + off, fromB, toB).addToSet(result);
        if (to > end)
          break;
        else
          rI += 2;
      }
      if (!next2)
        return result;
      new _ChangedRange(next2.fromA, next2.toA, next2.fromB, next2.toB).addToSet(result);
      posA = next2.toA;
      posB = next2.toB;
    }
  }
};
var ViewUpdate = class _ViewUpdate {
  constructor(view, state, transactions) {
    this.view = view;
    this.state = state;
    this.transactions = transactions;
    this.flags = 0;
    this.startState = view.state;
    this.changes = ChangeSet.empty(this.startState.doc.length);
    for (let tr of transactions)
      this.changes = this.changes.compose(tr.changes);
    let changedRanges = [];
    this.changes.iterChangedRanges((fromA, toA, fromB, toB) => changedRanges.push(new ChangedRange(fromA, toA, fromB, toB)));
    this.changedRanges = changedRanges;
  }
  /**
  @internal
  */
  static create(view, state, transactions) {
    return new _ViewUpdate(view, state, transactions);
  }
  /**
  Tells you whether the [viewport](https://codemirror.net/6/docs/ref/#view.EditorView.viewport) or
  [visible ranges](https://codemirror.net/6/docs/ref/#view.EditorView.visibleRanges) changed in this
  update.
  */
  get viewportChanged() {
    return (this.flags & 4) > 0;
  }
  /**
  Indicates whether the height of a block element in the editor
  changed in this update.
  */
  get heightChanged() {
    return (this.flags & 2) > 0;
  }
  /**
  Returns true when the document was modified or the size of the
  editor, or elements within the editor, changed.
  */
  get geometryChanged() {
    return this.docChanged || (this.flags & (8 | 2)) > 0;
  }
  /**
  True when this update indicates a focus change.
  */
  get focusChanged() {
    return (this.flags & 1) > 0;
  }
  /**
  Whether the document changed in this update.
  */
  get docChanged() {
    return !this.changes.empty;
  }
  /**
  Whether the selection was explicitly set in this update.
  */
  get selectionSet() {
    return this.transactions.some((tr) => tr.selection);
  }
  /**
  @internal
  */
  get empty() {
    return this.flags == 0 && this.transactions.length == 0;
  }
};
var Direction = /* @__PURE__ */ function(Direction2) {
  Direction2[Direction2["LTR"] = 0] = "LTR";
  Direction2[Direction2["RTL"] = 1] = "RTL";
  return Direction2;
}(Direction || (Direction = {}));
var LTR = Direction.LTR;
var RTL = Direction.RTL;
function dec(str) {
  let result = [];
  for (let i2 = 0; i2 < str.length; i2++)
    result.push(1 << +str[i2]);
  return result;
}
var LowTypes = /* @__PURE__ */ dec("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008");
var ArabicTypes = /* @__PURE__ */ dec("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333");
var Brackets = /* @__PURE__ */ Object.create(null);
var BracketStack = [];
for (let p of ["()", "[]", "{}"]) {
  let l = /* @__PURE__ */ p.charCodeAt(0), r3 = /* @__PURE__ */ p.charCodeAt(1);
  Brackets[l] = r3;
  Brackets[r3] = -l;
}
function charType(ch) {
  return ch <= 247 ? LowTypes[ch] : 1424 <= ch && ch <= 1524 ? 2 : 1536 <= ch && ch <= 1785 ? ArabicTypes[ch - 1536] : 1774 <= ch && ch <= 2220 ? 4 : 8192 <= ch && ch <= 8203 ? 256 : 64336 <= ch && ch <= 65023 ? 4 : ch == 8204 ? 256 : 1;
}
var BidiRE = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;
var BidiSpan = class {
  /**
  The direction of this span.
  */
  get dir() {
    return this.level % 2 ? RTL : LTR;
  }
  /**
  @internal
  */
  constructor(from2, to, level) {
    this.from = from2;
    this.to = to;
    this.level = level;
  }
  /**
  @internal
  */
  side(end, dir) {
    return this.dir == dir == end ? this.to : this.from;
  }
  /**
  @internal
  */
  static find(order, index, level, assoc) {
    let maybe = -1;
    for (let i2 = 0; i2 < order.length; i2++) {
      let span = order[i2];
      if (span.from <= index && span.to >= index) {
        if (span.level == level)
          return i2;
        if (maybe < 0 || (assoc != 0 ? assoc < 0 ? span.from < index : span.to > index : order[maybe].level > span.level))
          maybe = i2;
      }
    }
    if (maybe < 0)
      throw new RangeError("Index out of range");
    return maybe;
  }
};
function isolatesEq(a2, b) {
  if (a2.length != b.length)
    return false;
  for (let i2 = 0; i2 < a2.length; i2++) {
    let iA = a2[i2], iB = b[i2];
    if (iA.from != iB.from || iA.to != iB.to || iA.direction != iB.direction || !isolatesEq(iA.inner, iB.inner))
      return false;
  }
  return true;
}
var types = [];
function computeCharTypes(line2, rFrom, rTo, isolates, outerType) {
  for (let iI = 0; iI <= isolates.length; iI++) {
    let from2 = iI ? isolates[iI - 1].to : rFrom, to = iI < isolates.length ? isolates[iI].from : rTo;
    let prevType = iI ? 256 : outerType;
    for (let i2 = from2, prev2 = prevType, prevStrong = prevType; i2 < to; i2++) {
      let type = charType(line2.charCodeAt(i2));
      if (type == 512)
        type = prev2;
      else if (type == 8 && prevStrong == 4)
        type = 16;
      types[i2] = type == 4 ? 2 : type;
      if (type & 7)
        prevStrong = type;
      prev2 = type;
    }
    for (let i2 = from2, prev2 = prevType, prevStrong = prevType; i2 < to; i2++) {
      let type = types[i2];
      if (type == 128) {
        if (i2 < to - 1 && prev2 == types[i2 + 1] && prev2 & 24)
          type = types[i2] = prev2;
        else
          types[i2] = 256;
      } else if (type == 64) {
        let end = i2 + 1;
        while (end < to && types[end] == 64)
          end++;
        let replace2 = i2 && prev2 == 8 || end < rTo && types[end] == 8 ? prevStrong == 1 ? 1 : 8 : 256;
        for (let j = i2; j < end; j++)
          types[j] = replace2;
        i2 = end - 1;
      } else if (type == 8 && prevStrong == 1) {
        types[i2] = 1;
      }
      prev2 = type;
      if (type & 7)
        prevStrong = type;
    }
  }
}
function processBracketPairs(line2, rFrom, rTo, isolates, outerType) {
  let oppositeType = outerType == 1 ? 2 : 1;
  for (let iI = 0, sI = 0, context2 = 0; iI <= isolates.length; iI++) {
    let from2 = iI ? isolates[iI - 1].to : rFrom, to = iI < isolates.length ? isolates[iI].from : rTo;
    for (let i2 = from2, ch, br, type; i2 < to; i2++) {
      if (br = Brackets[ch = line2.charCodeAt(i2)]) {
        if (br < 0) {
          for (let sJ = sI - 3; sJ >= 0; sJ -= 3) {
            if (BracketStack[sJ + 1] == -br) {
              let flags = BracketStack[sJ + 2];
              let type2 = flags & 2 ? outerType : !(flags & 4) ? 0 : flags & 1 ? oppositeType : outerType;
              if (type2)
                types[i2] = types[BracketStack[sJ]] = type2;
              sI = sJ;
              break;
            }
          }
        } else if (BracketStack.length == 189) {
          break;
        } else {
          BracketStack[sI++] = i2;
          BracketStack[sI++] = ch;
          BracketStack[sI++] = context2;
        }
      } else if ((type = types[i2]) == 2 || type == 1) {
        let embed = type == outerType;
        context2 = embed ? 0 : 1;
        for (let sJ = sI - 3; sJ >= 0; sJ -= 3) {
          let cur2 = BracketStack[sJ + 2];
          if (cur2 & 2)
            break;
          if (embed) {
            BracketStack[sJ + 2] |= 2;
          } else {
            if (cur2 & 4)
              break;
            BracketStack[sJ + 2] |= 4;
          }
        }
      }
    }
  }
}
function processNeutrals(rFrom, rTo, isolates, outerType) {
  for (let iI = 0, prev2 = outerType; iI <= isolates.length; iI++) {
    let from2 = iI ? isolates[iI - 1].to : rFrom, to = iI < isolates.length ? isolates[iI].from : rTo;
    for (let i2 = from2; i2 < to; ) {
      let type = types[i2];
      if (type == 256) {
        let end = i2 + 1;
        for (; ; ) {
          if (end == to) {
            if (iI == isolates.length)
              break;
            end = isolates[iI++].to;
            to = iI < isolates.length ? isolates[iI].from : rTo;
          } else if (types[end] == 256) {
            end++;
          } else {
            break;
          }
        }
        let beforeL = prev2 == 1;
        let afterL = (end < rTo ? types[end] : outerType) == 1;
        let replace2 = beforeL == afterL ? beforeL ? 1 : 2 : outerType;
        for (let j = end, jI = iI, fromJ = jI ? isolates[jI - 1].to : rFrom; j > i2; ) {
          if (j == fromJ) {
            j = isolates[--jI].from;
            fromJ = jI ? isolates[jI - 1].to : rFrom;
          }
          types[--j] = replace2;
        }
        i2 = end;
      } else {
        prev2 = type;
        i2++;
      }
    }
  }
}
function emitSpans(line2, from2, to, level, baseLevel, isolates, order) {
  let ourType = level % 2 ? 2 : 1;
  if (level % 2 == baseLevel % 2) {
    for (let iCh = from2, iI = 0; iCh < to; ) {
      let sameDir = true, isNum = false;
      if (iI == isolates.length || iCh < isolates[iI].from) {
        let next2 = types[iCh];
        if (next2 != ourType) {
          sameDir = false;
          isNum = next2 == 16;
        }
      }
      let recurse = !sameDir && ourType == 1 ? [] : null;
      let localLevel = sameDir ? level : level + 1;
      let iScan = iCh;
      run:
        for (; ; ) {
          if (iI < isolates.length && iScan == isolates[iI].from) {
            if (isNum)
              break run;
            let iso = isolates[iI];
            if (!sameDir)
              for (let upto = iso.to, jI = iI + 1; ; ) {
                if (upto == to)
                  break run;
                if (jI < isolates.length && isolates[jI].from == upto)
                  upto = isolates[jI++].to;
                else if (types[upto] == ourType)
                  break run;
                else
                  break;
              }
            iI++;
            if (recurse) {
              recurse.push(iso);
            } else {
              if (iso.from > iCh)
                order.push(new BidiSpan(iCh, iso.from, localLevel));
              let dirSwap = iso.direction == LTR != !(localLevel % 2);
              computeSectionOrder(line2, dirSwap ? level + 1 : level, baseLevel, iso.inner, iso.from, iso.to, order);
              iCh = iso.to;
            }
            iScan = iso.to;
          } else if (iScan == to || (sameDir ? types[iScan] != ourType : types[iScan] == ourType)) {
            break;
          } else {
            iScan++;
          }
        }
      if (recurse)
        emitSpans(line2, iCh, iScan, level + 1, baseLevel, recurse, order);
      else if (iCh < iScan)
        order.push(new BidiSpan(iCh, iScan, localLevel));
      iCh = iScan;
    }
  } else {
    for (let iCh = to, iI = isolates.length; iCh > from2; ) {
      let sameDir = true, isNum = false;
      if (!iI || iCh > isolates[iI - 1].to) {
        let next2 = types[iCh - 1];
        if (next2 != ourType) {
          sameDir = false;
          isNum = next2 == 16;
        }
      }
      let recurse = !sameDir && ourType == 1 ? [] : null;
      let localLevel = sameDir ? level : level + 1;
      let iScan = iCh;
      run:
        for (; ; ) {
          if (iI && iScan == isolates[iI - 1].to) {
            if (isNum)
              break run;
            let iso = isolates[--iI];
            if (!sameDir)
              for (let upto = iso.from, jI = iI; ; ) {
                if (upto == from2)
                  break run;
                if (jI && isolates[jI - 1].to == upto)
                  upto = isolates[--jI].from;
                else if (types[upto - 1] == ourType)
                  break run;
                else
                  break;
              }
            if (recurse) {
              recurse.push(iso);
            } else {
              if (iso.to < iCh)
                order.push(new BidiSpan(iso.to, iCh, localLevel));
              let dirSwap = iso.direction == LTR != !(localLevel % 2);
              computeSectionOrder(line2, dirSwap ? level + 1 : level, baseLevel, iso.inner, iso.from, iso.to, order);
              iCh = iso.from;
            }
            iScan = iso.from;
          } else if (iScan == from2 || (sameDir ? types[iScan - 1] != ourType : types[iScan - 1] == ourType)) {
            break;
          } else {
            iScan--;
          }
        }
      if (recurse)
        emitSpans(line2, iScan, iCh, level + 1, baseLevel, recurse, order);
      else if (iScan < iCh)
        order.push(new BidiSpan(iScan, iCh, localLevel));
      iCh = iScan;
    }
  }
}
function computeSectionOrder(line2, level, baseLevel, isolates, from2, to, order) {
  let outerType = level % 2 ? 2 : 1;
  computeCharTypes(line2, from2, to, isolates, outerType);
  processBracketPairs(line2, from2, to, isolates, outerType);
  processNeutrals(from2, to, isolates, outerType);
  emitSpans(line2, from2, to, level, baseLevel, isolates, order);
}
function computeOrder(line2, direction, isolates) {
  if (!line2)
    return [new BidiSpan(0, 0, direction == RTL ? 1 : 0)];
  if (direction == LTR && !isolates.length && !BidiRE.test(line2))
    return trivialOrder(line2.length);
  if (isolates.length)
    while (line2.length > types.length)
      types[types.length] = 256;
  let order = [], level = direction == LTR ? 0 : 1;
  computeSectionOrder(line2, level, level, isolates, 0, line2.length, order);
  return order;
}
function trivialOrder(length2) {
  return [new BidiSpan(0, length2, 0)];
}
var movedOver = "";
function moveVisually(line2, order, dir, start, forward) {
  var _a2;
  let startIndex = start.head - line2.from, spanI = -1;
  if (startIndex == 0) {
    if (!forward || !line2.length)
      return null;
    if (order[0].level != dir) {
      startIndex = order[0].side(false, dir);
      spanI = 0;
    }
  } else if (startIndex == line2.length) {
    if (forward)
      return null;
    let last = order[order.length - 1];
    if (last.level != dir) {
      startIndex = last.side(true, dir);
      spanI = order.length - 1;
    }
  }
  if (spanI < 0)
    spanI = BidiSpan.find(order, startIndex, (_a2 = start.bidiLevel) !== null && _a2 !== void 0 ? _a2 : -1, start.assoc);
  let span = order[spanI];
  if (startIndex == span.side(forward, dir)) {
    span = order[spanI += forward ? 1 : -1];
    startIndex = span.side(!forward, dir);
  }
  let indexForward = forward == (span.dir == dir);
  let nextIndex = findClusterBreak(line2.text, startIndex, indexForward);
  movedOver = line2.text.slice(Math.min(startIndex, nextIndex), Math.max(startIndex, nextIndex));
  if (nextIndex != span.side(forward, dir))
    return EditorSelection.cursor(nextIndex + line2.from, indexForward ? -1 : 1, span.level);
  let nextSpan = spanI == (forward ? order.length - 1 : 0) ? null : order[spanI + (forward ? 1 : -1)];
  if (!nextSpan && span.level != dir)
    return EditorSelection.cursor(forward ? line2.to : line2.from, forward ? -1 : 1, dir);
  if (nextSpan && nextSpan.level < span.level)
    return EditorSelection.cursor(nextSpan.side(!forward, dir) + line2.from, forward ? 1 : -1, nextSpan.level);
  return EditorSelection.cursor(nextIndex + line2.from, forward ? -1 : 1, span.level);
}
var DocView = class extends ContentView {
  get length() {
    return this.view.state.doc.length;
  }
  constructor(view) {
    super();
    this.view = view;
    this.decorations = [];
    this.dynamicDecorationMap = [];
    this.domChanged = null;
    this.hasComposition = null;
    this.markedForComposition = /* @__PURE__ */ new Set();
    this.minWidth = 0;
    this.minWidthFrom = 0;
    this.minWidthTo = 0;
    this.impreciseAnchor = null;
    this.impreciseHead = null;
    this.forceSelection = false;
    this.lastUpdate = Date.now();
    this.setDOM(view.contentDOM);
    this.children = [new LineView()];
    this.children[0].setParent(this);
    this.updateDeco();
    this.updateInner([new ChangedRange(0, 0, 0, view.state.doc.length)], 0, null);
  }
  // Update the document view to a given state.
  update(update) {
    var _a2;
    let changedRanges = update.changedRanges;
    if (this.minWidth > 0 && changedRanges.length) {
      if (!changedRanges.every(({ fromA, toA }) => toA < this.minWidthFrom || fromA > this.minWidthTo)) {
        this.minWidth = this.minWidthFrom = this.minWidthTo = 0;
      } else {
        this.minWidthFrom = update.changes.mapPos(this.minWidthFrom, 1);
        this.minWidthTo = update.changes.mapPos(this.minWidthTo, 1);
      }
    }
    let readCompositionAt = -1;
    if (this.view.inputState.composing >= 0) {
      if ((_a2 = this.domChanged) === null || _a2 === void 0 ? void 0 : _a2.newSel)
        readCompositionAt = this.domChanged.newSel.head;
      else if (!touchesComposition(update.changes, this.hasComposition) && !update.selectionSet)
        readCompositionAt = update.state.selection.main.head;
    }
    let composition = readCompositionAt > -1 ? findCompositionRange(this.view, update.changes, readCompositionAt) : null;
    this.domChanged = null;
    if (this.hasComposition) {
      this.markedForComposition.clear();
      let { from: from2, to } = this.hasComposition;
      changedRanges = new ChangedRange(from2, to, update.changes.mapPos(from2, -1), update.changes.mapPos(to, 1)).addToSet(changedRanges.slice());
    }
    this.hasComposition = composition ? { from: composition.range.fromB, to: composition.range.toB } : null;
    if ((browser.ie || browser.chrome) && !composition && update && update.state.doc.lines != update.startState.doc.lines)
      this.forceSelection = true;
    let prevDeco = this.decorations, deco = this.updateDeco();
    let decoDiff = findChangedDeco(prevDeco, deco, update.changes);
    changedRanges = ChangedRange.extendWithRanges(changedRanges, decoDiff);
    if (!(this.flags & 7) && changedRanges.length == 0) {
      return false;
    } else {
      this.updateInner(changedRanges, update.startState.doc.length, composition);
      if (update.transactions.length)
        this.lastUpdate = Date.now();
      return true;
    }
  }
  // Used by update and the constructor do perform the actual DOM
  // update
  updateInner(changes, oldLength, composition) {
    this.view.viewState.mustMeasureContent = true;
    this.updateChildren(changes, oldLength, composition);
    let { observer } = this.view;
    observer.ignore(() => {
      this.dom.style.height = this.view.viewState.contentHeight / this.view.scaleY + "px";
      this.dom.style.flexBasis = this.minWidth ? this.minWidth + "px" : "";
      let track = browser.chrome || browser.ios ? { node: observer.selectionRange.focusNode, written: false } : void 0;
      this.sync(this.view, track);
      this.flags &= ~7;
      if (track && (track.written || observer.selectionRange.focusNode != track.node))
        this.forceSelection = true;
      this.dom.style.height = "";
    });
    this.markedForComposition.forEach(
      (cView) => cView.flags &= ~8
      /* ViewFlag.Composition */
    );
    let gaps = [];
    if (this.view.viewport.from || this.view.viewport.to < this.view.state.doc.length) {
      for (let child of this.children)
        if (child instanceof BlockWidgetView && child.widget instanceof BlockGapWidget)
          gaps.push(child.dom);
    }
    observer.updateGaps(gaps);
  }
  updateChildren(changes, oldLength, composition) {
    let ranges = composition ? composition.range.addToSet(changes.slice()) : changes;
    let cursor3 = this.childCursor(oldLength);
    for (let i2 = ranges.length - 1; ; i2--) {
      let next2 = i2 >= 0 ? ranges[i2] : null;
      if (!next2)
        break;
      let { fromA, toA, fromB, toB } = next2, content2, breakAtStart, openStart, openEnd;
      if (composition && composition.range.fromB < toB && composition.range.toB > fromB) {
        let before = ContentBuilder.build(this.view.state.doc, fromB, composition.range.fromB, this.decorations, this.dynamicDecorationMap);
        let after = ContentBuilder.build(this.view.state.doc, composition.range.toB, toB, this.decorations, this.dynamicDecorationMap);
        breakAtStart = before.breakAtStart;
        openStart = before.openStart;
        openEnd = after.openEnd;
        let compLine = this.compositionView(composition);
        if (after.breakAtStart) {
          compLine.breakAfter = 1;
        } else if (after.content.length && compLine.merge(compLine.length, compLine.length, after.content[0], false, after.openStart, 0)) {
          compLine.breakAfter = after.content[0].breakAfter;
          after.content.shift();
        }
        if (before.content.length && compLine.merge(0, 0, before.content[before.content.length - 1], true, 0, before.openEnd)) {
          before.content.pop();
        }
        content2 = before.content.concat(compLine).concat(after.content);
      } else {
        ({ content: content2, breakAtStart, openStart, openEnd } = ContentBuilder.build(this.view.state.doc, fromB, toB, this.decorations, this.dynamicDecorationMap));
      }
      let { i: toI, off: toOff } = cursor3.findPos(toA, 1);
      let { i: fromI, off: fromOff } = cursor3.findPos(fromA, -1);
      replaceRange(this, fromI, fromOff, toI, toOff, content2, breakAtStart, openStart, openEnd);
    }
    if (composition)
      this.fixCompositionDOM(composition);
  }
  compositionView(composition) {
    let cur2 = new TextView(composition.text.nodeValue);
    cur2.flags |= 8;
    for (let { deco } of composition.marks)
      cur2 = new MarkView(deco, [cur2], cur2.length);
    let line2 = new LineView();
    line2.append(cur2, 0);
    return line2;
  }
  fixCompositionDOM(composition) {
    let fix = (dom, cView2) => {
      cView2.flags |= 8 | (cView2.children.some(
        (c4) => c4.flags & 7
        /* ViewFlag.Dirty */
      ) ? 1 : 0);
      this.markedForComposition.add(cView2);
      let prev2 = ContentView.get(dom);
      if (prev2 && prev2 != cView2)
        prev2.dom = null;
      cView2.setDOM(dom);
    };
    let pos = this.childPos(composition.range.fromB, 1);
    let cView = this.children[pos.i];
    fix(composition.line, cView);
    for (let i2 = composition.marks.length - 1; i2 >= -1; i2--) {
      pos = cView.childPos(pos.off, 1);
      cView = cView.children[pos.i];
      fix(i2 >= 0 ? composition.marks[i2].node : composition.text, cView);
    }
  }
  // Sync the DOM selection to this.state.selection
  updateSelection(mustRead = false, fromPointer = false) {
    if (mustRead || !this.view.observer.selectionRange.focusNode)
      this.view.observer.readSelectionRange();
    let activeElt = this.view.root.activeElement, focused = activeElt == this.dom;
    let selectionNotFocus = !focused && hasSelection(this.dom, this.view.observer.selectionRange) && !(activeElt && this.dom.contains(activeElt));
    if (!(focused || fromPointer || selectionNotFocus))
      return;
    let force = this.forceSelection;
    this.forceSelection = false;
    let main = this.view.state.selection.main;
    let anchor = this.moveToLine(this.domAtPos(main.anchor));
    let head = main.empty ? anchor : this.moveToLine(this.domAtPos(main.head));
    if (browser.gecko && main.empty && !this.hasComposition && betweenUneditable(anchor)) {
      let dummy = document.createTextNode("");
      this.view.observer.ignore(() => anchor.node.insertBefore(dummy, anchor.node.childNodes[anchor.offset] || null));
      anchor = head = new DOMPos(dummy, 0);
      force = true;
    }
    let domSel = this.view.observer.selectionRange;
    if (force || !domSel.focusNode || !isEquivalentPosition(anchor.node, anchor.offset, domSel.anchorNode, domSel.anchorOffset) || !isEquivalentPosition(head.node, head.offset, domSel.focusNode, domSel.focusOffset)) {
      this.view.observer.ignore(() => {
        if (browser.android && browser.chrome && this.dom.contains(domSel.focusNode) && inUneditable(domSel.focusNode, this.dom)) {
          this.dom.blur();
          this.dom.focus({ preventScroll: true });
        }
        let rawSel = getSelection(this.view.root);
        if (!rawSel)
          ;
        else if (main.empty) {
          if (browser.gecko) {
            let nextTo = nextToUneditable(anchor.node, anchor.offset);
            if (nextTo && nextTo != (1 | 2)) {
              let text2 = nearbyTextNode(anchor.node, anchor.offset, nextTo == 1 ? 1 : -1);
              if (text2)
                anchor = new DOMPos(text2.node, text2.offset);
            }
          }
          rawSel.collapse(anchor.node, anchor.offset);
          if (main.bidiLevel != null && rawSel.caretBidiLevel !== void 0)
            rawSel.caretBidiLevel = main.bidiLevel;
        } else if (rawSel.extend) {
          rawSel.collapse(anchor.node, anchor.offset);
          try {
            rawSel.extend(head.node, head.offset);
          } catch (_) {
          }
        } else {
          let range4 = document.createRange();
          if (main.anchor > main.head)
            [anchor, head] = [head, anchor];
          range4.setEnd(head.node, head.offset);
          range4.setStart(anchor.node, anchor.offset);
          rawSel.removeAllRanges();
          rawSel.addRange(range4);
        }
        if (selectionNotFocus && this.view.root.activeElement == this.dom) {
          this.dom.blur();
          if (activeElt)
            activeElt.focus();
        }
      });
      this.view.observer.setSelectionRange(anchor, head);
    }
    this.impreciseAnchor = anchor.precise ? null : new DOMPos(domSel.anchorNode, domSel.anchorOffset);
    this.impreciseHead = head.precise ? null : new DOMPos(domSel.focusNode, domSel.focusOffset);
  }
  enforceCursorAssoc() {
    if (this.hasComposition)
      return;
    let { view } = this, cursor3 = view.state.selection.main;
    let sel = getSelection(view.root);
    let { anchorNode, anchorOffset } = view.observer.selectionRange;
    if (!sel || !cursor3.empty || !cursor3.assoc || !sel.modify)
      return;
    let line2 = LineView.find(this, cursor3.head);
    if (!line2)
      return;
    let lineStart = line2.posAtStart;
    if (cursor3.head == lineStart || cursor3.head == lineStart + line2.length)
      return;
    let before = this.coordsAt(cursor3.head, -1), after = this.coordsAt(cursor3.head, 1);
    if (!before || !after || before.bottom > after.top)
      return;
    let dom = this.domAtPos(cursor3.head + cursor3.assoc);
    sel.collapse(dom.node, dom.offset);
    sel.modify("move", cursor3.assoc < 0 ? "forward" : "backward", "lineboundary");
    view.observer.readSelectionRange();
    let newRange = view.observer.selectionRange;
    if (view.docView.posFromDOM(newRange.anchorNode, newRange.anchorOffset) != cursor3.from)
      sel.collapse(anchorNode, anchorOffset);
  }
  // If a position is in/near a block widget, move it to a nearby text
  // line, since we don't want the cursor inside a block widget.
  moveToLine(pos) {
    let dom = this.dom, newPos;
    if (pos.node != dom)
      return pos;
    for (let i2 = pos.offset; !newPos && i2 < dom.childNodes.length; i2++) {
      let view = ContentView.get(dom.childNodes[i2]);
      if (view instanceof LineView)
        newPos = view.domAtPos(0);
    }
    for (let i2 = pos.offset - 1; !newPos && i2 >= 0; i2--) {
      let view = ContentView.get(dom.childNodes[i2]);
      if (view instanceof LineView)
        newPos = view.domAtPos(view.length);
    }
    return newPos ? new DOMPos(newPos.node, newPos.offset, true) : pos;
  }
  nearest(dom) {
    for (let cur2 = dom; cur2; ) {
      let domView = ContentView.get(cur2);
      if (domView && domView.rootView == this)
        return domView;
      cur2 = cur2.parentNode;
    }
    return null;
  }
  posFromDOM(node56, offset) {
    let view = this.nearest(node56);
    if (!view)
      throw new RangeError("Trying to find position for a DOM position outside of the document");
    return view.localPosFromDOM(node56, offset) + view.posAtStart;
  }
  domAtPos(pos) {
    let { i: i2, off } = this.childCursor().findPos(pos, -1);
    for (; i2 < this.children.length - 1; ) {
      let child = this.children[i2];
      if (off < child.length || child instanceof LineView)
        break;
      i2++;
      off = 0;
    }
    return this.children[i2].domAtPos(off);
  }
  coordsAt(pos, side) {
    let best = null, bestPos = 0;
    for (let off = this.length, i2 = this.children.length - 1; i2 >= 0; i2--) {
      let child = this.children[i2], end = off - child.breakAfter, start = end - child.length;
      if (end < pos)
        break;
      if (start <= pos && (start < pos || child.covers(-1)) && (end > pos || child.covers(1)) && (!best || child instanceof LineView && !(best instanceof LineView && side >= 0))) {
        best = child;
        bestPos = start;
      }
      off = start;
    }
    return best ? best.coordsAt(pos - bestPos, side) : null;
  }
  coordsForChar(pos) {
    let { i: i2, off } = this.childPos(pos, 1), child = this.children[i2];
    if (!(child instanceof LineView))
      return null;
    while (child.children.length) {
      let { i: i3, off: childOff } = child.childPos(off, 1);
      for (; ; i3++) {
        if (i3 == child.children.length)
          return null;
        if ((child = child.children[i3]).length)
          break;
      }
      off = childOff;
    }
    if (!(child instanceof TextView))
      return null;
    let end = findClusterBreak(child.text, off);
    if (end == off)
      return null;
    let rects = textRange(child.dom, off, end).getClientRects();
    for (let i3 = 0; i3 < rects.length; i3++) {
      let rect = rects[i3];
      if (i3 == rects.length - 1 || rect.top < rect.bottom && rect.left < rect.right)
        return rect;
    }
    return null;
  }
  measureVisibleLineHeights(viewport) {
    let result = [], { from: from2, to } = viewport;
    let contentWidth = this.view.contentDOM.clientWidth;
    let isWider = contentWidth > Math.max(this.view.scrollDOM.clientWidth, this.minWidth) + 1;
    let widest = -1, ltr = this.view.textDirection == Direction.LTR;
    for (let pos = 0, i2 = 0; i2 < this.children.length; i2++) {
      let child = this.children[i2], end = pos + child.length;
      if (end > to)
        break;
      if (pos >= from2) {
        let childRect = child.dom.getBoundingClientRect();
        result.push(childRect.height);
        if (isWider) {
          let last = child.dom.lastChild;
          let rects = last ? clientRectsFor(last) : [];
          if (rects.length) {
            let rect = rects[rects.length - 1];
            let width = ltr ? rect.right - childRect.left : childRect.right - rect.left;
            if (width > widest) {
              widest = width;
              this.minWidth = contentWidth;
              this.minWidthFrom = pos;
              this.minWidthTo = end;
            }
          }
        }
      }
      pos = end + child.breakAfter;
    }
    return result;
  }
  textDirectionAt(pos) {
    let { i: i2 } = this.childPos(pos, 1);
    return getComputedStyle(this.children[i2].dom).direction == "rtl" ? Direction.RTL : Direction.LTR;
  }
  measureTextSize() {
    for (let child of this.children) {
      if (child instanceof LineView) {
        let measure = child.measureTextSize();
        if (measure)
          return measure;
      }
    }
    let dummy = document.createElement("div"), lineHeight, charWidth, textHeight;
    dummy.className = "cm-line";
    dummy.style.width = "99999px";
    dummy.style.position = "absolute";
    dummy.textContent = "abc def ghi jkl mno pqr stu";
    this.view.observer.ignore(() => {
      this.dom.appendChild(dummy);
      let rect = clientRectsFor(dummy.firstChild)[0];
      lineHeight = dummy.getBoundingClientRect().height;
      charWidth = rect ? rect.width / 27 : 7;
      textHeight = rect ? rect.height : lineHeight;
      dummy.remove();
    });
    return { lineHeight, charWidth, textHeight };
  }
  childCursor(pos = this.length) {
    let i2 = this.children.length;
    if (i2)
      pos -= this.children[--i2].length;
    return new ChildCursor(this.children, pos, i2);
  }
  computeBlockGapDeco() {
    let deco = [], vs = this.view.viewState;
    for (let pos = 0, i2 = 0; ; i2++) {
      let next2 = i2 == vs.viewports.length ? null : vs.viewports[i2];
      let end = next2 ? next2.from - 1 : this.length;
      if (end > pos) {
        let height = (vs.lineBlockAt(end).bottom - vs.lineBlockAt(pos).top) / this.view.scaleY;
        deco.push(Decoration.replace({
          widget: new BlockGapWidget(height),
          block: true,
          inclusive: true,
          isBlockGap: true
        }).range(pos, end));
      }
      if (!next2)
        break;
      pos = next2.to + 1;
    }
    return Decoration.set(deco);
  }
  updateDeco() {
    let allDeco = this.view.state.facet(decorations).map((d, i2) => {
      let dynamic = this.dynamicDecorationMap[i2] = typeof d == "function";
      return dynamic ? d(this.view) : d;
    });
    for (let i2 = allDeco.length; i2 < allDeco.length + 3; i2++)
      this.dynamicDecorationMap[i2] = false;
    return this.decorations = [
      ...allDeco,
      this.computeBlockGapDeco(),
      this.view.viewState.lineGapDeco
    ];
  }
  scrollIntoView(target) {
    let { range: range4 } = target;
    let rect = this.coordsAt(range4.head, range4.empty ? range4.assoc : range4.head > range4.anchor ? -1 : 1), other;
    if (!rect)
      return;
    if (!range4.empty && (other = this.coordsAt(range4.anchor, range4.anchor > range4.head ? -1 : 1)))
      rect = {
        left: Math.min(rect.left, other.left),
        top: Math.min(rect.top, other.top),
        right: Math.max(rect.right, other.right),
        bottom: Math.max(rect.bottom, other.bottom)
      };
    let margins = getScrollMargins(this.view);
    let targetRect = {
      left: rect.left - margins.left,
      top: rect.top - margins.top,
      right: rect.right + margins.right,
      bottom: rect.bottom + margins.bottom
    };
    scrollRectIntoView(this.view.scrollDOM, targetRect, range4.head < range4.anchor ? -1 : 1, target.x, target.y, target.xMargin, target.yMargin, this.view.textDirection == Direction.LTR);
  }
};
function betweenUneditable(pos) {
  return pos.node.nodeType == 1 && pos.node.firstChild && (pos.offset == 0 || pos.node.childNodes[pos.offset - 1].contentEditable == "false") && (pos.offset == pos.node.childNodes.length || pos.node.childNodes[pos.offset].contentEditable == "false");
}
var BlockGapWidget = class extends WidgetType {
  constructor(height) {
    super();
    this.height = height;
  }
  toDOM() {
    let elt = document.createElement("div");
    this.updateDOM(elt);
    return elt;
  }
  eq(other) {
    return other.height == this.height;
  }
  updateDOM(elt) {
    elt.style.height = this.height + "px";
    return true;
  }
  get estimatedHeight() {
    return this.height;
  }
};
function findCompositionNode(view, headPos) {
  let sel = view.observer.selectionRange;
  let textNode = sel.focusNode && nearbyTextNode(sel.focusNode, sel.focusOffset, 0);
  if (!textNode)
    return null;
  let from2 = headPos - textNode.offset;
  return { from: from2, to: from2 + textNode.node.nodeValue.length, node: textNode.node };
}
function findCompositionRange(view, changes, headPos) {
  let found = findCompositionNode(view, headPos);
  if (!found)
    return null;
  let { node: textNode, from: from2, to } = found, text2 = textNode.nodeValue;
  if (/[\n\r]/.test(text2))
    return null;
  if (view.state.doc.sliceString(found.from, found.to) != text2)
    return null;
  let inv = changes.invertedDesc;
  let range4 = new ChangedRange(inv.mapPos(from2), inv.mapPos(to), from2, to);
  let marks = [];
  for (let parent = textNode.parentNode; ; parent = parent.parentNode) {
    let parentView = ContentView.get(parent);
    if (parentView instanceof MarkView)
      marks.push({ node: parent, deco: parentView.mark });
    else if (parentView instanceof LineView || parent.nodeName == "DIV" && parent.parentNode == view.contentDOM)
      return { range: range4, text: textNode, marks, line: parent };
    else if (parent != view.contentDOM)
      marks.push({ node: parent, deco: new MarkDecoration({
        inclusive: true,
        attributes: getAttrs(parent),
        tagName: parent.tagName.toLowerCase()
      }) });
    else
      return null;
  }
}
function nearbyTextNode(startNode, startOffset, side) {
  if (side <= 0)
    for (let node56 = startNode, offset = startOffset; ; ) {
      if (node56.nodeType == 3)
        return { node: node56, offset };
      if (node56.nodeType == 1 && offset > 0) {
        node56 = node56.childNodes[offset - 1];
        offset = maxOffset(node56);
      } else {
        break;
      }
    }
  if (side >= 0)
    for (let node56 = startNode, offset = startOffset; ; ) {
      if (node56.nodeType == 3)
        return { node: node56, offset };
      if (node56.nodeType == 1 && offset < node56.childNodes.length && side >= 0) {
        node56 = node56.childNodes[offset];
        offset = 0;
      } else {
        break;
      }
    }
  return null;
}
function nextToUneditable(node56, offset) {
  if (node56.nodeType != 1)
    return 0;
  return (offset && node56.childNodes[offset - 1].contentEditable == "false" ? 1 : 0) | (offset < node56.childNodes.length && node56.childNodes[offset].contentEditable == "false" ? 2 : 0);
}
var DecorationComparator$1 = class DecorationComparator {
  constructor() {
    this.changes = [];
  }
  compareRange(from2, to) {
    addRange(from2, to, this.changes);
  }
  comparePoint(from2, to) {
    addRange(from2, to, this.changes);
  }
};
function findChangedDeco(a2, b, diff) {
  let comp = new DecorationComparator$1();
  RangeSet.compare(a2, b, diff, comp);
  return comp.changes;
}
function inUneditable(node56, inside2) {
  for (let cur2 = node56; cur2 && cur2 != inside2; cur2 = cur2.assignedSlot || cur2.parentNode) {
    if (cur2.nodeType == 1 && cur2.contentEditable == "false") {
      return true;
    }
  }
  return false;
}
function touchesComposition(changes, composition) {
  let touched = false;
  if (composition)
    changes.iterChangedRanges((from2, to) => {
      if (from2 < composition.to && to > composition.from)
        touched = true;
    });
  return touched;
}
function groupAt(state, pos, bias = 1) {
  let categorize = state.charCategorizer(pos);
  let line2 = state.doc.lineAt(pos), linePos = pos - line2.from;
  if (line2.length == 0)
    return EditorSelection.cursor(pos);
  if (linePos == 0)
    bias = 1;
  else if (linePos == line2.length)
    bias = -1;
  let from2 = linePos, to = linePos;
  if (bias < 0)
    from2 = findClusterBreak(line2.text, linePos, false);
  else
    to = findClusterBreak(line2.text, linePos);
  let cat = categorize(line2.text.slice(from2, to));
  while (from2 > 0) {
    let prev2 = findClusterBreak(line2.text, from2, false);
    if (categorize(line2.text.slice(prev2, from2)) != cat)
      break;
    from2 = prev2;
  }
  while (to < line2.length) {
    let next2 = findClusterBreak(line2.text, to);
    if (categorize(line2.text.slice(to, next2)) != cat)
      break;
    to = next2;
  }
  return EditorSelection.range(from2 + line2.from, to + line2.from);
}
function getdx(x2, rect) {
  return rect.left > x2 ? rect.left - x2 : Math.max(0, x2 - rect.right);
}
function getdy(y2, rect) {
  return rect.top > y2 ? rect.top - y2 : Math.max(0, y2 - rect.bottom);
}
function yOverlap(a2, b) {
  return a2.top < b.bottom - 1 && a2.bottom > b.top + 1;
}
function upTop(rect, top2) {
  return top2 < rect.top ? { top: top2, left: rect.left, right: rect.right, bottom: rect.bottom } : rect;
}
function upBot(rect, bottom) {
  return bottom > rect.bottom ? { top: rect.top, left: rect.left, right: rect.right, bottom } : rect;
}
function domPosAtCoords(parent, x2, y2) {
  let closest, closestRect, closestX, closestY, closestOverlap = false;
  let above, below, aboveRect, belowRect;
  for (let child = parent.firstChild; child; child = child.nextSibling) {
    let rects = clientRectsFor(child);
    for (let i2 = 0; i2 < rects.length; i2++) {
      let rect = rects[i2];
      if (closestRect && yOverlap(closestRect, rect))
        rect = upTop(upBot(rect, closestRect.bottom), closestRect.top);
      let dx = getdx(x2, rect), dy = getdy(y2, rect);
      if (dx == 0 && dy == 0)
        return child.nodeType == 3 ? domPosInText(child, x2, y2) : domPosAtCoords(child, x2, y2);
      if (!closest || closestY > dy || closestY == dy && closestX > dx) {
        closest = child;
        closestRect = rect;
        closestX = dx;
        closestY = dy;
        let side = dy ? y2 < rect.top ? -1 : 1 : dx ? x2 < rect.left ? -1 : 1 : 0;
        closestOverlap = !side || (side > 0 ? i2 < rects.length - 1 : i2 > 0);
      }
      if (dx == 0) {
        if (y2 > rect.bottom && (!aboveRect || aboveRect.bottom < rect.bottom)) {
          above = child;
          aboveRect = rect;
        } else if (y2 < rect.top && (!belowRect || belowRect.top > rect.top)) {
          below = child;
          belowRect = rect;
        }
      } else if (aboveRect && yOverlap(aboveRect, rect)) {
        aboveRect = upBot(aboveRect, rect.bottom);
      } else if (belowRect && yOverlap(belowRect, rect)) {
        belowRect = upTop(belowRect, rect.top);
      }
    }
  }
  if (aboveRect && aboveRect.bottom >= y2) {
    closest = above;
    closestRect = aboveRect;
  } else if (belowRect && belowRect.top <= y2) {
    closest = below;
    closestRect = belowRect;
  }
  if (!closest)
    return { node: parent, offset: 0 };
  let clipX = Math.max(closestRect.left, Math.min(closestRect.right, x2));
  if (closest.nodeType == 3)
    return domPosInText(closest, clipX, y2);
  if (closestOverlap && closest.contentEditable != "false")
    return domPosAtCoords(closest, clipX, y2);
  let offset = Array.prototype.indexOf.call(parent.childNodes, closest) + (x2 >= (closestRect.left + closestRect.right) / 2 ? 1 : 0);
  return { node: parent, offset };
}
function domPosInText(node56, x2, y2) {
  let len = node56.nodeValue.length;
  let closestOffset = -1, closestDY = 1e9, generalSide = 0;
  for (let i2 = 0; i2 < len; i2++) {
    let rects = textRange(node56, i2, i2 + 1).getClientRects();
    for (let j = 0; j < rects.length; j++) {
      let rect = rects[j];
      if (rect.top == rect.bottom)
        continue;
      if (!generalSide)
        generalSide = x2 - rect.left;
      let dy = (rect.top > y2 ? rect.top - y2 : y2 - rect.bottom) - 1;
      if (rect.left - 1 <= x2 && rect.right + 1 >= x2 && dy < closestDY) {
        let right = x2 >= (rect.left + rect.right) / 2, after = right;
        if (browser.chrome || browser.gecko) {
          let rectBefore = textRange(node56, i2).getBoundingClientRect();
          if (rectBefore.left == rect.right)
            after = !right;
        }
        if (dy <= 0)
          return { node: node56, offset: i2 + (after ? 1 : 0) };
        closestOffset = i2 + (after ? 1 : 0);
        closestDY = dy;
      }
    }
  }
  return { node: node56, offset: closestOffset > -1 ? closestOffset : generalSide > 0 ? node56.nodeValue.length : 0 };
}
function posAtCoords(view, coords, precise, bias = -1) {
  var _a2, _b;
  let content2 = view.contentDOM.getBoundingClientRect(), docTop = content2.top + view.viewState.paddingTop;
  let block, { docHeight } = view.viewState;
  let { x: x2, y: y2 } = coords, yOffset = y2 - docTop;
  if (yOffset < 0)
    return 0;
  if (yOffset > docHeight)
    return view.state.doc.length;
  for (let halfLine = view.viewState.heightOracle.textHeight / 2, bounced = false; ; ) {
    block = view.elementAtHeight(yOffset);
    if (block.type == BlockType.Text)
      break;
    for (; ; ) {
      yOffset = bias > 0 ? block.bottom + halfLine : block.top - halfLine;
      if (yOffset >= 0 && yOffset <= docHeight)
        break;
      if (bounced)
        return precise ? null : 0;
      bounced = true;
      bias = -bias;
    }
  }
  y2 = docTop + yOffset;
  let lineStart = block.from;
  if (lineStart < view.viewport.from)
    return view.viewport.from == 0 ? 0 : precise ? null : posAtCoordsImprecise(view, content2, block, x2, y2);
  if (lineStart > view.viewport.to)
    return view.viewport.to == view.state.doc.length ? view.state.doc.length : precise ? null : posAtCoordsImprecise(view, content2, block, x2, y2);
  let doc2 = view.dom.ownerDocument;
  let root2 = view.root.elementFromPoint ? view.root : doc2;
  let element2 = root2.elementFromPoint(x2, y2);
  if (element2 && !view.contentDOM.contains(element2))
    element2 = null;
  if (!element2) {
    x2 = Math.max(content2.left + 1, Math.min(content2.right - 1, x2));
    element2 = root2.elementFromPoint(x2, y2);
    if (element2 && !view.contentDOM.contains(element2))
      element2 = null;
  }
  let node56, offset = -1;
  if (element2 && ((_a2 = view.docView.nearest(element2)) === null || _a2 === void 0 ? void 0 : _a2.isEditable) != false) {
    if (doc2.caretPositionFromPoint) {
      let pos = doc2.caretPositionFromPoint(x2, y2);
      if (pos)
        ({ offsetNode: node56, offset } = pos);
    } else if (doc2.caretRangeFromPoint) {
      let range4 = doc2.caretRangeFromPoint(x2, y2);
      if (range4) {
        ({ startContainer: node56, startOffset: offset } = range4);
        if (!view.contentDOM.contains(node56) || browser.safari && isSuspiciousSafariCaretResult(node56, offset, x2) || browser.chrome && isSuspiciousChromeCaretResult(node56, offset, x2))
          node56 = void 0;
      }
    }
  }
  if (!node56 || !view.docView.dom.contains(node56)) {
    let line2 = LineView.find(view.docView, lineStart);
    if (!line2)
      return yOffset > block.top + block.height / 2 ? block.to : block.from;
    ({ node: node56, offset } = domPosAtCoords(line2.dom, x2, y2));
  }
  let nearest = view.docView.nearest(node56);
  if (!nearest)
    return null;
  if (nearest.isWidget && ((_b = nearest.dom) === null || _b === void 0 ? void 0 : _b.nodeType) == 1) {
    let rect = nearest.dom.getBoundingClientRect();
    return coords.y < rect.top || coords.y <= rect.bottom && coords.x <= (rect.left + rect.right) / 2 ? nearest.posAtStart : nearest.posAtEnd;
  } else {
    return nearest.localPosFromDOM(node56, offset) + nearest.posAtStart;
  }
}
function posAtCoordsImprecise(view, contentRect, block, x2, y2) {
  let into = Math.round((x2 - contentRect.left) * view.defaultCharacterWidth);
  if (view.lineWrapping && block.height > view.defaultLineHeight * 1.5) {
    let textHeight = view.viewState.heightOracle.textHeight;
    let line2 = Math.floor((y2 - block.top - (view.defaultLineHeight - textHeight) * 0.5) / textHeight);
    into += line2 * view.viewState.heightOracle.lineLength;
  }
  let content2 = view.state.sliceDoc(block.from, block.to);
  return block.from + findColumn(content2, into, view.state.tabSize);
}
function isSuspiciousSafariCaretResult(node56, offset, x2) {
  let len;
  if (node56.nodeType != 3 || offset != (len = node56.nodeValue.length))
    return false;
  for (let next2 = node56.nextSibling; next2; next2 = next2.nextSibling)
    if (next2.nodeType != 1 || next2.nodeName != "BR")
      return false;
  return textRange(node56, len - 1, len).getBoundingClientRect().left > x2;
}
function isSuspiciousChromeCaretResult(node56, offset, x2) {
  if (offset != 0)
    return false;
  for (let cur2 = node56; ; ) {
    let parent = cur2.parentNode;
    if (!parent || parent.nodeType != 1 || parent.firstChild != cur2)
      return false;
    if (parent.classList.contains("cm-line"))
      break;
    cur2 = parent;
  }
  let rect = node56.nodeType == 1 ? node56.getBoundingClientRect() : textRange(node56, 0, Math.max(node56.nodeValue.length, 1)).getBoundingClientRect();
  return x2 - rect.left > 5;
}
function blockAt(view, pos) {
  let line2 = view.lineBlockAt(pos);
  if (Array.isArray(line2.type))
    for (let l of line2.type) {
      if (l.to > pos || l.to == pos && (l.to == line2.to || l.type == BlockType.Text))
        return l;
    }
  return line2;
}
function moveToLineBoundary(view, start, forward, includeWrap) {
  let line2 = blockAt(view, start.head);
  let coords = !includeWrap || line2.type != BlockType.Text || !(view.lineWrapping || line2.widgetLineBreaks) ? null : view.coordsAtPos(start.assoc < 0 && start.head > line2.from ? start.head - 1 : start.head);
  if (coords) {
    let editorRect = view.dom.getBoundingClientRect();
    let direction = view.textDirectionAt(line2.from);
    let pos = view.posAtCoords({
      x: forward == (direction == Direction.LTR) ? editorRect.right - 1 : editorRect.left + 1,
      y: (coords.top + coords.bottom) / 2
    });
    if (pos != null)
      return EditorSelection.cursor(pos, forward ? -1 : 1);
  }
  return EditorSelection.cursor(forward ? line2.to : line2.from, forward ? -1 : 1);
}
function moveByChar(view, start, forward, by) {
  let line2 = view.state.doc.lineAt(start.head), spans = view.bidiSpans(line2);
  let direction = view.textDirectionAt(line2.from);
  for (let cur2 = start, check = null; ; ) {
    let next2 = moveVisually(line2, spans, direction, cur2, forward), char2 = movedOver;
    if (!next2) {
      if (line2.number == (forward ? view.state.doc.lines : 1))
        return cur2;
      char2 = "\n";
      line2 = view.state.doc.line(line2.number + (forward ? 1 : -1));
      spans = view.bidiSpans(line2);
      next2 = EditorSelection.cursor(forward ? line2.from : line2.to);
    }
    if (!check) {
      if (!by)
        return next2;
      check = by(char2);
    } else if (!check(char2)) {
      return cur2;
    }
    cur2 = next2;
  }
}
function byGroup(view, pos, start) {
  let categorize = view.state.charCategorizer(pos);
  let cat = categorize(start);
  return (next2) => {
    let nextCat = categorize(next2);
    if (cat == CharCategory.Space)
      cat = nextCat;
    return cat == nextCat;
  };
}
function moveVertically(view, start, forward, distance) {
  let startPos = start.head, dir = forward ? 1 : -1;
  if (startPos == (forward ? view.state.doc.length : 0))
    return EditorSelection.cursor(startPos, start.assoc);
  let goal = start.goalColumn, startY;
  let rect = view.contentDOM.getBoundingClientRect();
  let startCoords = view.coordsAtPos(startPos, start.assoc || -1), docTop = view.documentTop;
  if (startCoords) {
    if (goal == null)
      goal = startCoords.left - rect.left;
    startY = dir < 0 ? startCoords.top : startCoords.bottom;
  } else {
    let line2 = view.viewState.lineBlockAt(startPos);
    if (goal == null)
      goal = Math.min(rect.right - rect.left, view.defaultCharacterWidth * (startPos - line2.from));
    startY = (dir < 0 ? line2.top : line2.bottom) + docTop;
  }
  let resolvedGoal = rect.left + goal;
  let dist2 = distance !== null && distance !== void 0 ? distance : view.viewState.heightOracle.textHeight >> 1;
  for (let extra = 0; ; extra += 10) {
    let curY = startY + (dist2 + extra) * dir;
    let pos = posAtCoords(view, { x: resolvedGoal, y: curY }, false, dir);
    if (curY < rect.top || curY > rect.bottom || (dir < 0 ? pos < startPos : pos > startPos)) {
      let charRect = view.docView.coordsForChar(pos);
      let assoc = !charRect || curY < charRect.top ? -1 : 1;
      return EditorSelection.cursor(pos, assoc, void 0, goal);
    }
  }
}
function skipAtomicRanges(atoms, pos, bias) {
  for (; ; ) {
    let moved = 0;
    for (let set3 of atoms) {
      set3.between(pos - 1, pos + 1, (from2, to, value) => {
        if (pos > from2 && pos < to) {
          let side = moved || bias || (pos - from2 < to - pos ? -1 : 1);
          pos = side < 0 ? from2 : to;
          moved = side;
        }
      });
    }
    if (!moved)
      return pos;
  }
}
function skipAtoms(view, oldPos, pos) {
  let newPos = skipAtomicRanges(view.state.facet(atomicRanges).map((f) => f(view)), pos.from, oldPos.head > pos.from ? -1 : 1);
  return newPos == pos.from ? pos : EditorSelection.cursor(newPos, newPos < pos.from ? 1 : -1);
}
var InputState = class {
  setSelectionOrigin(origin) {
    this.lastSelectionOrigin = origin;
    this.lastSelectionTime = Date.now();
  }
  constructor(view) {
    this.view = view;
    this.lastKeyCode = 0;
    this.lastKeyTime = 0;
    this.lastTouchTime = 0;
    this.lastFocusTime = 0;
    this.lastScrollTop = 0;
    this.lastScrollLeft = 0;
    this.pendingIOSKey = void 0;
    this.lastSelectionOrigin = null;
    this.lastSelectionTime = 0;
    this.lastEscPress = 0;
    this.lastContextMenu = 0;
    this.scrollHandlers = [];
    this.handlers = /* @__PURE__ */ Object.create(null);
    this.composing = -1;
    this.compositionFirstChange = null;
    this.compositionEndedAt = 0;
    this.compositionPendingKey = false;
    this.compositionPendingChange = false;
    this.mouseSelection = null;
    this.handleEvent = this.handleEvent.bind(this);
    this.notifiedFocused = view.hasFocus;
    if (browser.safari)
      view.contentDOM.addEventListener("input", () => null);
    if (browser.gecko)
      firefoxCopyCutHack(view.contentDOM.ownerDocument);
  }
  handleEvent(event) {
    if (!eventBelongsToEditor(this.view, event) || this.ignoreDuringComposition(event))
      return;
    if (event.type == "keydown" && this.keydown(event))
      return;
    this.runHandlers(event.type, event);
  }
  runHandlers(type, event) {
    let handlers2 = this.handlers[type];
    if (handlers2) {
      for (let observer of handlers2.observers)
        observer(this.view, event);
      for (let handler of handlers2.handlers) {
        if (event.defaultPrevented)
          break;
        if (handler(this.view, event)) {
          event.preventDefault();
          break;
        }
      }
    }
  }
  ensureHandlers(plugins) {
    let handlers2 = computeHandlers(plugins), prev2 = this.handlers, dom = this.view.contentDOM;
    for (let type in handlers2)
      if (type != "scroll") {
        let passive = !handlers2[type].handlers.length;
        let exists = prev2[type];
        if (exists && passive != !exists.handlers.length) {
          dom.removeEventListener(type, this.handleEvent);
          exists = null;
        }
        if (!exists)
          dom.addEventListener(type, this.handleEvent, { passive });
      }
    for (let type in prev2)
      if (type != "scroll" && !handlers2[type])
        dom.removeEventListener(type, this.handleEvent);
    this.handlers = handlers2;
  }
  keydown(event) {
    this.lastKeyCode = event.keyCode;
    this.lastKeyTime = Date.now();
    if (event.keyCode == 9 && Date.now() < this.lastEscPress + 2e3)
      return true;
    if (event.keyCode != 27 && modifierCodes.indexOf(event.keyCode) < 0)
      this.view.inputState.lastEscPress = 0;
    if (browser.android && browser.chrome && !event.synthetic && (event.keyCode == 13 || event.keyCode == 8)) {
      this.view.observer.delayAndroidKey(event.key, event.keyCode);
      return true;
    }
    let pending;
    if (browser.ios && !event.synthetic && !event.altKey && !event.metaKey && ((pending = PendingKeys.find((key) => key.keyCode == event.keyCode)) && !event.ctrlKey || EmacsyPendingKeys.indexOf(event.key) > -1 && event.ctrlKey && !event.shiftKey)) {
      this.pendingIOSKey = pending || event;
      setTimeout(() => this.flushIOSKey(), 250);
      return true;
    }
    if (event.keyCode != 229)
      this.view.observer.forceFlush();
    return false;
  }
  flushIOSKey() {
    let key = this.pendingIOSKey;
    if (!key)
      return false;
    this.pendingIOSKey = void 0;
    return dispatchKey(this.view.contentDOM, key.key, key.keyCode);
  }
  ignoreDuringComposition(event) {
    if (!/^key/.test(event.type))
      return false;
    if (this.composing > 0)
      return true;
    if (browser.safari && !browser.ios && this.compositionPendingKey && Date.now() - this.compositionEndedAt < 100) {
      this.compositionPendingKey = false;
      return true;
    }
    return false;
  }
  startMouseSelection(mouseSelection) {
    if (this.mouseSelection)
      this.mouseSelection.destroy();
    this.mouseSelection = mouseSelection;
  }
  update(update) {
    if (this.mouseSelection)
      this.mouseSelection.update(update);
    if (update.transactions.length)
      this.lastKeyCode = this.lastSelectionTime = 0;
  }
  destroy() {
    if (this.mouseSelection)
      this.mouseSelection.destroy();
  }
};
function bindHandler(plugin, handler) {
  return (view, event) => {
    try {
      return handler.call(plugin, event, view);
    } catch (e3) {
      logException(view.state, e3);
    }
  };
}
function computeHandlers(plugins) {
  let result = /* @__PURE__ */ Object.create(null);
  function record(type) {
    return result[type] || (result[type] = { observers: [], handlers: [] });
  }
  for (let plugin of plugins) {
    let spec = plugin.spec;
    if (spec && spec.domEventHandlers)
      for (let type in spec.domEventHandlers) {
        let f = spec.domEventHandlers[type];
        if (f)
          record(type).handlers.push(bindHandler(plugin.value, f));
      }
    if (spec && spec.domEventObservers)
      for (let type in spec.domEventObservers) {
        let f = spec.domEventObservers[type];
        if (f)
          record(type).observers.push(bindHandler(plugin.value, f));
      }
  }
  for (let type in handlers)
    record(type).handlers.push(handlers[type]);
  for (let type in observers)
    record(type).observers.push(observers[type]);
  return result;
}
var PendingKeys = [
  { key: "Backspace", keyCode: 8, inputType: "deleteContentBackward" },
  { key: "Enter", keyCode: 13, inputType: "insertParagraph" },
  { key: "Enter", keyCode: 13, inputType: "insertLineBreak" },
  { key: "Delete", keyCode: 46, inputType: "deleteContentForward" }
];
var EmacsyPendingKeys = "dthko";
var modifierCodes = [16, 17, 18, 20, 91, 92, 224, 225];
var dragScrollMargin = 6;
function dragScrollSpeed(dist2) {
  return Math.max(0, dist2) * 0.7 + 8;
}
function dist(a2, b) {
  return Math.max(Math.abs(a2.clientX - b.clientX), Math.abs(a2.clientY - b.clientY));
}
var MouseSelection = class {
  constructor(view, startEvent, style, mustSelect) {
    this.view = view;
    this.startEvent = startEvent;
    this.style = style;
    this.mustSelect = mustSelect;
    this.scrollSpeed = { x: 0, y: 0 };
    this.scrolling = -1;
    this.lastEvent = startEvent;
    this.scrollParent = scrollableParent(view.contentDOM);
    this.atoms = view.state.facet(atomicRanges).map((f) => f(view));
    let doc2 = view.contentDOM.ownerDocument;
    doc2.addEventListener("mousemove", this.move = this.move.bind(this));
    doc2.addEventListener("mouseup", this.up = this.up.bind(this));
    this.extend = startEvent.shiftKey;
    this.multiple = view.state.facet(EditorState.allowMultipleSelections) && addsSelectionRange(view, startEvent);
    this.dragging = isInPrimarySelection(view, startEvent) && getClickType(startEvent) == 1 ? null : false;
  }
  start(event) {
    if (this.dragging === false)
      this.select(event);
  }
  move(event) {
    var _a2;
    if (event.buttons == 0)
      return this.destroy();
    if (this.dragging || this.dragging == null && dist(this.startEvent, event) < 10)
      return;
    this.select(this.lastEvent = event);
    let sx = 0, sy = 0;
    let rect = ((_a2 = this.scrollParent) === null || _a2 === void 0 ? void 0 : _a2.getBoundingClientRect()) || { left: 0, top: 0, right: this.view.win.innerWidth, bottom: this.view.win.innerHeight };
    let margins = getScrollMargins(this.view);
    if (event.clientX - margins.left <= rect.left + dragScrollMargin)
      sx = -dragScrollSpeed(rect.left - event.clientX);
    else if (event.clientX + margins.right >= rect.right - dragScrollMargin)
      sx = dragScrollSpeed(event.clientX - rect.right);
    if (event.clientY - margins.top <= rect.top + dragScrollMargin)
      sy = -dragScrollSpeed(rect.top - event.clientY);
    else if (event.clientY + margins.bottom >= rect.bottom - dragScrollMargin)
      sy = dragScrollSpeed(event.clientY - rect.bottom);
    this.setScrollSpeed(sx, sy);
  }
  up(event) {
    if (this.dragging == null)
      this.select(this.lastEvent);
    if (!this.dragging)
      event.preventDefault();
    this.destroy();
  }
  destroy() {
    this.setScrollSpeed(0, 0);
    let doc2 = this.view.contentDOM.ownerDocument;
    doc2.removeEventListener("mousemove", this.move);
    doc2.removeEventListener("mouseup", this.up);
    this.view.inputState.mouseSelection = null;
  }
  setScrollSpeed(sx, sy) {
    this.scrollSpeed = { x: sx, y: sy };
    if (sx || sy) {
      if (this.scrolling < 0)
        this.scrolling = setInterval(() => this.scroll(), 50);
    } else if (this.scrolling > -1) {
      clearInterval(this.scrolling);
      this.scrolling = -1;
    }
  }
  scroll() {
    if (this.scrollParent) {
      this.scrollParent.scrollLeft += this.scrollSpeed.x;
      this.scrollParent.scrollTop += this.scrollSpeed.y;
    } else {
      this.view.win.scrollBy(this.scrollSpeed.x, this.scrollSpeed.y);
    }
    if (this.dragging === false)
      this.select(this.lastEvent);
  }
  skipAtoms(sel) {
    let ranges = null;
    for (let i2 = 0; i2 < sel.ranges.length; i2++) {
      let range4 = sel.ranges[i2], updated = null;
      if (range4.empty) {
        let pos = skipAtomicRanges(this.atoms, range4.from, 0);
        if (pos != range4.from)
          updated = EditorSelection.cursor(pos, -1);
      } else {
        let from2 = skipAtomicRanges(this.atoms, range4.from, -1);
        let to = skipAtomicRanges(this.atoms, range4.to, 1);
        if (from2 != range4.from || to != range4.to)
          updated = EditorSelection.range(range4.from == range4.anchor ? from2 : to, range4.from == range4.head ? from2 : to);
      }
      if (updated) {
        if (!ranges)
          ranges = sel.ranges.slice();
        ranges[i2] = updated;
      }
    }
    return ranges ? EditorSelection.create(ranges, sel.mainIndex) : sel;
  }
  select(event) {
    let { view } = this, selection2 = this.skipAtoms(this.style.get(event, this.extend, this.multiple));
    if (this.mustSelect || !selection2.eq(view.state.selection) || selection2.main.assoc != view.state.selection.main.assoc && this.dragging === false)
      this.view.dispatch({
        selection: selection2,
        userEvent: "select.pointer"
      });
    this.mustSelect = false;
  }
  update(update) {
    if (update.docChanged && this.dragging)
      this.dragging = this.dragging.map(update.changes);
    if (this.style.update(update))
      setTimeout(() => this.select(this.lastEvent), 20);
  }
};
function addsSelectionRange(view, event) {
  let facet = view.state.facet(clickAddsSelectionRange);
  return facet.length ? facet[0](event) : browser.mac ? event.metaKey : event.ctrlKey;
}
function dragMovesSelection(view, event) {
  let facet = view.state.facet(dragMovesSelection$1);
  return facet.length ? facet[0](event) : browser.mac ? !event.altKey : !event.ctrlKey;
}
function isInPrimarySelection(view, event) {
  let { main } = view.state.selection;
  if (main.empty)
    return false;
  let sel = getSelection(view.root);
  if (!sel || sel.rangeCount == 0)
    return true;
  let rects = sel.getRangeAt(0).getClientRects();
  for (let i2 = 0; i2 < rects.length; i2++) {
    let rect = rects[i2];
    if (rect.left <= event.clientX && rect.right >= event.clientX && rect.top <= event.clientY && rect.bottom >= event.clientY)
      return true;
  }
  return false;
}
function eventBelongsToEditor(view, event) {
  if (!event.bubbles)
    return true;
  if (event.defaultPrevented)
    return false;
  for (let node56 = event.target, cView; node56 != view.contentDOM; node56 = node56.parentNode)
    if (!node56 || node56.nodeType == 11 || (cView = ContentView.get(node56)) && cView.ignoreEvent(event))
      return false;
  return true;
}
var handlers = /* @__PURE__ */ Object.create(null);
var observers = /* @__PURE__ */ Object.create(null);
var brokenClipboardAPI = browser.ie && browser.ie_version < 15 || browser.ios && browser.webkit_version < 604;
function capturePaste(view) {
  let parent = view.dom.parentNode;
  if (!parent)
    return;
  let target = parent.appendChild(document.createElement("textarea"));
  target.style.cssText = "position: fixed; left: -10000px; top: 10px";
  target.focus();
  setTimeout(() => {
    view.focus();
    target.remove();
    doPaste(view, target.value);
  }, 50);
}
function doPaste(view, input) {
  let { state } = view, changes, i2 = 1, text2 = state.toText(input);
  let byLine = text2.lines == state.selection.ranges.length;
  let linewise = lastLinewiseCopy != null && state.selection.ranges.every((r3) => r3.empty) && lastLinewiseCopy == text2.toString();
  if (linewise) {
    let lastLine = -1;
    changes = state.changeByRange((range4) => {
      let line2 = state.doc.lineAt(range4.from);
      if (line2.from == lastLine)
        return { range: range4 };
      lastLine = line2.from;
      let insert2 = state.toText((byLine ? text2.line(i2++).text : input) + state.lineBreak);
      return {
        changes: { from: line2.from, insert: insert2 },
        range: EditorSelection.cursor(range4.from + insert2.length)
      };
    });
  } else if (byLine) {
    changes = state.changeByRange((range4) => {
      let line2 = text2.line(i2++);
      return {
        changes: { from: range4.from, to: range4.to, insert: line2.text },
        range: EditorSelection.cursor(range4.from + line2.length)
      };
    });
  } else {
    changes = state.replaceSelection(text2);
  }
  view.dispatch(changes, {
    userEvent: "input.paste",
    scrollIntoView: true
  });
}
observers.scroll = (view) => {
  view.inputState.lastScrollTop = view.scrollDOM.scrollTop;
  view.inputState.lastScrollLeft = view.scrollDOM.scrollLeft;
};
handlers.keydown = (view, event) => {
  view.inputState.setSelectionOrigin("select");
  if (event.keyCode == 27)
    view.inputState.lastEscPress = Date.now();
  return false;
};
observers.touchstart = (view, e3) => {
  view.inputState.lastTouchTime = Date.now();
  view.inputState.setSelectionOrigin("select.pointer");
};
observers.touchmove = (view) => {
  view.inputState.setSelectionOrigin("select.pointer");
};
handlers.mousedown = (view, event) => {
  view.observer.flush();
  if (view.inputState.lastTouchTime > Date.now() - 2e3)
    return false;
  let style = null;
  for (let makeStyle of view.state.facet(mouseSelectionStyle)) {
    style = makeStyle(view, event);
    if (style)
      break;
  }
  if (!style && event.button == 0)
    style = basicMouseSelection(view, event);
  if (style) {
    let mustFocus = !view.hasFocus;
    view.inputState.startMouseSelection(new MouseSelection(view, event, style, mustFocus));
    if (mustFocus)
      view.observer.ignore(() => focusPreventScroll(view.contentDOM));
    let mouseSel = view.inputState.mouseSelection;
    if (mouseSel) {
      mouseSel.start(event);
      return mouseSel.dragging === false;
    }
  }
  return false;
};
function rangeForClick(view, pos, bias, type) {
  if (type == 1) {
    return EditorSelection.cursor(pos, bias);
  } else if (type == 2) {
    return groupAt(view.state, pos, bias);
  } else {
    let visual = LineView.find(view.docView, pos), line2 = view.state.doc.lineAt(visual ? visual.posAtEnd : pos);
    let from2 = visual ? visual.posAtStart : line2.from, to = visual ? visual.posAtEnd : line2.to;
    if (to < view.state.doc.length && to == line2.to)
      to++;
    return EditorSelection.range(from2, to);
  }
}
var insideY = (y2, rect) => y2 >= rect.top && y2 <= rect.bottom;
var inside = (x2, y2, rect) => insideY(y2, rect) && x2 >= rect.left && x2 <= rect.right;
function findPositionSide(view, pos, x2, y2) {
  let line2 = LineView.find(view.docView, pos);
  if (!line2)
    return 1;
  let off = pos - line2.posAtStart;
  if (off == 0)
    return 1;
  if (off == line2.length)
    return -1;
  let before = line2.coordsAt(off, -1);
  if (before && inside(x2, y2, before))
    return -1;
  let after = line2.coordsAt(off, 1);
  if (after && inside(x2, y2, after))
    return 1;
  return before && insideY(y2, before) ? -1 : 1;
}
function queryPos(view, event) {
  let pos = view.posAtCoords({ x: event.clientX, y: event.clientY }, false);
  return { pos, bias: findPositionSide(view, pos, event.clientX, event.clientY) };
}
var BadMouseDetail = browser.ie && browser.ie_version <= 11;
var lastMouseDown = null;
var lastMouseDownCount = 0;
var lastMouseDownTime = 0;
function getClickType(event) {
  if (!BadMouseDetail)
    return event.detail;
  let last = lastMouseDown, lastTime = lastMouseDownTime;
  lastMouseDown = event;
  lastMouseDownTime = Date.now();
  return lastMouseDownCount = !last || lastTime > Date.now() - 400 && Math.abs(last.clientX - event.clientX) < 2 && Math.abs(last.clientY - event.clientY) < 2 ? (lastMouseDownCount + 1) % 3 : 1;
}
function basicMouseSelection(view, event) {
  let start = queryPos(view, event), type = getClickType(event);
  let startSel = view.state.selection;
  return {
    update(update) {
      if (update.docChanged) {
        start.pos = update.changes.mapPos(start.pos);
        startSel = startSel.map(update.changes);
      }
    },
    get(event2, extend4, multiple) {
      let cur2 = queryPos(view, event2), removed;
      let range4 = rangeForClick(view, cur2.pos, cur2.bias, type);
      if (start.pos != cur2.pos && !extend4) {
        let startRange = rangeForClick(view, start.pos, start.bias, type);
        let from2 = Math.min(startRange.from, range4.from), to = Math.max(startRange.to, range4.to);
        range4 = from2 < range4.from ? EditorSelection.range(from2, to) : EditorSelection.range(to, from2);
      }
      if (extend4)
        return startSel.replaceRange(startSel.main.extend(range4.from, range4.to));
      else if (multiple && type == 1 && startSel.ranges.length > 1 && (removed = removeRangeAround(startSel, cur2.pos)))
        return removed;
      else if (multiple)
        return startSel.addRange(range4);
      else
        return EditorSelection.create([range4]);
    }
  };
}
function removeRangeAround(sel, pos) {
  for (let i2 = 0; i2 < sel.ranges.length; i2++) {
    let { from: from2, to } = sel.ranges[i2];
    if (from2 <= pos && to >= pos)
      return EditorSelection.create(sel.ranges.slice(0, i2).concat(sel.ranges.slice(i2 + 1)), sel.mainIndex == i2 ? 0 : sel.mainIndex - (sel.mainIndex > i2 ? 1 : 0));
  }
  return null;
}
handlers.dragstart = (view, event) => {
  let { selection: { main } } = view.state;
  let { mouseSelection } = view.inputState;
  if (mouseSelection)
    mouseSelection.dragging = main;
  if (event.dataTransfer) {
    event.dataTransfer.setData("Text", view.state.sliceDoc(main.from, main.to));
    event.dataTransfer.effectAllowed = "copyMove";
  }
  return false;
};
function dropText(view, event, text2, direct) {
  if (!text2)
    return;
  let dropPos = view.posAtCoords({ x: event.clientX, y: event.clientY }, false);
  let { mouseSelection } = view.inputState;
  let del = direct && mouseSelection && mouseSelection.dragging && dragMovesSelection(view, event) ? { from: mouseSelection.dragging.from, to: mouseSelection.dragging.to } : null;
  let ins = { from: dropPos, insert: text2 };
  let changes = view.state.changes(del ? [del, ins] : ins);
  view.focus();
  view.dispatch({
    changes,
    selection: { anchor: changes.mapPos(dropPos, -1), head: changes.mapPos(dropPos, 1) },
    userEvent: del ? "move.drop" : "input.drop"
  });
}
handlers.drop = (view, event) => {
  if (!event.dataTransfer)
    return false;
  if (view.state.readOnly)
    return true;
  let files = event.dataTransfer.files;
  if (files && files.length) {
    let text2 = Array(files.length), read = 0;
    let finishFile = () => {
      if (++read == files.length)
        dropText(view, event, text2.filter((s2) => s2 != null).join(view.state.lineBreak), false);
    };
    for (let i2 = 0; i2 < files.length; i2++) {
      let reader = new FileReader();
      reader.onerror = finishFile;
      reader.onload = () => {
        if (!/[\x00-\x08\x0e-\x1f]{2}/.test(reader.result))
          text2[i2] = reader.result;
        finishFile();
      };
      reader.readAsText(files[i2]);
    }
    return true;
  } else {
    let text2 = event.dataTransfer.getData("Text");
    if (text2) {
      dropText(view, event, text2, true);
      return true;
    }
  }
  return false;
};
handlers.paste = (view, event) => {
  if (view.state.readOnly)
    return true;
  view.observer.flush();
  let data = brokenClipboardAPI ? null : event.clipboardData;
  if (data) {
    doPaste(view, data.getData("text/plain") || data.getData("text/uri-text"));
    return true;
  } else {
    capturePaste(view);
    return false;
  }
};
function captureCopy(view, text2) {
  let parent = view.dom.parentNode;
  if (!parent)
    return;
  let target = parent.appendChild(document.createElement("textarea"));
  target.style.cssText = "position: fixed; left: -10000px; top: 10px";
  target.value = text2;
  target.focus();
  target.selectionEnd = text2.length;
  target.selectionStart = 0;
  setTimeout(() => {
    target.remove();
    view.focus();
  }, 50);
}
function copiedRange(state) {
  let content2 = [], ranges = [], linewise = false;
  for (let range4 of state.selection.ranges)
    if (!range4.empty) {
      content2.push(state.sliceDoc(range4.from, range4.to));
      ranges.push(range4);
    }
  if (!content2.length) {
    let upto = -1;
    for (let { from: from2 } of state.selection.ranges) {
      let line2 = state.doc.lineAt(from2);
      if (line2.number > upto) {
        content2.push(line2.text);
        ranges.push({ from: line2.from, to: Math.min(state.doc.length, line2.to + 1) });
      }
      upto = line2.number;
    }
    linewise = true;
  }
  return { text: content2.join(state.lineBreak), ranges, linewise };
}
var lastLinewiseCopy = null;
handlers.copy = handlers.cut = (view, event) => {
  let { text: text2, ranges, linewise } = copiedRange(view.state);
  if (!text2 && !linewise)
    return false;
  lastLinewiseCopy = linewise ? text2 : null;
  if (event.type == "cut" && !view.state.readOnly)
    view.dispatch({
      changes: ranges,
      scrollIntoView: true,
      userEvent: "delete.cut"
    });
  let data = brokenClipboardAPI ? null : event.clipboardData;
  if (data) {
    data.clearData();
    data.setData("text/plain", text2);
    return true;
  } else {
    captureCopy(view, text2);
    return false;
  }
};
var isFocusChange = /* @__PURE__ */ Annotation.define();
function focusChangeTransaction(state, focus) {
  let effects = [];
  for (let getEffect of state.facet(focusChangeEffect)) {
    let effect = getEffect(state, focus);
    if (effect)
      effects.push(effect);
  }
  return effects ? state.update({ effects, annotations: isFocusChange.of(true) }) : null;
}
function updateForFocusChange(view) {
  setTimeout(() => {
    let focus = view.hasFocus;
    if (focus != view.inputState.notifiedFocused) {
      let tr = focusChangeTransaction(view.state, focus);
      if (tr)
        view.dispatch(tr);
      else
        view.update([]);
    }
  }, 10);
}
observers.focus = (view) => {
  view.inputState.lastFocusTime = Date.now();
  if (!view.scrollDOM.scrollTop && (view.inputState.lastScrollTop || view.inputState.lastScrollLeft)) {
    view.scrollDOM.scrollTop = view.inputState.lastScrollTop;
    view.scrollDOM.scrollLeft = view.inputState.lastScrollLeft;
  }
  updateForFocusChange(view);
};
observers.blur = (view) => {
  view.observer.clearSelectionRange();
  updateForFocusChange(view);
};
observers.compositionstart = observers.compositionupdate = (view) => {
  if (view.inputState.compositionFirstChange == null)
    view.inputState.compositionFirstChange = true;
  if (view.inputState.composing < 0) {
    view.inputState.composing = 0;
  }
};
observers.compositionend = (view) => {
  view.inputState.composing = -1;
  view.inputState.compositionEndedAt = Date.now();
  view.inputState.compositionPendingKey = true;
  view.inputState.compositionPendingChange = view.observer.pendingRecords().length > 0;
  view.inputState.compositionFirstChange = null;
  if (browser.chrome && browser.android) {
    view.observer.flushSoon();
  } else if (view.inputState.compositionPendingChange) {
    Promise.resolve().then(() => view.observer.flush());
  } else {
    setTimeout(() => {
      if (view.inputState.composing < 0 && view.docView.hasComposition)
        view.update([]);
    }, 50);
  }
};
observers.contextmenu = (view) => {
  view.inputState.lastContextMenu = Date.now();
};
handlers.beforeinput = (view, event) => {
  var _a2;
  let pending;
  if (browser.chrome && browser.android && (pending = PendingKeys.find((key) => key.inputType == event.inputType))) {
    view.observer.delayAndroidKey(pending.key, pending.keyCode);
    if (pending.key == "Backspace" || pending.key == "Delete") {
      let startViewHeight = ((_a2 = window.visualViewport) === null || _a2 === void 0 ? void 0 : _a2.height) || 0;
      setTimeout(() => {
        var _a3;
        if ((((_a3 = window.visualViewport) === null || _a3 === void 0 ? void 0 : _a3.height) || 0) > startViewHeight + 10 && view.hasFocus) {
          view.contentDOM.blur();
          view.focus();
        }
      }, 100);
    }
  }
  return false;
};
var appliedFirefoxHack = /* @__PURE__ */ new Set();
function firefoxCopyCutHack(doc2) {
  if (!appliedFirefoxHack.has(doc2)) {
    appliedFirefoxHack.add(doc2);
    doc2.addEventListener("copy", () => {
    });
    doc2.addEventListener("cut", () => {
    });
  }
}
var wrappingWhiteSpace = ["pre-wrap", "normal", "pre-line", "break-spaces"];
var HeightOracle = class {
  constructor(lineWrapping) {
    this.lineWrapping = lineWrapping;
    this.doc = Text2.empty;
    this.heightSamples = {};
    this.lineHeight = 14;
    this.charWidth = 7;
    this.textHeight = 14;
    this.lineLength = 30;
    this.heightChanged = false;
  }
  heightForGap(from2, to) {
    let lines = this.doc.lineAt(to).number - this.doc.lineAt(from2).number + 1;
    if (this.lineWrapping)
      lines += Math.max(0, Math.ceil((to - from2 - lines * this.lineLength * 0.5) / this.lineLength));
    return this.lineHeight * lines;
  }
  heightForLine(length2) {
    if (!this.lineWrapping)
      return this.lineHeight;
    let lines = 1 + Math.max(0, Math.ceil((length2 - this.lineLength) / (this.lineLength - 5)));
    return lines * this.lineHeight;
  }
  setDoc(doc2) {
    this.doc = doc2;
    return this;
  }
  mustRefreshForWrapping(whiteSpace) {
    return wrappingWhiteSpace.indexOf(whiteSpace) > -1 != this.lineWrapping;
  }
  mustRefreshForHeights(lineHeights) {
    let newHeight = false;
    for (let i2 = 0; i2 < lineHeights.length; i2++) {
      let h = lineHeights[i2];
      if (h < 0) {
        i2++;
      } else if (!this.heightSamples[Math.floor(h * 10)]) {
        newHeight = true;
        this.heightSamples[Math.floor(h * 10)] = true;
      }
    }
    return newHeight;
  }
  refresh(whiteSpace, lineHeight, charWidth, textHeight, lineLength, knownHeights) {
    let lineWrapping = wrappingWhiteSpace.indexOf(whiteSpace) > -1;
    let changed = Math.round(lineHeight) != Math.round(this.lineHeight) || this.lineWrapping != lineWrapping;
    this.lineWrapping = lineWrapping;
    this.lineHeight = lineHeight;
    this.charWidth = charWidth;
    this.textHeight = textHeight;
    this.lineLength = lineLength;
    if (changed) {
      this.heightSamples = {};
      for (let i2 = 0; i2 < knownHeights.length; i2++) {
        let h = knownHeights[i2];
        if (h < 0)
          i2++;
        else
          this.heightSamples[Math.floor(h * 10)] = true;
      }
    }
    return changed;
  }
};
var MeasuredHeights = class {
  constructor(from2, heights) {
    this.from = from2;
    this.heights = heights;
    this.index = 0;
  }
  get more() {
    return this.index < this.heights.length;
  }
};
var BlockInfo = class _BlockInfo {
  /**
  @internal
  */
  constructor(from2, length2, top2, height, _content) {
    this.from = from2;
    this.length = length2;
    this.top = top2;
    this.height = height;
    this._content = _content;
  }
  /**
  The type of element this is. When querying lines, this may be
  an array of all the blocks that make up the line.
  */
  get type() {
    return typeof this._content == "number" ? BlockType.Text : Array.isArray(this._content) ? this._content : this._content.type;
  }
  /**
  The end of the element as a document position.
  */
  get to() {
    return this.from + this.length;
  }
  /**
  The bottom position of the element.
  */
  get bottom() {
    return this.top + this.height;
  }
  /**
  If this is a widget block, this will return the widget
  associated with it.
  */
  get widget() {
    return this._content instanceof PointDecoration ? this._content.widget : null;
  }
  /**
  If this is a textblock, this holds the number of line breaks
  that appear in widgets inside the block.
  */
  get widgetLineBreaks() {
    return typeof this._content == "number" ? this._content : 0;
  }
  /**
  @internal
  */
  join(other) {
    let content2 = (Array.isArray(this._content) ? this._content : [this]).concat(Array.isArray(other._content) ? other._content : [other]);
    return new _BlockInfo(this.from, this.length + other.length, this.top, this.height + other.height, content2);
  }
};
var QueryType = /* @__PURE__ */ function(QueryType3) {
  QueryType3[QueryType3["ByPos"] = 0] = "ByPos";
  QueryType3[QueryType3["ByHeight"] = 1] = "ByHeight";
  QueryType3[QueryType3["ByPosNoHeight"] = 2] = "ByPosNoHeight";
  return QueryType3;
}(QueryType || (QueryType = {}));
var Epsilon = 1e-3;
var HeightMap = class _HeightMap {
  constructor(length2, height, flags = 2) {
    this.length = length2;
    this.height = height;
    this.flags = flags;
  }
  get outdated() {
    return (this.flags & 2) > 0;
  }
  set outdated(value) {
    this.flags = (value ? 2 : 0) | this.flags & ~2;
  }
  setHeight(oracle, height) {
    if (this.height != height) {
      if (Math.abs(this.height - height) > Epsilon)
        oracle.heightChanged = true;
      this.height = height;
    }
  }
  // Base case is to replace a leaf node, which simply builds a tree
  // from the new nodes and returns that (HeightMapBranch and
  // HeightMapGap override this to actually use from/to)
  replace(_from, _to, nodes) {
    return _HeightMap.of(nodes);
  }
  // Again, these are base cases, and are overridden for branch and gap nodes.
  decomposeLeft(_to, result) {
    result.push(this);
  }
  decomposeRight(_from, result) {
    result.push(this);
  }
  applyChanges(decorations2, oldDoc, oracle, changes) {
    let me = this, doc2 = oracle.doc;
    for (let i2 = changes.length - 1; i2 >= 0; i2--) {
      let { fromA, toA, fromB, toB } = changes[i2];
      let start = me.lineAt(fromA, QueryType.ByPosNoHeight, oracle.setDoc(oldDoc), 0, 0);
      let end = start.to >= toA ? start : me.lineAt(toA, QueryType.ByPosNoHeight, oracle, 0, 0);
      toB += end.to - toA;
      toA = end.to;
      while (i2 > 0 && start.from <= changes[i2 - 1].toA) {
        fromA = changes[i2 - 1].fromA;
        fromB = changes[i2 - 1].fromB;
        i2--;
        if (fromA < start.from)
          start = me.lineAt(fromA, QueryType.ByPosNoHeight, oracle, 0, 0);
      }
      fromB += start.from - fromA;
      fromA = start.from;
      let nodes = NodeBuilder.build(oracle.setDoc(doc2), decorations2, fromB, toB);
      me = me.replace(fromA, toA, nodes);
    }
    return me.updateHeight(oracle, 0);
  }
  static empty() {
    return new HeightMapText(0, 0);
  }
  // nodes uses null values to indicate the position of line breaks.
  // There are never line breaks at the start or end of the array, or
  // two line breaks next to each other, and the array isn't allowed
  // to be empty (same restrictions as return value from the builder).
  static of(nodes) {
    if (nodes.length == 1)
      return nodes[0];
    let i2 = 0, j = nodes.length, before = 0, after = 0;
    for (; ; ) {
      if (i2 == j) {
        if (before > after * 2) {
          let split = nodes[i2 - 1];
          if (split.break)
            nodes.splice(--i2, 1, split.left, null, split.right);
          else
            nodes.splice(--i2, 1, split.left, split.right);
          j += 1 + split.break;
          before -= split.size;
        } else if (after > before * 2) {
          let split = nodes[j];
          if (split.break)
            nodes.splice(j, 1, split.left, null, split.right);
          else
            nodes.splice(j, 1, split.left, split.right);
          j += 2 + split.break;
          after -= split.size;
        } else {
          break;
        }
      } else if (before < after) {
        let next2 = nodes[i2++];
        if (next2)
          before += next2.size;
      } else {
        let next2 = nodes[--j];
        if (next2)
          after += next2.size;
      }
    }
    let brk = 0;
    if (nodes[i2 - 1] == null) {
      brk = 1;
      i2--;
    } else if (nodes[i2] == null) {
      brk = 1;
      j++;
    }
    return new HeightMapBranch(_HeightMap.of(nodes.slice(0, i2)), brk, _HeightMap.of(nodes.slice(j)));
  }
};
HeightMap.prototype.size = 1;
var HeightMapBlock = class extends HeightMap {
  constructor(length2, height, deco) {
    super(length2, height);
    this.deco = deco;
  }
  blockAt(_height, _oracle, top2, offset) {
    return new BlockInfo(offset, this.length, top2, this.height, this.deco || 0);
  }
  lineAt(_value, _type, oracle, top2, offset) {
    return this.blockAt(0, oracle, top2, offset);
  }
  forEachLine(from2, to, oracle, top2, offset, f) {
    if (from2 <= offset + this.length && to >= offset)
      f(this.blockAt(0, oracle, top2, offset));
  }
  updateHeight(oracle, offset = 0, _force = false, measured) {
    if (measured && measured.from <= offset && measured.more)
      this.setHeight(oracle, measured.heights[measured.index++]);
    this.outdated = false;
    return this;
  }
  toString() {
    return `block(${this.length})`;
  }
};
var HeightMapText = class _HeightMapText extends HeightMapBlock {
  constructor(length2, height) {
    super(length2, height, null);
    this.collapsed = 0;
    this.widgetHeight = 0;
    this.breaks = 0;
  }
  blockAt(_height, _oracle, top2, offset) {
    return new BlockInfo(offset, this.length, top2, this.height, this.breaks);
  }
  replace(_from, _to, nodes) {
    let node56 = nodes[0];
    if (nodes.length == 1 && (node56 instanceof _HeightMapText || node56 instanceof HeightMapGap && node56.flags & 4) && Math.abs(this.length - node56.length) < 10) {
      if (node56 instanceof HeightMapGap)
        node56 = new _HeightMapText(node56.length, this.height);
      else
        node56.height = this.height;
      if (!this.outdated)
        node56.outdated = false;
      return node56;
    } else {
      return HeightMap.of(nodes);
    }
  }
  updateHeight(oracle, offset = 0, force = false, measured) {
    if (measured && measured.from <= offset && measured.more)
      this.setHeight(oracle, measured.heights[measured.index++]);
    else if (force || this.outdated)
      this.setHeight(oracle, Math.max(this.widgetHeight, oracle.heightForLine(this.length - this.collapsed)) + this.breaks * oracle.lineHeight);
    this.outdated = false;
    return this;
  }
  toString() {
    return `line(${this.length}${this.collapsed ? -this.collapsed : ""}${this.widgetHeight ? ":" + this.widgetHeight : ""})`;
  }
};
var HeightMapGap = class _HeightMapGap extends HeightMap {
  constructor(length2) {
    super(length2, 0);
  }
  heightMetrics(oracle, offset) {
    let firstLine = oracle.doc.lineAt(offset).number, lastLine = oracle.doc.lineAt(offset + this.length).number;
    let lines = lastLine - firstLine + 1;
    let perLine, perChar = 0;
    if (oracle.lineWrapping) {
      let totalPerLine = Math.min(this.height, oracle.lineHeight * lines);
      perLine = totalPerLine / lines;
      if (this.length > lines + 1)
        perChar = (this.height - totalPerLine) / (this.length - lines - 1);
    } else {
      perLine = this.height / lines;
    }
    return { firstLine, lastLine, perLine, perChar };
  }
  blockAt(height, oracle, top2, offset) {
    let { firstLine, lastLine, perLine, perChar } = this.heightMetrics(oracle, offset);
    if (oracle.lineWrapping) {
      let guess = offset + Math.round(Math.max(0, Math.min(1, (height - top2) / this.height)) * this.length);
      let line2 = oracle.doc.lineAt(guess), lineHeight = perLine + line2.length * perChar;
      let lineTop = Math.max(top2, height - lineHeight / 2);
      return new BlockInfo(line2.from, line2.length, lineTop, lineHeight, 0);
    } else {
      let line2 = Math.max(0, Math.min(lastLine - firstLine, Math.floor((height - top2) / perLine)));
      let { from: from2, length: length2 } = oracle.doc.line(firstLine + line2);
      return new BlockInfo(from2, length2, top2 + perLine * line2, perLine, 0);
    }
  }
  lineAt(value, type, oracle, top2, offset) {
    if (type == QueryType.ByHeight)
      return this.blockAt(value, oracle, top2, offset);
    if (type == QueryType.ByPosNoHeight) {
      let { from: from2, to } = oracle.doc.lineAt(value);
      return new BlockInfo(from2, to - from2, 0, 0, 0);
    }
    let { firstLine, perLine, perChar } = this.heightMetrics(oracle, offset);
    let line2 = oracle.doc.lineAt(value), lineHeight = perLine + line2.length * perChar;
    let linesAbove = line2.number - firstLine;
    let lineTop = top2 + perLine * linesAbove + perChar * (line2.from - offset - linesAbove);
    return new BlockInfo(line2.from, line2.length, Math.max(top2, Math.min(lineTop, top2 + this.height - lineHeight)), lineHeight, 0);
  }
  forEachLine(from2, to, oracle, top2, offset, f) {
    from2 = Math.max(from2, offset);
    to = Math.min(to, offset + this.length);
    let { firstLine, perLine, perChar } = this.heightMetrics(oracle, offset);
    for (let pos = from2, lineTop = top2; pos <= to; ) {
      let line2 = oracle.doc.lineAt(pos);
      if (pos == from2) {
        let linesAbove = line2.number - firstLine;
        lineTop += perLine * linesAbove + perChar * (from2 - offset - linesAbove);
      }
      let lineHeight = perLine + perChar * line2.length;
      f(new BlockInfo(line2.from, line2.length, lineTop, lineHeight, 0));
      lineTop += lineHeight;
      pos = line2.to + 1;
    }
  }
  replace(from2, to, nodes) {
    let after = this.length - to;
    if (after > 0) {
      let last = nodes[nodes.length - 1];
      if (last instanceof _HeightMapGap)
        nodes[nodes.length - 1] = new _HeightMapGap(last.length + after);
      else
        nodes.push(null, new _HeightMapGap(after - 1));
    }
    if (from2 > 0) {
      let first = nodes[0];
      if (first instanceof _HeightMapGap)
        nodes[0] = new _HeightMapGap(from2 + first.length);
      else
        nodes.unshift(new _HeightMapGap(from2 - 1), null);
    }
    return HeightMap.of(nodes);
  }
  decomposeLeft(to, result) {
    result.push(new _HeightMapGap(to - 1), null);
  }
  decomposeRight(from2, result) {
    result.push(null, new _HeightMapGap(this.length - from2 - 1));
  }
  updateHeight(oracle, offset = 0, force = false, measured) {
    let end = offset + this.length;
    if (measured && measured.from <= offset + this.length && measured.more) {
      let nodes = [], pos = Math.max(offset, measured.from), singleHeight = -1;
      if (measured.from > offset)
        nodes.push(new _HeightMapGap(measured.from - offset - 1).updateHeight(oracle, offset));
      while (pos <= end && measured.more) {
        let len = oracle.doc.lineAt(pos).length;
        if (nodes.length)
          nodes.push(null);
        let height = measured.heights[measured.index++];
        if (singleHeight == -1)
          singleHeight = height;
        else if (Math.abs(height - singleHeight) >= Epsilon)
          singleHeight = -2;
        let line2 = new HeightMapText(len, height);
        line2.outdated = false;
        nodes.push(line2);
        pos += len + 1;
      }
      if (pos <= end)
        nodes.push(null, new _HeightMapGap(end - pos).updateHeight(oracle, pos));
      let result = HeightMap.of(nodes);
      if (singleHeight < 0 || Math.abs(result.height - this.height) >= Epsilon || Math.abs(singleHeight - this.heightMetrics(oracle, offset).perLine) >= Epsilon)
        oracle.heightChanged = true;
      return result;
    } else if (force || this.outdated) {
      this.setHeight(oracle, oracle.heightForGap(offset, offset + this.length));
      this.outdated = false;
    }
    return this;
  }
  toString() {
    return `gap(${this.length})`;
  }
};
var HeightMapBranch = class extends HeightMap {
  constructor(left, brk, right) {
    super(left.length + brk + right.length, left.height + right.height, brk | (left.outdated || right.outdated ? 2 : 0));
    this.left = left;
    this.right = right;
    this.size = left.size + right.size;
  }
  get break() {
    return this.flags & 1;
  }
  blockAt(height, oracle, top2, offset) {
    let mid = top2 + this.left.height;
    return height < mid ? this.left.blockAt(height, oracle, top2, offset) : this.right.blockAt(height, oracle, mid, offset + this.left.length + this.break);
  }
  lineAt(value, type, oracle, top2, offset) {
    let rightTop = top2 + this.left.height, rightOffset = offset + this.left.length + this.break;
    let left = type == QueryType.ByHeight ? value < rightTop : value < rightOffset;
    let base2 = left ? this.left.lineAt(value, type, oracle, top2, offset) : this.right.lineAt(value, type, oracle, rightTop, rightOffset);
    if (this.break || (left ? base2.to < rightOffset : base2.from > rightOffset))
      return base2;
    let subQuery = type == QueryType.ByPosNoHeight ? QueryType.ByPosNoHeight : QueryType.ByPos;
    if (left)
      return base2.join(this.right.lineAt(rightOffset, subQuery, oracle, rightTop, rightOffset));
    else
      return this.left.lineAt(rightOffset, subQuery, oracle, top2, offset).join(base2);
  }
  forEachLine(from2, to, oracle, top2, offset, f) {
    let rightTop = top2 + this.left.height, rightOffset = offset + this.left.length + this.break;
    if (this.break) {
      if (from2 < rightOffset)
        this.left.forEachLine(from2, to, oracle, top2, offset, f);
      if (to >= rightOffset)
        this.right.forEachLine(from2, to, oracle, rightTop, rightOffset, f);
    } else {
      let mid = this.lineAt(rightOffset, QueryType.ByPos, oracle, top2, offset);
      if (from2 < mid.from)
        this.left.forEachLine(from2, mid.from - 1, oracle, top2, offset, f);
      if (mid.to >= from2 && mid.from <= to)
        f(mid);
      if (to > mid.to)
        this.right.forEachLine(mid.to + 1, to, oracle, rightTop, rightOffset, f);
    }
  }
  replace(from2, to, nodes) {
    let rightStart = this.left.length + this.break;
    if (to < rightStart)
      return this.balanced(this.left.replace(from2, to, nodes), this.right);
    if (from2 > this.left.length)
      return this.balanced(this.left, this.right.replace(from2 - rightStart, to - rightStart, nodes));
    let result = [];
    if (from2 > 0)
      this.decomposeLeft(from2, result);
    let left = result.length;
    for (let node56 of nodes)
      result.push(node56);
    if (from2 > 0)
      mergeGaps(result, left - 1);
    if (to < this.length) {
      let right = result.length;
      this.decomposeRight(to, result);
      mergeGaps(result, right);
    }
    return HeightMap.of(result);
  }
  decomposeLeft(to, result) {
    let left = this.left.length;
    if (to <= left)
      return this.left.decomposeLeft(to, result);
    result.push(this.left);
    if (this.break) {
      left++;
      if (to >= left)
        result.push(null);
    }
    if (to > left)
      this.right.decomposeLeft(to - left, result);
  }
  decomposeRight(from2, result) {
    let left = this.left.length, right = left + this.break;
    if (from2 >= right)
      return this.right.decomposeRight(from2 - right, result);
    if (from2 < left)
      this.left.decomposeRight(from2, result);
    if (this.break && from2 < right)
      result.push(null);
    result.push(this.right);
  }
  balanced(left, right) {
    if (left.size > 2 * right.size || right.size > 2 * left.size)
      return HeightMap.of(this.break ? [left, null, right] : [left, right]);
    this.left = left;
    this.right = right;
    this.height = left.height + right.height;
    this.outdated = left.outdated || right.outdated;
    this.size = left.size + right.size;
    this.length = left.length + this.break + right.length;
    return this;
  }
  updateHeight(oracle, offset = 0, force = false, measured) {
    let { left, right } = this, rightStart = offset + left.length + this.break, rebalance = null;
    if (measured && measured.from <= offset + left.length && measured.more)
      rebalance = left = left.updateHeight(oracle, offset, force, measured);
    else
      left.updateHeight(oracle, offset, force);
    if (measured && measured.from <= rightStart + right.length && measured.more)
      rebalance = right = right.updateHeight(oracle, rightStart, force, measured);
    else
      right.updateHeight(oracle, rightStart, force);
    if (rebalance)
      return this.balanced(left, right);
    this.height = this.left.height + this.right.height;
    this.outdated = false;
    return this;
  }
  toString() {
    return this.left + (this.break ? " " : "-") + this.right;
  }
};
function mergeGaps(nodes, around) {
  let before, after;
  if (nodes[around] == null && (before = nodes[around - 1]) instanceof HeightMapGap && (after = nodes[around + 1]) instanceof HeightMapGap)
    nodes.splice(around - 1, 3, new HeightMapGap(before.length + 1 + after.length));
}
var relevantWidgetHeight = 5;
var NodeBuilder = class _NodeBuilder {
  constructor(pos, oracle) {
    this.pos = pos;
    this.oracle = oracle;
    this.nodes = [];
    this.lineStart = -1;
    this.lineEnd = -1;
    this.covering = null;
    this.writtenTo = pos;
  }
  get isCovered() {
    return this.covering && this.nodes[this.nodes.length - 1] == this.covering;
  }
  span(_from, to) {
    if (this.lineStart > -1) {
      let end = Math.min(to, this.lineEnd), last = this.nodes[this.nodes.length - 1];
      if (last instanceof HeightMapText)
        last.length += end - this.pos;
      else if (end > this.pos || !this.isCovered)
        this.nodes.push(new HeightMapText(end - this.pos, -1));
      this.writtenTo = end;
      if (to > end) {
        this.nodes.push(null);
        this.writtenTo++;
        this.lineStart = -1;
      }
    }
    this.pos = to;
  }
  point(from2, to, deco) {
    if (from2 < to || deco.heightRelevant) {
      let height = deco.widget ? deco.widget.estimatedHeight : 0;
      let breaks = deco.widget ? deco.widget.lineBreaks : 0;
      if (height < 0)
        height = this.oracle.lineHeight;
      let len = to - from2;
      if (deco.block) {
        this.addBlock(new HeightMapBlock(len, height, deco));
      } else if (len || breaks || height >= relevantWidgetHeight) {
        this.addLineDeco(height, breaks, len);
      }
    } else if (to > from2) {
      this.span(from2, to);
    }
    if (this.lineEnd > -1 && this.lineEnd < this.pos)
      this.lineEnd = this.oracle.doc.lineAt(this.pos).to;
  }
  enterLine() {
    if (this.lineStart > -1)
      return;
    let { from: from2, to } = this.oracle.doc.lineAt(this.pos);
    this.lineStart = from2;
    this.lineEnd = to;
    if (this.writtenTo < from2) {
      if (this.writtenTo < from2 - 1 || this.nodes[this.nodes.length - 1] == null)
        this.nodes.push(this.blankContent(this.writtenTo, from2 - 1));
      this.nodes.push(null);
    }
    if (this.pos > from2)
      this.nodes.push(new HeightMapText(this.pos - from2, -1));
    this.writtenTo = this.pos;
  }
  blankContent(from2, to) {
    let gap = new HeightMapGap(to - from2);
    if (this.oracle.doc.lineAt(from2).to == to)
      gap.flags |= 4;
    return gap;
  }
  ensureLine() {
    this.enterLine();
    let last = this.nodes.length ? this.nodes[this.nodes.length - 1] : null;
    if (last instanceof HeightMapText)
      return last;
    let line2 = new HeightMapText(0, -1);
    this.nodes.push(line2);
    return line2;
  }
  addBlock(block) {
    this.enterLine();
    let deco = block.deco;
    if (deco && deco.startSide > 0 && !this.isCovered)
      this.ensureLine();
    this.nodes.push(block);
    this.writtenTo = this.pos = this.pos + block.length;
    if (deco && deco.endSide > 0)
      this.covering = block;
  }
  addLineDeco(height, breaks, length2) {
    let line2 = this.ensureLine();
    line2.length += length2;
    line2.collapsed += length2;
    line2.widgetHeight = Math.max(line2.widgetHeight, height);
    line2.breaks += breaks;
    this.writtenTo = this.pos = this.pos + length2;
  }
  finish(from2) {
    let last = this.nodes.length == 0 ? null : this.nodes[this.nodes.length - 1];
    if (this.lineStart > -1 && !(last instanceof HeightMapText) && !this.isCovered)
      this.nodes.push(new HeightMapText(0, -1));
    else if (this.writtenTo < this.pos || last == null)
      this.nodes.push(this.blankContent(this.writtenTo, this.pos));
    let pos = from2;
    for (let node56 of this.nodes) {
      if (node56 instanceof HeightMapText)
        node56.updateHeight(this.oracle, pos);
      pos += node56 ? node56.length : 1;
    }
    return this.nodes;
  }
  // Always called with a region that on both sides either stretches
  // to a line break or the end of the document.
  // The returned array uses null to indicate line breaks, but never
  // starts or ends in a line break, or has multiple line breaks next
  // to each other.
  static build(oracle, decorations2, from2, to) {
    let builder = new _NodeBuilder(from2, oracle);
    RangeSet.spans(decorations2, from2, to, builder, 0);
    return builder.finish(from2);
  }
};
function heightRelevantDecoChanges(a2, b, diff) {
  let comp = new DecorationComparator2();
  RangeSet.compare(a2, b, diff, comp, 0);
  return comp.changes;
}
var DecorationComparator2 = class {
  constructor() {
    this.changes = [];
  }
  compareRange() {
  }
  comparePoint(from2, to, a2, b) {
    if (from2 < to || a2 && a2.heightRelevant || b && b.heightRelevant)
      addRange(from2, to, this.changes, 5);
  }
};
function visiblePixelRange(dom, paddingTop) {
  let rect = dom.getBoundingClientRect();
  let doc2 = dom.ownerDocument, win = doc2.defaultView || window;
  let left = Math.max(0, rect.left), right = Math.min(win.innerWidth, rect.right);
  let top2 = Math.max(0, rect.top), bottom = Math.min(win.innerHeight, rect.bottom);
  for (let parent = dom.parentNode; parent && parent != doc2.body; ) {
    if (parent.nodeType == 1) {
      let elt = parent;
      let style = window.getComputedStyle(elt);
      if ((elt.scrollHeight > elt.clientHeight || elt.scrollWidth > elt.clientWidth) && style.overflow != "visible") {
        let parentRect = elt.getBoundingClientRect();
        left = Math.max(left, parentRect.left);
        right = Math.min(right, parentRect.right);
        top2 = Math.max(top2, parentRect.top);
        bottom = parent == dom.parentNode ? parentRect.bottom : Math.min(bottom, parentRect.bottom);
      }
      parent = style.position == "absolute" || style.position == "fixed" ? elt.offsetParent : elt.parentNode;
    } else if (parent.nodeType == 11) {
      parent = parent.host;
    } else {
      break;
    }
  }
  return {
    left: left - rect.left,
    right: Math.max(left, right) - rect.left,
    top: top2 - (rect.top + paddingTop),
    bottom: Math.max(top2, bottom) - (rect.top + paddingTop)
  };
}
function fullPixelRange(dom, paddingTop) {
  let rect = dom.getBoundingClientRect();
  return {
    left: 0,
    right: rect.right - rect.left,
    top: paddingTop,
    bottom: rect.bottom - (rect.top + paddingTop)
  };
}
var LineGap = class {
  constructor(from2, to, size) {
    this.from = from2;
    this.to = to;
    this.size = size;
  }
  static same(a2, b) {
    if (a2.length != b.length)
      return false;
    for (let i2 = 0; i2 < a2.length; i2++) {
      let gA = a2[i2], gB = b[i2];
      if (gA.from != gB.from || gA.to != gB.to || gA.size != gB.size)
        return false;
    }
    return true;
  }
  draw(viewState, wrapping) {
    return Decoration.replace({
      widget: new LineGapWidget(this.size * (wrapping ? viewState.scaleY : viewState.scaleX), wrapping)
    }).range(this.from, this.to);
  }
};
var LineGapWidget = class extends WidgetType {
  constructor(size, vertical) {
    super();
    this.size = size;
    this.vertical = vertical;
  }
  eq(other) {
    return other.size == this.size && other.vertical == this.vertical;
  }
  toDOM() {
    let elt = document.createElement("div");
    if (this.vertical) {
      elt.style.height = this.size + "px";
    } else {
      elt.style.width = this.size + "px";
      elt.style.height = "2px";
      elt.style.display = "inline-block";
    }
    return elt;
  }
  get estimatedHeight() {
    return this.vertical ? this.size : -1;
  }
};
var ViewState = class {
  constructor(state) {
    this.state = state;
    this.pixelViewport = { left: 0, right: window.innerWidth, top: 0, bottom: 0 };
    this.inView = true;
    this.paddingTop = 0;
    this.paddingBottom = 0;
    this.contentDOMWidth = 0;
    this.contentDOMHeight = 0;
    this.editorHeight = 0;
    this.editorWidth = 0;
    this.scrollTop = 0;
    this.scrolledToBottom = true;
    this.scaleX = 1;
    this.scaleY = 1;
    this.scrollAnchorPos = 0;
    this.scrollAnchorHeight = -1;
    this.scaler = IdScaler;
    this.scrollTarget = null;
    this.printing = false;
    this.mustMeasureContent = true;
    this.defaultTextDirection = Direction.LTR;
    this.visibleRanges = [];
    this.mustEnforceCursorAssoc = false;
    let guessWrapping = state.facet(contentAttributes).some((v4) => typeof v4 != "function" && v4.class == "cm-lineWrapping");
    this.heightOracle = new HeightOracle(guessWrapping);
    this.stateDeco = state.facet(decorations).filter((d) => typeof d != "function");
    this.heightMap = HeightMap.empty().applyChanges(this.stateDeco, Text2.empty, this.heightOracle.setDoc(state.doc), [new ChangedRange(0, 0, 0, state.doc.length)]);
    this.viewport = this.getViewport(0, null);
    this.updateViewportLines();
    this.updateForViewport();
    this.lineGaps = this.ensureLineGaps([]);
    this.lineGapDeco = Decoration.set(this.lineGaps.map((gap) => gap.draw(this, false)));
    this.computeVisibleRanges();
  }
  updateForViewport() {
    let viewports = [this.viewport], { main } = this.state.selection;
    for (let i2 = 0; i2 <= 1; i2++) {
      let pos = i2 ? main.head : main.anchor;
      if (!viewports.some(({ from: from2, to }) => pos >= from2 && pos <= to)) {
        let { from: from2, to } = this.lineBlockAt(pos);
        viewports.push(new Viewport(from2, to));
      }
    }
    this.viewports = viewports.sort((a2, b) => a2.from - b.from);
    this.scaler = this.heightMap.height <= 7e6 ? IdScaler : new BigScaler(this.heightOracle, this.heightMap, this.viewports);
  }
  updateViewportLines() {
    this.viewportLines = [];
    this.heightMap.forEachLine(this.viewport.from, this.viewport.to, this.heightOracle.setDoc(this.state.doc), 0, 0, (block) => {
      this.viewportLines.push(this.scaler.scale == 1 ? block : scaleBlock(block, this.scaler));
    });
  }
  update(update, scrollTarget = null) {
    this.state = update.state;
    let prevDeco = this.stateDeco;
    this.stateDeco = this.state.facet(decorations).filter((d) => typeof d != "function");
    let contentChanges = update.changedRanges;
    let heightChanges = ChangedRange.extendWithRanges(contentChanges, heightRelevantDecoChanges(prevDeco, this.stateDeco, update ? update.changes : ChangeSet.empty(this.state.doc.length)));
    let prevHeight = this.heightMap.height;
    let scrollAnchor = this.scrolledToBottom ? null : this.scrollAnchorAt(this.scrollTop);
    this.heightMap = this.heightMap.applyChanges(this.stateDeco, update.startState.doc, this.heightOracle.setDoc(this.state.doc), heightChanges);
    if (this.heightMap.height != prevHeight)
      update.flags |= 2;
    if (scrollAnchor) {
      this.scrollAnchorPos = update.changes.mapPos(scrollAnchor.from, -1);
      this.scrollAnchorHeight = scrollAnchor.top;
    } else {
      this.scrollAnchorPos = -1;
      this.scrollAnchorHeight = this.heightMap.height;
    }
    let viewport = heightChanges.length ? this.mapViewport(this.viewport, update.changes) : this.viewport;
    if (scrollTarget && (scrollTarget.range.head < viewport.from || scrollTarget.range.head > viewport.to) || !this.viewportIsAppropriate(viewport))
      viewport = this.getViewport(0, scrollTarget);
    let updateLines = !update.changes.empty || update.flags & 2 || viewport.from != this.viewport.from || viewport.to != this.viewport.to;
    this.viewport = viewport;
    this.updateForViewport();
    if (updateLines)
      this.updateViewportLines();
    if (this.lineGaps.length || this.viewport.to - this.viewport.from > 2e3 << 1)
      this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps, update.changes)));
    update.flags |= this.computeVisibleRanges();
    if (scrollTarget)
      this.scrollTarget = scrollTarget;
    if (!this.mustEnforceCursorAssoc && update.selectionSet && update.view.lineWrapping && update.state.selection.main.empty && update.state.selection.main.assoc && !update.state.facet(nativeSelectionHidden))
      this.mustEnforceCursorAssoc = true;
  }
  measure(view) {
    let dom = view.contentDOM, style = window.getComputedStyle(dom);
    let oracle = this.heightOracle;
    let whiteSpace = style.whiteSpace;
    this.defaultTextDirection = style.direction == "rtl" ? Direction.RTL : Direction.LTR;
    let refresh = this.heightOracle.mustRefreshForWrapping(whiteSpace);
    let domRect = dom.getBoundingClientRect();
    let measureContent = refresh || this.mustMeasureContent || this.contentDOMHeight != domRect.height;
    this.contentDOMHeight = domRect.height;
    this.mustMeasureContent = false;
    let result = 0, bias = 0;
    if (domRect.width && domRect.height) {
      let scaleX = domRect.width / dom.offsetWidth;
      let scaleY = domRect.height / dom.offsetHeight;
      if (scaleX > 0.995 && scaleX < 1.005 || !isFinite(scaleX) || Math.abs(domRect.width - dom.offsetWidth) < 1)
        scaleX = 1;
      if (scaleY > 0.995 && scaleY < 1.005 || !isFinite(scaleY) || Math.abs(domRect.height - dom.offsetHeight) < 1)
        scaleY = 1;
      if (this.scaleX != scaleX || this.scaleY != scaleY) {
        this.scaleX = scaleX;
        this.scaleY = scaleY;
        result |= 8;
        refresh = measureContent = true;
      }
    }
    let paddingTop = (parseInt(style.paddingTop) || 0) * this.scaleY;
    let paddingBottom = (parseInt(style.paddingBottom) || 0) * this.scaleY;
    if (this.paddingTop != paddingTop || this.paddingBottom != paddingBottom) {
      this.paddingTop = paddingTop;
      this.paddingBottom = paddingBottom;
      result |= 8 | 2;
    }
    if (this.editorWidth != view.scrollDOM.clientWidth) {
      if (oracle.lineWrapping)
        measureContent = true;
      this.editorWidth = view.scrollDOM.clientWidth;
      result |= 8;
    }
    let scrollTop = view.scrollDOM.scrollTop * this.scaleY;
    if (this.scrollTop != scrollTop) {
      this.scrollAnchorHeight = -1;
      this.scrollTop = scrollTop;
    }
    this.scrolledToBottom = isScrolledToBottom(view.scrollDOM);
    let pixelViewport = (this.printing ? fullPixelRange : visiblePixelRange)(dom, this.paddingTop);
    let dTop = pixelViewport.top - this.pixelViewport.top, dBottom = pixelViewport.bottom - this.pixelViewport.bottom;
    this.pixelViewport = pixelViewport;
    let inView = this.pixelViewport.bottom > this.pixelViewport.top && this.pixelViewport.right > this.pixelViewport.left;
    if (inView != this.inView) {
      this.inView = inView;
      if (inView)
        measureContent = true;
    }
    if (!this.inView && !this.scrollTarget)
      return 0;
    let contentWidth = domRect.width;
    if (this.contentDOMWidth != contentWidth || this.editorHeight != view.scrollDOM.clientHeight) {
      this.contentDOMWidth = domRect.width;
      this.editorHeight = view.scrollDOM.clientHeight;
      result |= 8;
    }
    if (measureContent) {
      let lineHeights = view.docView.measureVisibleLineHeights(this.viewport);
      if (oracle.mustRefreshForHeights(lineHeights))
        refresh = true;
      if (refresh || oracle.lineWrapping && Math.abs(contentWidth - this.contentDOMWidth) > oracle.charWidth) {
        let { lineHeight, charWidth, textHeight } = view.docView.measureTextSize();
        refresh = lineHeight > 0 && oracle.refresh(whiteSpace, lineHeight, charWidth, textHeight, contentWidth / charWidth, lineHeights);
        if (refresh) {
          view.docView.minWidth = 0;
          result |= 8;
        }
      }
      if (dTop > 0 && dBottom > 0)
        bias = Math.max(dTop, dBottom);
      else if (dTop < 0 && dBottom < 0)
        bias = Math.min(dTop, dBottom);
      oracle.heightChanged = false;
      for (let vp of this.viewports) {
        let heights = vp.from == this.viewport.from ? lineHeights : view.docView.measureVisibleLineHeights(vp);
        this.heightMap = (refresh ? HeightMap.empty().applyChanges(this.stateDeco, Text2.empty, this.heightOracle, [new ChangedRange(0, 0, 0, view.state.doc.length)]) : this.heightMap).updateHeight(oracle, 0, refresh, new MeasuredHeights(vp.from, heights));
      }
      if (oracle.heightChanged)
        result |= 2;
    }
    let viewportChange = !this.viewportIsAppropriate(this.viewport, bias) || this.scrollTarget && (this.scrollTarget.range.head < this.viewport.from || this.scrollTarget.range.head > this.viewport.to);
    if (viewportChange)
      this.viewport = this.getViewport(bias, this.scrollTarget);
    this.updateForViewport();
    if (result & 2 || viewportChange)
      this.updateViewportLines();
    if (this.lineGaps.length || this.viewport.to - this.viewport.from > 2e3 << 1)
      this.updateLineGaps(this.ensureLineGaps(refresh ? [] : this.lineGaps, view));
    result |= this.computeVisibleRanges();
    if (this.mustEnforceCursorAssoc) {
      this.mustEnforceCursorAssoc = false;
      view.docView.enforceCursorAssoc();
    }
    return result;
  }
  get visibleTop() {
    return this.scaler.fromDOM(this.pixelViewport.top);
  }
  get visibleBottom() {
    return this.scaler.fromDOM(this.pixelViewport.bottom);
  }
  getViewport(bias, scrollTarget) {
    let marginTop = 0.5 - Math.max(-0.5, Math.min(0.5, bias / 1e3 / 2));
    let map3 = this.heightMap, oracle = this.heightOracle;
    let { visibleTop, visibleBottom } = this;
    let viewport = new Viewport(map3.lineAt(visibleTop - marginTop * 1e3, QueryType.ByHeight, oracle, 0, 0).from, map3.lineAt(visibleBottom + (1 - marginTop) * 1e3, QueryType.ByHeight, oracle, 0, 0).to);
    if (scrollTarget) {
      let { head } = scrollTarget.range;
      if (head < viewport.from || head > viewport.to) {
        let viewHeight = Math.min(this.editorHeight, this.pixelViewport.bottom - this.pixelViewport.top);
        let block = map3.lineAt(head, QueryType.ByPos, oracle, 0, 0), topPos;
        if (scrollTarget.y == "center")
          topPos = (block.top + block.bottom) / 2 - viewHeight / 2;
        else if (scrollTarget.y == "start" || scrollTarget.y == "nearest" && head < viewport.from)
          topPos = block.top;
        else
          topPos = block.bottom - viewHeight;
        viewport = new Viewport(map3.lineAt(topPos - 1e3 / 2, QueryType.ByHeight, oracle, 0, 0).from, map3.lineAt(topPos + viewHeight + 1e3 / 2, QueryType.ByHeight, oracle, 0, 0).to);
      }
    }
    return viewport;
  }
  mapViewport(viewport, changes) {
    let from2 = changes.mapPos(viewport.from, -1), to = changes.mapPos(viewport.to, 1);
    return new Viewport(this.heightMap.lineAt(from2, QueryType.ByPos, this.heightOracle, 0, 0).from, this.heightMap.lineAt(to, QueryType.ByPos, this.heightOracle, 0, 0).to);
  }
  // Checks if a given viewport covers the visible part of the
  // document and not too much beyond that.
  viewportIsAppropriate({ from: from2, to }, bias = 0) {
    if (!this.inView)
      return true;
    let { top: top2 } = this.heightMap.lineAt(from2, QueryType.ByPos, this.heightOracle, 0, 0);
    let { bottom } = this.heightMap.lineAt(to, QueryType.ByPos, this.heightOracle, 0, 0);
    let { visibleTop, visibleBottom } = this;
    return (from2 == 0 || top2 <= visibleTop - Math.max(10, Math.min(
      -bias,
      250
      /* VP.MaxCoverMargin */
    ))) && (to == this.state.doc.length || bottom >= visibleBottom + Math.max(10, Math.min(
      bias,
      250
      /* VP.MaxCoverMargin */
    ))) && (top2 > visibleTop - 2 * 1e3 && bottom < visibleBottom + 2 * 1e3);
  }
  mapLineGaps(gaps, changes) {
    if (!gaps.length || changes.empty)
      return gaps;
    let mapped = [];
    for (let gap of gaps)
      if (!changes.touchesRange(gap.from, gap.to))
        mapped.push(new LineGap(changes.mapPos(gap.from), changes.mapPos(gap.to), gap.size));
    return mapped;
  }
  // Computes positions in the viewport where the start or end of a
  // line should be hidden, trying to reuse existing line gaps when
  // appropriate to avoid unneccesary redraws.
  // Uses crude character-counting for the positioning and sizing,
  // since actual DOM coordinates aren't always available and
  // predictable. Relies on generous margins (see LG.Margin) to hide
  // the artifacts this might produce from the user.
  ensureLineGaps(current, mayMeasure) {
    let wrapping = this.heightOracle.lineWrapping;
    let margin = wrapping ? 1e4 : 2e3, halfMargin = margin >> 1, doubleMargin = margin << 1;
    if (this.defaultTextDirection != Direction.LTR && !wrapping)
      return [];
    let gaps = [];
    let addGap = (from2, to, line2, structure) => {
      if (to - from2 < halfMargin)
        return;
      let sel = this.state.selection.main, avoid = [sel.from];
      if (!sel.empty)
        avoid.push(sel.to);
      for (let pos of avoid) {
        if (pos > from2 && pos < to) {
          addGap(from2, pos - 10, line2, structure);
          addGap(pos + 10, to, line2, structure);
          return;
        }
      }
      let gap = find(current, (gap2) => gap2.from >= line2.from && gap2.to <= line2.to && Math.abs(gap2.from - from2) < halfMargin && Math.abs(gap2.to - to) < halfMargin && !avoid.some((pos) => gap2.from < pos && gap2.to > pos));
      if (!gap) {
        if (to < line2.to && mayMeasure && wrapping && mayMeasure.visibleRanges.some((r3) => r3.from <= to && r3.to >= to)) {
          let lineStart = mayMeasure.moveToLineBoundary(EditorSelection.cursor(to), false, true).head;
          if (lineStart > from2)
            to = lineStart;
        }
        gap = new LineGap(from2, to, this.gapSize(line2, from2, to, structure));
      }
      gaps.push(gap);
    };
    for (let line2 of this.viewportLines) {
      if (line2.length < doubleMargin)
        continue;
      let structure = lineStructure(line2.from, line2.to, this.stateDeco);
      if (structure.total < doubleMargin)
        continue;
      let target = this.scrollTarget ? this.scrollTarget.range.head : null;
      let viewFrom, viewTo;
      if (wrapping) {
        let marginHeight = margin / this.heightOracle.lineLength * this.heightOracle.lineHeight;
        let top2, bot;
        if (target != null) {
          let targetFrac = findFraction(structure, target);
          let spaceFrac = ((this.visibleBottom - this.visibleTop) / 2 + marginHeight) / line2.height;
          top2 = targetFrac - spaceFrac;
          bot = targetFrac + spaceFrac;
        } else {
          top2 = (this.visibleTop - line2.top - marginHeight) / line2.height;
          bot = (this.visibleBottom - line2.top + marginHeight) / line2.height;
        }
        viewFrom = findPosition(structure, top2);
        viewTo = findPosition(structure, bot);
      } else {
        let totalWidth = structure.total * this.heightOracle.charWidth;
        let marginWidth = margin * this.heightOracle.charWidth;
        let left, right;
        if (target != null) {
          let targetFrac = findFraction(structure, target);
          let spaceFrac = ((this.pixelViewport.right - this.pixelViewport.left) / 2 + marginWidth) / totalWidth;
          left = targetFrac - spaceFrac;
          right = targetFrac + spaceFrac;
        } else {
          left = (this.pixelViewport.left - marginWidth) / totalWidth;
          right = (this.pixelViewport.right + marginWidth) / totalWidth;
        }
        viewFrom = findPosition(structure, left);
        viewTo = findPosition(structure, right);
      }
      if (viewFrom > line2.from)
        addGap(line2.from, viewFrom, line2, structure);
      if (viewTo < line2.to)
        addGap(viewTo, line2.to, line2, structure);
    }
    return gaps;
  }
  gapSize(line2, from2, to, structure) {
    let fraction = findFraction(structure, to) - findFraction(structure, from2);
    if (this.heightOracle.lineWrapping) {
      return line2.height * fraction;
    } else {
      return structure.total * this.heightOracle.charWidth * fraction;
    }
  }
  updateLineGaps(gaps) {
    if (!LineGap.same(gaps, this.lineGaps)) {
      this.lineGaps = gaps;
      this.lineGapDeco = Decoration.set(gaps.map((gap) => gap.draw(this, this.heightOracle.lineWrapping)));
    }
  }
  computeVisibleRanges() {
    let deco = this.stateDeco;
    if (this.lineGaps.length)
      deco = deco.concat(this.lineGapDeco);
    let ranges = [];
    RangeSet.spans(deco, this.viewport.from, this.viewport.to, {
      span(from2, to) {
        ranges.push({ from: from2, to });
      },
      point() {
      }
    }, 20);
    let changed = ranges.length != this.visibleRanges.length || this.visibleRanges.some((r3, i2) => r3.from != ranges[i2].from || r3.to != ranges[i2].to);
    this.visibleRanges = ranges;
    return changed ? 4 : 0;
  }
  lineBlockAt(pos) {
    return pos >= this.viewport.from && pos <= this.viewport.to && this.viewportLines.find((b) => b.from <= pos && b.to >= pos) || scaleBlock(this.heightMap.lineAt(pos, QueryType.ByPos, this.heightOracle, 0, 0), this.scaler);
  }
  lineBlockAtHeight(height) {
    return scaleBlock(this.heightMap.lineAt(this.scaler.fromDOM(height), QueryType.ByHeight, this.heightOracle, 0, 0), this.scaler);
  }
  scrollAnchorAt(scrollTop) {
    let block = this.lineBlockAtHeight(scrollTop + 8);
    return block.from >= this.viewport.from || this.viewportLines[0].top - scrollTop > 200 ? block : this.viewportLines[0];
  }
  elementAtHeight(height) {
    return scaleBlock(this.heightMap.blockAt(this.scaler.fromDOM(height), this.heightOracle, 0, 0), this.scaler);
  }
  get docHeight() {
    return this.scaler.toDOM(this.heightMap.height);
  }
  get contentHeight() {
    return this.docHeight + this.paddingTop + this.paddingBottom;
  }
};
var Viewport = class {
  constructor(from2, to) {
    this.from = from2;
    this.to = to;
  }
};
function lineStructure(from2, to, stateDeco) {
  let ranges = [], pos = from2, total = 0;
  RangeSet.spans(stateDeco, from2, to, {
    span() {
    },
    point(from3, to2) {
      if (from3 > pos) {
        ranges.push({ from: pos, to: from3 });
        total += from3 - pos;
      }
      pos = to2;
    }
  }, 20);
  if (pos < to) {
    ranges.push({ from: pos, to });
    total += to - pos;
  }
  return { total, ranges };
}
function findPosition({ total, ranges }, ratio) {
  if (ratio <= 0)
    return ranges[0].from;
  if (ratio >= 1)
    return ranges[ranges.length - 1].to;
  let dist2 = Math.floor(total * ratio);
  for (let i2 = 0; ; i2++) {
    let { from: from2, to } = ranges[i2], size = to - from2;
    if (dist2 <= size)
      return from2 + dist2;
    dist2 -= size;
  }
}
function findFraction(structure, pos) {
  let counted = 0;
  for (let { from: from2, to } of structure.ranges) {
    if (pos <= to) {
      counted += pos - from2;
      break;
    }
    counted += to - from2;
  }
  return counted / structure.total;
}
function find(array, f) {
  for (let val of array)
    if (f(val))
      return val;
  return void 0;
}
var IdScaler = {
  toDOM(n2) {
    return n2;
  },
  fromDOM(n2) {
    return n2;
  },
  scale: 1
};
var BigScaler = class {
  constructor(oracle, heightMap, viewports) {
    let vpHeight = 0, base2 = 0, domBase = 0;
    this.viewports = viewports.map(({ from: from2, to }) => {
      let top2 = heightMap.lineAt(from2, QueryType.ByPos, oracle, 0, 0).top;
      let bottom = heightMap.lineAt(to, QueryType.ByPos, oracle, 0, 0).bottom;
      vpHeight += bottom - top2;
      return { from: from2, to, top: top2, bottom, domTop: 0, domBottom: 0 };
    });
    this.scale = (7e6 - vpHeight) / (heightMap.height - vpHeight);
    for (let obj of this.viewports) {
      obj.domTop = domBase + (obj.top - base2) * this.scale;
      domBase = obj.domBottom = obj.domTop + (obj.bottom - obj.top);
      base2 = obj.bottom;
    }
  }
  toDOM(n2) {
    for (let i2 = 0, base2 = 0, domBase = 0; ; i2++) {
      let vp = i2 < this.viewports.length ? this.viewports[i2] : null;
      if (!vp || n2 < vp.top)
        return domBase + (n2 - base2) * this.scale;
      if (n2 <= vp.bottom)
        return vp.domTop + (n2 - vp.top);
      base2 = vp.bottom;
      domBase = vp.domBottom;
    }
  }
  fromDOM(n2) {
    for (let i2 = 0, base2 = 0, domBase = 0; ; i2++) {
      let vp = i2 < this.viewports.length ? this.viewports[i2] : null;
      if (!vp || n2 < vp.domTop)
        return base2 + (n2 - domBase) / this.scale;
      if (n2 <= vp.domBottom)
        return vp.top + (n2 - vp.domTop);
      base2 = vp.bottom;
      domBase = vp.domBottom;
    }
  }
};
function scaleBlock(block, scaler) {
  if (scaler.scale == 1)
    return block;
  let bTop = scaler.toDOM(block.top), bBottom = scaler.toDOM(block.bottom);
  return new BlockInfo(block.from, block.length, bTop, bBottom - bTop, Array.isArray(block._content) ? block._content.map((b) => scaleBlock(b, scaler)) : block._content);
}
var theme2 = /* @__PURE__ */ Facet.define({ combine: (strs) => strs.join(" ") });
var darkTheme = /* @__PURE__ */ Facet.define({ combine: (values2) => values2.indexOf(true) > -1 });
var baseThemeID = /* @__PURE__ */ StyleModule.newName();
var baseLightID = /* @__PURE__ */ StyleModule.newName();
var baseDarkID = /* @__PURE__ */ StyleModule.newName();
var lightDarkIDs = { "&light": "." + baseLightID, "&dark": "." + baseDarkID };
function buildTheme(main, spec, scopes) {
  return new StyleModule(spec, {
    finish(sel) {
      return /&/.test(sel) ? sel.replace(/&\w*/, (m) => {
        if (m == "&")
          return main;
        if (!scopes || !scopes[m])
          throw new RangeError(`Unsupported selector: ${m}`);
        return scopes[m];
      }) : main + " " + sel;
    }
  });
}
var baseTheme$1 = /* @__PURE__ */ buildTheme("." + baseThemeID, {
  "&": {
    position: "relative !important",
    boxSizing: "border-box",
    "&.cm-focused": {
      // Provide a simple default outline to make sure a focused
      // editor is visually distinct. Can't leave the default behavior
      // because that will apply to the content element, which is
      // inside the scrollable container and doesn't include the
      // gutters. We also can't use an 'auto' outline, since those
      // are, for some reason, drawn behind the element content, which
      // will cause things like the active line background to cover
      // the outline (#297).
      outline: "1px dotted #212121"
    },
    display: "flex !important",
    flexDirection: "column"
  },
  ".cm-scroller": {
    display: "flex !important",
    alignItems: "flex-start !important",
    fontFamily: "monospace",
    lineHeight: 1.4,
    height: "100%",
    overflowX: "auto",
    position: "relative",
    zIndex: 0
  },
  ".cm-content": {
    margin: 0,
    flexGrow: 2,
    flexShrink: 0,
    display: "block",
    whiteSpace: "pre",
    wordWrap: "normal",
    boxSizing: "border-box",
    minHeight: "100%",
    padding: "4px 0",
    outline: "none",
    "&[contenteditable=true]": {
      WebkitUserModify: "read-write-plaintext-only"
    }
  },
  ".cm-lineWrapping": {
    whiteSpace_fallback: "pre-wrap",
    whiteSpace: "break-spaces",
    wordBreak: "break-word",
    overflowWrap: "anywhere",
    flexShrink: 1
  },
  "&light .cm-content": { caretColor: "black" },
  "&dark .cm-content": { caretColor: "white" },
  ".cm-line": {
    display: "block",
    padding: "0 2px 0 6px"
  },
  ".cm-layer": {
    position: "absolute",
    left: 0,
    top: 0,
    contain: "size style",
    "& > *": {
      position: "absolute"
    }
  },
  "&light .cm-selectionBackground": {
    background: "#d9d9d9"
  },
  "&dark .cm-selectionBackground": {
    background: "#222"
  },
  "&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground": {
    background: "#d7d4f0"
  },
  "&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground": {
    background: "#233"
  },
  ".cm-cursorLayer": {
    pointerEvents: "none"
  },
  "&.cm-focused > .cm-scroller > .cm-cursorLayer": {
    animation: "steps(1) cm-blink 1.2s infinite"
  },
  // Two animations defined so that we can switch between them to
  // restart the animation without forcing another style
  // recomputation.
  "@keyframes cm-blink": { "0%": {}, "50%": { opacity: 0 }, "100%": {} },
  "@keyframes cm-blink2": { "0%": {}, "50%": { opacity: 0 }, "100%": {} },
  ".cm-cursor, .cm-dropCursor": {
    borderLeft: "1.2px solid black",
    marginLeft: "-0.6px",
    pointerEvents: "none"
  },
  ".cm-cursor": {
    display: "none"
  },
  "&dark .cm-cursor": {
    borderLeftColor: "#444"
  },
  ".cm-dropCursor": {
    position: "absolute"
  },
  "&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor": {
    display: "block"
  },
  "&light .cm-activeLine": { backgroundColor: "#cceeff44" },
  "&dark .cm-activeLine": { backgroundColor: "#99eeff33" },
  "&light .cm-specialChar": { color: "red" },
  "&dark .cm-specialChar": { color: "#f78" },
  ".cm-gutters": {
    flexShrink: 0,
    display: "flex",
    height: "100%",
    boxSizing: "border-box",
    insetInlineStart: 0,
    zIndex: 200
  },
  "&light .cm-gutters": {
    backgroundColor: "#f5f5f5",
    color: "#6c6c6c",
    borderRight: "1px solid #ddd"
  },
  "&dark .cm-gutters": {
    backgroundColor: "#333338",
    color: "#ccc"
  },
  ".cm-gutter": {
    display: "flex !important",
    flexDirection: "column",
    flexShrink: 0,
    boxSizing: "border-box",
    minHeight: "100%",
    overflow: "hidden"
  },
  ".cm-gutterElement": {
    boxSizing: "border-box"
  },
  ".cm-lineNumbers .cm-gutterElement": {
    padding: "0 3px 0 5px",
    minWidth: "20px",
    textAlign: "right",
    whiteSpace: "nowrap"
  },
  "&light .cm-activeLineGutter": {
    backgroundColor: "#e2f2ff"
  },
  "&dark .cm-activeLineGutter": {
    backgroundColor: "#222227"
  },
  ".cm-panels": {
    boxSizing: "border-box",
    position: "sticky",
    left: 0,
    right: 0
  },
  "&light .cm-panels": {
    backgroundColor: "#f5f5f5",
    color: "black"
  },
  "&light .cm-panels-top": {
    borderBottom: "1px solid #ddd"
  },
  "&light .cm-panels-bottom": {
    borderTop: "1px solid #ddd"
  },
  "&dark .cm-panels": {
    backgroundColor: "#333338",
    color: "white"
  },
  ".cm-tab": {
    display: "inline-block",
    overflow: "hidden",
    verticalAlign: "bottom"
  },
  ".cm-widgetBuffer": {
    verticalAlign: "text-top",
    height: "1em",
    width: 0,
    display: "inline"
  },
  ".cm-placeholder": {
    color: "#888",
    display: "inline-block",
    verticalAlign: "top"
  },
  ".cm-highlightSpace:before": {
    content: "attr(data-display)",
    position: "absolute",
    pointerEvents: "none",
    color: "#888"
  },
  ".cm-highlightTab": {
    backgroundImage: `url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,
    backgroundSize: "auto 100%",
    backgroundPosition: "right 90%",
    backgroundRepeat: "no-repeat"
  },
  ".cm-trailingSpace": {
    backgroundColor: "#ff332255"
  },
  ".cm-button": {
    verticalAlign: "middle",
    color: "inherit",
    fontSize: "70%",
    padding: ".2em 1em",
    borderRadius: "1px"
  },
  "&light .cm-button": {
    backgroundImage: "linear-gradient(#eff1f5, #d9d9df)",
    border: "1px solid #888",
    "&:active": {
      backgroundImage: "linear-gradient(#b4b4b4, #d0d3d6)"
    }
  },
  "&dark .cm-button": {
    backgroundImage: "linear-gradient(#393939, #111)",
    border: "1px solid #888",
    "&:active": {
      backgroundImage: "linear-gradient(#111, #333)"
    }
  },
  ".cm-textfield": {
    verticalAlign: "middle",
    color: "inherit",
    fontSize: "70%",
    border: "1px solid silver",
    padding: ".2em .5em"
  },
  "&light .cm-textfield": {
    backgroundColor: "white"
  },
  "&dark .cm-textfield": {
    border: "1px solid #555",
    backgroundColor: "inherit"
  }
}, lightDarkIDs);
var LineBreakPlaceholder = "\uFFFF";
var DOMReader = class {
  constructor(points, state) {
    this.points = points;
    this.text = "";
    this.lineSeparator = state.facet(EditorState.lineSeparator);
  }
  append(text2) {
    this.text += text2;
  }
  lineBreak() {
    this.text += LineBreakPlaceholder;
  }
  readRange(start, end) {
    if (!start)
      return this;
    let parent = start.parentNode;
    for (let cur2 = start; ; ) {
      this.findPointBefore(parent, cur2);
      let oldLen = this.text.length;
      this.readNode(cur2);
      let next2 = cur2.nextSibling;
      if (next2 == end)
        break;
      let view = ContentView.get(cur2), nextView = ContentView.get(next2);
      if (view && nextView ? view.breakAfter : (view ? view.breakAfter : isBlockElement(cur2)) || isBlockElement(next2) && (cur2.nodeName != "BR" || cur2.cmIgnore) && this.text.length > oldLen)
        this.lineBreak();
      cur2 = next2;
    }
    this.findPointBefore(parent, end);
    return this;
  }
  readTextNode(node56) {
    let text2 = node56.nodeValue;
    for (let point4 of this.points)
      if (point4.node == node56)
        point4.pos = this.text.length + Math.min(point4.offset, text2.length);
    for (let off = 0, re2 = this.lineSeparator ? null : /\r\n?|\n/g; ; ) {
      let nextBreak = -1, breakSize = 1, m;
      if (this.lineSeparator) {
        nextBreak = text2.indexOf(this.lineSeparator, off);
        breakSize = this.lineSeparator.length;
      } else if (m = re2.exec(text2)) {
        nextBreak = m.index;
        breakSize = m[0].length;
      }
      this.append(text2.slice(off, nextBreak < 0 ? text2.length : nextBreak));
      if (nextBreak < 0)
        break;
      this.lineBreak();
      if (breakSize > 1) {
        for (let point4 of this.points)
          if (point4.node == node56 && point4.pos > this.text.length)
            point4.pos -= breakSize - 1;
      }
      off = nextBreak + breakSize;
    }
  }
  readNode(node56) {
    if (node56.cmIgnore)
      return;
    let view = ContentView.get(node56);
    let fromView = view && view.overrideDOMText;
    if (fromView != null) {
      this.findPointInside(node56, fromView.length);
      for (let i2 = fromView.iter(); !i2.next().done; ) {
        if (i2.lineBreak)
          this.lineBreak();
        else
          this.append(i2.value);
      }
    } else if (node56.nodeType == 3) {
      this.readTextNode(node56);
    } else if (node56.nodeName == "BR") {
      if (node56.nextSibling)
        this.lineBreak();
    } else if (node56.nodeType == 1) {
      this.readRange(node56.firstChild, null);
    }
  }
  findPointBefore(node56, next2) {
    for (let point4 of this.points)
      if (point4.node == node56 && node56.childNodes[point4.offset] == next2)
        point4.pos = this.text.length;
  }
  findPointInside(node56, length2) {
    for (let point4 of this.points)
      if (node56.nodeType == 3 ? point4.node == node56 : node56.contains(point4.node))
        point4.pos = this.text.length + (isAtEnd(node56, point4.node, point4.offset) ? length2 : 0);
  }
};
function isAtEnd(parent, node56, offset) {
  for (; ; ) {
    if (!node56 || offset < maxOffset(node56))
      return false;
    if (node56 == parent)
      return true;
    offset = domIndex(node56) + 1;
    node56 = node56.parentNode;
  }
}
function isBlockElement(node56) {
  return node56.nodeType == 1 && /^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(node56.nodeName);
}
var DOMPoint = class {
  constructor(node56, offset) {
    this.node = node56;
    this.offset = offset;
    this.pos = -1;
  }
};
var DOMChange = class {
  constructor(view, start, end, typeOver) {
    this.typeOver = typeOver;
    this.bounds = null;
    this.text = "";
    let { impreciseHead: iHead, impreciseAnchor: iAnchor } = view.docView;
    if (view.state.readOnly && start > -1) {
      this.newSel = null;
    } else if (start > -1 && (this.bounds = view.docView.domBoundsAround(start, end, 0))) {
      let selPoints = iHead || iAnchor ? [] : selectionPoints(view);
      let reader = new DOMReader(selPoints, view.state);
      reader.readRange(this.bounds.startDOM, this.bounds.endDOM);
      this.text = reader.text;
      this.newSel = selectionFromPoints(selPoints, this.bounds.from);
    } else {
      let domSel = view.observer.selectionRange;
      let head = iHead && iHead.node == domSel.focusNode && iHead.offset == domSel.focusOffset || !contains(view.contentDOM, domSel.focusNode) ? view.state.selection.main.head : view.docView.posFromDOM(domSel.focusNode, domSel.focusOffset);
      let anchor = iAnchor && iAnchor.node == domSel.anchorNode && iAnchor.offset == domSel.anchorOffset || !contains(view.contentDOM, domSel.anchorNode) ? view.state.selection.main.anchor : view.docView.posFromDOM(domSel.anchorNode, domSel.anchorOffset);
      this.newSel = EditorSelection.single(anchor, head);
    }
  }
};
function applyDOMChange(view, domChange) {
  let change;
  let { newSel } = domChange, sel = view.state.selection.main;
  let lastKey = view.inputState.lastKeyTime > Date.now() - 100 ? view.inputState.lastKeyCode : -1;
  if (domChange.bounds) {
    let { from: from2, to } = domChange.bounds;
    let preferredPos = sel.from, preferredSide = null;
    if (lastKey === 8 || browser.android && domChange.text.length < to - from2) {
      preferredPos = sel.to;
      preferredSide = "end";
    }
    let diff = findDiff(view.state.doc.sliceString(from2, to, LineBreakPlaceholder), domChange.text, preferredPos - from2, preferredSide);
    if (diff) {
      if (browser.chrome && lastKey == 13 && diff.toB == diff.from + 2 && domChange.text.slice(diff.from, diff.toB) == LineBreakPlaceholder + LineBreakPlaceholder)
        diff.toB--;
      change = {
        from: from2 + diff.from,
        to: from2 + diff.toA,
        insert: Text2.of(domChange.text.slice(diff.from, diff.toB).split(LineBreakPlaceholder))
      };
    }
  } else if (newSel && (!view.hasFocus && view.state.facet(editable) || newSel.main.eq(sel))) {
    newSel = null;
  }
  if (!change && !newSel)
    return false;
  if (!change && domChange.typeOver && !sel.empty && newSel && newSel.main.empty) {
    change = { from: sel.from, to: sel.to, insert: view.state.doc.slice(sel.from, sel.to) };
  } else if (change && change.from >= sel.from && change.to <= sel.to && (change.from != sel.from || change.to != sel.to) && sel.to - sel.from - (change.to - change.from) <= 4) {
    change = {
      from: sel.from,
      to: sel.to,
      insert: view.state.doc.slice(sel.from, change.from).append(change.insert).append(view.state.doc.slice(change.to, sel.to))
    };
  } else if ((browser.mac || browser.android) && change && change.from == change.to && change.from == sel.head - 1 && /^\. ?$/.test(change.insert.toString()) && view.contentDOM.getAttribute("autocorrect") == "off") {
    if (newSel && change.insert.length == 2)
      newSel = EditorSelection.single(newSel.main.anchor - 1, newSel.main.head - 1);
    change = { from: sel.from, to: sel.to, insert: Text2.of([" "]) };
  } else if (browser.chrome && change && change.from == change.to && change.from == sel.head && change.insert.toString() == "\n " && view.lineWrapping) {
    if (newSel)
      newSel = EditorSelection.single(newSel.main.anchor - 1, newSel.main.head - 1);
    change = { from: sel.from, to: sel.to, insert: Text2.of([" "]) };
  }
  if (change) {
    if (browser.ios && view.inputState.flushIOSKey())
      return true;
    if (browser.android && (change.from == sel.from && change.to == sel.to && change.insert.length == 1 && change.insert.lines == 2 && dispatchKey(view.contentDOM, "Enter", 13) || (change.from == sel.from - 1 && change.to == sel.to && change.insert.length == 0 || lastKey == 8 && change.insert.length < change.to - change.from && change.to > sel.head) && dispatchKey(view.contentDOM, "Backspace", 8) || change.from == sel.from && change.to == sel.to + 1 && change.insert.length == 0 && dispatchKey(view.contentDOM, "Delete", 46)))
      return true;
    let text2 = change.insert.toString();
    if (view.inputState.composing >= 0)
      view.inputState.composing++;
    let defaultTr;
    let defaultInsert = () => defaultTr || (defaultTr = applyDefaultInsert(view, change, newSel));
    if (!view.state.facet(inputHandler).some((h) => h(view, change.from, change.to, text2, defaultInsert)))
      view.dispatch(defaultInsert());
    return true;
  } else if (newSel && !newSel.main.eq(sel)) {
    let scrollIntoView3 = false, userEvent = "select";
    if (view.inputState.lastSelectionTime > Date.now() - 50) {
      if (view.inputState.lastSelectionOrigin == "select")
        scrollIntoView3 = true;
      userEvent = view.inputState.lastSelectionOrigin;
    }
    view.dispatch({ selection: newSel, scrollIntoView: scrollIntoView3, userEvent });
    return true;
  } else {
    return false;
  }
}
function applyDefaultInsert(view, change, newSel) {
  let tr, startState = view.state, sel = startState.selection.main;
  if (change.from >= sel.from && change.to <= sel.to && change.to - change.from >= (sel.to - sel.from) / 3 && (!newSel || newSel.main.empty && newSel.main.from == change.from + change.insert.length) && view.inputState.composing < 0) {
    let before = sel.from < change.from ? startState.sliceDoc(sel.from, change.from) : "";
    let after = sel.to > change.to ? startState.sliceDoc(change.to, sel.to) : "";
    tr = startState.replaceSelection(view.state.toText(before + change.insert.sliceString(0, void 0, view.state.lineBreak) + after));
  } else {
    let changes = startState.changes(change);
    let mainSel = newSel && newSel.main.to <= changes.newLength ? newSel.main : void 0;
    if (startState.selection.ranges.length > 1 && view.inputState.composing >= 0 && change.to <= sel.to && change.to >= sel.to - 10) {
      let replaced = view.state.sliceDoc(change.from, change.to);
      let compositionRange, composition = newSel && findCompositionNode(view, newSel.main.head);
      if (composition) {
        let dLen = change.insert.length - (change.to - change.from);
        compositionRange = { from: composition.from, to: composition.to - dLen };
      } else {
        compositionRange = view.state.doc.lineAt(sel.head);
      }
      let offset = sel.to - change.to, size = sel.to - sel.from;
      tr = startState.changeByRange((range4) => {
        if (range4.from == sel.from && range4.to == sel.to)
          return { changes, range: mainSel || range4.map(changes) };
        let to = range4.to - offset, from2 = to - replaced.length;
        if (range4.to - range4.from != size || view.state.sliceDoc(from2, to) != replaced || // Unfortunately, there's no way to make multiple
        // changes in the same node work without aborting
        // composition, so cursors in the composition range are
        // ignored.
        range4.to >= compositionRange.from && range4.from <= compositionRange.to)
          return { range: range4 };
        let rangeChanges = startState.changes({ from: from2, to, insert: change.insert }), selOff = range4.to - sel.to;
        return {
          changes: rangeChanges,
          range: !mainSel ? range4.map(rangeChanges) : EditorSelection.range(Math.max(0, mainSel.anchor + selOff), Math.max(0, mainSel.head + selOff))
        };
      });
    } else {
      tr = {
        changes,
        selection: mainSel && startState.selection.replaceRange(mainSel)
      };
    }
  }
  let userEvent = "input.type";
  if (view.composing || view.inputState.compositionPendingChange && view.inputState.compositionEndedAt > Date.now() - 50) {
    view.inputState.compositionPendingChange = false;
    userEvent += ".compose";
    if (view.inputState.compositionFirstChange) {
      userEvent += ".start";
      view.inputState.compositionFirstChange = false;
    }
  }
  return startState.update(tr, { userEvent, scrollIntoView: true });
}
function findDiff(a2, b, preferredPos, preferredSide) {
  let minLen = Math.min(a2.length, b.length);
  let from2 = 0;
  while (from2 < minLen && a2.charCodeAt(from2) == b.charCodeAt(from2))
    from2++;
  if (from2 == minLen && a2.length == b.length)
    return null;
  let toA = a2.length, toB = b.length;
  while (toA > 0 && toB > 0 && a2.charCodeAt(toA - 1) == b.charCodeAt(toB - 1)) {
    toA--;
    toB--;
  }
  if (preferredSide == "end") {
    let adjust = Math.max(0, from2 - Math.min(toA, toB));
    preferredPos -= toA + adjust - from2;
  }
  if (toA < from2 && a2.length < b.length) {
    let move = preferredPos <= from2 && preferredPos >= toA ? from2 - preferredPos : 0;
    from2 -= move;
    toB = from2 + (toB - toA);
    toA = from2;
  } else if (toB < from2) {
    let move = preferredPos <= from2 && preferredPos >= toB ? from2 - preferredPos : 0;
    from2 -= move;
    toA = from2 + (toA - toB);
    toB = from2;
  }
  return { from: from2, toA, toB };
}
function selectionPoints(view) {
  let result = [];
  if (view.root.activeElement != view.contentDOM)
    return result;
  let { anchorNode, anchorOffset, focusNode, focusOffset } = view.observer.selectionRange;
  if (anchorNode) {
    result.push(new DOMPoint(anchorNode, anchorOffset));
    if (focusNode != anchorNode || focusOffset != anchorOffset)
      result.push(new DOMPoint(focusNode, focusOffset));
  }
  return result;
}
function selectionFromPoints(points, base2) {
  if (points.length == 0)
    return null;
  let anchor = points[0].pos, head = points.length == 2 ? points[1].pos : anchor;
  return anchor > -1 && head > -1 ? EditorSelection.single(anchor + base2, head + base2) : null;
}
var observeOptions = {
  childList: true,
  characterData: true,
  subtree: true,
  attributes: true,
  characterDataOldValue: true
};
var useCharData = browser.ie && browser.ie_version <= 11;
var DOMObserver = class {
  constructor(view) {
    this.view = view;
    this.active = false;
    this.selectionRange = new DOMSelectionState();
    this.selectionChanged = false;
    this.delayedFlush = -1;
    this.resizeTimeout = -1;
    this.queue = [];
    this.delayedAndroidKey = null;
    this.flushingAndroidKey = -1;
    this.lastChange = 0;
    this.scrollTargets = [];
    this.intersection = null;
    this.resizeScroll = null;
    this.intersecting = false;
    this.gapIntersection = null;
    this.gaps = [];
    this.parentCheck = -1;
    this.dom = view.contentDOM;
    this.observer = new MutationObserver((mutations) => {
      for (let mut of mutations)
        this.queue.push(mut);
      if ((browser.ie && browser.ie_version <= 11 || browser.ios && view.composing) && mutations.some((m) => m.type == "childList" && m.removedNodes.length || m.type == "characterData" && m.oldValue.length > m.target.nodeValue.length))
        this.flushSoon();
      else
        this.flush();
    });
    if (useCharData)
      this.onCharData = (event) => {
        this.queue.push({
          target: event.target,
          type: "characterData",
          oldValue: event.prevValue
        });
        this.flushSoon();
      };
    this.onSelectionChange = this.onSelectionChange.bind(this);
    this.onResize = this.onResize.bind(this);
    this.onPrint = this.onPrint.bind(this);
    this.onScroll = this.onScroll.bind(this);
    if (typeof ResizeObserver == "function") {
      this.resizeScroll = new ResizeObserver(() => {
        var _a2;
        if (((_a2 = this.view.docView) === null || _a2 === void 0 ? void 0 : _a2.lastUpdate) < Date.now() - 75)
          this.onResize();
      });
      this.resizeScroll.observe(view.scrollDOM);
    }
    this.addWindowListeners(this.win = view.win);
    this.start();
    if (typeof IntersectionObserver == "function") {
      this.intersection = new IntersectionObserver((entries) => {
        if (this.parentCheck < 0)
          this.parentCheck = setTimeout(this.listenForScroll.bind(this), 1e3);
        if (entries.length > 0 && entries[entries.length - 1].intersectionRatio > 0 != this.intersecting) {
          this.intersecting = !this.intersecting;
          if (this.intersecting != this.view.inView)
            this.onScrollChanged(document.createEvent("Event"));
        }
      }, { threshold: [0, 1e-3] });
      this.intersection.observe(this.dom);
      this.gapIntersection = new IntersectionObserver((entries) => {
        if (entries.length > 0 && entries[entries.length - 1].intersectionRatio > 0)
          this.onScrollChanged(document.createEvent("Event"));
      }, {});
    }
    this.listenForScroll();
    this.readSelectionRange();
  }
  onScrollChanged(e3) {
    this.view.inputState.runHandlers("scroll", e3);
    if (this.intersecting)
      this.view.measure();
  }
  onScroll(e3) {
    if (this.intersecting)
      this.flush(false);
    this.onScrollChanged(e3);
  }
  onResize() {
    if (this.resizeTimeout < 0)
      this.resizeTimeout = setTimeout(() => {
        this.resizeTimeout = -1;
        this.view.requestMeasure();
      }, 50);
  }
  onPrint() {
    this.view.viewState.printing = true;
    this.view.measure();
    setTimeout(() => {
      this.view.viewState.printing = false;
      this.view.requestMeasure();
    }, 500);
  }
  updateGaps(gaps) {
    if (this.gapIntersection && (gaps.length != this.gaps.length || this.gaps.some((g, i2) => g != gaps[i2]))) {
      this.gapIntersection.disconnect();
      for (let gap of gaps)
        this.gapIntersection.observe(gap);
      this.gaps = gaps;
    }
  }
  onSelectionChange(event) {
    let wasChanged = this.selectionChanged;
    if (!this.readSelectionRange() || this.delayedAndroidKey)
      return;
    let { view } = this, sel = this.selectionRange;
    if (view.state.facet(editable) ? view.root.activeElement != this.dom : !hasSelection(view.dom, sel))
      return;
    let context2 = sel.anchorNode && view.docView.nearest(sel.anchorNode);
    if (context2 && context2.ignoreEvent(event)) {
      if (!wasChanged)
        this.selectionChanged = false;
      return;
    }
    if ((browser.ie && browser.ie_version <= 11 || browser.android && browser.chrome) && !view.state.selection.main.empty && // (Selection.isCollapsed isn't reliable on IE)
    sel.focusNode && isEquivalentPosition(sel.focusNode, sel.focusOffset, sel.anchorNode, sel.anchorOffset))
      this.flushSoon();
    else
      this.flush(false);
  }
  readSelectionRange() {
    let { view } = this;
    let range4 = browser.safari && view.root.nodeType == 11 && deepActiveElement(this.dom.ownerDocument) == this.dom && safariSelectionRangeHack(this.view) || getSelection(view.root);
    if (!range4 || this.selectionRange.eq(range4))
      return false;
    let local = hasSelection(this.dom, range4);
    if (local && !this.selectionChanged && view.inputState.lastFocusTime > Date.now() - 200 && view.inputState.lastTouchTime < Date.now() - 300 && atElementStart(this.dom, range4)) {
      this.view.inputState.lastFocusTime = 0;
      view.docView.updateSelection();
      return false;
    }
    this.selectionRange.setRange(range4);
    if (local)
      this.selectionChanged = true;
    return true;
  }
  setSelectionRange(anchor, head) {
    this.selectionRange.set(anchor.node, anchor.offset, head.node, head.offset);
    this.selectionChanged = false;
  }
  clearSelectionRange() {
    this.selectionRange.set(null, 0, null, 0);
  }
  listenForScroll() {
    this.parentCheck = -1;
    let i2 = 0, changed = null;
    for (let dom = this.dom; dom; ) {
      if (dom.nodeType == 1) {
        if (!changed && i2 < this.scrollTargets.length && this.scrollTargets[i2] == dom)
          i2++;
        else if (!changed)
          changed = this.scrollTargets.slice(0, i2);
        if (changed)
          changed.push(dom);
        dom = dom.assignedSlot || dom.parentNode;
      } else if (dom.nodeType == 11) {
        dom = dom.host;
      } else {
        break;
      }
    }
    if (i2 < this.scrollTargets.length && !changed)
      changed = this.scrollTargets.slice(0, i2);
    if (changed) {
      for (let dom of this.scrollTargets)
        dom.removeEventListener("scroll", this.onScroll);
      for (let dom of this.scrollTargets = changed)
        dom.addEventListener("scroll", this.onScroll);
    }
  }
  ignore(f) {
    if (!this.active)
      return f();
    try {
      this.stop();
      return f();
    } finally {
      this.start();
      this.clear();
    }
  }
  start() {
    if (this.active)
      return;
    this.observer.observe(this.dom, observeOptions);
    if (useCharData)
      this.dom.addEventListener("DOMCharacterDataModified", this.onCharData);
    this.active = true;
  }
  stop() {
    if (!this.active)
      return;
    this.active = false;
    this.observer.disconnect();
    if (useCharData)
      this.dom.removeEventListener("DOMCharacterDataModified", this.onCharData);
  }
  // Throw away any pending changes
  clear() {
    this.processRecords();
    this.queue.length = 0;
    this.selectionChanged = false;
  }
  // Chrome Android, especially in combination with GBoard, not only
  // doesn't reliably fire regular key events, but also often
  // surrounds the effect of enter or backspace with a bunch of
  // composition events that, when interrupted, cause text duplication
  // or other kinds of corruption. This hack makes the editor back off
  // from handling DOM changes for a moment when such a key is
  // detected (via beforeinput or keydown), and then tries to flush
  // them or, if that has no effect, dispatches the given key.
  delayAndroidKey(key, keyCode) {
    var _a2;
    if (!this.delayedAndroidKey) {
      let flush = () => {
        let key2 = this.delayedAndroidKey;
        if (key2) {
          this.clearDelayedAndroidKey();
          this.view.inputState.lastKeyCode = key2.keyCode;
          this.view.inputState.lastKeyTime = Date.now();
          let flushed = this.flush();
          if (!flushed && key2.force)
            dispatchKey(this.dom, key2.key, key2.keyCode);
        }
      };
      this.flushingAndroidKey = this.view.win.requestAnimationFrame(flush);
    }
    if (!this.delayedAndroidKey || key == "Enter")
      this.delayedAndroidKey = {
        key,
        keyCode,
        // Only run the key handler when no changes are detected if
        // this isn't coming right after another change, in which case
        // it is probably part of a weird chain of updates, and should
        // be ignored if it returns the DOM to its previous state.
        force: this.lastChange < Date.now() - 50 || !!((_a2 = this.delayedAndroidKey) === null || _a2 === void 0 ? void 0 : _a2.force)
      };
  }
  clearDelayedAndroidKey() {
    this.win.cancelAnimationFrame(this.flushingAndroidKey);
    this.delayedAndroidKey = null;
    this.flushingAndroidKey = -1;
  }
  flushSoon() {
    if (this.delayedFlush < 0)
      this.delayedFlush = this.view.win.requestAnimationFrame(() => {
        this.delayedFlush = -1;
        this.flush();
      });
  }
  forceFlush() {
    if (this.delayedFlush >= 0) {
      this.view.win.cancelAnimationFrame(this.delayedFlush);
      this.delayedFlush = -1;
    }
    this.flush();
  }
  pendingRecords() {
    for (let mut of this.observer.takeRecords())
      this.queue.push(mut);
    return this.queue;
  }
  processRecords() {
    let records = this.pendingRecords();
    if (records.length)
      this.queue = [];
    let from2 = -1, to = -1, typeOver = false;
    for (let record of records) {
      let range4 = this.readMutation(record);
      if (!range4)
        continue;
      if (range4.typeOver)
        typeOver = true;
      if (from2 == -1) {
        ({ from: from2, to } = range4);
      } else {
        from2 = Math.min(range4.from, from2);
        to = Math.max(range4.to, to);
      }
    }
    return { from: from2, to, typeOver };
  }
  readChange() {
    let { from: from2, to, typeOver } = this.processRecords();
    let newSel = this.selectionChanged && hasSelection(this.dom, this.selectionRange);
    if (from2 < 0 && !newSel)
      return null;
    if (from2 > -1)
      this.lastChange = Date.now();
    this.view.inputState.lastFocusTime = 0;
    this.selectionChanged = false;
    let change = new DOMChange(this.view, from2, to, typeOver);
    this.view.docView.domChanged = { newSel: change.newSel ? change.newSel.main : null };
    return change;
  }
  // Apply pending changes, if any
  flush(readSelection = true) {
    if (this.delayedFlush >= 0 || this.delayedAndroidKey)
      return false;
    if (readSelection)
      this.readSelectionRange();
    let domChange = this.readChange();
    if (!domChange) {
      this.view.requestMeasure();
      return false;
    }
    let startState = this.view.state;
    let handled = applyDOMChange(this.view, domChange);
    if (this.view.state == startState)
      this.view.update([]);
    return handled;
  }
  readMutation(rec) {
    let cView = this.view.docView.nearest(rec.target);
    if (!cView || cView.ignoreMutation(rec))
      return null;
    cView.markDirty(rec.type == "attributes");
    if (rec.type == "attributes")
      cView.flags |= 4;
    if (rec.type == "childList") {
      let childBefore = findChild(cView, rec.previousSibling || rec.target.previousSibling, -1);
      let childAfter = findChild(cView, rec.nextSibling || rec.target.nextSibling, 1);
      return {
        from: childBefore ? cView.posAfter(childBefore) : cView.posAtStart,
        to: childAfter ? cView.posBefore(childAfter) : cView.posAtEnd,
        typeOver: false
      };
    } else if (rec.type == "characterData") {
      return { from: cView.posAtStart, to: cView.posAtEnd, typeOver: rec.target.nodeValue == rec.oldValue };
    } else {
      return null;
    }
  }
  setWindow(win) {
    if (win != this.win) {
      this.removeWindowListeners(this.win);
      this.win = win;
      this.addWindowListeners(this.win);
    }
  }
  addWindowListeners(win) {
    win.addEventListener("resize", this.onResize);
    win.addEventListener("beforeprint", this.onPrint);
    win.addEventListener("scroll", this.onScroll);
    win.document.addEventListener("selectionchange", this.onSelectionChange);
  }
  removeWindowListeners(win) {
    win.removeEventListener("scroll", this.onScroll);
    win.removeEventListener("resize", this.onResize);
    win.removeEventListener("beforeprint", this.onPrint);
    win.document.removeEventListener("selectionchange", this.onSelectionChange);
  }
  destroy() {
    var _a2, _b, _c;
    this.stop();
    (_a2 = this.intersection) === null || _a2 === void 0 ? void 0 : _a2.disconnect();
    (_b = this.gapIntersection) === null || _b === void 0 ? void 0 : _b.disconnect();
    (_c = this.resizeScroll) === null || _c === void 0 ? void 0 : _c.disconnect();
    for (let dom of this.scrollTargets)
      dom.removeEventListener("scroll", this.onScroll);
    this.removeWindowListeners(this.win);
    clearTimeout(this.parentCheck);
    clearTimeout(this.resizeTimeout);
    this.win.cancelAnimationFrame(this.delayedFlush);
    this.win.cancelAnimationFrame(this.flushingAndroidKey);
  }
};
function findChild(cView, dom, dir) {
  while (dom) {
    let curView = ContentView.get(dom);
    if (curView && curView.parent == cView)
      return curView;
    let parent = dom.parentNode;
    dom = parent != cView.dom ? parent : dir > 0 ? dom.nextSibling : dom.previousSibling;
  }
  return null;
}
function safariSelectionRangeHack(view) {
  let found = null;
  function read(event) {
    event.preventDefault();
    event.stopImmediatePropagation();
    found = event.getTargetRanges()[0];
  }
  view.contentDOM.addEventListener("beforeinput", read, true);
  view.dom.ownerDocument.execCommand("indent");
  view.contentDOM.removeEventListener("beforeinput", read, true);
  if (!found)
    return null;
  let anchorNode = found.startContainer, anchorOffset = found.startOffset;
  let focusNode = found.endContainer, focusOffset = found.endOffset;
  let curAnchor = view.docView.domAtPos(view.state.selection.main.anchor);
  if (isEquivalentPosition(curAnchor.node, curAnchor.offset, focusNode, focusOffset))
    [anchorNode, anchorOffset, focusNode, focusOffset] = [focusNode, focusOffset, anchorNode, anchorOffset];
  return { anchorNode, anchorOffset, focusNode, focusOffset };
}
var EditorView = class _EditorView {
  /**
  The current editor state.
  */
  get state() {
    return this.viewState.state;
  }
  /**
  To be able to display large documents without consuming too much
  memory or overloading the browser, CodeMirror only draws the
  code that is visible (plus a margin around it) to the DOM. This
  property tells you the extent of the current drawn viewport, in
  document positions.
  */
  get viewport() {
    return this.viewState.viewport;
  }
  /**
  When there are, for example, large collapsed ranges in the
  viewport, its size can be a lot bigger than the actual visible
  content. Thus, if you are doing something like styling the
  content in the viewport, it is preferable to only do so for
  these ranges, which are the subset of the viewport that is
  actually drawn.
  */
  get visibleRanges() {
    return this.viewState.visibleRanges;
  }
  /**
  Returns false when the editor is entirely scrolled out of view
  or otherwise hidden.
  */
  get inView() {
    return this.viewState.inView;
  }
  /**
  Indicates whether the user is currently composing text via
  [IME](https://en.wikipedia.org/wiki/Input_method), and at least
  one change has been made in the current composition.
  */
  get composing() {
    return this.inputState.composing > 0;
  }
  /**
  Indicates whether the user is currently in composing state. Note
  that on some platforms, like Android, this will be the case a
  lot, since just putting the cursor on a word starts a
  composition there.
  */
  get compositionStarted() {
    return this.inputState.composing >= 0;
  }
  /**
  The document or shadow root that the view lives in.
  */
  get root() {
    return this._root;
  }
  /**
  @internal
  */
  get win() {
    return this.dom.ownerDocument.defaultView || window;
  }
  /**
  Construct a new view. You'll want to either provide a `parent`
  option, or put `view.dom` into your document after creating a
  view, so that the user can see the editor.
  */
  constructor(config2 = {}) {
    this.plugins = [];
    this.pluginMap = /* @__PURE__ */ new Map();
    this.editorAttrs = {};
    this.contentAttrs = {};
    this.bidiCache = [];
    this.destroyed = false;
    this.updateState = 2;
    this.measureScheduled = -1;
    this.measureRequests = [];
    this.contentDOM = document.createElement("div");
    this.scrollDOM = document.createElement("div");
    this.scrollDOM.tabIndex = -1;
    this.scrollDOM.className = "cm-scroller";
    this.scrollDOM.appendChild(this.contentDOM);
    this.announceDOM = document.createElement("div");
    this.announceDOM.style.cssText = "position: fixed; top: -10000px";
    this.announceDOM.setAttribute("aria-live", "polite");
    this.dom = document.createElement("div");
    this.dom.appendChild(this.announceDOM);
    this.dom.appendChild(this.scrollDOM);
    let { dispatch } = config2;
    this.dispatchTransactions = config2.dispatchTransactions || dispatch && ((trs) => trs.forEach((tr) => dispatch(tr, this))) || ((trs) => this.update(trs));
    this.dispatch = this.dispatch.bind(this);
    this._root = config2.root || getRoot(config2.parent) || document;
    this.viewState = new ViewState(config2.state || EditorState.create(config2));
    this.plugins = this.state.facet(viewPlugin).map((spec) => new PluginInstance(spec));
    for (let plugin of this.plugins)
      plugin.update(this);
    this.observer = new DOMObserver(this);
    this.inputState = new InputState(this);
    this.inputState.ensureHandlers(this.plugins);
    this.docView = new DocView(this);
    this.mountStyles();
    this.updateAttrs();
    this.updateState = 0;
    this.requestMeasure();
    if (config2.parent)
      config2.parent.appendChild(this.dom);
  }
  dispatch(...input) {
    let trs = input.length == 1 && input[0] instanceof Transaction ? input : input.length == 1 && Array.isArray(input[0]) ? input[0] : [this.state.update(...input)];
    this.dispatchTransactions(trs, this);
  }
  /**
  Update the view for the given array of transactions. This will
  update the visible document and selection to match the state
  produced by the transactions, and notify view plugins of the
  change. You should usually call
  [`dispatch`](https://codemirror.net/6/docs/ref/#view.EditorView.dispatch) instead, which uses this
  as a primitive.
  */
  update(transactions) {
    if (this.updateState != 0)
      throw new Error("Calls to EditorView.update are not allowed while an update is in progress");
    let redrawn = false, attrsChanged = false, update;
    let state = this.state;
    for (let tr of transactions) {
      if (tr.startState != state)
        throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");
      state = tr.state;
    }
    if (this.destroyed) {
      this.viewState.state = state;
      return;
    }
    let focus = this.hasFocus, focusFlag = 0, dispatchFocus = null;
    if (transactions.some((tr) => tr.annotation(isFocusChange))) {
      this.inputState.notifiedFocused = focus;
      focusFlag = 1;
    } else if (focus != this.inputState.notifiedFocused) {
      this.inputState.notifiedFocused = focus;
      dispatchFocus = focusChangeTransaction(state, focus);
      if (!dispatchFocus)
        focusFlag = 1;
    }
    let pendingKey = this.observer.delayedAndroidKey, domChange = null;
    if (pendingKey) {
      this.observer.clearDelayedAndroidKey();
      domChange = this.observer.readChange();
      if (domChange && !this.state.doc.eq(state.doc) || !this.state.selection.eq(state.selection))
        domChange = null;
    } else {
      this.observer.clear();
    }
    if (state.facet(EditorState.phrases) != this.state.facet(EditorState.phrases))
      return this.setState(state);
    update = ViewUpdate.create(this, state, transactions);
    update.flags |= focusFlag;
    let scrollTarget = this.viewState.scrollTarget;
    try {
      this.updateState = 2;
      for (let tr of transactions) {
        if (scrollTarget)
          scrollTarget = scrollTarget.map(tr.changes);
        if (tr.scrollIntoView) {
          let { main } = tr.state.selection;
          scrollTarget = new ScrollTarget(main.empty ? main : EditorSelection.cursor(main.head, main.head > main.anchor ? -1 : 1));
        }
        for (let e3 of tr.effects)
          if (e3.is(scrollIntoView))
            scrollTarget = e3.value;
      }
      this.viewState.update(update, scrollTarget);
      this.bidiCache = CachedOrder.update(this.bidiCache, update.changes);
      if (!update.empty) {
        this.updatePlugins(update);
        this.inputState.update(update);
      }
      redrawn = this.docView.update(update);
      if (this.state.facet(styleModule) != this.styleModules)
        this.mountStyles();
      attrsChanged = this.updateAttrs();
      this.showAnnouncements(transactions);
      this.docView.updateSelection(redrawn, transactions.some((tr) => tr.isUserEvent("select.pointer")));
    } finally {
      this.updateState = 0;
    }
    if (update.startState.facet(theme2) != update.state.facet(theme2))
      this.viewState.mustMeasureContent = true;
    if (redrawn || attrsChanged || scrollTarget || this.viewState.mustEnforceCursorAssoc || this.viewState.mustMeasureContent)
      this.requestMeasure();
    if (!update.empty)
      for (let listener of this.state.facet(updateListener))
        listener(update);
    if (dispatchFocus || domChange)
      Promise.resolve().then(() => {
        if (dispatchFocus && this.state == dispatchFocus.startState)
          this.dispatch(dispatchFocus);
        if (domChange) {
          if (!applyDOMChange(this, domChange) && pendingKey.force)
            dispatchKey(this.contentDOM, pendingKey.key, pendingKey.keyCode);
        }
      });
  }
  /**
  Reset the view to the given state. (This will cause the entire
  document to be redrawn and all view plugins to be reinitialized,
  so you should probably only use it when the new state isn't
  derived from the old state. Otherwise, use
  [`dispatch`](https://codemirror.net/6/docs/ref/#view.EditorView.dispatch) instead.)
  */
  setState(newState) {
    if (this.updateState != 0)
      throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");
    if (this.destroyed) {
      this.viewState.state = newState;
      return;
    }
    this.updateState = 2;
    let hadFocus = this.hasFocus;
    try {
      for (let plugin of this.plugins)
        plugin.destroy(this);
      this.viewState = new ViewState(newState);
      this.plugins = newState.facet(viewPlugin).map((spec) => new PluginInstance(spec));
      this.pluginMap.clear();
      for (let plugin of this.plugins)
        plugin.update(this);
      this.docView = new DocView(this);
      this.inputState.ensureHandlers(this.plugins);
      this.mountStyles();
      this.updateAttrs();
      this.bidiCache = [];
    } finally {
      this.updateState = 0;
    }
    if (hadFocus)
      this.focus();
    this.requestMeasure();
  }
  updatePlugins(update) {
    let prevSpecs = update.startState.facet(viewPlugin), specs = update.state.facet(viewPlugin);
    if (prevSpecs != specs) {
      let newPlugins = [];
      for (let spec of specs) {
        let found = prevSpecs.indexOf(spec);
        if (found < 0) {
          newPlugins.push(new PluginInstance(spec));
        } else {
          let plugin = this.plugins[found];
          plugin.mustUpdate = update;
          newPlugins.push(plugin);
        }
      }
      for (let plugin of this.plugins)
        if (plugin.mustUpdate != update)
          plugin.destroy(this);
      this.plugins = newPlugins;
      this.pluginMap.clear();
    } else {
      for (let p of this.plugins)
        p.mustUpdate = update;
    }
    for (let i2 = 0; i2 < this.plugins.length; i2++)
      this.plugins[i2].update(this);
    if (prevSpecs != specs)
      this.inputState.ensureHandlers(this.plugins);
  }
  /**
  @internal
  */
  measure(flush = true) {
    if (this.destroyed)
      return;
    if (this.measureScheduled > -1)
      this.win.cancelAnimationFrame(this.measureScheduled);
    if (this.observer.delayedAndroidKey) {
      this.measureScheduled = -1;
      this.requestMeasure();
      return;
    }
    this.measureScheduled = 0;
    if (flush)
      this.observer.forceFlush();
    let updated = null;
    let sDOM = this.scrollDOM, scrollTop = sDOM.scrollTop * this.scaleY;
    let { scrollAnchorPos, scrollAnchorHeight } = this.viewState;
    if (Math.abs(scrollTop - this.viewState.scrollTop) > 1)
      scrollAnchorHeight = -1;
    this.viewState.scrollAnchorHeight = -1;
    try {
      for (let i2 = 0; ; i2++) {
        if (scrollAnchorHeight < 0) {
          if (isScrolledToBottom(sDOM)) {
            scrollAnchorPos = -1;
            scrollAnchorHeight = this.viewState.heightMap.height;
          } else {
            let block = this.viewState.scrollAnchorAt(scrollTop);
            scrollAnchorPos = block.from;
            scrollAnchorHeight = block.top;
          }
        }
        this.updateState = 1;
        let changed = this.viewState.measure(this);
        if (!changed && !this.measureRequests.length && this.viewState.scrollTarget == null)
          break;
        if (i2 > 5) {
          console.warn(this.measureRequests.length ? "Measure loop restarted more than 5 times" : "Viewport failed to stabilize");
          break;
        }
        let measuring = [];
        if (!(changed & 4))
          [this.measureRequests, measuring] = [measuring, this.measureRequests];
        let measured = measuring.map((m) => {
          try {
            return m.read(this);
          } catch (e3) {
            logException(this.state, e3);
            return BadMeasure;
          }
        });
        let update = ViewUpdate.create(this, this.state, []), redrawn = false;
        update.flags |= changed;
        if (!updated)
          updated = update;
        else
          updated.flags |= changed;
        this.updateState = 2;
        if (!update.empty) {
          this.updatePlugins(update);
          this.inputState.update(update);
          this.updateAttrs();
          redrawn = this.docView.update(update);
        }
        for (let i3 = 0; i3 < measuring.length; i3++)
          if (measured[i3] != BadMeasure) {
            try {
              let m = measuring[i3];
              if (m.write)
                m.write(measured[i3], this);
            } catch (e3) {
              logException(this.state, e3);
            }
          }
        if (redrawn)
          this.docView.updateSelection(true);
        if (!update.viewportChanged && this.measureRequests.length == 0) {
          if (this.viewState.editorHeight) {
            if (this.viewState.scrollTarget) {
              this.docView.scrollIntoView(this.viewState.scrollTarget);
              this.viewState.scrollTarget = null;
              continue;
            } else {
              let newAnchorHeight = scrollAnchorPos < 0 ? this.viewState.heightMap.height : this.viewState.lineBlockAt(scrollAnchorPos).top;
              let diff = newAnchorHeight - scrollAnchorHeight;
              if (diff > 1 || diff < -1) {
                scrollTop = scrollTop + diff;
                sDOM.scrollTop = scrollTop / this.scaleY;
                scrollAnchorHeight = -1;
                continue;
              }
            }
          }
          break;
        }
      }
    } finally {
      this.updateState = 0;
      this.measureScheduled = -1;
    }
    if (updated && !updated.empty)
      for (let listener of this.state.facet(updateListener))
        listener(updated);
  }
  /**
  Get the CSS classes for the currently active editor themes.
  */
  get themeClasses() {
    return baseThemeID + " " + (this.state.facet(darkTheme) ? baseDarkID : baseLightID) + " " + this.state.facet(theme2);
  }
  updateAttrs() {
    let editorAttrs = attrsFromFacet(this, editorAttributes, {
      class: "cm-editor" + (this.hasFocus ? " cm-focused " : " ") + this.themeClasses
    });
    let contentAttrs = {
      spellcheck: "false",
      autocorrect: "off",
      autocapitalize: "off",
      translate: "no",
      contenteditable: !this.state.facet(editable) ? "false" : "true",
      class: "cm-content",
      style: `${browser.tabSize}: ${this.state.tabSize}`,
      role: "textbox",
      "aria-multiline": "true"
    };
    if (this.state.readOnly)
      contentAttrs["aria-readonly"] = "true";
    attrsFromFacet(this, contentAttributes, contentAttrs);
    let changed = this.observer.ignore(() => {
      let changedContent = updateAttrs(this.contentDOM, this.contentAttrs, contentAttrs);
      let changedEditor = updateAttrs(this.dom, this.editorAttrs, editorAttrs);
      return changedContent || changedEditor;
    });
    this.editorAttrs = editorAttrs;
    this.contentAttrs = contentAttrs;
    return changed;
  }
  showAnnouncements(trs) {
    let first = true;
    for (let tr of trs)
      for (let effect of tr.effects)
        if (effect.is(_EditorView.announce)) {
          if (first)
            this.announceDOM.textContent = "";
          first = false;
          let div = this.announceDOM.appendChild(document.createElement("div"));
          div.textContent = effect.value;
        }
  }
  mountStyles() {
    this.styleModules = this.state.facet(styleModule);
    let nonce = this.state.facet(_EditorView.cspNonce);
    StyleModule.mount(this.root, this.styleModules.concat(baseTheme$1).reverse(), nonce ? { nonce } : void 0);
  }
  readMeasured() {
    if (this.updateState == 2)
      throw new Error("Reading the editor layout isn't allowed during an update");
    if (this.updateState == 0 && this.measureScheduled > -1)
      this.measure(false);
  }
  /**
  Schedule a layout measurement, optionally providing callbacks to
  do custom DOM measuring followed by a DOM write phase. Using
  this is preferable reading DOM layout directly from, for
  example, an event handler, because it'll make sure measuring and
  drawing done by other components is synchronized, avoiding
  unnecessary DOM layout computations.
  */
  requestMeasure(request) {
    if (this.measureScheduled < 0)
      this.measureScheduled = this.win.requestAnimationFrame(() => this.measure());
    if (request) {
      if (this.measureRequests.indexOf(request) > -1)
        return;
      if (request.key != null)
        for (let i2 = 0; i2 < this.measureRequests.length; i2++) {
          if (this.measureRequests[i2].key === request.key) {
            this.measureRequests[i2] = request;
            return;
          }
        }
      this.measureRequests.push(request);
    }
  }
  /**
  Get the value of a specific plugin, if present. Note that
  plugins that crash can be dropped from a view, so even when you
  know you registered a given plugin, it is recommended to check
  the return value of this method.
  */
  plugin(plugin) {
    let known = this.pluginMap.get(plugin);
    if (known === void 0 || known && known.spec != plugin)
      this.pluginMap.set(plugin, known = this.plugins.find((p) => p.spec == plugin) || null);
    return known && known.update(this).value;
  }
  /**
  The top position of the document, in screen coordinates. This
  may be negative when the editor is scrolled down. Points
  directly to the top of the first line, not above the padding.
  */
  get documentTop() {
    return this.contentDOM.getBoundingClientRect().top + this.viewState.paddingTop;
  }
  /**
  Reports the padding above and below the document.
  */
  get documentPadding() {
    return { top: this.viewState.paddingTop, bottom: this.viewState.paddingBottom };
  }
  /**
  If the editor is transformed with CSS, this provides the scale
  along the X axis. Otherwise, it will just be 1. Note that
  transforms other than translation and scaling are not supported.
  */
  get scaleX() {
    return this.viewState.scaleX;
  }
  /**
  Provide the CSS transformed scale along the Y axis.
  */
  get scaleY() {
    return this.viewState.scaleY;
  }
  /**
  Find the text line or block widget at the given vertical
  position (which is interpreted as relative to the [top of the
  document](https://codemirror.net/6/docs/ref/#view.EditorView.documentTop)).
  */
  elementAtHeight(height) {
    this.readMeasured();
    return this.viewState.elementAtHeight(height);
  }
  /**
  Find the line block (see
  [`lineBlockAt`](https://codemirror.net/6/docs/ref/#view.EditorView.lineBlockAt) at the given
  height, again interpreted relative to the [top of the
  document](https://codemirror.net/6/docs/ref/#view.EditorView.documentTop).
  */
  lineBlockAtHeight(height) {
    this.readMeasured();
    return this.viewState.lineBlockAtHeight(height);
  }
  /**
  Get the extent and vertical position of all [line
  blocks](https://codemirror.net/6/docs/ref/#view.EditorView.lineBlockAt) in the viewport. Positions
  are relative to the [top of the
  document](https://codemirror.net/6/docs/ref/#view.EditorView.documentTop);
  */
  get viewportLineBlocks() {
    return this.viewState.viewportLines;
  }
  /**
  Find the line block around the given document position. A line
  block is a range delimited on both sides by either a
  non-[hidden](https://codemirror.net/6/docs/ref/#view.Decoration^replace) line breaks, or the
  start/end of the document. It will usually just hold a line of
  text, but may be broken into multiple textblocks by block
  widgets.
  */
  lineBlockAt(pos) {
    return this.viewState.lineBlockAt(pos);
  }
  /**
  The editor's total content height.
  */
  get contentHeight() {
    return this.viewState.contentHeight;
  }
  /**
  Move a cursor position by [grapheme
  cluster](https://codemirror.net/6/docs/ref/#state.findClusterBreak). `forward` determines whether
  the motion is away from the line start, or towards it. In
  bidirectional text, the line is traversed in visual order, using
  the editor's [text direction](https://codemirror.net/6/docs/ref/#view.EditorView.textDirection).
  When the start position was the last one on the line, the
  returned position will be across the line break. If there is no
  further line, the original position is returned.
  
  By default, this method moves over a single cluster. The
  optional `by` argument can be used to move across more. It will
  be called with the first cluster as argument, and should return
  a predicate that determines, for each subsequent cluster,
  whether it should also be moved over.
  */
  moveByChar(start, forward, by) {
    return skipAtoms(this, start, moveByChar(this, start, forward, by));
  }
  /**
  Move a cursor position across the next group of either
  [letters](https://codemirror.net/6/docs/ref/#state.EditorState.charCategorizer) or non-letter
  non-whitespace characters.
  */
  moveByGroup(start, forward) {
    return skipAtoms(this, start, moveByChar(this, start, forward, (initial) => byGroup(this, start.head, initial)));
  }
  /**
  Move to the next line boundary in the given direction. If
  `includeWrap` is true, line wrapping is on, and there is a
  further wrap point on the current line, the wrap point will be
  returned. Otherwise this function will return the start or end
  of the line.
  */
  moveToLineBoundary(start, forward, includeWrap = true) {
    return moveToLineBoundary(this, start, forward, includeWrap);
  }
  /**
  Move a cursor position vertically. When `distance` isn't given,
  it defaults to moving to the next line (including wrapped
  lines). Otherwise, `distance` should provide a positive distance
  in pixels.
  
  When `start` has a
  [`goalColumn`](https://codemirror.net/6/docs/ref/#state.SelectionRange.goalColumn), the vertical
  motion will use that as a target horizontal position. Otherwise,
  the cursor's own horizontal position is used. The returned
  cursor will have its goal column set to whichever column was
  used.
  */
  moveVertically(start, forward, distance) {
    return skipAtoms(this, start, moveVertically(this, start, forward, distance));
  }
  /**
  Find the DOM parent node and offset (child offset if `node` is
  an element, character offset when it is a text node) at the
  given document position.
  
  Note that for positions that aren't currently in
  `visibleRanges`, the resulting DOM position isn't necessarily
  meaningful (it may just point before or after a placeholder
  element).
  */
  domAtPos(pos) {
    return this.docView.domAtPos(pos);
  }
  /**
  Find the document position at the given DOM node. Can be useful
  for associating positions with DOM events. Will raise an error
  when `node` isn't part of the editor content.
  */
  posAtDOM(node56, offset = 0) {
    return this.docView.posFromDOM(node56, offset);
  }
  posAtCoords(coords, precise = true) {
    this.readMeasured();
    return posAtCoords(this, coords, precise);
  }
  /**
  Get the screen coordinates at the given document position.
  `side` determines whether the coordinates are based on the
  element before (-1) or after (1) the position (if no element is
  available on the given side, the method will transparently use
  another strategy to get reasonable coordinates).
  */
  coordsAtPos(pos, side = 1) {
    this.readMeasured();
    let rect = this.docView.coordsAt(pos, side);
    if (!rect || rect.left == rect.right)
      return rect;
    let line2 = this.state.doc.lineAt(pos), order = this.bidiSpans(line2);
    let span = order[BidiSpan.find(order, pos - line2.from, -1, side)];
    return flattenRect(rect, span.dir == Direction.LTR == side > 0);
  }
  /**
  Return the rectangle around a given character. If `pos` does not
  point in front of a character that is in the viewport and
  rendered (i.e. not replaced, not a line break), this will return
  null. For space characters that are a line wrap point, this will
  return the position before the line break.
  */
  coordsForChar(pos) {
    this.readMeasured();
    return this.docView.coordsForChar(pos);
  }
  /**
  The default width of a character in the editor. May not
  accurately reflect the width of all characters (given variable
  width fonts or styling of invididual ranges).
  */
  get defaultCharacterWidth() {
    return this.viewState.heightOracle.charWidth;
  }
  /**
  The default height of a line in the editor. May not be accurate
  for all lines.
  */
  get defaultLineHeight() {
    return this.viewState.heightOracle.lineHeight;
  }
  /**
  The text direction
  ([`direction`](https://developer.mozilla.org/en-US/docs/Web/CSS/direction)
  CSS property) of the editor's content element.
  */
  get textDirection() {
    return this.viewState.defaultTextDirection;
  }
  /**
  Find the text direction of the block at the given position, as
  assigned by CSS. If
  [`perLineTextDirection`](https://codemirror.net/6/docs/ref/#view.EditorView^perLineTextDirection)
  isn't enabled, or the given position is outside of the viewport,
  this will always return the same as
  [`textDirection`](https://codemirror.net/6/docs/ref/#view.EditorView.textDirection). Note that
  this may trigger a DOM layout.
  */
  textDirectionAt(pos) {
    let perLine = this.state.facet(perLineTextDirection);
    if (!perLine || pos < this.viewport.from || pos > this.viewport.to)
      return this.textDirection;
    this.readMeasured();
    return this.docView.textDirectionAt(pos);
  }
  /**
  Whether this editor [wraps lines](https://codemirror.net/6/docs/ref/#view.EditorView.lineWrapping)
  (as determined by the
  [`white-space`](https://developer.mozilla.org/en-US/docs/Web/CSS/white-space)
  CSS property of its content element).
  */
  get lineWrapping() {
    return this.viewState.heightOracle.lineWrapping;
  }
  /**
  Returns the bidirectional text structure of the given line
  (which should be in the current document) as an array of span
  objects. The order of these spans matches the [text
  direction](https://codemirror.net/6/docs/ref/#view.EditorView.textDirection)—if that is
  left-to-right, the leftmost spans come first, otherwise the
  rightmost spans come first.
  */
  bidiSpans(line2) {
    if (line2.length > MaxBidiLine)
      return trivialOrder(line2.length);
    let dir = this.textDirectionAt(line2.from), isolates;
    for (let entry of this.bidiCache) {
      if (entry.from == line2.from && entry.dir == dir && (entry.fresh || isolatesEq(entry.isolates, isolates = getIsolatedRanges(this, line2.from, line2.to))))
        return entry.order;
    }
    if (!isolates)
      isolates = getIsolatedRanges(this, line2.from, line2.to);
    let order = computeOrder(line2.text, dir, isolates);
    this.bidiCache.push(new CachedOrder(line2.from, line2.to, dir, isolates, true, order));
    return order;
  }
  /**
  Check whether the editor has focus.
  */
  get hasFocus() {
    var _a2;
    return (this.dom.ownerDocument.hasFocus() || browser.safari && ((_a2 = this.inputState) === null || _a2 === void 0 ? void 0 : _a2.lastContextMenu) > Date.now() - 3e4) && this.root.activeElement == this.contentDOM;
  }
  /**
  Put focus on the editor.
  */
  focus() {
    this.observer.ignore(() => {
      focusPreventScroll(this.contentDOM);
      this.docView.updateSelection();
    });
  }
  /**
  Update the [root](https://codemirror.net/6/docs/ref/##view.EditorViewConfig.root) in which the editor lives. This is only
  necessary when moving the editor's existing DOM to a new window or shadow root.
  */
  setRoot(root2) {
    if (this._root != root2) {
      this._root = root2;
      this.observer.setWindow((root2.nodeType == 9 ? root2 : root2.ownerDocument).defaultView || window);
      this.mountStyles();
    }
  }
  /**
  Clean up this editor view, removing its element from the
  document, unregistering event handlers, and notifying
  plugins. The view instance can no longer be used after
  calling this.
  */
  destroy() {
    for (let plugin of this.plugins)
      plugin.destroy(this);
    this.plugins = [];
    this.inputState.destroy();
    this.dom.remove();
    this.observer.destroy();
    if (this.measureScheduled > -1)
      this.win.cancelAnimationFrame(this.measureScheduled);
    this.destroyed = true;
  }
  /**
  Returns an effect that can be
  [added](https://codemirror.net/6/docs/ref/#state.TransactionSpec.effects) to a transaction to
  cause it to scroll the given position or range into view.
  */
  static scrollIntoView(pos, options = {}) {
    return scrollIntoView.of(new ScrollTarget(typeof pos == "number" ? EditorSelection.cursor(pos) : pos, options.y, options.x, options.yMargin, options.xMargin));
  }
  /**
  Returns an extension that can be used to add DOM event handlers.
  The value should be an object mapping event names to handler
  functions. For any given event, such functions are ordered by
  extension precedence, and the first handler to return true will
  be assumed to have handled that event, and no other handlers or
  built-in behavior will be activated for it. These are registered
  on the [content element](https://codemirror.net/6/docs/ref/#view.EditorView.contentDOM), except
  for `scroll` handlers, which will be called any time the
  editor's [scroll element](https://codemirror.net/6/docs/ref/#view.EditorView.scrollDOM) or one of
  its parent nodes is scrolled.
  */
  static domEventHandlers(handlers2) {
    return ViewPlugin.define(() => ({}), { eventHandlers: handlers2 });
  }
  /**
  Create an extension that registers DOM event observers. Contrary
  to event [handlers](https://codemirror.net/6/docs/ref/#view.EditorView^domEventHandlers),
  observers can't be prevented from running by a higher-precedence
  handler returning true. They also don't prevent other handlers
  and observers from running when they return true, and should not
  call `preventDefault`.
  */
  static domEventObservers(observers2) {
    return ViewPlugin.define(() => ({}), { eventObservers: observers2 });
  }
  /**
  Create a theme extension. The first argument can be a
  [`style-mod`](https://github.com/marijnh/style-mod#documentation)
  style spec providing the styles for the theme. These will be
  prefixed with a generated class for the style.
  
  Because the selectors will be prefixed with a scope class, rule
  that directly match the editor's [wrapper
  element](https://codemirror.net/6/docs/ref/#view.EditorView.dom)—to which the scope class will be
  added—need to be explicitly differentiated by adding an `&` to
  the selector for that element—for example
  `&.cm-focused`.
  
  When `dark` is set to true, the theme will be marked as dark,
  which will cause the `&dark` rules from [base
  themes](https://codemirror.net/6/docs/ref/#view.EditorView^baseTheme) to be used (as opposed to
  `&light` when a light theme is active).
  */
  static theme(spec, options) {
    let prefix3 = StyleModule.newName();
    let result = [theme2.of(prefix3), styleModule.of(buildTheme(`.${prefix3}`, spec))];
    if (options && options.dark)
      result.push(darkTheme.of(true));
    return result;
  }
  /**
  Create an extension that adds styles to the base theme. Like
  with [`theme`](https://codemirror.net/6/docs/ref/#view.EditorView^theme), use `&` to indicate the
  place of the editor wrapper element when directly targeting
  that. You can also use `&dark` or `&light` instead to only
  target editors with a dark or light theme.
  */
  static baseTheme(spec) {
    return Prec.lowest(styleModule.of(buildTheme("." + baseThemeID, spec, lightDarkIDs)));
  }
  /**
  Retrieve an editor view instance from the view's DOM
  representation.
  */
  static findFromDOM(dom) {
    var _a2;
    let content2 = dom.querySelector(".cm-content");
    let cView = content2 && ContentView.get(content2) || ContentView.get(dom);
    return ((_a2 = cView === null || cView === void 0 ? void 0 : cView.rootView) === null || _a2 === void 0 ? void 0 : _a2.view) || null;
  }
};
EditorView.styleModule = styleModule;
EditorView.inputHandler = inputHandler;
EditorView.focusChangeEffect = focusChangeEffect;
EditorView.perLineTextDirection = perLineTextDirection;
EditorView.exceptionSink = exceptionSink;
EditorView.updateListener = updateListener;
EditorView.editable = editable;
EditorView.mouseSelectionStyle = mouseSelectionStyle;
EditorView.dragMovesSelection = dragMovesSelection$1;
EditorView.clickAddsSelectionRange = clickAddsSelectionRange;
EditorView.decorations = decorations;
EditorView.atomicRanges = atomicRanges;
EditorView.bidiIsolatedRanges = bidiIsolatedRanges;
EditorView.scrollMargins = scrollMargins;
EditorView.darkTheme = darkTheme;
EditorView.cspNonce = /* @__PURE__ */ Facet.define({ combine: (values2) => values2.length ? values2[0] : "" });
EditorView.contentAttributes = contentAttributes;
EditorView.editorAttributes = editorAttributes;
EditorView.lineWrapping = /* @__PURE__ */ EditorView.contentAttributes.of({ "class": "cm-lineWrapping" });
EditorView.announce = /* @__PURE__ */ StateEffect.define();
var MaxBidiLine = 4096;
var BadMeasure = {};
var CachedOrder = class _CachedOrder {
  constructor(from2, to, dir, isolates, fresh, order) {
    this.from = from2;
    this.to = to;
    this.dir = dir;
    this.isolates = isolates;
    this.fresh = fresh;
    this.order = order;
  }
  static update(cache2, changes) {
    if (changes.empty && !cache2.some((c4) => c4.fresh))
      return cache2;
    let result = [], lastDir = cache2.length ? cache2[cache2.length - 1].dir : Direction.LTR;
    for (let i2 = Math.max(0, cache2.length - 10); i2 < cache2.length; i2++) {
      let entry = cache2[i2];
      if (entry.dir == lastDir && !changes.touchesRange(entry.from, entry.to))
        result.push(new _CachedOrder(changes.mapPos(entry.from, 1), changes.mapPos(entry.to, -1), entry.dir, entry.isolates, false, entry.order));
    }
    return result;
  }
};
function attrsFromFacet(view, facet, base2) {
  for (let sources = view.state.facet(facet), i2 = sources.length - 1; i2 >= 0; i2--) {
    let source = sources[i2], value = typeof source == "function" ? source(view) : source;
    if (value)
      combineAttrs(value, base2);
  }
  return base2;
}
var currentPlatform = browser.mac ? "mac" : browser.windows ? "win" : browser.linux ? "linux" : "key";
function normalizeKeyName(name2, platform) {
  const parts = name2.split(/-(?!$)/);
  let result = parts[parts.length - 1];
  if (result == "Space")
    result = " ";
  let alt, ctrl, shift2, meta2;
  for (let i2 = 0; i2 < parts.length - 1; ++i2) {
    const mod = parts[i2];
    if (/^(cmd|meta|m)$/i.test(mod))
      meta2 = true;
    else if (/^a(lt)?$/i.test(mod))
      alt = true;
    else if (/^(c|ctrl|control)$/i.test(mod))
      ctrl = true;
    else if (/^s(hift)?$/i.test(mod))
      shift2 = true;
    else if (/^mod$/i.test(mod)) {
      if (platform == "mac")
        meta2 = true;
      else
        ctrl = true;
    } else
      throw new Error("Unrecognized modifier name: " + mod);
  }
  if (alt)
    result = "Alt-" + result;
  if (ctrl)
    result = "Ctrl-" + result;
  if (meta2)
    result = "Meta-" + result;
  if (shift2)
    result = "Shift-" + result;
  return result;
}
function modifiers(name2, event, shift2) {
  if (event.altKey)
    name2 = "Alt-" + name2;
  if (event.ctrlKey)
    name2 = "Ctrl-" + name2;
  if (event.metaKey)
    name2 = "Meta-" + name2;
  if (shift2 !== false && event.shiftKey)
    name2 = "Shift-" + name2;
  return name2;
}
var handleKeyEvents = /* @__PURE__ */ Prec.default(/* @__PURE__ */ EditorView.domEventHandlers({
  keydown(event, view) {
    return runHandlers(getKeymap(view.state), event, view, "editor");
  }
}));
var keymap = /* @__PURE__ */ Facet.define({ enables: handleKeyEvents });
var Keymaps = /* @__PURE__ */ new WeakMap();
function getKeymap(state) {
  let bindings = state.facet(keymap);
  let map3 = Keymaps.get(bindings);
  if (!map3)
    Keymaps.set(bindings, map3 = buildKeymap(bindings.reduce((a2, b) => a2.concat(b), [])));
  return map3;
}
function runScopeHandlers(view, event, scope) {
  return runHandlers(getKeymap(view.state), event, view, scope);
}
var storedPrefix = null;
var PrefixTimeout = 4e3;
function buildKeymap(bindings, platform = currentPlatform) {
  let bound = /* @__PURE__ */ Object.create(null);
  let isPrefix = /* @__PURE__ */ Object.create(null);
  let checkPrefix = (name2, is2) => {
    let current = isPrefix[name2];
    if (current == null)
      isPrefix[name2] = is2;
    else if (current != is2)
      throw new Error("Key binding " + name2 + " is used both as a regular binding and as a multi-stroke prefix");
  };
  let add2 = (scope, key, command2, preventDefault, stopPropagation3) => {
    var _a2, _b;
    let scopeObj = bound[scope] || (bound[scope] = /* @__PURE__ */ Object.create(null));
    let parts = key.split(/ (?!$)/).map((k2) => normalizeKeyName(k2, platform));
    for (let i2 = 1; i2 < parts.length; i2++) {
      let prefix3 = parts.slice(0, i2).join(" ");
      checkPrefix(prefix3, true);
      if (!scopeObj[prefix3])
        scopeObj[prefix3] = {
          preventDefault: true,
          stopPropagation: false,
          run: [(view) => {
            let ourObj = storedPrefix = { view, prefix: prefix3, scope };
            setTimeout(() => {
              if (storedPrefix == ourObj)
                storedPrefix = null;
            }, PrefixTimeout);
            return true;
          }]
        };
    }
    let full = parts.join(" ");
    checkPrefix(full, false);
    let binding = scopeObj[full] || (scopeObj[full] = {
      preventDefault: false,
      stopPropagation: false,
      run: ((_b = (_a2 = scopeObj._any) === null || _a2 === void 0 ? void 0 : _a2.run) === null || _b === void 0 ? void 0 : _b.slice()) || []
    });
    if (command2)
      binding.run.push(command2);
    if (preventDefault)
      binding.preventDefault = true;
    if (stopPropagation3)
      binding.stopPropagation = true;
  };
  for (let b of bindings) {
    let scopes = b.scope ? b.scope.split(" ") : ["editor"];
    if (b.any)
      for (let scope of scopes) {
        let scopeObj = bound[scope] || (bound[scope] = /* @__PURE__ */ Object.create(null));
        if (!scopeObj._any)
          scopeObj._any = { preventDefault: false, stopPropagation: false, run: [] };
        for (let key in scopeObj)
          scopeObj[key].run.push(b.any);
      }
    let name2 = b[platform] || b.key;
    if (!name2)
      continue;
    for (let scope of scopes) {
      add2(scope, name2, b.run, b.preventDefault, b.stopPropagation);
      if (b.shift)
        add2(scope, "Shift-" + name2, b.shift, b.preventDefault, b.stopPropagation);
    }
  }
  return bound;
}
function runHandlers(map3, event, view, scope) {
  let name2 = keyName(event);
  let charCode = codePointAt(name2, 0), isChar = codePointSize(charCode) == name2.length && name2 != " ";
  let prefix3 = "", handled = false, prevented = false, stopPropagation3 = false;
  if (storedPrefix && storedPrefix.view == view && storedPrefix.scope == scope) {
    prefix3 = storedPrefix.prefix + " ";
    if (modifierCodes.indexOf(event.keyCode) < 0) {
      prevented = true;
      storedPrefix = null;
    }
  }
  let ran = /* @__PURE__ */ new Set();
  let runFor = (binding) => {
    if (binding) {
      for (let cmd2 of binding.run)
        if (!ran.has(cmd2)) {
          ran.add(cmd2);
          if (cmd2(view, event)) {
            if (binding.stopPropagation)
              stopPropagation3 = true;
            return true;
          }
        }
      if (binding.preventDefault) {
        if (binding.stopPropagation)
          stopPropagation3 = true;
        prevented = true;
      }
    }
    return false;
  };
  let scopeObj = map3[scope], baseName, shiftName;
  if (scopeObj) {
    if (runFor(scopeObj[prefix3 + modifiers(name2, event, !isChar)])) {
      handled = true;
    } else if (isChar && (event.altKey || event.metaKey || event.ctrlKey) && // Ctrl-Alt may be used for AltGr on Windows
    !(browser.windows && event.ctrlKey && event.altKey) && (baseName = base[event.keyCode]) && baseName != name2) {
      if (runFor(scopeObj[prefix3 + modifiers(baseName, event, true)])) {
        handled = true;
      } else if (event.shiftKey && (shiftName = shift[event.keyCode]) != name2 && shiftName != baseName && runFor(scopeObj[prefix3 + modifiers(shiftName, event, false)])) {
        handled = true;
      }
    } else if (isChar && event.shiftKey && runFor(scopeObj[prefix3 + modifiers(name2, event, true)])) {
      handled = true;
    }
    if (!handled && runFor(scopeObj._any))
      handled = true;
  }
  if (prevented)
    handled = true;
  if (handled && stopPropagation3)
    event.stopPropagation();
  return handled;
}
var RectangleMarker = class _RectangleMarker {
  /**
  Create a marker with the given class and dimensions. If `width`
  is null, the DOM element will get no width style.
  */
  constructor(className, left, top2, width, height) {
    this.className = className;
    this.left = left;
    this.top = top2;
    this.width = width;
    this.height = height;
  }
  draw() {
    let elt = document.createElement("div");
    elt.className = this.className;
    this.adjust(elt);
    return elt;
  }
  update(elt, prev2) {
    if (prev2.className != this.className)
      return false;
    this.adjust(elt);
    return true;
  }
  adjust(elt) {
    elt.style.left = this.left + "px";
    elt.style.top = this.top + "px";
    if (this.width != null)
      elt.style.width = this.width + "px";
    elt.style.height = this.height + "px";
  }
  eq(p) {
    return this.left == p.left && this.top == p.top && this.width == p.width && this.height == p.height && this.className == p.className;
  }
  /**
  Create a set of rectangles for the given selection range,
  assigning them theclass`className`. Will create a single
  rectangle for empty ranges, and a set of selection-style
  rectangles covering the range's content (in a bidi-aware
  way) for non-empty ones.
  */
  static forRange(view, className, range4) {
    if (range4.empty) {
      let pos = view.coordsAtPos(range4.head, range4.assoc || 1);
      if (!pos)
        return [];
      let base2 = getBase(view);
      return [new _RectangleMarker(className, pos.left - base2.left, pos.top - base2.top, null, pos.bottom - pos.top)];
    } else {
      return rectanglesForRange(view, className, range4);
    }
  }
};
function getBase(view) {
  let rect = view.scrollDOM.getBoundingClientRect();
  let left = view.textDirection == Direction.LTR ? rect.left : rect.right - view.scrollDOM.clientWidth * view.scaleX;
  return { left: left - view.scrollDOM.scrollLeft * view.scaleX, top: rect.top - view.scrollDOM.scrollTop * view.scaleY };
}
function wrappedLine(view, pos, inside2) {
  let range4 = EditorSelection.cursor(pos);
  return {
    from: Math.max(inside2.from, view.moveToLineBoundary(range4, false, true).from),
    to: Math.min(inside2.to, view.moveToLineBoundary(range4, true, true).from),
    type: BlockType.Text
  };
}
function rectanglesForRange(view, className, range4) {
  if (range4.to <= view.viewport.from || range4.from >= view.viewport.to)
    return [];
  let from2 = Math.max(range4.from, view.viewport.from), to = Math.min(range4.to, view.viewport.to);
  let ltr = view.textDirection == Direction.LTR;
  let content2 = view.contentDOM, contentRect = content2.getBoundingClientRect(), base2 = getBase(view);
  let lineElt = content2.querySelector(".cm-line"), lineStyle = lineElt && window.getComputedStyle(lineElt);
  let leftSide = contentRect.left + (lineStyle ? parseInt(lineStyle.paddingLeft) + Math.min(0, parseInt(lineStyle.textIndent)) : 0);
  let rightSide = contentRect.right - (lineStyle ? parseInt(lineStyle.paddingRight) : 0);
  let startBlock = blockAt(view, from2), endBlock = blockAt(view, to);
  let visualStart = startBlock.type == BlockType.Text ? startBlock : null;
  let visualEnd = endBlock.type == BlockType.Text ? endBlock : null;
  if (visualStart && (view.lineWrapping || startBlock.widgetLineBreaks))
    visualStart = wrappedLine(view, from2, visualStart);
  if (visualEnd && (view.lineWrapping || endBlock.widgetLineBreaks))
    visualEnd = wrappedLine(view, to, visualEnd);
  if (visualStart && visualEnd && visualStart.from == visualEnd.from) {
    return pieces(drawForLine(range4.from, range4.to, visualStart));
  } else {
    let top2 = visualStart ? drawForLine(range4.from, null, visualStart) : drawForWidget(startBlock, false);
    let bottom = visualEnd ? drawForLine(null, range4.to, visualEnd) : drawForWidget(endBlock, true);
    let between = [];
    if ((visualStart || startBlock).to < (visualEnd || endBlock).from - (visualStart && visualEnd ? 1 : 0) || startBlock.widgetLineBreaks > 1 && top2.bottom + view.defaultLineHeight / 2 < bottom.top)
      between.push(piece(leftSide, top2.bottom, rightSide, bottom.top));
    else if (top2.bottom < bottom.top && view.elementAtHeight((top2.bottom + bottom.top) / 2).type == BlockType.Text)
      top2.bottom = bottom.top = (top2.bottom + bottom.top) / 2;
    return pieces(top2).concat(between).concat(pieces(bottom));
  }
  function piece(left, top2, right, bottom) {
    return new RectangleMarker(
      className,
      left - base2.left,
      top2 - base2.top - 0.01,
      right - left,
      bottom - top2 + 0.01
      /* C.Epsilon */
    );
  }
  function pieces({ top: top2, bottom, horizontal }) {
    let pieces2 = [];
    for (let i2 = 0; i2 < horizontal.length; i2 += 2)
      pieces2.push(piece(horizontal[i2], top2, horizontal[i2 + 1], bottom));
    return pieces2;
  }
  function drawForLine(from3, to2, line2) {
    let top2 = 1e9, bottom = -1e9, horizontal = [];
    function addSpan(from4, fromOpen, to3, toOpen, dir) {
      let fromCoords = view.coordsAtPos(from4, from4 == line2.to ? -2 : 2);
      let toCoords = view.coordsAtPos(to3, to3 == line2.from ? 2 : -2);
      if (!fromCoords || !toCoords)
        return;
      top2 = Math.min(fromCoords.top, toCoords.top, top2);
      bottom = Math.max(fromCoords.bottom, toCoords.bottom, bottom);
      if (dir == Direction.LTR)
        horizontal.push(ltr && fromOpen ? leftSide : fromCoords.left, ltr && toOpen ? rightSide : toCoords.right);
      else
        horizontal.push(!ltr && toOpen ? leftSide : toCoords.left, !ltr && fromOpen ? rightSide : fromCoords.right);
    }
    let start = from3 !== null && from3 !== void 0 ? from3 : line2.from, end = to2 !== null && to2 !== void 0 ? to2 : line2.to;
    for (let r3 of view.visibleRanges)
      if (r3.to > start && r3.from < end) {
        for (let pos = Math.max(r3.from, start), endPos = Math.min(r3.to, end); ; ) {
          let docLine = view.state.doc.lineAt(pos);
          for (let span of view.bidiSpans(docLine)) {
            let spanFrom = span.from + docLine.from, spanTo = span.to + docLine.from;
            if (spanFrom >= endPos)
              break;
            if (spanTo > pos)
              addSpan(Math.max(spanFrom, pos), from3 == null && spanFrom <= start, Math.min(spanTo, endPos), to2 == null && spanTo >= end, span.dir);
          }
          pos = docLine.to + 1;
          if (pos >= endPos)
            break;
        }
      }
    if (horizontal.length == 0)
      addSpan(start, from3 == null, end, to2 == null, view.textDirection);
    return { top: top2, bottom, horizontal };
  }
  function drawForWidget(block, top2) {
    let y2 = contentRect.top + (top2 ? block.top : block.bottom);
    return { top: y2, bottom: y2, horizontal: [] };
  }
}
function sameMarker(a2, b) {
  return a2.constructor == b.constructor && a2.eq(b);
}
var LayerView = class {
  constructor(view, layer2) {
    this.view = view;
    this.layer = layer2;
    this.drawn = [];
    this.scaleX = 1;
    this.scaleY = 1;
    this.measureReq = { read: this.measure.bind(this), write: this.draw.bind(this) };
    this.dom = view.scrollDOM.appendChild(document.createElement("div"));
    this.dom.classList.add("cm-layer");
    if (layer2.above)
      this.dom.classList.add("cm-layer-above");
    if (layer2.class)
      this.dom.classList.add(layer2.class);
    this.scale();
    this.dom.setAttribute("aria-hidden", "true");
    this.setOrder(view.state);
    view.requestMeasure(this.measureReq);
    if (layer2.mount)
      layer2.mount(this.dom, view);
  }
  update(update) {
    if (update.startState.facet(layerOrder) != update.state.facet(layerOrder))
      this.setOrder(update.state);
    if (this.layer.update(update, this.dom) || update.geometryChanged) {
      this.scale();
      update.view.requestMeasure(this.measureReq);
    }
  }
  setOrder(state) {
    let pos = 0, order = state.facet(layerOrder);
    while (pos < order.length && order[pos] != this.layer)
      pos++;
    this.dom.style.zIndex = String((this.layer.above ? 150 : -1) - pos);
  }
  measure() {
    return this.layer.markers(this.view);
  }
  scale() {
    let { scaleX, scaleY } = this.view;
    if (scaleX != this.scaleX || scaleY != this.scaleY) {
      this.scaleX = scaleX;
      this.scaleY = scaleY;
      this.dom.style.transform = `scale(${1 / scaleX}, ${1 / scaleY})`;
    }
  }
  draw(markers) {
    if (markers.length != this.drawn.length || markers.some((p, i2) => !sameMarker(p, this.drawn[i2]))) {
      let old = this.dom.firstChild, oldI = 0;
      for (let marker of markers) {
        if (marker.update && old && marker.constructor && this.drawn[oldI].constructor && marker.update(old, this.drawn[oldI])) {
          old = old.nextSibling;
          oldI++;
        } else {
          this.dom.insertBefore(marker.draw(), old);
        }
      }
      while (old) {
        let next2 = old.nextSibling;
        old.remove();
        old = next2;
      }
      this.drawn = markers;
    }
  }
  destroy() {
    if (this.layer.destroy)
      this.layer.destroy(this.dom, this.view);
    this.dom.remove();
  }
};
var layerOrder = /* @__PURE__ */ Facet.define();
function layer(config2) {
  return [
    ViewPlugin.define((v4) => new LayerView(v4, config2)),
    layerOrder.of(config2)
  ];
}
var CanHidePrimary = !browser.ios;
var selectionConfig = /* @__PURE__ */ Facet.define({
  combine(configs) {
    return combineConfig(configs, {
      cursorBlinkRate: 1200,
      drawRangeCursor: true
    }, {
      cursorBlinkRate: (a2, b) => Math.min(a2, b),
      drawRangeCursor: (a2, b) => a2 || b
    });
  }
});
function drawSelection(config2 = {}) {
  return [
    selectionConfig.of(config2),
    cursorLayer,
    selectionLayer,
    hideNativeSelection,
    nativeSelectionHidden.of(true)
  ];
}
function configChanged(update) {
  return update.startState.facet(selectionConfig) != update.state.facet(selectionConfig);
}
var cursorLayer = /* @__PURE__ */ layer({
  above: true,
  markers(view) {
    let { state } = view, conf = state.facet(selectionConfig);
    let cursors = [];
    for (let r3 of state.selection.ranges) {
      let prim = r3 == state.selection.main;
      if (r3.empty ? !prim || CanHidePrimary : conf.drawRangeCursor) {
        let className = prim ? "cm-cursor cm-cursor-primary" : "cm-cursor cm-cursor-secondary";
        let cursor3 = r3.empty ? r3 : EditorSelection.cursor(r3.head, r3.head > r3.anchor ? -1 : 1);
        for (let piece of RectangleMarker.forRange(view, className, cursor3))
          cursors.push(piece);
      }
    }
    return cursors;
  },
  update(update, dom) {
    if (update.transactions.some((tr) => tr.selection))
      dom.style.animationName = dom.style.animationName == "cm-blink" ? "cm-blink2" : "cm-blink";
    let confChange = configChanged(update);
    if (confChange)
      setBlinkRate(update.state, dom);
    return update.docChanged || update.selectionSet || confChange;
  },
  mount(dom, view) {
    setBlinkRate(view.state, dom);
  },
  class: "cm-cursorLayer"
});
function setBlinkRate(state, dom) {
  dom.style.animationDuration = state.facet(selectionConfig).cursorBlinkRate + "ms";
}
var selectionLayer = /* @__PURE__ */ layer({
  above: false,
  markers(view) {
    return view.state.selection.ranges.map((r3) => r3.empty ? [] : RectangleMarker.forRange(view, "cm-selectionBackground", r3)).reduce((a2, b) => a2.concat(b));
  },
  update(update, dom) {
    return update.docChanged || update.selectionSet || update.viewportChanged || configChanged(update);
  },
  class: "cm-selectionLayer"
});
var themeSpec = {
  ".cm-line": {
    "& ::selection": { backgroundColor: "transparent !important" },
    "&::selection": { backgroundColor: "transparent !important" }
  }
};
if (CanHidePrimary)
  themeSpec[".cm-line"].caretColor = "transparent !important";
var hideNativeSelection = /* @__PURE__ */ Prec.highest(/* @__PURE__ */ EditorView.theme(themeSpec));
var setDropCursorPos = /* @__PURE__ */ StateEffect.define({
  map(pos, mapping) {
    return pos == null ? null : mapping.mapPos(pos);
  }
});
var dropCursorPos = /* @__PURE__ */ StateField.define({
  create() {
    return null;
  },
  update(pos, tr) {
    if (pos != null)
      pos = tr.changes.mapPos(pos);
    return tr.effects.reduce((pos2, e3) => e3.is(setDropCursorPos) ? e3.value : pos2, pos);
  }
});
var drawDropCursor = /* @__PURE__ */ ViewPlugin.fromClass(class {
  constructor(view) {
    this.view = view;
    this.cursor = null;
    this.measureReq = { read: this.readPos.bind(this), write: this.drawCursor.bind(this) };
  }
  update(update) {
    var _a2;
    let cursorPos = update.state.field(dropCursorPos);
    if (cursorPos == null) {
      if (this.cursor != null) {
        (_a2 = this.cursor) === null || _a2 === void 0 ? void 0 : _a2.remove();
        this.cursor = null;
      }
    } else {
      if (!this.cursor) {
        this.cursor = this.view.scrollDOM.appendChild(document.createElement("div"));
        this.cursor.className = "cm-dropCursor";
      }
      if (update.startState.field(dropCursorPos) != cursorPos || update.docChanged || update.geometryChanged)
        this.view.requestMeasure(this.measureReq);
    }
  }
  readPos() {
    let { view } = this;
    let pos = view.state.field(dropCursorPos);
    let rect = pos != null && view.coordsAtPos(pos);
    if (!rect)
      return null;
    let outer = view.scrollDOM.getBoundingClientRect();
    return {
      left: rect.left - outer.left + view.scrollDOM.scrollLeft * view.scaleX,
      top: rect.top - outer.top + view.scrollDOM.scrollTop * view.scaleY,
      height: rect.bottom - rect.top
    };
  }
  drawCursor(pos) {
    if (this.cursor) {
      let { scaleX, scaleY } = this.view;
      if (pos) {
        this.cursor.style.left = pos.left / scaleX + "px";
        this.cursor.style.top = pos.top / scaleY + "px";
        this.cursor.style.height = pos.height / scaleY + "px";
      } else {
        this.cursor.style.left = "-100000px";
      }
    }
  }
  destroy() {
    if (this.cursor)
      this.cursor.remove();
  }
  setDropPos(pos) {
    if (this.view.state.field(dropCursorPos) != pos)
      this.view.dispatch({ effects: setDropCursorPos.of(pos) });
  }
}, {
  eventObservers: {
    dragover(event) {
      this.setDropPos(this.view.posAtCoords({ x: event.clientX, y: event.clientY }));
    },
    dragleave(event) {
      if (event.target == this.view.contentDOM || !this.view.contentDOM.contains(event.relatedTarget))
        this.setDropPos(null);
    },
    dragend() {
      this.setDropPos(null);
    },
    drop() {
      this.setDropPos(null);
    }
  }
});
function dropCursor() {
  return [dropCursorPos, drawDropCursor];
}
function iterMatches(doc2, re2, from2, to, f) {
  re2.lastIndex = 0;
  for (let cursor3 = doc2.iterRange(from2, to), pos = from2, m; !cursor3.next().done; pos += cursor3.value.length) {
    if (!cursor3.lineBreak)
      while (m = re2.exec(cursor3.value))
        f(pos + m.index, m);
  }
}
function matchRanges(view, maxLength) {
  let visible = view.visibleRanges;
  if (visible.length == 1 && visible[0].from == view.viewport.from && visible[0].to == view.viewport.to)
    return visible;
  let result = [];
  for (let { from: from2, to } of visible) {
    from2 = Math.max(view.state.doc.lineAt(from2).from, from2 - maxLength);
    to = Math.min(view.state.doc.lineAt(to).to, to + maxLength);
    if (result.length && result[result.length - 1].to >= from2)
      result[result.length - 1].to = to;
    else
      result.push({ from: from2, to });
  }
  return result;
}
var MatchDecorator = class {
  /**
  Create a decorator.
  */
  constructor(config2) {
    const { regexp, decoration, decorate, boundary, maxLength = 1e3 } = config2;
    if (!regexp.global)
      throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");
    this.regexp = regexp;
    if (decorate) {
      this.addMatch = (match2, view, from2, add2) => decorate(add2, from2, from2 + match2[0].length, match2, view);
    } else if (typeof decoration == "function") {
      this.addMatch = (match2, view, from2, add2) => {
        let deco = decoration(match2, view, from2);
        if (deco)
          add2(from2, from2 + match2[0].length, deco);
      };
    } else if (decoration) {
      this.addMatch = (match2, _view, from2, add2) => add2(from2, from2 + match2[0].length, decoration);
    } else {
      throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");
    }
    this.boundary = boundary;
    this.maxLength = maxLength;
  }
  /**
  Compute the full set of decorations for matches in the given
  view's viewport. You'll want to call this when initializing your
  plugin.
  */
  createDeco(view) {
    let build = new RangeSetBuilder(), add2 = build.add.bind(build);
    for (let { from: from2, to } of matchRanges(view, this.maxLength))
      iterMatches(view.state.doc, this.regexp, from2, to, (from3, m) => this.addMatch(m, view, from3, add2));
    return build.finish();
  }
  /**
  Update a set of decorations for a view update. `deco` _must_ be
  the set of decorations produced by _this_ `MatchDecorator` for
  the view state before the update.
  */
  updateDeco(update, deco) {
    let changeFrom = 1e9, changeTo = -1;
    if (update.docChanged)
      update.changes.iterChanges((_f, _t, from2, to) => {
        if (to > update.view.viewport.from && from2 < update.view.viewport.to) {
          changeFrom = Math.min(from2, changeFrom);
          changeTo = Math.max(to, changeTo);
        }
      });
    if (update.viewportChanged || changeTo - changeFrom > 1e3)
      return this.createDeco(update.view);
    if (changeTo > -1)
      return this.updateRange(update.view, deco.map(update.changes), changeFrom, changeTo);
    return deco;
  }
  updateRange(view, deco, updateFrom, updateTo) {
    for (let r3 of view.visibleRanges) {
      let from2 = Math.max(r3.from, updateFrom), to = Math.min(r3.to, updateTo);
      if (to > from2) {
        let fromLine = view.state.doc.lineAt(from2), toLine = fromLine.to < to ? view.state.doc.lineAt(to) : fromLine;
        let start = Math.max(r3.from, fromLine.from), end = Math.min(r3.to, toLine.to);
        if (this.boundary) {
          for (; from2 > fromLine.from; from2--)
            if (this.boundary.test(fromLine.text[from2 - 1 - fromLine.from])) {
              start = from2;
              break;
            }
          for (; to < toLine.to; to++)
            if (this.boundary.test(toLine.text[to - toLine.from])) {
              end = to;
              break;
            }
        }
        let ranges = [], m;
        let add2 = (from3, to2, deco2) => ranges.push(deco2.range(from3, to2));
        if (fromLine == toLine) {
          this.regexp.lastIndex = start - fromLine.from;
          while ((m = this.regexp.exec(fromLine.text)) && m.index < end - fromLine.from)
            this.addMatch(m, view, m.index + fromLine.from, add2);
        } else {
          iterMatches(view.state.doc, this.regexp, start, end, (from3, m2) => this.addMatch(m2, view, from3, add2));
        }
        deco = deco.update({ filterFrom: start, filterTo: end, filter: (from3, to2) => from3 < start || to2 > end, add: ranges });
      }
    }
    return deco;
  }
};
var UnicodeRegexpSupport = /x/.unicode != null ? "gu" : "g";
var Specials = /* @__PURE__ */ new RegExp("[\0-\b\n-\x7F-\x9F\xAD\u061C\u200B\u200E\u200F\u2028\u2029\u202D\u202E\u2066\u2067\u2069\uFEFF\uFFF9-\uFFFC]", UnicodeRegexpSupport);
var Names = {
  0: "null",
  7: "bell",
  8: "backspace",
  10: "newline",
  11: "vertical tab",
  13: "carriage return",
  27: "escape",
  8203: "zero width space",
  8204: "zero width non-joiner",
  8205: "zero width joiner",
  8206: "left-to-right mark",
  8207: "right-to-left mark",
  8232: "line separator",
  8237: "left-to-right override",
  8238: "right-to-left override",
  8294: "left-to-right isolate",
  8295: "right-to-left isolate",
  8297: "pop directional isolate",
  8233: "paragraph separator",
  65279: "zero width no-break space",
  65532: "object replacement"
};
var _supportsTabSize = null;
function supportsTabSize() {
  var _a2;
  if (_supportsTabSize == null && typeof document != "undefined" && document.body) {
    let styles = document.body.style;
    _supportsTabSize = ((_a2 = styles.tabSize) !== null && _a2 !== void 0 ? _a2 : styles.MozTabSize) != null;
  }
  return _supportsTabSize || false;
}
var specialCharConfig = /* @__PURE__ */ Facet.define({
  combine(configs) {
    let config2 = combineConfig(configs, {
      render: null,
      specialChars: Specials,
      addSpecialChars: null
    });
    if (config2.replaceTabs = !supportsTabSize())
      config2.specialChars = new RegExp("	|" + config2.specialChars.source, UnicodeRegexpSupport);
    if (config2.addSpecialChars)
      config2.specialChars = new RegExp(config2.specialChars.source + "|" + config2.addSpecialChars.source, UnicodeRegexpSupport);
    return config2;
  }
});
function highlightSpecialChars(config2 = {}) {
  return [specialCharConfig.of(config2), specialCharPlugin()];
}
var _plugin = null;
function specialCharPlugin() {
  return _plugin || (_plugin = ViewPlugin.fromClass(class {
    constructor(view) {
      this.view = view;
      this.decorations = Decoration.none;
      this.decorationCache = /* @__PURE__ */ Object.create(null);
      this.decorator = this.makeDecorator(view.state.facet(specialCharConfig));
      this.decorations = this.decorator.createDeco(view);
    }
    makeDecorator(conf) {
      return new MatchDecorator({
        regexp: conf.specialChars,
        decoration: (m, view, pos) => {
          let { doc: doc2 } = view.state;
          let code = codePointAt(m[0], 0);
          if (code == 9) {
            let line2 = doc2.lineAt(pos);
            let size = view.state.tabSize, col = countColumn(line2.text, size, pos - line2.from);
            return Decoration.replace({
              widget: new TabWidget((size - col % size) * this.view.defaultCharacterWidth / this.view.scaleX)
            });
          }
          return this.decorationCache[code] || (this.decorationCache[code] = Decoration.replace({ widget: new SpecialCharWidget(conf, code) }));
        },
        boundary: conf.replaceTabs ? void 0 : /[^]/
      });
    }
    update(update) {
      let conf = update.state.facet(specialCharConfig);
      if (update.startState.facet(specialCharConfig) != conf) {
        this.decorator = this.makeDecorator(conf);
        this.decorations = this.decorator.createDeco(update.view);
      } else {
        this.decorations = this.decorator.updateDeco(update, this.decorations);
      }
    }
  }, {
    decorations: (v4) => v4.decorations
  }));
}
var DefaultPlaceholder = "\u2022";
function placeholder$1(code) {
  if (code >= 32)
    return DefaultPlaceholder;
  if (code == 10)
    return "\u2424";
  return String.fromCharCode(9216 + code);
}
var SpecialCharWidget = class extends WidgetType {
  constructor(options, code) {
    super();
    this.options = options;
    this.code = code;
  }
  eq(other) {
    return other.code == this.code;
  }
  toDOM(view) {
    let ph = placeholder$1(this.code);
    let desc = view.state.phrase("Control character") + " " + (Names[this.code] || "0x" + this.code.toString(16));
    let custom = this.options.render && this.options.render(this.code, desc, ph);
    if (custom)
      return custom;
    let span = document.createElement("span");
    span.textContent = ph;
    span.title = desc;
    span.setAttribute("aria-label", desc);
    span.className = "cm-specialChar";
    return span;
  }
  ignoreEvent() {
    return false;
  }
};
var TabWidget = class extends WidgetType {
  constructor(width) {
    super();
    this.width = width;
  }
  eq(other) {
    return other.width == this.width;
  }
  toDOM() {
    let span = document.createElement("span");
    span.textContent = "	";
    span.className = "cm-tab";
    span.style.width = this.width + "px";
    return span;
  }
  ignoreEvent() {
    return false;
  }
};
function highlightActiveLine() {
  return activeLineHighlighter;
}
var lineDeco = /* @__PURE__ */ Decoration.line({ class: "cm-activeLine" });
var activeLineHighlighter = /* @__PURE__ */ ViewPlugin.fromClass(class {
  constructor(view) {
    this.decorations = this.getDeco(view);
  }
  update(update) {
    if (update.docChanged || update.selectionSet)
      this.decorations = this.getDeco(update.view);
  }
  getDeco(view) {
    let lastLineStart = -1, deco = [];
    for (let r3 of view.state.selection.ranges) {
      let line2 = view.lineBlockAt(r3.head);
      if (line2.from > lastLineStart) {
        deco.push(lineDeco.range(line2.from));
        lastLineStart = line2.from;
      }
    }
    return Decoration.set(deco);
  }
}, {
  decorations: (v4) => v4.decorations
});
var Placeholder = class extends WidgetType {
  constructor(content2) {
    super();
    this.content = content2;
  }
  toDOM() {
    let wrap = document.createElement("span");
    wrap.className = "cm-placeholder";
    wrap.style.pointerEvents = "none";
    wrap.appendChild(typeof this.content == "string" ? document.createTextNode(this.content) : this.content);
    if (typeof this.content == "string")
      wrap.setAttribute("aria-label", "placeholder " + this.content);
    else
      wrap.setAttribute("aria-hidden", "true");
    return wrap;
  }
  coordsAt(dom) {
    let rects = dom.firstChild ? clientRectsFor(dom.firstChild) : [];
    if (!rects.length)
      return null;
    let style = window.getComputedStyle(dom.parentNode);
    let rect = flattenRect(rects[0], style.direction != "rtl");
    let lineHeight = parseInt(style.lineHeight);
    if (rect.bottom - rect.top > lineHeight * 1.5)
      return { left: rect.left, right: rect.right, top: rect.top, bottom: rect.top + lineHeight };
    return rect;
  }
  ignoreEvent() {
    return false;
  }
};
function placeholder(content2) {
  return ViewPlugin.fromClass(class {
    constructor(view) {
      this.view = view;
      this.placeholder = content2 ? Decoration.set([Decoration.widget({ widget: new Placeholder(content2), side: 1 }).range(0)]) : Decoration.none;
    }
    get decorations() {
      return this.view.state.doc.length ? Decoration.none : this.placeholder;
    }
  }, { decorations: (v4) => v4.decorations });
}
var MaxOff = 2e3;
function rectangleFor(state, a2, b) {
  let startLine = Math.min(a2.line, b.line), endLine = Math.max(a2.line, b.line);
  let ranges = [];
  if (a2.off > MaxOff || b.off > MaxOff || a2.col < 0 || b.col < 0) {
    let startOff = Math.min(a2.off, b.off), endOff = Math.max(a2.off, b.off);
    for (let i2 = startLine; i2 <= endLine; i2++) {
      let line2 = state.doc.line(i2);
      if (line2.length <= endOff)
        ranges.push(EditorSelection.range(line2.from + startOff, line2.to + endOff));
    }
  } else {
    let startCol = Math.min(a2.col, b.col), endCol = Math.max(a2.col, b.col);
    for (let i2 = startLine; i2 <= endLine; i2++) {
      let line2 = state.doc.line(i2);
      let start = findColumn(line2.text, startCol, state.tabSize, true);
      if (start < 0) {
        ranges.push(EditorSelection.cursor(line2.to));
      } else {
        let end = findColumn(line2.text, endCol, state.tabSize);
        ranges.push(EditorSelection.range(line2.from + start, line2.from + end));
      }
    }
  }
  return ranges;
}
function absoluteColumn(view, x2) {
  let ref = view.coordsAtPos(view.viewport.from);
  return ref ? Math.round(Math.abs((ref.left - x2) / view.defaultCharacterWidth)) : -1;
}
function getPos(view, event) {
  let offset = view.posAtCoords({ x: event.clientX, y: event.clientY }, false);
  let line2 = view.state.doc.lineAt(offset), off = offset - line2.from;
  let col = off > MaxOff ? -1 : off == line2.length ? absoluteColumn(view, event.clientX) : countColumn(line2.text, view.state.tabSize, offset - line2.from);
  return { line: line2.number, col, off };
}
function rectangleSelectionStyle(view, event) {
  let start = getPos(view, event), startSel = view.state.selection;
  if (!start)
    return null;
  return {
    update(update) {
      if (update.docChanged) {
        let newStart = update.changes.mapPos(update.startState.doc.line(start.line).from);
        let newLine = update.state.doc.lineAt(newStart);
        start = { line: newLine.number, col: start.col, off: Math.min(start.off, newLine.length) };
        startSel = startSel.map(update.changes);
      }
    },
    get(event2, _extend, multiple) {
      let cur2 = getPos(view, event2);
      if (!cur2)
        return startSel;
      let ranges = rectangleFor(view.state, start, cur2);
      if (!ranges.length)
        return startSel;
      if (multiple)
        return EditorSelection.create(ranges.concat(startSel.ranges));
      else
        return EditorSelection.create(ranges);
    }
  };
}
function rectangularSelection(options) {
  let filter = (options === null || options === void 0 ? void 0 : options.eventFilter) || ((e3) => e3.altKey && e3.button == 0);
  return EditorView.mouseSelectionStyle.of((view, event) => filter(event) ? rectangleSelectionStyle(view, event) : null);
}
var keys2 = {
  Alt: [18, (e3) => !!e3.altKey],
  Control: [17, (e3) => !!e3.ctrlKey],
  Shift: [16, (e3) => !!e3.shiftKey],
  Meta: [91, (e3) => !!e3.metaKey]
};
var showCrosshair = { style: "cursor: crosshair" };
function crosshairCursor(options = {}) {
  let [code, getter] = keys2[options.key || "Alt"];
  let plugin = ViewPlugin.fromClass(class {
    constructor(view) {
      this.view = view;
      this.isDown = false;
    }
    set(isDown) {
      if (this.isDown != isDown) {
        this.isDown = isDown;
        this.view.update([]);
      }
    }
  }, {
    eventObservers: {
      keydown(e3) {
        this.set(e3.keyCode == code || getter(e3));
      },
      keyup(e3) {
        if (e3.keyCode == code || !getter(e3))
          this.set(false);
      },
      mousemove(e3) {
        this.set(getter(e3));
      }
    }
  });
  return [
    plugin,
    EditorView.contentAttributes.of((view) => {
      var _a2;
      return ((_a2 = view.plugin(plugin)) === null || _a2 === void 0 ? void 0 : _a2.isDown) ? showCrosshair : null;
    })
  ];
}
var Outside = "-10000px";
var TooltipViewManager = class {
  constructor(view, facet, createTooltipView) {
    this.facet = facet;
    this.createTooltipView = createTooltipView;
    this.input = view.state.facet(facet);
    this.tooltips = this.input.filter((t3) => t3);
    this.tooltipViews = this.tooltips.map(createTooltipView);
  }
  update(update, above) {
    var _a2;
    let input = update.state.facet(this.facet);
    let tooltips = input.filter((x2) => x2);
    if (input === this.input) {
      for (let t3 of this.tooltipViews)
        if (t3.update)
          t3.update(update);
      return false;
    }
    let tooltipViews = [], newAbove = above ? [] : null;
    for (let i2 = 0; i2 < tooltips.length; i2++) {
      let tip = tooltips[i2], known = -1;
      if (!tip)
        continue;
      for (let i3 = 0; i3 < this.tooltips.length; i3++) {
        let other = this.tooltips[i3];
        if (other && other.create == tip.create)
          known = i3;
      }
      if (known < 0) {
        tooltipViews[i2] = this.createTooltipView(tip);
        if (newAbove)
          newAbove[i2] = !!tip.above;
      } else {
        let tooltipView = tooltipViews[i2] = this.tooltipViews[known];
        if (newAbove)
          newAbove[i2] = above[known];
        if (tooltipView.update)
          tooltipView.update(update);
      }
    }
    for (let t3 of this.tooltipViews)
      if (tooltipViews.indexOf(t3) < 0) {
        t3.dom.remove();
        (_a2 = t3.destroy) === null || _a2 === void 0 ? void 0 : _a2.call(t3);
      }
    if (above) {
      newAbove.forEach((val, i2) => above[i2] = val);
      above.length = newAbove.length;
    }
    this.input = input;
    this.tooltips = tooltips;
    this.tooltipViews = tooltipViews;
    return true;
  }
};
function windowSpace(view) {
  let { win } = view;
  return { top: 0, left: 0, bottom: win.innerHeight, right: win.innerWidth };
}
var tooltipConfig = /* @__PURE__ */ Facet.define({
  combine: (values2) => {
    var _a2, _b, _c;
    return {
      position: browser.ios ? "absolute" : ((_a2 = values2.find((conf) => conf.position)) === null || _a2 === void 0 ? void 0 : _a2.position) || "fixed",
      parent: ((_b = values2.find((conf) => conf.parent)) === null || _b === void 0 ? void 0 : _b.parent) || null,
      tooltipSpace: ((_c = values2.find((conf) => conf.tooltipSpace)) === null || _c === void 0 ? void 0 : _c.tooltipSpace) || windowSpace
    };
  }
});
var knownHeight = /* @__PURE__ */ new WeakMap();
var tooltipPlugin = /* @__PURE__ */ ViewPlugin.fromClass(class {
  constructor(view) {
    this.view = view;
    this.above = [];
    this.inView = true;
    this.madeAbsolute = false;
    this.lastTransaction = 0;
    this.measureTimeout = -1;
    let config2 = view.state.facet(tooltipConfig);
    this.position = config2.position;
    this.parent = config2.parent;
    this.classes = view.themeClasses;
    this.createContainer();
    this.measureReq = { read: this.readMeasure.bind(this), write: this.writeMeasure.bind(this), key: this };
    this.manager = new TooltipViewManager(view, showTooltip, (t3) => this.createTooltip(t3));
    this.intersectionObserver = typeof IntersectionObserver == "function" ? new IntersectionObserver((entries) => {
      if (Date.now() > this.lastTransaction - 50 && entries.length > 0 && entries[entries.length - 1].intersectionRatio < 1)
        this.measureSoon();
    }, { threshold: [1] }) : null;
    this.observeIntersection();
    view.win.addEventListener("resize", this.measureSoon = this.measureSoon.bind(this));
    this.maybeMeasure();
  }
  createContainer() {
    if (this.parent) {
      this.container = document.createElement("div");
      this.container.style.position = "relative";
      this.container.className = this.view.themeClasses;
      this.parent.appendChild(this.container);
    } else {
      this.container = this.view.dom;
    }
  }
  observeIntersection() {
    if (this.intersectionObserver) {
      this.intersectionObserver.disconnect();
      for (let tooltip of this.manager.tooltipViews)
        this.intersectionObserver.observe(tooltip.dom);
    }
  }
  measureSoon() {
    if (this.measureTimeout < 0)
      this.measureTimeout = setTimeout(() => {
        this.measureTimeout = -1;
        this.maybeMeasure();
      }, 50);
  }
  update(update) {
    if (update.transactions.length)
      this.lastTransaction = Date.now();
    let updated = this.manager.update(update, this.above);
    if (updated)
      this.observeIntersection();
    let shouldMeasure = updated || update.geometryChanged;
    let newConfig = update.state.facet(tooltipConfig);
    if (newConfig.position != this.position && !this.madeAbsolute) {
      this.position = newConfig.position;
      for (let t3 of this.manager.tooltipViews)
        t3.dom.style.position = this.position;
      shouldMeasure = true;
    }
    if (newConfig.parent != this.parent) {
      if (this.parent)
        this.container.remove();
      this.parent = newConfig.parent;
      this.createContainer();
      for (let t3 of this.manager.tooltipViews)
        this.container.appendChild(t3.dom);
      shouldMeasure = true;
    } else if (this.parent && this.view.themeClasses != this.classes) {
      this.classes = this.container.className = this.view.themeClasses;
    }
    if (shouldMeasure)
      this.maybeMeasure();
  }
  createTooltip(tooltip) {
    let tooltipView = tooltip.create(this.view);
    tooltipView.dom.classList.add("cm-tooltip");
    if (tooltip.arrow && !tooltipView.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")) {
      let arrow = document.createElement("div");
      arrow.className = "cm-tooltip-arrow";
      tooltipView.dom.appendChild(arrow);
    }
    tooltipView.dom.style.position = this.position;
    tooltipView.dom.style.top = Outside;
    tooltipView.dom.style.left = "0px";
    this.container.appendChild(tooltipView.dom);
    if (tooltipView.mount)
      tooltipView.mount(this.view);
    return tooltipView;
  }
  destroy() {
    var _a2, _b;
    this.view.win.removeEventListener("resize", this.measureSoon);
    for (let tooltipView of this.manager.tooltipViews) {
      tooltipView.dom.remove();
      (_a2 = tooltipView.destroy) === null || _a2 === void 0 ? void 0 : _a2.call(tooltipView);
    }
    if (this.parent)
      this.container.remove();
    (_b = this.intersectionObserver) === null || _b === void 0 ? void 0 : _b.disconnect();
    clearTimeout(this.measureTimeout);
  }
  readMeasure() {
    let editor = this.view.dom.getBoundingClientRect();
    let scaleX = 1, scaleY = 1, makeAbsolute = false;
    if (this.position == "fixed" && this.manager.tooltipViews.length) {
      let { dom } = this.manager.tooltipViews[0];
      if (browser.gecko) {
        makeAbsolute = dom.offsetParent != this.container.ownerDocument.body;
      } else {
        if (this.view.scaleX != 1 || this.view.scaleY != 1) {
          makeAbsolute = true;
        } else if (dom.style.top == Outside && dom.style.left == "0px") {
          let rect = dom.getBoundingClientRect();
          makeAbsolute = Math.abs(rect.top + 1e4) > 1 || Math.abs(rect.left) > 1;
        }
      }
    }
    if (makeAbsolute || this.position == "absolute") {
      if (this.parent) {
        let rect = this.parent.getBoundingClientRect();
        if (rect.width && rect.height) {
          scaleX = rect.width / this.parent.offsetWidth;
          scaleY = rect.height / this.parent.offsetHeight;
        }
      } else {
        ({ scaleX, scaleY } = this.view.viewState);
      }
    }
    return {
      editor,
      parent: this.parent ? this.container.getBoundingClientRect() : editor,
      pos: this.manager.tooltips.map((t3, i2) => {
        let tv = this.manager.tooltipViews[i2];
        return tv.getCoords ? tv.getCoords(t3.pos) : this.view.coordsAtPos(t3.pos);
      }),
      size: this.manager.tooltipViews.map(({ dom }) => dom.getBoundingClientRect()),
      space: this.view.state.facet(tooltipConfig).tooltipSpace(this.view),
      scaleX,
      scaleY,
      makeAbsolute
    };
  }
  writeMeasure(measured) {
    var _a2;
    if (measured.makeAbsolute) {
      this.madeAbsolute = true;
      this.position = "absolute";
      for (let t3 of this.manager.tooltipViews)
        t3.dom.style.position = "absolute";
    }
    let { editor, space: space2, scaleX, scaleY } = measured;
    let others = [];
    for (let i2 = 0; i2 < this.manager.tooltips.length; i2++) {
      let tooltip = this.manager.tooltips[i2], tView = this.manager.tooltipViews[i2], { dom } = tView;
      let pos = measured.pos[i2], size = measured.size[i2];
      if (!pos || pos.bottom <= Math.max(editor.top, space2.top) || pos.top >= Math.min(editor.bottom, space2.bottom) || pos.right < Math.max(editor.left, space2.left) - 0.1 || pos.left > Math.min(editor.right, space2.right) + 0.1) {
        dom.style.top = Outside;
        continue;
      }
      let arrow = tooltip.arrow ? tView.dom.querySelector(".cm-tooltip-arrow") : null;
      let arrowHeight = arrow ? 7 : 0;
      let width = size.right - size.left, height = (_a2 = knownHeight.get(tView)) !== null && _a2 !== void 0 ? _a2 : size.bottom - size.top;
      let offset = tView.offset || noOffset, ltr = this.view.textDirection == Direction.LTR;
      let left = size.width > space2.right - space2.left ? ltr ? space2.left : space2.right - size.width : ltr ? Math.min(pos.left - (arrow ? 14 : 0) + offset.x, space2.right - width) : Math.max(space2.left, pos.left - width + (arrow ? 14 : 0) - offset.x);
      let above = this.above[i2];
      if (!tooltip.strictSide && (above ? pos.top - (size.bottom - size.top) - offset.y < space2.top : pos.bottom + (size.bottom - size.top) + offset.y > space2.bottom) && above == space2.bottom - pos.bottom > pos.top - space2.top)
        above = this.above[i2] = !above;
      let spaceVert = (above ? pos.top - space2.top : space2.bottom - pos.bottom) - arrowHeight;
      if (spaceVert < height && tView.resize !== false) {
        if (spaceVert < this.view.defaultLineHeight) {
          dom.style.top = Outside;
          continue;
        }
        knownHeight.set(tView, height);
        dom.style.height = (height = spaceVert) / scaleY + "px";
      } else if (dom.style.height) {
        dom.style.height = "";
      }
      let top2 = above ? pos.top - height - arrowHeight - offset.y : pos.bottom + arrowHeight + offset.y;
      let right = left + width;
      if (tView.overlap !== true) {
        for (let r3 of others)
          if (r3.left < right && r3.right > left && r3.top < top2 + height && r3.bottom > top2)
            top2 = above ? r3.top - height - 2 - arrowHeight : r3.bottom + arrowHeight + 2;
      }
      if (this.position == "absolute") {
        dom.style.top = (top2 - measured.parent.top) / scaleY + "px";
        dom.style.left = (left - measured.parent.left) / scaleX + "px";
      } else {
        dom.style.top = top2 / scaleY + "px";
        dom.style.left = left / scaleX + "px";
      }
      if (arrow) {
        let arrowLeft = pos.left + (ltr ? offset.x : -offset.x) - (left + 14 - 7);
        arrow.style.left = arrowLeft / scaleX + "px";
      }
      if (tView.overlap !== true)
        others.push({ left, top: top2, right, bottom: top2 + height });
      dom.classList.toggle("cm-tooltip-above", above);
      dom.classList.toggle("cm-tooltip-below", !above);
      if (tView.positioned)
        tView.positioned(measured.space);
    }
  }
  maybeMeasure() {
    if (this.manager.tooltips.length) {
      if (this.view.inView)
        this.view.requestMeasure(this.measureReq);
      if (this.inView != this.view.inView) {
        this.inView = this.view.inView;
        if (!this.inView)
          for (let tv of this.manager.tooltipViews)
            tv.dom.style.top = Outside;
      }
    }
  }
}, {
  eventObservers: {
    scroll() {
      this.maybeMeasure();
    }
  }
});
var baseTheme = /* @__PURE__ */ EditorView.baseTheme({
  ".cm-tooltip": {
    zIndex: 100,
    boxSizing: "border-box"
  },
  "&light .cm-tooltip": {
    border: "1px solid #bbb",
    backgroundColor: "#f5f5f5"
  },
  "&light .cm-tooltip-section:not(:first-child)": {
    borderTop: "1px solid #bbb"
  },
  "&dark .cm-tooltip": {
    backgroundColor: "#333338",
    color: "white"
  },
  ".cm-tooltip-arrow": {
    height: `${7}px`,
    width: `${7 * 2}px`,
    position: "absolute",
    zIndex: -1,
    overflow: "hidden",
    "&:before, &:after": {
      content: "''",
      position: "absolute",
      width: 0,
      height: 0,
      borderLeft: `${7}px solid transparent`,
      borderRight: `${7}px solid transparent`
    },
    ".cm-tooltip-above &": {
      bottom: `-${7}px`,
      "&:before": {
        borderTop: `${7}px solid #bbb`
      },
      "&:after": {
        borderTop: `${7}px solid #f5f5f5`,
        bottom: "1px"
      }
    },
    ".cm-tooltip-below &": {
      top: `-${7}px`,
      "&:before": {
        borderBottom: `${7}px solid #bbb`
      },
      "&:after": {
        borderBottom: `${7}px solid #f5f5f5`,
        top: "1px"
      }
    }
  },
  "&dark .cm-tooltip .cm-tooltip-arrow": {
    "&:before": {
      borderTopColor: "#333338",
      borderBottomColor: "#333338"
    },
    "&:after": {
      borderTopColor: "transparent",
      borderBottomColor: "transparent"
    }
  }
});
var noOffset = { x: 0, y: 0 };
var showTooltip = /* @__PURE__ */ Facet.define({
  enables: [tooltipPlugin, baseTheme]
});
var showHoverTooltip = /* @__PURE__ */ Facet.define();
var HoverTooltipHost = class _HoverTooltipHost {
  // Needs to be static so that host tooltip instances always match
  static create(view) {
    return new _HoverTooltipHost(view);
  }
  constructor(view) {
    this.view = view;
    this.mounted = false;
    this.dom = document.createElement("div");
    this.dom.classList.add("cm-tooltip-hover");
    this.manager = new TooltipViewManager(view, showHoverTooltip, (t3) => this.createHostedView(t3));
  }
  createHostedView(tooltip) {
    let hostedView = tooltip.create(this.view);
    hostedView.dom.classList.add("cm-tooltip-section");
    this.dom.appendChild(hostedView.dom);
    if (this.mounted && hostedView.mount)
      hostedView.mount(this.view);
    return hostedView;
  }
  mount(view) {
    for (let hostedView of this.manager.tooltipViews) {
      if (hostedView.mount)
        hostedView.mount(view);
    }
    this.mounted = true;
  }
  positioned(space2) {
    for (let hostedView of this.manager.tooltipViews) {
      if (hostedView.positioned)
        hostedView.positioned(space2);
    }
  }
  update(update) {
    this.manager.update(update);
  }
  destroy() {
    var _a2;
    for (let t3 of this.manager.tooltipViews)
      (_a2 = t3.destroy) === null || _a2 === void 0 ? void 0 : _a2.call(t3);
  }
  passProp(name2) {
    let value = void 0;
    for (let view of this.manager.tooltipViews) {
      let given = view[name2];
      if (given !== void 0) {
        if (value === void 0)
          value = given;
        else if (value !== given)
          return void 0;
      }
    }
    return value;
  }
  get offset() {
    return this.passProp("offset");
  }
  get getCoords() {
    return this.passProp("getCoords");
  }
  get overlap() {
    return this.passProp("overlap");
  }
  get resize() {
    return this.passProp("resize");
  }
};
var showHoverTooltipHost = /* @__PURE__ */ showTooltip.compute([showHoverTooltip], (state) => {
  let tooltips = state.facet(showHoverTooltip).filter((t3) => t3);
  if (tooltips.length === 0)
    return null;
  return {
    pos: Math.min(...tooltips.map((t3) => t3.pos)),
    end: Math.max(...tooltips.filter((t3) => t3.end != null).map((t3) => t3.end)),
    create: HoverTooltipHost.create,
    above: tooltips[0].above,
    arrow: tooltips.some((t3) => t3.arrow)
  };
});
var HoverPlugin = class {
  constructor(view, source, field, setHover, hoverTime) {
    this.view = view;
    this.source = source;
    this.field = field;
    this.setHover = setHover;
    this.hoverTime = hoverTime;
    this.hoverTimeout = -1;
    this.restartTimeout = -1;
    this.pending = null;
    this.lastMove = { x: 0, y: 0, target: view.dom, time: 0 };
    this.checkHover = this.checkHover.bind(this);
    view.dom.addEventListener("mouseleave", this.mouseleave = this.mouseleave.bind(this));
    view.dom.addEventListener("mousemove", this.mousemove = this.mousemove.bind(this));
  }
  update() {
    if (this.pending) {
      this.pending = null;
      clearTimeout(this.restartTimeout);
      this.restartTimeout = setTimeout(() => this.startHover(), 20);
    }
  }
  get active() {
    return this.view.state.field(this.field);
  }
  checkHover() {
    this.hoverTimeout = -1;
    if (this.active)
      return;
    let hovered = Date.now() - this.lastMove.time;
    if (hovered < this.hoverTime)
      this.hoverTimeout = setTimeout(this.checkHover, this.hoverTime - hovered);
    else
      this.startHover();
  }
  startHover() {
    clearTimeout(this.restartTimeout);
    let { view, lastMove } = this;
    let desc = view.docView.nearest(lastMove.target);
    if (!desc)
      return;
    let pos, side = 1;
    if (desc instanceof WidgetView) {
      pos = desc.posAtStart;
    } else {
      pos = view.posAtCoords(lastMove);
      if (pos == null)
        return;
      let posCoords = view.coordsAtPos(pos);
      if (!posCoords || lastMove.y < posCoords.top || lastMove.y > posCoords.bottom || lastMove.x < posCoords.left - view.defaultCharacterWidth || lastMove.x > posCoords.right + view.defaultCharacterWidth)
        return;
      let bidi = view.bidiSpans(view.state.doc.lineAt(pos)).find((s2) => s2.from <= pos && s2.to >= pos);
      let rtl2 = bidi && bidi.dir == Direction.RTL ? -1 : 1;
      side = lastMove.x < posCoords.left ? -rtl2 : rtl2;
    }
    let open = this.source(view, pos, side);
    if (open === null || open === void 0 ? void 0 : open.then) {
      let pending = this.pending = { pos };
      open.then((result) => {
        if (this.pending == pending) {
          this.pending = null;
          if (result)
            view.dispatch({ effects: this.setHover.of(result) });
        }
      }, (e3) => logException(view.state, e3, "hover tooltip"));
    } else if (open) {
      view.dispatch({ effects: this.setHover.of(open) });
    }
  }
  mousemove(event) {
    var _a2;
    this.lastMove = { x: event.clientX, y: event.clientY, target: event.target, time: Date.now() };
    if (this.hoverTimeout < 0)
      this.hoverTimeout = setTimeout(this.checkHover, this.hoverTime);
    let tooltip = this.active;
    if (tooltip && !isInTooltip(this.lastMove.target) || this.pending) {
      let { pos } = tooltip || this.pending, end = (_a2 = tooltip === null || tooltip === void 0 ? void 0 : tooltip.end) !== null && _a2 !== void 0 ? _a2 : pos;
      if (pos == end ? this.view.posAtCoords(this.lastMove) != pos : !isOverRange(this.view, pos, end, event.clientX, event.clientY)) {
        this.view.dispatch({ effects: this.setHover.of(null) });
        this.pending = null;
      }
    }
  }
  mouseleave(e3) {
    clearTimeout(this.hoverTimeout);
    this.hoverTimeout = -1;
    if (this.active && !isInTooltip(e3.relatedTarget))
      this.view.dispatch({ effects: this.setHover.of(null) });
  }
  destroy() {
    clearTimeout(this.hoverTimeout);
    this.view.dom.removeEventListener("mouseleave", this.mouseleave);
    this.view.dom.removeEventListener("mousemove", this.mousemove);
  }
};
function isInTooltip(elt) {
  for (let cur2 = elt; cur2; cur2 = cur2.parentNode)
    if (cur2.nodeType == 1 && cur2.classList.contains("cm-tooltip"))
      return true;
  return false;
}
function isOverRange(view, from2, to, x2, y2, margin) {
  let rect = view.scrollDOM.getBoundingClientRect();
  let docBottom = view.documentTop + view.documentPadding.top + view.contentHeight;
  if (rect.left > x2 || rect.right < x2 || rect.top > y2 || Math.min(rect.bottom, docBottom) < y2)
    return false;
  let pos = view.posAtCoords({ x: x2, y: y2 }, false);
  return pos >= from2 && pos <= to;
}
function hoverTooltip(source, options = {}) {
  let setHover = StateEffect.define();
  let hoverState = StateField.define({
    create() {
      return null;
    },
    update(value, tr) {
      if (value && (options.hideOnChange && (tr.docChanged || tr.selection) || options.hideOn && options.hideOn(tr, value)))
        return null;
      if (value && tr.docChanged) {
        let newPos = tr.changes.mapPos(value.pos, -1, MapMode.TrackDel);
        if (newPos == null)
          return null;
        let copy4 = Object.assign(/* @__PURE__ */ Object.create(null), value);
        copy4.pos = newPos;
        if (value.end != null)
          copy4.end = tr.changes.mapPos(value.end);
        value = copy4;
      }
      for (let effect of tr.effects) {
        if (effect.is(setHover))
          value = effect.value;
        if (effect.is(closeHoverTooltipEffect))
          value = null;
      }
      return value;
    },
    provide: (f) => showHoverTooltip.from(f)
  });
  return [
    hoverState,
    ViewPlugin.define((view) => new HoverPlugin(
      view,
      source,
      hoverState,
      setHover,
      options.hoverTime || 300
      /* Hover.Time */
    )),
    showHoverTooltipHost
  ];
}
function getTooltip(view, tooltip) {
  let plugin = view.plugin(tooltipPlugin);
  if (!plugin)
    return null;
  let found = plugin.manager.tooltips.indexOf(tooltip);
  return found < 0 ? null : plugin.manager.tooltipViews[found];
}
var closeHoverTooltipEffect = /* @__PURE__ */ StateEffect.define();
var panelConfig = /* @__PURE__ */ Facet.define({
  combine(configs) {
    let topContainer, bottomContainer;
    for (let c4 of configs) {
      topContainer = topContainer || c4.topContainer;
      bottomContainer = bottomContainer || c4.bottomContainer;
    }
    return { topContainer, bottomContainer };
  }
});
function getPanel(view, panel) {
  let plugin = view.plugin(panelPlugin);
  let index = plugin ? plugin.specs.indexOf(panel) : -1;
  return index > -1 ? plugin.panels[index] : null;
}
var panelPlugin = /* @__PURE__ */ ViewPlugin.fromClass(class {
  constructor(view) {
    this.input = view.state.facet(showPanel);
    this.specs = this.input.filter((s2) => s2);
    this.panels = this.specs.map((spec) => spec(view));
    let conf = view.state.facet(panelConfig);
    this.top = new PanelGroup(view, true, conf.topContainer);
    this.bottom = new PanelGroup(view, false, conf.bottomContainer);
    this.top.sync(this.panels.filter((p) => p.top));
    this.bottom.sync(this.panels.filter((p) => !p.top));
    for (let p of this.panels) {
      p.dom.classList.add("cm-panel");
      if (p.mount)
        p.mount();
    }
  }
  update(update) {
    let conf = update.state.facet(panelConfig);
    if (this.top.container != conf.topContainer) {
      this.top.sync([]);
      this.top = new PanelGroup(update.view, true, conf.topContainer);
    }
    if (this.bottom.container != conf.bottomContainer) {
      this.bottom.sync([]);
      this.bottom = new PanelGroup(update.view, false, conf.bottomContainer);
    }
    this.top.syncClasses();
    this.bottom.syncClasses();
    let input = update.state.facet(showPanel);
    if (input != this.input) {
      let specs = input.filter((x2) => x2);
      let panels = [], top2 = [], bottom = [], mount = [];
      for (let spec of specs) {
        let known = this.specs.indexOf(spec), panel;
        if (known < 0) {
          panel = spec(update.view);
          mount.push(panel);
        } else {
          panel = this.panels[known];
          if (panel.update)
            panel.update(update);
        }
        panels.push(panel);
        (panel.top ? top2 : bottom).push(panel);
      }
      this.specs = specs;
      this.panels = panels;
      this.top.sync(top2);
      this.bottom.sync(bottom);
      for (let p of mount) {
        p.dom.classList.add("cm-panel");
        if (p.mount)
          p.mount();
      }
    } else {
      for (let p of this.panels)
        if (p.update)
          p.update(update);
    }
  }
  destroy() {
    this.top.sync([]);
    this.bottom.sync([]);
  }
}, {
  provide: (plugin) => EditorView.scrollMargins.of((view) => {
    let value = view.plugin(plugin);
    return value && { top: value.top.scrollMargin(), bottom: value.bottom.scrollMargin() };
  })
});
var PanelGroup = class {
  constructor(view, top2, container) {
    this.view = view;
    this.top = top2;
    this.container = container;
    this.dom = void 0;
    this.classes = "";
    this.panels = [];
    this.syncClasses();
  }
  sync(panels) {
    for (let p of this.panels)
      if (p.destroy && panels.indexOf(p) < 0)
        p.destroy();
    this.panels = panels;
    this.syncDOM();
  }
  syncDOM() {
    if (this.panels.length == 0) {
      if (this.dom) {
        this.dom.remove();
        this.dom = void 0;
      }
      return;
    }
    if (!this.dom) {
      this.dom = document.createElement("div");
      this.dom.className = this.top ? "cm-panels cm-panels-top" : "cm-panels cm-panels-bottom";
      this.dom.style[this.top ? "top" : "bottom"] = "0";
      let parent = this.container || this.view.dom;
      parent.insertBefore(this.dom, this.top ? parent.firstChild : null);
    }
    let curDOM = this.dom.firstChild;
    for (let panel of this.panels) {
      if (panel.dom.parentNode == this.dom) {
        while (curDOM != panel.dom)
          curDOM = rm(curDOM);
        curDOM = curDOM.nextSibling;
      } else {
        this.dom.insertBefore(panel.dom, curDOM);
      }
    }
    while (curDOM)
      curDOM = rm(curDOM);
  }
  scrollMargin() {
    return !this.dom || this.container ? 0 : Math.max(0, this.top ? this.dom.getBoundingClientRect().bottom - Math.max(0, this.view.scrollDOM.getBoundingClientRect().top) : Math.min(innerHeight, this.view.scrollDOM.getBoundingClientRect().bottom) - this.dom.getBoundingClientRect().top);
  }
  syncClasses() {
    if (!this.container || this.classes == this.view.themeClasses)
      return;
    for (let cls of this.classes.split(" "))
      if (cls)
        this.container.classList.remove(cls);
    for (let cls of (this.classes = this.view.themeClasses).split(" "))
      if (cls)
        this.container.classList.add(cls);
  }
};
function rm(node56) {
  let next2 = node56.nextSibling;
  node56.remove();
  return next2;
}
var showPanel = /* @__PURE__ */ Facet.define({
  enables: panelPlugin
});
var GutterMarker = class extends RangeValue {
  /**
  @internal
  */
  compare(other) {
    return this == other || this.constructor == other.constructor && this.eq(other);
  }
  /**
  Compare this marker to another marker of the same type.
  */
  eq(other) {
    return false;
  }
  /**
  Called if the marker has a `toDOM` method and its representation
  was removed from a gutter.
  */
  destroy(dom) {
  }
};
GutterMarker.prototype.elementClass = "";
GutterMarker.prototype.toDOM = void 0;
GutterMarker.prototype.mapMode = MapMode.TrackBefore;
GutterMarker.prototype.startSide = GutterMarker.prototype.endSide = -1;
GutterMarker.prototype.point = true;
var gutterLineClass = /* @__PURE__ */ Facet.define();
var defaults = {
  class: "",
  renderEmptyElements: false,
  elementStyle: "",
  markers: () => RangeSet.empty,
  lineMarker: () => null,
  widgetMarker: () => null,
  lineMarkerChange: null,
  initialSpacer: null,
  updateSpacer: null,
  domEventHandlers: {}
};
var activeGutters = /* @__PURE__ */ Facet.define();
function gutter(config2) {
  return [gutters(), activeGutters.of(Object.assign(Object.assign({}, defaults), config2))];
}
var unfixGutters = /* @__PURE__ */ Facet.define({
  combine: (values2) => values2.some((x2) => x2)
});
function gutters(config2) {
  let result = [
    gutterView
  ];
  if (config2 && config2.fixed === false)
    result.push(unfixGutters.of(true));
  return result;
}
var gutterView = /* @__PURE__ */ ViewPlugin.fromClass(class {
  constructor(view) {
    this.view = view;
    this.prevViewport = view.viewport;
    this.dom = document.createElement("div");
    this.dom.className = "cm-gutters";
    this.dom.setAttribute("aria-hidden", "true");
    this.dom.style.minHeight = this.view.contentHeight / this.view.scaleY + "px";
    this.gutters = view.state.facet(activeGutters).map((conf) => new SingleGutterView(view, conf));
    for (let gutter2 of this.gutters)
      this.dom.appendChild(gutter2.dom);
    this.fixed = !view.state.facet(unfixGutters);
    if (this.fixed) {
      this.dom.style.position = "sticky";
    }
    this.syncGutters(false);
    view.scrollDOM.insertBefore(this.dom, view.contentDOM);
  }
  update(update) {
    if (this.updateGutters(update)) {
      let vpA = this.prevViewport, vpB = update.view.viewport;
      let vpOverlap = Math.min(vpA.to, vpB.to) - Math.max(vpA.from, vpB.from);
      this.syncGutters(vpOverlap < (vpB.to - vpB.from) * 0.8);
    }
    if (update.geometryChanged)
      this.dom.style.minHeight = this.view.contentHeight + "px";
    if (this.view.state.facet(unfixGutters) != !this.fixed) {
      this.fixed = !this.fixed;
      this.dom.style.position = this.fixed ? "sticky" : "";
    }
    this.prevViewport = update.view.viewport;
  }
  syncGutters(detach2) {
    let after = this.dom.nextSibling;
    if (detach2)
      this.dom.remove();
    let lineClasses = RangeSet.iter(this.view.state.facet(gutterLineClass), this.view.viewport.from);
    let classSet = [];
    let contexts = this.gutters.map((gutter2) => new UpdateContext(gutter2, this.view.viewport, -this.view.documentPadding.top));
    for (let line2 of this.view.viewportLineBlocks) {
      if (classSet.length)
        classSet = [];
      if (Array.isArray(line2.type)) {
        let first = true;
        for (let b of line2.type) {
          if (b.type == BlockType.Text && first) {
            advanceCursor(lineClasses, classSet, b.from);
            for (let cx of contexts)
              cx.line(this.view, b, classSet);
            first = false;
          } else if (b.widget) {
            for (let cx of contexts)
              cx.widget(this.view, b);
          }
        }
      } else if (line2.type == BlockType.Text) {
        advanceCursor(lineClasses, classSet, line2.from);
        for (let cx of contexts)
          cx.line(this.view, line2, classSet);
      } else if (line2.widget) {
        for (let cx of contexts)
          cx.widget(this.view, line2);
      }
    }
    for (let cx of contexts)
      cx.finish();
    if (detach2)
      this.view.scrollDOM.insertBefore(this.dom, after);
  }
  updateGutters(update) {
    let prev2 = update.startState.facet(activeGutters), cur2 = update.state.facet(activeGutters);
    let change = update.docChanged || update.heightChanged || update.viewportChanged || !RangeSet.eq(update.startState.facet(gutterLineClass), update.state.facet(gutterLineClass), update.view.viewport.from, update.view.viewport.to);
    if (prev2 == cur2) {
      for (let gutter2 of this.gutters)
        if (gutter2.update(update))
          change = true;
    } else {
      change = true;
      let gutters2 = [];
      for (let conf of cur2) {
        let known = prev2.indexOf(conf);
        if (known < 0) {
          gutters2.push(new SingleGutterView(this.view, conf));
        } else {
          this.gutters[known].update(update);
          gutters2.push(this.gutters[known]);
        }
      }
      for (let g of this.gutters) {
        g.dom.remove();
        if (gutters2.indexOf(g) < 0)
          g.destroy();
      }
      for (let g of gutters2)
        this.dom.appendChild(g.dom);
      this.gutters = gutters2;
    }
    return change;
  }
  destroy() {
    for (let view of this.gutters)
      view.destroy();
    this.dom.remove();
  }
}, {
  provide: (plugin) => EditorView.scrollMargins.of((view) => {
    let value = view.plugin(plugin);
    if (!value || value.gutters.length == 0 || !value.fixed)
      return null;
    return view.textDirection == Direction.LTR ? { left: value.dom.offsetWidth * view.scaleX } : { right: value.dom.offsetWidth * view.scaleX };
  })
});
function asArray2(val) {
  return Array.isArray(val) ? val : [val];
}
function advanceCursor(cursor3, collect, pos) {
  while (cursor3.value && cursor3.from <= pos) {
    if (cursor3.from == pos)
      collect.push(cursor3.value);
    cursor3.next();
  }
}
var UpdateContext = class {
  constructor(gutter2, viewport, height) {
    this.gutter = gutter2;
    this.height = height;
    this.i = 0;
    this.cursor = RangeSet.iter(gutter2.markers, viewport.from);
  }
  addElement(view, block, markers) {
    let { gutter: gutter2 } = this, above = (block.top - this.height) / view.scaleY, height = block.height / view.scaleY;
    if (this.i == gutter2.elements.length) {
      let newElt = new GutterElement(view, height, above, markers);
      gutter2.elements.push(newElt);
      gutter2.dom.appendChild(newElt.dom);
    } else {
      gutter2.elements[this.i].update(view, height, above, markers);
    }
    this.height = block.bottom;
    this.i++;
  }
  line(view, line2, extraMarkers) {
    let localMarkers = [];
    advanceCursor(this.cursor, localMarkers, line2.from);
    if (extraMarkers.length)
      localMarkers = localMarkers.concat(extraMarkers);
    let forLine = this.gutter.config.lineMarker(view, line2, localMarkers);
    if (forLine)
      localMarkers.unshift(forLine);
    let gutter2 = this.gutter;
    if (localMarkers.length == 0 && !gutter2.config.renderEmptyElements)
      return;
    this.addElement(view, line2, localMarkers);
  }
  widget(view, block) {
    let marker = this.gutter.config.widgetMarker(view, block.widget, block);
    if (marker)
      this.addElement(view, block, [marker]);
  }
  finish() {
    let gutter2 = this.gutter;
    while (gutter2.elements.length > this.i) {
      let last = gutter2.elements.pop();
      gutter2.dom.removeChild(last.dom);
      last.destroy();
    }
  }
};
var SingleGutterView = class {
  constructor(view, config2) {
    this.view = view;
    this.config = config2;
    this.elements = [];
    this.spacer = null;
    this.dom = document.createElement("div");
    this.dom.className = "cm-gutter" + (this.config.class ? " " + this.config.class : "");
    for (let prop in config2.domEventHandlers) {
      this.dom.addEventListener(prop, (event) => {
        let target = event.target, y2;
        if (target != this.dom && this.dom.contains(target)) {
          while (target.parentNode != this.dom)
            target = target.parentNode;
          let rect = target.getBoundingClientRect();
          y2 = (rect.top + rect.bottom) / 2;
        } else {
          y2 = event.clientY;
        }
        let line2 = view.lineBlockAtHeight(y2 - view.documentTop);
        if (config2.domEventHandlers[prop](view, line2, event))
          event.preventDefault();
      });
    }
    this.markers = asArray2(config2.markers(view));
    if (config2.initialSpacer) {
      this.spacer = new GutterElement(view, 0, 0, [config2.initialSpacer(view)]);
      this.dom.appendChild(this.spacer.dom);
      this.spacer.dom.style.cssText += "visibility: hidden; pointer-events: none";
    }
  }
  update(update) {
    let prevMarkers = this.markers;
    this.markers = asArray2(this.config.markers(update.view));
    if (this.spacer && this.config.updateSpacer) {
      let updated = this.config.updateSpacer(this.spacer.markers[0], update);
      if (updated != this.spacer.markers[0])
        this.spacer.update(update.view, 0, 0, [updated]);
    }
    let vp = update.view.viewport;
    return !RangeSet.eq(this.markers, prevMarkers, vp.from, vp.to) || (this.config.lineMarkerChange ? this.config.lineMarkerChange(update) : false);
  }
  destroy() {
    for (let elt of this.elements)
      elt.destroy();
  }
};
var GutterElement = class {
  constructor(view, height, above, markers) {
    this.height = -1;
    this.above = 0;
    this.markers = [];
    this.dom = document.createElement("div");
    this.dom.className = "cm-gutterElement";
    this.update(view, height, above, markers);
  }
  update(view, height, above, markers) {
    if (this.height != height) {
      this.height = height;
      this.dom.style.height = height + "px";
    }
    if (this.above != above)
      this.dom.style.marginTop = (this.above = above) ? above + "px" : "";
    if (!sameMarkers(this.markers, markers))
      this.setMarkers(view, markers);
  }
  setMarkers(view, markers) {
    let cls = "cm-gutterElement", domPos = this.dom.firstChild;
    for (let iNew = 0, iOld = 0; ; ) {
      let skipTo = iOld, marker = iNew < markers.length ? markers[iNew++] : null, matched = false;
      if (marker) {
        let c4 = marker.elementClass;
        if (c4)
          cls += " " + c4;
        for (let i2 = iOld; i2 < this.markers.length; i2++)
          if (this.markers[i2].compare(marker)) {
            skipTo = i2;
            matched = true;
            break;
          }
      } else {
        skipTo = this.markers.length;
      }
      while (iOld < skipTo) {
        let next2 = this.markers[iOld++];
        if (next2.toDOM) {
          next2.destroy(domPos);
          let after = domPos.nextSibling;
          domPos.remove();
          domPos = after;
        }
      }
      if (!marker)
        break;
      if (marker.toDOM) {
        if (matched)
          domPos = domPos.nextSibling;
        else
          this.dom.insertBefore(marker.toDOM(view), domPos);
      }
      if (matched)
        iOld++;
    }
    this.dom.className = cls;
    this.markers = markers;
  }
  destroy() {
    this.setMarkers(null, []);
  }
};
function sameMarkers(a2, b) {
  if (a2.length != b.length)
    return false;
  for (let i2 = 0; i2 < a2.length; i2++)
    if (!a2[i2].compare(b[i2]))
      return false;
  return true;
}
var lineNumberMarkers = /* @__PURE__ */ Facet.define();
var lineNumberConfig = /* @__PURE__ */ Facet.define({
  combine(values2) {
    return combineConfig(values2, { formatNumber: String, domEventHandlers: {} }, {
      domEventHandlers(a2, b) {
        let result = Object.assign({}, a2);
        for (let event in b) {
          let exists = result[event], add2 = b[event];
          result[event] = exists ? (view, line2, event2) => exists(view, line2, event2) || add2(view, line2, event2) : add2;
        }
        return result;
      }
    });
  }
});
var NumberMarker = class extends GutterMarker {
  constructor(number5) {
    super();
    this.number = number5;
  }
  eq(other) {
    return this.number == other.number;
  }
  toDOM() {
    return document.createTextNode(this.number);
  }
};
function formatNumber2(view, number5) {
  return view.state.facet(lineNumberConfig).formatNumber(number5, view.state);
}
var lineNumberGutter = /* @__PURE__ */ activeGutters.compute([lineNumberConfig], (state) => ({
  class: "cm-lineNumbers",
  renderEmptyElements: false,
  markers(view) {
    return view.state.facet(lineNumberMarkers);
  },
  lineMarker(view, line2, others) {
    if (others.some((m) => m.toDOM))
      return null;
    return new NumberMarker(formatNumber2(view, view.state.doc.lineAt(line2.from).number));
  },
  widgetMarker: () => null,
  lineMarkerChange: (update) => update.startState.facet(lineNumberConfig) != update.state.facet(lineNumberConfig),
  initialSpacer(view) {
    return new NumberMarker(formatNumber2(view, maxLineNumber(view.state.doc.lines)));
  },
  updateSpacer(spacer, update) {
    let max3 = formatNumber2(update.view, maxLineNumber(update.view.state.doc.lines));
    return max3 == spacer.number ? spacer : new NumberMarker(max3);
  },
  domEventHandlers: state.facet(lineNumberConfig).domEventHandlers
}));
function lineNumbers(config2 = {}) {
  return [
    lineNumberConfig.of(config2),
    gutters(),
    lineNumberGutter
  ];
}
function maxLineNumber(lines) {
  let last = 9;
  while (last < lines)
    last = last * 10 + 9;
  return last;
}
var activeLineGutterMarker = /* @__PURE__ */ new class extends GutterMarker {
  constructor() {
    super(...arguments);
    this.elementClass = "cm-activeLineGutter";
  }
}();
var activeLineGutterHighlighter = /* @__PURE__ */ gutterLineClass.compute(["selection"], (state) => {
  let marks = [], last = -1;
  for (let range4 of state.selection.ranges) {
    let linePos = state.doc.lineAt(range4.head).from;
    if (linePos > last) {
      last = linePos;
      marks.push(activeLineGutterMarker.range(linePos));
    }
  }
  return RangeSet.of(marks);
});
function highlightActiveLineGutter() {
  return activeLineGutterHighlighter;
}

// node_modules/@lezer/common/dist/index.js
var DefaultBufferLength = 1024;
var nextPropID = 0;
var Range2 = class {
  constructor(from2, to) {
    this.from = from2;
    this.to = to;
  }
};
var NodeProp = class {
  /**
  Create a new node prop type.
  */
  constructor(config2 = {}) {
    this.id = nextPropID++;
    this.perNode = !!config2.perNode;
    this.deserialize = config2.deserialize || (() => {
      throw new Error("This node type doesn't define a deserialize function");
    });
  }
  /**
  This is meant to be used with
  [`NodeSet.extend`](#common.NodeSet.extend) or
  [`LRParser.configure`](#lr.ParserConfig.props) to compute
  prop values for each node type in the set. Takes a [match
  object](#common.NodeType^match) or function that returns undefined
  if the node type doesn't get this prop, and the prop's value if
  it does.
  */
  add(match2) {
    if (this.perNode)
      throw new RangeError("Can't add per-node props to node types");
    if (typeof match2 != "function")
      match2 = NodeType.match(match2);
    return (type) => {
      let result = match2(type);
      return result === void 0 ? null : [this, result];
    };
  }
};
NodeProp.closedBy = new NodeProp({ deserialize: (str) => str.split(" ") });
NodeProp.openedBy = new NodeProp({ deserialize: (str) => str.split(" ") });
NodeProp.group = new NodeProp({ deserialize: (str) => str.split(" ") });
NodeProp.contextHash = new NodeProp({ perNode: true });
NodeProp.lookAhead = new NodeProp({ perNode: true });
NodeProp.mounted = new NodeProp({ perNode: true });
var MountedTree = class {
  constructor(tree, overlay, parser3) {
    this.tree = tree;
    this.overlay = overlay;
    this.parser = parser3;
  }
  /**
  @internal
  */
  static get(tree) {
    return tree && tree.props && tree.props[NodeProp.mounted.id];
  }
};
var noProps = /* @__PURE__ */ Object.create(null);
var NodeType = class _NodeType {
  /**
  @internal
  */
  constructor(name2, props, id2, flags = 0) {
    this.name = name2;
    this.props = props;
    this.id = id2;
    this.flags = flags;
  }
  /**
  Define a node type.
  */
  static define(spec) {
    let props = spec.props && spec.props.length ? /* @__PURE__ */ Object.create(null) : noProps;
    let flags = (spec.top ? 1 : 0) | (spec.skipped ? 2 : 0) | (spec.error ? 4 : 0) | (spec.name == null ? 8 : 0);
    let type = new _NodeType(spec.name || "", props, spec.id, flags);
    if (spec.props)
      for (let src of spec.props) {
        if (!Array.isArray(src))
          src = src(type);
        if (src) {
          if (src[0].perNode)
            throw new RangeError("Can't store a per-node prop on a node type");
          props[src[0].id] = src[1];
        }
      }
    return type;
  }
  /**
  Retrieves a node prop for this type. Will return `undefined` if
  the prop isn't present on this node.
  */
  prop(prop) {
    return this.props[prop.id];
  }
  /**
  True when this is the top node of a grammar.
  */
  get isTop() {
    return (this.flags & 1) > 0;
  }
  /**
  True when this node is produced by a skip rule.
  */
  get isSkipped() {
    return (this.flags & 2) > 0;
  }
  /**
  Indicates whether this is an error node.
  */
  get isError() {
    return (this.flags & 4) > 0;
  }
  /**
  When true, this node type doesn't correspond to a user-declared
  named node, for example because it is used to cache repetition.
  */
  get isAnonymous() {
    return (this.flags & 8) > 0;
  }
  /**
  Returns true when this node's name or one of its
  [groups](#common.NodeProp^group) matches the given string.
  */
  is(name2) {
    if (typeof name2 == "string") {
      if (this.name == name2)
        return true;
      let group = this.prop(NodeProp.group);
      return group ? group.indexOf(name2) > -1 : false;
    }
    return this.id == name2;
  }
  /**
  Create a function from node types to arbitrary values by
  specifying an object whose property names are node or
  [group](#common.NodeProp^group) names. Often useful with
  [`NodeProp.add`](#common.NodeProp.add). You can put multiple
  names, separated by spaces, in a single property name to map
  multiple node names to a single value.
  */
  static match(map3) {
    let direct = /* @__PURE__ */ Object.create(null);
    for (let prop in map3)
      for (let name2 of prop.split(" "))
        direct[name2] = map3[prop];
    return (node56) => {
      for (let groups = node56.prop(NodeProp.group), i2 = -1; i2 < (groups ? groups.length : 0); i2++) {
        let found = direct[i2 < 0 ? node56.name : groups[i2]];
        if (found)
          return found;
      }
    };
  }
};
NodeType.none = new NodeType(
  "",
  /* @__PURE__ */ Object.create(null),
  0,
  8
  /* NodeFlag.Anonymous */
);
var NodeSet = class _NodeSet {
  /**
  Create a set with the given types. The `id` property of each
  type should correspond to its position within the array.
  */
  constructor(types2) {
    this.types = types2;
    for (let i2 = 0; i2 < types2.length; i2++)
      if (types2[i2].id != i2)
        throw new RangeError("Node type ids should correspond to array positions when creating a node set");
  }
  /**
  Create a copy of this set with some node properties added. The
  arguments to this method can be created with
  [`NodeProp.add`](#common.NodeProp.add).
  */
  extend(...props) {
    let newTypes = [];
    for (let type of this.types) {
      let newProps = null;
      for (let source of props) {
        let add2 = source(type);
        if (add2) {
          if (!newProps)
            newProps = Object.assign({}, type.props);
          newProps[add2[0].id] = add2[1];
        }
      }
      newTypes.push(newProps ? new NodeType(type.name, newProps, type.id, type.flags) : type);
    }
    return new _NodeSet(newTypes);
  }
};
var CachedNode = /* @__PURE__ */ new WeakMap();
var CachedInnerNode = /* @__PURE__ */ new WeakMap();
var IterMode;
(function(IterMode2) {
  IterMode2[IterMode2["ExcludeBuffers"] = 1] = "ExcludeBuffers";
  IterMode2[IterMode2["IncludeAnonymous"] = 2] = "IncludeAnonymous";
  IterMode2[IterMode2["IgnoreMounts"] = 4] = "IgnoreMounts";
  IterMode2[IterMode2["IgnoreOverlays"] = 8] = "IgnoreOverlays";
})(IterMode || (IterMode = {}));
var Tree = class _Tree {
  /**
  Construct a new tree. See also [`Tree.build`](#common.Tree^build).
  */
  constructor(type, children, positions, length2, props) {
    this.type = type;
    this.children = children;
    this.positions = positions;
    this.length = length2;
    this.props = null;
    if (props && props.length) {
      this.props = /* @__PURE__ */ Object.create(null);
      for (let [prop, value] of props)
        this.props[typeof prop == "number" ? prop : prop.id] = value;
    }
  }
  /**
  @internal
  */
  toString() {
    let mounted = MountedTree.get(this);
    if (mounted && !mounted.overlay)
      return mounted.tree.toString();
    let children = "";
    for (let ch of this.children) {
      let str = ch.toString();
      if (str) {
        if (children)
          children += ",";
        children += str;
      }
    }
    return !this.type.name ? children : (/\W/.test(this.type.name) && !this.type.isError ? JSON.stringify(this.type.name) : this.type.name) + (children.length ? "(" + children + ")" : "");
  }
  /**
  Get a [tree cursor](#common.TreeCursor) positioned at the top of
  the tree. Mode can be used to [control](#common.IterMode) which
  nodes the cursor visits.
  */
  cursor(mode = 0) {
    return new TreeCursor(this.topNode, mode);
  }
  /**
  Get a [tree cursor](#common.TreeCursor) pointing into this tree
  at the given position and side (see
  [`moveTo`](#common.TreeCursor.moveTo).
  */
  cursorAt(pos, side = 0, mode = 0) {
    let scope = CachedNode.get(this) || this.topNode;
    let cursor3 = new TreeCursor(scope);
    cursor3.moveTo(pos, side);
    CachedNode.set(this, cursor3._tree);
    return cursor3;
  }
  /**
  Get a [syntax node](#common.SyntaxNode) object for the top of the
  tree.
  */
  get topNode() {
    return new TreeNode(this, 0, 0, null);
  }
  /**
  Get the [syntax node](#common.SyntaxNode) at the given position.
  If `side` is -1, this will move into nodes that end at the
  position. If 1, it'll move into nodes that start at the
  position. With 0, it'll only enter nodes that cover the position
  from both sides.
  
  Note that this will not enter
  [overlays](#common.MountedTree.overlay), and you often want
  [`resolveInner`](#common.Tree.resolveInner) instead.
  */
  resolve(pos, side = 0) {
    let node56 = resolveNode(CachedNode.get(this) || this.topNode, pos, side, false);
    CachedNode.set(this, node56);
    return node56;
  }
  /**
  Like [`resolve`](#common.Tree.resolve), but will enter
  [overlaid](#common.MountedTree.overlay) nodes, producing a syntax node
  pointing into the innermost overlaid tree at the given position
  (with parent links going through all parent structure, including
  the host trees).
  */
  resolveInner(pos, side = 0) {
    let node56 = resolveNode(CachedInnerNode.get(this) || this.topNode, pos, side, true);
    CachedInnerNode.set(this, node56);
    return node56;
  }
  /**
  In some situations, it can be useful to iterate through all
  nodes around a position, including those in overlays that don't
  directly cover the position. This method gives you an iterator
  that will produce all nodes, from small to big, around the given
  position.
  */
  resolveStack(pos, side = 0) {
    return stackIterator(this, pos, side);
  }
  /**
  Iterate over the tree and its children, calling `enter` for any
  node that touches the `from`/`to` region (if given) before
  running over such a node's children, and `leave` (if given) when
  leaving the node. When `enter` returns `false`, that node will
  not have its children iterated over (or `leave` called).
  */
  iterate(spec) {
    let { enter, leave, from: from2 = 0, to = this.length } = spec;
    let mode = spec.mode || 0, anon = (mode & IterMode.IncludeAnonymous) > 0;
    for (let c4 = this.cursor(mode | IterMode.IncludeAnonymous); ; ) {
      let entered = false;
      if (c4.from <= to && c4.to >= from2 && (!anon && c4.type.isAnonymous || enter(c4) !== false)) {
        if (c4.firstChild())
          continue;
        entered = true;
      }
      for (; ; ) {
        if (entered && leave && (anon || !c4.type.isAnonymous))
          leave(c4);
        if (c4.nextSibling())
          break;
        if (!c4.parent())
          return;
        entered = true;
      }
    }
  }
  /**
  Get the value of the given [node prop](#common.NodeProp) for this
  node. Works with both per-node and per-type props.
  */
  prop(prop) {
    return !prop.perNode ? this.type.prop(prop) : this.props ? this.props[prop.id] : void 0;
  }
  /**
  Returns the node's [per-node props](#common.NodeProp.perNode) in a
  format that can be passed to the [`Tree`](#common.Tree)
  constructor.
  */
  get propValues() {
    let result = [];
    if (this.props)
      for (let id2 in this.props)
        result.push([+id2, this.props[id2]]);
    return result;
  }
  /**
  Balance the direct children of this tree, producing a copy of
  which may have children grouped into subtrees with type
  [`NodeType.none`](#common.NodeType^none).
  */
  balance(config2 = {}) {
    return this.children.length <= 8 ? this : balanceRange(NodeType.none, this.children, this.positions, 0, this.children.length, 0, this.length, (children, positions, length2) => new _Tree(this.type, children, positions, length2, this.propValues), config2.makeTree || ((children, positions, length2) => new _Tree(NodeType.none, children, positions, length2)));
  }
  /**
  Build a tree from a postfix-ordered buffer of node information,
  or a cursor over such a buffer.
  */
  static build(data) {
    return buildTree(data);
  }
};
Tree.empty = new Tree(NodeType.none, [], [], 0);
var FlatBufferCursor = class _FlatBufferCursor {
  constructor(buffer, index) {
    this.buffer = buffer;
    this.index = index;
  }
  get id() {
    return this.buffer[this.index - 4];
  }
  get start() {
    return this.buffer[this.index - 3];
  }
  get end() {
    return this.buffer[this.index - 2];
  }
  get size() {
    return this.buffer[this.index - 1];
  }
  get pos() {
    return this.index;
  }
  next() {
    this.index -= 4;
  }
  fork() {
    return new _FlatBufferCursor(this.buffer, this.index);
  }
};
var TreeBuffer = class _TreeBuffer {
  /**
  Create a tree buffer.
  */
  constructor(buffer, length2, set3) {
    this.buffer = buffer;
    this.length = length2;
    this.set = set3;
  }
  /**
  @internal
  */
  get type() {
    return NodeType.none;
  }
  /**
  @internal
  */
  toString() {
    let result = [];
    for (let index = 0; index < this.buffer.length; ) {
      result.push(this.childString(index));
      index = this.buffer[index + 3];
    }
    return result.join(",");
  }
  /**
  @internal
  */
  childString(index) {
    let id2 = this.buffer[index], endIndex = this.buffer[index + 3];
    let type = this.set.types[id2], result = type.name;
    if (/\W/.test(result) && !type.isError)
      result = JSON.stringify(result);
    index += 4;
    if (endIndex == index)
      return result;
    let children = [];
    while (index < endIndex) {
      children.push(this.childString(index));
      index = this.buffer[index + 3];
    }
    return result + "(" + children.join(",") + ")";
  }
  /**
  @internal
  */
  findChild(startIndex, endIndex, dir, pos, side) {
    let { buffer } = this, pick = -1;
    for (let i2 = startIndex; i2 != endIndex; i2 = buffer[i2 + 3]) {
      if (checkSide(side, pos, buffer[i2 + 1], buffer[i2 + 2])) {
        pick = i2;
        if (dir > 0)
          break;
      }
    }
    return pick;
  }
  /**
  @internal
  */
  slice(startI, endI, from2) {
    let b = this.buffer;
    let copy4 = new Uint16Array(endI - startI), len = 0;
    for (let i2 = startI, j = 0; i2 < endI; ) {
      copy4[j++] = b[i2++];
      copy4[j++] = b[i2++] - from2;
      let to = copy4[j++] = b[i2++] - from2;
      copy4[j++] = b[i2++] - startI;
      len = Math.max(len, to);
    }
    return new _TreeBuffer(copy4, len, this.set);
  }
};
function checkSide(side, pos, from2, to) {
  switch (side) {
    case -2:
      return from2 < pos;
    case -1:
      return to >= pos && from2 < pos;
    case 0:
      return from2 < pos && to > pos;
    case 1:
      return from2 <= pos && to > pos;
    case 2:
      return to > pos;
    case 4:
      return true;
  }
}
function resolveNode(node56, pos, side, overlays) {
  var _a2;
  while (node56.from == node56.to || (side < 1 ? node56.from >= pos : node56.from > pos) || (side > -1 ? node56.to <= pos : node56.to < pos)) {
    let parent = !overlays && node56 instanceof TreeNode && node56.index < 0 ? null : node56.parent;
    if (!parent)
      return node56;
    node56 = parent;
  }
  let mode = overlays ? 0 : IterMode.IgnoreOverlays;
  if (overlays)
    for (let scan = node56, parent = scan.parent; parent; scan = parent, parent = scan.parent) {
      if (scan instanceof TreeNode && scan.index < 0 && ((_a2 = parent.enter(pos, side, mode)) === null || _a2 === void 0 ? void 0 : _a2.from) != scan.from)
        node56 = parent;
    }
  for (; ; ) {
    let inner = node56.enter(pos, side, mode);
    if (!inner)
      return node56;
    node56 = inner;
  }
}
var BaseNode = class {
  cursor(mode = 0) {
    return new TreeCursor(this, mode);
  }
  getChild(type, before = null, after = null) {
    let r3 = getChildren(this, type, before, after);
    return r3.length ? r3[0] : null;
  }
  getChildren(type, before = null, after = null) {
    return getChildren(this, type, before, after);
  }
  resolve(pos, side = 0) {
    return resolveNode(this, pos, side, false);
  }
  resolveInner(pos, side = 0) {
    return resolveNode(this, pos, side, true);
  }
  matchContext(context2) {
    return matchNodeContext(this, context2);
  }
  enterUnfinishedNodesBefore(pos) {
    let scan = this.childBefore(pos), node56 = this;
    while (scan) {
      let last = scan.lastChild;
      if (!last || last.to != scan.to)
        break;
      if (last.type.isError && last.from == last.to) {
        node56 = scan;
        scan = last.prevSibling;
      } else {
        scan = last;
      }
    }
    return node56;
  }
  get node() {
    return this;
  }
  get next() {
    return this.parent;
  }
};
var TreeNode = class _TreeNode extends BaseNode {
  constructor(_tree, from2, index, _parent) {
    super();
    this._tree = _tree;
    this.from = from2;
    this.index = index;
    this._parent = _parent;
  }
  get type() {
    return this._tree.type;
  }
  get name() {
    return this._tree.type.name;
  }
  get to() {
    return this.from + this._tree.length;
  }
  nextChild(i2, dir, pos, side, mode = 0) {
    for (let parent = this; ; ) {
      for (let { children, positions } = parent._tree, e3 = dir > 0 ? children.length : -1; i2 != e3; i2 += dir) {
        let next2 = children[i2], start = positions[i2] + parent.from;
        if (!checkSide(side, pos, start, start + next2.length))
          continue;
        if (next2 instanceof TreeBuffer) {
          if (mode & IterMode.ExcludeBuffers)
            continue;
          let index = next2.findChild(0, next2.buffer.length, dir, pos - start, side);
          if (index > -1)
            return new BufferNode(new BufferContext(parent, next2, i2, start), null, index);
        } else if (mode & IterMode.IncludeAnonymous || (!next2.type.isAnonymous || hasChild(next2))) {
          let mounted;
          if (!(mode & IterMode.IgnoreMounts) && (mounted = MountedTree.get(next2)) && !mounted.overlay)
            return new _TreeNode(mounted.tree, start, i2, parent);
          let inner = new _TreeNode(next2, start, i2, parent);
          return mode & IterMode.IncludeAnonymous || !inner.type.isAnonymous ? inner : inner.nextChild(dir < 0 ? next2.children.length - 1 : 0, dir, pos, side);
        }
      }
      if (mode & IterMode.IncludeAnonymous || !parent.type.isAnonymous)
        return null;
      if (parent.index >= 0)
        i2 = parent.index + dir;
      else
        i2 = dir < 0 ? -1 : parent._parent._tree.children.length;
      parent = parent._parent;
      if (!parent)
        return null;
    }
  }
  get firstChild() {
    return this.nextChild(
      0,
      1,
      0,
      4
      /* Side.DontCare */
    );
  }
  get lastChild() {
    return this.nextChild(
      this._tree.children.length - 1,
      -1,
      0,
      4
      /* Side.DontCare */
    );
  }
  childAfter(pos) {
    return this.nextChild(
      0,
      1,
      pos,
      2
      /* Side.After */
    );
  }
  childBefore(pos) {
    return this.nextChild(
      this._tree.children.length - 1,
      -1,
      pos,
      -2
      /* Side.Before */
    );
  }
  enter(pos, side, mode = 0) {
    let mounted;
    if (!(mode & IterMode.IgnoreOverlays) && (mounted = MountedTree.get(this._tree)) && mounted.overlay) {
      let rPos = pos - this.from;
      for (let { from: from2, to } of mounted.overlay) {
        if ((side > 0 ? from2 <= rPos : from2 < rPos) && (side < 0 ? to >= rPos : to > rPos))
          return new _TreeNode(mounted.tree, mounted.overlay[0].from + this.from, -1, this);
      }
    }
    return this.nextChild(0, 1, pos, side, mode);
  }
  nextSignificantParent() {
    let val = this;
    while (val.type.isAnonymous && val._parent)
      val = val._parent;
    return val;
  }
  get parent() {
    return this._parent ? this._parent.nextSignificantParent() : null;
  }
  get nextSibling() {
    return this._parent && this.index >= 0 ? this._parent.nextChild(
      this.index + 1,
      1,
      0,
      4
      /* Side.DontCare */
    ) : null;
  }
  get prevSibling() {
    return this._parent && this.index >= 0 ? this._parent.nextChild(
      this.index - 1,
      -1,
      0,
      4
      /* Side.DontCare */
    ) : null;
  }
  get tree() {
    return this._tree;
  }
  toTree() {
    return this._tree;
  }
  /**
  @internal
  */
  toString() {
    return this._tree.toString();
  }
};
function getChildren(node56, type, before, after) {
  let cur2 = node56.cursor(), result = [];
  if (!cur2.firstChild())
    return result;
  if (before != null) {
    while (!cur2.type.is(before))
      if (!cur2.nextSibling())
        return result;
  }
  for (; ; ) {
    if (after != null && cur2.type.is(after))
      return result;
    if (cur2.type.is(type))
      result.push(cur2.node);
    if (!cur2.nextSibling())
      return after == null ? result : [];
  }
}
function matchNodeContext(node56, context2, i2 = context2.length - 1) {
  for (let p = node56.parent; i2 >= 0; p = p.parent) {
    if (!p)
      return false;
    if (!p.type.isAnonymous) {
      if (context2[i2] && context2[i2] != p.name)
        return false;
      i2--;
    }
  }
  return true;
}
var BufferContext = class {
  constructor(parent, buffer, index, start) {
    this.parent = parent;
    this.buffer = buffer;
    this.index = index;
    this.start = start;
  }
};
var BufferNode = class _BufferNode extends BaseNode {
  get name() {
    return this.type.name;
  }
  get from() {
    return this.context.start + this.context.buffer.buffer[this.index + 1];
  }
  get to() {
    return this.context.start + this.context.buffer.buffer[this.index + 2];
  }
  constructor(context2, _parent, index) {
    super();
    this.context = context2;
    this._parent = _parent;
    this.index = index;
    this.type = context2.buffer.set.types[context2.buffer.buffer[index]];
  }
  child(dir, pos, side) {
    let { buffer } = this.context;
    let index = buffer.findChild(this.index + 4, buffer.buffer[this.index + 3], dir, pos - this.context.start, side);
    return index < 0 ? null : new _BufferNode(this.context, this, index);
  }
  get firstChild() {
    return this.child(
      1,
      0,
      4
      /* Side.DontCare */
    );
  }
  get lastChild() {
    return this.child(
      -1,
      0,
      4
      /* Side.DontCare */
    );
  }
  childAfter(pos) {
    return this.child(
      1,
      pos,
      2
      /* Side.After */
    );
  }
  childBefore(pos) {
    return this.child(
      -1,
      pos,
      -2
      /* Side.Before */
    );
  }
  enter(pos, side, mode = 0) {
    if (mode & IterMode.ExcludeBuffers)
      return null;
    let { buffer } = this.context;
    let index = buffer.findChild(this.index + 4, buffer.buffer[this.index + 3], side > 0 ? 1 : -1, pos - this.context.start, side);
    return index < 0 ? null : new _BufferNode(this.context, this, index);
  }
  get parent() {
    return this._parent || this.context.parent.nextSignificantParent();
  }
  externalSibling(dir) {
    return this._parent ? null : this.context.parent.nextChild(
      this.context.index + dir,
      dir,
      0,
      4
      /* Side.DontCare */
    );
  }
  get nextSibling() {
    let { buffer } = this.context;
    let after = buffer.buffer[this.index + 3];
    if (after < (this._parent ? buffer.buffer[this._parent.index + 3] : buffer.buffer.length))
      return new _BufferNode(this.context, this._parent, after);
    return this.externalSibling(1);
  }
  get prevSibling() {
    let { buffer } = this.context;
    let parentStart = this._parent ? this._parent.index + 4 : 0;
    if (this.index == parentStart)
      return this.externalSibling(-1);
    return new _BufferNode(this.context, this._parent, buffer.findChild(
      parentStart,
      this.index,
      -1,
      0,
      4
      /* Side.DontCare */
    ));
  }
  get tree() {
    return null;
  }
  toTree() {
    let children = [], positions = [];
    let { buffer } = this.context;
    let startI = this.index + 4, endI = buffer.buffer[this.index + 3];
    if (endI > startI) {
      let from2 = buffer.buffer[this.index + 1];
      children.push(buffer.slice(startI, endI, from2));
      positions.push(0);
    }
    return new Tree(this.type, children, positions, this.to - this.from);
  }
  /**
  @internal
  */
  toString() {
    return this.context.buffer.childString(this.index);
  }
};
function iterStack(heads) {
  if (!heads.length)
    return null;
  if (heads.length == 1)
    return heads[0];
  let pick = 0, picked = heads[0];
  for (let i2 = 1; i2 < heads.length; i2++) {
    let node56 = heads[i2];
    if (node56.from > picked.from || node56.to < picked.to) {
      picked = node56;
      pick = i2;
    }
  }
  let next2 = picked instanceof TreeNode && picked.index < 0 ? null : picked.parent;
  let newHeads = heads.slice();
  if (next2)
    newHeads[pick] = next2;
  else
    newHeads.splice(pick, 1);
  return new StackIterator(newHeads, picked);
}
var StackIterator = class {
  constructor(heads, node56) {
    this.heads = heads;
    this.node = node56;
  }
  get next() {
    return iterStack(this.heads);
  }
};
function stackIterator(tree, pos, side) {
  let inner = tree.resolveInner(pos, side), layers = null;
  for (let scan = inner instanceof TreeNode ? inner : inner.context.parent; scan; scan = scan.parent) {
    if (scan.index < 0) {
      let parent = scan.parent;
      (layers || (layers = [inner])).push(parent.resolve(pos, side));
      scan = parent;
    } else {
      let mount = MountedTree.get(scan.tree);
      if (mount && mount.overlay && mount.overlay[0].from <= pos && mount.overlay[mount.overlay.length - 1].to >= pos) {
        let root2 = new TreeNode(mount.tree, mount.overlay[0].from + scan.from, 0, null);
        (layers || (layers = [inner])).push(resolveNode(root2, pos, side, false));
      }
    }
  }
  return layers ? iterStack(layers) : inner;
}
var TreeCursor = class {
  /**
  Shorthand for `.type.name`.
  */
  get name() {
    return this.type.name;
  }
  /**
  @internal
  */
  constructor(node56, mode = 0) {
    this.mode = mode;
    this.buffer = null;
    this.stack = [];
    this.index = 0;
    this.bufferNode = null;
    if (node56 instanceof TreeNode) {
      this.yieldNode(node56);
    } else {
      this._tree = node56.context.parent;
      this.buffer = node56.context;
      for (let n2 = node56._parent; n2; n2 = n2._parent)
        this.stack.unshift(n2.index);
      this.bufferNode = node56;
      this.yieldBuf(node56.index);
    }
  }
  yieldNode(node56) {
    if (!node56)
      return false;
    this._tree = node56;
    this.type = node56.type;
    this.from = node56.from;
    this.to = node56.to;
    return true;
  }
  yieldBuf(index, type) {
    this.index = index;
    let { start, buffer } = this.buffer;
    this.type = type || buffer.set.types[buffer.buffer[index]];
    this.from = start + buffer.buffer[index + 1];
    this.to = start + buffer.buffer[index + 2];
    return true;
  }
  yield(node56) {
    if (!node56)
      return false;
    if (node56 instanceof TreeNode) {
      this.buffer = null;
      return this.yieldNode(node56);
    }
    this.buffer = node56.context;
    return this.yieldBuf(node56.index, node56.type);
  }
  /**
  @internal
  */
  toString() {
    return this.buffer ? this.buffer.buffer.childString(this.index) : this._tree.toString();
  }
  /**
  @internal
  */
  enterChild(dir, pos, side) {
    if (!this.buffer)
      return this.yield(this._tree.nextChild(dir < 0 ? this._tree._tree.children.length - 1 : 0, dir, pos, side, this.mode));
    let { buffer } = this.buffer;
    let index = buffer.findChild(this.index + 4, buffer.buffer[this.index + 3], dir, pos - this.buffer.start, side);
    if (index < 0)
      return false;
    this.stack.push(this.index);
    return this.yieldBuf(index);
  }
  /**
  Move the cursor to this node's first child. When this returns
  false, the node has no child, and the cursor has not been moved.
  */
  firstChild() {
    return this.enterChild(
      1,
      0,
      4
      /* Side.DontCare */
    );
  }
  /**
  Move the cursor to this node's last child.
  */
  lastChild() {
    return this.enterChild(
      -1,
      0,
      4
      /* Side.DontCare */
    );
  }
  /**
  Move the cursor to the first child that ends after `pos`.
  */
  childAfter(pos) {
    return this.enterChild(
      1,
      pos,
      2
      /* Side.After */
    );
  }
  /**
  Move to the last child that starts before `pos`.
  */
  childBefore(pos) {
    return this.enterChild(
      -1,
      pos,
      -2
      /* Side.Before */
    );
  }
  /**
  Move the cursor to the child around `pos`. If side is -1 the
  child may end at that position, when 1 it may start there. This
  will also enter [overlaid](#common.MountedTree.overlay)
  [mounted](#common.NodeProp^mounted) trees unless `overlays` is
  set to false.
  */
  enter(pos, side, mode = this.mode) {
    if (!this.buffer)
      return this.yield(this._tree.enter(pos, side, mode));
    return mode & IterMode.ExcludeBuffers ? false : this.enterChild(1, pos, side);
  }
  /**
  Move to the node's parent node, if this isn't the top node.
  */
  parent() {
    if (!this.buffer)
      return this.yieldNode(this.mode & IterMode.IncludeAnonymous ? this._tree._parent : this._tree.parent);
    if (this.stack.length)
      return this.yieldBuf(this.stack.pop());
    let parent = this.mode & IterMode.IncludeAnonymous ? this.buffer.parent : this.buffer.parent.nextSignificantParent();
    this.buffer = null;
    return this.yieldNode(parent);
  }
  /**
  @internal
  */
  sibling(dir) {
    if (!this.buffer)
      return !this._tree._parent ? false : this.yield(this._tree.index < 0 ? null : this._tree._parent.nextChild(this._tree.index + dir, dir, 0, 4, this.mode));
    let { buffer } = this.buffer, d = this.stack.length - 1;
    if (dir < 0) {
      let parentStart = d < 0 ? 0 : this.stack[d] + 4;
      if (this.index != parentStart)
        return this.yieldBuf(buffer.findChild(
          parentStart,
          this.index,
          -1,
          0,
          4
          /* Side.DontCare */
        ));
    } else {
      let after = buffer.buffer[this.index + 3];
      if (after < (d < 0 ? buffer.buffer.length : buffer.buffer[this.stack[d] + 3]))
        return this.yieldBuf(after);
    }
    return d < 0 ? this.yield(this.buffer.parent.nextChild(this.buffer.index + dir, dir, 0, 4, this.mode)) : false;
  }
  /**
  Move to this node's next sibling, if any.
  */
  nextSibling() {
    return this.sibling(1);
  }
  /**
  Move to this node's previous sibling, if any.
  */
  prevSibling() {
    return this.sibling(-1);
  }
  atLastNode(dir) {
    let index, parent, { buffer } = this;
    if (buffer) {
      if (dir > 0) {
        if (this.index < buffer.buffer.buffer.length)
          return false;
      } else {
        for (let i2 = 0; i2 < this.index; i2++)
          if (buffer.buffer.buffer[i2 + 3] < this.index)
            return false;
      }
      ({ index, parent } = buffer);
    } else {
      ({ index, _parent: parent } = this._tree);
    }
    for (; parent; { index, _parent: parent } = parent) {
      if (index > -1)
        for (let i2 = index + dir, e3 = dir < 0 ? -1 : parent._tree.children.length; i2 != e3; i2 += dir) {
          let child = parent._tree.children[i2];
          if (this.mode & IterMode.IncludeAnonymous || child instanceof TreeBuffer || !child.type.isAnonymous || hasChild(child))
            return false;
        }
    }
    return true;
  }
  move(dir, enter) {
    if (enter && this.enterChild(
      dir,
      0,
      4
      /* Side.DontCare */
    ))
      return true;
    for (; ; ) {
      if (this.sibling(dir))
        return true;
      if (this.atLastNode(dir) || !this.parent())
        return false;
    }
  }
  /**
  Move to the next node in a
  [pre-order](https://en.wikipedia.org/wiki/Tree_traversal#Pre-order,_NLR)
  traversal, going from a node to its first child or, if the
  current node is empty or `enter` is false, its next sibling or
  the next sibling of the first parent node that has one.
  */
  next(enter = true) {
    return this.move(1, enter);
  }
  /**
  Move to the next node in a last-to-first pre-order traveral. A
  node is followed by its last child or, if it has none, its
  previous sibling or the previous sibling of the first parent
  node that has one.
  */
  prev(enter = true) {
    return this.move(-1, enter);
  }
  /**
  Move the cursor to the innermost node that covers `pos`. If
  `side` is -1, it will enter nodes that end at `pos`. If it is 1,
  it will enter nodes that start at `pos`.
  */
  moveTo(pos, side = 0) {
    while (this.from == this.to || (side < 1 ? this.from >= pos : this.from > pos) || (side > -1 ? this.to <= pos : this.to < pos))
      if (!this.parent())
        break;
    while (this.enterChild(1, pos, side)) {
    }
    return this;
  }
  /**
  Get a [syntax node](#common.SyntaxNode) at the cursor's current
  position.
  */
  get node() {
    if (!this.buffer)
      return this._tree;
    let cache2 = this.bufferNode, result = null, depth = 0;
    if (cache2 && cache2.context == this.buffer) {
      scan:
        for (let index = this.index, d = this.stack.length; d >= 0; ) {
          for (let c4 = cache2; c4; c4 = c4._parent)
            if (c4.index == index) {
              if (index == this.index)
                return c4;
              result = c4;
              depth = d + 1;
              break scan;
            }
          index = this.stack[--d];
        }
    }
    for (let i2 = depth; i2 < this.stack.length; i2++)
      result = new BufferNode(this.buffer, result, this.stack[i2]);
    return this.bufferNode = new BufferNode(this.buffer, result, this.index);
  }
  /**
  Get the [tree](#common.Tree) that represents the current node, if
  any. Will return null when the node is in a [tree
  buffer](#common.TreeBuffer).
  */
  get tree() {
    return this.buffer ? null : this._tree._tree;
  }
  /**
  Iterate over the current node and all its descendants, calling
  `enter` when entering a node and `leave`, if given, when leaving
  one. When `enter` returns `false`, any children of that node are
  skipped, and `leave` isn't called for it.
  */
  iterate(enter, leave) {
    for (let depth = 0; ; ) {
      let mustLeave = false;
      if (this.type.isAnonymous || enter(this) !== false) {
        if (this.firstChild()) {
          depth++;
          continue;
        }
        if (!this.type.isAnonymous)
          mustLeave = true;
      }
      for (; ; ) {
        if (mustLeave && leave)
          leave(this);
        mustLeave = this.type.isAnonymous;
        if (this.nextSibling())
          break;
        if (!depth)
          return;
        this.parent();
        depth--;
        mustLeave = true;
      }
    }
  }
  /**
  Test whether the current node matches a given context—a sequence
  of direct parent node names. Empty strings in the context array
  are treated as wildcards.
  */
  matchContext(context2) {
    if (!this.buffer)
      return matchNodeContext(this.node, context2);
    let { buffer } = this.buffer, { types: types2 } = buffer.set;
    for (let i2 = context2.length - 1, d = this.stack.length - 1; i2 >= 0; d--) {
      if (d < 0)
        return matchNodeContext(this.node, context2, i2);
      let type = types2[buffer.buffer[this.stack[d]]];
      if (!type.isAnonymous) {
        if (context2[i2] && context2[i2] != type.name)
          return false;
        i2--;
      }
    }
    return true;
  }
};
function hasChild(tree) {
  return tree.children.some((ch) => ch instanceof TreeBuffer || !ch.type.isAnonymous || hasChild(ch));
}
function buildTree(data) {
  var _a2;
  let { buffer, nodeSet, maxBufferLength = DefaultBufferLength, reused = [], minRepeatType = nodeSet.types.length } = data;
  let cursor3 = Array.isArray(buffer) ? new FlatBufferCursor(buffer, buffer.length) : buffer;
  let types2 = nodeSet.types;
  let contextHash = 0, lookAhead = 0;
  function takeNode(parentStart, minPos, children2, positions2, inRepeat) {
    let { id: id2, start, end, size } = cursor3;
    let lookAheadAtStart = lookAhead;
    while (size < 0) {
      cursor3.next();
      if (size == -1) {
        let node57 = reused[id2];
        children2.push(node57);
        positions2.push(start - parentStart);
        return;
      } else if (size == -3) {
        contextHash = id2;
        return;
      } else if (size == -4) {
        lookAhead = id2;
        return;
      } else {
        throw new RangeError(`Unrecognized record size: ${size}`);
      }
    }
    let type = types2[id2], node56, buffer2;
    let startPos = start - parentStart;
    if (end - start <= maxBufferLength && (buffer2 = findBufferSize(cursor3.pos - minPos, inRepeat))) {
      let data2 = new Uint16Array(buffer2.size - buffer2.skip);
      let endPos = cursor3.pos - buffer2.size, index = data2.length;
      while (cursor3.pos > endPos)
        index = copyToBuffer(buffer2.start, data2, index);
      node56 = new TreeBuffer(data2, end - buffer2.start, nodeSet);
      startPos = buffer2.start - parentStart;
    } else {
      let endPos = cursor3.pos - size;
      cursor3.next();
      let localChildren = [], localPositions = [];
      let localInRepeat = id2 >= minRepeatType ? id2 : -1;
      let lastGroup = 0, lastEnd = end;
      while (cursor3.pos > endPos) {
        if (localInRepeat >= 0 && cursor3.id == localInRepeat && cursor3.size >= 0) {
          if (cursor3.end <= lastEnd - maxBufferLength) {
            makeRepeatLeaf(localChildren, localPositions, start, lastGroup, cursor3.end, lastEnd, localInRepeat, lookAheadAtStart);
            lastGroup = localChildren.length;
            lastEnd = cursor3.end;
          }
          cursor3.next();
        } else {
          takeNode(start, endPos, localChildren, localPositions, localInRepeat);
        }
      }
      if (localInRepeat >= 0 && lastGroup > 0 && lastGroup < localChildren.length)
        makeRepeatLeaf(localChildren, localPositions, start, lastGroup, start, lastEnd, localInRepeat, lookAheadAtStart);
      localChildren.reverse();
      localPositions.reverse();
      if (localInRepeat > -1 && lastGroup > 0) {
        let make = makeBalanced(type);
        node56 = balanceRange(type, localChildren, localPositions, 0, localChildren.length, 0, end - start, make, make);
      } else {
        node56 = makeTree(type, localChildren, localPositions, end - start, lookAheadAtStart - end);
      }
    }
    children2.push(node56);
    positions2.push(startPos);
  }
  function makeBalanced(type) {
    return (children2, positions2, length3) => {
      let lookAhead2 = 0, lastI = children2.length - 1, last, lookAheadProp;
      if (lastI >= 0 && (last = children2[lastI]) instanceof Tree) {
        if (!lastI && last.type == type && last.length == length3)
          return last;
        if (lookAheadProp = last.prop(NodeProp.lookAhead))
          lookAhead2 = positions2[lastI] + last.length + lookAheadProp;
      }
      return makeTree(type, children2, positions2, length3, lookAhead2);
    };
  }
  function makeRepeatLeaf(children2, positions2, base2, i2, from2, to, type, lookAhead2) {
    let localChildren = [], localPositions = [];
    while (children2.length > i2) {
      localChildren.push(children2.pop());
      localPositions.push(positions2.pop() + base2 - from2);
    }
    children2.push(makeTree(nodeSet.types[type], localChildren, localPositions, to - from2, lookAhead2 - to));
    positions2.push(from2 - base2);
  }
  function makeTree(type, children2, positions2, length3, lookAhead2 = 0, props) {
    if (contextHash) {
      let pair2 = [NodeProp.contextHash, contextHash];
      props = props ? [pair2].concat(props) : [pair2];
    }
    if (lookAhead2 > 25) {
      let pair2 = [NodeProp.lookAhead, lookAhead2];
      props = props ? [pair2].concat(props) : [pair2];
    }
    return new Tree(type, children2, positions2, length3, props);
  }
  function findBufferSize(maxSize, inRepeat) {
    let fork = cursor3.fork();
    let size = 0, start = 0, skip = 0, minStart = fork.end - maxBufferLength;
    let result = { size: 0, start: 0, skip: 0 };
    scan:
      for (let minPos = fork.pos - maxSize; fork.pos > minPos; ) {
        let nodeSize2 = fork.size;
        if (fork.id == inRepeat && nodeSize2 >= 0) {
          result.size = size;
          result.start = start;
          result.skip = skip;
          skip += 4;
          size += 4;
          fork.next();
          continue;
        }
        let startPos = fork.pos - nodeSize2;
        if (nodeSize2 < 0 || startPos < minPos || fork.start < minStart)
          break;
        let localSkipped = fork.id >= minRepeatType ? 4 : 0;
        let nodeStart2 = fork.start;
        fork.next();
        while (fork.pos > startPos) {
          if (fork.size < 0) {
            if (fork.size == -3)
              localSkipped += 4;
            else
              break scan;
          } else if (fork.id >= minRepeatType) {
            localSkipped += 4;
          }
          fork.next();
        }
        start = nodeStart2;
        size += nodeSize2;
        skip += localSkipped;
      }
    if (inRepeat < 0 || size == maxSize) {
      result.size = size;
      result.start = start;
      result.skip = skip;
    }
    return result.size > 4 ? result : void 0;
  }
  function copyToBuffer(bufferStart, buffer2, index) {
    let { id: id2, start, end, size } = cursor3;
    cursor3.next();
    if (size >= 0 && id2 < minRepeatType) {
      let startIndex = index;
      if (size > 4) {
        let endPos = cursor3.pos - (size - 4);
        while (cursor3.pos > endPos)
          index = copyToBuffer(bufferStart, buffer2, index);
      }
      buffer2[--index] = startIndex;
      buffer2[--index] = end - bufferStart;
      buffer2[--index] = start - bufferStart;
      buffer2[--index] = id2;
    } else if (size == -3) {
      contextHash = id2;
    } else if (size == -4) {
      lookAhead = id2;
    }
    return index;
  }
  let children = [], positions = [];
  while (cursor3.pos > 0)
    takeNode(data.start || 0, data.bufferStart || 0, children, positions, -1);
  let length2 = (_a2 = data.length) !== null && _a2 !== void 0 ? _a2 : children.length ? positions[0] + children[0].length : 0;
  return new Tree(types2[data.topID], children.reverse(), positions.reverse(), length2);
}
var nodeSizeCache = /* @__PURE__ */ new WeakMap();
function nodeSize(balanceType, node56) {
  if (!balanceType.isAnonymous || node56 instanceof TreeBuffer || node56.type != balanceType)
    return 1;
  let size = nodeSizeCache.get(node56);
  if (size == null) {
    size = 1;
    for (let child of node56.children) {
      if (child.type != balanceType || !(child instanceof Tree)) {
        size = 1;
        break;
      }
      size += nodeSize(balanceType, child);
    }
    nodeSizeCache.set(node56, size);
  }
  return size;
}
function balanceRange(balanceType, children, positions, from2, to, start, length2, mkTop, mkTree) {
  let total = 0;
  for (let i2 = from2; i2 < to; i2++)
    total += nodeSize(balanceType, children[i2]);
  let maxChild = Math.ceil(
    total * 1.5 / 8
    /* Balance.BranchFactor */
  );
  let localChildren = [], localPositions = [];
  function divide(children2, positions2, from3, to2, offset) {
    for (let i2 = from3; i2 < to2; ) {
      let groupFrom = i2, groupStart = positions2[i2], groupSize = nodeSize(balanceType, children2[i2]);
      i2++;
      for (; i2 < to2; i2++) {
        let nextSize = nodeSize(balanceType, children2[i2]);
        if (groupSize + nextSize >= maxChild)
          break;
        groupSize += nextSize;
      }
      if (i2 == groupFrom + 1) {
        if (groupSize > maxChild) {
          let only = children2[groupFrom];
          divide(only.children, only.positions, 0, only.children.length, positions2[groupFrom] + offset);
          continue;
        }
        localChildren.push(children2[groupFrom]);
      } else {
        let length3 = positions2[i2 - 1] + children2[i2 - 1].length - groupStart;
        localChildren.push(balanceRange(balanceType, children2, positions2, groupFrom, i2, groupStart, length3, null, mkTree));
      }
      localPositions.push(groupStart + offset - start);
    }
  }
  divide(children, positions, from2, to, 0);
  return (mkTop || mkTree)(localChildren, localPositions, length2);
}
var NodeWeakMap = class {
  constructor() {
    this.map = /* @__PURE__ */ new WeakMap();
  }
  setBuffer(buffer, index, value) {
    let inner = this.map.get(buffer);
    if (!inner)
      this.map.set(buffer, inner = /* @__PURE__ */ new Map());
    inner.set(index, value);
  }
  getBuffer(buffer, index) {
    let inner = this.map.get(buffer);
    return inner && inner.get(index);
  }
  /**
  Set the value for this syntax node.
  */
  set(node56, value) {
    if (node56 instanceof BufferNode)
      this.setBuffer(node56.context.buffer, node56.index, value);
    else if (node56 instanceof TreeNode)
      this.map.set(node56.tree, value);
  }
  /**
  Retrieve value for this syntax node, if it exists in the map.
  */
  get(node56) {
    return node56 instanceof BufferNode ? this.getBuffer(node56.context.buffer, node56.index) : node56 instanceof TreeNode ? this.map.get(node56.tree) : void 0;
  }
  /**
  Set the value for the node that a cursor currently points to.
  */
  cursorSet(cursor3, value) {
    if (cursor3.buffer)
      this.setBuffer(cursor3.buffer.buffer, cursor3.index, value);
    else
      this.map.set(cursor3.tree, value);
  }
  /**
  Retrieve the value for the node that a cursor currently points
  to.
  */
  cursorGet(cursor3) {
    return cursor3.buffer ? this.getBuffer(cursor3.buffer.buffer, cursor3.index) : this.map.get(cursor3.tree);
  }
};
var TreeFragment = class _TreeFragment {
  /**
  Construct a tree fragment. You'll usually want to use
  [`addTree`](#common.TreeFragment^addTree) and
  [`applyChanges`](#common.TreeFragment^applyChanges) instead of
  calling this directly.
  */
  constructor(from2, to, tree, offset, openStart = false, openEnd = false) {
    this.from = from2;
    this.to = to;
    this.tree = tree;
    this.offset = offset;
    this.open = (openStart ? 1 : 0) | (openEnd ? 2 : 0);
  }
  /**
  Whether the start of the fragment represents the start of a
  parse, or the end of a change. (In the second case, it may not
  be safe to reuse some nodes at the start, depending on the
  parsing algorithm.)
  */
  get openStart() {
    return (this.open & 1) > 0;
  }
  /**
  Whether the end of the fragment represents the end of a
  full-document parse, or the start of a change.
  */
  get openEnd() {
    return (this.open & 2) > 0;
  }
  /**
  Create a set of fragments from a freshly parsed tree, or update
  an existing set of fragments by replacing the ones that overlap
  with a tree with content from the new tree. When `partial` is
  true, the parse is treated as incomplete, and the resulting
  fragment has [`openEnd`](#common.TreeFragment.openEnd) set to
  true.
  */
  static addTree(tree, fragments = [], partial = false) {
    let result = [new _TreeFragment(0, tree.length, tree, 0, false, partial)];
    for (let f of fragments)
      if (f.to > tree.length)
        result.push(f);
    return result;
  }
  /**
  Apply a set of edits to an array of fragments, removing or
  splitting fragments as necessary to remove edited ranges, and
  adjusting offsets for fragments that moved.
  */
  static applyChanges(fragments, changes, minGap = 128) {
    if (!changes.length)
      return fragments;
    let result = [];
    let fI = 1, nextF = fragments.length ? fragments[0] : null;
    for (let cI = 0, pos = 0, off = 0; ; cI++) {
      let nextC = cI < changes.length ? changes[cI] : null;
      let nextPos = nextC ? nextC.fromA : 1e9;
      if (nextPos - pos >= minGap)
        while (nextF && nextF.from < nextPos) {
          let cut = nextF;
          if (pos >= cut.from || nextPos <= cut.to || off) {
            let fFrom = Math.max(cut.from, pos) - off, fTo = Math.min(cut.to, nextPos) - off;
            cut = fFrom >= fTo ? null : new _TreeFragment(fFrom, fTo, cut.tree, cut.offset + off, cI > 0, !!nextC);
          }
          if (cut)
            result.push(cut);
          if (nextF.to > nextPos)
            break;
          nextF = fI < fragments.length ? fragments[fI++] : null;
        }
      if (!nextC)
        break;
      pos = nextC.toA;
      off = nextC.toA - nextC.toB;
    }
    return result;
  }
};
var Parser = class {
  /**
  Start a parse, returning a [partial parse](#common.PartialParse)
  object. [`fragments`](#common.TreeFragment) can be passed in to
  make the parse incremental.
  
  By default, the entire input is parsed. You can pass `ranges`,
  which should be a sorted array of non-empty, non-overlapping
  ranges, to parse only those ranges. The tree returned in that
  case will start at `ranges[0].from`.
  */
  startParse(input, fragments, ranges) {
    if (typeof input == "string")
      input = new StringInput(input);
    ranges = !ranges ? [new Range2(0, input.length)] : ranges.length ? ranges.map((r3) => new Range2(r3.from, r3.to)) : [new Range2(0, 0)];
    return this.createParse(input, fragments || [], ranges);
  }
  /**
  Run a full parse, returning the resulting tree.
  */
  parse(input, fragments, ranges) {
    let parse2 = this.startParse(input, fragments, ranges);
    for (; ; ) {
      let done = parse2.advance();
      if (done)
        return done;
    }
  }
};
var StringInput = class {
  constructor(string2) {
    this.string = string2;
  }
  get length() {
    return this.string.length;
  }
  chunk(from2) {
    return this.string.slice(from2);
  }
  get lineChunks() {
    return false;
  }
  read(from2, to) {
    return this.string.slice(from2, to);
  }
};
var stoppedInner = new NodeProp({ perNode: true });

// node_modules/@lezer/highlight/dist/index.js
var nextTagID = 0;
var Tag = class _Tag {
  /**
  @internal
  */
  constructor(set3, base2, modified) {
    this.set = set3;
    this.base = base2;
    this.modified = modified;
    this.id = nextTagID++;
  }
  /**
  Define a new tag. If `parent` is given, the tag is treated as a
  sub-tag of that parent, and
  [highlighters](#highlight.tagHighlighter) that don't mention
  this tag will try to fall back to the parent tag (or grandparent
  tag, etc).
  */
  static define(parent) {
    if (parent === null || parent === void 0 ? void 0 : parent.base)
      throw new Error("Can not derive from a modified tag");
    let tag = new _Tag([], null, []);
    tag.set.push(tag);
    if (parent)
      for (let t3 of parent.set)
        tag.set.push(t3);
    return tag;
  }
  /**
  Define a tag _modifier_, which is a function that, given a tag,
  will return a tag that is a subtag of the original. Applying the
  same modifier to a twice tag will return the same value (`m1(t1)
  == m1(t1)`) and applying multiple modifiers will, regardless or
  order, produce the same tag (`m1(m2(t1)) == m2(m1(t1))`).
  
  When multiple modifiers are applied to a given base tag, each
  smaller set of modifiers is registered as a parent, so that for
  example `m1(m2(m3(t1)))` is a subtype of `m1(m2(t1))`,
  `m1(m3(t1)`, and so on.
  */
  static defineModifier() {
    let mod = new Modifier();
    return (tag) => {
      if (tag.modified.indexOf(mod) > -1)
        return tag;
      return Modifier.get(tag.base || tag, tag.modified.concat(mod).sort((a2, b) => a2.id - b.id));
    };
  }
};
var nextModifierID = 0;
var Modifier = class _Modifier {
  constructor() {
    this.instances = [];
    this.id = nextModifierID++;
  }
  static get(base2, mods) {
    if (!mods.length)
      return base2;
    let exists = mods[0].instances.find((t3) => t3.base == base2 && sameArray2(mods, t3.modified));
    if (exists)
      return exists;
    let set3 = [], tag = new Tag(set3, base2, mods);
    for (let m of mods)
      m.instances.push(tag);
    let configs = powerSet(mods);
    for (let parent of base2.set)
      if (!parent.modified.length)
        for (let config2 of configs)
          set3.push(_Modifier.get(parent, config2));
    return tag;
  }
};
function sameArray2(a2, b) {
  return a2.length == b.length && a2.every((x2, i2) => x2 == b[i2]);
}
function powerSet(array) {
  let sets = [[]];
  for (let i2 = 0; i2 < array.length; i2++) {
    for (let j = 0, e3 = sets.length; j < e3; j++) {
      sets.push(sets[j].concat(array[i2]));
    }
  }
  return sets.sort((a2, b) => b.length - a2.length);
}
function styleTags(spec) {
  let byName = /* @__PURE__ */ Object.create(null);
  for (let prop in spec) {
    let tags2 = spec[prop];
    if (!Array.isArray(tags2))
      tags2 = [tags2];
    for (let part of prop.split(" "))
      if (part) {
        let pieces = [], mode = 2, rest = part;
        for (let pos = 0; ; ) {
          if (rest == "..." && pos > 0 && pos + 3 == part.length) {
            mode = 1;
            break;
          }
          let m = /^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(rest);
          if (!m)
            throw new RangeError("Invalid path: " + part);
          pieces.push(m[0] == "*" ? "" : m[0][0] == '"' ? JSON.parse(m[0]) : m[0]);
          pos += m[0].length;
          if (pos == part.length)
            break;
          let next2 = part[pos++];
          if (pos == part.length && next2 == "!") {
            mode = 0;
            break;
          }
          if (next2 != "/")
            throw new RangeError("Invalid path: " + part);
          rest = part.slice(pos);
        }
        let last = pieces.length - 1, inner = pieces[last];
        if (!inner)
          throw new RangeError("Invalid path: " + part);
        let rule = new Rule(tags2, mode, last > 0 ? pieces.slice(0, last) : null);
        byName[inner] = rule.sort(byName[inner]);
      }
  }
  return ruleNodeProp.add(byName);
}
var ruleNodeProp = new NodeProp();
var Rule = class {
  constructor(tags2, mode, context2, next2) {
    this.tags = tags2;
    this.mode = mode;
    this.context = context2;
    this.next = next2;
  }
  get opaque() {
    return this.mode == 0;
  }
  get inherit() {
    return this.mode == 1;
  }
  sort(other) {
    if (!other || other.depth < this.depth) {
      this.next = other;
      return this;
    }
    other.next = this.sort(other.next);
    return other;
  }
  get depth() {
    return this.context ? this.context.length : 0;
  }
};
Rule.empty = new Rule([], 2, null);
function tagHighlighter(tags2, options) {
  let map3 = /* @__PURE__ */ Object.create(null);
  for (let style of tags2) {
    if (!Array.isArray(style.tag))
      map3[style.tag.id] = style.class;
    else
      for (let tag of style.tag)
        map3[tag.id] = style.class;
  }
  let { scope, all = null } = options || {};
  return {
    style: (tags3) => {
      let cls = all;
      for (let tag of tags3) {
        for (let sub of tag.set) {
          let tagClass = map3[sub.id];
          if (tagClass) {
            cls = cls ? cls + " " + tagClass : tagClass;
            break;
          }
        }
      }
      return cls;
    },
    scope
  };
}
function highlightTags(highlighters, tags2) {
  let result = null;
  for (let highlighter of highlighters) {
    let value = highlighter.style(tags2);
    if (value)
      result = result ? result + " " + value : value;
  }
  return result;
}
function highlightTree(tree, highlighter, putStyle, from2 = 0, to = tree.length) {
  let builder = new HighlightBuilder(from2, Array.isArray(highlighter) ? highlighter : [highlighter], putStyle);
  builder.highlightRange(tree.cursor(), from2, to, "", builder.highlighters);
  builder.flush(to);
}
var HighlightBuilder = class {
  constructor(at, highlighters, span) {
    this.at = at;
    this.highlighters = highlighters;
    this.span = span;
    this.class = "";
  }
  startSpan(at, cls) {
    if (cls != this.class) {
      this.flush(at);
      if (at > this.at)
        this.at = at;
      this.class = cls;
    }
  }
  flush(to) {
    if (to > this.at && this.class)
      this.span(this.at, to, this.class);
  }
  highlightRange(cursor3, from2, to, inheritedClass, highlighters) {
    let { type, from: start, to: end } = cursor3;
    if (start >= to || end <= from2)
      return;
    if (type.isTop)
      highlighters = this.highlighters.filter((h) => !h.scope || h.scope(type));
    let cls = inheritedClass;
    let rule = getStyleTags(cursor3) || Rule.empty;
    let tagCls = highlightTags(highlighters, rule.tags);
    if (tagCls) {
      if (cls)
        cls += " ";
      cls += tagCls;
      if (rule.mode == 1)
        inheritedClass += (inheritedClass ? " " : "") + tagCls;
    }
    this.startSpan(Math.max(from2, start), cls);
    if (rule.opaque)
      return;
    let mounted = cursor3.tree && cursor3.tree.prop(NodeProp.mounted);
    if (mounted && mounted.overlay) {
      let inner = cursor3.node.enter(mounted.overlay[0].from + start, 1);
      let innerHighlighters = this.highlighters.filter((h) => !h.scope || h.scope(mounted.tree.type));
      let hasChild2 = cursor3.firstChild();
      for (let i2 = 0, pos = start; ; i2++) {
        let next2 = i2 < mounted.overlay.length ? mounted.overlay[i2] : null;
        let nextPos = next2 ? next2.from + start : end;
        let rangeFrom = Math.max(from2, pos), rangeTo = Math.min(to, nextPos);
        if (rangeFrom < rangeTo && hasChild2) {
          while (cursor3.from < rangeTo) {
            this.highlightRange(cursor3, rangeFrom, rangeTo, inheritedClass, highlighters);
            this.startSpan(Math.min(rangeTo, cursor3.to), cls);
            if (cursor3.to >= nextPos || !cursor3.nextSibling())
              break;
          }
        }
        if (!next2 || nextPos > to)
          break;
        pos = next2.to + start;
        if (pos > from2) {
          this.highlightRange(inner.cursor(), Math.max(from2, next2.from + start), Math.min(to, pos), "", innerHighlighters);
          this.startSpan(Math.min(to, pos), cls);
        }
      }
      if (hasChild2)
        cursor3.parent();
    } else if (cursor3.firstChild()) {
      if (mounted)
        inheritedClass = "";
      do {
        if (cursor3.to <= from2)
          continue;
        if (cursor3.from >= to)
          break;
        this.highlightRange(cursor3, from2, to, inheritedClass, highlighters);
        this.startSpan(Math.min(to, cursor3.to), cls);
      } while (cursor3.nextSibling());
      cursor3.parent();
    }
  }
};
function getStyleTags(node56) {
  let rule = node56.type.prop(ruleNodeProp);
  while (rule && rule.context && !node56.matchContext(rule.context))
    rule = rule.next;
  return rule || null;
}
var t2 = Tag.define;
var comment2 = t2();
var name = t2();
var typeName = t2(name);
var propertyName = t2(name);
var literal = t2();
var string = t2(literal);
var number = t2(literal);
var content = t2();
var heading = t2(content);
var keyword = t2();
var operator = t2();
var punctuation = t2();
var bracket = t2(punctuation);
var meta = t2();
var tags = {
  /**
  A comment.
  */
  comment: comment2,
  /**
  A line [comment](#highlight.tags.comment).
  */
  lineComment: t2(comment2),
  /**
  A block [comment](#highlight.tags.comment).
  */
  blockComment: t2(comment2),
  /**
  A documentation [comment](#highlight.tags.comment).
  */
  docComment: t2(comment2),
  /**
  Any kind of identifier.
  */
  name,
  /**
  The [name](#highlight.tags.name) of a variable.
  */
  variableName: t2(name),
  /**
  A type [name](#highlight.tags.name).
  */
  typeName,
  /**
  A tag name (subtag of [`typeName`](#highlight.tags.typeName)).
  */
  tagName: t2(typeName),
  /**
  A property or field [name](#highlight.tags.name).
  */
  propertyName,
  /**
  An attribute name (subtag of [`propertyName`](#highlight.tags.propertyName)).
  */
  attributeName: t2(propertyName),
  /**
  The [name](#highlight.tags.name) of a class.
  */
  className: t2(name),
  /**
  A label [name](#highlight.tags.name).
  */
  labelName: t2(name),
  /**
  A namespace [name](#highlight.tags.name).
  */
  namespace: t2(name),
  /**
  The [name](#highlight.tags.name) of a macro.
  */
  macroName: t2(name),
  /**
  A literal value.
  */
  literal,
  /**
  A string [literal](#highlight.tags.literal).
  */
  string,
  /**
  A documentation [string](#highlight.tags.string).
  */
  docString: t2(string),
  /**
  A character literal (subtag of [string](#highlight.tags.string)).
  */
  character: t2(string),
  /**
  An attribute value (subtag of [string](#highlight.tags.string)).
  */
  attributeValue: t2(string),
  /**
  A number [literal](#highlight.tags.literal).
  */
  number,
  /**
  An integer [number](#highlight.tags.number) literal.
  */
  integer: t2(number),
  /**
  A floating-point [number](#highlight.tags.number) literal.
  */
  float: t2(number),
  /**
  A boolean [literal](#highlight.tags.literal).
  */
  bool: t2(literal),
  /**
  Regular expression [literal](#highlight.tags.literal).
  */
  regexp: t2(literal),
  /**
  An escape [literal](#highlight.tags.literal), for example a
  backslash escape in a string.
  */
  escape: t2(literal),
  /**
  A color [literal](#highlight.tags.literal).
  */
  color: t2(literal),
  /**
  A URL [literal](#highlight.tags.literal).
  */
  url: t2(literal),
  /**
  A language keyword.
  */
  keyword,
  /**
  The [keyword](#highlight.tags.keyword) for the self or this
  object.
  */
  self: t2(keyword),
  /**
  The [keyword](#highlight.tags.keyword) for null.
  */
  null: t2(keyword),
  /**
  A [keyword](#highlight.tags.keyword) denoting some atomic value.
  */
  atom: t2(keyword),
  /**
  A [keyword](#highlight.tags.keyword) that represents a unit.
  */
  unit: t2(keyword),
  /**
  A modifier [keyword](#highlight.tags.keyword).
  */
  modifier: t2(keyword),
  /**
  A [keyword](#highlight.tags.keyword) that acts as an operator.
  */
  operatorKeyword: t2(keyword),
  /**
  A control-flow related [keyword](#highlight.tags.keyword).
  */
  controlKeyword: t2(keyword),
  /**
  A [keyword](#highlight.tags.keyword) that defines something.
  */
  definitionKeyword: t2(keyword),
  /**
  A [keyword](#highlight.tags.keyword) related to defining or
  interfacing with modules.
  */
  moduleKeyword: t2(keyword),
  /**
  An operator.
  */
  operator,
  /**
  An [operator](#highlight.tags.operator) that dereferences something.
  */
  derefOperator: t2(operator),
  /**
  Arithmetic-related [operator](#highlight.tags.operator).
  */
  arithmeticOperator: t2(operator),
  /**
  Logical [operator](#highlight.tags.operator).
  */
  logicOperator: t2(operator),
  /**
  Bit [operator](#highlight.tags.operator).
  */
  bitwiseOperator: t2(operator),
  /**
  Comparison [operator](#highlight.tags.operator).
  */
  compareOperator: t2(operator),
  /**
  [Operator](#highlight.tags.operator) that updates its operand.
  */
  updateOperator: t2(operator),
  /**
  [Operator](#highlight.tags.operator) that defines something.
  */
  definitionOperator: t2(operator),
  /**
  Type-related [operator](#highlight.tags.operator).
  */
  typeOperator: t2(operator),
  /**
  Control-flow [operator](#highlight.tags.operator).
  */
  controlOperator: t2(operator),
  /**
  Program or markup punctuation.
  */
  punctuation,
  /**
  [Punctuation](#highlight.tags.punctuation) that separates
  things.
  */
  separator: t2(punctuation),
  /**
  Bracket-style [punctuation](#highlight.tags.punctuation).
  */
  bracket,
  /**
  Angle [brackets](#highlight.tags.bracket) (usually `<` and `>`
  tokens).
  */
  angleBracket: t2(bracket),
  /**
  Square [brackets](#highlight.tags.bracket) (usually `[` and `]`
  tokens).
  */
  squareBracket: t2(bracket),
  /**
  Parentheses (usually `(` and `)` tokens). Subtag of
  [bracket](#highlight.tags.bracket).
  */
  paren: t2(bracket),
  /**
  Braces (usually `{` and `}` tokens). Subtag of
  [bracket](#highlight.tags.bracket).
  */
  brace: t2(bracket),
  /**
  Content, for example plain text in XML or markup documents.
  */
  content,
  /**
  [Content](#highlight.tags.content) that represents a heading.
  */
  heading,
  /**
  A level 1 [heading](#highlight.tags.heading).
  */
  heading1: t2(heading),
  /**
  A level 2 [heading](#highlight.tags.heading).
  */
  heading2: t2(heading),
  /**
  A level 3 [heading](#highlight.tags.heading).
  */
  heading3: t2(heading),
  /**
  A level 4 [heading](#highlight.tags.heading).
  */
  heading4: t2(heading),
  /**
  A level 5 [heading](#highlight.tags.heading).
  */
  heading5: t2(heading),
  /**
  A level 6 [heading](#highlight.tags.heading).
  */
  heading6: t2(heading),
  /**
  A prose separator (such as a horizontal rule).
  */
  contentSeparator: t2(content),
  /**
  [Content](#highlight.tags.content) that represents a list.
  */
  list: t2(content),
  /**
  [Content](#highlight.tags.content) that represents a quote.
  */
  quote: t2(content),
  /**
  [Content](#highlight.tags.content) that is emphasized.
  */
  emphasis: t2(content),
  /**
  [Content](#highlight.tags.content) that is styled strong.
  */
  strong: t2(content),
  /**
  [Content](#highlight.tags.content) that is part of a link.
  */
  link: t2(content),
  /**
  [Content](#highlight.tags.content) that is styled as code or
  monospace.
  */
  monospace: t2(content),
  /**
  [Content](#highlight.tags.content) that has a strike-through
  style.
  */
  strikethrough: t2(content),
  /**
  Inserted text in a change-tracking format.
  */
  inserted: t2(),
  /**
  Deleted text.
  */
  deleted: t2(),
  /**
  Changed text.
  */
  changed: t2(),
  /**
  An invalid or unsyntactic element.
  */
  invalid: t2(),
  /**
  Metadata or meta-instruction.
  */
  meta,
  /**
  [Metadata](#highlight.tags.meta) that applies to the entire
  document.
  */
  documentMeta: t2(meta),
  /**
  [Metadata](#highlight.tags.meta) that annotates or adds
  attributes to a given syntactic element.
  */
  annotation: t2(meta),
  /**
  Processing instruction or preprocessor directive. Subtag of
  [meta](#highlight.tags.meta).
  */
  processingInstruction: t2(meta),
  /**
  [Modifier](#highlight.Tag^defineModifier) that indicates that a
  given element is being defined. Expected to be used with the
  various [name](#highlight.tags.name) tags.
  */
  definition: Tag.defineModifier(),
  /**
  [Modifier](#highlight.Tag^defineModifier) that indicates that
  something is constant. Mostly expected to be used with
  [variable names](#highlight.tags.variableName).
  */
  constant: Tag.defineModifier(),
  /**
  [Modifier](#highlight.Tag^defineModifier) used to indicate that
  a [variable](#highlight.tags.variableName) or [property
  name](#highlight.tags.propertyName) is being called or defined
  as a function.
  */
  function: Tag.defineModifier(),
  /**
  [Modifier](#highlight.Tag^defineModifier) that can be applied to
  [names](#highlight.tags.name) to indicate that they belong to
  the language's standard environment.
  */
  standard: Tag.defineModifier(),
  /**
  [Modifier](#highlight.Tag^defineModifier) that indicates a given
  [names](#highlight.tags.name) is local to some scope.
  */
  local: Tag.defineModifier(),
  /**
  A generic variant [modifier](#highlight.Tag^defineModifier) that
  can be used to tag language-specific alternative variants of
  some common tag. It is recommended for themes to define special
  forms of at least the [string](#highlight.tags.string) and
  [variable name](#highlight.tags.variableName) tags, since those
  come up a lot.
  */
  special: Tag.defineModifier()
};
var classHighlighter = tagHighlighter([
  { tag: tags.link, class: "tok-link" },
  { tag: tags.heading, class: "tok-heading" },
  { tag: tags.emphasis, class: "tok-emphasis" },
  { tag: tags.strong, class: "tok-strong" },
  { tag: tags.keyword, class: "tok-keyword" },
  { tag: tags.atom, class: "tok-atom" },
  { tag: tags.bool, class: "tok-bool" },
  { tag: tags.url, class: "tok-url" },
  { tag: tags.labelName, class: "tok-labelName" },
  { tag: tags.inserted, class: "tok-inserted" },
  { tag: tags.deleted, class: "tok-deleted" },
  { tag: tags.literal, class: "tok-literal" },
  { tag: tags.string, class: "tok-string" },
  { tag: tags.number, class: "tok-number" },
  { tag: [tags.regexp, tags.escape, tags.special(tags.string)], class: "tok-string2" },
  { tag: tags.variableName, class: "tok-variableName" },
  { tag: tags.local(tags.variableName), class: "tok-variableName tok-local" },
  { tag: tags.definition(tags.variableName), class: "tok-variableName tok-definition" },
  { tag: tags.special(tags.variableName), class: "tok-variableName2" },
  { tag: tags.definition(tags.propertyName), class: "tok-propertyName tok-definition" },
  { tag: tags.typeName, class: "tok-typeName" },
  { tag: tags.namespace, class: "tok-namespace" },
  { tag: tags.className, class: "tok-className" },
  { tag: tags.macroName, class: "tok-macroName" },
  { tag: tags.propertyName, class: "tok-propertyName" },
  { tag: tags.operator, class: "tok-operator" },
  { tag: tags.comment, class: "tok-comment" },
  { tag: tags.meta, class: "tok-meta" },
  { tag: tags.invalid, class: "tok-invalid" },
  { tag: tags.punctuation, class: "tok-punctuation" }
]);

// node_modules/@codemirror/language/dist/index.js
var _a;
var languageDataProp = /* @__PURE__ */ new NodeProp();
function defineLanguageFacet(baseData) {
  return Facet.define({
    combine: baseData ? (values2) => values2.concat(baseData) : void 0
  });
}
var sublanguageProp = /* @__PURE__ */ new NodeProp();
var Language = class {
  /**
  Construct a language object. If you need to invoke this
  directly, first define a data facet with
  [`defineLanguageFacet`](https://codemirror.net/6/docs/ref/#language.defineLanguageFacet), and then
  configure your parser to [attach](https://codemirror.net/6/docs/ref/#language.languageDataProp) it
  to the language's outer syntax node.
  */
  constructor(data, parser3, extraExtensions = [], name2 = "") {
    this.data = data;
    this.name = name2;
    if (!EditorState.prototype.hasOwnProperty("tree"))
      Object.defineProperty(EditorState.prototype, "tree", { get() {
        return syntaxTree(this);
      } });
    this.parser = parser3;
    this.extension = [
      language.of(this),
      EditorState.languageData.of((state, pos, side) => {
        let top2 = topNodeAt(state, pos, side), data2 = top2.type.prop(languageDataProp);
        if (!data2)
          return [];
        let base2 = state.facet(data2), sub = top2.type.prop(sublanguageProp);
        if (sub) {
          let innerNode = top2.resolve(pos - top2.from, side);
          for (let sublang of sub)
            if (sublang.test(innerNode, state)) {
              let data3 = state.facet(sublang.facet);
              return sublang.type == "replace" ? data3 : data3.concat(base2);
            }
        }
        return base2;
      })
    ].concat(extraExtensions);
  }
  /**
  Query whether this language is active at the given position.
  */
  isActiveAt(state, pos, side = -1) {
    return topNodeAt(state, pos, side).type.prop(languageDataProp) == this.data;
  }
  /**
  Find the document regions that were parsed using this language.
  The returned regions will _include_ any nested languages rooted
  in this language, when those exist.
  */
  findRegions(state) {
    let lang = state.facet(language);
    if ((lang === null || lang === void 0 ? void 0 : lang.data) == this.data)
      return [{ from: 0, to: state.doc.length }];
    if (!lang || !lang.allowsNesting)
      return [];
    let result = [];
    let explore = (tree, from2) => {
      if (tree.prop(languageDataProp) == this.data) {
        result.push({ from: from2, to: from2 + tree.length });
        return;
      }
      let mount = tree.prop(NodeProp.mounted);
      if (mount) {
        if (mount.tree.prop(languageDataProp) == this.data) {
          if (mount.overlay)
            for (let r3 of mount.overlay)
              result.push({ from: r3.from + from2, to: r3.to + from2 });
          else
            result.push({ from: from2, to: from2 + tree.length });
          return;
        } else if (mount.overlay) {
          let size = result.length;
          explore(mount.tree, mount.overlay[0].from + from2);
          if (result.length > size)
            return;
        }
      }
      for (let i2 = 0; i2 < tree.children.length; i2++) {
        let ch = tree.children[i2];
        if (ch instanceof Tree)
          explore(ch, tree.positions[i2] + from2);
      }
    };
    explore(syntaxTree(state), 0);
    return result;
  }
  /**
  Indicates whether this language allows nested languages. The
  default implementation returns true.
  */
  get allowsNesting() {
    return true;
  }
};
Language.setState = /* @__PURE__ */ StateEffect.define();
function topNodeAt(state, pos, side) {
  let topLang = state.facet(language), tree = syntaxTree(state).topNode;
  if (!topLang || topLang.allowsNesting) {
    for (let node56 = tree; node56; node56 = node56.enter(pos, side, IterMode.ExcludeBuffers))
      if (node56.type.isTop)
        tree = node56;
  }
  return tree;
}
var LRLanguage = class _LRLanguage extends Language {
  constructor(data, parser3, name2) {
    super(data, parser3, [], name2);
    this.parser = parser3;
  }
  /**
  Define a language from a parser.
  */
  static define(spec) {
    let data = defineLanguageFacet(spec.languageData);
    return new _LRLanguage(data, spec.parser.configure({
      props: [languageDataProp.add((type) => type.isTop ? data : void 0)]
    }), spec.name);
  }
  /**
  Create a new instance of this language with a reconfigured
  version of its parser and optionally a new name.
  */
  configure(options, name2) {
    return new _LRLanguage(this.data, this.parser.configure(options), name2 || this.name);
  }
  get allowsNesting() {
    return this.parser.hasWrappers();
  }
};
function syntaxTree(state) {
  let field = state.field(Language.state, false);
  return field ? field.tree : Tree.empty;
}
var DocInput = class {
  /**
  Create an input object for the given document.
  */
  constructor(doc2) {
    this.doc = doc2;
    this.cursorPos = 0;
    this.string = "";
    this.cursor = doc2.iter();
  }
  get length() {
    return this.doc.length;
  }
  syncTo(pos) {
    this.string = this.cursor.next(pos - this.cursorPos).value;
    this.cursorPos = pos + this.string.length;
    return this.cursorPos - this.string.length;
  }
  chunk(pos) {
    this.syncTo(pos);
    return this.string;
  }
  get lineChunks() {
    return true;
  }
  read(from2, to) {
    let stringStart = this.cursorPos - this.string.length;
    if (from2 < stringStart || to >= this.cursorPos)
      return this.doc.sliceString(from2, to);
    else
      return this.string.slice(from2 - stringStart, to - stringStart);
  }
};
var currentContext = null;
var ParseContext = class _ParseContext {
  constructor(parser3, state, fragments = [], tree, treeLen, viewport, skipped, scheduleOn) {
    this.parser = parser3;
    this.state = state;
    this.fragments = fragments;
    this.tree = tree;
    this.treeLen = treeLen;
    this.viewport = viewport;
    this.skipped = skipped;
    this.scheduleOn = scheduleOn;
    this.parse = null;
    this.tempSkipped = [];
  }
  /**
  @internal
  */
  static create(parser3, state, viewport) {
    return new _ParseContext(parser3, state, [], Tree.empty, 0, viewport, [], null);
  }
  startParse() {
    return this.parser.startParse(new DocInput(this.state.doc), this.fragments);
  }
  /**
  @internal
  */
  work(until, upto) {
    if (upto != null && upto >= this.state.doc.length)
      upto = void 0;
    if (this.tree != Tree.empty && this.isDone(upto !== null && upto !== void 0 ? upto : this.state.doc.length)) {
      this.takeTree();
      return true;
    }
    return this.withContext(() => {
      var _a2;
      if (typeof until == "number") {
        let endTime = Date.now() + until;
        until = () => Date.now() > endTime;
      }
      if (!this.parse)
        this.parse = this.startParse();
      if (upto != null && (this.parse.stoppedAt == null || this.parse.stoppedAt > upto) && upto < this.state.doc.length)
        this.parse.stopAt(upto);
      for (; ; ) {
        let done = this.parse.advance();
        if (done) {
          this.fragments = this.withoutTempSkipped(TreeFragment.addTree(done, this.fragments, this.parse.stoppedAt != null));
          this.treeLen = (_a2 = this.parse.stoppedAt) !== null && _a2 !== void 0 ? _a2 : this.state.doc.length;
          this.tree = done;
          this.parse = null;
          if (this.treeLen < (upto !== null && upto !== void 0 ? upto : this.state.doc.length))
            this.parse = this.startParse();
          else
            return true;
        }
        if (until())
          return false;
      }
    });
  }
  /**
  @internal
  */
  takeTree() {
    let pos, tree;
    if (this.parse && (pos = this.parse.parsedPos) >= this.treeLen) {
      if (this.parse.stoppedAt == null || this.parse.stoppedAt > pos)
        this.parse.stopAt(pos);
      this.withContext(() => {
        while (!(tree = this.parse.advance())) {
        }
      });
      this.treeLen = pos;
      this.tree = tree;
      this.fragments = this.withoutTempSkipped(TreeFragment.addTree(this.tree, this.fragments, true));
      this.parse = null;
    }
  }
  withContext(f) {
    let prev2 = currentContext;
    currentContext = this;
    try {
      return f();
    } finally {
      currentContext = prev2;
    }
  }
  withoutTempSkipped(fragments) {
    for (let r3; r3 = this.tempSkipped.pop(); )
      fragments = cutFragments(fragments, r3.from, r3.to);
    return fragments;
  }
  /**
  @internal
  */
  changes(changes, newState) {
    let { fragments, tree, treeLen, viewport, skipped } = this;
    this.takeTree();
    if (!changes.empty) {
      let ranges = [];
      changes.iterChangedRanges((fromA, toA, fromB, toB) => ranges.push({ fromA, toA, fromB, toB }));
      fragments = TreeFragment.applyChanges(fragments, ranges);
      tree = Tree.empty;
      treeLen = 0;
      viewport = { from: changes.mapPos(viewport.from, -1), to: changes.mapPos(viewport.to, 1) };
      if (this.skipped.length) {
        skipped = [];
        for (let r3 of this.skipped) {
          let from2 = changes.mapPos(r3.from, 1), to = changes.mapPos(r3.to, -1);
          if (from2 < to)
            skipped.push({ from: from2, to });
        }
      }
    }
    return new _ParseContext(this.parser, newState, fragments, tree, treeLen, viewport, skipped, this.scheduleOn);
  }
  /**
  @internal
  */
  updateViewport(viewport) {
    if (this.viewport.from == viewport.from && this.viewport.to == viewport.to)
      return false;
    this.viewport = viewport;
    let startLen = this.skipped.length;
    for (let i2 = 0; i2 < this.skipped.length; i2++) {
      let { from: from2, to } = this.skipped[i2];
      if (from2 < viewport.to && to > viewport.from) {
        this.fragments = cutFragments(this.fragments, from2, to);
        this.skipped.splice(i2--, 1);
      }
    }
    if (this.skipped.length >= startLen)
      return false;
    this.reset();
    return true;
  }
  /**
  @internal
  */
  reset() {
    if (this.parse) {
      this.takeTree();
      this.parse = null;
    }
  }
  /**
  Notify the parse scheduler that the given region was skipped
  because it wasn't in view, and the parse should be restarted
  when it comes into view.
  */
  skipUntilInView(from2, to) {
    this.skipped.push({ from: from2, to });
  }
  /**
  Returns a parser intended to be used as placeholder when
  asynchronously loading a nested parser. It'll skip its input and
  mark it as not-really-parsed, so that the next update will parse
  it again.
  
  When `until` is given, a reparse will be scheduled when that
  promise resolves.
  */
  static getSkippingParser(until) {
    return new class extends Parser {
      createParse(input, fragments, ranges) {
        let from2 = ranges[0].from, to = ranges[ranges.length - 1].to;
        let parser3 = {
          parsedPos: from2,
          advance() {
            let cx = currentContext;
            if (cx) {
              for (let r3 of ranges)
                cx.tempSkipped.push(r3);
              if (until)
                cx.scheduleOn = cx.scheduleOn ? Promise.all([cx.scheduleOn, until]) : until;
            }
            this.parsedPos = to;
            return new Tree(NodeType.none, [], [], to - from2);
          },
          stoppedAt: null,
          stopAt() {
          }
        };
        return parser3;
      }
    }();
  }
  /**
  @internal
  */
  isDone(upto) {
    upto = Math.min(upto, this.state.doc.length);
    let frags = this.fragments;
    return this.treeLen >= upto && frags.length && frags[0].from == 0 && frags[0].to >= upto;
  }
  /**
  Get the context for the current parse, or `null` if no editor
  parse is in progress.
  */
  static get() {
    return currentContext;
  }
};
function cutFragments(fragments, from2, to) {
  return TreeFragment.applyChanges(fragments, [{ fromA: from2, toA: to, fromB: from2, toB: to }]);
}
var LanguageState = class _LanguageState {
  constructor(context2) {
    this.context = context2;
    this.tree = context2.tree;
  }
  apply(tr) {
    if (!tr.docChanged && this.tree == this.context.tree)
      return this;
    let newCx = this.context.changes(tr.changes, tr.state);
    let upto = this.context.treeLen == tr.startState.doc.length ? void 0 : Math.max(tr.changes.mapPos(this.context.treeLen), newCx.viewport.to);
    if (!newCx.work(20, upto))
      newCx.takeTree();
    return new _LanguageState(newCx);
  }
  static init(state) {
    let vpTo = Math.min(3e3, state.doc.length);
    let parseState = ParseContext.create(state.facet(language).parser, state, { from: 0, to: vpTo });
    if (!parseState.work(20, vpTo))
      parseState.takeTree();
    return new _LanguageState(parseState);
  }
};
Language.state = /* @__PURE__ */ StateField.define({
  create: LanguageState.init,
  update(value, tr) {
    for (let e3 of tr.effects)
      if (e3.is(Language.setState))
        return e3.value;
    if (tr.startState.facet(language) != tr.state.facet(language))
      return LanguageState.init(tr.state);
    return value.apply(tr);
  }
});
var requestIdle = (callback) => {
  let timeout2 = setTimeout(
    () => callback(),
    500
    /* Work.MaxPause */
  );
  return () => clearTimeout(timeout2);
};
if (typeof requestIdleCallback != "undefined")
  requestIdle = (callback) => {
    let idle = -1, timeout2 = setTimeout(
      () => {
        idle = requestIdleCallback(callback, {
          timeout: 500 - 100
          /* Work.MinPause */
        });
      },
      100
      /* Work.MinPause */
    );
    return () => idle < 0 ? clearTimeout(timeout2) : cancelIdleCallback(idle);
  };
var isInputPending = typeof navigator != "undefined" && ((_a = navigator.scheduling) === null || _a === void 0 ? void 0 : _a.isInputPending) ? () => navigator.scheduling.isInputPending() : null;
var parseWorker = /* @__PURE__ */ ViewPlugin.fromClass(class ParseWorker {
  constructor(view) {
    this.view = view;
    this.working = null;
    this.workScheduled = 0;
    this.chunkEnd = -1;
    this.chunkBudget = -1;
    this.work = this.work.bind(this);
    this.scheduleWork();
  }
  update(update) {
    let cx = this.view.state.field(Language.state).context;
    if (cx.updateViewport(update.view.viewport) || this.view.viewport.to > cx.treeLen)
      this.scheduleWork();
    if (update.docChanged || update.selectionSet) {
      if (this.view.hasFocus)
        this.chunkBudget += 50;
      this.scheduleWork();
    }
    this.checkAsyncSchedule(cx);
  }
  scheduleWork() {
    if (this.working)
      return;
    let { state } = this.view, field = state.field(Language.state);
    if (field.tree != field.context.tree || !field.context.isDone(state.doc.length))
      this.working = requestIdle(this.work);
  }
  work(deadline) {
    this.working = null;
    let now2 = Date.now();
    if (this.chunkEnd < now2 && (this.chunkEnd < 0 || this.view.hasFocus)) {
      this.chunkEnd = now2 + 3e4;
      this.chunkBudget = 3e3;
    }
    if (this.chunkBudget <= 0)
      return;
    let { state, viewport: { to: vpTo } } = this.view, field = state.field(Language.state);
    if (field.tree == field.context.tree && field.context.isDone(
      vpTo + 1e5
      /* Work.MaxParseAhead */
    ))
      return;
    let endTime = Date.now() + Math.min(this.chunkBudget, 100, deadline && !isInputPending ? Math.max(25, deadline.timeRemaining() - 5) : 1e9);
    let viewportFirst = field.context.treeLen < vpTo && state.doc.length > vpTo + 1e3;
    let done = field.context.work(() => {
      return isInputPending && isInputPending() || Date.now() > endTime;
    }, vpTo + (viewportFirst ? 0 : 1e5));
    this.chunkBudget -= Date.now() - now2;
    if (done || this.chunkBudget <= 0) {
      field.context.takeTree();
      this.view.dispatch({ effects: Language.setState.of(new LanguageState(field.context)) });
    }
    if (this.chunkBudget > 0 && !(done && !viewportFirst))
      this.scheduleWork();
    this.checkAsyncSchedule(field.context);
  }
  checkAsyncSchedule(cx) {
    if (cx.scheduleOn) {
      this.workScheduled++;
      cx.scheduleOn.then(() => this.scheduleWork()).catch((err) => logException(this.view.state, err)).then(() => this.workScheduled--);
      cx.scheduleOn = null;
    }
  }
  destroy() {
    if (this.working)
      this.working();
  }
  isWorking() {
    return !!(this.working || this.workScheduled > 0);
  }
}, {
  eventHandlers: { focus() {
    this.scheduleWork();
  } }
});
var language = /* @__PURE__ */ Facet.define({
  combine(languages) {
    return languages.length ? languages[0] : null;
  },
  enables: (language2) => [
    Language.state,
    parseWorker,
    EditorView.contentAttributes.compute([language2], (state) => {
      let lang = state.facet(language2);
      return lang && lang.name ? { "data-language": lang.name } : {};
    })
  ]
});
var LanguageSupport = class {
  /**
  Create a language support object.
  */
  constructor(language2, support = []) {
    this.language = language2;
    this.support = support;
    this.extension = [language2, support];
  }
};
var indentService = /* @__PURE__ */ Facet.define();
var indentUnit = /* @__PURE__ */ Facet.define({
  combine: (values2) => {
    if (!values2.length)
      return "  ";
    let unit2 = values2[0];
    if (!unit2 || /\S/.test(unit2) || Array.from(unit2).some((e3) => e3 != unit2[0]))
      throw new Error("Invalid indent unit: " + JSON.stringify(values2[0]));
    return unit2;
  }
});
function getIndentUnit(state) {
  let unit2 = state.facet(indentUnit);
  return unit2.charCodeAt(0) == 9 ? state.tabSize * unit2.length : unit2.length;
}
function indentString(state, cols) {
  let result = "", ts = state.tabSize, ch = state.facet(indentUnit)[0];
  if (ch == "	") {
    while (cols >= ts) {
      result += "	";
      cols -= ts;
    }
    ch = " ";
  }
  for (let i2 = 0; i2 < cols; i2++)
    result += ch;
  return result;
}
function getIndentation(context2, pos) {
  if (context2 instanceof EditorState)
    context2 = new IndentContext(context2);
  for (let service of context2.state.facet(indentService)) {
    let result = service(context2, pos);
    if (result !== void 0)
      return result;
  }
  let tree = syntaxTree(context2.state);
  return tree.length >= pos ? syntaxIndentation(context2, tree, pos) : null;
}
var IndentContext = class {
  /**
  Create an indent context.
  */
  constructor(state, options = {}) {
    this.state = state;
    this.options = options;
    this.unit = getIndentUnit(state);
  }
  /**
  Get a description of the line at the given position, taking
  [simulated line
  breaks](https://codemirror.net/6/docs/ref/#language.IndentContext.constructor^options.simulateBreak)
  into account. If there is such a break at `pos`, the `bias`
  argument determines whether the part of the line line before or
  after the break is used.
  */
  lineAt(pos, bias = 1) {
    let line2 = this.state.doc.lineAt(pos);
    let { simulateBreak, simulateDoubleBreak } = this.options;
    if (simulateBreak != null && simulateBreak >= line2.from && simulateBreak <= line2.to) {
      if (simulateDoubleBreak && simulateBreak == pos)
        return { text: "", from: pos };
      else if (bias < 0 ? simulateBreak < pos : simulateBreak <= pos)
        return { text: line2.text.slice(simulateBreak - line2.from), from: simulateBreak };
      else
        return { text: line2.text.slice(0, simulateBreak - line2.from), from: line2.from };
    }
    return line2;
  }
  /**
  Get the text directly after `pos`, either the entire line
  or the next 100 characters, whichever is shorter.
  */
  textAfterPos(pos, bias = 1) {
    if (this.options.simulateDoubleBreak && pos == this.options.simulateBreak)
      return "";
    let { text: text2, from: from2 } = this.lineAt(pos, bias);
    return text2.slice(pos - from2, Math.min(text2.length, pos + 100 - from2));
  }
  /**
  Find the column for the given position.
  */
  column(pos, bias = 1) {
    let { text: text2, from: from2 } = this.lineAt(pos, bias);
    let result = this.countColumn(text2, pos - from2);
    let override = this.options.overrideIndentation ? this.options.overrideIndentation(from2) : -1;
    if (override > -1)
      result += override - this.countColumn(text2, text2.search(/\S|$/));
    return result;
  }
  /**
  Find the column position (taking tabs into account) of the given
  position in the given string.
  */
  countColumn(line2, pos = line2.length) {
    return countColumn(line2, this.state.tabSize, pos);
  }
  /**
  Find the indentation column of the line at the given point.
  */
  lineIndent(pos, bias = 1) {
    let { text: text2, from: from2 } = this.lineAt(pos, bias);
    let override = this.options.overrideIndentation;
    if (override) {
      let overriden = override(from2);
      if (overriden > -1)
        return overriden;
    }
    return this.countColumn(text2, text2.search(/\S|$/));
  }
  /**
  Returns the [simulated line
  break](https://codemirror.net/6/docs/ref/#language.IndentContext.constructor^options.simulateBreak)
  for this context, if any.
  */
  get simulatedBreak() {
    return this.options.simulateBreak || null;
  }
};
var indentNodeProp = /* @__PURE__ */ new NodeProp();
function syntaxIndentation(cx, ast, pos) {
  let stack = ast.resolveStack(pos);
  let inner = stack.node.enterUnfinishedNodesBefore(pos);
  if (inner != stack.node) {
    let add2 = [];
    for (let cur2 = inner; cur2 != stack.node; cur2 = cur2.parent)
      add2.push(cur2);
    for (let i2 = add2.length - 1; i2 >= 0; i2--)
      stack = { node: add2[i2], next: stack };
  }
  return indentFor(stack, cx, pos);
}
function indentFor(stack, cx, pos) {
  for (let cur2 = stack; cur2; cur2 = cur2.next) {
    let strategy = indentStrategy(cur2.node);
    if (strategy)
      return strategy(TreeIndentContext.create(cx, pos, cur2));
  }
  return 0;
}
function ignoreClosed(cx) {
  return cx.pos == cx.options.simulateBreak && cx.options.simulateDoubleBreak;
}
function indentStrategy(tree) {
  let strategy = tree.type.prop(indentNodeProp);
  if (strategy)
    return strategy;
  let first = tree.firstChild, close;
  if (first && (close = first.type.prop(NodeProp.closedBy))) {
    let last = tree.lastChild, closed = last && close.indexOf(last.name) > -1;
    return (cx) => delimitedStrategy(cx, true, 1, void 0, closed && !ignoreClosed(cx) ? last.from : void 0);
  }
  return tree.parent == null ? topIndent : null;
}
function topIndent() {
  return 0;
}
var TreeIndentContext = class _TreeIndentContext extends IndentContext {
  constructor(base2, pos, context2) {
    super(base2.state, base2.options);
    this.base = base2;
    this.pos = pos;
    this.context = context2;
  }
  /**
  The syntax tree node to which the indentation strategy
  applies.
  */
  get node() {
    return this.context.node;
  }
  /**
  @internal
  */
  static create(base2, pos, context2) {
    return new _TreeIndentContext(base2, pos, context2);
  }
  /**
  Get the text directly after `this.pos`, either the entire line
  or the next 100 characters, whichever is shorter.
  */
  get textAfter() {
    return this.textAfterPos(this.pos);
  }
  /**
  Get the indentation at the reference line for `this.node`, which
  is the line on which it starts, unless there is a node that is
  _not_ a parent of this node covering the start of that line. If
  so, the line at the start of that node is tried, again skipping
  on if it is covered by another such node.
  */
  get baseIndent() {
    return this.baseIndentFor(this.node);
  }
  /**
  Get the indentation for the reference line of the given node
  (see [`baseIndent`](https://codemirror.net/6/docs/ref/#language.TreeIndentContext.baseIndent)).
  */
  baseIndentFor(node56) {
    let line2 = this.state.doc.lineAt(node56.from);
    for (; ; ) {
      let atBreak = node56.resolve(line2.from);
      while (atBreak.parent && atBreak.parent.from == atBreak.from)
        atBreak = atBreak.parent;
      if (isParent(atBreak, node56))
        break;
      line2 = this.state.doc.lineAt(atBreak.from);
    }
    return this.lineIndent(line2.from);
  }
  /**
  Continue looking for indentations in the node's parent nodes,
  and return the result of that.
  */
  continue() {
    return indentFor(this.context.next, this.base, this.pos);
  }
};
function isParent(parent, of) {
  for (let cur2 = of; cur2; cur2 = cur2.parent)
    if (parent == cur2)
      return true;
  return false;
}
function bracketedAligned(context2) {
  let tree = context2.node;
  let openToken = tree.childAfter(tree.from), last = tree.lastChild;
  if (!openToken)
    return null;
  let sim = context2.options.simulateBreak;
  let openLine = context2.state.doc.lineAt(openToken.from);
  let lineEnd = sim == null || sim <= openLine.from ? openLine.to : Math.min(openLine.to, sim);
  for (let pos = openToken.to; ; ) {
    let next2 = tree.childAfter(pos);
    if (!next2 || next2 == last)
      return null;
    if (!next2.type.isSkipped)
      return next2.from < lineEnd ? openToken : null;
    pos = next2.to;
  }
}
function delimitedIndent({ closing: closing2, align = true, units = 1 }) {
  return (context2) => delimitedStrategy(context2, align, units, closing2);
}
function delimitedStrategy(context2, align, units, closing2, closedAt) {
  let after = context2.textAfter, space2 = after.match(/^\s*/)[0].length;
  let closed = closing2 && after.slice(space2, space2 + closing2.length) == closing2 || closedAt == context2.pos + space2;
  let aligned = align ? bracketedAligned(context2) : null;
  if (aligned)
    return closed ? context2.column(aligned.from) : context2.column(aligned.to);
  return context2.baseIndent + (closed ? 0 : context2.unit * units);
}
function continuedIndent({ except, units = 1 } = {}) {
  return (context2) => {
    let matchExcept = except && except.test(context2.textAfter);
    return context2.baseIndent + (matchExcept ? 0 : units * context2.unit);
  };
}
var DontIndentBeyond = 200;
function indentOnInput() {
  return EditorState.transactionFilter.of((tr) => {
    if (!tr.docChanged || !tr.isUserEvent("input.type") && !tr.isUserEvent("input.complete"))
      return tr;
    let rules = tr.startState.languageDataAt("indentOnInput", tr.startState.selection.main.head);
    if (!rules.length)
      return tr;
    let doc2 = tr.newDoc, { head } = tr.newSelection.main, line2 = doc2.lineAt(head);
    if (head > line2.from + DontIndentBeyond)
      return tr;
    let lineStart = doc2.sliceString(line2.from, head);
    if (!rules.some((r3) => r3.test(lineStart)))
      return tr;
    let { state } = tr, last = -1, changes = [];
    for (let { head: head2 } of state.selection.ranges) {
      let line3 = state.doc.lineAt(head2);
      if (line3.from == last)
        continue;
      last = line3.from;
      let indent2 = getIndentation(state, line3.from);
      if (indent2 == null)
        continue;
      let cur2 = /^\s*/.exec(line3.text)[0];
      let norm = indentString(state, indent2);
      if (cur2 != norm)
        changes.push({ from: line3.from, to: line3.from + cur2.length, insert: norm });
    }
    return changes.length ? [tr, { changes, sequential: true }] : tr;
  });
}
var foldService = /* @__PURE__ */ Facet.define();
var foldNodeProp = /* @__PURE__ */ new NodeProp();
function foldInside(node56) {
  let first = node56.firstChild, last = node56.lastChild;
  return first && first.to < last.from ? { from: first.to, to: last.type.isError ? node56.to : last.from } : null;
}
function syntaxFolding(state, start, end) {
  let tree = syntaxTree(state);
  if (tree.length < end)
    return null;
  let stack = tree.resolveStack(end, 1);
  let found = null;
  for (let iter = stack; iter; iter = iter.next) {
    let cur2 = iter.node;
    if (cur2.to <= end || cur2.from > end)
      continue;
    if (found && cur2.from < start)
      break;
    let prop = cur2.type.prop(foldNodeProp);
    if (prop && (cur2.to < tree.length - 50 || tree.length == state.doc.length || !isUnfinished(cur2))) {
      let value = prop(cur2, state);
      if (value && value.from <= end && value.from >= start && value.to > end)
        found = value;
    }
  }
  return found;
}
function isUnfinished(node56) {
  let ch = node56.lastChild;
  return ch && ch.to == node56.to && ch.type.isError;
}
function foldable(state, lineStart, lineEnd) {
  for (let service of state.facet(foldService)) {
    let result = service(state, lineStart, lineEnd);
    if (result)
      return result;
  }
  return syntaxFolding(state, lineStart, lineEnd);
}
function mapRange(range4, mapping) {
  let from2 = mapping.mapPos(range4.from, 1), to = mapping.mapPos(range4.to, -1);
  return from2 >= to ? void 0 : { from: from2, to };
}
var foldEffect = /* @__PURE__ */ StateEffect.define({ map: mapRange });
var unfoldEffect = /* @__PURE__ */ StateEffect.define({ map: mapRange });
function selectedLines(view) {
  let lines = [];
  for (let { head } of view.state.selection.ranges) {
    if (lines.some((l) => l.from <= head && l.to >= head))
      continue;
    lines.push(view.lineBlockAt(head));
  }
  return lines;
}
var foldState = /* @__PURE__ */ StateField.define({
  create() {
    return Decoration.none;
  },
  update(folded, tr) {
    folded = folded.map(tr.changes);
    for (let e3 of tr.effects) {
      if (e3.is(foldEffect) && !foldExists(folded, e3.value.from, e3.value.to)) {
        let { preparePlaceholder } = tr.state.facet(foldConfig);
        let widget = !preparePlaceholder ? foldWidget : Decoration.replace({ widget: new PreparedFoldWidget(preparePlaceholder(tr.state, e3.value)) });
        folded = folded.update({ add: [widget.range(e3.value.from, e3.value.to)] });
      } else if (e3.is(unfoldEffect)) {
        folded = folded.update({
          filter: (from2, to) => e3.value.from != from2 || e3.value.to != to,
          filterFrom: e3.value.from,
          filterTo: e3.value.to
        });
      }
    }
    if (tr.selection) {
      let onSelection = false, { head } = tr.selection.main;
      folded.between(head, head, (a2, b) => {
        if (a2 < head && b > head)
          onSelection = true;
      });
      if (onSelection)
        folded = folded.update({
          filterFrom: head,
          filterTo: head,
          filter: (a2, b) => b <= head || a2 >= head
        });
    }
    return folded;
  },
  provide: (f) => EditorView.decorations.from(f),
  toJSON(folded, state) {
    let ranges = [];
    folded.between(0, state.doc.length, (from2, to) => {
      ranges.push(from2, to);
    });
    return ranges;
  },
  fromJSON(value) {
    if (!Array.isArray(value) || value.length % 2)
      throw new RangeError("Invalid JSON for fold state");
    let ranges = [];
    for (let i2 = 0; i2 < value.length; ) {
      let from2 = value[i2++], to = value[i2++];
      if (typeof from2 != "number" || typeof to != "number")
        throw new RangeError("Invalid JSON for fold state");
      ranges.push(foldWidget.range(from2, to));
    }
    return Decoration.set(ranges, true);
  }
});
function findFold(state, from2, to) {
  var _a2;
  let found = null;
  (_a2 = state.field(foldState, false)) === null || _a2 === void 0 ? void 0 : _a2.between(from2, to, (from3, to2) => {
    if (!found || found.from > from3)
      found = { from: from3, to: to2 };
  });
  return found;
}
function foldExists(folded, from2, to) {
  let found = false;
  folded.between(from2, from2, (a2, b) => {
    if (a2 == from2 && b == to)
      found = true;
  });
  return found;
}
function maybeEnable(state, other) {
  return state.field(foldState, false) ? other : other.concat(StateEffect.appendConfig.of(codeFolding()));
}
var foldCode = (view) => {
  for (let line2 of selectedLines(view)) {
    let range4 = foldable(view.state, line2.from, line2.to);
    if (range4) {
      view.dispatch({ effects: maybeEnable(view.state, [foldEffect.of(range4), announceFold(view, range4)]) });
      return true;
    }
  }
  return false;
};
var unfoldCode = (view) => {
  if (!view.state.field(foldState, false))
    return false;
  let effects = [];
  for (let line2 of selectedLines(view)) {
    let folded = findFold(view.state, line2.from, line2.to);
    if (folded)
      effects.push(unfoldEffect.of(folded), announceFold(view, folded, false));
  }
  if (effects.length)
    view.dispatch({ effects });
  return effects.length > 0;
};
function announceFold(view, range4, fold = true) {
  let lineFrom = view.state.doc.lineAt(range4.from).number, lineTo = view.state.doc.lineAt(range4.to).number;
  return EditorView.announce.of(`${view.state.phrase(fold ? "Folded lines" : "Unfolded lines")} ${lineFrom} ${view.state.phrase("to")} ${lineTo}.`);
}
var foldAll = (view) => {
  let { state } = view, effects = [];
  for (let pos = 0; pos < state.doc.length; ) {
    let line2 = view.lineBlockAt(pos), range4 = foldable(state, line2.from, line2.to);
    if (range4)
      effects.push(foldEffect.of(range4));
    pos = (range4 ? view.lineBlockAt(range4.to) : line2).to + 1;
  }
  if (effects.length)
    view.dispatch({ effects: maybeEnable(view.state, effects) });
  return !!effects.length;
};
var unfoldAll = (view) => {
  let field = view.state.field(foldState, false);
  if (!field || !field.size)
    return false;
  let effects = [];
  field.between(0, view.state.doc.length, (from2, to) => {
    effects.push(unfoldEffect.of({ from: from2, to }));
  });
  view.dispatch({ effects });
  return true;
};
var foldKeymap = [
  { key: "Ctrl-Shift-[", mac: "Cmd-Alt-[", run: foldCode },
  { key: "Ctrl-Shift-]", mac: "Cmd-Alt-]", run: unfoldCode },
  { key: "Ctrl-Alt-[", run: foldAll },
  { key: "Ctrl-Alt-]", run: unfoldAll }
];
var defaultConfig = {
  placeholderDOM: null,
  preparePlaceholder: null,
  placeholderText: "\u2026"
};
var foldConfig = /* @__PURE__ */ Facet.define({
  combine(values2) {
    return combineConfig(values2, defaultConfig);
  }
});
function codeFolding(config2) {
  let result = [foldState, baseTheme$12];
  if (config2)
    result.push(foldConfig.of(config2));
  return result;
}
function widgetToDOM(view, prepared) {
  let { state } = view, conf = state.facet(foldConfig);
  let onclick = (event) => {
    let line2 = view.lineBlockAt(view.posAtDOM(event.target));
    let folded = findFold(view.state, line2.from, line2.to);
    if (folded)
      view.dispatch({ effects: unfoldEffect.of(folded) });
    event.preventDefault();
  };
  if (conf.placeholderDOM)
    return conf.placeholderDOM(view, onclick, prepared);
  let element2 = document.createElement("span");
  element2.textContent = conf.placeholderText;
  element2.setAttribute("aria-label", state.phrase("folded code"));
  element2.title = state.phrase("unfold");
  element2.className = "cm-foldPlaceholder";
  element2.onclick = onclick;
  return element2;
}
var foldWidget = /* @__PURE__ */ Decoration.replace({ widget: /* @__PURE__ */ new class extends WidgetType {
  toDOM(view) {
    return widgetToDOM(view, null);
  }
}() });
var PreparedFoldWidget = class extends WidgetType {
  constructor(value) {
    super();
    this.value = value;
  }
  eq(other) {
    return this.value == other.value;
  }
  toDOM(view) {
    return widgetToDOM(view, this.value);
  }
};
var foldGutterDefaults = {
  openText: "\u2304",
  closedText: "\u203A",
  markerDOM: null,
  domEventHandlers: {},
  foldingChanged: () => false
};
var FoldMarker = class extends GutterMarker {
  constructor(config2, open) {
    super();
    this.config = config2;
    this.open = open;
  }
  eq(other) {
    return this.config == other.config && this.open == other.open;
  }
  toDOM(view) {
    if (this.config.markerDOM)
      return this.config.markerDOM(this.open);
    let span = document.createElement("span");
    span.textContent = this.open ? this.config.openText : this.config.closedText;
    span.title = view.state.phrase(this.open ? "Fold line" : "Unfold line");
    return span;
  }
};
function foldGutter(config2 = {}) {
  let fullConfig = Object.assign(Object.assign({}, foldGutterDefaults), config2);
  let canFold = new FoldMarker(fullConfig, true), canUnfold = new FoldMarker(fullConfig, false);
  let markers = ViewPlugin.fromClass(class {
    constructor(view) {
      this.from = view.viewport.from;
      this.markers = this.buildMarkers(view);
    }
    update(update) {
      if (update.docChanged || update.viewportChanged || update.startState.facet(language) != update.state.facet(language) || update.startState.field(foldState, false) != update.state.field(foldState, false) || syntaxTree(update.startState) != syntaxTree(update.state) || fullConfig.foldingChanged(update))
        this.markers = this.buildMarkers(update.view);
    }
    buildMarkers(view) {
      let builder = new RangeSetBuilder();
      for (let line2 of view.viewportLineBlocks) {
        let mark = findFold(view.state, line2.from, line2.to) ? canUnfold : foldable(view.state, line2.from, line2.to) ? canFold : null;
        if (mark)
          builder.add(line2.from, line2.from, mark);
      }
      return builder.finish();
    }
  });
  let { domEventHandlers } = fullConfig;
  return [
    markers,
    gutter({
      class: "cm-foldGutter",
      markers(view) {
        var _a2;
        return ((_a2 = view.plugin(markers)) === null || _a2 === void 0 ? void 0 : _a2.markers) || RangeSet.empty;
      },
      initialSpacer() {
        return new FoldMarker(fullConfig, false);
      },
      domEventHandlers: Object.assign(Object.assign({}, domEventHandlers), { click: (view, line2, event) => {
        if (domEventHandlers.click && domEventHandlers.click(view, line2, event))
          return true;
        let folded = findFold(view.state, line2.from, line2.to);
        if (folded) {
          view.dispatch({ effects: unfoldEffect.of(folded) });
          return true;
        }
        let range4 = foldable(view.state, line2.from, line2.to);
        if (range4) {
          view.dispatch({ effects: foldEffect.of(range4) });
          return true;
        }
        return false;
      } })
    }),
    codeFolding()
  ];
}
var baseTheme$12 = /* @__PURE__ */ EditorView.baseTheme({
  ".cm-foldPlaceholder": {
    backgroundColor: "#eee",
    border: "1px solid #ddd",
    color: "#888",
    borderRadius: ".2em",
    margin: "0 1px",
    padding: "0 1px",
    cursor: "pointer"
  },
  ".cm-foldGutter span": {
    padding: "0 1px",
    cursor: "pointer"
  }
});
var HighlightStyle = class _HighlightStyle {
  constructor(specs, options) {
    this.specs = specs;
    let modSpec;
    function def(spec) {
      let cls = StyleModule.newName();
      (modSpec || (modSpec = /* @__PURE__ */ Object.create(null)))["." + cls] = spec;
      return cls;
    }
    const all = typeof options.all == "string" ? options.all : options.all ? def(options.all) : void 0;
    const scopeOpt = options.scope;
    this.scope = scopeOpt instanceof Language ? (type) => type.prop(languageDataProp) == scopeOpt.data : scopeOpt ? (type) => type == scopeOpt : void 0;
    this.style = tagHighlighter(specs.map((style) => ({
      tag: style.tag,
      class: style.class || def(Object.assign({}, style, { tag: null }))
    })), {
      all
    }).style;
    this.module = modSpec ? new StyleModule(modSpec) : null;
    this.themeType = options.themeType;
  }
  /**
  Create a highlighter style that associates the given styles to
  the given tags. The specs must be objects that hold a style tag
  or array of tags in their `tag` property, and either a single
  `class` property providing a static CSS class (for highlighter
  that rely on external styling), or a
  [`style-mod`](https://github.com/marijnh/style-mod#documentation)-style
  set of CSS properties (which define the styling for those tags).
  
  The CSS rules created for a highlighter will be emitted in the
  order of the spec's properties. That means that for elements that
  have multiple tags associated with them, styles defined further
  down in the list will have a higher CSS precedence than styles
  defined earlier.
  */
  static define(specs, options) {
    return new _HighlightStyle(specs, options || {});
  }
};
var highlighterFacet = /* @__PURE__ */ Facet.define();
var fallbackHighlighter = /* @__PURE__ */ Facet.define({
  combine(values2) {
    return values2.length ? [values2[0]] : null;
  }
});
function getHighlighters(state) {
  let main = state.facet(highlighterFacet);
  return main.length ? main : state.facet(fallbackHighlighter);
}
function syntaxHighlighting(highlighter, options) {
  let ext = [treeHighlighter], themeType;
  if (highlighter instanceof HighlightStyle) {
    if (highlighter.module)
      ext.push(EditorView.styleModule.of(highlighter.module));
    themeType = highlighter.themeType;
  }
  if (options === null || options === void 0 ? void 0 : options.fallback)
    ext.push(fallbackHighlighter.of(highlighter));
  else if (themeType)
    ext.push(highlighterFacet.computeN([EditorView.darkTheme], (state) => {
      return state.facet(EditorView.darkTheme) == (themeType == "dark") ? [highlighter] : [];
    }));
  else
    ext.push(highlighterFacet.of(highlighter));
  return ext;
}
var TreeHighlighter = class {
  constructor(view) {
    this.markCache = /* @__PURE__ */ Object.create(null);
    this.tree = syntaxTree(view.state);
    this.decorations = this.buildDeco(view, getHighlighters(view.state));
  }
  update(update) {
    let tree = syntaxTree(update.state), highlighters = getHighlighters(update.state);
    let styleChange = highlighters != getHighlighters(update.startState);
    if (tree.length < update.view.viewport.to && !styleChange && tree.type == this.tree.type) {
      this.decorations = this.decorations.map(update.changes);
    } else if (tree != this.tree || update.viewportChanged || styleChange) {
      this.tree = tree;
      this.decorations = this.buildDeco(update.view, highlighters);
    }
  }
  buildDeco(view, highlighters) {
    if (!highlighters || !this.tree.length)
      return Decoration.none;
    let builder = new RangeSetBuilder();
    for (let { from: from2, to } of view.visibleRanges) {
      highlightTree(this.tree, highlighters, (from3, to2, style) => {
        builder.add(from3, to2, this.markCache[style] || (this.markCache[style] = Decoration.mark({ class: style })));
      }, from2, to);
    }
    return builder.finish();
  }
};
var treeHighlighter = /* @__PURE__ */ Prec.high(/* @__PURE__ */ ViewPlugin.fromClass(TreeHighlighter, {
  decorations: (v4) => v4.decorations
}));
var defaultHighlightStyle = /* @__PURE__ */ HighlightStyle.define([
  {
    tag: tags.meta,
    color: "#404740"
  },
  {
    tag: tags.link,
    textDecoration: "underline"
  },
  {
    tag: tags.heading,
    textDecoration: "underline",
    fontWeight: "bold"
  },
  {
    tag: tags.emphasis,
    fontStyle: "italic"
  },
  {
    tag: tags.strong,
    fontWeight: "bold"
  },
  {
    tag: tags.strikethrough,
    textDecoration: "line-through"
  },
  {
    tag: tags.keyword,
    color: "#708"
  },
  {
    tag: [tags.atom, tags.bool, tags.url, tags.contentSeparator, tags.labelName],
    color: "#219"
  },
  {
    tag: [tags.literal, tags.inserted],
    color: "#164"
  },
  {
    tag: [tags.string, tags.deleted],
    color: "#a11"
  },
  {
    tag: [tags.regexp, tags.escape, /* @__PURE__ */ tags.special(tags.string)],
    color: "#e40"
  },
  {
    tag: /* @__PURE__ */ tags.definition(tags.variableName),
    color: "#00f"
  },
  {
    tag: /* @__PURE__ */ tags.local(tags.variableName),
    color: "#30a"
  },
  {
    tag: [tags.typeName, tags.namespace],
    color: "#085"
  },
  {
    tag: tags.className,
    color: "#167"
  },
  {
    tag: [/* @__PURE__ */ tags.special(tags.variableName), tags.macroName],
    color: "#256"
  },
  {
    tag: /* @__PURE__ */ tags.definition(tags.propertyName),
    color: "#00c"
  },
  {
    tag: tags.comment,
    color: "#940"
  },
  {
    tag: tags.invalid,
    color: "#f00"
  }
]);
var baseTheme2 = /* @__PURE__ */ EditorView.baseTheme({
  "&.cm-focused .cm-matchingBracket": { backgroundColor: "#328c8252" },
  "&.cm-focused .cm-nonmatchingBracket": { backgroundColor: "#bb555544" }
});
var DefaultScanDist = 1e4;
var DefaultBrackets = "()[]{}";
var bracketMatchingConfig = /* @__PURE__ */ Facet.define({
  combine(configs) {
    return combineConfig(configs, {
      afterCursor: true,
      brackets: DefaultBrackets,
      maxScanDistance: DefaultScanDist,
      renderMatch: defaultRenderMatch
    });
  }
});
var matchingMark = /* @__PURE__ */ Decoration.mark({ class: "cm-matchingBracket" });
var nonmatchingMark = /* @__PURE__ */ Decoration.mark({ class: "cm-nonmatchingBracket" });
function defaultRenderMatch(match2) {
  let decorations2 = [];
  let mark = match2.matched ? matchingMark : nonmatchingMark;
  decorations2.push(mark.range(match2.start.from, match2.start.to));
  if (match2.end)
    decorations2.push(mark.range(match2.end.from, match2.end.to));
  return decorations2;
}
var bracketMatchingState = /* @__PURE__ */ StateField.define({
  create() {
    return Decoration.none;
  },
  update(deco, tr) {
    if (!tr.docChanged && !tr.selection)
      return deco;
    let decorations2 = [];
    let config2 = tr.state.facet(bracketMatchingConfig);
    for (let range4 of tr.state.selection.ranges) {
      if (!range4.empty)
        continue;
      let match2 = matchBrackets(tr.state, range4.head, -1, config2) || range4.head > 0 && matchBrackets(tr.state, range4.head - 1, 1, config2) || config2.afterCursor && (matchBrackets(tr.state, range4.head, 1, config2) || range4.head < tr.state.doc.length && matchBrackets(tr.state, range4.head + 1, -1, config2));
      if (match2)
        decorations2 = decorations2.concat(config2.renderMatch(match2, tr.state));
    }
    return Decoration.set(decorations2, true);
  },
  provide: (f) => EditorView.decorations.from(f)
});
var bracketMatchingUnique = [
  bracketMatchingState,
  baseTheme2
];
function bracketMatching(config2 = {}) {
  return [bracketMatchingConfig.of(config2), bracketMatchingUnique];
}
var bracketMatchingHandle = /* @__PURE__ */ new NodeProp();
function matchingNodes(node56, dir, brackets) {
  let byProp = node56.prop(dir < 0 ? NodeProp.openedBy : NodeProp.closedBy);
  if (byProp)
    return byProp;
  if (node56.name.length == 1) {
    let index = brackets.indexOf(node56.name);
    if (index > -1 && index % 2 == (dir < 0 ? 1 : 0))
      return [brackets[index + dir]];
  }
  return null;
}
function findHandle(node56) {
  let hasHandle = node56.type.prop(bracketMatchingHandle);
  return hasHandle ? hasHandle(node56.node) : node56;
}
function matchBrackets(state, pos, dir, config2 = {}) {
  let maxScanDistance = config2.maxScanDistance || DefaultScanDist, brackets = config2.brackets || DefaultBrackets;
  let tree = syntaxTree(state), node56 = tree.resolveInner(pos, dir);
  for (let cur2 = node56; cur2; cur2 = cur2.parent) {
    let matches = matchingNodes(cur2.type, dir, brackets);
    if (matches && cur2.from < cur2.to) {
      let handle = findHandle(cur2);
      if (handle && (dir > 0 ? pos >= handle.from && pos < handle.to : pos > handle.from && pos <= handle.to))
        return matchMarkedBrackets(state, pos, dir, cur2, handle, matches, brackets);
    }
  }
  return matchPlainBrackets(state, pos, dir, tree, node56.type, maxScanDistance, brackets);
}
function matchMarkedBrackets(_state, _pos, dir, token2, handle, matching, brackets) {
  let parent = token2.parent, firstToken = { from: handle.from, to: handle.to };
  let depth = 0, cursor3 = parent === null || parent === void 0 ? void 0 : parent.cursor();
  if (cursor3 && (dir < 0 ? cursor3.childBefore(token2.from) : cursor3.childAfter(token2.to)))
    do {
      if (dir < 0 ? cursor3.to <= token2.from : cursor3.from >= token2.to) {
        if (depth == 0 && matching.indexOf(cursor3.type.name) > -1 && cursor3.from < cursor3.to) {
          let endHandle = findHandle(cursor3);
          return { start: firstToken, end: endHandle ? { from: endHandle.from, to: endHandle.to } : void 0, matched: true };
        } else if (matchingNodes(cursor3.type, dir, brackets)) {
          depth++;
        } else if (matchingNodes(cursor3.type, -dir, brackets)) {
          if (depth == 0) {
            let endHandle = findHandle(cursor3);
            return {
              start: firstToken,
              end: endHandle && endHandle.from < endHandle.to ? { from: endHandle.from, to: endHandle.to } : void 0,
              matched: false
            };
          }
          depth--;
        }
      }
    } while (dir < 0 ? cursor3.prevSibling() : cursor3.nextSibling());
  return { start: firstToken, matched: false };
}
function matchPlainBrackets(state, pos, dir, tree, tokenType, maxScanDistance, brackets) {
  let startCh = dir < 0 ? state.sliceDoc(pos - 1, pos) : state.sliceDoc(pos, pos + 1);
  let bracket2 = brackets.indexOf(startCh);
  if (bracket2 < 0 || bracket2 % 2 == 0 != dir > 0)
    return null;
  let startToken = { from: dir < 0 ? pos - 1 : pos, to: dir > 0 ? pos + 1 : pos };
  let iter = state.doc.iterRange(pos, dir > 0 ? state.doc.length : 0), depth = 0;
  for (let distance = 0; !iter.next().done && distance <= maxScanDistance; ) {
    let text2 = iter.value;
    if (dir < 0)
      distance += text2.length;
    let basePos = pos + distance * dir;
    for (let pos2 = dir > 0 ? 0 : text2.length - 1, end = dir > 0 ? text2.length : -1; pos2 != end; pos2 += dir) {
      let found = brackets.indexOf(text2[pos2]);
      if (found < 0 || tree.resolveInner(basePos + pos2, 1).type != tokenType)
        continue;
      if (found % 2 == 0 == dir > 0) {
        depth++;
      } else if (depth == 1) {
        return { start: startToken, end: { from: basePos + pos2, to: basePos + pos2 + 1 }, matched: found >> 1 == bracket2 >> 1 };
      } else {
        depth--;
      }
    }
    if (dir > 0)
      distance += text2.length;
  }
  return iter.done ? { start: startToken, matched: false } : null;
}
var noTokens = /* @__PURE__ */ Object.create(null);
var typeArray = [NodeType.none];
var warned = [];
var defaultTable = /* @__PURE__ */ Object.create(null);
for (let [legacyName, name2] of [
  ["variable", "variableName"],
  ["variable-2", "variableName.special"],
  ["string-2", "string.special"],
  ["def", "variableName.definition"],
  ["tag", "tagName"],
  ["attribute", "attributeName"],
  ["type", "typeName"],
  ["builtin", "variableName.standard"],
  ["qualifier", "modifier"],
  ["error", "invalid"],
  ["header", "heading"],
  ["property", "propertyName"]
])
  defaultTable[legacyName] = /* @__PURE__ */ createTokenType(noTokens, name2);
function warnForPart(part, msg) {
  if (warned.indexOf(part) > -1)
    return;
  warned.push(part);
  console.warn(msg);
}
function createTokenType(extra, tagStr) {
  let tags$1 = [];
  for (let name3 of tagStr.split(" ")) {
    let found = [];
    for (let part of name3.split(".")) {
      let value = extra[part] || tags[part];
      if (!value) {
        warnForPart(part, `Unknown highlighting tag ${part}`);
      } else if (typeof value == "function") {
        if (!found.length)
          warnForPart(part, `Modifier ${part} used at start of tag`);
        else
          found = found.map(value);
      } else {
        if (found.length)
          warnForPart(part, `Tag ${part} used as modifier`);
        else
          found = Array.isArray(value) ? value : [value];
      }
    }
    for (let tag of found)
      tags$1.push(tag);
  }
  if (!tags$1.length)
    return 0;
  let name2 = tagStr.replace(/ /g, "_"), type = NodeType.define({
    id: typeArray.length,
    name: name2,
    props: [styleTags({ [name2]: tags$1 })]
  });
  typeArray.push(type);
  return type.id;
}

// node_modules/@codemirror/autocomplete/dist/index.js
var CompletionContext = class {
  /**
  Create a new completion context. (Mostly useful for testing
  completion sources—in the editor, the extension will create
  these for you.)
  */
  constructor(state, pos, explicit) {
    this.state = state;
    this.pos = pos;
    this.explicit = explicit;
    this.abortListeners = [];
  }
  /**
  Get the extent, content, and (if there is a token) type of the
  token before `this.pos`.
  */
  tokenBefore(types2) {
    let token2 = syntaxTree(this.state).resolveInner(this.pos, -1);
    while (token2 && types2.indexOf(token2.name) < 0)
      token2 = token2.parent;
    return token2 ? {
      from: token2.from,
      to: this.pos,
      text: this.state.sliceDoc(token2.from, this.pos),
      type: token2.type
    } : null;
  }
  /**
  Get the match of the given expression directly before the
  cursor.
  */
  matchBefore(expr) {
    let line2 = this.state.doc.lineAt(this.pos);
    let start = Math.max(line2.from, this.pos - 250);
    let str = line2.text.slice(start - line2.from, this.pos - line2.from);
    let found = str.search(ensureAnchor(expr, false));
    return found < 0 ? null : { from: start + found, to: this.pos, text: str.slice(found) };
  }
  /**
  Yields true when the query has been aborted. Can be useful in
  asynchronous queries to avoid doing work that will be ignored.
  */
  get aborted() {
    return this.abortListeners == null;
  }
  /**
  Allows you to register abort handlers, which will be called when
  the query is
  [aborted](https://codemirror.net/6/docs/ref/#autocomplete.CompletionContext.aborted).
  */
  addEventListener(type, listener) {
    if (type == "abort" && this.abortListeners)
      this.abortListeners.push(listener);
  }
};
function toSet(chars) {
  let flat = Object.keys(chars).join("");
  let words = /\w/.test(flat);
  if (words)
    flat = flat.replace(/\w/g, "");
  return `[${words ? "\\w" : ""}${flat.replace(/[^\w\s]/g, "\\$&")}]`;
}
function prefixMatch(options) {
  let first = /* @__PURE__ */ Object.create(null), rest = /* @__PURE__ */ Object.create(null);
  for (let { label } of options) {
    first[label[0]] = true;
    for (let i2 = 1; i2 < label.length; i2++)
      rest[label[i2]] = true;
  }
  let source = toSet(first) + toSet(rest) + "*$";
  return [new RegExp("^" + source), new RegExp(source)];
}
function completeFromList(list) {
  let options = list.map((o) => typeof o == "string" ? { label: o } : o);
  let [validFor, match2] = options.every((o) => /^\w+$/.test(o.label)) ? [/\w*$/, /\w+$/] : prefixMatch(options);
  return (context2) => {
    let token2 = context2.matchBefore(match2);
    return token2 || context2.explicit ? { from: token2 ? token2.from : context2.pos, options, validFor } : null;
  };
}
function ifNotIn(nodes, source) {
  return (context2) => {
    for (let pos = syntaxTree(context2.state).resolveInner(context2.pos, -1); pos; pos = pos.parent) {
      if (nodes.indexOf(pos.name) > -1)
        return null;
      if (pos.type.isTop)
        break;
    }
    return source(context2);
  };
}
var Option = class {
  constructor(completion, source, match2, score2) {
    this.completion = completion;
    this.source = source;
    this.match = match2;
    this.score = score2;
  }
};
function cur(state) {
  return state.selection.main.from;
}
function ensureAnchor(expr, start) {
  var _a2;
  let { source } = expr;
  let addStart = start && source[0] != "^", addEnd = source[source.length - 1] != "$";
  if (!addStart && !addEnd)
    return expr;
  return new RegExp(`${addStart ? "^" : ""}(?:${source})${addEnd ? "$" : ""}`, (_a2 = expr.flags) !== null && _a2 !== void 0 ? _a2 : expr.ignoreCase ? "i" : "");
}
var pickedCompletion = /* @__PURE__ */ Annotation.define();
function insertCompletionText(state, text2, from2, to) {
  let { main } = state.selection, fromOff = from2 - main.from, toOff = to - main.from;
  return Object.assign(Object.assign({}, state.changeByRange((range4) => {
    if (range4 != main && from2 != to && state.sliceDoc(range4.from + fromOff, range4.from + toOff) != state.sliceDoc(from2, to))
      return { range: range4 };
    return {
      changes: { from: range4.from + fromOff, to: to == main.from ? range4.to : range4.from + toOff, insert: text2 },
      range: EditorSelection.cursor(range4.from + fromOff + text2.length)
    };
  })), { scrollIntoView: true, userEvent: "input.complete" });
}
var SourceCache = /* @__PURE__ */ new WeakMap();
function asSource(source) {
  if (!Array.isArray(source))
    return source;
  let known = SourceCache.get(source);
  if (!known)
    SourceCache.set(source, known = completeFromList(source));
  return known;
}
var startCompletionEffect = /* @__PURE__ */ StateEffect.define();
var closeCompletionEffect = /* @__PURE__ */ StateEffect.define();
var FuzzyMatcher = class {
  constructor(pattern) {
    this.pattern = pattern;
    this.chars = [];
    this.folded = [];
    this.any = [];
    this.precise = [];
    this.byWord = [];
    this.score = 0;
    this.matched = [];
    for (let p = 0; p < pattern.length; ) {
      let char2 = codePointAt(pattern, p), size = codePointSize(char2);
      this.chars.push(char2);
      let part = pattern.slice(p, p + size), upper = part.toUpperCase();
      this.folded.push(codePointAt(upper == part ? part.toLowerCase() : upper, 0));
      p += size;
    }
    this.astral = pattern.length != this.chars.length;
  }
  ret(score2, matched) {
    this.score = score2;
    this.matched = matched;
    return true;
  }
  // Matches a given word (completion) against the pattern (input).
  // Will return a boolean indicating whether there was a match and,
  // on success, set `this.score` to the score, `this.matched` to an
  // array of `from, to` pairs indicating the matched parts of `word`.
  //
  // The score is a number that is more negative the worse the match
  // is. See `Penalty` above.
  match(word) {
    if (this.pattern.length == 0)
      return this.ret(-100, []);
    if (word.length < this.pattern.length)
      return false;
    let { chars, folded, any, precise, byWord } = this;
    if (chars.length == 1) {
      let first = codePointAt(word, 0), firstSize = codePointSize(first);
      let score2 = firstSize == word.length ? 0 : -100;
      if (first == chars[0])
        ;
      else if (first == folded[0])
        score2 += -200;
      else
        return false;
      return this.ret(score2, [0, firstSize]);
    }
    let direct = word.indexOf(this.pattern);
    if (direct == 0)
      return this.ret(word.length == this.pattern.length ? 0 : -100, [0, this.pattern.length]);
    let len = chars.length, anyTo = 0;
    if (direct < 0) {
      for (let i2 = 0, e3 = Math.min(word.length, 200); i2 < e3 && anyTo < len; ) {
        let next2 = codePointAt(word, i2);
        if (next2 == chars[anyTo] || next2 == folded[anyTo])
          any[anyTo++] = i2;
        i2 += codePointSize(next2);
      }
      if (anyTo < len)
        return false;
    }
    let preciseTo = 0;
    let byWordTo = 0, byWordFolded = false;
    let adjacentTo = 0, adjacentStart = -1, adjacentEnd = -1;
    let hasLower = /[a-z]/.test(word), wordAdjacent = true;
    for (let i2 = 0, e3 = Math.min(word.length, 200), prevType = 0; i2 < e3 && byWordTo < len; ) {
      let next2 = codePointAt(word, i2);
      if (direct < 0) {
        if (preciseTo < len && next2 == chars[preciseTo])
          precise[preciseTo++] = i2;
        if (adjacentTo < len) {
          if (next2 == chars[adjacentTo] || next2 == folded[adjacentTo]) {
            if (adjacentTo == 0)
              adjacentStart = i2;
            adjacentEnd = i2 + 1;
            adjacentTo++;
          } else {
            adjacentTo = 0;
          }
        }
      }
      let ch, type = next2 < 255 ? next2 >= 48 && next2 <= 57 || next2 >= 97 && next2 <= 122 ? 2 : next2 >= 65 && next2 <= 90 ? 1 : 0 : (ch = fromCodePoint(next2)) != ch.toLowerCase() ? 1 : ch != ch.toUpperCase() ? 2 : 0;
      if (!i2 || type == 1 && hasLower || prevType == 0 && type != 0) {
        if (chars[byWordTo] == next2 || folded[byWordTo] == next2 && (byWordFolded = true))
          byWord[byWordTo++] = i2;
        else if (byWord.length)
          wordAdjacent = false;
      }
      prevType = type;
      i2 += codePointSize(next2);
    }
    if (byWordTo == len && byWord[0] == 0 && wordAdjacent)
      return this.result(-100 + (byWordFolded ? -200 : 0), byWord, word);
    if (adjacentTo == len && adjacentStart == 0)
      return this.ret(-200 - word.length + (adjacentEnd == word.length ? 0 : -100), [0, adjacentEnd]);
    if (direct > -1)
      return this.ret(-700 - word.length, [direct, direct + this.pattern.length]);
    if (adjacentTo == len)
      return this.ret(-200 + -700 - word.length, [adjacentStart, adjacentEnd]);
    if (byWordTo == len)
      return this.result(-100 + (byWordFolded ? -200 : 0) + -700 + (wordAdjacent ? 0 : -1100), byWord, word);
    return chars.length == 2 ? false : this.result((any[0] ? -700 : 0) + -200 + -1100, any, word);
  }
  result(score2, positions, word) {
    let result = [], i2 = 0;
    for (let pos of positions) {
      let to = pos + (this.astral ? codePointSize(codePointAt(word, pos)) : 1);
      if (i2 && result[i2 - 1] == pos)
        result[i2 - 1] = to;
      else {
        result[i2++] = pos;
        result[i2++] = to;
      }
    }
    return this.ret(score2 - word.length, result);
  }
};
var completionConfig = /* @__PURE__ */ Facet.define({
  combine(configs) {
    return combineConfig(configs, {
      activateOnTyping: true,
      selectOnOpen: true,
      override: null,
      closeOnBlur: true,
      maxRenderedOptions: 100,
      defaultKeymap: true,
      tooltipClass: () => "",
      optionClass: () => "",
      aboveCursor: false,
      icons: true,
      addToOptions: [],
      positionInfo: defaultPositionInfo,
      compareCompletions: (a2, b) => a2.label.localeCompare(b.label),
      interactionDelay: 75,
      updateSyncTime: 100
    }, {
      defaultKeymap: (a2, b) => a2 && b,
      closeOnBlur: (a2, b) => a2 && b,
      icons: (a2, b) => a2 && b,
      tooltipClass: (a2, b) => (c4) => joinClass(a2(c4), b(c4)),
      optionClass: (a2, b) => (c4) => joinClass(a2(c4), b(c4)),
      addToOptions: (a2, b) => a2.concat(b)
    });
  }
});
function joinClass(a2, b) {
  return a2 ? b ? a2 + " " + b : a2 : b;
}
function defaultPositionInfo(view, list, option, info, space2, tooltip) {
  let rtl2 = view.textDirection == Direction.RTL, left = rtl2, narrow = false;
  let side = "top", offset, maxWidth;
  let spaceLeft = list.left - space2.left, spaceRight = space2.right - list.right;
  let infoWidth = info.right - info.left, infoHeight = info.bottom - info.top;
  if (left && spaceLeft < Math.min(infoWidth, spaceRight))
    left = false;
  else if (!left && spaceRight < Math.min(infoWidth, spaceLeft))
    left = true;
  if (infoWidth <= (left ? spaceLeft : spaceRight)) {
    offset = Math.max(space2.top, Math.min(option.top, space2.bottom - infoHeight)) - list.top;
    maxWidth = Math.min(400, left ? spaceLeft : spaceRight);
  } else {
    narrow = true;
    maxWidth = Math.min(
      400,
      (rtl2 ? list.right : space2.right - list.left) - 30
      /* Info.Margin */
    );
    let spaceBelow = space2.bottom - list.bottom;
    if (spaceBelow >= infoHeight || spaceBelow > list.top) {
      offset = option.bottom - list.top;
    } else {
      side = "bottom";
      offset = list.bottom - option.top;
    }
  }
  let scaleY = (list.bottom - list.top) / tooltip.offsetHeight;
  let scaleX = (list.right - list.left) / tooltip.offsetWidth;
  return {
    style: `${side}: ${offset / scaleY}px; max-width: ${maxWidth / scaleX}px`,
    class: "cm-completionInfo-" + (narrow ? rtl2 ? "left-narrow" : "right-narrow" : left ? "left" : "right")
  };
}
function optionContent(config2) {
  let content2 = config2.addToOptions.slice();
  if (config2.icons)
    content2.push({
      render(completion) {
        let icon = document.createElement("div");
        icon.classList.add("cm-completionIcon");
        if (completion.type)
          icon.classList.add(...completion.type.split(/\s+/g).map((cls) => "cm-completionIcon-" + cls));
        icon.setAttribute("aria-hidden", "true");
        return icon;
      },
      position: 20
    });
  content2.push({
    render(completion, _s, match2) {
      let labelElt = document.createElement("span");
      labelElt.className = "cm-completionLabel";
      let label = completion.displayLabel || completion.label, off = 0;
      for (let j = 0; j < match2.length; ) {
        let from2 = match2[j++], to = match2[j++];
        if (from2 > off)
          labelElt.appendChild(document.createTextNode(label.slice(off, from2)));
        let span = labelElt.appendChild(document.createElement("span"));
        span.appendChild(document.createTextNode(label.slice(from2, to)));
        span.className = "cm-completionMatchedText";
        off = to;
      }
      if (off < label.length)
        labelElt.appendChild(document.createTextNode(label.slice(off)));
      return labelElt;
    },
    position: 50
  }, {
    render(completion) {
      if (!completion.detail)
        return null;
      let detailElt = document.createElement("span");
      detailElt.className = "cm-completionDetail";
      detailElt.textContent = completion.detail;
      return detailElt;
    },
    position: 80
  });
  return content2.sort((a2, b) => a2.position - b.position).map((a2) => a2.render);
}
function rangeAroundSelected(total, selected, max3) {
  if (total <= max3)
    return { from: 0, to: total };
  if (selected < 0)
    selected = 0;
  if (selected <= total >> 1) {
    let off2 = Math.floor(selected / max3);
    return { from: off2 * max3, to: (off2 + 1) * max3 };
  }
  let off = Math.floor((total - selected) / max3);
  return { from: total - (off + 1) * max3, to: total - off * max3 };
}
var CompletionTooltip = class {
  constructor(view, stateField, applyCompletion2) {
    this.view = view;
    this.stateField = stateField;
    this.applyCompletion = applyCompletion2;
    this.info = null;
    this.infoDestroy = null;
    this.placeInfoReq = {
      read: () => this.measureInfo(),
      write: (pos) => this.placeInfo(pos),
      key: this
    };
    this.space = null;
    this.currentClass = "";
    let cState = view.state.field(stateField);
    let { options, selected } = cState.open;
    let config2 = view.state.facet(completionConfig);
    this.optionContent = optionContent(config2);
    this.optionClass = config2.optionClass;
    this.tooltipClass = config2.tooltipClass;
    this.range = rangeAroundSelected(options.length, selected, config2.maxRenderedOptions);
    this.dom = document.createElement("div");
    this.dom.className = "cm-tooltip-autocomplete";
    this.updateTooltipClass(view.state);
    this.dom.addEventListener("mousedown", (e3) => {
      let { options: options2 } = view.state.field(stateField).open;
      for (let dom = e3.target, match2; dom && dom != this.dom; dom = dom.parentNode) {
        if (dom.nodeName == "LI" && (match2 = /-(\d+)$/.exec(dom.id)) && +match2[1] < options2.length) {
          this.applyCompletion(view, options2[+match2[1]]);
          e3.preventDefault();
          return;
        }
      }
    });
    this.dom.addEventListener("focusout", (e3) => {
      let state = view.state.field(this.stateField, false);
      if (state && state.tooltip && view.state.facet(completionConfig).closeOnBlur && e3.relatedTarget != view.contentDOM)
        view.dispatch({ effects: closeCompletionEffect.of(null) });
    });
    this.showOptions(options, cState.id);
  }
  mount() {
    this.updateSel();
  }
  showOptions(options, id2) {
    if (this.list)
      this.list.remove();
    this.list = this.dom.appendChild(this.createListBox(options, id2, this.range));
    this.list.addEventListener("scroll", () => {
      if (this.info)
        this.view.requestMeasure(this.placeInfoReq);
    });
  }
  update(update) {
    var _a2;
    let cState = update.state.field(this.stateField);
    let prevState = update.startState.field(this.stateField);
    this.updateTooltipClass(update.state);
    if (cState != prevState) {
      let { options, selected, disabled } = cState.open;
      if (!prevState.open || prevState.open.options != options) {
        this.range = rangeAroundSelected(options.length, selected, update.state.facet(completionConfig).maxRenderedOptions);
        this.showOptions(options, cState.id);
      }
      this.updateSel();
      if (disabled != ((_a2 = prevState.open) === null || _a2 === void 0 ? void 0 : _a2.disabled))
        this.dom.classList.toggle("cm-tooltip-autocomplete-disabled", !!disabled);
    }
  }
  updateTooltipClass(state) {
    let cls = this.tooltipClass(state);
    if (cls != this.currentClass) {
      for (let c4 of this.currentClass.split(" "))
        if (c4)
          this.dom.classList.remove(c4);
      for (let c4 of cls.split(" "))
        if (c4)
          this.dom.classList.add(c4);
      this.currentClass = cls;
    }
  }
  positioned(space2) {
    this.space = space2;
    if (this.info)
      this.view.requestMeasure(this.placeInfoReq);
  }
  updateSel() {
    let cState = this.view.state.field(this.stateField), open = cState.open;
    if (open.selected > -1 && open.selected < this.range.from || open.selected >= this.range.to) {
      this.range = rangeAroundSelected(open.options.length, open.selected, this.view.state.facet(completionConfig).maxRenderedOptions);
      this.showOptions(open.options, cState.id);
    }
    if (this.updateSelectedOption(open.selected)) {
      this.destroyInfo();
      let { completion } = open.options[open.selected];
      let { info } = completion;
      if (!info)
        return;
      let infoResult = typeof info === "string" ? document.createTextNode(info) : info(completion);
      if (!infoResult)
        return;
      if ("then" in infoResult) {
        infoResult.then((obj) => {
          if (obj && this.view.state.field(this.stateField, false) == cState)
            this.addInfoPane(obj, completion);
        }).catch((e3) => logException(this.view.state, e3, "completion info"));
      } else {
        this.addInfoPane(infoResult, completion);
      }
    }
  }
  addInfoPane(content2, completion) {
    this.destroyInfo();
    let wrap = this.info = document.createElement("div");
    wrap.className = "cm-tooltip cm-completionInfo";
    if (content2.nodeType != null) {
      wrap.appendChild(content2);
      this.infoDestroy = null;
    } else {
      let { dom, destroy } = content2;
      wrap.appendChild(dom);
      this.infoDestroy = destroy || null;
    }
    this.dom.appendChild(wrap);
    this.view.requestMeasure(this.placeInfoReq);
  }
  updateSelectedOption(selected) {
    let set3 = null;
    for (let opt = this.list.firstChild, i2 = this.range.from; opt; opt = opt.nextSibling, i2++) {
      if (opt.nodeName != "LI" || !opt.id) {
        i2--;
      } else if (i2 == selected) {
        if (!opt.hasAttribute("aria-selected")) {
          opt.setAttribute("aria-selected", "true");
          set3 = opt;
        }
      } else {
        if (opt.hasAttribute("aria-selected"))
          opt.removeAttribute("aria-selected");
      }
    }
    if (set3)
      scrollIntoView2(this.list, set3);
    return set3;
  }
  measureInfo() {
    let sel = this.dom.querySelector("[aria-selected]");
    if (!sel || !this.info)
      return null;
    let listRect = this.dom.getBoundingClientRect();
    let infoRect = this.info.getBoundingClientRect();
    let selRect = sel.getBoundingClientRect();
    let space2 = this.space;
    if (!space2) {
      let win = this.dom.ownerDocument.defaultView || window;
      space2 = { left: 0, top: 0, right: win.innerWidth, bottom: win.innerHeight };
    }
    if (selRect.top > Math.min(space2.bottom, listRect.bottom) - 10 || selRect.bottom < Math.max(space2.top, listRect.top) + 10)
      return null;
    return this.view.state.facet(completionConfig).positionInfo(this.view, listRect, selRect, infoRect, space2, this.dom);
  }
  placeInfo(pos) {
    if (this.info) {
      if (pos) {
        if (pos.style)
          this.info.style.cssText = pos.style;
        this.info.className = "cm-tooltip cm-completionInfo " + (pos.class || "");
      } else {
        this.info.style.cssText = "top: -1e6px";
      }
    }
  }
  createListBox(options, id2, range4) {
    const ul = document.createElement("ul");
    ul.id = id2;
    ul.setAttribute("role", "listbox");
    ul.setAttribute("aria-expanded", "true");
    ul.setAttribute("aria-label", this.view.state.phrase("Completions"));
    let curSection = null;
    for (let i2 = range4.from; i2 < range4.to; i2++) {
      let { completion, match: match2 } = options[i2], { section } = completion;
      if (section) {
        let name2 = typeof section == "string" ? section : section.name;
        if (name2 != curSection && (i2 > range4.from || range4.from == 0)) {
          curSection = name2;
          if (typeof section != "string" && section.header) {
            ul.appendChild(section.header(section));
          } else {
            let header = ul.appendChild(document.createElement("completion-section"));
            header.textContent = name2;
          }
        }
      }
      const li = ul.appendChild(document.createElement("li"));
      li.id = id2 + "-" + i2;
      li.setAttribute("role", "option");
      let cls = this.optionClass(completion);
      if (cls)
        li.className = cls;
      for (let source of this.optionContent) {
        let node56 = source(completion, this.view.state, match2);
        if (node56)
          li.appendChild(node56);
      }
    }
    if (range4.from)
      ul.classList.add("cm-completionListIncompleteTop");
    if (range4.to < options.length)
      ul.classList.add("cm-completionListIncompleteBottom");
    return ul;
  }
  destroyInfo() {
    if (this.info) {
      if (this.infoDestroy)
        this.infoDestroy();
      this.info.remove();
      this.info = null;
    }
  }
  destroy() {
    this.destroyInfo();
  }
};
function completionTooltip(stateField, applyCompletion2) {
  return (view) => new CompletionTooltip(view, stateField, applyCompletion2);
}
function scrollIntoView2(container, element2) {
  let parent = container.getBoundingClientRect();
  let self2 = element2.getBoundingClientRect();
  let scaleY = parent.height / container.offsetHeight;
  if (self2.top < parent.top)
    container.scrollTop -= (parent.top - self2.top) / scaleY;
  else if (self2.bottom > parent.bottom)
    container.scrollTop += (self2.bottom - parent.bottom) / scaleY;
}
function score(option) {
  return (option.boost || 0) * 100 + (option.apply ? 10 : 0) + (option.info ? 5 : 0) + (option.type ? 1 : 0);
}
function sortOptions(active, state) {
  let options = [];
  let sections = null;
  let addOption = (option) => {
    options.push(option);
    let { section } = option.completion;
    if (section) {
      if (!sections)
        sections = [];
      let name2 = typeof section == "string" ? section : section.name;
      if (!sections.some((s2) => s2.name == name2))
        sections.push(typeof section == "string" ? { name: name2 } : section);
    }
  };
  for (let a2 of active)
    if (a2.hasResult()) {
      let getMatch = a2.result.getMatch;
      if (a2.result.filter === false) {
        for (let option of a2.result.options) {
          addOption(new Option(option, a2.source, getMatch ? getMatch(option) : [], 1e9 - options.length));
        }
      } else {
        let matcher = new FuzzyMatcher(state.sliceDoc(a2.from, a2.to));
        for (let option of a2.result.options)
          if (matcher.match(option.label)) {
            let matched = !option.displayLabel ? matcher.matched : getMatch ? getMatch(option, matcher.matched) : [];
            addOption(new Option(option, a2.source, matched, matcher.score + (option.boost || 0)));
          }
      }
    }
  if (sections) {
    let sectionOrder = /* @__PURE__ */ Object.create(null), pos = 0;
    let cmp = (a2, b) => {
      var _a2, _b;
      return ((_a2 = a2.rank) !== null && _a2 !== void 0 ? _a2 : 1e9) - ((_b = b.rank) !== null && _b !== void 0 ? _b : 1e9) || (a2.name < b.name ? -1 : 1);
    };
    for (let s2 of sections.sort(cmp)) {
      pos -= 1e5;
      sectionOrder[s2.name] = pos;
    }
    for (let option of options) {
      let { section } = option.completion;
      if (section)
        option.score += sectionOrder[typeof section == "string" ? section : section.name];
    }
  }
  let result = [], prev2 = null;
  let compare2 = state.facet(completionConfig).compareCompletions;
  for (let opt of options.sort((a2, b) => b.score - a2.score || compare2(a2.completion, b.completion))) {
    let cur2 = opt.completion;
    if (!prev2 || prev2.label != cur2.label || prev2.detail != cur2.detail || prev2.type != null && cur2.type != null && prev2.type != cur2.type || prev2.apply != cur2.apply || prev2.boost != cur2.boost)
      result.push(opt);
    else if (score(opt.completion) > score(prev2))
      result[result.length - 1] = opt;
    prev2 = opt.completion;
  }
  return result;
}
var CompletionDialog = class _CompletionDialog {
  constructor(options, attrs, tooltip, timestamp, selected, disabled) {
    this.options = options;
    this.attrs = attrs;
    this.tooltip = tooltip;
    this.timestamp = timestamp;
    this.selected = selected;
    this.disabled = disabled;
  }
  setSelected(selected, id2) {
    return selected == this.selected || selected >= this.options.length ? this : new _CompletionDialog(this.options, makeAttrs(id2, selected), this.tooltip, this.timestamp, selected, this.disabled);
  }
  static build(active, state, id2, prev2, conf) {
    let options = sortOptions(active, state);
    if (!options.length) {
      return prev2 && active.some(
        (a2) => a2.state == 1
        /* State.Pending */
      ) ? new _CompletionDialog(prev2.options, prev2.attrs, prev2.tooltip, prev2.timestamp, prev2.selected, true) : null;
    }
    let selected = state.facet(completionConfig).selectOnOpen ? 0 : -1;
    if (prev2 && prev2.selected != selected && prev2.selected != -1) {
      let selectedValue = prev2.options[prev2.selected].completion;
      for (let i2 = 0; i2 < options.length; i2++)
        if (options[i2].completion == selectedValue) {
          selected = i2;
          break;
        }
    }
    return new _CompletionDialog(options, makeAttrs(id2, selected), {
      pos: active.reduce((a2, b) => b.hasResult() ? Math.min(a2, b.from) : a2, 1e8),
      create: createTooltip,
      above: conf.aboveCursor
    }, prev2 ? prev2.timestamp : Date.now(), selected, false);
  }
  map(changes) {
    return new _CompletionDialog(this.options, this.attrs, Object.assign(Object.assign({}, this.tooltip), { pos: changes.mapPos(this.tooltip.pos) }), this.timestamp, this.selected, this.disabled);
  }
};
var CompletionState = class _CompletionState {
  constructor(active, id2, open) {
    this.active = active;
    this.id = id2;
    this.open = open;
  }
  static start() {
    return new _CompletionState(none2, "cm-ac-" + Math.floor(Math.random() * 2e6).toString(36), null);
  }
  update(tr) {
    let { state } = tr, conf = state.facet(completionConfig);
    let sources = conf.override || state.languageDataAt("autocomplete", cur(state)).map(asSource);
    let active = sources.map((source) => {
      let value = this.active.find((s2) => s2.source == source) || new ActiveSource(
        source,
        this.active.some(
          (a2) => a2.state != 0
          /* State.Inactive */
        ) ? 1 : 0
        /* State.Inactive */
      );
      return value.update(tr, conf);
    });
    if (active.length == this.active.length && active.every((a2, i2) => a2 == this.active[i2]))
      active = this.active;
    let open = this.open;
    if (open && tr.docChanged)
      open = open.map(tr.changes);
    if (tr.selection || active.some((a2) => a2.hasResult() && tr.changes.touchesRange(a2.from, a2.to)) || !sameResults(active, this.active))
      open = CompletionDialog.build(active, state, this.id, open, conf);
    else if (open && open.disabled && !active.some(
      (a2) => a2.state == 1
      /* State.Pending */
    ))
      open = null;
    if (!open && active.every(
      (a2) => a2.state != 1
      /* State.Pending */
    ) && active.some((a2) => a2.hasResult()))
      active = active.map((a2) => a2.hasResult() ? new ActiveSource(
        a2.source,
        0
        /* State.Inactive */
      ) : a2);
    for (let effect of tr.effects)
      if (effect.is(setSelectedEffect))
        open = open && open.setSelected(effect.value, this.id);
    return active == this.active && open == this.open ? this : new _CompletionState(active, this.id, open);
  }
  get tooltip() {
    return this.open ? this.open.tooltip : null;
  }
  get attrs() {
    return this.open ? this.open.attrs : baseAttrs;
  }
};
function sameResults(a2, b) {
  if (a2 == b)
    return true;
  for (let iA = 0, iB = 0; ; ) {
    while (iA < a2.length && !a2[iA].hasResult)
      iA++;
    while (iB < b.length && !b[iB].hasResult)
      iB++;
    let endA = iA == a2.length, endB = iB == b.length;
    if (endA || endB)
      return endA == endB;
    if (a2[iA++].result != b[iB++].result)
      return false;
  }
}
var baseAttrs = {
  "aria-autocomplete": "list"
};
function makeAttrs(id2, selected) {
  let result = {
    "aria-autocomplete": "list",
    "aria-haspopup": "listbox",
    "aria-controls": id2
  };
  if (selected > -1)
    result["aria-activedescendant"] = id2 + "-" + selected;
  return result;
}
var none2 = [];
function getUserEvent(tr) {
  return tr.isUserEvent("input.type") ? "input" : tr.isUserEvent("delete.backward") ? "delete" : null;
}
var ActiveSource = class _ActiveSource {
  constructor(source, state, explicitPos = -1) {
    this.source = source;
    this.state = state;
    this.explicitPos = explicitPos;
  }
  hasResult() {
    return false;
  }
  update(tr, conf) {
    let event = getUserEvent(tr), value = this;
    if (event)
      value = value.handleUserEvent(tr, event, conf);
    else if (tr.docChanged)
      value = value.handleChange(tr);
    else if (tr.selection && value.state != 0)
      value = new _ActiveSource(
        value.source,
        0
        /* State.Inactive */
      );
    for (let effect of tr.effects) {
      if (effect.is(startCompletionEffect))
        value = new _ActiveSource(value.source, 1, effect.value ? cur(tr.state) : -1);
      else if (effect.is(closeCompletionEffect))
        value = new _ActiveSource(
          value.source,
          0
          /* State.Inactive */
        );
      else if (effect.is(setActiveEffect)) {
        for (let active of effect.value)
          if (active.source == value.source)
            value = active;
      }
    }
    return value;
  }
  handleUserEvent(tr, type, conf) {
    return type == "delete" || !conf.activateOnTyping ? this.map(tr.changes) : new _ActiveSource(
      this.source,
      1
      /* State.Pending */
    );
  }
  handleChange(tr) {
    return tr.changes.touchesRange(cur(tr.startState)) ? new _ActiveSource(
      this.source,
      0
      /* State.Inactive */
    ) : this.map(tr.changes);
  }
  map(changes) {
    return changes.empty || this.explicitPos < 0 ? this : new _ActiveSource(this.source, this.state, changes.mapPos(this.explicitPos));
  }
};
var ActiveResult = class _ActiveResult extends ActiveSource {
  constructor(source, explicitPos, result, from2, to) {
    super(source, 2, explicitPos);
    this.result = result;
    this.from = from2;
    this.to = to;
  }
  hasResult() {
    return true;
  }
  handleUserEvent(tr, type, conf) {
    var _a2;
    let from2 = tr.changes.mapPos(this.from), to = tr.changes.mapPos(this.to, 1);
    let pos = cur(tr.state);
    if ((this.explicitPos < 0 ? pos <= from2 : pos < this.from) || pos > to || type == "delete" && cur(tr.startState) == this.from)
      return new ActiveSource(
        this.source,
        type == "input" && conf.activateOnTyping ? 1 : 0
        /* State.Inactive */
      );
    let explicitPos = this.explicitPos < 0 ? -1 : tr.changes.mapPos(this.explicitPos), updated;
    if (checkValid(this.result.validFor, tr.state, from2, to))
      return new _ActiveResult(this.source, explicitPos, this.result, from2, to);
    if (this.result.update && (updated = this.result.update(this.result, from2, to, new CompletionContext(tr.state, pos, explicitPos >= 0))))
      return new _ActiveResult(this.source, explicitPos, updated, updated.from, (_a2 = updated.to) !== null && _a2 !== void 0 ? _a2 : cur(tr.state));
    return new ActiveSource(this.source, 1, explicitPos);
  }
  handleChange(tr) {
    return tr.changes.touchesRange(this.from, this.to) ? new ActiveSource(
      this.source,
      0
      /* State.Inactive */
    ) : this.map(tr.changes);
  }
  map(mapping) {
    return mapping.empty ? this : new _ActiveResult(this.source, this.explicitPos < 0 ? -1 : mapping.mapPos(this.explicitPos), this.result, mapping.mapPos(this.from), mapping.mapPos(this.to, 1));
  }
};
function checkValid(validFor, state, from2, to) {
  if (!validFor)
    return false;
  let text2 = state.sliceDoc(from2, to);
  return typeof validFor == "function" ? validFor(text2, from2, to, state) : ensureAnchor(validFor, true).test(text2);
}
var setActiveEffect = /* @__PURE__ */ StateEffect.define({
  map(sources, mapping) {
    return sources.map((s2) => s2.map(mapping));
  }
});
var setSelectedEffect = /* @__PURE__ */ StateEffect.define();
var completionState = /* @__PURE__ */ StateField.define({
  create() {
    return CompletionState.start();
  },
  update(value, tr) {
    return value.update(tr);
  },
  provide: (f) => [
    showTooltip.from(f, (val) => val.tooltip),
    EditorView.contentAttributes.from(f, (state) => state.attrs)
  ]
});
function applyCompletion(view, option) {
  const apply = option.completion.apply || option.completion.label;
  let result = view.state.field(completionState).active.find((a2) => a2.source == option.source);
  if (!(result instanceof ActiveResult))
    return false;
  if (typeof apply == "string")
    view.dispatch(Object.assign(Object.assign({}, insertCompletionText(view.state, apply, result.from, result.to)), { annotations: pickedCompletion.of(option.completion) }));
  else
    apply(view, option.completion, result.from, result.to);
  return true;
}
var createTooltip = /* @__PURE__ */ completionTooltip(completionState, applyCompletion);
function moveCompletionSelection(forward, by = "option") {
  return (view) => {
    let cState = view.state.field(completionState, false);
    if (!cState || !cState.open || cState.open.disabled || Date.now() - cState.open.timestamp < view.state.facet(completionConfig).interactionDelay)
      return false;
    let step = 1, tooltip;
    if (by == "page" && (tooltip = getTooltip(view, cState.open.tooltip)))
      step = Math.max(2, Math.floor(tooltip.dom.offsetHeight / tooltip.dom.querySelector("li").offsetHeight) - 1);
    let { length: length2 } = cState.open.options;
    let selected = cState.open.selected > -1 ? cState.open.selected + step * (forward ? 1 : -1) : forward ? 0 : length2 - 1;
    if (selected < 0)
      selected = by == "page" ? 0 : length2 - 1;
    else if (selected >= length2)
      selected = by == "page" ? length2 - 1 : 0;
    view.dispatch({ effects: setSelectedEffect.of(selected) });
    return true;
  };
}
var acceptCompletion = (view) => {
  let cState = view.state.field(completionState, false);
  if (view.state.readOnly || !cState || !cState.open || cState.open.selected < 0 || cState.open.disabled || Date.now() - cState.open.timestamp < view.state.facet(completionConfig).interactionDelay)
    return false;
  return applyCompletion(view, cState.open.options[cState.open.selected]);
};
var startCompletion = (view) => {
  let cState = view.state.field(completionState, false);
  if (!cState)
    return false;
  view.dispatch({ effects: startCompletionEffect.of(true) });
  return true;
};
var closeCompletion = (view) => {
  let cState = view.state.field(completionState, false);
  if (!cState || !cState.active.some(
    (a2) => a2.state != 0
    /* State.Inactive */
  ))
    return false;
  view.dispatch({ effects: closeCompletionEffect.of(null) });
  return true;
};
var RunningQuery = class {
  constructor(active, context2) {
    this.active = active;
    this.context = context2;
    this.time = Date.now();
    this.updates = [];
    this.done = void 0;
  }
};
var MaxUpdateCount = 50;
var MinAbortTime = 1e3;
var completionPlugin = /* @__PURE__ */ ViewPlugin.fromClass(class {
  constructor(view) {
    this.view = view;
    this.debounceUpdate = -1;
    this.running = [];
    this.debounceAccept = -1;
    this.composing = 0;
    for (let active of view.state.field(completionState).active)
      if (active.state == 1)
        this.startQuery(active);
  }
  update(update) {
    let cState = update.state.field(completionState);
    if (!update.selectionSet && !update.docChanged && update.startState.field(completionState) == cState)
      return;
    let doesReset = update.transactions.some((tr) => {
      return (tr.selection || tr.docChanged) && !getUserEvent(tr);
    });
    for (let i2 = 0; i2 < this.running.length; i2++) {
      let query2 = this.running[i2];
      if (doesReset || query2.updates.length + update.transactions.length > MaxUpdateCount && Date.now() - query2.time > MinAbortTime) {
        for (let handler of query2.context.abortListeners) {
          try {
            handler();
          } catch (e3) {
            logException(this.view.state, e3);
          }
        }
        query2.context.abortListeners = null;
        this.running.splice(i2--, 1);
      } else {
        query2.updates.push(...update.transactions);
      }
    }
    if (this.debounceUpdate > -1)
      clearTimeout(this.debounceUpdate);
    this.debounceUpdate = cState.active.some((a2) => a2.state == 1 && !this.running.some((q) => q.active.source == a2.source)) ? setTimeout(() => this.startUpdate(), 50) : -1;
    if (this.composing != 0)
      for (let tr of update.transactions) {
        if (getUserEvent(tr) == "input")
          this.composing = 2;
        else if (this.composing == 2 && tr.selection)
          this.composing = 3;
      }
  }
  startUpdate() {
    this.debounceUpdate = -1;
    let { state } = this.view, cState = state.field(completionState);
    for (let active of cState.active) {
      if (active.state == 1 && !this.running.some((r3) => r3.active.source == active.source))
        this.startQuery(active);
    }
  }
  startQuery(active) {
    let { state } = this.view, pos = cur(state);
    let context2 = new CompletionContext(state, pos, active.explicitPos == pos);
    let pending = new RunningQuery(active, context2);
    this.running.push(pending);
    Promise.resolve(active.source(context2)).then((result) => {
      if (!pending.context.aborted) {
        pending.done = result || null;
        this.scheduleAccept();
      }
    }, (err) => {
      this.view.dispatch({ effects: closeCompletionEffect.of(null) });
      logException(this.view.state, err);
    });
  }
  scheduleAccept() {
    if (this.running.every((q) => q.done !== void 0))
      this.accept();
    else if (this.debounceAccept < 0)
      this.debounceAccept = setTimeout(() => this.accept(), this.view.state.facet(completionConfig).updateSyncTime);
  }
  // For each finished query in this.running, try to create a result
  // or, if appropriate, restart the query.
  accept() {
    var _a2;
    if (this.debounceAccept > -1)
      clearTimeout(this.debounceAccept);
    this.debounceAccept = -1;
    let updated = [];
    let conf = this.view.state.facet(completionConfig);
    for (let i2 = 0; i2 < this.running.length; i2++) {
      let query2 = this.running[i2];
      if (query2.done === void 0)
        continue;
      this.running.splice(i2--, 1);
      if (query2.done) {
        let active = new ActiveResult(query2.active.source, query2.active.explicitPos, query2.done, query2.done.from, (_a2 = query2.done.to) !== null && _a2 !== void 0 ? _a2 : cur(query2.updates.length ? query2.updates[0].startState : this.view.state));
        for (let tr of query2.updates)
          active = active.update(tr, conf);
        if (active.hasResult()) {
          updated.push(active);
          continue;
        }
      }
      let current = this.view.state.field(completionState).active.find((a2) => a2.source == query2.active.source);
      if (current && current.state == 1) {
        if (query2.done == null) {
          let active = new ActiveSource(
            query2.active.source,
            0
            /* State.Inactive */
          );
          for (let tr of query2.updates)
            active = active.update(tr, conf);
          if (active.state != 1)
            updated.push(active);
        } else {
          this.startQuery(current);
        }
      }
    }
    if (updated.length)
      this.view.dispatch({ effects: setActiveEffect.of(updated) });
  }
}, {
  eventHandlers: {
    blur(event) {
      let state = this.view.state.field(completionState, false);
      if (state && state.tooltip && this.view.state.facet(completionConfig).closeOnBlur) {
        let dialog = state.open && getTooltip(this.view, state.open.tooltip);
        if (!dialog || !dialog.dom.contains(event.relatedTarget))
          this.view.dispatch({ effects: closeCompletionEffect.of(null) });
      }
    },
    compositionstart() {
      this.composing = 1;
    },
    compositionend() {
      if (this.composing == 3) {
        setTimeout(() => this.view.dispatch({ effects: startCompletionEffect.of(false) }), 20);
      }
      this.composing = 0;
    }
  }
});
var baseTheme3 = /* @__PURE__ */ EditorView.baseTheme({
  ".cm-tooltip.cm-tooltip-autocomplete": {
    "& > ul": {
      fontFamily: "monospace",
      whiteSpace: "nowrap",
      overflow: "hidden auto",
      maxWidth_fallback: "700px",
      maxWidth: "min(700px, 95vw)",
      minWidth: "250px",
      maxHeight: "10em",
      height: "100%",
      listStyle: "none",
      margin: 0,
      padding: 0,
      "& > li, & > completion-section": {
        padding: "1px 3px",
        lineHeight: 1.2
      },
      "& > li": {
        overflowX: "hidden",
        textOverflow: "ellipsis",
        cursor: "pointer"
      },
      "& > completion-section": {
        display: "list-item",
        borderBottom: "1px solid silver",
        paddingLeft: "0.5em",
        opacity: 0.7
      }
    }
  },
  "&light .cm-tooltip-autocomplete ul li[aria-selected]": {
    background: "#17c",
    color: "white"
  },
  "&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]": {
    background: "#777"
  },
  "&dark .cm-tooltip-autocomplete ul li[aria-selected]": {
    background: "#347",
    color: "white"
  },
  "&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]": {
    background: "#444"
  },
  ".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after": {
    content: '"\xB7\xB7\xB7"',
    opacity: 0.5,
    display: "block",
    textAlign: "center"
  },
  ".cm-tooltip.cm-completionInfo": {
    position: "absolute",
    padding: "3px 9px",
    width: "max-content",
    maxWidth: `${400}px`,
    boxSizing: "border-box"
  },
  ".cm-completionInfo.cm-completionInfo-left": { right: "100%" },
  ".cm-completionInfo.cm-completionInfo-right": { left: "100%" },
  ".cm-completionInfo.cm-completionInfo-left-narrow": { right: `${30}px` },
  ".cm-completionInfo.cm-completionInfo-right-narrow": { left: `${30}px` },
  "&light .cm-snippetField": { backgroundColor: "#00000022" },
  "&dark .cm-snippetField": { backgroundColor: "#ffffff22" },
  ".cm-snippetFieldPosition": {
    verticalAlign: "text-top",
    width: 0,
    height: "1.15em",
    display: "inline-block",
    margin: "0 -0.7px -.7em",
    borderLeft: "1.4px dotted #888"
  },
  ".cm-completionMatchedText": {
    textDecoration: "underline"
  },
  ".cm-completionDetail": {
    marginLeft: "0.5em",
    fontStyle: "italic"
  },
  ".cm-completionIcon": {
    fontSize: "90%",
    width: ".8em",
    display: "inline-block",
    textAlign: "center",
    paddingRight: ".6em",
    opacity: "0.6",
    boxSizing: "content-box"
  },
  ".cm-completionIcon-function, .cm-completionIcon-method": {
    "&:after": { content: "'\u0192'" }
  },
  ".cm-completionIcon-class": {
    "&:after": { content: "'\u25CB'" }
  },
  ".cm-completionIcon-interface": {
    "&:after": { content: "'\u25CC'" }
  },
  ".cm-completionIcon-variable": {
    "&:after": { content: "'\u{1D465}'" }
  },
  ".cm-completionIcon-constant": {
    "&:after": { content: "'\u{1D436}'" }
  },
  ".cm-completionIcon-type": {
    "&:after": { content: "'\u{1D461}'" }
  },
  ".cm-completionIcon-enum": {
    "&:after": { content: "'\u222A'" }
  },
  ".cm-completionIcon-property": {
    "&:after": { content: "'\u25A1'" }
  },
  ".cm-completionIcon-keyword": {
    "&:after": { content: "'\u{1F511}\uFE0E'" }
    // Disable emoji rendering
  },
  ".cm-completionIcon-namespace": {
    "&:after": { content: "'\u25A2'" }
  },
  ".cm-completionIcon-text": {
    "&:after": { content: "'abc'", fontSize: "50%", verticalAlign: "middle" }
  }
});
var FieldPos = class {
  constructor(field, line2, from2, to) {
    this.field = field;
    this.line = line2;
    this.from = from2;
    this.to = to;
  }
};
var FieldRange = class _FieldRange {
  constructor(field, from2, to) {
    this.field = field;
    this.from = from2;
    this.to = to;
  }
  map(changes) {
    let from2 = changes.mapPos(this.from, -1, MapMode.TrackDel);
    let to = changes.mapPos(this.to, 1, MapMode.TrackDel);
    return from2 == null || to == null ? null : new _FieldRange(this.field, from2, to);
  }
};
var Snippet = class _Snippet {
  constructor(lines, fieldPositions) {
    this.lines = lines;
    this.fieldPositions = fieldPositions;
  }
  instantiate(state, pos) {
    let text2 = [], lineStart = [pos];
    let lineObj = state.doc.lineAt(pos), baseIndent = /^\s*/.exec(lineObj.text)[0];
    for (let line2 of this.lines) {
      if (text2.length) {
        let indent2 = baseIndent, tabs = /^\t*/.exec(line2)[0].length;
        for (let i2 = 0; i2 < tabs; i2++)
          indent2 += state.facet(indentUnit);
        lineStart.push(pos + indent2.length - tabs);
        line2 = indent2 + line2.slice(tabs);
      }
      text2.push(line2);
      pos += line2.length + 1;
    }
    let ranges = this.fieldPositions.map((pos2) => new FieldRange(pos2.field, lineStart[pos2.line] + pos2.from, lineStart[pos2.line] + pos2.to));
    return { text: text2, ranges };
  }
  static parse(template) {
    let fields = [];
    let lines = [], positions = [], m;
    for (let line2 of template.split(/\r\n?|\n/)) {
      while (m = /[#$]\{(?:(\d+)(?::([^}]*))?|([^}]*))\}/.exec(line2)) {
        let seq = m[1] ? +m[1] : null, name2 = m[2] || m[3] || "", found = -1;
        for (let i2 = 0; i2 < fields.length; i2++) {
          if (seq != null ? fields[i2].seq == seq : name2 ? fields[i2].name == name2 : false)
            found = i2;
        }
        if (found < 0) {
          let i2 = 0;
          while (i2 < fields.length && (seq == null || fields[i2].seq != null && fields[i2].seq < seq))
            i2++;
          fields.splice(i2, 0, { seq, name: name2 });
          found = i2;
          for (let pos of positions)
            if (pos.field >= found)
              pos.field++;
        }
        positions.push(new FieldPos(found, lines.length, m.index, m.index + name2.length));
        line2 = line2.slice(0, m.index) + name2 + line2.slice(m.index + m[0].length);
      }
      for (let esc; esc = /\\([{}])/.exec(line2); ) {
        line2 = line2.slice(0, esc.index) + esc[1] + line2.slice(esc.index + esc[0].length);
        for (let pos of positions)
          if (pos.line == lines.length && pos.from > esc.index) {
            pos.from--;
            pos.to--;
          }
      }
      lines.push(line2);
    }
    return new _Snippet(lines, positions);
  }
};
var fieldMarker = /* @__PURE__ */ Decoration.widget({ widget: /* @__PURE__ */ new class extends WidgetType {
  toDOM() {
    let span = document.createElement("span");
    span.className = "cm-snippetFieldPosition";
    return span;
  }
  ignoreEvent() {
    return false;
  }
}() });
var fieldRange = /* @__PURE__ */ Decoration.mark({ class: "cm-snippetField" });
var ActiveSnippet = class _ActiveSnippet {
  constructor(ranges, active) {
    this.ranges = ranges;
    this.active = active;
    this.deco = Decoration.set(ranges.map((r3) => (r3.from == r3.to ? fieldMarker : fieldRange).range(r3.from, r3.to)));
  }
  map(changes) {
    let ranges = [];
    for (let r3 of this.ranges) {
      let mapped = r3.map(changes);
      if (!mapped)
        return null;
      ranges.push(mapped);
    }
    return new _ActiveSnippet(ranges, this.active);
  }
  selectionInsideField(sel) {
    return sel.ranges.every((range4) => this.ranges.some((r3) => r3.field == this.active && r3.from <= range4.from && r3.to >= range4.to));
  }
};
var setActive = /* @__PURE__ */ StateEffect.define({
  map(value, changes) {
    return value && value.map(changes);
  }
});
var moveToField = /* @__PURE__ */ StateEffect.define();
var snippetState = /* @__PURE__ */ StateField.define({
  create() {
    return null;
  },
  update(value, tr) {
    for (let effect of tr.effects) {
      if (effect.is(setActive))
        return effect.value;
      if (effect.is(moveToField) && value)
        return new ActiveSnippet(value.ranges, effect.value);
    }
    if (value && tr.docChanged)
      value = value.map(tr.changes);
    if (value && tr.selection && !value.selectionInsideField(tr.selection))
      value = null;
    return value;
  },
  provide: (f) => EditorView.decorations.from(f, (val) => val ? val.deco : Decoration.none)
});
function fieldSelection(ranges, field) {
  return EditorSelection.create(ranges.filter((r3) => r3.field == field).map((r3) => EditorSelection.range(r3.from, r3.to)));
}
function snippet(template) {
  let snippet2 = Snippet.parse(template);
  return (editor, completion, from2, to) => {
    let { text: text2, ranges } = snippet2.instantiate(editor.state, from2);
    let spec = {
      changes: { from: from2, to, insert: Text2.of(text2) },
      scrollIntoView: true,
      annotations: completion ? pickedCompletion.of(completion) : void 0
    };
    if (ranges.length)
      spec.selection = fieldSelection(ranges, 0);
    if (ranges.length > 1) {
      let active = new ActiveSnippet(ranges, 0);
      let effects = spec.effects = [setActive.of(active)];
      if (editor.state.field(snippetState, false) === void 0)
        effects.push(StateEffect.appendConfig.of([snippetState, addSnippetKeymap, snippetPointerHandler, baseTheme3]));
    }
    editor.dispatch(editor.state.update(spec));
  };
}
function moveField(dir) {
  return ({ state, dispatch }) => {
    let active = state.field(snippetState, false);
    if (!active || dir < 0 && active.active == 0)
      return false;
    let next2 = active.active + dir, last = dir > 0 && !active.ranges.some((r3) => r3.field == next2 + dir);
    dispatch(state.update({
      selection: fieldSelection(active.ranges, next2),
      effects: setActive.of(last ? null : new ActiveSnippet(active.ranges, next2)),
      scrollIntoView: true
    }));
    return true;
  };
}
var clearSnippet = ({ state, dispatch }) => {
  let active = state.field(snippetState, false);
  if (!active)
    return false;
  dispatch(state.update({ effects: setActive.of(null) }));
  return true;
};
var nextSnippetField = /* @__PURE__ */ moveField(1);
var prevSnippetField = /* @__PURE__ */ moveField(-1);
var defaultSnippetKeymap = [
  { key: "Tab", run: nextSnippetField, shift: prevSnippetField },
  { key: "Escape", run: clearSnippet }
];
var snippetKeymap = /* @__PURE__ */ Facet.define({
  combine(maps) {
    return maps.length ? maps[0] : defaultSnippetKeymap;
  }
});
var addSnippetKeymap = /* @__PURE__ */ Prec.highest(/* @__PURE__ */ keymap.compute([snippetKeymap], (state) => state.facet(snippetKeymap)));
function snippetCompletion(template, completion) {
  return Object.assign(Object.assign({}, completion), { apply: snippet(template) });
}
var snippetPointerHandler = /* @__PURE__ */ EditorView.domEventHandlers({
  mousedown(event, view) {
    let active = view.state.field(snippetState, false), pos;
    if (!active || (pos = view.posAtCoords({ x: event.clientX, y: event.clientY })) == null)
      return false;
    let match2 = active.ranges.find((r3) => r3.from <= pos && r3.to >= pos);
    if (!match2 || match2.field == active.active)
      return false;
    view.dispatch({
      selection: fieldSelection(active.ranges, match2.field),
      effects: setActive.of(active.ranges.some((r3) => r3.field > match2.field) ? new ActiveSnippet(active.ranges, match2.field) : null),
      scrollIntoView: true
    });
    return true;
  }
});
var defaults2 = {
  brackets: ["(", "[", "{", "'", '"'],
  before: ")]}:;>",
  stringPrefixes: []
};
var closeBracketEffect = /* @__PURE__ */ StateEffect.define({
  map(value, mapping) {
    let mapped = mapping.mapPos(value, -1, MapMode.TrackAfter);
    return mapped == null ? void 0 : mapped;
  }
});
var closedBracket = /* @__PURE__ */ new class extends RangeValue {
}();
closedBracket.startSide = 1;
closedBracket.endSide = -1;
var bracketState = /* @__PURE__ */ StateField.define({
  create() {
    return RangeSet.empty;
  },
  update(value, tr) {
    if (tr.selection) {
      let lineStart = tr.state.doc.lineAt(tr.selection.main.head).from;
      let prevLineStart = tr.startState.doc.lineAt(tr.startState.selection.main.head).from;
      if (lineStart != tr.changes.mapPos(prevLineStart, -1))
        value = RangeSet.empty;
    }
    value = value.map(tr.changes);
    for (let effect of tr.effects)
      if (effect.is(closeBracketEffect))
        value = value.update({ add: [closedBracket.range(effect.value, effect.value + 1)] });
    return value;
  }
});
function closeBrackets() {
  return [inputHandler2, bracketState];
}
var definedClosing = "()[]{}<>";
function closing(ch) {
  for (let i2 = 0; i2 < definedClosing.length; i2 += 2)
    if (definedClosing.charCodeAt(i2) == ch)
      return definedClosing.charAt(i2 + 1);
  return fromCodePoint(ch < 128 ? ch : ch + 1);
}
function config(state, pos) {
  return state.languageDataAt("closeBrackets", pos)[0] || defaults2;
}
var android = typeof navigator == "object" && /* @__PURE__ */ /Android\b/.test(navigator.userAgent);
var inputHandler2 = /* @__PURE__ */ EditorView.inputHandler.of((view, from2, to, insert2) => {
  if ((android ? view.composing : view.compositionStarted) || view.state.readOnly)
    return false;
  let sel = view.state.selection.main;
  if (insert2.length > 2 || insert2.length == 2 && codePointSize(codePointAt(insert2, 0)) == 1 || from2 != sel.from || to != sel.to)
    return false;
  let tr = insertBracket(view.state, insert2);
  if (!tr)
    return false;
  view.dispatch(tr);
  return true;
});
var deleteBracketPair = ({ state, dispatch }) => {
  if (state.readOnly)
    return false;
  let conf = config(state, state.selection.main.head);
  let tokens = conf.brackets || defaults2.brackets;
  let dont = null, changes = state.changeByRange((range4) => {
    if (range4.empty) {
      let before = prevChar(state.doc, range4.head);
      for (let token2 of tokens) {
        if (token2 == before && nextChar(state.doc, range4.head) == closing(codePointAt(token2, 0)))
          return {
            changes: { from: range4.head - token2.length, to: range4.head + token2.length },
            range: EditorSelection.cursor(range4.head - token2.length)
          };
      }
    }
    return { range: dont = range4 };
  });
  if (!dont)
    dispatch(state.update(changes, { scrollIntoView: true, userEvent: "delete.backward" }));
  return !dont;
};
var closeBracketsKeymap = [
  { key: "Backspace", run: deleteBracketPair }
];
function insertBracket(state, bracket2) {
  let conf = config(state, state.selection.main.head);
  let tokens = conf.brackets || defaults2.brackets;
  for (let tok of tokens) {
    let closed = closing(codePointAt(tok, 0));
    if (bracket2 == tok)
      return closed == tok ? handleSame(state, tok, tokens.indexOf(tok + tok + tok) > -1, conf) : handleOpen(state, tok, closed, conf.before || defaults2.before);
    if (bracket2 == closed && closedBracketAt(state, state.selection.main.from))
      return handleClose(state, tok, closed);
  }
  return null;
}
function closedBracketAt(state, pos) {
  let found = false;
  state.field(bracketState).between(0, state.doc.length, (from2) => {
    if (from2 == pos)
      found = true;
  });
  return found;
}
function nextChar(doc2, pos) {
  let next2 = doc2.sliceString(pos, pos + 2);
  return next2.slice(0, codePointSize(codePointAt(next2, 0)));
}
function prevChar(doc2, pos) {
  let prev2 = doc2.sliceString(pos - 2, pos);
  return codePointSize(codePointAt(prev2, 0)) == prev2.length ? prev2 : prev2.slice(1);
}
function handleOpen(state, open, close, closeBefore) {
  let dont = null, changes = state.changeByRange((range4) => {
    if (!range4.empty)
      return {
        changes: [{ insert: open, from: range4.from }, { insert: close, from: range4.to }],
        effects: closeBracketEffect.of(range4.to + open.length),
        range: EditorSelection.range(range4.anchor + open.length, range4.head + open.length)
      };
    let next2 = nextChar(state.doc, range4.head);
    if (!next2 || /\s/.test(next2) || closeBefore.indexOf(next2) > -1)
      return {
        changes: { insert: open + close, from: range4.head },
        effects: closeBracketEffect.of(range4.head + open.length),
        range: EditorSelection.cursor(range4.head + open.length)
      };
    return { range: dont = range4 };
  });
  return dont ? null : state.update(changes, {
    scrollIntoView: true,
    userEvent: "input.type"
  });
}
function handleClose(state, _open, close) {
  let dont = null, changes = state.changeByRange((range4) => {
    if (range4.empty && nextChar(state.doc, range4.head) == close)
      return {
        changes: { from: range4.head, to: range4.head + close.length, insert: close },
        range: EditorSelection.cursor(range4.head + close.length)
      };
    return dont = { range: range4 };
  });
  return dont ? null : state.update(changes, {
    scrollIntoView: true,
    userEvent: "input.type"
  });
}
function handleSame(state, token2, allowTriple, config2) {
  let stringPrefixes = config2.stringPrefixes || defaults2.stringPrefixes;
  let dont = null, changes = state.changeByRange((range4) => {
    if (!range4.empty)
      return {
        changes: [{ insert: token2, from: range4.from }, { insert: token2, from: range4.to }],
        effects: closeBracketEffect.of(range4.to + token2.length),
        range: EditorSelection.range(range4.anchor + token2.length, range4.head + token2.length)
      };
    let pos = range4.head, next2 = nextChar(state.doc, pos), start;
    if (next2 == token2) {
      if (nodeStart(state, pos)) {
        return {
          changes: { insert: token2 + token2, from: pos },
          effects: closeBracketEffect.of(pos + token2.length),
          range: EditorSelection.cursor(pos + token2.length)
        };
      } else if (closedBracketAt(state, pos)) {
        let isTriple = allowTriple && state.sliceDoc(pos, pos + token2.length * 3) == token2 + token2 + token2;
        let content2 = isTriple ? token2 + token2 + token2 : token2;
        return {
          changes: { from: pos, to: pos + content2.length, insert: content2 },
          range: EditorSelection.cursor(pos + content2.length)
        };
      }
    } else if (allowTriple && state.sliceDoc(pos - 2 * token2.length, pos) == token2 + token2 && (start = canStartStringAt(state, pos - 2 * token2.length, stringPrefixes)) > -1 && nodeStart(state, start)) {
      return {
        changes: { insert: token2 + token2 + token2 + token2, from: pos },
        effects: closeBracketEffect.of(pos + token2.length),
        range: EditorSelection.cursor(pos + token2.length)
      };
    } else if (state.charCategorizer(pos)(next2) != CharCategory.Word) {
      if (canStartStringAt(state, pos, stringPrefixes) > -1 && !probablyInString(state, pos, token2, stringPrefixes))
        return {
          changes: { insert: token2 + token2, from: pos },
          effects: closeBracketEffect.of(pos + token2.length),
          range: EditorSelection.cursor(pos + token2.length)
        };
    }
    return { range: dont = range4 };
  });
  return dont ? null : state.update(changes, {
    scrollIntoView: true,
    userEvent: "input.type"
  });
}
function nodeStart(state, pos) {
  let tree = syntaxTree(state).resolveInner(pos + 1);
  return tree.parent && tree.from == pos;
}
function probablyInString(state, pos, quoteToken, prefixes2) {
  let node56 = syntaxTree(state).resolveInner(pos, -1);
  let maxPrefix = prefixes2.reduce((m, p) => Math.max(m, p.length), 0);
  for (let i2 = 0; i2 < 5; i2++) {
    let start = state.sliceDoc(node56.from, Math.min(node56.to, node56.from + quoteToken.length + maxPrefix));
    let quotePos = start.indexOf(quoteToken);
    if (!quotePos || quotePos > -1 && prefixes2.indexOf(start.slice(0, quotePos)) > -1) {
      let first = node56.firstChild;
      while (first && first.from == node56.from && first.to - first.from > quoteToken.length + quotePos) {
        if (state.sliceDoc(first.to - quoteToken.length, first.to) == quoteToken)
          return false;
        first = first.firstChild;
      }
      return true;
    }
    let parent = node56.to == pos && node56.parent;
    if (!parent)
      break;
    node56 = parent;
  }
  return false;
}
function canStartStringAt(state, pos, prefixes2) {
  let charCat = state.charCategorizer(pos);
  if (charCat(state.sliceDoc(pos - 1, pos)) != CharCategory.Word)
    return pos;
  for (let prefix3 of prefixes2) {
    let start = pos - prefix3.length;
    if (state.sliceDoc(start, pos) == prefix3 && charCat(state.sliceDoc(start - 1, start)) != CharCategory.Word)
      return start;
  }
  return -1;
}
function autocompletion(config2 = {}) {
  return [
    completionState,
    completionConfig.of(config2),
    completionPlugin,
    completionKeymapExt,
    baseTheme3
  ];
}
var completionKeymap = [
  { key: "Ctrl-Space", run: startCompletion },
  { key: "Escape", run: closeCompletion },
  { key: "ArrowDown", run: /* @__PURE__ */ moveCompletionSelection(true) },
  { key: "ArrowUp", run: /* @__PURE__ */ moveCompletionSelection(false) },
  { key: "PageDown", run: /* @__PURE__ */ moveCompletionSelection(true, "page") },
  { key: "PageUp", run: /* @__PURE__ */ moveCompletionSelection(false, "page") },
  { key: "Enter", run: acceptCompletion }
];
var completionKeymapExt = /* @__PURE__ */ Prec.highest(/* @__PURE__ */ keymap.computeN([completionConfig], (state) => state.facet(completionConfig).defaultKeymap ? [completionKeymap] : []));

// node_modules/@lezer/lr/dist/index.js
var Stack = class _Stack {
  /**
  @internal
  */
  constructor(p, stack, state, reducePos, pos, score2, buffer, bufferBase, curContext, lookAhead = 0, parent) {
    this.p = p;
    this.stack = stack;
    this.state = state;
    this.reducePos = reducePos;
    this.pos = pos;
    this.score = score2;
    this.buffer = buffer;
    this.bufferBase = bufferBase;
    this.curContext = curContext;
    this.lookAhead = lookAhead;
    this.parent = parent;
  }
  /**
  @internal
  */
  toString() {
    return `[${this.stack.filter((_, i2) => i2 % 3 == 0).concat(this.state)}]@${this.pos}${this.score ? "!" + this.score : ""}`;
  }
  // Start an empty stack
  /**
  @internal
  */
  static start(p, state, pos = 0) {
    let cx = p.parser.context;
    return new _Stack(p, [], state, pos, pos, 0, [], 0, cx ? new StackContext(cx, cx.start) : null, 0, null);
  }
  /**
  The stack's current [context](#lr.ContextTracker) value, if
  any. Its type will depend on the context tracker's type
  parameter, or it will be `null` if there is no context
  tracker.
  */
  get context() {
    return this.curContext ? this.curContext.context : null;
  }
  // Push a state onto the stack, tracking its start position as well
  // as the buffer base at that point.
  /**
  @internal
  */
  pushState(state, start) {
    this.stack.push(this.state, start, this.bufferBase + this.buffer.length);
    this.state = state;
  }
  // Apply a reduce action
  /**
  @internal
  */
  reduce(action) {
    var _a2;
    let depth = action >> 19, type = action & 65535;
    let { parser: parser3 } = this.p;
    let dPrec = parser3.dynamicPrecedence(type);
    if (dPrec)
      this.score += dPrec;
    if (depth == 0) {
      this.pushState(parser3.getGoto(this.state, type, true), this.reducePos);
      if (type < parser3.minRepeatTerm)
        this.storeNode(type, this.reducePos, this.reducePos, 4, true);
      this.reduceContext(type, this.reducePos);
      return;
    }
    let base2 = this.stack.length - (depth - 1) * 3 - (action & 262144 ? 6 : 0);
    let start = base2 ? this.stack[base2 - 2] : this.p.ranges[0].from, size = this.reducePos - start;
    if (size >= 2e3 && !((_a2 = this.p.parser.nodeSet.types[type]) === null || _a2 === void 0 ? void 0 : _a2.isAnonymous)) {
      if (start == this.p.lastBigReductionStart) {
        this.p.bigReductionCount++;
        this.p.lastBigReductionSize = size;
      } else if (this.p.lastBigReductionSize < size) {
        this.p.bigReductionCount = 1;
        this.p.lastBigReductionStart = start;
        this.p.lastBigReductionSize = size;
      }
    }
    let bufferBase = base2 ? this.stack[base2 - 1] : 0, count2 = this.bufferBase + this.buffer.length - bufferBase;
    if (type < parser3.minRepeatTerm || action & 131072) {
      let pos = parser3.stateFlag(
        this.state,
        1
        /* StateFlag.Skipped */
      ) ? this.pos : this.reducePos;
      this.storeNode(type, start, pos, count2 + 4, true);
    }
    if (action & 262144) {
      this.state = this.stack[base2];
    } else {
      let baseStateID = this.stack[base2 - 3];
      this.state = parser3.getGoto(baseStateID, type, true);
    }
    while (this.stack.length > base2)
      this.stack.pop();
    this.reduceContext(type, start);
  }
  // Shift a value into the buffer
  /**
  @internal
  */
  storeNode(term, start, end, size = 4, isReduce = false) {
    if (term == 0 && (!this.stack.length || this.stack[this.stack.length - 1] < this.buffer.length + this.bufferBase)) {
      let cur2 = this, top2 = this.buffer.length;
      if (top2 == 0 && cur2.parent) {
        top2 = cur2.bufferBase - cur2.parent.bufferBase;
        cur2 = cur2.parent;
      }
      if (top2 > 0 && cur2.buffer[top2 - 4] == 0 && cur2.buffer[top2 - 1] > -1) {
        if (start == end)
          return;
        if (cur2.buffer[top2 - 2] >= start) {
          cur2.buffer[top2 - 2] = end;
          return;
        }
      }
    }
    if (!isReduce || this.pos == end) {
      this.buffer.push(term, start, end, size);
    } else {
      let index = this.buffer.length;
      if (index > 0 && this.buffer[index - 4] != 0)
        while (index > 0 && this.buffer[index - 2] > end) {
          this.buffer[index] = this.buffer[index - 4];
          this.buffer[index + 1] = this.buffer[index - 3];
          this.buffer[index + 2] = this.buffer[index - 2];
          this.buffer[index + 3] = this.buffer[index - 1];
          index -= 4;
          if (size > 4)
            size -= 4;
        }
      this.buffer[index] = term;
      this.buffer[index + 1] = start;
      this.buffer[index + 2] = end;
      this.buffer[index + 3] = size;
    }
  }
  // Apply a shift action
  /**
  @internal
  */
  shift(action, type, start, end) {
    if (action & 131072) {
      this.pushState(action & 65535, this.pos);
    } else if ((action & 262144) == 0) {
      let nextState = action, { parser: parser3 } = this.p;
      if (end > this.pos || type <= parser3.maxNode) {
        this.pos = end;
        if (!parser3.stateFlag(
          nextState,
          1
          /* StateFlag.Skipped */
        ))
          this.reducePos = end;
      }
      this.pushState(nextState, start);
      this.shiftContext(type, start);
      if (type <= parser3.maxNode)
        this.buffer.push(type, start, end, 4);
    } else {
      this.pos = end;
      this.shiftContext(type, start);
      if (type <= this.p.parser.maxNode)
        this.buffer.push(type, start, end, 4);
    }
  }
  // Apply an action
  /**
  @internal
  */
  apply(action, next2, nextStart, nextEnd) {
    if (action & 65536)
      this.reduce(action);
    else
      this.shift(action, next2, nextStart, nextEnd);
  }
  // Add a prebuilt (reused) node into the buffer.
  /**
  @internal
  */
  useNode(value, next2) {
    let index = this.p.reused.length - 1;
    if (index < 0 || this.p.reused[index] != value) {
      this.p.reused.push(value);
      index++;
    }
    let start = this.pos;
    this.reducePos = this.pos = start + value.length;
    this.pushState(next2, start);
    this.buffer.push(
      index,
      start,
      this.reducePos,
      -1
      /* size == -1 means this is a reused value */
    );
    if (this.curContext)
      this.updateContext(this.curContext.tracker.reuse(this.curContext.context, value, this, this.p.stream.reset(this.pos - value.length)));
  }
  // Split the stack. Due to the buffer sharing and the fact
  // that `this.stack` tends to stay quite shallow, this isn't very
  // expensive.
  /**
  @internal
  */
  split() {
    let parent = this;
    let off = parent.buffer.length;
    while (off > 0 && parent.buffer[off - 2] > parent.reducePos)
      off -= 4;
    let buffer = parent.buffer.slice(off), base2 = parent.bufferBase + off;
    while (parent && base2 == parent.bufferBase)
      parent = parent.parent;
    return new _Stack(this.p, this.stack.slice(), this.state, this.reducePos, this.pos, this.score, buffer, base2, this.curContext, this.lookAhead, parent);
  }
  // Try to recover from an error by 'deleting' (ignoring) one token.
  /**
  @internal
  */
  recoverByDelete(next2, nextEnd) {
    let isNode = next2 <= this.p.parser.maxNode;
    if (isNode)
      this.storeNode(next2, this.pos, nextEnd, 4);
    this.storeNode(0, this.pos, nextEnd, isNode ? 8 : 4);
    this.pos = this.reducePos = nextEnd;
    this.score -= 190;
  }
  /**
  Check if the given term would be able to be shifted (optionally
  after some reductions) on this stack. This can be useful for
  external tokenizers that want to make sure they only provide a
  given token when it applies.
  */
  canShift(term) {
    for (let sim = new SimulatedStack(this); ; ) {
      let action = this.p.parser.stateSlot(
        sim.state,
        4
        /* ParseState.DefaultReduce */
      ) || this.p.parser.hasAction(sim.state, term);
      if (action == 0)
        return false;
      if ((action & 65536) == 0)
        return true;
      sim.reduce(action);
    }
  }
  // Apply up to Recover.MaxNext recovery actions that conceptually
  // inserts some missing token or rule.
  /**
  @internal
  */
  recoverByInsert(next2) {
    if (this.stack.length >= 300)
      return [];
    let nextStates = this.p.parser.nextStates(this.state);
    if (nextStates.length > 4 << 1 || this.stack.length >= 120) {
      let best = [];
      for (let i2 = 0, s2; i2 < nextStates.length; i2 += 2) {
        if ((s2 = nextStates[i2 + 1]) != this.state && this.p.parser.hasAction(s2, next2))
          best.push(nextStates[i2], s2);
      }
      if (this.stack.length < 120)
        for (let i2 = 0; best.length < 4 << 1 && i2 < nextStates.length; i2 += 2) {
          let s2 = nextStates[i2 + 1];
          if (!best.some((v4, i3) => i3 & 1 && v4 == s2))
            best.push(nextStates[i2], s2);
        }
      nextStates = best;
    }
    let result = [];
    for (let i2 = 0; i2 < nextStates.length && result.length < 4; i2 += 2) {
      let s2 = nextStates[i2 + 1];
      if (s2 == this.state)
        continue;
      let stack = this.split();
      stack.pushState(s2, this.pos);
      stack.storeNode(0, stack.pos, stack.pos, 4, true);
      stack.shiftContext(nextStates[i2], this.pos);
      stack.reducePos = this.pos;
      stack.score -= 200;
      result.push(stack);
    }
    return result;
  }
  // Force a reduce, if possible. Return false if that can't
  // be done.
  /**
  @internal
  */
  forceReduce() {
    let { parser: parser3 } = this.p;
    let reduce = parser3.stateSlot(
      this.state,
      5
      /* ParseState.ForcedReduce */
    );
    if ((reduce & 65536) == 0)
      return false;
    if (!parser3.validAction(this.state, reduce)) {
      let depth = reduce >> 19, term = reduce & 65535;
      let target = this.stack.length - depth * 3;
      if (target < 0 || parser3.getGoto(this.stack[target], term, false) < 0) {
        let backup = this.findForcedReduction();
        if (backup == null)
          return false;
        reduce = backup;
      }
      this.storeNode(0, this.pos, this.pos, 4, true);
      this.score -= 100;
    }
    this.reducePos = this.pos;
    this.reduce(reduce);
    return true;
  }
  /**
  Try to scan through the automaton to find some kind of reduction
  that can be applied. Used when the regular ForcedReduce field
  isn't a valid action. @internal
  */
  findForcedReduction() {
    let { parser: parser3 } = this.p, seen = [];
    let explore = (state, depth) => {
      if (seen.includes(state))
        return;
      seen.push(state);
      return parser3.allActions(state, (action) => {
        if (action & (262144 | 131072))
          ;
        else if (action & 65536) {
          let rDepth = (action >> 19) - depth;
          if (rDepth > 1) {
            let term = action & 65535, target = this.stack.length - rDepth * 3;
            if (target >= 0 && parser3.getGoto(this.stack[target], term, false) >= 0)
              return rDepth << 19 | 65536 | term;
          }
        } else {
          let found = explore(action, depth + 1);
          if (found != null)
            return found;
        }
      });
    };
    return explore(this.state, 0);
  }
  /**
  @internal
  */
  forceAll() {
    while (!this.p.parser.stateFlag(
      this.state,
      2
      /* StateFlag.Accepting */
    )) {
      if (!this.forceReduce()) {
        this.storeNode(0, this.pos, this.pos, 4, true);
        break;
      }
    }
    return this;
  }
  /**
  Check whether this state has no further actions (assumed to be a direct descendant of the
  top state, since any other states must be able to continue
  somehow). @internal
  */
  get deadEnd() {
    if (this.stack.length != 3)
      return false;
    let { parser: parser3 } = this.p;
    return parser3.data[parser3.stateSlot(
      this.state,
      1
      /* ParseState.Actions */
    )] == 65535 && !parser3.stateSlot(
      this.state,
      4
      /* ParseState.DefaultReduce */
    );
  }
  /**
  Restart the stack (put it back in its start state). Only safe
  when this.stack.length == 3 (state is directly below the top
  state). @internal
  */
  restart() {
    this.storeNode(0, this.pos, this.pos, 4, true);
    this.state = this.stack[0];
    this.stack.length = 0;
  }
  /**
  @internal
  */
  sameState(other) {
    if (this.state != other.state || this.stack.length != other.stack.length)
      return false;
    for (let i2 = 0; i2 < this.stack.length; i2 += 3)
      if (this.stack[i2] != other.stack[i2])
        return false;
    return true;
  }
  /**
  Get the parser used by this stack.
  */
  get parser() {
    return this.p.parser;
  }
  /**
  Test whether a given dialect (by numeric ID, as exported from
  the terms file) is enabled.
  */
  dialectEnabled(dialectID) {
    return this.p.parser.dialect.flags[dialectID];
  }
  shiftContext(term, start) {
    if (this.curContext)
      this.updateContext(this.curContext.tracker.shift(this.curContext.context, term, this, this.p.stream.reset(start)));
  }
  reduceContext(term, start) {
    if (this.curContext)
      this.updateContext(this.curContext.tracker.reduce(this.curContext.context, term, this, this.p.stream.reset(start)));
  }
  /**
  @internal
  */
  emitContext() {
    let last = this.buffer.length - 1;
    if (last < 0 || this.buffer[last] != -3)
      this.buffer.push(this.curContext.hash, this.pos, this.pos, -3);
  }
  /**
  @internal
  */
  emitLookAhead() {
    let last = this.buffer.length - 1;
    if (last < 0 || this.buffer[last] != -4)
      this.buffer.push(this.lookAhead, this.pos, this.pos, -4);
  }
  updateContext(context2) {
    if (context2 != this.curContext.context) {
      let newCx = new StackContext(this.curContext.tracker, context2);
      if (newCx.hash != this.curContext.hash)
        this.emitContext();
      this.curContext = newCx;
    }
  }
  /**
  @internal
  */
  setLookAhead(lookAhead) {
    if (lookAhead > this.lookAhead) {
      this.emitLookAhead();
      this.lookAhead = lookAhead;
    }
  }
  /**
  @internal
  */
  close() {
    if (this.curContext && this.curContext.tracker.strict)
      this.emitContext();
    if (this.lookAhead > 0)
      this.emitLookAhead();
  }
};
var StackContext = class {
  constructor(tracker, context2) {
    this.tracker = tracker;
    this.context = context2;
    this.hash = tracker.strict ? tracker.hash(context2) : 0;
  }
};
var SimulatedStack = class {
  constructor(start) {
    this.start = start;
    this.state = start.state;
    this.stack = start.stack;
    this.base = this.stack.length;
  }
  reduce(action) {
    let term = action & 65535, depth = action >> 19;
    if (depth == 0) {
      if (this.stack == this.start.stack)
        this.stack = this.stack.slice();
      this.stack.push(this.state, 0, 0);
      this.base += 3;
    } else {
      this.base -= (depth - 1) * 3;
    }
    let goto = this.start.p.parser.getGoto(this.stack[this.base - 3], term, true);
    this.state = goto;
  }
};
var StackBufferCursor = class _StackBufferCursor {
  constructor(stack, pos, index) {
    this.stack = stack;
    this.pos = pos;
    this.index = index;
    this.buffer = stack.buffer;
    if (this.index == 0)
      this.maybeNext();
  }
  static create(stack, pos = stack.bufferBase + stack.buffer.length) {
    return new _StackBufferCursor(stack, pos, pos - stack.bufferBase);
  }
  maybeNext() {
    let next2 = this.stack.parent;
    if (next2 != null) {
      this.index = this.stack.bufferBase - next2.bufferBase;
      this.stack = next2;
      this.buffer = next2.buffer;
    }
  }
  get id() {
    return this.buffer[this.index - 4];
  }
  get start() {
    return this.buffer[this.index - 3];
  }
  get end() {
    return this.buffer[this.index - 2];
  }
  get size() {
    return this.buffer[this.index - 1];
  }
  next() {
    this.index -= 4;
    this.pos -= 4;
    if (this.index == 0)
      this.maybeNext();
  }
  fork() {
    return new _StackBufferCursor(this.stack, this.pos, this.index);
  }
};
function decodeArray(input, Type = Uint16Array) {
  if (typeof input != "string")
    return input;
  let array = null;
  for (let pos = 0, out = 0; pos < input.length; ) {
    let value = 0;
    for (; ; ) {
      let next2 = input.charCodeAt(pos++), stop = false;
      if (next2 == 126) {
        value = 65535;
        break;
      }
      if (next2 >= 92)
        next2--;
      if (next2 >= 34)
        next2--;
      let digit = next2 - 32;
      if (digit >= 46) {
        digit -= 46;
        stop = true;
      }
      value += digit;
      if (stop)
        break;
      value *= 46;
    }
    if (array)
      array[out++] = value;
    else
      array = new Type(value);
  }
  return array;
}
var CachedToken = class {
  constructor() {
    this.start = -1;
    this.value = -1;
    this.end = -1;
    this.extended = -1;
    this.lookAhead = 0;
    this.mask = 0;
    this.context = 0;
  }
};
var nullToken = new CachedToken();
var InputStream = class {
  /**
  @internal
  */
  constructor(input, ranges) {
    this.input = input;
    this.ranges = ranges;
    this.chunk = "";
    this.chunkOff = 0;
    this.chunk2 = "";
    this.chunk2Pos = 0;
    this.next = -1;
    this.token = nullToken;
    this.rangeIndex = 0;
    this.pos = this.chunkPos = ranges[0].from;
    this.range = ranges[0];
    this.end = ranges[ranges.length - 1].to;
    this.readNext();
  }
  /**
  @internal
  */
  resolveOffset(offset, assoc) {
    let range4 = this.range, index = this.rangeIndex;
    let pos = this.pos + offset;
    while (pos < range4.from) {
      if (!index)
        return null;
      let next2 = this.ranges[--index];
      pos -= range4.from - next2.to;
      range4 = next2;
    }
    while (assoc < 0 ? pos > range4.to : pos >= range4.to) {
      if (index == this.ranges.length - 1)
        return null;
      let next2 = this.ranges[++index];
      pos += next2.from - range4.to;
      range4 = next2;
    }
    return pos;
  }
  /**
  @internal
  */
  clipPos(pos) {
    if (pos >= this.range.from && pos < this.range.to)
      return pos;
    for (let range4 of this.ranges)
      if (range4.to > pos)
        return Math.max(pos, range4.from);
    return this.end;
  }
  /**
  Look at a code unit near the stream position. `.peek(0)` equals
  `.next`, `.peek(-1)` gives you the previous character, and so
  on.
  
  Note that looking around during tokenizing creates dependencies
  on potentially far-away content, which may reduce the
  effectiveness incremental parsing—when looking forward—or even
  cause invalid reparses when looking backward more than 25 code
  units, since the library does not track lookbehind.
  */
  peek(offset) {
    let idx = this.chunkOff + offset, pos, result;
    if (idx >= 0 && idx < this.chunk.length) {
      pos = this.pos + offset;
      result = this.chunk.charCodeAt(idx);
    } else {
      let resolved = this.resolveOffset(offset, 1);
      if (resolved == null)
        return -1;
      pos = resolved;
      if (pos >= this.chunk2Pos && pos < this.chunk2Pos + this.chunk2.length) {
        result = this.chunk2.charCodeAt(pos - this.chunk2Pos);
      } else {
        let i2 = this.rangeIndex, range4 = this.range;
        while (range4.to <= pos)
          range4 = this.ranges[++i2];
        this.chunk2 = this.input.chunk(this.chunk2Pos = pos);
        if (pos + this.chunk2.length > range4.to)
          this.chunk2 = this.chunk2.slice(0, range4.to - pos);
        result = this.chunk2.charCodeAt(0);
      }
    }
    if (pos >= this.token.lookAhead)
      this.token.lookAhead = pos + 1;
    return result;
  }
  /**
  Accept a token. By default, the end of the token is set to the
  current stream position, but you can pass an offset (relative to
  the stream position) to change that.
  */
  acceptToken(token2, endOffset = 0) {
    let end = endOffset ? this.resolveOffset(endOffset, -1) : this.pos;
    if (end == null || end < this.token.start)
      throw new RangeError("Token end out of bounds");
    this.token.value = token2;
    this.token.end = end;
  }
  getChunk() {
    if (this.pos >= this.chunk2Pos && this.pos < this.chunk2Pos + this.chunk2.length) {
      let { chunk, chunkPos } = this;
      this.chunk = this.chunk2;
      this.chunkPos = this.chunk2Pos;
      this.chunk2 = chunk;
      this.chunk2Pos = chunkPos;
      this.chunkOff = this.pos - this.chunkPos;
    } else {
      this.chunk2 = this.chunk;
      this.chunk2Pos = this.chunkPos;
      let nextChunk = this.input.chunk(this.pos);
      let end = this.pos + nextChunk.length;
      this.chunk = end > this.range.to ? nextChunk.slice(0, this.range.to - this.pos) : nextChunk;
      this.chunkPos = this.pos;
      this.chunkOff = 0;
    }
  }
  readNext() {
    if (this.chunkOff >= this.chunk.length) {
      this.getChunk();
      if (this.chunkOff == this.chunk.length)
        return this.next = -1;
    }
    return this.next = this.chunk.charCodeAt(this.chunkOff);
  }
  /**
  Move the stream forward N (defaults to 1) code units. Returns
  the new value of [`next`](#lr.InputStream.next).
  */
  advance(n2 = 1) {
    this.chunkOff += n2;
    while (this.pos + n2 >= this.range.to) {
      if (this.rangeIndex == this.ranges.length - 1)
        return this.setDone();
      n2 -= this.range.to - this.pos;
      this.range = this.ranges[++this.rangeIndex];
      this.pos = this.range.from;
    }
    this.pos += n2;
    if (this.pos >= this.token.lookAhead)
      this.token.lookAhead = this.pos + 1;
    return this.readNext();
  }
  setDone() {
    this.pos = this.chunkPos = this.end;
    this.range = this.ranges[this.rangeIndex = this.ranges.length - 1];
    this.chunk = "";
    return this.next = -1;
  }
  /**
  @internal
  */
  reset(pos, token2) {
    if (token2) {
      this.token = token2;
      token2.start = pos;
      token2.lookAhead = pos + 1;
      token2.value = token2.extended = -1;
    } else {
      this.token = nullToken;
    }
    if (this.pos != pos) {
      this.pos = pos;
      if (pos == this.end) {
        this.setDone();
        return this;
      }
      while (pos < this.range.from)
        this.range = this.ranges[--this.rangeIndex];
      while (pos >= this.range.to)
        this.range = this.ranges[++this.rangeIndex];
      if (pos >= this.chunkPos && pos < this.chunkPos + this.chunk.length) {
        this.chunkOff = pos - this.chunkPos;
      } else {
        this.chunk = "";
        this.chunkOff = 0;
      }
      this.readNext();
    }
    return this;
  }
  /**
  @internal
  */
  read(from2, to) {
    if (from2 >= this.chunkPos && to <= this.chunkPos + this.chunk.length)
      return this.chunk.slice(from2 - this.chunkPos, to - this.chunkPos);
    if (from2 >= this.chunk2Pos && to <= this.chunk2Pos + this.chunk2.length)
      return this.chunk2.slice(from2 - this.chunk2Pos, to - this.chunk2Pos);
    if (from2 >= this.range.from && to <= this.range.to)
      return this.input.read(from2, to);
    let result = "";
    for (let r3 of this.ranges) {
      if (r3.from >= to)
        break;
      if (r3.to > from2)
        result += this.input.read(Math.max(r3.from, from2), Math.min(r3.to, to));
    }
    return result;
  }
};
var TokenGroup = class {
  constructor(data, id2) {
    this.data = data;
    this.id = id2;
  }
  token(input, stack) {
    let { parser: parser3 } = stack.p;
    readToken(this.data, input, stack, this.id, parser3.data, parser3.tokenPrecTable);
  }
};
TokenGroup.prototype.contextual = TokenGroup.prototype.fallback = TokenGroup.prototype.extend = false;
var LocalTokenGroup = class {
  constructor(data, precTable, elseToken) {
    this.precTable = precTable;
    this.elseToken = elseToken;
    this.data = typeof data == "string" ? decodeArray(data) : data;
  }
  token(input, stack) {
    let start = input.pos, skipped = 0;
    for (; ; ) {
      let atEof = input.next < 0, nextPos = input.resolveOffset(1, 1);
      readToken(this.data, input, stack, 0, this.data, this.precTable);
      if (input.token.value > -1)
        break;
      if (this.elseToken == null)
        return;
      if (!atEof)
        skipped++;
      if (nextPos == null)
        break;
      input.reset(nextPos, input.token);
    }
    if (skipped) {
      input.reset(start, input.token);
      input.acceptToken(this.elseToken, skipped);
    }
  }
};
LocalTokenGroup.prototype.contextual = TokenGroup.prototype.fallback = TokenGroup.prototype.extend = false;
var ExternalTokenizer = class {
  /**
  Create a tokenizer. The first argument is the function that,
  given an input stream, scans for the types of tokens it
  recognizes at the stream's position, and calls
  [`acceptToken`](#lr.InputStream.acceptToken) when it finds
  one.
  */
  constructor(token2, options = {}) {
    this.token = token2;
    this.contextual = !!options.contextual;
    this.fallback = !!options.fallback;
    this.extend = !!options.extend;
  }
};
function readToken(data, input, stack, group, precTable, precOffset) {
  let state = 0, groupMask = 1 << group, { dialect } = stack.p.parser;
  scan:
    for (; ; ) {
      if ((groupMask & data[state]) == 0)
        break;
      let accEnd = data[state + 1];
      for (let i2 = state + 3; i2 < accEnd; i2 += 2)
        if ((data[i2 + 1] & groupMask) > 0) {
          let term = data[i2];
          if (dialect.allows(term) && (input.token.value == -1 || input.token.value == term || overrides(term, input.token.value, precTable, precOffset))) {
            input.acceptToken(term);
            break;
          }
        }
      let next2 = input.next, low = 0, high = data[state + 2];
      if (input.next < 0 && high > low && data[accEnd + high * 3 - 3] == 65535 && data[accEnd + high * 3 - 3] == 65535) {
        state = data[accEnd + high * 3 - 1];
        continue scan;
      }
      for (; low < high; ) {
        let mid = low + high >> 1;
        let index = accEnd + mid + (mid << 1);
        let from2 = data[index], to = data[index + 1] || 65536;
        if (next2 < from2)
          high = mid;
        else if (next2 >= to)
          low = mid + 1;
        else {
          state = data[index + 2];
          input.advance();
          continue scan;
        }
      }
      break;
    }
}
function findOffset(data, start, term) {
  for (let i2 = start, next2; (next2 = data[i2]) != 65535; i2++)
    if (next2 == term)
      return i2 - start;
  return -1;
}
function overrides(token2, prev2, tableData, tableOffset) {
  let iPrev = findOffset(tableData, tableOffset, prev2);
  return iPrev < 0 || findOffset(tableData, tableOffset, token2) < iPrev;
}
var verbose = typeof process != "undefined" && process.env && /\bparse\b/.test(process.env.LOG);
var stackIDs = null;
function cutAt(tree, pos, side) {
  let cursor3 = tree.cursor(IterMode.IncludeAnonymous);
  cursor3.moveTo(pos);
  for (; ; ) {
    if (!(side < 0 ? cursor3.childBefore(pos) : cursor3.childAfter(pos)))
      for (; ; ) {
        if ((side < 0 ? cursor3.to < pos : cursor3.from > pos) && !cursor3.type.isError)
          return side < 0 ? Math.max(0, Math.min(
            cursor3.to - 1,
            pos - 25
            /* Safety.Margin */
          )) : Math.min(tree.length, Math.max(
            cursor3.from + 1,
            pos + 25
            /* Safety.Margin */
          ));
        if (side < 0 ? cursor3.prevSibling() : cursor3.nextSibling())
          break;
        if (!cursor3.parent())
          return side < 0 ? 0 : tree.length;
      }
  }
}
var FragmentCursor = class {
  constructor(fragments, nodeSet) {
    this.fragments = fragments;
    this.nodeSet = nodeSet;
    this.i = 0;
    this.fragment = null;
    this.safeFrom = -1;
    this.safeTo = -1;
    this.trees = [];
    this.start = [];
    this.index = [];
    this.nextFragment();
  }
  nextFragment() {
    let fr = this.fragment = this.i == this.fragments.length ? null : this.fragments[this.i++];
    if (fr) {
      this.safeFrom = fr.openStart ? cutAt(fr.tree, fr.from + fr.offset, 1) - fr.offset : fr.from;
      this.safeTo = fr.openEnd ? cutAt(fr.tree, fr.to + fr.offset, -1) - fr.offset : fr.to;
      while (this.trees.length) {
        this.trees.pop();
        this.start.pop();
        this.index.pop();
      }
      this.trees.push(fr.tree);
      this.start.push(-fr.offset);
      this.index.push(0);
      this.nextStart = this.safeFrom;
    } else {
      this.nextStart = 1e9;
    }
  }
  // `pos` must be >= any previously given `pos` for this cursor
  nodeAt(pos) {
    if (pos < this.nextStart)
      return null;
    while (this.fragment && this.safeTo <= pos)
      this.nextFragment();
    if (!this.fragment)
      return null;
    for (; ; ) {
      let last = this.trees.length - 1;
      if (last < 0) {
        this.nextFragment();
        return null;
      }
      let top2 = this.trees[last], index = this.index[last];
      if (index == top2.children.length) {
        this.trees.pop();
        this.start.pop();
        this.index.pop();
        continue;
      }
      let next2 = top2.children[index];
      let start = this.start[last] + top2.positions[index];
      if (start > pos) {
        this.nextStart = start;
        return null;
      }
      if (next2 instanceof Tree) {
        if (start == pos) {
          if (start < this.safeFrom)
            return null;
          let end = start + next2.length;
          if (end <= this.safeTo) {
            let lookAhead = next2.prop(NodeProp.lookAhead);
            if (!lookAhead || end + lookAhead < this.fragment.to)
              return next2;
          }
        }
        this.index[last]++;
        if (start + next2.length >= Math.max(this.safeFrom, pos)) {
          this.trees.push(next2);
          this.start.push(start);
          this.index.push(0);
        }
      } else {
        this.index[last]++;
        this.nextStart = start + next2.length;
      }
    }
  }
};
var TokenCache = class {
  constructor(parser3, stream) {
    this.stream = stream;
    this.tokens = [];
    this.mainToken = null;
    this.actions = [];
    this.tokens = parser3.tokenizers.map((_) => new CachedToken());
  }
  getActions(stack) {
    let actionIndex = 0;
    let main = null;
    let { parser: parser3 } = stack.p, { tokenizers } = parser3;
    let mask = parser3.stateSlot(
      stack.state,
      3
      /* ParseState.TokenizerMask */
    );
    let context2 = stack.curContext ? stack.curContext.hash : 0;
    let lookAhead = 0;
    for (let i2 = 0; i2 < tokenizers.length; i2++) {
      if ((1 << i2 & mask) == 0)
        continue;
      let tokenizer = tokenizers[i2], token2 = this.tokens[i2];
      if (main && !tokenizer.fallback)
        continue;
      if (tokenizer.contextual || token2.start != stack.pos || token2.mask != mask || token2.context != context2) {
        this.updateCachedToken(token2, tokenizer, stack);
        token2.mask = mask;
        token2.context = context2;
      }
      if (token2.lookAhead > token2.end + 25)
        lookAhead = Math.max(token2.lookAhead, lookAhead);
      if (token2.value != 0) {
        let startIndex = actionIndex;
        if (token2.extended > -1)
          actionIndex = this.addActions(stack, token2.extended, token2.end, actionIndex);
        actionIndex = this.addActions(stack, token2.value, token2.end, actionIndex);
        if (!tokenizer.extend) {
          main = token2;
          if (actionIndex > startIndex)
            break;
        }
      }
    }
    while (this.actions.length > actionIndex)
      this.actions.pop();
    if (lookAhead)
      stack.setLookAhead(lookAhead);
    if (!main && stack.pos == this.stream.end) {
      main = new CachedToken();
      main.value = stack.p.parser.eofTerm;
      main.start = main.end = stack.pos;
      actionIndex = this.addActions(stack, main.value, main.end, actionIndex);
    }
    this.mainToken = main;
    return this.actions;
  }
  getMainToken(stack) {
    if (this.mainToken)
      return this.mainToken;
    let main = new CachedToken(), { pos, p } = stack;
    main.start = pos;
    main.end = Math.min(pos + 1, p.stream.end);
    main.value = pos == p.stream.end ? p.parser.eofTerm : 0;
    return main;
  }
  updateCachedToken(token2, tokenizer, stack) {
    let start = this.stream.clipPos(stack.pos);
    tokenizer.token(this.stream.reset(start, token2), stack);
    if (token2.value > -1) {
      let { parser: parser3 } = stack.p;
      for (let i2 = 0; i2 < parser3.specialized.length; i2++)
        if (parser3.specialized[i2] == token2.value) {
          let result = parser3.specializers[i2](this.stream.read(token2.start, token2.end), stack);
          if (result >= 0 && stack.p.parser.dialect.allows(result >> 1)) {
            if ((result & 1) == 0)
              token2.value = result >> 1;
            else
              token2.extended = result >> 1;
            break;
          }
        }
    } else {
      token2.value = 0;
      token2.end = this.stream.clipPos(start + 1);
    }
  }
  putAction(action, token2, end, index) {
    for (let i2 = 0; i2 < index; i2 += 3)
      if (this.actions[i2] == action)
        return index;
    this.actions[index++] = action;
    this.actions[index++] = token2;
    this.actions[index++] = end;
    return index;
  }
  addActions(stack, token2, end, index) {
    let { state } = stack, { parser: parser3 } = stack.p, { data } = parser3;
    for (let set3 = 0; set3 < 2; set3++) {
      for (let i2 = parser3.stateSlot(
        state,
        set3 ? 2 : 1
        /* ParseState.Actions */
      ); ; i2 += 3) {
        if (data[i2] == 65535) {
          if (data[i2 + 1] == 1) {
            i2 = pair(data, i2 + 2);
          } else {
            if (index == 0 && data[i2 + 1] == 2)
              index = this.putAction(pair(data, i2 + 2), token2, end, index);
            break;
          }
        }
        if (data[i2] == token2)
          index = this.putAction(pair(data, i2 + 1), token2, end, index);
      }
    }
    return index;
  }
};
var Parse = class {
  constructor(parser3, input, fragments, ranges) {
    this.parser = parser3;
    this.input = input;
    this.ranges = ranges;
    this.recovering = 0;
    this.nextStackID = 9812;
    this.minStackPos = 0;
    this.reused = [];
    this.stoppedAt = null;
    this.lastBigReductionStart = -1;
    this.lastBigReductionSize = 0;
    this.bigReductionCount = 0;
    this.stream = new InputStream(input, ranges);
    this.tokens = new TokenCache(parser3, this.stream);
    this.topTerm = parser3.top[1];
    let { from: from2 } = ranges[0];
    this.stacks = [Stack.start(this, parser3.top[0], from2)];
    this.fragments = fragments.length && this.stream.end - from2 > parser3.bufferLength * 4 ? new FragmentCursor(fragments, parser3.nodeSet) : null;
  }
  get parsedPos() {
    return this.minStackPos;
  }
  // Move the parser forward. This will process all parse stacks at
  // `this.pos` and try to advance them to a further position. If no
  // stack for such a position is found, it'll start error-recovery.
  //
  // When the parse is finished, this will return a syntax tree. When
  // not, it returns `null`.
  advance() {
    let stacks = this.stacks, pos = this.minStackPos;
    let newStacks = this.stacks = [];
    let stopped, stoppedTokens;
    if (this.bigReductionCount > 300 && stacks.length == 1) {
      let [s2] = stacks;
      while (s2.forceReduce() && s2.stack.length && s2.stack[s2.stack.length - 2] >= this.lastBigReductionStart) {
      }
      this.bigReductionCount = this.lastBigReductionSize = 0;
    }
    for (let i2 = 0; i2 < stacks.length; i2++) {
      let stack = stacks[i2];
      for (; ; ) {
        this.tokens.mainToken = null;
        if (stack.pos > pos) {
          newStacks.push(stack);
        } else if (this.advanceStack(stack, newStacks, stacks)) {
          continue;
        } else {
          if (!stopped) {
            stopped = [];
            stoppedTokens = [];
          }
          stopped.push(stack);
          let tok = this.tokens.getMainToken(stack);
          stoppedTokens.push(tok.value, tok.end);
        }
        break;
      }
    }
    if (!newStacks.length) {
      let finished = stopped && findFinished(stopped);
      if (finished) {
        if (verbose)
          console.log("Finish with " + this.stackID(finished));
        return this.stackToTree(finished);
      }
      if (this.parser.strict) {
        if (verbose && stopped)
          console.log("Stuck with token " + (this.tokens.mainToken ? this.parser.getName(this.tokens.mainToken.value) : "none"));
        throw new SyntaxError("No parse at " + pos);
      }
      if (!this.recovering)
        this.recovering = 5;
    }
    if (this.recovering && stopped) {
      let finished = this.stoppedAt != null && stopped[0].pos > this.stoppedAt ? stopped[0] : this.runRecovery(stopped, stoppedTokens, newStacks);
      if (finished) {
        if (verbose)
          console.log("Force-finish " + this.stackID(finished));
        return this.stackToTree(finished.forceAll());
      }
    }
    if (this.recovering) {
      let maxRemaining = this.recovering == 1 ? 1 : this.recovering * 3;
      if (newStacks.length > maxRemaining) {
        newStacks.sort((a2, b) => b.score - a2.score);
        while (newStacks.length > maxRemaining)
          newStacks.pop();
      }
      if (newStacks.some((s2) => s2.reducePos > pos))
        this.recovering--;
    } else if (newStacks.length > 1) {
      outer:
        for (let i2 = 0; i2 < newStacks.length - 1; i2++) {
          let stack = newStacks[i2];
          for (let j = i2 + 1; j < newStacks.length; j++) {
            let other = newStacks[j];
            if (stack.sameState(other) || stack.buffer.length > 500 && other.buffer.length > 500) {
              if ((stack.score - other.score || stack.buffer.length - other.buffer.length) > 0) {
                newStacks.splice(j--, 1);
              } else {
                newStacks.splice(i2--, 1);
                continue outer;
              }
            }
          }
        }
      if (newStacks.length > 12)
        newStacks.splice(
          12,
          newStacks.length - 12
          /* Rec.MaxStackCount */
        );
    }
    this.minStackPos = newStacks[0].pos;
    for (let i2 = 1; i2 < newStacks.length; i2++)
      if (newStacks[i2].pos < this.minStackPos)
        this.minStackPos = newStacks[i2].pos;
    return null;
  }
  stopAt(pos) {
    if (this.stoppedAt != null && this.stoppedAt < pos)
      throw new RangeError("Can't move stoppedAt forward");
    this.stoppedAt = pos;
  }
  // Returns an updated version of the given stack, or null if the
  // stack can't advance normally. When `split` and `stacks` are
  // given, stacks split off by ambiguous operations will be pushed to
  // `split`, or added to `stacks` if they move `pos` forward.
  advanceStack(stack, stacks, split) {
    let start = stack.pos, { parser: parser3 } = this;
    let base2 = verbose ? this.stackID(stack) + " -> " : "";
    if (this.stoppedAt != null && start > this.stoppedAt)
      return stack.forceReduce() ? stack : null;
    if (this.fragments) {
      let strictCx = stack.curContext && stack.curContext.tracker.strict, cxHash = strictCx ? stack.curContext.hash : 0;
      for (let cached = this.fragments.nodeAt(start); cached; ) {
        let match2 = this.parser.nodeSet.types[cached.type.id] == cached.type ? parser3.getGoto(stack.state, cached.type.id) : -1;
        if (match2 > -1 && cached.length && (!strictCx || (cached.prop(NodeProp.contextHash) || 0) == cxHash)) {
          stack.useNode(cached, match2);
          if (verbose)
            console.log(base2 + this.stackID(stack) + ` (via reuse of ${parser3.getName(cached.type.id)})`);
          return true;
        }
        if (!(cached instanceof Tree) || cached.children.length == 0 || cached.positions[0] > 0)
          break;
        let inner = cached.children[0];
        if (inner instanceof Tree && cached.positions[0] == 0)
          cached = inner;
        else
          break;
      }
    }
    let defaultReduce = parser3.stateSlot(
      stack.state,
      4
      /* ParseState.DefaultReduce */
    );
    if (defaultReduce > 0) {
      stack.reduce(defaultReduce);
      if (verbose)
        console.log(base2 + this.stackID(stack) + ` (via always-reduce ${parser3.getName(
          defaultReduce & 65535
          /* Action.ValueMask */
        )})`);
      return true;
    }
    if (stack.stack.length >= 9e3) {
      while (stack.stack.length > 6e3 && stack.forceReduce()) {
      }
    }
    let actions = this.tokens.getActions(stack);
    for (let i2 = 0; i2 < actions.length; ) {
      let action = actions[i2++], term = actions[i2++], end = actions[i2++];
      let last = i2 == actions.length || !split;
      let localStack = last ? stack : stack.split();
      let main = this.tokens.mainToken;
      localStack.apply(action, term, main ? main.start : localStack.pos, end);
      if (verbose)
        console.log(base2 + this.stackID(localStack) + ` (via ${(action & 65536) == 0 ? "shift" : `reduce of ${parser3.getName(
          action & 65535
          /* Action.ValueMask */
        )}`} for ${parser3.getName(term)} @ ${start}${localStack == stack ? "" : ", split"})`);
      if (last)
        return true;
      else if (localStack.pos > start)
        stacks.push(localStack);
      else
        split.push(localStack);
    }
    return false;
  }
  // Advance a given stack forward as far as it will go. Returns the
  // (possibly updated) stack if it got stuck, or null if it moved
  // forward and was given to `pushStackDedup`.
  advanceFully(stack, newStacks) {
    let pos = stack.pos;
    for (; ; ) {
      if (!this.advanceStack(stack, null, null))
        return false;
      if (stack.pos > pos) {
        pushStackDedup(stack, newStacks);
        return true;
      }
    }
  }
  runRecovery(stacks, tokens, newStacks) {
    let finished = null, restarted = false;
    for (let i2 = 0; i2 < stacks.length; i2++) {
      let stack = stacks[i2], token2 = tokens[i2 << 1], tokenEnd = tokens[(i2 << 1) + 1];
      let base2 = verbose ? this.stackID(stack) + " -> " : "";
      if (stack.deadEnd) {
        if (restarted)
          continue;
        restarted = true;
        stack.restart();
        if (verbose)
          console.log(base2 + this.stackID(stack) + " (restarted)");
        let done = this.advanceFully(stack, newStacks);
        if (done)
          continue;
      }
      let force = stack.split(), forceBase = base2;
      for (let j = 0; force.forceReduce() && j < 10; j++) {
        if (verbose)
          console.log(forceBase + this.stackID(force) + " (via force-reduce)");
        let done = this.advanceFully(force, newStacks);
        if (done)
          break;
        if (verbose)
          forceBase = this.stackID(force) + " -> ";
      }
      for (let insert2 of stack.recoverByInsert(token2)) {
        if (verbose)
          console.log(base2 + this.stackID(insert2) + " (via recover-insert)");
        this.advanceFully(insert2, newStacks);
      }
      if (this.stream.end > stack.pos) {
        if (tokenEnd == stack.pos) {
          tokenEnd++;
          token2 = 0;
        }
        stack.recoverByDelete(token2, tokenEnd);
        if (verbose)
          console.log(base2 + this.stackID(stack) + ` (via recover-delete ${this.parser.getName(token2)})`);
        pushStackDedup(stack, newStacks);
      } else if (!finished || finished.score < stack.score) {
        finished = stack;
      }
    }
    return finished;
  }
  // Convert the stack's buffer to a syntax tree.
  stackToTree(stack) {
    stack.close();
    return Tree.build({
      buffer: StackBufferCursor.create(stack),
      nodeSet: this.parser.nodeSet,
      topID: this.topTerm,
      maxBufferLength: this.parser.bufferLength,
      reused: this.reused,
      start: this.ranges[0].from,
      length: stack.pos - this.ranges[0].from,
      minRepeatType: this.parser.minRepeatTerm
    });
  }
  stackID(stack) {
    let id2 = (stackIDs || (stackIDs = /* @__PURE__ */ new WeakMap())).get(stack);
    if (!id2)
      stackIDs.set(stack, id2 = String.fromCodePoint(this.nextStackID++));
    return id2 + stack;
  }
};
function pushStackDedup(stack, newStacks) {
  for (let i2 = 0; i2 < newStacks.length; i2++) {
    let other = newStacks[i2];
    if (other.pos == stack.pos && other.sameState(stack)) {
      if (newStacks[i2].score < stack.score)
        newStacks[i2] = stack;
      return;
    }
  }
  newStacks.push(stack);
}
var Dialect = class {
  constructor(source, flags, disabled) {
    this.source = source;
    this.flags = flags;
    this.disabled = disabled;
  }
  allows(term) {
    return !this.disabled || this.disabled[term] == 0;
  }
};
var id = (x2) => x2;
var ContextTracker = class {
  /**
  Define a context tracker.
  */
  constructor(spec) {
    this.start = spec.start;
    this.shift = spec.shift || id;
    this.reduce = spec.reduce || id;
    this.reuse = spec.reuse || id;
    this.hash = spec.hash || (() => 0);
    this.strict = spec.strict !== false;
  }
};
var LRParser = class _LRParser extends Parser {
  /**
  @internal
  */
  constructor(spec) {
    super();
    this.wrappers = [];
    if (spec.version != 14)
      throw new RangeError(`Parser version (${spec.version}) doesn't match runtime version (${14})`);
    let nodeNames = spec.nodeNames.split(" ");
    this.minRepeatTerm = nodeNames.length;
    for (let i2 = 0; i2 < spec.repeatNodeCount; i2++)
      nodeNames.push("");
    let topTerms = Object.keys(spec.topRules).map((r3) => spec.topRules[r3][1]);
    let nodeProps = [];
    for (let i2 = 0; i2 < nodeNames.length; i2++)
      nodeProps.push([]);
    function setProp(nodeID, prop, value) {
      nodeProps[nodeID].push([prop, prop.deserialize(String(value))]);
    }
    if (spec.nodeProps)
      for (let propSpec of spec.nodeProps) {
        let prop = propSpec[0];
        if (typeof prop == "string")
          prop = NodeProp[prop];
        for (let i2 = 1; i2 < propSpec.length; ) {
          let next2 = propSpec[i2++];
          if (next2 >= 0) {
            setProp(next2, prop, propSpec[i2++]);
          } else {
            let value = propSpec[i2 + -next2];
            for (let j = -next2; j > 0; j--)
              setProp(propSpec[i2++], prop, value);
            i2++;
          }
        }
      }
    this.nodeSet = new NodeSet(nodeNames.map((name2, i2) => NodeType.define({
      name: i2 >= this.minRepeatTerm ? void 0 : name2,
      id: i2,
      props: nodeProps[i2],
      top: topTerms.indexOf(i2) > -1,
      error: i2 == 0,
      skipped: spec.skippedNodes && spec.skippedNodes.indexOf(i2) > -1
    })));
    if (spec.propSources)
      this.nodeSet = this.nodeSet.extend(...spec.propSources);
    this.strict = false;
    this.bufferLength = DefaultBufferLength;
    let tokenArray = decodeArray(spec.tokenData);
    this.context = spec.context;
    this.specializerSpecs = spec.specialized || [];
    this.specialized = new Uint16Array(this.specializerSpecs.length);
    for (let i2 = 0; i2 < this.specializerSpecs.length; i2++)
      this.specialized[i2] = this.specializerSpecs[i2].term;
    this.specializers = this.specializerSpecs.map(getSpecializer);
    this.states = decodeArray(spec.states, Uint32Array);
    this.data = decodeArray(spec.stateData);
    this.goto = decodeArray(spec.goto);
    this.maxTerm = spec.maxTerm;
    this.tokenizers = spec.tokenizers.map((value) => typeof value == "number" ? new TokenGroup(tokenArray, value) : value);
    this.topRules = spec.topRules;
    this.dialects = spec.dialects || {};
    this.dynamicPrecedences = spec.dynamicPrecedences || null;
    this.tokenPrecTable = spec.tokenPrec;
    this.termNames = spec.termNames || null;
    this.maxNode = this.nodeSet.types.length - 1;
    this.dialect = this.parseDialect();
    this.top = this.topRules[Object.keys(this.topRules)[0]];
  }
  createParse(input, fragments, ranges) {
    let parse2 = new Parse(this, input, fragments, ranges);
    for (let w of this.wrappers)
      parse2 = w(parse2, input, fragments, ranges);
    return parse2;
  }
  /**
  Get a goto table entry @internal
  */
  getGoto(state, term, loose = false) {
    let table = this.goto;
    if (term >= table[0])
      return -1;
    for (let pos = table[term + 1]; ; ) {
      let groupTag = table[pos++], last = groupTag & 1;
      let target = table[pos++];
      if (last && loose)
        return target;
      for (let end = pos + (groupTag >> 1); pos < end; pos++)
        if (table[pos] == state)
          return target;
      if (last)
        return -1;
    }
  }
  /**
  Check if this state has an action for a given terminal @internal
  */
  hasAction(state, terminal) {
    let data = this.data;
    for (let set3 = 0; set3 < 2; set3++) {
      for (let i2 = this.stateSlot(
        state,
        set3 ? 2 : 1
        /* ParseState.Actions */
      ), next2; ; i2 += 3) {
        if ((next2 = data[i2]) == 65535) {
          if (data[i2 + 1] == 1)
            next2 = data[i2 = pair(data, i2 + 2)];
          else if (data[i2 + 1] == 2)
            return pair(data, i2 + 2);
          else
            break;
        }
        if (next2 == terminal || next2 == 0)
          return pair(data, i2 + 1);
      }
    }
    return 0;
  }
  /**
  @internal
  */
  stateSlot(state, slot) {
    return this.states[state * 6 + slot];
  }
  /**
  @internal
  */
  stateFlag(state, flag) {
    return (this.stateSlot(
      state,
      0
      /* ParseState.Flags */
    ) & flag) > 0;
  }
  /**
  @internal
  */
  validAction(state, action) {
    return !!this.allActions(state, (a2) => a2 == action ? true : null);
  }
  /**
  @internal
  */
  allActions(state, action) {
    let deflt = this.stateSlot(
      state,
      4
      /* ParseState.DefaultReduce */
    );
    let result = deflt ? action(deflt) : void 0;
    for (let i2 = this.stateSlot(
      state,
      1
      /* ParseState.Actions */
    ); result == null; i2 += 3) {
      if (this.data[i2] == 65535) {
        if (this.data[i2 + 1] == 1)
          i2 = pair(this.data, i2 + 2);
        else
          break;
      }
      result = action(pair(this.data, i2 + 1));
    }
    return result;
  }
  /**
  Get the states that can follow this one through shift actions or
  goto jumps. @internal
  */
  nextStates(state) {
    let result = [];
    for (let i2 = this.stateSlot(
      state,
      1
      /* ParseState.Actions */
    ); ; i2 += 3) {
      if (this.data[i2] == 65535) {
        if (this.data[i2 + 1] == 1)
          i2 = pair(this.data, i2 + 2);
        else
          break;
      }
      if ((this.data[i2 + 2] & 65536 >> 16) == 0) {
        let value = this.data[i2 + 1];
        if (!result.some((v4, i3) => i3 & 1 && v4 == value))
          result.push(this.data[i2], value);
      }
    }
    return result;
  }
  /**
  Configure the parser. Returns a new parser instance that has the
  given settings modified. Settings not provided in `config` are
  kept from the original parser.
  */
  configure(config2) {
    let copy4 = Object.assign(Object.create(_LRParser.prototype), this);
    if (config2.props)
      copy4.nodeSet = this.nodeSet.extend(...config2.props);
    if (config2.top) {
      let info = this.topRules[config2.top];
      if (!info)
        throw new RangeError(`Invalid top rule name ${config2.top}`);
      copy4.top = info;
    }
    if (config2.tokenizers)
      copy4.tokenizers = this.tokenizers.map((t3) => {
        let found = config2.tokenizers.find((r3) => r3.from == t3);
        return found ? found.to : t3;
      });
    if (config2.specializers) {
      copy4.specializers = this.specializers.slice();
      copy4.specializerSpecs = this.specializerSpecs.map((s2, i2) => {
        let found = config2.specializers.find((r3) => r3.from == s2.external);
        if (!found)
          return s2;
        let spec = Object.assign(Object.assign({}, s2), { external: found.to });
        copy4.specializers[i2] = getSpecializer(spec);
        return spec;
      });
    }
    if (config2.contextTracker)
      copy4.context = config2.contextTracker;
    if (config2.dialect)
      copy4.dialect = this.parseDialect(config2.dialect);
    if (config2.strict != null)
      copy4.strict = config2.strict;
    if (config2.wrap)
      copy4.wrappers = copy4.wrappers.concat(config2.wrap);
    if (config2.bufferLength != null)
      copy4.bufferLength = config2.bufferLength;
    return copy4;
  }
  /**
  Tells you whether any [parse wrappers](#lr.ParserConfig.wrap)
  are registered for this parser.
  */
  hasWrappers() {
    return this.wrappers.length > 0;
  }
  /**
  Returns the name associated with a given term. This will only
  work for all terms when the parser was generated with the
  `--names` option. By default, only the names of tagged terms are
  stored.
  */
  getName(term) {
    return this.termNames ? this.termNames[term] : String(term <= this.maxNode && this.nodeSet.types[term].name || term);
  }
  /**
  The eof term id is always allocated directly after the node
  types. @internal
  */
  get eofTerm() {
    return this.maxNode + 1;
  }
  /**
  The type of top node produced by the parser.
  */
  get topNode() {
    return this.nodeSet.types[this.top[1]];
  }
  /**
  @internal
  */
  dynamicPrecedence(term) {
    let prec2 = this.dynamicPrecedences;
    return prec2 == null ? 0 : prec2[term] || 0;
  }
  /**
  @internal
  */
  parseDialect(dialect) {
    let values2 = Object.keys(this.dialects), flags = values2.map(() => false);
    if (dialect)
      for (let part of dialect.split(" ")) {
        let id2 = values2.indexOf(part);
        if (id2 >= 0)
          flags[id2] = true;
      }
    let disabled = null;
    for (let i2 = 0; i2 < values2.length; i2++)
      if (!flags[i2]) {
        for (let j = this.dialects[values2[i2]], id2; (id2 = this.data[j++]) != 65535; )
          (disabled || (disabled = new Uint8Array(this.maxTerm + 1)))[id2] = 1;
      }
    return new Dialect(dialect, flags, disabled);
  }
  /**
  Used by the output of the parser generator. Not available to
  user code. @hide
  */
  static deserialize(spec) {
    return new _LRParser(spec);
  }
};
function pair(data, off) {
  return data[off] | data[off + 1] << 16;
}
function findFinished(stacks) {
  let best = null;
  for (let stack of stacks) {
    let stopped = stack.p.stoppedAt;
    if ((stack.pos == stack.p.stream.end || stopped != null && stack.pos > stopped) && stack.p.parser.stateFlag(
      stack.state,
      2
      /* StateFlag.Accepting */
    ) && (!best || best.score < stack.score))
      best = stack;
  }
  return best;
}
function getSpecializer(spec) {
  if (spec.external) {
    let mask = spec.extend ? 1 : 0;
    return (value, stack) => spec.external(value, stack) << 1 | mask;
  }
  return spec.get;
}

// node_modules/@lezer/python/dist/index.js
var printKeyword = 1;
var indent = 201;
var dedent = 202;
var newline$1 = 203;
var blankLineStart = 204;
var newlineBracketed = 205;
var eof = 206;
var formatString1Content = 207;
var formatString1Brace = 2;
var formatString1End = 208;
var formatString2Content = 209;
var formatString2Brace = 3;
var formatString2End = 210;
var formatString1lContent = 211;
var formatString1lBrace = 4;
var formatString1lEnd = 212;
var formatString2lContent = 213;
var formatString2lBrace = 5;
var formatString2lEnd = 214;
var ParenL = 26;
var ParenthesizedExpression = 27;
var TupleExpression = 51;
var ComprehensionExpression = 52;
var BracketL = 57;
var ArrayExpression = 58;
var ArrayComprehensionExpression = 59;
var BraceL = 61;
var DictionaryExpression = 62;
var DictionaryComprehensionExpression = 63;
var SetExpression = 64;
var SetComprehensionExpression = 65;
var ArgList = 67;
var subscript = 251;
var FormatString = 74;
var importList = 270;
var TypeParamList = 115;
var ParamList = 133;
var SequencePattern = 154;
var MappingPattern = 155;
var PatternArgList = 158;
var newline = 10;
var carriageReturn = 13;
var space = 32;
var tab = 9;
var hash2 = 35;
var parenOpen = 40;
var dot = 46;
var braceOpen = 123;
var singleQuote = 39;
var doubleQuote = 34;
var backslash = 92;
var bracketed = /* @__PURE__ */ new Set([
  ParenthesizedExpression,
  TupleExpression,
  ComprehensionExpression,
  importList,
  ArgList,
  ParamList,
  ArrayExpression,
  ArrayComprehensionExpression,
  subscript,
  SetExpression,
  SetComprehensionExpression,
  FormatString,
  DictionaryExpression,
  DictionaryComprehensionExpression,
  SequencePattern,
  MappingPattern,
  PatternArgList,
  TypeParamList
]);
function isLineBreak(ch) {
  return ch == newline || ch == carriageReturn;
}
var newlines = new ExternalTokenizer((input, stack) => {
  let prev2;
  if (input.next < 0) {
    input.acceptToken(eof);
  } else if (stack.context.depth < 0) {
    if (isLineBreak(input.next))
      input.acceptToken(newlineBracketed, 1);
  } else if (((prev2 = input.peek(-1)) < 0 || isLineBreak(prev2)) && stack.canShift(blankLineStart)) {
    let spaces = 0;
    while (input.next == space || input.next == tab) {
      input.advance();
      spaces++;
    }
    if (input.next == newline || input.next == carriageReturn || input.next == hash2)
      input.acceptToken(blankLineStart, -spaces);
  } else if (isLineBreak(input.next)) {
    input.acceptToken(newline$1, 1);
  }
}, { contextual: true });
var indentation = new ExternalTokenizer((input, stack) => {
  let cDepth = stack.context.depth;
  if (cDepth < 0)
    return;
  let prev2 = input.peek(-1);
  if (prev2 == newline || prev2 == carriageReturn) {
    let depth = 0, chars = 0;
    for (; ; ) {
      if (input.next == space)
        depth++;
      else if (input.next == tab)
        depth += 8 - depth % 8;
      else
        break;
      input.advance();
      chars++;
    }
    if (depth != cDepth && input.next != newline && input.next != carriageReturn && input.next != hash2) {
      if (depth < cDepth)
        input.acceptToken(dedent, -chars);
      else
        input.acceptToken(indent);
    }
  }
});
function IndentLevel(parent, depth) {
  this.parent = parent;
  this.depth = depth;
  this.hash = (parent ? parent.hash + parent.hash << 8 : 0) + depth + (depth << 4);
}
var topIndent2 = new IndentLevel(null, 0);
function countIndent(space2) {
  let depth = 0;
  for (let i2 = 0; i2 < space2.length; i2++)
    depth += space2.charCodeAt(i2) == tab ? 8 - depth % 8 : 1;
  return depth;
}
var trackIndent = new ContextTracker({
  start: topIndent2,
  reduce(context2, term) {
    return context2.depth < 0 && bracketed.has(term) ? context2.parent : context2;
  },
  shift(context2, term, stack, input) {
    if (term == indent)
      return new IndentLevel(context2, countIndent(input.read(input.pos, stack.pos)));
    if (term == dedent)
      return context2.parent;
    if (term == ParenL || term == BracketL || term == BraceL)
      return new IndentLevel(context2, -1);
    return context2;
  },
  hash(context2) {
    return context2.hash;
  }
});
var legacyPrint = new ExternalTokenizer((input) => {
  for (let i2 = 0; i2 < 5; i2++) {
    if (input.next != "print".charCodeAt(i2))
      return;
    input.advance();
  }
  if (/\w/.test(String.fromCharCode(input.next)))
    return;
  for (let off = 0; ; off++) {
    let next2 = input.peek(off);
    if (next2 == space || next2 == tab)
      continue;
    if (next2 != parenOpen && next2 != dot && next2 != newline && next2 != carriageReturn && next2 != hash2)
      input.acceptToken(printKeyword);
    return;
  }
});
function formatString(quote, len, content2, brace, end) {
  return new ExternalTokenizer((input) => {
    let start = input.pos;
    for (; ; ) {
      if (input.next < 0) {
        break;
      } else if (input.next == braceOpen) {
        if (input.peek(1) == braceOpen) {
          input.advance(2);
        } else {
          if (input.pos == start) {
            input.acceptToken(brace, 1);
            return;
          }
          break;
        }
      } else if (input.next == backslash) {
        input.advance();
        if (input.next >= 0)
          input.advance();
      } else if (input.next == quote && (len == 1 || input.peek(1) == quote && input.peek(2) == quote)) {
        if (input.pos == start) {
          input.acceptToken(end, len);
          return;
        }
        break;
      } else {
        input.advance();
      }
    }
    if (input.pos > start)
      input.acceptToken(content2);
  });
}
var formatString1 = formatString(singleQuote, 1, formatString1Content, formatString1Brace, formatString1End);
var formatString2 = formatString(doubleQuote, 1, formatString2Content, formatString2Brace, formatString2End);
var formatString1l = formatString(singleQuote, 3, formatString1lContent, formatString1lBrace, formatString1lEnd);
var formatString2l = formatString(doubleQuote, 3, formatString2lContent, formatString2lBrace, formatString2lEnd);
var pythonHighlighting = styleTags({
  'async "*" "**" FormatConversion FormatSpec': tags.modifier,
  "for while if elif else try except finally return raise break continue with pass assert await yield match case": tags.controlKeyword,
  "in not and or is del": tags.operatorKeyword,
  "from def class global nonlocal lambda": tags.definitionKeyword,
  import: tags.moduleKeyword,
  "with as print": tags.keyword,
  Boolean: tags.bool,
  None: tags.null,
  VariableName: tags.variableName,
  "CallExpression/VariableName": tags.function(tags.variableName),
  "FunctionDefinition/VariableName": tags.function(tags.definition(tags.variableName)),
  "ClassDefinition/VariableName": tags.definition(tags.className),
  PropertyName: tags.propertyName,
  "CallExpression/MemberExpression/PropertyName": tags.function(tags.propertyName),
  Comment: tags.lineComment,
  Number: tags.number,
  String: tags.string,
  FormatString: tags.special(tags.string),
  UpdateOp: tags.updateOperator,
  "ArithOp!": tags.arithmeticOperator,
  BitOp: tags.bitwiseOperator,
  CompareOp: tags.compareOperator,
  AssignOp: tags.definitionOperator,
  Ellipsis: tags.punctuation,
  At: tags.meta,
  "( )": tags.paren,
  "[ ]": tags.squareBracket,
  "{ }": tags.brace,
  ".": tags.derefOperator,
  ", ;": tags.separator
});
var spec_identifier = { __proto__: null, await: 48, or: 58, and: 60, in: 64, not: 66, is: 68, if: 74, else: 76, lambda: 80, yield: 98, from: 100, async: 106, for: 108, None: 168, True: 170, False: 170, del: 184, pass: 188, break: 192, continue: 196, return: 200, raise: 208, import: 212, as: 214, global: 218, nonlocal: 220, assert: 224, type: 229, elif: 242, while: 246, try: 252, except: 254, finally: 256, with: 260, def: 264, class: 274, match: 285, case: 291 };
var parser = LRParser.deserialize({
  version: 14,
  states: "#&jO`Q#yOOP$bOSOOO%kQ&nO'#HcOOQS'#Cq'#CqOOQS'#Cr'#CrO'ZQ#xO'#CpO(|Q&nO'#HbOOQS'#Hc'#HcOOQS'#DW'#DWOOQS'#Hb'#HbO)jQ#xO'#DaO)}Q#xO'#DhO*_Q#xO'#DlOOQS'#Dw'#DwO*rO,UO'#DwO*zO7[O'#DwO+SOWO'#DxO+_O`O'#DxO+jOpO'#DxO+uO!bO'#DxO-wQ&nO'#HSOOQS'#HS'#HSO'ZQ#xO'#HRO/ZQ&nO'#HROOQS'#Ee'#EeO/rQ#xO'#EfOOQS'#HQ'#HQO/|Q#xO'#HPOOQV'#HP'#HPO0XQ#xO'#F]OOQS'#Ge'#GeO0^Q#xO'#F[OOQV'#IY'#IYOOQV'#HO'#HOOOQV'#Ft'#FtQ`Q#yOOO'ZQ#xO'#CsO0lQ#xO'#DPO0sQ#xO'#DTO1RQ#xO'#HgO1cQ&nO'#EYO'ZQ#xO'#EZOOQS'#E]'#E]OOQS'#E_'#E_OOQS'#Ea'#EaO1wQ#xO'#EcO2_Q#xO'#EgO0XQ#xO'#EiO2rQ&nO'#EiO0XQ#xO'#ElO/rQ#xO'#EoO0XQ#xO'#EqO/rQ#xO'#EwO/rQ#xO'#EzO2}Q#xO'#E|O3UQ#xO'#FRO3aQ#xO'#E}O/rQ#xO'#FRO0XQ#xO'#FTO0XQ#xO'#FYO3fQ#xO'#F_P3mO#xO'#G}POOO)CBq)CBqOOQS'#Cg'#CgOOQS'#Ch'#ChOOQS'#Ci'#CiOOQS'#Cj'#CjOOQS'#Ck'#CkOOQS'#Cl'#ClOOQS'#Cn'#CnO'ZQ#xO,59QO'ZQ#xO,59QO'ZQ#xO,59QO'ZQ#xO,59QO'ZQ#xO,59QO'ZQ#xO,59QO3xQ#xO'#DqOOQS,5:[,5:[O4]Q#xO'#HqOOQS,5:_,5:_O4jQMlO,5:_O4oQ&nO,59[O0lQ#xO,59dO0lQ#xO,59dO0lQ#xO,59dO7_Q#xO,59dO7dQ#xO,59dO7kQ#xO,59lO7rQ#xO'#HbO8xQ#xO'#HaOOQS'#Ha'#HaOOQS'#D^'#D^O9aQ#xO,59cO'ZQ#xO,59cO9oQ#xO,59cOOQS,59{,59{O9tQ#xO,5:TO'ZQ#xO,5:TOOQS,5:S,5:SO:SQ#xO,5:SO:XQ#xO,5:ZO'ZQ#xO,5:ZO'ZQ#xO,5:XOOQS,5:W,5:WO:jQ#xO,5:WO:oQ#xO,5:YOOOO'#F|'#F|O:tO,UO,5:cOOQS,5:c,5:cOOOO'#F}'#F}O:|O7[O,5:cO;UQ#xO'#DyOOOW'#GO'#GOO;fOWO,5:dOOQS,5:d,5:dO;UQ#xO'#D}OOO`'#GR'#GRO;qO`O,5:dO;UQ#xO'#EOOOOp'#GS'#GSO;|OpO,5:dO;UQ#xO'#EPOOO!b'#GT'#GTO<XO!bO,5:dOOQS'#GU'#GUO<dQ&nO,5:lO?UQ&nO,5=mO?oQ!LUO,5=mO@`Q&nO,5=mOOQS,5;Q,5;QO@wQ#yO'#G_OBZQ#xO,5;aOOQV,5=k,5=kOBfQ&nO'#ITOB}Q#xO,5;wOOQS-E:c-E:cOOQV,5;v,5;vO3[Q#xO'#FTOOQV-E9r-E9rOCVQ&nO,59_OE^Q&nO,59kOEwQ#xO'#HdOFSQ#xO'#HdO0XQ#xO'#HdOF_Q#xO'#DVOFgQ#xO,59oOFlQ#xO'#HhO'ZQ#xO'#HhO/rQ#xO,5>ROOQS,5>R,5>RO/rQ#xO'#EUOOQS'#EV'#EVOGZQ#xO'#GWOGkQ#xO,59OOGkQ#xO,59OO)pQ#xO,5:rOGyQ&nO'#HjOOQS,5:u,5:uOOQS,5:},5:}OH^Q#xO,5;ROHoQ#xO,5;TOOQS'#GZ'#GZOH}Q&nO,5;TOI]Q#xO,5;TOIbQ#xO'#IWOOQS,5;W,5;WOIpQ#xO'#ISOOQS,5;Z,5;ZOJRQ#xO,5;]O3aQ#xO,5;cO3aQ#xO,5;fOJZQ&nO'#IZO'ZQ#xO'#IZOJeQ#xO,5;hO2}Q#xO,5;hO/rQ#xO,5;mO0XQ#xO,5;oOJjQ#yO'#ExOKvQ#{O,5;iO! [Q#xO'#I[O3aQ#xO,5;mO! gQ#xO,5;oO! oQ#xO,5;tO! zQ&nO,5;yO'ZQ#xO,5;yPOOO,5=i,5=iP!!ROSO,5=iP!!WO#xO,5=iO!${Q&nO1G.lO!%SQ&nO1G.lO!'sQ&nO1G.lO!'}Q&nO1G.lO!*hQ&nO1G.lO!*{Q&nO1G.lO!+`Q#xO'#HpO!+nQ&nO'#HSO/rQ#xO'#HpO!+xQ#xO'#HoOOQS,5:],5:]O!,QQ#xO,5:]O!,VQ#xO'#HrO!,bQ#xO'#HrO!,uQ#xO,5>]OOQS'#Du'#DuOOQS1G/y1G/yOOQS1G/O1G/OO!-uQ&nO1G/OO!-|Q&nO1G/OO0lQ#xO1G/OO!.iQ#xO1G/WOOQS'#D]'#D]O/rQ#xO,59vOOQS1G.}1G.}O!.pQ#xO1G/gO!/QQ#xO1G/gO!/YQ#xO1G/hO'ZQ#xO'#HiO!/_Q#xO'#HiO!/dQ&nO1G.}O!/tQ#xO,59kO!0zQ#xO,5>XO!1[Q#xO,5>XO!1dQ#xO1G/oO!1iQ&nO1G/oOOQS1G/n1G/nO!1yQ#xO,5>SO!2pQ#xO,5>SO/rQ#xO1G/sO!3_Q#xO1G/uO!3dQ&nO1G/uO!3tQ&nO1G/sOOQS1G/r1G/rOOQS1G/t1G/tOOOO-E9z-E9zOOQS1G/}1G/}OOOO-E9{-E9{O!4UQ#xO'#H|O/rQ#xO'#H|O!4dQ#xO,5:eOOOW-E9|-E9|OOQS1G0O1G0OO!4oQ#xO,5:iOOO`-E:P-E:PO!4zQ#xO,5:jOOOp-E:Q-E:QO!5VQ#xO,5:kOOO!b-E:R-E:ROOQS-E:S-E:SO!5bQ!LUO1G3XO!6RQ&nO1G3XO'ZQ#xO,5<qOOQS,5<q,5<qOOQS-E:T-E:TOOQS,5<y,5<yOOQS-E:]-E:]OOQV1G0{1G0{O0XQ#xO'#GYO!6jQ&nO,5>oOOQS1G1c1G1cO!7RQ#xO1G1cOOQS'#DX'#DXO/rQ#xO,5>OOOQS,5>O,5>OO!7WQ#xO'#FuO!7cQ#xO,59qO!7kQ#xO1G/ZO!7uQ&nO,5>SOOQS1G3m1G3mOOQS,5:p,5:pO!8fQ#xO'#HROOQS,5<r,5<rOOQS-E:U-E:UO!8wQ#xO1G.jOOQS1G0^1G0^O!9VQ#xO,5>UO!9gQ#xO,5>UO/rQ#xO1G0mO/rQ#xO1G0mO0XQ#xO1G0oOOQS-E:X-E:XO!9xQ#xO1G0oO!:TQ#xO1G0oO!:YQ#xO,5>rO!:hQ#xO,5>rO!:vQ#xO,5>nO!;^Q#xO,5>nO!;oQ#xO'#EsO/rQ#xO1G0wO!;zQ#xO1G0wO!<PQ#{O1G0}O!?bQ#{O1G1QO!BpQ#xO,5>uO!BzQ#xO,5>uO!CSQ&nO,5>uO/rQ#xO1G1SO!C^Q#xO1G1SO3aQ#xO1G1XO! gQ#xO1G1ZOOQV,5;d,5;dO!CcQ#zO,5;dO!ChQ#{O1G1TO!F|Q#xO'#GbO3aQ#xO1G1TO3aQ#xO1G1TO!G^Q#xO,5>vO!GkQ#xO,5>vO0XQ#xO,5>vOOQV1G1X1G1XO!GsQ#xO'#FVO!HUQMlO1G1ZO!H^Q#xO1G1ZOOQV1G1`1G1`O3aQ#xO1G1`O!HcQ#xO1G1`O!HkQ#xO'#FaOOQV1G1e1G1eO! zQ&nO1G1ePOOO1G3T1G3TP!HpOSO1G3TOOQS,5>[,5>[OOQS'#Dr'#DrO/rQ#xO,5>[O!HuQ#xO,5>ZO!IYQ#xO,5>ZOOQS1G/w1G/wO!IbQ#xO,5>^O!IrQ#xO,5>^O!IzQ#xO,5>^O!J_Q#xO,5>^O!JoQ#xO,5>^OOQS1G3w1G3wOOQS7+$j7+$jO!7kQ#xO7+$rO!LbQ#xO1G/OO!LiQ#xO1G/OOOQS1G/b1G/bOOQS,5<c,5<cO'ZQ#xO,5<cOOQS7+%R7+%RO!LpQ#xO7+%ROOQS-E9u-E9uOOQS7+%S7+%SO!MQQ#xO,5>TO'ZQ#xO,5>TOOQS7+$i7+$iO!MVQ#xO7+%RO!M_Q#xO7+%SO!MdQ#xO1G3sOOQS7+%Z7+%ZO!MtQ#xO1G3sO!M|Q#xO7+%ZOOQS,5<b,5<bO'ZQ#xO,5<bO!NRQ#xO1G3nOOQS-E9t-E9tO!NxQ#xO7+%_OOQS7+%a7+%aO# WQ#xO1G3nO# uQ#xO7+%aO# zQ#xO1G3tO#![Q#xO1G3tO#!dQ#xO7+%_O#!iQ#xO,5>hO##PQ#xO,5>hO##PQ#xO,5>hO##_O$ISO'#D{O##jO#tO'#H}OOOW1G0P1G0PO##oQ#xO1G0POOO`1G0T1G0TO##wQ#xO1G0TOOOp1G0U1G0UO#$PQ#xO1G0UOOO!b1G0V1G0VO#$XQ#xO1G0VO#$aQ!LUO7+(sO#%QQ&nO1G2]P#%kQ#xO'#GVOOQS,5<t,5<tOOQS-E:W-E:WOOQS7+&}7+&}OOQS1G3j1G3jOOQS,5<a,5<aOOQS-E9s-E9sOOQS7+$u7+$uO#%xQ#xO,5=mO#&cQ#xO,5=mO#&tQ&nO,5<dO#'XQ#xO1G3pOOQS-E9v-E9vOOQS7+&X7+&XO#'iQ#xO7+&XOOQS7+&Z7+&ZO#'wQ#xO'#IVO0XQ#xO'#IUO#(]Q#xO7+&ZOOQS,5<w,5<wO#(hQ#xO1G4^OOQS-E:Z-E:ZOOQS,5<s,5<sO#(vQ#xO1G4YOOQS-E:V-E:VO0XQ#xO'#EtO#)^Q#xO'#EtO#)iQ#xO'#IXO#)qQ#xO,5;_OOQS7+&c7+&cO/rQ#xO7+&cO#)vQ#{O7+&iO!GPQ#xO'#G`O3aQ#xO7+&iO3aQ#xO7+&lO#-XQ&nO,5<{O'ZQ#xO,5<{O#-cQ#xO1G4aOOQS-E:_-E:_O#-mQ#xO1G4aO3aQ#xO7+&nO/rQ#xO7+&nOOQV7+&s7+&sO!HUQMlO7+&uO!H^Q#xO7+&uO`Q#yO1G1OOOQV-E:`-E:`O3aQ#xO7+&oO3aQ#xO7+&oOOQV,5<|,5<|O#-uQ#xO,5<|O!GPQ#xO,5<|OOQV7+&o7+&oO#.QQ#{O7+&oO#1`Q#xO,5<}O#1kQ#xO1G4bOOQS-E:a-E:aO#1xQ#xO1G4bO#2QQ#xO'#I^O#2`Q#xO'#I^O0XQ#xO'#I^OOQS'#I^'#I^O#2kQ#xO'#I]OOQS,5;q,5;qO#2sQ#xO,5;qO/rQ#xO'#FXOOQV7+&u7+&uO3aQ#xO7+&uOOQV7+&z7+&zO3aQ#xO7+&zO#2xQ#zO,5;{OOQV7+'P7+'PPOOO7+(o7+(oO#2}Q#xO1G3vOOQS,5<f,5<fO#3]Q#xO1G3uOOQS-E9x-E9xO#3pQ#xO,5<gO#3{Q#xO,5<gO#4`Q#xO1G3xOOQS-E9y-E9yO#4pQ#xO1G3xO#4xQ#xO1G3xO#5YQ#xO1G3xO#4pQ#xO1G3xOOQS<<H^<<H^O#5eQ&nO1G1}OOQS<<Hm<<HmP#5rQ#xO'#FwO7kQ#xO1G3oO#6PQ#xO1G3oO#6UQ#xO<<HmOOQS<<Hn<<HnO#6fQ#xO7+)_OOQS<<Hu<<HuO#6vQ&nO1G1|P#7gQ#xO'#FvO#7tQ#xO7+)`O#8UQ#xO7+)`O#8^Q#xO<<HyO#8cQ#xO7+)YOOQS<<H{<<H{O#9YQ#xO,5<eO'ZQ#xO,5<eOOQS-E9w-E9wOOQS<<Hy<<HyOOQS,5<k,5<kO/rQ#xO,5<kO#9_Q#xO1G4SOOQS-E9}-E9}O#9uQ#xO1G4SO;UQ#xO'#D|OOOO'#GQ'#GQO#:TO$ISO,5:gOOO#l,5>i,5>iOOOW7+%k7+%kOOO`7+%o7+%oOOOp7+%p7+%pOOO!b7+%q7+%qO#:`Q#xO1G3XO#:yQ#xO1G3XP'ZQ#xO'#FxO/rQ#xO<<IsO#;[Q#xO,5>qO#;mQ#xO,5>qO0XQ#xO,5>qO#<OQ#xO,5>pOOQS<<Iu<<IuP0XQ#xO'#G]P/rQ#xO'#GXOOQS,5;`,5;`O#<TQ#xO,5>sO#<cQ#xO,5>sOOQS1G0y1G0yOOQS<<I}<<I}OOQV-E:^-E:^O3aQ#xO<<JTOOQV,5<z,5<zO3aQ#xO,5<zOOQV<<JT<<JTOOQV<<JW<<JWO#<kQ&nO1G2gP#<uQ#xO'#GaO#<|Q#xO7+){O#=WQ#{O<<JYO3aQ#xO<<JYOOQV<<Ja<<JaO3aQ#xO<<JaO!HUQMlO<<JaO#@fQ#{O7+&jOOQV<<JZ<<JZO#@pQ#{O<<JZOOQV1G2h1G2hO0XQ#xO1G2hO#DOQ#xO1G2hO3aQ#xO<<JZO0XQ#xO1G2iP/rQ#xO'#GcO#DZQ#xO7+)|O#DhQ#xO7+)|OOQS'#FW'#FWO/rQ#xO,5>xO#DpQ#xO,5>xOOQS,5>x,5>xO#D{Q#xO,5>wO#E^Q#xO,5>wOOQS1G1]1G1]OOQS,5;s,5;sOOQV<<Jf<<JfO#EfQ#xO1G1gOOQS7+)b7+)bP#EkQ#xO'#FzO#E{Q#xO1G2RO#F`Q#xO1G2RO#FpQ#xO1G2RP#F{Q#xO'#F{O#GYQ#xO7+)dO#GjQ#xO7+)dO#GjQ#xO7+)dO#GrQ#xO7+)dO#HSQ#xO7+)ZO7kQ#xO7+)ZOOQSAN>XAN>XO#HmQ#xO<<LzOOQSAN>eAN>eO/rQ#xO1G2PO#H}Q&nO1G2PP#IXQ#xO'#FyOOQS1G2V1G2VP#IfQ#xO'#GPO#IsQ#xO7+)nO#JZQ#xO,5:hOOOO-E:O-E:OO#JfQ#xO7+(sOOQSAN?_AN?_O#KPQ#xO,5<vO#KeQ#xO1G4]OOQS-E:Y-E:YO#KvQ#xO1G4]OOQS1G4[1G4[OOQS,5<x,5<xO#LXQ#xO1G4_OOQS-E:[-E:[OOQVAN?oAN?oOOQV1G2f1G2fO3aQ#xOAN?tO#LgQ#{OAN?tOOQVAN?{AN?{O3aQ#xOAN?{OOQV<<JU<<JUO3aQ#xOAN?uO3aQ#xO7+(SOOQV7+(S7+(SO0XQ#xO7+(SOOQVAN?uAN?uOOQS7+(T7+(TO$ uQ#xO<<MhOOQS1G4d1G4dO/rQ#xO1G4dOOQS,5=O,5=OO$!SQ#xO1G4cOOQS-E:b-E:bOOQU'#Gf'#GfO$!eQ#zO7+'RO$!pQ#xO'#FbO$#hQ#xO7+'mO$#xQ#xO7+'mOOQS7+'m7+'mO$$TQ#xO<<MOO$$eQ#xO<<MOO$$eQ#xO<<MOO$$mQ#xO'#HkOOQS<<Lu<<LuO$$wQ#xO<<LuOOQS7+'k7+'kOOOO1G0S1G0SO$%bQ#xO1G0SO0XQ#xO1G2bP0XQ#xO'#G[O$%jQ#xO7+)wO$%{Q#xO7+)wP!;oQ#xO'#G^OOQVG25`G25`O3aQ#xOG25`OOQVG25gG25gOOQVG25aG25aOOQV<<Kn<<KnO3aQ#xO<<KnOOQS7+*O7+*OP$&^Q#xO'#GdOOQU-E:d-E:dOOQV<<Jm<<JmO$'QQ&nO'#FdOOQS'#Ff'#FfO$'bQ#xO'#FeO$(SQ#xO'#FeOOQS'#Fe'#FeO$(XQ#xO'#I`O$!pQ#xO'#FlO$!pQ#xO'#FlO$(pQ#xO'#FmO$!pQ#xO'#FnO$(wQ#xO'#IaOOQS'#Ia'#IaO$)fQ#xO,5;|OOQS<<KX<<KXO$)nQ#xO<<KXO$*OQ#xOANBjO$*`Q#xOANBjO$*hQ#xO'#HlOOQS'#Hl'#HlO0sQ#xO'#DeO$+RQ#xO,5>VOOQSANBaANBaOOOO7+%n7+%nOOQS7+'|7+'|O$+jQ#xO<<McOOQVLD*zLD*zOOQVANAYANAYO4jQMlO'#GhO$+{Q&nO,5<VO$!pQ#xO'#FpOOQS,5<Z,5<ZOOQS'#Fg'#FgO$,mQ#xO,5<PO$,rQ#xO,5<POOQS'#Fj'#FjO$!pQ#xO'#GgO$-dQ#xO,5<TO$.OQ#xO,5>zO$.`Q#xO,5>zO0XQ#xO,5<SO$.qQ#xO,5<WO$.vQ#xO,5<WO$!pQ#xO'#IbO$.{Q#xO'#IbO$/QQ#xO,5<XOOQS,5<Y,5<YO'ZQ#xO'#FsOOQU1G1h1G1hO3aQ#xO1G1hOOQSAN@sAN@sO$/VQ#xOG28UO$/gQ#xO,5:POOQS1G3q1G3qOOQS,5=S,5=SOOQS-E:f-E:fO$/lQ&nO'#FdO$/sQ#xO'#IcO$0RQ#xO'#IcO$0ZQ#xO,5<[OOQS1G1k1G1kO$0`Q#xO1G1kO$0eQ#xO,5=ROOQS-E:e-E:eO$1PQ#xO,5=VO$1hQ#xO1G4fOOQS-E:i-E:iOOQS1G1n1G1nOOQS1G1r1G1rO$1xQ#xO,5>|O$!pQ#xO,5>|OOQS1G1s1G1sO$2WQ&nO,5<_OOQU7+'S7+'SO$$mQ#xO1G/kO$!pQ#xO,5<]O$2_Q#xO,5>}O$2fQ#xO,5>}OOQS1G1v1G1vOOQS7+'V7+'VP$!pQ#xO'#GkO$2nQ#xO1G4hO$2xQ#xO1G4hO$3QQ#xO1G4hOOQS7+%V7+%VO$3`Q#xO1G1wO$3nQ&nO'#FdO$3uQ#xO,5=UOOQS,5=U,5=UO$4TQ#xO1G4iOOQS-E:h-E:hO$!pQ#xO,5=TO$4[Q#xO,5=TO$4aQ#xO7+*SOOQS-E:g-E:gO$4kQ#xO7+*SO$!pQ#xO,5<^P$!pQ#xO'#GjO$4sQ#xO1G2oO$!pQ#xO1G2oP$5RQ#xO'#GiO$5YQ#xO<<MnO$5dQ#xO1G1xO$5rQ#xO7+(ZO7kQ#xO'#DPO7kQ#xO,59dO7kQ#xO,59dO7kQ#xO,59dO$6QQ&nO,5=mO7kQ#xO1G/OO/rQ#xO1G/ZO/rQ#xO7+$rP$6eQ#xO'#GVO'ZQ#xO'#HRO$6rQ#xO,59dO$6wQ#xO,59dO$7OQ#xO,59oO$7TQ#xO1G/WO0sQ#xO'#DTO7kQ#xO,59l",
  stateData: "$7f~O%pOS%eOSUOS%dPQ~OPiOXfOhtOjYOquOu!UOxvO!RwO!S!QO!V!XO!W!WO!ZZO!_[O!jeO!ueO!veO!weO#OyO#QzO#S{O#U|O#W}O#[!OO#^!PO#a!RO#b!RO#d!SO#f!TO#o!VO#r!YO#v!ZO#x![O#}!]O$QmO$S!^O%|RO%}RO&RSO&SWO&h]O&i^O&l_O&o`O&saO&tbO&ucO~O%d!_O~OX!fOa!fOc!gOj!nO!Z!pO!h!rO%w!aO%x!bO%y!cO%z!dO%{!dO%|!eO%}!eO&O!fO&P!fO&Q!fO~Om&VXn&VXo&VXp&VXq&VXr&VXu&VX|&VX}&VX!{&VX#j&VX%c&VX%f&VX&X&VXi&VX!V&VX!W&VX&Y&VX!Y&VX!^&VX!S&VX#_&VXv&VX!n&VX~P$gOhtOjYO!ZZO!_[O!jeO!ueO!veO!weO%|RO%}RO&RSO&SWO&h]O&i^O&l_O&o`O&saO&tbO&ucO~O|&UX}&UX#j&UX%c&UX%f&UX&X&UX~Om!uOn!vOo!tOp!tOq!wOr!xOu!yO!{&UX~P(hOX#POi#ROq0zOx1YO!RwO~P'ZOX#TOq0zOx1YO!Y#UO~P'ZOX#XOc#YOq0zOx1YO!^#ZO~P'ZO&j#^O&k#`O~O&m#aO&n#`O~OQ#cO%g#dO%h#fO~OR#gO%i#hO%j#fO~OS#jO%k#kO%l#fO~OT#mO%m#nO%n#fO~OX%vXa%vXc%vXj%vXm%vXn%vXo%vXp%vXq%vXr%vXu%vX|%vX!Z%vX!h%vX%w%vX%x%vX%y%vX%z%vX%{%vX%|%vX%}%vX&O%vX&P%vX&Q%vXi%vX!V%vX!W%vX~O&h]O&i^O&l_O&o`O&saO&tbO&ucO}%vX!{%vX#j%vX%c%vX%f%vX&X%vX&Y%vX!Y%vX!^%vX!S%vX#_%vXv%vX!n%vX~P,QO|#sO}%uX!{%uX#j%uX%c%uX%f%uX&X%uX~Oq0zOx1YO~P'ZO#j#vO%c#xO%f#xO~O&SWO~O!V#}O#x![O#}!]O$QmO~OquO~P'ZOX$SOc$TO&SWO}yP~OX$XOq0zOx1YO!S$YO~P'ZO}$[O!{$aO&X$]O#j!|X%c!|X%f!|X~OX$XOq0zOx1YO#j#VX%c#VX%f#VX~P'ZOq0zOx1YO#j#ZX%c#ZX%f#ZX~P'ZO!h$gO!u$gO&SWO~OX$rO~P'ZO!W$tO#v$uO#x$vO~O}$wO~OX%OO~P'ZOU%QO%c%PO%p%RO~OX%[Oc%[Oi%^Oq0zOx1YO~P'ZOq0zOx1YO}%aO~P'ZO&g%cO~Oc!gOj!nO!Z!pO!h!rOXdaadamdandaodapdaqdardauda|da}da!{da#jda%cda%fda%wda%xda%yda%zda%{da%|da%}da&Oda&Pda&Qda&Xdaida!Vda!Wda&Yda!Yda!^da!Sda#_davda!nda~Op%hO~Oq%hO~P'ZOq0zO~P'ZOm0|On0}Oo0{Op0{Oq1UOr1VOu1ZOi&UX!V&UX!W&UX&Y&UX!Y&UX!^&UX!S&UX#_&UX!n&UX~P(hO&Y%jOi&TX|&TX!V&TX!W&TX!Y&TX}&TX~Oi%lO|%mO!V%qO!W%pO~Oi%lO~O|%tO!V%qO!W%pO!Y&aX~O!Y%xO~O|%yO}%{O!V%qO!W%pO!^&[X~O!^&PO~O!^&QO~O&j#^O&k&SO~O&m#aO&n&SO~OX&VOq0zOx1YO!RwO~P'ZOQ#cO%g#dO%h&YO~OR#gO%i#hO%j&YO~OS#jO%k#kO%l&YO~OT#mO%m#nO%n&YO~OX!taa!tac!taj!tam!tan!tao!tap!taq!tar!tau!ta|!ta}!ta!Z!ta!h!ta!{!ta#j!ta%c!ta%f!ta%w!ta%x!ta%y!ta%z!ta%{!ta%|!ta%}!ta&O!ta&P!ta&Q!ta&X!tai!ta!V!ta!W!ta&Y!ta!Y!ta!^!ta!S!ta#_!tav!ta!n!ta~P#yO|&bO}%ua!{%ua#j%ua%c%ua%f%ua&X%ua~P$gOX&dOquOxvO}%ua!{%ua#j%ua%c%ua%f%ua&X%ua~P'ZO|&bO}%ua!{%ua#j%ua%c%ua%f%ua&X%ua~OPiOXfOquOxvO!RwO!S!QO#OyO#QzO#S{O#U|O#W}O#[!OO#^!PO#a!RO#b!RO#d!SO#f!TO#j%RX%c%RX%f%RX~P'ZO#j#vO%c&iO%f&iO~O!h&jOj&wX%c&wX#_&wX#j&wX%f&wX#^&wX~Oj!nO%c&lO~Omgangaogapgaqgargauga|ga}ga!{ga#jga%cga%fga&Xgaiga!Vga!Wga&Yga!Yga!^ga!Sga#_gavga!nga~P$gOusa|sa}sa#jsa%csa%fsa&Xsa~Om!uOn!vOo!tOp!tOq!wOr!xO!{sa~PDuO&X&nO|&WX}&WX~O&SWO|&WX}&WX~O|&qO}yX~O}&sO~O|%yO#j&[X%c&[X%f&[Xi&[X}&[X!^&[X!n&[X&X&[X~OX1TOq0zOx1YO!RwO~P'ZO&X$]O#jWa%cWa%fWa~O|&|O#j&^X%c&^X%f&^Xp&^X~P$gO|'PO!S'OO#j#Za%c#Za%f#Za~O#_'QO#j#]a%c#]a%f#]a~O!h$gO!u$gO#^'SO&SWO~O#^'SO~O|'UO#j&zX%c&zX%f&zX~O|'WO#j&vX%c&vX%f&vX}&vX~O!Z'YO&X'ZO~O|'_Op&}X~P$gOp'bO~OPiOXfOquOxvO!RwO!S!QO#OyO#QzO#S{O#U|O#W}O#[!OO#^!PO#a!RO#b!RO#d!SO#f!TO%c'gO~P'ZOv'kO#s'iO#t'jOP#qaX#qah#qaj#qaq#qau#qax#qa!R#qa!S#qa!V#qa!W#qa!Z#qa!_#qa!j#qa!u#qa!v#qa!w#qa#O#qa#Q#qa#S#qa#U#qa#W#qa#[#qa#^#qa#a#qa#b#qa#d#qa#f#qa#o#qa#r#qa#v#qa#x#qa#}#qa$Q#qa$S#qa%`#qa%|#qa%}#qa&R#qa&S#qa&h#qa&i#qa&l#qa&o#qa&s#qa&t#qa&u#qa%b#qa%f#qa~O|'lO#_'nO}'OX~Oj'pO!Z'YO~Oj!nO}$wO!Z'YO~O}'vO~P$gO%c'yO~OU'zO%c'yO~OX!fOa!fOc!gOj!nO!Z!pO!h!rO%y!cO%z!dO%{!dO%|!eO%}!eO&O!fO&P!fO&Q!fOmYinYioYipYiqYirYiuYi|Yi}Yi!{Yi#jYi%cYi%fYi%wYi&XYiiYi!VYi!WYi&YYi!YYi!^Yi!SYi#_YivYi!nYi~O%x!bO~P!!`O%xYi~P!!`OX!fOa!fOc!gOj!nO!Z!pO!h!rO%|!eO%}!eO&O!fO&P!fO&Q!fOmYinYioYipYiqYirYiuYi|Yi}Yi!{Yi#jYi%cYi%fYi%wYi%xYi%yYi&XYiiYi!VYi!WYi&YYi!YYi!^Yi!SYi#_YivYi!nYi~O%z!dO%{!dO~P!%ZO%zYi%{Yi~P!%ZOc!gOj!nO!Z!pO!h!rOmYinYioYipYiqYirYiuYi|Yi}Yi!{Yi#jYi%cYi%fYi%wYi%xYi%yYi%zYi%{Yi%|Yi%}Yi&XYiiYi!VYi!WYi&YYi!YYi!^Yi!SYi#_YivYi!nYi~OX!fOa!fO&O!fO&P!fO&Q!fO~P!(XOXYiaYi&OYi&PYi&QYi~P!(XO!V%qO!W%pOi&dX|&dX~O&X'|O&Y'|O~P,QO|(OOi&cX~Oi(QO~O|(RO}(TO!Y&fX~Oq0zOx1YO|(RO}(UO!Y&fX~P'ZO!Y(WO~Oo!tOp!tOq!wOr!xOmliuli|li}li!{li#jli%cli%fli&Xli~On!vO~P!,zOnli~P!,zOm0|On0}Oo0{Op0{Oq1UOr1VO~Ov(YO~P!.TOX(_Oi(`Oq0zOx1YO~P'ZOi(`O|(aO~Oi(cO~O!W(eO~Oi(fO|(aO!V%qO!W%pO~P$gOm0|On0}Oo0{Op0{Oq1UOr1VOisa!Vsa!Wsa&Ysa!Ysa!^sa!Ssa#_savsa!nsa~PDuOX(_Oq0zOx1YO!Y&aa~P'ZO|(iO!Y&aa~O!Y(jO~O|(iO!V%qO!W%pO!Y&aa~P$gOX(nOq0zOx1YO!^&[a#j&[a%c&[a%f&[ai&[a}&[a!n&[a&X&[a~P'ZO|(oO!^&[a#j&[a%c&[a%f&[ai&[a}&[a!n&[a&X&[a~O!^(rO~O|(oO!V%qO!W%pO!^&[a~P$gO|(uO!V%qO!W%pO!^&ba~P$gO|(xO}&pX!^&pX!n&pX~O}({O!^(}O!n)OO~O}({O!^)PO!n)QO~O}({O!^)RO!n)SO~O}({O!^)TO!n)UO~OX&dOquOxvO}%ui!{%ui#j%ui%c%ui%f%ui&X%ui~P'ZO|)VO}%ui!{%ui#j%ui%c%ui%f%ui&X%ui~O!h&jOj&wa%c&wa#_&wa#j&wa%f&wa#^&wa~O%c)[O~OX$SOc$TO&SWO~O|&qO}ya~OquOxvO~P'ZO|(oO#j&[a%c&[a%f&[ai&[a}&[a!^&[a!n&[a&X&[a~P$gO|)aO#j%uX%c%uX%f%uX&X%uX~O&X$]O#jWi%cWi%fWi~O#j&^a%c&^a%f&^ap&^a~P'ZO|)dO#j&^a%c&^a%f&^ap&^a~OX)hOj)jO&SWO~O#^)kO~O&SWO#j&za%c&za%f&za~O|)mO#j&za%c&za%f&za~Oq0zOx1YO#j&va%c&va%f&va}&va~P'ZO|)pO#j&va%c&va%f&va}&va~OX)rOc)rO&SWO~O&X)wO~Ov)zO#m)yOP#kiX#kih#kij#kiq#kiu#kix#ki!R#ki!S#ki!V#ki!W#ki!Z#ki!_#ki!j#ki!u#ki!v#ki!w#ki#O#ki#Q#ki#S#ki#U#ki#W#ki#[#ki#^#ki#a#ki#b#ki#d#ki#f#ki#o#ki#r#ki#v#ki#x#ki#}#ki$Q#ki$S#ki%`#ki%|#ki%}#ki&R#ki&S#ki&h#ki&i#ki&l#ki&o#ki&s#ki&t#ki&u#ki%b#ki%f#ki~Ov){OP#niX#nih#nij#niq#niu#nix#ni!R#ni!S#ni!V#ni!W#ni!Z#ni!_#ni!j#ni!u#ni!v#ni!w#ni#O#ni#Q#ni#S#ni#U#ni#W#ni#[#ni#^#ni#a#ni#b#ni#d#ni#f#ni#o#ni#r#ni#v#ni#x#ni#}#ni$Q#ni$S#ni%`#ni%|#ni%}#ni&R#ni&S#ni&h#ni&i#ni&l#ni&o#ni&s#ni&t#ni&u#ni%b#ni%f#ni~OX)}Op&}a~P'ZO|*OOp&}a~O|*OOp&}a~P$gOp*SO~O%a*WO~Ov*ZO#s'iO#t*YOP#qiX#qih#qij#qiq#qiu#qix#qi!R#qi!S#qi!V#qi!W#qi!Z#qi!_#qi!j#qi!u#qi!v#qi!w#qi#O#qi#Q#qi#S#qi#U#qi#W#qi#[#qi#^#qi#a#qi#b#qi#d#qi#f#qi#o#qi#r#qi#v#qi#x#qi#}#qi$Q#qi$S#qi%`#qi%|#qi%}#qi&R#qi&S#qi&h#qi&i#qi&l#qi&o#qi&s#qi&t#qi&u#qi%b#qi%f#qi~OX*^Oq0zOx1YO}$wO~P'ZOq0zOx1YO}'Oa~P'ZO|*bO}'Oa~OX*fOc*gOi*jO&O*hO&SWO~O}$wO'R*lO~Oj'pO~Oj!nO}$wO~O%c*qO~O%c*sO~OX%[Oc%[Oq0zOx1YOi&ca~P'ZO|*vOi&ca~Oq0zOx1YO}*yO!Y&fa~P'ZO|*zO!Y&fa~Oq0zOx1YO|*zO}*}O!Y&fa~P'ZOq0zOx1YO|*zO!Y&fa~P'ZO|*zO}*}O!Y&fa~Oo0{Op0{Oq1UOr1VOilimliuli|li!Vli!Wli&Yli!Yli}li!^li#jli%cli%fli!Sli#_livli!nli&Xli~On0}O~P!JzOnli~P!JzOX(_Oi+SOq0zOx1YO~P'ZOp+UO~Oi+SO|+WO~Oi+XO~OX(_Oq0zOx1YO!Y&ai~P'ZO|+YO!Y&ai~O!Y+ZO~OX(nOq0zOx1YO!^&[i#j&[i%c&[i%f&[ii&[i}&[i!n&[i&X&[i~P'ZO|+^O!V%qO!W%pO!^&bi~O|+aO!^&[i#j&[i%c&[i%f&[ii&[i}&[i!n&[i&X&[i~O!^+bO~Oc+dOq0zOx1YO!^&bi~P'ZO|+^O!^&bi~O!^+fO~OX+hOq0zOx1YO}&pa!^&pa!n&pa~P'ZO|+iO}&pa!^&pa!n&pa~O!_+lO&r+mO!^!oX~O!^+oO~O}({O!^+pO~O}({O!^+qO~O}({O!^+rO~O}({O!^+sO~OX&dOquOxvO}%uq!{%uq#j%uq%c%uq%f%uq&X%uq~P'ZO|$yi}$yi!{$yi#j$yi%c$yi%f$yi&X$yi~P$gOX&dOquOxvO~P'ZOX&dOq0zOx1YO#j%ua%c%ua%f%ua&X%ua~P'ZO|+tO#j%ua%c%ua%f%ua&X%ua~O|$la#j$la%c$la%f$lap$la~P$gO#j&^i%c&^i%f&^ip&^i~P'ZO|+wO#j#Zq%c#Zq%f#Zq~O|+xO#_+zO#j&yX%c&yX%f&yXi&yX~OX+|Oj)jO&SWO~O&SWO#j&zi%c&zi%f&zi~Oq0zOx1YO#j&vi%c&vi%f&vi}&vi~P'ZO}$[O|#hX!Y#hX~O|,QO!Y&{X~O!Y,SO~Ov,VO#m)yOP#kqX#kqh#kqj#kqq#kqu#kqx#kq!R#kq!S#kq!V#kq!W#kq!Z#kq!_#kq!j#kq!u#kq!v#kq!w#kq#O#kq#Q#kq#S#kq#U#kq#W#kq#[#kq#^#kq#a#kq#b#kq#d#kq#f#kq#o#kq#r#kq#v#kq#x#kq#}#kq$Q#kq$S#kq%`#kq%|#kq%}#kq&R#kq&S#kq&h#kq&i#kq&l#kq&o#kq&s#kq&t#kq&u#kq%b#kq%f#kq~Op%Ta|%Ta~P$gOX)}Op&}i~P'ZO|,^Op&}i~O|,hO}$wO#_,hO~O#t,jOP#qqX#qqh#qqj#qqq#qqu#qqx#qq!R#qq!S#qq!V#qq!W#qq!Z#qq!_#qq!j#qq!u#qq!v#qq!w#qq#O#qq#Q#qq#S#qq#U#qq#W#qq#[#qq#^#qq#a#qq#b#qq#d#qq#f#qq#o#qq#r#qq#v#qq#x#qq#}#qq$Q#qq$S#qq%`#qq%|#qq%}#qq&R#qq&S#qq&h#qq&i#qq&l#qq&o#qq&s#qq&t#qq&u#qq%b#qq%f#qq~O#_,kO|%Va}%Va~Oq0zOx1YO}'Oi~P'ZO|,mO}'Oi~O}$[O&X,oOi'QX|'QX~O&SWOi'QX|'QX~O|,sOi'PX~Oi,uO~O%a,xO~O!V%qO!W%pOi&di|&di~OX%[Oc%[Oq0zOx1YOi&ci~P'ZO},{O|$oa!Y$oa~Oq0zOx1YO},|O|$oa!Y$oa~P'ZOq0zOx1YO}*yO!Y&fi~P'ZO|-PO!Y&fi~Oq0zOx1YO|-PO!Y&fi~P'ZO|-PO}-SO!Y&fi~Oi$ki|$ki!Y$ki~P$gOX(_Oq0zOx1YO~P'ZOp-UO~OX(_Oi-VOq0zOx1YO~P'ZOX(_Oq0zOx1YO!Y&aq~P'ZO|$ji!^$ji#j$ji%c$ji%f$jii$ji}$ji!n$ji&X$ji~P$gOX(nOq0zOx1YO~P'ZOc+dOq0zOx1YO!^&bq~P'ZO|-WO!^&bq~O!^-XO~OX(nOq0zOx1YO!^&[q#j&[q%c&[q%f&[qi&[q}&[q!n&[q&X&[q~P'ZO}-YO~OX+hOq0zOx1YO}&pi!^&pi!n&pi~P'ZO|-_O}&pi!^&pi!n&pi~O!_+lO&r+mO!^!oa~OX&dOq0zOx1YO#j%ui%c%ui%f%ui&X%ui~P'ZO|-bO#j%ui%c%ui%f%ui&X%ui~O&SWO#j&ya%c&ya%f&yai&ya~O|-eO#j&ya%c&ya%f&yai&ya~Oi-hO~OX)rOc)rO&SWO!Y&{a~O|-jO!Y&{a~Op%Ti|%Ti~P$gOX)}O~P'ZOX)}Op&}q~P'ZOv-nOP#pyX#pyh#pyj#pyq#pyu#pyx#py!R#py!S#py!V#py!W#py!Z#py!_#py!j#py!u#py!v#py!w#py#O#py#Q#py#S#py#U#py#W#py#[#py#^#py#a#py#b#py#d#py#f#py#o#py#r#py#v#py#x#py#}#py$Q#py$S#py%`#py%|#py%}#py&R#py&S#py&h#py&i#py&l#py&o#py&s#py&t#py&u#py%b#py%f#py~O%b-rO%f-rO~P`O#t-sOP#qyX#qyh#qyj#qyq#qyu#qyx#qy!R#qy!S#qy!V#qy!W#qy!Z#qy!_#qy!j#qy!u#qy!v#qy!w#qy#O#qy#Q#qy#S#qy#U#qy#W#qy#[#qy#^#qy#a#qy#b#qy#d#qy#f#qy#o#qy#r#qy#v#qy#x#qy#}#qy$Q#qy$S#qy%`#qy%|#qy%}#qy&R#qy&S#qy&h#qy&i#qy&l#qy&o#qy&s#qy&t#qy&u#qy%b#qy%f#qy~O|-vO}$wO#_-vO~Oq0zOx1YO}'Oq~P'ZO|-yO}'Oq~O&X,oOi'Qa|'Qa~OX*fOc*gO&O*hO&SWOi'Pa~O|-}Oi'Pa~O$V.RO~OX%[Oc%[Oq0zOx1YO~P'ZOq0zOx1YO}.SO|$oi!Y$oi~P'ZOq0zOx1YO|$oi!Y$oi~P'ZO}.SO|$oi!Y$oi~Oq0zOx1YO}*yO~P'ZOq0zOx1YO}*yO!Y&fq~P'ZO|.VO!Y&fq~Oq0zOx1YO|.VO!Y&fq~P'ZOu.YO!V%qO!W%pOi&]q!Y&]q!^&]q|&]q~P!.TOc+dOq0zOx1YO!^&by~P'ZO|$mi!^$mi~P$gOc+dOq0zOx1YO~P'ZOX+hOq0zOx1YO~P'ZOX+hOq0zOx1YO}&pq!^&pq!n&pq~P'ZO}({O!^.^O!n._O~OX&dOq0zOx1YO#j%uq%c%uq%f%uq&X%uq~P'ZO#_.`O|%Oa#j%Oa%c%Oa%f%Oai%Oa~O&SWO#j&yi%c&yi%f&yii&yi~O|.bO#j&yi%c&yi%f&yii&yi~OX)rOc)rO&SWO!Y&{i~Ov.fOP#p!RX#p!Rh#p!Rj#p!Rq#p!Ru#p!Rx#p!R!R#p!R!S#p!R!V#p!R!W#p!R!Z#p!R!_#p!R!j#p!R!u#p!R!v#p!R!w#p!R#O#p!R#Q#p!R#S#p!R#U#p!R#W#p!R#[#p!R#^#p!R#a#p!R#b#p!R#d#p!R#f#p!R#o#p!R#r#p!R#v#p!R#x#p!R#}#p!R$Q#p!R$S#p!R%`#p!R%|#p!R%}#p!R&R#p!R&S#p!R&h#p!R&i#p!R&l#p!R&o#p!R&s#p!R&t#p!R&u#p!R%b#p!R%f#p!R~Oq0zOx1YO}'Oy~P'ZOX*fOc*gO&O*hO&SWOi'Pi~O$V.RO%b.nO%f.nO~OX.xOj.vO!Z.uO!_.wO!j.qO!v.sO!w.sO%}.pO&SWO&h]O&i^O&l_O~Oq0zOx1YO|$oq!Y$oq~P'ZO}.}O|$oq!Y$oq~Oq0zOx1YO}*yO!Y&fy~P'ZO|/OO!Y&fy~Oq0zOx/SO~P'ZOu.YO!V%qO!W%pOi&]y!Y&]y!^&]y|&]y~P!.TO}({O!^/VO~O&SWO#j&yq%c&yq%f&yqi&yq~O|/XO#j&yq%c&yq%f&yqi&yq~OX*fOc*gO&O*hO&SWO~Oj/^O!h/[O|$WX#_$WX%w$WXi$WX~Ou$WX}$WX!Y$WX!^$WX~P$&lO%|/`O%}/`Ou$XX|$XX}$XX#_$XX%w$XX!Y$XXi$XX!^$XX~O!j/bO~O|/fO#_/hO%w/cOu'SX}'SX!Y'SXi'SX~Oc/kO~P$!|Oj/^Ou'TX|'TX}'TX#_'TX%w'TX!Y'TXi'TX!^'TX~Ou/oO}$wO~Oq0zOx1YO|$oy!Y$oy~P'ZOq0zOx1YO}*yO!Y&f!R~P'ZO|/sO!Y&f!R~Oi&`Xu&`X!V&`X!W&`X!Y&`X!^&`X|&`X~P!.TOu.YO!V%qO!W%pOi&_a!Y&_a!^&_a|&_a~O&SWO#j&yy%c&yy%f&yyi&yy~O!h/[Oj$_au$_a|$_a}$_a#_$_a%w$_a!Y$_ai$_a!^$_a~O!j/|O~O%|/`O%}/`Ou$Xa|$Xa}$Xa#_$Xa%w$Xa!Y$Xai$Xa!^$Xa~O%w/cOu$]a|$]a}$]a#_$]a!Y$]ai$]a!^$]a~Ou'Sa}'Sa!Y'Sai'Sa~P$!pO|0ROu'Sa}'Sa!Y'Sai'Sa~O!Y0UO~Oi0UO~O}0WO~O!^0XO~Oq0zOx1YO}*yO!Y&f!Z~P'ZO}0[O~O&X0]O~P$&lO|0^O#_/hO%w/cOi'VX~O|0^Oi'VX~Oi0`O~O!j0aO~O#_/hOu%Za|%Za}%Za%w%Za!Y%Zai%Za!^%Za~O#_/hO%w/cOu%_a|%_a}%_a!Y%_ai%_a~Ou'Si}'Si!Y'Sii'Si~P$!pO|0cO#_/hO%w/cO!^'Ua~O}$ga~P$gOi'Va~P$!pO|0kOi'Va~Oc0mO!^'Ui~P$!|O|0oO!^'Ui~O|0oO#_/hO%w/cO!^'Ui~O#_/hO%w/cOi$ei|$ei~O&X0rO~P$&lO#_/hO%w/cOi%^a|%^a~Oi'Vi~P$!pO}0uO~Oc0mO!^'Uq~P$!|O|0wO!^'Uq~O#_/hO%w/cO|%]i!^%]i~Oc0mO~P$!|Oc0mO!^'Uy~P$!|O#_/hO%w/cOi$fi|$fi~O#_/hO%w/cO|%]q!^%]q~O|+tO#j%ua%c%ua%f%ua&X%ua~P$gOX&dOq0zOx1YO~P'ZOp1PO~Oq1PO~P'ZO}1QO~Ov1RO~P!.TO&i&l&t&u&h&o&s&S&h~",
  goto: "!?b'WPPPPPPPP'XP'a*|+f,P,k-W-tP.cP'a/S/S'aPPP'a2oPPPPPP2o5fPP5fP7y8S>fPP>i?Z?^PP'a'aPP?vPP'a'aPP'a'a'a'a'a?z@t'aP@wP@}EXHxPH|IYI^IbIf'aPPPIjIs'XP'X'XP'XP'XP'XP'XP'X'X'XP'XPP'XPP'XP'XPIyJVJ_PJfJlPJfPJfJfPPPJfPLzPMTM_MeLzPJfMnPJfPMuM{PNPNe! S! mNPNP! s!!QNPNPNPNP!!f!!l!!o!!t!!w!#R!#X!#e!#w!#}!$X!$_!${!%R!%X!%_!%i!%o!%u!%{!&R!&X!&k!&u!&{!'R!'X!'c!'i!'o!'u!'{!(V!(]!(g!(m!(v!(|!)]!)e!)o!)vPPPPPPPPPPPPPPPPP!)|!*P!*V!*`!*j!*uPPPPPPPPPPPP!/l!1Q!5T!8hPP!8p!9S!9]!:U!9{!:_!:e!:h!:k!:n!:v!;gPPPPPPPPP!;j!;yPPPP!<i!<u!=R!=X!=b!=e!=h!=n!=t!=z!=}P!>V!>`!?[!?_]jOs#v$w*W,d(TeOTYZ[fistuwy}!O!S!U!V!W!Z!^!h!i!j!k!l!m!n!p!t!u!v!x!y#P#T#X#Y#c#g#j#m#s#v$X$Y$[$^$a$r$t$u$w%O%[%a%h%k%m%p%t%y%{&V&b&d&o&s&|'O'P'W'Z'_'b'i'l'}(O(R(T(U(Y(_(a(e(i(n(o(u(x)V)X)a)d)p)w)y)}*O*S*W*^*b*l*v*y*z*}+T+U+W+Y+]+^+a+d+h+i+l+t+v+w,O,],^,d,l,m,p,z,{,|-O-P-S-U-W-Y-[-^-_-b-y-{.S.V.Y.}/O/o/s0[0z0{0|0}1P1Q1R1S1T1V1Z}!hQ#r$P$b$q$}%r%w%}&O&t'a'x)W)c)|+R+[,[-Z0Y1O!P!iQ#r$P$b$q$}%S%r%w%}&O&t'a'x)W)c)|+R+[,[-Z0Y1O!R!jQ#r$P$b$q$}%S%T%r%w%}&O&t'a'x)W)c)|+R+[,[-Z0Y1O!T!kQ#r$P$b$q$}%S%T%U%r%w%}&O&t'a'x)W)c)|+R+[,[-Z0Y1O!V!lQ#r$P$b$q$}%S%T%U%V%r%w%}&O&t'a'x)W)c)|+R+[,[-Z0Y1O!X!mQ#r$P$b$q$}%S%T%U%V%W%r%w%}&O&t'a'x)W)c)|+R+[,[-Z0Y1O!]!mQ!s#r$P$b$q$}%S%T%U%V%W%X%r%w%}&O&t'a'x)W)c)|+R+[,[-Z0Y1O(TTOTYZ[fistuwy}!O!S!U!V!W!Z!^!h!i!j!k!l!m!n!p!t!u!v!x!y#P#T#X#Y#c#g#j#m#s#v$X$Y$[$^$a$r$t$u$w%O%[%a%h%k%m%p%t%y%{&V&b&d&o&s&|'O'P'W'Z'_'b'i'l'}(O(R(T(U(Y(_(a(e(i(n(o(u(x)V)X)a)d)p)w)y)}*O*S*W*^*b*l*v*y*z*}+T+U+W+Y+]+^+a+d+h+i+l+t+v+w,O,],^,d,l,m,p,z,{,|-O-P-S-U-W-Y-[-^-_-b-y-{.S.V.Y.}/O/o/s0[0z0{0|0}1P1Q1R1S1T1V1Z&iVOYZ[isuw}!O!S!U!V!Z!n!p!t!u!v!x!y#c#g#j#m#s#v$Y$[$^$a$u$w%[%a%h%k%m%t%y%{&V&b&o&s'O'P'W'Z'b'i'l'}(O(R(T(U(Y(a(i(o(u(x)V)X)a)p)w)y*S*W*^*b*l*v*y*z*}+T+U+W+Y+]+^+a+h+i+l+t+w,O,d,l,m,p,z,{,|-O-P-S-U-W-Y-[-^-_-b-y-{.S.V.Y.}/O/s0[0z0{0|0}1P1Q1R1S1V1Z%sXOYZ[isw}!O!S!U!V!Z!n!p#c#g#j#m#s#v$Y$[$^$a$u$w%[%a%k%m%t%y%{&V&b&o&s'O'P'W'Z'b'i'l'}(O(R(T(U(Y(a(i(o(u(x)V)X)a)p)w)y*S*W*^*b*l*v*y*z*}+T+W+Y+]+^+a+h+i+l+t+w,O,d,l,m,p,z,{,|-O-P-S-W-Y-[-^-_-b-y-{.S.V.}/O/s1Q1R1SQ$VvQ/t/SR1W1Y'zeOTYZ[fistuwy}!O!S!U!V!W!Z!^!h!i!j!k!l!m!p!t!u!v!x!y#P#T#X#Y#c#g#j#m#s#v$X$Y$[$^$a$r$t$u$w%O%[%a%h%k%m%p%t%y%{&V&b&d&o&s&|'O'P'W'Z'_'b'i'l'}(R(T(U(Y(_(a(e(i(n(o(u(x)V)X)a)d)p)w)y)}*O*S*W*^*b*l*y*z*}+T+U+W+Y+]+^+a+d+h+i+l+t+v+w,O,],^,d,l,m,p,{,|-O-P-S-U-W-Y-[-^-_-b-y-{.S.V.Y.}/O/o/s0[0z0{0|0}1P1Q1R1S1T1V1ZW#ym!P!Q$hW$Rv&q/S1YQ$j!RQ$n!TQ${![Q$|!]W%Z!n(O*v,zS&p$S$TQ'e$vQ)Y&jQ)h'QU)i'S)j)kU)l'U)m+}W)s'Y,Q-j.dQ*d'nW*e'p,s-}.lQ,P)rS,r*f*gY-d+x-e.a.b/XQ-g+zQ-t,hQ-x,kQ.j-vl.o.R.u.v.x/d/f/k0R0W0]0b0m0r0uQ/W.`Q/l.wQ/x/^Q0T/hU0h0^0k0sX0n0c0o0v0wR&o$R!_!|YZ!U!V!p%a%m%t(R(T(U(a(i)y*y*z*}+T+W+Y,{,|-O-P-S.S.V.}/O/sR%k!{Q#QYQ&W#cQ&Z#gQ&]#jQ&_#mQ&x$^Q&{$aR-`+lT/R.Y0[![!oQ!s#r$P$b$q$}%S%T%U%V%W%X%r%w%}&O&t'a'x)W)c)|+R+[,[-Z0Y1OQ&m#zQ't$|R*p'uR'}%ZQ%d!rR/v/[(SdOTYZ[fistuwy}!O!S!U!V!W!Z!^!h!i!j!k!l!m!n!p!t!u!v!x!y#P#T#X#Y#c#g#j#m#s#v$X$Y$[$^$a$r$t$u$w%O%[%a%h%k%m%p%t%y%{&V&b&d&o&s&|'O'P'W'Z'_'b'i'l'}(O(R(T(U(Y(_(a(e(i(n(o(u(x)V)X)a)d)p)w)y)}*O*S*W*^*b*l*v*y*z*}+T+U+W+Y+]+^+a+d+h+i+l+t+v+w,O,],^,d,l,m,p,z,{,|-O-P-S-U-W-Y-[-^-_-b-y-{.S.V.Y.}/O/o/s0[0z0{0|0}1P1Q1R1S1T1V1ZS#pd#q!P.s.R.u.v.w.x/^/d/f/k0R0W0]0^0b0c0k0m0o0r0s0u0v0w(SdOTYZ[fistuwy}!O!S!U!V!W!Z!^!h!i!j!k!l!m!n!p!t!u!v!x!y#P#T#X#Y#c#g#j#m#s#v$X$Y$[$^$a$r$t$u$w%O%[%a%h%k%m%p%t%y%{&V&b&d&o&s&|'O'P'W'Z'_'b'i'l'}(O(R(T(U(Y(_(a(e(i(n(o(u(x)V)X)a)d)p)w)y)}*O*S*W*^*b*l*v*y*z*}+T+U+W+Y+]+^+a+d+h+i+l+t+v+w,O,],^,d,l,m,p,z,{,|-O-P-S-U-W-Y-[-^-_-b-y-{.S.V.Y.}/O/o/s0[0z0{0|0}1P1Q1R1S1T1V1ZT#pd#qT#d`#ee(|&W&Z&]&_)O)Q)S)U-`._T+m({+nT#ha#iT#kb#lT#nc#oQ$`xQ,P)sR,q*eX$^x$_$`&zQ'[$nQ'r${Q'u$|R*V'eQ)t'YV-i,Q-j.dZlOs$w*W,dXpOs*W,dQ$x!YQ']$oQ'^$pQ'o$zQ's$|Q*T'dQ*['iQ*_'jQ*`'kQ*m'qS*o't'uQ,W)yQ,Y)zQ,Z){Q,_*RS,a*U*nQ,e*YQ,f*ZS,g*]*^Q,w*pQ-l,VQ-m,XQ-o,`S-p,b,cQ-u,iQ-w,jQ.e-nQ.g-qQ.h-sQ.i-tQ/Y.fQ/Z.jQ/p.{R0Z/qWpOs*W,dR#|oQ'q${S*U'e'rR,c*VQ,p*eR-{,qQ*n'qQ,b*UR-q,cZnOos*W,dQ'w$}R*r'xT.P,x.Qu.z.R.u.v.x/^/d/f/k0R0W0]0^0b0k0m0r0s0ut.z.R.u.v.x/^/d/f/k0R0W0]0^0b0k0m0r0s0uQ/l.wX0n0c0o0v0w!P.r.R.u.v.w.x/^/d/f/k0R0W0]0^0b0c0k0m0o0r0s0u0v0wQ/a.qR/}/bg/d.t/e/y0Q0V0e0g0i0t0x0yu.y.R.u.v.x/^/d/f/k0R0W0]0^0b0k0m0r0s0uX/_.o.y/x0hR/z/^V0j0^0k0sR/q.{QsOS$Os,dR,d*WQ&r$UR)_&rS%z#W$WS(p%z(sT(s%}&tQ%n#OQ%u#SW(b%n%u(g(kQ(g%rR(k%wQ&}$bR)e&}Q(v&OQ+_(qT+e(v+_Q(P%]R*w(PS(S%`%aY*{(S*|-Q.W/PU*|(T(U(VU-Q*}+O+PS.W-R-SR/P.XQ#_^R&R#_Q#b_R&T#bQ#e`R&X#eQ(y&US+j(y+kR+k(zQ+n({R-a+nQ#iaR&[#iQ#lbR&^#lQ#ocR&`#oQ#qdR&a#qQ#tgQ&c#rW&f#t&c)b+uQ)b&wR+u1OQ$_xS&y$_&zR&z$`Q'X$lR)q'XQ&k#yR)Z&kQ$h!QR'R$hQ+y)iS-f+y.cR.c-gQ'V$jR)n'VQ,R)tR-k,RQ#wkR&h#wQ)x']R,U)xQ'`$qS*P'`*QR*Q'aQ'h$xR*X'hQ'm$yS*c'm,nR,n*dQ,t*iR.O,tWoOs*W,dR#{oQ.Q,xR.m.Qd/e.t/y0Q0V0e0g0i0t0x0yR0P/eU/].o/x0hR/w/]Q0d0VS0p0d0qR0q0eS0_/y/zR0l0_Q/g.tR0S/gR!`PXrOs*W,dWqOs*W,dR'f$wYkOs$w*W,dR&g#v[xOs#v$w*W,dR&x$^&hQOYZ[isuw}!O!S!U!V!Z!n!p!t!u!v!x!y#c#g#j#m#s#v$Y$[$^$a$u$w%[%a%h%k%m%t%y%{&V&b&o&s'O'P'W'Z'b'i'l'}(O(R(T(U(Y(a(i(o(u(x)V)X)a)p)w)y*S*W*^*b*l*v*y*z*}+T+U+W+Y+]+^+a+h+i+l+t+w,O,d,l,m,p,z,{,|-O-P-S-U-W-Y-[-^-_-b-y-{.S.V.Y.}/O/s0[0z0{0|0}1P1Q1R1S1V1ZQ!sTQ#rfQ$PtU$by%p(eS$q!W$tQ$}!^Q%S!hQ%T!iQ%U!jQ%V!kQ%W!lQ%X!mQ%r#PQ%w#TQ%}#XQ&O#YQ&t$XQ'a$rQ'x%OQ)W&dU)c&|)d+vW)|'_*O,],^Q+R(_Q+[(nQ,[)}Q-Z+dQ0Y/oR1O1TQ#OYQ#SZQ$o!UQ$p!VQ%`!pQ(V%a^(^%m%t(a(i+T+W+Y^*x(R*z-O-P.V/O/sQ+O(TQ+P(UQ,X)yQ,}*yQ-R*}Q.T,{Q.U,|Q.X-SQ.|.SR/r.}[gOs#v$w*W,d!^!{YZ!U!V!p%a%m%t(R(T(U(a(i)y*y*z*}+T+W+Y,{,|-O-P-S.S.V.}/O/sQ#W[Q#uiS$Ww}Q$e!OW$l!S$a'b*SS$y!Z$uW%Y!n(O*v,zY&U#c#g#j#m+l`&e#s&b)V)X)a+t-b1SQ&u$YQ&v$[Q&w$^Q'{%[Q(]%kW(m%y(o+]+aQ(q%{Q(z&VQ)]&oS)`&s1QQ)f'OQ)g'PU)o'W)p,OQ)v'ZQ*]'iY*a'l*b,l,m-yQ*t'}S+Q(Y1RW+c(u+^-W-[W+g(x+i-^-_Q,T)wQ,i*^Q,v*lQ-]+hQ-c+wQ-z,pQ.]-YR.k-{hUOs#s#v$w&b&s(Y)V)X*W,d%Y!zYZ[iw}!O!S!U!V!Z!n!p#c#g#j#m$Y$[$^$a$u%[%a%k%m%t%y%{&V&o'O'P'W'Z'b'i'l'}(O(R(T(U(a(i(o(u(x)a)p)w)y*S*^*b*l*v*y*z*}+T+W+Y+]+^+a+h+i+l+t+w,O,l,m,p,z,{,|-O-P-S-W-Y-[-^-_-b-y-{.S.V.}/O/s1Q1R1SQ$QuW%e!t!x0{1VQ%f!uQ%g!vQ%i!yQ%s0zS(X%h1PQ(Z0|Q([0}Q-T+UQ.[-US/Q.Y0[R1X1ZU$Uv/S1YR)^&q[hOs#v$w*W,da!}Y#c#g#j#m$^$a+lQ#][Q$ZwR$d}Q%o#OQ%v#SQ%|#WQ'{%YQ(h%rQ(l%wQ(t%}Q(w&OQ+`(qQ,y*tQ.Z-TQ/U.[R/u/TQ$cyQ(d%pR+V(eQ/T.YR0f0[R#VZR#[[R%_!nQ%]!nV*u(O*v,z!]!qQ!s#r$P$b$q$}%S%T%U%V%W%X%r%w%}&O&t'a'x)W)c)|+R+[,[-Z0Y1OR%b!pQ&W#cQ&Z#gQ&]#jQ&_#mR-`+lQ(}&WQ)P&ZQ)R&]Q)T&_Q+p)OQ+q)QQ+r)SQ+s)UQ.^-`R/V._Q$m!SQ&{$aQ*R'bR,`*SQ#zmQ$f!PQ$i!QR'T$hQ)h'SR+|)kQ)h'SQ+{)jR+|)kR$k!RR)u'YXqOs*W,dQ$s!WR'c$tQ$z!ZR'd$uR*k'pQ*i'pV-|,s-}.lQ.{.RQ/i.uR/j.vU.t.R.u.vQ/n.xQ/y/^Q0O/dU0Q/f0R0bQ0V/kQ0e0WQ0g0]U0i0^0k0sQ0t0mQ0x0rR0y0uR/m.wR/{/^",
  nodeNames: "\u26A0 print { { { { Comment Script AssignStatement * BinaryExpression BitOp BitOp BitOp BitOp ArithOp ArithOp @ ArithOp ** UnaryExpression ArithOp BitOp AwaitExpression await ) ( ParenthesizedExpression BinaryExpression or and CompareOp in not is UnaryExpression ConditionalExpression if else LambdaExpression lambda ParamList VariableName AssignOp , : NamedExpression AssignOp YieldExpression yield from TupleExpression ComprehensionExpression async for LambdaExpression ] [ ArrayExpression ArrayComprehensionExpression } { DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression CallExpression ArgList AssignOp MemberExpression . PropertyName Number String FormatString FormatReplacement FormatConversion FormatSpec FormatReplacement FormatReplacement FormatReplacement FormatReplacement ContinuedString Ellipsis None Boolean TypeDef AssignOp UpdateStatement UpdateOp ExpressionStatement DeleteStatement del PassStatement pass BreakStatement break ContinueStatement continue ReturnStatement return YieldStatement PrintStatement RaiseStatement raise ImportStatement import as ScopeStatement global nonlocal AssertStatement assert TypeDefinition type TypeParamList TypeParam StatementGroup ; IfStatement Body elif WhileStatement while ForStatement TryStatement try except finally WithStatement with FunctionDefinition def ParamList AssignOp TypeDef ClassDefinition class DecoratedStatement Decorator At MatchStatement match MatchBody MatchClause case CapturePattern LiteralPattern ArithOp ArithOp AsPattern OrPattern LogicOp AttributePattern SequencePattern MappingPattern StarPattern ClassPattern PatternArgList KeywordPattern KeywordPattern Guard",
  maxTerm: 283,
  context: trackIndent,
  nodeProps: [
    ["group", -15, 8, 88, 90, 91, 93, 95, 97, 99, 101, 102, 103, 105, 108, 111, 113, "Statement Statement", -22, 10, 20, 23, 27, 42, 51, 52, 58, 59, 62, 63, 64, 65, 66, 69, 72, 73, 74, 82, 83, 84, 85, "Expression", -10, 117, 119, 122, 124, 125, 129, 131, 136, 138, 141, "Statement", -9, 146, 147, 150, 151, 153, 154, 155, 156, 157, "Pattern"],
    ["openedBy", 25, "(", 56, "[", 60, "{"],
    ["closedBy", 26, ")", 57, "]", 61, "}"]
  ],
  propSources: [pythonHighlighting],
  skippedNodes: [0, 6],
  repeatNodeCount: 38,
  tokenData: "%-W#sR!`OX%TXY=|Y[%T[]=|]p%Tpq=|qr@_rsDOst!+|tu%Tuv!Nnvw#!|wx#$Wxy#:Uyz#;Yz{#<^{|#>x|}#@S}!O#AW!O!P#Ci!P!Q#N_!Q!R$!y!R![$&w![!]$1e!]!^$3s!^!_$4w!_!`$7c!`!a$8m!a!b%T!b!c$;U!c!d$<b!d!e$>W!e!h$<b!h!i$H[!i!t$<b!t!u%#r!u!w$<b!w!x$Fl!x!}$<b!}#O%%z#O#P?d#P#Q%'O#Q#R%(S#R#S$<b#S#T%T#T#U$<b#U#V$>W#V#Y$<b#Y#Z$H[#Z#f$<b#f#g%#r#g#i$<b#i#j$Fl#j#o$<b#o#p%)^#p#q%*S#q#r%+^#r#s%,S#s$g%T$g;'S$<b;'S;=`$>Q<%lO$<b!n%^]&r!b&jS&mWOr%Trs&Vsw%Twx/Xx#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T!n&^]&r!b&jSOr%Trs'Vsw%Twx/Xx#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T!n'^]&r!b&jSOr%Trs(Vsw%Twx/Xx#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T!f(^Z&r!b&jSOw(Vwx)Px#O(V#O#P+Z#P#o(V#o#p+x#p#q(V#q#r+x#r;'S(V;'S;=`/R<%lO(V!f)UZ&r!bOw(Vwx)wx#O(V#O#P+Z#P#o(V#o#p+x#p#q(V#q#r+x#r;'S(V;'S;=`/R<%lO(V!f)|Z&r!bOw(Vwx*ox#O(V#O#P+Z#P#o(V#o#p+x#p#q(V#q#r+x#r;'S(V;'S;=`/R<%lO(V!b*tT&r!bO#o*o#p#q*o#r;'S*o;'S;=`+T<%lO*o!b+WP;=`<%l*o!f+`W&r!bO#o(V#o#p+x#p#q(V#q#r+x#r;'S(V;'S;=`.d;=`<%l+x<%lO(VS+}V&jSOw+xwx,dx#O+x#O#P-c#P;'S+x;'S;=`.^<%lO+xS,gVOw+xwx,|x#O+x#O#P-c#P;'S+x;'S;=`.^<%lO+xS-PUOw+xx#O+x#O#P-c#P;'S+x;'S;=`.^<%lO+xS-fRO;'S+x;'S;=`-o;=`O+xS-tW&jSOw+xwx,dx#O+x#O#P-c#P;'S+x;'S;=`.^;=`<%l+x<%lO+xS.aP;=`<%l+x!f.iW&jSOw+xwx,dx#O+x#O#P-c#P;'S+x;'S;=`.^;=`<%l(V<%lO+x!f/UP;=`<%l(V!n/`]&r!b&mWOr%Trs&Vsw%Twx0Xx#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T!n0`]&r!b&mWOr%Trs&Vsw%Twx1Xx#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T!j1`Z&r!b&mWOr1Xrs2Rs#O1X#O#P3q#P#o1X#o#p4`#p#q1X#q#r4`#r;'S1X;'S;=`7i<%lO1X!j2WZ&r!bOr1Xrs2ys#O1X#O#P3q#P#o1X#o#p4`#p#q1X#q#r4`#r;'S1X;'S;=`7i<%lO1X!j3OZ&r!bOr1Xrs*os#O1X#O#P3q#P#o1X#o#p4`#p#q1X#q#r4`#r;'S1X;'S;=`7i<%lO1X!j3vW&r!bO#o1X#o#p4`#p#q1X#q#r4`#r;'S1X;'S;=`6z;=`<%l4`<%lO1XW4eV&mWOr4`rs4zs#O4`#O#P5y#P;'S4`;'S;=`6t<%lO4`W4}VOr4`rs5ds#O4`#O#P5y#P;'S4`;'S;=`6t<%lO4`W5gUOr4`s#O4`#O#P5y#P;'S4`;'S;=`6t<%lO4`W5|RO;'S4`;'S;=`6V;=`O4`W6[W&mWOr4`rs4zs#O4`#O#P5y#P;'S4`;'S;=`6t;=`<%l4`<%lO4`W6wP;=`<%l4`!j7PW&mWOr4`rs4zs#O4`#O#P5y#P;'S4`;'S;=`6t;=`<%l1X<%lO4`!j7lP;=`<%l1X!n7tW&r!bO#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=P;=`<%l8^<%lO%T[8eX&jS&mWOr8^rs9Qsw8^wx:dx#O8^#O#P;v#P;'S8^;'S;=`<y<%lO8^[9VX&jSOr8^rs9rsw8^wx:dx#O8^#O#P;v#P;'S8^;'S;=`<y<%lO8^[9wX&jSOr8^rs+xsw8^wx:dx#O8^#O#P;v#P;'S8^;'S;=`<y<%lO8^[:iX&mWOr8^rs9Qsw8^wx;Ux#O8^#O#P;v#P;'S8^;'S;=`<y<%lO8^[;ZX&mWOr8^rs9Qsw8^wx4`x#O8^#O#P;v#P;'S8^;'S;=`<y<%lO8^[;yRO;'S8^;'S;=`<S;=`O8^[<ZY&jS&mWOr8^rs9Qsw8^wx:dx#O8^#O#P;v#P;'S8^;'S;=`<y;=`<%l8^<%lO8^[<|P;=`<%l8^!n=WY&jS&mWOr8^rs9Qsw8^wx:dx#O8^#O#P;v#P;'S8^;'S;=`<y;=`<%l%T<%lO8^!n=yP;=`<%l%T#s>Xc&r!b&jS&mW%p!TOX%TXY=|Y[%T[]=|]p%Tpq=|qr%Trs&Vsw%Twx/Xx#O%T#O#P?d#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#s?i[&r!bOY%TYZ=|Z]%T]^=|^#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=P;=`<%l8^<%lO%T!q@hd&r!b&jS&mWOr%Trs&Vsw%Twx/Xx!_%T!_!`Av!`#O%T#O#P7o#P#T%T#T#UBz#U#f%T#f#gBz#g#hBz#h#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T!qBR]oR&r!b&jS&mWOr%Trs&Vsw%Twx/Xx#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T!qCV]!nR&r!b&jS&mWOr%Trs&Vsw%Twx/Xx#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#cDXa&r!b&jS&hsOYE^YZ%TZ]E^]^%T^rE^rs!)|swE^wxGpx#OE^#O#P!!u#P#oE^#o#p!#d#p#qE^#q#r!#d#r;'SE^;'S;=`!)v<%lOE^#cEia&r!b&jS&mW&hsOYE^YZ%TZ]E^]^%T^rE^rsFnswE^wxGpx#OE^#O#P!!u#P#oE^#o#p!#d#p#qE^#q#r!#d#r;'SE^;'S;=`!)v<%lOE^#cFw]&r!b&jS&hsOr%Trs'Vsw%Twx/Xx#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#cGya&r!b&mW&hsOYE^YZ%TZ]E^]^%T^rE^rsFnswE^wxIOx#OE^#O#P!!u#P#oE^#o#p!#d#p#qE^#q#r!#d#r;'SE^;'S;=`!)v<%lOE^#cIXa&r!b&mW&hsOYE^YZ%TZ]E^]^%T^rE^rsFnswE^wxJ^x#OE^#O#P!!u#P#oE^#o#p!#d#p#qE^#q#r!#d#r;'SE^;'S;=`!)v<%lOE^#_Jg_&r!b&mW&hsOYJ^YZ1XZ]J^]^1X^rJ^rsKfs#OJ^#O#PL`#P#oJ^#o#pL}#p#qJ^#q#rL}#r;'SJ^;'S;=`!!o<%lOJ^#_KmZ&r!b&hsOr1Xrs2ys#O1X#O#P3q#P#o1X#o#p4`#p#q1X#q#r4`#r;'S1X;'S;=`7i<%lO1X#_LeW&r!bO#oJ^#o#pL}#p#qJ^#q#rL}#r;'SJ^;'S;=`! r;=`<%lL}<%lOJ^{MUZ&mW&hsOYL}YZ4`Z]L}]^4`^rL}rsMws#OL}#O#PNc#P;'SL};'S;=`! l<%lOL}{M|V&hsOr4`rs5ds#O4`#O#P5y#P;'S4`;'S;=`6t<%lO4`{NfRO;'SL};'S;=`No;=`OL}{Nv[&mW&hsOYL}YZ4`Z]L}]^4`^rL}rsMws#OL}#O#PNc#P;'SL};'S;=`! l;=`<%lL}<%lOL}{! oP;=`<%lL}#_! y[&mW&hsOYL}YZ4`Z]L}]^4`^rL}rsMws#OL}#O#PNc#P;'SL};'S;=`! l;=`<%lJ^<%lOL}#_!!rP;=`<%lJ^#c!!zW&r!bO#oE^#o#p!#d#p#qE^#q#r!#d#r;'SE^;'S;=`!(q;=`<%l!#d<%lOE^!P!#m]&jS&mW&hsOY!#dYZ8^Z]!#d]^8^^r!#drs!$fsw!#dwx!%Yx#O!#d#O#P!'Y#P;'S!#d;'S;=`!(k<%lO!#d!P!$mX&jS&hsOr8^rs9rsw8^wx:dx#O8^#O#P;v#P;'S8^;'S;=`<y<%lO8^!P!%a]&mW&hsOY!#dYZ8^Z]!#d]^8^^r!#drs!$fsw!#dwx!&Yx#O!#d#O#P!'Y#P;'S!#d;'S;=`!(k<%lO!#d!P!&a]&mW&hsOY!#dYZ8^Z]!#d]^8^^r!#drs!$fsw!#dwxL}x#O!#d#O#P!'Y#P;'S!#d;'S;=`!(k<%lO!#d!P!']RO;'S!#d;'S;=`!'f;=`O!#d!P!'o^&jS&mW&hsOY!#dYZ8^Z]!#d]^8^^r!#drs!$fsw!#dwx!%Yx#O!#d#O#P!'Y#P;'S!#d;'S;=`!(k;=`<%l!#d<%lO!#d!P!(nP;=`<%l!#d#c!(z^&jS&mW&hsOY!#dYZ8^Z]!#d]^8^^r!#drs!$fsw!#dwx!%Yx#O!#d#O#P!'Y#P;'S!#d;'S;=`!(k;=`<%lE^<%lO!#d#c!)yP;=`<%lE^#c!*V]&r!b&jS&hsOr%Trs!+Osw%Twx/Xx#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#c!+ZZ&nW&r!b&jS&lsOw(Vwx)Px#O(V#O#P+Z#P#o(V#o#p+x#p#q(V#q#r+x#r;'S(V;'S;=`/R<%lO(V#s!,XaU!T&r!b&jS&mWOY!+|YZ%TZ]!+|]^%T^r!+|rs!-^sw!+|wx!:hx#O!+|#O#P!FW#P#o!+|#o#p!GT#p#q!+|#q#r!GT#r;'S!+|;'S;=`!Nh<%lO!+|#s!-gaU!T&r!b&jSOY!+|YZ%TZ]!+|]^%T^r!+|rs!.lsw!+|wx!:hx#O!+|#O#P!FW#P#o!+|#o#p!GT#p#q!+|#q#r!GT#r;'S!+|;'S;=`!Nh<%lO!+|#s!.uaU!T&r!b&jSOY!+|YZ%TZ]!+|]^%T^r!+|rs!/zsw!+|wx!:hx#O!+|#O#P!FW#P#o!+|#o#p!GT#p#q!+|#q#r!GT#r;'S!+|;'S;=`!Nh<%lO!+|#k!0T_U!T&r!b&jSOY!/zYZ(VZ]!/z]^(V^w!/zwx!1Sx#O!/z#O#P!4z#P#o!/z#o#p!5w#p#q!/z#q#r!5w#r;'S!/z;'S;=`!:b<%lO!/z#k!1Z_U!T&r!bOY!/zYZ(VZ]!/z]^(V^w!/zwx!2Yx#O!/z#O#P!4z#P#o!/z#o#p!5w#p#q!/z#q#r!5w#r;'S!/z;'S;=`!:b<%lO!/z#k!2a_U!T&r!bOY!/zYZ(VZ]!/z]^(V^w!/zwx!3`x#O!/z#O#P!4z#P#o!/z#o#p!5w#p#q!/z#q#r!5w#r;'S!/z;'S;=`!:b<%lO!/z#g!3gZU!T&r!bOY!3`YZ*oZ]!3`]^*o^#o!3`#o#p!4Y#p#q!3`#q#r!4Y#r;'S!3`;'S;=`!4t<%lO!3`!T!4_TU!TOY!4YZ]!4Y^;'S!4Y;'S;=`!4n<%lO!4Y!T!4qP;=`<%l!4Y#g!4wP;=`<%l!3`#k!5R[U!T&r!bOY!/zYZ(VZ]!/z]^(V^#o!/z#o#p!5w#p#q!/z#q#r!5w#r;'S!/z;'S;=`!9s;=`<%l+x<%lO!/z!X!6OZU!T&jSOY!5wYZ+xZ]!5w]^+x^w!5wwx!6qx#O!5w#O#P!8a#P;'S!5w;'S;=`!9m<%lO!5w!X!6vZU!TOY!5wYZ+xZ]!5w]^+x^w!5wwx!7ix#O!5w#O#P!8a#P;'S!5w;'S;=`!9m<%lO!5w!X!7nZU!TOY!5wYZ+xZ]!5w]^+x^w!5wwx!4Yx#O!5w#O#P!8a#P;'S!5w;'S;=`!9m<%lO!5w!X!8fWU!TOY!5wYZ+xZ]!5w]^+x^;'S!5w;'S;=`!9O;=`<%l+x<%lO!5w!X!9TW&jSOw+xwx,dx#O+x#O#P-c#P;'S+x;'S;=`.^;=`<%l!5w<%lO+x!X!9pP;=`<%l!5w#k!9xW&jSOw+xwx,dx#O+x#O#P-c#P;'S+x;'S;=`.^;=`<%l!/z<%lO+x#k!:eP;=`<%l!/z#s!:qaU!T&r!b&mWOY!+|YZ%TZ]!+|]^%T^r!+|rs!-^sw!+|wx!;vx#O!+|#O#P!FW#P#o!+|#o#p!GT#p#q!+|#q#r!GT#r;'S!+|;'S;=`!Nh<%lO!+|#s!<PaU!T&r!b&mWOY!+|YZ%TZ]!+|]^%T^r!+|rs!-^sw!+|wx!=Ux#O!+|#O#P!FW#P#o!+|#o#p!GT#p#q!+|#q#r!GT#r;'S!+|;'S;=`!Nh<%lO!+|#o!=__U!T&r!b&mWOY!=UYZ1XZ]!=U]^1X^r!=Urs!>^s#O!=U#O#P!@j#P#o!=U#o#p!Ag#p#q!=U#q#r!Ag#r;'S!=U;'S;=`!FQ<%lO!=U#o!>e_U!T&r!bOY!=UYZ1XZ]!=U]^1X^r!=Urs!?ds#O!=U#O#P!@j#P#o!=U#o#p!Ag#p#q!=U#q#r!Ag#r;'S!=U;'S;=`!FQ<%lO!=U#o!?k_U!T&r!bOY!=UYZ1XZ]!=U]^1X^r!=Urs!3`s#O!=U#O#P!@j#P#o!=U#o#p!Ag#p#q!=U#q#r!Ag#r;'S!=U;'S;=`!FQ<%lO!=U#o!@q[U!T&r!bOY!=UYZ1XZ]!=U]^1X^#o!=U#o#p!Ag#p#q!=U#q#r!Ag#r;'S!=U;'S;=`!Ec;=`<%l4`<%lO!=U!]!AnZU!T&mWOY!AgYZ4`Z]!Ag]^4`^r!Agrs!Bas#O!Ag#O#P!DP#P;'S!Ag;'S;=`!E]<%lO!Ag!]!BfZU!TOY!AgYZ4`Z]!Ag]^4`^r!Agrs!CXs#O!Ag#O#P!DP#P;'S!Ag;'S;=`!E]<%lO!Ag!]!C^ZU!TOY!AgYZ4`Z]!Ag]^4`^r!Agrs!4Ys#O!Ag#O#P!DP#P;'S!Ag;'S;=`!E]<%lO!Ag!]!DUWU!TOY!AgYZ4`Z]!Ag]^4`^;'S!Ag;'S;=`!Dn;=`<%l4`<%lO!Ag!]!DsW&mWOr4`rs4zs#O4`#O#P5y#P;'S4`;'S;=`6t;=`<%l!Ag<%lO4`!]!E`P;=`<%l!Ag#o!EhW&mWOr4`rs4zs#O4`#O#P5y#P;'S4`;'S;=`6t;=`<%l!=U<%lO4`#o!FTP;=`<%l!=U#s!F_[U!T&r!bOY!+|YZ%TZ]!+|]^%T^#o!+|#o#p!GT#p#q!+|#q#r!GT#r;'S!+|;'S;=`!Mq;=`<%l8^<%lO!+|!a!G^]U!T&jS&mWOY!GTYZ8^Z]!GT]^8^^r!GTrs!HVsw!GTwx!JVx#O!GT#O#P!LV#P;'S!GT;'S;=`!Mk<%lO!GT!a!H^]U!T&jSOY!GTYZ8^Z]!GT]^8^^r!GTrs!IVsw!GTwx!JVx#O!GT#O#P!LV#P;'S!GT;'S;=`!Mk<%lO!GT!a!I^]U!T&jSOY!GTYZ8^Z]!GT]^8^^r!GTrs!5wsw!GTwx!JVx#O!GT#O#P!LV#P;'S!GT;'S;=`!Mk<%lO!GT!a!J^]U!T&mWOY!GTYZ8^Z]!GT]^8^^r!GTrs!HVsw!GTwx!KVx#O!GT#O#P!LV#P;'S!GT;'S;=`!Mk<%lO!GT!a!K^]U!T&mWOY!GTYZ8^Z]!GT]^8^^r!GTrs!HVsw!GTwx!Agx#O!GT#O#P!LV#P;'S!GT;'S;=`!Mk<%lO!GT!a!L[WU!TOY!GTYZ8^Z]!GT]^8^^;'S!GT;'S;=`!Lt;=`<%l8^<%lO!GT!a!L{Y&jS&mWOr8^rs9Qsw8^wx:dx#O8^#O#P;v#P;'S8^;'S;=`<y;=`<%l!GT<%lO8^!a!MnP;=`<%l!GT#s!MxY&jS&mWOr8^rs9Qsw8^wx:dx#O8^#O#P;v#P;'S8^;'S;=`<y;=`<%l!+|<%lO8^#s!NkP;=`<%l!+|#b!Ny_&PQ&r!b&jS&mWOr%Trs&Vsw%Twx/Xx!_%T!_!`# x!`#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#b#!T]!{r&r!b&jS&mWOr%Trs&Vsw%Twx/Xx#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#b##X_%yQ&r!b&jS&mWOr%Trs&Vsw%Twx/Xx!_%T!_!`# x!`#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#c#$aa&r!b&mW&hsOY#%fYZ%TZ]#%f]^%T^r#%frs#&vsw#%fwx#8Ux#O#%f#O#P#0}#P#o#%f#o#p#1l#p#q#%f#q#r#1l#r;'S#%f;'S;=`#8O<%lO#%f#c#%qa&r!b&jS&mW&hsOY#%fYZ%TZ]#%f]^%T^r#%frs#&vsw#%fwx#/{x#O#%f#O#P#0}#P#o#%f#o#p#1l#p#q#%f#q#r#1l#r;'S#%f;'S;=`#8O<%lO#%f#c#'Pa&r!b&jS&hsOY#%fYZ%TZ]#%f]^%T^r#%frs#(Usw#%fwx#/{x#O#%f#O#P#0}#P#o#%f#o#p#1l#p#q#%f#q#r#1l#r;'S#%f;'S;=`#8O<%lO#%f#c#(_a&r!b&jS&hsOY#%fYZ%TZ]#%f]^%T^r#%frs#)dsw#%fwx#/{x#O#%f#O#P#0}#P#o#%f#o#p#1l#p#q#%f#q#r#1l#r;'S#%f;'S;=`#8O<%lO#%f#Z#)m_&r!b&jS&hsOY#)dYZ(VZ]#)d]^(V^w#)dwx#*lx#O#)d#O#P#+f#P#o#)d#o#p#,T#p#q#)d#q#r#,T#r;'S#)d;'S;=`#/u<%lO#)d#Z#*sZ&r!b&hsOw(Vwx)wx#O(V#O#P+Z#P#o(V#o#p+x#p#q(V#q#r+x#r;'S(V;'S;=`/R<%lO(V#Z#+kW&r!bO#o#)d#o#p#,T#p#q#)d#q#r#,T#r;'S#)d;'S;=`#.x;=`<%l#,T<%lO#)dw#,[Z&jS&hsOY#,TYZ+xZ]#,T]^+x^w#,Twx#,}x#O#,T#O#P#-i#P;'S#,T;'S;=`#.r<%lO#,Tw#-SV&hsOw+xwx,|x#O+x#O#P-c#P;'S+x;'S;=`.^<%lO+xw#-lRO;'S#,T;'S;=`#-u;=`O#,Tw#-|[&jS&hsOY#,TYZ+xZ]#,T]^+x^w#,Twx#,}x#O#,T#O#P#-i#P;'S#,T;'S;=`#.r;=`<%l#,T<%lO#,Tw#.uP;=`<%l#,T#Z#/P[&jS&hsOY#,TYZ+xZ]#,T]^+x^w#,Twx#,}x#O#,T#O#P#-i#P;'S#,T;'S;=`#.r;=`<%l#)d<%lO#,T#Z#/xP;=`<%l#)d#c#0U]&r!b&mW&hsOr%Trs&Vsw%Twx0Xx#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#c#1SW&r!bO#o#%f#o#p#1l#p#q#%f#q#r#1l#r;'S#%f;'S;=`#6y;=`<%l#1l<%lO#%f!P#1u]&jS&mW&hsOY#1lYZ8^Z]#1l]^8^^r#1lrs#2nsw#1lwx#4nx#O#1l#O#P#5b#P;'S#1l;'S;=`#6s<%lO#1l!P#2u]&jS&hsOY#1lYZ8^Z]#1l]^8^^r#1lrs#3nsw#1lwx#4nx#O#1l#O#P#5b#P;'S#1l;'S;=`#6s<%lO#1l!P#3u]&jS&hsOY#1lYZ8^Z]#1l]^8^^r#1lrs#,Tsw#1lwx#4nx#O#1l#O#P#5b#P;'S#1l;'S;=`#6s<%lO#1l!P#4uX&mW&hsOr8^rs9Qsw8^wx;Ux#O8^#O#P;v#P;'S8^;'S;=`<y<%lO8^!P#5eRO;'S#1l;'S;=`#5n;=`O#1l!P#5w^&jS&mW&hsOY#1lYZ8^Z]#1l]^8^^r#1lrs#2nsw#1lwx#4nx#O#1l#O#P#5b#P;'S#1l;'S;=`#6s;=`<%l#1l<%lO#1l!P#6vP;=`<%l#1l#c#7S^&jS&mW&hsOY#1lYZ8^Z]#1l]^8^^r#1lrs#2nsw#1lwx#4nx#O#1l#O#P#5b#P;'S#1l;'S;=`#6s;=`<%l#%f<%lO#1l#c#8RP;=`<%l#%f#c#8_]&r!b&mW&hsOr%Trs&Vsw%Twx#9Wx#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#c#9cZ&kS&r!b&mW&isOr1Xrs2Rs#O1X#O#P3q#P#o1X#o#p4`#p#q1X#q#r4`#r;'S1X;'S;=`7i<%lO1X#c#:a]js&r!b&jS&mWOr%Trs&Vsw%Twx/Xx#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T!q#;e]iR&r!b&jS&mWOr%Trs&Vsw%Twx/Xx#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#c#<iaXs&r!b&jS&mWOr%Trs&Vsw%Twx/Xxz%Tz{#=n{!_%T!_!`# x!`#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#c#=y_cR&r!b&jS&mWOr%Trs&Vsw%Twx/Xx!_%T!_!`# x!`#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#c#?T_%|s&r!b&jS&mWOr%Trs&Vsw%Twx/Xx!_%T!_!`# x!`#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T!q#@_]|R&r!b&jS&mWOr%Trs&Vsw%Twx/Xx#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#s#Ac`%}s&r!b&jS&mWOr%Trs&Vsw%Twx/Xx!_%T!_!`# x!`!a#Be!a#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#O#Bp]'R`&r!b&jS&mWOr%Trs&Vsw%Twx/Xx#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#c#Cta!hQ&r!b&jS&mWOr%Trs&Vsw%Twx/Xx!O%T!O!P#Dy!P!Q%T!Q![#GV![#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#c#ES_&r!b&jS&mWOr%Trs&Vsw%Twx/Xx!O%T!O!P#FR!P#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#c#F^]!us&r!b&jS&mWOr%Trs&Vsw%Twx/Xx#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#a#Gbi!jq&r!b&jS&mWOr%Trs&Vsw%Twx/Xx!Q%T!Q![#GV![!g%T!g!h#IP!h!l%T!l!m#MZ!m#O%T#O#P7o#P#R%T#R#S#GV#S#X%T#X#Y#IP#Y#^%T#^#_#MZ#_#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#a#IYc&r!b&jS&mWOr%Trs&Vsw%Twx/Xx{%T{|#Je|}%T}!O#Je!O!Q%T!Q![#Km![#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#a#Jn_&r!b&jS&mWOr%Trs&Vsw%Twx/Xx!Q%T!Q![#Km![#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#a#Kxe!jq&r!b&jS&mWOr%Trs&Vsw%Twx/Xx!Q%T!Q![#Km![!l%T!l!m#MZ!m#O%T#O#P7o#P#R%T#R#S#Km#S#^%T#^#_#MZ#_#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#a#Mf]!jq&r!b&jS&mWOr%Trs&Vsw%Twx/Xx#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#c#Nja&OR&r!b&jS&mWOr%Trs&Vsw%Twx/Xx!P%T!P!Q$ o!Q!_%T!_!`# x!`#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#b$ z_&QQ&r!b&jS&mWOr%Trs&Vsw%Twx/Xx!_%T!_!`# x!`#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#a$#Uw!jq&r!b&jS&mWOr%Trs&Vsw%Twx/Xx!O%T!O!P$%o!P!Q%T!Q![$&w![!d%T!d!e$(w!e!g%T!g!h#IP!h!l%T!l!m#MZ!m!q%T!q!r$+m!r!z%T!z!{$.]!{#O%T#O#P7o#P#R%T#R#S$&w#S#U%T#U#V$(w#V#X%T#X#Y#IP#Y#^%T#^#_#MZ#_#c%T#c#d$+m#d#l%T#l#m$.]#m#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#a$%x_&r!b&jS&mWOr%Trs&Vsw%Twx/Xx!Q%T!Q![#GV![#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#a$'Sk!jq&r!b&jS&mWOr%Trs&Vsw%Twx/Xx!O%T!O!P$%o!P!Q%T!Q![$&w![!g%T!g!h#IP!h!l%T!l!m#MZ!m#O%T#O#P7o#P#R%T#R#S$&w#S#X%T#X#Y#IP#Y#^%T#^#_#MZ#_#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#a$)Qb&r!b&jS&mWOr%Trs&Vsw%Twx/Xx!Q%T!Q!R$*Y!R!S$*Y!S#O%T#O#P7o#P#R%T#R#S$*Y#S#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#a$*eb!jq&r!b&jS&mWOr%Trs&Vsw%Twx/Xx!Q%T!Q!R$*Y!R!S$*Y!S#O%T#O#P7o#P#R%T#R#S$*Y#S#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#a$+va&r!b&jS&mWOr%Trs&Vsw%Twx/Xx!Q%T!Q!Y$,{!Y#O%T#O#P7o#P#R%T#R#S$,{#S#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#a$-Wa!jq&r!b&jS&mWOr%Trs&Vsw%Twx/Xx!Q%T!Q!Y$,{!Y#O%T#O#P7o#P#R%T#R#S$,{#S#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#a$.fe&r!b&jS&mWOr%Trs&Vsw%Twx/Xx!Q%T!Q![$/w![!c%T!c!i$/w!i#O%T#O#P7o#P#R%T#R#S$/w#S#T%T#T#Z$/w#Z#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#a$0Se!jq&r!b&jS&mWOr%Trs&Vsw%Twx/Xx!Q%T!Q![$/w![!c%T!c!i$/w!i#O%T#O#P7o#P#R%T#R#S$/w#S#T%T#T#Z$/w#Z#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#s$1p_}!T&r!b&jS&mWOr%Trs&Vsw%Twx/Xx!_%T!_!`$2o!`#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T!q$2z]&YR&r!b&jS&mWOr%Trs&Vsw%Twx/Xx#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#c$4O]#js&r!b&jS&mWOr%Trs&Vsw%Twx/Xx#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#c$5SaoR&r!b&jS&mWOr%Trs&Vsw%Twx/Xx!^%T!^!_$6X!_!`Av!`!aAv!a#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#b$6d_%zQ&r!b&jS&mWOr%Trs&Vsw%Twx/Xx!_%T!_!`# x!`#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#c$7n_&Xs&r!b&jS&mWOr%Trs&Vsw%Twx/Xx!_%T!_!`Av!`#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#c$8x`oR&r!b&jS&mWOr%Trs&Vsw%Twx/Xx!_%T!_!`Av!`!a$9z!a#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#b$:V_%{Q&r!b&jS&mWOr%Trs&Vsw%Twx/Xx!_%T!_!`# x!`#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#c$;c_aQ$QP&r!b&jS&mWOr%Trs&Vsw%Twx/Xx!_%T!_!`# x!`#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#s$<oe&r!b&jS&mW&g`&SsOr%Trs&Vsw%Twx/Xx!Q%T!Q![$<b![!c%T!c!}$<b!}#O%T#O#P7o#P#R%T#R#S$<b#S#T%T#T#o$<b#o#p8^#p#q%T#q#r8^#r$g%T$g;'S$<b;'S;=`$>Q<%lO$<b#s$>TP;=`<%l$<b#s$>ei&r!b&jS&mW&g`&SsOr%Trs$@Ssw%Twx$C`x!Q%T!Q![$<b![!c%T!c!t$<b!t!u$Fl!u!}$<b!}#O%T#O#P7o#P#R%T#R#S$<b#S#T%T#T#f$<b#f#g$Fl#g#o$<b#o#p8^#p#q%T#q#r8^#r$g%T$g;'S$<b;'S;=`$>Q<%lO$<b#c$@]a&r!b&jS&hsOYE^YZ%TZ]E^]^%T^rE^rs$AbswE^wxGpx#OE^#O#P!!u#P#oE^#o#p!#d#p#qE^#q#r!#d#r;'SE^;'S;=`!)v<%lOE^#c$Ak]&r!b&jS&hsOr%Trs$Bdsw%Twx/Xx#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#Z$BmZ&r!b&jS&lsOw(Vwx)Px#O(V#O#P+Z#P#o(V#o#p+x#p#q(V#q#r+x#r;'S(V;'S;=`/R<%lO(V#c$Cia&r!b&mW&hsOY#%fYZ%TZ]#%f]^%T^r#%frs#&vsw#%fwx$Dnx#O#%f#O#P#0}#P#o#%f#o#p#1l#p#q#%f#q#r#1l#r;'S#%f;'S;=`#8O<%lO#%f#c$Dw]&r!b&mW&hsOr%Trs&Vsw%Twx$Epx#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#_$EyZ&r!b&mW&isOr1Xrs2Rs#O1X#O#P3q#P#o1X#o#p4`#p#q1X#q#r4`#r;'S1X;'S;=`7i<%lO1X#s$Fye&r!b&jS&mW&g`&SsOr%Trs$@Ssw%Twx$C`x!Q%T!Q![$<b![!c%T!c!}$<b!}#O%T#O#P7o#P#R%T#R#S$<b#S#T%T#T#o$<b#o#p8^#p#q%T#q#r8^#r$g%T$g;'S$<b;'S;=`$>Q<%lO$<b#s$Hii&r!b&jS&mW&g`&SsOr%Trs$JWsw%Twx$MUx!Q%T!Q![$<b![!c%T!c!t$<b!t!u%!S!u!}$<b!}#O%T#O#P7o#P#R%T#R#S$<b#S#T%T#T#f$<b#f#g%!S#g#o$<b#o#p8^#p#q%T#q#r8^#r$g%T$g;'S$<b;'S;=`$>Q<%lO$<b#c$Ja]&r!b&jS&ssOr%Trs$KYsw%Twx/Xx#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#c$Ka]&r!b&jSOr%Trs$LYsw%Twx/Xx#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#Z$LcZ&r!b&jS&usOw(Vwx)Px#O(V#O#P+Z#P#o(V#o#p+x#p#q(V#q#r+x#r;'S(V;'S;=`/R<%lO(V#c$M_]&r!b&mW&osOr%Trs&Vsw%Twx$NWx#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#c$N_]&r!b&mWOr%Trs&Vsw%Twx% Wx#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#_% aZ&r!b&mW&tsOr1Xrs2Rs#O1X#O#P3q#P#o1X#o#p4`#p#q1X#q#r4`#r;'S1X;'S;=`7i<%lO1X#s%!ae&r!b&jS&mW&g`&SsOr%Trs$JWsw%Twx$MUx!Q%T!Q![$<b![!c%T!c!}$<b!}#O%T#O#P7o#P#R%T#R#S$<b#S#T%T#T#o$<b#o#p8^#p#q%T#q#r8^#r$g%T$g;'S$<b;'S;=`$>Q<%lO$<b#s%$Pm&r!b&jS&mW&g`&SsOr%Trs$@Ssw%Twx$C`x!Q%T!Q![$<b![!c%T!c!h$<b!h!i%!S!i!t$<b!t!u$Fl!u!}$<b!}#O%T#O#P7o#P#R%T#R#S$<b#S#T%T#T#U$<b#U#V$Fl#V#Y$<b#Y#Z%!S#Z#o$<b#o#p8^#p#q%T#q#r8^#r$g%T$g;'S$<b;'S;=`$>Q<%lO$<b#c%&V]!Zs&r!b&jS&mWOr%Trs&Vsw%Twx/Xx#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T!q%'Z]!YR&r!b&jS&mWOr%Trs&Vsw%Twx/Xx#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#b%(__%xQ&r!b&jS&mWOr%Trs&Vsw%Twx/Xx!_%T!_!`# x!`#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#a%)gX!_#T&jS&mWOr8^rs9Qsw8^wx:dx#O8^#O#P;v#P;'S8^;'S;=`<y<%lO8^#c%*__%wR&r!b&jS&mWOr%Trs&Vsw%Twx/Xx!_%T!_!`# x!`#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T!q%+gX!^!e&jS&mWOr8^rs9Qsw8^wx:dx#O8^#O#P;v#P;'S8^;'S;=`<y<%lO8^#a%,_]&Rq&r!b&jS&mWOr%Trs&Vsw%Twx/Xx#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T",
  tokenizers: [legacyPrint, indentation, newlines, formatString1, formatString2, formatString1l, formatString2l, 0, 1, 2, 3, 4, 5, 6],
  topRules: { "Script": [0, 7] },
  specialized: [{ term: 234, get: (value) => spec_identifier[value] || -1 }],
  tokenPrec: 7372
});

// node_modules/@codemirror/lang-python/dist/index.js
var cache = /* @__PURE__ */ new NodeWeakMap();
var ScopeNodes = /* @__PURE__ */ new Set([
  "Script",
  "Body",
  "FunctionDefinition",
  "ClassDefinition",
  "LambdaExpression",
  "ForStatement",
  "MatchClause"
]);
function defID(type) {
  return (node56, def, outer) => {
    if (outer)
      return false;
    let id2 = node56.node.getChild("VariableName");
    if (id2)
      def(id2, type);
    return true;
  };
}
var gatherCompletions = {
  FunctionDefinition: /* @__PURE__ */ defID("function"),
  ClassDefinition: /* @__PURE__ */ defID("class"),
  ForStatement(node56, def, outer) {
    if (outer)
      for (let child = node56.node.firstChild; child; child = child.nextSibling) {
        if (child.name == "VariableName")
          def(child, "variable");
        else if (child.name == "in")
          break;
      }
  },
  ImportStatement(_node, def) {
    var _a2, _b;
    let { node: node56 } = _node;
    let isFrom = ((_a2 = node56.firstChild) === null || _a2 === void 0 ? void 0 : _a2.name) == "from";
    for (let ch = node56.getChild("import"); ch; ch = ch.nextSibling) {
      if (ch.name == "VariableName" && ((_b = ch.nextSibling) === null || _b === void 0 ? void 0 : _b.name) != "as")
        def(ch, isFrom ? "variable" : "namespace");
    }
  },
  AssignStatement(node56, def) {
    for (let child = node56.node.firstChild; child; child = child.nextSibling) {
      if (child.name == "VariableName")
        def(child, "variable");
      else if (child.name == ":" || child.name == "AssignOp")
        break;
    }
  },
  ParamList(node56, def) {
    for (let prev2 = null, child = node56.node.firstChild; child; child = child.nextSibling) {
      if (child.name == "VariableName" && (!prev2 || !/\*|AssignOp/.test(prev2.name)))
        def(child, "variable");
      prev2 = child;
    }
  },
  CapturePattern: /* @__PURE__ */ defID("variable"),
  AsPattern: /* @__PURE__ */ defID("variable"),
  __proto__: null
};
function getScope(doc2, node56) {
  let cached = cache.get(node56);
  if (cached)
    return cached;
  let completions = [], top2 = true;
  function def(node57, type) {
    let name2 = doc2.sliceString(node57.from, node57.to);
    completions.push({ label: name2, type });
  }
  node56.cursor(IterMode.IncludeAnonymous).iterate((node57) => {
    if (node57.name) {
      let gather = gatherCompletions[node57.name];
      if (gather && gather(node57, def, top2) || !top2 && ScopeNodes.has(node57.name))
        return false;
      top2 = false;
    } else if (node57.to - node57.from > 8192) {
      for (let c4 of getScope(doc2, node57.node))
        completions.push(c4);
      return false;
    }
  });
  cache.set(node56, completions);
  return completions;
}
var Identifier = /^[\w\xa1-\uffff][\w\d\xa1-\uffff]*$/;
var dontComplete = ["String", "FormatString", "Comment", "PropertyName"];
function localCompletionSource(context2) {
  let inner = syntaxTree(context2.state).resolveInner(context2.pos, -1);
  if (dontComplete.indexOf(inner.name) > -1)
    return null;
  let isWord = inner.name == "VariableName" || inner.to - inner.from < 20 && Identifier.test(context2.state.sliceDoc(inner.from, inner.to));
  if (!isWord && !context2.explicit)
    return null;
  let options = [];
  for (let pos = inner; pos; pos = pos.parent) {
    if (ScopeNodes.has(pos.name))
      options = options.concat(getScope(context2.state.doc, pos));
  }
  return {
    options,
    from: isWord ? inner.from : context2.pos,
    validFor: Identifier
  };
}
var globals = /* @__PURE__ */ [
  "__annotations__",
  "__builtins__",
  "__debug__",
  "__doc__",
  "__import__",
  "__name__",
  "__loader__",
  "__package__",
  "__spec__",
  "False",
  "None",
  "True"
].map((n2) => ({ label: n2, type: "constant" })).concat(/* @__PURE__ */ [
  "ArithmeticError",
  "AssertionError",
  "AttributeError",
  "BaseException",
  "BlockingIOError",
  "BrokenPipeError",
  "BufferError",
  "BytesWarning",
  "ChildProcessError",
  "ConnectionAbortedError",
  "ConnectionError",
  "ConnectionRefusedError",
  "ConnectionResetError",
  "DeprecationWarning",
  "EOFError",
  "Ellipsis",
  "EncodingWarning",
  "EnvironmentError",
  "Exception",
  "FileExistsError",
  "FileNotFoundError",
  "FloatingPointError",
  "FutureWarning",
  "GeneratorExit",
  "IOError",
  "ImportError",
  "ImportWarning",
  "IndentationError",
  "IndexError",
  "InterruptedError",
  "IsADirectoryError",
  "KeyError",
  "KeyboardInterrupt",
  "LookupError",
  "MemoryError",
  "ModuleNotFoundError",
  "NameError",
  "NotADirectoryError",
  "NotImplemented",
  "NotImplementedError",
  "OSError",
  "OverflowError",
  "PendingDeprecationWarning",
  "PermissionError",
  "ProcessLookupError",
  "RecursionError",
  "ReferenceError",
  "ResourceWarning",
  "RuntimeError",
  "RuntimeWarning",
  "StopAsyncIteration",
  "StopIteration",
  "SyntaxError",
  "SyntaxWarning",
  "SystemError",
  "SystemExit",
  "TabError",
  "TimeoutError",
  "TypeError",
  "UnboundLocalError",
  "UnicodeDecodeError",
  "UnicodeEncodeError",
  "UnicodeError",
  "UnicodeTranslateError",
  "UnicodeWarning",
  "UserWarning",
  "ValueError",
  "Warning",
  "ZeroDivisionError"
].map((n2) => ({ label: n2, type: "type" }))).concat(/* @__PURE__ */ [
  "bool",
  "bytearray",
  "bytes",
  "classmethod",
  "complex",
  "float",
  "frozenset",
  "int",
  "list",
  "map",
  "memoryview",
  "object",
  "range",
  "set",
  "staticmethod",
  "str",
  "super",
  "tuple",
  "type"
].map((n2) => ({ label: n2, type: "class" }))).concat(/* @__PURE__ */ [
  "abs",
  "aiter",
  "all",
  "anext",
  "any",
  "ascii",
  "bin",
  "breakpoint",
  "callable",
  "chr",
  "compile",
  "delattr",
  "dict",
  "dir",
  "divmod",
  "enumerate",
  "eval",
  "exec",
  "exit",
  "filter",
  "format",
  "getattr",
  "globals",
  "hasattr",
  "hash",
  "help",
  "hex",
  "id",
  "input",
  "isinstance",
  "issubclass",
  "iter",
  "len",
  "license",
  "locals",
  "max",
  "min",
  "next",
  "oct",
  "open",
  "ord",
  "pow",
  "print",
  "property",
  "quit",
  "repr",
  "reversed",
  "round",
  "setattr",
  "slice",
  "sorted",
  "sum",
  "vars",
  "zip"
].map((n2) => ({ label: n2, type: "function" })));
var snippets = [
  /* @__PURE__ */ snippetCompletion("def ${name}(${params}):\n	${}", {
    label: "def",
    detail: "function",
    type: "keyword"
  }),
  /* @__PURE__ */ snippetCompletion("for ${name} in ${collection}:\n	${}", {
    label: "for",
    detail: "loop",
    type: "keyword"
  }),
  /* @__PURE__ */ snippetCompletion("while ${}:\n	${}", {
    label: "while",
    detail: "loop",
    type: "keyword"
  }),
  /* @__PURE__ */ snippetCompletion("try:\n	${}\nexcept ${error}:\n	${}", {
    label: "try",
    detail: "/ except block",
    type: "keyword"
  }),
  /* @__PURE__ */ snippetCompletion("if ${}:\n	\n", {
    label: "if",
    detail: "block",
    type: "keyword"
  }),
  /* @__PURE__ */ snippetCompletion("if ${}:\n	${}\nelse:\n	${}", {
    label: "if",
    detail: "/ else block",
    type: "keyword"
  }),
  /* @__PURE__ */ snippetCompletion("class ${name}:\n	def __init__(self, ${params}):\n			${}", {
    label: "class",
    detail: "definition",
    type: "keyword"
  }),
  /* @__PURE__ */ snippetCompletion("import ${module}", {
    label: "import",
    detail: "statement",
    type: "keyword"
  }),
  /* @__PURE__ */ snippetCompletion("from ${module} import ${names}", {
    label: "from",
    detail: "import",
    type: "keyword"
  })
];
var globalCompletion = /* @__PURE__ */ ifNotIn(dontComplete, /* @__PURE__ */ completeFromList(/* @__PURE__ */ globals.concat(snippets)));
function indentBody(context2, node56) {
  let base2 = context2.baseIndentFor(node56);
  let line2 = context2.lineAt(context2.pos, -1), to = line2.from + line2.text.length;
  if (/^\s*($|#)/.test(line2.text) && context2.node.to < to + 100 && !/\S/.test(context2.state.sliceDoc(to, context2.node.to)) && context2.lineIndent(context2.pos, -1) <= base2)
    return null;
  if (/^\s*(else:|elif |except |finally:)/.test(context2.textAfter) && context2.lineIndent(context2.pos, -1) > base2)
    return null;
  return base2 + context2.unit;
}
var pythonLanguage = /* @__PURE__ */ LRLanguage.define({
  name: "python",
  parser: /* @__PURE__ */ parser.configure({
    props: [
      /* @__PURE__ */ indentNodeProp.add({
        Body: (context2) => {
          var _a2;
          return (_a2 = indentBody(context2, context2.node)) !== null && _a2 !== void 0 ? _a2 : context2.continue();
        },
        IfStatement: (cx) => /^\s*(else:|elif )/.test(cx.textAfter) ? cx.baseIndent : cx.continue(),
        TryStatement: (cx) => /^\s*(except |finally:|else:)/.test(cx.textAfter) ? cx.baseIndent : cx.continue(),
        "TupleExpression ComprehensionExpression ParamList ArgList ParenthesizedExpression": /* @__PURE__ */ delimitedIndent({ closing: ")" }),
        "DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression": /* @__PURE__ */ delimitedIndent({ closing: "}" }),
        "ArrayExpression ArrayComprehensionExpression": /* @__PURE__ */ delimitedIndent({ closing: "]" }),
        "String FormatString": () => null,
        Script: (context2) => {
          if (context2.pos + /\s*/.exec(context2.textAfter)[0].length >= context2.node.to) {
            let endBody = null;
            for (let cur2 = context2.node, to = cur2.to; ; ) {
              cur2 = cur2.lastChild;
              if (!cur2 || cur2.to != to)
                break;
              if (cur2.type.name == "Body")
                endBody = cur2;
            }
            if (endBody) {
              let bodyIndent = indentBody(context2, endBody);
              if (bodyIndent != null)
                return bodyIndent;
            }
          }
          return context2.continue();
        }
      }),
      /* @__PURE__ */ foldNodeProp.add({
        "ArrayExpression DictionaryExpression SetExpression TupleExpression": foldInside,
        Body: (node56, state) => ({ from: node56.from + 1, to: node56.to - (node56.to == state.doc.length ? 0 : 1) })
      })
    ]
  }),
  languageData: {
    closeBrackets: {
      brackets: ["(", "[", "{", "'", '"', "'''", '"""'],
      stringPrefixes: [
        "f",
        "fr",
        "rf",
        "r",
        "u",
        "b",
        "br",
        "rb",
        "F",
        "FR",
        "RF",
        "R",
        "U",
        "B",
        "BR",
        "RB"
      ]
    },
    commentTokens: { line: "#" },
    indentOnInput: /^\s*([\}\]\)]|else:|elif |except |finally:)$/
  }
});
function python() {
  return new LanguageSupport(pythonLanguage, [
    pythonLanguage.data.of({ autocomplete: localCompletionSource }),
    pythonLanguage.data.of({ autocomplete: globalCompletion })
  ]);
}

// node_modules/@uiw/codemirror-themes/esm/index.js
var createTheme = (_ref18) => {
  var {
    theme: theme3,
    settings = {},
    styles = []
  } = _ref18;
  var themeOptions = {
    ".cm-gutters": {}
  };
  var baseStyle = {};
  if (settings.background) {
    baseStyle.backgroundColor = settings.background;
  }
  if (settings.backgroundImage) {
    baseStyle.backgroundImage = settings.backgroundImage;
  }
  if (settings.foreground) {
    baseStyle.color = settings.foreground;
  }
  if (settings.background || settings.foreground) {
    themeOptions["&"] = baseStyle;
  }
  if (settings.fontFamily) {
    themeOptions["&.cm-editor .cm-scroller"] = {
      fontFamily: settings.fontFamily
    };
  }
  if (settings.gutterBackground) {
    themeOptions[".cm-gutters"].backgroundColor = settings.gutterBackground;
  }
  if (settings.gutterForeground) {
    themeOptions[".cm-gutters"].color = settings.gutterForeground;
  }
  if (settings.gutterBorder) {
    themeOptions[".cm-gutters"].borderRightColor = settings.gutterBorder;
  }
  if (settings.caret) {
    themeOptions[".cm-content"] = {
      caretColor: settings.caret
    };
    themeOptions[".cm-cursor, .cm-dropCursor"] = {
      borderLeftColor: settings.caret
    };
  }
  var activeLineGutterStyle = {};
  if (settings.gutterActiveForeground) {
    activeLineGutterStyle.color = settings.gutterActiveForeground;
  }
  if (settings.lineHighlight) {
    themeOptions[".cm-activeLine"] = {
      backgroundColor: settings.lineHighlight
    };
    activeLineGutterStyle.backgroundColor = settings.lineHighlight;
  }
  themeOptions[".cm-activeLineGutter"] = activeLineGutterStyle;
  if (settings.selection) {
    themeOptions["&.cm-focused .cm-selectionBackground, & .cm-line::selection, & .cm-selectionLayer .cm-selectionBackground, .cm-content ::selection"] = {
      background: settings.selection + " !important"
    };
  }
  if (settings.selectionMatch) {
    themeOptions["& .cm-selectionMatch"] = {
      backgroundColor: settings.selectionMatch
    };
  }
  var themeExtension = EditorView.theme(themeOptions, {
    dark: theme3 === "dark"
  });
  var highlightStyle = HighlightStyle.define(styles);
  var extension = [themeExtension, syntaxHighlighting(highlightStyle)];
  return extension;
};

// node_modules/@uiw/codemirror-theme-nord/esm/index.js
var defaultSettingsNord = {
  background: "#2e3440",
  foreground: "#FFFFFF",
  caret: "#FFFFFF",
  selection: "#3b4252",
  selectionMatch: "#e5e9f0",
  gutterBackground: "#2e3440",
  gutterForeground: "#4c566a",
  gutterActiveForeground: "#d8dee9",
  lineHighlight: "#4c566a"
};
var nordInit = (options) => {
  var {
    theme: theme3 = "dark",
    settings = {},
    styles = []
  } = options || {};
  return createTheme({
    theme: theme3,
    settings: _extends({}, defaultSettingsNord, settings),
    styles: [{
      tag: tags.keyword,
      color: "#5e81ac"
    }, {
      tag: [tags.name, tags.deleted, tags.character, tags.propertyName, tags.macroName],
      color: "#88c0d0"
    }, {
      tag: [tags.variableName],
      color: "#8fbcbb"
    }, {
      tag: [tags.function(tags.variableName)],
      color: "#8fbcbb"
    }, {
      tag: [tags.labelName],
      color: "#81a1c1"
    }, {
      tag: [tags.color, tags.constant(tags.name), tags.standard(tags.name)],
      color: "#5e81ac"
    }, {
      tag: [tags.definition(tags.name), tags.separator],
      color: "#a3be8c"
    }, {
      tag: [tags.brace],
      color: "#8fbcbb"
    }, {
      tag: [tags.annotation],
      color: "#d30102"
    }, {
      tag: [tags.number, tags.changed, tags.annotation, tags.modifier, tags.self, tags.namespace],
      color: "#b48ead"
    }, {
      tag: [tags.typeName, tags.className],
      color: "#ebcb8b"
    }, {
      tag: [tags.operator, tags.operatorKeyword],
      color: "#a3be8c"
    }, {
      tag: [tags.tagName],
      color: "#b48ead"
    }, {
      tag: [tags.squareBracket],
      color: "#bf616a"
    }, {
      tag: [tags.angleBracket],
      color: "#d08770"
    }, {
      tag: [tags.attributeName],
      color: "#ebcb8b"
    }, {
      tag: [tags.regexp],
      color: "#5e81ac"
    }, {
      tag: [tags.quote],
      color: "#b48ead"
    }, {
      tag: [tags.string],
      color: "#a3be8c"
    }, {
      tag: tags.link,
      color: "#a3be8c",
      textDecoration: "underline",
      textUnderlinePosition: "under"
    }, {
      tag: [tags.url, tags.escape, tags.special(tags.string)],
      color: "#8fbcbb"
    }, {
      tag: [tags.meta],
      color: "#88c0d0"
    }, {
      tag: [tags.monospace],
      color: "#d8dee9",
      fontStyle: "italic"
    }, {
      tag: [tags.comment],
      color: "#4c566a",
      fontStyle: "italic"
    }, {
      tag: tags.strong,
      fontWeight: "bold",
      color: "#5e81ac"
    }, {
      tag: tags.emphasis,
      fontStyle: "italic",
      color: "#5e81ac"
    }, {
      tag: tags.strikethrough,
      textDecoration: "line-through"
    }, {
      tag: tags.heading,
      fontWeight: "bold",
      color: "#5e81ac"
    }, {
      tag: tags.special(tags.heading1),
      fontWeight: "bold",
      color: "#5e81ac"
    }, {
      tag: tags.heading1,
      fontWeight: "bold",
      color: "#5e81ac"
    }, {
      tag: [tags.heading2, tags.heading3, tags.heading4],
      fontWeight: "bold",
      color: "#5e81ac"
    }, {
      tag: [tags.heading5, tags.heading6],
      color: "#5e81ac"
    }, {
      tag: [tags.atom, tags.bool, tags.special(tags.variableName)],
      color: "#d08770"
    }, {
      tag: [tags.processingInstruction, tags.inserted],
      color: "#8fbcbb"
    }, {
      tag: [tags.contentSeparator],
      color: "#ebcb8b"
    }, {
      tag: tags.invalid,
      color: "#434c5e",
      borderBottom: "1px dotted #d30102"
    }, ...styles]
  });
};
var nord = nordInit();

// node_modules/@uiw/react-codemirror/esm/index.js
var import_react62 = __toESM(require_react());

// node_modules/@uiw/react-codemirror/esm/useCodeMirror.js
var import_react61 = __toESM(require_react());

// node_modules/@codemirror/commands/dist/index.js
var toggleComment = (target) => {
  let { state } = target, line2 = state.doc.lineAt(state.selection.main.from), config2 = getConfig(target.state, line2.from);
  return config2.line ? toggleLineComment(target) : config2.block ? toggleBlockCommentByLine(target) : false;
};
function command(f, option) {
  return ({ state, dispatch }) => {
    if (state.readOnly)
      return false;
    let tr = f(option, state);
    if (!tr)
      return false;
    dispatch(state.update(tr));
    return true;
  };
}
var toggleLineComment = /* @__PURE__ */ command(
  changeLineComment,
  0
  /* CommentOption.Toggle */
);
var toggleBlockComment = /* @__PURE__ */ command(
  changeBlockComment,
  0
  /* CommentOption.Toggle */
);
var toggleBlockCommentByLine = /* @__PURE__ */ command(
  (o, s2) => changeBlockComment(o, s2, selectedLineRanges(s2)),
  0
  /* CommentOption.Toggle */
);
function getConfig(state, pos) {
  let data = state.languageDataAt("commentTokens", pos);
  return data.length ? data[0] : {};
}
var SearchMargin = 50;
function findBlockComment(state, { open, close }, from2, to) {
  let textBefore = state.sliceDoc(from2 - SearchMargin, from2);
  let textAfter = state.sliceDoc(to, to + SearchMargin);
  let spaceBefore = /\s*$/.exec(textBefore)[0].length, spaceAfter = /^\s*/.exec(textAfter)[0].length;
  let beforeOff = textBefore.length - spaceBefore;
  if (textBefore.slice(beforeOff - open.length, beforeOff) == open && textAfter.slice(spaceAfter, spaceAfter + close.length) == close) {
    return {
      open: { pos: from2 - spaceBefore, margin: spaceBefore && 1 },
      close: { pos: to + spaceAfter, margin: spaceAfter && 1 }
    };
  }
  let startText, endText;
  if (to - from2 <= 2 * SearchMargin) {
    startText = endText = state.sliceDoc(from2, to);
  } else {
    startText = state.sliceDoc(from2, from2 + SearchMargin);
    endText = state.sliceDoc(to - SearchMargin, to);
  }
  let startSpace = /^\s*/.exec(startText)[0].length, endSpace = /\s*$/.exec(endText)[0].length;
  let endOff = endText.length - endSpace - close.length;
  if (startText.slice(startSpace, startSpace + open.length) == open && endText.slice(endOff, endOff + close.length) == close) {
    return {
      open: {
        pos: from2 + startSpace + open.length,
        margin: /\s/.test(startText.charAt(startSpace + open.length)) ? 1 : 0
      },
      close: {
        pos: to - endSpace - close.length,
        margin: /\s/.test(endText.charAt(endOff - 1)) ? 1 : 0
      }
    };
  }
  return null;
}
function selectedLineRanges(state) {
  let ranges = [];
  for (let r3 of state.selection.ranges) {
    let fromLine = state.doc.lineAt(r3.from);
    let toLine = r3.to <= fromLine.to ? fromLine : state.doc.lineAt(r3.to);
    let last = ranges.length - 1;
    if (last >= 0 && ranges[last].to > fromLine.from)
      ranges[last].to = toLine.to;
    else
      ranges.push({ from: fromLine.from + /^\s*/.exec(fromLine.text)[0].length, to: toLine.to });
  }
  return ranges;
}
function changeBlockComment(option, state, ranges = state.selection.ranges) {
  let tokens = ranges.map((r3) => getConfig(state, r3.from).block);
  if (!tokens.every((c4) => c4))
    return null;
  let comments = ranges.map((r3, i2) => findBlockComment(state, tokens[i2], r3.from, r3.to));
  if (option != 2 && !comments.every((c4) => c4)) {
    return { changes: state.changes(ranges.map((range4, i2) => {
      if (comments[i2])
        return [];
      return [{ from: range4.from, insert: tokens[i2].open + " " }, { from: range4.to, insert: " " + tokens[i2].close }];
    })) };
  } else if (option != 1 && comments.some((c4) => c4)) {
    let changes = [];
    for (let i2 = 0, comment3; i2 < comments.length; i2++)
      if (comment3 = comments[i2]) {
        let token2 = tokens[i2], { open, close } = comment3;
        changes.push({ from: open.pos - token2.open.length, to: open.pos + open.margin }, { from: close.pos - close.margin, to: close.pos + token2.close.length });
      }
    return { changes };
  }
  return null;
}
function changeLineComment(option, state, ranges = state.selection.ranges) {
  let lines = [];
  let prevLine = -1;
  for (let { from: from2, to } of ranges) {
    let startI = lines.length, minIndent = 1e9;
    let token2 = getConfig(state, from2).line;
    if (!token2)
      continue;
    for (let pos = from2; pos <= to; ) {
      let line2 = state.doc.lineAt(pos);
      if (line2.from > prevLine && (from2 == to || to > line2.from)) {
        prevLine = line2.from;
        let indent2 = /^\s*/.exec(line2.text)[0].length;
        let empty2 = indent2 == line2.length;
        let comment3 = line2.text.slice(indent2, indent2 + token2.length) == token2 ? indent2 : -1;
        if (indent2 < line2.text.length && indent2 < minIndent)
          minIndent = indent2;
        lines.push({ line: line2, comment: comment3, token: token2, indent: indent2, empty: empty2, single: false });
      }
      pos = line2.to + 1;
    }
    if (minIndent < 1e9) {
      for (let i2 = startI; i2 < lines.length; i2++)
        if (lines[i2].indent < lines[i2].line.text.length)
          lines[i2].indent = minIndent;
    }
    if (lines.length == startI + 1)
      lines[startI].single = true;
  }
  if (option != 2 && lines.some((l) => l.comment < 0 && (!l.empty || l.single))) {
    let changes = [];
    for (let { line: line2, token: token2, indent: indent2, empty: empty2, single } of lines)
      if (single || !empty2)
        changes.push({ from: line2.from + indent2, insert: token2 + " " });
    let changeSet = state.changes(changes);
    return { changes: changeSet, selection: state.selection.map(changeSet, 1) };
  } else if (option != 1 && lines.some((l) => l.comment >= 0)) {
    let changes = [];
    for (let { line: line2, comment: comment3, token: token2 } of lines)
      if (comment3 >= 0) {
        let from2 = line2.from + comment3, to = from2 + token2.length;
        if (line2.text[to - line2.from] == " ")
          to++;
        changes.push({ from: from2, to });
      }
    return { changes };
  }
  return null;
}
var fromHistory = /* @__PURE__ */ Annotation.define();
var isolateHistory = /* @__PURE__ */ Annotation.define();
var invertedEffects = /* @__PURE__ */ Facet.define();
var historyConfig = /* @__PURE__ */ Facet.define({
  combine(configs) {
    return combineConfig(configs, {
      minDepth: 100,
      newGroupDelay: 500,
      joinToEvent: (_t, isAdjacent2) => isAdjacent2
    }, {
      minDepth: Math.max,
      newGroupDelay: Math.min,
      joinToEvent: (a2, b) => (tr, adj) => a2(tr, adj) || b(tr, adj)
    });
  }
});
function changeEnd(changes) {
  let end = 0;
  changes.iterChangedRanges((_, to) => end = to);
  return end;
}
var historyField_ = /* @__PURE__ */ StateField.define({
  create() {
    return HistoryState.empty;
  },
  update(state, tr) {
    let config2 = tr.state.facet(historyConfig);
    let fromHist = tr.annotation(fromHistory);
    if (fromHist) {
      let selection2 = tr.docChanged ? EditorSelection.single(changeEnd(tr.changes)) : void 0;
      let item = HistEvent.fromTransaction(tr, selection2), from2 = fromHist.side;
      let other = from2 == 0 ? state.undone : state.done;
      if (item)
        other = updateBranch(other, other.length, config2.minDepth, item);
      else
        other = addSelection(other, tr.startState.selection);
      return new HistoryState(from2 == 0 ? fromHist.rest : other, from2 == 0 ? other : fromHist.rest);
    }
    let isolate = tr.annotation(isolateHistory);
    if (isolate == "full" || isolate == "before")
      state = state.isolate();
    if (tr.annotation(Transaction.addToHistory) === false)
      return !tr.changes.empty ? state.addMapping(tr.changes.desc) : state;
    let event = HistEvent.fromTransaction(tr);
    let time2 = tr.annotation(Transaction.time), userEvent = tr.annotation(Transaction.userEvent);
    if (event)
      state = state.addChanges(event, time2, userEvent, config2, tr);
    else if (tr.selection)
      state = state.addSelection(tr.startState.selection, time2, userEvent, config2.newGroupDelay);
    if (isolate == "full" || isolate == "after")
      state = state.isolate();
    return state;
  },
  toJSON(value) {
    return { done: value.done.map((e3) => e3.toJSON()), undone: value.undone.map((e3) => e3.toJSON()) };
  },
  fromJSON(json3) {
    return new HistoryState(json3.done.map(HistEvent.fromJSON), json3.undone.map(HistEvent.fromJSON));
  }
});
function history(config2 = {}) {
  return [
    historyField_,
    historyConfig.of(config2),
    EditorView.domEventHandlers({
      beforeinput(e3, view) {
        let command2 = e3.inputType == "historyUndo" ? undo : e3.inputType == "historyRedo" ? redo : null;
        if (!command2)
          return false;
        e3.preventDefault();
        return command2(view);
      }
    })
  ];
}
function cmd(side, selection2) {
  return function({ state, dispatch }) {
    if (!selection2 && state.readOnly)
      return false;
    let historyState = state.field(historyField_, false);
    if (!historyState)
      return false;
    let tr = historyState.pop(side, state, selection2);
    if (!tr)
      return false;
    dispatch(tr);
    return true;
  };
}
var undo = /* @__PURE__ */ cmd(0, false);
var redo = /* @__PURE__ */ cmd(1, false);
var undoSelection = /* @__PURE__ */ cmd(0, true);
var redoSelection = /* @__PURE__ */ cmd(1, true);
var HistEvent = class _HistEvent {
  constructor(changes, effects, mapped, startSelection, selectionsAfter) {
    this.changes = changes;
    this.effects = effects;
    this.mapped = mapped;
    this.startSelection = startSelection;
    this.selectionsAfter = selectionsAfter;
  }
  setSelAfter(after) {
    return new _HistEvent(this.changes, this.effects, this.mapped, this.startSelection, after);
  }
  toJSON() {
    var _a2, _b, _c;
    return {
      changes: (_a2 = this.changes) === null || _a2 === void 0 ? void 0 : _a2.toJSON(),
      mapped: (_b = this.mapped) === null || _b === void 0 ? void 0 : _b.toJSON(),
      startSelection: (_c = this.startSelection) === null || _c === void 0 ? void 0 : _c.toJSON(),
      selectionsAfter: this.selectionsAfter.map((s2) => s2.toJSON())
    };
  }
  static fromJSON(json3) {
    return new _HistEvent(json3.changes && ChangeSet.fromJSON(json3.changes), [], json3.mapped && ChangeDesc.fromJSON(json3.mapped), json3.startSelection && EditorSelection.fromJSON(json3.startSelection), json3.selectionsAfter.map(EditorSelection.fromJSON));
  }
  // This does not check `addToHistory` and such, it assumes the
  // transaction needs to be converted to an item. Returns null when
  // there are no changes or effects in the transaction.
  static fromTransaction(tr, selection2) {
    let effects = none3;
    for (let invert of tr.startState.facet(invertedEffects)) {
      let result = invert(tr);
      if (result.length)
        effects = effects.concat(result);
    }
    if (!effects.length && tr.changes.empty)
      return null;
    return new _HistEvent(tr.changes.invert(tr.startState.doc), effects, void 0, selection2 || tr.startState.selection, none3);
  }
  static selection(selections) {
    return new _HistEvent(void 0, none3, void 0, void 0, selections);
  }
};
function updateBranch(branch, to, maxLen, newEvent) {
  let start = to + 1 > maxLen + 20 ? to - maxLen - 1 : 0;
  let newBranch = branch.slice(start, to);
  newBranch.push(newEvent);
  return newBranch;
}
function isAdjacent(a2, b) {
  let ranges = [], isAdjacent2 = false;
  a2.iterChangedRanges((f, t3) => ranges.push(f, t3));
  b.iterChangedRanges((_f, _t, f, t3) => {
    for (let i2 = 0; i2 < ranges.length; ) {
      let from2 = ranges[i2++], to = ranges[i2++];
      if (t3 >= from2 && f <= to)
        isAdjacent2 = true;
    }
  });
  return isAdjacent2;
}
function eqSelectionShape(a2, b) {
  return a2.ranges.length == b.ranges.length && a2.ranges.filter((r3, i2) => r3.empty != b.ranges[i2].empty).length === 0;
}
function conc(a2, b) {
  return !a2.length ? b : !b.length ? a2 : a2.concat(b);
}
var none3 = [];
var MaxSelectionsPerEvent = 200;
function addSelection(branch, selection2) {
  if (!branch.length) {
    return [HistEvent.selection([selection2])];
  } else {
    let lastEvent = branch[branch.length - 1];
    let sels = lastEvent.selectionsAfter.slice(Math.max(0, lastEvent.selectionsAfter.length - MaxSelectionsPerEvent));
    if (sels.length && sels[sels.length - 1].eq(selection2))
      return branch;
    sels.push(selection2);
    return updateBranch(branch, branch.length - 1, 1e9, lastEvent.setSelAfter(sels));
  }
}
function popSelection(branch) {
  let last = branch[branch.length - 1];
  let newBranch = branch.slice();
  newBranch[branch.length - 1] = last.setSelAfter(last.selectionsAfter.slice(0, last.selectionsAfter.length - 1));
  return newBranch;
}
function addMappingToBranch(branch, mapping) {
  if (!branch.length)
    return branch;
  let length2 = branch.length, selections = none3;
  while (length2) {
    let event = mapEvent(branch[length2 - 1], mapping, selections);
    if (event.changes && !event.changes.empty || event.effects.length) {
      let result = branch.slice(0, length2);
      result[length2 - 1] = event;
      return result;
    } else {
      mapping = event.mapped;
      length2--;
      selections = event.selectionsAfter;
    }
  }
  return selections.length ? [HistEvent.selection(selections)] : none3;
}
function mapEvent(event, mapping, extraSelections) {
  let selections = conc(event.selectionsAfter.length ? event.selectionsAfter.map((s2) => s2.map(mapping)) : none3, extraSelections);
  if (!event.changes)
    return HistEvent.selection(selections);
  let mappedChanges = event.changes.map(mapping), before = mapping.mapDesc(event.changes, true);
  let fullMapping = event.mapped ? event.mapped.composeDesc(before) : before;
  return new HistEvent(mappedChanges, StateEffect.mapEffects(event.effects, mapping), fullMapping, event.startSelection.map(before), selections);
}
var joinableUserEvent = /^(input\.type|delete)($|\.)/;
var HistoryState = class _HistoryState {
  constructor(done, undone, prevTime = 0, prevUserEvent = void 0) {
    this.done = done;
    this.undone = undone;
    this.prevTime = prevTime;
    this.prevUserEvent = prevUserEvent;
  }
  isolate() {
    return this.prevTime ? new _HistoryState(this.done, this.undone) : this;
  }
  addChanges(event, time2, userEvent, config2, tr) {
    let done = this.done, lastEvent = done[done.length - 1];
    if (lastEvent && lastEvent.changes && !lastEvent.changes.empty && event.changes && (!userEvent || joinableUserEvent.test(userEvent)) && (!lastEvent.selectionsAfter.length && time2 - this.prevTime < config2.newGroupDelay && config2.joinToEvent(tr, isAdjacent(lastEvent.changes, event.changes)) || // For compose (but not compose.start) events, always join with previous event
    userEvent == "input.type.compose")) {
      done = updateBranch(done, done.length - 1, config2.minDepth, new HistEvent(event.changes.compose(lastEvent.changes), conc(event.effects, lastEvent.effects), lastEvent.mapped, lastEvent.startSelection, none3));
    } else {
      done = updateBranch(done, done.length, config2.minDepth, event);
    }
    return new _HistoryState(done, none3, time2, userEvent);
  }
  addSelection(selection2, time2, userEvent, newGroupDelay) {
    let last = this.done.length ? this.done[this.done.length - 1].selectionsAfter : none3;
    if (last.length > 0 && time2 - this.prevTime < newGroupDelay && userEvent == this.prevUserEvent && userEvent && /^select($|\.)/.test(userEvent) && eqSelectionShape(last[last.length - 1], selection2))
      return this;
    return new _HistoryState(addSelection(this.done, selection2), this.undone, time2, userEvent);
  }
  addMapping(mapping) {
    return new _HistoryState(addMappingToBranch(this.done, mapping), addMappingToBranch(this.undone, mapping), this.prevTime, this.prevUserEvent);
  }
  pop(side, state, selection2) {
    let branch = side == 0 ? this.done : this.undone;
    if (branch.length == 0)
      return null;
    let event = branch[branch.length - 1];
    if (selection2 && event.selectionsAfter.length) {
      return state.update({
        selection: event.selectionsAfter[event.selectionsAfter.length - 1],
        annotations: fromHistory.of({ side, rest: popSelection(branch) }),
        userEvent: side == 0 ? "select.undo" : "select.redo",
        scrollIntoView: true
      });
    } else if (!event.changes) {
      return null;
    } else {
      let rest = branch.length == 1 ? none3 : branch.slice(0, branch.length - 1);
      if (event.mapped)
        rest = addMappingToBranch(rest, event.mapped);
      return state.update({
        changes: event.changes,
        selection: event.startSelection,
        effects: event.effects,
        annotations: fromHistory.of({ side, rest }),
        filter: false,
        userEvent: side == 0 ? "undo" : "redo",
        scrollIntoView: true
      });
    }
  }
};
HistoryState.empty = /* @__PURE__ */ new HistoryState(none3, none3);
var historyKeymap = [
  { key: "Mod-z", run: undo, preventDefault: true },
  { key: "Mod-y", mac: "Mod-Shift-z", run: redo, preventDefault: true },
  { linux: "Ctrl-Shift-z", run: redo, preventDefault: true },
  { key: "Mod-u", run: undoSelection, preventDefault: true },
  { key: "Alt-u", mac: "Mod-Shift-u", run: redoSelection, preventDefault: true }
];
function updateSel(sel, by) {
  return EditorSelection.create(sel.ranges.map(by), sel.mainIndex);
}
function setSel(state, selection2) {
  return state.update({ selection: selection2, scrollIntoView: true, userEvent: "select" });
}
function moveSel({ state, dispatch }, how) {
  let selection2 = updateSel(state.selection, how);
  if (selection2.eq(state.selection))
    return false;
  dispatch(setSel(state, selection2));
  return true;
}
function rangeEnd(range4, forward) {
  return EditorSelection.cursor(forward ? range4.to : range4.from);
}
function cursorByChar(view, forward) {
  return moveSel(view, (range4) => range4.empty ? view.moveByChar(range4, forward) : rangeEnd(range4, forward));
}
function ltrAtCursor(view) {
  return view.textDirectionAt(view.state.selection.main.head) == Direction.LTR;
}
var cursorCharLeft = (view) => cursorByChar(view, !ltrAtCursor(view));
var cursorCharRight = (view) => cursorByChar(view, ltrAtCursor(view));
function cursorByGroup(view, forward) {
  return moveSel(view, (range4) => range4.empty ? view.moveByGroup(range4, forward) : rangeEnd(range4, forward));
}
var cursorGroupLeft = (view) => cursorByGroup(view, !ltrAtCursor(view));
var cursorGroupRight = (view) => cursorByGroup(view, ltrAtCursor(view));
var segmenter = typeof Intl != "undefined" && Intl.Segmenter ? /* @__PURE__ */ new Intl.Segmenter(void 0, { granularity: "word" }) : null;
function interestingNode(state, node56, bracketProp) {
  if (node56.type.prop(bracketProp))
    return true;
  let len = node56.to - node56.from;
  return len && (len > 2 || /[^\s,.;:]/.test(state.sliceDoc(node56.from, node56.to))) || node56.firstChild;
}
function moveBySyntax(state, start, forward) {
  let pos = syntaxTree(state).resolveInner(start.head);
  let bracketProp = forward ? NodeProp.closedBy : NodeProp.openedBy;
  for (let at = start.head; ; ) {
    let next2 = forward ? pos.childAfter(at) : pos.childBefore(at);
    if (!next2)
      break;
    if (interestingNode(state, next2, bracketProp))
      pos = next2;
    else
      at = forward ? next2.to : next2.from;
  }
  let bracket2 = pos.type.prop(bracketProp), match2, newPos;
  if (bracket2 && (match2 = forward ? matchBrackets(state, pos.from, 1) : matchBrackets(state, pos.to, -1)) && match2.matched)
    newPos = forward ? match2.end.to : match2.end.from;
  else
    newPos = forward ? pos.to : pos.from;
  return EditorSelection.cursor(newPos, forward ? -1 : 1);
}
var cursorSyntaxLeft = (view) => moveSel(view, (range4) => moveBySyntax(view.state, range4, !ltrAtCursor(view)));
var cursorSyntaxRight = (view) => moveSel(view, (range4) => moveBySyntax(view.state, range4, ltrAtCursor(view)));
function cursorByLine(view, forward) {
  return moveSel(view, (range4) => {
    if (!range4.empty)
      return rangeEnd(range4, forward);
    let moved = view.moveVertically(range4, forward);
    return moved.head != range4.head ? moved : view.moveToLineBoundary(range4, forward);
  });
}
var cursorLineUp = (view) => cursorByLine(view, false);
var cursorLineDown = (view) => cursorByLine(view, true);
function pageInfo(view) {
  let selfScroll = view.scrollDOM.clientHeight < view.scrollDOM.scrollHeight - 2;
  let marginTop = 0, marginBottom = 0, height;
  if (selfScroll) {
    for (let source of view.state.facet(EditorView.scrollMargins)) {
      let margins = source(view);
      if (margins === null || margins === void 0 ? void 0 : margins.top)
        marginTop = Math.max(margins === null || margins === void 0 ? void 0 : margins.top, marginTop);
      if (margins === null || margins === void 0 ? void 0 : margins.bottom)
        marginBottom = Math.max(margins === null || margins === void 0 ? void 0 : margins.bottom, marginBottom);
    }
    height = view.scrollDOM.clientHeight - marginTop - marginBottom;
  } else {
    height = (view.dom.ownerDocument.defaultView || window).innerHeight;
  }
  return {
    marginTop,
    marginBottom,
    selfScroll,
    height: Math.max(view.defaultLineHeight, height - 5)
  };
}
function cursorByPage(view, forward) {
  let page = pageInfo(view);
  let { state } = view, selection2 = updateSel(state.selection, (range4) => {
    return range4.empty ? view.moveVertically(range4, forward, page.height) : rangeEnd(range4, forward);
  });
  if (selection2.eq(state.selection))
    return false;
  let effect;
  if (page.selfScroll) {
    let startPos = view.coordsAtPos(state.selection.main.head);
    let scrollRect = view.scrollDOM.getBoundingClientRect();
    let scrollTop = scrollRect.top + page.marginTop, scrollBottom = scrollRect.bottom - page.marginBottom;
    if (startPos && startPos.top > scrollTop && startPos.bottom < scrollBottom)
      effect = EditorView.scrollIntoView(selection2.main.head, { y: "start", yMargin: startPos.top - scrollTop });
  }
  view.dispatch(setSel(state, selection2), { effects: effect });
  return true;
}
var cursorPageUp = (view) => cursorByPage(view, false);
var cursorPageDown = (view) => cursorByPage(view, true);
function moveByLineBoundary(view, start, forward) {
  let line2 = view.lineBlockAt(start.head), moved = view.moveToLineBoundary(start, forward);
  if (moved.head == start.head && moved.head != (forward ? line2.to : line2.from))
    moved = view.moveToLineBoundary(start, forward, false);
  if (!forward && moved.head == line2.from && line2.length) {
    let space2 = /^\s*/.exec(view.state.sliceDoc(line2.from, Math.min(line2.from + 100, line2.to)))[0].length;
    if (space2 && start.head != line2.from + space2)
      moved = EditorSelection.cursor(line2.from + space2);
  }
  return moved;
}
var cursorLineBoundaryForward = (view) => moveSel(view, (range4) => moveByLineBoundary(view, range4, true));
var cursorLineBoundaryBackward = (view) => moveSel(view, (range4) => moveByLineBoundary(view, range4, false));
var cursorLineBoundaryLeft = (view) => moveSel(view, (range4) => moveByLineBoundary(view, range4, !ltrAtCursor(view)));
var cursorLineBoundaryRight = (view) => moveSel(view, (range4) => moveByLineBoundary(view, range4, ltrAtCursor(view)));
var cursorLineStart = (view) => moveSel(view, (range4) => EditorSelection.cursor(view.lineBlockAt(range4.head).from, 1));
var cursorLineEnd = (view) => moveSel(view, (range4) => EditorSelection.cursor(view.lineBlockAt(range4.head).to, -1));
function toMatchingBracket(state, dispatch, extend4) {
  let found = false, selection2 = updateSel(state.selection, (range4) => {
    let matching = matchBrackets(state, range4.head, -1) || matchBrackets(state, range4.head, 1) || range4.head > 0 && matchBrackets(state, range4.head - 1, 1) || range4.head < state.doc.length && matchBrackets(state, range4.head + 1, -1);
    if (!matching || !matching.end)
      return range4;
    found = true;
    let head = matching.start.from == range4.head ? matching.end.to : matching.end.from;
    return extend4 ? EditorSelection.range(range4.anchor, head) : EditorSelection.cursor(head);
  });
  if (!found)
    return false;
  dispatch(setSel(state, selection2));
  return true;
}
var cursorMatchingBracket = ({ state, dispatch }) => toMatchingBracket(state, dispatch, false);
function extendSel(view, how) {
  let selection2 = updateSel(view.state.selection, (range4) => {
    let head = how(range4);
    return EditorSelection.range(range4.anchor, head.head, head.goalColumn, head.bidiLevel || void 0);
  });
  if (selection2.eq(view.state.selection))
    return false;
  view.dispatch(setSel(view.state, selection2));
  return true;
}
function selectByChar(view, forward) {
  return extendSel(view, (range4) => view.moveByChar(range4, forward));
}
var selectCharLeft = (view) => selectByChar(view, !ltrAtCursor(view));
var selectCharRight = (view) => selectByChar(view, ltrAtCursor(view));
function selectByGroup(view, forward) {
  return extendSel(view, (range4) => view.moveByGroup(range4, forward));
}
var selectGroupLeft = (view) => selectByGroup(view, !ltrAtCursor(view));
var selectGroupRight = (view) => selectByGroup(view, ltrAtCursor(view));
var selectSyntaxLeft = (view) => extendSel(view, (range4) => moveBySyntax(view.state, range4, !ltrAtCursor(view)));
var selectSyntaxRight = (view) => extendSel(view, (range4) => moveBySyntax(view.state, range4, ltrAtCursor(view)));
function selectByLine(view, forward) {
  return extendSel(view, (range4) => view.moveVertically(range4, forward));
}
var selectLineUp = (view) => selectByLine(view, false);
var selectLineDown = (view) => selectByLine(view, true);
function selectByPage(view, forward) {
  return extendSel(view, (range4) => view.moveVertically(range4, forward, pageInfo(view).height));
}
var selectPageUp = (view) => selectByPage(view, false);
var selectPageDown = (view) => selectByPage(view, true);
var selectLineBoundaryForward = (view) => extendSel(view, (range4) => moveByLineBoundary(view, range4, true));
var selectLineBoundaryBackward = (view) => extendSel(view, (range4) => moveByLineBoundary(view, range4, false));
var selectLineBoundaryLeft = (view) => extendSel(view, (range4) => moveByLineBoundary(view, range4, !ltrAtCursor(view)));
var selectLineBoundaryRight = (view) => extendSel(view, (range4) => moveByLineBoundary(view, range4, ltrAtCursor(view)));
var selectLineStart = (view) => extendSel(view, (range4) => EditorSelection.cursor(view.lineBlockAt(range4.head).from));
var selectLineEnd = (view) => extendSel(view, (range4) => EditorSelection.cursor(view.lineBlockAt(range4.head).to));
var cursorDocStart = ({ state, dispatch }) => {
  dispatch(setSel(state, { anchor: 0 }));
  return true;
};
var cursorDocEnd = ({ state, dispatch }) => {
  dispatch(setSel(state, { anchor: state.doc.length }));
  return true;
};
var selectDocStart = ({ state, dispatch }) => {
  dispatch(setSel(state, { anchor: state.selection.main.anchor, head: 0 }));
  return true;
};
var selectDocEnd = ({ state, dispatch }) => {
  dispatch(setSel(state, { anchor: state.selection.main.anchor, head: state.doc.length }));
  return true;
};
var selectAll = ({ state, dispatch }) => {
  dispatch(state.update({ selection: { anchor: 0, head: state.doc.length }, userEvent: "select" }));
  return true;
};
var selectLine = ({ state, dispatch }) => {
  let ranges = selectedLineBlocks(state).map(({ from: from2, to }) => EditorSelection.range(from2, Math.min(to + 1, state.doc.length)));
  dispatch(state.update({ selection: EditorSelection.create(ranges), userEvent: "select" }));
  return true;
};
var selectParentSyntax = ({ state, dispatch }) => {
  let selection2 = updateSel(state.selection, (range4) => {
    var _a2;
    let stack = syntaxTree(state).resolveStack(range4.from, 1);
    for (let cur2 = stack; cur2; cur2 = cur2.next) {
      let { node: node56 } = cur2;
      if ((node56.from < range4.from && node56.to >= range4.to || node56.to > range4.to && node56.from <= range4.from) && ((_a2 = node56.parent) === null || _a2 === void 0 ? void 0 : _a2.parent))
        return EditorSelection.range(node56.to, node56.from);
    }
    return range4;
  });
  dispatch(setSel(state, selection2));
  return true;
};
var simplifySelection = ({ state, dispatch }) => {
  let cur2 = state.selection, selection2 = null;
  if (cur2.ranges.length > 1)
    selection2 = EditorSelection.create([cur2.main]);
  else if (!cur2.main.empty)
    selection2 = EditorSelection.create([EditorSelection.cursor(cur2.main.head)]);
  if (!selection2)
    return false;
  dispatch(setSel(state, selection2));
  return true;
};
function deleteBy(target, by) {
  if (target.state.readOnly)
    return false;
  let event = "delete.selection", { state } = target;
  let changes = state.changeByRange((range4) => {
    let { from: from2, to } = range4;
    if (from2 == to) {
      let towards = by(range4);
      if (towards < from2) {
        event = "delete.backward";
        towards = skipAtomic(target, towards, false);
      } else if (towards > from2) {
        event = "delete.forward";
        towards = skipAtomic(target, towards, true);
      }
      from2 = Math.min(from2, towards);
      to = Math.max(to, towards);
    } else {
      from2 = skipAtomic(target, from2, false);
      to = skipAtomic(target, to, true);
    }
    return from2 == to ? { range: range4 } : { changes: { from: from2, to }, range: EditorSelection.cursor(from2, from2 < range4.head ? -1 : 1) };
  });
  if (changes.changes.empty)
    return false;
  target.dispatch(state.update(changes, {
    scrollIntoView: true,
    userEvent: event,
    effects: event == "delete.selection" ? EditorView.announce.of(state.phrase("Selection deleted")) : void 0
  }));
  return true;
}
function skipAtomic(target, pos, forward) {
  if (target instanceof EditorView)
    for (let ranges of target.state.facet(EditorView.atomicRanges).map((f) => f(target)))
      ranges.between(pos, pos, (from2, to) => {
        if (from2 < pos && to > pos)
          pos = forward ? to : from2;
      });
  return pos;
}
var deleteByChar = (target, forward) => deleteBy(target, (range4) => {
  let pos = range4.from, { state } = target, line2 = state.doc.lineAt(pos), before, targetPos;
  if (!forward && pos > line2.from && pos < line2.from + 200 && !/[^ \t]/.test(before = line2.text.slice(0, pos - line2.from))) {
    if (before[before.length - 1] == "	")
      return pos - 1;
    let col = countColumn(before, state.tabSize), drop = col % getIndentUnit(state) || getIndentUnit(state);
    for (let i2 = 0; i2 < drop && before[before.length - 1 - i2] == " "; i2++)
      pos--;
    targetPos = pos;
  } else {
    targetPos = findClusterBreak(line2.text, pos - line2.from, forward, forward) + line2.from;
    if (targetPos == pos && line2.number != (forward ? state.doc.lines : 1))
      targetPos += forward ? 1 : -1;
  }
  return targetPos;
});
var deleteCharBackward = (view) => deleteByChar(view, false);
var deleteCharForward = (view) => deleteByChar(view, true);
var deleteByGroup = (target, forward) => deleteBy(target, (range4) => {
  let pos = range4.head, { state } = target, line2 = state.doc.lineAt(pos);
  let categorize = state.charCategorizer(pos);
  for (let cat = null; ; ) {
    if (pos == (forward ? line2.to : line2.from)) {
      if (pos == range4.head && line2.number != (forward ? state.doc.lines : 1))
        pos += forward ? 1 : -1;
      break;
    }
    let next2 = findClusterBreak(line2.text, pos - line2.from, forward) + line2.from;
    let nextChar2 = line2.text.slice(Math.min(pos, next2) - line2.from, Math.max(pos, next2) - line2.from);
    let nextCat = categorize(nextChar2);
    if (cat != null && nextCat != cat)
      break;
    if (nextChar2 != " " || pos != range4.head)
      cat = nextCat;
    pos = next2;
  }
  return pos;
});
var deleteGroupBackward = (target) => deleteByGroup(target, false);
var deleteGroupForward = (target) => deleteByGroup(target, true);
var deleteToLineEnd = (view) => deleteBy(view, (range4) => {
  let lineEnd = view.lineBlockAt(range4.head).to;
  return range4.head < lineEnd ? lineEnd : Math.min(view.state.doc.length, range4.head + 1);
});
var deleteLineBoundaryBackward = (view) => deleteBy(view, (range4) => {
  let lineStart = view.moveToLineBoundary(range4, false).head;
  return range4.head > lineStart ? lineStart : Math.max(0, range4.head - 1);
});
var deleteLineBoundaryForward = (view) => deleteBy(view, (range4) => {
  let lineStart = view.moveToLineBoundary(range4, true).head;
  return range4.head < lineStart ? lineStart : Math.min(view.state.doc.length, range4.head + 1);
});
var splitLine = ({ state, dispatch }) => {
  if (state.readOnly)
    return false;
  let changes = state.changeByRange((range4) => {
    return {
      changes: { from: range4.from, to: range4.to, insert: Text2.of(["", ""]) },
      range: EditorSelection.cursor(range4.from)
    };
  });
  dispatch(state.update(changes, { scrollIntoView: true, userEvent: "input" }));
  return true;
};
var transposeChars = ({ state, dispatch }) => {
  if (state.readOnly)
    return false;
  let changes = state.changeByRange((range4) => {
    if (!range4.empty || range4.from == 0 || range4.from == state.doc.length)
      return { range: range4 };
    let pos = range4.from, line2 = state.doc.lineAt(pos);
    let from2 = pos == line2.from ? pos - 1 : findClusterBreak(line2.text, pos - line2.from, false) + line2.from;
    let to = pos == line2.to ? pos + 1 : findClusterBreak(line2.text, pos - line2.from, true) + line2.from;
    return {
      changes: { from: from2, to, insert: state.doc.slice(pos, to).append(state.doc.slice(from2, pos)) },
      range: EditorSelection.cursor(to)
    };
  });
  if (changes.changes.empty)
    return false;
  dispatch(state.update(changes, { scrollIntoView: true, userEvent: "move.character" }));
  return true;
};
function selectedLineBlocks(state) {
  let blocks = [], upto = -1;
  for (let range4 of state.selection.ranges) {
    let startLine = state.doc.lineAt(range4.from), endLine = state.doc.lineAt(range4.to);
    if (!range4.empty && range4.to == endLine.from)
      endLine = state.doc.lineAt(range4.to - 1);
    if (upto >= startLine.number) {
      let prev2 = blocks[blocks.length - 1];
      prev2.to = endLine.to;
      prev2.ranges.push(range4);
    } else {
      blocks.push({ from: startLine.from, to: endLine.to, ranges: [range4] });
    }
    upto = endLine.number + 1;
  }
  return blocks;
}
function moveLine(state, dispatch, forward) {
  if (state.readOnly)
    return false;
  let changes = [], ranges = [];
  for (let block of selectedLineBlocks(state)) {
    if (forward ? block.to == state.doc.length : block.from == 0)
      continue;
    let nextLine = state.doc.lineAt(forward ? block.to + 1 : block.from - 1);
    let size = nextLine.length + 1;
    if (forward) {
      changes.push({ from: block.to, to: nextLine.to }, { from: block.from, insert: nextLine.text + state.lineBreak });
      for (let r3 of block.ranges)
        ranges.push(EditorSelection.range(Math.min(state.doc.length, r3.anchor + size), Math.min(state.doc.length, r3.head + size)));
    } else {
      changes.push({ from: nextLine.from, to: block.from }, { from: block.to, insert: state.lineBreak + nextLine.text });
      for (let r3 of block.ranges)
        ranges.push(EditorSelection.range(r3.anchor - size, r3.head - size));
    }
  }
  if (!changes.length)
    return false;
  dispatch(state.update({
    changes,
    scrollIntoView: true,
    selection: EditorSelection.create(ranges, state.selection.mainIndex),
    userEvent: "move.line"
  }));
  return true;
}
var moveLineUp = ({ state, dispatch }) => moveLine(state, dispatch, false);
var moveLineDown = ({ state, dispatch }) => moveLine(state, dispatch, true);
function copyLine(state, dispatch, forward) {
  if (state.readOnly)
    return false;
  let changes = [];
  for (let block of selectedLineBlocks(state)) {
    if (forward)
      changes.push({ from: block.from, insert: state.doc.slice(block.from, block.to) + state.lineBreak });
    else
      changes.push({ from: block.to, insert: state.lineBreak + state.doc.slice(block.from, block.to) });
  }
  dispatch(state.update({ changes, scrollIntoView: true, userEvent: "input.copyline" }));
  return true;
}
var copyLineUp = ({ state, dispatch }) => copyLine(state, dispatch, false);
var copyLineDown = ({ state, dispatch }) => copyLine(state, dispatch, true);
var deleteLine = (view) => {
  if (view.state.readOnly)
    return false;
  let { state } = view, changes = state.changes(selectedLineBlocks(state).map(({ from: from2, to }) => {
    if (from2 > 0)
      from2--;
    else if (to < state.doc.length)
      to++;
    return { from: from2, to };
  }));
  let selection2 = updateSel(state.selection, (range4) => view.moveVertically(range4, true)).map(changes);
  view.dispatch({ changes, selection: selection2, scrollIntoView: true, userEvent: "delete.line" });
  return true;
};
function isBetweenBrackets(state, pos) {
  if (/\(\)|\[\]|\{\}/.test(state.sliceDoc(pos - 1, pos + 1)))
    return { from: pos, to: pos };
  let context2 = syntaxTree(state).resolveInner(pos);
  let before = context2.childBefore(pos), after = context2.childAfter(pos), closedBy;
  if (before && after && before.to <= pos && after.from >= pos && (closedBy = before.type.prop(NodeProp.closedBy)) && closedBy.indexOf(after.name) > -1 && state.doc.lineAt(before.to).from == state.doc.lineAt(after.from).from && !/\S/.test(state.sliceDoc(before.to, after.from)))
    return { from: before.to, to: after.from };
  return null;
}
var insertNewlineAndIndent = /* @__PURE__ */ newlineAndIndent(false);
var insertBlankLine = /* @__PURE__ */ newlineAndIndent(true);
function newlineAndIndent(atEof) {
  return ({ state, dispatch }) => {
    if (state.readOnly)
      return false;
    let changes = state.changeByRange((range4) => {
      let { from: from2, to } = range4, line2 = state.doc.lineAt(from2);
      let explode = !atEof && from2 == to && isBetweenBrackets(state, from2);
      if (atEof)
        from2 = to = (to <= line2.to ? line2 : state.doc.lineAt(to)).to;
      let cx = new IndentContext(state, { simulateBreak: from2, simulateDoubleBreak: !!explode });
      let indent2 = getIndentation(cx, from2);
      if (indent2 == null)
        indent2 = countColumn(/^\s*/.exec(state.doc.lineAt(from2).text)[0], state.tabSize);
      while (to < line2.to && /\s/.test(line2.text[to - line2.from]))
        to++;
      if (explode)
        ({ from: from2, to } = explode);
      else if (from2 > line2.from && from2 < line2.from + 100 && !/\S/.test(line2.text.slice(0, from2)))
        from2 = line2.from;
      let insert2 = ["", indentString(state, indent2)];
      if (explode)
        insert2.push(indentString(state, cx.lineIndent(line2.from, -1)));
      return {
        changes: { from: from2, to, insert: Text2.of(insert2) },
        range: EditorSelection.cursor(from2 + 1 + insert2[1].length)
      };
    });
    dispatch(state.update(changes, { scrollIntoView: true, userEvent: "input" }));
    return true;
  };
}
function changeBySelectedLine(state, f) {
  let atLine = -1;
  return state.changeByRange((range4) => {
    let changes = [];
    for (let pos = range4.from; pos <= range4.to; ) {
      let line2 = state.doc.lineAt(pos);
      if (line2.number > atLine && (range4.empty || range4.to > line2.from)) {
        f(line2, changes, range4);
        atLine = line2.number;
      }
      pos = line2.to + 1;
    }
    let changeSet = state.changes(changes);
    return {
      changes,
      range: EditorSelection.range(changeSet.mapPos(range4.anchor, 1), changeSet.mapPos(range4.head, 1))
    };
  });
}
var indentSelection = ({ state, dispatch }) => {
  if (state.readOnly)
    return false;
  let updated = /* @__PURE__ */ Object.create(null);
  let context2 = new IndentContext(state, { overrideIndentation: (start) => {
    let found = updated[start];
    return found == null ? -1 : found;
  } });
  let changes = changeBySelectedLine(state, (line2, changes2, range4) => {
    let indent2 = getIndentation(context2, line2.from);
    if (indent2 == null)
      return;
    if (!/\S/.test(line2.text))
      indent2 = 0;
    let cur2 = /^\s*/.exec(line2.text)[0];
    let norm = indentString(state, indent2);
    if (cur2 != norm || range4.from < line2.from + cur2.length) {
      updated[line2.from] = indent2;
      changes2.push({ from: line2.from, to: line2.from + cur2.length, insert: norm });
    }
  });
  if (!changes.changes.empty)
    dispatch(state.update(changes, { userEvent: "indent" }));
  return true;
};
var indentMore = ({ state, dispatch }) => {
  if (state.readOnly)
    return false;
  dispatch(state.update(changeBySelectedLine(state, (line2, changes) => {
    changes.push({ from: line2.from, insert: state.facet(indentUnit) });
  }), { userEvent: "input.indent" }));
  return true;
};
var indentLess = ({ state, dispatch }) => {
  if (state.readOnly)
    return false;
  dispatch(state.update(changeBySelectedLine(state, (line2, changes) => {
    let space2 = /^\s*/.exec(line2.text)[0];
    if (!space2)
      return;
    let col = countColumn(space2, state.tabSize), keep = 0;
    let insert2 = indentString(state, Math.max(0, col - getIndentUnit(state)));
    while (keep < space2.length && keep < insert2.length && space2.charCodeAt(keep) == insert2.charCodeAt(keep))
      keep++;
    changes.push({ from: line2.from + keep, to: line2.from + space2.length, insert: insert2.slice(keep) });
  }), { userEvent: "delete.dedent" }));
  return true;
};
var emacsStyleKeymap = [
  { key: "Ctrl-b", run: cursorCharLeft, shift: selectCharLeft, preventDefault: true },
  { key: "Ctrl-f", run: cursorCharRight, shift: selectCharRight },
  { key: "Ctrl-p", run: cursorLineUp, shift: selectLineUp },
  { key: "Ctrl-n", run: cursorLineDown, shift: selectLineDown },
  { key: "Ctrl-a", run: cursorLineStart, shift: selectLineStart },
  { key: "Ctrl-e", run: cursorLineEnd, shift: selectLineEnd },
  { key: "Ctrl-d", run: deleteCharForward },
  { key: "Ctrl-h", run: deleteCharBackward },
  { key: "Ctrl-k", run: deleteToLineEnd },
  { key: "Ctrl-Alt-h", run: deleteGroupBackward },
  { key: "Ctrl-o", run: splitLine },
  { key: "Ctrl-t", run: transposeChars },
  { key: "Ctrl-v", run: cursorPageDown }
];
var standardKeymap = /* @__PURE__ */ [
  { key: "ArrowLeft", run: cursorCharLeft, shift: selectCharLeft, preventDefault: true },
  { key: "Mod-ArrowLeft", mac: "Alt-ArrowLeft", run: cursorGroupLeft, shift: selectGroupLeft, preventDefault: true },
  { mac: "Cmd-ArrowLeft", run: cursorLineBoundaryLeft, shift: selectLineBoundaryLeft, preventDefault: true },
  { key: "ArrowRight", run: cursorCharRight, shift: selectCharRight, preventDefault: true },
  { key: "Mod-ArrowRight", mac: "Alt-ArrowRight", run: cursorGroupRight, shift: selectGroupRight, preventDefault: true },
  { mac: "Cmd-ArrowRight", run: cursorLineBoundaryRight, shift: selectLineBoundaryRight, preventDefault: true },
  { key: "ArrowUp", run: cursorLineUp, shift: selectLineUp, preventDefault: true },
  { mac: "Cmd-ArrowUp", run: cursorDocStart, shift: selectDocStart },
  { mac: "Ctrl-ArrowUp", run: cursorPageUp, shift: selectPageUp },
  { key: "ArrowDown", run: cursorLineDown, shift: selectLineDown, preventDefault: true },
  { mac: "Cmd-ArrowDown", run: cursorDocEnd, shift: selectDocEnd },
  { mac: "Ctrl-ArrowDown", run: cursorPageDown, shift: selectPageDown },
  { key: "PageUp", run: cursorPageUp, shift: selectPageUp },
  { key: "PageDown", run: cursorPageDown, shift: selectPageDown },
  { key: "Home", run: cursorLineBoundaryBackward, shift: selectLineBoundaryBackward, preventDefault: true },
  { key: "Mod-Home", run: cursorDocStart, shift: selectDocStart },
  { key: "End", run: cursorLineBoundaryForward, shift: selectLineBoundaryForward, preventDefault: true },
  { key: "Mod-End", run: cursorDocEnd, shift: selectDocEnd },
  { key: "Enter", run: insertNewlineAndIndent },
  { key: "Mod-a", run: selectAll },
  { key: "Backspace", run: deleteCharBackward, shift: deleteCharBackward },
  { key: "Delete", run: deleteCharForward },
  { key: "Mod-Backspace", mac: "Alt-Backspace", run: deleteGroupBackward },
  { key: "Mod-Delete", mac: "Alt-Delete", run: deleteGroupForward },
  { mac: "Mod-Backspace", run: deleteLineBoundaryBackward },
  { mac: "Mod-Delete", run: deleteLineBoundaryForward }
].concat(/* @__PURE__ */ emacsStyleKeymap.map((b) => ({ mac: b.key, run: b.run, shift: b.shift })));
var defaultKeymap = /* @__PURE__ */ [
  { key: "Alt-ArrowLeft", mac: "Ctrl-ArrowLeft", run: cursorSyntaxLeft, shift: selectSyntaxLeft },
  { key: "Alt-ArrowRight", mac: "Ctrl-ArrowRight", run: cursorSyntaxRight, shift: selectSyntaxRight },
  { key: "Alt-ArrowUp", run: moveLineUp },
  { key: "Shift-Alt-ArrowUp", run: copyLineUp },
  { key: "Alt-ArrowDown", run: moveLineDown },
  { key: "Shift-Alt-ArrowDown", run: copyLineDown },
  { key: "Escape", run: simplifySelection },
  { key: "Mod-Enter", run: insertBlankLine },
  { key: "Alt-l", mac: "Ctrl-l", run: selectLine },
  { key: "Mod-i", run: selectParentSyntax, preventDefault: true },
  { key: "Mod-[", run: indentLess },
  { key: "Mod-]", run: indentMore },
  { key: "Mod-Alt-\\", run: indentSelection },
  { key: "Shift-Mod-k", run: deleteLine },
  { key: "Shift-Mod-\\", run: cursorMatchingBracket },
  { key: "Mod-/", run: toggleComment },
  { key: "Alt-A", run: toggleBlockComment }
].concat(standardKeymap);
var indentWithTab = { key: "Tab", run: indentMore, shift: indentLess };

// node_modules/crelt/index.js
function crelt() {
  var elt = arguments[0];
  if (typeof elt == "string")
    elt = document.createElement(elt);
  var i2 = 1, next2 = arguments[1];
  if (next2 && typeof next2 == "object" && next2.nodeType == null && !Array.isArray(next2)) {
    for (var name2 in next2)
      if (Object.prototype.hasOwnProperty.call(next2, name2)) {
        var value = next2[name2];
        if (typeof value == "string")
          elt.setAttribute(name2, value);
        else if (value != null)
          elt[name2] = value;
      }
    i2++;
  }
  for (; i2 < arguments.length; i2++)
    add(elt, arguments[i2]);
  return elt;
}
function add(elt, child) {
  if (typeof child == "string") {
    elt.appendChild(document.createTextNode(child));
  } else if (child == null) {
  } else if (child.nodeType != null) {
    elt.appendChild(child);
  } else if (Array.isArray(child)) {
    for (var i2 = 0; i2 < child.length; i2++)
      add(elt, child[i2]);
  } else {
    throw new RangeError("Unsupported child node: " + child);
  }
}

// node_modules/@codemirror/search/dist/index.js
var basicNormalize = typeof String.prototype.normalize == "function" ? (x2) => x2.normalize("NFKD") : (x2) => x2;
var SearchCursor = class {
  /**
  Create a text cursor. The query is the search string, `from` to
  `to` provides the region to search.
  
  When `normalize` is given, it will be called, on both the query
  string and the content it is matched against, before comparing.
  You can, for example, create a case-insensitive search by
  passing `s => s.toLowerCase()`.
  
  Text is always normalized with
  [`.normalize("NFKD")`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize)
  (when supported).
  */
  constructor(text2, query2, from2 = 0, to = text2.length, normalize3, test) {
    this.test = test;
    this.value = { from: 0, to: 0 };
    this.done = false;
    this.matches = [];
    this.buffer = "";
    this.bufferPos = 0;
    this.iter = text2.iterRange(from2, to);
    this.bufferStart = from2;
    this.normalize = normalize3 ? (x2) => normalize3(basicNormalize(x2)) : basicNormalize;
    this.query = this.normalize(query2);
  }
  peek() {
    if (this.bufferPos == this.buffer.length) {
      this.bufferStart += this.buffer.length;
      this.iter.next();
      if (this.iter.done)
        return -1;
      this.bufferPos = 0;
      this.buffer = this.iter.value;
    }
    return codePointAt(this.buffer, this.bufferPos);
  }
  /**
  Look for the next match. Updates the iterator's
  [`value`](https://codemirror.net/6/docs/ref/#search.SearchCursor.value) and
  [`done`](https://codemirror.net/6/docs/ref/#search.SearchCursor.done) properties. Should be called
  at least once before using the cursor.
  */
  next() {
    while (this.matches.length)
      this.matches.pop();
    return this.nextOverlapping();
  }
  /**
  The `next` method will ignore matches that partially overlap a
  previous match. This method behaves like `next`, but includes
  such matches.
  */
  nextOverlapping() {
    for (; ; ) {
      let next2 = this.peek();
      if (next2 < 0) {
        this.done = true;
        return this;
      }
      let str = fromCodePoint(next2), start = this.bufferStart + this.bufferPos;
      this.bufferPos += codePointSize(next2);
      let norm = this.normalize(str);
      for (let i2 = 0, pos = start; ; i2++) {
        let code = norm.charCodeAt(i2);
        let match2 = this.match(code, pos);
        if (i2 == norm.length - 1) {
          if (match2) {
            this.value = match2;
            return this;
          }
          break;
        }
        if (pos == start && i2 < str.length && str.charCodeAt(i2) == code)
          pos++;
      }
    }
  }
  match(code, pos) {
    let match2 = null;
    for (let i2 = 0; i2 < this.matches.length; i2 += 2) {
      let index = this.matches[i2], keep = false;
      if (this.query.charCodeAt(index) == code) {
        if (index == this.query.length - 1) {
          match2 = { from: this.matches[i2 + 1], to: pos + 1 };
        } else {
          this.matches[i2]++;
          keep = true;
        }
      }
      if (!keep) {
        this.matches.splice(i2, 2);
        i2 -= 2;
      }
    }
    if (this.query.charCodeAt(0) == code) {
      if (this.query.length == 1)
        match2 = { from: pos, to: pos + 1 };
      else
        this.matches.push(1, pos);
    }
    if (match2 && this.test && !this.test(match2.from, match2.to, this.buffer, this.bufferStart))
      match2 = null;
    return match2;
  }
};
if (typeof Symbol != "undefined")
  SearchCursor.prototype[Symbol.iterator] = function() {
    return this;
  };
var empty = { from: -1, to: -1, match: /* @__PURE__ */ /.*/.exec("") };
var baseFlags = "gm" + (/x/.unicode == null ? "" : "u");
var RegExpCursor = class {
  /**
  Create a cursor that will search the given range in the given
  document. `query` should be the raw pattern (as you'd pass it to
  `new RegExp`).
  */
  constructor(text2, query2, options, from2 = 0, to = text2.length) {
    this.text = text2;
    this.to = to;
    this.curLine = "";
    this.done = false;
    this.value = empty;
    if (/\\[sWDnr]|\n|\r|\[\^/.test(query2))
      return new MultilineRegExpCursor(text2, query2, options, from2, to);
    this.re = new RegExp(query2, baseFlags + ((options === null || options === void 0 ? void 0 : options.ignoreCase) ? "i" : ""));
    this.test = options === null || options === void 0 ? void 0 : options.test;
    this.iter = text2.iter();
    let startLine = text2.lineAt(from2);
    this.curLineStart = startLine.from;
    this.matchPos = toCharEnd(text2, from2);
    this.getLine(this.curLineStart);
  }
  getLine(skip) {
    this.iter.next(skip);
    if (this.iter.lineBreak) {
      this.curLine = "";
    } else {
      this.curLine = this.iter.value;
      if (this.curLineStart + this.curLine.length > this.to)
        this.curLine = this.curLine.slice(0, this.to - this.curLineStart);
      this.iter.next();
    }
  }
  nextLine() {
    this.curLineStart = this.curLineStart + this.curLine.length + 1;
    if (this.curLineStart > this.to)
      this.curLine = "";
    else
      this.getLine(0);
  }
  /**
  Move to the next match, if there is one.
  */
  next() {
    for (let off = this.matchPos - this.curLineStart; ; ) {
      this.re.lastIndex = off;
      let match2 = this.matchPos <= this.to && this.re.exec(this.curLine);
      if (match2) {
        let from2 = this.curLineStart + match2.index, to = from2 + match2[0].length;
        this.matchPos = toCharEnd(this.text, to + (from2 == to ? 1 : 0));
        if (from2 == this.curLineStart + this.curLine.length)
          this.nextLine();
        if ((from2 < to || from2 > this.value.to) && (!this.test || this.test(from2, to, match2))) {
          this.value = { from: from2, to, match: match2 };
          return this;
        }
        off = this.matchPos - this.curLineStart;
      } else if (this.curLineStart + this.curLine.length < this.to) {
        this.nextLine();
        off = 0;
      } else {
        this.done = true;
        return this;
      }
    }
  }
};
var flattened = /* @__PURE__ */ new WeakMap();
var FlattenedDoc = class _FlattenedDoc {
  constructor(from2, text2) {
    this.from = from2;
    this.text = text2;
  }
  get to() {
    return this.from + this.text.length;
  }
  static get(doc2, from2, to) {
    let cached = flattened.get(doc2);
    if (!cached || cached.from >= to || cached.to <= from2) {
      let flat = new _FlattenedDoc(from2, doc2.sliceString(from2, to));
      flattened.set(doc2, flat);
      return flat;
    }
    if (cached.from == from2 && cached.to == to)
      return cached;
    let { text: text2, from: cachedFrom } = cached;
    if (cachedFrom > from2) {
      text2 = doc2.sliceString(from2, cachedFrom) + text2;
      cachedFrom = from2;
    }
    if (cached.to < to)
      text2 += doc2.sliceString(cached.to, to);
    flattened.set(doc2, new _FlattenedDoc(cachedFrom, text2));
    return new _FlattenedDoc(from2, text2.slice(from2 - cachedFrom, to - cachedFrom));
  }
};
var MultilineRegExpCursor = class {
  constructor(text2, query2, options, from2, to) {
    this.text = text2;
    this.to = to;
    this.done = false;
    this.value = empty;
    this.matchPos = toCharEnd(text2, from2);
    this.re = new RegExp(query2, baseFlags + ((options === null || options === void 0 ? void 0 : options.ignoreCase) ? "i" : ""));
    this.test = options === null || options === void 0 ? void 0 : options.test;
    this.flat = FlattenedDoc.get(text2, from2, this.chunkEnd(
      from2 + 5e3
      /* Chunk.Base */
    ));
  }
  chunkEnd(pos) {
    return pos >= this.to ? this.to : this.text.lineAt(pos).to;
  }
  next() {
    for (; ; ) {
      let off = this.re.lastIndex = this.matchPos - this.flat.from;
      let match2 = this.re.exec(this.flat.text);
      if (match2 && !match2[0] && match2.index == off) {
        this.re.lastIndex = off + 1;
        match2 = this.re.exec(this.flat.text);
      }
      if (match2) {
        let from2 = this.flat.from + match2.index, to = from2 + match2[0].length;
        if ((this.flat.to >= this.to || match2.index + match2[0].length <= this.flat.text.length - 10) && (!this.test || this.test(from2, to, match2))) {
          this.value = { from: from2, to, match: match2 };
          this.matchPos = toCharEnd(this.text, to + (from2 == to ? 1 : 0));
          return this;
        }
      }
      if (this.flat.to == this.to) {
        this.done = true;
        return this;
      }
      this.flat = FlattenedDoc.get(this.text, this.flat.from, this.chunkEnd(this.flat.from + this.flat.text.length * 2));
    }
  }
};
if (typeof Symbol != "undefined") {
  RegExpCursor.prototype[Symbol.iterator] = MultilineRegExpCursor.prototype[Symbol.iterator] = function() {
    return this;
  };
}
function validRegExp(source) {
  try {
    new RegExp(source, baseFlags);
    return true;
  } catch (_a2) {
    return false;
  }
}
function toCharEnd(text2, pos) {
  if (pos >= text2.length)
    return pos;
  let line2 = text2.lineAt(pos), next2;
  while (pos < line2.to && (next2 = line2.text.charCodeAt(pos - line2.from)) >= 56320 && next2 < 57344)
    pos++;
  return pos;
}
function createLineDialog(view) {
  let line2 = String(view.state.doc.lineAt(view.state.selection.main.head).number);
  let input = crelt("input", { class: "cm-textfield", name: "line", value: line2 });
  let dom = crelt("form", {
    class: "cm-gotoLine",
    onkeydown: (event) => {
      if (event.keyCode == 27) {
        event.preventDefault();
        view.dispatch({ effects: dialogEffect.of(false) });
        view.focus();
      } else if (event.keyCode == 13) {
        event.preventDefault();
        go();
      }
    },
    onsubmit: (event) => {
      event.preventDefault();
      go();
    }
  }, crelt("label", view.state.phrase("Go to line"), ": ", input), " ", crelt("button", { class: "cm-button", type: "submit" }, view.state.phrase("go")));
  function go() {
    let match2 = /^([+-])?(\d+)?(:\d+)?(%)?$/.exec(input.value);
    if (!match2)
      return;
    let { state } = view, startLine = state.doc.lineAt(state.selection.main.head);
    let [, sign3, ln, cl, percent] = match2;
    let col = cl ? +cl.slice(1) : 0;
    let line3 = ln ? +ln : startLine.number;
    if (ln && percent) {
      let pc = line3 / 100;
      if (sign3)
        pc = pc * (sign3 == "-" ? -1 : 1) + startLine.number / state.doc.lines;
      line3 = Math.round(state.doc.lines * pc);
    } else if (ln && sign3) {
      line3 = line3 * (sign3 == "-" ? -1 : 1) + startLine.number;
    }
    let docLine = state.doc.line(Math.max(1, Math.min(state.doc.lines, line3)));
    let selection2 = EditorSelection.cursor(docLine.from + Math.max(0, Math.min(col, docLine.length)));
    view.dispatch({
      effects: [dialogEffect.of(false), EditorView.scrollIntoView(selection2.from, { y: "center" })],
      selection: selection2
    });
    view.focus();
  }
  return { dom };
}
var dialogEffect = /* @__PURE__ */ StateEffect.define();
var dialogField = /* @__PURE__ */ StateField.define({
  create() {
    return true;
  },
  update(value, tr) {
    for (let e3 of tr.effects)
      if (e3.is(dialogEffect))
        value = e3.value;
    return value;
  },
  provide: (f) => showPanel.from(f, (val) => val ? createLineDialog : null)
});
var gotoLine = (view) => {
  let panel = getPanel(view, createLineDialog);
  if (!panel) {
    let effects = [dialogEffect.of(true)];
    if (view.state.field(dialogField, false) == null)
      effects.push(StateEffect.appendConfig.of([dialogField, baseTheme$13]));
    view.dispatch({ effects });
    panel = getPanel(view, createLineDialog);
  }
  if (panel)
    panel.dom.querySelector("input").select();
  return true;
};
var baseTheme$13 = /* @__PURE__ */ EditorView.baseTheme({
  ".cm-panel.cm-gotoLine": {
    padding: "2px 6px 4px",
    "& label": { fontSize: "80%" }
  }
});
var defaultHighlightOptions = {
  highlightWordAroundCursor: false,
  minSelectionLength: 1,
  maxMatches: 100,
  wholeWords: false
};
var highlightConfig = /* @__PURE__ */ Facet.define({
  combine(options) {
    return combineConfig(options, defaultHighlightOptions, {
      highlightWordAroundCursor: (a2, b) => a2 || b,
      minSelectionLength: Math.min,
      maxMatches: Math.min
    });
  }
});
function highlightSelectionMatches(options) {
  let ext = [defaultTheme, matchHighlighter];
  if (options)
    ext.push(highlightConfig.of(options));
  return ext;
}
var matchDeco = /* @__PURE__ */ Decoration.mark({ class: "cm-selectionMatch" });
var mainMatchDeco = /* @__PURE__ */ Decoration.mark({ class: "cm-selectionMatch cm-selectionMatch-main" });
function insideWordBoundaries(check, state, from2, to) {
  return (from2 == 0 || check(state.sliceDoc(from2 - 1, from2)) != CharCategory.Word) && (to == state.doc.length || check(state.sliceDoc(to, to + 1)) != CharCategory.Word);
}
function insideWord(check, state, from2, to) {
  return check(state.sliceDoc(from2, from2 + 1)) == CharCategory.Word && check(state.sliceDoc(to - 1, to)) == CharCategory.Word;
}
var matchHighlighter = /* @__PURE__ */ ViewPlugin.fromClass(class {
  constructor(view) {
    this.decorations = this.getDeco(view);
  }
  update(update) {
    if (update.selectionSet || update.docChanged || update.viewportChanged)
      this.decorations = this.getDeco(update.view);
  }
  getDeco(view) {
    let conf = view.state.facet(highlightConfig);
    let { state } = view, sel = state.selection;
    if (sel.ranges.length > 1)
      return Decoration.none;
    let range4 = sel.main, query2, check = null;
    if (range4.empty) {
      if (!conf.highlightWordAroundCursor)
        return Decoration.none;
      let word = state.wordAt(range4.head);
      if (!word)
        return Decoration.none;
      check = state.charCategorizer(range4.head);
      query2 = state.sliceDoc(word.from, word.to);
    } else {
      let len = range4.to - range4.from;
      if (len < conf.minSelectionLength || len > 200)
        return Decoration.none;
      if (conf.wholeWords) {
        query2 = state.sliceDoc(range4.from, range4.to);
        check = state.charCategorizer(range4.head);
        if (!(insideWordBoundaries(check, state, range4.from, range4.to) && insideWord(check, state, range4.from, range4.to)))
          return Decoration.none;
      } else {
        query2 = state.sliceDoc(range4.from, range4.to).trim();
        if (!query2)
          return Decoration.none;
      }
    }
    let deco = [];
    for (let part of view.visibleRanges) {
      let cursor3 = new SearchCursor(state.doc, query2, part.from, part.to);
      while (!cursor3.next().done) {
        let { from: from2, to } = cursor3.value;
        if (!check || insideWordBoundaries(check, state, from2, to)) {
          if (range4.empty && from2 <= range4.from && to >= range4.to)
            deco.push(mainMatchDeco.range(from2, to));
          else if (from2 >= range4.to || to <= range4.from)
            deco.push(matchDeco.range(from2, to));
          if (deco.length > conf.maxMatches)
            return Decoration.none;
        }
      }
    }
    return Decoration.set(deco);
  }
}, {
  decorations: (v4) => v4.decorations
});
var defaultTheme = /* @__PURE__ */ EditorView.baseTheme({
  ".cm-selectionMatch": { backgroundColor: "#99ff7780" },
  ".cm-searchMatch .cm-selectionMatch": { backgroundColor: "transparent" }
});
var selectWord = ({ state, dispatch }) => {
  let { selection: selection2 } = state;
  let newSel = EditorSelection.create(selection2.ranges.map((range4) => state.wordAt(range4.head) || EditorSelection.cursor(range4.head)), selection2.mainIndex);
  if (newSel.eq(selection2))
    return false;
  dispatch(state.update({ selection: newSel }));
  return true;
};
function findNextOccurrence(state, query2) {
  let { main, ranges } = state.selection;
  let word = state.wordAt(main.head), fullWord = word && word.from == main.from && word.to == main.to;
  for (let cycled = false, cursor3 = new SearchCursor(state.doc, query2, ranges[ranges.length - 1].to); ; ) {
    cursor3.next();
    if (cursor3.done) {
      if (cycled)
        return null;
      cursor3 = new SearchCursor(state.doc, query2, 0, Math.max(0, ranges[ranges.length - 1].from - 1));
      cycled = true;
    } else {
      if (cycled && ranges.some((r3) => r3.from == cursor3.value.from))
        continue;
      if (fullWord) {
        let word2 = state.wordAt(cursor3.value.from);
        if (!word2 || word2.from != cursor3.value.from || word2.to != cursor3.value.to)
          continue;
      }
      return cursor3.value;
    }
  }
}
var selectNextOccurrence = ({ state, dispatch }) => {
  let { ranges } = state.selection;
  if (ranges.some((sel) => sel.from === sel.to))
    return selectWord({ state, dispatch });
  let searchedText = state.sliceDoc(ranges[0].from, ranges[0].to);
  if (state.selection.ranges.some((r3) => state.sliceDoc(r3.from, r3.to) != searchedText))
    return false;
  let range4 = findNextOccurrence(state, searchedText);
  if (!range4)
    return false;
  dispatch(state.update({
    selection: state.selection.addRange(EditorSelection.range(range4.from, range4.to), false),
    effects: EditorView.scrollIntoView(range4.to)
  }));
  return true;
};
var searchConfigFacet = /* @__PURE__ */ Facet.define({
  combine(configs) {
    return combineConfig(configs, {
      top: false,
      caseSensitive: false,
      literal: false,
      regexp: false,
      wholeWord: false,
      createPanel: (view) => new SearchPanel(view),
      scrollToMatch: (range4) => EditorView.scrollIntoView(range4)
    });
  }
});
var SearchQuery = class {
  /**
  Create a query object.
  */
  constructor(config2) {
    this.search = config2.search;
    this.caseSensitive = !!config2.caseSensitive;
    this.literal = !!config2.literal;
    this.regexp = !!config2.regexp;
    this.replace = config2.replace || "";
    this.valid = !!this.search && (!this.regexp || validRegExp(this.search));
    this.unquoted = this.unquote(this.search);
    this.wholeWord = !!config2.wholeWord;
  }
  /**
  @internal
  */
  unquote(text2) {
    return this.literal ? text2 : text2.replace(/\\([nrt\\])/g, (_, ch) => ch == "n" ? "\n" : ch == "r" ? "\r" : ch == "t" ? "	" : "\\");
  }
  /**
  Compare this query to another query.
  */
  eq(other) {
    return this.search == other.search && this.replace == other.replace && this.caseSensitive == other.caseSensitive && this.regexp == other.regexp && this.wholeWord == other.wholeWord;
  }
  /**
  @internal
  */
  create() {
    return this.regexp ? new RegExpQuery(this) : new StringQuery(this);
  }
  /**
  Get a search cursor for this query, searching through the given
  range in the given state.
  */
  getCursor(state, from2 = 0, to) {
    let st = state.doc ? state : EditorState.create({ doc: state });
    if (to == null)
      to = st.doc.length;
    return this.regexp ? regexpCursor(this, st, from2, to) : stringCursor(this, st, from2, to);
  }
};
var QueryType2 = class {
  constructor(spec) {
    this.spec = spec;
  }
};
function stringCursor(spec, state, from2, to) {
  return new SearchCursor(state.doc, spec.unquoted, from2, to, spec.caseSensitive ? void 0 : (x2) => x2.toLowerCase(), spec.wholeWord ? stringWordTest(state.doc, state.charCategorizer(state.selection.main.head)) : void 0);
}
function stringWordTest(doc2, categorizer) {
  return (from2, to, buf, bufPos) => {
    if (bufPos > from2 || bufPos + buf.length < to) {
      bufPos = Math.max(0, from2 - 2);
      buf = doc2.sliceString(bufPos, Math.min(doc2.length, to + 2));
    }
    return (categorizer(charBefore(buf, from2 - bufPos)) != CharCategory.Word || categorizer(charAfter(buf, from2 - bufPos)) != CharCategory.Word) && (categorizer(charAfter(buf, to - bufPos)) != CharCategory.Word || categorizer(charBefore(buf, to - bufPos)) != CharCategory.Word);
  };
}
var StringQuery = class extends QueryType2 {
  constructor(spec) {
    super(spec);
  }
  nextMatch(state, curFrom, curTo) {
    let cursor3 = stringCursor(this.spec, state, curTo, state.doc.length).nextOverlapping();
    if (cursor3.done)
      cursor3 = stringCursor(this.spec, state, 0, curFrom).nextOverlapping();
    return cursor3.done ? null : cursor3.value;
  }
  // Searching in reverse is, rather than implementing an inverted search
  // cursor, done by scanning chunk after chunk forward.
  prevMatchInRange(state, from2, to) {
    for (let pos = to; ; ) {
      let start = Math.max(from2, pos - 1e4 - this.spec.unquoted.length);
      let cursor3 = stringCursor(this.spec, state, start, pos), range4 = null;
      while (!cursor3.nextOverlapping().done)
        range4 = cursor3.value;
      if (range4)
        return range4;
      if (start == from2)
        return null;
      pos -= 1e4;
    }
  }
  prevMatch(state, curFrom, curTo) {
    return this.prevMatchInRange(state, 0, curFrom) || this.prevMatchInRange(state, curTo, state.doc.length);
  }
  getReplacement(_result) {
    return this.spec.unquote(this.spec.replace);
  }
  matchAll(state, limit) {
    let cursor3 = stringCursor(this.spec, state, 0, state.doc.length), ranges = [];
    while (!cursor3.next().done) {
      if (ranges.length >= limit)
        return null;
      ranges.push(cursor3.value);
    }
    return ranges;
  }
  highlight(state, from2, to, add2) {
    let cursor3 = stringCursor(this.spec, state, Math.max(0, from2 - this.spec.unquoted.length), Math.min(to + this.spec.unquoted.length, state.doc.length));
    while (!cursor3.next().done)
      add2(cursor3.value.from, cursor3.value.to);
  }
};
function regexpCursor(spec, state, from2, to) {
  return new RegExpCursor(state.doc, spec.search, {
    ignoreCase: !spec.caseSensitive,
    test: spec.wholeWord ? regexpWordTest(state.charCategorizer(state.selection.main.head)) : void 0
  }, from2, to);
}
function charBefore(str, index) {
  return str.slice(findClusterBreak(str, index, false), index);
}
function charAfter(str, index) {
  return str.slice(index, findClusterBreak(str, index));
}
function regexpWordTest(categorizer) {
  return (_from, _to, match2) => !match2[0].length || (categorizer(charBefore(match2.input, match2.index)) != CharCategory.Word || categorizer(charAfter(match2.input, match2.index)) != CharCategory.Word) && (categorizer(charAfter(match2.input, match2.index + match2[0].length)) != CharCategory.Word || categorizer(charBefore(match2.input, match2.index + match2[0].length)) != CharCategory.Word);
}
var RegExpQuery = class extends QueryType2 {
  nextMatch(state, curFrom, curTo) {
    let cursor3 = regexpCursor(this.spec, state, curTo, state.doc.length).next();
    if (cursor3.done)
      cursor3 = regexpCursor(this.spec, state, 0, curFrom).next();
    return cursor3.done ? null : cursor3.value;
  }
  prevMatchInRange(state, from2, to) {
    for (let size = 1; ; size++) {
      let start = Math.max(
        from2,
        to - size * 1e4
        /* FindPrev.ChunkSize */
      );
      let cursor3 = regexpCursor(this.spec, state, start, to), range4 = null;
      while (!cursor3.next().done)
        range4 = cursor3.value;
      if (range4 && (start == from2 || range4.from > start + 10))
        return range4;
      if (start == from2)
        return null;
    }
  }
  prevMatch(state, curFrom, curTo) {
    return this.prevMatchInRange(state, 0, curFrom) || this.prevMatchInRange(state, curTo, state.doc.length);
  }
  getReplacement(result) {
    return this.spec.unquote(this.spec.replace.replace(/\$([$&\d+])/g, (m, i2) => i2 == "$" ? "$" : i2 == "&" ? result.match[0] : i2 != "0" && +i2 < result.match.length ? result.match[i2] : m));
  }
  matchAll(state, limit) {
    let cursor3 = regexpCursor(this.spec, state, 0, state.doc.length), ranges = [];
    while (!cursor3.next().done) {
      if (ranges.length >= limit)
        return null;
      ranges.push(cursor3.value);
    }
    return ranges;
  }
  highlight(state, from2, to, add2) {
    let cursor3 = regexpCursor(this.spec, state, Math.max(
      0,
      from2 - 250
      /* RegExp.HighlightMargin */
    ), Math.min(to + 250, state.doc.length));
    while (!cursor3.next().done)
      add2(cursor3.value.from, cursor3.value.to);
  }
};
var setSearchQuery = /* @__PURE__ */ StateEffect.define();
var togglePanel = /* @__PURE__ */ StateEffect.define();
var searchState = /* @__PURE__ */ StateField.define({
  create(state) {
    return new SearchState(defaultQuery(state).create(), null);
  },
  update(value, tr) {
    for (let effect of tr.effects) {
      if (effect.is(setSearchQuery))
        value = new SearchState(effect.value.create(), value.panel);
      else if (effect.is(togglePanel))
        value = new SearchState(value.query, effect.value ? createSearchPanel : null);
    }
    return value;
  },
  provide: (f) => showPanel.from(f, (val) => val.panel)
});
var SearchState = class {
  constructor(query2, panel) {
    this.query = query2;
    this.panel = panel;
  }
};
var matchMark = /* @__PURE__ */ Decoration.mark({ class: "cm-searchMatch" });
var selectedMatchMark = /* @__PURE__ */ Decoration.mark({ class: "cm-searchMatch cm-searchMatch-selected" });
var searchHighlighter = /* @__PURE__ */ ViewPlugin.fromClass(class {
  constructor(view) {
    this.view = view;
    this.decorations = this.highlight(view.state.field(searchState));
  }
  update(update) {
    let state = update.state.field(searchState);
    if (state != update.startState.field(searchState) || update.docChanged || update.selectionSet || update.viewportChanged)
      this.decorations = this.highlight(state);
  }
  highlight({ query: query2, panel }) {
    if (!panel || !query2.spec.valid)
      return Decoration.none;
    let { view } = this;
    let builder = new RangeSetBuilder();
    for (let i2 = 0, ranges = view.visibleRanges, l = ranges.length; i2 < l; i2++) {
      let { from: from2, to } = ranges[i2];
      while (i2 < l - 1 && to > ranges[i2 + 1].from - 2 * 250)
        to = ranges[++i2].to;
      query2.highlight(view.state, from2, to, (from3, to2) => {
        let selected = view.state.selection.ranges.some((r3) => r3.from == from3 && r3.to == to2);
        builder.add(from3, to2, selected ? selectedMatchMark : matchMark);
      });
    }
    return builder.finish();
  }
}, {
  decorations: (v4) => v4.decorations
});
function searchCommand(f) {
  return (view) => {
    let state = view.state.field(searchState, false);
    return state && state.query.spec.valid ? f(view, state) : openSearchPanel(view);
  };
}
var findNext = /* @__PURE__ */ searchCommand((view, { query: query2 }) => {
  let { to } = view.state.selection.main;
  let next2 = query2.nextMatch(view.state, to, to);
  if (!next2)
    return false;
  let selection2 = EditorSelection.single(next2.from, next2.to);
  let config2 = view.state.facet(searchConfigFacet);
  view.dispatch({
    selection: selection2,
    effects: [announceMatch(view, next2), config2.scrollToMatch(selection2.main, view)],
    userEvent: "select.search"
  });
  selectSearchInput(view);
  return true;
});
var findPrevious = /* @__PURE__ */ searchCommand((view, { query: query2 }) => {
  let { state } = view, { from: from2 } = state.selection.main;
  let prev2 = query2.prevMatch(state, from2, from2);
  if (!prev2)
    return false;
  let selection2 = EditorSelection.single(prev2.from, prev2.to);
  let config2 = view.state.facet(searchConfigFacet);
  view.dispatch({
    selection: selection2,
    effects: [announceMatch(view, prev2), config2.scrollToMatch(selection2.main, view)],
    userEvent: "select.search"
  });
  selectSearchInput(view);
  return true;
});
var selectMatches = /* @__PURE__ */ searchCommand((view, { query: query2 }) => {
  let ranges = query2.matchAll(view.state, 1e3);
  if (!ranges || !ranges.length)
    return false;
  view.dispatch({
    selection: EditorSelection.create(ranges.map((r3) => EditorSelection.range(r3.from, r3.to))),
    userEvent: "select.search.matches"
  });
  return true;
});
var selectSelectionMatches = ({ state, dispatch }) => {
  let sel = state.selection;
  if (sel.ranges.length > 1 || sel.main.empty)
    return false;
  let { from: from2, to } = sel.main;
  let ranges = [], main = 0;
  for (let cur2 = new SearchCursor(state.doc, state.sliceDoc(from2, to)); !cur2.next().done; ) {
    if (ranges.length > 1e3)
      return false;
    if (cur2.value.from == from2)
      main = ranges.length;
    ranges.push(EditorSelection.range(cur2.value.from, cur2.value.to));
  }
  dispatch(state.update({
    selection: EditorSelection.create(ranges, main),
    userEvent: "select.search.matches"
  }));
  return true;
};
var replaceNext = /* @__PURE__ */ searchCommand((view, { query: query2 }) => {
  let { state } = view, { from: from2, to } = state.selection.main;
  if (state.readOnly)
    return false;
  let next2 = query2.nextMatch(state, from2, from2);
  if (!next2)
    return false;
  let changes = [], selection2, replacement;
  let effects = [];
  if (next2.from == from2 && next2.to == to) {
    replacement = state.toText(query2.getReplacement(next2));
    changes.push({ from: next2.from, to: next2.to, insert: replacement });
    next2 = query2.nextMatch(state, next2.from, next2.to);
    effects.push(EditorView.announce.of(state.phrase("replaced match on line $", state.doc.lineAt(from2).number) + "."));
  }
  if (next2) {
    let off = changes.length == 0 || changes[0].from >= next2.to ? 0 : next2.to - next2.from - replacement.length;
    selection2 = EditorSelection.single(next2.from - off, next2.to - off);
    effects.push(announceMatch(view, next2));
    effects.push(state.facet(searchConfigFacet).scrollToMatch(selection2.main, view));
  }
  view.dispatch({
    changes,
    selection: selection2,
    effects,
    userEvent: "input.replace"
  });
  return true;
});
var replaceAll = /* @__PURE__ */ searchCommand((view, { query: query2 }) => {
  if (view.state.readOnly)
    return false;
  let changes = query2.matchAll(view.state, 1e9).map((match2) => {
    let { from: from2, to } = match2;
    return { from: from2, to, insert: query2.getReplacement(match2) };
  });
  if (!changes.length)
    return false;
  let announceText = view.state.phrase("replaced $ matches", changes.length) + ".";
  view.dispatch({
    changes,
    effects: EditorView.announce.of(announceText),
    userEvent: "input.replace.all"
  });
  return true;
});
function createSearchPanel(view) {
  return view.state.facet(searchConfigFacet).createPanel(view);
}
function defaultQuery(state, fallback) {
  var _a2, _b, _c, _d, _e;
  let sel = state.selection.main;
  let selText = sel.empty || sel.to > sel.from + 100 ? "" : state.sliceDoc(sel.from, sel.to);
  if (fallback && !selText)
    return fallback;
  let config2 = state.facet(searchConfigFacet);
  return new SearchQuery({
    search: ((_a2 = fallback === null || fallback === void 0 ? void 0 : fallback.literal) !== null && _a2 !== void 0 ? _a2 : config2.literal) ? selText : selText.replace(/\n/g, "\\n"),
    caseSensitive: (_b = fallback === null || fallback === void 0 ? void 0 : fallback.caseSensitive) !== null && _b !== void 0 ? _b : config2.caseSensitive,
    literal: (_c = fallback === null || fallback === void 0 ? void 0 : fallback.literal) !== null && _c !== void 0 ? _c : config2.literal,
    regexp: (_d = fallback === null || fallback === void 0 ? void 0 : fallback.regexp) !== null && _d !== void 0 ? _d : config2.regexp,
    wholeWord: (_e = fallback === null || fallback === void 0 ? void 0 : fallback.wholeWord) !== null && _e !== void 0 ? _e : config2.wholeWord
  });
}
function getSearchInput(view) {
  let panel = getPanel(view, createSearchPanel);
  return panel && panel.dom.querySelector("[main-field]");
}
function selectSearchInput(view) {
  let input = getSearchInput(view);
  if (input && input == view.root.activeElement)
    input.select();
}
var openSearchPanel = (view) => {
  let state = view.state.field(searchState, false);
  if (state && state.panel) {
    let searchInput = getSearchInput(view);
    if (searchInput && searchInput != view.root.activeElement) {
      let query2 = defaultQuery(view.state, state.query.spec);
      if (query2.valid)
        view.dispatch({ effects: setSearchQuery.of(query2) });
      searchInput.focus();
      searchInput.select();
    }
  } else {
    view.dispatch({ effects: [
      togglePanel.of(true),
      state ? setSearchQuery.of(defaultQuery(view.state, state.query.spec)) : StateEffect.appendConfig.of(searchExtensions)
    ] });
  }
  return true;
};
var closeSearchPanel = (view) => {
  let state = view.state.field(searchState, false);
  if (!state || !state.panel)
    return false;
  let panel = getPanel(view, createSearchPanel);
  if (panel && panel.dom.contains(view.root.activeElement))
    view.focus();
  view.dispatch({ effects: togglePanel.of(false) });
  return true;
};
var searchKeymap = [
  { key: "Mod-f", run: openSearchPanel, scope: "editor search-panel" },
  { key: "F3", run: findNext, shift: findPrevious, scope: "editor search-panel", preventDefault: true },
  { key: "Mod-g", run: findNext, shift: findPrevious, scope: "editor search-panel", preventDefault: true },
  { key: "Escape", run: closeSearchPanel, scope: "editor search-panel" },
  { key: "Mod-Shift-l", run: selectSelectionMatches },
  { key: "Alt-g", run: gotoLine },
  { key: "Mod-d", run: selectNextOccurrence, preventDefault: true }
];
var SearchPanel = class {
  constructor(view) {
    this.view = view;
    let query2 = this.query = view.state.field(searchState).query.spec;
    this.commit = this.commit.bind(this);
    this.searchField = crelt("input", {
      value: query2.search,
      placeholder: phrase(view, "Find"),
      "aria-label": phrase(view, "Find"),
      class: "cm-textfield",
      name: "search",
      form: "",
      "main-field": "true",
      onchange: this.commit,
      onkeyup: this.commit
    });
    this.replaceField = crelt("input", {
      value: query2.replace,
      placeholder: phrase(view, "Replace"),
      "aria-label": phrase(view, "Replace"),
      class: "cm-textfield",
      name: "replace",
      form: "",
      onchange: this.commit,
      onkeyup: this.commit
    });
    this.caseField = crelt("input", {
      type: "checkbox",
      name: "case",
      form: "",
      checked: query2.caseSensitive,
      onchange: this.commit
    });
    this.reField = crelt("input", {
      type: "checkbox",
      name: "re",
      form: "",
      checked: query2.regexp,
      onchange: this.commit
    });
    this.wordField = crelt("input", {
      type: "checkbox",
      name: "word",
      form: "",
      checked: query2.wholeWord,
      onchange: this.commit
    });
    function button(name2, onclick, content2) {
      return crelt("button", { class: "cm-button", name: name2, onclick, type: "button" }, content2);
    }
    this.dom = crelt("div", { onkeydown: (e3) => this.keydown(e3), class: "cm-search" }, [
      this.searchField,
      button("next", () => findNext(view), [phrase(view, "next")]),
      button("prev", () => findPrevious(view), [phrase(view, "previous")]),
      button("select", () => selectMatches(view), [phrase(view, "all")]),
      crelt("label", null, [this.caseField, phrase(view, "match case")]),
      crelt("label", null, [this.reField, phrase(view, "regexp")]),
      crelt("label", null, [this.wordField, phrase(view, "by word")]),
      ...view.state.readOnly ? [] : [
        crelt("br"),
        this.replaceField,
        button("replace", () => replaceNext(view), [phrase(view, "replace")]),
        button("replaceAll", () => replaceAll(view), [phrase(view, "replace all")])
      ],
      crelt("button", {
        name: "close",
        onclick: () => closeSearchPanel(view),
        "aria-label": phrase(view, "close"),
        type: "button"
      }, ["\xD7"])
    ]);
  }
  commit() {
    let query2 = new SearchQuery({
      search: this.searchField.value,
      caseSensitive: this.caseField.checked,
      regexp: this.reField.checked,
      wholeWord: this.wordField.checked,
      replace: this.replaceField.value
    });
    if (!query2.eq(this.query)) {
      this.query = query2;
      this.view.dispatch({ effects: setSearchQuery.of(query2) });
    }
  }
  keydown(e3) {
    if (runScopeHandlers(this.view, e3, "search-panel")) {
      e3.preventDefault();
    } else if (e3.keyCode == 13 && e3.target == this.searchField) {
      e3.preventDefault();
      (e3.shiftKey ? findPrevious : findNext)(this.view);
    } else if (e3.keyCode == 13 && e3.target == this.replaceField) {
      e3.preventDefault();
      replaceNext(this.view);
    }
  }
  update(update) {
    for (let tr of update.transactions)
      for (let effect of tr.effects) {
        if (effect.is(setSearchQuery) && !effect.value.eq(this.query))
          this.setQuery(effect.value);
      }
  }
  setQuery(query2) {
    this.query = query2;
    this.searchField.value = query2.search;
    this.replaceField.value = query2.replace;
    this.caseField.checked = query2.caseSensitive;
    this.reField.checked = query2.regexp;
    this.wordField.checked = query2.wholeWord;
  }
  mount() {
    this.searchField.select();
  }
  get pos() {
    return 80;
  }
  get top() {
    return this.view.state.facet(searchConfigFacet).top;
  }
};
function phrase(view, phrase2) {
  return view.state.phrase(phrase2);
}
var AnnounceMargin = 30;
var Break = /[\s\.,:;?!]/;
function announceMatch(view, { from: from2, to }) {
  let line2 = view.state.doc.lineAt(from2), lineEnd = view.state.doc.lineAt(to).to;
  let start = Math.max(line2.from, from2 - AnnounceMargin), end = Math.min(lineEnd, to + AnnounceMargin);
  let text2 = view.state.sliceDoc(start, end);
  if (start != line2.from) {
    for (let i2 = 0; i2 < AnnounceMargin; i2++)
      if (!Break.test(text2[i2 + 1]) && Break.test(text2[i2])) {
        text2 = text2.slice(i2);
        break;
      }
  }
  if (end != lineEnd) {
    for (let i2 = text2.length - 1; i2 > text2.length - AnnounceMargin; i2--)
      if (!Break.test(text2[i2 - 1]) && Break.test(text2[i2])) {
        text2 = text2.slice(0, i2);
        break;
      }
  }
  return EditorView.announce.of(`${view.state.phrase("current match")}. ${text2} ${view.state.phrase("on line")} ${line2.number}.`);
}
var baseTheme4 = /* @__PURE__ */ EditorView.baseTheme({
  ".cm-panel.cm-search": {
    padding: "2px 6px 4px",
    position: "relative",
    "& [name=close]": {
      position: "absolute",
      top: "0",
      right: "4px",
      backgroundColor: "inherit",
      border: "none",
      font: "inherit",
      padding: 0,
      margin: 0
    },
    "& input, & button, & label": {
      margin: ".2em .6em .2em 0"
    },
    "& input[type=checkbox]": {
      marginRight: ".2em"
    },
    "& label": {
      fontSize: "80%",
      whiteSpace: "pre"
    }
  },
  "&light .cm-searchMatch": { backgroundColor: "#ffff0054" },
  "&dark .cm-searchMatch": { backgroundColor: "#00ffff8a" },
  "&light .cm-searchMatch-selected": { backgroundColor: "#ff6a0054" },
  "&dark .cm-searchMatch-selected": { backgroundColor: "#ff00ff8a" }
});
var searchExtensions = [
  searchState,
  /* @__PURE__ */ Prec.low(searchHighlighter),
  baseTheme4
];

// node_modules/@codemirror/lint/dist/index.js
var SelectedDiagnostic = class {
  constructor(from2, to, diagnostic) {
    this.from = from2;
    this.to = to;
    this.diagnostic = diagnostic;
  }
};
var LintState = class _LintState {
  constructor(diagnostics, panel, selected) {
    this.diagnostics = diagnostics;
    this.panel = panel;
    this.selected = selected;
  }
  static init(diagnostics, panel, state) {
    let markedDiagnostics = diagnostics;
    let diagnosticFilter = state.facet(lintConfig).markerFilter;
    if (diagnosticFilter)
      markedDiagnostics = diagnosticFilter(markedDiagnostics);
    let ranges = Decoration.set(markedDiagnostics.map((d) => {
      return d.from == d.to || d.from == d.to - 1 && state.doc.lineAt(d.from).to == d.from ? Decoration.widget({
        widget: new DiagnosticWidget(d),
        diagnostic: d
      }).range(d.from) : Decoration.mark({
        attributes: { class: "cm-lintRange cm-lintRange-" + d.severity + (d.markClass ? " " + d.markClass : "") },
        diagnostic: d
      }).range(d.from, d.to);
    }), true);
    return new _LintState(ranges, panel, findDiagnostic(ranges));
  }
};
function findDiagnostic(diagnostics, diagnostic = null, after = 0) {
  let found = null;
  diagnostics.between(after, 1e9, (from2, to, { spec }) => {
    if (diagnostic && spec.diagnostic != diagnostic)
      return;
    found = new SelectedDiagnostic(from2, to, spec.diagnostic);
    return false;
  });
  return found;
}
function hideTooltip(tr, tooltip) {
  let line2 = tr.startState.doc.lineAt(tooltip.pos);
  return !!(tr.effects.some((e3) => e3.is(setDiagnosticsEffect)) || tr.changes.touchesRange(line2.from, line2.to));
}
function maybeEnableLint(state, effects) {
  return state.field(lintState, false) ? effects : effects.concat(StateEffect.appendConfig.of(lintExtensions));
}
var setDiagnosticsEffect = /* @__PURE__ */ StateEffect.define();
var togglePanel2 = /* @__PURE__ */ StateEffect.define();
var movePanelSelection = /* @__PURE__ */ StateEffect.define();
var lintState = /* @__PURE__ */ StateField.define({
  create() {
    return new LintState(Decoration.none, null, null);
  },
  update(value, tr) {
    if (tr.docChanged) {
      let mapped = value.diagnostics.map(tr.changes), selected = null;
      if (value.selected) {
        let selPos = tr.changes.mapPos(value.selected.from, 1);
        selected = findDiagnostic(mapped, value.selected.diagnostic, selPos) || findDiagnostic(mapped, null, selPos);
      }
      value = new LintState(mapped, value.panel, selected);
    }
    for (let effect of tr.effects) {
      if (effect.is(setDiagnosticsEffect)) {
        value = LintState.init(effect.value, value.panel, tr.state);
      } else if (effect.is(togglePanel2)) {
        value = new LintState(value.diagnostics, effect.value ? LintPanel.open : null, value.selected);
      } else if (effect.is(movePanelSelection)) {
        value = new LintState(value.diagnostics, value.panel, effect.value);
      }
    }
    return value;
  },
  provide: (f) => [
    showPanel.from(f, (val) => val.panel),
    EditorView.decorations.from(f, (s2) => s2.diagnostics)
  ]
});
var activeMark = /* @__PURE__ */ Decoration.mark({ class: "cm-lintRange cm-lintRange-active" });
function lintTooltip(view, pos, side) {
  let { diagnostics } = view.state.field(lintState);
  let found = [], stackStart = 2e8, stackEnd = 0;
  diagnostics.between(pos - (side < 0 ? 1 : 0), pos + (side > 0 ? 1 : 0), (from2, to, { spec }) => {
    if (pos >= from2 && pos <= to && (from2 == to || (pos > from2 || side > 0) && (pos < to || side < 0))) {
      found.push(spec.diagnostic);
      stackStart = Math.min(from2, stackStart);
      stackEnd = Math.max(to, stackEnd);
    }
  });
  let diagnosticFilter = view.state.facet(lintConfig).tooltipFilter;
  if (diagnosticFilter)
    found = diagnosticFilter(found);
  if (!found.length)
    return null;
  return {
    pos: stackStart,
    end: stackEnd,
    above: view.state.doc.lineAt(stackStart).to < stackEnd,
    create() {
      return { dom: diagnosticsTooltip(view, found) };
    }
  };
}
function diagnosticsTooltip(view, diagnostics) {
  return crelt("ul", { class: "cm-tooltip-lint" }, diagnostics.map((d) => renderDiagnostic(view, d, false)));
}
var openLintPanel = (view) => {
  let field = view.state.field(lintState, false);
  if (!field || !field.panel)
    view.dispatch({ effects: maybeEnableLint(view.state, [togglePanel2.of(true)]) });
  let panel = getPanel(view, LintPanel.open);
  if (panel)
    panel.dom.querySelector(".cm-panel-lint ul").focus();
  return true;
};
var closeLintPanel = (view) => {
  let field = view.state.field(lintState, false);
  if (!field || !field.panel)
    return false;
  view.dispatch({ effects: togglePanel2.of(false) });
  return true;
};
var nextDiagnostic = (view) => {
  let field = view.state.field(lintState, false);
  if (!field)
    return false;
  let sel = view.state.selection.main, next2 = field.diagnostics.iter(sel.to + 1);
  if (!next2.value) {
    next2 = field.diagnostics.iter(0);
    if (!next2.value || next2.from == sel.from && next2.to == sel.to)
      return false;
  }
  view.dispatch({ selection: { anchor: next2.from, head: next2.to }, scrollIntoView: true });
  return true;
};
var lintKeymap = [
  { key: "Mod-Shift-m", run: openLintPanel, preventDefault: true },
  { key: "F8", run: nextDiagnostic }
];
var lintConfig = /* @__PURE__ */ Facet.define({
  combine(input) {
    return Object.assign({ sources: input.map((i2) => i2.source) }, combineConfig(input.map((i2) => i2.config), {
      delay: 750,
      markerFilter: null,
      tooltipFilter: null,
      needsRefresh: null
    }, {
      needsRefresh: (a2, b) => !a2 ? b : !b ? a2 : (u) => a2(u) || b(u)
    }));
  }
});
function assignKeys(actions) {
  let assigned = [];
  if (actions)
    actions:
      for (let { name: name2 } of actions) {
        for (let i2 = 0; i2 < name2.length; i2++) {
          let ch = name2[i2];
          if (/[a-zA-Z]/.test(ch) && !assigned.some((c4) => c4.toLowerCase() == ch.toLowerCase())) {
            assigned.push(ch);
            continue actions;
          }
        }
        assigned.push("");
      }
  return assigned;
}
function renderDiagnostic(view, diagnostic, inPanel) {
  var _a2;
  let keys4 = inPanel ? assignKeys(diagnostic.actions) : [];
  return crelt("li", { class: "cm-diagnostic cm-diagnostic-" + diagnostic.severity }, crelt("span", { class: "cm-diagnosticText" }, diagnostic.renderMessage ? diagnostic.renderMessage() : diagnostic.message), (_a2 = diagnostic.actions) === null || _a2 === void 0 ? void 0 : _a2.map((action, i2) => {
    let fired = false, click = (e3) => {
      e3.preventDefault();
      if (fired)
        return;
      fired = true;
      let found = findDiagnostic(view.state.field(lintState).diagnostics, diagnostic);
      if (found)
        action.apply(view, found.from, found.to);
    };
    let { name: name2 } = action, keyIndex = keys4[i2] ? name2.indexOf(keys4[i2]) : -1;
    let nameElt = keyIndex < 0 ? name2 : [
      name2.slice(0, keyIndex),
      crelt("u", name2.slice(keyIndex, keyIndex + 1)),
      name2.slice(keyIndex + 1)
    ];
    return crelt("button", {
      type: "button",
      class: "cm-diagnosticAction",
      onclick: click,
      onmousedown: click,
      "aria-label": ` Action: ${name2}${keyIndex < 0 ? "" : ` (access key "${keys4[i2]})"`}.`
    }, nameElt);
  }), diagnostic.source && crelt("div", { class: "cm-diagnosticSource" }, diagnostic.source));
}
var DiagnosticWidget = class extends WidgetType {
  constructor(diagnostic) {
    super();
    this.diagnostic = diagnostic;
  }
  eq(other) {
    return other.diagnostic == this.diagnostic;
  }
  toDOM() {
    return crelt("span", { class: "cm-lintPoint cm-lintPoint-" + this.diagnostic.severity });
  }
};
var PanelItem = class {
  constructor(view, diagnostic) {
    this.diagnostic = diagnostic;
    this.id = "item_" + Math.floor(Math.random() * 4294967295).toString(16);
    this.dom = renderDiagnostic(view, diagnostic, true);
    this.dom.id = this.id;
    this.dom.setAttribute("role", "option");
  }
};
var LintPanel = class _LintPanel {
  constructor(view) {
    this.view = view;
    this.items = [];
    let onkeydown = (event) => {
      if (event.keyCode == 27) {
        closeLintPanel(this.view);
        this.view.focus();
      } else if (event.keyCode == 38 || event.keyCode == 33) {
        this.moveSelection((this.selectedIndex - 1 + this.items.length) % this.items.length);
      } else if (event.keyCode == 40 || event.keyCode == 34) {
        this.moveSelection((this.selectedIndex + 1) % this.items.length);
      } else if (event.keyCode == 36) {
        this.moveSelection(0);
      } else if (event.keyCode == 35) {
        this.moveSelection(this.items.length - 1);
      } else if (event.keyCode == 13) {
        this.view.focus();
      } else if (event.keyCode >= 65 && event.keyCode <= 90 && this.selectedIndex >= 0) {
        let { diagnostic } = this.items[this.selectedIndex], keys4 = assignKeys(diagnostic.actions);
        for (let i2 = 0; i2 < keys4.length; i2++)
          if (keys4[i2].toUpperCase().charCodeAt(0) == event.keyCode) {
            let found = findDiagnostic(this.view.state.field(lintState).diagnostics, diagnostic);
            if (found)
              diagnostic.actions[i2].apply(view, found.from, found.to);
          }
      } else {
        return;
      }
      event.preventDefault();
    };
    let onclick = (event) => {
      for (let i2 = 0; i2 < this.items.length; i2++) {
        if (this.items[i2].dom.contains(event.target))
          this.moveSelection(i2);
      }
    };
    this.list = crelt("ul", {
      tabIndex: 0,
      role: "listbox",
      "aria-label": this.view.state.phrase("Diagnostics"),
      onkeydown,
      onclick
    });
    this.dom = crelt("div", { class: "cm-panel-lint" }, this.list, crelt("button", {
      type: "button",
      name: "close",
      "aria-label": this.view.state.phrase("close"),
      onclick: () => closeLintPanel(this.view)
    }, "\xD7"));
    this.update();
  }
  get selectedIndex() {
    let selected = this.view.state.field(lintState).selected;
    if (!selected)
      return -1;
    for (let i2 = 0; i2 < this.items.length; i2++)
      if (this.items[i2].diagnostic == selected.diagnostic)
        return i2;
    return -1;
  }
  update() {
    let { diagnostics, selected } = this.view.state.field(lintState);
    let i2 = 0, needsSync = false, newSelectedItem = null;
    diagnostics.between(0, this.view.state.doc.length, (_start3, _end3, { spec }) => {
      let found = -1, item;
      for (let j = i2; j < this.items.length; j++)
        if (this.items[j].diagnostic == spec.diagnostic) {
          found = j;
          break;
        }
      if (found < 0) {
        item = new PanelItem(this.view, spec.diagnostic);
        this.items.splice(i2, 0, item);
        needsSync = true;
      } else {
        item = this.items[found];
        if (found > i2) {
          this.items.splice(i2, found - i2);
          needsSync = true;
        }
      }
      if (selected && item.diagnostic == selected.diagnostic) {
        if (!item.dom.hasAttribute("aria-selected")) {
          item.dom.setAttribute("aria-selected", "true");
          newSelectedItem = item;
        }
      } else if (item.dom.hasAttribute("aria-selected")) {
        item.dom.removeAttribute("aria-selected");
      }
      i2++;
    });
    while (i2 < this.items.length && !(this.items.length == 1 && this.items[0].diagnostic.from < 0)) {
      needsSync = true;
      this.items.pop();
    }
    if (this.items.length == 0) {
      this.items.push(new PanelItem(this.view, {
        from: -1,
        to: -1,
        severity: "info",
        message: this.view.state.phrase("No diagnostics")
      }));
      needsSync = true;
    }
    if (newSelectedItem) {
      this.list.setAttribute("aria-activedescendant", newSelectedItem.id);
      this.view.requestMeasure({
        key: this,
        read: () => ({ sel: newSelectedItem.dom.getBoundingClientRect(), panel: this.list.getBoundingClientRect() }),
        write: ({ sel, panel }) => {
          let scaleY = panel.height / this.list.offsetHeight;
          if (sel.top < panel.top)
            this.list.scrollTop -= (panel.top - sel.top) / scaleY;
          else if (sel.bottom > panel.bottom)
            this.list.scrollTop += (sel.bottom - panel.bottom) / scaleY;
        }
      });
    } else if (this.selectedIndex < 0) {
      this.list.removeAttribute("aria-activedescendant");
    }
    if (needsSync)
      this.sync();
  }
  sync() {
    let domPos = this.list.firstChild;
    function rm2() {
      let prev2 = domPos;
      domPos = prev2.nextSibling;
      prev2.remove();
    }
    for (let item of this.items) {
      if (item.dom.parentNode == this.list) {
        while (domPos != item.dom)
          rm2();
        domPos = item.dom.nextSibling;
      } else {
        this.list.insertBefore(item.dom, domPos);
      }
    }
    while (domPos)
      rm2();
  }
  moveSelection(selectedIndex) {
    if (this.selectedIndex < 0)
      return;
    let field = this.view.state.field(lintState);
    let selection2 = findDiagnostic(field.diagnostics, this.items[selectedIndex].diagnostic);
    if (!selection2)
      return;
    this.view.dispatch({
      selection: { anchor: selection2.from, head: selection2.to },
      scrollIntoView: true,
      effects: movePanelSelection.of(selection2)
    });
  }
  static open(view) {
    return new _LintPanel(view);
  }
};
function svg(content2, attrs = `viewBox="0 0 40 40"`) {
  return `url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${attrs}>${encodeURIComponent(content2)}</svg>')`;
}
function underline(color2) {
  return svg(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${color2}" fill="none" stroke-width=".7"/>`, `width="6" height="3"`);
}
var baseTheme5 = /* @__PURE__ */ EditorView.baseTheme({
  ".cm-diagnostic": {
    padding: "3px 6px 3px 8px",
    marginLeft: "-1px",
    display: "block",
    whiteSpace: "pre-wrap"
  },
  ".cm-diagnostic-error": { borderLeft: "5px solid #d11" },
  ".cm-diagnostic-warning": { borderLeft: "5px solid orange" },
  ".cm-diagnostic-info": { borderLeft: "5px solid #999" },
  ".cm-diagnostic-hint": { borderLeft: "5px solid #66d" },
  ".cm-diagnosticAction": {
    font: "inherit",
    border: "none",
    padding: "2px 4px",
    backgroundColor: "#444",
    color: "white",
    borderRadius: "3px",
    marginLeft: "8px",
    cursor: "pointer"
  },
  ".cm-diagnosticSource": {
    fontSize: "70%",
    opacity: 0.7
  },
  ".cm-lintRange": {
    backgroundPosition: "left bottom",
    backgroundRepeat: "repeat-x",
    paddingBottom: "0.7px"
  },
  ".cm-lintRange-error": { backgroundImage: /* @__PURE__ */ underline("#d11") },
  ".cm-lintRange-warning": { backgroundImage: /* @__PURE__ */ underline("orange") },
  ".cm-lintRange-info": { backgroundImage: /* @__PURE__ */ underline("#999") },
  ".cm-lintRange-hint": { backgroundImage: /* @__PURE__ */ underline("#66d") },
  ".cm-lintRange-active": { backgroundColor: "#ffdd9980" },
  ".cm-tooltip-lint": {
    padding: 0,
    margin: 0
  },
  ".cm-lintPoint": {
    position: "relative",
    "&:after": {
      content: '""',
      position: "absolute",
      bottom: 0,
      left: "-2px",
      borderLeft: "3px solid transparent",
      borderRight: "3px solid transparent",
      borderBottom: "4px solid #d11"
    }
  },
  ".cm-lintPoint-warning": {
    "&:after": { borderBottomColor: "orange" }
  },
  ".cm-lintPoint-info": {
    "&:after": { borderBottomColor: "#999" }
  },
  ".cm-lintPoint-hint": {
    "&:after": { borderBottomColor: "#66d" }
  },
  ".cm-panel.cm-panel-lint": {
    position: "relative",
    "& ul": {
      maxHeight: "100px",
      overflowY: "auto",
      "& [aria-selected]": {
        backgroundColor: "#ddd",
        "& u": { textDecoration: "underline" }
      },
      "&:focus [aria-selected]": {
        background_fallback: "#bdf",
        backgroundColor: "Highlight",
        color_fallback: "white",
        color: "HighlightText"
      },
      "& u": { textDecoration: "none" },
      padding: 0,
      margin: 0
    },
    "& [name=close]": {
      position: "absolute",
      top: "0",
      right: "2px",
      background: "inherit",
      border: "none",
      font: "inherit",
      padding: 0,
      margin: 0
    }
  }
});
var lintExtensions = [
  lintState,
  /* @__PURE__ */ EditorView.decorations.compute([lintState], (state) => {
    let { selected, panel } = state.field(lintState);
    return !selected || !panel || selected.from == selected.to ? Decoration.none : Decoration.set([
      activeMark.range(selected.from, selected.to)
    ]);
  }),
  /* @__PURE__ */ hoverTooltip(lintTooltip, { hideOn: hideTooltip }),
  baseTheme5
];

// node_modules/@uiw/codemirror-extensions-basic-setup/esm/index.js
var basicSetup = function basicSetup2(options) {
  if (options === void 0) {
    options = {};
  }
  var {
    crosshairCursor: initCrosshairCursor = false
  } = options;
  var keymaps = [];
  if (options.closeBracketsKeymap !== false) {
    keymaps = keymaps.concat(closeBracketsKeymap);
  }
  if (options.defaultKeymap !== false) {
    keymaps = keymaps.concat(defaultKeymap);
  }
  if (options.searchKeymap !== false) {
    keymaps = keymaps.concat(searchKeymap);
  }
  if (options.historyKeymap !== false) {
    keymaps = keymaps.concat(historyKeymap);
  }
  if (options.foldKeymap !== false) {
    keymaps = keymaps.concat(foldKeymap);
  }
  if (options.completionKeymap !== false) {
    keymaps = keymaps.concat(completionKeymap);
  }
  if (options.lintKeymap !== false) {
    keymaps = keymaps.concat(lintKeymap);
  }
  var extensions2 = [];
  if (options.lineNumbers !== false)
    extensions2.push(lineNumbers());
  if (options.highlightActiveLineGutter !== false)
    extensions2.push(highlightActiveLineGutter());
  if (options.highlightSpecialChars !== false)
    extensions2.push(highlightSpecialChars());
  if (options.history !== false)
    extensions2.push(history());
  if (options.foldGutter !== false)
    extensions2.push(foldGutter());
  if (options.drawSelection !== false)
    extensions2.push(drawSelection());
  if (options.dropCursor !== false)
    extensions2.push(dropCursor());
  if (options.allowMultipleSelections !== false)
    extensions2.push(EditorState.allowMultipleSelections.of(true));
  if (options.indentOnInput !== false)
    extensions2.push(indentOnInput());
  if (options.syntaxHighlighting !== false)
    extensions2.push(syntaxHighlighting(defaultHighlightStyle, {
      fallback: true
    }));
  if (options.bracketMatching !== false)
    extensions2.push(bracketMatching());
  if (options.closeBrackets !== false)
    extensions2.push(closeBrackets());
  if (options.autocompletion !== false)
    extensions2.push(autocompletion());
  if (options.rectangularSelection !== false)
    extensions2.push(rectangularSelection());
  if (initCrosshairCursor !== false)
    extensions2.push(crosshairCursor());
  if (options.highlightActiveLine !== false)
    extensions2.push(highlightActiveLine());
  if (options.highlightSelectionMatches !== false)
    extensions2.push(highlightSelectionMatches());
  if (options.tabSize && typeof options.tabSize === "number")
    extensions2.push(indentUnit.of(" ".repeat(options.tabSize)));
  return extensions2.concat([keymap.of(keymaps.flat())]).filter(Boolean);
};

// node_modules/@codemirror/theme-one-dark/dist/index.js
var chalky = "#e5c07b";
var coral = "#e06c75";
var cyan = "#56b6c2";
var invalid = "#ffffff";
var ivory = "#abb2bf";
var stone = "#7d8799";
var malibu = "#61afef";
var sage = "#98c379";
var whiskey = "#d19a66";
var violet = "#c678dd";
var darkBackground = "#21252b";
var highlightBackground = "#2c313a";
var background = "#282c34";
var tooltipBackground = "#353a42";
var selection = "#3E4451";
var cursor2 = "#528bff";
var oneDarkTheme = /* @__PURE__ */ EditorView.theme({
  "&": {
    color: ivory,
    backgroundColor: background
  },
  ".cm-content": {
    caretColor: cursor2
  },
  ".cm-cursor, .cm-dropCursor": { borderLeftColor: cursor2 },
  "&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection": { backgroundColor: selection },
  ".cm-panels": { backgroundColor: darkBackground, color: ivory },
  ".cm-panels.cm-panels-top": { borderBottom: "2px solid black" },
  ".cm-panels.cm-panels-bottom": { borderTop: "2px solid black" },
  ".cm-searchMatch": {
    backgroundColor: "#72a1ff59",
    outline: "1px solid #457dff"
  },
  ".cm-searchMatch.cm-searchMatch-selected": {
    backgroundColor: "#6199ff2f"
  },
  ".cm-activeLine": { backgroundColor: "#6699ff0b" },
  ".cm-selectionMatch": { backgroundColor: "#aafe661a" },
  "&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket": {
    backgroundColor: "#bad0f847"
  },
  ".cm-gutters": {
    backgroundColor: background,
    color: stone,
    border: "none"
  },
  ".cm-activeLineGutter": {
    backgroundColor: highlightBackground
  },
  ".cm-foldPlaceholder": {
    backgroundColor: "transparent",
    border: "none",
    color: "#ddd"
  },
  ".cm-tooltip": {
    border: "none",
    backgroundColor: tooltipBackground
  },
  ".cm-tooltip .cm-tooltip-arrow:before": {
    borderTopColor: "transparent",
    borderBottomColor: "transparent"
  },
  ".cm-tooltip .cm-tooltip-arrow:after": {
    borderTopColor: tooltipBackground,
    borderBottomColor: tooltipBackground
  },
  ".cm-tooltip-autocomplete": {
    "& > ul > li[aria-selected]": {
      backgroundColor: highlightBackground,
      color: ivory
    }
  }
}, { dark: true });
var oneDarkHighlightStyle = /* @__PURE__ */ HighlightStyle.define([
  {
    tag: tags.keyword,
    color: violet
  },
  {
    tag: [tags.name, tags.deleted, tags.character, tags.propertyName, tags.macroName],
    color: coral
  },
  {
    tag: [/* @__PURE__ */ tags.function(tags.variableName), tags.labelName],
    color: malibu
  },
  {
    tag: [tags.color, /* @__PURE__ */ tags.constant(tags.name), /* @__PURE__ */ tags.standard(tags.name)],
    color: whiskey
  },
  {
    tag: [/* @__PURE__ */ tags.definition(tags.name), tags.separator],
    color: ivory
  },
  {
    tag: [tags.typeName, tags.className, tags.number, tags.changed, tags.annotation, tags.modifier, tags.self, tags.namespace],
    color: chalky
  },
  {
    tag: [tags.operator, tags.operatorKeyword, tags.url, tags.escape, tags.regexp, tags.link, /* @__PURE__ */ tags.special(tags.string)],
    color: cyan
  },
  {
    tag: [tags.meta, tags.comment],
    color: stone
  },
  {
    tag: tags.strong,
    fontWeight: "bold"
  },
  {
    tag: tags.emphasis,
    fontStyle: "italic"
  },
  {
    tag: tags.strikethrough,
    textDecoration: "line-through"
  },
  {
    tag: tags.link,
    color: stone,
    textDecoration: "underline"
  },
  {
    tag: tags.heading,
    fontWeight: "bold",
    color: coral
  },
  {
    tag: [tags.atom, tags.bool, /* @__PURE__ */ tags.special(tags.variableName)],
    color: whiskey
  },
  {
    tag: [tags.processingInstruction, tags.string, tags.inserted],
    color: sage
  },
  {
    tag: tags.invalid,
    color: invalid
  }
]);
var oneDark = [oneDarkTheme, /* @__PURE__ */ syntaxHighlighting(oneDarkHighlightStyle)];

// node_modules/@uiw/react-codemirror/esm/theme/light.js
var defaultLightThemeOption = EditorView.theme({
  "&": {
    backgroundColor: "#fff"
  }
}, {
  dark: false
});

// node_modules/@uiw/react-codemirror/esm/getDefaultExtensions.js
var getDefaultExtensions = function getDefaultExtensions2(optios) {
  if (optios === void 0) {
    optios = {};
  }
  var {
    indentWithTab: defaultIndentWithTab = true,
    editable: editable2 = true,
    readOnly: readOnly2 = false,
    theme: theme3 = "light",
    placeholder: placeholderStr = "",
    basicSetup: defaultBasicSetup = true
  } = optios;
  var getExtensions = [];
  if (defaultIndentWithTab) {
    getExtensions.unshift(keymap.of([indentWithTab]));
  }
  if (defaultBasicSetup) {
    if (typeof defaultBasicSetup === "boolean") {
      getExtensions.unshift(basicSetup());
    } else {
      getExtensions.unshift(basicSetup(defaultBasicSetup));
    }
  }
  if (placeholderStr) {
    getExtensions.unshift(placeholder(placeholderStr));
  }
  switch (theme3) {
    case "light":
      getExtensions.push(defaultLightThemeOption);
      break;
    case "dark":
      getExtensions.push(oneDark);
      break;
    case "none":
      break;
    default:
      getExtensions.push(theme3);
      break;
  }
  if (editable2 === false) {
    getExtensions.push(EditorView.editable.of(false));
  }
  if (readOnly2) {
    getExtensions.push(EditorState.readOnly.of(true));
  }
  return [...getExtensions];
};

// node_modules/@uiw/react-codemirror/esm/utils.js
var getStatistics = (view) => {
  return {
    line: view.state.doc.lineAt(view.state.selection.main.from),
    lineCount: view.state.doc.lines,
    lineBreak: view.state.lineBreak,
    length: view.state.doc.length,
    readOnly: view.state.readOnly,
    tabSize: view.state.tabSize,
    selection: view.state.selection,
    selectionAsSingle: view.state.selection.asSingle().main,
    ranges: view.state.selection.ranges,
    selectionCode: view.state.sliceDoc(view.state.selection.main.from, view.state.selection.main.to),
    selections: view.state.selection.ranges.map((r3) => view.state.sliceDoc(r3.from, r3.to)),
    selectedText: view.state.selection.ranges.some((r3) => !r3.empty)
  };
};

// node_modules/@uiw/react-codemirror/esm/useCodeMirror.js
var External = Annotation.define();
var emptyExtensions = [];
function useCodeMirror(props) {
  var {
    value,
    selection: selection2,
    onChange,
    onStatistics,
    onCreateEditor,
    onUpdate,
    extensions: extensions2 = emptyExtensions,
    autoFocus,
    theme: theme3 = "light",
    height = null,
    minHeight = null,
    maxHeight = null,
    width = null,
    minWidth = null,
    maxWidth = null,
    placeholder: placeholderStr = "",
    editable: editable2 = true,
    readOnly: readOnly2 = false,
    indentWithTab: defaultIndentWithTab = true,
    basicSetup: defaultBasicSetup = true,
    root: root2,
    initialState
  } = props;
  var [container, setContainer] = (0, import_react61.useState)();
  var [view, setView] = (0, import_react61.useState)();
  var [state, setState] = (0, import_react61.useState)();
  var defaultThemeOption = EditorView.theme({
    "&": {
      height,
      minHeight,
      maxHeight,
      width,
      minWidth,
      maxWidth
    },
    "& .cm-scroller": {
      height: "100% !important"
    }
  });
  var updateListener2 = EditorView.updateListener.of((vu) => {
    if (vu.docChanged && typeof onChange === "function" && // Fix echoing of the remote changes:
    // If transaction is market as remote we don't have to call `onChange` handler again
    !vu.transactions.some((tr) => tr.annotation(External))) {
      var doc2 = vu.state.doc;
      var _value = doc2.toString();
      onChange(_value, vu);
    }
    onStatistics && onStatistics(getStatistics(vu));
  });
  var defaultExtensions = getDefaultExtensions({
    theme: theme3,
    editable: editable2,
    readOnly: readOnly2,
    placeholder: placeholderStr,
    indentWithTab: defaultIndentWithTab,
    basicSetup: defaultBasicSetup
  });
  var getExtensions = [updateListener2, defaultThemeOption, ...defaultExtensions];
  if (onUpdate && typeof onUpdate === "function") {
    getExtensions.push(EditorView.updateListener.of(onUpdate));
  }
  getExtensions = getExtensions.concat(extensions2);
  (0, import_react61.useEffect)(() => {
    if (container && !state) {
      var config2 = {
        doc: value,
        selection: selection2,
        extensions: getExtensions
      };
      var stateCurrent = initialState ? EditorState.fromJSON(initialState.json, config2, initialState.fields) : EditorState.create(config2);
      setState(stateCurrent);
      if (!view) {
        var viewCurrent = new EditorView({
          state: stateCurrent,
          parent: container,
          root: root2
        });
        setView(viewCurrent);
        onCreateEditor && onCreateEditor(viewCurrent, stateCurrent);
      }
    }
    return () => {
      if (view) {
        setState(void 0);
        setView(void 0);
      }
    };
  }, [container, state]);
  (0, import_react61.useEffect)(() => setContainer(props.container), [props.container]);
  (0, import_react61.useEffect)(() => () => {
    if (view) {
      view.destroy();
      setView(void 0);
    }
  }, [view]);
  (0, import_react61.useEffect)(() => {
    if (autoFocus && view) {
      view.focus();
    }
  }, [autoFocus, view]);
  (0, import_react61.useEffect)(() => {
    if (view) {
      view.dispatch({
        effects: StateEffect.reconfigure.of(getExtensions)
      });
    }
  }, [theme3, extensions2, height, minHeight, maxHeight, width, minWidth, maxWidth, placeholderStr, editable2, readOnly2, defaultIndentWithTab, defaultBasicSetup, onChange, onUpdate]);
  (0, import_react61.useEffect)(() => {
    if (value === void 0) {
      return;
    }
    var currentValue = view ? view.state.doc.toString() : "";
    if (view && value !== currentValue) {
      view.dispatch({
        changes: {
          from: 0,
          to: currentValue.length,
          insert: value || ""
        },
        annotations: [External.of(true)]
      });
    }
  }, [value, view]);
  return {
    state,
    setState,
    view,
    setView,
    container,
    setContainer
  };
}

// node_modules/@uiw/react-codemirror/esm/index.js
var import_jsx_runtime21 = __toESM(require_jsx_runtime());
var _excluded4 = ["className", "value", "selection", "extensions", "onChange", "onStatistics", "onCreateEditor", "onUpdate", "autoFocus", "theme", "height", "minHeight", "maxHeight", "width", "minWidth", "maxWidth", "basicSetup", "placeholder", "indentWithTab", "editable", "readOnly", "root", "initialState"];
var ReactCodeMirror = /* @__PURE__ */ (0, import_react62.forwardRef)((props, ref) => {
  var {
    className,
    value = "",
    selection: selection2,
    extensions: extensions2 = [],
    onChange,
    onStatistics,
    onCreateEditor,
    onUpdate,
    autoFocus,
    theme: theme3 = "light",
    height,
    minHeight,
    maxHeight,
    width,
    minWidth,
    maxWidth,
    basicSetup: basicSetup3,
    placeholder: placeholder2,
    indentWithTab: indentWithTab2,
    editable: editable2,
    readOnly: readOnly2,
    root: root2,
    initialState
  } = props, other = _objectWithoutPropertiesLoose(props, _excluded4);
  var editor = (0, import_react62.useRef)(null);
  var {
    state,
    view,
    container
  } = useCodeMirror({
    container: editor.current,
    root: root2,
    value,
    autoFocus,
    theme: theme3,
    height,
    minHeight,
    maxHeight,
    width,
    minWidth,
    maxWidth,
    basicSetup: basicSetup3,
    placeholder: placeholder2,
    indentWithTab: indentWithTab2,
    editable: editable2,
    readOnly: readOnly2,
    selection: selection2,
    onChange,
    onStatistics,
    onCreateEditor,
    onUpdate,
    extensions: extensions2,
    initialState
  });
  (0, import_react62.useImperativeHandle)(ref, () => ({
    editor: editor.current,
    state,
    view
  }), [editor, container, state, view]);
  if (typeof value !== "string") {
    throw new Error("value must be typeof string but got " + typeof value);
  }
  var defaultClassNames = typeof theme3 === "string" ? "cm-theme-" + theme3 : "cm-theme";
  return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", _extends({
    ref: editor,
    className: "" + defaultClassNames + (className ? " " + className : "")
  }, other));
});
ReactCodeMirror.displayName = "CodeMirror";
var esm_default = ReactCodeMirror;

// src/pages/tracing/SpanFilterConditionField.tsx
var import_relay_runtime2 = __toESM(require_relay_runtime2());
var codeMirrorCSS = css`
  flex: 1 1 auto;
  .cm-content {
    padding: var(--ac-global-dimension-static-size-100) 0;
  }
  .cm-editor {
    background-color: transparent;
  }
  .cm-focused {
    outline: none;
  }
  .cm-selectionLayer .cm-selectionBackground {
    background: var(--ac-global-color-cyan-400) !important;
  }
`;
var fieldCSS = css`
  border-width: var(--ac-global-border-size-thin);
  border-style: solid;
  border-color: var(--ac-global-input-field-border-color);
  border-radius: var(--ac-global-rounding-small);
  background-color: var(--ac-global-input-field-background-color);
  transition: all 0.2s ease-in-out;
  overflow-x: hidden;
  &:hover,
  &[data-is-focused="true"] {
    border-color: var(--ac-global-input-field-border-color-active);
    background-color: var(--ac-global-input-field-background-color-active);
  }
  &[data-is-invalid="true"] {
    border-color: var(--ac-global-color-danger);
  }
  box-sizing: border-box;
`;
function filterConditionCompletions(context2) {
  const word = context2.matchBefore(/\w*/);
  if (!word)
    return null;
  if (word.from == word.to && !context2.explicit)
    return null;
  return {
    from: word.from,
    options: [
      {
        label: "span_kind",
        type: "variable",
        info: "The span variant: CHAIN, LLM, RETRIEVER, TOOL, etc."
      },
      {
        label: "status_code",
        type: "variable",
        info: "The span status: OK, UNSET, or ERROR"
      },
      {
        label: "input.value",
        type: "variable",
        info: "The input value of a span, typically a query"
      },
      {
        label: "output.value",
        type: "variable",
        info: "The output value of a span, typically a response"
      },
      {
        label: "name",
        type: "variable",
        info: "The name given to a span - e.x. OpenAI"
      },
      {
        label: "latency_ms",
        type: "variable",
        info: "Latency (i.e. duration) in milliseconds"
      },
      {
        label: "cumulative_token_count.prompt",
        type: "variable",
        info: "Sum of token count for prompt from self and all child spans"
      },
      {
        label: "cumulative_token_count.completion",
        type: "variable",
        info: "Sum of token count for completion from self and all child spans"
      },
      {
        label: "cumulative_token_count.total",
        type: "variable",
        info: "Sum of token count total (prompt + completion) from self and all child spans"
      },
      {
        label: "llm spans",
        type: "text",
        apply: "span_kind == 'LLM'",
        detail: "macro"
      },
      {
        label: "retriever spans",
        type: "text",
        apply: "span_kind == 'RETRIEVER'",
        detail: "macro"
      },
      {
        label: "search input",
        type: "text",
        apply: "'' in input.value",
        detail: "macro"
      },
      {
        label: "search output",
        type: "text",
        apply: "'' in output.value",
        detail: "macro"
      },
      {
        label: "status_code error",
        type: "text",
        apply: "status_code == 'ERROR'",
        detail: "macro"
      },
      {
        label: "Latency >= 10s",
        type: "text",
        apply: "latency_ms >= 10_000",
        detail: "macro"
      },
      {
        label: "Tokens >= 1,000",
        type: "text",
        apply: "llm.token_count.total >= 1_000",
        detail: "macro"
      },
      {
        label: "Hallucinations",
        type: "text",
        apply: "evals['Hallucination'].label == 'hallucinated'",
        detail: "macro"
      }
    ]
  };
}
async function isConditionValid(condition) {
  if (!condition) {
    return {
      isValid: true,
      errorMessage: null
    };
  }
  const validationResult = await (0, import_relay_runtime2.fetchQuery)(
    RelayEnvironment_default,
    SpanFilterConditionFieldValidationQuery_graphql_default,
    { condition }
  ).toPromise();
  if (!validationResult) {
    throw new Error("Filter condition validation is null");
  }
  return validationResult.validateSpanFilterCondition;
}
var extensions = [
  keymap.of([
    {
      key: "Enter",
      run: (_editorView) => {
        return true;
      }
    }
  ]),
  python(),
  autocompletion({ override: [filterConditionCompletions] })
];
function SpanFilterConditionField(props) {
  const {
    onValidCondition,
    placeholder: placeholder2 = "filter condition (e.x. span_kind == 'LLM')"
  } = props;
  const [isFocused, setIsFocused] = (0, import_react63.useState)(false);
  const [errorMessage, setErrorMessage] = (0, import_react63.useState)("");
  const [filterCondition, setFilterCondition] = (0, import_react63.useState)("");
  const deferredFilterCondition = (0, import_react63.useDeferredValue)(filterCondition);
  const { theme: theme3 } = useTheme2();
  const codeMirrorTheme = theme3 === "dark" ? nord : void 0;
  const onAddFilterConditionSnippet = (0, import_react63.useCallback)(
    (additionalCondition) => {
      if (filterCondition.length > 0) {
        setFilterCondition(`${filterCondition} and ${additionalCondition}`);
      } else {
        setFilterCondition(additionalCondition);
      }
    },
    [filterCondition, setFilterCondition]
  );
  (0, import_react63.useEffect)(() => {
    isConditionValid(deferredFilterCondition).then((result) => {
      if (!result.isValid && result.errorMessage) {
        setErrorMessage(result.errorMessage);
      } else {
        setErrorMessage("");
        (0, import_react63.startTransition)(() => {
          onValidCondition(deferredFilterCondition);
        });
      }
    });
  }, [onValidCondition, deferredFilterCondition]);
  const hasError = errorMessage !== "";
  const hasCondition = filterCondition !== "";
  return /* @__PURE__ */ jsxs2(
    "div",
    {
      "data-is-focused": isFocused,
      "data-is-invalid": hasError,
      className: "span-filter-condition-field",
      css: fieldCSS,
      children: [
        /* @__PURE__ */ jsxs2(_Flex, { direction: "row", children: [
          /* @__PURE__ */ jsx5(AddonBefore, { children: /* @__PURE__ */ jsx5(Icon, { svg: /* @__PURE__ */ jsx5(Icons.Search, {}) }) }),
          /* @__PURE__ */ jsx5(
            esm_default,
            {
              css: codeMirrorCSS,
              basicSetup: {
                lineNumbers: false,
                foldGutter: false,
                bracketMatching: true,
                syntaxHighlighting: true,
                highlightActiveLine: false,
                highlightActiveLineGutter: false,
                defaultKeymap: false
              },
              onFocus: () => setIsFocused(true),
              onBlur: () => setIsFocused(false),
              value: filterCondition,
              onChange: setFilterCondition,
              height: "36px",
              width: "100%",
              theme: codeMirrorTheme,
              placeholder: placeholder2,
              extensions
            }
          ),
          /* @__PURE__ */ jsx5(
            "button",
            {
              css: css`
            margin-right: var(--ac-global-dimension-static-size-100);
            color: var(--ac-global-text-color-700);
            visibility: ${hasCondition ? "visible" : "hidden"};
          `,
              onClick: () => setFilterCondition(""),
              className: "button--reset",
              children: /* @__PURE__ */ jsx5(Icon, { svg: /* @__PURE__ */ jsx5(Icons.CloseCircleOutline, {}) })
            }
          ),
          /* @__PURE__ */ jsxs2(PopoverTrigger, { placement: "bottom right", children: [
            /* @__PURE__ */ jsx5(_TriggerWrap, { children: /* @__PURE__ */ jsx5(
              "button",
              {
                css: css`
                color: var(--ac-global-text-color-700);
                background-color: var(--ac-global-color-grey-400);
                padding-left: var(--ac-global-dimension-static-size-100);
                padding-right: var(--ac-global-dimension-static-size-100);
                height: 100%;
              `,
                className: "button--reset",
                children: /* @__PURE__ */ jsx5(Icon, { svg: /* @__PURE__ */ jsx5(Icons.PlusCircleOutline, {}) })
              }
            ) }),
            /* @__PURE__ */ jsx5(
              FilterConditionBuilder,
              {
                onAddFilterConditionSnippet
              }
            )
          ] })
        ] }),
        /* @__PURE__ */ jsxs2(TooltipTrigger, { isOpen: hasError && isFocused, placement: "bottom", children: [
          /* @__PURE__ */ jsx5(_TriggerWrap, { children: /* @__PURE__ */ jsx5("div", {}) }),
          /* @__PURE__ */ jsx5(_HelpTooltip, { children: errorMessage != "" ? /* @__PURE__ */ jsx5(_Text, { color: "danger", children: errorMessage }) : /* @__PURE__ */ jsx5(_Text, { color: "success", children: "Valid Expression" }) })
        ] })
      ]
    }
  );
}
function FilterConditionBuilder(props) {
  const { onAddFilterConditionSnippet } = props;
  return /* @__PURE__ */ jsx5(
    _View,
    {
      width: "500px",
      paddingTop: "size-200",
      paddingStart: "size-200",
      paddingEnd: "size-200",
      borderRadius: "medium",
      borderWidth: "thin",
      borderColor: "light",
      backgroundColor: "light",
      children: /* @__PURE__ */ jsxs2(_Form, { children: [
        /* @__PURE__ */ jsx5(
          FilterConditionSnippet,
          {
            label: "filter by kind",
            initialSnippet: "span_kind == 'LLM'",
            onAddFilterConditionSnippet
          },
          "kind"
        ),
        /* @__PURE__ */ jsx5(
          FilterConditionSnippet,
          {
            label: "filter by token count",
            initialSnippet: "cumulative_token_count.total > 1000",
            onAddFilterConditionSnippet
          },
          "token_count"
        ),
        /* @__PURE__ */ jsx5(
          FilterConditionSnippet,
          {
            label: "filter by evaluation label",
            initialSnippet: "evals['Hallucination'].label == 'hallucinated'",
            onAddFilterConditionSnippet
          },
          "eval_label"
        ),
        /* @__PURE__ */ jsx5(
          FilterConditionSnippet,
          {
            label: "filter by evaluation score",
            initialSnippet: "evals['Hallucination'].score < 1",
            onAddFilterConditionSnippet
          },
          "eval_score"
        )
      ] })
    }
  );
}
function FilterConditionSnippet(props) {
  const { initialSnippet, onAddFilterConditionSnippet } = props;
  const [snippet2, setSnippet] = (0, import_react63.useState)(initialSnippet);
  const { theme: theme3 } = useTheme2();
  const codeMirrorTheme = theme3 === "light" ? void 0 : nord;
  return /* @__PURE__ */ jsx5(_Field, { label: props.label, children: /* @__PURE__ */ jsxs2(_Flex, { direction: "row", width: "100%", gap: "size-100", children: [
    /* @__PURE__ */ jsx5(
      "div",
      {
        css: css(
          fieldCSS,
          css`
              flex: 1 1 auto;
            `
        ),
        children: /* @__PURE__ */ jsx5(
          esm_default,
          {
            value: snippet2,
            basicSetup: {
              lineNumbers: false,
              foldGutter: false,
              bracketMatching: true,
              syntaxHighlighting: true,
              highlightActiveLine: false,
              highlightActiveLineGutter: false
            },
            extensions: [python()],
            editable: true,
            onChange: setSnippet,
            theme: codeMirrorTheme,
            css: codeMirrorCSS
          }
        )
      }
    ),
    /* @__PURE__ */ jsx5(
      _Button,
      {
        title: "Add to filter condition",
        variant: "default",
        onClick: () => onAddFilterConditionSnippet(snippet2),
        icon: /* @__PURE__ */ jsx5(Icon, { svg: /* @__PURE__ */ jsx5(Icons.PlusCircleOutline, {}) })
      }
    )
  ] }) });
}

// src/pages/tracing/styles.tsx
var spansTableCSS = css`
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  overflow: hidden;
  .span-filter-condition-field {
    flex: 1 1 auto;
  }

  // Style the column selector
  .ac-dropdown-button {
    min-width: var(--ac-global-dimension-static-size-300);
  }
`;

// src/pages/tracing/tableUtils.ts
var EVALS_COLUMN_PREFIX = "evals";
var EVALS_KEY_SEPARATOR = ":";
var DEFAULT_SORT = {
  col: "startTime",
  dir: "desc"
};
function getGqlSort(sort) {
  let col = null, evalResultKey = null;
  if (sort.id && sort.id.startsWith(EVALS_COLUMN_PREFIX)) {
    const [, attr, name2] = sort.id.split(EVALS_KEY_SEPARATOR);
    evalResultKey = {
      attr,
      name: name2
    };
  } else {
    col = sort.id;
  }
  return {
    col,
    evalResultKey,
    dir: sort.desc ? "desc" : "asc"
  };
}

// src/pages/tracing/TokenCount.tsx
function TokenCount(props) {
  return /* @__PURE__ */ jsxs2(TooltipTrigger, { children: [
    /* @__PURE__ */ jsx5(_TriggerWrap, { children: /* @__PURE__ */ jsx5(TokenItem, { children: props.tokenCountTotal }) }),
    /* @__PURE__ */ jsx5(_Tooltip, { children: /* @__PURE__ */ jsxs2(_Flex, { direction: "column", gap: "size-50", children: [
      /* @__PURE__ */ jsxs2(_Flex, { direction: "row", gap: "size-100", justifyContent: "space-between", children: [
        "prompt tokens",
        /* @__PURE__ */ jsx5(TokenItem, { children: props.tokenCountPrompt })
      ] }),
      /* @__PURE__ */ jsxs2(_Flex, { direction: "row", gap: "size-100", justifyContent: "space-between", children: [
        "completion tokens",
        /* @__PURE__ */ jsx5(TokenItem, { children: props.tokenCountCompletion })
      ] })
    ] }) })
  ] });
}
function TokenItem({ children }) {
  return /* @__PURE__ */ jsxs2(_Flex, { direction: "row", gap: "size-25", alignItems: "center", children: [
    /* @__PURE__ */ jsx5(
      Icon,
      {
        svg: /* @__PURE__ */ jsx5(Icons.TokensOutline, {}),
        css: css`
          color: var(--ac-global-text-color-900);
        `
      }
    ),
    /* @__PURE__ */ jsx5(_Text, { children })
  ] });
}

// src/pages/tracing/SpansTable.tsx
var PAGE_SIZE = 100;
function SpansTable(props) {
  const { fetchKey } = useStreamState();
  const tableContainerRef = (0, import_react67.useRef)(null);
  const [sorting, setSorting] = (0, import_react67.useState)([]);
  const [filterCondition, setFilterCondition] = (0, import_react67.useState)("");
  const columnVisibility = useTracingContext((state) => state.columnVisibility);
  const navigate = useNavigate();
  const { data, loadNext, hasNext, isLoadingNext, refetch } = (0, import_react_relay3.usePaginationFragment)(
    SpansTable_spans_graphql_default,
    props.query
  );
  const evaluationVisibility = useTracingContext(
    (state) => state.evaluationVisibility
  );
  const visibleEvaluationColumnNames = (0, import_react67.useMemo)(() => {
    return Object.keys(evaluationVisibility).filter(
      (name2) => evaluationVisibility[name2]
    );
  }, [evaluationVisibility]);
  const tableData = (0, import_react67.useMemo)(() => {
    const tableData2 = data.spans.edges.map(({ span }) => span);
    return tableData2;
  }, [data]);
  const dynamicEvaluationColumns = visibleEvaluationColumnNames.map((name2) => {
    return {
      header: name2,
      columns: [
        {
          header: `label`,
          accessorKey: `${EVALS_COLUMN_PREFIX}${EVALS_KEY_SEPARATOR}label${EVALS_KEY_SEPARATOR}${name2}`,
          cell: ({ row }) => {
            const evaluation = row.original.spanEvaluations.find(
              (evaluation2) => evaluation2.name === name2
            );
            if (!evaluation) {
              return null;
            }
            return evaluation.label;
          }
        },
        {
          header: `score`,
          accessorKey: `${EVALS_COLUMN_PREFIX}${EVALS_KEY_SEPARATOR}score${EVALS_KEY_SEPARATOR}${name2}`,
          cell: ({ row }) => {
            const evaluation = row.original.spanEvaluations.find(
              (evaluation2) => evaluation2.name === name2
            );
            if (!evaluation) {
              return null;
            }
            return evaluation.score;
          }
        }
      ]
    };
  });
  const evaluationColumns = [
    {
      header: "evaluations",
      accessorKey: "spanEvaluations",
      enableSorting: false,
      cell: ({ row }) => {
        return /* @__PURE__ */ jsxs2(_Flex, { direction: "row", gap: "size-50", wrap: "wrap", children: [
          row.original.spanEvaluations.map((evaluation) => {
            return /* @__PURE__ */ jsx5(
              EvaluationLabel,
              {
                evaluation
              },
              evaluation.name
            );
          }),
          row.original.documentRetrievalMetrics.map((retrievalMetric) => {
            return /* @__PURE__ */ jsxs2(Fragment5, { children: [
              /* @__PURE__ */ jsx5(
                RetrievalEvaluationLabel,
                {
                  name: retrievalMetric.evaluationName,
                  metric: "ndcg",
                  score: retrievalMetric.ndcg
                },
                "ndcg"
              ),
              /* @__PURE__ */ jsx5(
                RetrievalEvaluationLabel,
                {
                  name: retrievalMetric.evaluationName,
                  metric: "precision",
                  score: retrievalMetric.precision
                },
                "precision"
              ),
              /* @__PURE__ */ jsx5(
                RetrievalEvaluationLabel,
                {
                  name: retrievalMetric.evaluationName,
                  metric: "hit",
                  score: retrievalMetric.hit
                },
                "hit"
              )
            ] });
          })
        ] });
      }
    },
    ...dynamicEvaluationColumns
  ];
  const columns2 = [
    {
      header: "kind",
      accessorKey: "spanKind",
      maxSize: 100,
      enableSorting: false,
      cell: ({ getValue }) => {
        return /* @__PURE__ */ jsx5(SpanKindLabel, { spanKind: getValue() });
      }
    },
    {
      header: "name",
      accessorKey: "name",
      enableSorting: false,
      cell: ({ getValue, row }) => {
        const { spanId, traceId } = row.original.context;
        return /* @__PURE__ */ jsx5(Link2, { to: `/tracing/traces/${traceId}?selectedSpanId=${spanId}`, children: getValue() });
      }
    },
    {
      header: "input",
      accessorKey: "input.value",
      cell: TextCell,
      enableSorting: false
    },
    {
      header: "output",
      accessorKey: "output.value",
      cell: TextCell,
      enableSorting: false
    },
    ...evaluationColumns,
    // TODO: consider hiding this column if there are no evals. For now we want people to know that there are evals
    {
      header: "start time",
      accessorKey: "startTime",
      cell: TimestampCell
    },
    {
      header: "latency",
      accessorKey: "latencyMs",
      cell: ({ getValue }) => {
        const value = getValue();
        if (value === null || typeof value !== "number") {
          return null;
        }
        return /* @__PURE__ */ jsx5(LatencyText, { latencyMs: value });
      }
    },
    {
      header: "total tokens",
      accessorKey: "tokenCountTotal",
      cell: ({ row, getValue }) => {
        const value = getValue();
        if (value === null) {
          return "--";
        }
        return /* @__PURE__ */ jsx5(
          TokenCount,
          {
            tokenCountTotal: value,
            tokenCountPrompt: row.original.tokenCountPrompt || 0,
            tokenCountCompletion: row.original.tokenCountCompletion || 0
          }
        );
      }
    },
    {
      header: "status",
      accessorKey: "statusCode",
      enableSorting: false,
      cell: ({ getValue }) => {
        return /* @__PURE__ */ jsx5(SpanStatusCodeIcon, { statusCode: getValue() });
      }
    }
  ];
  (0, import_react67.useEffect)(() => {
    const sort = sorting[0];
    (0, import_react67.startTransition)(() => {
      refetch(
        {
          sort: sort ? getGqlSort(sort) : DEFAULT_SORT,
          after: null,
          first: PAGE_SIZE,
          filterCondition
        },
        { fetchPolicy: "store-and-network" }
      );
    });
  }, [sorting, refetch, filterCondition, fetchKey]);
  const fetchMoreOnBottomReached = import_react67.default.useCallback(
    (containerRefElement) => {
      if (containerRefElement) {
        const { scrollHeight, scrollTop, clientHeight } = containerRefElement;
        if (scrollHeight - scrollTop - clientHeight < 300 && !isLoadingNext && hasNext) {
          loadNext(PAGE_SIZE);
        }
      }
    },
    [hasNext, isLoadingNext, loadNext]
  );
  const table = useReactTable({
    columns: columns2,
    data: tableData,
    state: {
      sorting,
      columnVisibility
    },
    onSortingChange: setSorting,
    getCoreRowModel: getCoreRowModel(),
    getSortedRowModel: getSortedRowModel()
  });
  const rows = table.getRowModel().rows;
  const isEmpty = rows.length === 0;
  const computedColumns = table.getAllColumns().filter((column2) => {
    return column2.columns.length === 0;
  });
  return /* @__PURE__ */ jsxs2("div", { css: spansTableCSS, children: [
    /* @__PURE__ */ jsx5(
      _View,
      {
        paddingTop: "size-100",
        paddingBottom: "size-100",
        paddingStart: "size-200",
        paddingEnd: "size-200",
        borderBottomColor: "grey-300",
        borderBottomWidth: "thin",
        flex: "none",
        children: /* @__PURE__ */ jsxs2(_Flex, { direction: "row", gap: "size-100", width: "100%", alignItems: "center", children: [
          /* @__PURE__ */ jsx5(SpanFilterConditionField, { onValidCondition: setFilterCondition }),
          /* @__PURE__ */ jsx5(SpanColumnSelector, { columns: computedColumns, query: data })
        ] })
      }
    ),
    /* @__PURE__ */ jsx5(
      "div",
      {
        css: css`
          flex: 1 1 auto;
          overflow: auto;
        `,
        onScroll: (e3) => fetchMoreOnBottomReached(e3.target),
        ref: tableContainerRef,
        children: /* @__PURE__ */ jsxs2("table", { css: selectableTableCSS, children: [
          /* @__PURE__ */ jsx5("thead", { children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx5("tr", { children: headerGroup.headers.map((header) => /* @__PURE__ */ jsx5("th", { colSpan: header.colSpan, children: header.isPlaceholder ? null : /* @__PURE__ */ jsxs2(
            "div",
            {
              ...{
                className: header.column.getCanSort() ? "cursor-pointer" : "",
                onClick: header.column.getToggleSortingHandler(),
                style: {
                  left: header.getStart(),
                  width: header.getSize()
                }
              },
              children: [
                flexRender(
                  header.column.columnDef.header,
                  header.getContext()
                ),
                header.column.getIsSorted() ? /* @__PURE__ */ jsx5(
                  Icon,
                  {
                    className: "sort-icon",
                    svg: header.column.getIsSorted() === "asc" ? /* @__PURE__ */ jsx5(Icons.ArrowUpFilled, {}) : /* @__PURE__ */ jsx5(Icons.ArrowDownFilled, {})
                  }
                ) : null
              ]
            }
          ) }, header.id)) }, headerGroup.id)) }),
          isEmpty ? /* @__PURE__ */ jsx5(TableEmpty, {}) : /* @__PURE__ */ jsx5("tbody", { children: rows.map((row) => {
            return /* @__PURE__ */ jsx5(
              "tr",
              {
                onClick: () => navigate(
                  `traces/${row.original.context.traceId}?selectedSpanId=${row.original.context.spanId}`
                ),
                children: row.getVisibleCells().map((cell) => {
                  return /* @__PURE__ */ jsx5("td", { children: flexRender(
                    cell.column.columnDef.cell,
                    cell.getContext()
                  ) }, cell.id);
                })
              },
              row.id
            );
          }) })
        ] })
      }
    )
  ] });
}

// src/pages/tracing/__generated__/StreamToggle_data.graphql.ts
var node12 = {
  "argumentDefinitions": [],
  "kind": "Fragment",
  "metadata": {
    "refetch": {
      "connection": null,
      "fragmentPathInResult": [],
      "operation": (init_StreamToggleRefetchQuery_graphql(), __toCommonJS(StreamToggleRefetchQuery_graphql_exports))
    }
  },
  "name": "StreamToggle_data",
  "selections": [
    {
      "alias": null,
      "args": null,
      "kind": "ScalarField",
      "name": "streamingLastUpdatedAt",
      "storageKey": null
    }
  ],
  "type": "Query",
  "abstractKey": null
};
node12.hash = "5a87fc2da6f4964259d4eaaaed28e26a";
var StreamToggle_data_graphql_default = node12;

// src/pages/tracing/StreamToggle.tsx
var import_react70 = __toESM(require_react());
var import_react_relay4 = __toESM(require_react_relay());

// src/hooks/useInterval.ts
var import_react69 = __toESM(require_react());
function useInterval(callback, delay) {
  const savedCallback = (0, import_react69.useRef)(null);
  (0, import_react69.useEffect)(() => {
    savedCallback.current = callback;
  }, [callback]);
  (0, import_react69.useEffect)(() => {
    function tick() {
      savedCallback.current && savedCallback.current();
    }
    if (delay !== null) {
      const id2 = setInterval(tick, delay);
      return () => clearInterval(id2);
    }
  }, [delay]);
}

// src/pages/tracing/StreamToggle.tsx
var REFRESH_INTERVAL_MS = 2e3;
function StreamToggle(props) {
  const { isStreaming, setIsStreaming, setFetchKey } = useStreamState();
  const [lastUpdatedAt, refetchLastUpdatedAt] = (0, import_react_relay4.useRefetchableFragment)(
    StreamToggle_data_graphql_default,
    props.query
  );
  const loadedLastUpdatedAtRef = (0, import_react70.useRef)(
    lastUpdatedAt.streamingLastUpdatedAt
  );
  const refetchCountsIfStreaming = (0, import_react70.useCallback)(() => {
    if (isStreaming) {
      (0, import_react70.startTransition)(() => {
        refetchLastUpdatedAt({}, { fetchPolicy: "store-and-network" });
      });
    }
  }, [isStreaming, refetchLastUpdatedAt]);
  const currentLastUpdatedAt = lastUpdatedAt.streamingLastUpdatedAt;
  (0, import_react70.useEffect)(() => {
    if (currentLastUpdatedAt != null && (loadedLastUpdatedAtRef.current == null || loadedLastUpdatedAtRef.current < currentLastUpdatedAt)) {
      loadedLastUpdatedAtRef.current = currentLastUpdatedAt;
      setFetchKey(`fetch-traces-${currentLastUpdatedAt}`);
    }
  }, [setFetchKey, currentLastUpdatedAt]);
  useInterval(refetchCountsIfStreaming, REFRESH_INTERVAL_MS);
  return /* @__PURE__ */ jsx5(
    _Switch,
    {
      labelPlacement: "start",
      defaultSelected: true,
      onChange: () => {
        setIsStreaming(!isStreaming);
      },
      children: "Stream"
    }
  );
}

// src/pages/tracing/__generated__/TracesTable_spans.graphql.ts
var node14 = function() {
  var v0 = [
    "rootSpans"
  ], v12 = {
    "alias": null,
    "args": null,
    "kind": "ScalarField",
    "name": "spanKind",
    "storageKey": null
  }, v22 = {
    "alias": null,
    "args": null,
    "kind": "ScalarField",
    "name": "name",
    "storageKey": null
  }, v32 = {
    "alias": "statusCode",
    "args": null,
    "kind": "ScalarField",
    "name": "propagatedStatusCode",
    "storageKey": null
  }, v4 = {
    "alias": null,
    "args": null,
    "kind": "ScalarField",
    "name": "startTime",
    "storageKey": null
  }, v5 = {
    "alias": null,
    "args": null,
    "kind": "ScalarField",
    "name": "latencyMs",
    "storageKey": null
  }, v6 = {
    "alias": null,
    "args": null,
    "kind": "ScalarField",
    "name": "parentId",
    "storageKey": null
  }, v7 = [
    {
      "alias": null,
      "args": null,
      "kind": "ScalarField",
      "name": "value",
      "storageKey": null
    }
  ], v8 = {
    "alias": null,
    "args": null,
    "concreteType": "SpanIOValue",
    "kind": "LinkedField",
    "name": "input",
    "plural": false,
    "selections": v7,
    "storageKey": null
  }, v9 = {
    "alias": null,
    "args": null,
    "concreteType": "SpanIOValue",
    "kind": "LinkedField",
    "name": "output",
    "plural": false,
    "selections": v7,
    "storageKey": null
  }, v10 = {
    "alias": null,
    "args": null,
    "concreteType": "SpanContext",
    "kind": "LinkedField",
    "name": "context",
    "plural": false,
    "selections": [
      {
        "alias": null,
        "args": null,
        "kind": "ScalarField",
        "name": "spanId",
        "storageKey": null
      },
      {
        "alias": null,
        "args": null,
        "kind": "ScalarField",
        "name": "traceId",
        "storageKey": null
      }
    ],
    "storageKey": null
  }, v11 = {
    "alias": null,
    "args": null,
    "concreteType": "SpanEvaluation",
    "kind": "LinkedField",
    "name": "spanEvaluations",
    "plural": true,
    "selections": [
      v22,
      {
        "alias": null,
        "args": null,
        "kind": "ScalarField",
        "name": "label",
        "storageKey": null
      },
      {
        "alias": null,
        "args": null,
        "kind": "ScalarField",
        "name": "score",
        "storageKey": null
      }
    ],
    "storageKey": null
  }, v122 = {
    "alias": null,
    "args": null,
    "concreteType": "DocumentRetrievalMetrics",
    "kind": "LinkedField",
    "name": "documentRetrievalMetrics",
    "plural": true,
    "selections": [
      {
        "alias": null,
        "args": null,
        "kind": "ScalarField",
        "name": "evaluationName",
        "storageKey": null
      },
      {
        "alias": null,
        "args": null,
        "kind": "ScalarField",
        "name": "ndcg",
        "storageKey": null
      },
      {
        "alias": null,
        "args": null,
        "kind": "ScalarField",
        "name": "precision",
        "storageKey": null
      },
      {
        "alias": null,
        "args": null,
        "kind": "ScalarField",
        "name": "hit",
        "storageKey": null
      }
    ],
    "storageKey": null
  };
  return {
    "argumentDefinitions": [
      {
        "defaultValue": null,
        "kind": "LocalArgument",
        "name": "after"
      },
      {
        "defaultValue": null,
        "kind": "LocalArgument",
        "name": "filterCondition"
      },
      {
        "defaultValue": 100,
        "kind": "LocalArgument",
        "name": "first"
      },
      {
        "defaultValue": {
          "col": "startTime",
          "dir": "desc"
        },
        "kind": "LocalArgument",
        "name": "sort"
      }
    ],
    "kind": "Fragment",
    "metadata": {
      "connection": [
        {
          "count": "first",
          "cursor": "after",
          "direction": "forward",
          "path": v0
        }
      ],
      "refetch": {
        "connection": {
          "forward": {
            "count": "first",
            "cursor": "after"
          },
          "backward": null,
          "path": v0
        },
        "fragmentPathInResult": [],
        "operation": (init_TracesTableQuery_graphql(), __toCommonJS(TracesTableQuery_graphql_exports))
      }
    },
    "name": "TracesTable_spans",
    "selections": [
      {
        "args": null,
        "kind": "FragmentSpread",
        "name": "SpanColumnSelector_evaluations"
      },
      {
        "alias": "rootSpans",
        "args": [
          {
            "kind": "Variable",
            "name": "filterCondition",
            "variableName": "filterCondition"
          },
          {
            "kind": "Literal",
            "name": "rootSpansOnly",
            "value": true
          },
          {
            "kind": "Variable",
            "name": "sort",
            "variableName": "sort"
          }
        ],
        "concreteType": "SpanConnection",
        "kind": "LinkedField",
        "name": "__TracesTable_rootSpans_connection",
        "plural": false,
        "selections": [
          {
            "alias": null,
            "args": null,
            "concreteType": "SpanEdge",
            "kind": "LinkedField",
            "name": "edges",
            "plural": true,
            "selections": [
              {
                "alias": "rootSpan",
                "args": null,
                "concreteType": "Span",
                "kind": "LinkedField",
                "name": "node",
                "plural": false,
                "selections": [
                  v12,
                  v22,
                  v32,
                  v4,
                  v5,
                  {
                    "alias": "tokenCountTotal",
                    "args": null,
                    "kind": "ScalarField",
                    "name": "cumulativeTokenCountTotal",
                    "storageKey": null
                  },
                  {
                    "alias": "tokenCountPrompt",
                    "args": null,
                    "kind": "ScalarField",
                    "name": "cumulativeTokenCountPrompt",
                    "storageKey": null
                  },
                  {
                    "alias": "tokenCountCompletion",
                    "args": null,
                    "kind": "ScalarField",
                    "name": "cumulativeTokenCountCompletion",
                    "storageKey": null
                  },
                  v6,
                  v8,
                  v9,
                  v10,
                  v11,
                  v122,
                  {
                    "alias": null,
                    "args": null,
                    "concreteType": "Span",
                    "kind": "LinkedField",
                    "name": "descendants",
                    "plural": true,
                    "selections": [
                      v12,
                      v22,
                      v32,
                      v4,
                      v5,
                      v6,
                      {
                        "alias": null,
                        "args": null,
                        "kind": "ScalarField",
                        "name": "tokenCountTotal",
                        "storageKey": null
                      },
                      {
                        "alias": null,
                        "args": null,
                        "kind": "ScalarField",
                        "name": "tokenCountPrompt",
                        "storageKey": null
                      },
                      {
                        "alias": null,
                        "args": null,
                        "kind": "ScalarField",
                        "name": "tokenCountCompletion",
                        "storageKey": null
                      },
                      v8,
                      v9,
                      v10,
                      v11,
                      v122
                    ],
                    "storageKey": null
                  }
                ],
                "storageKey": null
              },
              {
                "alias": null,
                "args": null,
                "kind": "ScalarField",
                "name": "cursor",
                "storageKey": null
              },
              {
                "alias": null,
                "args": null,
                "concreteType": "Span",
                "kind": "LinkedField",
                "name": "node",
                "plural": false,
                "selections": [
                  {
                    "alias": null,
                    "args": null,
                    "kind": "ScalarField",
                    "name": "__typename",
                    "storageKey": null
                  }
                ],
                "storageKey": null
              }
            ],
            "storageKey": null
          },
          {
            "alias": null,
            "args": null,
            "concreteType": "PageInfo",
            "kind": "LinkedField",
            "name": "pageInfo",
            "plural": false,
            "selections": [
              {
                "alias": null,
                "args": null,
                "kind": "ScalarField",
                "name": "endCursor",
                "storageKey": null
              },
              {
                "alias": null,
                "args": null,
                "kind": "ScalarField",
                "name": "hasNextPage",
                "storageKey": null
              }
            ],
            "storageKey": null
          }
        ],
        "storageKey": null
      }
    ],
    "type": "Query",
    "abstractKey": null
  };
}();
node14.hash = "0d9c0b6da977229d4c340f577a02c55d";
var TracesTable_spans_graphql_default = node14;

// src/pages/tracing/TracesTable.tsx
var import_react73 = __toESM(require_react());
var import_react_relay5 = __toESM(require_react_relay());

// src/components/table/Table.tsx
function Table({
  columns: columns2,
  data
}) {
  const table = useReactTable({
    columns: columns2,
    data,
    getCoreRowModel: getCoreRowModel(),
    getPaginationRowModel: getPaginationRowModel(),
    getSortedRowModel: getSortedRowModel()
  });
  const rows = table.getRowModel().rows;
  const hasContent = rows.length > 0;
  const body = hasContent ? /* @__PURE__ */ jsx5("tbody", { children: rows.map((row) => {
    return /* @__PURE__ */ jsx5("tr", { children: row.getVisibleCells().map((cell) => {
      return /* @__PURE__ */ jsx5("td", { children: flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id);
    }) }, row.id);
  }) }) : /* @__PURE__ */ jsx5(TableEmpty, {});
  return /* @__PURE__ */ jsxs2(Fragment5, { children: [
    /* @__PURE__ */ jsxs2("table", { css: tableCSS, children: [
      /* @__PURE__ */ jsx5("thead", { children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx5("tr", { children: headerGroup.headers.map((header) => /* @__PURE__ */ jsx5("th", { colSpan: header.colSpan, children: header.isPlaceholder ? null : /* @__PURE__ */ jsx5("div", { children: flexRender(
        header.column.columnDef.header,
        header.getContext()
      ) }) }, header.id)) }, headerGroup.id)) }),
      body
    ] }),
    /* @__PURE__ */ jsxs2("div", { css: paginationCSS, children: [
      /* @__PURE__ */ jsx5(
        _Button,
        {
          variant: "default",
          size: "compact",
          onClick: table.previousPage,
          disabled: !table.getCanPreviousPage(),
          "aria-label": "Previous Page",
          icon: /* @__PURE__ */ jsx5(Icon, { svg: /* @__PURE__ */ jsx5(Icons.ArrowIosBackOutline, {}) })
        }
      ),
      /* @__PURE__ */ jsx5(
        _Button,
        {
          variant: "default",
          size: "compact",
          onClick: table.nextPage,
          disabled: !table.getCanNextPage(),
          "aria-label": "Next Page",
          icon: /* @__PURE__ */ jsx5(Icon, { svg: /* @__PURE__ */ jsx5(Icons.ArrowIosForwardOutline, {}) })
        }
      )
    ] })
  ] });
}

// src/components/table/FloatCell.tsx
function FloatCell({
  getValue
}) {
  const value = getValue();
  if (!isNumberOrNull(value)) {
    throw new Error("IntCell only supports number or null values.");
  }
  return /* @__PURE__ */ jsx5("span", { title: value != null ? String(value) : "", children: floatFormatter(value) });
}

// src/components/table/IntCell.tsx
var floatRightCSS = css`
  float: right;
`;
function IntCell({
  getValue
}) {
  const value = getValue();
  if (!isNumberOrNull(value)) {
    throw new Error("IntCell only supports number or null values.");
  }
  return /* @__PURE__ */ jsx5("span", { title: value != null ? String(value) : "", css: floatRightCSS, children: intFormatter(value) });
}

// src/components/table/PercentCell.tsx
function PercentCell({
  getValue
}) {
  const value = getValue();
  if (!isNumberOrNull(value)) {
    throw new Error("IntCell only supports number or null values.");
  }
  return /* @__PURE__ */ jsx5("span", { title: value != null ? String(value) : "", children: percentFormatter(value) });
}

// src/components/table/TableExpandButton.tsx
function TableExpandButton(props) {
  return /* @__PURE__ */ jsx5(
    "button",
    {
      className: "button--reset",
      onClick: (e3) => {
        e3.stopPropagation();
        props.onClick(e3);
      },
      "aria-label": props["aria-label"],
      css: css`
        color: var(--ac-global-text-color-white-900);
        .ac-icon-wrap {
          font-size: 1.2rem;
        }

        &:hover {
          color: var(--ac-global-color-primary);
        }
      `,
      children: /* @__PURE__ */ jsx5(
        Icon,
        {
          svg: props.isExpanded ? /* @__PURE__ */ jsx5(Icons.ChevronDownOutline, {}) : /* @__PURE__ */ jsx5(Icons.ChevronRightOutline, {})
        }
      )
    }
  );
}

// src/components/trace/utils.ts
function createSpanTree(spans) {
  const spanMap = spans.reduce((acc, span) => {
    acc.set(span.context.spanId, {
      span,
      children: []
    });
    return acc;
  }, /* @__PURE__ */ new Map());
  const rootSpans = [];
  for (const span of spans) {
    const spanTreeItem = spanMap.get(span.context.spanId);
    if (span.parentId === null) {
      rootSpans.push(spanTreeItem);
    } else {
      const parentSpanNode = spanMap.get(span.parentId);
      if (parentSpanNode) {
        parentSpanNode.children.push(spanTreeItem);
      }
    }
  }
  for (const spanNode of spanMap.values()) {
    spanNode.children.sort(
      (a2, b) => new Date(a2.span.startTime).valueOf() - new Date(b.span.startTime).valueOf()
    );
  }
  return rootSpans;
}

// src/pages/tracing/TracesTable.tsx
var PAGE_SIZE2 = 100;
function spanTreeToNestedSpanTableRows(children) {
  const normalizedSpanTreeChildren = [];
  for (const child of children) {
    const normalizedChild = {
      ...child.span,
      children: spanTreeToNestedSpanTableRows(child.children)
    };
    normalizedSpanTreeChildren.push(normalizedChild);
  }
  return normalizedSpanTreeChildren;
}
function TracesTable(props) {
  const tableContainerRef = (0, import_react73.useRef)(null);
  const [sorting, setSorting] = (0, import_react73.useState)([]);
  const [filterCondition, setFilterCondition] = (0, import_react73.useState)("");
  const navigate = useNavigate();
  const { fetchKey } = useStreamState();
  const { data, loadNext, hasNext, isLoadingNext, refetch } = (0, import_react_relay5.usePaginationFragment)(
    TracesTable_spans_graphql_default,
    props.query
  );
  const evaluationVisibility = useTracingContext(
    (state) => state.evaluationVisibility
  );
  const visibleEvaluationColumnNames = (0, import_react73.useMemo)(() => {
    return Object.keys(evaluationVisibility).filter(
      (name2) => evaluationVisibility[name2]
    );
  }, [evaluationVisibility]);
  const tableData = (0, import_react73.useMemo)(() => {
    const tableData2 = data.rootSpans.edges.map(({ rootSpan }) => {
      const spanTree = createSpanTree([rootSpan, ...rootSpan.descendants]);
      const [root2] = spanTreeToNestedSpanTableRows(spanTree);
      return root2;
    });
    return tableData2;
  }, [data]);
  const dynamicEvaluationColumns = visibleEvaluationColumnNames.map((name2) => {
    return {
      header: name2,
      columns: [
        {
          header: `label`,
          accessorKey: `${EVALS_COLUMN_PREFIX}${EVALS_KEY_SEPARATOR}label${EVALS_KEY_SEPARATOR}${name2}`,
          cell: ({ row }) => {
            const evaluation = row.original.spanEvaluations.find(
              (evaluation2) => evaluation2.name === name2
            );
            if (!evaluation) {
              return null;
            }
            return evaluation.label;
          }
        },
        {
          header: `score`,
          accessorKey: `${EVALS_COLUMN_PREFIX}${EVALS_KEY_SEPARATOR}score${EVALS_KEY_SEPARATOR}${name2}`,
          cell: ({ row }) => {
            const evaluation = row.original.spanEvaluations.find(
              (evaluation2) => evaluation2.name === name2
            );
            if (!evaluation) {
              return null;
            }
            return evaluation.score;
          }
        }
      ]
    };
  });
  const evaluationColumns = [
    {
      header: "evaluations",
      accessorKey: "spanEvaluations",
      enableSorting: false,
      cell: ({ row }) => {
        const hasNoEvaluations = row.original.spanEvaluations.length === 0 && row.original.documentRetrievalMetrics.length === 0;
        return /* @__PURE__ */ jsxs2(_Flex, { direction: "row", gap: "size-50", wrap: "wrap", children: [
          row.original.spanEvaluations.map((evaluation) => {
            return /* @__PURE__ */ jsx5(
              EvaluationLabel,
              {
                evaluation
              },
              evaluation.name
            );
          }),
          row.original.documentRetrievalMetrics.map((retrievalMetric) => {
            return /* @__PURE__ */ jsxs2(Fragment5, { children: [
              /* @__PURE__ */ jsx5(
                RetrievalEvaluationLabel,
                {
                  name: retrievalMetric.evaluationName,
                  metric: "ndcg",
                  score: retrievalMetric.ndcg
                },
                "ndcg"
              ),
              /* @__PURE__ */ jsx5(
                RetrievalEvaluationLabel,
                {
                  name: retrievalMetric.evaluationName,
                  metric: "precision",
                  score: retrievalMetric.precision
                },
                "precision"
              ),
              /* @__PURE__ */ jsx5(
                RetrievalEvaluationLabel,
                {
                  name: retrievalMetric.evaluationName,
                  metric: "hit",
                  score: retrievalMetric.hit
                },
                "hit"
              )
            ] });
          }),
          hasNoEvaluations ? "--" : null
        ] });
      }
    },
    ...dynamicEvaluationColumns
  ];
  const columns2 = [
    {
      header: () => {
        return /* @__PURE__ */ jsxs2(_Flex, { gap: "size-50", direction: "row", alignItems: "center", children: [
          /* @__PURE__ */ jsx5(
            TableExpandButton,
            {
              isExpanded: table.getIsAllRowsExpanded(),
              onClick: table.getToggleAllRowsExpandedHandler(),
              "aria-label": "Expand all rows"
            }
          ),
          "kind"
        ] });
      },
      enableSorting: false,
      accessorKey: "spanKind",
      maxSize: 100,
      cell: (props2) => {
        return /* @__PURE__ */ jsx5(
          "div",
          {
            css: css`
              // Since rows are flattened by default,
              // we can use the row.depth property
              // and paddingLeft to visually indicate the depth
              // of the row
              padding-left: ${props2.row.depth * 2}rem;
            `,
            children: /* @__PURE__ */ jsxs2(_Flex, { gap: "size-50", children: [
              props2.row.getCanExpand() ? /* @__PURE__ */ jsx5(
                TableExpandButton,
                {
                  isExpanded: props2.row.getIsExpanded(),
                  onClick: props2.row.getToggleExpandedHandler(),
                  "aria-label": "Expand row"
                }
              ) : null,
              /* @__PURE__ */ jsx5(SpanKindLabel, { spanKind: props2.getValue() })
            ] })
          }
        );
      }
    },
    {
      header: "name",
      accessorKey: "name",
      enableSorting: false,
      cell: ({ getValue, row }) => {
        const { spanId, traceId } = row.original.context;
        return /* @__PURE__ */ jsx5(Link2, { to: `/tracing/traces/${traceId}?selectedSpanId=${spanId}`, children: getValue() });
      }
    },
    {
      header: "input",
      accessorKey: "input.value",
      enableSorting: false,
      cell: TextCell
    },
    {
      header: "output",
      accessorKey: "output.value",
      enableSorting: false,
      cell: TextCell
    },
    ...evaluationColumns,
    // TODO: consider hiding this column is there is no evals. For now show it
    {
      header: "start time",
      accessorKey: "startTime",
      cell: TimestampCell
    },
    {
      header: "latency",
      accessorKey: "latencyMs",
      cell: ({ getValue }) => {
        const value = getValue();
        if (value === null || typeof value !== "number") {
          return null;
        }
        return /* @__PURE__ */ jsx5(LatencyText, { latencyMs: value });
      }
    },
    {
      header: "total tokens",
      minSize: 80,
      accessorKey: "tokenCountTotal",
      cell: ({ row, getValue }) => {
        const value = getValue();
        if (value === null) {
          return "--";
        }
        return /* @__PURE__ */ jsx5(
          TokenCount,
          {
            tokenCountTotal: value,
            tokenCountPrompt: row.original.tokenCountPrompt || 0,
            tokenCountCompletion: row.original.tokenCountCompletion || 0
          }
        );
      }
    },
    {
      header: "status",
      accessorKey: "statusCode",
      enableSorting: false,
      cell: ({ getValue }) => {
        return /* @__PURE__ */ jsx5(SpanStatusCodeIcon, { statusCode: getValue() });
      }
    }
  ];
  (0, import_react73.useEffect)(() => {
    const sort = sorting[0];
    (0, import_react73.startTransition)(() => {
      refetch(
        {
          sort: sort ? getGqlSort(sort) : DEFAULT_SORT,
          after: null,
          first: PAGE_SIZE2,
          filterCondition
        },
        {
          fetchPolicy: "store-and-network"
        }
      );
    });
  }, [sorting, refetch, filterCondition, fetchKey]);
  const fetchMoreOnBottomReached = import_react73.default.useCallback(
    (containerRefElement) => {
      if (containerRefElement) {
        const { scrollHeight, scrollTop, clientHeight } = containerRefElement;
        if (scrollHeight - scrollTop - clientHeight < 300 && !isLoadingNext && hasNext) {
          loadNext(PAGE_SIZE2);
        }
      }
    },
    [hasNext, isLoadingNext, loadNext]
  );
  const [expanded, setExpanded] = (0, import_react73.useState)({});
  const columnVisibility = useTracingContext((state) => state.columnVisibility);
  const table = useReactTable({
    columns: columns2,
    data: tableData,
    onExpandedChange: setExpanded,
    getSubRows: (row) => row.children,
    state: {
      sorting,
      expanded,
      columnVisibility
    },
    onSortingChange: setSorting,
    getCoreRowModel: getCoreRowModel(),
    getSortedRowModel: getSortedRowModel(),
    getExpandedRowModel: getExpandedRowModel()
  });
  const rows = table.getRowModel().rows;
  const isEmpty = rows.length === 0;
  const computedColumns = table.getAllColumns().filter((column2) => {
    return column2.columns.length === 0;
  });
  return /* @__PURE__ */ jsxs2("div", { css: spansTableCSS, children: [
    /* @__PURE__ */ jsx5(
      _View,
      {
        paddingTop: "size-100",
        paddingBottom: "size-100",
        paddingStart: "size-200",
        paddingEnd: "size-200",
        borderBottomColor: "grey-300",
        borderBottomWidth: "thin",
        flex: "none",
        children: /* @__PURE__ */ jsxs2(_Flex, { direction: "row", gap: "size-100", width: "100%", alignItems: "center", children: [
          /* @__PURE__ */ jsx5(SpanFilterConditionField, { onValidCondition: setFilterCondition }),
          /* @__PURE__ */ jsx5(SpanColumnSelector, { columns: computedColumns, query: data })
        ] })
      }
    ),
    /* @__PURE__ */ jsx5(
      "div",
      {
        css: css`
          flex: 1 1 auto;
          overflow: auto;
        `,
        onScroll: (e3) => fetchMoreOnBottomReached(e3.target),
        ref: tableContainerRef,
        children: /* @__PURE__ */ jsxs2("table", { css: selectableTableCSS, children: [
          /* @__PURE__ */ jsx5("thead", { children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx5("tr", { children: headerGroup.headers.map((header) => /* @__PURE__ */ jsx5("th", { colSpan: header.colSpan, children: header.isPlaceholder ? null : /* @__PURE__ */ jsxs2(
            "div",
            {
              "data-sortable": header.column.getCanSort(),
              ...{
                className: header.column.getCanSort() ? "cursor-pointer" : "",
                onClick: header.column.getToggleSortingHandler(),
                style: {
                  left: header.getStart(),
                  width: header.getSize()
                }
              },
              children: [
                flexRender(
                  header.column.columnDef.header,
                  header.getContext()
                ),
                header.column.getIsSorted() ? /* @__PURE__ */ jsx5(
                  Icon,
                  {
                    className: "sort-icon",
                    svg: header.column.getIsSorted() === "asc" ? /* @__PURE__ */ jsx5(Icons.ArrowUpFilled, {}) : /* @__PURE__ */ jsx5(Icons.ArrowDownFilled, {})
                  }
                ) : null
              ]
            }
          ) }, header.id)) }, headerGroup.id)) }),
          isEmpty ? /* @__PURE__ */ jsx5(TableEmpty, {}) : /* @__PURE__ */ jsx5("tbody", { children: rows.map((row) => {
            return /* @__PURE__ */ jsx5(
              "tr",
              {
                onClick: () => navigate(`traces/${row.original.context.traceId}`),
                children: row.getVisibleCells().map((cell) => {
                  return /* @__PURE__ */ jsx5("td", { children: flexRender(
                    cell.column.columnDef.cell,
                    cell.getContext()
                  ) }, cell.id);
                })
              },
              row.id
            );
          }) })
        ] })
      }
    )
  ] });
}

// src/pages/tracing/__generated__/TracingHomePageHeader_stats.graphql.ts
var node16 = {
  "argumentDefinitions": [],
  "kind": "Fragment",
  "metadata": {
    "refetch": {
      "connection": null,
      "fragmentPathInResult": [],
      "operation": (init_TracingHomePageHeaderQuery_graphql(), __toCommonJS(TracingHomePageHeaderQuery_graphql_exports))
    }
  },
  "name": "TracingHomePageHeader_stats",
  "selections": [
    {
      "alias": "totalTraces",
      "args": [
        {
          "kind": "Literal",
          "name": "rootSpansOnly",
          "value": true
        }
      ],
      "concreteType": "SpanConnection",
      "kind": "LinkedField",
      "name": "spans",
      "plural": false,
      "selections": [
        {
          "alias": null,
          "args": null,
          "concreteType": "PageInfo",
          "kind": "LinkedField",
          "name": "pageInfo",
          "plural": false,
          "selections": [
            {
              "alias": null,
              "args": null,
              "kind": "ScalarField",
              "name": "totalCount",
              "storageKey": null
            }
          ],
          "storageKey": null
        }
      ],
      "storageKey": "spans(rootSpansOnly:true)"
    },
    {
      "alias": null,
      "args": null,
      "concreteType": "TraceDatasetInfo",
      "kind": "LinkedField",
      "name": "traceDatasetInfo",
      "plural": false,
      "selections": [
        {
          "alias": null,
          "args": null,
          "kind": "ScalarField",
          "name": "startTime",
          "storageKey": null
        },
        {
          "alias": null,
          "args": null,
          "kind": "ScalarField",
          "name": "endTime",
          "storageKey": null
        },
        {
          "alias": null,
          "args": null,
          "kind": "ScalarField",
          "name": "tokenCountTotal",
          "storageKey": null
        },
        {
          "alias": null,
          "args": null,
          "kind": "ScalarField",
          "name": "latencyMsP50",
          "storageKey": null
        },
        {
          "alias": null,
          "args": null,
          "kind": "ScalarField",
          "name": "latencyMsP99",
          "storageKey": null
        }
      ],
      "storageKey": null
    },
    {
      "alias": null,
      "args": null,
      "kind": "ScalarField",
      "name": "spanEvaluationNames",
      "storageKey": null
    },
    {
      "alias": null,
      "args": null,
      "kind": "ScalarField",
      "name": "documentEvaluationNames",
      "storageKey": null
    }
  ],
  "type": "Query",
  "abstractKey": null
};
node16.hash = "631360b4ed0a5a26238d4c2aea1bd759";
var TracingHomePageHeader_stats_graphql_default = node16;

// src/pages/tracing/TracingHomePageHeader.tsx
var import_react122 = __toESM(require_react());
var import_react_relay8 = __toESM(require_react_relay());

// src/pages/tracing/__generated__/DocumentEvaluationSummaryQuery.graphql.ts
var node17 = function() {
  var v0 = [
    {
      "defaultValue": null,
      "kind": "LocalArgument",
      "name": "evaluationName"
    }
  ], v12 = [
    {
      "kind": "Variable",
      "name": "evaluationName",
      "variableName": "evaluationName"
    }
  ];
  return {
    "fragment": {
      "argumentDefinitions": v0,
      "kind": "Fragment",
      "metadata": null,
      "name": "DocumentEvaluationSummaryQuery",
      "selections": [
        {
          "args": v12,
          "kind": "FragmentSpread",
          "name": "DocumentEvaluationSummaryValueFragment"
        }
      ],
      "type": "Query",
      "abstractKey": null
    },
    "kind": "Request",
    "operation": {
      "argumentDefinitions": v0,
      "kind": "Operation",
      "name": "DocumentEvaluationSummaryQuery",
      "selections": [
        {
          "alias": null,
          "args": v12,
          "concreteType": "DocumentEvaluationSummary",
          "kind": "LinkedField",
          "name": "documentEvaluationSummary",
          "plural": false,
          "selections": [
            {
              "alias": null,
              "args": null,
              "kind": "ScalarField",
              "name": "averageNdcg",
              "storageKey": null
            },
            {
              "alias": null,
              "args": null,
              "kind": "ScalarField",
              "name": "averagePrecision",
              "storageKey": null
            },
            {
              "alias": null,
              "args": null,
              "kind": "ScalarField",
              "name": "meanReciprocalRank",
              "storageKey": null
            },
            {
              "alias": null,
              "args": null,
              "kind": "ScalarField",
              "name": "hitRate",
              "storageKey": null
            }
          ],
          "storageKey": null
        }
      ]
    },
    "params": {
      "cacheID": "128887370326e6f31e211ff48094572a",
      "id": null,
      "metadata": {},
      "name": "DocumentEvaluationSummaryQuery",
      "operationKind": "query",
      "text": "query DocumentEvaluationSummaryQuery(\n  $evaluationName: String!\n) {\n  ...DocumentEvaluationSummaryValueFragment_qsFcK\n}\n\nfragment DocumentEvaluationSummaryValueFragment_qsFcK on Query {\n  documentEvaluationSummary(evaluationName: $evaluationName) {\n    averageNdcg\n    averagePrecision\n    meanReciprocalRank\n    hitRate\n  }\n}\n"
    }
  };
}();
node17.hash = "bf75586dafc4a88ba9529c86783e3933";
var DocumentEvaluationSummaryQuery_graphql_default = node17;

// src/pages/tracing/__generated__/DocumentEvaluationSummaryValueFragment.graphql.ts
var node19 = {
  "argumentDefinitions": [
    {
      "defaultValue": null,
      "kind": "LocalArgument",
      "name": "evaluationName"
    }
  ],
  "kind": "Fragment",
  "metadata": {
    "refetch": {
      "connection": null,
      "fragmentPathInResult": [],
      "operation": (init_DocumentEvaluationSummaryValueQuery_graphql(), __toCommonJS(DocumentEvaluationSummaryValueQuery_graphql_exports))
    }
  },
  "name": "DocumentEvaluationSummaryValueFragment",
  "selections": [
    {
      "alias": null,
      "args": [
        {
          "kind": "Variable",
          "name": "evaluationName",
          "variableName": "evaluationName"
        }
      ],
      "concreteType": "DocumentEvaluationSummary",
      "kind": "LinkedField",
      "name": "documentEvaluationSummary",
      "plural": false,
      "selections": [
        {
          "alias": null,
          "args": null,
          "kind": "ScalarField",
          "name": "averageNdcg",
          "storageKey": null
        },
        {
          "alias": null,
          "args": null,
          "kind": "ScalarField",
          "name": "averagePrecision",
          "storageKey": null
        },
        {
          "alias": null,
          "args": null,
          "kind": "ScalarField",
          "name": "meanReciprocalRank",
          "storageKey": null
        },
        {
          "alias": null,
          "args": null,
          "kind": "ScalarField",
          "name": "hitRate",
          "storageKey": null
        }
      ],
      "storageKey": null
    }
  ],
  "type": "Query",
  "abstractKey": null
};
node19.hash = "2713c6e621dbac0dec917c29a08fff7b";
var DocumentEvaluationSummaryValueFragment_graphql_default = node19;

// src/pages/tracing/DocumentEvaluationSummary.tsx
var import_react75 = __toESM(require_react());
var import_react_relay6 = __toESM(require_react_relay());
function DocumentEvaluationSummary({
  evaluationName
}) {
  const data = (0, import_react_relay6.useLazyLoadQuery)(
    DocumentEvaluationSummaryQuery_graphql_default,
    {
      evaluationName
    }
  );
  return /* @__PURE__ */ jsxs2(_Flex, { direction: "column", flex: "none", children: [
    /* @__PURE__ */ jsx5(_Text, { elementType: "h3", textSize: "medium", color: "text-700", children: evaluationName }),
    /* @__PURE__ */ jsx5(import_react75.Suspense, { fallback: /* @__PURE__ */ jsx5(_Text, { textSize: "xlarge", children: "--" }), children: /* @__PURE__ */ jsx5(EvaluationSummaryValue, { evaluationName, query: data }) })
  ] });
}
function EvaluationSummaryValue(props) {
  const { query: query2 } = props;
  const { fetchKey } = useStreamState();
  const [data, refetch] = (0, import_react_relay6.useRefetchableFragment)(
    DocumentEvaluationSummaryValueFragment_graphql_default,
    query2
  );
  (0, import_react75.useEffect)(() => {
    (0, import_react75.startTransition)(() => {
      refetch({}, { fetchPolicy: "store-and-network" });
    });
  }, [fetchKey, refetch]);
  const averageNdcg = data?.documentEvaluationSummary?.averageNdcg;
  const averagePrecision = data?.documentEvaluationSummary?.averagePrecision;
  const hitRate = data?.documentEvaluationSummary?.hitRate;
  const meanReciprocalRank = data?.documentEvaluationSummary?.meanReciprocalRank;
  return /* @__PURE__ */ jsxs2(TooltipTrigger, { delay: 0, placement: "bottom", children: [
    /* @__PURE__ */ jsx5(_TriggerWrap, { children: /* @__PURE__ */ jsx5(_Flex, { direction: "row", alignItems: "center", gap: "size-50", height: "28px", children: /* @__PURE__ */ jsxs2(Fragment5, { children: [
      /* @__PURE__ */ jsx5(
        RetrievalEvaluationLabel,
        {
          metric: "ndcg",
          score: averageNdcg
        },
        "ndcg"
      ),
      /* @__PURE__ */ jsx5(
        RetrievalEvaluationLabel,
        {
          metric: "precision",
          score: averagePrecision
        },
        "precision"
      ),
      /* @__PURE__ */ jsx5(
        RetrievalEvaluationLabel,
        {
          metric: "hit rate",
          score: hitRate
        },
        "hit"
      )
    ] }) }) }),
    /* @__PURE__ */ jsx5(_HelpTooltip, { children: /* @__PURE__ */ jsx5(_View, { width: "size-2400", children: /* @__PURE__ */ jsxs2(_Flex, { direction: "column", children: [
      /* @__PURE__ */ jsxs2(_Flex, { justifyContent: "space-between", children: [
        /* @__PURE__ */ jsx5(_Text, { children: "average ndcg" }),
        /* @__PURE__ */ jsx5(_Text, { children: typeof averageNdcg === "number" ? formatFloat(averageNdcg) : "--" })
      ] }),
      /* @__PURE__ */ jsxs2(_Flex, { justifyContent: "space-between", children: [
        /* @__PURE__ */ jsx5(_Text, { children: "average precision" }),
        /* @__PURE__ */ jsx5(_Text, { children: typeof averagePrecision === "number" ? formatFloat(averagePrecision) : "--" })
      ] }),
      /* @__PURE__ */ jsxs2(_Flex, { justifyContent: "space-between", children: [
        /* @__PURE__ */ jsx5(_Text, { children: "mean reciprocal rank" }),
        /* @__PURE__ */ jsx5(_Text, { children: typeof meanReciprocalRank === "number" ? formatFloat(meanReciprocalRank) : "--" })
      ] }),
      /* @__PURE__ */ jsxs2(_Flex, { justifyContent: "space-between", children: [
        /* @__PURE__ */ jsx5(_Text, { children: "hit rate" }),
        /* @__PURE__ */ jsx5(_Text, { children: typeof hitRate === "number" ? formatFloat(hitRate) : "--" })
      ] })
    ] }) }) })
  ] });
}

// src/pages/tracing/__generated__/EvaluationSummaryQuery.graphql.ts
var node20 = function() {
  var v0 = [
    {
      "defaultValue": null,
      "kind": "LocalArgument",
      "name": "evaluationName"
    }
  ], v12 = [
    {
      "kind": "Variable",
      "name": "evaluationName",
      "variableName": "evaluationName"
    }
  ];
  return {
    "fragment": {
      "argumentDefinitions": v0,
      "kind": "Fragment",
      "metadata": null,
      "name": "EvaluationSummaryQuery",
      "selections": [
        {
          "args": v12,
          "kind": "FragmentSpread",
          "name": "EvaluationSummaryValueFragment"
        }
      ],
      "type": "Query",
      "abstractKey": null
    },
    "kind": "Request",
    "operation": {
      "argumentDefinitions": v0,
      "kind": "Operation",
      "name": "EvaluationSummaryQuery",
      "selections": [
        {
          "alias": null,
          "args": v12,
          "concreteType": "EvaluationSummary",
          "kind": "LinkedField",
          "name": "spanEvaluationSummary",
          "plural": false,
          "selections": [
            {
              "alias": null,
              "args": null,
              "concreteType": "LabelFraction",
              "kind": "LinkedField",
              "name": "labelFractions",
              "plural": true,
              "selections": [
                {
                  "alias": null,
                  "args": null,
                  "kind": "ScalarField",
                  "name": "label",
                  "storageKey": null
                },
                {
                  "alias": null,
                  "args": null,
                  "kind": "ScalarField",
                  "name": "fraction",
                  "storageKey": null
                }
              ],
              "storageKey": null
            },
            {
              "alias": null,
              "args": null,
              "kind": "ScalarField",
              "name": "meanScore",
              "storageKey": null
            }
          ],
          "storageKey": null
        }
      ]
    },
    "params": {
      "cacheID": "cb8452f8a7f5755f6b74f6e7eab3f3ae",
      "id": null,
      "metadata": {},
      "name": "EvaluationSummaryQuery",
      "operationKind": "query",
      "text": "query EvaluationSummaryQuery(\n  $evaluationName: String!\n) {\n  ...EvaluationSummaryValueFragment_qsFcK\n}\n\nfragment EvaluationSummaryValueFragment_qsFcK on Query {\n  spanEvaluationSummary(evaluationName: $evaluationName) {\n    labelFractions {\n      label\n      fraction\n    }\n    meanScore\n  }\n}\n"
    }
  };
}();
node20.hash = "0510c60cd850ebf4eeed37e113108328";
var EvaluationSummaryQuery_graphql_default = node20;

// src/pages/tracing/__generated__/EvaluationSummaryValueFragment.graphql.ts
var node22 = {
  "argumentDefinitions": [
    {
      "defaultValue": null,
      "kind": "LocalArgument",
      "name": "evaluationName"
    }
  ],
  "kind": "Fragment",
  "metadata": {
    "refetch": {
      "connection": null,
      "fragmentPathInResult": [],
      "operation": (init_EvaluationSummaryValueQuery_graphql(), __toCommonJS(EvaluationSummaryValueQuery_graphql_exports))
    }
  },
  "name": "EvaluationSummaryValueFragment",
  "selections": [
    {
      "alias": null,
      "args": [
        {
          "kind": "Variable",
          "name": "evaluationName",
          "variableName": "evaluationName"
        }
      ],
      "concreteType": "EvaluationSummary",
      "kind": "LinkedField",
      "name": "spanEvaluationSummary",
      "plural": false,
      "selections": [
        {
          "alias": null,
          "args": null,
          "concreteType": "LabelFraction",
          "kind": "LinkedField",
          "name": "labelFractions",
          "plural": true,
          "selections": [
            {
              "alias": null,
              "args": null,
              "kind": "ScalarField",
              "name": "label",
              "storageKey": null
            },
            {
              "alias": null,
              "args": null,
              "kind": "ScalarField",
              "name": "fraction",
              "storageKey": null
            }
          ],
          "storageKey": null
        },
        {
          "alias": null,
          "args": null,
          "kind": "ScalarField",
          "name": "meanScore",
          "storageKey": null
        }
      ],
      "storageKey": null
    }
  ],
  "type": "Query",
  "abstractKey": null
};
node22.hash = "f014d6fd36312661220d2f080f257f1d";
var EvaluationSummaryValueFragment_graphql_default = node22;

// src/pages/tracing/EvaluationSummary.tsx
var import_react121 = __toESM(require_react());
var import_react_relay7 = __toESM(require_react_relay());

// node_modules/recharts/es6/container/Surface.js
var import_react78 = __toESM(require_react());
var import_classnames = __toESM(require_classnames());

// node_modules/recharts/es6/util/ReactUtils.js
var import_isObject2 = __toESM(require_isObject());
var import_isFunction = __toESM(require_isFunction());
var import_isString2 = __toESM(require_isString());
var import_get2 = __toESM(require_get());
var import_isNil = __toESM(require_isNil());
var import_isArray2 = __toESM(require_isArray());
var import_react77 = __toESM(require_react());
var import_react_is = __toESM(require_react_is());

// node_modules/recharts/es6/util/DataUtils.js
var import_get = __toESM(require_get());
var import_isArray = __toESM(require_isArray());
var import_isNaN = __toESM(require_isNaN());
var import_isNumber = __toESM(require_isNumber());
var import_isString = __toESM(require_isString());
var mathSign = function mathSign2(value) {
  if (value === 0) {
    return 0;
  }
  if (value > 0) {
    return 1;
  }
  return -1;
};
var isPercent = function isPercent2(value) {
  return (0, import_isString.default)(value) && value.indexOf("%") === value.length - 1;
};
var isNumber = function isNumber2(value) {
  return (0, import_isNumber.default)(value) && !(0, import_isNaN.default)(value);
};
var isNumOrStr = function isNumOrStr2(value) {
  return isNumber(value) || (0, import_isString.default)(value);
};
var idCounter = 0;
var uniqueId = function uniqueId2(prefix3) {
  var id2 = ++idCounter;
  return "".concat(prefix3 || "").concat(id2);
};
var getPercentValue = function getPercentValue2(percent, totalValue) {
  var defaultValue = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 0;
  var validate = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false;
  if (!isNumber(percent) && !(0, import_isString.default)(percent)) {
    return defaultValue;
  }
  var value;
  if (isPercent(percent)) {
    var index = percent.indexOf("%");
    value = totalValue * parseFloat(percent.slice(0, index)) / 100;
  } else {
    value = +percent;
  }
  if ((0, import_isNaN.default)(value)) {
    value = defaultValue;
  }
  if (validate && value > totalValue) {
    value = totalValue;
  }
  return value;
};
var getAnyElementOfObject = function getAnyElementOfObject2(obj) {
  if (!obj) {
    return null;
  }
  var keys4 = Object.keys(obj);
  if (keys4 && keys4.length) {
    return obj[keys4[0]];
  }
  return null;
};
var hasDuplicate = function hasDuplicate2(ary) {
  if (!(0, import_isArray.default)(ary)) {
    return false;
  }
  var len = ary.length;
  var cache2 = {};
  for (var i2 = 0; i2 < len; i2++) {
    if (!cache2[ary[i2]]) {
      cache2[ary[i2]] = true;
    } else {
      return true;
    }
  }
  return false;
};
var interpolateNumber = function interpolateNumber2(numberA, numberB) {
  if (isNumber(numberA) && isNumber(numberB)) {
    return function(t3) {
      return numberA + t3 * (numberB - numberA);
    };
  }
  return function() {
    return numberB;
  };
};
function findEntryInArray(ary, specifiedKey, specifiedValue) {
  if (!ary || !ary.length) {
    return null;
  }
  return ary.find(function(entry) {
    return entry && (typeof specifiedKey === "function" ? specifiedKey(entry) : (0, import_get.default)(entry, specifiedKey)) === specifiedValue;
  });
}
var getLinearRegression = function getLinearRegression2(data) {
  if (!data || !data.length) {
    return null;
  }
  var len = data.length;
  var xsum = 0;
  var ysum = 0;
  var xysum = 0;
  var xxsum = 0;
  var xmin = Infinity;
  var xmax = -Infinity;
  var xcurrent = 0;
  var ycurrent = 0;
  for (var i2 = 0; i2 < len; i2++) {
    xcurrent = data[i2].cx || 0;
    ycurrent = data[i2].cy || 0;
    xsum += xcurrent;
    ysum += ycurrent;
    xysum += xcurrent * ycurrent;
    xxsum += xcurrent * xcurrent;
    xmin = Math.min(xmin, xcurrent);
    xmax = Math.max(xmax, xcurrent);
  }
  var a2 = len * xxsum !== xsum * xsum ? (len * xysum - xsum * ysum) / (len * xxsum - xsum * xsum) : 0;
  return {
    xmin,
    xmax,
    a: a2,
    b: (ysum - a2 * xsum) / len
  };
};

// node_modules/recharts/es6/util/ShallowEqual.js
function shallowEqual(a2, b) {
  for (var key in a2) {
    if ({}.hasOwnProperty.call(a2, key) && (!{}.hasOwnProperty.call(b, key) || a2[key] !== b[key])) {
      return false;
    }
  }
  for (var _key in b) {
    if ({}.hasOwnProperty.call(b, _key) && !{}.hasOwnProperty.call(a2, _key)) {
      return false;
    }
  }
  return true;
}

// node_modules/recharts/es6/util/types.js
var import_isObject = __toESM(require_isObject());
var import_react76 = __toESM(require_react());
function _typeof2(o) {
  "@babel/helpers - typeof";
  return _typeof2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
    return typeof o2;
  } : function(o2) {
    return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
  }, _typeof2(o);
}
var SVGContainerPropKeys = ["viewBox", "children"];
var SVGElementPropKeys = [
  "aria-activedescendant",
  "aria-atomic",
  "aria-autocomplete",
  "aria-busy",
  "aria-checked",
  "aria-colcount",
  "aria-colindex",
  "aria-colspan",
  "aria-controls",
  "aria-current",
  "aria-describedby",
  "aria-details",
  "aria-disabled",
  "aria-errormessage",
  "aria-expanded",
  "aria-flowto",
  "aria-haspopup",
  "aria-hidden",
  "aria-invalid",
  "aria-keyshortcuts",
  "aria-label",
  "aria-labelledby",
  "aria-level",
  "aria-live",
  "aria-modal",
  "aria-multiline",
  "aria-multiselectable",
  "aria-orientation",
  "aria-owns",
  "aria-placeholder",
  "aria-posinset",
  "aria-pressed",
  "aria-readonly",
  "aria-relevant",
  "aria-required",
  "aria-roledescription",
  "aria-rowcount",
  "aria-rowindex",
  "aria-rowspan",
  "aria-selected",
  "aria-setsize",
  "aria-sort",
  "aria-valuemax",
  "aria-valuemin",
  "aria-valuenow",
  "aria-valuetext",
  "className",
  "color",
  "height",
  "id",
  "lang",
  "max",
  "media",
  "method",
  "min",
  "name",
  "style",
  /*
   * removed 'type' SVGElementPropKey because we do not currently use any SVG elements
   * that can use it and it conflicts with the recharts prop 'type'
   * https://github.com/recharts/recharts/pull/3327
   * https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/type
   */
  // 'type',
  "target",
  "width",
  "role",
  "tabIndex",
  "accentHeight",
  "accumulate",
  "additive",
  "alignmentBaseline",
  "allowReorder",
  "alphabetic",
  "amplitude",
  "arabicForm",
  "ascent",
  "attributeName",
  "attributeType",
  "autoReverse",
  "azimuth",
  "baseFrequency",
  "baselineShift",
  "baseProfile",
  "bbox",
  "begin",
  "bias",
  "by",
  "calcMode",
  "capHeight",
  "clip",
  "clipPath",
  "clipPathUnits",
  "clipRule",
  "colorInterpolation",
  "colorInterpolationFilters",
  "colorProfile",
  "colorRendering",
  "contentScriptType",
  "contentStyleType",
  "cursor",
  "cx",
  "cy",
  "d",
  "decelerate",
  "descent",
  "diffuseConstant",
  "direction",
  "display",
  "divisor",
  "dominantBaseline",
  "dur",
  "dx",
  "dy",
  "edgeMode",
  "elevation",
  "enableBackground",
  "end",
  "exponent",
  "externalResourcesRequired",
  "fill",
  "fillOpacity",
  "fillRule",
  "filter",
  "filterRes",
  "filterUnits",
  "floodColor",
  "floodOpacity",
  "focusable",
  "fontFamily",
  "fontSize",
  "fontSizeAdjust",
  "fontStretch",
  "fontStyle",
  "fontVariant",
  "fontWeight",
  "format",
  "from",
  "fx",
  "fy",
  "g1",
  "g2",
  "glyphName",
  "glyphOrientationHorizontal",
  "glyphOrientationVertical",
  "glyphRef",
  "gradientTransform",
  "gradientUnits",
  "hanging",
  "horizAdvX",
  "horizOriginX",
  "href",
  "ideographic",
  "imageRendering",
  "in2",
  "in",
  "intercept",
  "k1",
  "k2",
  "k3",
  "k4",
  "k",
  "kernelMatrix",
  "kernelUnitLength",
  "kerning",
  "keyPoints",
  "keySplines",
  "keyTimes",
  "lengthAdjust",
  "letterSpacing",
  "lightingColor",
  "limitingConeAngle",
  "local",
  "markerEnd",
  "markerHeight",
  "markerMid",
  "markerStart",
  "markerUnits",
  "markerWidth",
  "mask",
  "maskContentUnits",
  "maskUnits",
  "mathematical",
  "mode",
  "numOctaves",
  "offset",
  "opacity",
  "operator",
  "order",
  "orient",
  "orientation",
  "origin",
  "overflow",
  "overlinePosition",
  "overlineThickness",
  "paintOrder",
  "panose1",
  "pathLength",
  "patternContentUnits",
  "patternTransform",
  "patternUnits",
  "pointerEvents",
  "pointsAtX",
  "pointsAtY",
  "pointsAtZ",
  "preserveAlpha",
  "preserveAspectRatio",
  "primitiveUnits",
  "r",
  "radius",
  "refX",
  "refY",
  "renderingIntent",
  "repeatCount",
  "repeatDur",
  "requiredExtensions",
  "requiredFeatures",
  "restart",
  "result",
  "rotate",
  "rx",
  "ry",
  "seed",
  "shapeRendering",
  "slope",
  "spacing",
  "specularConstant",
  "specularExponent",
  "speed",
  "spreadMethod",
  "startOffset",
  "stdDeviation",
  "stemh",
  "stemv",
  "stitchTiles",
  "stopColor",
  "stopOpacity",
  "strikethroughPosition",
  "strikethroughThickness",
  "string",
  "stroke",
  "strokeDasharray",
  "strokeDashoffset",
  "strokeLinecap",
  "strokeLinejoin",
  "strokeMiterlimit",
  "strokeOpacity",
  "strokeWidth",
  "surfaceScale",
  "systemLanguage",
  "tableValues",
  "targetX",
  "targetY",
  "textAnchor",
  "textDecoration",
  "textLength",
  "textRendering",
  "to",
  "transform",
  "u1",
  "u2",
  "underlinePosition",
  "underlineThickness",
  "unicode",
  "unicodeBidi",
  "unicodeRange",
  "unitsPerEm",
  "vAlphabetic",
  "values",
  "vectorEffect",
  "version",
  "vertAdvY",
  "vertOriginX",
  "vertOriginY",
  "vHanging",
  "vIdeographic",
  "viewTarget",
  "visibility",
  "vMathematical",
  "widths",
  "wordSpacing",
  "writingMode",
  "x1",
  "x2",
  "x",
  "xChannelSelector",
  "xHeight",
  "xlinkActuate",
  "xlinkArcrole",
  "xlinkHref",
  "xlinkRole",
  "xlinkShow",
  "xlinkTitle",
  "xlinkType",
  "xmlBase",
  "xmlLang",
  "xmlns",
  "xmlnsXlink",
  "xmlSpace",
  "y1",
  "y2",
  "y",
  "yChannelSelector",
  "z",
  "zoomAndPan",
  "ref",
  "key",
  "angle"
];
var PolyElementKeys = ["points", "pathLength"];
var FilteredElementKeyMap = {
  svg: SVGContainerPropKeys,
  polygon: PolyElementKeys,
  polyline: PolyElementKeys
};
var EventKeys = ["dangerouslySetInnerHTML", "onCopy", "onCopyCapture", "onCut", "onCutCapture", "onPaste", "onPasteCapture", "onCompositionEnd", "onCompositionEndCapture", "onCompositionStart", "onCompositionStartCapture", "onCompositionUpdate", "onCompositionUpdateCapture", "onFocus", "onFocusCapture", "onBlur", "onBlurCapture", "onChange", "onChangeCapture", "onBeforeInput", "onBeforeInputCapture", "onInput", "onInputCapture", "onReset", "onResetCapture", "onSubmit", "onSubmitCapture", "onInvalid", "onInvalidCapture", "onLoad", "onLoadCapture", "onError", "onErrorCapture", "onKeyDown", "onKeyDownCapture", "onKeyPress", "onKeyPressCapture", "onKeyUp", "onKeyUpCapture", "onAbort", "onAbortCapture", "onCanPlay", "onCanPlayCapture", "onCanPlayThrough", "onCanPlayThroughCapture", "onDurationChange", "onDurationChangeCapture", "onEmptied", "onEmptiedCapture", "onEncrypted", "onEncryptedCapture", "onEnded", "onEndedCapture", "onLoadedData", "onLoadedDataCapture", "onLoadedMetadata", "onLoadedMetadataCapture", "onLoadStart", "onLoadStartCapture", "onPause", "onPauseCapture", "onPlay", "onPlayCapture", "onPlaying", "onPlayingCapture", "onProgress", "onProgressCapture", "onRateChange", "onRateChangeCapture", "onSeeked", "onSeekedCapture", "onSeeking", "onSeekingCapture", "onStalled", "onStalledCapture", "onSuspend", "onSuspendCapture", "onTimeUpdate", "onTimeUpdateCapture", "onVolumeChange", "onVolumeChangeCapture", "onWaiting", "onWaitingCapture", "onAuxClick", "onAuxClickCapture", "onClick", "onClickCapture", "onContextMenu", "onContextMenuCapture", "onDoubleClick", "onDoubleClickCapture", "onDrag", "onDragCapture", "onDragEnd", "onDragEndCapture", "onDragEnter", "onDragEnterCapture", "onDragExit", "onDragExitCapture", "onDragLeave", "onDragLeaveCapture", "onDragOver", "onDragOverCapture", "onDragStart", "onDragStartCapture", "onDrop", "onDropCapture", "onMouseDown", "onMouseDownCapture", "onMouseEnter", "onMouseLeave", "onMouseMove", "onMouseMoveCapture", "onMouseOut", "onMouseOutCapture", "onMouseOver", "onMouseOverCapture", "onMouseUp", "onMouseUpCapture", "onSelect", "onSelectCapture", "onTouchCancel", "onTouchCancelCapture", "onTouchEnd", "onTouchEndCapture", "onTouchMove", "onTouchMoveCapture", "onTouchStart", "onTouchStartCapture", "onPointerDown", "onPointerDownCapture", "onPointerMove", "onPointerMoveCapture", "onPointerUp", "onPointerUpCapture", "onPointerCancel", "onPointerCancelCapture", "onPointerEnter", "onPointerEnterCapture", "onPointerLeave", "onPointerLeaveCapture", "onPointerOver", "onPointerOverCapture", "onPointerOut", "onPointerOutCapture", "onGotPointerCapture", "onGotPointerCaptureCapture", "onLostPointerCapture", "onLostPointerCaptureCapture", "onScroll", "onScrollCapture", "onWheel", "onWheelCapture", "onAnimationStart", "onAnimationStartCapture", "onAnimationEnd", "onAnimationEndCapture", "onAnimationIteration", "onAnimationIterationCapture", "onTransitionEnd", "onTransitionEndCapture"];
var adaptEventHandlers = function adaptEventHandlers2(props, newHandler) {
  if (!props || typeof props === "function" || typeof props === "boolean") {
    return null;
  }
  var inputProps = props;
  if (/* @__PURE__ */ (0, import_react76.isValidElement)(props)) {
    inputProps = props.props;
  }
  if (!(0, import_isObject.default)(inputProps)) {
    return null;
  }
  var out = {};
  Object.keys(inputProps).forEach(function(key) {
    if (EventKeys.includes(key)) {
      out[key] = newHandler || function(e3) {
        return inputProps[key](inputProps, e3);
      };
    }
  });
  return out;
};
var getEventHandlerOfChild = function getEventHandlerOfChild2(originalHandler, data, index) {
  return function(e3) {
    originalHandler(data, index, e3);
    return null;
  };
};
var adaptEventsOfChild = function adaptEventsOfChild2(props, data, index) {
  if (!(0, import_isObject.default)(props) || _typeof2(props) !== "object") {
    return null;
  }
  var out = null;
  Object.keys(props).forEach(function(key) {
    var item = props[key];
    if (EventKeys.includes(key) && typeof item === "function") {
      if (!out)
        out = {};
      out[key] = getEventHandlerOfChild(item, data, index);
    }
  });
  return out;
};

// node_modules/recharts/es6/util/ReactUtils.js
var _excluded5 = ["children"];
var _excluded23 = ["children"];
function _objectWithoutProperties(source, excluded) {
  if (source == null)
    return {};
  var target = _objectWithoutPropertiesLoose5(source, excluded);
  var key, i2;
  if (Object.getOwnPropertySymbols) {
    var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
    for (i2 = 0; i2 < sourceSymbolKeys.length; i2++) {
      key = sourceSymbolKeys[i2];
      if (excluded.indexOf(key) >= 0)
        continue;
      if (!Object.prototype.propertyIsEnumerable.call(source, key))
        continue;
      target[key] = source[key];
    }
  }
  return target;
}
function _objectWithoutPropertiesLoose5(source, excluded) {
  if (source == null)
    return {};
  var target = {};
  var sourceKeys = Object.keys(source);
  var key, i2;
  for (i2 = 0; i2 < sourceKeys.length; i2++) {
    key = sourceKeys[i2];
    if (excluded.indexOf(key) >= 0)
      continue;
    target[key] = source[key];
  }
  return target;
}
function _typeof3(o) {
  "@babel/helpers - typeof";
  return _typeof3 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
    return typeof o2;
  } : function(o2) {
    return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
  }, _typeof3(o);
}
var REACT_BROWSER_EVENT_MAP = {
  click: "onClick",
  mousedown: "onMouseDown",
  mouseup: "onMouseUp",
  mouseover: "onMouseOver",
  mousemove: "onMouseMove",
  mouseout: "onMouseOut",
  mouseenter: "onMouseEnter",
  mouseleave: "onMouseLeave",
  touchcancel: "onTouchCancel",
  touchend: "onTouchEnd",
  touchmove: "onTouchMove",
  touchstart: "onTouchStart"
};
var getDisplayName = function getDisplayName2(Comp) {
  if (typeof Comp === "string") {
    return Comp;
  }
  if (!Comp) {
    return "";
  }
  return Comp.displayName || Comp.name || "Component";
};
var lastChildren = null;
var lastResult = null;
var toArray = function toArray2(children) {
  if (children === lastChildren && (0, import_isArray2.default)(lastResult)) {
    return lastResult;
  }
  var result = [];
  import_react77.Children.forEach(children, function(child) {
    if ((0, import_isNil.default)(child))
      return;
    if ((0, import_react_is.isFragment)(child)) {
      result = result.concat(toArray2(child.props.children));
    } else {
      result.push(child);
    }
  });
  lastResult = result;
  lastChildren = children;
  return result;
};
function findAllByType(children, type) {
  var result = [];
  var types2 = [];
  if ((0, import_isArray2.default)(type)) {
    types2 = type.map(function(t3) {
      return getDisplayName(t3);
    });
  } else {
    types2 = [getDisplayName(type)];
  }
  toArray(children).forEach(function(child) {
    var childType = (0, import_get2.default)(child, "type.displayName") || (0, import_get2.default)(child, "type.name");
    if (types2.indexOf(childType) !== -1) {
      result.push(child);
    }
  });
  return result;
}
function findChildByType(children, type) {
  var result = findAllByType(children, type);
  return result && result[0];
}
var validateWidthHeight = function validateWidthHeight2(el) {
  if (!el || !el.props) {
    return false;
  }
  var _el$props = el.props, width = _el$props.width, height = _el$props.height;
  if (!isNumber(width) || width <= 0 || !isNumber(height) || height <= 0) {
    return false;
  }
  return true;
};
var SVG_TAGS = ["a", "altGlyph", "altGlyphDef", "altGlyphItem", "animate", "animateColor", "animateMotion", "animateTransform", "circle", "clipPath", "color-profile", "cursor", "defs", "desc", "ellipse", "feBlend", "feColormatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence", "filter", "font", "font-face", "font-face-format", "font-face-name", "font-face-url", "foreignObject", "g", "glyph", "glyphRef", "hkern", "image", "line", "lineGradient", "marker", "mask", "metadata", "missing-glyph", "mpath", "path", "pattern", "polygon", "polyline", "radialGradient", "rect", "script", "set", "stop", "style", "svg", "switch", "symbol", "text", "textPath", "title", "tref", "tspan", "use", "view", "vkern"];
var isSvgElement = function isSvgElement2(child) {
  return child && child.type && (0, import_isString2.default)(child.type) && SVG_TAGS.indexOf(child.type) >= 0;
};
var isDotProps = function isDotProps2(dot2) {
  return dot2 && _typeof3(dot2) === "object" && "cx" in dot2 && "cy" in dot2 && "r" in dot2;
};
var isValidSpreadableProp = function isValidSpreadableProp2(property, key, includeEvents, svgElementType) {
  var _FilteredElementKeyMa;
  var matchingElementTypeKeys = (_FilteredElementKeyMa = FilteredElementKeyMap === null || FilteredElementKeyMap === void 0 ? void 0 : FilteredElementKeyMap[svgElementType]) !== null && _FilteredElementKeyMa !== void 0 ? _FilteredElementKeyMa : [];
  return !(0, import_isFunction.default)(property) && (svgElementType && matchingElementTypeKeys.includes(key) || SVGElementPropKeys.includes(key)) || includeEvents && EventKeys.includes(key);
};
var filterProps = function filterProps2(props, includeEvents, svgElementType) {
  if (!props || typeof props === "function" || typeof props === "boolean") {
    return null;
  }
  var inputProps = props;
  if (/* @__PURE__ */ (0, import_react77.isValidElement)(props)) {
    inputProps = props.props;
  }
  if (!(0, import_isObject2.default)(inputProps)) {
    return null;
  }
  var out = {};
  Object.keys(inputProps).forEach(function(key) {
    var _inputProps;
    if (isValidSpreadableProp((_inputProps = inputProps) === null || _inputProps === void 0 ? void 0 : _inputProps[key], key, includeEvents, svgElementType)) {
      out[key] = inputProps[key];
    }
  });
  return out;
};
var isChildrenEqual = function isChildrenEqual2(nextChildren, prevChildren) {
  if (nextChildren === prevChildren) {
    return true;
  }
  var count2 = import_react77.Children.count(nextChildren);
  if (count2 !== import_react77.Children.count(prevChildren)) {
    return false;
  }
  if (count2 === 0) {
    return true;
  }
  if (count2 === 1) {
    return isSingleChildEqual((0, import_isArray2.default)(nextChildren) ? nextChildren[0] : nextChildren, (0, import_isArray2.default)(prevChildren) ? prevChildren[0] : prevChildren);
  }
  for (var i2 = 0; i2 < count2; i2++) {
    var nextChild = nextChildren[i2];
    var prevChild = prevChildren[i2];
    if ((0, import_isArray2.default)(nextChild) || (0, import_isArray2.default)(prevChild)) {
      if (!isChildrenEqual2(nextChild, prevChild)) {
        return false;
      }
    } else if (!isSingleChildEqual(nextChild, prevChild)) {
      return false;
    }
  }
  return true;
};
var isSingleChildEqual = function isSingleChildEqual2(nextChild, prevChild) {
  if ((0, import_isNil.default)(nextChild) && (0, import_isNil.default)(prevChild)) {
    return true;
  }
  if (!(0, import_isNil.default)(nextChild) && !(0, import_isNil.default)(prevChild)) {
    var _ref18 = nextChild.props || {}, nextChildren = _ref18.children, nextProps = _objectWithoutProperties(_ref18, _excluded5);
    var _ref22 = prevChild.props || {}, prevChildren = _ref22.children, prevProps = _objectWithoutProperties(_ref22, _excluded23);
    if (nextChildren && prevChildren) {
      return shallowEqual(nextProps, prevProps) && isChildrenEqual(nextChildren, prevChildren);
    }
    if (!nextChildren && !prevChildren) {
      return shallowEqual(nextProps, prevProps);
    }
    return false;
  }
  return false;
};
var renderByOrder = function renderByOrder2(children, renderMap) {
  var elements = [];
  var record = {};
  toArray(children).forEach(function(child, index) {
    if (isSvgElement(child)) {
      elements.push(child);
    } else if (child) {
      var displayName = getDisplayName(child.type);
      var _ref32 = renderMap[displayName] || {}, handler = _ref32.handler, once = _ref32.once;
      if (handler && (!once || !record[displayName])) {
        var results = handler(child, displayName, index);
        elements.push(results);
        record[displayName] = true;
      }
    }
  });
  return elements;
};
var getReactEventByType = function getReactEventByType2(e3) {
  var type = e3 && e3.type;
  if (type && REACT_BROWSER_EVENT_MAP[type]) {
    return REACT_BROWSER_EVENT_MAP[type];
  }
  return null;
};
var parseChildIndex = function parseChildIndex2(child, children) {
  return toArray(children).indexOf(child);
};

// node_modules/recharts/es6/container/Surface.js
var _excluded6 = ["children", "width", "height", "viewBox", "className", "style"];
function _extends8() {
  _extends8 = Object.assign ? Object.assign.bind() : function(target) {
    for (var i2 = 1; i2 < arguments.length; i2++) {
      var source = arguments[i2];
      for (var key in source) {
        if (Object.prototype.hasOwnProperty.call(source, key)) {
          target[key] = source[key];
        }
      }
    }
    return target;
  };
  return _extends8.apply(this, arguments);
}
function _objectWithoutProperties2(source, excluded) {
  if (source == null)
    return {};
  var target = _objectWithoutPropertiesLoose6(source, excluded);
  var key, i2;
  if (Object.getOwnPropertySymbols) {
    var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
    for (i2 = 0; i2 < sourceSymbolKeys.length; i2++) {
      key = sourceSymbolKeys[i2];
      if (excluded.indexOf(key) >= 0)
        continue;
      if (!Object.prototype.propertyIsEnumerable.call(source, key))
        continue;
      target[key] = source[key];
    }
  }
  return target;
}
function _objectWithoutPropertiesLoose6(source, excluded) {
  if (source == null)
    return {};
  var target = {};
  var sourceKeys = Object.keys(source);
  var key, i2;
  for (i2 = 0; i2 < sourceKeys.length; i2++) {
    key = sourceKeys[i2];
    if (excluded.indexOf(key) >= 0)
      continue;
    target[key] = source[key];
  }
  return target;
}
function Surface(props) {
  var children = props.children, width = props.width, height = props.height, viewBox = props.viewBox, className = props.className, style = props.style, others = _objectWithoutProperties2(props, _excluded6);
  var svgView = viewBox || {
    width,
    height,
    x: 0,
    y: 0
  };
  var layerClass = (0, import_classnames.default)("recharts-surface", className);
  return /* @__PURE__ */ import_react78.default.createElement("svg", _extends8({}, filterProps(others, true, "svg"), {
    className: layerClass,
    width,
    height,
    style,
    viewBox: "".concat(svgView.x, " ").concat(svgView.y, " ").concat(svgView.width, " ").concat(svgView.height)
  }), /* @__PURE__ */ import_react78.default.createElement("title", null, props.title), /* @__PURE__ */ import_react78.default.createElement("desc", null, props.desc), children);
}

// node_modules/recharts/es6/container/Layer.js
var import_react79 = __toESM(require_react());
var import_classnames2 = __toESM(require_classnames());
var _excluded7 = ["children", "className"];
function _extends9() {
  _extends9 = Object.assign ? Object.assign.bind() : function(target) {
    for (var i2 = 1; i2 < arguments.length; i2++) {
      var source = arguments[i2];
      for (var key in source) {
        if (Object.prototype.hasOwnProperty.call(source, key)) {
          target[key] = source[key];
        }
      }
    }
    return target;
  };
  return _extends9.apply(this, arguments);
}
function _objectWithoutProperties3(source, excluded) {
  if (source == null)
    return {};
  var target = _objectWithoutPropertiesLoose7(source, excluded);
  var key, i2;
  if (Object.getOwnPropertySymbols) {
    var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
    for (i2 = 0; i2 < sourceSymbolKeys.length; i2++) {
      key = sourceSymbolKeys[i2];
      if (excluded.indexOf(key) >= 0)
        continue;
      if (!Object.prototype.propertyIsEnumerable.call(source, key))
        continue;
      target[key] = source[key];
    }
  }
  return target;
}
function _objectWithoutPropertiesLoose7(source, excluded) {
  if (source == null)
    return {};
  var target = {};
  var sourceKeys = Object.keys(source);
  var key, i2;
  for (i2 = 0; i2 < sourceKeys.length; i2++) {
    key = sourceKeys[i2];
    if (excluded.indexOf(key) >= 0)
      continue;
    target[key] = source[key];
  }
  return target;
}
var Layer = /* @__PURE__ */ import_react79.default.forwardRef(function(props, ref) {
  var children = props.children, className = props.className, others = _objectWithoutProperties3(props, _excluded7);
  var layerClass = (0, import_classnames2.default)("recharts-layer", className);
  return /* @__PURE__ */ import_react79.default.createElement("g", _extends9({
    className: layerClass
  }, filterProps(others, true), {
    ref
  }), children);
});

// node_modules/recharts/es6/component/Legend.js
var import_isFunction3 = __toESM(require_isFunction());
var import_uniqBy = __toESM(require_uniqBy());
var import_react82 = __toESM(require_react());

// node_modules/recharts/es6/component/DefaultLegendContent.js
var import_isFunction2 = __toESM(require_isFunction());
var import_react81 = __toESM(require_react());
var import_classnames4 = __toESM(require_classnames());

// node_modules/recharts/es6/util/LogUtils.js
var isDev = true;
var warn = function warn2(condition, format3) {
  for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
    args[_key - 2] = arguments[_key];
  }
  if (isDev && typeof console !== "undefined" && console.warn) {
    if (format3 === void 0) {
      console.warn("LogUtils requires an error message argument");
    }
    if (!condition) {
      if (format3 === void 0) {
        console.warn("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");
      } else {
        var argIndex = 0;
        console.warn(format3.replace(/%s/g, function() {
          return args[argIndex++];
        }));
      }
    }
  }
};

// node_modules/recharts/es6/shape/Symbols.js
var import_upperFirst = __toESM(require_upperFirst());
var import_react80 = __toESM(require_react());

// node_modules/d3-shape/src/constant.js
function constant_default2(x2) {
  return function constant() {
    return x2;
  };
}

// node_modules/d3-shape/src/math.js
var cos = Math.cos;
var sin = Math.sin;
var sqrt = Math.sqrt;
var pi = Math.PI;
var halfPi = pi / 2;
var tau = 2 * pi;

// node_modules/d3-path/src/path.js
var pi2 = Math.PI;
var tau2 = 2 * pi2;
var epsilon2 = 1e-6;
var tauEpsilon = tau2 - epsilon2;
function append2(strings) {
  this._ += strings[0];
  for (let i2 = 1, n2 = strings.length; i2 < n2; ++i2) {
    this._ += arguments[i2] + strings[i2];
  }
}
function appendRound(digits) {
  let d = Math.floor(digits);
  if (!(d >= 0))
    throw new Error(`invalid digits: ${digits}`);
  if (d > 15)
    return append2;
  const k2 = 10 ** d;
  return function(strings) {
    this._ += strings[0];
    for (let i2 = 1, n2 = strings.length; i2 < n2; ++i2) {
      this._ += Math.round(arguments[i2] * k2) / k2 + strings[i2];
    }
  };
}
var Path2 = class {
  constructor(digits) {
    this._x0 = this._y0 = // start of current subpath
    this._x1 = this._y1 = null;
    this._ = "";
    this._append = digits == null ? append2 : appendRound(digits);
  }
  moveTo(x2, y2) {
    this._append`M${this._x0 = this._x1 = +x2},${this._y0 = this._y1 = +y2}`;
  }
  closePath() {
    if (this._x1 !== null) {
      this._x1 = this._x0, this._y1 = this._y0;
      this._append`Z`;
    }
  }
  lineTo(x2, y2) {
    this._append`L${this._x1 = +x2},${this._y1 = +y2}`;
  }
  quadraticCurveTo(x1, y1, x2, y2) {
    this._append`Q${+x1},${+y1},${this._x1 = +x2},${this._y1 = +y2}`;
  }
  bezierCurveTo(x1, y1, x2, y2, x3, y3) {
    this._append`C${+x1},${+y1},${+x2},${+y2},${this._x1 = +x3},${this._y1 = +y3}`;
  }
  arcTo(x1, y1, x2, y2, r3) {
    x1 = +x1, y1 = +y1, x2 = +x2, y2 = +y2, r3 = +r3;
    if (r3 < 0)
      throw new Error(`negative radius: ${r3}`);
    let x0 = this._x1, y0 = this._y1, x21 = x2 - x1, y21 = y2 - y1, x01 = x0 - x1, y01 = y0 - y1, l01_2 = x01 * x01 + y01 * y01;
    if (this._x1 === null) {
      this._append`M${this._x1 = x1},${this._y1 = y1}`;
    } else if (!(l01_2 > epsilon2))
      ;
    else if (!(Math.abs(y01 * x21 - y21 * x01) > epsilon2) || !r3) {
      this._append`L${this._x1 = x1},${this._y1 = y1}`;
    } else {
      let x20 = x2 - x0, y20 = y2 - y0, l21_2 = x21 * x21 + y21 * y21, l20_2 = x20 * x20 + y20 * y20, l21 = Math.sqrt(l21_2), l01 = Math.sqrt(l01_2), l = r3 * Math.tan((pi2 - Math.acos((l21_2 + l01_2 - l20_2) / (2 * l21 * l01))) / 2), t01 = l / l01, t21 = l / l21;
      if (Math.abs(t01 - 1) > epsilon2) {
        this._append`L${x1 + t01 * x01},${y1 + t01 * y01}`;
      }
      this._append`A${r3},${r3},0,0,${+(y01 * x20 > x01 * y20)},${this._x1 = x1 + t21 * x21},${this._y1 = y1 + t21 * y21}`;
    }
  }
  arc(x2, y2, r3, a0, a1, ccw) {
    x2 = +x2, y2 = +y2, r3 = +r3, ccw = !!ccw;
    if (r3 < 0)
      throw new Error(`negative radius: ${r3}`);
    let dx = r3 * Math.cos(a0), dy = r3 * Math.sin(a0), x0 = x2 + dx, y0 = y2 + dy, cw = 1 ^ ccw, da = ccw ? a0 - a1 : a1 - a0;
    if (this._x1 === null) {
      this._append`M${x0},${y0}`;
    } else if (Math.abs(this._x1 - x0) > epsilon2 || Math.abs(this._y1 - y0) > epsilon2) {
      this._append`L${x0},${y0}`;
    }
    if (!r3)
      return;
    if (da < 0)
      da = da % tau2 + tau2;
    if (da > tauEpsilon) {
      this._append`A${r3},${r3},0,1,${cw},${x2 - dx},${y2 - dy}A${r3},${r3},0,1,${cw},${this._x1 = x0},${this._y1 = y0}`;
    } else if (da > epsilon2) {
      this._append`A${r3},${r3},0,${+(da >= pi2)},${cw},${this._x1 = x2 + r3 * Math.cos(a1)},${this._y1 = y2 + r3 * Math.sin(a1)}`;
    }
  }
  rect(x2, y2, w, h) {
    this._append`M${this._x0 = this._x1 = +x2},${this._y0 = this._y1 = +y2}h${w = +w}v${+h}h${-w}Z`;
  }
  toString() {
    return this._;
  }
};
function path() {
  return new Path2();
}
path.prototype = Path2.prototype;

// node_modules/d3-shape/src/path.js
function withPath(shape) {
  let digits = 3;
  shape.digits = function(_) {
    if (!arguments.length)
      return digits;
    if (_ == null) {
      digits = null;
    } else {
      const d = Math.floor(_);
      if (!(d >= 0))
        throw new RangeError(`invalid digits: ${_}`);
      digits = d;
    }
    return shape;
  };
  return () => new Path2(digits);
}

// node_modules/d3-shape/src/array.js
var slice2 = Array.prototype.slice;
function array_default(x2) {
  return typeof x2 === "object" && "length" in x2 ? x2 : Array.from(x2);
}

// node_modules/d3-shape/src/curve/linear.js
function Linear(context2) {
  this._context = context2;
}
Linear.prototype = {
  areaStart: function() {
    this._line = 0;
  },
  areaEnd: function() {
    this._line = NaN;
  },
  lineStart: function() {
    this._point = 0;
  },
  lineEnd: function() {
    if (this._line || this._line !== 0 && this._point === 1)
      this._context.closePath();
    this._line = 1 - this._line;
  },
  point: function(x2, y2) {
    x2 = +x2, y2 = +y2;
    switch (this._point) {
      case 0:
        this._point = 1;
        this._line ? this._context.lineTo(x2, y2) : this._context.moveTo(x2, y2);
        break;
      case 1:
        this._point = 2;
      default:
        this._context.lineTo(x2, y2);
        break;
    }
  }
};
function linear_default(context2) {
  return new Linear(context2);
}

// node_modules/d3-shape/src/point.js
function x(p) {
  return p[0];
}
function y(p) {
  return p[1];
}

// node_modules/d3-shape/src/line.js
function line_default(x2, y2) {
  var defined3 = constant_default2(true), context2 = null, curve = linear_default, output = null, path2 = withPath(line2);
  x2 = typeof x2 === "function" ? x2 : x2 === void 0 ? x : constant_default2(x2);
  y2 = typeof y2 === "function" ? y2 : y2 === void 0 ? y : constant_default2(y2);
  function line2(data) {
    var i2, n2 = (data = array_default(data)).length, d, defined0 = false, buffer;
    if (context2 == null)
      output = curve(buffer = path2());
    for (i2 = 0; i2 <= n2; ++i2) {
      if (!(i2 < n2 && defined3(d = data[i2], i2, data)) === defined0) {
        if (defined0 = !defined0)
          output.lineStart();
        else
          output.lineEnd();
      }
      if (defined0)
        output.point(+x2(d, i2, data), +y2(d, i2, data));
    }
    if (buffer)
      return output = null, buffer + "" || null;
  }
  line2.x = function(_) {
    return arguments.length ? (x2 = typeof _ === "function" ? _ : constant_default2(+_), line2) : x2;
  };
  line2.y = function(_) {
    return arguments.length ? (y2 = typeof _ === "function" ? _ : constant_default2(+_), line2) : y2;
  };
  line2.defined = function(_) {
    return arguments.length ? (defined3 = typeof _ === "function" ? _ : constant_default2(!!_), line2) : defined3;
  };
  line2.curve = function(_) {
    return arguments.length ? (curve = _, context2 != null && (output = curve(context2)), line2) : curve;
  };
  line2.context = function(_) {
    return arguments.length ? (_ == null ? context2 = output = null : output = curve(context2 = _), line2) : context2;
  };
  return line2;
}

// node_modules/d3-shape/src/area.js
function area_default(x0, y0, y1) {
  var x1 = null, defined3 = constant_default2(true), context2 = null, curve = linear_default, output = null, path2 = withPath(area2);
  x0 = typeof x0 === "function" ? x0 : x0 === void 0 ? x : constant_default2(+x0);
  y0 = typeof y0 === "function" ? y0 : y0 === void 0 ? constant_default2(0) : constant_default2(+y0);
  y1 = typeof y1 === "function" ? y1 : y1 === void 0 ? y : constant_default2(+y1);
  function area2(data) {
    var i2, j, k2, n2 = (data = array_default(data)).length, d, defined0 = false, buffer, x0z = new Array(n2), y0z = new Array(n2);
    if (context2 == null)
      output = curve(buffer = path2());
    for (i2 = 0; i2 <= n2; ++i2) {
      if (!(i2 < n2 && defined3(d = data[i2], i2, data)) === defined0) {
        if (defined0 = !defined0) {
          j = i2;
          output.areaStart();
          output.lineStart();
        } else {
          output.lineEnd();
          output.lineStart();
          for (k2 = i2 - 1; k2 >= j; --k2) {
            output.point(x0z[k2], y0z[k2]);
          }
          output.lineEnd();
          output.areaEnd();
        }
      }
      if (defined0) {
        x0z[i2] = +x0(d, i2, data), y0z[i2] = +y0(d, i2, data);
        output.point(x1 ? +x1(d, i2, data) : x0z[i2], y1 ? +y1(d, i2, data) : y0z[i2]);
      }
    }
    if (buffer)
      return output = null, buffer + "" || null;
  }
  function arealine() {
    return line_default().defined(defined3).curve(curve).context(context2);
  }
  area2.x = function(_) {
    return arguments.length ? (x0 = typeof _ === "function" ? _ : constant_default2(+_), x1 = null, area2) : x0;
  };
  area2.x0 = function(_) {
    return arguments.length ? (x0 = typeof _ === "function" ? _ : constant_default2(+_), area2) : x0;
  };
  area2.x1 = function(_) {
    return arguments.length ? (x1 = _ == null ? null : typeof _ === "function" ? _ : constant_default2(+_), area2) : x1;
  };
  area2.y = function(_) {
    return arguments.length ? (y0 = typeof _ === "function" ? _ : constant_default2(+_), y1 = null, area2) : y0;
  };
  area2.y0 = function(_) {
    return arguments.length ? (y0 = typeof _ === "function" ? _ : constant_default2(+_), area2) : y0;
  };
  area2.y1 = function(_) {
    return arguments.length ? (y1 = _ == null ? null : typeof _ === "function" ? _ : constant_default2(+_), area2) : y1;
  };
  area2.lineX0 = area2.lineY0 = function() {
    return arealine().x(x0).y(y0);
  };
  area2.lineY1 = function() {
    return arealine().x(x0).y(y1);
  };
  area2.lineX1 = function() {
    return arealine().x(x1).y(y0);
  };
  area2.defined = function(_) {
    return arguments.length ? (defined3 = typeof _ === "function" ? _ : constant_default2(!!_), area2) : defined3;
  };
  area2.curve = function(_) {
    return arguments.length ? (curve = _, context2 != null && (output = curve(context2)), area2) : curve;
  };
  area2.context = function(_) {
    return arguments.length ? (_ == null ? context2 = output = null : output = curve(context2 = _), area2) : context2;
  };
  return area2;
}

// node_modules/d3-shape/src/curve/bump.js
var Bump = class {
  constructor(context2, x2) {
    this._context = context2;
    this._x = x2;
  }
  areaStart() {
    this._line = 0;
  }
  areaEnd() {
    this._line = NaN;
  }
  lineStart() {
    this._point = 0;
  }
  lineEnd() {
    if (this._line || this._line !== 0 && this._point === 1)
      this._context.closePath();
    this._line = 1 - this._line;
  }
  point(x2, y2) {
    x2 = +x2, y2 = +y2;
    switch (this._point) {
      case 0: {
        this._point = 1;
        if (this._line)
          this._context.lineTo(x2, y2);
        else
          this._context.moveTo(x2, y2);
        break;
      }
      case 1:
        this._point = 2;
      default: {
        if (this._x)
          this._context.bezierCurveTo(this._x0 = (this._x0 + x2) / 2, this._y0, this._x0, y2, x2, y2);
        else
          this._context.bezierCurveTo(this._x0, this._y0 = (this._y0 + y2) / 2, x2, this._y0, x2, y2);
        break;
      }
    }
    this._x0 = x2, this._y0 = y2;
  }
};
function bumpX(context2) {
  return new Bump(context2, true);
}
function bumpY(context2) {
  return new Bump(context2, false);
}

// node_modules/d3-shape/src/symbol/circle.js
var circle_default = {
  draw(context2, size) {
    const r3 = sqrt(size / pi);
    context2.moveTo(r3, 0);
    context2.arc(0, 0, r3, 0, tau);
  }
};

// node_modules/d3-shape/src/symbol/cross.js
var cross_default = {
  draw(context2, size) {
    const r3 = sqrt(size / 5) / 2;
    context2.moveTo(-3 * r3, -r3);
    context2.lineTo(-r3, -r3);
    context2.lineTo(-r3, -3 * r3);
    context2.lineTo(r3, -3 * r3);
    context2.lineTo(r3, -r3);
    context2.lineTo(3 * r3, -r3);
    context2.lineTo(3 * r3, r3);
    context2.lineTo(r3, r3);
    context2.lineTo(r3, 3 * r3);
    context2.lineTo(-r3, 3 * r3);
    context2.lineTo(-r3, r3);
    context2.lineTo(-3 * r3, r3);
    context2.closePath();
  }
};

// node_modules/d3-shape/src/symbol/diamond.js
var tan30 = sqrt(1 / 3);
var tan30_2 = tan30 * 2;
var diamond_default = {
  draw(context2, size) {
    const y2 = sqrt(size / tan30_2);
    const x2 = y2 * tan30;
    context2.moveTo(0, -y2);
    context2.lineTo(x2, 0);
    context2.lineTo(0, y2);
    context2.lineTo(-x2, 0);
    context2.closePath();
  }
};

// node_modules/d3-shape/src/symbol/square.js
var square_default = {
  draw(context2, size) {
    const w = sqrt(size);
    const x2 = -w / 2;
    context2.rect(x2, x2, w, w);
  }
};

// node_modules/d3-shape/src/symbol/star.js
var ka = 0.8908130915292852;
var kr = sin(pi / 10) / sin(7 * pi / 10);
var kx = sin(tau / 10) * kr;
var ky = -cos(tau / 10) * kr;
var star_default = {
  draw(context2, size) {
    const r3 = sqrt(size * ka);
    const x2 = kx * r3;
    const y2 = ky * r3;
    context2.moveTo(0, -r3);
    context2.lineTo(x2, y2);
    for (let i2 = 1; i2 < 5; ++i2) {
      const a2 = tau * i2 / 5;
      const c4 = cos(a2);
      const s2 = sin(a2);
      context2.lineTo(s2 * r3, -c4 * r3);
      context2.lineTo(c4 * x2 - s2 * y2, s2 * x2 + c4 * y2);
    }
    context2.closePath();
  }
};

// node_modules/d3-shape/src/symbol/triangle.js
var sqrt3 = sqrt(3);
var triangle_default = {
  draw(context2, size) {
    const y2 = -sqrt(size / (sqrt3 * 3));
    context2.moveTo(0, y2 * 2);
    context2.lineTo(-sqrt3 * y2, -y2);
    context2.lineTo(sqrt3 * y2, -y2);
    context2.closePath();
  }
};

// node_modules/d3-shape/src/symbol/wye.js
var c3 = -0.5;
var s = sqrt(3) / 2;
var k = 1 / sqrt(12);
var a = (k / 2 + 1) * 3;
var wye_default = {
  draw(context2, size) {
    const r3 = sqrt(size / a);
    const x0 = r3 / 2, y0 = r3 * k;
    const x1 = x0, y1 = r3 * k + r3;
    const x2 = -x1, y2 = y1;
    context2.moveTo(x0, y0);
    context2.lineTo(x1, y1);
    context2.lineTo(x2, y2);
    context2.lineTo(c3 * x0 - s * y0, s * x0 + c3 * y0);
    context2.lineTo(c3 * x1 - s * y1, s * x1 + c3 * y1);
    context2.lineTo(c3 * x2 - s * y2, s * x2 + c3 * y2);
    context2.lineTo(c3 * x0 + s * y0, c3 * y0 - s * x0);
    context2.lineTo(c3 * x1 + s * y1, c3 * y1 - s * x1);
    context2.lineTo(c3 * x2 + s * y2, c3 * y2 - s * x2);
    context2.closePath();
  }
};

// node_modules/d3-shape/src/symbol.js
function Symbol2(type, size) {
  let context2 = null, path2 = withPath(symbol);
  type = typeof type === "function" ? type : constant_default2(type || circle_default);
  size = typeof size === "function" ? size : constant_default2(size === void 0 ? 64 : +size);
  function symbol() {
    let buffer;
    if (!context2)
      context2 = buffer = path2();
    type.apply(this, arguments).draw(context2, +size.apply(this, arguments));
    if (buffer)
      return context2 = null, buffer + "" || null;
  }
  symbol.type = function(_) {
    return arguments.length ? (type = typeof _ === "function" ? _ : constant_default2(_), symbol) : type;
  };
  symbol.size = function(_) {
    return arguments.length ? (size = typeof _ === "function" ? _ : constant_default2(+_), symbol) : size;
  };
  symbol.context = function(_) {
    return arguments.length ? (context2 = _ == null ? null : _, symbol) : context2;
  };
  return symbol;
}

// node_modules/d3-shape/src/noop.js
function noop_default() {
}

// node_modules/d3-shape/src/curve/basis.js
function point(that, x2, y2) {
  that._context.bezierCurveTo(
    (2 * that._x0 + that._x1) / 3,
    (2 * that._y0 + that._y1) / 3,
    (that._x0 + 2 * that._x1) / 3,
    (that._y0 + 2 * that._y1) / 3,
    (that._x0 + 4 * that._x1 + x2) / 6,
    (that._y0 + 4 * that._y1 + y2) / 6
  );
}
function Basis(context2) {
  this._context = context2;
}
Basis.prototype = {
  areaStart: function() {
    this._line = 0;
  },
  areaEnd: function() {
    this._line = NaN;
  },
  lineStart: function() {
    this._x0 = this._x1 = this._y0 = this._y1 = NaN;
    this._point = 0;
  },
  lineEnd: function() {
    switch (this._point) {
      case 3:
        point(this, this._x1, this._y1);
      case 2:
        this._context.lineTo(this._x1, this._y1);
        break;
    }
    if (this._line || this._line !== 0 && this._point === 1)
      this._context.closePath();
    this._line = 1 - this._line;
  },
  point: function(x2, y2) {
    x2 = +x2, y2 = +y2;
    switch (this._point) {
      case 0:
        this._point = 1;
        this._line ? this._context.lineTo(x2, y2) : this._context.moveTo(x2, y2);
        break;
      case 1:
        this._point = 2;
        break;
      case 2:
        this._point = 3;
        this._context.lineTo((5 * this._x0 + this._x1) / 6, (5 * this._y0 + this._y1) / 6);
      default:
        point(this, x2, y2);
        break;
    }
    this._x0 = this._x1, this._x1 = x2;
    this._y0 = this._y1, this._y1 = y2;
  }
};
function basis_default2(context2) {
  return new Basis(context2);
}

// node_modules/d3-shape/src/curve/basisClosed.js
function BasisClosed(context2) {
  this._context = context2;
}
BasisClosed.prototype = {
  areaStart: noop_default,
  areaEnd: noop_default,
  lineStart: function() {
    this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = NaN;
    this._point = 0;
  },
  lineEnd: function() {
    switch (this._point) {
      case 1: {
        this._context.moveTo(this._x2, this._y2);
        this._context.closePath();
        break;
      }
      case 2: {
        this._context.moveTo((this._x2 + 2 * this._x3) / 3, (this._y2 + 2 * this._y3) / 3);
        this._context.lineTo((this._x3 + 2 * this._x2) / 3, (this._y3 + 2 * this._y2) / 3);
        this._context.closePath();
        break;
      }
      case 3: {
        this.point(this._x2, this._y2);
        this.point(this._x3, this._y3);
        this.point(this._x4, this._y4);
        break;
      }
    }
  },
  point: function(x2, y2) {
    x2 = +x2, y2 = +y2;
    switch (this._point) {
      case 0:
        this._point = 1;
        this._x2 = x2, this._y2 = y2;
        break;
      case 1:
        this._point = 2;
        this._x3 = x2, this._y3 = y2;
        break;
      case 2:
        this._point = 3;
        this._x4 = x2, this._y4 = y2;
        this._context.moveTo((this._x0 + 4 * this._x1 + x2) / 6, (this._y0 + 4 * this._y1 + y2) / 6);
        break;
      default:
        point(this, x2, y2);
        break;
    }
    this._x0 = this._x1, this._x1 = x2;
    this._y0 = this._y1, this._y1 = y2;
  }
};
function basisClosed_default2(context2) {
  return new BasisClosed(context2);
}

// node_modules/d3-shape/src/curve/basisOpen.js
function BasisOpen(context2) {
  this._context = context2;
}
BasisOpen.prototype = {
  areaStart: function() {
    this._line = 0;
  },
  areaEnd: function() {
    this._line = NaN;
  },
  lineStart: function() {
    this._x0 = this._x1 = this._y0 = this._y1 = NaN;
    this._point = 0;
  },
  lineEnd: function() {
    if (this._line || this._line !== 0 && this._point === 3)
      this._context.closePath();
    this._line = 1 - this._line;
  },
  point: function(x2, y2) {
    x2 = +x2, y2 = +y2;
    switch (this._point) {
      case 0:
        this._point = 1;
        break;
      case 1:
        this._point = 2;
        break;
      case 2:
        this._point = 3;
        var x0 = (this._x0 + 4 * this._x1 + x2) / 6, y0 = (this._y0 + 4 * this._y1 + y2) / 6;
        this._line ? this._context.lineTo(x0, y0) : this._context.moveTo(x0, y0);
        break;
      case 3:
        this._point = 4;
      default:
        point(this, x2, y2);
        break;
    }
    this._x0 = this._x1, this._x1 = x2;
    this._y0 = this._y1, this._y1 = y2;
  }
};
function basisOpen_default(context2) {
  return new BasisOpen(context2);
}

// node_modules/d3-shape/src/curve/linearClosed.js
function LinearClosed(context2) {
  this._context = context2;
}
LinearClosed.prototype = {
  areaStart: noop_default,
  areaEnd: noop_default,
  lineStart: function() {
    this._point = 0;
  },
  lineEnd: function() {
    if (this._point)
      this._context.closePath();
  },
  point: function(x2, y2) {
    x2 = +x2, y2 = +y2;
    if (this._point)
      this._context.lineTo(x2, y2);
    else
      this._point = 1, this._context.moveTo(x2, y2);
  }
};
function linearClosed_default(context2) {
  return new LinearClosed(context2);
}

// node_modules/d3-shape/src/curve/monotone.js
function sign2(x2) {
  return x2 < 0 ? -1 : 1;
}
function slope3(that, x2, y2) {
  var h0 = that._x1 - that._x0, h1 = x2 - that._x1, s0 = (that._y1 - that._y0) / (h0 || h1 < 0 && -0), s1 = (y2 - that._y1) / (h1 || h0 < 0 && -0), p = (s0 * h1 + s1 * h0) / (h0 + h1);
  return (sign2(s0) + sign2(s1)) * Math.min(Math.abs(s0), Math.abs(s1), 0.5 * Math.abs(p)) || 0;
}
function slope2(that, t3) {
  var h = that._x1 - that._x0;
  return h ? (3 * (that._y1 - that._y0) / h - t3) / 2 : t3;
}
function point2(that, t02, t12) {
  var x0 = that._x0, y0 = that._y0, x1 = that._x1, y1 = that._y1, dx = (x1 - x0) / 3;
  that._context.bezierCurveTo(x0 + dx, y0 + dx * t02, x1 - dx, y1 - dx * t12, x1, y1);
}
function MonotoneX(context2) {
  this._context = context2;
}
MonotoneX.prototype = {
  areaStart: function() {
    this._line = 0;
  },
  areaEnd: function() {
    this._line = NaN;
  },
  lineStart: function() {
    this._x0 = this._x1 = this._y0 = this._y1 = this._t0 = NaN;
    this._point = 0;
  },
  lineEnd: function() {
    switch (this._point) {
      case 2:
        this._context.lineTo(this._x1, this._y1);
        break;
      case 3:
        point2(this, this._t0, slope2(this, this._t0));
        break;
    }
    if (this._line || this._line !== 0 && this._point === 1)
      this._context.closePath();
    this._line = 1 - this._line;
  },
  point: function(x2, y2) {
    var t12 = NaN;
    x2 = +x2, y2 = +y2;
    if (x2 === this._x1 && y2 === this._y1)
      return;
    switch (this._point) {
      case 0:
        this._point = 1;
        this._line ? this._context.lineTo(x2, y2) : this._context.moveTo(x2, y2);
        break;
      case 1:
        this._point = 2;
        break;
      case 2:
        this._point = 3;
        point2(this, slope2(this, t12 = slope3(this, x2, y2)), t12);
        break;
      default:
        point2(this, this._t0, t12 = slope3(this, x2, y2));
        break;
    }
    this._x0 = this._x1, this._x1 = x2;
    this._y0 = this._y1, this._y1 = y2;
    this._t0 = t12;
  }
};
function MonotoneY(context2) {
  this._context = new ReflectContext(context2);
}
(MonotoneY.prototype = Object.create(MonotoneX.prototype)).point = function(x2, y2) {
  MonotoneX.prototype.point.call(this, y2, x2);
};
function ReflectContext(context2) {
  this._context = context2;
}
ReflectContext.prototype = {
  moveTo: function(x2, y2) {
    this._context.moveTo(y2, x2);
  },
  closePath: function() {
    this._context.closePath();
  },
  lineTo: function(x2, y2) {
    this._context.lineTo(y2, x2);
  },
  bezierCurveTo: function(x1, y1, x2, y2, x3, y3) {
    this._context.bezierCurveTo(y1, x1, y2, x2, y3, x3);
  }
};
function monotoneX(context2) {
  return new MonotoneX(context2);
}
function monotoneY(context2) {
  return new MonotoneY(context2);
}

// node_modules/d3-shape/src/curve/natural.js
function Natural(context2) {
  this._context = context2;
}
Natural.prototype = {
  areaStart: function() {
    this._line = 0;
  },
  areaEnd: function() {
    this._line = NaN;
  },
  lineStart: function() {
    this._x = [];
    this._y = [];
  },
  lineEnd: function() {
    var x2 = this._x, y2 = this._y, n2 = x2.length;
    if (n2) {
      this._line ? this._context.lineTo(x2[0], y2[0]) : this._context.moveTo(x2[0], y2[0]);
      if (n2 === 2) {
        this._context.lineTo(x2[1], y2[1]);
      } else {
        var px2 = controlPoints(x2), py2 = controlPoints(y2);
        for (var i0 = 0, i1 = 1; i1 < n2; ++i0, ++i1) {
          this._context.bezierCurveTo(px2[0][i0], py2[0][i0], px2[1][i0], py2[1][i0], x2[i1], y2[i1]);
        }
      }
    }
    if (this._line || this._line !== 0 && n2 === 1)
      this._context.closePath();
    this._line = 1 - this._line;
    this._x = this._y = null;
  },
  point: function(x2, y2) {
    this._x.push(+x2);
    this._y.push(+y2);
  }
};
function controlPoints(x2) {
  var i2, n2 = x2.length - 1, m, a2 = new Array(n2), b = new Array(n2), r3 = new Array(n2);
  a2[0] = 0, b[0] = 2, r3[0] = x2[0] + 2 * x2[1];
  for (i2 = 1; i2 < n2 - 1; ++i2)
    a2[i2] = 1, b[i2] = 4, r3[i2] = 4 * x2[i2] + 2 * x2[i2 + 1];
  a2[n2 - 1] = 2, b[n2 - 1] = 7, r3[n2 - 1] = 8 * x2[n2 - 1] + x2[n2];
  for (i2 = 1; i2 < n2; ++i2)
    m = a2[i2] / b[i2 - 1], b[i2] -= m, r3[i2] -= m * r3[i2 - 1];
  a2[n2 - 1] = r3[n2 - 1] / b[n2 - 1];
  for (i2 = n2 - 2; i2 >= 0; --i2)
    a2[i2] = (r3[i2] - a2[i2 + 1]) / b[i2];
  b[n2 - 1] = (x2[n2] + a2[n2 - 1]) / 2;
  for (i2 = 0; i2 < n2 - 1; ++i2)
    b[i2] = 2 * x2[i2 + 1] - a2[i2 + 1];
  return [a2, b];
}
function natural_default(context2) {
  return new Natural(context2);
}

// node_modules/d3-shape/src/curve/step.js
function Step(context2, t3) {
  this._context = context2;
  this._t = t3;
}
Step.prototype = {
  areaStart: function() {
    this._line = 0;
  },
  areaEnd: function() {
    this._line = NaN;
  },
  lineStart: function() {
    this._x = this._y = NaN;
    this._point = 0;
  },
  lineEnd: function() {
    if (0 < this._t && this._t < 1 && this._point === 2)
      this._context.lineTo(this._x, this._y);
    if (this._line || this._line !== 0 && this._point === 1)
      this._context.closePath();
    if (this._line >= 0)
      this._t = 1 - this._t, this._line = 1 - this._line;
  },
  point: function(x2, y2) {
    x2 = +x2, y2 = +y2;
    switch (this._point) {
      case 0:
        this._point = 1;
        this._line ? this._context.lineTo(x2, y2) : this._context.moveTo(x2, y2);
        break;
      case 1:
        this._point = 2;
      default: {
        if (this._t <= 0) {
          this._context.lineTo(this._x, y2);
          this._context.lineTo(x2, y2);
        } else {
          var x1 = this._x * (1 - this._t) + x2 * this._t;
          this._context.lineTo(x1, this._y);
          this._context.lineTo(x1, y2);
        }
        break;
      }
    }
    this._x = x2, this._y = y2;
  }
};
function step_default(context2) {
  return new Step(context2, 0.5);
}
function stepBefore(context2) {
  return new Step(context2, 0);
}
function stepAfter(context2) {
  return new Step(context2, 1);
}

// node_modules/d3-shape/src/offset/none.js
function none_default(series, order) {
  if (!((n2 = series.length) > 1))
    return;
  for (var i2 = 1, j, s0, s1 = series[order[0]], n2, m = s1.length; i2 < n2; ++i2) {
    s0 = s1, s1 = series[order[i2]];
    for (j = 0; j < m; ++j) {
      s1[j][1] += s1[j][0] = isNaN(s0[j][1]) ? s0[j][0] : s0[j][1];
    }
  }
}

// node_modules/d3-shape/src/order/none.js
function none_default2(series) {
  var n2 = series.length, o = new Array(n2);
  while (--n2 >= 0)
    o[n2] = n2;
  return o;
}

// node_modules/d3-shape/src/stack.js
function stackValue(d, key) {
  return d[key];
}
function stackSeries(key) {
  const series = [];
  series.key = key;
  return series;
}
function stack_default() {
  var keys4 = constant_default2([]), order = none_default2, offset = none_default, value = stackValue;
  function stack(data) {
    var sz = Array.from(keys4.apply(this, arguments), stackSeries), i2, n2 = sz.length, j = -1, oz;
    for (const d of data) {
      for (i2 = 0, ++j; i2 < n2; ++i2) {
        (sz[i2][j] = [0, +value(d, sz[i2].key, j, data)]).data = d;
      }
    }
    for (i2 = 0, oz = array_default(order(sz)); i2 < n2; ++i2) {
      sz[oz[i2]].index = i2;
    }
    offset(sz, oz);
    return sz;
  }
  stack.keys = function(_) {
    return arguments.length ? (keys4 = typeof _ === "function" ? _ : constant_default2(Array.from(_)), stack) : keys4;
  };
  stack.value = function(_) {
    return arguments.length ? (value = typeof _ === "function" ? _ : constant_default2(+_), stack) : value;
  };
  stack.order = function(_) {
    return arguments.length ? (order = _ == null ? none_default2 : typeof _ === "function" ? _ : constant_default2(Array.from(_)), stack) : order;
  };
  stack.offset = function(_) {
    return arguments.length ? (offset = _ == null ? none_default : _, stack) : offset;
  };
  return stack;
}

// node_modules/d3-shape/src/offset/expand.js
function expand_default(series, order) {
  if (!((n2 = series.length) > 0))
    return;
  for (var i2, n2, j = 0, m = series[0].length, y2; j < m; ++j) {
    for (y2 = i2 = 0; i2 < n2; ++i2)
      y2 += series[i2][j][1] || 0;
    if (y2)
      for (i2 = 0; i2 < n2; ++i2)
        series[i2][j][1] /= y2;
  }
  none_default(series, order);
}

// node_modules/d3-shape/src/offset/silhouette.js
function silhouette_default(series, order) {
  if (!((n2 = series.length) > 0))
    return;
  for (var j = 0, s0 = series[order[0]], n2, m = s0.length; j < m; ++j) {
    for (var i2 = 0, y2 = 0; i2 < n2; ++i2)
      y2 += series[i2][j][1] || 0;
    s0[j][1] += s0[j][0] = -y2 / 2;
  }
  none_default(series, order);
}

// node_modules/d3-shape/src/offset/wiggle.js
function wiggle_default(series, order) {
  if (!((n2 = series.length) > 0) || !((m = (s0 = series[order[0]]).length) > 0))
    return;
  for (var y2 = 0, j = 1, s0, m, n2; j < m; ++j) {
    for (var i2 = 0, s1 = 0, s2 = 0; i2 < n2; ++i2) {
      var si = series[order[i2]], sij0 = si[j][1] || 0, sij1 = si[j - 1][1] || 0, s3 = (sij0 - sij1) / 2;
      for (var k2 = 0; k2 < i2; ++k2) {
        var sk = series[order[k2]], skj0 = sk[j][1] || 0, skj1 = sk[j - 1][1] || 0;
        s3 += skj0 - skj1;
      }
      s1 += sij0, s2 += s3 * sij0;
    }
    s0[j - 1][1] += s0[j - 1][0] = y2;
    if (s1)
      y2 -= s2 / s1;
  }
  s0[j - 1][1] += s0[j - 1][0] = y2;
  none_default(series, order);
}

// node_modules/recharts/es6/shape/Symbols.js
var import_classnames3 = __toESM(require_classnames());
function _typeof4(o) {
  "@babel/helpers - typeof";
  return _typeof4 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
    return typeof o2;
  } : function(o2) {
    return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
  }, _typeof4(o);
}
var _excluded8 = ["type", "size", "sizeType"];
function _extends10() {
  _extends10 = Object.assign ? Object.assign.bind() : function(target) {
    for (var i2 = 1; i2 < arguments.length; i2++) {
      var source = arguments[i2];
      for (var key in source) {
        if (Object.prototype.hasOwnProperty.call(source, key)) {
          target[key] = source[key];
        }
      }
    }
    return target;
  };
  return _extends10.apply(this, arguments);
}
function ownKeys(e3, r3) {
  var t3 = Object.keys(e3);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e3);
    r3 && (o = o.filter(function(r4) {
      return Object.getOwnPropertyDescriptor(e3, r4).enumerable;
    })), t3.push.apply(t3, o);
  }
  return t3;
}
function _objectSpread(e3) {
  for (var r3 = 1; r3 < arguments.length; r3++) {
    var t3 = null != arguments[r3] ? arguments[r3] : {};
    r3 % 2 ? ownKeys(Object(t3), true).forEach(function(r4) {
      _defineProperty(e3, r4, t3[r4]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e3, Object.getOwnPropertyDescriptors(t3)) : ownKeys(Object(t3)).forEach(function(r4) {
      Object.defineProperty(e3, r4, Object.getOwnPropertyDescriptor(t3, r4));
    });
  }
  return e3;
}
function _defineProperty(obj, key, value) {
  key = _toPropertyKey(key);
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
function _toPropertyKey(arg) {
  var key = _toPrimitive(arg, "string");
  return _typeof4(key) === "symbol" ? key : String(key);
}
function _toPrimitive(input, hint) {
  if (_typeof4(input) !== "object" || input === null)
    return input;
  var prim = input[Symbol.toPrimitive];
  if (prim !== void 0) {
    var res = prim.call(input, hint || "default");
    if (_typeof4(res) !== "object")
      return res;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (hint === "string" ? String : Number)(input);
}
function _objectWithoutProperties4(source, excluded) {
  if (source == null)
    return {};
  var target = _objectWithoutPropertiesLoose8(source, excluded);
  var key, i2;
  if (Object.getOwnPropertySymbols) {
    var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
    for (i2 = 0; i2 < sourceSymbolKeys.length; i2++) {
      key = sourceSymbolKeys[i2];
      if (excluded.indexOf(key) >= 0)
        continue;
      if (!Object.prototype.propertyIsEnumerable.call(source, key))
        continue;
      target[key] = source[key];
    }
  }
  return target;
}
function _objectWithoutPropertiesLoose8(source, excluded) {
  if (source == null)
    return {};
  var target = {};
  var sourceKeys = Object.keys(source);
  var key, i2;
  for (i2 = 0; i2 < sourceKeys.length; i2++) {
    key = sourceKeys[i2];
    if (excluded.indexOf(key) >= 0)
      continue;
    target[key] = source[key];
  }
  return target;
}
var symbolFactories = {
  symbolCircle: circle_default,
  symbolCross: cross_default,
  symbolDiamond: diamond_default,
  symbolSquare: square_default,
  symbolStar: star_default,
  symbolTriangle: triangle_default,
  symbolWye: wye_default
};
var RADIAN = Math.PI / 180;
var getSymbolFactory = function getSymbolFactory2(type) {
  var name2 = "symbol".concat((0, import_upperFirst.default)(type));
  return symbolFactories[name2] || circle_default;
};
var calculateAreaSize = function calculateAreaSize2(size, sizeType, type) {
  if (sizeType === "area") {
    return size;
  }
  switch (type) {
    case "cross":
      return 5 * size * size / 9;
    case "diamond":
      return 0.5 * size * size / Math.sqrt(3);
    case "square":
      return size * size;
    case "star": {
      var angle = 18 * RADIAN;
      return 1.25 * size * size * (Math.tan(angle) - Math.tan(angle * 2) * Math.pow(Math.tan(angle), 2));
    }
    case "triangle":
      return Math.sqrt(3) * size * size / 4;
    case "wye":
      return (21 - 10 * Math.sqrt(3)) * size * size / 8;
    default:
      return Math.PI * size * size / 4;
  }
};
var registerSymbol = function registerSymbol2(key, factory) {
  symbolFactories["symbol".concat((0, import_upperFirst.default)(key))] = factory;
};
var Symbols = function Symbols2(_ref18) {
  var _ref$type = _ref18.type, type = _ref$type === void 0 ? "circle" : _ref$type, _ref$size = _ref18.size, size = _ref$size === void 0 ? 64 : _ref$size, _ref$sizeType = _ref18.sizeType, sizeType = _ref$sizeType === void 0 ? "area" : _ref$sizeType, rest = _objectWithoutProperties4(_ref18, _excluded8);
  var props = _objectSpread(_objectSpread({}, rest), {}, {
    type,
    size,
    sizeType
  });
  var getPath5 = function getPath6() {
    var symbolFactory = getSymbolFactory(type);
    var symbol = Symbol2().type(symbolFactory).size(calculateAreaSize(size, sizeType, type));
    return symbol();
  };
  var className = props.className, cx = props.cx, cy = props.cy;
  var filteredProps = filterProps(props, true);
  if (cx === +cx && cy === +cy && size === +size) {
    return /* @__PURE__ */ import_react80.default.createElement("path", _extends10({}, filteredProps, {
      className: (0, import_classnames3.default)("recharts-symbols", className),
      transform: "translate(".concat(cx, ", ").concat(cy, ")"),
      d: getPath5()
    }));
  }
  return null;
};
Symbols.registerSymbol = registerSymbol;

// node_modules/recharts/es6/component/DefaultLegendContent.js
function _typeof5(o) {
  "@babel/helpers - typeof";
  return _typeof5 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
    return typeof o2;
  } : function(o2) {
    return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
  }, _typeof5(o);
}
function _extends11() {
  _extends11 = Object.assign ? Object.assign.bind() : function(target) {
    for (var i2 = 1; i2 < arguments.length; i2++) {
      var source = arguments[i2];
      for (var key in source) {
        if (Object.prototype.hasOwnProperty.call(source, key)) {
          target[key] = source[key];
        }
      }
    }
    return target;
  };
  return _extends11.apply(this, arguments);
}
function ownKeys2(e3, r3) {
  var t3 = Object.keys(e3);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e3);
    r3 && (o = o.filter(function(r4) {
      return Object.getOwnPropertyDescriptor(e3, r4).enumerable;
    })), t3.push.apply(t3, o);
  }
  return t3;
}
function _objectSpread2(e3) {
  for (var r3 = 1; r3 < arguments.length; r3++) {
    var t3 = null != arguments[r3] ? arguments[r3] : {};
    r3 % 2 ? ownKeys2(Object(t3), true).forEach(function(r4) {
      _defineProperty2(e3, r4, t3[r4]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e3, Object.getOwnPropertyDescriptors(t3)) : ownKeys2(Object(t3)).forEach(function(r4) {
      Object.defineProperty(e3, r4, Object.getOwnPropertyDescriptor(t3, r4));
    });
  }
  return e3;
}
function _classCallCheck(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties(target, props) {
  for (var i2 = 0; i2 < props.length; i2++) {
    var descriptor = props[i2];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor)
      descriptor.writable = true;
    Object.defineProperty(target, _toPropertyKey2(descriptor.key), descriptor);
  }
}
function _createClass(Constructor, protoProps, staticProps) {
  if (protoProps)
    _defineProperties(Constructor.prototype, protoProps);
  if (staticProps)
    _defineProperties(Constructor, staticProps);
  Object.defineProperty(Constructor, "prototype", { writable: false });
  return Constructor;
}
function _inherits(subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function");
  }
  subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
  Object.defineProperty(subClass, "prototype", { writable: false });
  if (superClass)
    _setPrototypeOf3(subClass, superClass);
}
function _setPrototypeOf3(o, p) {
  _setPrototypeOf3 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf19(o2, p2) {
    o2.__proto__ = p2;
    return o2;
  };
  return _setPrototypeOf3(o, p);
}
function _createSuper(Derived) {
  var hasNativeReflectConstruct = _isNativeReflectConstruct2();
  return function _createSuperInternal() {
    var Super = _getPrototypeOf2(Derived), result;
    if (hasNativeReflectConstruct) {
      var NewTarget = _getPrototypeOf2(this).constructor;
      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }
    return _possibleConstructorReturn(this, result);
  };
}
function _possibleConstructorReturn(self2, call) {
  if (call && (_typeof5(call) === "object" || typeof call === "function")) {
    return call;
  } else if (call !== void 0) {
    throw new TypeError("Derived constructors may only return object or undefined");
  }
  return _assertThisInitialized3(self2);
}
function _assertThisInitialized3(self2) {
  if (self2 === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }
  return self2;
}
function _isNativeReflectConstruct2() {
  if (typeof Reflect === "undefined" || !Reflect.construct)
    return false;
  if (Reflect.construct.sham)
    return false;
  if (typeof Proxy === "function")
    return true;
  try {
    Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
    return true;
  } catch (e3) {
    return false;
  }
}
function _getPrototypeOf2(o) {
  _getPrototypeOf2 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf18(o2) {
    return o2.__proto__ || Object.getPrototypeOf(o2);
  };
  return _getPrototypeOf2(o);
}
function _defineProperty2(obj, key, value) {
  key = _toPropertyKey2(key);
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
function _toPropertyKey2(arg) {
  var key = _toPrimitive2(arg, "string");
  return _typeof5(key) === "symbol" ? key : String(key);
}
function _toPrimitive2(input, hint) {
  if (_typeof5(input) !== "object" || input === null)
    return input;
  var prim = input[Symbol.toPrimitive];
  if (prim !== void 0) {
    var res = prim.call(input, hint || "default");
    if (_typeof5(res) !== "object")
      return res;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (hint === "string" ? String : Number)(input);
}
var SIZE = 32;
var DefaultLegendContent = /* @__PURE__ */ function(_PureComponent) {
  _inherits(DefaultLegendContent2, _PureComponent);
  var _super = _createSuper(DefaultLegendContent2);
  function DefaultLegendContent2() {
    _classCallCheck(this, DefaultLegendContent2);
    return _super.apply(this, arguments);
  }
  _createClass(DefaultLegendContent2, [{
    key: "renderIcon",
    value: (
      /**
       * Render the path of icon
       * @param {Object} data Data of each legend item
       * @return {String} Path element
       */
      function renderIcon(data) {
        var inactiveColor = this.props.inactiveColor;
        var halfSize = SIZE / 2;
        var sixthSize = SIZE / 6;
        var thirdSize = SIZE / 3;
        var color2 = data.inactive ? inactiveColor : data.color;
        if (data.type === "plainline") {
          return /* @__PURE__ */ import_react81.default.createElement("line", {
            strokeWidth: 4,
            fill: "none",
            stroke: color2,
            strokeDasharray: data.payload.strokeDasharray,
            x1: 0,
            y1: halfSize,
            x2: SIZE,
            y2: halfSize,
            className: "recharts-legend-icon"
          });
        }
        if (data.type === "line") {
          return /* @__PURE__ */ import_react81.default.createElement("path", {
            strokeWidth: 4,
            fill: "none",
            stroke: color2,
            d: "M0,".concat(halfSize, "h").concat(thirdSize, "\n            A").concat(sixthSize, ",").concat(sixthSize, ",0,1,1,").concat(2 * thirdSize, ",").concat(halfSize, "\n            H").concat(SIZE, "M").concat(2 * thirdSize, ",").concat(halfSize, "\n            A").concat(sixthSize, ",").concat(sixthSize, ",0,1,1,").concat(thirdSize, ",").concat(halfSize),
            className: "recharts-legend-icon"
          });
        }
        if (data.type === "rect") {
          return /* @__PURE__ */ import_react81.default.createElement("path", {
            stroke: "none",
            fill: color2,
            d: "M0,".concat(SIZE / 8, "h").concat(SIZE, "v").concat(SIZE * 3 / 4, "h").concat(-SIZE, "z"),
            className: "recharts-legend-icon"
          });
        }
        if (/* @__PURE__ */ import_react81.default.isValidElement(data.legendIcon)) {
          var iconProps = _objectSpread2({}, data);
          delete iconProps.legendIcon;
          return /* @__PURE__ */ import_react81.default.cloneElement(data.legendIcon, iconProps);
        }
        return /* @__PURE__ */ import_react81.default.createElement(Symbols, {
          fill: color2,
          cx: halfSize,
          cy: halfSize,
          size: SIZE,
          sizeType: "diameter",
          type: data.type
        });
      }
    )
    /**
     * Draw items of legend
     * @return {ReactElement} Items
     */
  }, {
    key: "renderItems",
    value: function renderItems() {
      var _this = this;
      var _this$props = this.props, payload = _this$props.payload, iconSize = _this$props.iconSize, layout = _this$props.layout, formatter3 = _this$props.formatter, inactiveColor = _this$props.inactiveColor;
      var viewBox = {
        x: 0,
        y: 0,
        width: SIZE,
        height: SIZE
      };
      var itemStyle = {
        display: layout === "horizontal" ? "inline-block" : "block",
        marginRight: 10
      };
      var svgStyle = {
        display: "inline-block",
        verticalAlign: "middle",
        marginRight: 4
      };
      return payload.map(function(entry, i2) {
        var _classNames;
        var finalFormatter = entry.formatter || formatter3;
        var className = (0, import_classnames4.default)((_classNames = {
          "recharts-legend-item": true
        }, _defineProperty2(_classNames, "legend-item-".concat(i2), true), _defineProperty2(_classNames, "inactive", entry.inactive), _classNames));
        if (entry.type === "none") {
          return null;
        }
        var entryValue = !(0, import_isFunction2.default)(entry.value) ? entry.value : null;
        warn(
          !(0, import_isFunction2.default)(entry.value),
          `The name property is also required when using a function for the dataKey of a chart's cartesian components. Ex: <Bar name="Name of my Data"/>`
          // eslint-disable-line max-len
        );
        var color2 = entry.inactive ? inactiveColor : entry.color;
        return /* @__PURE__ */ import_react81.default.createElement("li", _extends11({
          className,
          style: itemStyle,
          key: "legend-item-".concat(i2)
          // eslint-disable-line react/no-array-index-key
        }, adaptEventsOfChild(_this.props, entry, i2)), /* @__PURE__ */ import_react81.default.createElement(Surface, {
          width: iconSize,
          height: iconSize,
          viewBox,
          style: svgStyle
        }, _this.renderIcon(entry)), /* @__PURE__ */ import_react81.default.createElement("span", {
          className: "recharts-legend-item-text",
          style: {
            color: color2
          }
        }, finalFormatter ? finalFormatter(entryValue, entry, i2) : entryValue));
      });
    }
  }, {
    key: "render",
    value: function render2() {
      var _this$props2 = this.props, payload = _this$props2.payload, layout = _this$props2.layout, align = _this$props2.align;
      if (!payload || !payload.length) {
        return null;
      }
      var finalStyle = {
        padding: 0,
        margin: 0,
        textAlign: layout === "horizontal" ? align : "left"
      };
      return /* @__PURE__ */ import_react81.default.createElement("ul", {
        className: "recharts-default-legend",
        style: finalStyle
      }, this.renderItems());
    }
  }]);
  return DefaultLegendContent2;
}(import_react81.PureComponent);
_defineProperty2(DefaultLegendContent, "displayName", "Legend");
_defineProperty2(DefaultLegendContent, "defaultProps", {
  iconSize: 14,
  layout: "horizontal",
  align: "center",
  verticalAlign: "middle",
  inactiveColor: "#ccc"
});

// node_modules/recharts/es6/component/Legend.js
function _typeof6(o) {
  "@babel/helpers - typeof";
  return _typeof6 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
    return typeof o2;
  } : function(o2) {
    return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
  }, _typeof6(o);
}
var _excluded9 = ["ref"];
function ownKeys3(e3, r3) {
  var t3 = Object.keys(e3);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e3);
    r3 && (o = o.filter(function(r4) {
      return Object.getOwnPropertyDescriptor(e3, r4).enumerable;
    })), t3.push.apply(t3, o);
  }
  return t3;
}
function _objectSpread3(e3) {
  for (var r3 = 1; r3 < arguments.length; r3++) {
    var t3 = null != arguments[r3] ? arguments[r3] : {};
    r3 % 2 ? ownKeys3(Object(t3), true).forEach(function(r4) {
      _defineProperty3(e3, r4, t3[r4]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e3, Object.getOwnPropertyDescriptors(t3)) : ownKeys3(Object(t3)).forEach(function(r4) {
      Object.defineProperty(e3, r4, Object.getOwnPropertyDescriptor(t3, r4));
    });
  }
  return e3;
}
function _classCallCheck2(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties2(target, props) {
  for (var i2 = 0; i2 < props.length; i2++) {
    var descriptor = props[i2];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor)
      descriptor.writable = true;
    Object.defineProperty(target, _toPropertyKey3(descriptor.key), descriptor);
  }
}
function _createClass2(Constructor, protoProps, staticProps) {
  if (protoProps)
    _defineProperties2(Constructor.prototype, protoProps);
  if (staticProps)
    _defineProperties2(Constructor, staticProps);
  Object.defineProperty(Constructor, "prototype", { writable: false });
  return Constructor;
}
function _inherits2(subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function");
  }
  subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
  Object.defineProperty(subClass, "prototype", { writable: false });
  if (superClass)
    _setPrototypeOf4(subClass, superClass);
}
function _setPrototypeOf4(o, p) {
  _setPrototypeOf4 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf19(o2, p2) {
    o2.__proto__ = p2;
    return o2;
  };
  return _setPrototypeOf4(o, p);
}
function _createSuper2(Derived) {
  var hasNativeReflectConstruct = _isNativeReflectConstruct3();
  return function _createSuperInternal() {
    var Super = _getPrototypeOf3(Derived), result;
    if (hasNativeReflectConstruct) {
      var NewTarget = _getPrototypeOf3(this).constructor;
      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }
    return _possibleConstructorReturn2(this, result);
  };
}
function _possibleConstructorReturn2(self2, call) {
  if (call && (_typeof6(call) === "object" || typeof call === "function")) {
    return call;
  } else if (call !== void 0) {
    throw new TypeError("Derived constructors may only return object or undefined");
  }
  return _assertThisInitialized4(self2);
}
function _assertThisInitialized4(self2) {
  if (self2 === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }
  return self2;
}
function _isNativeReflectConstruct3() {
  if (typeof Reflect === "undefined" || !Reflect.construct)
    return false;
  if (Reflect.construct.sham)
    return false;
  if (typeof Proxy === "function")
    return true;
  try {
    Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
    return true;
  } catch (e3) {
    return false;
  }
}
function _getPrototypeOf3(o) {
  _getPrototypeOf3 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf18(o2) {
    return o2.__proto__ || Object.getPrototypeOf(o2);
  };
  return _getPrototypeOf3(o);
}
function _defineProperty3(obj, key, value) {
  key = _toPropertyKey3(key);
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
function _toPropertyKey3(arg) {
  var key = _toPrimitive3(arg, "string");
  return _typeof6(key) === "symbol" ? key : String(key);
}
function _toPrimitive3(input, hint) {
  if (_typeof6(input) !== "object" || input === null)
    return input;
  var prim = input[Symbol.toPrimitive];
  if (prim !== void 0) {
    var res = prim.call(input, hint || "default");
    if (_typeof6(res) !== "object")
      return res;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (hint === "string" ? String : Number)(input);
}
function _objectWithoutProperties5(source, excluded) {
  if (source == null)
    return {};
  var target = _objectWithoutPropertiesLoose9(source, excluded);
  var key, i2;
  if (Object.getOwnPropertySymbols) {
    var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
    for (i2 = 0; i2 < sourceSymbolKeys.length; i2++) {
      key = sourceSymbolKeys[i2];
      if (excluded.indexOf(key) >= 0)
        continue;
      if (!Object.prototype.propertyIsEnumerable.call(source, key))
        continue;
      target[key] = source[key];
    }
  }
  return target;
}
function _objectWithoutPropertiesLoose9(source, excluded) {
  if (source == null)
    return {};
  var target = {};
  var sourceKeys = Object.keys(source);
  var key, i2;
  for (i2 = 0; i2 < sourceKeys.length; i2++) {
    key = sourceKeys[i2];
    if (excluded.indexOf(key) >= 0)
      continue;
    target[key] = source[key];
  }
  return target;
}
function defaultUniqBy(entry) {
  return entry.value;
}
function getUniqPayload(option, payload) {
  if (option === true) {
    return (0, import_uniqBy.default)(payload, defaultUniqBy);
  }
  if ((0, import_isFunction3.default)(option)) {
    return (0, import_uniqBy.default)(payload, option);
  }
  return payload;
}
function renderContent(content2, props) {
  if (/* @__PURE__ */ import_react82.default.isValidElement(content2)) {
    return /* @__PURE__ */ import_react82.default.cloneElement(content2, props);
  }
  if ((0, import_isFunction3.default)(content2)) {
    return /* @__PURE__ */ import_react82.default.createElement(content2, props);
  }
  var ref = props.ref, otherProps = _objectWithoutProperties5(props, _excluded9);
  return /* @__PURE__ */ import_react82.default.createElement(DefaultLegendContent, otherProps);
}
var EPS = 1;
var Legend = /* @__PURE__ */ function(_PureComponent) {
  _inherits2(Legend2, _PureComponent);
  var _super = _createSuper2(Legend2);
  function Legend2() {
    var _this;
    _classCallCheck2(this, Legend2);
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    _this = _super.call.apply(_super, [this].concat(args));
    _defineProperty3(_assertThisInitialized4(_this), "state", {
      boxWidth: -1,
      boxHeight: -1
    });
    return _this;
  }
  _createClass2(Legend2, [{
    key: "componentDidMount",
    value: function componentDidMount() {
      this.updateBBox();
    }
  }, {
    key: "componentDidUpdate",
    value: function componentDidUpdate() {
      this.updateBBox();
    }
  }, {
    key: "getBBox",
    value: function getBBox() {
      if (this.wrapperNode && this.wrapperNode.getBoundingClientRect) {
        return this.wrapperNode.getBoundingClientRect();
      }
      return null;
    }
  }, {
    key: "getBBoxSnapshot",
    value: function getBBoxSnapshot() {
      var _this$state = this.state, boxWidth = _this$state.boxWidth, boxHeight = _this$state.boxHeight;
      if (boxWidth >= 0 && boxHeight >= 0) {
        return {
          width: boxWidth,
          height: boxHeight
        };
      }
      return null;
    }
  }, {
    key: "getDefaultPosition",
    value: function getDefaultPosition(style) {
      var _this$props = this.props, layout = _this$props.layout, align = _this$props.align, verticalAlign = _this$props.verticalAlign, margin = _this$props.margin, chartWidth = _this$props.chartWidth, chartHeight = _this$props.chartHeight;
      var hPos, vPos;
      if (!style || (style.left === void 0 || style.left === null) && (style.right === void 0 || style.right === null)) {
        if (align === "center" && layout === "vertical") {
          var _box4 = this.getBBoxSnapshot() || {
            width: 0
          };
          hPos = {
            left: ((chartWidth || 0) - _box4.width) / 2
          };
        } else {
          hPos = align === "right" ? {
            right: margin && margin.right || 0
          } : {
            left: margin && margin.left || 0
          };
        }
      }
      if (!style || (style.top === void 0 || style.top === null) && (style.bottom === void 0 || style.bottom === null)) {
        if (verticalAlign === "middle") {
          var _box22 = this.getBBoxSnapshot() || {
            height: 0
          };
          vPos = {
            top: ((chartHeight || 0) - _box22.height) / 2
          };
        } else {
          vPos = verticalAlign === "bottom" ? {
            bottom: margin && margin.bottom || 0
          } : {
            top: margin && margin.top || 0
          };
        }
      }
      return _objectSpread3(_objectSpread3({}, hPos), vPos);
    }
  }, {
    key: "updateBBox",
    value: function updateBBox() {
      var _this$state2 = this.state, boxWidth = _this$state2.boxWidth, boxHeight = _this$state2.boxHeight;
      var onBBoxUpdate = this.props.onBBoxUpdate;
      if (this.wrapperNode && this.wrapperNode.getBoundingClientRect) {
        var _box32 = this.wrapperNode.getBoundingClientRect();
        if (Math.abs(_box32.width - boxWidth) > EPS || Math.abs(_box32.height - boxHeight) > EPS) {
          this.setState({
            boxWidth: _box32.width,
            boxHeight: _box32.height
          }, function() {
            if (onBBoxUpdate) {
              onBBoxUpdate(_box32);
            }
          });
        }
      } else if (boxWidth !== -1 || boxHeight !== -1) {
        this.setState({
          boxWidth: -1,
          boxHeight: -1
        }, function() {
          if (onBBoxUpdate) {
            onBBoxUpdate(null);
          }
        });
      }
    }
  }, {
    key: "render",
    value: function render2() {
      var _this2 = this;
      var _this$props2 = this.props, content2 = _this$props2.content, width = _this$props2.width, height = _this$props2.height, wrapperStyle = _this$props2.wrapperStyle, payloadUniqBy = _this$props2.payloadUniqBy, payload = _this$props2.payload;
      var outerStyle = _objectSpread3(_objectSpread3({
        position: "absolute",
        width: width || "auto",
        height: height || "auto"
      }, this.getDefaultPosition(wrapperStyle)), wrapperStyle);
      return /* @__PURE__ */ import_react82.default.createElement("div", {
        className: "recharts-legend-wrapper",
        style: outerStyle,
        ref: function ref(node56) {
          _this2.wrapperNode = node56;
        }
      }, renderContent(content2, _objectSpread3(_objectSpread3({}, this.props), {}, {
        payload: getUniqPayload(payloadUniqBy, payload)
      })));
    }
  }], [{
    key: "getWithHeight",
    value: function getWithHeight(item, chartWidth) {
      var layout = item.props.layout;
      if (layout === "vertical" && isNumber(item.props.height)) {
        return {
          height: item.props.height
        };
      }
      if (layout === "horizontal") {
        return {
          width: item.props.width || chartWidth
        };
      }
      return null;
    }
  }]);
  return Legend2;
}(import_react82.PureComponent);
_defineProperty3(Legend, "displayName", "Legend");
_defineProperty3(Legend, "defaultProps", {
  iconSize: 14,
  layout: "horizontal",
  align: "center",
  verticalAlign: "bottom"
});

// node_modules/recharts/es6/component/Tooltip.js
var import_isNil3 = __toESM(require_isNil());
var import_isFunction4 = __toESM(require_isFunction());
var import_uniqBy2 = __toESM(require_uniqBy());
var import_react87 = __toESM(require_react());

// node_modules/react-smooth/es6/Animate.js
var import_react83 = __toESM(require_react());
var import_prop_types5 = __toESM(require_prop_types());

// node_modules/fast-equals/dist/esm/index.mjs
var getOwnPropertyNames = Object.getOwnPropertyNames;
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
var hasOwnProperty2 = Object.prototype.hasOwnProperty;
function combineComparators(comparatorA, comparatorB) {
  return function isEqual(a2, b, state) {
    return comparatorA(a2, b, state) && comparatorB(a2, b, state);
  };
}
function createIsCircular(areItemsEqual) {
  return function isCircular(a2, b, state) {
    if (!a2 || !b || typeof a2 !== "object" || typeof b !== "object") {
      return areItemsEqual(a2, b, state);
    }
    var cache2 = state.cache;
    var cachedA = cache2.get(a2);
    var cachedB = cache2.get(b);
    if (cachedA && cachedB) {
      return cachedA === b && cachedB === a2;
    }
    cache2.set(a2, b);
    cache2.set(b, a2);
    var result = areItemsEqual(a2, b, state);
    cache2.delete(a2);
    cache2.delete(b);
    return result;
  };
}
function getStrictProperties(object) {
  return getOwnPropertyNames(object).concat(getOwnPropertySymbols(object));
}
var hasOwn = Object.hasOwn || function(object, property) {
  return hasOwnProperty2.call(object, property);
};
function sameValueZeroEqual(a2, b) {
  return a2 || b ? a2 === b : a2 === b || a2 !== a2 && b !== b;
}
var OWNER = "_owner";
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
var keys3 = Object.keys;
function areArraysEqual(a2, b, state) {
  var index = a2.length;
  if (b.length !== index) {
    return false;
  }
  while (index-- > 0) {
    if (!state.equals(a2[index], b[index], index, index, a2, b, state)) {
      return false;
    }
  }
  return true;
}
function areDatesEqual(a2, b) {
  return sameValueZeroEqual(a2.getTime(), b.getTime());
}
function areMapsEqual(a2, b, state) {
  if (a2.size !== b.size) {
    return false;
  }
  var matchedIndices = {};
  var aIterable = a2.entries();
  var index = 0;
  var aResult;
  var bResult;
  while (aResult = aIterable.next()) {
    if (aResult.done) {
      break;
    }
    var bIterable = b.entries();
    var hasMatch = false;
    var matchIndex = 0;
    while (bResult = bIterable.next()) {
      if (bResult.done) {
        break;
      }
      var _a2 = aResult.value, aKey = _a2[0], aValue = _a2[1];
      var _b = bResult.value, bKey = _b[0], bValue = _b[1];
      if (!hasMatch && !matchedIndices[matchIndex] && (hasMatch = state.equals(aKey, bKey, index, matchIndex, a2, b, state) && state.equals(aValue, bValue, aKey, bKey, a2, b, state))) {
        matchedIndices[matchIndex] = true;
      }
      matchIndex++;
    }
    if (!hasMatch) {
      return false;
    }
    index++;
  }
  return true;
}
function areObjectsEqual(a2, b, state) {
  var properties = keys3(a2);
  var index = properties.length;
  if (keys3(b).length !== index) {
    return false;
  }
  var property;
  while (index-- > 0) {
    property = properties[index];
    if (property === OWNER && (a2.$$typeof || b.$$typeof) && a2.$$typeof !== b.$$typeof) {
      return false;
    }
    if (!hasOwn(b, property) || !state.equals(a2[property], b[property], property, property, a2, b, state)) {
      return false;
    }
  }
  return true;
}
function areObjectsEqualStrict(a2, b, state) {
  var properties = getStrictProperties(a2);
  var index = properties.length;
  if (getStrictProperties(b).length !== index) {
    return false;
  }
  var property;
  var descriptorA;
  var descriptorB;
  while (index-- > 0) {
    property = properties[index];
    if (property === OWNER && (a2.$$typeof || b.$$typeof) && a2.$$typeof !== b.$$typeof) {
      return false;
    }
    if (!hasOwn(b, property)) {
      return false;
    }
    if (!state.equals(a2[property], b[property], property, property, a2, b, state)) {
      return false;
    }
    descriptorA = getOwnPropertyDescriptor(a2, property);
    descriptorB = getOwnPropertyDescriptor(b, property);
    if ((descriptorA || descriptorB) && (!descriptorA || !descriptorB || descriptorA.configurable !== descriptorB.configurable || descriptorA.enumerable !== descriptorB.enumerable || descriptorA.writable !== descriptorB.writable)) {
      return false;
    }
  }
  return true;
}
function arePrimitiveWrappersEqual(a2, b) {
  return sameValueZeroEqual(a2.valueOf(), b.valueOf());
}
function areRegExpsEqual(a2, b) {
  return a2.source === b.source && a2.flags === b.flags;
}
function areSetsEqual(a2, b, state) {
  if (a2.size !== b.size) {
    return false;
  }
  var matchedIndices = {};
  var aIterable = a2.values();
  var aResult;
  var bResult;
  while (aResult = aIterable.next()) {
    if (aResult.done) {
      break;
    }
    var bIterable = b.values();
    var hasMatch = false;
    var matchIndex = 0;
    while (bResult = bIterable.next()) {
      if (bResult.done) {
        break;
      }
      if (!hasMatch && !matchedIndices[matchIndex] && (hasMatch = state.equals(aResult.value, bResult.value, aResult.value, bResult.value, a2, b, state))) {
        matchedIndices[matchIndex] = true;
      }
      matchIndex++;
    }
    if (!hasMatch) {
      return false;
    }
  }
  return true;
}
function areTypedArraysEqual(a2, b) {
  var index = a2.length;
  if (b.length !== index) {
    return false;
  }
  while (index-- > 0) {
    if (a2[index] !== b[index]) {
      return false;
    }
  }
  return true;
}
var ARGUMENTS_TAG = "[object Arguments]";
var BOOLEAN_TAG = "[object Boolean]";
var DATE_TAG = "[object Date]";
var MAP_TAG = "[object Map]";
var NUMBER_TAG = "[object Number]";
var OBJECT_TAG = "[object Object]";
var REG_EXP_TAG = "[object RegExp]";
var SET_TAG = "[object Set]";
var STRING_TAG = "[object String]";
var isArray = Array.isArray;
var isTypedArray = typeof ArrayBuffer === "function" && ArrayBuffer.isView ? ArrayBuffer.isView : null;
var assign2 = Object.assign;
var getTag = Object.prototype.toString.call.bind(Object.prototype.toString);
function createEqualityComparator(_a2) {
  var areArraysEqual2 = _a2.areArraysEqual, areDatesEqual2 = _a2.areDatesEqual, areMapsEqual2 = _a2.areMapsEqual, areObjectsEqual2 = _a2.areObjectsEqual, arePrimitiveWrappersEqual2 = _a2.arePrimitiveWrappersEqual, areRegExpsEqual2 = _a2.areRegExpsEqual, areSetsEqual2 = _a2.areSetsEqual, areTypedArraysEqual2 = _a2.areTypedArraysEqual;
  return function comparator(a2, b, state) {
    if (a2 === b) {
      return true;
    }
    if (a2 == null || b == null || typeof a2 !== "object" || typeof b !== "object") {
      return a2 !== a2 && b !== b;
    }
    var constructor = a2.constructor;
    if (constructor !== b.constructor) {
      return false;
    }
    if (constructor === Object) {
      return areObjectsEqual2(a2, b, state);
    }
    if (isArray(a2)) {
      return areArraysEqual2(a2, b, state);
    }
    if (isTypedArray != null && isTypedArray(a2)) {
      return areTypedArraysEqual2(a2, b, state);
    }
    if (constructor === Date) {
      return areDatesEqual2(a2, b, state);
    }
    if (constructor === RegExp) {
      return areRegExpsEqual2(a2, b, state);
    }
    if (constructor === Map) {
      return areMapsEqual2(a2, b, state);
    }
    if (constructor === Set) {
      return areSetsEqual2(a2, b, state);
    }
    var tag = getTag(a2);
    if (tag === DATE_TAG) {
      return areDatesEqual2(a2, b, state);
    }
    if (tag === REG_EXP_TAG) {
      return areRegExpsEqual2(a2, b, state);
    }
    if (tag === MAP_TAG) {
      return areMapsEqual2(a2, b, state);
    }
    if (tag === SET_TAG) {
      return areSetsEqual2(a2, b, state);
    }
    if (tag === OBJECT_TAG) {
      return typeof a2.then !== "function" && typeof b.then !== "function" && areObjectsEqual2(a2, b, state);
    }
    if (tag === ARGUMENTS_TAG) {
      return areObjectsEqual2(a2, b, state);
    }
    if (tag === BOOLEAN_TAG || tag === NUMBER_TAG || tag === STRING_TAG) {
      return arePrimitiveWrappersEqual2(a2, b, state);
    }
    return false;
  };
}
function createEqualityComparatorConfig(_a2) {
  var circular = _a2.circular, createCustomConfig = _a2.createCustomConfig, strict = _a2.strict;
  var config2 = {
    areArraysEqual: strict ? areObjectsEqualStrict : areArraysEqual,
    areDatesEqual,
    areMapsEqual: strict ? combineComparators(areMapsEqual, areObjectsEqualStrict) : areMapsEqual,
    areObjectsEqual: strict ? areObjectsEqualStrict : areObjectsEqual,
    arePrimitiveWrappersEqual,
    areRegExpsEqual,
    areSetsEqual: strict ? combineComparators(areSetsEqual, areObjectsEqualStrict) : areSetsEqual,
    areTypedArraysEqual: strict ? areObjectsEqualStrict : areTypedArraysEqual
  };
  if (createCustomConfig) {
    config2 = assign2({}, config2, createCustomConfig(config2));
  }
  if (circular) {
    var areArraysEqual$1 = createIsCircular(config2.areArraysEqual);
    var areMapsEqual$1 = createIsCircular(config2.areMapsEqual);
    var areObjectsEqual$1 = createIsCircular(config2.areObjectsEqual);
    var areSetsEqual$1 = createIsCircular(config2.areSetsEqual);
    config2 = assign2({}, config2, {
      areArraysEqual: areArraysEqual$1,
      areMapsEqual: areMapsEqual$1,
      areObjectsEqual: areObjectsEqual$1,
      areSetsEqual: areSetsEqual$1
    });
  }
  return config2;
}
function createInternalEqualityComparator(compare2) {
  return function(a2, b, _indexOrKeyA, _indexOrKeyB, _parentA, _parentB, state) {
    return compare2(a2, b, state);
  };
}
function createIsEqual(_a2) {
  var circular = _a2.circular, comparator = _a2.comparator, createState = _a2.createState, equals3 = _a2.equals, strict = _a2.strict;
  if (createState) {
    return function isEqual(a2, b) {
      var _a3 = createState(), _b = _a3.cache, cache2 = _b === void 0 ? circular ? /* @__PURE__ */ new WeakMap() : void 0 : _b, meta2 = _a3.meta;
      return comparator(a2, b, {
        cache: cache2,
        equals: equals3,
        meta: meta2,
        strict
      });
    };
  }
  if (circular) {
    return function isEqual(a2, b) {
      return comparator(a2, b, {
        cache: /* @__PURE__ */ new WeakMap(),
        equals: equals3,
        meta: void 0,
        strict
      });
    };
  }
  var state = {
    cache: void 0,
    equals: equals3,
    meta: void 0,
    strict
  };
  return function isEqual(a2, b) {
    return comparator(a2, b, state);
  };
}
var deepEqual2 = createCustomEqual();
var strictDeepEqual = createCustomEqual({ strict: true });
var circularDeepEqual = createCustomEqual({ circular: true });
var strictCircularDeepEqual = createCustomEqual({
  circular: true,
  strict: true
});
var shallowEqual2 = createCustomEqual({
  createInternalComparator: function() {
    return sameValueZeroEqual;
  }
});
var strictShallowEqual = createCustomEqual({
  strict: true,
  createInternalComparator: function() {
    return sameValueZeroEqual;
  }
});
var circularShallowEqual = createCustomEqual({
  circular: true,
  createInternalComparator: function() {
    return sameValueZeroEqual;
  }
});
var strictCircularShallowEqual = createCustomEqual({
  circular: true,
  createInternalComparator: function() {
    return sameValueZeroEqual;
  },
  strict: true
});
function createCustomEqual(options) {
  if (options === void 0) {
    options = {};
  }
  var _a2 = options.circular, circular = _a2 === void 0 ? false : _a2, createCustomInternalComparator = options.createInternalComparator, createState = options.createState, _b = options.strict, strict = _b === void 0 ? false : _b;
  var config2 = createEqualityComparatorConfig(options);
  var comparator = createEqualityComparator(config2);
  var equals3 = createCustomInternalComparator ? createCustomInternalComparator(comparator) : createInternalEqualityComparator(comparator);
  return createIsEqual({ circular, comparator, createState, equals: equals3, strict });
}

// node_modules/react-smooth/es6/setRafTimeout.js
function safeRequestAnimationFrame(callback) {
  if (typeof requestAnimationFrame !== "undefined")
    requestAnimationFrame(callback);
}
function setRafTimeout(callback) {
  var timeout2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
  var currTime = -1;
  var shouldUpdate = function shouldUpdate2(now2) {
    if (currTime < 0) {
      currTime = now2;
    }
    if (now2 - currTime > timeout2) {
      callback(now2);
      currTime = -1;
    } else {
      safeRequestAnimationFrame(shouldUpdate2);
    }
  };
  requestAnimationFrame(shouldUpdate);
}

// node_modules/react-smooth/es6/AnimateManager.js
function _typeof7(obj) {
  "@babel/helpers - typeof";
  return _typeof7 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
    return typeof obj2;
  } : function(obj2) {
    return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
  }, _typeof7(obj);
}
function _toArray(arr) {
  return _arrayWithHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray2(arr) || _nonIterableRest();
}
function _nonIterableRest() {
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _unsupportedIterableToArray2(o, minLen) {
  if (!o)
    return;
  if (typeof o === "string")
    return _arrayLikeToArray2(o, minLen);
  var n2 = Object.prototype.toString.call(o).slice(8, -1);
  if (n2 === "Object" && o.constructor)
    n2 = o.constructor.name;
  if (n2 === "Map" || n2 === "Set")
    return Array.from(o);
  if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2))
    return _arrayLikeToArray2(o, minLen);
}
function _arrayLikeToArray2(arr, len) {
  if (len == null || len > arr.length)
    len = arr.length;
  for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++)
    arr2[i2] = arr[i2];
  return arr2;
}
function _iterableToArray(iter) {
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
    return Array.from(iter);
}
function _arrayWithHoles(arr) {
  if (Array.isArray(arr))
    return arr;
}
function createAnimateManager() {
  var currStyle = {};
  var handleChange = function handleChange2() {
    return null;
  };
  var shouldStop = false;
  var setStyle = function setStyle2(_style) {
    if (shouldStop) {
      return;
    }
    if (Array.isArray(_style)) {
      if (!_style.length) {
        return;
      }
      var styles = _style;
      var _styles = _toArray(styles), curr = _styles[0], restStyles = _styles.slice(1);
      if (typeof curr === "number") {
        setRafTimeout(setStyle2.bind(null, restStyles), curr);
        return;
      }
      setStyle2(curr);
      setRafTimeout(setStyle2.bind(null, restStyles));
      return;
    }
    if (_typeof7(_style) === "object") {
      currStyle = _style;
      handleChange(currStyle);
    }
    if (typeof _style === "function") {
      _style();
    }
  };
  return {
    stop: function stop() {
      shouldStop = true;
    },
    start: function start(style) {
      shouldStop = false;
      setStyle(style);
    },
    subscribe: function subscribe(_handleChange) {
      handleChange = _handleChange;
      return function() {
        handleChange = function handleChange2() {
          return null;
        };
      };
    }
  };
}

// node_modules/react-smooth/es6/util.js
function _typeof8(obj) {
  "@babel/helpers - typeof";
  return _typeof8 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
    return typeof obj2;
  } : function(obj2) {
    return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
  }, _typeof8(obj);
}
function ownKeys4(object, enumerableOnly) {
  var keys4 = Object.keys(object);
  if (Object.getOwnPropertySymbols) {
    var symbols = Object.getOwnPropertySymbols(object);
    enumerableOnly && (symbols = symbols.filter(function(sym) {
      return Object.getOwnPropertyDescriptor(object, sym).enumerable;
    })), keys4.push.apply(keys4, symbols);
  }
  return keys4;
}
function _objectSpread4(target) {
  for (var i2 = 1; i2 < arguments.length; i2++) {
    var source = null != arguments[i2] ? arguments[i2] : {};
    i2 % 2 ? ownKeys4(Object(source), true).forEach(function(key) {
      _defineProperty4(target, key, source[key]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys4(Object(source)).forEach(function(key) {
      Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
    });
  }
  return target;
}
function _defineProperty4(obj, key, value) {
  key = _toPropertyKey4(key);
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
function _toPropertyKey4(arg) {
  var key = _toPrimitive4(arg, "string");
  return _typeof8(key) === "symbol" ? key : String(key);
}
function _toPrimitive4(input, hint) {
  if (_typeof8(input) !== "object" || input === null)
    return input;
  var prim = input[Symbol.toPrimitive];
  if (prim !== void 0) {
    var res = prim.call(input, hint || "default");
    if (_typeof8(res) !== "object")
      return res;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (hint === "string" ? String : Number)(input);
}
var PREFIX_LIST = ["Webkit", "Moz", "O", "ms"];
var IN_LINE_PREFIX_LIST = ["-webkit-", "-moz-", "-o-", "-ms-"];
var IN_COMPATIBLE_PROPERTY = ["transform", "transformOrigin", "transition"];
var getIntersectionKeys = function getIntersectionKeys2(preObj, nextObj) {
  return [Object.keys(preObj), Object.keys(nextObj)].reduce(function(a2, b) {
    return a2.filter(function(c4) {
      return b.includes(c4);
    });
  });
};
var identity = function identity2(param) {
  return param;
};
var getDashCase = function getDashCase2(name2) {
  return name2.replace(/([A-Z])/g, function(v4) {
    return "-".concat(v4.toLowerCase());
  });
};
var generatePrefixStyle = function generatePrefixStyle2(name2, value) {
  if (IN_COMPATIBLE_PROPERTY.indexOf(name2) === -1) {
    return _defineProperty4({}, name2, Number.isNaN(value) ? 0 : value);
  }
  var isTransition = name2 === "transition";
  var camelName = name2.replace(/(\w)/, function(v4) {
    return v4.toUpperCase();
  });
  var styleVal = value;
  return PREFIX_LIST.reduce(function(result, property, i2) {
    if (isTransition) {
      styleVal = value.replace(/(transform|transform-origin)/gim, "".concat(IN_LINE_PREFIX_LIST[i2], "$1"));
    }
    return _objectSpread4(_objectSpread4({}, result), {}, _defineProperty4({}, property + camelName, styleVal));
  }, {});
};
var mapObject = function mapObject2(fn, obj) {
  return Object.keys(obj).reduce(function(res, key) {
    return _objectSpread4(_objectSpread4({}, res), {}, _defineProperty4({}, key, fn(key, obj[key])));
  }, {});
};
var translateStyle = function translateStyle2(style) {
  return Object.keys(style).reduce(function(res, key) {
    return _objectSpread4(_objectSpread4({}, res), generatePrefixStyle(key, res[key]));
  }, style);
};
var getTransitionVal = function getTransitionVal2(props, duration, easing) {
  return props.map(function(prop) {
    return "".concat(getDashCase(prop), " ").concat(duration, "ms ").concat(easing);
  }).join(",");
};
var isDev2 = true;
var warn3 = function warn4(condition, format3, a2, b, c4, d, e3, f) {
  if (isDev2 && typeof console !== "undefined" && console.warn) {
    if (format3 === void 0) {
      console.warn("LogUtils requires an error message argument");
    }
    if (!condition) {
      if (format3 === void 0) {
        console.warn("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");
      } else {
        var args = [a2, b, c4, d, e3, f];
        var argIndex = 0;
        console.warn(format3.replace(/%s/g, function() {
          return args[argIndex++];
        }));
      }
    }
  }
};

// node_modules/react-smooth/es6/easing.js
function _slicedToArray(arr, i2) {
  return _arrayWithHoles2(arr) || _iterableToArrayLimit(arr, i2) || _unsupportedIterableToArray3(arr, i2) || _nonIterableRest2();
}
function _nonIterableRest2() {
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _iterableToArrayLimit(arr, i2) {
  var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
  if (null != _i) {
    var _s, _e, _x2, _r, _arr = [], _n = true, _d = false;
    try {
      if (_x2 = (_i = _i.call(arr)).next, 0 === i2) {
        if (Object(_i) !== _i)
          return;
        _n = false;
      } else
        for (; !(_n = (_s = _x2.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i2); _n = true)
          ;
    } catch (err) {
      _d = true, _e = err;
    } finally {
      try {
        if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r))
          return;
      } finally {
        if (_d)
          throw _e;
      }
    }
    return _arr;
  }
}
function _arrayWithHoles2(arr) {
  if (Array.isArray(arr))
    return arr;
}
function _toConsumableArray(arr) {
  return _arrayWithoutHoles(arr) || _iterableToArray2(arr) || _unsupportedIterableToArray3(arr) || _nonIterableSpread();
}
function _nonIterableSpread() {
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _unsupportedIterableToArray3(o, minLen) {
  if (!o)
    return;
  if (typeof o === "string")
    return _arrayLikeToArray3(o, minLen);
  var n2 = Object.prototype.toString.call(o).slice(8, -1);
  if (n2 === "Object" && o.constructor)
    n2 = o.constructor.name;
  if (n2 === "Map" || n2 === "Set")
    return Array.from(o);
  if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2))
    return _arrayLikeToArray3(o, minLen);
}
function _iterableToArray2(iter) {
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
    return Array.from(iter);
}
function _arrayWithoutHoles(arr) {
  if (Array.isArray(arr))
    return _arrayLikeToArray3(arr);
}
function _arrayLikeToArray3(arr, len) {
  if (len == null || len > arr.length)
    len = arr.length;
  for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++)
    arr2[i2] = arr[i2];
  return arr2;
}
var ACCURACY = 1e-4;
var cubicBezierFactor = function cubicBezierFactor2(c1, c22) {
  return [0, 3 * c1, 3 * c22 - 6 * c1, 3 * c1 - 3 * c22 + 1];
};
var multyTime = function multyTime2(params, t3) {
  return params.map(function(param, i2) {
    return param * Math.pow(t3, i2);
  }).reduce(function(pre, curr) {
    return pre + curr;
  });
};
var cubicBezier = function cubicBezier2(c1, c22) {
  return function(t3) {
    var params = cubicBezierFactor(c1, c22);
    return multyTime(params, t3);
  };
};
var derivativeCubicBezier = function derivativeCubicBezier2(c1, c22) {
  return function(t3) {
    var params = cubicBezierFactor(c1, c22);
    var newParams = [].concat(_toConsumableArray(params.map(function(param, i2) {
      return param * i2;
    }).slice(1)), [0]);
    return multyTime(newParams, t3);
  };
};
var configBezier = function configBezier2() {
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
    args[_key] = arguments[_key];
  }
  var x1 = args[0], y1 = args[1], x2 = args[2], y2 = args[3];
  if (args.length === 1) {
    switch (args[0]) {
      case "linear":
        x1 = 0;
        y1 = 0;
        x2 = 1;
        y2 = 1;
        break;
      case "ease":
        x1 = 0.25;
        y1 = 0.1;
        x2 = 0.25;
        y2 = 1;
        break;
      case "ease-in":
        x1 = 0.42;
        y1 = 0;
        x2 = 1;
        y2 = 1;
        break;
      case "ease-out":
        x1 = 0.42;
        y1 = 0;
        x2 = 0.58;
        y2 = 1;
        break;
      case "ease-in-out":
        x1 = 0;
        y1 = 0;
        x2 = 0.58;
        y2 = 1;
        break;
      default: {
        var easing = args[0].split("(");
        if (easing[0] === "cubic-bezier" && easing[1].split(")")[0].split(",").length === 4) {
          var _easing$1$split$0$spl = easing[1].split(")")[0].split(",").map(function(x3) {
            return parseFloat(x3);
          });
          var _easing$1$split$0$spl2 = _slicedToArray(_easing$1$split$0$spl, 4);
          x1 = _easing$1$split$0$spl2[0];
          y1 = _easing$1$split$0$spl2[1];
          x2 = _easing$1$split$0$spl2[2];
          y2 = _easing$1$split$0$spl2[3];
        } else {
          warn3(false, "[configBezier]: arguments should be one of oneOf 'linear', 'ease', 'ease-in', 'ease-out', 'ease-in-out','cubic-bezier(x1,y1,x2,y2)', instead received %s", args);
        }
      }
    }
  }
  warn3([x1, x2, y1, y2].every(function(num) {
    return typeof num === "number" && num >= 0 && num <= 1;
  }), "[configBezier]: arguments should be x1, y1, x2, y2 of [0, 1] instead received %s", args);
  var curveX = cubicBezier(x1, x2);
  var curveY = cubicBezier(y1, y2);
  var derCurveX = derivativeCubicBezier(x1, x2);
  var rangeValue = function rangeValue2(value) {
    if (value > 1) {
      return 1;
    }
    if (value < 0) {
      return 0;
    }
    return value;
  };
  var bezier = function bezier2(_t) {
    var t3 = _t > 1 ? 1 : _t;
    var x3 = t3;
    for (var i2 = 0; i2 < 8; ++i2) {
      var evalT = curveX(x3) - t3;
      var derVal = derCurveX(x3);
      if (Math.abs(evalT - t3) < ACCURACY || derVal < ACCURACY) {
        return curveY(x3);
      }
      x3 = rangeValue(x3 - evalT / derVal);
    }
    return curveY(x3);
  };
  bezier.isStepper = false;
  return bezier;
};
var configSpring = function configSpring2() {
  var config2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
  var _config$stiff = config2.stiff, stiff = _config$stiff === void 0 ? 100 : _config$stiff, _config$damping = config2.damping, damping = _config$damping === void 0 ? 8 : _config$damping, _config$dt = config2.dt, dt = _config$dt === void 0 ? 17 : _config$dt;
  var stepper = function stepper2(currX, destX, currV) {
    var FSpring = -(currX - destX) * stiff;
    var FDamping = currV * damping;
    var newV = currV + (FSpring - FDamping) * dt / 1e3;
    var newX = currV * dt / 1e3 + currX;
    if (Math.abs(newX - destX) < ACCURACY && Math.abs(newV) < ACCURACY) {
      return [destX, 0];
    }
    return [newX, newV];
  };
  stepper.isStepper = true;
  stepper.dt = dt;
  return stepper;
};
var configEasing = function configEasing2() {
  for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
    args[_key2] = arguments[_key2];
  }
  var easing = args[0];
  if (typeof easing === "string") {
    switch (easing) {
      case "ease":
      case "ease-in-out":
      case "ease-out":
      case "ease-in":
      case "linear":
        return configBezier(easing);
      case "spring":
        return configSpring();
      default:
        if (easing.split("(")[0] === "cubic-bezier") {
          return configBezier(easing);
        }
        warn3(false, "[configEasing]: first argument should be one of 'ease', 'ease-in', 'ease-out', 'ease-in-out','cubic-bezier(x1,y1,x2,y2)', 'linear' and 'spring', instead  received %s", args);
    }
  }
  if (typeof easing === "function") {
    return easing;
  }
  warn3(false, "[configEasing]: first argument type should be function or string, instead received %s", args);
  return null;
};

// node_modules/react-smooth/es6/configUpdate.js
function _typeof9(obj) {
  "@babel/helpers - typeof";
  return _typeof9 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
    return typeof obj2;
  } : function(obj2) {
    return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
  }, _typeof9(obj);
}
function _toConsumableArray2(arr) {
  return _arrayWithoutHoles2(arr) || _iterableToArray3(arr) || _unsupportedIterableToArray4(arr) || _nonIterableSpread2();
}
function _nonIterableSpread2() {
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _iterableToArray3(iter) {
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
    return Array.from(iter);
}
function _arrayWithoutHoles2(arr) {
  if (Array.isArray(arr))
    return _arrayLikeToArray4(arr);
}
function ownKeys5(object, enumerableOnly) {
  var keys4 = Object.keys(object);
  if (Object.getOwnPropertySymbols) {
    var symbols = Object.getOwnPropertySymbols(object);
    enumerableOnly && (symbols = symbols.filter(function(sym) {
      return Object.getOwnPropertyDescriptor(object, sym).enumerable;
    })), keys4.push.apply(keys4, symbols);
  }
  return keys4;
}
function _objectSpread5(target) {
  for (var i2 = 1; i2 < arguments.length; i2++) {
    var source = null != arguments[i2] ? arguments[i2] : {};
    i2 % 2 ? ownKeys5(Object(source), true).forEach(function(key) {
      _defineProperty5(target, key, source[key]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys5(Object(source)).forEach(function(key) {
      Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
    });
  }
  return target;
}
function _defineProperty5(obj, key, value) {
  key = _toPropertyKey5(key);
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
function _toPropertyKey5(arg) {
  var key = _toPrimitive5(arg, "string");
  return _typeof9(key) === "symbol" ? key : String(key);
}
function _toPrimitive5(input, hint) {
  if (_typeof9(input) !== "object" || input === null)
    return input;
  var prim = input[Symbol.toPrimitive];
  if (prim !== void 0) {
    var res = prim.call(input, hint || "default");
    if (_typeof9(res) !== "object")
      return res;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (hint === "string" ? String : Number)(input);
}
function _slicedToArray2(arr, i2) {
  return _arrayWithHoles3(arr) || _iterableToArrayLimit2(arr, i2) || _unsupportedIterableToArray4(arr, i2) || _nonIterableRest3();
}
function _nonIterableRest3() {
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _unsupportedIterableToArray4(o, minLen) {
  if (!o)
    return;
  if (typeof o === "string")
    return _arrayLikeToArray4(o, minLen);
  var n2 = Object.prototype.toString.call(o).slice(8, -1);
  if (n2 === "Object" && o.constructor)
    n2 = o.constructor.name;
  if (n2 === "Map" || n2 === "Set")
    return Array.from(o);
  if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2))
    return _arrayLikeToArray4(o, minLen);
}
function _arrayLikeToArray4(arr, len) {
  if (len == null || len > arr.length)
    len = arr.length;
  for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++)
    arr2[i2] = arr[i2];
  return arr2;
}
function _iterableToArrayLimit2(arr, i2) {
  var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
  if (null != _i) {
    var _s, _e, _x2, _r, _arr = [], _n = true, _d = false;
    try {
      if (_x2 = (_i = _i.call(arr)).next, 0 === i2) {
        if (Object(_i) !== _i)
          return;
        _n = false;
      } else
        for (; !(_n = (_s = _x2.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i2); _n = true)
          ;
    } catch (err) {
      _d = true, _e = err;
    } finally {
      try {
        if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r))
          return;
      } finally {
        if (_d)
          throw _e;
      }
    }
    return _arr;
  }
}
function _arrayWithHoles3(arr) {
  if (Array.isArray(arr))
    return arr;
}
var alpha = function alpha2(begin, end, k2) {
  return begin + (end - begin) * k2;
};
var needContinue = function needContinue2(_ref18) {
  var from2 = _ref18.from, to = _ref18.to;
  return from2 !== to;
};
var calStepperVals = function calStepperVals2(easing, preVals, steps) {
  var nextStepVals = mapObject(function(key, val) {
    if (needContinue(val)) {
      var _easing = easing(val.from, val.to, val.velocity), _easing2 = _slicedToArray2(_easing, 2), newX = _easing2[0], newV = _easing2[1];
      return _objectSpread5(_objectSpread5({}, val), {}, {
        from: newX,
        velocity: newV
      });
    }
    return val;
  }, preVals);
  if (steps < 1) {
    return mapObject(function(key, val) {
      if (needContinue(val)) {
        return _objectSpread5(_objectSpread5({}, val), {}, {
          velocity: alpha(val.velocity, nextStepVals[key].velocity, steps),
          from: alpha(val.from, nextStepVals[key].from, steps)
        });
      }
      return val;
    }, preVals);
  }
  return calStepperVals2(easing, nextStepVals, steps - 1);
};
var configUpdate_default = function(from2, to, easing, duration, render2) {
  var interKeys = getIntersectionKeys(from2, to);
  var timingStyle = interKeys.reduce(function(res, key) {
    return _objectSpread5(_objectSpread5({}, res), {}, _defineProperty5({}, key, [from2[key], to[key]]));
  }, {});
  var stepperStyle = interKeys.reduce(function(res, key) {
    return _objectSpread5(_objectSpread5({}, res), {}, _defineProperty5({}, key, {
      from: from2[key],
      velocity: 0,
      to: to[key]
    }));
  }, {});
  var cafId = -1;
  var preTime;
  var beginTime;
  var update = function update2() {
    return null;
  };
  var getCurrStyle = function getCurrStyle2() {
    return mapObject(function(key, val) {
      return val.from;
    }, stepperStyle);
  };
  var shouldStopAnimation = function shouldStopAnimation2() {
    return !Object.values(stepperStyle).filter(needContinue).length;
  };
  var stepperUpdate = function stepperUpdate2(now2) {
    if (!preTime) {
      preTime = now2;
    }
    var deltaTime = now2 - preTime;
    var steps = deltaTime / easing.dt;
    stepperStyle = calStepperVals(easing, stepperStyle, steps);
    render2(_objectSpread5(_objectSpread5(_objectSpread5({}, from2), to), getCurrStyle(stepperStyle)));
    preTime = now2;
    if (!shouldStopAnimation()) {
      cafId = requestAnimationFrame(update);
    }
  };
  var timingUpdate = function timingUpdate2(now2) {
    if (!beginTime) {
      beginTime = now2;
    }
    var t3 = (now2 - beginTime) / duration;
    var currStyle = mapObject(function(key, val) {
      return alpha.apply(void 0, _toConsumableArray2(val).concat([easing(t3)]));
    }, timingStyle);
    render2(_objectSpread5(_objectSpread5(_objectSpread5({}, from2), to), currStyle));
    if (t3 < 1) {
      cafId = requestAnimationFrame(update);
    } else {
      var finalStyle = mapObject(function(key, val) {
        return alpha.apply(void 0, _toConsumableArray2(val).concat([easing(1)]));
      }, timingStyle);
      render2(_objectSpread5(_objectSpread5(_objectSpread5({}, from2), to), finalStyle));
    }
  };
  update = easing.isStepper ? stepperUpdate : timingUpdate;
  return function() {
    requestAnimationFrame(update);
    return function() {
      cancelAnimationFrame(cafId);
    };
  };
};

// node_modules/react-smooth/es6/Animate.js
function _typeof10(obj) {
  "@babel/helpers - typeof";
  return _typeof10 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
    return typeof obj2;
  } : function(obj2) {
    return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
  }, _typeof10(obj);
}
var _excluded10 = ["children", "begin", "duration", "attributeName", "easing", "isActive", "steps", "from", "to", "canBegin", "onAnimationEnd", "shouldReAnimate", "onAnimationReStart"];
function _objectWithoutProperties6(source, excluded) {
  if (source == null)
    return {};
  var target = _objectWithoutPropertiesLoose10(source, excluded);
  var key, i2;
  if (Object.getOwnPropertySymbols) {
    var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
    for (i2 = 0; i2 < sourceSymbolKeys.length; i2++) {
      key = sourceSymbolKeys[i2];
      if (excluded.indexOf(key) >= 0)
        continue;
      if (!Object.prototype.propertyIsEnumerable.call(source, key))
        continue;
      target[key] = source[key];
    }
  }
  return target;
}
function _objectWithoutPropertiesLoose10(source, excluded) {
  if (source == null)
    return {};
  var target = {};
  var sourceKeys = Object.keys(source);
  var key, i2;
  for (i2 = 0; i2 < sourceKeys.length; i2++) {
    key = sourceKeys[i2];
    if (excluded.indexOf(key) >= 0)
      continue;
    target[key] = source[key];
  }
  return target;
}
function _toConsumableArray3(arr) {
  return _arrayWithoutHoles3(arr) || _iterableToArray4(arr) || _unsupportedIterableToArray5(arr) || _nonIterableSpread3();
}
function _nonIterableSpread3() {
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _unsupportedIterableToArray5(o, minLen) {
  if (!o)
    return;
  if (typeof o === "string")
    return _arrayLikeToArray5(o, minLen);
  var n2 = Object.prototype.toString.call(o).slice(8, -1);
  if (n2 === "Object" && o.constructor)
    n2 = o.constructor.name;
  if (n2 === "Map" || n2 === "Set")
    return Array.from(o);
  if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2))
    return _arrayLikeToArray5(o, minLen);
}
function _iterableToArray4(iter) {
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
    return Array.from(iter);
}
function _arrayWithoutHoles3(arr) {
  if (Array.isArray(arr))
    return _arrayLikeToArray5(arr);
}
function _arrayLikeToArray5(arr, len) {
  if (len == null || len > arr.length)
    len = arr.length;
  for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++)
    arr2[i2] = arr[i2];
  return arr2;
}
function ownKeys6(object, enumerableOnly) {
  var keys4 = Object.keys(object);
  if (Object.getOwnPropertySymbols) {
    var symbols = Object.getOwnPropertySymbols(object);
    enumerableOnly && (symbols = symbols.filter(function(sym) {
      return Object.getOwnPropertyDescriptor(object, sym).enumerable;
    })), keys4.push.apply(keys4, symbols);
  }
  return keys4;
}
function _objectSpread6(target) {
  for (var i2 = 1; i2 < arguments.length; i2++) {
    var source = null != arguments[i2] ? arguments[i2] : {};
    i2 % 2 ? ownKeys6(Object(source), true).forEach(function(key) {
      _defineProperty6(target, key, source[key]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys6(Object(source)).forEach(function(key) {
      Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
    });
  }
  return target;
}
function _defineProperty6(obj, key, value) {
  key = _toPropertyKey6(key);
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
function _classCallCheck3(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties3(target, props) {
  for (var i2 = 0; i2 < props.length; i2++) {
    var descriptor = props[i2];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor)
      descriptor.writable = true;
    Object.defineProperty(target, _toPropertyKey6(descriptor.key), descriptor);
  }
}
function _createClass3(Constructor, protoProps, staticProps) {
  if (protoProps)
    _defineProperties3(Constructor.prototype, protoProps);
  if (staticProps)
    _defineProperties3(Constructor, staticProps);
  Object.defineProperty(Constructor, "prototype", { writable: false });
  return Constructor;
}
function _toPropertyKey6(arg) {
  var key = _toPrimitive6(arg, "string");
  return _typeof10(key) === "symbol" ? key : String(key);
}
function _toPrimitive6(input, hint) {
  if (_typeof10(input) !== "object" || input === null)
    return input;
  var prim = input[Symbol.toPrimitive];
  if (prim !== void 0) {
    var res = prim.call(input, hint || "default");
    if (_typeof10(res) !== "object")
      return res;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (hint === "string" ? String : Number)(input);
}
function _inherits3(subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function");
  }
  subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
  Object.defineProperty(subClass, "prototype", { writable: false });
  if (superClass)
    _setPrototypeOf5(subClass, superClass);
}
function _setPrototypeOf5(o, p) {
  _setPrototypeOf5 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf19(o2, p2) {
    o2.__proto__ = p2;
    return o2;
  };
  return _setPrototypeOf5(o, p);
}
function _createSuper3(Derived) {
  var hasNativeReflectConstruct = _isNativeReflectConstruct4();
  return function _createSuperInternal() {
    var Super = _getPrototypeOf4(Derived), result;
    if (hasNativeReflectConstruct) {
      var NewTarget = _getPrototypeOf4(this).constructor;
      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }
    return _possibleConstructorReturn3(this, result);
  };
}
function _possibleConstructorReturn3(self2, call) {
  if (call && (_typeof10(call) === "object" || typeof call === "function")) {
    return call;
  } else if (call !== void 0) {
    throw new TypeError("Derived constructors may only return object or undefined");
  }
  return _assertThisInitialized5(self2);
}
function _assertThisInitialized5(self2) {
  if (self2 === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }
  return self2;
}
function _isNativeReflectConstruct4() {
  if (typeof Reflect === "undefined" || !Reflect.construct)
    return false;
  if (Reflect.construct.sham)
    return false;
  if (typeof Proxy === "function")
    return true;
  try {
    Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
    return true;
  } catch (e3) {
    return false;
  }
}
function _getPrototypeOf4(o) {
  _getPrototypeOf4 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf18(o2) {
    return o2.__proto__ || Object.getPrototypeOf(o2);
  };
  return _getPrototypeOf4(o);
}
var Animate = /* @__PURE__ */ function(_PureComponent) {
  _inherits3(Animate2, _PureComponent);
  var _super = _createSuper3(Animate2);
  function Animate2(props, context2) {
    var _this;
    _classCallCheck3(this, Animate2);
    _this = _super.call(this, props, context2);
    var _this$props = _this.props, isActive = _this$props.isActive, attributeName = _this$props.attributeName, from2 = _this$props.from, to = _this$props.to, steps = _this$props.steps, children = _this$props.children, duration = _this$props.duration;
    _this.handleStyleChange = _this.handleStyleChange.bind(_assertThisInitialized5(_this));
    _this.changeStyle = _this.changeStyle.bind(_assertThisInitialized5(_this));
    if (!isActive || duration <= 0) {
      _this.state = {
        style: {}
      };
      if (typeof children === "function") {
        _this.state = {
          style: to
        };
      }
      return _possibleConstructorReturn3(_this);
    }
    if (steps && steps.length) {
      _this.state = {
        style: steps[0].style
      };
    } else if (from2) {
      if (typeof children === "function") {
        _this.state = {
          style: from2
        };
        return _possibleConstructorReturn3(_this);
      }
      _this.state = {
        style: attributeName ? _defineProperty6({}, attributeName, from2) : from2
      };
    } else {
      _this.state = {
        style: {}
      };
    }
    return _this;
  }
  _createClass3(Animate2, [{
    key: "componentDidMount",
    value: function componentDidMount() {
      var _this$props2 = this.props, isActive = _this$props2.isActive, canBegin = _this$props2.canBegin;
      this.mounted = true;
      if (!isActive || !canBegin) {
        return;
      }
      this.runAnimation(this.props);
    }
  }, {
    key: "componentDidUpdate",
    value: function componentDidUpdate(prevProps) {
      var _this$props3 = this.props, isActive = _this$props3.isActive, canBegin = _this$props3.canBegin, attributeName = _this$props3.attributeName, shouldReAnimate = _this$props3.shouldReAnimate, to = _this$props3.to, currentFrom = _this$props3.from;
      var style = this.state.style;
      if (!canBegin) {
        return;
      }
      if (!isActive) {
        var newState = {
          style: attributeName ? _defineProperty6({}, attributeName, to) : to
        };
        if (this.state && style) {
          if (attributeName && style[attributeName] !== to || !attributeName && style !== to) {
            this.setState(newState);
          }
        }
        return;
      }
      if (deepEqual2(prevProps.to, to) && prevProps.canBegin && prevProps.isActive) {
        return;
      }
      var isTriggered = !prevProps.canBegin || !prevProps.isActive;
      if (this.manager) {
        this.manager.stop();
      }
      if (this.stopJSAnimation) {
        this.stopJSAnimation();
      }
      var from2 = isTriggered || shouldReAnimate ? currentFrom : prevProps.to;
      if (this.state && style) {
        var _newState = {
          style: attributeName ? _defineProperty6({}, attributeName, from2) : from2
        };
        if (attributeName && [attributeName] !== from2 || !attributeName && style !== from2) {
          this.setState(_newState);
        }
      }
      this.runAnimation(_objectSpread6(_objectSpread6({}, this.props), {}, {
        from: from2,
        begin: 0
      }));
    }
  }, {
    key: "componentWillUnmount",
    value: function componentWillUnmount() {
      this.mounted = false;
      var onAnimationEnd2 = this.props.onAnimationEnd;
      if (this.unSubscribe) {
        this.unSubscribe();
      }
      if (this.manager) {
        this.manager.stop();
        this.manager = null;
      }
      if (this.stopJSAnimation) {
        this.stopJSAnimation();
      }
      if (onAnimationEnd2) {
        onAnimationEnd2();
      }
    }
  }, {
    key: "handleStyleChange",
    value: function handleStyleChange(style) {
      this.changeStyle(style);
    }
  }, {
    key: "changeStyle",
    value: function changeStyle(style) {
      if (this.mounted) {
        this.setState({
          style
        });
      }
    }
  }, {
    key: "runJSAnimation",
    value: function runJSAnimation(props) {
      var _this2 = this;
      var from2 = props.from, to = props.to, duration = props.duration, easing = props.easing, begin = props.begin, onAnimationEnd2 = props.onAnimationEnd, onAnimationStart2 = props.onAnimationStart;
      var startAnimation = configUpdate_default(from2, to, configEasing(easing), duration, this.changeStyle);
      var finalStartAnimation = function finalStartAnimation2() {
        _this2.stopJSAnimation = startAnimation();
      };
      this.manager.start([onAnimationStart2, begin, finalStartAnimation, duration, onAnimationEnd2]);
    }
  }, {
    key: "runStepAnimation",
    value: function runStepAnimation(props) {
      var _this3 = this;
      var steps = props.steps, begin = props.begin, onAnimationStart2 = props.onAnimationStart;
      var _steps$ = steps[0], initialStyle = _steps$.style, _steps$$duration = _steps$.duration, initialTime = _steps$$duration === void 0 ? 0 : _steps$$duration;
      var addStyle = function addStyle2(sequence, nextItem, index) {
        if (index === 0) {
          return sequence;
        }
        var duration = nextItem.duration, _nextItem$easing = nextItem.easing, easing = _nextItem$easing === void 0 ? "ease" : _nextItem$easing, style = nextItem.style, nextProperties = nextItem.properties, onAnimationEnd2 = nextItem.onAnimationEnd;
        var preItem = index > 0 ? steps[index - 1] : nextItem;
        var properties = nextProperties || Object.keys(style);
        if (typeof easing === "function" || easing === "spring") {
          return [].concat(_toConsumableArray3(sequence), [_this3.runJSAnimation.bind(_this3, {
            from: preItem.style,
            to: style,
            duration,
            easing
          }), duration]);
        }
        var transition = getTransitionVal(properties, duration, easing);
        var newStyle = _objectSpread6(_objectSpread6(_objectSpread6({}, preItem.style), style), {}, {
          transition
        });
        return [].concat(_toConsumableArray3(sequence), [newStyle, duration, onAnimationEnd2]).filter(identity);
      };
      return this.manager.start([onAnimationStart2].concat(_toConsumableArray3(steps.reduce(addStyle, [initialStyle, Math.max(initialTime, begin)])), [props.onAnimationEnd]));
    }
  }, {
    key: "runAnimation",
    value: function runAnimation(props) {
      if (!this.manager) {
        this.manager = createAnimateManager();
      }
      var begin = props.begin, duration = props.duration, attributeName = props.attributeName, propsTo = props.to, easing = props.easing, onAnimationStart2 = props.onAnimationStart, onAnimationEnd2 = props.onAnimationEnd, steps = props.steps, children = props.children;
      var manager = this.manager;
      this.unSubscribe = manager.subscribe(this.handleStyleChange);
      if (typeof easing === "function" || typeof children === "function" || easing === "spring") {
        this.runJSAnimation(props);
        return;
      }
      if (steps.length > 1) {
        this.runStepAnimation(props);
        return;
      }
      var to = attributeName ? _defineProperty6({}, attributeName, propsTo) : propsTo;
      var transition = getTransitionVal(Object.keys(to), duration, easing);
      manager.start([onAnimationStart2, begin, _objectSpread6(_objectSpread6({}, to), {}, {
        transition
      }), duration, onAnimationEnd2]);
    }
  }, {
    key: "render",
    value: function render2() {
      var _this$props4 = this.props, children = _this$props4.children, begin = _this$props4.begin, duration = _this$props4.duration, attributeName = _this$props4.attributeName, easing = _this$props4.easing, isActive = _this$props4.isActive, steps = _this$props4.steps, from2 = _this$props4.from, to = _this$props4.to, canBegin = _this$props4.canBegin, onAnimationEnd2 = _this$props4.onAnimationEnd, shouldReAnimate = _this$props4.shouldReAnimate, onAnimationReStart = _this$props4.onAnimationReStart, others = _objectWithoutProperties6(_this$props4, _excluded10);
      var count2 = import_react83.Children.count(children);
      var stateStyle = translateStyle(this.state.style);
      if (typeof children === "function") {
        return children(stateStyle);
      }
      if (!isActive || count2 === 0 || duration <= 0) {
        return children;
      }
      var cloneContainer = function cloneContainer2(container) {
        var _container$props = container.props, _container$props$styl = _container$props.style, style = _container$props$styl === void 0 ? {} : _container$props$styl, className = _container$props.className;
        var res = /* @__PURE__ */ (0, import_react83.cloneElement)(container, _objectSpread6(_objectSpread6({}, others), {}, {
          style: _objectSpread6(_objectSpread6({}, style), stateStyle),
          className
        }));
        return res;
      };
      if (count2 === 1) {
        return cloneContainer(import_react83.Children.only(children));
      }
      return /* @__PURE__ */ import_react83.default.createElement("div", null, import_react83.Children.map(children, function(child) {
        return cloneContainer(child);
      }));
    }
  }]);
  return Animate2;
}(import_react83.PureComponent);
Animate.displayName = "Animate";
Animate.defaultProps = {
  begin: 0,
  duration: 1e3,
  from: "",
  to: "",
  attributeName: "",
  easing: "ease",
  isActive: true,
  canBegin: true,
  steps: [],
  onAnimationEnd: function onAnimationEnd() {
  },
  onAnimationStart: function onAnimationStart() {
  }
};
Animate.propTypes = {
  from: import_prop_types5.default.oneOfType([import_prop_types5.default.object, import_prop_types5.default.string]),
  to: import_prop_types5.default.oneOfType([import_prop_types5.default.object, import_prop_types5.default.string]),
  attributeName: import_prop_types5.default.string,
  // animation duration
  duration: import_prop_types5.default.number,
  begin: import_prop_types5.default.number,
  easing: import_prop_types5.default.oneOfType([import_prop_types5.default.string, import_prop_types5.default.func]),
  steps: import_prop_types5.default.arrayOf(import_prop_types5.default.shape({
    duration: import_prop_types5.default.number.isRequired,
    style: import_prop_types5.default.object.isRequired,
    easing: import_prop_types5.default.oneOfType([import_prop_types5.default.oneOf(["ease", "ease-in", "ease-out", "ease-in-out", "linear"]), import_prop_types5.default.func]),
    // transition css properties(dash case), optional
    properties: import_prop_types5.default.arrayOf("string"),
    onAnimationEnd: import_prop_types5.default.func
  })),
  children: import_prop_types5.default.oneOfType([import_prop_types5.default.node, import_prop_types5.default.func]),
  isActive: import_prop_types5.default.bool,
  canBegin: import_prop_types5.default.bool,
  onAnimationEnd: import_prop_types5.default.func,
  // decide if it should reanimate with initial from style when props change
  shouldReAnimate: import_prop_types5.default.bool,
  onAnimationStart: import_prop_types5.default.func,
  onAnimationReStart: import_prop_types5.default.func
};
var Animate_default = Animate;

// node_modules/react-smooth/es6/AnimateGroup.js
var import_react85 = __toESM(require_react());
var import_react_transition_group3 = __toESM(require_react_transition_group());
var import_prop_types7 = __toESM(require_prop_types());

// node_modules/react-smooth/es6/AnimateGroupChild.js
var import_react84 = __toESM(require_react());
var import_react_transition_group2 = __toESM(require_react_transition_group());
var import_prop_types6 = __toESM(require_prop_types());
var _excluded11 = ["children", "appearOptions", "enterOptions", "leaveOptions"];
function _typeof11(obj) {
  "@babel/helpers - typeof";
  return _typeof11 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
    return typeof obj2;
  } : function(obj2) {
    return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
  }, _typeof11(obj);
}
function _extends12() {
  _extends12 = Object.assign ? Object.assign.bind() : function(target) {
    for (var i2 = 1; i2 < arguments.length; i2++) {
      var source = arguments[i2];
      for (var key in source) {
        if (Object.prototype.hasOwnProperty.call(source, key)) {
          target[key] = source[key];
        }
      }
    }
    return target;
  };
  return _extends12.apply(this, arguments);
}
function _objectWithoutProperties7(source, excluded) {
  if (source == null)
    return {};
  var target = _objectWithoutPropertiesLoose11(source, excluded);
  var key, i2;
  if (Object.getOwnPropertySymbols) {
    var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
    for (i2 = 0; i2 < sourceSymbolKeys.length; i2++) {
      key = sourceSymbolKeys[i2];
      if (excluded.indexOf(key) >= 0)
        continue;
      if (!Object.prototype.propertyIsEnumerable.call(source, key))
        continue;
      target[key] = source[key];
    }
  }
  return target;
}
function _objectWithoutPropertiesLoose11(source, excluded) {
  if (source == null)
    return {};
  var target = {};
  var sourceKeys = Object.keys(source);
  var key, i2;
  for (i2 = 0; i2 < sourceKeys.length; i2++) {
    key = sourceKeys[i2];
    if (excluded.indexOf(key) >= 0)
      continue;
    target[key] = source[key];
  }
  return target;
}
function ownKeys7(object, enumerableOnly) {
  var keys4 = Object.keys(object);
  if (Object.getOwnPropertySymbols) {
    var symbols = Object.getOwnPropertySymbols(object);
    enumerableOnly && (symbols = symbols.filter(function(sym) {
      return Object.getOwnPropertyDescriptor(object, sym).enumerable;
    })), keys4.push.apply(keys4, symbols);
  }
  return keys4;
}
function _objectSpread7(target) {
  for (var i2 = 1; i2 < arguments.length; i2++) {
    var source = null != arguments[i2] ? arguments[i2] : {};
    i2 % 2 ? ownKeys7(Object(source), true).forEach(function(key) {
      _defineProperty7(target, key, source[key]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys7(Object(source)).forEach(function(key) {
      Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
    });
  }
  return target;
}
function _classCallCheck4(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties4(target, props) {
  for (var i2 = 0; i2 < props.length; i2++) {
    var descriptor = props[i2];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor)
      descriptor.writable = true;
    Object.defineProperty(target, _toPropertyKey7(descriptor.key), descriptor);
  }
}
function _createClass4(Constructor, protoProps, staticProps) {
  if (protoProps)
    _defineProperties4(Constructor.prototype, protoProps);
  if (staticProps)
    _defineProperties4(Constructor, staticProps);
  Object.defineProperty(Constructor, "prototype", { writable: false });
  return Constructor;
}
function _inherits4(subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function");
  }
  subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
  Object.defineProperty(subClass, "prototype", { writable: false });
  if (superClass)
    _setPrototypeOf6(subClass, superClass);
}
function _setPrototypeOf6(o, p) {
  _setPrototypeOf6 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf19(o2, p2) {
    o2.__proto__ = p2;
    return o2;
  };
  return _setPrototypeOf6(o, p);
}
function _createSuper4(Derived) {
  var hasNativeReflectConstruct = _isNativeReflectConstruct5();
  return function _createSuperInternal() {
    var Super = _getPrototypeOf5(Derived), result;
    if (hasNativeReflectConstruct) {
      var NewTarget = _getPrototypeOf5(this).constructor;
      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }
    return _possibleConstructorReturn4(this, result);
  };
}
function _possibleConstructorReturn4(self2, call) {
  if (call && (_typeof11(call) === "object" || typeof call === "function")) {
    return call;
  } else if (call !== void 0) {
    throw new TypeError("Derived constructors may only return object or undefined");
  }
  return _assertThisInitialized6(self2);
}
function _assertThisInitialized6(self2) {
  if (self2 === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }
  return self2;
}
function _isNativeReflectConstruct5() {
  if (typeof Reflect === "undefined" || !Reflect.construct)
    return false;
  if (Reflect.construct.sham)
    return false;
  if (typeof Proxy === "function")
    return true;
  try {
    Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
    return true;
  } catch (e3) {
    return false;
  }
}
function _getPrototypeOf5(o) {
  _getPrototypeOf5 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf18(o2) {
    return o2.__proto__ || Object.getPrototypeOf(o2);
  };
  return _getPrototypeOf5(o);
}
function _defineProperty7(obj, key, value) {
  key = _toPropertyKey7(key);
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
function _toPropertyKey7(arg) {
  var key = _toPrimitive7(arg, "string");
  return _typeof11(key) === "symbol" ? key : String(key);
}
function _toPrimitive7(input, hint) {
  if (_typeof11(input) !== "object" || input === null)
    return input;
  var prim = input[Symbol.toPrimitive];
  if (prim !== void 0) {
    var res = prim.call(input, hint || "default");
    if (_typeof11(res) !== "object")
      return res;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (hint === "string" ? String : Number)(input);
}
if (Number.isFinite === void 0) {
  Number.isFinite = function(value) {
    return typeof value === "number" && isFinite(value);
  };
}
var parseDurationOfSingleTransition = function parseDurationOfSingleTransition2() {
  var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
  var steps = options.steps, duration = options.duration;
  if (steps && steps.length) {
    return steps.reduce(function(result, entry) {
      return result + (Number.isFinite(entry.duration) && entry.duration > 0 ? entry.duration : 0);
    }, 0);
  }
  if (Number.isFinite(duration)) {
    return duration;
  }
  return 0;
};
var AnimateGroupChild = /* @__PURE__ */ function(_Component) {
  _inherits4(AnimateGroupChild2, _Component);
  var _super = _createSuper4(AnimateGroupChild2);
  function AnimateGroupChild2() {
    var _this;
    _classCallCheck4(this, AnimateGroupChild2);
    _this = _super.call(this);
    _defineProperty7(_assertThisInitialized6(_this), "handleEnter", function(node56, isAppearing) {
      var _this$props = _this.props, appearOptions = _this$props.appearOptions, enterOptions = _this$props.enterOptions;
      _this.handleStyleActive(isAppearing ? appearOptions : enterOptions);
    });
    _defineProperty7(_assertThisInitialized6(_this), "handleExit", function() {
      var leaveOptions = _this.props.leaveOptions;
      _this.handleStyleActive(leaveOptions);
    });
    _this.state = {
      isActive: false
    };
    return _this;
  }
  _createClass4(AnimateGroupChild2, [{
    key: "handleStyleActive",
    value: function handleStyleActive(style) {
      if (style) {
        var onAnimationEnd2 = style.onAnimationEnd ? function() {
          style.onAnimationEnd();
        } : null;
        this.setState(_objectSpread7(_objectSpread7({}, style), {}, {
          onAnimationEnd: onAnimationEnd2,
          isActive: true
        }));
      }
    }
  }, {
    key: "parseTimeout",
    value: function parseTimeout() {
      var _this$props2 = this.props, appearOptions = _this$props2.appearOptions, enterOptions = _this$props2.enterOptions, leaveOptions = _this$props2.leaveOptions;
      return parseDurationOfSingleTransition(appearOptions) + parseDurationOfSingleTransition(enterOptions) + parseDurationOfSingleTransition(leaveOptions);
    }
  }, {
    key: "render",
    value: function render2() {
      var _this2 = this;
      var _this$props3 = this.props, children = _this$props3.children, appearOptions = _this$props3.appearOptions, enterOptions = _this$props3.enterOptions, leaveOptions = _this$props3.leaveOptions, props = _objectWithoutProperties7(_this$props3, _excluded11);
      return /* @__PURE__ */ import_react84.default.createElement(import_react_transition_group2.Transition, _extends12({}, props, {
        onEnter: this.handleEnter,
        onExit: this.handleExit,
        timeout: this.parseTimeout()
      }), function() {
        return /* @__PURE__ */ import_react84.default.createElement(Animate_default, _this2.state, import_react84.Children.only(children));
      });
    }
  }]);
  return AnimateGroupChild2;
}(import_react84.Component);
AnimateGroupChild.propTypes = {
  appearOptions: import_prop_types6.default.object,
  enterOptions: import_prop_types6.default.object,
  leaveOptions: import_prop_types6.default.object,
  children: import_prop_types6.default.element
};
var AnimateGroupChild_default = AnimateGroupChild;

// node_modules/react-smooth/es6/AnimateGroup.js
function AnimateGroup(props) {
  var component = props.component, children = props.children, appear = props.appear, enter = props.enter, leave = props.leave;
  return /* @__PURE__ */ import_react85.default.createElement(import_react_transition_group3.TransitionGroup, {
    component
  }, import_react85.Children.map(children, function(child, index) {
    return /* @__PURE__ */ import_react85.default.createElement(AnimateGroupChild_default, {
      appearOptions: appear,
      enterOptions: enter,
      leaveOptions: leave,
      key: "child-".concat(index)
      // eslint-disable-line
    }, child);
  }));
}
AnimateGroup.propTypes = {
  appear: import_prop_types7.default.object,
  enter: import_prop_types7.default.object,
  leave: import_prop_types7.default.object,
  children: import_prop_types7.default.oneOfType([import_prop_types7.default.array, import_prop_types7.default.element]),
  component: import_prop_types7.default.any
};
AnimateGroup.defaultProps = {
  component: "span"
};

// node_modules/react-smooth/es6/index.js
var es6_default = Animate_default;

// node_modules/recharts/es6/component/Tooltip.js
var import_classnames6 = __toESM(require_classnames());

// node_modules/recharts/es6/component/DefaultTooltipContent.js
var import_isNil2 = __toESM(require_isNil());
var import_sortBy = __toESM(require_sortBy());
var import_isArray3 = __toESM(require_isArray());
var import_react86 = __toESM(require_react());
var import_classnames5 = __toESM(require_classnames());
function _typeof12(o) {
  "@babel/helpers - typeof";
  return _typeof12 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
    return typeof o2;
  } : function(o2) {
    return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
  }, _typeof12(o);
}
function _slicedToArray3(arr, i2) {
  return _arrayWithHoles4(arr) || _iterableToArrayLimit3(arr, i2) || _unsupportedIterableToArray6(arr, i2) || _nonIterableRest4();
}
function _nonIterableRest4() {
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _unsupportedIterableToArray6(o, minLen) {
  if (!o)
    return;
  if (typeof o === "string")
    return _arrayLikeToArray6(o, minLen);
  var n2 = Object.prototype.toString.call(o).slice(8, -1);
  if (n2 === "Object" && o.constructor)
    n2 = o.constructor.name;
  if (n2 === "Map" || n2 === "Set")
    return Array.from(o);
  if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2))
    return _arrayLikeToArray6(o, minLen);
}
function _arrayLikeToArray6(arr, len) {
  if (len == null || len > arr.length)
    len = arr.length;
  for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++)
    arr2[i2] = arr[i2];
  return arr2;
}
function _iterableToArrayLimit3(r3, l) {
  var t3 = null == r3 ? null : "undefined" != typeof Symbol && r3[Symbol.iterator] || r3["@@iterator"];
  if (null != t3) {
    var e3, n2, i2, u, a2 = [], f = true, o = false;
    try {
      if (i2 = (t3 = t3.call(r3)).next, 0 === l) {
        if (Object(t3) !== t3)
          return;
        f = false;
      } else
        for (; !(f = (e3 = i2.call(t3)).done) && (a2.push(e3.value), a2.length !== l); f = true)
          ;
    } catch (r4) {
      o = true, n2 = r4;
    } finally {
      try {
        if (!f && null != t3["return"] && (u = t3["return"](), Object(u) !== u))
          return;
      } finally {
        if (o)
          throw n2;
      }
    }
    return a2;
  }
}
function _arrayWithHoles4(arr) {
  if (Array.isArray(arr))
    return arr;
}
function ownKeys8(e3, r3) {
  var t3 = Object.keys(e3);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e3);
    r3 && (o = o.filter(function(r4) {
      return Object.getOwnPropertyDescriptor(e3, r4).enumerable;
    })), t3.push.apply(t3, o);
  }
  return t3;
}
function _objectSpread8(e3) {
  for (var r3 = 1; r3 < arguments.length; r3++) {
    var t3 = null != arguments[r3] ? arguments[r3] : {};
    r3 % 2 ? ownKeys8(Object(t3), true).forEach(function(r4) {
      _defineProperty8(e3, r4, t3[r4]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e3, Object.getOwnPropertyDescriptors(t3)) : ownKeys8(Object(t3)).forEach(function(r4) {
      Object.defineProperty(e3, r4, Object.getOwnPropertyDescriptor(t3, r4));
    });
  }
  return e3;
}
function _defineProperty8(obj, key, value) {
  key = _toPropertyKey8(key);
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
function _toPropertyKey8(arg) {
  var key = _toPrimitive8(arg, "string");
  return _typeof12(key) === "symbol" ? key : String(key);
}
function _toPrimitive8(input, hint) {
  if (_typeof12(input) !== "object" || input === null)
    return input;
  var prim = input[Symbol.toPrimitive];
  if (prim !== void 0) {
    var res = prim.call(input, hint || "default");
    if (_typeof12(res) !== "object")
      return res;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (hint === "string" ? String : Number)(input);
}
function defaultFormatter(value) {
  return (0, import_isArray3.default)(value) && isNumOrStr(value[0]) && isNumOrStr(value[1]) ? value.join(" ~ ") : value;
}
var DefaultTooltipContent = function DefaultTooltipContent2(props) {
  var _props$separator = props.separator, separator = _props$separator === void 0 ? " : " : _props$separator, _props$contentStyle = props.contentStyle, contentStyle = _props$contentStyle === void 0 ? {} : _props$contentStyle, _props$itemStyle = props.itemStyle, itemStyle = _props$itemStyle === void 0 ? {} : _props$itemStyle, _props$labelStyle = props.labelStyle, labelStyle = _props$labelStyle === void 0 ? {} : _props$labelStyle, payload = props.payload, formatter3 = props.formatter, itemSorter = props.itemSorter, wrapperClassName = props.wrapperClassName, labelClassName = props.labelClassName, label = props.label, labelFormatter = props.labelFormatter;
  var renderContent3 = function renderContent4() {
    if (payload && payload.length) {
      var listStyle = {
        padding: 0,
        margin: 0
      };
      var items = (itemSorter ? (0, import_sortBy.default)(payload, itemSorter) : payload).map(function(entry, i2) {
        if (entry.type === "none") {
          return null;
        }
        var finalItemStyle = _objectSpread8({
          display: "block",
          paddingTop: 4,
          paddingBottom: 4,
          color: entry.color || "#000"
        }, itemStyle);
        var finalFormatter = entry.formatter || formatter3 || defaultFormatter;
        var value = entry.value, name2 = entry.name;
        var finalValue = value;
        var finalName = name2;
        if (finalFormatter && finalValue != null && finalName != null) {
          var formatted = finalFormatter(value, name2, entry, i2, payload);
          if (Array.isArray(formatted)) {
            var _formatted = _slicedToArray3(formatted, 2);
            finalValue = _formatted[0];
            finalName = _formatted[1];
          } else {
            finalValue = formatted;
          }
        }
        return (
          // eslint-disable-next-line react/no-array-index-key
          /* @__PURE__ */ import_react86.default.createElement("li", {
            className: "recharts-tooltip-item",
            key: "tooltip-item-".concat(i2),
            style: finalItemStyle
          }, isNumOrStr(finalName) ? /* @__PURE__ */ import_react86.default.createElement("span", {
            className: "recharts-tooltip-item-name"
          }, finalName) : null, isNumOrStr(finalName) ? /* @__PURE__ */ import_react86.default.createElement("span", {
            className: "recharts-tooltip-item-separator"
          }, separator) : null, /* @__PURE__ */ import_react86.default.createElement("span", {
            className: "recharts-tooltip-item-value"
          }, finalValue), /* @__PURE__ */ import_react86.default.createElement("span", {
            className: "recharts-tooltip-item-unit"
          }, entry.unit || ""))
        );
      });
      return /* @__PURE__ */ import_react86.default.createElement("ul", {
        className: "recharts-tooltip-item-list",
        style: listStyle
      }, items);
    }
    return null;
  };
  var finalStyle = _objectSpread8({
    margin: 0,
    padding: 10,
    backgroundColor: "#fff",
    border: "1px solid #ccc",
    whiteSpace: "nowrap"
  }, contentStyle);
  var finalLabelStyle = _objectSpread8({
    margin: 0
  }, labelStyle);
  var hasLabel = !(0, import_isNil2.default)(label);
  var finalLabel = hasLabel ? label : "";
  var wrapperCN = (0, import_classnames5.default)("recharts-default-tooltip", wrapperClassName);
  var labelCN = (0, import_classnames5.default)("recharts-tooltip-label", labelClassName);
  if (hasLabel && labelFormatter && payload !== void 0 && payload !== null) {
    finalLabel = labelFormatter(label, payload);
  }
  return /* @__PURE__ */ import_react86.default.createElement("div", {
    className: wrapperCN,
    style: finalStyle
  }, /* @__PURE__ */ import_react86.default.createElement("p", {
    className: labelCN,
    style: finalLabelStyle
  }, /* @__PURE__ */ import_react86.default.isValidElement(finalLabel) ? finalLabel : "".concat(finalLabel)), renderContent3());
};

// node_modules/recharts/es6/util/Global.js
var parseIsSsrByDefault = function parseIsSsrByDefault2() {
  return !(typeof window !== "undefined" && window.document && window.document.createElement && window.setTimeout);
};
var Global2 = {
  isSsr: parseIsSsrByDefault(),
  get: function get(key) {
    return Global2[key];
  },
  set: function set(key, value) {
    if (typeof key === "string") {
      Global2[key] = value;
    } else {
      var keys4 = Object.keys(key);
      if (keys4 && keys4.length) {
        keys4.forEach(function(k2) {
          Global2[k2] = key[k2];
        });
      }
    }
  }
};

// node_modules/recharts/es6/component/Tooltip.js
function _typeof13(o) {
  "@babel/helpers - typeof";
  return _typeof13 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
    return typeof o2;
  } : function(o2) {
    return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
  }, _typeof13(o);
}
function ownKeys9(e3, r3) {
  var t3 = Object.keys(e3);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e3);
    r3 && (o = o.filter(function(r4) {
      return Object.getOwnPropertyDescriptor(e3, r4).enumerable;
    })), t3.push.apply(t3, o);
  }
  return t3;
}
function _objectSpread9(e3) {
  for (var r3 = 1; r3 < arguments.length; r3++) {
    var t3 = null != arguments[r3] ? arguments[r3] : {};
    r3 % 2 ? ownKeys9(Object(t3), true).forEach(function(r4) {
      _defineProperty9(e3, r4, t3[r4]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e3, Object.getOwnPropertyDescriptors(t3)) : ownKeys9(Object(t3)).forEach(function(r4) {
      Object.defineProperty(e3, r4, Object.getOwnPropertyDescriptor(t3, r4));
    });
  }
  return e3;
}
function _classCallCheck5(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties5(target, props) {
  for (var i2 = 0; i2 < props.length; i2++) {
    var descriptor = props[i2];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor)
      descriptor.writable = true;
    Object.defineProperty(target, _toPropertyKey9(descriptor.key), descriptor);
  }
}
function _createClass5(Constructor, protoProps, staticProps) {
  if (protoProps)
    _defineProperties5(Constructor.prototype, protoProps);
  if (staticProps)
    _defineProperties5(Constructor, staticProps);
  Object.defineProperty(Constructor, "prototype", { writable: false });
  return Constructor;
}
function _inherits5(subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function");
  }
  subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
  Object.defineProperty(subClass, "prototype", { writable: false });
  if (superClass)
    _setPrototypeOf7(subClass, superClass);
}
function _setPrototypeOf7(o, p) {
  _setPrototypeOf7 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf19(o2, p2) {
    o2.__proto__ = p2;
    return o2;
  };
  return _setPrototypeOf7(o, p);
}
function _createSuper5(Derived) {
  var hasNativeReflectConstruct = _isNativeReflectConstruct6();
  return function _createSuperInternal() {
    var Super = _getPrototypeOf6(Derived), result;
    if (hasNativeReflectConstruct) {
      var NewTarget = _getPrototypeOf6(this).constructor;
      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }
    return _possibleConstructorReturn5(this, result);
  };
}
function _possibleConstructorReturn5(self2, call) {
  if (call && (_typeof13(call) === "object" || typeof call === "function")) {
    return call;
  } else if (call !== void 0) {
    throw new TypeError("Derived constructors may only return object or undefined");
  }
  return _assertThisInitialized7(self2);
}
function _assertThisInitialized7(self2) {
  if (self2 === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }
  return self2;
}
function _isNativeReflectConstruct6() {
  if (typeof Reflect === "undefined" || !Reflect.construct)
    return false;
  if (Reflect.construct.sham)
    return false;
  if (typeof Proxy === "function")
    return true;
  try {
    Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
    return true;
  } catch (e3) {
    return false;
  }
}
function _getPrototypeOf6(o) {
  _getPrototypeOf6 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf18(o2) {
    return o2.__proto__ || Object.getPrototypeOf(o2);
  };
  return _getPrototypeOf6(o);
}
function _defineProperty9(obj, key, value) {
  key = _toPropertyKey9(key);
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
function _toPropertyKey9(arg) {
  var key = _toPrimitive9(arg, "string");
  return _typeof13(key) === "symbol" ? key : String(key);
}
function _toPrimitive9(input, hint) {
  if (_typeof13(input) !== "object" || input === null)
    return input;
  var prim = input[Symbol.toPrimitive];
  if (prim !== void 0) {
    var res = prim.call(input, hint || "default");
    if (_typeof13(res) !== "object")
      return res;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (hint === "string" ? String : Number)(input);
}
var CLS_PREFIX = "recharts-tooltip-wrapper";
var EPS2 = 1;
function defaultUniqBy2(entry) {
  return entry.dataKey;
}
function getUniqPayload2(option, payload) {
  if (option === true) {
    return (0, import_uniqBy2.default)(payload, defaultUniqBy2);
  }
  if ((0, import_isFunction4.default)(option)) {
    return (0, import_uniqBy2.default)(payload, option);
  }
  return payload;
}
function renderContent2(content2, props) {
  if (/* @__PURE__ */ import_react87.default.isValidElement(content2)) {
    return /* @__PURE__ */ import_react87.default.cloneElement(content2, props);
  }
  if ((0, import_isFunction4.default)(content2)) {
    return /* @__PURE__ */ import_react87.default.createElement(content2, props);
  }
  return /* @__PURE__ */ import_react87.default.createElement(DefaultTooltipContent, props);
}
var Tooltip2 = /* @__PURE__ */ function(_PureComponent) {
  _inherits5(Tooltip3, _PureComponent);
  var _super = _createSuper5(Tooltip3);
  function Tooltip3() {
    var _this;
    _classCallCheck5(this, Tooltip3);
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    _this = _super.call.apply(_super, [this].concat(args));
    _defineProperty9(_assertThisInitialized7(_this), "state", {
      boxWidth: -1,
      boxHeight: -1,
      dismissed: false,
      dismissedAtCoordinate: {
        x: 0,
        y: 0
      }
    });
    _defineProperty9(_assertThisInitialized7(_this), "handleKeyDown", function(event) {
      if (event.key === "Escape") {
        _this.setState({
          dismissed: true,
          dismissedAtCoordinate: _objectSpread9(_objectSpread9({}, _this.state.dismissedAtCoordinate), {}, {
            x: _this.props.coordinate.x,
            y: _this.props.coordinate.y
          })
        });
      }
    });
    _defineProperty9(_assertThisInitialized7(_this), "getTranslate", function(_ref18) {
      var key = _ref18.key, tooltipDimension = _ref18.tooltipDimension, viewBoxDimension = _ref18.viewBoxDimension;
      var _this$props = _this.props, allowEscapeViewBox = _this$props.allowEscapeViewBox, reverseDirection = _this$props.reverseDirection, coordinate = _this$props.coordinate, offset = _this$props.offset, position2 = _this$props.position, viewBox = _this$props.viewBox;
      if (position2 && isNumber(position2[key])) {
        return position2[key];
      }
      var negative = coordinate[key] - tooltipDimension - offset;
      var positive = coordinate[key] + offset;
      if (allowEscapeViewBox[key]) {
        return reverseDirection[key] ? negative : positive;
      }
      if (reverseDirection[key]) {
        var _tooltipBoundary = negative;
        var _viewBoxBoundary = viewBox[key];
        if (_tooltipBoundary < _viewBoxBoundary) {
          return Math.max(positive, viewBox[key]);
        }
        return Math.max(negative, viewBox[key]);
      }
      var tooltipBoundary = positive + tooltipDimension;
      var viewBoxBoundary = viewBox[key] + viewBoxDimension;
      if (tooltipBoundary > viewBoxBoundary) {
        return Math.max(negative, viewBox[key]);
      }
      return Math.max(positive, viewBox[key]);
    });
    return _this;
  }
  _createClass5(Tooltip3, [{
    key: "componentDidMount",
    value: function componentDidMount() {
      this.updateBBox();
    }
  }, {
    key: "componentWillUnmount",
    value: function componentWillUnmount() {
      document.removeEventListener("keydown", this.handleKeyDown);
    }
  }, {
    key: "componentDidUpdate",
    value: function componentDidUpdate() {
      this.updateBBox();
    }
  }, {
    key: "updateBBox",
    value: function updateBBox() {
      var _this$state = this.state, boxWidth = _this$state.boxWidth, boxHeight = _this$state.boxHeight, dismissed = _this$state.dismissed;
      if (dismissed) {
        document.removeEventListener("keydown", this.handleKeyDown);
        if (this.props.coordinate.x !== this.state.dismissedAtCoordinate.x || this.props.coordinate.y !== this.state.dismissedAtCoordinate.y) {
          this.setState({
            dismissed: false
          });
        }
      } else {
        document.addEventListener("keydown", this.handleKeyDown);
      }
      if (this.wrapperNode && this.wrapperNode.getBoundingClientRect) {
        var box = this.wrapperNode.getBoundingClientRect();
        if (Math.abs(box.width - boxWidth) > EPS2 || Math.abs(box.height - boxHeight) > EPS2) {
          this.setState({
            boxWidth: box.width,
            boxHeight: box.height
          });
        }
      } else if (boxWidth !== -1 || boxHeight !== -1) {
        this.setState({
          boxWidth: -1,
          boxHeight: -1
        });
      }
    }
  }, {
    key: "render",
    value: function render2() {
      var _classNames, _this2 = this;
      var _this$props2 = this.props, payload = _this$props2.payload, isAnimationActive = _this$props2.isAnimationActive, animationDuration = _this$props2.animationDuration, animationEasing = _this$props2.animationEasing, filterNull = _this$props2.filterNull, payloadUniqBy = _this$props2.payloadUniqBy;
      var finalPayload = getUniqPayload2(payloadUniqBy, filterNull && payload && payload.length ? payload.filter(function(entry) {
        return !(0, import_isNil3.default)(entry.value);
      }) : payload);
      var hasPayload = finalPayload && finalPayload.length;
      var _this$props3 = this.props, content2 = _this$props3.content, viewBox = _this$props3.viewBox, coordinate = _this$props3.coordinate, position2 = _this$props3.position, active = _this$props3.active, wrapperStyle = _this$props3.wrapperStyle;
      var outerStyle = _objectSpread9({
        pointerEvents: "none",
        visibility: !this.state.dismissed && active && hasPayload ? "visible" : "hidden",
        position: "absolute",
        top: 0,
        left: 0
      }, wrapperStyle);
      var translateX, translateY;
      if (position2 && isNumber(position2.x) && isNumber(position2.y)) {
        translateX = position2.x;
        translateY = position2.y;
      } else {
        var _this$state2 = this.state, boxWidth = _this$state2.boxWidth, boxHeight = _this$state2.boxHeight;
        if (boxWidth > 0 && boxHeight > 0 && coordinate) {
          translateX = this.getTranslate({
            key: "x",
            tooltipDimension: boxWidth,
            viewBoxDimension: viewBox.width
          });
          translateY = this.getTranslate({
            key: "y",
            tooltipDimension: boxHeight,
            viewBoxDimension: viewBox.height
          });
        } else {
          outerStyle.visibility = "hidden";
        }
      }
      outerStyle = _objectSpread9(_objectSpread9({}, translateStyle({
        transform: this.props.useTranslate3d ? "translate3d(".concat(translateX, "px, ").concat(translateY, "px, 0)") : "translate(".concat(translateX, "px, ").concat(translateY, "px)")
      })), outerStyle);
      if (isAnimationActive && active) {
        outerStyle = _objectSpread9(_objectSpread9({}, translateStyle({
          transition: "transform ".concat(animationDuration, "ms ").concat(animationEasing)
        })), outerStyle);
      }
      var cls = (0, import_classnames6.default)(CLS_PREFIX, (_classNames = {}, _defineProperty9(_classNames, "".concat(CLS_PREFIX, "-right"), isNumber(translateX) && coordinate && isNumber(coordinate.x) && translateX >= coordinate.x), _defineProperty9(_classNames, "".concat(CLS_PREFIX, "-left"), isNumber(translateX) && coordinate && isNumber(coordinate.x) && translateX < coordinate.x), _defineProperty9(_classNames, "".concat(CLS_PREFIX, "-bottom"), isNumber(translateY) && coordinate && isNumber(coordinate.y) && translateY >= coordinate.y), _defineProperty9(_classNames, "".concat(CLS_PREFIX, "-top"), isNumber(translateY) && coordinate && isNumber(coordinate.y) && translateY < coordinate.y), _classNames));
      return (
        // ESLint is disabled to allow listening to the `Escape` key. Refer to
        // https://github.com/recharts/recharts/pull/2925
        // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions
        /* @__PURE__ */ import_react87.default.createElement("div", {
          tabIndex: -1,
          role: "dialog",
          className: cls,
          style: outerStyle,
          ref: function ref(node56) {
            _this2.wrapperNode = node56;
          }
        }, renderContent2(content2, _objectSpread9(_objectSpread9({}, this.props), {}, {
          payload: finalPayload
        })))
      );
    }
  }]);
  return Tooltip3;
}(import_react87.PureComponent);
_defineProperty9(Tooltip2, "displayName", "Tooltip");
_defineProperty9(Tooltip2, "defaultProps", {
  active: false,
  allowEscapeViewBox: {
    x: false,
    y: false
  },
  reverseDirection: {
    x: false,
    y: false
  },
  offset: 10,
  viewBox: {
    x: 0,
    y: 0,
    height: 0,
    width: 0
  },
  coordinate: {
    x: 0,
    y: 0
  },
  cursorStyle: {},
  separator: " : ",
  wrapperStyle: {},
  contentStyle: {},
  itemStyle: {},
  labelStyle: {},
  cursor: true,
  trigger: "hover",
  isAnimationActive: !Global2.isSsr,
  animationEasing: "ease",
  animationDuration: 400,
  filterNull: true,
  useTranslate3d: false
});

// node_modules/recharts/es6/component/ResponsiveContainer.js
var import_classnames7 = __toESM(require_classnames());
var import_react89 = __toESM(require_react());

// node_modules/react-resize-detector/build/index.esm.js
var import_react88 = __toESM(require_react());
var import_react_dom6 = __toESM(require_react_dom());
var import_debounce2 = __toESM(require_debounce2());
var import_throttle = __toESM(require_throttle());
var extendStatics = function(d, b) {
  extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
    d2.__proto__ = b2;
  } || function(d2, b2) {
    for (var p in b2)
      if (b2.hasOwnProperty(p))
        d2[p] = b2[p];
  };
  return extendStatics(d, b);
};
function __extends(d, b) {
  extendStatics(d, b);
  function __() {
    this.constructor = d;
  }
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
}
function __rest(s2, e3) {
  var t3 = {};
  for (var p in s2)
    if (Object.prototype.hasOwnProperty.call(s2, p) && e3.indexOf(p) < 0)
      t3[p] = s2[p];
  if (s2 != null && typeof Object.getOwnPropertySymbols === "function")
    for (var i2 = 0, p = Object.getOwnPropertySymbols(s2); i2 < p.length; i2++) {
      if (e3.indexOf(p[i2]) < 0 && Object.prototype.propertyIsEnumerable.call(s2, p[i2]))
        t3[p[i2]] = s2[p[i2]];
    }
  return t3;
}
var patchResizeHandler = function(resizeCallback, refreshMode, refreshRate, refreshOptions) {
  switch (refreshMode) {
    case "debounce":
      return (0, import_debounce2.default)(resizeCallback, refreshRate, refreshOptions);
    case "throttle":
      return (0, import_throttle.default)(resizeCallback, refreshRate, refreshOptions);
    default:
      return resizeCallback;
  }
};
var isFunction2 = function(fn) {
  return typeof fn === "function";
};
var isSSR3 = function() {
  return typeof window === "undefined";
};
var isDOMElement = function(element2) {
  return element2 instanceof Element || element2 instanceof HTMLDocument;
};
var createNotifier = function(setSize, handleWidth, handleHeight) {
  return function(_a2) {
    var width = _a2.width, height = _a2.height;
    setSize(function(prev2) {
      if (prev2.width === width && prev2.height === height) {
        return prev2;
      }
      if (prev2.width === width && !handleHeight || prev2.height === height && !handleWidth) {
        return prev2;
      }
      return { width, height };
    });
  };
};
var ResizeDetector = (
  /** @class */
  function(_super) {
    __extends(ResizeDetector2, _super);
    function ResizeDetector2(props) {
      var _this = _super.call(this, props) || this;
      _this.cancelHandler = function() {
        if (_this.resizeHandler && _this.resizeHandler.cancel) {
          _this.resizeHandler.cancel();
          _this.resizeHandler = null;
        }
      };
      _this.attachObserver = function() {
        var _a3 = _this.props, targetRef = _a3.targetRef, observerOptions = _a3.observerOptions;
        if (isSSR3()) {
          return;
        }
        if (targetRef && targetRef.current) {
          _this.targetRef.current = targetRef.current;
        }
        var element2 = _this.getElement();
        if (!element2) {
          return;
        }
        if (_this.observableElement && _this.observableElement === element2) {
          return;
        }
        _this.observableElement = element2;
        _this.resizeObserver.observe(element2, observerOptions);
      };
      _this.getElement = function() {
        var _a3 = _this.props, querySelector = _a3.querySelector, targetDomEl = _a3.targetDomEl;
        if (isSSR3())
          return null;
        if (querySelector)
          return document.querySelector(querySelector);
        if (targetDomEl && isDOMElement(targetDomEl))
          return targetDomEl;
        if (_this.targetRef && isDOMElement(_this.targetRef.current))
          return _this.targetRef.current;
        var currentElement = (0, import_react_dom6.findDOMNode)(_this);
        if (!currentElement)
          return null;
        var renderType = _this.getRenderType();
        switch (renderType) {
          case "renderProp":
            return currentElement;
          case "childFunction":
            return currentElement;
          case "child":
            return currentElement;
          case "childArray":
            return currentElement;
          default:
            return currentElement.parentElement;
        }
      };
      _this.createResizeHandler = function(entries) {
        var _a3 = _this.props, _b = _a3.handleWidth, handleWidth = _b === void 0 ? true : _b, _c = _a3.handleHeight, handleHeight = _c === void 0 ? true : _c, onResize = _a3.onResize;
        if (!handleWidth && !handleHeight)
          return;
        var notifyResize = createNotifier(function(setStateFunc) {
          return _this.setState(setStateFunc, function() {
            return onResize === null || onResize === void 0 ? void 0 : onResize(_this.state.width, _this.state.height);
          });
        }, handleWidth, handleHeight);
        entries.forEach(function(entry) {
          var _a4 = entry && entry.contentRect || {}, width = _a4.width, height = _a4.height;
          var shouldSetSize = !_this.skipOnMount && !isSSR3();
          if (shouldSetSize) {
            notifyResize({ width, height });
          }
          _this.skipOnMount = false;
        });
      };
      _this.getRenderType = function() {
        var _a3 = _this.props, render2 = _a3.render, children = _a3.children;
        if (isFunction2(render2)) {
          return "renderProp";
        }
        if (isFunction2(children)) {
          return "childFunction";
        }
        if ((0, import_react88.isValidElement)(children)) {
          return "child";
        }
        if (Array.isArray(children)) {
          return "childArray";
        }
        return "parent";
      };
      var skipOnMount = props.skipOnMount, refreshMode = props.refreshMode, _a2 = props.refreshRate, refreshRate = _a2 === void 0 ? 1e3 : _a2, refreshOptions = props.refreshOptions;
      _this.state = {
        width: void 0,
        height: void 0
      };
      _this.skipOnMount = skipOnMount;
      _this.targetRef = (0, import_react88.createRef)();
      _this.observableElement = null;
      if (isSSR3()) {
        return _this;
      }
      _this.resizeHandler = patchResizeHandler(_this.createResizeHandler, refreshMode, refreshRate, refreshOptions);
      _this.resizeObserver = new window.ResizeObserver(_this.resizeHandler);
      return _this;
    }
    ResizeDetector2.prototype.componentDidMount = function() {
      this.attachObserver();
    };
    ResizeDetector2.prototype.componentDidUpdate = function() {
      this.attachObserver();
    };
    ResizeDetector2.prototype.componentWillUnmount = function() {
      if (isSSR3()) {
        return;
      }
      this.observableElement = null;
      this.resizeObserver.disconnect();
      this.cancelHandler();
    };
    ResizeDetector2.prototype.render = function() {
      var _a2 = this.props, render2 = _a2.render, children = _a2.children, _b = _a2.nodeType, WrapperTag = _b === void 0 ? "div" : _b;
      var _c = this.state, width = _c.width, height = _c.height;
      var childProps = { width, height, targetRef: this.targetRef };
      var renderType = this.getRenderType();
      switch (renderType) {
        case "renderProp":
          return render2 === null || render2 === void 0 ? void 0 : render2(childProps);
        case "childFunction": {
          var childFunction = children;
          return childFunction === null || childFunction === void 0 ? void 0 : childFunction(childProps);
        }
        case "child": {
          var child = children;
          if (child.type && typeof child.type === "string") {
            childProps.targetRef;
            var nativeProps = __rest(childProps, ["targetRef"]);
            return (0, import_react88.cloneElement)(child, nativeProps);
          }
          return (0, import_react88.cloneElement)(child, childProps);
        }
        case "childArray": {
          var childArray = children;
          return childArray.map(function(el) {
            return !!el && (0, import_react88.cloneElement)(el, childProps);
          });
        }
        default:
          return import_react88.default.createElement(WrapperTag, null);
      }
    };
    return ResizeDetector2;
  }(import_react88.PureComponent)
);
var useEnhancedEffect = isSSR3() ? import_react88.useEffect : import_react88.useLayoutEffect;

// node_modules/recharts/es6/component/ResponsiveContainer.js
function _typeof14(o) {
  "@babel/helpers - typeof";
  return _typeof14 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
    return typeof o2;
  } : function(o2) {
    return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
  }, _typeof14(o);
}
function _extends13() {
  _extends13 = Object.assign ? Object.assign.bind() : function(target) {
    for (var i2 = 1; i2 < arguments.length; i2++) {
      var source = arguments[i2];
      for (var key in source) {
        if (Object.prototype.hasOwnProperty.call(source, key)) {
          target[key] = source[key];
        }
      }
    }
    return target;
  };
  return _extends13.apply(this, arguments);
}
function ownKeys10(e3, r3) {
  var t3 = Object.keys(e3);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e3);
    r3 && (o = o.filter(function(r4) {
      return Object.getOwnPropertyDescriptor(e3, r4).enumerable;
    })), t3.push.apply(t3, o);
  }
  return t3;
}
function _objectSpread10(e3) {
  for (var r3 = 1; r3 < arguments.length; r3++) {
    var t3 = null != arguments[r3] ? arguments[r3] : {};
    r3 % 2 ? ownKeys10(Object(t3), true).forEach(function(r4) {
      _defineProperty10(e3, r4, t3[r4]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e3, Object.getOwnPropertyDescriptors(t3)) : ownKeys10(Object(t3)).forEach(function(r4) {
      Object.defineProperty(e3, r4, Object.getOwnPropertyDescriptor(t3, r4));
    });
  }
  return e3;
}
function _defineProperty10(obj, key, value) {
  key = _toPropertyKey10(key);
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
function _toPropertyKey10(arg) {
  var key = _toPrimitive10(arg, "string");
  return _typeof14(key) === "symbol" ? key : String(key);
}
function _toPrimitive10(input, hint) {
  if (_typeof14(input) !== "object" || input === null)
    return input;
  var prim = input[Symbol.toPrimitive];
  if (prim !== void 0) {
    var res = prim.call(input, hint || "default");
    if (_typeof14(res) !== "object")
      return res;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (hint === "string" ? String : Number)(input);
}
function _slicedToArray4(arr, i2) {
  return _arrayWithHoles5(arr) || _iterableToArrayLimit4(arr, i2) || _unsupportedIterableToArray7(arr, i2) || _nonIterableRest5();
}
function _nonIterableRest5() {
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _unsupportedIterableToArray7(o, minLen) {
  if (!o)
    return;
  if (typeof o === "string")
    return _arrayLikeToArray7(o, minLen);
  var n2 = Object.prototype.toString.call(o).slice(8, -1);
  if (n2 === "Object" && o.constructor)
    n2 = o.constructor.name;
  if (n2 === "Map" || n2 === "Set")
    return Array.from(o);
  if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2))
    return _arrayLikeToArray7(o, minLen);
}
function _arrayLikeToArray7(arr, len) {
  if (len == null || len > arr.length)
    len = arr.length;
  for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++)
    arr2[i2] = arr[i2];
  return arr2;
}
function _iterableToArrayLimit4(r3, l) {
  var t3 = null == r3 ? null : "undefined" != typeof Symbol && r3[Symbol.iterator] || r3["@@iterator"];
  if (null != t3) {
    var e3, n2, i2, u, a2 = [], f = true, o = false;
    try {
      if (i2 = (t3 = t3.call(r3)).next, 0 === l) {
        if (Object(t3) !== t3)
          return;
        f = false;
      } else
        for (; !(f = (e3 = i2.call(t3)).done) && (a2.push(e3.value), a2.length !== l); f = true)
          ;
    } catch (r4) {
      o = true, n2 = r4;
    } finally {
      try {
        if (!f && null != t3["return"] && (u = t3["return"](), Object(u) !== u))
          return;
      } finally {
        if (o)
          throw n2;
      }
    }
    return a2;
  }
}
function _arrayWithHoles5(arr) {
  if (Array.isArray(arr))
    return arr;
}
var ResponsiveContainer = /* @__PURE__ */ (0, import_react89.forwardRef)(function(_ref18, ref) {
  var aspect2 = _ref18.aspect, _ref$initialDimension = _ref18.initialDimension, initialDimension = _ref$initialDimension === void 0 ? {
    width: -1,
    height: -1
  } : _ref$initialDimension, _ref$width = _ref18.width, width = _ref$width === void 0 ? "100%" : _ref$width, _ref$height = _ref18.height, height = _ref$height === void 0 ? "100%" : _ref$height, _ref$minWidth = _ref18.minWidth, minWidth = _ref$minWidth === void 0 ? 0 : _ref$minWidth, minHeight = _ref18.minHeight, maxHeight = _ref18.maxHeight, children = _ref18.children, _ref$debounce = _ref18.debounce, debounce4 = _ref$debounce === void 0 ? 0 : _ref$debounce, id2 = _ref18.id, className = _ref18.className, onResize = _ref18.onResize, _ref$style = _ref18.style, style = _ref$style === void 0 ? {} : _ref$style;
  var _useState = (0, import_react89.useState)({
    containerWidth: initialDimension.width,
    containerHeight: initialDimension.height
  }), _useState2 = _slicedToArray4(_useState, 2), sizes2 = _useState2[0], setSizes = _useState2[1];
  var containerRef = (0, import_react89.useRef)(null);
  (0, import_react89.useImperativeHandle)(ref, function() {
    return containerRef;
  }, [containerRef]);
  var getContainerSize = (0, import_react89.useCallback)(function() {
    if (!containerRef.current) {
      return null;
    }
    return {
      containerWidth: containerRef.current.clientWidth,
      containerHeight: containerRef.current.clientHeight
    };
  }, []);
  var updateDimensionsImmediate = (0, import_react89.useCallback)(function() {
    var newSize = getContainerSize();
    if (newSize) {
      var containerWidth = newSize.containerWidth, containerHeight = newSize.containerHeight;
      if (onResize)
        onResize(containerWidth, containerHeight);
      setSizes(function(currentSizes) {
        var oldWidth = currentSizes.containerWidth, oldHeight = currentSizes.containerHeight;
        if (containerWidth !== oldWidth || containerHeight !== oldHeight) {
          return {
            containerWidth,
            containerHeight
          };
        }
        return currentSizes;
      });
    }
  }, [getContainerSize, onResize]);
  var chartContent = (0, import_react89.useMemo)(function() {
    var containerWidth = sizes2.containerWidth, containerHeight = sizes2.containerHeight;
    if (containerWidth < 0 || containerHeight < 0) {
      return null;
    }
    warn(isPercent(width) || isPercent(height), "The width(%s) and height(%s) are both fixed numbers,\n       maybe you don't need to use a ResponsiveContainer.", width, height);
    warn(!aspect2 || aspect2 > 0, "The aspect(%s) must be greater than zero.", aspect2);
    var calculatedWidth = isPercent(width) ? containerWidth : width;
    var calculatedHeight = isPercent(height) ? containerHeight : height;
    if (aspect2 && aspect2 > 0) {
      if (calculatedWidth) {
        calculatedHeight = calculatedWidth / aspect2;
      } else if (calculatedHeight) {
        calculatedWidth = calculatedHeight * aspect2;
      }
      if (maxHeight && calculatedHeight > maxHeight) {
        calculatedHeight = maxHeight;
      }
    }
    warn(calculatedWidth > 0 || calculatedHeight > 0, "The width(%s) and height(%s) of chart should be greater than 0,\n       please check the style of container, or the props width(%s) and height(%s),\n       or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the\n       height and width.", calculatedWidth, calculatedHeight, width, height, minWidth, minHeight, aspect2);
    return /* @__PURE__ */ (0, import_react89.cloneElement)(children, {
      width: calculatedWidth,
      height: calculatedHeight
    });
  }, [aspect2, children, height, maxHeight, minHeight, minWidth, sizes2, width]);
  (0, import_react89.useEffect)(function() {
    var size = getContainerSize();
    if (size) {
      setSizes(size);
    }
  }, [getContainerSize]);
  var styles = _objectSpread10(_objectSpread10({}, style), {}, {
    width,
    height,
    minWidth,
    minHeight,
    maxHeight
  });
  return /* @__PURE__ */ import_react89.default.createElement(ResizeDetector, {
    handleWidth: true,
    handleHeight: true,
    onResize: updateDimensionsImmediate,
    targetRef: containerRef,
    refreshMode: debounce4 > 0 ? "debounce" : void 0,
    refreshRate: debounce4
  }, /* @__PURE__ */ import_react89.default.createElement("div", _extends13({}, id2 != null ? {
    id: "".concat(id2)
  } : {}, {
    className: (0, import_classnames7.default)("recharts-responsive-container", className),
    style: styles,
    ref: containerRef
  }), chartContent));
});

// node_modules/recharts/es6/component/Cell.js
var Cell = function Cell2(_props) {
  return null;
};
Cell.displayName = "Cell";

// node_modules/recharts/es6/component/Text.js
var import_isNil4 = __toESM(require_isNil());
var import_react90 = __toESM(require_react());
var import_classnames8 = __toESM(require_classnames());

// node_modules/recharts/es6/util/DOMUtils.js
function _typeof15(o) {
  "@babel/helpers - typeof";
  return _typeof15 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
    return typeof o2;
  } : function(o2) {
    return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
  }, _typeof15(o);
}
function ownKeys11(e3, r3) {
  var t3 = Object.keys(e3);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e3);
    r3 && (o = o.filter(function(r4) {
      return Object.getOwnPropertyDescriptor(e3, r4).enumerable;
    })), t3.push.apply(t3, o);
  }
  return t3;
}
function _objectSpread11(e3) {
  for (var r3 = 1; r3 < arguments.length; r3++) {
    var t3 = null != arguments[r3] ? arguments[r3] : {};
    r3 % 2 ? ownKeys11(Object(t3), true).forEach(function(r4) {
      _defineProperty11(e3, r4, t3[r4]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e3, Object.getOwnPropertyDescriptors(t3)) : ownKeys11(Object(t3)).forEach(function(r4) {
      Object.defineProperty(e3, r4, Object.getOwnPropertyDescriptor(t3, r4));
    });
  }
  return e3;
}
function _defineProperty11(obj, key, value) {
  key = _toPropertyKey11(key);
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
function _toPropertyKey11(arg) {
  var key = _toPrimitive11(arg, "string");
  return _typeof15(key) === "symbol" ? key : String(key);
}
function _toPrimitive11(input, hint) {
  if (_typeof15(input) !== "object" || input === null)
    return input;
  var prim = input[Symbol.toPrimitive];
  if (prim !== void 0) {
    var res = prim.call(input, hint || "default");
    if (_typeof15(res) !== "object")
      return res;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (hint === "string" ? String : Number)(input);
}
function _toConsumableArray4(arr) {
  return _arrayWithoutHoles4(arr) || _iterableToArray5(arr) || _unsupportedIterableToArray8(arr) || _nonIterableSpread4();
}
function _nonIterableSpread4() {
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _unsupportedIterableToArray8(o, minLen) {
  if (!o)
    return;
  if (typeof o === "string")
    return _arrayLikeToArray8(o, minLen);
  var n2 = Object.prototype.toString.call(o).slice(8, -1);
  if (n2 === "Object" && o.constructor)
    n2 = o.constructor.name;
  if (n2 === "Map" || n2 === "Set")
    return Array.from(o);
  if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2))
    return _arrayLikeToArray8(o, minLen);
}
function _iterableToArray5(iter) {
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
    return Array.from(iter);
}
function _arrayWithoutHoles4(arr) {
  if (Array.isArray(arr))
    return _arrayLikeToArray8(arr);
}
function _arrayLikeToArray8(arr, len) {
  if (len == null || len > arr.length)
    len = arr.length;
  for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++)
    arr2[i2] = arr[i2];
  return arr2;
}
var stringCache = {
  widthCache: {},
  cacheCount: 0
};
var MAX_CACHE_NUM = 2e3;
var SPAN_STYLE = {
  position: "absolute",
  top: "-20000px",
  left: 0,
  padding: 0,
  margin: 0,
  border: "none",
  whiteSpace: "pre"
};
var STYLE_LIST = ["minWidth", "maxWidth", "width", "minHeight", "maxHeight", "height", "top", "left", "fontSize", "lineHeight", "padding", "margin", "paddingLeft", "paddingRight", "paddingTop", "paddingBottom", "marginLeft", "marginRight", "marginTop", "marginBottom"];
var MEASUREMENT_SPAN_ID = "recharts_measurement_span";
function autoCompleteStyle(name2, value) {
  if (STYLE_LIST.indexOf(name2) >= 0 && value === +value) {
    return "".concat(value, "px");
  }
  return value;
}
function camelToMiddleLine(text2) {
  var strs = text2.split("");
  var formatStrs = strs.reduce(function(result, entry) {
    if (entry === entry.toUpperCase()) {
      return [].concat(_toConsumableArray4(result), ["-", entry.toLowerCase()]);
    }
    return [].concat(_toConsumableArray4(result), [entry]);
  }, []);
  return formatStrs.join("");
}
var getStyleString = function getStyleString2(style) {
  return Object.keys(style).reduce(function(result, s2) {
    return "".concat(result).concat(camelToMiddleLine(s2), ":").concat(autoCompleteStyle(s2, style[s2]), ";");
  }, "");
};
var getStringSize = function getStringSize2(text2) {
  var style = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
  if (text2 === void 0 || text2 === null || Global2.isSsr) {
    return {
      width: 0,
      height: 0
    };
  }
  var str = "".concat(text2);
  var styleString = getStyleString(style);
  var cacheKey = "".concat(str, "-").concat(styleString);
  if (stringCache.widthCache[cacheKey]) {
    return stringCache.widthCache[cacheKey];
  }
  try {
    var measurementSpan = document.getElementById(MEASUREMENT_SPAN_ID);
    if (!measurementSpan) {
      measurementSpan = document.createElement("span");
      measurementSpan.setAttribute("id", MEASUREMENT_SPAN_ID);
      measurementSpan.setAttribute("aria-hidden", "true");
      document.body.appendChild(measurementSpan);
    }
    var measurementSpanStyle = _objectSpread11(_objectSpread11({}, SPAN_STYLE), style);
    Object.keys(measurementSpanStyle).map(function(styleKey) {
      measurementSpan.style[styleKey] = measurementSpanStyle[styleKey];
      return styleKey;
    });
    measurementSpan.textContent = str;
    var rect = measurementSpan.getBoundingClientRect();
    var result = {
      width: rect.width,
      height: rect.height
    };
    stringCache.widthCache[cacheKey] = result;
    if (++stringCache.cacheCount > MAX_CACHE_NUM) {
      stringCache.cacheCount = 0;
      stringCache.widthCache = {};
    }
    return result;
  } catch (e3) {
    return {
      width: 0,
      height: 0
    };
  }
};
var getOffset = function getOffset2(el) {
  var html = el.ownerDocument.documentElement;
  var box = {
    top: 0,
    left: 0
  };
  if (typeof el.getBoundingClientRect !== "undefined") {
    box = el.getBoundingClientRect();
  }
  return {
    top: box.top + window.pageYOffset - html.clientTop,
    left: box.left + window.pageXOffset - html.clientLeft
  };
};
var calculateChartCoordinate = function calculateChartCoordinate2(event, offset) {
  return {
    chartX: Math.round(event.pageX - offset.left),
    chartY: Math.round(event.pageY - offset.top)
  };
};

// node_modules/recharts/es6/util/ReduceCSSCalc.js
function _typeof16(o) {
  "@babel/helpers - typeof";
  return _typeof16 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
    return typeof o2;
  } : function(o2) {
    return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
  }, _typeof16(o);
}
function _slicedToArray5(arr, i2) {
  return _arrayWithHoles6(arr) || _iterableToArrayLimit5(arr, i2) || _unsupportedIterableToArray9(arr, i2) || _nonIterableRest6();
}
function _nonIterableRest6() {
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _unsupportedIterableToArray9(o, minLen) {
  if (!o)
    return;
  if (typeof o === "string")
    return _arrayLikeToArray9(o, minLen);
  var n2 = Object.prototype.toString.call(o).slice(8, -1);
  if (n2 === "Object" && o.constructor)
    n2 = o.constructor.name;
  if (n2 === "Map" || n2 === "Set")
    return Array.from(o);
  if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2))
    return _arrayLikeToArray9(o, minLen);
}
function _arrayLikeToArray9(arr, len) {
  if (len == null || len > arr.length)
    len = arr.length;
  for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++)
    arr2[i2] = arr[i2];
  return arr2;
}
function _iterableToArrayLimit5(r3, l) {
  var t3 = null == r3 ? null : "undefined" != typeof Symbol && r3[Symbol.iterator] || r3["@@iterator"];
  if (null != t3) {
    var e3, n2, i2, u, a2 = [], f = true, o = false;
    try {
      if (i2 = (t3 = t3.call(r3)).next, 0 === l) {
        if (Object(t3) !== t3)
          return;
        f = false;
      } else
        for (; !(f = (e3 = i2.call(t3)).done) && (a2.push(e3.value), a2.length !== l); f = true)
          ;
    } catch (r4) {
      o = true, n2 = r4;
    } finally {
      try {
        if (!f && null != t3["return"] && (u = t3["return"](), Object(u) !== u))
          return;
      } finally {
        if (o)
          throw n2;
      }
    }
    return a2;
  }
}
function _arrayWithHoles6(arr) {
  if (Array.isArray(arr))
    return arr;
}
function _classCallCheck6(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties6(target, props) {
  for (var i2 = 0; i2 < props.length; i2++) {
    var descriptor = props[i2];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor)
      descriptor.writable = true;
    Object.defineProperty(target, _toPropertyKey12(descriptor.key), descriptor);
  }
}
function _createClass6(Constructor, protoProps, staticProps) {
  if (protoProps)
    _defineProperties6(Constructor.prototype, protoProps);
  if (staticProps)
    _defineProperties6(Constructor, staticProps);
  Object.defineProperty(Constructor, "prototype", { writable: false });
  return Constructor;
}
function _toPropertyKey12(arg) {
  var key = _toPrimitive12(arg, "string");
  return _typeof16(key) === "symbol" ? key : String(key);
}
function _toPrimitive12(input, hint) {
  if (_typeof16(input) !== "object" || input === null)
    return input;
  var prim = input[Symbol.toPrimitive];
  if (prim !== void 0) {
    var res = prim.call(input, hint || "default");
    if (_typeof16(res) !== "object")
      return res;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (hint === "string" ? String : Number)(input);
}
var MULTIPLY_OR_DIVIDE_REGEX = /(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/;
var ADD_OR_SUBTRACT_REGEX = /(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/;
var CSS_LENGTH_UNIT_REGEX = /^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/;
var NUM_SPLIT_REGEX = /(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/;
var CONVERSION_RATES = {
  cm: 96 / 2.54,
  mm: 96 / 25.4,
  pt: 96 / 72,
  pc: 96 / 6,
  "in": 96,
  Q: 96 / (2.54 * 40),
  px: 1
};
var FIXED_CSS_LENGTH_UNITS = Object.keys(CONVERSION_RATES);
var STR_NAN = "NaN";
function convertToPx(value, unit2) {
  return value * CONVERSION_RATES[unit2];
}
var DecimalCSS = /* @__PURE__ */ function() {
  function DecimalCSS2(num, unit2) {
    _classCallCheck6(this, DecimalCSS2);
    this.num = num;
    this.unit = unit2;
    this.num = num;
    this.unit = unit2;
    if (Number.isNaN(num)) {
      this.unit = "";
    }
    if (unit2 !== "" && !CSS_LENGTH_UNIT_REGEX.test(unit2)) {
      this.num = NaN;
      this.unit = "";
    }
    if (FIXED_CSS_LENGTH_UNITS.includes(unit2)) {
      this.num = convertToPx(num, unit2);
      this.unit = "px";
    }
  }
  _createClass6(DecimalCSS2, [{
    key: "add",
    value: function add2(other) {
      if (this.unit !== other.unit) {
        return new DecimalCSS2(NaN, "");
      }
      return new DecimalCSS2(this.num + other.num, this.unit);
    }
  }, {
    key: "subtract",
    value: function subtract(other) {
      if (this.unit !== other.unit) {
        return new DecimalCSS2(NaN, "");
      }
      return new DecimalCSS2(this.num - other.num, this.unit);
    }
  }, {
    key: "multiply",
    value: function multiply(other) {
      if (this.unit !== "" && other.unit !== "" && this.unit !== other.unit) {
        return new DecimalCSS2(NaN, "");
      }
      return new DecimalCSS2(this.num * other.num, this.unit || other.unit);
    }
  }, {
    key: "divide",
    value: function divide(other) {
      if (this.unit !== "" && other.unit !== "" && this.unit !== other.unit) {
        return new DecimalCSS2(NaN, "");
      }
      return new DecimalCSS2(this.num / other.num, this.unit || other.unit);
    }
  }, {
    key: "toString",
    value: function toString2() {
      return "".concat(this.num).concat(this.unit);
    }
  }, {
    key: "isNaN",
    value: function isNaN2() {
      return Number.isNaN(this.num);
    }
  }], [{
    key: "parse",
    value: function parse2(str) {
      var _NUM_SPLIT_REGEX$exec;
      var _ref18 = (_NUM_SPLIT_REGEX$exec = NUM_SPLIT_REGEX.exec(str)) !== null && _NUM_SPLIT_REGEX$exec !== void 0 ? _NUM_SPLIT_REGEX$exec : [], _ref22 = _slicedToArray5(_ref18, 3), numStr = _ref22[1], unit2 = _ref22[2];
      return new DecimalCSS2(parseFloat(numStr), unit2 !== null && unit2 !== void 0 ? unit2 : "");
    }
  }]);
  return DecimalCSS2;
}();
function calculateArithmetic(expr) {
  if (expr.includes(STR_NAN)) {
    return STR_NAN;
  }
  var newExpr = expr;
  while (newExpr.includes("*") || newExpr.includes("/")) {
    var _MULTIPLY_OR_DIVIDE_R;
    var _ref32 = (_MULTIPLY_OR_DIVIDE_R = MULTIPLY_OR_DIVIDE_REGEX.exec(newExpr)) !== null && _MULTIPLY_OR_DIVIDE_R !== void 0 ? _MULTIPLY_OR_DIVIDE_R : [], _ref42 = _slicedToArray5(_ref32, 4), leftOperand = _ref42[1], operator2 = _ref42[2], rightOperand = _ref42[3];
    var lTs = DecimalCSS.parse(leftOperand !== null && leftOperand !== void 0 ? leftOperand : "");
    var rTs = DecimalCSS.parse(rightOperand !== null && rightOperand !== void 0 ? rightOperand : "");
    var result = operator2 === "*" ? lTs.multiply(rTs) : lTs.divide(rTs);
    if (result.isNaN()) {
      return STR_NAN;
    }
    newExpr = newExpr.replace(MULTIPLY_OR_DIVIDE_REGEX, result.toString());
  }
  while (newExpr.includes("+") || /.-\d+(?:\.\d+)?/.test(newExpr)) {
    var _ADD_OR_SUBTRACT_REGE;
    var _ref52 = (_ADD_OR_SUBTRACT_REGE = ADD_OR_SUBTRACT_REGEX.exec(newExpr)) !== null && _ADD_OR_SUBTRACT_REGE !== void 0 ? _ADD_OR_SUBTRACT_REGE : [], _ref62 = _slicedToArray5(_ref52, 4), _leftOperand = _ref62[1], _operator = _ref62[2], _rightOperand = _ref62[3];
    var _lTs = DecimalCSS.parse(_leftOperand !== null && _leftOperand !== void 0 ? _leftOperand : "");
    var _rTs = DecimalCSS.parse(_rightOperand !== null && _rightOperand !== void 0 ? _rightOperand : "");
    var _result = _operator === "+" ? _lTs.add(_rTs) : _lTs.subtract(_rTs);
    if (_result.isNaN()) {
      return STR_NAN;
    }
    newExpr = newExpr.replace(ADD_OR_SUBTRACT_REGEX, _result.toString());
  }
  return newExpr;
}
var PARENTHESES_REGEX = /\(([^()]*)\)/;
function calculateParentheses(expr) {
  var newExpr = expr;
  while (newExpr.includes("(")) {
    var _PARENTHESES_REGEX$ex = PARENTHESES_REGEX.exec(newExpr), _PARENTHESES_REGEX$ex2 = _slicedToArray5(_PARENTHESES_REGEX$ex, 2), parentheticalExpression = _PARENTHESES_REGEX$ex2[1];
    newExpr = newExpr.replace(PARENTHESES_REGEX, calculateArithmetic(parentheticalExpression));
  }
  return newExpr;
}
function evaluateExpression(expression) {
  var newExpr = expression.replace(/\s+/g, "");
  newExpr = calculateParentheses(newExpr);
  newExpr = calculateArithmetic(newExpr);
  return newExpr;
}
function safeEvaluateExpression(expression) {
  try {
    return evaluateExpression(expression);
  } catch (e3) {
    return STR_NAN;
  }
}
function reduceCSSCalc(expression) {
  var result = safeEvaluateExpression(expression.slice(5, -1));
  if (result === STR_NAN) {
    return "";
  }
  return result;
}

// node_modules/recharts/es6/component/Text.js
var _excluded12 = ["x", "y", "lineHeight", "capHeight", "scaleToFit", "textAnchor", "verticalAnchor", "fill"];
var _excluded24 = ["dx", "dy", "angle", "className", "breakAll"];
function _extends14() {
  _extends14 = Object.assign ? Object.assign.bind() : function(target) {
    for (var i2 = 1; i2 < arguments.length; i2++) {
      var source = arguments[i2];
      for (var key in source) {
        if (Object.prototype.hasOwnProperty.call(source, key)) {
          target[key] = source[key];
        }
      }
    }
    return target;
  };
  return _extends14.apply(this, arguments);
}
function _objectWithoutProperties8(source, excluded) {
  if (source == null)
    return {};
  var target = _objectWithoutPropertiesLoose12(source, excluded);
  var key, i2;
  if (Object.getOwnPropertySymbols) {
    var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
    for (i2 = 0; i2 < sourceSymbolKeys.length; i2++) {
      key = sourceSymbolKeys[i2];
      if (excluded.indexOf(key) >= 0)
        continue;
      if (!Object.prototype.propertyIsEnumerable.call(source, key))
        continue;
      target[key] = source[key];
    }
  }
  return target;
}
function _objectWithoutPropertiesLoose12(source, excluded) {
  if (source == null)
    return {};
  var target = {};
  var sourceKeys = Object.keys(source);
  var key, i2;
  for (i2 = 0; i2 < sourceKeys.length; i2++) {
    key = sourceKeys[i2];
    if (excluded.indexOf(key) >= 0)
      continue;
    target[key] = source[key];
  }
  return target;
}
function _slicedToArray6(arr, i2) {
  return _arrayWithHoles7(arr) || _iterableToArrayLimit6(arr, i2) || _unsupportedIterableToArray10(arr, i2) || _nonIterableRest7();
}
function _nonIterableRest7() {
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _unsupportedIterableToArray10(o, minLen) {
  if (!o)
    return;
  if (typeof o === "string")
    return _arrayLikeToArray10(o, minLen);
  var n2 = Object.prototype.toString.call(o).slice(8, -1);
  if (n2 === "Object" && o.constructor)
    n2 = o.constructor.name;
  if (n2 === "Map" || n2 === "Set")
    return Array.from(o);
  if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2))
    return _arrayLikeToArray10(o, minLen);
}
function _arrayLikeToArray10(arr, len) {
  if (len == null || len > arr.length)
    len = arr.length;
  for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++)
    arr2[i2] = arr[i2];
  return arr2;
}
function _iterableToArrayLimit6(r3, l) {
  var t3 = null == r3 ? null : "undefined" != typeof Symbol && r3[Symbol.iterator] || r3["@@iterator"];
  if (null != t3) {
    var e3, n2, i2, u, a2 = [], f = true, o = false;
    try {
      if (i2 = (t3 = t3.call(r3)).next, 0 === l) {
        if (Object(t3) !== t3)
          return;
        f = false;
      } else
        for (; !(f = (e3 = i2.call(t3)).done) && (a2.push(e3.value), a2.length !== l); f = true)
          ;
    } catch (r4) {
      o = true, n2 = r4;
    } finally {
      try {
        if (!f && null != t3["return"] && (u = t3["return"](), Object(u) !== u))
          return;
      } finally {
        if (o)
          throw n2;
      }
    }
    return a2;
  }
}
function _arrayWithHoles7(arr) {
  if (Array.isArray(arr))
    return arr;
}
var BREAKING_SPACES = /[ \f\n\r\t\v\u2028\u2029]+/;
var calculateWordWidths = function calculateWordWidths2(_ref18) {
  var children = _ref18.children, breakAll = _ref18.breakAll, style = _ref18.style;
  try {
    var words = [];
    if (!(0, import_isNil4.default)(children)) {
      if (breakAll) {
        words = children.toString().split("");
      } else {
        words = children.toString().split(BREAKING_SPACES);
      }
    }
    var wordsWithComputedWidth = words.map(function(word) {
      return {
        word,
        width: getStringSize(word, style).width
      };
    });
    var spaceWidth = breakAll ? 0 : getStringSize("\xA0", style).width;
    return {
      wordsWithComputedWidth,
      spaceWidth
    };
  } catch (e3) {
    return null;
  }
};
var calculateWordsByLines = function calculateWordsByLines2(_ref22, initialWordsWithComputedWith, spaceWidth, lineWidth2, scaleToFit) {
  var maxLines = _ref22.maxLines, children = _ref22.children, style = _ref22.style, breakAll = _ref22.breakAll;
  var shouldLimitLines = isNumber(maxLines);
  var text2 = children;
  var calculate = function calculate2() {
    var words = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
    return words.reduce(function(result2, _ref32) {
      var word = _ref32.word, width = _ref32.width;
      var currentLine = result2[result2.length - 1];
      if (currentLine && (lineWidth2 == null || scaleToFit || currentLine.width + width + spaceWidth < Number(lineWidth2))) {
        currentLine.words.push(word);
        currentLine.width += width + spaceWidth;
      } else {
        var newLine = {
          words: [word],
          width
        };
        result2.push(newLine);
      }
      return result2;
    }, []);
  };
  var originalResult = calculate(initialWordsWithComputedWith);
  var findLongestLine = function findLongestLine2(words) {
    return words.reduce(function(a2, b) {
      return a2.width > b.width ? a2 : b;
    });
  };
  if (!shouldLimitLines) {
    return originalResult;
  }
  var suffix = "\u2026";
  var checkOverflow = function checkOverflow2(index) {
    var tempText = text2.slice(0, index);
    var words = calculateWordWidths({
      breakAll,
      style,
      children: tempText + suffix
    }).wordsWithComputedWidth;
    var result2 = calculate(words);
    var doesOverflow = result2.length > maxLines || findLongestLine(result2).width > Number(lineWidth2);
    return [doesOverflow, result2];
  };
  var start = 0;
  var end = text2.length - 1;
  var iterations = 0;
  var trimmedResult;
  while (start <= end && iterations <= text2.length - 1) {
    var middle = Math.floor((start + end) / 2);
    var prev2 = middle - 1;
    var _checkOverflow = checkOverflow(prev2), _checkOverflow2 = _slicedToArray6(_checkOverflow, 2), doesPrevOverflow = _checkOverflow2[0], result = _checkOverflow2[1];
    var _checkOverflow3 = checkOverflow(middle), _checkOverflow4 = _slicedToArray6(_checkOverflow3, 1), doesMiddleOverflow = _checkOverflow4[0];
    if (!doesPrevOverflow && !doesMiddleOverflow) {
      start = middle + 1;
    }
    if (doesPrevOverflow && doesMiddleOverflow) {
      end = middle - 1;
    }
    if (!doesPrevOverflow && doesMiddleOverflow) {
      trimmedResult = result;
      break;
    }
    iterations++;
  }
  return trimmedResult || originalResult;
};
var getWordsWithoutCalculate = function getWordsWithoutCalculate2(children) {
  var words = !(0, import_isNil4.default)(children) ? children.toString().split(BREAKING_SPACES) : [];
  return [{
    words
  }];
};
var getWordsByLines = function getWordsByLines2(_ref42) {
  var width = _ref42.width, scaleToFit = _ref42.scaleToFit, children = _ref42.children, style = _ref42.style, breakAll = _ref42.breakAll, maxLines = _ref42.maxLines;
  if ((width || scaleToFit) && !Global2.isSsr) {
    var wordsWithComputedWidth, spaceWidth;
    var wordWidths = calculateWordWidths({
      breakAll,
      children,
      style
    });
    if (wordWidths) {
      var wcw = wordWidths.wordsWithComputedWidth, sw = wordWidths.spaceWidth;
      wordsWithComputedWidth = wcw;
      spaceWidth = sw;
    } else {
      return getWordsWithoutCalculate(children);
    }
    return calculateWordsByLines({
      breakAll,
      children,
      maxLines,
      style
    }, wordsWithComputedWidth, spaceWidth, width, scaleToFit);
  }
  return getWordsWithoutCalculate(children);
};
var DEFAULT_FILL = "#808080";
var Text3 = function Text4(_ref52) {
  var _ref5$x = _ref52.x, propsX = _ref5$x === void 0 ? 0 : _ref5$x, _ref5$y = _ref52.y, propsY = _ref5$y === void 0 ? 0 : _ref5$y, _ref5$lineHeight = _ref52.lineHeight, lineHeight = _ref5$lineHeight === void 0 ? "1em" : _ref5$lineHeight, _ref5$capHeight = _ref52.capHeight, capHeight = _ref5$capHeight === void 0 ? "0.71em" : _ref5$capHeight, _ref5$scaleToFit = _ref52.scaleToFit, scaleToFit = _ref5$scaleToFit === void 0 ? false : _ref5$scaleToFit, _ref5$textAnchor = _ref52.textAnchor, textAnchor = _ref5$textAnchor === void 0 ? "start" : _ref5$textAnchor, _ref5$verticalAnchor = _ref52.verticalAnchor, verticalAnchor = _ref5$verticalAnchor === void 0 ? "end" : _ref5$verticalAnchor, _ref5$fill = _ref52.fill, fill = _ref5$fill === void 0 ? DEFAULT_FILL : _ref5$fill, props = _objectWithoutProperties8(_ref52, _excluded12);
  var wordsByLines = (0, import_react90.useMemo)(function() {
    return getWordsByLines({
      breakAll: props.breakAll,
      children: props.children,
      maxLines: props.maxLines,
      scaleToFit,
      style: props.style,
      width: props.width
    });
  }, [props.breakAll, props.children, props.maxLines, scaleToFit, props.style, props.width]);
  var dx = props.dx, dy = props.dy, angle = props.angle, className = props.className, breakAll = props.breakAll, textProps = _objectWithoutProperties8(props, _excluded24);
  if (!isNumOrStr(propsX) || !isNumOrStr(propsY)) {
    return null;
  }
  var x2 = propsX + (isNumber(dx) ? dx : 0);
  var y2 = propsY + (isNumber(dy) ? dy : 0);
  var startDy;
  switch (verticalAnchor) {
    case "start":
      startDy = reduceCSSCalc("calc(".concat(capHeight, ")"));
      break;
    case "middle":
      startDy = reduceCSSCalc("calc(".concat((wordsByLines.length - 1) / 2, " * -").concat(lineHeight, " + (").concat(capHeight, " / 2))"));
      break;
    default:
      startDy = reduceCSSCalc("calc(".concat(wordsByLines.length - 1, " * -").concat(lineHeight, ")"));
      break;
  }
  var transforms = [];
  if (scaleToFit) {
    var lineWidth2 = wordsByLines[0].width;
    var width = props.width;
    transforms.push("scale(".concat((isNumber(width) ? width / lineWidth2 : 1) / lineWidth2, ")"));
  }
  if (angle) {
    transforms.push("rotate(".concat(angle, ", ").concat(x2, ", ").concat(y2, ")"));
  }
  if (transforms.length) {
    textProps.transform = transforms.join(" ");
  }
  return /* @__PURE__ */ import_react90.default.createElement("text", _extends14({}, filterProps(textProps, true), {
    x: x2,
    y: y2,
    className: (0, import_classnames8.default)("recharts-text", className),
    textAnchor,
    fill: fill.includes("url") ? DEFAULT_FILL : fill
  }), wordsByLines.map(function(line2, index) {
    return (
      // eslint-disable-next-line react/no-array-index-key
      /* @__PURE__ */ import_react90.default.createElement("tspan", {
        x: x2,
        dy: index === 0 ? startDy : lineHeight,
        key: index
      }, line2.words.join(breakAll ? "" : " "))
    );
  }));
};

// node_modules/recharts/es6/component/Label.js
var import_isObject3 = __toESM(require_isObject());
var import_isFunction6 = __toESM(require_isFunction());
var import_isNil7 = __toESM(require_isNil());
var import_react92 = __toESM(require_react());
var import_classnames9 = __toESM(require_classnames());

// node_modules/recharts/es6/util/PolarUtils.js
var import_isNil6 = __toESM(require_isNil());

// node_modules/recharts/es6/util/ChartUtils.js
var import_isEqual = __toESM(require_isEqual());
var import_sortBy2 = __toESM(require_sortBy());
var import_upperFirst2 = __toESM(require_upperFirst());
var import_isString3 = __toESM(require_isString());
var import_isNaN2 = __toESM(require_isNaN());
var import_isArray4 = __toESM(require_isArray());
var import_max2 = __toESM(require_max());
var import_min2 = __toESM(require_min());
var import_flatMap = __toESM(require_flatMap());
var import_isFunction5 = __toESM(require_isFunction());
var import_get3 = __toESM(require_get());
var import_isNil5 = __toESM(require_isNil());

// node_modules/victory-vendor/es/d3-scale.js
var d3_scale_exports = {};
__export(d3_scale_exports, {
  scaleBand: () => band,
  scaleDiverging: () => diverging,
  scaleDivergingLog: () => divergingLog,
  scaleDivergingPow: () => divergingPow,
  scaleDivergingSqrt: () => divergingSqrt,
  scaleDivergingSymlog: () => divergingSymlog,
  scaleIdentity: () => identity4,
  scaleImplicit: () => implicit,
  scaleLinear: () => linear2,
  scaleLog: () => log,
  scaleOrdinal: () => ordinal,
  scalePoint: () => point3,
  scalePow: () => pow,
  scaleQuantile: () => quantile2,
  scaleQuantize: () => quantize,
  scaleRadial: () => radial,
  scaleSequential: () => sequential,
  scaleSequentialLog: () => sequentialLog,
  scaleSequentialPow: () => sequentialPow,
  scaleSequentialQuantile: () => sequentialQuantile,
  scaleSequentialSqrt: () => sequentialSqrt,
  scaleSequentialSymlog: () => sequentialSymlog,
  scaleSqrt: () => sqrt2,
  scaleSymlog: () => symlog,
  scaleThreshold: () => threshold,
  scaleTime: () => time,
  scaleUtc: () => utcTime,
  tickFormat: () => tickFormat
});

// node_modules/d3-array/src/ascending.js
function ascending(a2, b) {
  return a2 == null || b == null ? NaN : a2 < b ? -1 : a2 > b ? 1 : a2 >= b ? 0 : NaN;
}

// node_modules/d3-array/src/descending.js
function descending(a2, b) {
  return a2 == null || b == null ? NaN : b < a2 ? -1 : b > a2 ? 1 : b >= a2 ? 0 : NaN;
}

// node_modules/d3-array/src/bisector.js
function bisector(f) {
  let compare1, compare2, delta;
  if (f.length !== 2) {
    compare1 = ascending;
    compare2 = (d, x2) => ascending(f(d), x2);
    delta = (d, x2) => f(d) - x2;
  } else {
    compare1 = f === ascending || f === descending ? f : zero2;
    compare2 = f;
    delta = f;
  }
  function left(a2, x2, lo = 0, hi = a2.length) {
    if (lo < hi) {
      if (compare1(x2, x2) !== 0)
        return hi;
      do {
        const mid = lo + hi >>> 1;
        if (compare2(a2[mid], x2) < 0)
          lo = mid + 1;
        else
          hi = mid;
      } while (lo < hi);
    }
    return lo;
  }
  function right(a2, x2, lo = 0, hi = a2.length) {
    if (lo < hi) {
      if (compare1(x2, x2) !== 0)
        return hi;
      do {
        const mid = lo + hi >>> 1;
        if (compare2(a2[mid], x2) <= 0)
          lo = mid + 1;
        else
          hi = mid;
      } while (lo < hi);
    }
    return lo;
  }
  function center(a2, x2, lo = 0, hi = a2.length) {
    const i2 = left(a2, x2, lo, hi - 1);
    return i2 > lo && delta(a2[i2 - 1], x2) > -delta(a2[i2], x2) ? i2 - 1 : i2;
  }
  return { left, center, right };
}
function zero2() {
  return 0;
}

// node_modules/d3-array/src/number.js
function number2(x2) {
  return x2 === null ? NaN : +x2;
}
function* numbers(values2, valueof) {
  if (valueof === void 0) {
    for (let value of values2) {
      if (value != null && (value = +value) >= value) {
        yield value;
      }
    }
  } else {
    let index = -1;
    for (let value of values2) {
      if ((value = valueof(value, ++index, values2)) != null && (value = +value) >= value) {
        yield value;
      }
    }
  }
}

// node_modules/d3-array/src/bisect.js
var ascendingBisect = bisector(ascending);
var bisectRight = ascendingBisect.right;
var bisectLeft = ascendingBisect.left;
var bisectCenter = bisector(number2).center;
var bisect_default = bisectRight;

// node_modules/internmap/src/index.js
var InternMap = class extends Map {
  constructor(entries, key = keyof) {
    super();
    Object.defineProperties(this, { _intern: { value: /* @__PURE__ */ new Map() }, _key: { value: key } });
    if (entries != null)
      for (const [key2, value] of entries)
        this.set(key2, value);
  }
  get(key) {
    return super.get(intern_get(this, key));
  }
  has(key) {
    return super.has(intern_get(this, key));
  }
  set(key, value) {
    return super.set(intern_set(this, key), value);
  }
  delete(key) {
    return super.delete(intern_delete(this, key));
  }
};
function intern_get({ _intern, _key }, value) {
  const key = _key(value);
  return _intern.has(key) ? _intern.get(key) : value;
}
function intern_set({ _intern, _key }, value) {
  const key = _key(value);
  if (_intern.has(key))
    return _intern.get(key);
  _intern.set(key, value);
  return value;
}
function intern_delete({ _intern, _key }, value) {
  const key = _key(value);
  if (_intern.has(key)) {
    value = _intern.get(key);
    _intern.delete(key);
  }
  return value;
}
function keyof(value) {
  return value !== null && typeof value === "object" ? value.valueOf() : value;
}

// node_modules/d3-array/src/sort.js
function compareDefined(compare2 = ascending) {
  if (compare2 === ascending)
    return ascendingDefined;
  if (typeof compare2 !== "function")
    throw new TypeError("compare is not a function");
  return (a2, b) => {
    const x2 = compare2(a2, b);
    if (x2 || x2 === 0)
      return x2;
    return (compare2(b, b) === 0) - (compare2(a2, a2) === 0);
  };
}
function ascendingDefined(a2, b) {
  return (a2 == null || !(a2 >= a2)) - (b == null || !(b >= b)) || (a2 < b ? -1 : a2 > b ? 1 : 0);
}

// node_modules/d3-array/src/ticks.js
var e10 = Math.sqrt(50);
var e5 = Math.sqrt(10);
var e2 = Math.sqrt(2);
function tickSpec(start, stop, count2) {
  const step = (stop - start) / Math.max(0, count2), power = Math.floor(Math.log10(step)), error = step / Math.pow(10, power), factor = error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1;
  let i1, i2, inc;
  if (power < 0) {
    inc = Math.pow(10, -power) / factor;
    i1 = Math.round(start * inc);
    i2 = Math.round(stop * inc);
    if (i1 / inc < start)
      ++i1;
    if (i2 / inc > stop)
      --i2;
    inc = -inc;
  } else {
    inc = Math.pow(10, power) * factor;
    i1 = Math.round(start / inc);
    i2 = Math.round(stop / inc);
    if (i1 * inc < start)
      ++i1;
    if (i2 * inc > stop)
      --i2;
  }
  if (i2 < i1 && 0.5 <= count2 && count2 < 2)
    return tickSpec(start, stop, count2 * 2);
  return [i1, i2, inc];
}
function ticks(start, stop, count2) {
  stop = +stop, start = +start, count2 = +count2;
  if (!(count2 > 0))
    return [];
  if (start === stop)
    return [start];
  const reverse3 = stop < start, [i1, i2, inc] = reverse3 ? tickSpec(stop, start, count2) : tickSpec(start, stop, count2);
  if (!(i2 >= i1))
    return [];
  const n2 = i2 - i1 + 1, ticks2 = new Array(n2);
  if (reverse3) {
    if (inc < 0)
      for (let i3 = 0; i3 < n2; ++i3)
        ticks2[i3] = (i2 - i3) / -inc;
    else
      for (let i3 = 0; i3 < n2; ++i3)
        ticks2[i3] = (i2 - i3) * inc;
  } else {
    if (inc < 0)
      for (let i3 = 0; i3 < n2; ++i3)
        ticks2[i3] = (i1 + i3) / -inc;
    else
      for (let i3 = 0; i3 < n2; ++i3)
        ticks2[i3] = (i1 + i3) * inc;
  }
  return ticks2;
}
function tickIncrement(start, stop, count2) {
  stop = +stop, start = +start, count2 = +count2;
  return tickSpec(start, stop, count2)[2];
}
function tickStep(start, stop, count2) {
  stop = +stop, start = +start, count2 = +count2;
  const reverse3 = stop < start, inc = reverse3 ? tickIncrement(stop, start, count2) : tickIncrement(start, stop, count2);
  return (reverse3 ? -1 : 1) * (inc < 0 ? 1 / -inc : inc);
}

// node_modules/d3-array/src/max.js
function max2(values2, valueof) {
  let max3;
  if (valueof === void 0) {
    for (const value of values2) {
      if (value != null && (max3 < value || max3 === void 0 && value >= value)) {
        max3 = value;
      }
    }
  } else {
    let index = -1;
    for (let value of values2) {
      if ((value = valueof(value, ++index, values2)) != null && (max3 < value || max3 === void 0 && value >= value)) {
        max3 = value;
      }
    }
  }
  return max3;
}

// node_modules/d3-array/src/min.js
function min2(values2, valueof) {
  let min3;
  if (valueof === void 0) {
    for (const value of values2) {
      if (value != null && (min3 > value || min3 === void 0 && value >= value)) {
        min3 = value;
      }
    }
  } else {
    let index = -1;
    for (let value of values2) {
      if ((value = valueof(value, ++index, values2)) != null && (min3 > value || min3 === void 0 && value >= value)) {
        min3 = value;
      }
    }
  }
  return min3;
}

// node_modules/d3-array/src/quickselect.js
function quickselect(array, k2, left = 0, right = Infinity, compare2) {
  k2 = Math.floor(k2);
  left = Math.floor(Math.max(0, left));
  right = Math.floor(Math.min(array.length - 1, right));
  if (!(left <= k2 && k2 <= right))
    return array;
  compare2 = compare2 === void 0 ? ascendingDefined : compareDefined(compare2);
  while (right > left) {
    if (right - left > 600) {
      const n2 = right - left + 1;
      const m = k2 - left + 1;
      const z = Math.log(n2);
      const s2 = 0.5 * Math.exp(2 * z / 3);
      const sd = 0.5 * Math.sqrt(z * s2 * (n2 - s2) / n2) * (m - n2 / 2 < 0 ? -1 : 1);
      const newLeft = Math.max(left, Math.floor(k2 - m * s2 / n2 + sd));
      const newRight = Math.min(right, Math.floor(k2 + (n2 - m) * s2 / n2 + sd));
      quickselect(array, k2, newLeft, newRight, compare2);
    }
    const t3 = array[k2];
    let i2 = left;
    let j = right;
    swap(array, left, k2);
    if (compare2(array[right], t3) > 0)
      swap(array, left, right);
    while (i2 < j) {
      swap(array, i2, j), ++i2, --j;
      while (compare2(array[i2], t3) < 0)
        ++i2;
      while (compare2(array[j], t3) > 0)
        --j;
    }
    if (compare2(array[left], t3) === 0)
      swap(array, left, j);
    else
      ++j, swap(array, j, right);
    if (j <= k2)
      left = j + 1;
    if (k2 <= j)
      right = j - 1;
  }
  return array;
}
function swap(array, i2, j) {
  const t3 = array[i2];
  array[i2] = array[j];
  array[j] = t3;
}

// node_modules/d3-array/src/quantile.js
function quantile(values2, p, valueof) {
  values2 = Float64Array.from(numbers(values2, valueof));
  if (!(n2 = values2.length) || isNaN(p = +p))
    return;
  if (p <= 0 || n2 < 2)
    return min2(values2);
  if (p >= 1)
    return max2(values2);
  var n2, i2 = (n2 - 1) * p, i0 = Math.floor(i2), value0 = max2(quickselect(values2, i0).subarray(0, i0 + 1)), value1 = min2(values2.subarray(i0 + 1));
  return value0 + (value1 - value0) * (i2 - i0);
}
function quantileSorted(values2, p, valueof = number2) {
  if (!(n2 = values2.length) || isNaN(p = +p))
    return;
  if (p <= 0 || n2 < 2)
    return +valueof(values2[0], 0, values2);
  if (p >= 1)
    return +valueof(values2[n2 - 1], n2 - 1, values2);
  var n2, i2 = (n2 - 1) * p, i0 = Math.floor(i2), value0 = +valueof(values2[i0], i0, values2), value1 = +valueof(values2[i0 + 1], i0 + 1, values2);
  return value0 + (value1 - value0) * (i2 - i0);
}

// node_modules/d3-array/src/range.js
function range(start, stop, step) {
  start = +start, stop = +stop, step = (n2 = arguments.length) < 2 ? (stop = start, start = 0, 1) : n2 < 3 ? 1 : +step;
  var i2 = -1, n2 = Math.max(0, Math.ceil((stop - start) / step)) | 0, range4 = new Array(n2);
  while (++i2 < n2) {
    range4[i2] = start + i2 * step;
  }
  return range4;
}

// node_modules/d3-scale/src/init.js
function initRange(domain, range4) {
  switch (arguments.length) {
    case 0:
      break;
    case 1:
      this.range(domain);
      break;
    default:
      this.range(range4).domain(domain);
      break;
  }
  return this;
}
function initInterpolator(domain, interpolator) {
  switch (arguments.length) {
    case 0:
      break;
    case 1: {
      if (typeof domain === "function")
        this.interpolator(domain);
      else
        this.range(domain);
      break;
    }
    default: {
      this.domain(domain);
      if (typeof interpolator === "function")
        this.interpolator(interpolator);
      else
        this.range(interpolator);
      break;
    }
  }
  return this;
}

// node_modules/d3-scale/src/ordinal.js
var implicit = Symbol("implicit");
function ordinal() {
  var index = new InternMap(), domain = [], range4 = [], unknown = implicit;
  function scale(d) {
    let i2 = index.get(d);
    if (i2 === void 0) {
      if (unknown !== implicit)
        return unknown;
      index.set(d, i2 = domain.push(d) - 1);
    }
    return range4[i2 % range4.length];
  }
  scale.domain = function(_) {
    if (!arguments.length)
      return domain.slice();
    domain = [], index = new InternMap();
    for (const value of _) {
      if (index.has(value))
        continue;
      index.set(value, domain.push(value) - 1);
    }
    return scale;
  };
  scale.range = function(_) {
    return arguments.length ? (range4 = Array.from(_), scale) : range4.slice();
  };
  scale.unknown = function(_) {
    return arguments.length ? (unknown = _, scale) : unknown;
  };
  scale.copy = function() {
    return ordinal(domain, range4).unknown(unknown);
  };
  initRange.apply(scale, arguments);
  return scale;
}

// node_modules/d3-scale/src/band.js
function band() {
  var scale = ordinal().unknown(void 0), domain = scale.domain, ordinalRange = scale.range, r0 = 0, r1 = 1, step, bandwidth, round = false, paddingInner = 0, paddingOuter = 0, align = 0.5;
  delete scale.unknown;
  function rescale() {
    var n2 = domain().length, reverse3 = r1 < r0, start = reverse3 ? r1 : r0, stop = reverse3 ? r0 : r1;
    step = (stop - start) / Math.max(1, n2 - paddingInner + paddingOuter * 2);
    if (round)
      step = Math.floor(step);
    start += (stop - start - step * (n2 - paddingInner)) * align;
    bandwidth = step * (1 - paddingInner);
    if (round)
      start = Math.round(start), bandwidth = Math.round(bandwidth);
    var values2 = range(n2).map(function(i2) {
      return start + step * i2;
    });
    return ordinalRange(reverse3 ? values2.reverse() : values2);
  }
  scale.domain = function(_) {
    return arguments.length ? (domain(_), rescale()) : domain();
  };
  scale.range = function(_) {
    return arguments.length ? ([r0, r1] = _, r0 = +r0, r1 = +r1, rescale()) : [r0, r1];
  };
  scale.rangeRound = function(_) {
    return [r0, r1] = _, r0 = +r0, r1 = +r1, round = true, rescale();
  };
  scale.bandwidth = function() {
    return bandwidth;
  };
  scale.step = function() {
    return step;
  };
  scale.round = function(_) {
    return arguments.length ? (round = !!_, rescale()) : round;
  };
  scale.padding = function(_) {
    return arguments.length ? (paddingInner = Math.min(1, paddingOuter = +_), rescale()) : paddingInner;
  };
  scale.paddingInner = function(_) {
    return arguments.length ? (paddingInner = Math.min(1, _), rescale()) : paddingInner;
  };
  scale.paddingOuter = function(_) {
    return arguments.length ? (paddingOuter = +_, rescale()) : paddingOuter;
  };
  scale.align = function(_) {
    return arguments.length ? (align = Math.max(0, Math.min(1, _)), rescale()) : align;
  };
  scale.copy = function() {
    return band(domain(), [r0, r1]).round(round).paddingInner(paddingInner).paddingOuter(paddingOuter).align(align);
  };
  return initRange.apply(rescale(), arguments);
}
function pointish(scale) {
  var copy4 = scale.copy;
  scale.padding = scale.paddingOuter;
  delete scale.paddingInner;
  delete scale.paddingOuter;
  scale.copy = function() {
    return pointish(copy4());
  };
  return scale;
}
function point3() {
  return pointish(band.apply(null, arguments).paddingInner(1));
}

// node_modules/d3-scale/src/constant.js
function constants(x2) {
  return function() {
    return x2;
  };
}

// node_modules/d3-scale/src/number.js
function number3(x2) {
  return +x2;
}

// node_modules/d3-scale/src/continuous.js
var unit = [0, 1];
function identity3(x2) {
  return x2;
}
function normalize2(a2, b) {
  return (b -= a2 = +a2) ? function(x2) {
    return (x2 - a2) / b;
  } : constants(isNaN(b) ? NaN : 0.5);
}
function clamper(a2, b) {
  var t3;
  if (a2 > b)
    t3 = a2, a2 = b, b = t3;
  return function(x2) {
    return Math.max(a2, Math.min(b, x2));
  };
}
function bimap(domain, range4, interpolate) {
  var d0 = domain[0], d1 = domain[1], r0 = range4[0], r1 = range4[1];
  if (d1 < d0)
    d0 = normalize2(d1, d0), r0 = interpolate(r1, r0);
  else
    d0 = normalize2(d0, d1), r0 = interpolate(r0, r1);
  return function(x2) {
    return r0(d0(x2));
  };
}
function polymap(domain, range4, interpolate) {
  var j = Math.min(domain.length, range4.length) - 1, d = new Array(j), r3 = new Array(j), i2 = -1;
  if (domain[j] < domain[0]) {
    domain = domain.slice().reverse();
    range4 = range4.slice().reverse();
  }
  while (++i2 < j) {
    d[i2] = normalize2(domain[i2], domain[i2 + 1]);
    r3[i2] = interpolate(range4[i2], range4[i2 + 1]);
  }
  return function(x2) {
    var i3 = bisect_default(domain, x2, 1, j) - 1;
    return r3[i3](d[i3](x2));
  };
}
function copy2(source, target) {
  return target.domain(source.domain()).range(source.range()).interpolate(source.interpolate()).clamp(source.clamp()).unknown(source.unknown());
}
function transformer() {
  var domain = unit, range4 = unit, interpolate = value_default, transform, untransform, unknown, clamp2 = identity3, piecewise2, output, input;
  function rescale() {
    var n2 = Math.min(domain.length, range4.length);
    if (clamp2 !== identity3)
      clamp2 = clamper(domain[0], domain[n2 - 1]);
    piecewise2 = n2 > 2 ? polymap : bimap;
    output = input = null;
    return scale;
  }
  function scale(x2) {
    return x2 == null || isNaN(x2 = +x2) ? unknown : (output || (output = piecewise2(domain.map(transform), range4, interpolate)))(transform(clamp2(x2)));
  }
  scale.invert = function(y2) {
    return clamp2(untransform((input || (input = piecewise2(range4, domain.map(transform), number_default)))(y2)));
  };
  scale.domain = function(_) {
    return arguments.length ? (domain = Array.from(_, number3), rescale()) : domain.slice();
  };
  scale.range = function(_) {
    return arguments.length ? (range4 = Array.from(_), rescale()) : range4.slice();
  };
  scale.rangeRound = function(_) {
    return range4 = Array.from(_), interpolate = round_default, rescale();
  };
  scale.clamp = function(_) {
    return arguments.length ? (clamp2 = _ ? true : identity3, rescale()) : clamp2 !== identity3;
  };
  scale.interpolate = function(_) {
    return arguments.length ? (interpolate = _, rescale()) : interpolate;
  };
  scale.unknown = function(_) {
    return arguments.length ? (unknown = _, scale) : unknown;
  };
  return function(t3, u) {
    transform = t3, untransform = u;
    return rescale();
  };
}
function continuous() {
  return transformer()(identity3, identity3);
}

// node_modules/d3-scale/src/tickFormat.js
function tickFormat(start, stop, count2, specifier) {
  var step = tickStep(start, stop, count2), precision;
  specifier = formatSpecifier(specifier == null ? ",f" : specifier);
  switch (specifier.type) {
    case "s": {
      var value = Math.max(Math.abs(start), Math.abs(stop));
      if (specifier.precision == null && !isNaN(precision = precisionPrefix_default(step, value)))
        specifier.precision = precision;
      return formatPrefix(specifier, value);
    }
    case "":
    case "e":
    case "g":
    case "p":
    case "r": {
      if (specifier.precision == null && !isNaN(precision = precisionRound_default(step, Math.max(Math.abs(start), Math.abs(stop)))))
        specifier.precision = precision - (specifier.type === "e");
      break;
    }
    case "f":
    case "%": {
      if (specifier.precision == null && !isNaN(precision = precisionFixed_default(step)))
        specifier.precision = precision - (specifier.type === "%") * 2;
      break;
    }
  }
  return format2(specifier);
}

// node_modules/d3-scale/src/linear.js
function linearish(scale) {
  var domain = scale.domain;
  scale.ticks = function(count2) {
    var d = domain();
    return ticks(d[0], d[d.length - 1], count2 == null ? 10 : count2);
  };
  scale.tickFormat = function(count2, specifier) {
    var d = domain();
    return tickFormat(d[0], d[d.length - 1], count2 == null ? 10 : count2, specifier);
  };
  scale.nice = function(count2) {
    if (count2 == null)
      count2 = 10;
    var d = domain();
    var i0 = 0;
    var i1 = d.length - 1;
    var start = d[i0];
    var stop = d[i1];
    var prestep;
    var step;
    var maxIter = 10;
    if (stop < start) {
      step = start, start = stop, stop = step;
      step = i0, i0 = i1, i1 = step;
    }
    while (maxIter-- > 0) {
      step = tickIncrement(start, stop, count2);
      if (step === prestep) {
        d[i0] = start;
        d[i1] = stop;
        return domain(d);
      } else if (step > 0) {
        start = Math.floor(start / step) * step;
        stop = Math.ceil(stop / step) * step;
      } else if (step < 0) {
        start = Math.ceil(start * step) / step;
        stop = Math.floor(stop * step) / step;
      } else {
        break;
      }
      prestep = step;
    }
    return scale;
  };
  return scale;
}
function linear2() {
  var scale = continuous();
  scale.copy = function() {
    return copy2(scale, linear2());
  };
  initRange.apply(scale, arguments);
  return linearish(scale);
}

// node_modules/d3-scale/src/identity.js
function identity4(domain) {
  var unknown;
  function scale(x2) {
    return x2 == null || isNaN(x2 = +x2) ? unknown : x2;
  }
  scale.invert = scale;
  scale.domain = scale.range = function(_) {
    return arguments.length ? (domain = Array.from(_, number3), scale) : domain.slice();
  };
  scale.unknown = function(_) {
    return arguments.length ? (unknown = _, scale) : unknown;
  };
  scale.copy = function() {
    return identity4(domain).unknown(unknown);
  };
  domain = arguments.length ? Array.from(domain, number3) : [0, 1];
  return linearish(scale);
}

// node_modules/d3-scale/src/nice.js
function nice(domain, interval) {
  domain = domain.slice();
  var i0 = 0, i1 = domain.length - 1, x0 = domain[i0], x1 = domain[i1], t3;
  if (x1 < x0) {
    t3 = i0, i0 = i1, i1 = t3;
    t3 = x0, x0 = x1, x1 = t3;
  }
  domain[i0] = interval.floor(x0);
  domain[i1] = interval.ceil(x1);
  return domain;
}

// node_modules/d3-scale/src/log.js
function transformLog(x2) {
  return Math.log(x2);
}
function transformExp(x2) {
  return Math.exp(x2);
}
function transformLogn(x2) {
  return -Math.log(-x2);
}
function transformExpn(x2) {
  return -Math.exp(-x2);
}
function pow10(x2) {
  return isFinite(x2) ? +("1e" + x2) : x2 < 0 ? 0 : x2;
}
function powp(base2) {
  return base2 === 10 ? pow10 : base2 === Math.E ? Math.exp : (x2) => Math.pow(base2, x2);
}
function logp(base2) {
  return base2 === Math.E ? Math.log : base2 === 10 && Math.log10 || base2 === 2 && Math.log2 || (base2 = Math.log(base2), (x2) => Math.log(x2) / base2);
}
function reflect(f) {
  return (x2, k2) => -f(-x2, k2);
}
function loggish(transform) {
  const scale = transform(transformLog, transformExp);
  const domain = scale.domain;
  let base2 = 10;
  let logs;
  let pows;
  function rescale() {
    logs = logp(base2), pows = powp(base2);
    if (domain()[0] < 0) {
      logs = reflect(logs), pows = reflect(pows);
      transform(transformLogn, transformExpn);
    } else {
      transform(transformLog, transformExp);
    }
    return scale;
  }
  scale.base = function(_) {
    return arguments.length ? (base2 = +_, rescale()) : base2;
  };
  scale.domain = function(_) {
    return arguments.length ? (domain(_), rescale()) : domain();
  };
  scale.ticks = (count2) => {
    const d = domain();
    let u = d[0];
    let v4 = d[d.length - 1];
    const r3 = v4 < u;
    if (r3)
      [u, v4] = [v4, u];
    let i2 = logs(u);
    let j = logs(v4);
    let k2;
    let t3;
    const n2 = count2 == null ? 10 : +count2;
    let z = [];
    if (!(base2 % 1) && j - i2 < n2) {
      i2 = Math.floor(i2), j = Math.ceil(j);
      if (u > 0)
        for (; i2 <= j; ++i2) {
          for (k2 = 1; k2 < base2; ++k2) {
            t3 = i2 < 0 ? k2 / pows(-i2) : k2 * pows(i2);
            if (t3 < u)
              continue;
            if (t3 > v4)
              break;
            z.push(t3);
          }
        }
      else
        for (; i2 <= j; ++i2) {
          for (k2 = base2 - 1; k2 >= 1; --k2) {
            t3 = i2 > 0 ? k2 / pows(-i2) : k2 * pows(i2);
            if (t3 < u)
              continue;
            if (t3 > v4)
              break;
            z.push(t3);
          }
        }
      if (z.length * 2 < n2)
        z = ticks(u, v4, n2);
    } else {
      z = ticks(i2, j, Math.min(j - i2, n2)).map(pows);
    }
    return r3 ? z.reverse() : z;
  };
  scale.tickFormat = (count2, specifier) => {
    if (count2 == null)
      count2 = 10;
    if (specifier == null)
      specifier = base2 === 10 ? "s" : ",";
    if (typeof specifier !== "function") {
      if (!(base2 % 1) && (specifier = formatSpecifier(specifier)).precision == null)
        specifier.trim = true;
      specifier = format2(specifier);
    }
    if (count2 === Infinity)
      return specifier;
    const k2 = Math.max(1, base2 * count2 / scale.ticks().length);
    return (d) => {
      let i2 = d / pows(Math.round(logs(d)));
      if (i2 * base2 < base2 - 0.5)
        i2 *= base2;
      return i2 <= k2 ? specifier(d) : "";
    };
  };
  scale.nice = () => {
    return domain(nice(domain(), {
      floor: (x2) => pows(Math.floor(logs(x2))),
      ceil: (x2) => pows(Math.ceil(logs(x2)))
    }));
  };
  return scale;
}
function log() {
  const scale = loggish(transformer()).domain([1, 10]);
  scale.copy = () => copy2(scale, log()).base(scale.base());
  initRange.apply(scale, arguments);
  return scale;
}

// node_modules/d3-scale/src/symlog.js
function transformSymlog(c4) {
  return function(x2) {
    return Math.sign(x2) * Math.log1p(Math.abs(x2 / c4));
  };
}
function transformSymexp(c4) {
  return function(x2) {
    return Math.sign(x2) * Math.expm1(Math.abs(x2)) * c4;
  };
}
function symlogish(transform) {
  var c4 = 1, scale = transform(transformSymlog(c4), transformSymexp(c4));
  scale.constant = function(_) {
    return arguments.length ? transform(transformSymlog(c4 = +_), transformSymexp(c4)) : c4;
  };
  return linearish(scale);
}
function symlog() {
  var scale = symlogish(transformer());
  scale.copy = function() {
    return copy2(scale, symlog()).constant(scale.constant());
  };
  return initRange.apply(scale, arguments);
}

// node_modules/d3-scale/src/pow.js
function transformPow(exponent) {
  return function(x2) {
    return x2 < 0 ? -Math.pow(-x2, exponent) : Math.pow(x2, exponent);
  };
}
function transformSqrt(x2) {
  return x2 < 0 ? -Math.sqrt(-x2) : Math.sqrt(x2);
}
function transformSquare(x2) {
  return x2 < 0 ? -x2 * x2 : x2 * x2;
}
function powish(transform) {
  var scale = transform(identity3, identity3), exponent = 1;
  function rescale() {
    return exponent === 1 ? transform(identity3, identity3) : exponent === 0.5 ? transform(transformSqrt, transformSquare) : transform(transformPow(exponent), transformPow(1 / exponent));
  }
  scale.exponent = function(_) {
    return arguments.length ? (exponent = +_, rescale()) : exponent;
  };
  return linearish(scale);
}
function pow() {
  var scale = powish(transformer());
  scale.copy = function() {
    return copy2(scale, pow()).exponent(scale.exponent());
  };
  initRange.apply(scale, arguments);
  return scale;
}
function sqrt2() {
  return pow.apply(null, arguments).exponent(0.5);
}

// node_modules/d3-scale/src/radial.js
function square(x2) {
  return Math.sign(x2) * x2 * x2;
}
function unsquare(x2) {
  return Math.sign(x2) * Math.sqrt(Math.abs(x2));
}
function radial() {
  var squared = continuous(), range4 = [0, 1], round = false, unknown;
  function scale(x2) {
    var y2 = unsquare(squared(x2));
    return isNaN(y2) ? unknown : round ? Math.round(y2) : y2;
  }
  scale.invert = function(y2) {
    return squared.invert(square(y2));
  };
  scale.domain = function(_) {
    return arguments.length ? (squared.domain(_), scale) : squared.domain();
  };
  scale.range = function(_) {
    return arguments.length ? (squared.range((range4 = Array.from(_, number3)).map(square)), scale) : range4.slice();
  };
  scale.rangeRound = function(_) {
    return scale.range(_).round(true);
  };
  scale.round = function(_) {
    return arguments.length ? (round = !!_, scale) : round;
  };
  scale.clamp = function(_) {
    return arguments.length ? (squared.clamp(_), scale) : squared.clamp();
  };
  scale.unknown = function(_) {
    return arguments.length ? (unknown = _, scale) : unknown;
  };
  scale.copy = function() {
    return radial(squared.domain(), range4).round(round).clamp(squared.clamp()).unknown(unknown);
  };
  initRange.apply(scale, arguments);
  return linearish(scale);
}

// node_modules/d3-scale/src/quantile.js
function quantile2() {
  var domain = [], range4 = [], thresholds = [], unknown;
  function rescale() {
    var i2 = 0, n2 = Math.max(1, range4.length);
    thresholds = new Array(n2 - 1);
    while (++i2 < n2)
      thresholds[i2 - 1] = quantileSorted(domain, i2 / n2);
    return scale;
  }
  function scale(x2) {
    return x2 == null || isNaN(x2 = +x2) ? unknown : range4[bisect_default(thresholds, x2)];
  }
  scale.invertExtent = function(y2) {
    var i2 = range4.indexOf(y2);
    return i2 < 0 ? [NaN, NaN] : [
      i2 > 0 ? thresholds[i2 - 1] : domain[0],
      i2 < thresholds.length ? thresholds[i2] : domain[domain.length - 1]
    ];
  };
  scale.domain = function(_) {
    if (!arguments.length)
      return domain.slice();
    domain = [];
    for (let d of _)
      if (d != null && !isNaN(d = +d))
        domain.push(d);
    domain.sort(ascending);
    return rescale();
  };
  scale.range = function(_) {
    return arguments.length ? (range4 = Array.from(_), rescale()) : range4.slice();
  };
  scale.unknown = function(_) {
    return arguments.length ? (unknown = _, scale) : unknown;
  };
  scale.quantiles = function() {
    return thresholds.slice();
  };
  scale.copy = function() {
    return quantile2().domain(domain).range(range4).unknown(unknown);
  };
  return initRange.apply(scale, arguments);
}

// node_modules/d3-scale/src/quantize.js
function quantize() {
  var x0 = 0, x1 = 1, n2 = 1, domain = [0.5], range4 = [0, 1], unknown;
  function scale(x2) {
    return x2 != null && x2 <= x2 ? range4[bisect_default(domain, x2, 0, n2)] : unknown;
  }
  function rescale() {
    var i2 = -1;
    domain = new Array(n2);
    while (++i2 < n2)
      domain[i2] = ((i2 + 1) * x1 - (i2 - n2) * x0) / (n2 + 1);
    return scale;
  }
  scale.domain = function(_) {
    return arguments.length ? ([x0, x1] = _, x0 = +x0, x1 = +x1, rescale()) : [x0, x1];
  };
  scale.range = function(_) {
    return arguments.length ? (n2 = (range4 = Array.from(_)).length - 1, rescale()) : range4.slice();
  };
  scale.invertExtent = function(y2) {
    var i2 = range4.indexOf(y2);
    return i2 < 0 ? [NaN, NaN] : i2 < 1 ? [x0, domain[0]] : i2 >= n2 ? [domain[n2 - 1], x1] : [domain[i2 - 1], domain[i2]];
  };
  scale.unknown = function(_) {
    return arguments.length ? (unknown = _, scale) : scale;
  };
  scale.thresholds = function() {
    return domain.slice();
  };
  scale.copy = function() {
    return quantize().domain([x0, x1]).range(range4).unknown(unknown);
  };
  return initRange.apply(linearish(scale), arguments);
}

// node_modules/d3-scale/src/threshold.js
function threshold() {
  var domain = [0.5], range4 = [0, 1], unknown, n2 = 1;
  function scale(x2) {
    return x2 != null && x2 <= x2 ? range4[bisect_default(domain, x2, 0, n2)] : unknown;
  }
  scale.domain = function(_) {
    return arguments.length ? (domain = Array.from(_), n2 = Math.min(domain.length, range4.length - 1), scale) : domain.slice();
  };
  scale.range = function(_) {
    return arguments.length ? (range4 = Array.from(_), n2 = Math.min(domain.length, range4.length - 1), scale) : range4.slice();
  };
  scale.invertExtent = function(y2) {
    var i2 = range4.indexOf(y2);
    return [domain[i2 - 1], domain[i2]];
  };
  scale.unknown = function(_) {
    return arguments.length ? (unknown = _, scale) : unknown;
  };
  scale.copy = function() {
    return threshold().domain(domain).range(range4).unknown(unknown);
  };
  return initRange.apply(scale, arguments);
}

// node_modules/d3-time/src/interval.js
var t0 = /* @__PURE__ */ new Date();
var t1 = /* @__PURE__ */ new Date();
function timeInterval(floori, offseti, count2, field) {
  function interval(date2) {
    return floori(date2 = arguments.length === 0 ? /* @__PURE__ */ new Date() : /* @__PURE__ */ new Date(+date2)), date2;
  }
  interval.floor = (date2) => {
    return floori(date2 = /* @__PURE__ */ new Date(+date2)), date2;
  };
  interval.ceil = (date2) => {
    return floori(date2 = new Date(date2 - 1)), offseti(date2, 1), floori(date2), date2;
  };
  interval.round = (date2) => {
    const d0 = interval(date2), d1 = interval.ceil(date2);
    return date2 - d0 < d1 - date2 ? d0 : d1;
  };
  interval.offset = (date2, step) => {
    return offseti(date2 = /* @__PURE__ */ new Date(+date2), step == null ? 1 : Math.floor(step)), date2;
  };
  interval.range = (start, stop, step) => {
    const range4 = [];
    start = interval.ceil(start);
    step = step == null ? 1 : Math.floor(step);
    if (!(start < stop) || !(step > 0))
      return range4;
    let previous;
    do
      range4.push(previous = /* @__PURE__ */ new Date(+start)), offseti(start, step), floori(start);
    while (previous < start && start < stop);
    return range4;
  };
  interval.filter = (test) => {
    return timeInterval((date2) => {
      if (date2 >= date2)
        while (floori(date2), !test(date2))
          date2.setTime(date2 - 1);
    }, (date2, step) => {
      if (date2 >= date2) {
        if (step < 0)
          while (++step <= 0) {
            while (offseti(date2, -1), !test(date2)) {
            }
          }
        else
          while (--step >= 0) {
            while (offseti(date2, 1), !test(date2)) {
            }
          }
      }
    });
  };
  if (count2) {
    interval.count = (start, end) => {
      t0.setTime(+start), t1.setTime(+end);
      floori(t0), floori(t1);
      return Math.floor(count2(t0, t1));
    };
    interval.every = (step) => {
      step = Math.floor(step);
      return !isFinite(step) || !(step > 0) ? null : !(step > 1) ? interval : interval.filter(field ? (d) => field(d) % step === 0 : (d) => interval.count(0, d) % step === 0);
    };
  }
  return interval;
}

// node_modules/d3-time/src/millisecond.js
var millisecond = timeInterval(() => {
}, (date2, step) => {
  date2.setTime(+date2 + step);
}, (start, end) => {
  return end - start;
});
millisecond.every = (k2) => {
  k2 = Math.floor(k2);
  if (!isFinite(k2) || !(k2 > 0))
    return null;
  if (!(k2 > 1))
    return millisecond;
  return timeInterval((date2) => {
    date2.setTime(Math.floor(date2 / k2) * k2);
  }, (date2, step) => {
    date2.setTime(+date2 + step * k2);
  }, (start, end) => {
    return (end - start) / k2;
  });
};
var milliseconds = millisecond.range;

// node_modules/d3-time/src/duration.js
var durationSecond = 1e3;
var durationMinute = durationSecond * 60;
var durationHour = durationMinute * 60;
var durationDay = durationHour * 24;
var durationWeek = durationDay * 7;
var durationMonth = durationDay * 30;
var durationYear = durationDay * 365;

// node_modules/d3-time/src/second.js
var second = timeInterval((date2) => {
  date2.setTime(date2 - date2.getMilliseconds());
}, (date2, step) => {
  date2.setTime(+date2 + step * durationSecond);
}, (start, end) => {
  return (end - start) / durationSecond;
}, (date2) => {
  return date2.getUTCSeconds();
});
var seconds = second.range;

// node_modules/d3-time/src/minute.js
var timeMinute = timeInterval((date2) => {
  date2.setTime(date2 - date2.getMilliseconds() - date2.getSeconds() * durationSecond);
}, (date2, step) => {
  date2.setTime(+date2 + step * durationMinute);
}, (start, end) => {
  return (end - start) / durationMinute;
}, (date2) => {
  return date2.getMinutes();
});
var timeMinutes = timeMinute.range;
var utcMinute = timeInterval((date2) => {
  date2.setUTCSeconds(0, 0);
}, (date2, step) => {
  date2.setTime(+date2 + step * durationMinute);
}, (start, end) => {
  return (end - start) / durationMinute;
}, (date2) => {
  return date2.getUTCMinutes();
});
var utcMinutes = utcMinute.range;

// node_modules/d3-time/src/hour.js
var timeHour = timeInterval((date2) => {
  date2.setTime(date2 - date2.getMilliseconds() - date2.getSeconds() * durationSecond - date2.getMinutes() * durationMinute);
}, (date2, step) => {
  date2.setTime(+date2 + step * durationHour);
}, (start, end) => {
  return (end - start) / durationHour;
}, (date2) => {
  return date2.getHours();
});
var timeHours = timeHour.range;
var utcHour = timeInterval((date2) => {
  date2.setUTCMinutes(0, 0, 0);
}, (date2, step) => {
  date2.setTime(+date2 + step * durationHour);
}, (start, end) => {
  return (end - start) / durationHour;
}, (date2) => {
  return date2.getUTCHours();
});
var utcHours = utcHour.range;

// node_modules/d3-time/src/day.js
var timeDay = timeInterval(
  (date2) => date2.setHours(0, 0, 0, 0),
  (date2, step) => date2.setDate(date2.getDate() + step),
  (start, end) => (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationDay,
  (date2) => date2.getDate() - 1
);
var timeDays = timeDay.range;
var utcDay = timeInterval((date2) => {
  date2.setUTCHours(0, 0, 0, 0);
}, (date2, step) => {
  date2.setUTCDate(date2.getUTCDate() + step);
}, (start, end) => {
  return (end - start) / durationDay;
}, (date2) => {
  return date2.getUTCDate() - 1;
});
var utcDays = utcDay.range;
var unixDay = timeInterval((date2) => {
  date2.setUTCHours(0, 0, 0, 0);
}, (date2, step) => {
  date2.setUTCDate(date2.getUTCDate() + step);
}, (start, end) => {
  return (end - start) / durationDay;
}, (date2) => {
  return Math.floor(date2 / durationDay);
});
var unixDays = unixDay.range;

// node_modules/d3-time/src/week.js
function timeWeekday(i2) {
  return timeInterval((date2) => {
    date2.setDate(date2.getDate() - (date2.getDay() + 7 - i2) % 7);
    date2.setHours(0, 0, 0, 0);
  }, (date2, step) => {
    date2.setDate(date2.getDate() + step * 7);
  }, (start, end) => {
    return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationWeek;
  });
}
var timeSunday = timeWeekday(0);
var timeMonday = timeWeekday(1);
var timeTuesday = timeWeekday(2);
var timeWednesday = timeWeekday(3);
var timeThursday = timeWeekday(4);
var timeFriday = timeWeekday(5);
var timeSaturday = timeWeekday(6);
var timeSundays = timeSunday.range;
var timeMondays = timeMonday.range;
var timeTuesdays = timeTuesday.range;
var timeWednesdays = timeWednesday.range;
var timeThursdays = timeThursday.range;
var timeFridays = timeFriday.range;
var timeSaturdays = timeSaturday.range;
function utcWeekday(i2) {
  return timeInterval((date2) => {
    date2.setUTCDate(date2.getUTCDate() - (date2.getUTCDay() + 7 - i2) % 7);
    date2.setUTCHours(0, 0, 0, 0);
  }, (date2, step) => {
    date2.setUTCDate(date2.getUTCDate() + step * 7);
  }, (start, end) => {
    return (end - start) / durationWeek;
  });
}
var utcSunday = utcWeekday(0);
var utcMonday = utcWeekday(1);
var utcTuesday = utcWeekday(2);
var utcWednesday = utcWeekday(3);
var utcThursday = utcWeekday(4);
var utcFriday = utcWeekday(5);
var utcSaturday = utcWeekday(6);
var utcSundays = utcSunday.range;
var utcMondays = utcMonday.range;
var utcTuesdays = utcTuesday.range;
var utcWednesdays = utcWednesday.range;
var utcThursdays = utcThursday.range;
var utcFridays = utcFriday.range;
var utcSaturdays = utcSaturday.range;

// node_modules/d3-time/src/month.js
var timeMonth = timeInterval((date2) => {
  date2.setDate(1);
  date2.setHours(0, 0, 0, 0);
}, (date2, step) => {
  date2.setMonth(date2.getMonth() + step);
}, (start, end) => {
  return end.getMonth() - start.getMonth() + (end.getFullYear() - start.getFullYear()) * 12;
}, (date2) => {
  return date2.getMonth();
});
var timeMonths = timeMonth.range;
var utcMonth = timeInterval((date2) => {
  date2.setUTCDate(1);
  date2.setUTCHours(0, 0, 0, 0);
}, (date2, step) => {
  date2.setUTCMonth(date2.getUTCMonth() + step);
}, (start, end) => {
  return end.getUTCMonth() - start.getUTCMonth() + (end.getUTCFullYear() - start.getUTCFullYear()) * 12;
}, (date2) => {
  return date2.getUTCMonth();
});
var utcMonths = utcMonth.range;

// node_modules/d3-time/src/year.js
var timeYear = timeInterval((date2) => {
  date2.setMonth(0, 1);
  date2.setHours(0, 0, 0, 0);
}, (date2, step) => {
  date2.setFullYear(date2.getFullYear() + step);
}, (start, end) => {
  return end.getFullYear() - start.getFullYear();
}, (date2) => {
  return date2.getFullYear();
});
timeYear.every = (k2) => {
  return !isFinite(k2 = Math.floor(k2)) || !(k2 > 0) ? null : timeInterval((date2) => {
    date2.setFullYear(Math.floor(date2.getFullYear() / k2) * k2);
    date2.setMonth(0, 1);
    date2.setHours(0, 0, 0, 0);
  }, (date2, step) => {
    date2.setFullYear(date2.getFullYear() + step * k2);
  });
};
var timeYears = timeYear.range;
var utcYear = timeInterval((date2) => {
  date2.setUTCMonth(0, 1);
  date2.setUTCHours(0, 0, 0, 0);
}, (date2, step) => {
  date2.setUTCFullYear(date2.getUTCFullYear() + step);
}, (start, end) => {
  return end.getUTCFullYear() - start.getUTCFullYear();
}, (date2) => {
  return date2.getUTCFullYear();
});
utcYear.every = (k2) => {
  return !isFinite(k2 = Math.floor(k2)) || !(k2 > 0) ? null : timeInterval((date2) => {
    date2.setUTCFullYear(Math.floor(date2.getUTCFullYear() / k2) * k2);
    date2.setUTCMonth(0, 1);
    date2.setUTCHours(0, 0, 0, 0);
  }, (date2, step) => {
    date2.setUTCFullYear(date2.getUTCFullYear() + step * k2);
  });
};
var utcYears = utcYear.range;

// node_modules/d3-time/src/ticks.js
function ticker(year, month, week, day, hour, minute) {
  const tickIntervals = [
    [second, 1, durationSecond],
    [second, 5, 5 * durationSecond],
    [second, 15, 15 * durationSecond],
    [second, 30, 30 * durationSecond],
    [minute, 1, durationMinute],
    [minute, 5, 5 * durationMinute],
    [minute, 15, 15 * durationMinute],
    [minute, 30, 30 * durationMinute],
    [hour, 1, durationHour],
    [hour, 3, 3 * durationHour],
    [hour, 6, 6 * durationHour],
    [hour, 12, 12 * durationHour],
    [day, 1, durationDay],
    [day, 2, 2 * durationDay],
    [week, 1, durationWeek],
    [month, 1, durationMonth],
    [month, 3, 3 * durationMonth],
    [year, 1, durationYear]
  ];
  function ticks2(start, stop, count2) {
    const reverse3 = stop < start;
    if (reverse3)
      [start, stop] = [stop, start];
    const interval = count2 && typeof count2.range === "function" ? count2 : tickInterval(start, stop, count2);
    const ticks3 = interval ? interval.range(start, +stop + 1) : [];
    return reverse3 ? ticks3.reverse() : ticks3;
  }
  function tickInterval(start, stop, count2) {
    const target = Math.abs(stop - start) / count2;
    const i2 = bisector(([, , step2]) => step2).right(tickIntervals, target);
    if (i2 === tickIntervals.length)
      return year.every(tickStep(start / durationYear, stop / durationYear, count2));
    if (i2 === 0)
      return millisecond.every(Math.max(tickStep(start, stop, count2), 1));
    const [t3, step] = tickIntervals[target / tickIntervals[i2 - 1][2] < tickIntervals[i2][2] / target ? i2 - 1 : i2];
    return t3.every(step);
  }
  return [ticks2, tickInterval];
}
var [utcTicks, utcTickInterval] = ticker(utcYear, utcMonth, utcSunday, unixDay, utcHour, utcMinute);
var [timeTicks, timeTickInterval] = ticker(timeYear, timeMonth, timeSunday, timeDay, timeHour, timeMinute);

// node_modules/d3-time-format/src/locale.js
function localDate(d) {
  if (0 <= d.y && d.y < 100) {
    var date2 = new Date(-1, d.m, d.d, d.H, d.M, d.S, d.L);
    date2.setFullYear(d.y);
    return date2;
  }
  return new Date(d.y, d.m, d.d, d.H, d.M, d.S, d.L);
}
function utcDate(d) {
  if (0 <= d.y && d.y < 100) {
    var date2 = new Date(Date.UTC(-1, d.m, d.d, d.H, d.M, d.S, d.L));
    date2.setUTCFullYear(d.y);
    return date2;
  }
  return new Date(Date.UTC(d.y, d.m, d.d, d.H, d.M, d.S, d.L));
}
function newDate(y2, m, d) {
  return { y: y2, m, d, H: 0, M: 0, S: 0, L: 0 };
}
function formatLocale(locale3) {
  var locale_dateTime = locale3.dateTime, locale_date = locale3.date, locale_time = locale3.time, locale_periods = locale3.periods, locale_weekdays = locale3.days, locale_shortWeekdays = locale3.shortDays, locale_months = locale3.months, locale_shortMonths = locale3.shortMonths;
  var periodRe = formatRe(locale_periods), periodLookup = formatLookup(locale_periods), weekdayRe = formatRe(locale_weekdays), weekdayLookup = formatLookup(locale_weekdays), shortWeekdayRe = formatRe(locale_shortWeekdays), shortWeekdayLookup = formatLookup(locale_shortWeekdays), monthRe = formatRe(locale_months), monthLookup = formatLookup(locale_months), shortMonthRe = formatRe(locale_shortMonths), shortMonthLookup = formatLookup(locale_shortMonths);
  var formats = {
    "a": formatShortWeekday,
    "A": formatWeekday,
    "b": formatShortMonth,
    "B": formatMonth,
    "c": null,
    "d": formatDayOfMonth,
    "e": formatDayOfMonth,
    "f": formatMicroseconds,
    "g": formatYearISO,
    "G": formatFullYearISO,
    "H": formatHour24,
    "I": formatHour12,
    "j": formatDayOfYear,
    "L": formatMilliseconds,
    "m": formatMonthNumber,
    "M": formatMinutes,
    "p": formatPeriod,
    "q": formatQuarter,
    "Q": formatUnixTimestamp,
    "s": formatUnixTimestampSeconds,
    "S": formatSeconds,
    "u": formatWeekdayNumberMonday,
    "U": formatWeekNumberSunday,
    "V": formatWeekNumberISO,
    "w": formatWeekdayNumberSunday,
    "W": formatWeekNumberMonday,
    "x": null,
    "X": null,
    "y": formatYear,
    "Y": formatFullYear,
    "Z": formatZone,
    "%": formatLiteralPercent
  };
  var utcFormats = {
    "a": formatUTCShortWeekday,
    "A": formatUTCWeekday,
    "b": formatUTCShortMonth,
    "B": formatUTCMonth,
    "c": null,
    "d": formatUTCDayOfMonth,
    "e": formatUTCDayOfMonth,
    "f": formatUTCMicroseconds,
    "g": formatUTCYearISO,
    "G": formatUTCFullYearISO,
    "H": formatUTCHour24,
    "I": formatUTCHour12,
    "j": formatUTCDayOfYear,
    "L": formatUTCMilliseconds,
    "m": formatUTCMonthNumber,
    "M": formatUTCMinutes,
    "p": formatUTCPeriod,
    "q": formatUTCQuarter,
    "Q": formatUnixTimestamp,
    "s": formatUnixTimestampSeconds,
    "S": formatUTCSeconds,
    "u": formatUTCWeekdayNumberMonday,
    "U": formatUTCWeekNumberSunday,
    "V": formatUTCWeekNumberISO,
    "w": formatUTCWeekdayNumberSunday,
    "W": formatUTCWeekNumberMonday,
    "x": null,
    "X": null,
    "y": formatUTCYear,
    "Y": formatUTCFullYear,
    "Z": formatUTCZone,
    "%": formatLiteralPercent
  };
  var parses = {
    "a": parseShortWeekday,
    "A": parseWeekday,
    "b": parseShortMonth,
    "B": parseMonth,
    "c": parseLocaleDateTime,
    "d": parseDayOfMonth,
    "e": parseDayOfMonth,
    "f": parseMicroseconds,
    "g": parseYear,
    "G": parseFullYear,
    "H": parseHour24,
    "I": parseHour24,
    "j": parseDayOfYear,
    "L": parseMilliseconds,
    "m": parseMonthNumber,
    "M": parseMinutes,
    "p": parsePeriod,
    "q": parseQuarter,
    "Q": parseUnixTimestamp,
    "s": parseUnixTimestampSeconds,
    "S": parseSeconds,
    "u": parseWeekdayNumberMonday,
    "U": parseWeekNumberSunday,
    "V": parseWeekNumberISO,
    "w": parseWeekdayNumberSunday,
    "W": parseWeekNumberMonday,
    "x": parseLocaleDate,
    "X": parseLocaleTime,
    "y": parseYear,
    "Y": parseFullYear,
    "Z": parseZone,
    "%": parseLiteralPercent
  };
  formats.x = newFormat(locale_date, formats);
  formats.X = newFormat(locale_time, formats);
  formats.c = newFormat(locale_dateTime, formats);
  utcFormats.x = newFormat(locale_date, utcFormats);
  utcFormats.X = newFormat(locale_time, utcFormats);
  utcFormats.c = newFormat(locale_dateTime, utcFormats);
  function newFormat(specifier, formats2) {
    return function(date2) {
      var string2 = [], i2 = -1, j = 0, n2 = specifier.length, c4, pad2, format3;
      if (!(date2 instanceof Date))
        date2 = /* @__PURE__ */ new Date(+date2);
      while (++i2 < n2) {
        if (specifier.charCodeAt(i2) === 37) {
          string2.push(specifier.slice(j, i2));
          if ((pad2 = pads[c4 = specifier.charAt(++i2)]) != null)
            c4 = specifier.charAt(++i2);
          else
            pad2 = c4 === "e" ? " " : "0";
          if (format3 = formats2[c4])
            c4 = format3(date2, pad2);
          string2.push(c4);
          j = i2 + 1;
        }
      }
      string2.push(specifier.slice(j, i2));
      return string2.join("");
    };
  }
  function newParse(specifier, Z) {
    return function(string2) {
      var d = newDate(1900, void 0, 1), i2 = parseSpecifier(d, specifier, string2 += "", 0), week, day;
      if (i2 != string2.length)
        return null;
      if ("Q" in d)
        return new Date(d.Q);
      if ("s" in d)
        return new Date(d.s * 1e3 + ("L" in d ? d.L : 0));
      if (Z && !("Z" in d))
        d.Z = 0;
      if ("p" in d)
        d.H = d.H % 12 + d.p * 12;
      if (d.m === void 0)
        d.m = "q" in d ? d.q : 0;
      if ("V" in d) {
        if (d.V < 1 || d.V > 53)
          return null;
        if (!("w" in d))
          d.w = 1;
        if ("Z" in d) {
          week = utcDate(newDate(d.y, 0, 1)), day = week.getUTCDay();
          week = day > 4 || day === 0 ? utcMonday.ceil(week) : utcMonday(week);
          week = utcDay.offset(week, (d.V - 1) * 7);
          d.y = week.getUTCFullYear();
          d.m = week.getUTCMonth();
          d.d = week.getUTCDate() + (d.w + 6) % 7;
        } else {
          week = localDate(newDate(d.y, 0, 1)), day = week.getDay();
          week = day > 4 || day === 0 ? timeMonday.ceil(week) : timeMonday(week);
          week = timeDay.offset(week, (d.V - 1) * 7);
          d.y = week.getFullYear();
          d.m = week.getMonth();
          d.d = week.getDate() + (d.w + 6) % 7;
        }
      } else if ("W" in d || "U" in d) {
        if (!("w" in d))
          d.w = "u" in d ? d.u % 7 : "W" in d ? 1 : 0;
        day = "Z" in d ? utcDate(newDate(d.y, 0, 1)).getUTCDay() : localDate(newDate(d.y, 0, 1)).getDay();
        d.m = 0;
        d.d = "W" in d ? (d.w + 6) % 7 + d.W * 7 - (day + 5) % 7 : d.w + d.U * 7 - (day + 6) % 7;
      }
      if ("Z" in d) {
        d.H += d.Z / 100 | 0;
        d.M += d.Z % 100;
        return utcDate(d);
      }
      return localDate(d);
    };
  }
  function parseSpecifier(d, specifier, string2, j) {
    var i2 = 0, n2 = specifier.length, m = string2.length, c4, parse2;
    while (i2 < n2) {
      if (j >= m)
        return -1;
      c4 = specifier.charCodeAt(i2++);
      if (c4 === 37) {
        c4 = specifier.charAt(i2++);
        parse2 = parses[c4 in pads ? specifier.charAt(i2++) : c4];
        if (!parse2 || (j = parse2(d, string2, j)) < 0)
          return -1;
      } else if (c4 != string2.charCodeAt(j++)) {
        return -1;
      }
    }
    return j;
  }
  function parsePeriod(d, string2, i2) {
    var n2 = periodRe.exec(string2.slice(i2));
    return n2 ? (d.p = periodLookup.get(n2[0].toLowerCase()), i2 + n2[0].length) : -1;
  }
  function parseShortWeekday(d, string2, i2) {
    var n2 = shortWeekdayRe.exec(string2.slice(i2));
    return n2 ? (d.w = shortWeekdayLookup.get(n2[0].toLowerCase()), i2 + n2[0].length) : -1;
  }
  function parseWeekday(d, string2, i2) {
    var n2 = weekdayRe.exec(string2.slice(i2));
    return n2 ? (d.w = weekdayLookup.get(n2[0].toLowerCase()), i2 + n2[0].length) : -1;
  }
  function parseShortMonth(d, string2, i2) {
    var n2 = shortMonthRe.exec(string2.slice(i2));
    return n2 ? (d.m = shortMonthLookup.get(n2[0].toLowerCase()), i2 + n2[0].length) : -1;
  }
  function parseMonth(d, string2, i2) {
    var n2 = monthRe.exec(string2.slice(i2));
    return n2 ? (d.m = monthLookup.get(n2[0].toLowerCase()), i2 + n2[0].length) : -1;
  }
  function parseLocaleDateTime(d, string2, i2) {
    return parseSpecifier(d, locale_dateTime, string2, i2);
  }
  function parseLocaleDate(d, string2, i2) {
    return parseSpecifier(d, locale_date, string2, i2);
  }
  function parseLocaleTime(d, string2, i2) {
    return parseSpecifier(d, locale_time, string2, i2);
  }
  function formatShortWeekday(d) {
    return locale_shortWeekdays[d.getDay()];
  }
  function formatWeekday(d) {
    return locale_weekdays[d.getDay()];
  }
  function formatShortMonth(d) {
    return locale_shortMonths[d.getMonth()];
  }
  function formatMonth(d) {
    return locale_months[d.getMonth()];
  }
  function formatPeriod(d) {
    return locale_periods[+(d.getHours() >= 12)];
  }
  function formatQuarter(d) {
    return 1 + ~~(d.getMonth() / 3);
  }
  function formatUTCShortWeekday(d) {
    return locale_shortWeekdays[d.getUTCDay()];
  }
  function formatUTCWeekday(d) {
    return locale_weekdays[d.getUTCDay()];
  }
  function formatUTCShortMonth(d) {
    return locale_shortMonths[d.getUTCMonth()];
  }
  function formatUTCMonth(d) {
    return locale_months[d.getUTCMonth()];
  }
  function formatUTCPeriod(d) {
    return locale_periods[+(d.getUTCHours() >= 12)];
  }
  function formatUTCQuarter(d) {
    return 1 + ~~(d.getUTCMonth() / 3);
  }
  return {
    format: function(specifier) {
      var f = newFormat(specifier += "", formats);
      f.toString = function() {
        return specifier;
      };
      return f;
    },
    parse: function(specifier) {
      var p = newParse(specifier += "", false);
      p.toString = function() {
        return specifier;
      };
      return p;
    },
    utcFormat: function(specifier) {
      var f = newFormat(specifier += "", utcFormats);
      f.toString = function() {
        return specifier;
      };
      return f;
    },
    utcParse: function(specifier) {
      var p = newParse(specifier += "", true);
      p.toString = function() {
        return specifier;
      };
      return p;
    }
  };
}
var pads = { "-": "", "_": " ", "0": "0" };
var numberRe = /^\s*\d+/;
var percentRe = /^%/;
var requoteRe = /[\\^$*+?|[\]().{}]/g;
function pad(value, fill, width) {
  var sign3 = value < 0 ? "-" : "", string2 = (sign3 ? -value : value) + "", length2 = string2.length;
  return sign3 + (length2 < width ? new Array(width - length2 + 1).join(fill) + string2 : string2);
}
function requote(s2) {
  return s2.replace(requoteRe, "\\$&");
}
function formatRe(names) {
  return new RegExp("^(?:" + names.map(requote).join("|") + ")", "i");
}
function formatLookup(names) {
  return new Map(names.map((name2, i2) => [name2.toLowerCase(), i2]));
}
function parseWeekdayNumberSunday(d, string2, i2) {
  var n2 = numberRe.exec(string2.slice(i2, i2 + 1));
  return n2 ? (d.w = +n2[0], i2 + n2[0].length) : -1;
}
function parseWeekdayNumberMonday(d, string2, i2) {
  var n2 = numberRe.exec(string2.slice(i2, i2 + 1));
  return n2 ? (d.u = +n2[0], i2 + n2[0].length) : -1;
}
function parseWeekNumberSunday(d, string2, i2) {
  var n2 = numberRe.exec(string2.slice(i2, i2 + 2));
  return n2 ? (d.U = +n2[0], i2 + n2[0].length) : -1;
}
function parseWeekNumberISO(d, string2, i2) {
  var n2 = numberRe.exec(string2.slice(i2, i2 + 2));
  return n2 ? (d.V = +n2[0], i2 + n2[0].length) : -1;
}
function parseWeekNumberMonday(d, string2, i2) {
  var n2 = numberRe.exec(string2.slice(i2, i2 + 2));
  return n2 ? (d.W = +n2[0], i2 + n2[0].length) : -1;
}
function parseFullYear(d, string2, i2) {
  var n2 = numberRe.exec(string2.slice(i2, i2 + 4));
  return n2 ? (d.y = +n2[0], i2 + n2[0].length) : -1;
}
function parseYear(d, string2, i2) {
  var n2 = numberRe.exec(string2.slice(i2, i2 + 2));
  return n2 ? (d.y = +n2[0] + (+n2[0] > 68 ? 1900 : 2e3), i2 + n2[0].length) : -1;
}
function parseZone(d, string2, i2) {
  var n2 = /^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(string2.slice(i2, i2 + 6));
  return n2 ? (d.Z = n2[1] ? 0 : -(n2[2] + (n2[3] || "00")), i2 + n2[0].length) : -1;
}
function parseQuarter(d, string2, i2) {
  var n2 = numberRe.exec(string2.slice(i2, i2 + 1));
  return n2 ? (d.q = n2[0] * 3 - 3, i2 + n2[0].length) : -1;
}
function parseMonthNumber(d, string2, i2) {
  var n2 = numberRe.exec(string2.slice(i2, i2 + 2));
  return n2 ? (d.m = n2[0] - 1, i2 + n2[0].length) : -1;
}
function parseDayOfMonth(d, string2, i2) {
  var n2 = numberRe.exec(string2.slice(i2, i2 + 2));
  return n2 ? (d.d = +n2[0], i2 + n2[0].length) : -1;
}
function parseDayOfYear(d, string2, i2) {
  var n2 = numberRe.exec(string2.slice(i2, i2 + 3));
  return n2 ? (d.m = 0, d.d = +n2[0], i2 + n2[0].length) : -1;
}
function parseHour24(d, string2, i2) {
  var n2 = numberRe.exec(string2.slice(i2, i2 + 2));
  return n2 ? (d.H = +n2[0], i2 + n2[0].length) : -1;
}
function parseMinutes(d, string2, i2) {
  var n2 = numberRe.exec(string2.slice(i2, i2 + 2));
  return n2 ? (d.M = +n2[0], i2 + n2[0].length) : -1;
}
function parseSeconds(d, string2, i2) {
  var n2 = numberRe.exec(string2.slice(i2, i2 + 2));
  return n2 ? (d.S = +n2[0], i2 + n2[0].length) : -1;
}
function parseMilliseconds(d, string2, i2) {
  var n2 = numberRe.exec(string2.slice(i2, i2 + 3));
  return n2 ? (d.L = +n2[0], i2 + n2[0].length) : -1;
}
function parseMicroseconds(d, string2, i2) {
  var n2 = numberRe.exec(string2.slice(i2, i2 + 6));
  return n2 ? (d.L = Math.floor(n2[0] / 1e3), i2 + n2[0].length) : -1;
}
function parseLiteralPercent(d, string2, i2) {
  var n2 = percentRe.exec(string2.slice(i2, i2 + 1));
  return n2 ? i2 + n2[0].length : -1;
}
function parseUnixTimestamp(d, string2, i2) {
  var n2 = numberRe.exec(string2.slice(i2));
  return n2 ? (d.Q = +n2[0], i2 + n2[0].length) : -1;
}
function parseUnixTimestampSeconds(d, string2, i2) {
  var n2 = numberRe.exec(string2.slice(i2));
  return n2 ? (d.s = +n2[0], i2 + n2[0].length) : -1;
}
function formatDayOfMonth(d, p) {
  return pad(d.getDate(), p, 2);
}
function formatHour24(d, p) {
  return pad(d.getHours(), p, 2);
}
function formatHour12(d, p) {
  return pad(d.getHours() % 12 || 12, p, 2);
}
function formatDayOfYear(d, p) {
  return pad(1 + timeDay.count(timeYear(d), d), p, 3);
}
function formatMilliseconds(d, p) {
  return pad(d.getMilliseconds(), p, 3);
}
function formatMicroseconds(d, p) {
  return formatMilliseconds(d, p) + "000";
}
function formatMonthNumber(d, p) {
  return pad(d.getMonth() + 1, p, 2);
}
function formatMinutes(d, p) {
  return pad(d.getMinutes(), p, 2);
}
function formatSeconds(d, p) {
  return pad(d.getSeconds(), p, 2);
}
function formatWeekdayNumberMonday(d) {
  var day = d.getDay();
  return day === 0 ? 7 : day;
}
function formatWeekNumberSunday(d, p) {
  return pad(timeSunday.count(timeYear(d) - 1, d), p, 2);
}
function dISO(d) {
  var day = d.getDay();
  return day >= 4 || day === 0 ? timeThursday(d) : timeThursday.ceil(d);
}
function formatWeekNumberISO(d, p) {
  d = dISO(d);
  return pad(timeThursday.count(timeYear(d), d) + (timeYear(d).getDay() === 4), p, 2);
}
function formatWeekdayNumberSunday(d) {
  return d.getDay();
}
function formatWeekNumberMonday(d, p) {
  return pad(timeMonday.count(timeYear(d) - 1, d), p, 2);
}
function formatYear(d, p) {
  return pad(d.getFullYear() % 100, p, 2);
}
function formatYearISO(d, p) {
  d = dISO(d);
  return pad(d.getFullYear() % 100, p, 2);
}
function formatFullYear(d, p) {
  return pad(d.getFullYear() % 1e4, p, 4);
}
function formatFullYearISO(d, p) {
  var day = d.getDay();
  d = day >= 4 || day === 0 ? timeThursday(d) : timeThursday.ceil(d);
  return pad(d.getFullYear() % 1e4, p, 4);
}
function formatZone(d) {
  var z = d.getTimezoneOffset();
  return (z > 0 ? "-" : (z *= -1, "+")) + pad(z / 60 | 0, "0", 2) + pad(z % 60, "0", 2);
}
function formatUTCDayOfMonth(d, p) {
  return pad(d.getUTCDate(), p, 2);
}
function formatUTCHour24(d, p) {
  return pad(d.getUTCHours(), p, 2);
}
function formatUTCHour12(d, p) {
  return pad(d.getUTCHours() % 12 || 12, p, 2);
}
function formatUTCDayOfYear(d, p) {
  return pad(1 + utcDay.count(utcYear(d), d), p, 3);
}
function formatUTCMilliseconds(d, p) {
  return pad(d.getUTCMilliseconds(), p, 3);
}
function formatUTCMicroseconds(d, p) {
  return formatUTCMilliseconds(d, p) + "000";
}
function formatUTCMonthNumber(d, p) {
  return pad(d.getUTCMonth() + 1, p, 2);
}
function formatUTCMinutes(d, p) {
  return pad(d.getUTCMinutes(), p, 2);
}
function formatUTCSeconds(d, p) {
  return pad(d.getUTCSeconds(), p, 2);
}
function formatUTCWeekdayNumberMonday(d) {
  var dow = d.getUTCDay();
  return dow === 0 ? 7 : dow;
}
function formatUTCWeekNumberSunday(d, p) {
  return pad(utcSunday.count(utcYear(d) - 1, d), p, 2);
}
function UTCdISO(d) {
  var day = d.getUTCDay();
  return day >= 4 || day === 0 ? utcThursday(d) : utcThursday.ceil(d);
}
function formatUTCWeekNumberISO(d, p) {
  d = UTCdISO(d);
  return pad(utcThursday.count(utcYear(d), d) + (utcYear(d).getUTCDay() === 4), p, 2);
}
function formatUTCWeekdayNumberSunday(d) {
  return d.getUTCDay();
}
function formatUTCWeekNumberMonday(d, p) {
  return pad(utcMonday.count(utcYear(d) - 1, d), p, 2);
}
function formatUTCYear(d, p) {
  return pad(d.getUTCFullYear() % 100, p, 2);
}
function formatUTCYearISO(d, p) {
  d = UTCdISO(d);
  return pad(d.getUTCFullYear() % 100, p, 2);
}
function formatUTCFullYear(d, p) {
  return pad(d.getUTCFullYear() % 1e4, p, 4);
}
function formatUTCFullYearISO(d, p) {
  var day = d.getUTCDay();
  d = day >= 4 || day === 0 ? utcThursday(d) : utcThursday.ceil(d);
  return pad(d.getUTCFullYear() % 1e4, p, 4);
}
function formatUTCZone() {
  return "+0000";
}
function formatLiteralPercent() {
  return "%";
}
function formatUnixTimestamp(d) {
  return +d;
}
function formatUnixTimestampSeconds(d) {
  return Math.floor(+d / 1e3);
}

// node_modules/d3-time-format/src/defaultLocale.js
var locale2;
var timeFormat;
var timeParse;
var utcFormat;
var utcParse;
defaultLocale2({
  dateTime: "%x, %X",
  date: "%-m/%-d/%Y",
  time: "%-I:%M:%S %p",
  periods: ["AM", "PM"],
  days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
  shortDays: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
  months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
  shortMonths: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
});
function defaultLocale2(definition) {
  locale2 = formatLocale(definition);
  timeFormat = locale2.format;
  timeParse = locale2.parse;
  utcFormat = locale2.utcFormat;
  utcParse = locale2.utcParse;
  return locale2;
}

// node_modules/d3-scale/src/time.js
function date(t3) {
  return new Date(t3);
}
function number4(t3) {
  return t3 instanceof Date ? +t3 : +/* @__PURE__ */ new Date(+t3);
}
function calendar(ticks2, tickInterval, year, month, week, day, hour, minute, second2, format3) {
  var scale = continuous(), invert = scale.invert, domain = scale.domain;
  var formatMillisecond = format3(".%L"), formatSecond = format3(":%S"), formatMinute = format3("%I:%M"), formatHour = format3("%I %p"), formatDay = format3("%a %d"), formatWeek = format3("%b %d"), formatMonth = format3("%B"), formatYear2 = format3("%Y");
  function tickFormat2(date2) {
    return (second2(date2) < date2 ? formatMillisecond : minute(date2) < date2 ? formatSecond : hour(date2) < date2 ? formatMinute : day(date2) < date2 ? formatHour : month(date2) < date2 ? week(date2) < date2 ? formatDay : formatWeek : year(date2) < date2 ? formatMonth : formatYear2)(date2);
  }
  scale.invert = function(y2) {
    return new Date(invert(y2));
  };
  scale.domain = function(_) {
    return arguments.length ? domain(Array.from(_, number4)) : domain().map(date);
  };
  scale.ticks = function(interval) {
    var d = domain();
    return ticks2(d[0], d[d.length - 1], interval == null ? 10 : interval);
  };
  scale.tickFormat = function(count2, specifier) {
    return specifier == null ? tickFormat2 : format3(specifier);
  };
  scale.nice = function(interval) {
    var d = domain();
    if (!interval || typeof interval.range !== "function")
      interval = tickInterval(d[0], d[d.length - 1], interval == null ? 10 : interval);
    return interval ? domain(nice(d, interval)) : scale;
  };
  scale.copy = function() {
    return copy2(scale, calendar(ticks2, tickInterval, year, month, week, day, hour, minute, second2, format3));
  };
  return scale;
}
function time() {
  return initRange.apply(calendar(timeTicks, timeTickInterval, timeYear, timeMonth, timeSunday, timeDay, timeHour, timeMinute, second, timeFormat).domain([new Date(2e3, 0, 1), new Date(2e3, 0, 2)]), arguments);
}

// node_modules/d3-scale/src/utcTime.js
function utcTime() {
  return initRange.apply(calendar(utcTicks, utcTickInterval, utcYear, utcMonth, utcSunday, utcDay, utcHour, utcMinute, second, utcFormat).domain([Date.UTC(2e3, 0, 1), Date.UTC(2e3, 0, 2)]), arguments);
}

// node_modules/d3-scale/src/sequential.js
function transformer2() {
  var x0 = 0, x1 = 1, t02, t12, k10, transform, interpolator = identity3, clamp2 = false, unknown;
  function scale(x2) {
    return x2 == null || isNaN(x2 = +x2) ? unknown : interpolator(k10 === 0 ? 0.5 : (x2 = (transform(x2) - t02) * k10, clamp2 ? Math.max(0, Math.min(1, x2)) : x2));
  }
  scale.domain = function(_) {
    return arguments.length ? ([x0, x1] = _, t02 = transform(x0 = +x0), t12 = transform(x1 = +x1), k10 = t02 === t12 ? 0 : 1 / (t12 - t02), scale) : [x0, x1];
  };
  scale.clamp = function(_) {
    return arguments.length ? (clamp2 = !!_, scale) : clamp2;
  };
  scale.interpolator = function(_) {
    return arguments.length ? (interpolator = _, scale) : interpolator;
  };
  function range4(interpolate) {
    return function(_) {
      var r0, r1;
      return arguments.length ? ([r0, r1] = _, interpolator = interpolate(r0, r1), scale) : [interpolator(0), interpolator(1)];
    };
  }
  scale.range = range4(value_default);
  scale.rangeRound = range4(round_default);
  scale.unknown = function(_) {
    return arguments.length ? (unknown = _, scale) : unknown;
  };
  return function(t3) {
    transform = t3, t02 = t3(x0), t12 = t3(x1), k10 = t02 === t12 ? 0 : 1 / (t12 - t02);
    return scale;
  };
}
function copy3(source, target) {
  return target.domain(source.domain()).interpolator(source.interpolator()).clamp(source.clamp()).unknown(source.unknown());
}
function sequential() {
  var scale = linearish(transformer2()(identity3));
  scale.copy = function() {
    return copy3(scale, sequential());
  };
  return initInterpolator.apply(scale, arguments);
}
function sequentialLog() {
  var scale = loggish(transformer2()).domain([1, 10]);
  scale.copy = function() {
    return copy3(scale, sequentialLog()).base(scale.base());
  };
  return initInterpolator.apply(scale, arguments);
}
function sequentialSymlog() {
  var scale = symlogish(transformer2());
  scale.copy = function() {
    return copy3(scale, sequentialSymlog()).constant(scale.constant());
  };
  return initInterpolator.apply(scale, arguments);
}
function sequentialPow() {
  var scale = powish(transformer2());
  scale.copy = function() {
    return copy3(scale, sequentialPow()).exponent(scale.exponent());
  };
  return initInterpolator.apply(scale, arguments);
}
function sequentialSqrt() {
  return sequentialPow.apply(null, arguments).exponent(0.5);
}

// node_modules/d3-scale/src/sequentialQuantile.js
function sequentialQuantile() {
  var domain = [], interpolator = identity3;
  function scale(x2) {
    if (x2 != null && !isNaN(x2 = +x2))
      return interpolator((bisect_default(domain, x2, 1) - 1) / (domain.length - 1));
  }
  scale.domain = function(_) {
    if (!arguments.length)
      return domain.slice();
    domain = [];
    for (let d of _)
      if (d != null && !isNaN(d = +d))
        domain.push(d);
    domain.sort(ascending);
    return scale;
  };
  scale.interpolator = function(_) {
    return arguments.length ? (interpolator = _, scale) : interpolator;
  };
  scale.range = function() {
    return domain.map((d, i2) => interpolator(i2 / (domain.length - 1)));
  };
  scale.quantiles = function(n2) {
    return Array.from({ length: n2 + 1 }, (_, i2) => quantile(domain, i2 / n2));
  };
  scale.copy = function() {
    return sequentialQuantile(interpolator).domain(domain);
  };
  return initInterpolator.apply(scale, arguments);
}

// node_modules/d3-scale/src/diverging.js
function transformer3() {
  var x0 = 0, x1 = 0.5, x2 = 1, s2 = 1, t02, t12, t22, k10, k21, interpolator = identity3, transform, clamp2 = false, unknown;
  function scale(x3) {
    return isNaN(x3 = +x3) ? unknown : (x3 = 0.5 + ((x3 = +transform(x3)) - t12) * (s2 * x3 < s2 * t12 ? k10 : k21), interpolator(clamp2 ? Math.max(0, Math.min(1, x3)) : x3));
  }
  scale.domain = function(_) {
    return arguments.length ? ([x0, x1, x2] = _, t02 = transform(x0 = +x0), t12 = transform(x1 = +x1), t22 = transform(x2 = +x2), k10 = t02 === t12 ? 0 : 0.5 / (t12 - t02), k21 = t12 === t22 ? 0 : 0.5 / (t22 - t12), s2 = t12 < t02 ? -1 : 1, scale) : [x0, x1, x2];
  };
  scale.clamp = function(_) {
    return arguments.length ? (clamp2 = !!_, scale) : clamp2;
  };
  scale.interpolator = function(_) {
    return arguments.length ? (interpolator = _, scale) : interpolator;
  };
  function range4(interpolate) {
    return function(_) {
      var r0, r1, r22;
      return arguments.length ? ([r0, r1, r22] = _, interpolator = piecewise(interpolate, [r0, r1, r22]), scale) : [interpolator(0), interpolator(0.5), interpolator(1)];
    };
  }
  scale.range = range4(value_default);
  scale.rangeRound = range4(round_default);
  scale.unknown = function(_) {
    return arguments.length ? (unknown = _, scale) : unknown;
  };
  return function(t3) {
    transform = t3, t02 = t3(x0), t12 = t3(x1), t22 = t3(x2), k10 = t02 === t12 ? 0 : 0.5 / (t12 - t02), k21 = t12 === t22 ? 0 : 0.5 / (t22 - t12), s2 = t12 < t02 ? -1 : 1;
    return scale;
  };
}
function diverging() {
  var scale = linearish(transformer3()(identity3));
  scale.copy = function() {
    return copy3(scale, diverging());
  };
  return initInterpolator.apply(scale, arguments);
}
function divergingLog() {
  var scale = loggish(transformer3()).domain([0.1, 1, 10]);
  scale.copy = function() {
    return copy3(scale, divergingLog()).base(scale.base());
  };
  return initInterpolator.apply(scale, arguments);
}
function divergingSymlog() {
  var scale = symlogish(transformer3());
  scale.copy = function() {
    return copy3(scale, divergingSymlog()).constant(scale.constant());
  };
  return initInterpolator.apply(scale, arguments);
}
function divergingPow() {
  var scale = powish(transformer3());
  scale.copy = function() {
    return copy3(scale, divergingPow()).exponent(scale.exponent());
  };
  return initInterpolator.apply(scale, arguments);
}
function divergingSqrt() {
  return divergingPow.apply(null, arguments).exponent(0.5);
}

// node_modules/recharts-scale/es6/getNiceTickValues.js
var import_decimal2 = __toESM(require_decimal());

// node_modules/recharts-scale/es6/util/utils.js
function _toConsumableArray5(arr) {
  return _arrayWithoutHoles5(arr) || _iterableToArray6(arr) || _unsupportedIterableToArray11(arr) || _nonIterableSpread5();
}
function _nonIterableSpread5() {
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _unsupportedIterableToArray11(o, minLen) {
  if (!o)
    return;
  if (typeof o === "string")
    return _arrayLikeToArray11(o, minLen);
  var n2 = Object.prototype.toString.call(o).slice(8, -1);
  if (n2 === "Object" && o.constructor)
    n2 = o.constructor.name;
  if (n2 === "Map" || n2 === "Set")
    return Array.from(o);
  if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2))
    return _arrayLikeToArray11(o, minLen);
}
function _iterableToArray6(iter) {
  if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter))
    return Array.from(iter);
}
function _arrayWithoutHoles5(arr) {
  if (Array.isArray(arr))
    return _arrayLikeToArray11(arr);
}
function _arrayLikeToArray11(arr, len) {
  if (len == null || len > arr.length)
    len = arr.length;
  for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++) {
    arr2[i2] = arr[i2];
  }
  return arr2;
}
var identity5 = function identity6(i2) {
  return i2;
};
var PLACE_HOLDER = {
  "@@functional/placeholder": true
};
var isPlaceHolder = function isPlaceHolder2(val) {
  return val === PLACE_HOLDER;
};
var curry0 = function curry02(fn) {
  return function _curried() {
    if (arguments.length === 0 || arguments.length === 1 && isPlaceHolder(arguments.length <= 0 ? void 0 : arguments[0])) {
      return _curried;
    }
    return fn.apply(void 0, arguments);
  };
};
var curryN = function curryN2(n2, fn) {
  if (n2 === 1) {
    return fn;
  }
  return curry0(function() {
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    var argsLength = args.filter(function(arg) {
      return arg !== PLACE_HOLDER;
    }).length;
    if (argsLength >= n2) {
      return fn.apply(void 0, args);
    }
    return curryN2(n2 - argsLength, curry0(function() {
      for (var _len2 = arguments.length, restArgs = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
        restArgs[_key2] = arguments[_key2];
      }
      var newArgs = args.map(function(arg) {
        return isPlaceHolder(arg) ? restArgs.shift() : arg;
      });
      return fn.apply(void 0, _toConsumableArray5(newArgs).concat(restArgs));
    }));
  });
};
var curry2 = function curry3(fn) {
  return curryN(fn.length, fn);
};
var range2 = function range3(begin, end) {
  var arr = [];
  for (var i2 = begin; i2 < end; ++i2) {
    arr[i2 - begin] = i2;
  }
  return arr;
};
var map2 = curry2(function(fn, arr) {
  if (Array.isArray(arr)) {
    return arr.map(fn);
  }
  return Object.keys(arr).map(function(key) {
    return arr[key];
  }).map(fn);
});
var compose = function compose2() {
  for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
    args[_key3] = arguments[_key3];
  }
  if (!args.length) {
    return identity5;
  }
  var fns = args.reverse();
  var firstFn = fns[0];
  var tailsFn = fns.slice(1);
  return function() {
    return tailsFn.reduce(function(res, fn) {
      return fn(res);
    }, firstFn.apply(void 0, arguments));
  };
};
var reverse = function reverse2(arr) {
  if (Array.isArray(arr)) {
    return arr.reverse();
  }
  return arr.split("").reverse.join("");
};
var memoize2 = function memoize3(fn) {
  var lastArgs = null;
  var lastResult2 = null;
  return function() {
    for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
      args[_key4] = arguments[_key4];
    }
    if (lastArgs && args.every(function(val, i2) {
      return val === lastArgs[i2];
    })) {
      return lastResult2;
    }
    lastArgs = args;
    lastResult2 = fn.apply(void 0, args);
    return lastResult2;
  };
};

// node_modules/recharts-scale/es6/util/arithmetic.js
var import_decimal = __toESM(require_decimal());
function getDigitCount(value) {
  var result;
  if (value === 0) {
    result = 1;
  } else {
    result = Math.floor(new import_decimal.default(value).abs().log(10).toNumber()) + 1;
  }
  return result;
}
function rangeStep(start, end, step) {
  var num = new import_decimal.default(start);
  var i2 = 0;
  var result = [];
  while (num.lt(end) && i2 < 1e5) {
    result.push(num.toNumber());
    num = num.add(step);
    i2++;
  }
  return result;
}
var interpolateNumber3 = curry2(function(a2, b, t3) {
  var newA = +a2;
  var newB = +b;
  return newA + t3 * (newB - newA);
});
var uninterpolateNumber = curry2(function(a2, b, x2) {
  var diff = b - +a2;
  diff = diff || Infinity;
  return (x2 - a2) / diff;
});
var uninterpolateTruncation = curry2(function(a2, b, x2) {
  var diff = b - +a2;
  diff = diff || Infinity;
  return Math.max(0, Math.min(1, (x2 - a2) / diff));
});
var arithmetic_default = {
  rangeStep,
  getDigitCount,
  interpolateNumber: interpolateNumber3,
  uninterpolateNumber,
  uninterpolateTruncation
};

// node_modules/recharts-scale/es6/getNiceTickValues.js
function _toConsumableArray6(arr) {
  return _arrayWithoutHoles6(arr) || _iterableToArray7(arr) || _unsupportedIterableToArray12(arr) || _nonIterableSpread6();
}
function _nonIterableSpread6() {
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _iterableToArray7(iter) {
  if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter))
    return Array.from(iter);
}
function _arrayWithoutHoles6(arr) {
  if (Array.isArray(arr))
    return _arrayLikeToArray12(arr);
}
function _slicedToArray7(arr, i2) {
  return _arrayWithHoles8(arr) || _iterableToArrayLimit7(arr, i2) || _unsupportedIterableToArray12(arr, i2) || _nonIterableRest8();
}
function _nonIterableRest8() {
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _unsupportedIterableToArray12(o, minLen) {
  if (!o)
    return;
  if (typeof o === "string")
    return _arrayLikeToArray12(o, minLen);
  var n2 = Object.prototype.toString.call(o).slice(8, -1);
  if (n2 === "Object" && o.constructor)
    n2 = o.constructor.name;
  if (n2 === "Map" || n2 === "Set")
    return Array.from(o);
  if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2))
    return _arrayLikeToArray12(o, minLen);
}
function _arrayLikeToArray12(arr, len) {
  if (len == null || len > arr.length)
    len = arr.length;
  for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++) {
    arr2[i2] = arr[i2];
  }
  return arr2;
}
function _iterableToArrayLimit7(arr, i2) {
  if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr)))
    return;
  var _arr = [];
  var _n = true;
  var _d = false;
  var _e = void 0;
  try {
    for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
      _arr.push(_s.value);
      if (i2 && _arr.length === i2)
        break;
    }
  } catch (err) {
    _d = true;
    _e = err;
  } finally {
    try {
      if (!_n && _i["return"] != null)
        _i["return"]();
    } finally {
      if (_d)
        throw _e;
    }
  }
  return _arr;
}
function _arrayWithHoles8(arr) {
  if (Array.isArray(arr))
    return arr;
}
function getValidInterval(_ref18) {
  var _ref22 = _slicedToArray7(_ref18, 2), min3 = _ref22[0], max3 = _ref22[1];
  var validMin = min3, validMax = max3;
  if (min3 > max3) {
    validMin = max3;
    validMax = min3;
  }
  return [validMin, validMax];
}
function getFormatStep(roughStep, allowDecimals, correctionFactor) {
  if (roughStep.lte(0)) {
    return new import_decimal2.default(0);
  }
  var digitCount = arithmetic_default.getDigitCount(roughStep.toNumber());
  var digitCountValue = new import_decimal2.default(10).pow(digitCount);
  var stepRatio = roughStep.div(digitCountValue);
  var stepRatioScale = digitCount !== 1 ? 0.05 : 0.1;
  var amendStepRatio = new import_decimal2.default(Math.ceil(stepRatio.div(stepRatioScale).toNumber())).add(correctionFactor).mul(stepRatioScale);
  var formatStep = amendStepRatio.mul(digitCountValue);
  return allowDecimals ? formatStep : new import_decimal2.default(Math.ceil(formatStep));
}
function getTickOfSingleValue(value, tickCount, allowDecimals) {
  var step = 1;
  var middle = new import_decimal2.default(value);
  if (!middle.isint() && allowDecimals) {
    var absVal = Math.abs(value);
    if (absVal < 1) {
      step = new import_decimal2.default(10).pow(arithmetic_default.getDigitCount(value) - 1);
      middle = new import_decimal2.default(Math.floor(middle.div(step).toNumber())).mul(step);
    } else if (absVal > 1) {
      middle = new import_decimal2.default(Math.floor(value));
    }
  } else if (value === 0) {
    middle = new import_decimal2.default(Math.floor((tickCount - 1) / 2));
  } else if (!allowDecimals) {
    middle = new import_decimal2.default(Math.floor(value));
  }
  var middleIndex = Math.floor((tickCount - 1) / 2);
  var fn = compose(map2(function(n2) {
    return middle.add(new import_decimal2.default(n2 - middleIndex).mul(step)).toNumber();
  }), range2);
  return fn(0, tickCount);
}
function calculateStep(min3, max3, tickCount, allowDecimals) {
  var correctionFactor = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : 0;
  if (!Number.isFinite((max3 - min3) / (tickCount - 1))) {
    return {
      step: new import_decimal2.default(0),
      tickMin: new import_decimal2.default(0),
      tickMax: new import_decimal2.default(0)
    };
  }
  var step = getFormatStep(new import_decimal2.default(max3).sub(min3).div(tickCount - 1), allowDecimals, correctionFactor);
  var middle;
  if (min3 <= 0 && max3 >= 0) {
    middle = new import_decimal2.default(0);
  } else {
    middle = new import_decimal2.default(min3).add(max3).div(2);
    middle = middle.sub(new import_decimal2.default(middle).mod(step));
  }
  var belowCount = Math.ceil(middle.sub(min3).div(step).toNumber());
  var upCount = Math.ceil(new import_decimal2.default(max3).sub(middle).div(step).toNumber());
  var scaleCount = belowCount + upCount + 1;
  if (scaleCount > tickCount) {
    return calculateStep(min3, max3, tickCount, allowDecimals, correctionFactor + 1);
  }
  if (scaleCount < tickCount) {
    upCount = max3 > 0 ? upCount + (tickCount - scaleCount) : upCount;
    belowCount = max3 > 0 ? belowCount : belowCount + (tickCount - scaleCount);
  }
  return {
    step,
    tickMin: middle.sub(new import_decimal2.default(belowCount).mul(step)),
    tickMax: middle.add(new import_decimal2.default(upCount).mul(step))
  };
}
function getNiceTickValuesFn(_ref32) {
  var _ref42 = _slicedToArray7(_ref32, 2), min3 = _ref42[0], max3 = _ref42[1];
  var tickCount = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 6;
  var allowDecimals = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : true;
  var count2 = Math.max(tickCount, 2);
  var _getValidInterval = getValidInterval([min3, max3]), _getValidInterval2 = _slicedToArray7(_getValidInterval, 2), cormin = _getValidInterval2[0], cormax = _getValidInterval2[1];
  if (cormin === -Infinity || cormax === Infinity) {
    var _values = cormax === Infinity ? [cormin].concat(_toConsumableArray6(range2(0, tickCount - 1).map(function() {
      return Infinity;
    }))) : [].concat(_toConsumableArray6(range2(0, tickCount - 1).map(function() {
      return -Infinity;
    })), [cormax]);
    return min3 > max3 ? reverse(_values) : _values;
  }
  if (cormin === cormax) {
    return getTickOfSingleValue(cormin, tickCount, allowDecimals);
  }
  var _calculateStep = calculateStep(cormin, cormax, count2, allowDecimals), step = _calculateStep.step, tickMin = _calculateStep.tickMin, tickMax = _calculateStep.tickMax;
  var values2 = arithmetic_default.rangeStep(tickMin, tickMax.add(new import_decimal2.default(0.1).mul(step)), step);
  return min3 > max3 ? reverse(values2) : values2;
}
function getTickValuesFn(_ref52) {
  var _ref62 = _slicedToArray7(_ref52, 2), min3 = _ref62[0], max3 = _ref62[1];
  var tickCount = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 6;
  var allowDecimals = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : true;
  var count2 = Math.max(tickCount, 2);
  var _getValidInterval3 = getValidInterval([min3, max3]), _getValidInterval4 = _slicedToArray7(_getValidInterval3, 2), cormin = _getValidInterval4[0], cormax = _getValidInterval4[1];
  if (cormin === -Infinity || cormax === Infinity) {
    return [min3, max3];
  }
  if (cormin === cormax) {
    return getTickOfSingleValue(cormin, tickCount, allowDecimals);
  }
  var step = getFormatStep(new import_decimal2.default(cormax).sub(cormin).div(count2 - 1), allowDecimals, 0);
  var fn = compose(map2(function(n2) {
    return new import_decimal2.default(cormin).add(new import_decimal2.default(n2).mul(step)).toNumber();
  }), range2);
  var values2 = fn(0, count2).filter(function(entry) {
    return entry >= cormin && entry <= cormax;
  });
  return min3 > max3 ? reverse(values2) : values2;
}
function getTickValuesFixedDomainFn(_ref72, tickCount) {
  var _ref82 = _slicedToArray7(_ref72, 2), min3 = _ref82[0], max3 = _ref82[1];
  var allowDecimals = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : true;
  var _getValidInterval5 = getValidInterval([min3, max3]), _getValidInterval6 = _slicedToArray7(_getValidInterval5, 2), cormin = _getValidInterval6[0], cormax = _getValidInterval6[1];
  if (cormin === -Infinity || cormax === Infinity) {
    return [min3, max3];
  }
  if (cormin === cormax) {
    return [cormin];
  }
  var count2 = Math.max(tickCount, 2);
  var step = getFormatStep(new import_decimal2.default(cormax).sub(cormin).div(count2 - 1), allowDecimals, 0);
  var values2 = [].concat(_toConsumableArray6(arithmetic_default.rangeStep(new import_decimal2.default(cormin), new import_decimal2.default(cormax).sub(new import_decimal2.default(0.99).mul(step)), step)), [cormax]);
  return min3 > max3 ? reverse(values2) : values2;
}
var getNiceTickValues = memoize2(getNiceTickValuesFn);
var getTickValues = memoize2(getTickValuesFn);
var getTickValuesFixedDomain = memoize2(getTickValuesFixedDomainFn);

// node_modules/recharts/es6/cartesian/ErrorBar.js
var import_react91 = __toESM(require_react());
var _excluded13 = ["offset", "layout", "width", "dataKey", "data", "dataPointFormatter", "xAxis", "yAxis"];
function _extends15() {
  _extends15 = Object.assign ? Object.assign.bind() : function(target) {
    for (var i2 = 1; i2 < arguments.length; i2++) {
      var source = arguments[i2];
      for (var key in source) {
        if (Object.prototype.hasOwnProperty.call(source, key)) {
          target[key] = source[key];
        }
      }
    }
    return target;
  };
  return _extends15.apply(this, arguments);
}
function _slicedToArray8(arr, i2) {
  return _arrayWithHoles9(arr) || _iterableToArrayLimit8(arr, i2) || _unsupportedIterableToArray13(arr, i2) || _nonIterableRest9();
}
function _nonIterableRest9() {
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _unsupportedIterableToArray13(o, minLen) {
  if (!o)
    return;
  if (typeof o === "string")
    return _arrayLikeToArray13(o, minLen);
  var n2 = Object.prototype.toString.call(o).slice(8, -1);
  if (n2 === "Object" && o.constructor)
    n2 = o.constructor.name;
  if (n2 === "Map" || n2 === "Set")
    return Array.from(o);
  if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2))
    return _arrayLikeToArray13(o, minLen);
}
function _arrayLikeToArray13(arr, len) {
  if (len == null || len > arr.length)
    len = arr.length;
  for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++)
    arr2[i2] = arr[i2];
  return arr2;
}
function _iterableToArrayLimit8(r3, l) {
  var t3 = null == r3 ? null : "undefined" != typeof Symbol && r3[Symbol.iterator] || r3["@@iterator"];
  if (null != t3) {
    var e3, n2, i2, u, a2 = [], f = true, o = false;
    try {
      if (i2 = (t3 = t3.call(r3)).next, 0 === l) {
        if (Object(t3) !== t3)
          return;
        f = false;
      } else
        for (; !(f = (e3 = i2.call(t3)).done) && (a2.push(e3.value), a2.length !== l); f = true)
          ;
    } catch (r4) {
      o = true, n2 = r4;
    } finally {
      try {
        if (!f && null != t3["return"] && (u = t3["return"](), Object(u) !== u))
          return;
      } finally {
        if (o)
          throw n2;
      }
    }
    return a2;
  }
}
function _arrayWithHoles9(arr) {
  if (Array.isArray(arr))
    return arr;
}
function _objectWithoutProperties9(source, excluded) {
  if (source == null)
    return {};
  var target = _objectWithoutPropertiesLoose13(source, excluded);
  var key, i2;
  if (Object.getOwnPropertySymbols) {
    var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
    for (i2 = 0; i2 < sourceSymbolKeys.length; i2++) {
      key = sourceSymbolKeys[i2];
      if (excluded.indexOf(key) >= 0)
        continue;
      if (!Object.prototype.propertyIsEnumerable.call(source, key))
        continue;
      target[key] = source[key];
    }
  }
  return target;
}
function _objectWithoutPropertiesLoose13(source, excluded) {
  if (source == null)
    return {};
  var target = {};
  var sourceKeys = Object.keys(source);
  var key, i2;
  for (i2 = 0; i2 < sourceKeys.length; i2++) {
    key = sourceKeys[i2];
    if (excluded.indexOf(key) >= 0)
      continue;
    target[key] = source[key];
  }
  return target;
}
function ErrorBar(props) {
  var offset = props.offset, layout = props.layout, width = props.width, dataKey = props.dataKey, data = props.data, dataPointFormatter = props.dataPointFormatter, xAxis = props.xAxis, yAxis = props.yAxis, others = _objectWithoutProperties9(props, _excluded13);
  var svgProps = filterProps(others);
  var errorBars = data.map(function(entry, i2) {
    var _dataPointFormatter = dataPointFormatter(entry, dataKey), x2 = _dataPointFormatter.x, y2 = _dataPointFormatter.y, value = _dataPointFormatter.value, errorVal = _dataPointFormatter.errorVal;
    if (!errorVal) {
      return null;
    }
    var lineCoordinates = [];
    var lowBound, highBound;
    if (Array.isArray(errorVal)) {
      var _errorVal = _slicedToArray8(errorVal, 2);
      lowBound = _errorVal[0];
      highBound = _errorVal[1];
    } else {
      lowBound = highBound = errorVal;
    }
    if (layout === "vertical") {
      var scale = xAxis.scale;
      var yMid = y2 + offset;
      var yMin = yMid + width;
      var yMax = yMid - width;
      var xMin = scale(value - lowBound);
      var xMax = scale(value + highBound);
      lineCoordinates.push({
        x1: xMax,
        y1: yMin,
        x2: xMax,
        y2: yMax
      });
      lineCoordinates.push({
        x1: xMin,
        y1: yMid,
        x2: xMax,
        y2: yMid
      });
      lineCoordinates.push({
        x1: xMin,
        y1: yMin,
        x2: xMin,
        y2: yMax
      });
    } else if (layout === "horizontal") {
      var _scale2 = yAxis.scale;
      var xMid = x2 + offset;
      var _xMin = xMid - width;
      var _xMax = xMid + width;
      var _yMin = _scale2(value - lowBound);
      var _yMax = _scale2(value + highBound);
      lineCoordinates.push({
        x1: _xMin,
        y1: _yMax,
        x2: _xMax,
        y2: _yMax
      });
      lineCoordinates.push({
        x1: xMid,
        y1: _yMin,
        x2: xMid,
        y2: _yMax
      });
      lineCoordinates.push({
        x1: _xMin,
        y1: _yMin,
        x2: _xMax,
        y2: _yMin
      });
    }
    return (
      // eslint-disable-next-line react/no-array-index-key
      /* @__PURE__ */ import_react91.default.createElement(Layer, _extends15({
        className: "recharts-errorBar",
        key: "bar-".concat(i2)
      }, svgProps), lineCoordinates.map(function(coordinates, index) {
        return (
          // eslint-disable-next-line react/no-array-index-key
          /* @__PURE__ */ import_react91.default.createElement("line", _extends15({}, coordinates, {
            key: "line-".concat(index)
          }))
        );
      }))
    );
  });
  return /* @__PURE__ */ import_react91.default.createElement(Layer, {
    className: "recharts-errorBars"
  }, errorBars);
}
ErrorBar.defaultProps = {
  stroke: "black",
  strokeWidth: 1.5,
  width: 5,
  offset: 0,
  layout: "horizontal"
};
ErrorBar.displayName = "ErrorBar";

// node_modules/recharts/es6/util/getLegendProps.js
function _typeof17(o) {
  "@babel/helpers - typeof";
  return _typeof17 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
    return typeof o2;
  } : function(o2) {
    return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
  }, _typeof17(o);
}
function ownKeys12(e3, r3) {
  var t3 = Object.keys(e3);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e3);
    r3 && (o = o.filter(function(r4) {
      return Object.getOwnPropertyDescriptor(e3, r4).enumerable;
    })), t3.push.apply(t3, o);
  }
  return t3;
}
function _objectSpread12(e3) {
  for (var r3 = 1; r3 < arguments.length; r3++) {
    var t3 = null != arguments[r3] ? arguments[r3] : {};
    r3 % 2 ? ownKeys12(Object(t3), true).forEach(function(r4) {
      _defineProperty12(e3, r4, t3[r4]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e3, Object.getOwnPropertyDescriptors(t3)) : ownKeys12(Object(t3)).forEach(function(r4) {
      Object.defineProperty(e3, r4, Object.getOwnPropertyDescriptor(t3, r4));
    });
  }
  return e3;
}
function _defineProperty12(obj, key, value) {
  key = _toPropertyKey13(key);
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
function _toPropertyKey13(arg) {
  var key = _toPrimitive13(arg, "string");
  return _typeof17(key) === "symbol" ? key : String(key);
}
function _toPrimitive13(input, hint) {
  if (_typeof17(input) !== "object" || input === null)
    return input;
  var prim = input[Symbol.toPrimitive];
  if (prim !== void 0) {
    var res = prim.call(input, hint || "default");
    if (_typeof17(res) !== "object")
      return res;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (hint === "string" ? String : Number)(input);
}
var getLegendProps = function getLegendProps2(_ref18) {
  var children = _ref18.children, formattedGraphicalItems = _ref18.formattedGraphicalItems, legendWidth = _ref18.legendWidth, legendContent = _ref18.legendContent;
  var legendItem = findChildByType(children, Legend);
  if (!legendItem) {
    return null;
  }
  var legendData;
  if (legendItem.props && legendItem.props.payload) {
    legendData = legendItem.props && legendItem.props.payload;
  } else if (legendContent === "children") {
    legendData = (formattedGraphicalItems || []).reduce(function(result, _ref22) {
      var item = _ref22.item, props = _ref22.props;
      var data = props.sectors || props.data || [];
      return result.concat(data.map(function(entry) {
        return {
          type: legendItem.props.iconType || item.props.legendType,
          value: entry.name,
          color: entry.fill,
          payload: entry
        };
      }));
    }, []);
  } else {
    legendData = (formattedGraphicalItems || []).map(function(_ref32) {
      var item = _ref32.item;
      var _item$props = item.props, dataKey = _item$props.dataKey, name2 = _item$props.name, legendType = _item$props.legendType, hide = _item$props.hide;
      return {
        inactive: hide,
        dataKey,
        type: legendItem.props.iconType || legendType || "square",
        color: getMainColorOfGraphicItem(item),
        value: name2 || dataKey,
        // @ts-expect-error property strokeDasharray is required in Payload but optional in props
        payload: item.props
      };
    });
  }
  return _objectSpread12(_objectSpread12(_objectSpread12({}, legendItem.props), Legend.getWithHeight(legendItem, legendWidth)), {}, {
    payload: legendData,
    item: legendItem
  });
};

// node_modules/recharts/es6/util/ChartUtils.js
function _typeof18(o) {
  "@babel/helpers - typeof";
  return _typeof18 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
    return typeof o2;
  } : function(o2) {
    return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
  }, _typeof18(o);
}
function ownKeys13(e3, r3) {
  var t3 = Object.keys(e3);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e3);
    r3 && (o = o.filter(function(r4) {
      return Object.getOwnPropertyDescriptor(e3, r4).enumerable;
    })), t3.push.apply(t3, o);
  }
  return t3;
}
function _objectSpread13(e3) {
  for (var r3 = 1; r3 < arguments.length; r3++) {
    var t3 = null != arguments[r3] ? arguments[r3] : {};
    r3 % 2 ? ownKeys13(Object(t3), true).forEach(function(r4) {
      _defineProperty13(e3, r4, t3[r4]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e3, Object.getOwnPropertyDescriptors(t3)) : ownKeys13(Object(t3)).forEach(function(r4) {
      Object.defineProperty(e3, r4, Object.getOwnPropertyDescriptor(t3, r4));
    });
  }
  return e3;
}
function _defineProperty13(obj, key, value) {
  key = _toPropertyKey14(key);
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
function _toPropertyKey14(arg) {
  var key = _toPrimitive14(arg, "string");
  return _typeof18(key) === "symbol" ? key : String(key);
}
function _toPrimitive14(input, hint) {
  if (_typeof18(input) !== "object" || input === null)
    return input;
  var prim = input[Symbol.toPrimitive];
  if (prim !== void 0) {
    var res = prim.call(input, hint || "default");
    if (_typeof18(res) !== "object")
      return res;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (hint === "string" ? String : Number)(input);
}
function _toConsumableArray7(arr) {
  return _arrayWithoutHoles7(arr) || _iterableToArray8(arr) || _unsupportedIterableToArray14(arr) || _nonIterableSpread7();
}
function _nonIterableSpread7() {
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _unsupportedIterableToArray14(o, minLen) {
  if (!o)
    return;
  if (typeof o === "string")
    return _arrayLikeToArray14(o, minLen);
  var n2 = Object.prototype.toString.call(o).slice(8, -1);
  if (n2 === "Object" && o.constructor)
    n2 = o.constructor.name;
  if (n2 === "Map" || n2 === "Set")
    return Array.from(o);
  if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2))
    return _arrayLikeToArray14(o, minLen);
}
function _iterableToArray8(iter) {
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
    return Array.from(iter);
}
function _arrayWithoutHoles7(arr) {
  if (Array.isArray(arr))
    return _arrayLikeToArray14(arr);
}
function _arrayLikeToArray14(arr, len) {
  if (len == null || len > arr.length)
    len = arr.length;
  for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++)
    arr2[i2] = arr[i2];
  return arr2;
}
function getValueByDataKey(obj, dataKey, defaultValue) {
  if ((0, import_isNil5.default)(obj) || (0, import_isNil5.default)(dataKey)) {
    return defaultValue;
  }
  if (isNumOrStr(dataKey)) {
    return (0, import_get3.default)(obj, dataKey, defaultValue);
  }
  if ((0, import_isFunction5.default)(dataKey)) {
    return dataKey(obj);
  }
  return defaultValue;
}
function getDomainOfDataByKey(data, key, type, filterNil) {
  var flattenData = (0, import_flatMap.default)(data, function(entry) {
    return getValueByDataKey(entry, key);
  });
  if (type === "number") {
    var domain = flattenData.filter(function(entry) {
      return isNumber(entry) || parseFloat(entry);
    });
    return domain.length ? [(0, import_min2.default)(domain), (0, import_max2.default)(domain)] : [Infinity, -Infinity];
  }
  var validateData = filterNil ? flattenData.filter(function(entry) {
    return !(0, import_isNil5.default)(entry);
  }) : flattenData;
  return validateData.map(function(entry) {
    return isNumOrStr(entry) || entry instanceof Date ? entry : "";
  });
}
var calculateActiveTickIndex = function calculateActiveTickIndex2(coordinate) {
  var _ticks$length;
  var ticks2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [];
  var unsortedTicks = arguments.length > 2 ? arguments[2] : void 0;
  var axis = arguments.length > 3 ? arguments[3] : void 0;
  var index = -1;
  var len = (_ticks$length = ticks2 === null || ticks2 === void 0 ? void 0 : ticks2.length) !== null && _ticks$length !== void 0 ? _ticks$length : 0;
  if (len <= 1) {
    return 0;
  }
  if (axis && axis.axisType === "angleAxis" && Math.abs(Math.abs(axis.range[1] - axis.range[0]) - 360) <= 1e-6) {
    var range4 = axis.range;
    for (var i2 = 0; i2 < len; i2++) {
      var before = i2 > 0 ? unsortedTicks[i2 - 1].coordinate : unsortedTicks[len - 1].coordinate;
      var cur2 = unsortedTicks[i2].coordinate;
      var after = i2 >= len - 1 ? unsortedTicks[0].coordinate : unsortedTicks[i2 + 1].coordinate;
      var sameDirectionCoord = void 0;
      if (mathSign(cur2 - before) !== mathSign(after - cur2)) {
        var diffInterval = [];
        if (mathSign(after - cur2) === mathSign(range4[1] - range4[0])) {
          sameDirectionCoord = after;
          var curInRange = cur2 + range4[1] - range4[0];
          diffInterval[0] = Math.min(curInRange, (curInRange + before) / 2);
          diffInterval[1] = Math.max(curInRange, (curInRange + before) / 2);
        } else {
          sameDirectionCoord = before;
          var afterInRange = after + range4[1] - range4[0];
          diffInterval[0] = Math.min(cur2, (afterInRange + cur2) / 2);
          diffInterval[1] = Math.max(cur2, (afterInRange + cur2) / 2);
        }
        var sameInterval = [Math.min(cur2, (sameDirectionCoord + cur2) / 2), Math.max(cur2, (sameDirectionCoord + cur2) / 2)];
        if (coordinate > sameInterval[0] && coordinate <= sameInterval[1] || coordinate >= diffInterval[0] && coordinate <= diffInterval[1]) {
          index = unsortedTicks[i2].index;
          break;
        }
      } else {
        var min3 = Math.min(before, after);
        var max3 = Math.max(before, after);
        if (coordinate > (min3 + cur2) / 2 && coordinate <= (max3 + cur2) / 2) {
          index = unsortedTicks[i2].index;
          break;
        }
      }
    }
  } else {
    for (var _i = 0; _i < len; _i++) {
      if (_i === 0 && coordinate <= (ticks2[_i].coordinate + ticks2[_i + 1].coordinate) / 2 || _i > 0 && _i < len - 1 && coordinate > (ticks2[_i].coordinate + ticks2[_i - 1].coordinate) / 2 && coordinate <= (ticks2[_i].coordinate + ticks2[_i + 1].coordinate) / 2 || _i === len - 1 && coordinate > (ticks2[_i].coordinate + ticks2[_i - 1].coordinate) / 2) {
        index = ticks2[_i].index;
        break;
      }
    }
  }
  return index;
};
var getMainColorOfGraphicItem = function getMainColorOfGraphicItem2(item) {
  var _ref18 = item, displayName = _ref18.type.displayName;
  var _item$props = item.props, stroke = _item$props.stroke, fill = _item$props.fill;
  var result;
  switch (displayName) {
    case "Line":
      result = stroke;
      break;
    case "Area":
    case "Radar":
      result = stroke && stroke !== "none" ? stroke : fill;
      break;
    default:
      result = fill;
      break;
  }
  return result;
};
var getBarSizeList = function getBarSizeList2(_ref22) {
  var globalSize = _ref22.barSize, _ref2$stackGroups = _ref22.stackGroups, stackGroups = _ref2$stackGroups === void 0 ? {} : _ref2$stackGroups;
  if (!stackGroups) {
    return {};
  }
  var result = {};
  var numericAxisIds = Object.keys(stackGroups);
  for (var i2 = 0, len = numericAxisIds.length; i2 < len; i2++) {
    var sgs = stackGroups[numericAxisIds[i2]].stackGroups;
    var stackIds = Object.keys(sgs);
    for (var j = 0, sLen = stackIds.length; j < sLen; j++) {
      var _sgs$stackIds$j = sgs[stackIds[j]], items = _sgs$stackIds$j.items, cateAxisId = _sgs$stackIds$j.cateAxisId;
      var barItems = items.filter(function(item) {
        return getDisplayName(item.type).indexOf("Bar") >= 0;
      });
      if (barItems && barItems.length) {
        var selfSize = barItems[0].props.barSize;
        var cateId = barItems[0].props[cateAxisId];
        if (!result[cateId]) {
          result[cateId] = [];
        }
        result[cateId].push({
          item: barItems[0],
          stackList: barItems.slice(1),
          barSize: (0, import_isNil5.default)(selfSize) ? globalSize : selfSize
        });
      }
    }
  }
  return result;
};
var getBarPosition = function getBarPosition2(_ref32) {
  var barGap = _ref32.barGap, barCategoryGap = _ref32.barCategoryGap, bandSize = _ref32.bandSize, _ref3$sizeList = _ref32.sizeList, sizeList = _ref3$sizeList === void 0 ? [] : _ref3$sizeList, maxBarSize = _ref32.maxBarSize;
  var len = sizeList.length;
  if (len < 1)
    return null;
  var realBarGap = getPercentValue(barGap, bandSize, 0, true);
  var result;
  var initialValue = [];
  if (sizeList[0].barSize === +sizeList[0].barSize) {
    var useFull = false;
    var fullBarSize = bandSize / len;
    var sum2 = sizeList.reduce(function(res, entry) {
      return res + entry.barSize || 0;
    }, 0);
    sum2 += (len - 1) * realBarGap;
    if (sum2 >= bandSize) {
      sum2 -= (len - 1) * realBarGap;
      realBarGap = 0;
    }
    if (sum2 >= bandSize && fullBarSize > 0) {
      useFull = true;
      fullBarSize *= 0.9;
      sum2 = len * fullBarSize;
    }
    var offset = (bandSize - sum2) / 2 >> 0;
    var prev2 = {
      offset: offset - realBarGap,
      size: 0
    };
    result = sizeList.reduce(function(res, entry) {
      var newPosition = {
        item: entry.item,
        position: {
          offset: prev2.offset + prev2.size + realBarGap,
          // @ts-expect-error the type check above does not check for type number explicitly
          size: useFull ? fullBarSize : entry.barSize
        }
      };
      var newRes = [].concat(_toConsumableArray7(res), [newPosition]);
      prev2 = newRes[newRes.length - 1].position;
      if (entry.stackList && entry.stackList.length) {
        entry.stackList.forEach(function(item) {
          newRes.push({
            item,
            position: prev2
          });
        });
      }
      return newRes;
    }, initialValue);
  } else {
    var _offset2 = getPercentValue(barCategoryGap, bandSize, 0, true);
    if (bandSize - 2 * _offset2 - (len - 1) * realBarGap <= 0) {
      realBarGap = 0;
    }
    var originalSize = (bandSize - 2 * _offset2 - (len - 1) * realBarGap) / len;
    if (originalSize > 1) {
      originalSize >>= 0;
    }
    var size = maxBarSize === +maxBarSize ? Math.min(originalSize, maxBarSize) : originalSize;
    result = sizeList.reduce(function(res, entry, i2) {
      var newRes = [].concat(_toConsumableArray7(res), [{
        item: entry.item,
        position: {
          offset: _offset2 + (originalSize + realBarGap) * i2 + (originalSize - size) / 2,
          size
        }
      }]);
      if (entry.stackList && entry.stackList.length) {
        entry.stackList.forEach(function(item) {
          newRes.push({
            item,
            position: newRes[newRes.length - 1].position
          });
        });
      }
      return newRes;
    }, initialValue);
  }
  return result;
};
var appendOffsetOfLegend = function appendOffsetOfLegend2(offset, _unused, props, legendBox) {
  var children = props.children, width = props.width, margin = props.margin;
  var legendWidth = width - (margin.left || 0) - (margin.right || 0);
  var legendProps = getLegendProps({
    children,
    legendWidth
  });
  if (legendProps) {
    var _ref42 = legendBox || {}, boxWidth = _ref42.width, boxHeight = _ref42.height;
    var align = legendProps.align, verticalAlign = legendProps.verticalAlign, layout = legendProps.layout;
    if ((layout === "vertical" || layout === "horizontal" && verticalAlign === "middle") && align !== "center" && isNumber(offset[align])) {
      return _objectSpread13(_objectSpread13({}, offset), {}, _defineProperty13({}, align, offset[align] + (boxWidth || 0)));
    }
    if ((layout === "horizontal" || layout === "vertical" && align === "center") && verticalAlign !== "middle" && isNumber(offset[verticalAlign])) {
      return _objectSpread13(_objectSpread13({}, offset), {}, _defineProperty13({}, verticalAlign, offset[verticalAlign] + (boxHeight || 0)));
    }
  }
  return offset;
};
var isErrorBarRelevantForAxis = function isErrorBarRelevantForAxis2(layout, axisType, direction) {
  if ((0, import_isNil5.default)(axisType)) {
    return true;
  }
  if (layout === "horizontal") {
    return axisType === "yAxis";
  }
  if (layout === "vertical") {
    return axisType === "xAxis";
  }
  if (direction === "x") {
    return axisType === "xAxis";
  }
  if (direction === "y") {
    return axisType === "yAxis";
  }
  return true;
};
var getDomainOfErrorBars = function getDomainOfErrorBars2(data, item, dataKey, layout, axisType) {
  var children = item.props.children;
  var errorBars = findAllByType(children, ErrorBar).filter(function(errorBarChild) {
    return isErrorBarRelevantForAxis(layout, axisType, errorBarChild.props.direction);
  });
  if (errorBars && errorBars.length) {
    var keys4 = errorBars.map(function(errorBarChild) {
      return errorBarChild.props.dataKey;
    });
    return data.reduce(function(result, entry) {
      var entryValue = getValueByDataKey(entry, dataKey, 0);
      var mainValue = (0, import_isArray4.default)(entryValue) ? [(0, import_min2.default)(entryValue), (0, import_max2.default)(entryValue)] : [entryValue, entryValue];
      var errorDomain = keys4.reduce(function(prevErrorArr, k2) {
        var errorValue = getValueByDataKey(entry, k2, 0);
        var lowerValue = mainValue[0] - Math.abs((0, import_isArray4.default)(errorValue) ? errorValue[0] : errorValue);
        var upperValue = mainValue[1] + Math.abs((0, import_isArray4.default)(errorValue) ? errorValue[1] : errorValue);
        return [Math.min(lowerValue, prevErrorArr[0]), Math.max(upperValue, prevErrorArr[1])];
      }, [Infinity, -Infinity]);
      return [Math.min(errorDomain[0], result[0]), Math.max(errorDomain[1], result[1])];
    }, [Infinity, -Infinity]);
  }
  return null;
};
var parseErrorBarsOfAxis = function parseErrorBarsOfAxis2(data, items, dataKey, axisType, layout) {
  var domains = items.map(function(item) {
    return getDomainOfErrorBars(data, item, dataKey, layout, axisType);
  }).filter(function(entry) {
    return !(0, import_isNil5.default)(entry);
  });
  if (domains && domains.length) {
    return domains.reduce(function(result, entry) {
      return [Math.min(result[0], entry[0]), Math.max(result[1], entry[1])];
    }, [Infinity, -Infinity]);
  }
  return null;
};
var getDomainOfItemsWithSameAxis = function getDomainOfItemsWithSameAxis2(data, items, type, layout, filterNil) {
  var domains = items.map(function(item) {
    var dataKey = item.props.dataKey;
    if (type === "number" && dataKey) {
      return getDomainOfErrorBars(data, item, dataKey, layout) || getDomainOfDataByKey(data, dataKey, type, filterNil);
    }
    return getDomainOfDataByKey(data, dataKey, type, filterNil);
  });
  if (type === "number") {
    return domains.reduce(
      // @ts-expect-error if (type === number) means that the domain is numerical type
      // - but this link is missing in the type definition
      function(result, entry) {
        return [Math.min(result[0], entry[0]), Math.max(result[1], entry[1])];
      },
      [Infinity, -Infinity]
    );
  }
  var tag = {};
  return domains.reduce(function(result, entry) {
    for (var i2 = 0, len = entry.length; i2 < len; i2++) {
      if (!tag[entry[i2]]) {
        tag[entry[i2]] = true;
        result.push(entry[i2]);
      }
    }
    return result;
  }, []);
};
var isCategoricalAxis = function isCategoricalAxis2(layout, axisType) {
  return layout === "horizontal" && axisType === "xAxis" || layout === "vertical" && axisType === "yAxis" || layout === "centric" && axisType === "angleAxis" || layout === "radial" && axisType === "radiusAxis";
};
var getCoordinatesOfGrid = function getCoordinatesOfGrid2(ticks2, min3, max3, syncWithTicks) {
  if (syncWithTicks) {
    return ticks2.map(function(entry) {
      return entry.coordinate;
    });
  }
  var hasMin, hasMax;
  var values2 = ticks2.map(function(entry) {
    if (entry.coordinate === min3) {
      hasMin = true;
    }
    if (entry.coordinate === max3) {
      hasMax = true;
    }
    return entry.coordinate;
  });
  if (!hasMin) {
    values2.push(min3);
  }
  if (!hasMax) {
    values2.push(max3);
  }
  return values2;
};
var getTicksOfAxis = function getTicksOfAxis2(axis, isGrid, isAll) {
  if (!axis)
    return null;
  var scale = axis.scale;
  var duplicateDomain = axis.duplicateDomain, type = axis.type, range4 = axis.range;
  var offsetForBand = axis.realScaleType === "scaleBand" ? scale.bandwidth() / 2 : 2;
  var offset = (isGrid || isAll) && type === "category" && scale.bandwidth ? scale.bandwidth() / offsetForBand : 0;
  offset = axis.axisType === "angleAxis" && (range4 === null || range4 === void 0 ? void 0 : range4.length) >= 2 ? mathSign(range4[0] - range4[1]) * 2 * offset : offset;
  if (isGrid && (axis.ticks || axis.niceTicks)) {
    var result = (axis.ticks || axis.niceTicks).map(function(entry) {
      var scaleContent = duplicateDomain ? duplicateDomain.indexOf(entry) : entry;
      return {
        // If the scaleContent is not a number, the coordinate will be NaN.
        // That could be the case for example with a PointScale and a string as domain.
        coordinate: scale(scaleContent) + offset,
        value: entry,
        offset
      };
    });
    return result.filter(function(row) {
      return !(0, import_isNaN2.default)(row.coordinate);
    });
  }
  if (axis.isCategorical && axis.categoricalDomain) {
    return axis.categoricalDomain.map(function(entry, index) {
      return {
        coordinate: scale(entry) + offset,
        value: entry,
        index,
        offset
      };
    });
  }
  if (scale.ticks && !isAll) {
    return scale.ticks(axis.tickCount).map(function(entry) {
      return {
        coordinate: scale(entry) + offset,
        value: entry,
        offset
      };
    });
  }
  return scale.domain().map(function(entry, index) {
    return {
      coordinate: scale(entry) + offset,
      value: duplicateDomain ? duplicateDomain[entry] : entry,
      index,
      offset
    };
  });
};
var combineEventHandlers = function combineEventHandlers2(defaultHandler, parentHandler, childHandler) {
  var customizedHandler;
  if ((0, import_isFunction5.default)(childHandler)) {
    customizedHandler = childHandler;
  } else if ((0, import_isFunction5.default)(parentHandler)) {
    customizedHandler = parentHandler;
  }
  if ((0, import_isFunction5.default)(defaultHandler) || customizedHandler) {
    return function(arg1, arg2, arg3, arg4) {
      if ((0, import_isFunction5.default)(defaultHandler)) {
        defaultHandler(arg1, arg2, arg3, arg4);
      }
      if ((0, import_isFunction5.default)(customizedHandler)) {
        customizedHandler(arg1, arg2, arg3, arg4);
      }
    };
  }
  return null;
};
var parseScale = function parseScale2(axis, chartType, hasBar) {
  var scale = axis.scale, type = axis.type, layout = axis.layout, axisType = axis.axisType;
  if (scale === "auto") {
    if (layout === "radial" && axisType === "radiusAxis") {
      return {
        scale: band(),
        realScaleType: "band"
      };
    }
    if (layout === "radial" && axisType === "angleAxis") {
      return {
        scale: linear2(),
        realScaleType: "linear"
      };
    }
    if (type === "category" && chartType && (chartType.indexOf("LineChart") >= 0 || chartType.indexOf("AreaChart") >= 0 || chartType.indexOf("ComposedChart") >= 0 && !hasBar)) {
      return {
        scale: point3(),
        realScaleType: "point"
      };
    }
    if (type === "category") {
      return {
        scale: band(),
        realScaleType: "band"
      };
    }
    return {
      scale: linear2(),
      realScaleType: "linear"
    };
  }
  if ((0, import_isString3.default)(scale)) {
    var name2 = "scale".concat((0, import_upperFirst2.default)(scale));
    return {
      scale: (d3_scale_exports[name2] || point3)(),
      realScaleType: d3_scale_exports[name2] ? name2 : "point"
    };
  }
  return (0, import_isFunction5.default)(scale) ? {
    scale
  } : {
    scale: point3(),
    realScaleType: "point"
  };
};
var EPS3 = 1e-4;
var checkDomainOfScale = function checkDomainOfScale2(scale) {
  var domain = scale.domain();
  if (!domain || domain.length <= 2) {
    return;
  }
  var len = domain.length;
  var range4 = scale.range();
  var min3 = Math.min(range4[0], range4[1]) - EPS3;
  var max3 = Math.max(range4[0], range4[1]) + EPS3;
  var first = scale(domain[0]);
  var last = scale(domain[len - 1]);
  if (first < min3 || first > max3 || last < min3 || last > max3) {
    scale.domain([domain[0], domain[len - 1]]);
  }
};
var findPositionOfBar = function findPositionOfBar2(barPosition, child) {
  if (!barPosition) {
    return null;
  }
  for (var i2 = 0, len = barPosition.length; i2 < len; i2++) {
    if (barPosition[i2].item === child) {
      return barPosition[i2].position;
    }
  }
  return null;
};
var truncateByDomain = function truncateByDomain2(value, domain) {
  if (!domain || domain.length !== 2 || !isNumber(domain[0]) || !isNumber(domain[1])) {
    return value;
  }
  var min3 = Math.min(domain[0], domain[1]);
  var max3 = Math.max(domain[0], domain[1]);
  var result = [value[0], value[1]];
  if (!isNumber(value[0]) || value[0] < min3) {
    result[0] = min3;
  }
  if (!isNumber(value[1]) || value[1] > max3) {
    result[1] = max3;
  }
  if (result[0] > max3) {
    result[0] = max3;
  }
  if (result[1] < min3) {
    result[1] = min3;
  }
  return result;
};
var offsetSign = function offsetSign2(series) {
  var n2 = series.length;
  if (n2 <= 0) {
    return;
  }
  for (var j = 0, m = series[0].length; j < m; ++j) {
    var positive = 0;
    var negative = 0;
    for (var i2 = 0; i2 < n2; ++i2) {
      var value = (0, import_isNaN2.default)(series[i2][j][1]) ? series[i2][j][0] : series[i2][j][1];
      if (value >= 0) {
        series[i2][j][0] = positive;
        series[i2][j][1] = positive + value;
        positive = series[i2][j][1];
      } else {
        series[i2][j][0] = negative;
        series[i2][j][1] = negative + value;
        negative = series[i2][j][1];
      }
    }
  }
};
var offsetPositive = function offsetPositive2(series) {
  var n2 = series.length;
  if (n2 <= 0) {
    return;
  }
  for (var j = 0, m = series[0].length; j < m; ++j) {
    var positive = 0;
    for (var i2 = 0; i2 < n2; ++i2) {
      var value = (0, import_isNaN2.default)(series[i2][j][1]) ? series[i2][j][0] : series[i2][j][1];
      if (value >= 0) {
        series[i2][j][0] = positive;
        series[i2][j][1] = positive + value;
        positive = series[i2][j][1];
      } else {
        series[i2][j][0] = 0;
        series[i2][j][1] = 0;
      }
    }
  }
};
var STACK_OFFSET_MAP = {
  sign: offsetSign,
  // @ts-expect-error definitelytyped types are incorrect
  expand: expand_default,
  // @ts-expect-error definitelytyped types are incorrect
  none: none_default,
  // @ts-expect-error definitelytyped types are incorrect
  silhouette: silhouette_default,
  // @ts-expect-error definitelytyped types are incorrect
  wiggle: wiggle_default,
  positive: offsetPositive
};
var getStackedData = function getStackedData2(data, stackItems, offsetType) {
  var dataKeys = stackItems.map(function(item) {
    return item.props.dataKey;
  });
  var offsetAccessor = STACK_OFFSET_MAP[offsetType];
  var stack = stack_default().keys(dataKeys).value(function(d, key) {
    return +getValueByDataKey(d, key, 0);
  }).order(none_default2).offset(offsetAccessor);
  return stack(data);
};
var getStackGroupsByAxisId = function getStackGroupsByAxisId2(data, _items, numericAxisId, cateAxisId, offsetType, reverseStackOrder) {
  if (!data) {
    return null;
  }
  var items = reverseStackOrder ? _items.reverse() : _items;
  var parentStackGroupsInitialValue = {};
  var stackGroups = items.reduce(function(result, item) {
    var _item$props2 = item.props, stackId = _item$props2.stackId, hide = _item$props2.hide;
    if (hide) {
      return result;
    }
    var axisId = item.props[numericAxisId];
    var parentGroup = result[axisId] || {
      hasStack: false,
      stackGroups: {}
    };
    if (isNumOrStr(stackId)) {
      var childGroup = parentGroup.stackGroups[stackId] || {
        numericAxisId,
        cateAxisId,
        items: []
      };
      childGroup.items.push(item);
      parentGroup.hasStack = true;
      parentGroup.stackGroups[stackId] = childGroup;
    } else {
      parentGroup.stackGroups[uniqueId("_stackId_")] = {
        numericAxisId,
        cateAxisId,
        items: [item]
      };
    }
    return _objectSpread13(_objectSpread13({}, result), {}, _defineProperty13({}, axisId, parentGroup));
  }, parentStackGroupsInitialValue);
  var axisStackGroupsInitialValue = {};
  return Object.keys(stackGroups).reduce(function(result, axisId) {
    var group = stackGroups[axisId];
    if (group.hasStack) {
      var stackGroupsInitialValue = {};
      group.stackGroups = Object.keys(group.stackGroups).reduce(function(res, stackId) {
        var g = group.stackGroups[stackId];
        return _objectSpread13(_objectSpread13({}, res), {}, _defineProperty13({}, stackId, {
          numericAxisId,
          cateAxisId,
          items: g.items,
          stackedData: getStackedData(data, g.items, offsetType)
        }));
      }, stackGroupsInitialValue);
    }
    return _objectSpread13(_objectSpread13({}, result), {}, _defineProperty13({}, axisId, group));
  }, axisStackGroupsInitialValue);
};
var getTicksOfScale = function getTicksOfScale2(scale, opts) {
  var realScaleType = opts.realScaleType, type = opts.type, tickCount = opts.tickCount, originalDomain = opts.originalDomain, allowDecimals = opts.allowDecimals;
  var scaleType = realScaleType || opts.scale;
  if (scaleType !== "auto" && scaleType !== "linear") {
    return null;
  }
  if (tickCount && type === "number" && originalDomain && (originalDomain[0] === "auto" || originalDomain[1] === "auto")) {
    var domain = scale.domain();
    if (!domain.length) {
      return null;
    }
    var tickValues = getNiceTickValues(domain, tickCount, allowDecimals);
    scale.domain([(0, import_min2.default)(tickValues), (0, import_max2.default)(tickValues)]);
    return {
      niceTicks: tickValues
    };
  }
  if (tickCount && type === "number") {
    var _domain = scale.domain();
    var _tickValues = getTickValuesFixedDomain(_domain, tickCount, allowDecimals);
    return {
      niceTicks: _tickValues
    };
  }
  return null;
};
var getCateCoordinateOfLine = function getCateCoordinateOfLine2(_ref52) {
  var axis = _ref52.axis, ticks2 = _ref52.ticks, bandSize = _ref52.bandSize, entry = _ref52.entry, index = _ref52.index, dataKey = _ref52.dataKey;
  if (axis.type === "category") {
    if (!axis.allowDuplicatedCategory && axis.dataKey && !(0, import_isNil5.default)(entry[axis.dataKey])) {
      var matchedTick = findEntryInArray(ticks2, "value", entry[axis.dataKey]);
      if (matchedTick) {
        return matchedTick.coordinate + bandSize / 2;
      }
    }
    return ticks2[index] ? ticks2[index].coordinate + bandSize / 2 : null;
  }
  var value = getValueByDataKey(entry, !(0, import_isNil5.default)(dataKey) ? dataKey : axis.dataKey);
  return !(0, import_isNil5.default)(value) ? axis.scale(value) : null;
};
var getCateCoordinateOfBar = function getCateCoordinateOfBar2(_ref62) {
  var axis = _ref62.axis, ticks2 = _ref62.ticks, offset = _ref62.offset, bandSize = _ref62.bandSize, entry = _ref62.entry, index = _ref62.index;
  if (axis.type === "category") {
    return ticks2[index] ? ticks2[index].coordinate + offset : null;
  }
  var value = getValueByDataKey(entry, axis.dataKey, axis.domain[index]);
  return !(0, import_isNil5.default)(value) ? axis.scale(value) - bandSize / 2 + offset : null;
};
var getBaseValueOfBar = function getBaseValueOfBar2(_ref72) {
  var numericAxis = _ref72.numericAxis;
  var domain = numericAxis.scale.domain();
  if (numericAxis.type === "number") {
    var min3 = Math.min(domain[0], domain[1]);
    var max3 = Math.max(domain[0], domain[1]);
    if (min3 <= 0 && max3 >= 0) {
      return 0;
    }
    if (max3 < 0) {
      return max3;
    }
    return min3;
  }
  return domain[0];
};
var getStackedDataOfItem = function getStackedDataOfItem2(item, stackGroups) {
  var stackId = item.props.stackId;
  if (isNumOrStr(stackId)) {
    var group = stackGroups[stackId];
    if (group) {
      var itemIndex = group.items.indexOf(item);
      return itemIndex >= 0 ? group.stackedData[itemIndex] : null;
    }
  }
  return null;
};
var getDomainOfSingle = function getDomainOfSingle2(data) {
  return data.reduce(function(result, entry) {
    return [(0, import_min2.default)(entry.concat([result[0]]).filter(isNumber)), (0, import_max2.default)(entry.concat([result[1]]).filter(isNumber))];
  }, [Infinity, -Infinity]);
};
var getDomainOfStackGroups = function getDomainOfStackGroups2(stackGroups, startIndex, endIndex) {
  return Object.keys(stackGroups).reduce(function(result, stackId) {
    var group = stackGroups[stackId];
    var stackedData = group.stackedData;
    var domain = stackedData.reduce(function(res, entry) {
      var s2 = getDomainOfSingle(entry.slice(startIndex, endIndex + 1));
      return [Math.min(res[0], s2[0]), Math.max(res[1], s2[1])];
    }, [Infinity, -Infinity]);
    return [Math.min(domain[0], result[0]), Math.max(domain[1], result[1])];
  }, [Infinity, -Infinity]).map(function(result) {
    return result === Infinity || result === -Infinity ? 0 : result;
  });
};
var MIN_VALUE_REG = /^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/;
var MAX_VALUE_REG = /^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/;
var parseSpecifiedDomain = function parseSpecifiedDomain2(specifiedDomain, dataDomain, allowDataOverflow) {
  if ((0, import_isFunction5.default)(specifiedDomain)) {
    return specifiedDomain(dataDomain, allowDataOverflow);
  }
  if (!(0, import_isArray4.default)(specifiedDomain)) {
    return dataDomain;
  }
  var domain = [];
  if (isNumber(specifiedDomain[0])) {
    domain[0] = allowDataOverflow ? specifiedDomain[0] : Math.min(specifiedDomain[0], dataDomain[0]);
  } else if (MIN_VALUE_REG.test(specifiedDomain[0])) {
    var value = +MIN_VALUE_REG.exec(specifiedDomain[0])[1];
    domain[0] = dataDomain[0] - value;
  } else if ((0, import_isFunction5.default)(specifiedDomain[0])) {
    domain[0] = specifiedDomain[0](dataDomain[0]);
  } else {
    domain[0] = dataDomain[0];
  }
  if (isNumber(specifiedDomain[1])) {
    domain[1] = allowDataOverflow ? specifiedDomain[1] : Math.max(specifiedDomain[1], dataDomain[1]);
  } else if (MAX_VALUE_REG.test(specifiedDomain[1])) {
    var _value = +MAX_VALUE_REG.exec(specifiedDomain[1])[1];
    domain[1] = dataDomain[1] + _value;
  } else if ((0, import_isFunction5.default)(specifiedDomain[1])) {
    domain[1] = specifiedDomain[1](dataDomain[1]);
  } else {
    domain[1] = dataDomain[1];
  }
  return domain;
};
var getBandSizeOfAxis = function getBandSizeOfAxis2(axis, ticks2, isBar) {
  if (axis && axis.scale && axis.scale.bandwidth) {
    var bandWidth = axis.scale.bandwidth();
    if (!isBar || bandWidth > 0) {
      return bandWidth;
    }
  }
  if (axis && ticks2 && ticks2.length >= 2) {
    var orderedTicks = (0, import_sortBy2.default)(ticks2, function(o) {
      return o.coordinate;
    });
    var bandSize = Infinity;
    for (var i2 = 1, len = orderedTicks.length; i2 < len; i2++) {
      var cur2 = orderedTicks[i2];
      var prev2 = orderedTicks[i2 - 1];
      bandSize = Math.min((cur2.coordinate || 0) - (prev2.coordinate || 0), bandSize);
    }
    return bandSize === Infinity ? 0 : bandSize;
  }
  return isBar ? void 0 : 0;
};
var parseDomainOfCategoryAxis = function parseDomainOfCategoryAxis2(specifiedDomain, calculatedDomain, axisChild) {
  if (!specifiedDomain || !specifiedDomain.length) {
    return calculatedDomain;
  }
  if ((0, import_isEqual.default)(specifiedDomain, (0, import_get3.default)(axisChild, "type.defaultProps.domain"))) {
    return calculatedDomain;
  }
  return specifiedDomain;
};
var getTooltipItem = function getTooltipItem2(graphicalItem, payload) {
  var _graphicalItem$props = graphicalItem.props, dataKey = _graphicalItem$props.dataKey, name2 = _graphicalItem$props.name, unit2 = _graphicalItem$props.unit, formatter3 = _graphicalItem$props.formatter, tooltipType = _graphicalItem$props.tooltipType, chartType = _graphicalItem$props.chartType;
  return _objectSpread13(_objectSpread13({}, filterProps(graphicalItem)), {}, {
    dataKey,
    unit: unit2,
    formatter: formatter3,
    name: name2 || dataKey,
    color: getMainColorOfGraphicItem(graphicalItem),
    value: getValueByDataKey(payload, dataKey),
    type: tooltipType,
    payload,
    chartType
  });
};

// node_modules/recharts/es6/util/PolarUtils.js
function _typeof19(o) {
  "@babel/helpers - typeof";
  return _typeof19 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
    return typeof o2;
  } : function(o2) {
    return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
  }, _typeof19(o);
}
function ownKeys14(e3, r3) {
  var t3 = Object.keys(e3);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e3);
    r3 && (o = o.filter(function(r4) {
      return Object.getOwnPropertyDescriptor(e3, r4).enumerable;
    })), t3.push.apply(t3, o);
  }
  return t3;
}
function _objectSpread14(e3) {
  for (var r3 = 1; r3 < arguments.length; r3++) {
    var t3 = null != arguments[r3] ? arguments[r3] : {};
    r3 % 2 ? ownKeys14(Object(t3), true).forEach(function(r4) {
      _defineProperty14(e3, r4, t3[r4]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e3, Object.getOwnPropertyDescriptors(t3)) : ownKeys14(Object(t3)).forEach(function(r4) {
      Object.defineProperty(e3, r4, Object.getOwnPropertyDescriptor(t3, r4));
    });
  }
  return e3;
}
function _defineProperty14(obj, key, value) {
  key = _toPropertyKey15(key);
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
function _toPropertyKey15(arg) {
  var key = _toPrimitive15(arg, "string");
  return _typeof19(key) === "symbol" ? key : String(key);
}
function _toPrimitive15(input, hint) {
  if (_typeof19(input) !== "object" || input === null)
    return input;
  var prim = input[Symbol.toPrimitive];
  if (prim !== void 0) {
    var res = prim.call(input, hint || "default");
    if (_typeof19(res) !== "object")
      return res;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (hint === "string" ? String : Number)(input);
}
function _slicedToArray9(arr, i2) {
  return _arrayWithHoles10(arr) || _iterableToArrayLimit9(arr, i2) || _unsupportedIterableToArray15(arr, i2) || _nonIterableRest10();
}
function _nonIterableRest10() {
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _unsupportedIterableToArray15(o, minLen) {
  if (!o)
    return;
  if (typeof o === "string")
    return _arrayLikeToArray15(o, minLen);
  var n2 = Object.prototype.toString.call(o).slice(8, -1);
  if (n2 === "Object" && o.constructor)
    n2 = o.constructor.name;
  if (n2 === "Map" || n2 === "Set")
    return Array.from(o);
  if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2))
    return _arrayLikeToArray15(o, minLen);
}
function _arrayLikeToArray15(arr, len) {
  if (len == null || len > arr.length)
    len = arr.length;
  for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++)
    arr2[i2] = arr[i2];
  return arr2;
}
function _iterableToArrayLimit9(r3, l) {
  var t3 = null == r3 ? null : "undefined" != typeof Symbol && r3[Symbol.iterator] || r3["@@iterator"];
  if (null != t3) {
    var e3, n2, i2, u, a2 = [], f = true, o = false;
    try {
      if (i2 = (t3 = t3.call(r3)).next, 0 === l) {
        if (Object(t3) !== t3)
          return;
        f = false;
      } else
        for (; !(f = (e3 = i2.call(t3)).done) && (a2.push(e3.value), a2.length !== l); f = true)
          ;
    } catch (r4) {
      o = true, n2 = r4;
    } finally {
      try {
        if (!f && null != t3["return"] && (u = t3["return"](), Object(u) !== u))
          return;
      } finally {
        if (o)
          throw n2;
      }
    }
    return a2;
  }
}
function _arrayWithHoles10(arr) {
  if (Array.isArray(arr))
    return arr;
}
var RADIAN2 = Math.PI / 180;
var radianToDegree = function radianToDegree2(angleInRadian) {
  return angleInRadian * 180 / Math.PI;
};
var polarToCartesian = function polarToCartesian2(cx, cy, radius, angle) {
  return {
    x: cx + Math.cos(-RADIAN2 * angle) * radius,
    y: cy + Math.sin(-RADIAN2 * angle) * radius
  };
};
var getMaxRadius = function getMaxRadius2(width, height) {
  var offset = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {
    top: 0,
    right: 0,
    bottom: 0,
    left: 0
  };
  return Math.min(Math.abs(width - (offset.left || 0) - (offset.right || 0)), Math.abs(height - (offset.top || 0) - (offset.bottom || 0))) / 2;
};
var formatAxisMap = function formatAxisMap2(props, axisMap, offset, axisType, chartName) {
  var width = props.width, height = props.height;
  var startAngle = props.startAngle, endAngle = props.endAngle;
  var cx = getPercentValue(props.cx, width, width / 2);
  var cy = getPercentValue(props.cy, height, height / 2);
  var maxRadius = getMaxRadius(width, height, offset);
  var innerRadius = getPercentValue(props.innerRadius, maxRadius, 0);
  var outerRadius = getPercentValue(props.outerRadius, maxRadius, maxRadius * 0.8);
  var ids = Object.keys(axisMap);
  return ids.reduce(function(result, id2) {
    var axis = axisMap[id2];
    var domain = axis.domain, reversed = axis.reversed;
    var range4;
    if ((0, import_isNil6.default)(axis.range)) {
      if (axisType === "angleAxis") {
        range4 = [startAngle, endAngle];
      } else if (axisType === "radiusAxis") {
        range4 = [innerRadius, outerRadius];
      }
      if (reversed) {
        range4 = [range4[1], range4[0]];
      }
    } else {
      range4 = axis.range;
      var _range3 = range4;
      var _range22 = _slicedToArray9(_range3, 2);
      startAngle = _range22[0];
      endAngle = _range22[1];
    }
    var _parseScale = parseScale(axis, chartName), realScaleType = _parseScale.realScaleType, scale = _parseScale.scale;
    scale.domain(domain).range(range4);
    checkDomainOfScale(scale);
    var ticks2 = getTicksOfScale(scale, _objectSpread14(_objectSpread14({}, axis), {}, {
      realScaleType
    }));
    var finalAxis = _objectSpread14(_objectSpread14(_objectSpread14({}, axis), ticks2), {}, {
      range: range4,
      radius: outerRadius,
      realScaleType,
      scale,
      cx,
      cy,
      innerRadius,
      outerRadius,
      startAngle,
      endAngle
    });
    return _objectSpread14(_objectSpread14({}, result), {}, _defineProperty14({}, id2, finalAxis));
  }, {});
};
var distanceBetweenPoints = function distanceBetweenPoints2(point4, anotherPoint) {
  var x1 = point4.x, y1 = point4.y;
  var x2 = anotherPoint.x, y2 = anotherPoint.y;
  return Math.sqrt(Math.pow(x1 - x2, 2) + Math.pow(y1 - y2, 2));
};
var getAngleOfPoint = function getAngleOfPoint2(_ref18, _ref22) {
  var x2 = _ref18.x, y2 = _ref18.y;
  var cx = _ref22.cx, cy = _ref22.cy;
  var radius = distanceBetweenPoints({
    x: x2,
    y: y2
  }, {
    x: cx,
    y: cy
  });
  if (radius <= 0) {
    return {
      radius
    };
  }
  var cos2 = (x2 - cx) / radius;
  var angleInRadian = Math.acos(cos2);
  if (y2 > cy) {
    angleInRadian = 2 * Math.PI - angleInRadian;
  }
  return {
    radius,
    angle: radianToDegree(angleInRadian),
    angleInRadian
  };
};
var formatAngleOfSector = function formatAngleOfSector2(_ref32) {
  var startAngle = _ref32.startAngle, endAngle = _ref32.endAngle;
  var startCnt = Math.floor(startAngle / 360);
  var endCnt = Math.floor(endAngle / 360);
  var min3 = Math.min(startCnt, endCnt);
  return {
    startAngle: startAngle - min3 * 360,
    endAngle: endAngle - min3 * 360
  };
};
var reverseFormatAngleOfSetor = function reverseFormatAngleOfSetor2(angle, _ref42) {
  var startAngle = _ref42.startAngle, endAngle = _ref42.endAngle;
  var startCnt = Math.floor(startAngle / 360);
  var endCnt = Math.floor(endAngle / 360);
  var min3 = Math.min(startCnt, endCnt);
  return angle + min3 * 360;
};
var inRangeOfSector = function inRangeOfSector2(_ref52, sector) {
  var x2 = _ref52.x, y2 = _ref52.y;
  var _getAngleOfPoint = getAngleOfPoint({
    x: x2,
    y: y2
  }, sector), radius = _getAngleOfPoint.radius, angle = _getAngleOfPoint.angle;
  var innerRadius = sector.innerRadius, outerRadius = sector.outerRadius;
  if (radius < innerRadius || radius > outerRadius) {
    return false;
  }
  if (radius === 0) {
    return true;
  }
  var _formatAngleOfSector = formatAngleOfSector(sector), startAngle = _formatAngleOfSector.startAngle, endAngle = _formatAngleOfSector.endAngle;
  var formatAngle = angle;
  var inRange;
  if (startAngle <= endAngle) {
    while (formatAngle > endAngle) {
      formatAngle -= 360;
    }
    while (formatAngle < startAngle) {
      formatAngle += 360;
    }
    inRange = formatAngle >= startAngle && formatAngle <= endAngle;
  } else {
    while (formatAngle > startAngle) {
      formatAngle -= 360;
    }
    while (formatAngle < endAngle) {
      formatAngle += 360;
    }
    inRange = formatAngle >= endAngle && formatAngle <= startAngle;
  }
  if (inRange) {
    return _objectSpread14(_objectSpread14({}, sector), {}, {
      radius,
      angle: reverseFormatAngleOfSetor(formatAngle, sector)
    });
  }
  return null;
};

// node_modules/recharts/es6/component/Label.js
function _typeof20(o) {
  "@babel/helpers - typeof";
  return _typeof20 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
    return typeof o2;
  } : function(o2) {
    return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
  }, _typeof20(o);
}
var _excluded14 = ["offset"];
function _toConsumableArray8(arr) {
  return _arrayWithoutHoles8(arr) || _iterableToArray9(arr) || _unsupportedIterableToArray16(arr) || _nonIterableSpread8();
}
function _nonIterableSpread8() {
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _unsupportedIterableToArray16(o, minLen) {
  if (!o)
    return;
  if (typeof o === "string")
    return _arrayLikeToArray16(o, minLen);
  var n2 = Object.prototype.toString.call(o).slice(8, -1);
  if (n2 === "Object" && o.constructor)
    n2 = o.constructor.name;
  if (n2 === "Map" || n2 === "Set")
    return Array.from(o);
  if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2))
    return _arrayLikeToArray16(o, minLen);
}
function _iterableToArray9(iter) {
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
    return Array.from(iter);
}
function _arrayWithoutHoles8(arr) {
  if (Array.isArray(arr))
    return _arrayLikeToArray16(arr);
}
function _arrayLikeToArray16(arr, len) {
  if (len == null || len > arr.length)
    len = arr.length;
  for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++)
    arr2[i2] = arr[i2];
  return arr2;
}
function _objectWithoutProperties10(source, excluded) {
  if (source == null)
    return {};
  var target = _objectWithoutPropertiesLoose14(source, excluded);
  var key, i2;
  if (Object.getOwnPropertySymbols) {
    var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
    for (i2 = 0; i2 < sourceSymbolKeys.length; i2++) {
      key = sourceSymbolKeys[i2];
      if (excluded.indexOf(key) >= 0)
        continue;
      if (!Object.prototype.propertyIsEnumerable.call(source, key))
        continue;
      target[key] = source[key];
    }
  }
  return target;
}
function _objectWithoutPropertiesLoose14(source, excluded) {
  if (source == null)
    return {};
  var target = {};
  var sourceKeys = Object.keys(source);
  var key, i2;
  for (i2 = 0; i2 < sourceKeys.length; i2++) {
    key = sourceKeys[i2];
    if (excluded.indexOf(key) >= 0)
      continue;
    target[key] = source[key];
  }
  return target;
}
function ownKeys15(e3, r3) {
  var t3 = Object.keys(e3);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e3);
    r3 && (o = o.filter(function(r4) {
      return Object.getOwnPropertyDescriptor(e3, r4).enumerable;
    })), t3.push.apply(t3, o);
  }
  return t3;
}
function _objectSpread15(e3) {
  for (var r3 = 1; r3 < arguments.length; r3++) {
    var t3 = null != arguments[r3] ? arguments[r3] : {};
    r3 % 2 ? ownKeys15(Object(t3), true).forEach(function(r4) {
      _defineProperty15(e3, r4, t3[r4]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e3, Object.getOwnPropertyDescriptors(t3)) : ownKeys15(Object(t3)).forEach(function(r4) {
      Object.defineProperty(e3, r4, Object.getOwnPropertyDescriptor(t3, r4));
    });
  }
  return e3;
}
function _defineProperty15(obj, key, value) {
  key = _toPropertyKey16(key);
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
function _toPropertyKey16(arg) {
  var key = _toPrimitive16(arg, "string");
  return _typeof20(key) === "symbol" ? key : String(key);
}
function _toPrimitive16(input, hint) {
  if (_typeof20(input) !== "object" || input === null)
    return input;
  var prim = input[Symbol.toPrimitive];
  if (prim !== void 0) {
    var res = prim.call(input, hint || "default");
    if (_typeof20(res) !== "object")
      return res;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (hint === "string" ? String : Number)(input);
}
function _extends16() {
  _extends16 = Object.assign ? Object.assign.bind() : function(target) {
    for (var i2 = 1; i2 < arguments.length; i2++) {
      var source = arguments[i2];
      for (var key in source) {
        if (Object.prototype.hasOwnProperty.call(source, key)) {
          target[key] = source[key];
        }
      }
    }
    return target;
  };
  return _extends16.apply(this, arguments);
}
var getLabel = function getLabel2(props) {
  var value = props.value, formatter3 = props.formatter;
  var label = (0, import_isNil7.default)(props.children) ? value : props.children;
  if ((0, import_isFunction6.default)(formatter3)) {
    return formatter3(label);
  }
  return label;
};
var getDeltaAngle = function getDeltaAngle2(startAngle, endAngle) {
  var sign3 = mathSign(endAngle - startAngle);
  var deltaAngle = Math.min(Math.abs(endAngle - startAngle), 360);
  return sign3 * deltaAngle;
};
var renderRadialLabel = function renderRadialLabel2(labelProps, label, attrs) {
  var position2 = labelProps.position, viewBox = labelProps.viewBox, offset = labelProps.offset, className = labelProps.className;
  var _ref18 = viewBox, cx = _ref18.cx, cy = _ref18.cy, innerRadius = _ref18.innerRadius, outerRadius = _ref18.outerRadius, startAngle = _ref18.startAngle, endAngle = _ref18.endAngle, clockWise = _ref18.clockWise;
  var radius = (innerRadius + outerRadius) / 2;
  var deltaAngle = getDeltaAngle(startAngle, endAngle);
  var sign3 = deltaAngle >= 0 ? 1 : -1;
  var labelAngle, direction;
  if (position2 === "insideStart") {
    labelAngle = startAngle + sign3 * offset;
    direction = clockWise;
  } else if (position2 === "insideEnd") {
    labelAngle = endAngle - sign3 * offset;
    direction = !clockWise;
  } else if (position2 === "end") {
    labelAngle = endAngle + sign3 * offset;
    direction = clockWise;
  }
  direction = deltaAngle <= 0 ? direction : !direction;
  var startPoint = polarToCartesian(cx, cy, radius, labelAngle);
  var endPoint = polarToCartesian(cx, cy, radius, labelAngle + (direction ? 1 : -1) * 359);
  var path2 = "M".concat(startPoint.x, ",").concat(startPoint.y, "\n    A").concat(radius, ",").concat(radius, ",0,1,").concat(direction ? 0 : 1, ",\n    ").concat(endPoint.x, ",").concat(endPoint.y);
  var id2 = (0, import_isNil7.default)(labelProps.id) ? uniqueId("recharts-radial-line-") : labelProps.id;
  return /* @__PURE__ */ import_react92.default.createElement("text", _extends16({}, attrs, {
    dominantBaseline: "central",
    className: (0, import_classnames9.default)("recharts-radial-bar-label", className)
  }), /* @__PURE__ */ import_react92.default.createElement("defs", null, /* @__PURE__ */ import_react92.default.createElement("path", {
    id: id2,
    d: path2
  })), /* @__PURE__ */ import_react92.default.createElement("textPath", {
    xlinkHref: "#".concat(id2)
  }, label));
};
var getAttrsOfPolarLabel = function getAttrsOfPolarLabel2(props) {
  var viewBox = props.viewBox, offset = props.offset, position2 = props.position;
  var _ref22 = viewBox, cx = _ref22.cx, cy = _ref22.cy, innerRadius = _ref22.innerRadius, outerRadius = _ref22.outerRadius, startAngle = _ref22.startAngle, endAngle = _ref22.endAngle;
  var midAngle = (startAngle + endAngle) / 2;
  if (position2 === "outside") {
    var _polarToCartesian = polarToCartesian(cx, cy, outerRadius + offset, midAngle), _x2 = _polarToCartesian.x, _y2 = _polarToCartesian.y;
    return {
      x: _x2,
      y: _y2,
      textAnchor: _x2 >= cx ? "start" : "end",
      verticalAnchor: "middle"
    };
  }
  if (position2 === "center") {
    return {
      x: cx,
      y: cy,
      textAnchor: "middle",
      verticalAnchor: "middle"
    };
  }
  if (position2 === "centerTop") {
    return {
      x: cx,
      y: cy,
      textAnchor: "middle",
      verticalAnchor: "start"
    };
  }
  if (position2 === "centerBottom") {
    return {
      x: cx,
      y: cy,
      textAnchor: "middle",
      verticalAnchor: "end"
    };
  }
  var r3 = (innerRadius + outerRadius) / 2;
  var _polarToCartesian2 = polarToCartesian(cx, cy, r3, midAngle), x2 = _polarToCartesian2.x, y2 = _polarToCartesian2.y;
  return {
    x: x2,
    y: y2,
    textAnchor: "middle",
    verticalAnchor: "middle"
  };
};
var getAttrsOfCartesianLabel = function getAttrsOfCartesianLabel2(props) {
  var viewBox = props.viewBox, parentViewBox = props.parentViewBox, offset = props.offset, position2 = props.position;
  var _ref32 = viewBox, x2 = _ref32.x, y2 = _ref32.y, width = _ref32.width, height = _ref32.height;
  var verticalSign = height >= 0 ? 1 : -1;
  var verticalOffset = verticalSign * offset;
  var verticalEnd = verticalSign > 0 ? "end" : "start";
  var verticalStart = verticalSign > 0 ? "start" : "end";
  var horizontalSign = width >= 0 ? 1 : -1;
  var horizontalOffset = horizontalSign * offset;
  var horizontalEnd = horizontalSign > 0 ? "end" : "start";
  var horizontalStart = horizontalSign > 0 ? "start" : "end";
  if (position2 === "top") {
    var attrs = {
      x: x2 + width / 2,
      y: y2 - verticalSign * offset,
      textAnchor: "middle",
      verticalAnchor: verticalEnd
    };
    return _objectSpread15(_objectSpread15({}, attrs), parentViewBox ? {
      height: Math.max(y2 - parentViewBox.y, 0),
      width
    } : {});
  }
  if (position2 === "bottom") {
    var _attrs = {
      x: x2 + width / 2,
      y: y2 + height + verticalOffset,
      textAnchor: "middle",
      verticalAnchor: verticalStart
    };
    return _objectSpread15(_objectSpread15({}, _attrs), parentViewBox ? {
      height: Math.max(parentViewBox.y + parentViewBox.height - (y2 + height), 0),
      width
    } : {});
  }
  if (position2 === "left") {
    var _attrs2 = {
      x: x2 - horizontalOffset,
      y: y2 + height / 2,
      textAnchor: horizontalEnd,
      verticalAnchor: "middle"
    };
    return _objectSpread15(_objectSpread15({}, _attrs2), parentViewBox ? {
      width: Math.max(_attrs2.x - parentViewBox.x, 0),
      height
    } : {});
  }
  if (position2 === "right") {
    var _attrs3 = {
      x: x2 + width + horizontalOffset,
      y: y2 + height / 2,
      textAnchor: horizontalStart,
      verticalAnchor: "middle"
    };
    return _objectSpread15(_objectSpread15({}, _attrs3), parentViewBox ? {
      width: Math.max(parentViewBox.x + parentViewBox.width - _attrs3.x, 0),
      height
    } : {});
  }
  var sizeAttrs = parentViewBox ? {
    width,
    height
  } : {};
  if (position2 === "insideLeft") {
    return _objectSpread15({
      x: x2 + horizontalOffset,
      y: y2 + height / 2,
      textAnchor: horizontalStart,
      verticalAnchor: "middle"
    }, sizeAttrs);
  }
  if (position2 === "insideRight") {
    return _objectSpread15({
      x: x2 + width - horizontalOffset,
      y: y2 + height / 2,
      textAnchor: horizontalEnd,
      verticalAnchor: "middle"
    }, sizeAttrs);
  }
  if (position2 === "insideTop") {
    return _objectSpread15({
      x: x2 + width / 2,
      y: y2 + verticalOffset,
      textAnchor: "middle",
      verticalAnchor: verticalStart
    }, sizeAttrs);
  }
  if (position2 === "insideBottom") {
    return _objectSpread15({
      x: x2 + width / 2,
      y: y2 + height - verticalOffset,
      textAnchor: "middle",
      verticalAnchor: verticalEnd
    }, sizeAttrs);
  }
  if (position2 === "insideTopLeft") {
    return _objectSpread15({
      x: x2 + horizontalOffset,
      y: y2 + verticalOffset,
      textAnchor: horizontalStart,
      verticalAnchor: verticalStart
    }, sizeAttrs);
  }
  if (position2 === "insideTopRight") {
    return _objectSpread15({
      x: x2 + width - horizontalOffset,
      y: y2 + verticalOffset,
      textAnchor: horizontalEnd,
      verticalAnchor: verticalStart
    }, sizeAttrs);
  }
  if (position2 === "insideBottomLeft") {
    return _objectSpread15({
      x: x2 + horizontalOffset,
      y: y2 + height - verticalOffset,
      textAnchor: horizontalStart,
      verticalAnchor: verticalEnd
    }, sizeAttrs);
  }
  if (position2 === "insideBottomRight") {
    return _objectSpread15({
      x: x2 + width - horizontalOffset,
      y: y2 + height - verticalOffset,
      textAnchor: horizontalEnd,
      verticalAnchor: verticalEnd
    }, sizeAttrs);
  }
  if ((0, import_isObject3.default)(position2) && (isNumber(position2.x) || isPercent(position2.x)) && (isNumber(position2.y) || isPercent(position2.y))) {
    return _objectSpread15({
      x: x2 + getPercentValue(position2.x, width),
      y: y2 + getPercentValue(position2.y, height),
      textAnchor: "end",
      verticalAnchor: "end"
    }, sizeAttrs);
  }
  return _objectSpread15({
    x: x2 + width / 2,
    y: y2 + height / 2,
    textAnchor: "middle",
    verticalAnchor: "middle"
  }, sizeAttrs);
};
var isPolar = function isPolar2(viewBox) {
  return "cx" in viewBox && isNumber(viewBox.cx);
};
function Label3(_ref42) {
  var _ref4$offset = _ref42.offset, offset = _ref4$offset === void 0 ? 5 : _ref4$offset, restProps = _objectWithoutProperties10(_ref42, _excluded14);
  var props = _objectSpread15({
    offset
  }, restProps);
  var viewBox = props.viewBox, position2 = props.position, value = props.value, children = props.children, content2 = props.content, _props$className = props.className, className = _props$className === void 0 ? "" : _props$className, textBreakAll = props.textBreakAll;
  if (!viewBox || (0, import_isNil7.default)(value) && (0, import_isNil7.default)(children) && !/* @__PURE__ */ (0, import_react92.isValidElement)(content2) && !(0, import_isFunction6.default)(content2)) {
    return null;
  }
  if (/* @__PURE__ */ (0, import_react92.isValidElement)(content2)) {
    return /* @__PURE__ */ (0, import_react92.cloneElement)(content2, props);
  }
  var label;
  if ((0, import_isFunction6.default)(content2)) {
    label = /* @__PURE__ */ (0, import_react92.createElement)(content2, props);
    if (/* @__PURE__ */ (0, import_react92.isValidElement)(label)) {
      return label;
    }
  } else {
    label = getLabel(props);
  }
  var isPolarLabel = isPolar(viewBox);
  var attrs = filterProps(props, true);
  if (isPolarLabel && (position2 === "insideStart" || position2 === "insideEnd" || position2 === "end")) {
    return renderRadialLabel(props, label, attrs);
  }
  var positionAttrs = isPolarLabel ? getAttrsOfPolarLabel(props) : getAttrsOfCartesianLabel(props);
  return /* @__PURE__ */ import_react92.default.createElement(Text3, _extends16({
    className: (0, import_classnames9.default)("recharts-label", className)
  }, attrs, positionAttrs, {
    breakAll: textBreakAll
  }), label);
}
Label3.displayName = "Label";
var parseViewBox = function parseViewBox2(props) {
  var cx = props.cx, cy = props.cy, angle = props.angle, startAngle = props.startAngle, endAngle = props.endAngle, r3 = props.r, radius = props.radius, innerRadius = props.innerRadius, outerRadius = props.outerRadius, x2 = props.x, y2 = props.y, top2 = props.top, left = props.left, width = props.width, height = props.height, clockWise = props.clockWise, labelViewBox = props.labelViewBox;
  if (labelViewBox) {
    return labelViewBox;
  }
  if (isNumber(width) && isNumber(height)) {
    if (isNumber(x2) && isNumber(y2)) {
      return {
        x: x2,
        y: y2,
        width,
        height
      };
    }
    if (isNumber(top2) && isNumber(left)) {
      return {
        x: top2,
        y: left,
        width,
        height
      };
    }
  }
  if (isNumber(x2) && isNumber(y2)) {
    return {
      x: x2,
      y: y2,
      width: 0,
      height: 0
    };
  }
  if (isNumber(cx) && isNumber(cy)) {
    return {
      cx,
      cy,
      startAngle: startAngle || angle || 0,
      endAngle: endAngle || angle || 0,
      innerRadius: innerRadius || 0,
      outerRadius: outerRadius || radius || r3 || 0,
      clockWise
    };
  }
  if (props.viewBox) {
    return props.viewBox;
  }
  return {};
};
var parseLabel = function parseLabel2(label, viewBox) {
  if (!label) {
    return null;
  }
  if (label === true) {
    return /* @__PURE__ */ import_react92.default.createElement(Label3, {
      key: "label-implicit",
      viewBox
    });
  }
  if (isNumOrStr(label)) {
    return /* @__PURE__ */ import_react92.default.createElement(Label3, {
      key: "label-implicit",
      viewBox,
      value: label
    });
  }
  if (/* @__PURE__ */ (0, import_react92.isValidElement)(label)) {
    if (label.type === Label3) {
      return /* @__PURE__ */ (0, import_react92.cloneElement)(label, {
        key: "label-implicit",
        viewBox
      });
    }
    return /* @__PURE__ */ import_react92.default.createElement(Label3, {
      key: "label-implicit",
      content: label,
      viewBox
    });
  }
  if ((0, import_isFunction6.default)(label)) {
    return /* @__PURE__ */ import_react92.default.createElement(Label3, {
      key: "label-implicit",
      content: label,
      viewBox
    });
  }
  if ((0, import_isObject3.default)(label)) {
    return /* @__PURE__ */ import_react92.default.createElement(Label3, _extends16({
      viewBox
    }, label, {
      key: "label-implicit"
    }));
  }
  return null;
};
var renderCallByParent = function renderCallByParent2(parentProps, viewBox) {
  var checkPropsLabel = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : true;
  if (!parentProps || !parentProps.children && checkPropsLabel && !parentProps.label) {
    return null;
  }
  var children = parentProps.children;
  var parentViewBox = parseViewBox(parentProps);
  var explicitChildren = findAllByType(children, Label3).map(function(child, index) {
    return /* @__PURE__ */ (0, import_react92.cloneElement)(child, {
      viewBox: viewBox || parentViewBox,
      // eslint-disable-next-line react/no-array-index-key
      key: "label-".concat(index)
    });
  });
  if (!checkPropsLabel) {
    return explicitChildren;
  }
  var implicitLabel = parseLabel(parentProps.label, viewBox || parentViewBox);
  return [implicitLabel].concat(_toConsumableArray8(explicitChildren));
};
Label3.parseViewBox = parseViewBox;
Label3.renderCallByParent = renderCallByParent;

// node_modules/recharts/es6/component/LabelList.js
var import_isObject4 = __toESM(require_isObject());
var import_isFunction7 = __toESM(require_isFunction());
var import_isNil8 = __toESM(require_isNil());
var import_last = __toESM(require_last());
var import_isArray5 = __toESM(require_isArray());
var import_react93 = __toESM(require_react());
function _typeof21(o) {
  "@babel/helpers - typeof";
  return _typeof21 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
    return typeof o2;
  } : function(o2) {
    return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
  }, _typeof21(o);
}
var _excluded15 = ["valueAccessor"];
var _excluded25 = ["data", "dataKey", "clockWise", "id", "textBreakAll"];
function _toConsumableArray9(arr) {
  return _arrayWithoutHoles9(arr) || _iterableToArray10(arr) || _unsupportedIterableToArray17(arr) || _nonIterableSpread9();
}
function _nonIterableSpread9() {
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _unsupportedIterableToArray17(o, minLen) {
  if (!o)
    return;
  if (typeof o === "string")
    return _arrayLikeToArray17(o, minLen);
  var n2 = Object.prototype.toString.call(o).slice(8, -1);
  if (n2 === "Object" && o.constructor)
    n2 = o.constructor.name;
  if (n2 === "Map" || n2 === "Set")
    return Array.from(o);
  if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2))
    return _arrayLikeToArray17(o, minLen);
}
function _iterableToArray10(iter) {
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
    return Array.from(iter);
}
function _arrayWithoutHoles9(arr) {
  if (Array.isArray(arr))
    return _arrayLikeToArray17(arr);
}
function _arrayLikeToArray17(arr, len) {
  if (len == null || len > arr.length)
    len = arr.length;
  for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++)
    arr2[i2] = arr[i2];
  return arr2;
}
function _extends17() {
  _extends17 = Object.assign ? Object.assign.bind() : function(target) {
    for (var i2 = 1; i2 < arguments.length; i2++) {
      var source = arguments[i2];
      for (var key in source) {
        if (Object.prototype.hasOwnProperty.call(source, key)) {
          target[key] = source[key];
        }
      }
    }
    return target;
  };
  return _extends17.apply(this, arguments);
}
function ownKeys16(e3, r3) {
  var t3 = Object.keys(e3);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e3);
    r3 && (o = o.filter(function(r4) {
      return Object.getOwnPropertyDescriptor(e3, r4).enumerable;
    })), t3.push.apply(t3, o);
  }
  return t3;
}
function _objectSpread16(e3) {
  for (var r3 = 1; r3 < arguments.length; r3++) {
    var t3 = null != arguments[r3] ? arguments[r3] : {};
    r3 % 2 ? ownKeys16(Object(t3), true).forEach(function(r4) {
      _defineProperty16(e3, r4, t3[r4]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e3, Object.getOwnPropertyDescriptors(t3)) : ownKeys16(Object(t3)).forEach(function(r4) {
      Object.defineProperty(e3, r4, Object.getOwnPropertyDescriptor(t3, r4));
    });
  }
  return e3;
}
function _defineProperty16(obj, key, value) {
  key = _toPropertyKey17(key);
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
function _toPropertyKey17(arg) {
  var key = _toPrimitive17(arg, "string");
  return _typeof21(key) === "symbol" ? key : String(key);
}
function _toPrimitive17(input, hint) {
  if (_typeof21(input) !== "object" || input === null)
    return input;
  var prim = input[Symbol.toPrimitive];
  if (prim !== void 0) {
    var res = prim.call(input, hint || "default");
    if (_typeof21(res) !== "object")
      return res;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (hint === "string" ? String : Number)(input);
}
function _objectWithoutProperties11(source, excluded) {
  if (source == null)
    return {};
  var target = _objectWithoutPropertiesLoose15(source, excluded);
  var key, i2;
  if (Object.getOwnPropertySymbols) {
    var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
    for (i2 = 0; i2 < sourceSymbolKeys.length; i2++) {
      key = sourceSymbolKeys[i2];
      if (excluded.indexOf(key) >= 0)
        continue;
      if (!Object.prototype.propertyIsEnumerable.call(source, key))
        continue;
      target[key] = source[key];
    }
  }
  return target;
}
function _objectWithoutPropertiesLoose15(source, excluded) {
  if (source == null)
    return {};
  var target = {};
  var sourceKeys = Object.keys(source);
  var key, i2;
  for (i2 = 0; i2 < sourceKeys.length; i2++) {
    key = sourceKeys[i2];
    if (excluded.indexOf(key) >= 0)
      continue;
    target[key] = source[key];
  }
  return target;
}
var defaultAccessor = function defaultAccessor2(entry) {
  return (0, import_isArray5.default)(entry.value) ? (0, import_last.default)(entry.value) : entry.value;
};
function LabelList(_ref18) {
  var _ref$valueAccessor = _ref18.valueAccessor, valueAccessor = _ref$valueAccessor === void 0 ? defaultAccessor : _ref$valueAccessor, restProps = _objectWithoutProperties11(_ref18, _excluded15);
  var data = restProps.data, dataKey = restProps.dataKey, clockWise = restProps.clockWise, id2 = restProps.id, textBreakAll = restProps.textBreakAll, others = _objectWithoutProperties11(restProps, _excluded25);
  if (!data || !data.length) {
    return null;
  }
  return /* @__PURE__ */ import_react93.default.createElement(Layer, {
    className: "recharts-label-list"
  }, data.map(function(entry, index) {
    var value = (0, import_isNil8.default)(dataKey) ? valueAccessor(entry, index) : getValueByDataKey(entry && entry.payload, dataKey);
    var idProps = (0, import_isNil8.default)(id2) ? {} : {
      id: "".concat(id2, "-").concat(index)
    };
    return /* @__PURE__ */ import_react93.default.createElement(Label3, _extends17({}, filterProps(entry, true), others, idProps, {
      parentViewBox: entry.parentViewBox,
      index,
      value,
      textBreakAll,
      viewBox: Label3.parseViewBox((0, import_isNil8.default)(clockWise) ? entry : _objectSpread16(_objectSpread16({}, entry), {}, {
        clockWise
      })),
      key: "label-".concat(index)
      // eslint-disable-line react/no-array-index-key
    }));
  }));
}
LabelList.displayName = "LabelList";
function parseLabelList(label, data) {
  if (!label) {
    return null;
  }
  if (label === true) {
    return /* @__PURE__ */ import_react93.default.createElement(LabelList, {
      key: "labelList-implicit",
      data
    });
  }
  if (/* @__PURE__ */ import_react93.default.isValidElement(label) || (0, import_isFunction7.default)(label)) {
    return /* @__PURE__ */ import_react93.default.createElement(LabelList, {
      key: "labelList-implicit",
      data,
      content: label
    });
  }
  if ((0, import_isObject4.default)(label)) {
    return /* @__PURE__ */ import_react93.default.createElement(LabelList, _extends17({
      data
    }, label, {
      key: "labelList-implicit"
    }));
  }
  return null;
}
function renderCallByParent3(parentProps, data) {
  var checkPropsLabel = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : true;
  if (!parentProps || !parentProps.children && checkPropsLabel && !parentProps.label) {
    return null;
  }
  var children = parentProps.children;
  var explicitChildren = findAllByType(children, LabelList).map(function(child, index) {
    return /* @__PURE__ */ (0, import_react93.cloneElement)(child, {
      data,
      // eslint-disable-next-line react/no-array-index-key
      key: "labelList-".concat(index)
    });
  });
  if (!checkPropsLabel) {
    return explicitChildren;
  }
  var implicitLabelList = parseLabelList(parentProps.label, data);
  return [implicitLabelList].concat(_toConsumableArray9(explicitChildren));
}
LabelList.renderCallByParent = renderCallByParent3;

// node_modules/recharts/es6/shape/Sector.js
var import_react94 = __toESM(require_react());
var import_classnames10 = __toESM(require_classnames());
function _typeof22(o) {
  "@babel/helpers - typeof";
  return _typeof22 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
    return typeof o2;
  } : function(o2) {
    return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
  }, _typeof22(o);
}
function _extends18() {
  _extends18 = Object.assign ? Object.assign.bind() : function(target) {
    for (var i2 = 1; i2 < arguments.length; i2++) {
      var source = arguments[i2];
      for (var key in source) {
        if (Object.prototype.hasOwnProperty.call(source, key)) {
          target[key] = source[key];
        }
      }
    }
    return target;
  };
  return _extends18.apply(this, arguments);
}
function ownKeys17(e3, r3) {
  var t3 = Object.keys(e3);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e3);
    r3 && (o = o.filter(function(r4) {
      return Object.getOwnPropertyDescriptor(e3, r4).enumerable;
    })), t3.push.apply(t3, o);
  }
  return t3;
}
function _objectSpread17(e3) {
  for (var r3 = 1; r3 < arguments.length; r3++) {
    var t3 = null != arguments[r3] ? arguments[r3] : {};
    r3 % 2 ? ownKeys17(Object(t3), true).forEach(function(r4) {
      _defineProperty17(e3, r4, t3[r4]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e3, Object.getOwnPropertyDescriptors(t3)) : ownKeys17(Object(t3)).forEach(function(r4) {
      Object.defineProperty(e3, r4, Object.getOwnPropertyDescriptor(t3, r4));
    });
  }
  return e3;
}
function _defineProperty17(obj, key, value) {
  key = _toPropertyKey18(key);
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
function _toPropertyKey18(arg) {
  var key = _toPrimitive18(arg, "string");
  return _typeof22(key) === "symbol" ? key : String(key);
}
function _toPrimitive18(input, hint) {
  if (_typeof22(input) !== "object" || input === null)
    return input;
  var prim = input[Symbol.toPrimitive];
  if (prim !== void 0) {
    var res = prim.call(input, hint || "default");
    if (_typeof22(res) !== "object")
      return res;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (hint === "string" ? String : Number)(input);
}
var getDeltaAngle3 = function getDeltaAngle4(startAngle, endAngle) {
  var sign3 = mathSign(endAngle - startAngle);
  var deltaAngle = Math.min(Math.abs(endAngle - startAngle), 359.999);
  return sign3 * deltaAngle;
};
var getTangentCircle = function getTangentCircle2(_ref18) {
  var cx = _ref18.cx, cy = _ref18.cy, radius = _ref18.radius, angle = _ref18.angle, sign3 = _ref18.sign, isExternal = _ref18.isExternal, cornerRadius = _ref18.cornerRadius, cornerIsExternal = _ref18.cornerIsExternal;
  var centerRadius = cornerRadius * (isExternal ? 1 : -1) + radius;
  var theta = Math.asin(cornerRadius / centerRadius) / RADIAN2;
  var centerAngle = cornerIsExternal ? angle : angle + sign3 * theta;
  var center = polarToCartesian(cx, cy, centerRadius, centerAngle);
  var circleTangency = polarToCartesian(cx, cy, radius, centerAngle);
  var lineTangencyAngle = cornerIsExternal ? angle - sign3 * theta : angle;
  var lineTangency = polarToCartesian(cx, cy, centerRadius * Math.cos(theta * RADIAN2), lineTangencyAngle);
  return {
    center,
    circleTangency,
    lineTangency,
    theta
  };
};
var getSectorPath = function getSectorPath2(_ref22) {
  var cx = _ref22.cx, cy = _ref22.cy, innerRadius = _ref22.innerRadius, outerRadius = _ref22.outerRadius, startAngle = _ref22.startAngle, endAngle = _ref22.endAngle;
  var angle = getDeltaAngle3(startAngle, endAngle);
  var tempEndAngle = startAngle + angle;
  var outerStartPoint = polarToCartesian(cx, cy, outerRadius, startAngle);
  var outerEndPoint = polarToCartesian(cx, cy, outerRadius, tempEndAngle);
  var path2 = "M ".concat(outerStartPoint.x, ",").concat(outerStartPoint.y, "\n    A ").concat(outerRadius, ",").concat(outerRadius, ",0,\n    ").concat(+(Math.abs(angle) > 180), ",").concat(+(startAngle > tempEndAngle), ",\n    ").concat(outerEndPoint.x, ",").concat(outerEndPoint.y, "\n  ");
  if (innerRadius > 0) {
    var innerStartPoint = polarToCartesian(cx, cy, innerRadius, startAngle);
    var innerEndPoint = polarToCartesian(cx, cy, innerRadius, tempEndAngle);
    path2 += "L ".concat(innerEndPoint.x, ",").concat(innerEndPoint.y, "\n            A ").concat(innerRadius, ",").concat(innerRadius, ",0,\n            ").concat(+(Math.abs(angle) > 180), ",").concat(+(startAngle <= tempEndAngle), ",\n            ").concat(innerStartPoint.x, ",").concat(innerStartPoint.y, " Z");
  } else {
    path2 += "L ".concat(cx, ",").concat(cy, " Z");
  }
  return path2;
};
var getSectorWithCorner = function getSectorWithCorner2(_ref32) {
  var cx = _ref32.cx, cy = _ref32.cy, innerRadius = _ref32.innerRadius, outerRadius = _ref32.outerRadius, cornerRadius = _ref32.cornerRadius, forceCornerRadius = _ref32.forceCornerRadius, cornerIsExternal = _ref32.cornerIsExternal, startAngle = _ref32.startAngle, endAngle = _ref32.endAngle;
  var sign3 = mathSign(endAngle - startAngle);
  var _getTangentCircle = getTangentCircle({
    cx,
    cy,
    radius: outerRadius,
    angle: startAngle,
    sign: sign3,
    cornerRadius,
    cornerIsExternal
  }), soct = _getTangentCircle.circleTangency, solt = _getTangentCircle.lineTangency, sot = _getTangentCircle.theta;
  var _getTangentCircle2 = getTangentCircle({
    cx,
    cy,
    radius: outerRadius,
    angle: endAngle,
    sign: -sign3,
    cornerRadius,
    cornerIsExternal
  }), eoct = _getTangentCircle2.circleTangency, eolt = _getTangentCircle2.lineTangency, eot = _getTangentCircle2.theta;
  var outerArcAngle = cornerIsExternal ? Math.abs(startAngle - endAngle) : Math.abs(startAngle - endAngle) - sot - eot;
  if (outerArcAngle < 0) {
    if (forceCornerRadius) {
      return "M ".concat(solt.x, ",").concat(solt.y, "\n        a").concat(cornerRadius, ",").concat(cornerRadius, ",0,0,1,").concat(cornerRadius * 2, ",0\n        a").concat(cornerRadius, ",").concat(cornerRadius, ",0,0,1,").concat(-cornerRadius * 2, ",0\n      ");
    }
    return getSectorPath({
      cx,
      cy,
      innerRadius,
      outerRadius,
      startAngle,
      endAngle
    });
  }
  var path2 = "M ".concat(solt.x, ",").concat(solt.y, "\n    A").concat(cornerRadius, ",").concat(cornerRadius, ",0,0,").concat(+(sign3 < 0), ",").concat(soct.x, ",").concat(soct.y, "\n    A").concat(outerRadius, ",").concat(outerRadius, ",0,").concat(+(outerArcAngle > 180), ",").concat(+(sign3 < 0), ",").concat(eoct.x, ",").concat(eoct.y, "\n    A").concat(cornerRadius, ",").concat(cornerRadius, ",0,0,").concat(+(sign3 < 0), ",").concat(eolt.x, ",").concat(eolt.y, "\n  ");
  if (innerRadius > 0) {
    var _getTangentCircle3 = getTangentCircle({
      cx,
      cy,
      radius: innerRadius,
      angle: startAngle,
      sign: sign3,
      isExternal: true,
      cornerRadius,
      cornerIsExternal
    }), sict = _getTangentCircle3.circleTangency, silt = _getTangentCircle3.lineTangency, sit = _getTangentCircle3.theta;
    var _getTangentCircle4 = getTangentCircle({
      cx,
      cy,
      radius: innerRadius,
      angle: endAngle,
      sign: -sign3,
      isExternal: true,
      cornerRadius,
      cornerIsExternal
    }), eict = _getTangentCircle4.circleTangency, eilt = _getTangentCircle4.lineTangency, eit = _getTangentCircle4.theta;
    var innerArcAngle = cornerIsExternal ? Math.abs(startAngle - endAngle) : Math.abs(startAngle - endAngle) - sit - eit;
    if (innerArcAngle < 0 && cornerRadius === 0) {
      return "".concat(path2, "L").concat(cx, ",").concat(cy, "Z");
    }
    path2 += "L".concat(eilt.x, ",").concat(eilt.y, "\n      A").concat(cornerRadius, ",").concat(cornerRadius, ",0,0,").concat(+(sign3 < 0), ",").concat(eict.x, ",").concat(eict.y, "\n      A").concat(innerRadius, ",").concat(innerRadius, ",0,").concat(+(innerArcAngle > 180), ",").concat(+(sign3 > 0), ",").concat(sict.x, ",").concat(sict.y, "\n      A").concat(cornerRadius, ",").concat(cornerRadius, ",0,0,").concat(+(sign3 < 0), ",").concat(silt.x, ",").concat(silt.y, "Z");
  } else {
    path2 += "L".concat(cx, ",").concat(cy, "Z");
  }
  return path2;
};
var defaultProps2 = {
  cx: 0,
  cy: 0,
  innerRadius: 0,
  outerRadius: 0,
  startAngle: 0,
  endAngle: 0,
  cornerRadius: 0,
  forceCornerRadius: false,
  cornerIsExternal: false
};
var Sector = function Sector2(sectorProps) {
  var props = _objectSpread17(_objectSpread17({}, defaultProps2), sectorProps);
  var cx = props.cx, cy = props.cy, innerRadius = props.innerRadius, outerRadius = props.outerRadius, cornerRadius = props.cornerRadius, forceCornerRadius = props.forceCornerRadius, cornerIsExternal = props.cornerIsExternal, startAngle = props.startAngle, endAngle = props.endAngle, className = props.className;
  if (outerRadius < innerRadius || startAngle === endAngle) {
    return null;
  }
  var layerClass = (0, import_classnames10.default)("recharts-sector", className);
  var deltaRadius = outerRadius - innerRadius;
  var cr = getPercentValue(cornerRadius, deltaRadius, 0, true);
  var path2;
  if (cr > 0 && Math.abs(startAngle - endAngle) < 360) {
    path2 = getSectorWithCorner({
      cx,
      cy,
      innerRadius,
      outerRadius,
      cornerRadius: Math.min(cr, deltaRadius / 2),
      forceCornerRadius,
      cornerIsExternal,
      startAngle,
      endAngle
    });
  } else {
    path2 = getSectorPath({
      cx,
      cy,
      innerRadius,
      outerRadius,
      startAngle,
      endAngle
    });
  }
  return /* @__PURE__ */ import_react94.default.createElement("path", _extends18({}, filterProps(props, true), {
    className: layerClass,
    d: path2,
    role: "img"
  }));
};

// node_modules/recharts/es6/shape/Curve.js
var import_isArray6 = __toESM(require_isArray());
var import_upperFirst3 = __toESM(require_upperFirst());
var import_isFunction8 = __toESM(require_isFunction());
var import_react95 = __toESM(require_react());
var import_classnames11 = __toESM(require_classnames());
function _typeof23(o) {
  "@babel/helpers - typeof";
  return _typeof23 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
    return typeof o2;
  } : function(o2) {
    return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
  }, _typeof23(o);
}
function _extends19() {
  _extends19 = Object.assign ? Object.assign.bind() : function(target) {
    for (var i2 = 1; i2 < arguments.length; i2++) {
      var source = arguments[i2];
      for (var key in source) {
        if (Object.prototype.hasOwnProperty.call(source, key)) {
          target[key] = source[key];
        }
      }
    }
    return target;
  };
  return _extends19.apply(this, arguments);
}
function ownKeys18(e3, r3) {
  var t3 = Object.keys(e3);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e3);
    r3 && (o = o.filter(function(r4) {
      return Object.getOwnPropertyDescriptor(e3, r4).enumerable;
    })), t3.push.apply(t3, o);
  }
  return t3;
}
function _objectSpread18(e3) {
  for (var r3 = 1; r3 < arguments.length; r3++) {
    var t3 = null != arguments[r3] ? arguments[r3] : {};
    r3 % 2 ? ownKeys18(Object(t3), true).forEach(function(r4) {
      _defineProperty18(e3, r4, t3[r4]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e3, Object.getOwnPropertyDescriptors(t3)) : ownKeys18(Object(t3)).forEach(function(r4) {
      Object.defineProperty(e3, r4, Object.getOwnPropertyDescriptor(t3, r4));
    });
  }
  return e3;
}
function _defineProperty18(obj, key, value) {
  key = _toPropertyKey19(key);
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
function _toPropertyKey19(arg) {
  var key = _toPrimitive19(arg, "string");
  return _typeof23(key) === "symbol" ? key : String(key);
}
function _toPrimitive19(input, hint) {
  if (_typeof23(input) !== "object" || input === null)
    return input;
  var prim = input[Symbol.toPrimitive];
  if (prim !== void 0) {
    var res = prim.call(input, hint || "default");
    if (_typeof23(res) !== "object")
      return res;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (hint === "string" ? String : Number)(input);
}
var CURVE_FACTORIES = {
  curveBasisClosed: basisClosed_default2,
  curveBasisOpen: basisOpen_default,
  curveBasis: basis_default2,
  curveBumpX: bumpX,
  curveBumpY: bumpY,
  curveLinearClosed: linearClosed_default,
  curveLinear: linear_default,
  curveMonotoneX: monotoneX,
  curveMonotoneY: monotoneY,
  curveNatural: natural_default,
  curveStep: step_default,
  curveStepAfter: stepAfter,
  curveStepBefore: stepBefore
};
var defined = function defined2(p) {
  return p.x === +p.x && p.y === +p.y;
};
var getX = function getX2(p) {
  return p.x;
};
var getY = function getY2(p) {
  return p.y;
};
var getCurveFactory = function getCurveFactory2(type, layout) {
  if ((0, import_isFunction8.default)(type)) {
    return type;
  }
  var name2 = "curve".concat((0, import_upperFirst3.default)(type));
  if ((name2 === "curveMonotone" || name2 === "curveBump") && layout) {
    return CURVE_FACTORIES["".concat(name2).concat(layout === "vertical" ? "Y" : "X")];
  }
  return CURVE_FACTORIES[name2] || linear_default;
};
var getPath = function getPath2(_ref18) {
  var _ref$type = _ref18.type, type = _ref$type === void 0 ? "linear" : _ref$type, _ref$points = _ref18.points, points = _ref$points === void 0 ? [] : _ref$points, baseLine = _ref18.baseLine, layout = _ref18.layout, _ref$connectNulls = _ref18.connectNulls, connectNulls = _ref$connectNulls === void 0 ? false : _ref$connectNulls;
  var curveFactory = getCurveFactory(type, layout);
  var formatPoints = connectNulls ? points.filter(function(entry) {
    return defined(entry);
  }) : points;
  var lineFunction;
  if ((0, import_isArray6.default)(baseLine)) {
    var formatBaseLine = connectNulls ? baseLine.filter(function(base2) {
      return defined(base2);
    }) : baseLine;
    var areaPoints = formatPoints.map(function(entry, index) {
      return _objectSpread18(_objectSpread18({}, entry), {}, {
        base: formatBaseLine[index]
      });
    });
    if (layout === "vertical") {
      lineFunction = area_default().y(getY).x1(getX).x0(function(d) {
        return d.base.x;
      });
    } else {
      lineFunction = area_default().x(getX).y1(getY).y0(function(d) {
        return d.base.y;
      });
    }
    lineFunction.defined(defined).curve(curveFactory);
    return lineFunction(areaPoints);
  }
  if (layout === "vertical" && isNumber(baseLine)) {
    lineFunction = area_default().y(getY).x1(getX).x0(baseLine);
  } else if (isNumber(baseLine)) {
    lineFunction = area_default().x(getX).y1(getY).y0(baseLine);
  } else {
    lineFunction = line_default().x(getX).y(getY);
  }
  lineFunction.defined(defined).curve(curveFactory);
  return lineFunction(formatPoints);
};
var Curve2 = function Curve3(props) {
  var className = props.className, points = props.points, path2 = props.path, pathRef = props.pathRef;
  if ((!points || !points.length) && !path2) {
    return null;
  }
  var realPath = points && points.length ? getPath(props) : path2;
  return /* @__PURE__ */ import_react95.default.createElement("path", _extends19({}, filterProps(props), adaptEventHandlers(props), {
    className: (0, import_classnames11.default)("recharts-curve", className),
    d: realPath,
    ref: pathRef
  }));
};

// node_modules/recharts/es6/shape/Rectangle.js
var import_react96 = __toESM(require_react());
var import_classnames12 = __toESM(require_classnames());
function _typeof24(o) {
  "@babel/helpers - typeof";
  return _typeof24 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
    return typeof o2;
  } : function(o2) {
    return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
  }, _typeof24(o);
}
function _extends20() {
  _extends20 = Object.assign ? Object.assign.bind() : function(target) {
    for (var i2 = 1; i2 < arguments.length; i2++) {
      var source = arguments[i2];
      for (var key in source) {
        if (Object.prototype.hasOwnProperty.call(source, key)) {
          target[key] = source[key];
        }
      }
    }
    return target;
  };
  return _extends20.apply(this, arguments);
}
function _slicedToArray10(arr, i2) {
  return _arrayWithHoles11(arr) || _iterableToArrayLimit10(arr, i2) || _unsupportedIterableToArray18(arr, i2) || _nonIterableRest11();
}
function _nonIterableRest11() {
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _unsupportedIterableToArray18(o, minLen) {
  if (!o)
    return;
  if (typeof o === "string")
    return _arrayLikeToArray18(o, minLen);
  var n2 = Object.prototype.toString.call(o).slice(8, -1);
  if (n2 === "Object" && o.constructor)
    n2 = o.constructor.name;
  if (n2 === "Map" || n2 === "Set")
    return Array.from(o);
  if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2))
    return _arrayLikeToArray18(o, minLen);
}
function _arrayLikeToArray18(arr, len) {
  if (len == null || len > arr.length)
    len = arr.length;
  for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++)
    arr2[i2] = arr[i2];
  return arr2;
}
function _iterableToArrayLimit10(r3, l) {
  var t3 = null == r3 ? null : "undefined" != typeof Symbol && r3[Symbol.iterator] || r3["@@iterator"];
  if (null != t3) {
    var e3, n2, i2, u, a2 = [], f = true, o = false;
    try {
      if (i2 = (t3 = t3.call(r3)).next, 0 === l) {
        if (Object(t3) !== t3)
          return;
        f = false;
      } else
        for (; !(f = (e3 = i2.call(t3)).done) && (a2.push(e3.value), a2.length !== l); f = true)
          ;
    } catch (r4) {
      o = true, n2 = r4;
    } finally {
      try {
        if (!f && null != t3["return"] && (u = t3["return"](), Object(u) !== u))
          return;
      } finally {
        if (o)
          throw n2;
      }
    }
    return a2;
  }
}
function _arrayWithHoles11(arr) {
  if (Array.isArray(arr))
    return arr;
}
function ownKeys19(e3, r3) {
  var t3 = Object.keys(e3);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e3);
    r3 && (o = o.filter(function(r4) {
      return Object.getOwnPropertyDescriptor(e3, r4).enumerable;
    })), t3.push.apply(t3, o);
  }
  return t3;
}
function _objectSpread19(e3) {
  for (var r3 = 1; r3 < arguments.length; r3++) {
    var t3 = null != arguments[r3] ? arguments[r3] : {};
    r3 % 2 ? ownKeys19(Object(t3), true).forEach(function(r4) {
      _defineProperty19(e3, r4, t3[r4]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e3, Object.getOwnPropertyDescriptors(t3)) : ownKeys19(Object(t3)).forEach(function(r4) {
      Object.defineProperty(e3, r4, Object.getOwnPropertyDescriptor(t3, r4));
    });
  }
  return e3;
}
function _defineProperty19(obj, key, value) {
  key = _toPropertyKey20(key);
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
function _toPropertyKey20(arg) {
  var key = _toPrimitive20(arg, "string");
  return _typeof24(key) === "symbol" ? key : String(key);
}
function _toPrimitive20(input, hint) {
  if (_typeof24(input) !== "object" || input === null)
    return input;
  var prim = input[Symbol.toPrimitive];
  if (prim !== void 0) {
    var res = prim.call(input, hint || "default");
    if (_typeof24(res) !== "object")
      return res;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (hint === "string" ? String : Number)(input);
}
var getRectanglePath = function getRectanglePath2(x2, y2, width, height, radius) {
  var maxRadius = Math.min(Math.abs(width) / 2, Math.abs(height) / 2);
  var ySign = height >= 0 ? 1 : -1;
  var xSign = width >= 0 ? 1 : -1;
  var clockWise = height >= 0 && width >= 0 || height < 0 && width < 0 ? 1 : 0;
  var path2;
  if (maxRadius > 0 && radius instanceof Array) {
    var newRadius = [0, 0, 0, 0];
    for (var i2 = 0, len = 4; i2 < len; i2++) {
      newRadius[i2] = radius[i2] > maxRadius ? maxRadius : radius[i2];
    }
    path2 = "M".concat(x2, ",").concat(y2 + ySign * newRadius[0]);
    if (newRadius[0] > 0) {
      path2 += "A ".concat(newRadius[0], ",").concat(newRadius[0], ",0,0,").concat(clockWise, ",").concat(x2 + xSign * newRadius[0], ",").concat(y2);
    }
    path2 += "L ".concat(x2 + width - xSign * newRadius[1], ",").concat(y2);
    if (newRadius[1] > 0) {
      path2 += "A ".concat(newRadius[1], ",").concat(newRadius[1], ",0,0,").concat(clockWise, ",\n        ").concat(x2 + width, ",").concat(y2 + ySign * newRadius[1]);
    }
    path2 += "L ".concat(x2 + width, ",").concat(y2 + height - ySign * newRadius[2]);
    if (newRadius[2] > 0) {
      path2 += "A ".concat(newRadius[2], ",").concat(newRadius[2], ",0,0,").concat(clockWise, ",\n        ").concat(x2 + width - xSign * newRadius[2], ",").concat(y2 + height);
    }
    path2 += "L ".concat(x2 + xSign * newRadius[3], ",").concat(y2 + height);
    if (newRadius[3] > 0) {
      path2 += "A ".concat(newRadius[3], ",").concat(newRadius[3], ",0,0,").concat(clockWise, ",\n        ").concat(x2, ",").concat(y2 + height - ySign * newRadius[3]);
    }
    path2 += "Z";
  } else if (maxRadius > 0 && radius === +radius && radius > 0) {
    var _newRadius = Math.min(maxRadius, radius);
    path2 = "M ".concat(x2, ",").concat(y2 + ySign * _newRadius, "\n            A ").concat(_newRadius, ",").concat(_newRadius, ",0,0,").concat(clockWise, ",").concat(x2 + xSign * _newRadius, ",").concat(y2, "\n            L ").concat(x2 + width - xSign * _newRadius, ",").concat(y2, "\n            A ").concat(_newRadius, ",").concat(_newRadius, ",0,0,").concat(clockWise, ",").concat(x2 + width, ",").concat(y2 + ySign * _newRadius, "\n            L ").concat(x2 + width, ",").concat(y2 + height - ySign * _newRadius, "\n            A ").concat(_newRadius, ",").concat(_newRadius, ",0,0,").concat(clockWise, ",").concat(x2 + width - xSign * _newRadius, ",").concat(y2 + height, "\n            L ").concat(x2 + xSign * _newRadius, ",").concat(y2 + height, "\n            A ").concat(_newRadius, ",").concat(_newRadius, ",0,0,").concat(clockWise, ",").concat(x2, ",").concat(y2 + height - ySign * _newRadius, " Z");
  } else {
    path2 = "M ".concat(x2, ",").concat(y2, " h ").concat(width, " v ").concat(height, " h ").concat(-width, " Z");
  }
  return path2;
};
var isInRectangle = function isInRectangle2(point4, rect) {
  if (!point4 || !rect) {
    return false;
  }
  var px2 = point4.x, py2 = point4.y;
  var x2 = rect.x, y2 = rect.y, width = rect.width, height = rect.height;
  if (Math.abs(width) > 0 && Math.abs(height) > 0) {
    var minX = Math.min(x2, x2 + width);
    var maxX = Math.max(x2, x2 + width);
    var minY = Math.min(y2, y2 + height);
    var maxY = Math.max(y2, y2 + height);
    return px2 >= minX && px2 <= maxX && py2 >= minY && py2 <= maxY;
  }
  return false;
};
var defaultProps3 = {
  x: 0,
  y: 0,
  width: 0,
  height: 0,
  // The radius of border
  // The radius of four corners when radius is a number
  // The radius of left-top, right-top, right-bottom, left-bottom when radius is an array
  radius: 0,
  isAnimationActive: false,
  isUpdateAnimationActive: false,
  animationBegin: 0,
  animationDuration: 1500,
  animationEasing: "ease"
};
var Rectangle = function Rectangle2(rectangleProps) {
  var props = _objectSpread19(_objectSpread19({}, defaultProps3), rectangleProps);
  var pathRef = (0, import_react96.useRef)();
  var _useState = (0, import_react96.useState)(-1), _useState2 = _slicedToArray10(_useState, 2), totalLength = _useState2[0], setTotalLength = _useState2[1];
  (0, import_react96.useEffect)(function() {
    if (pathRef.current && pathRef.current.getTotalLength) {
      try {
        var pathTotalLength = pathRef.current.getTotalLength();
        if (pathTotalLength) {
          setTotalLength(pathTotalLength);
        }
      } catch (err) {
      }
    }
  }, []);
  var x2 = props.x, y2 = props.y, width = props.width, height = props.height, radius = props.radius, className = props.className;
  var animationEasing = props.animationEasing, animationDuration = props.animationDuration, animationBegin = props.animationBegin, isAnimationActive = props.isAnimationActive, isUpdateAnimationActive = props.isUpdateAnimationActive;
  if (x2 !== +x2 || y2 !== +y2 || width !== +width || height !== +height || width === 0 || height === 0) {
    return null;
  }
  var layerClass = (0, import_classnames12.default)("recharts-rectangle", className);
  if (!isUpdateAnimationActive) {
    return /* @__PURE__ */ import_react96.default.createElement("path", _extends20({}, filterProps(props, true), {
      className: layerClass,
      d: getRectanglePath(x2, y2, width, height, radius)
    }));
  }
  return /* @__PURE__ */ import_react96.default.createElement(es6_default, {
    canBegin: totalLength > 0,
    from: {
      width,
      height,
      x: x2,
      y: y2
    },
    to: {
      width,
      height,
      x: x2,
      y: y2
    },
    duration: animationDuration,
    animationEasing,
    isActive: isUpdateAnimationActive
  }, function(_ref18) {
    var currWidth = _ref18.width, currHeight = _ref18.height, currX = _ref18.x, currY = _ref18.y;
    return /* @__PURE__ */ import_react96.default.createElement(es6_default, {
      canBegin: totalLength > 0,
      from: "0px ".concat(totalLength === -1 ? 1 : totalLength, "px"),
      to: "".concat(totalLength, "px 0px"),
      attributeName: "strokeDasharray",
      begin: animationBegin,
      duration: animationDuration,
      isActive: isAnimationActive,
      easing: animationEasing
    }, /* @__PURE__ */ import_react96.default.createElement("path", _extends20({}, filterProps(props, true), {
      className: layerClass,
      d: getRectanglePath(currX, currY, currWidth, currHeight, radius),
      ref: pathRef
    })));
  });
};

// node_modules/recharts/es6/shape/Polygon.js
var import_react97 = __toESM(require_react());
var import_classnames13 = __toESM(require_classnames());
var _excluded16 = ["points", "className", "baseLinePoints", "connectNulls"];
function _extends21() {
  _extends21 = Object.assign ? Object.assign.bind() : function(target) {
    for (var i2 = 1; i2 < arguments.length; i2++) {
      var source = arguments[i2];
      for (var key in source) {
        if (Object.prototype.hasOwnProperty.call(source, key)) {
          target[key] = source[key];
        }
      }
    }
    return target;
  };
  return _extends21.apply(this, arguments);
}
function _objectWithoutProperties12(source, excluded) {
  if (source == null)
    return {};
  var target = _objectWithoutPropertiesLoose16(source, excluded);
  var key, i2;
  if (Object.getOwnPropertySymbols) {
    var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
    for (i2 = 0; i2 < sourceSymbolKeys.length; i2++) {
      key = sourceSymbolKeys[i2];
      if (excluded.indexOf(key) >= 0)
        continue;
      if (!Object.prototype.propertyIsEnumerable.call(source, key))
        continue;
      target[key] = source[key];
    }
  }
  return target;
}
function _objectWithoutPropertiesLoose16(source, excluded) {
  if (source == null)
    return {};
  var target = {};
  var sourceKeys = Object.keys(source);
  var key, i2;
  for (i2 = 0; i2 < sourceKeys.length; i2++) {
    key = sourceKeys[i2];
    if (excluded.indexOf(key) >= 0)
      continue;
    target[key] = source[key];
  }
  return target;
}
function _toConsumableArray10(arr) {
  return _arrayWithoutHoles10(arr) || _iterableToArray11(arr) || _unsupportedIterableToArray19(arr) || _nonIterableSpread10();
}
function _nonIterableSpread10() {
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _unsupportedIterableToArray19(o, minLen) {
  if (!o)
    return;
  if (typeof o === "string")
    return _arrayLikeToArray19(o, minLen);
  var n2 = Object.prototype.toString.call(o).slice(8, -1);
  if (n2 === "Object" && o.constructor)
    n2 = o.constructor.name;
  if (n2 === "Map" || n2 === "Set")
    return Array.from(o);
  if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2))
    return _arrayLikeToArray19(o, minLen);
}
function _iterableToArray11(iter) {
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
    return Array.from(iter);
}
function _arrayWithoutHoles10(arr) {
  if (Array.isArray(arr))
    return _arrayLikeToArray19(arr);
}
function _arrayLikeToArray19(arr, len) {
  if (len == null || len > arr.length)
    len = arr.length;
  for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++)
    arr2[i2] = arr[i2];
  return arr2;
}
var isValidatePoint = function isValidatePoint2(point4) {
  return point4 && point4.x === +point4.x && point4.y === +point4.y;
};
var getParsedPoints = function getParsedPoints2() {
  var points = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
  var segmentPoints = [[]];
  points.forEach(function(entry) {
    if (isValidatePoint(entry)) {
      segmentPoints[segmentPoints.length - 1].push(entry);
    } else if (segmentPoints[segmentPoints.length - 1].length > 0) {
      segmentPoints.push([]);
    }
  });
  if (isValidatePoint(points[0])) {
    segmentPoints[segmentPoints.length - 1].push(points[0]);
  }
  if (segmentPoints[segmentPoints.length - 1].length <= 0) {
    segmentPoints = segmentPoints.slice(0, -1);
  }
  return segmentPoints;
};
var getSinglePolygonPath = function getSinglePolygonPath2(points, connectNulls) {
  var segmentPoints = getParsedPoints(points);
  if (connectNulls) {
    segmentPoints = [segmentPoints.reduce(function(res, segPoints) {
      return [].concat(_toConsumableArray10(res), _toConsumableArray10(segPoints));
    }, [])];
  }
  var polygonPath = segmentPoints.map(function(segPoints) {
    return segPoints.reduce(function(path2, point4, index) {
      return "".concat(path2).concat(index === 0 ? "M" : "L").concat(point4.x, ",").concat(point4.y);
    }, "");
  }).join("");
  return segmentPoints.length === 1 ? "".concat(polygonPath, "Z") : polygonPath;
};
var getRanglePath = function getRanglePath2(points, baseLinePoints, connectNulls) {
  var outerPath = getSinglePolygonPath(points, connectNulls);
  return "".concat(outerPath.slice(-1) === "Z" ? outerPath.slice(0, -1) : outerPath, "L").concat(getSinglePolygonPath(baseLinePoints.reverse(), connectNulls).slice(1));
};
var Polygon = function Polygon2(props) {
  var points = props.points, className = props.className, baseLinePoints = props.baseLinePoints, connectNulls = props.connectNulls, others = _objectWithoutProperties12(props, _excluded16);
  if (!points || !points.length) {
    return null;
  }
  var layerClass = (0, import_classnames13.default)("recharts-polygon", className);
  if (baseLinePoints && baseLinePoints.length) {
    var hasStroke = others.stroke && others.stroke !== "none";
    var rangePath = getRanglePath(points, baseLinePoints, connectNulls);
    return /* @__PURE__ */ import_react97.default.createElement("g", {
      className: layerClass
    }, /* @__PURE__ */ import_react97.default.createElement("path", _extends21({}, filterProps(others, true), {
      fill: rangePath.slice(-1) === "Z" ? others.fill : "none",
      stroke: "none",
      d: rangePath
    })), hasStroke ? /* @__PURE__ */ import_react97.default.createElement("path", _extends21({}, filterProps(others, true), {
      fill: "none",
      d: getSinglePolygonPath(points, connectNulls)
    })) : null, hasStroke ? /* @__PURE__ */ import_react97.default.createElement("path", _extends21({}, filterProps(others, true), {
      fill: "none",
      d: getSinglePolygonPath(baseLinePoints, connectNulls)
    })) : null);
  }
  var singlePath = getSinglePolygonPath(points, connectNulls);
  return /* @__PURE__ */ import_react97.default.createElement("path", _extends21({}, filterProps(others, true), {
    fill: singlePath.slice(-1) === "Z" ? others.fill : "none",
    className: layerClass,
    d: singlePath
  }));
};

// node_modules/recharts/es6/shape/Dot.js
var import_react98 = __toESM(require_react());
var import_classnames14 = __toESM(require_classnames());
function _extends22() {
  _extends22 = Object.assign ? Object.assign.bind() : function(target) {
    for (var i2 = 1; i2 < arguments.length; i2++) {
      var source = arguments[i2];
      for (var key in source) {
        if (Object.prototype.hasOwnProperty.call(source, key)) {
          target[key] = source[key];
        }
      }
    }
    return target;
  };
  return _extends22.apply(this, arguments);
}
var Dot = function Dot2(props) {
  var cx = props.cx, cy = props.cy, r3 = props.r, className = props.className;
  var layerClass = (0, import_classnames14.default)("recharts-dot", className);
  if (cx === +cx && cy === +cy && r3 === +r3) {
    return /* @__PURE__ */ import_react98.default.createElement("circle", _extends22({}, filterProps(props), adaptEventHandlers(props), {
      className: layerClass,
      cx,
      cy,
      r: r3
    }));
  }
  return null;
};

// node_modules/recharts/es6/shape/Cross.js
var import_react99 = __toESM(require_react());
var import_classnames15 = __toESM(require_classnames());
function _typeof25(o) {
  "@babel/helpers - typeof";
  return _typeof25 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
    return typeof o2;
  } : function(o2) {
    return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
  }, _typeof25(o);
}
var _excluded17 = ["x", "y", "top", "left", "width", "height", "className"];
function _extends23() {
  _extends23 = Object.assign ? Object.assign.bind() : function(target) {
    for (var i2 = 1; i2 < arguments.length; i2++) {
      var source = arguments[i2];
      for (var key in source) {
        if (Object.prototype.hasOwnProperty.call(source, key)) {
          target[key] = source[key];
        }
      }
    }
    return target;
  };
  return _extends23.apply(this, arguments);
}
function ownKeys20(e3, r3) {
  var t3 = Object.keys(e3);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e3);
    r3 && (o = o.filter(function(r4) {
      return Object.getOwnPropertyDescriptor(e3, r4).enumerable;
    })), t3.push.apply(t3, o);
  }
  return t3;
}
function _objectSpread20(e3) {
  for (var r3 = 1; r3 < arguments.length; r3++) {
    var t3 = null != arguments[r3] ? arguments[r3] : {};
    r3 % 2 ? ownKeys20(Object(t3), true).forEach(function(r4) {
      _defineProperty20(e3, r4, t3[r4]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e3, Object.getOwnPropertyDescriptors(t3)) : ownKeys20(Object(t3)).forEach(function(r4) {
      Object.defineProperty(e3, r4, Object.getOwnPropertyDescriptor(t3, r4));
    });
  }
  return e3;
}
function _defineProperty20(obj, key, value) {
  key = _toPropertyKey21(key);
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
function _toPropertyKey21(arg) {
  var key = _toPrimitive21(arg, "string");
  return _typeof25(key) === "symbol" ? key : String(key);
}
function _toPrimitive21(input, hint) {
  if (_typeof25(input) !== "object" || input === null)
    return input;
  var prim = input[Symbol.toPrimitive];
  if (prim !== void 0) {
    var res = prim.call(input, hint || "default");
    if (_typeof25(res) !== "object")
      return res;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (hint === "string" ? String : Number)(input);
}
function _objectWithoutProperties13(source, excluded) {
  if (source == null)
    return {};
  var target = _objectWithoutPropertiesLoose17(source, excluded);
  var key, i2;
  if (Object.getOwnPropertySymbols) {
    var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
    for (i2 = 0; i2 < sourceSymbolKeys.length; i2++) {
      key = sourceSymbolKeys[i2];
      if (excluded.indexOf(key) >= 0)
        continue;
      if (!Object.prototype.propertyIsEnumerable.call(source, key))
        continue;
      target[key] = source[key];
    }
  }
  return target;
}
function _objectWithoutPropertiesLoose17(source, excluded) {
  if (source == null)
    return {};
  var target = {};
  var sourceKeys = Object.keys(source);
  var key, i2;
  for (i2 = 0; i2 < sourceKeys.length; i2++) {
    key = sourceKeys[i2];
    if (excluded.indexOf(key) >= 0)
      continue;
    target[key] = source[key];
  }
  return target;
}
var getPath3 = function getPath4(x2, y2, width, height, top2, left) {
  return "M".concat(x2, ",").concat(top2, "v").concat(height, "M").concat(left, ",").concat(y2, "h").concat(width);
};
var Cross = function Cross2(_ref18) {
  var _ref$x = _ref18.x, x2 = _ref$x === void 0 ? 0 : _ref$x, _ref$y = _ref18.y, y2 = _ref$y === void 0 ? 0 : _ref$y, _ref$top = _ref18.top, top2 = _ref$top === void 0 ? 0 : _ref$top, _ref$left = _ref18.left, left = _ref$left === void 0 ? 0 : _ref$left, _ref$width = _ref18.width, width = _ref$width === void 0 ? 0 : _ref$width, _ref$height = _ref18.height, height = _ref$height === void 0 ? 0 : _ref$height, className = _ref18.className, rest = _objectWithoutProperties13(_ref18, _excluded17);
  var props = _objectSpread20({
    x: x2,
    y: y2,
    top: top2,
    left,
    width,
    height
  }, rest);
  if (!isNumber(x2) || !isNumber(y2) || !isNumber(width) || !isNumber(height) || !isNumber(top2) || !isNumber(left)) {
    return null;
  }
  return /* @__PURE__ */ import_react99.default.createElement("path", _extends23({}, filterProps(props, true), {
    className: (0, import_classnames15.default)("recharts-cross", className),
    d: getPath3(x2, y2, width, height, top2, left)
  }));
};

// node_modules/recharts/es6/polar/PolarRadiusAxis.js
var import_isFunction9 = __toESM(require_isFunction());
var import_minBy = __toESM(require_minBy());
var import_maxBy = __toESM(require_maxBy());
var import_react100 = __toESM(require_react());
var _excluded18 = ["cx", "cy", "angle", "ticks", "axisLine"];
var _excluded26 = ["ticks", "tick", "angle", "tickFormatter", "stroke"];
function _typeof26(o) {
  "@babel/helpers - typeof";
  return _typeof26 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
    return typeof o2;
  } : function(o2) {
    return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
  }, _typeof26(o);
}
function _extends24() {
  _extends24 = Object.assign ? Object.assign.bind() : function(target) {
    for (var i2 = 1; i2 < arguments.length; i2++) {
      var source = arguments[i2];
      for (var key in source) {
        if (Object.prototype.hasOwnProperty.call(source, key)) {
          target[key] = source[key];
        }
      }
    }
    return target;
  };
  return _extends24.apply(this, arguments);
}
function ownKeys21(e3, r3) {
  var t3 = Object.keys(e3);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e3);
    r3 && (o = o.filter(function(r4) {
      return Object.getOwnPropertyDescriptor(e3, r4).enumerable;
    })), t3.push.apply(t3, o);
  }
  return t3;
}
function _objectSpread21(e3) {
  for (var r3 = 1; r3 < arguments.length; r3++) {
    var t3 = null != arguments[r3] ? arguments[r3] : {};
    r3 % 2 ? ownKeys21(Object(t3), true).forEach(function(r4) {
      _defineProperty21(e3, r4, t3[r4]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e3, Object.getOwnPropertyDescriptors(t3)) : ownKeys21(Object(t3)).forEach(function(r4) {
      Object.defineProperty(e3, r4, Object.getOwnPropertyDescriptor(t3, r4));
    });
  }
  return e3;
}
function _objectWithoutProperties14(source, excluded) {
  if (source == null)
    return {};
  var target = _objectWithoutPropertiesLoose18(source, excluded);
  var key, i2;
  if (Object.getOwnPropertySymbols) {
    var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
    for (i2 = 0; i2 < sourceSymbolKeys.length; i2++) {
      key = sourceSymbolKeys[i2];
      if (excluded.indexOf(key) >= 0)
        continue;
      if (!Object.prototype.propertyIsEnumerable.call(source, key))
        continue;
      target[key] = source[key];
    }
  }
  return target;
}
function _objectWithoutPropertiesLoose18(source, excluded) {
  if (source == null)
    return {};
  var target = {};
  var sourceKeys = Object.keys(source);
  var key, i2;
  for (i2 = 0; i2 < sourceKeys.length; i2++) {
    key = sourceKeys[i2];
    if (excluded.indexOf(key) >= 0)
      continue;
    target[key] = source[key];
  }
  return target;
}
function _classCallCheck7(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties7(target, props) {
  for (var i2 = 0; i2 < props.length; i2++) {
    var descriptor = props[i2];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor)
      descriptor.writable = true;
    Object.defineProperty(target, _toPropertyKey22(descriptor.key), descriptor);
  }
}
function _createClass7(Constructor, protoProps, staticProps) {
  if (protoProps)
    _defineProperties7(Constructor.prototype, protoProps);
  if (staticProps)
    _defineProperties7(Constructor, staticProps);
  Object.defineProperty(Constructor, "prototype", { writable: false });
  return Constructor;
}
function _inherits6(subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function");
  }
  subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
  Object.defineProperty(subClass, "prototype", { writable: false });
  if (superClass)
    _setPrototypeOf8(subClass, superClass);
}
function _setPrototypeOf8(o, p) {
  _setPrototypeOf8 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf19(o2, p2) {
    o2.__proto__ = p2;
    return o2;
  };
  return _setPrototypeOf8(o, p);
}
function _createSuper6(Derived) {
  var hasNativeReflectConstruct = _isNativeReflectConstruct7();
  return function _createSuperInternal() {
    var Super = _getPrototypeOf7(Derived), result;
    if (hasNativeReflectConstruct) {
      var NewTarget = _getPrototypeOf7(this).constructor;
      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }
    return _possibleConstructorReturn6(this, result);
  };
}
function _possibleConstructorReturn6(self2, call) {
  if (call && (_typeof26(call) === "object" || typeof call === "function")) {
    return call;
  } else if (call !== void 0) {
    throw new TypeError("Derived constructors may only return object or undefined");
  }
  return _assertThisInitialized8(self2);
}
function _assertThisInitialized8(self2) {
  if (self2 === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }
  return self2;
}
function _isNativeReflectConstruct7() {
  if (typeof Reflect === "undefined" || !Reflect.construct)
    return false;
  if (Reflect.construct.sham)
    return false;
  if (typeof Proxy === "function")
    return true;
  try {
    Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
    return true;
  } catch (e3) {
    return false;
  }
}
function _getPrototypeOf7(o) {
  _getPrototypeOf7 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf18(o2) {
    return o2.__proto__ || Object.getPrototypeOf(o2);
  };
  return _getPrototypeOf7(o);
}
function _defineProperty21(obj, key, value) {
  key = _toPropertyKey22(key);
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
function _toPropertyKey22(arg) {
  var key = _toPrimitive22(arg, "string");
  return _typeof26(key) === "symbol" ? key : String(key);
}
function _toPrimitive22(input, hint) {
  if (_typeof26(input) !== "object" || input === null)
    return input;
  var prim = input[Symbol.toPrimitive];
  if (prim !== void 0) {
    var res = prim.call(input, hint || "default");
    if (_typeof26(res) !== "object")
      return res;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (hint === "string" ? String : Number)(input);
}
var PolarRadiusAxis = /* @__PURE__ */ function(_PureComponent) {
  _inherits6(PolarRadiusAxis2, _PureComponent);
  var _super = _createSuper6(PolarRadiusAxis2);
  function PolarRadiusAxis2() {
    _classCallCheck7(this, PolarRadiusAxis2);
    return _super.apply(this, arguments);
  }
  _createClass7(PolarRadiusAxis2, [{
    key: "getTickValueCoord",
    value: (
      /**
       * Calculate the coordinate of tick
       * @param  {Number} coordinate The radius of tick
       * @return {Object} (x, y)
       */
      function getTickValueCoord(_ref18) {
        var coordinate = _ref18.coordinate;
        var _this$props = this.props, angle = _this$props.angle, cx = _this$props.cx, cy = _this$props.cy;
        return polarToCartesian(cx, cy, coordinate, angle);
      }
    )
  }, {
    key: "getTickTextAnchor",
    value: function getTickTextAnchor() {
      var orientation = this.props.orientation;
      var textAnchor;
      switch (orientation) {
        case "left":
          textAnchor = "end";
          break;
        case "right":
          textAnchor = "start";
          break;
        default:
          textAnchor = "middle";
          break;
      }
      return textAnchor;
    }
  }, {
    key: "getViewBox",
    value: function getViewBox() {
      var _this$props2 = this.props, cx = _this$props2.cx, cy = _this$props2.cy, angle = _this$props2.angle, ticks2 = _this$props2.ticks;
      var maxRadiusTick = (0, import_maxBy.default)(ticks2, function(entry) {
        return entry.coordinate || 0;
      });
      var minRadiusTick = (0, import_minBy.default)(ticks2, function(entry) {
        return entry.coordinate || 0;
      });
      return {
        cx,
        cy,
        startAngle: angle,
        endAngle: angle,
        innerRadius: minRadiusTick.coordinate || 0,
        outerRadius: maxRadiusTick.coordinate || 0
      };
    }
  }, {
    key: "renderAxisLine",
    value: function renderAxisLine() {
      var _this$props3 = this.props, cx = _this$props3.cx, cy = _this$props3.cy, angle = _this$props3.angle, ticks2 = _this$props3.ticks, axisLine = _this$props3.axisLine, others = _objectWithoutProperties14(_this$props3, _excluded18);
      var extent2 = ticks2.reduce(function(result, entry) {
        return [Math.min(result[0], entry.coordinate), Math.max(result[1], entry.coordinate)];
      }, [Infinity, -Infinity]);
      var point0 = polarToCartesian(cx, cy, extent2[0], angle);
      var point1 = polarToCartesian(cx, cy, extent2[1], angle);
      var props = _objectSpread21(_objectSpread21(_objectSpread21({}, filterProps(others)), {}, {
        fill: "none"
      }, filterProps(axisLine)), {}, {
        x1: point0.x,
        y1: point0.y,
        x2: point1.x,
        y2: point1.y
      });
      return /* @__PURE__ */ import_react100.default.createElement("line", _extends24({
        className: "recharts-polar-radius-axis-line"
      }, props));
    }
  }, {
    key: "renderTicks",
    value: function renderTicks() {
      var _this = this;
      var _this$props4 = this.props, ticks2 = _this$props4.ticks, tick = _this$props4.tick, angle = _this$props4.angle, tickFormatter = _this$props4.tickFormatter, stroke = _this$props4.stroke, others = _objectWithoutProperties14(_this$props4, _excluded26);
      var textAnchor = this.getTickTextAnchor();
      var axisProps = filterProps(others);
      var customTickProps = filterProps(tick);
      var items = ticks2.map(function(entry, i2) {
        var coord = _this.getTickValueCoord(entry);
        var tickProps = _objectSpread21(_objectSpread21(_objectSpread21(_objectSpread21({
          textAnchor,
          transform: "rotate(".concat(90 - angle, ", ").concat(coord.x, ", ").concat(coord.y, ")")
        }, axisProps), {}, {
          stroke: "none",
          fill: stroke
        }, customTickProps), {}, {
          index: i2
        }, coord), {}, {
          payload: entry
        });
        return /* @__PURE__ */ import_react100.default.createElement(Layer, _extends24({
          className: "recharts-polar-radius-axis-tick",
          key: "tick-".concat(i2)
          // eslint-disable-line react/no-array-index-key
        }, adaptEventsOfChild(_this.props, entry, i2)), PolarRadiusAxis2.renderTickItem(tick, tickProps, tickFormatter ? tickFormatter(entry.value, i2) : entry.value));
      });
      return /* @__PURE__ */ import_react100.default.createElement(Layer, {
        className: "recharts-polar-radius-axis-ticks"
      }, items);
    }
  }, {
    key: "render",
    value: function render2() {
      var _this$props5 = this.props, ticks2 = _this$props5.ticks, axisLine = _this$props5.axisLine, tick = _this$props5.tick;
      if (!ticks2 || !ticks2.length) {
        return null;
      }
      return /* @__PURE__ */ import_react100.default.createElement(Layer, {
        className: "recharts-polar-radius-axis"
      }, axisLine && this.renderAxisLine(), tick && this.renderTicks(), Label3.renderCallByParent(this.props, this.getViewBox()));
    }
  }], [{
    key: "renderTickItem",
    value: function renderTickItem(option, props, value) {
      var tickItem;
      if (/* @__PURE__ */ import_react100.default.isValidElement(option)) {
        tickItem = /* @__PURE__ */ import_react100.default.cloneElement(option, props);
      } else if ((0, import_isFunction9.default)(option)) {
        tickItem = option(props);
      } else {
        tickItem = /* @__PURE__ */ import_react100.default.createElement(Text3, _extends24({}, props, {
          className: "recharts-polar-radius-axis-tick-value"
        }), value);
      }
      return tickItem;
    }
  }]);
  return PolarRadiusAxis2;
}(import_react100.PureComponent);
_defineProperty21(PolarRadiusAxis, "displayName", "PolarRadiusAxis");
_defineProperty21(PolarRadiusAxis, "axisType", "radiusAxis");
_defineProperty21(PolarRadiusAxis, "defaultProps", {
  type: "number",
  radiusAxisId: 0,
  cx: 0,
  cy: 0,
  angle: 0,
  orientation: "right",
  stroke: "#ccc",
  axisLine: true,
  tick: true,
  tickCount: 5,
  allowDataOverflow: false,
  scale: "auto",
  allowDuplicatedCategory: true
});

// node_modules/recharts/es6/polar/PolarAngleAxis.js
var import_isFunction10 = __toESM(require_isFunction());
var import_react101 = __toESM(require_react());
function _typeof27(o) {
  "@babel/helpers - typeof";
  return _typeof27 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
    return typeof o2;
  } : function(o2) {
    return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
  }, _typeof27(o);
}
function _extends25() {
  _extends25 = Object.assign ? Object.assign.bind() : function(target) {
    for (var i2 = 1; i2 < arguments.length; i2++) {
      var source = arguments[i2];
      for (var key in source) {
        if (Object.prototype.hasOwnProperty.call(source, key)) {
          target[key] = source[key];
        }
      }
    }
    return target;
  };
  return _extends25.apply(this, arguments);
}
function ownKeys22(e3, r3) {
  var t3 = Object.keys(e3);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e3);
    r3 && (o = o.filter(function(r4) {
      return Object.getOwnPropertyDescriptor(e3, r4).enumerable;
    })), t3.push.apply(t3, o);
  }
  return t3;
}
function _objectSpread22(e3) {
  for (var r3 = 1; r3 < arguments.length; r3++) {
    var t3 = null != arguments[r3] ? arguments[r3] : {};
    r3 % 2 ? ownKeys22(Object(t3), true).forEach(function(r4) {
      _defineProperty22(e3, r4, t3[r4]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e3, Object.getOwnPropertyDescriptors(t3)) : ownKeys22(Object(t3)).forEach(function(r4) {
      Object.defineProperty(e3, r4, Object.getOwnPropertyDescriptor(t3, r4));
    });
  }
  return e3;
}
function _classCallCheck8(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties8(target, props) {
  for (var i2 = 0; i2 < props.length; i2++) {
    var descriptor = props[i2];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor)
      descriptor.writable = true;
    Object.defineProperty(target, _toPropertyKey23(descriptor.key), descriptor);
  }
}
function _createClass8(Constructor, protoProps, staticProps) {
  if (protoProps)
    _defineProperties8(Constructor.prototype, protoProps);
  if (staticProps)
    _defineProperties8(Constructor, staticProps);
  Object.defineProperty(Constructor, "prototype", { writable: false });
  return Constructor;
}
function _inherits7(subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function");
  }
  subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
  Object.defineProperty(subClass, "prototype", { writable: false });
  if (superClass)
    _setPrototypeOf9(subClass, superClass);
}
function _setPrototypeOf9(o, p) {
  _setPrototypeOf9 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf19(o2, p2) {
    o2.__proto__ = p2;
    return o2;
  };
  return _setPrototypeOf9(o, p);
}
function _createSuper7(Derived) {
  var hasNativeReflectConstruct = _isNativeReflectConstruct8();
  return function _createSuperInternal() {
    var Super = _getPrototypeOf8(Derived), result;
    if (hasNativeReflectConstruct) {
      var NewTarget = _getPrototypeOf8(this).constructor;
      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }
    return _possibleConstructorReturn7(this, result);
  };
}
function _possibleConstructorReturn7(self2, call) {
  if (call && (_typeof27(call) === "object" || typeof call === "function")) {
    return call;
  } else if (call !== void 0) {
    throw new TypeError("Derived constructors may only return object or undefined");
  }
  return _assertThisInitialized9(self2);
}
function _assertThisInitialized9(self2) {
  if (self2 === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }
  return self2;
}
function _isNativeReflectConstruct8() {
  if (typeof Reflect === "undefined" || !Reflect.construct)
    return false;
  if (Reflect.construct.sham)
    return false;
  if (typeof Proxy === "function")
    return true;
  try {
    Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
    return true;
  } catch (e3) {
    return false;
  }
}
function _getPrototypeOf8(o) {
  _getPrototypeOf8 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf18(o2) {
    return o2.__proto__ || Object.getPrototypeOf(o2);
  };
  return _getPrototypeOf8(o);
}
function _defineProperty22(obj, key, value) {
  key = _toPropertyKey23(key);
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
function _toPropertyKey23(arg) {
  var key = _toPrimitive23(arg, "string");
  return _typeof27(key) === "symbol" ? key : String(key);
}
function _toPrimitive23(input, hint) {
  if (_typeof27(input) !== "object" || input === null)
    return input;
  var prim = input[Symbol.toPrimitive];
  if (prim !== void 0) {
    var res = prim.call(input, hint || "default");
    if (_typeof27(res) !== "object")
      return res;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (hint === "string" ? String : Number)(input);
}
var RADIAN3 = Math.PI / 180;
var eps = 1e-5;
var PolarAngleAxis = /* @__PURE__ */ function(_PureComponent) {
  _inherits7(PolarAngleAxis2, _PureComponent);
  var _super = _createSuper7(PolarAngleAxis2);
  function PolarAngleAxis2() {
    _classCallCheck8(this, PolarAngleAxis2);
    return _super.apply(this, arguments);
  }
  _createClass8(PolarAngleAxis2, [{
    key: "getTickLineCoord",
    value: (
      /**
       * Calculate the coordinate of line endpoint
       * @param  {Object} data The Data if ticks
       * @return {Object} (x0, y0): The start point of text,
       *                  (x1, y1): The end point close to text,
       *                  (x2, y2): The end point close to axis
       */
      function getTickLineCoord(data) {
        var _this$props = this.props, cx = _this$props.cx, cy = _this$props.cy, radius = _this$props.radius, orientation = _this$props.orientation, tickSize = _this$props.tickSize;
        var tickLineSize = tickSize || 8;
        var p1 = polarToCartesian(cx, cy, radius, data.coordinate);
        var p2 = polarToCartesian(cx, cy, radius + (orientation === "inner" ? -1 : 1) * tickLineSize, data.coordinate);
        return {
          x1: p1.x,
          y1: p1.y,
          x2: p2.x,
          y2: p2.y
        };
      }
    )
    /**
     * Get the text-anchor of each tick
     * @param  {Object} data Data of ticks
     * @return {String} text-anchor
     */
  }, {
    key: "getTickTextAnchor",
    value: function getTickTextAnchor(data) {
      var orientation = this.props.orientation;
      var cos2 = Math.cos(-data.coordinate * RADIAN3);
      var textAnchor;
      if (cos2 > eps) {
        textAnchor = orientation === "outer" ? "start" : "end";
      } else if (cos2 < -eps) {
        textAnchor = orientation === "outer" ? "end" : "start";
      } else {
        textAnchor = "middle";
      }
      return textAnchor;
    }
  }, {
    key: "renderAxisLine",
    value: function renderAxisLine() {
      var _this$props2 = this.props, cx = _this$props2.cx, cy = _this$props2.cy, radius = _this$props2.radius, axisLine = _this$props2.axisLine, axisLineType = _this$props2.axisLineType;
      var props = _objectSpread22(_objectSpread22({}, filterProps(this.props)), {}, {
        fill: "none"
      }, filterProps(axisLine));
      if (axisLineType === "circle") {
        return /* @__PURE__ */ import_react101.default.createElement(Dot, _extends25({
          className: "recharts-polar-angle-axis-line"
        }, props, {
          cx,
          cy,
          r: radius
        }));
      }
      var ticks2 = this.props.ticks;
      var points = ticks2.map(function(entry) {
        return polarToCartesian(cx, cy, radius, entry.coordinate);
      });
      return /* @__PURE__ */ import_react101.default.createElement(Polygon, _extends25({
        className: "recharts-polar-angle-axis-line"
      }, props, {
        points
      }));
    }
  }, {
    key: "renderTicks",
    value: function renderTicks() {
      var _this = this;
      var _this$props3 = this.props, ticks2 = _this$props3.ticks, tick = _this$props3.tick, tickLine = _this$props3.tickLine, tickFormatter = _this$props3.tickFormatter, stroke = _this$props3.stroke;
      var axisProps = filterProps(this.props);
      var customTickProps = filterProps(tick);
      var tickLineProps = _objectSpread22(_objectSpread22({}, axisProps), {}, {
        fill: "none"
      }, filterProps(tickLine));
      var items = ticks2.map(function(entry, i2) {
        var lineCoord = _this.getTickLineCoord(entry);
        var textAnchor = _this.getTickTextAnchor(entry);
        var tickProps = _objectSpread22(_objectSpread22(_objectSpread22({
          textAnchor
        }, axisProps), {}, {
          stroke: "none",
          fill: stroke
        }, customTickProps), {}, {
          index: i2,
          payload: entry,
          x: lineCoord.x2,
          y: lineCoord.y2
        });
        return /* @__PURE__ */ import_react101.default.createElement(Layer, _extends25({
          className: "recharts-polar-angle-axis-tick",
          key: "tick-".concat(i2)
          // eslint-disable-line react/no-array-index-key
        }, adaptEventsOfChild(_this.props, entry, i2)), tickLine && /* @__PURE__ */ import_react101.default.createElement("line", _extends25({
          className: "recharts-polar-angle-axis-tick-line"
        }, tickLineProps, lineCoord)), tick && PolarAngleAxis2.renderTickItem(tick, tickProps, tickFormatter ? tickFormatter(entry.value, i2) : entry.value));
      });
      return /* @__PURE__ */ import_react101.default.createElement(Layer, {
        className: "recharts-polar-angle-axis-ticks"
      }, items);
    }
  }, {
    key: "render",
    value: function render2() {
      var _this$props4 = this.props, ticks2 = _this$props4.ticks, radius = _this$props4.radius, axisLine = _this$props4.axisLine;
      if (radius <= 0 || !ticks2 || !ticks2.length) {
        return null;
      }
      return /* @__PURE__ */ import_react101.default.createElement(Layer, {
        className: "recharts-polar-angle-axis"
      }, axisLine && this.renderAxisLine(), this.renderTicks());
    }
  }], [{
    key: "renderTickItem",
    value: function renderTickItem(option, props, value) {
      var tickItem;
      if (/* @__PURE__ */ import_react101.default.isValidElement(option)) {
        tickItem = /* @__PURE__ */ import_react101.default.cloneElement(option, props);
      } else if ((0, import_isFunction10.default)(option)) {
        tickItem = option(props);
      } else {
        tickItem = /* @__PURE__ */ import_react101.default.createElement(Text3, _extends25({}, props, {
          className: "recharts-polar-angle-axis-tick-value"
        }), value);
      }
      return tickItem;
    }
  }]);
  return PolarAngleAxis2;
}(import_react101.PureComponent);
_defineProperty22(PolarAngleAxis, "displayName", "PolarAngleAxis");
_defineProperty22(PolarAngleAxis, "axisType", "angleAxis");
_defineProperty22(PolarAngleAxis, "defaultProps", {
  type: "category",
  angleAxisId: 0,
  scale: "auto",
  cx: 0,
  cy: 0,
  orientation: "outer",
  axisLine: true,
  tickLine: true,
  tickSize: 8,
  tick: true,
  hide: false,
  allowDuplicatedCategory: true
});

// node_modules/recharts/es6/polar/Pie.js
var import_isEqual3 = __toESM(require_isEqual());
var import_get4 = __toESM(require_get());
var import_isFunction12 = __toESM(require_isFunction());
var import_isNil9 = __toESM(require_isNil());
var import_react104 = __toESM(require_react());
var import_classnames17 = __toESM(require_classnames());

// node_modules/recharts/es6/util/ActiveShapeUtils.js
var import_isEqual2 = __toESM(require_isEqual());
var import_isBoolean = __toESM(require_isBoolean());
var import_isPlainObject = __toESM(require_isPlainObject());
var import_isFunction11 = __toESM(require_isFunction());
var import_react103 = __toESM(require_react());

// node_modules/recharts/es6/shape/Trapezoid.js
var import_react102 = __toESM(require_react());
var import_classnames16 = __toESM(require_classnames());
function _typeof28(o) {
  "@babel/helpers - typeof";
  return _typeof28 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
    return typeof o2;
  } : function(o2) {
    return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
  }, _typeof28(o);
}
function _extends26() {
  _extends26 = Object.assign ? Object.assign.bind() : function(target) {
    for (var i2 = 1; i2 < arguments.length; i2++) {
      var source = arguments[i2];
      for (var key in source) {
        if (Object.prototype.hasOwnProperty.call(source, key)) {
          target[key] = source[key];
        }
      }
    }
    return target;
  };
  return _extends26.apply(this, arguments);
}
function _slicedToArray11(arr, i2) {
  return _arrayWithHoles12(arr) || _iterableToArrayLimit11(arr, i2) || _unsupportedIterableToArray20(arr, i2) || _nonIterableRest12();
}
function _nonIterableRest12() {
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _unsupportedIterableToArray20(o, minLen) {
  if (!o)
    return;
  if (typeof o === "string")
    return _arrayLikeToArray20(o, minLen);
  var n2 = Object.prototype.toString.call(o).slice(8, -1);
  if (n2 === "Object" && o.constructor)
    n2 = o.constructor.name;
  if (n2 === "Map" || n2 === "Set")
    return Array.from(o);
  if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2))
    return _arrayLikeToArray20(o, minLen);
}
function _arrayLikeToArray20(arr, len) {
  if (len == null || len > arr.length)
    len = arr.length;
  for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++)
    arr2[i2] = arr[i2];
  return arr2;
}
function _iterableToArrayLimit11(r3, l) {
  var t3 = null == r3 ? null : "undefined" != typeof Symbol && r3[Symbol.iterator] || r3["@@iterator"];
  if (null != t3) {
    var e3, n2, i2, u, a2 = [], f = true, o = false;
    try {
      if (i2 = (t3 = t3.call(r3)).next, 0 === l) {
        if (Object(t3) !== t3)
          return;
        f = false;
      } else
        for (; !(f = (e3 = i2.call(t3)).done) && (a2.push(e3.value), a2.length !== l); f = true)
          ;
    } catch (r4) {
      o = true, n2 = r4;
    } finally {
      try {
        if (!f && null != t3["return"] && (u = t3["return"](), Object(u) !== u))
          return;
      } finally {
        if (o)
          throw n2;
      }
    }
    return a2;
  }
}
function _arrayWithHoles12(arr) {
  if (Array.isArray(arr))
    return arr;
}
function ownKeys23(e3, r3) {
  var t3 = Object.keys(e3);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e3);
    r3 && (o = o.filter(function(r4) {
      return Object.getOwnPropertyDescriptor(e3, r4).enumerable;
    })), t3.push.apply(t3, o);
  }
  return t3;
}
function _objectSpread23(e3) {
  for (var r3 = 1; r3 < arguments.length; r3++) {
    var t3 = null != arguments[r3] ? arguments[r3] : {};
    r3 % 2 ? ownKeys23(Object(t3), true).forEach(function(r4) {
      _defineProperty23(e3, r4, t3[r4]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e3, Object.getOwnPropertyDescriptors(t3)) : ownKeys23(Object(t3)).forEach(function(r4) {
      Object.defineProperty(e3, r4, Object.getOwnPropertyDescriptor(t3, r4));
    });
  }
  return e3;
}
function _defineProperty23(obj, key, value) {
  key = _toPropertyKey24(key);
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
function _toPropertyKey24(arg) {
  var key = _toPrimitive24(arg, "string");
  return _typeof28(key) === "symbol" ? key : String(key);
}
function _toPrimitive24(input, hint) {
  if (_typeof28(input) !== "object" || input === null)
    return input;
  var prim = input[Symbol.toPrimitive];
  if (prim !== void 0) {
    var res = prim.call(input, hint || "default");
    if (_typeof28(res) !== "object")
      return res;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (hint === "string" ? String : Number)(input);
}
var getTrapezoidPath = function getTrapezoidPath2(x2, y2, upperWidth, lowerWidth, height) {
  var widthGap = upperWidth - lowerWidth;
  var path2;
  path2 = "M ".concat(x2, ",").concat(y2);
  path2 += "L ".concat(x2 + upperWidth, ",").concat(y2);
  path2 += "L ".concat(x2 + upperWidth - widthGap / 2, ",").concat(y2 + height);
  path2 += "L ".concat(x2 + upperWidth - widthGap / 2 - lowerWidth, ",").concat(y2 + height);
  path2 += "L ".concat(x2, ",").concat(y2, " Z");
  return path2;
};
var defaultProps4 = {
  x: 0,
  y: 0,
  upperWidth: 0,
  lowerWidth: 0,
  height: 0,
  isUpdateAnimationActive: false,
  animationBegin: 0,
  animationDuration: 1500,
  animationEasing: "ease"
};
var Trapezoid = function Trapezoid2(props) {
  var trapezoidProps = _objectSpread23(_objectSpread23({}, defaultProps4), props);
  var pathRef = (0, import_react102.useRef)();
  var _useState = (0, import_react102.useState)(-1), _useState2 = _slicedToArray11(_useState, 2), totalLength = _useState2[0], setTotalLength = _useState2[1];
  (0, import_react102.useEffect)(function() {
    if (pathRef.current && pathRef.current.getTotalLength) {
      try {
        var pathTotalLength = pathRef.current.getTotalLength();
        if (pathTotalLength) {
          setTotalLength(pathTotalLength);
        }
      } catch (err) {
      }
    }
  }, []);
  var x2 = trapezoidProps.x, y2 = trapezoidProps.y, upperWidth = trapezoidProps.upperWidth, lowerWidth = trapezoidProps.lowerWidth, height = trapezoidProps.height, className = trapezoidProps.className;
  var animationEasing = trapezoidProps.animationEasing, animationDuration = trapezoidProps.animationDuration, animationBegin = trapezoidProps.animationBegin, isUpdateAnimationActive = trapezoidProps.isUpdateAnimationActive;
  if (x2 !== +x2 || y2 !== +y2 || upperWidth !== +upperWidth || lowerWidth !== +lowerWidth || height !== +height || upperWidth === 0 && lowerWidth === 0 || height === 0) {
    return null;
  }
  var layerClass = (0, import_classnames16.default)("recharts-trapezoid", className);
  if (!isUpdateAnimationActive) {
    return /* @__PURE__ */ import_react102.default.createElement("g", null, /* @__PURE__ */ import_react102.default.createElement("path", _extends26({}, filterProps(trapezoidProps, true), {
      className: layerClass,
      d: getTrapezoidPath(x2, y2, upperWidth, lowerWidth, height)
    })));
  }
  return /* @__PURE__ */ import_react102.default.createElement(es6_default, {
    canBegin: totalLength > 0,
    from: {
      upperWidth: 0,
      lowerWidth: 0,
      height,
      x: x2,
      y: y2
    },
    to: {
      upperWidth,
      lowerWidth,
      height,
      x: x2,
      y: y2
    },
    duration: animationDuration,
    animationEasing,
    isActive: isUpdateAnimationActive
  }, function(_ref18) {
    var currUpperWidth = _ref18.upperWidth, currLowerWidth = _ref18.lowerWidth, currHeight = _ref18.height, currX = _ref18.x, currY = _ref18.y;
    return /* @__PURE__ */ import_react102.default.createElement(es6_default, {
      canBegin: totalLength > 0,
      from: "0px ".concat(totalLength === -1 ? 1 : totalLength, "px"),
      to: "".concat(totalLength, "px 0px"),
      attributeName: "strokeDasharray",
      begin: animationBegin,
      duration: animationDuration,
      easing: animationEasing
    }, /* @__PURE__ */ import_react102.default.createElement("path", _extends26({}, filterProps(trapezoidProps, true), {
      className: layerClass,
      d: getTrapezoidPath(currX, currY, currUpperWidth, currLowerWidth, currHeight),
      ref: pathRef
    })));
  });
};

// node_modules/recharts/es6/util/ActiveShapeUtils.js
var _excluded19 = ["option", "shapeType", "propTransformer", "activeClassName", "isActive"];
function _typeof29(o) {
  "@babel/helpers - typeof";
  return _typeof29 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
    return typeof o2;
  } : function(o2) {
    return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
  }, _typeof29(o);
}
function _objectWithoutProperties15(source, excluded) {
  if (source == null)
    return {};
  var target = _objectWithoutPropertiesLoose19(source, excluded);
  var key, i2;
  if (Object.getOwnPropertySymbols) {
    var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
    for (i2 = 0; i2 < sourceSymbolKeys.length; i2++) {
      key = sourceSymbolKeys[i2];
      if (excluded.indexOf(key) >= 0)
        continue;
      if (!Object.prototype.propertyIsEnumerable.call(source, key))
        continue;
      target[key] = source[key];
    }
  }
  return target;
}
function _objectWithoutPropertiesLoose19(source, excluded) {
  if (source == null)
    return {};
  var target = {};
  var sourceKeys = Object.keys(source);
  var key, i2;
  for (i2 = 0; i2 < sourceKeys.length; i2++) {
    key = sourceKeys[i2];
    if (excluded.indexOf(key) >= 0)
      continue;
    target[key] = source[key];
  }
  return target;
}
function ownKeys24(e3, r3) {
  var t3 = Object.keys(e3);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e3);
    r3 && (o = o.filter(function(r4) {
      return Object.getOwnPropertyDescriptor(e3, r4).enumerable;
    })), t3.push.apply(t3, o);
  }
  return t3;
}
function _objectSpread24(e3) {
  for (var r3 = 1; r3 < arguments.length; r3++) {
    var t3 = null != arguments[r3] ? arguments[r3] : {};
    r3 % 2 ? ownKeys24(Object(t3), true).forEach(function(r4) {
      _defineProperty24(e3, r4, t3[r4]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e3, Object.getOwnPropertyDescriptors(t3)) : ownKeys24(Object(t3)).forEach(function(r4) {
      Object.defineProperty(e3, r4, Object.getOwnPropertyDescriptor(t3, r4));
    });
  }
  return e3;
}
function _defineProperty24(obj, key, value) {
  key = _toPropertyKey25(key);
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
function _toPropertyKey25(arg) {
  var key = _toPrimitive25(arg, "string");
  return _typeof29(key) === "symbol" ? key : String(key);
}
function _toPrimitive25(input, hint) {
  if (_typeof29(input) !== "object" || input === null)
    return input;
  var prim = input[Symbol.toPrimitive];
  if (prim !== void 0) {
    var res = prim.call(input, hint || "default");
    if (_typeof29(res) !== "object")
      return res;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (hint === "string" ? String : Number)(input);
}
function defaultPropTransformer(option, props) {
  return _objectSpread24(_objectSpread24({}, props), option);
}
function isSymbolsProps(shapeType, _elementProps) {
  return shapeType === "symbols";
}
function ShapeSelector(_ref18) {
  var shapeType = _ref18.shapeType, elementProps = _ref18.elementProps;
  switch (shapeType) {
    case "rectangle":
      return /* @__PURE__ */ import_react103.default.createElement(Rectangle, elementProps);
    case "trapezoid":
      return /* @__PURE__ */ import_react103.default.createElement(Trapezoid, elementProps);
    case "sector":
      return /* @__PURE__ */ import_react103.default.createElement(Sector, elementProps);
    case "symbols":
      if (isSymbolsProps(shapeType, elementProps)) {
        return /* @__PURE__ */ import_react103.default.createElement(Symbols, elementProps);
      }
      break;
    default:
      return null;
  }
}
function Shape2(_ref22) {
  var option = _ref22.option, shapeType = _ref22.shapeType, _ref2$propTransformer = _ref22.propTransformer, propTransformer = _ref2$propTransformer === void 0 ? defaultPropTransformer : _ref2$propTransformer, _ref2$activeClassName = _ref22.activeClassName, activeClassName = _ref2$activeClassName === void 0 ? "recharts-active-shape" : _ref2$activeClassName, isActive = _ref22.isActive, props = _objectWithoutProperties15(_ref22, _excluded19);
  var shape;
  if (/* @__PURE__ */ (0, import_react103.isValidElement)(option)) {
    shape = /* @__PURE__ */ (0, import_react103.cloneElement)(option, props);
  } else if ((0, import_isFunction11.default)(option)) {
    shape = option(props);
  } else if ((0, import_isPlainObject.default)(option) && !(0, import_isBoolean.default)(option)) {
    var shapeProps = props;
    var elementProps = propTransformer(option, shapeProps);
    shape = /* @__PURE__ */ import_react103.default.createElement(ShapeSelector, {
      shapeType,
      elementProps
    });
  } else {
    var _elementProps2 = props;
    shape = /* @__PURE__ */ import_react103.default.createElement(ShapeSelector, {
      shapeType,
      elementProps: _elementProps2
    });
  }
  if (isActive) {
    return /* @__PURE__ */ import_react103.default.createElement(Layer, {
      className: activeClassName
    }, shape);
  }
  return shape;
}
function isFunnel(graphicalItem, _item) {
  return "trapezoids" in graphicalItem.props;
}
function isPie(graphicalItem, _item) {
  return "sectors" in graphicalItem.props;
}
function isScatter(graphicalItem, _item) {
  return "points" in graphicalItem.props;
}
function compareFunnel(shapeData, activeTooltipItem) {
  var _activeTooltipItem$la, _activeTooltipItem$la2;
  var xMatches = shapeData.x === (activeTooltipItem === null || activeTooltipItem === void 0 || (_activeTooltipItem$la = activeTooltipItem.labelViewBox) === null || _activeTooltipItem$la === void 0 ? void 0 : _activeTooltipItem$la.x) || shapeData.x === activeTooltipItem.x;
  var yMatches = shapeData.y === (activeTooltipItem === null || activeTooltipItem === void 0 || (_activeTooltipItem$la2 = activeTooltipItem.labelViewBox) === null || _activeTooltipItem$la2 === void 0 ? void 0 : _activeTooltipItem$la2.y) || shapeData.y === activeTooltipItem.y;
  return xMatches && yMatches;
}
function comparePie(shapeData, activeTooltipItem) {
  var startAngleMatches = shapeData.endAngle === activeTooltipItem.endAngle;
  var endAngleMatches = shapeData.startAngle === activeTooltipItem.startAngle;
  return startAngleMatches && endAngleMatches;
}
function compareScatter(shapeData, activeTooltipItem) {
  var xMatches = shapeData.x === activeTooltipItem.x;
  var yMatches = shapeData.y === activeTooltipItem.y;
  var zMatches = shapeData.z === activeTooltipItem.z;
  return xMatches && yMatches && zMatches;
}
function getComparisonFn(graphicalItem, activeItem) {
  var comparison;
  if (isFunnel(graphicalItem, activeItem)) {
    comparison = compareFunnel;
  } else if (isPie(graphicalItem, activeItem)) {
    comparison = comparePie;
  } else if (isScatter(graphicalItem, activeItem)) {
    comparison = compareScatter;
  }
  return comparison;
}
function getShapeDataKey(graphicalItem, activeItem) {
  var shapeKey;
  if (isFunnel(graphicalItem, activeItem)) {
    shapeKey = "trapezoids";
  } else if (isPie(graphicalItem, activeItem)) {
    shapeKey = "sectors";
  } else if (isScatter(graphicalItem, activeItem)) {
    shapeKey = "points";
  }
  return shapeKey;
}
function getActiveShapeTooltipPayload(graphicalItem, activeItem) {
  if (isFunnel(graphicalItem, activeItem)) {
    var _activeItem$tooltipPa;
    return (_activeItem$tooltipPa = activeItem.tooltipPayload) === null || _activeItem$tooltipPa === void 0 || (_activeItem$tooltipPa = _activeItem$tooltipPa[0]) === null || _activeItem$tooltipPa === void 0 || (_activeItem$tooltipPa = _activeItem$tooltipPa.payload) === null || _activeItem$tooltipPa === void 0 ? void 0 : _activeItem$tooltipPa.payload;
  }
  if (isPie(graphicalItem, activeItem)) {
    var _activeItem$tooltipPa2;
    return (_activeItem$tooltipPa2 = activeItem.tooltipPayload) === null || _activeItem$tooltipPa2 === void 0 || (_activeItem$tooltipPa2 = _activeItem$tooltipPa2[0]) === null || _activeItem$tooltipPa2 === void 0 || (_activeItem$tooltipPa2 = _activeItem$tooltipPa2.payload) === null || _activeItem$tooltipPa2 === void 0 ? void 0 : _activeItem$tooltipPa2.payload;
  }
  if (isScatter(graphicalItem, activeItem)) {
    return activeItem.payload;
  }
  return {};
}
function getActiveShapeIndexForTooltip(_ref32) {
  var activeTooltipItem = _ref32.activeTooltipItem, graphicalItem = _ref32.graphicalItem, itemData = _ref32.itemData;
  var shapeKey = getShapeDataKey(graphicalItem, activeTooltipItem);
  var tooltipPayload = getActiveShapeTooltipPayload(graphicalItem, activeTooltipItem);
  var activeItemMatches = itemData.filter(function(datum, dataIndex) {
    var valuesMatch = (0, import_isEqual2.default)(tooltipPayload, datum);
    var mouseCoordinateMatches = graphicalItem.props[shapeKey].filter(function(shapeData) {
      var comparison = getComparisonFn(graphicalItem, activeTooltipItem);
      return comparison(shapeData, activeTooltipItem);
    });
    var indexOfMouseCoordinates = graphicalItem.props[shapeKey].indexOf(mouseCoordinateMatches[mouseCoordinateMatches.length - 1]);
    var coordinatesMatch = dataIndex === indexOfMouseCoordinates;
    return valuesMatch && coordinatesMatch;
  });
  var activeIndex = itemData.indexOf(activeItemMatches[activeItemMatches.length - 1]);
  return activeIndex;
}

// node_modules/recharts/es6/polar/Pie.js
var _class;
function _typeof30(o) {
  "@babel/helpers - typeof";
  return _typeof30 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
    return typeof o2;
  } : function(o2) {
    return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
  }, _typeof30(o);
}
function _extends27() {
  _extends27 = Object.assign ? Object.assign.bind() : function(target) {
    for (var i2 = 1; i2 < arguments.length; i2++) {
      var source = arguments[i2];
      for (var key in source) {
        if (Object.prototype.hasOwnProperty.call(source, key)) {
          target[key] = source[key];
        }
      }
    }
    return target;
  };
  return _extends27.apply(this, arguments);
}
function ownKeys25(e3, r3) {
  var t3 = Object.keys(e3);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e3);
    r3 && (o = o.filter(function(r4) {
      return Object.getOwnPropertyDescriptor(e3, r4).enumerable;
    })), t3.push.apply(t3, o);
  }
  return t3;
}
function _objectSpread25(e3) {
  for (var r3 = 1; r3 < arguments.length; r3++) {
    var t3 = null != arguments[r3] ? arguments[r3] : {};
    r3 % 2 ? ownKeys25(Object(t3), true).forEach(function(r4) {
      _defineProperty25(e3, r4, t3[r4]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e3, Object.getOwnPropertyDescriptors(t3)) : ownKeys25(Object(t3)).forEach(function(r4) {
      Object.defineProperty(e3, r4, Object.getOwnPropertyDescriptor(t3, r4));
    });
  }
  return e3;
}
function _classCallCheck9(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties9(target, props) {
  for (var i2 = 0; i2 < props.length; i2++) {
    var descriptor = props[i2];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor)
      descriptor.writable = true;
    Object.defineProperty(target, _toPropertyKey26(descriptor.key), descriptor);
  }
}
function _createClass9(Constructor, protoProps, staticProps) {
  if (protoProps)
    _defineProperties9(Constructor.prototype, protoProps);
  if (staticProps)
    _defineProperties9(Constructor, staticProps);
  Object.defineProperty(Constructor, "prototype", { writable: false });
  return Constructor;
}
function _inherits8(subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function");
  }
  subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
  Object.defineProperty(subClass, "prototype", { writable: false });
  if (superClass)
    _setPrototypeOf10(subClass, superClass);
}
function _setPrototypeOf10(o, p) {
  _setPrototypeOf10 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf19(o2, p2) {
    o2.__proto__ = p2;
    return o2;
  };
  return _setPrototypeOf10(o, p);
}
function _createSuper8(Derived) {
  var hasNativeReflectConstruct = _isNativeReflectConstruct9();
  return function _createSuperInternal() {
    var Super = _getPrototypeOf9(Derived), result;
    if (hasNativeReflectConstruct) {
      var NewTarget = _getPrototypeOf9(this).constructor;
      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }
    return _possibleConstructorReturn8(this, result);
  };
}
function _possibleConstructorReturn8(self2, call) {
  if (call && (_typeof30(call) === "object" || typeof call === "function")) {
    return call;
  } else if (call !== void 0) {
    throw new TypeError("Derived constructors may only return object or undefined");
  }
  return _assertThisInitialized10(self2);
}
function _assertThisInitialized10(self2) {
  if (self2 === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }
  return self2;
}
function _isNativeReflectConstruct9() {
  if (typeof Reflect === "undefined" || !Reflect.construct)
    return false;
  if (Reflect.construct.sham)
    return false;
  if (typeof Proxy === "function")
    return true;
  try {
    Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
    return true;
  } catch (e3) {
    return false;
  }
}
function _getPrototypeOf9(o) {
  _getPrototypeOf9 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf18(o2) {
    return o2.__proto__ || Object.getPrototypeOf(o2);
  };
  return _getPrototypeOf9(o);
}
function _defineProperty25(obj, key, value) {
  key = _toPropertyKey26(key);
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
function _toPropertyKey26(arg) {
  var key = _toPrimitive26(arg, "string");
  return _typeof30(key) === "symbol" ? key : String(key);
}
function _toPrimitive26(input, hint) {
  if (_typeof30(input) !== "object" || input === null)
    return input;
  var prim = input[Symbol.toPrimitive];
  if (prim !== void 0) {
    var res = prim.call(input, hint || "default");
    if (_typeof30(res) !== "object")
      return res;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (hint === "string" ? String : Number)(input);
}
var Pie = /* @__PURE__ */ function(_PureComponent) {
  _inherits8(Pie2, _PureComponent);
  var _super = _createSuper8(Pie2);
  function Pie2(props) {
    var _this;
    _classCallCheck9(this, Pie2);
    _this = _super.call(this, props);
    _defineProperty25(_assertThisInitialized10(_this), "pieRef", null);
    _defineProperty25(_assertThisInitialized10(_this), "sectorRefs", []);
    _defineProperty25(_assertThisInitialized10(_this), "id", uniqueId("recharts-pie-"));
    _defineProperty25(_assertThisInitialized10(_this), "handleAnimationEnd", function() {
      var onAnimationEnd2 = _this.props.onAnimationEnd;
      _this.setState({
        isAnimationFinished: true
      });
      if ((0, import_isFunction12.default)(onAnimationEnd2)) {
        onAnimationEnd2();
      }
    });
    _defineProperty25(_assertThisInitialized10(_this), "handleAnimationStart", function() {
      var onAnimationStart2 = _this.props.onAnimationStart;
      _this.setState({
        isAnimationFinished: false
      });
      if ((0, import_isFunction12.default)(onAnimationStart2)) {
        onAnimationStart2();
      }
    });
    _this.state = {
      isAnimationFinished: !props.isAnimationActive,
      prevIsAnimationActive: props.isAnimationActive,
      prevAnimationId: props.animationId,
      sectorToFocus: 0
    };
    return _this;
  }
  _createClass9(Pie2, [{
    key: "isActiveIndex",
    value: function isActiveIndex(i2) {
      var activeIndex = this.props.activeIndex;
      if (Array.isArray(activeIndex)) {
        return activeIndex.indexOf(i2) !== -1;
      }
      return i2 === activeIndex;
    }
  }, {
    key: "hasActiveIndex",
    value: function hasActiveIndex() {
      var activeIndex = this.props.activeIndex;
      return Array.isArray(activeIndex) ? activeIndex.length !== 0 : activeIndex || activeIndex === 0;
    }
  }, {
    key: "renderLabels",
    value: function renderLabels(sectors) {
      var isAnimationActive = this.props.isAnimationActive;
      if (isAnimationActive && !this.state.isAnimationFinished) {
        return null;
      }
      var _this$props = this.props, label = _this$props.label, labelLine = _this$props.labelLine, dataKey = _this$props.dataKey, valueKey = _this$props.valueKey;
      var pieProps = filterProps(this.props);
      var customLabelProps = filterProps(label);
      var customLabelLineProps = filterProps(labelLine);
      var offsetRadius = label && label.offsetRadius || 20;
      var labels = sectors.map(function(entry, i2) {
        var midAngle = (entry.startAngle + entry.endAngle) / 2;
        var endPoint = polarToCartesian(entry.cx, entry.cy, entry.outerRadius + offsetRadius, midAngle);
        var labelProps = _objectSpread25(_objectSpread25(_objectSpread25(_objectSpread25({}, pieProps), entry), {}, {
          stroke: "none"
        }, customLabelProps), {}, {
          index: i2,
          textAnchor: Pie2.getTextAnchor(endPoint.x, entry.cx)
        }, endPoint);
        var lineProps = _objectSpread25(_objectSpread25(_objectSpread25(_objectSpread25({}, pieProps), entry), {}, {
          fill: "none",
          stroke: entry.fill
        }, customLabelLineProps), {}, {
          index: i2,
          points: [polarToCartesian(entry.cx, entry.cy, entry.outerRadius, midAngle), endPoint],
          key: "line"
        });
        var realDataKey = dataKey;
        if ((0, import_isNil9.default)(dataKey) && (0, import_isNil9.default)(valueKey)) {
          realDataKey = "value";
        } else if ((0, import_isNil9.default)(dataKey)) {
          realDataKey = valueKey;
        }
        return (
          // eslint-disable-next-line react/no-array-index-key
          /* @__PURE__ */ import_react104.default.createElement(Layer, {
            key: "label-".concat(i2)
          }, labelLine && Pie2.renderLabelLineItem(labelLine, lineProps), Pie2.renderLabelItem(label, labelProps, getValueByDataKey(entry, realDataKey)))
        );
      });
      return /* @__PURE__ */ import_react104.default.createElement(Layer, {
        className: "recharts-pie-labels"
      }, labels);
    }
  }, {
    key: "renderSectorsStatically",
    value: function renderSectorsStatically(sectors) {
      var _this2 = this;
      var _this$props2 = this.props, activeShape = _this$props2.activeShape, blendStroke = _this$props2.blendStroke, inactiveShapeProp = _this$props2.inactiveShape;
      return sectors.map(function(entry, i2) {
        var isActive = _this2.isActiveIndex(i2);
        var inactiveShape = inactiveShapeProp && _this2.hasActiveIndex() ? inactiveShapeProp : null;
        var sectorOptions = isActive ? activeShape : inactiveShape;
        var sectorProps = _objectSpread25(_objectSpread25({}, entry), {}, {
          stroke: blendStroke ? entry.fill : entry.stroke,
          tabIndex: -1
        });
        return /* @__PURE__ */ import_react104.default.createElement(Layer, _extends27({
          ref: function ref(_ref18) {
            if (_ref18 && !_this2.sectorRefs.includes(_ref18)) {
              _this2.sectorRefs.push(_ref18);
            }
          },
          tabIndex: -1,
          className: "recharts-pie-sector"
        }, adaptEventsOfChild(_this2.props, entry, i2), {
          key: "sector-".concat(i2)
          // eslint-disable-line react/no-array-index-key
        }), /* @__PURE__ */ import_react104.default.createElement(Shape2, _extends27({
          option: sectorOptions,
          isActive,
          shapeType: "sector"
        }, sectorProps)));
      });
    }
  }, {
    key: "renderSectorsWithAnimation",
    value: function renderSectorsWithAnimation() {
      var _this3 = this;
      var _this$props3 = this.props, sectors = _this$props3.sectors, isAnimationActive = _this$props3.isAnimationActive, animationBegin = _this$props3.animationBegin, animationDuration = _this$props3.animationDuration, animationEasing = _this$props3.animationEasing, animationId = _this$props3.animationId;
      var _this$state = this.state, prevSectors = _this$state.prevSectors, prevIsAnimationActive = _this$state.prevIsAnimationActive;
      return /* @__PURE__ */ import_react104.default.createElement(es6_default, {
        begin: animationBegin,
        duration: animationDuration,
        isActive: isAnimationActive,
        easing: animationEasing,
        from: {
          t: 0
        },
        to: {
          t: 1
        },
        key: "pie-".concat(animationId, "-").concat(prevIsAnimationActive),
        onAnimationStart: this.handleAnimationStart,
        onAnimationEnd: this.handleAnimationEnd
      }, function(_ref22) {
        var t3 = _ref22.t;
        var stepData = [];
        var first = sectors && sectors[0];
        var curAngle = first.startAngle;
        sectors.forEach(function(entry, index) {
          var prev2 = prevSectors && prevSectors[index];
          var paddingAngle = index > 0 ? (0, import_get4.default)(entry, "paddingAngle", 0) : 0;
          if (prev2) {
            var angleIp = interpolateNumber(prev2.endAngle - prev2.startAngle, entry.endAngle - entry.startAngle);
            var latest = _objectSpread25(_objectSpread25({}, entry), {}, {
              startAngle: curAngle + paddingAngle,
              endAngle: curAngle + angleIp(t3) + paddingAngle
            });
            stepData.push(latest);
            curAngle = latest.endAngle;
          } else {
            var endAngle = entry.endAngle, startAngle = entry.startAngle;
            var interpolatorAngle = interpolateNumber(0, endAngle - startAngle);
            var deltaAngle = interpolatorAngle(t3);
            var _latest = _objectSpread25(_objectSpread25({}, entry), {}, {
              startAngle: curAngle + paddingAngle,
              endAngle: curAngle + deltaAngle + paddingAngle
            });
            stepData.push(_latest);
            curAngle = _latest.endAngle;
          }
        });
        return /* @__PURE__ */ import_react104.default.createElement(Layer, null, _this3.renderSectorsStatically(stepData));
      });
    }
  }, {
    key: "attachKeyboardHandlers",
    value: function attachKeyboardHandlers(pieRef) {
      var _this4 = this;
      pieRef.onkeydown = function(e3) {
        if (!e3.altKey) {
          switch (e3.key) {
            case "ArrowLeft": {
              var next2 = ++_this4.state.sectorToFocus % _this4.sectorRefs.length;
              _this4.sectorRefs[next2].focus();
              _this4.setState({
                sectorToFocus: next2
              });
              break;
            }
            case "ArrowRight": {
              var _next = --_this4.state.sectorToFocus < 0 ? _this4.sectorRefs.length - 1 : _this4.state.sectorToFocus % _this4.sectorRefs.length;
              _this4.sectorRefs[_next].focus();
              _this4.setState({
                sectorToFocus: _next
              });
              break;
            }
            case "Escape": {
              _this4.sectorRefs[_this4.state.sectorToFocus].blur();
              _this4.setState({
                sectorToFocus: 0
              });
              break;
            }
            default: {
            }
          }
        }
      };
    }
  }, {
    key: "renderSectors",
    value: function renderSectors() {
      var _this$props4 = this.props, sectors = _this$props4.sectors, isAnimationActive = _this$props4.isAnimationActive;
      var prevSectors = this.state.prevSectors;
      if (isAnimationActive && sectors && sectors.length && (!prevSectors || !(0, import_isEqual3.default)(prevSectors, sectors))) {
        return this.renderSectorsWithAnimation();
      }
      return this.renderSectorsStatically(sectors);
    }
  }, {
    key: "componentDidMount",
    value: function componentDidMount() {
      if (this.pieRef) {
        this.attachKeyboardHandlers(this.pieRef);
      }
    }
  }, {
    key: "render",
    value: function render2() {
      var _this5 = this;
      var _this$props5 = this.props, hide = _this$props5.hide, sectors = _this$props5.sectors, className = _this$props5.className, label = _this$props5.label, cx = _this$props5.cx, cy = _this$props5.cy, innerRadius = _this$props5.innerRadius, outerRadius = _this$props5.outerRadius, isAnimationActive = _this$props5.isAnimationActive;
      var isAnimationFinished = this.state.isAnimationFinished;
      if (hide || !sectors || !sectors.length || !isNumber(cx) || !isNumber(cy) || !isNumber(innerRadius) || !isNumber(outerRadius)) {
        return null;
      }
      var layerClass = (0, import_classnames17.default)("recharts-pie", className);
      return /* @__PURE__ */ import_react104.default.createElement(Layer, {
        tabIndex: this.props.rootTabIndex,
        className: layerClass,
        ref: function ref(_ref32) {
          _this5.pieRef = _ref32;
        }
      }, this.renderSectors(), label && this.renderLabels(sectors), Label3.renderCallByParent(this.props, null, false), (!isAnimationActive || isAnimationFinished) && LabelList.renderCallByParent(this.props, sectors, false));
    }
  }], [{
    key: "getDerivedStateFromProps",
    value: function getDerivedStateFromProps(nextProps, prevState) {
      if (prevState.prevIsAnimationActive !== nextProps.isAnimationActive) {
        return {
          prevIsAnimationActive: nextProps.isAnimationActive,
          prevAnimationId: nextProps.animationId,
          curSectors: nextProps.sectors,
          prevSectors: [],
          isAnimationFinished: true
        };
      }
      if (nextProps.isAnimationActive && nextProps.animationId !== prevState.prevAnimationId) {
        return {
          prevAnimationId: nextProps.animationId,
          curSectors: nextProps.sectors,
          prevSectors: prevState.curSectors,
          isAnimationFinished: true
        };
      }
      if (nextProps.sectors !== prevState.curSectors) {
        return {
          curSectors: nextProps.sectors,
          isAnimationFinished: true
        };
      }
      return null;
    }
  }, {
    key: "getTextAnchor",
    value: function getTextAnchor(x2, cx) {
      if (x2 > cx) {
        return "start";
      }
      if (x2 < cx) {
        return "end";
      }
      return "middle";
    }
  }, {
    key: "renderLabelLineItem",
    value: function renderLabelLineItem(option, props) {
      if (/* @__PURE__ */ import_react104.default.isValidElement(option)) {
        return /* @__PURE__ */ import_react104.default.cloneElement(option, props);
      }
      if ((0, import_isFunction12.default)(option)) {
        return option(props);
      }
      return /* @__PURE__ */ import_react104.default.createElement(Curve2, _extends27({}, props, {
        type: "linear",
        className: "recharts-pie-label-line"
      }));
    }
  }, {
    key: "renderLabelItem",
    value: function renderLabelItem(option, props, value) {
      if (/* @__PURE__ */ import_react104.default.isValidElement(option)) {
        return /* @__PURE__ */ import_react104.default.cloneElement(option, props);
      }
      var label = value;
      if ((0, import_isFunction12.default)(option)) {
        label = option(props);
        if (/* @__PURE__ */ import_react104.default.isValidElement(label)) {
          return label;
        }
      }
      return /* @__PURE__ */ import_react104.default.createElement(Text3, _extends27({}, props, {
        alignmentBaseline: "middle",
        className: "recharts-pie-label-text"
      }), label);
    }
  }]);
  return Pie2;
}(import_react104.PureComponent);
_class = Pie;
_defineProperty25(Pie, "displayName", "Pie");
_defineProperty25(Pie, "defaultProps", {
  stroke: "#fff",
  fill: "#808080",
  legendType: "rect",
  cx: "50%",
  cy: "50%",
  startAngle: 0,
  endAngle: 360,
  innerRadius: 0,
  outerRadius: "80%",
  paddingAngle: 0,
  labelLine: true,
  hide: false,
  minAngle: 0,
  isAnimationActive: !Global2.isSsr,
  animationBegin: 400,
  animationDuration: 1500,
  animationEasing: "ease",
  nameKey: "name",
  blendStroke: false,
  rootTabIndex: 0
});
_defineProperty25(Pie, "parseDeltaAngle", function(startAngle, endAngle) {
  var sign3 = mathSign(endAngle - startAngle);
  var deltaAngle = Math.min(Math.abs(endAngle - startAngle), 360);
  return sign3 * deltaAngle;
});
_defineProperty25(Pie, "getRealPieData", function(item) {
  var _item$props = item.props, data = _item$props.data, children = _item$props.children;
  var presentationProps = filterProps(item.props);
  var cells = findAllByType(children, Cell);
  if (data && data.length) {
    return data.map(function(entry, index) {
      return _objectSpread25(_objectSpread25(_objectSpread25({
        payload: entry
      }, presentationProps), entry), cells && cells[index] && cells[index].props);
    });
  }
  if (cells && cells.length) {
    return cells.map(function(cell) {
      return _objectSpread25(_objectSpread25({}, presentationProps), cell.props);
    });
  }
  return [];
});
_defineProperty25(Pie, "parseCoordinateOfPie", function(item, offset) {
  var top2 = offset.top, left = offset.left, width = offset.width, height = offset.height;
  var maxPieRadius = getMaxRadius(width, height);
  var cx = left + getPercentValue(item.props.cx, width, width / 2);
  var cy = top2 + getPercentValue(item.props.cy, height, height / 2);
  var innerRadius = getPercentValue(item.props.innerRadius, maxPieRadius, 0);
  var outerRadius = getPercentValue(item.props.outerRadius, maxPieRadius, maxPieRadius * 0.8);
  var maxRadius = item.props.maxRadius || Math.sqrt(width * width + height * height) / 2;
  return {
    cx,
    cy,
    innerRadius,
    outerRadius,
    maxRadius
  };
});
_defineProperty25(Pie, "getComposedData", function(_ref42) {
  var item = _ref42.item, offset = _ref42.offset;
  var pieData = _class.getRealPieData(item);
  if (!pieData || !pieData.length) {
    return null;
  }
  var _item$props2 = item.props, cornerRadius = _item$props2.cornerRadius, startAngle = _item$props2.startAngle, endAngle = _item$props2.endAngle, paddingAngle = _item$props2.paddingAngle, dataKey = _item$props2.dataKey, nameKey = _item$props2.nameKey, valueKey = _item$props2.valueKey, tooltipType = _item$props2.tooltipType;
  var minAngle = Math.abs(item.props.minAngle);
  var coordinate = _class.parseCoordinateOfPie(item, offset);
  var deltaAngle = _class.parseDeltaAngle(startAngle, endAngle);
  var absDeltaAngle = Math.abs(deltaAngle);
  var realDataKey = dataKey;
  if ((0, import_isNil9.default)(dataKey) && (0, import_isNil9.default)(valueKey)) {
    warn(false, 'Use "dataKey" to specify the value of pie,\n      the props "valueKey" will be deprecated in 1.1.0');
    realDataKey = "value";
  } else if ((0, import_isNil9.default)(dataKey)) {
    warn(false, 'Use "dataKey" to specify the value of pie,\n      the props "valueKey" will be deprecated in 1.1.0');
    realDataKey = valueKey;
  }
  var notZeroItemCount = pieData.filter(function(entry) {
    return getValueByDataKey(entry, realDataKey, 0) !== 0;
  }).length;
  var totalPadingAngle = (absDeltaAngle >= 360 ? notZeroItemCount : notZeroItemCount - 1) * paddingAngle;
  var realTotalAngle = absDeltaAngle - notZeroItemCount * minAngle - totalPadingAngle;
  var sum2 = pieData.reduce(function(result, entry) {
    var val = getValueByDataKey(entry, realDataKey, 0);
    return result + (isNumber(val) ? val : 0);
  }, 0);
  var sectors;
  if (sum2 > 0) {
    var prev2;
    sectors = pieData.map(function(entry, i2) {
      var val = getValueByDataKey(entry, realDataKey, 0);
      var name2 = getValueByDataKey(entry, nameKey, i2);
      var percent = (isNumber(val) ? val : 0) / sum2;
      var tempStartAngle;
      if (i2) {
        tempStartAngle = prev2.endAngle + mathSign(deltaAngle) * paddingAngle * (val !== 0 ? 1 : 0);
      } else {
        tempStartAngle = startAngle;
      }
      var tempEndAngle = tempStartAngle + mathSign(deltaAngle) * ((val !== 0 ? minAngle : 0) + percent * realTotalAngle);
      var midAngle = (tempStartAngle + tempEndAngle) / 2;
      var middleRadius = (coordinate.innerRadius + coordinate.outerRadius) / 2;
      var tooltipPayload = [{
        name: name2,
        value: val,
        payload: entry,
        dataKey: realDataKey,
        type: tooltipType
      }];
      var tooltipPosition = polarToCartesian(coordinate.cx, coordinate.cy, middleRadius, midAngle);
      prev2 = _objectSpread25(_objectSpread25(_objectSpread25({
        percent,
        cornerRadius,
        name: name2,
        tooltipPayload,
        midAngle,
        middleRadius,
        tooltipPosition
      }, entry), coordinate), {}, {
        value: getValueByDataKey(entry, realDataKey),
        startAngle: tempStartAngle,
        endAngle: tempEndAngle,
        payload: entry,
        paddingAngle: mathSign(deltaAngle) * paddingAngle
      });
      return prev2;
    });
  }
  return _objectSpread25(_objectSpread25({}, coordinate), {}, {
    sectors,
    data: pieData
  });
});

// node_modules/recharts/es6/cartesian/Brush.js
var import_isFunction13 = __toESM(require_isFunction());
var import_range2 = __toESM(require_range());
var import_react105 = __toESM(require_react());
var import_classnames18 = __toESM(require_classnames());

// node_modules/recharts/es6/util/CssPrefixUtils.js
function _typeof31(o) {
  "@babel/helpers - typeof";
  return _typeof31 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
    return typeof o2;
  } : function(o2) {
    return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
  }, _typeof31(o);
}
function ownKeys26(e3, r3) {
  var t3 = Object.keys(e3);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e3);
    r3 && (o = o.filter(function(r4) {
      return Object.getOwnPropertyDescriptor(e3, r4).enumerable;
    })), t3.push.apply(t3, o);
  }
  return t3;
}
function _objectSpread26(e3) {
  for (var r3 = 1; r3 < arguments.length; r3++) {
    var t3 = null != arguments[r3] ? arguments[r3] : {};
    r3 % 2 ? ownKeys26(Object(t3), true).forEach(function(r4) {
      _defineProperty26(e3, r4, t3[r4]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e3, Object.getOwnPropertyDescriptors(t3)) : ownKeys26(Object(t3)).forEach(function(r4) {
      Object.defineProperty(e3, r4, Object.getOwnPropertyDescriptor(t3, r4));
    });
  }
  return e3;
}
function _defineProperty26(obj, key, value) {
  key = _toPropertyKey27(key);
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
function _toPropertyKey27(arg) {
  var key = _toPrimitive27(arg, "string");
  return _typeof31(key) === "symbol" ? key : String(key);
}
function _toPrimitive27(input, hint) {
  if (_typeof31(input) !== "object" || input === null)
    return input;
  var prim = input[Symbol.toPrimitive];
  if (prim !== void 0) {
    var res = prim.call(input, hint || "default");
    if (_typeof31(res) !== "object")
      return res;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (hint === "string" ? String : Number)(input);
}
var PREFIX_LIST2 = ["Webkit", "Moz", "O", "ms"];
var generatePrefixStyle3 = function generatePrefixStyle4(name2, value) {
  if (!name2) {
    return null;
  }
  var camelName = name2.replace(/(\w)/, function(v4) {
    return v4.toUpperCase();
  });
  var result = PREFIX_LIST2.reduce(function(res, entry) {
    return _objectSpread26(_objectSpread26({}, res), {}, _defineProperty26({}, entry + camelName, value));
  }, {});
  result[name2] = value;
  return result;
};

// node_modules/recharts/es6/cartesian/Brush.js
function _typeof32(o) {
  "@babel/helpers - typeof";
  return _typeof32 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
    return typeof o2;
  } : function(o2) {
    return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
  }, _typeof32(o);
}
function _extends28() {
  _extends28 = Object.assign ? Object.assign.bind() : function(target) {
    for (var i2 = 1; i2 < arguments.length; i2++) {
      var source = arguments[i2];
      for (var key in source) {
        if (Object.prototype.hasOwnProperty.call(source, key)) {
          target[key] = source[key];
        }
      }
    }
    return target;
  };
  return _extends28.apply(this, arguments);
}
function ownKeys27(e3, r3) {
  var t3 = Object.keys(e3);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e3);
    r3 && (o = o.filter(function(r4) {
      return Object.getOwnPropertyDescriptor(e3, r4).enumerable;
    })), t3.push.apply(t3, o);
  }
  return t3;
}
function _objectSpread27(e3) {
  for (var r3 = 1; r3 < arguments.length; r3++) {
    var t3 = null != arguments[r3] ? arguments[r3] : {};
    r3 % 2 ? ownKeys27(Object(t3), true).forEach(function(r4) {
      _defineProperty27(e3, r4, t3[r4]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e3, Object.getOwnPropertyDescriptors(t3)) : ownKeys27(Object(t3)).forEach(function(r4) {
      Object.defineProperty(e3, r4, Object.getOwnPropertyDescriptor(t3, r4));
    });
  }
  return e3;
}
function _classCallCheck10(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties10(target, props) {
  for (var i2 = 0; i2 < props.length; i2++) {
    var descriptor = props[i2];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor)
      descriptor.writable = true;
    Object.defineProperty(target, _toPropertyKey28(descriptor.key), descriptor);
  }
}
function _createClass10(Constructor, protoProps, staticProps) {
  if (protoProps)
    _defineProperties10(Constructor.prototype, protoProps);
  if (staticProps)
    _defineProperties10(Constructor, staticProps);
  Object.defineProperty(Constructor, "prototype", { writable: false });
  return Constructor;
}
function _inherits9(subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function");
  }
  subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
  Object.defineProperty(subClass, "prototype", { writable: false });
  if (superClass)
    _setPrototypeOf11(subClass, superClass);
}
function _setPrototypeOf11(o, p) {
  _setPrototypeOf11 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf19(o2, p2) {
    o2.__proto__ = p2;
    return o2;
  };
  return _setPrototypeOf11(o, p);
}
function _createSuper9(Derived) {
  var hasNativeReflectConstruct = _isNativeReflectConstruct10();
  return function _createSuperInternal() {
    var Super = _getPrototypeOf10(Derived), result;
    if (hasNativeReflectConstruct) {
      var NewTarget = _getPrototypeOf10(this).constructor;
      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }
    return _possibleConstructorReturn9(this, result);
  };
}
function _possibleConstructorReturn9(self2, call) {
  if (call && (_typeof32(call) === "object" || typeof call === "function")) {
    return call;
  } else if (call !== void 0) {
    throw new TypeError("Derived constructors may only return object or undefined");
  }
  return _assertThisInitialized11(self2);
}
function _assertThisInitialized11(self2) {
  if (self2 === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }
  return self2;
}
function _isNativeReflectConstruct10() {
  if (typeof Reflect === "undefined" || !Reflect.construct)
    return false;
  if (Reflect.construct.sham)
    return false;
  if (typeof Proxy === "function")
    return true;
  try {
    Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
    return true;
  } catch (e3) {
    return false;
  }
}
function _getPrototypeOf10(o) {
  _getPrototypeOf10 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf18(o2) {
    return o2.__proto__ || Object.getPrototypeOf(o2);
  };
  return _getPrototypeOf10(o);
}
function _defineProperty27(obj, key, value) {
  key = _toPropertyKey28(key);
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
function _toPropertyKey28(arg) {
  var key = _toPrimitive28(arg, "string");
  return _typeof32(key) === "symbol" ? key : String(key);
}
function _toPrimitive28(input, hint) {
  if (_typeof32(input) !== "object" || input === null)
    return input;
  var prim = input[Symbol.toPrimitive];
  if (prim !== void 0) {
    var res = prim.call(input, hint || "default");
    if (_typeof32(res) !== "object")
      return res;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (hint === "string" ? String : Number)(input);
}
var createScale = function createScale2(_ref18) {
  var data = _ref18.data, startIndex = _ref18.startIndex, endIndex = _ref18.endIndex, x2 = _ref18.x, width = _ref18.width, travellerWidth = _ref18.travellerWidth;
  if (!data || !data.length) {
    return {};
  }
  var len = data.length;
  var scale = point3().domain((0, import_range2.default)(0, len)).range([x2, x2 + width - travellerWidth]);
  var scaleValues = scale.domain().map(function(entry) {
    return scale(entry);
  });
  return {
    isTextActive: false,
    isSlideMoving: false,
    isTravellerMoving: false,
    isTravellerFocused: false,
    startX: scale(startIndex),
    endX: scale(endIndex),
    scale,
    scaleValues
  };
};
var isTouch = function isTouch2(e3) {
  return e3.changedTouches && !!e3.changedTouches.length;
};
var Brush = /* @__PURE__ */ function(_PureComponent) {
  _inherits9(Brush2, _PureComponent);
  var _super = _createSuper9(Brush2);
  function Brush2(props) {
    var _this;
    _classCallCheck10(this, Brush2);
    _this = _super.call(this, props);
    _defineProperty27(_assertThisInitialized11(_this), "handleDrag", function(e3) {
      if (_this.leaveTimer) {
        clearTimeout(_this.leaveTimer);
        _this.leaveTimer = null;
      }
      if (_this.state.isTravellerMoving) {
        _this.handleTravellerMove(e3);
      } else if (_this.state.isSlideMoving) {
        _this.handleSlideDrag(e3);
      }
    });
    _defineProperty27(_assertThisInitialized11(_this), "handleTouchMove", function(e3) {
      if (e3.changedTouches != null && e3.changedTouches.length > 0) {
        _this.handleDrag(e3.changedTouches[0]);
      }
    });
    _defineProperty27(_assertThisInitialized11(_this), "handleDragEnd", function() {
      _this.setState({
        isTravellerMoving: false,
        isSlideMoving: false
      }, function() {
        var _this$props = _this.props, endIndex = _this$props.endIndex, onDragEnd = _this$props.onDragEnd, startIndex = _this$props.startIndex;
        onDragEnd === null || onDragEnd === void 0 || onDragEnd({
          endIndex,
          startIndex
        });
      });
      _this.detachDragEndListener();
    });
    _defineProperty27(_assertThisInitialized11(_this), "handleLeaveWrapper", function() {
      if (_this.state.isTravellerMoving || _this.state.isSlideMoving) {
        _this.leaveTimer = window.setTimeout(_this.handleDragEnd, _this.props.leaveTimeOut);
      }
    });
    _defineProperty27(_assertThisInitialized11(_this), "handleEnterSlideOrTraveller", function() {
      _this.setState({
        isTextActive: true
      });
    });
    _defineProperty27(_assertThisInitialized11(_this), "handleLeaveSlideOrTraveller", function() {
      _this.setState({
        isTextActive: false
      });
    });
    _defineProperty27(_assertThisInitialized11(_this), "handleSlideDragStart", function(e3) {
      var event = isTouch(e3) ? e3.changedTouches[0] : e3;
      _this.setState({
        isTravellerMoving: false,
        isSlideMoving: true,
        slideMoveStartX: event.pageX
      });
      _this.attachDragEndListener();
    });
    _this.travellerDragStartHandlers = {
      startX: _this.handleTravellerDragStart.bind(_assertThisInitialized11(_this), "startX"),
      endX: _this.handleTravellerDragStart.bind(_assertThisInitialized11(_this), "endX")
    };
    _this.state = {};
    return _this;
  }
  _createClass10(Brush2, [{
    key: "componentWillUnmount",
    value: function componentWillUnmount() {
      if (this.leaveTimer) {
        clearTimeout(this.leaveTimer);
        this.leaveTimer = null;
      }
      this.detachDragEndListener();
    }
  }, {
    key: "getIndex",
    value: function getIndex(_ref22) {
      var startX = _ref22.startX, endX = _ref22.endX;
      var scaleValues = this.state.scaleValues;
      var _this$props2 = this.props, gap = _this$props2.gap, data = _this$props2.data;
      var lastIndex = data.length - 1;
      var min3 = Math.min(startX, endX);
      var max3 = Math.max(startX, endX);
      var minIndex = Brush2.getIndexInRange(scaleValues, min3);
      var maxIndex = Brush2.getIndexInRange(scaleValues, max3);
      return {
        startIndex: minIndex - minIndex % gap,
        endIndex: maxIndex === lastIndex ? lastIndex : maxIndex - maxIndex % gap
      };
    }
  }, {
    key: "getTextOfTick",
    value: function getTextOfTick(index) {
      var _this$props3 = this.props, data = _this$props3.data, tickFormatter = _this$props3.tickFormatter, dataKey = _this$props3.dataKey;
      var text2 = getValueByDataKey(data[index], dataKey, index);
      return (0, import_isFunction13.default)(tickFormatter) ? tickFormatter(text2, index) : text2;
    }
  }, {
    key: "attachDragEndListener",
    value: function attachDragEndListener() {
      window.addEventListener("mouseup", this.handleDragEnd, true);
      window.addEventListener("touchend", this.handleDragEnd, true);
      window.addEventListener("mousemove", this.handleDrag, true);
    }
  }, {
    key: "detachDragEndListener",
    value: function detachDragEndListener() {
      window.removeEventListener("mouseup", this.handleDragEnd, true);
      window.removeEventListener("touchend", this.handleDragEnd, true);
      window.removeEventListener("mousemove", this.handleDrag, true);
    }
  }, {
    key: "handleSlideDrag",
    value: function handleSlideDrag(e3) {
      var _this$state = this.state, slideMoveStartX = _this$state.slideMoveStartX, startX = _this$state.startX, endX = _this$state.endX;
      var _this$props4 = this.props, x2 = _this$props4.x, width = _this$props4.width, travellerWidth = _this$props4.travellerWidth, startIndex = _this$props4.startIndex, endIndex = _this$props4.endIndex, onChange = _this$props4.onChange;
      var delta = e3.pageX - slideMoveStartX;
      if (delta > 0) {
        delta = Math.min(delta, x2 + width - travellerWidth - endX, x2 + width - travellerWidth - startX);
      } else if (delta < 0) {
        delta = Math.max(delta, x2 - startX, x2 - endX);
      }
      var newIndex = this.getIndex({
        startX: startX + delta,
        endX: endX + delta
      });
      if ((newIndex.startIndex !== startIndex || newIndex.endIndex !== endIndex) && onChange) {
        onChange(newIndex);
      }
      this.setState({
        startX: startX + delta,
        endX: endX + delta,
        slideMoveStartX: e3.pageX
      });
    }
  }, {
    key: "handleTravellerDragStart",
    value: function handleTravellerDragStart(id2, e3) {
      var event = isTouch(e3) ? e3.changedTouches[0] : e3;
      this.setState({
        isSlideMoving: false,
        isTravellerMoving: true,
        movingTravellerId: id2,
        brushMoveStartX: event.pageX
      });
      this.attachDragEndListener();
    }
  }, {
    key: "handleTravellerMove",
    value: function handleTravellerMove(e3) {
      var _this$setState;
      var _this$state2 = this.state, brushMoveStartX = _this$state2.brushMoveStartX, movingTravellerId = _this$state2.movingTravellerId, endX = _this$state2.endX, startX = _this$state2.startX;
      var prevValue = this.state[movingTravellerId];
      var _this$props5 = this.props, x2 = _this$props5.x, width = _this$props5.width, travellerWidth = _this$props5.travellerWidth, onChange = _this$props5.onChange, gap = _this$props5.gap, data = _this$props5.data;
      var params = {
        startX: this.state.startX,
        endX: this.state.endX
      };
      var delta = e3.pageX - brushMoveStartX;
      if (delta > 0) {
        delta = Math.min(delta, x2 + width - travellerWidth - prevValue);
      } else if (delta < 0) {
        delta = Math.max(delta, x2 - prevValue);
      }
      params[movingTravellerId] = prevValue + delta;
      var newIndex = this.getIndex(params);
      var startIndex = newIndex.startIndex, endIndex = newIndex.endIndex;
      var isFullGap = function isFullGap2() {
        var lastIndex = data.length - 1;
        if (movingTravellerId === "startX" && (endX > startX ? startIndex % gap === 0 : endIndex % gap === 0) || endX < startX && endIndex === lastIndex || movingTravellerId === "endX" && (endX > startX ? endIndex % gap === 0 : startIndex % gap === 0) || endX > startX && endIndex === lastIndex) {
          return true;
        }
        return false;
      };
      this.setState((_this$setState = {}, _defineProperty27(_this$setState, movingTravellerId, prevValue + delta), _defineProperty27(_this$setState, "brushMoveStartX", e3.pageX), _this$setState), function() {
        if (onChange) {
          if (isFullGap()) {
            onChange(newIndex);
          }
        }
      });
    }
  }, {
    key: "handleTravellerMoveKeyboard",
    value: function handleTravellerMoveKeyboard(direction, id2) {
      var _this2 = this;
      var _this$state3 = this.state, scaleValues = _this$state3.scaleValues, startX = _this$state3.startX, endX = _this$state3.endX;
      var currentScaleValue = this.state[id2];
      var currentIndex = scaleValues.indexOf(currentScaleValue);
      if (currentIndex === -1) {
        return;
      }
      var newIndex = currentIndex + direction;
      if (newIndex === -1 || newIndex >= scaleValues.length) {
        return;
      }
      var newScaleValue = scaleValues[newIndex];
      if (id2 === "startX" && newScaleValue >= endX || id2 === "endX" && newScaleValue <= startX) {
        return;
      }
      this.setState(_defineProperty27({}, id2, newScaleValue), function() {
        _this2.props.onChange(_this2.getIndex({
          startX: _this2.state.startX,
          endX: _this2.state.endX
        }));
      });
    }
  }, {
    key: "renderBackground",
    value: function renderBackground() {
      var _this$props6 = this.props, x2 = _this$props6.x, y2 = _this$props6.y, width = _this$props6.width, height = _this$props6.height, fill = _this$props6.fill, stroke = _this$props6.stroke;
      return /* @__PURE__ */ import_react105.default.createElement("rect", {
        stroke,
        fill,
        x: x2,
        y: y2,
        width,
        height
      });
    }
  }, {
    key: "renderPanorama",
    value: function renderPanorama() {
      var _this$props7 = this.props, x2 = _this$props7.x, y2 = _this$props7.y, width = _this$props7.width, height = _this$props7.height, data = _this$props7.data, children = _this$props7.children, padding = _this$props7.padding;
      var chartElement = import_react105.Children.only(children);
      if (!chartElement) {
        return null;
      }
      return /* @__PURE__ */ import_react105.default.cloneElement(chartElement, {
        x: x2,
        y: y2,
        width,
        height,
        margin: padding,
        compact: true,
        data
      });
    }
  }, {
    key: "renderTravellerLayer",
    value: function renderTravellerLayer(travellerX, id2) {
      var _this3 = this;
      var _this$props8 = this.props, y2 = _this$props8.y, travellerWidth = _this$props8.travellerWidth, height = _this$props8.height, traveller = _this$props8.traveller;
      var x2 = Math.max(travellerX, this.props.x);
      var travellerProps = _objectSpread27(_objectSpread27({}, filterProps(this.props)), {}, {
        x: x2,
        y: y2,
        width: travellerWidth,
        height
      });
      return /* @__PURE__ */ import_react105.default.createElement(Layer, {
        tabIndex: 0,
        role: "slider",
        className: "recharts-brush-traveller",
        onMouseEnter: this.handleEnterSlideOrTraveller,
        onMouseLeave: this.handleLeaveSlideOrTraveller,
        onMouseDown: this.travellerDragStartHandlers[id2],
        onTouchStart: this.travellerDragStartHandlers[id2],
        onKeyDown: function onKeyDown(e3) {
          if (!["ArrowLeft", "ArrowRight"].includes(e3.key)) {
            return;
          }
          e3.preventDefault();
          e3.stopPropagation();
          _this3.handleTravellerMoveKeyboard(e3.key === "ArrowRight" ? 1 : -1, id2);
        },
        onFocus: function onFocus() {
          _this3.setState({
            isTravellerFocused: true
          });
        },
        onBlur: function onBlur() {
          _this3.setState({
            isTravellerFocused: false
          });
        },
        style: {
          cursor: "col-resize"
        }
      }, Brush2.renderTraveller(traveller, travellerProps));
    }
  }, {
    key: "renderSlide",
    value: function renderSlide(startX, endX) {
      var _this$props9 = this.props, y2 = _this$props9.y, height = _this$props9.height, stroke = _this$props9.stroke, travellerWidth = _this$props9.travellerWidth;
      var x2 = Math.min(startX, endX) + travellerWidth;
      var width = Math.max(Math.abs(endX - startX) - travellerWidth, 0);
      return /* @__PURE__ */ import_react105.default.createElement("rect", {
        className: "recharts-brush-slide",
        onMouseEnter: this.handleEnterSlideOrTraveller,
        onMouseLeave: this.handleLeaveSlideOrTraveller,
        onMouseDown: this.handleSlideDragStart,
        onTouchStart: this.handleSlideDragStart,
        style: {
          cursor: "move"
        },
        stroke: "none",
        fill: stroke,
        fillOpacity: 0.2,
        x: x2,
        y: y2,
        width,
        height
      });
    }
  }, {
    key: "renderText",
    value: function renderText() {
      var _this$props10 = this.props, startIndex = _this$props10.startIndex, endIndex = _this$props10.endIndex, y2 = _this$props10.y, height = _this$props10.height, travellerWidth = _this$props10.travellerWidth, stroke = _this$props10.stroke;
      var _this$state4 = this.state, startX = _this$state4.startX, endX = _this$state4.endX;
      var offset = 5;
      var attrs = {
        pointerEvents: "none",
        fill: stroke
      };
      return /* @__PURE__ */ import_react105.default.createElement(Layer, {
        className: "recharts-brush-texts"
      }, /* @__PURE__ */ import_react105.default.createElement(Text3, _extends28({
        textAnchor: "end",
        verticalAnchor: "middle",
        x: Math.min(startX, endX) - offset,
        y: y2 + height / 2
      }, attrs), this.getTextOfTick(startIndex)), /* @__PURE__ */ import_react105.default.createElement(Text3, _extends28({
        textAnchor: "start",
        verticalAnchor: "middle",
        x: Math.max(startX, endX) + travellerWidth + offset,
        y: y2 + height / 2
      }, attrs), this.getTextOfTick(endIndex)));
    }
  }, {
    key: "render",
    value: function render2() {
      var _this$props11 = this.props, data = _this$props11.data, className = _this$props11.className, children = _this$props11.children, x2 = _this$props11.x, y2 = _this$props11.y, width = _this$props11.width, height = _this$props11.height, alwaysShowText = _this$props11.alwaysShowText;
      var _this$state5 = this.state, startX = _this$state5.startX, endX = _this$state5.endX, isTextActive = _this$state5.isTextActive, isSlideMoving = _this$state5.isSlideMoving, isTravellerMoving = _this$state5.isTravellerMoving, isTravellerFocused = _this$state5.isTravellerFocused;
      if (!data || !data.length || !isNumber(x2) || !isNumber(y2) || !isNumber(width) || !isNumber(height) || width <= 0 || height <= 0) {
        return null;
      }
      var layerClass = (0, import_classnames18.default)("recharts-brush", className);
      var isPanoramic = import_react105.default.Children.count(children) === 1;
      var style = generatePrefixStyle3("userSelect", "none");
      return /* @__PURE__ */ import_react105.default.createElement(Layer, {
        className: layerClass,
        onMouseLeave: this.handleLeaveWrapper,
        onTouchMove: this.handleTouchMove,
        style
      }, this.renderBackground(), isPanoramic && this.renderPanorama(), this.renderSlide(startX, endX), this.renderTravellerLayer(startX, "startX"), this.renderTravellerLayer(endX, "endX"), (isTextActive || isSlideMoving || isTravellerMoving || isTravellerFocused || alwaysShowText) && this.renderText());
    }
  }], [{
    key: "renderDefaultTraveller",
    value: function renderDefaultTraveller(props) {
      var x2 = props.x, y2 = props.y, width = props.width, height = props.height, stroke = props.stroke;
      var lineY = Math.floor(y2 + height / 2) - 1;
      return /* @__PURE__ */ import_react105.default.createElement(import_react105.default.Fragment, null, /* @__PURE__ */ import_react105.default.createElement("rect", {
        x: x2,
        y: y2,
        width,
        height,
        fill: stroke,
        stroke: "none"
      }), /* @__PURE__ */ import_react105.default.createElement("line", {
        x1: x2 + 1,
        y1: lineY,
        x2: x2 + width - 1,
        y2: lineY,
        fill: "none",
        stroke: "#fff"
      }), /* @__PURE__ */ import_react105.default.createElement("line", {
        x1: x2 + 1,
        y1: lineY + 2,
        x2: x2 + width - 1,
        y2: lineY + 2,
        fill: "none",
        stroke: "#fff"
      }));
    }
  }, {
    key: "renderTraveller",
    value: function renderTraveller(option, props) {
      var rectangle;
      if (/* @__PURE__ */ import_react105.default.isValidElement(option)) {
        rectangle = /* @__PURE__ */ import_react105.default.cloneElement(option, props);
      } else if ((0, import_isFunction13.default)(option)) {
        rectangle = option(props);
      } else {
        rectangle = Brush2.renderDefaultTraveller(props);
      }
      return rectangle;
    }
  }, {
    key: "getDerivedStateFromProps",
    value: function getDerivedStateFromProps(nextProps, prevState) {
      var data = nextProps.data, width = nextProps.width, x2 = nextProps.x, travellerWidth = nextProps.travellerWidth, updateId = nextProps.updateId, startIndex = nextProps.startIndex, endIndex = nextProps.endIndex;
      if (data !== prevState.prevData || updateId !== prevState.prevUpdateId) {
        return _objectSpread27({
          prevData: data,
          prevTravellerWidth: travellerWidth,
          prevUpdateId: updateId,
          prevX: x2,
          prevWidth: width
        }, data && data.length ? createScale({
          data,
          width,
          x: x2,
          travellerWidth,
          startIndex,
          endIndex
        }) : {
          scale: null,
          scaleValues: null
        });
      }
      if (prevState.scale && (width !== prevState.prevWidth || x2 !== prevState.prevX || travellerWidth !== prevState.prevTravellerWidth)) {
        prevState.scale.range([x2, x2 + width - travellerWidth]);
        var scaleValues = prevState.scale.domain().map(function(entry) {
          return prevState.scale(entry);
        });
        return {
          prevData: data,
          prevTravellerWidth: travellerWidth,
          prevUpdateId: updateId,
          prevX: x2,
          prevWidth: width,
          startX: prevState.scale(nextProps.startIndex),
          endX: prevState.scale(nextProps.endIndex),
          scaleValues
        };
      }
      return null;
    }
  }, {
    key: "getIndexInRange",
    value: function getIndexInRange(range4, x2) {
      var len = range4.length;
      var start = 0;
      var end = len - 1;
      while (end - start > 1) {
        var middle = Math.floor((start + end) / 2);
        if (range4[middle] > x2) {
          end = middle;
        } else {
          start = middle;
        }
      }
      return x2 >= range4[end] ? end : start;
    }
  }]);
  return Brush2;
}(import_react105.PureComponent);
_defineProperty27(Brush, "displayName", "Brush");
_defineProperty27(Brush, "defaultProps", {
  height: 40,
  travellerWidth: 5,
  gap: 1,
  fill: "#fff",
  stroke: "#666",
  padding: {
    top: 1,
    right: 1,
    bottom: 1,
    left: 1
  },
  leaveTimeOut: 1e3,
  alwaysShowText: false
});

// node_modules/recharts/es6/cartesian/ReferenceLine.js
var import_some = __toESM(require_some());
var import_isFunction14 = __toESM(require_isFunction());
var import_react108 = __toESM(require_react());
var import_classnames20 = __toESM(require_classnames());

// node_modules/recharts/es6/util/IfOverflowMatches.js
var ifOverflowMatches = function ifOverflowMatches2(props, value) {
  var alwaysShow = props.alwaysShow;
  var ifOverflow = props.ifOverflow;
  if (alwaysShow) {
    ifOverflow = "extendDomain";
  }
  return ifOverflow === value;
};

// node_modules/recharts/es6/util/CartesianUtils.js
var import_every = __toESM(require_every());
var import_mapValues = __toESM(require_mapValues());

// node_modules/recharts/es6/cartesian/Bar.js
var import_isNil10 = __toESM(require_isNil());
var import_isEqual4 = __toESM(require_isEqual());
var import_isArray7 = __toESM(require_isArray());
var import_react107 = __toESM(require_react());
var import_classnames19 = __toESM(require_classnames());

// node_modules/recharts/es6/util/BarUtils.js
var import_react106 = __toESM(require_react());
function _typeof33(o) {
  "@babel/helpers - typeof";
  return _typeof33 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
    return typeof o2;
  } : function(o2) {
    return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
  }, _typeof33(o);
}
var _excluded20 = ["x", "y"];
function _extends29() {
  _extends29 = Object.assign ? Object.assign.bind() : function(target) {
    for (var i2 = 1; i2 < arguments.length; i2++) {
      var source = arguments[i2];
      for (var key in source) {
        if (Object.prototype.hasOwnProperty.call(source, key)) {
          target[key] = source[key];
        }
      }
    }
    return target;
  };
  return _extends29.apply(this, arguments);
}
function ownKeys28(e3, r3) {
  var t3 = Object.keys(e3);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e3);
    r3 && (o = o.filter(function(r4) {
      return Object.getOwnPropertyDescriptor(e3, r4).enumerable;
    })), t3.push.apply(t3, o);
  }
  return t3;
}
function _objectSpread28(e3) {
  for (var r3 = 1; r3 < arguments.length; r3++) {
    var t3 = null != arguments[r3] ? arguments[r3] : {};
    r3 % 2 ? ownKeys28(Object(t3), true).forEach(function(r4) {
      _defineProperty28(e3, r4, t3[r4]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e3, Object.getOwnPropertyDescriptors(t3)) : ownKeys28(Object(t3)).forEach(function(r4) {
      Object.defineProperty(e3, r4, Object.getOwnPropertyDescriptor(t3, r4));
    });
  }
  return e3;
}
function _defineProperty28(obj, key, value) {
  key = _toPropertyKey29(key);
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
function _toPropertyKey29(arg) {
  var key = _toPrimitive29(arg, "string");
  return _typeof33(key) === "symbol" ? key : String(key);
}
function _toPrimitive29(input, hint) {
  if (_typeof33(input) !== "object" || input === null)
    return input;
  var prim = input[Symbol.toPrimitive];
  if (prim !== void 0) {
    var res = prim.call(input, hint || "default");
    if (_typeof33(res) !== "object")
      return res;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (hint === "string" ? String : Number)(input);
}
function _objectWithoutProperties16(source, excluded) {
  if (source == null)
    return {};
  var target = _objectWithoutPropertiesLoose20(source, excluded);
  var key, i2;
  if (Object.getOwnPropertySymbols) {
    var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
    for (i2 = 0; i2 < sourceSymbolKeys.length; i2++) {
      key = sourceSymbolKeys[i2];
      if (excluded.indexOf(key) >= 0)
        continue;
      if (!Object.prototype.propertyIsEnumerable.call(source, key))
        continue;
      target[key] = source[key];
    }
  }
  return target;
}
function _objectWithoutPropertiesLoose20(source, excluded) {
  if (source == null)
    return {};
  var target = {};
  var sourceKeys = Object.keys(source);
  var key, i2;
  for (i2 = 0; i2 < sourceKeys.length; i2++) {
    key = sourceKeys[i2];
    if (excluded.indexOf(key) >= 0)
      continue;
    target[key] = source[key];
  }
  return target;
}
function typeguardBarRectangleProps(_ref18, props) {
  var xProp = _ref18.x, yProp = _ref18.y, option = _objectWithoutProperties16(_ref18, _excluded20);
  var xValue = "".concat(xProp);
  var x2 = parseInt(xValue, 10);
  var yValue = "".concat(yProp);
  var y2 = parseInt(yValue, 10);
  var heightValue = "".concat(props.height || option.height);
  var height = parseInt(heightValue, 10);
  var widthValue = "".concat(props.width || option.width);
  var width = parseInt(widthValue, 10);
  return _objectSpread28(_objectSpread28(_objectSpread28(_objectSpread28(_objectSpread28({}, props), option), x2 ? {
    x: x2
  } : {}), y2 ? {
    y: y2
  } : {}), {}, {
    height,
    width,
    name: props.name,
    radius: props.radius
  });
}
function BarRectangle(props) {
  return /* @__PURE__ */ import_react106.default.createElement(Shape2, _extends29({
    shapeType: "rectangle",
    propTransformer: typeguardBarRectangleProps,
    activeClassName: "recharts-active-bar"
  }, props));
}

// node_modules/recharts/es6/cartesian/Bar.js
var _excluded21 = ["value", "background"];
function _typeof34(o) {
  "@babel/helpers - typeof";
  return _typeof34 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
    return typeof o2;
  } : function(o2) {
    return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
  }, _typeof34(o);
}
function _objectWithoutProperties17(source, excluded) {
  if (source == null)
    return {};
  var target = _objectWithoutPropertiesLoose21(source, excluded);
  var key, i2;
  if (Object.getOwnPropertySymbols) {
    var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
    for (i2 = 0; i2 < sourceSymbolKeys.length; i2++) {
      key = sourceSymbolKeys[i2];
      if (excluded.indexOf(key) >= 0)
        continue;
      if (!Object.prototype.propertyIsEnumerable.call(source, key))
        continue;
      target[key] = source[key];
    }
  }
  return target;
}
function _objectWithoutPropertiesLoose21(source, excluded) {
  if (source == null)
    return {};
  var target = {};
  var sourceKeys = Object.keys(source);
  var key, i2;
  for (i2 = 0; i2 < sourceKeys.length; i2++) {
    key = sourceKeys[i2];
    if (excluded.indexOf(key) >= 0)
      continue;
    target[key] = source[key];
  }
  return target;
}
function _extends30() {
  _extends30 = Object.assign ? Object.assign.bind() : function(target) {
    for (var i2 = 1; i2 < arguments.length; i2++) {
      var source = arguments[i2];
      for (var key in source) {
        if (Object.prototype.hasOwnProperty.call(source, key)) {
          target[key] = source[key];
        }
      }
    }
    return target;
  };
  return _extends30.apply(this, arguments);
}
function ownKeys29(e3, r3) {
  var t3 = Object.keys(e3);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e3);
    r3 && (o = o.filter(function(r4) {
      return Object.getOwnPropertyDescriptor(e3, r4).enumerable;
    })), t3.push.apply(t3, o);
  }
  return t3;
}
function _objectSpread29(e3) {
  for (var r3 = 1; r3 < arguments.length; r3++) {
    var t3 = null != arguments[r3] ? arguments[r3] : {};
    r3 % 2 ? ownKeys29(Object(t3), true).forEach(function(r4) {
      _defineProperty29(e3, r4, t3[r4]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e3, Object.getOwnPropertyDescriptors(t3)) : ownKeys29(Object(t3)).forEach(function(r4) {
      Object.defineProperty(e3, r4, Object.getOwnPropertyDescriptor(t3, r4));
    });
  }
  return e3;
}
function _classCallCheck11(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties11(target, props) {
  for (var i2 = 0; i2 < props.length; i2++) {
    var descriptor = props[i2];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor)
      descriptor.writable = true;
    Object.defineProperty(target, _toPropertyKey30(descriptor.key), descriptor);
  }
}
function _createClass11(Constructor, protoProps, staticProps) {
  if (protoProps)
    _defineProperties11(Constructor.prototype, protoProps);
  if (staticProps)
    _defineProperties11(Constructor, staticProps);
  Object.defineProperty(Constructor, "prototype", { writable: false });
  return Constructor;
}
function _inherits10(subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function");
  }
  subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
  Object.defineProperty(subClass, "prototype", { writable: false });
  if (superClass)
    _setPrototypeOf12(subClass, superClass);
}
function _setPrototypeOf12(o, p) {
  _setPrototypeOf12 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf19(o2, p2) {
    o2.__proto__ = p2;
    return o2;
  };
  return _setPrototypeOf12(o, p);
}
function _createSuper10(Derived) {
  var hasNativeReflectConstruct = _isNativeReflectConstruct11();
  return function _createSuperInternal() {
    var Super = _getPrototypeOf11(Derived), result;
    if (hasNativeReflectConstruct) {
      var NewTarget = _getPrototypeOf11(this).constructor;
      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }
    return _possibleConstructorReturn10(this, result);
  };
}
function _possibleConstructorReturn10(self2, call) {
  if (call && (_typeof34(call) === "object" || typeof call === "function")) {
    return call;
  } else if (call !== void 0) {
    throw new TypeError("Derived constructors may only return object or undefined");
  }
  return _assertThisInitialized12(self2);
}
function _assertThisInitialized12(self2) {
  if (self2 === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }
  return self2;
}
function _isNativeReflectConstruct11() {
  if (typeof Reflect === "undefined" || !Reflect.construct)
    return false;
  if (Reflect.construct.sham)
    return false;
  if (typeof Proxy === "function")
    return true;
  try {
    Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
    return true;
  } catch (e3) {
    return false;
  }
}
function _getPrototypeOf11(o) {
  _getPrototypeOf11 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf18(o2) {
    return o2.__proto__ || Object.getPrototypeOf(o2);
  };
  return _getPrototypeOf11(o);
}
function _defineProperty29(obj, key, value) {
  key = _toPropertyKey30(key);
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
function _toPropertyKey30(arg) {
  var key = _toPrimitive30(arg, "string");
  return _typeof34(key) === "symbol" ? key : String(key);
}
function _toPrimitive30(input, hint) {
  if (_typeof34(input) !== "object" || input === null)
    return input;
  var prim = input[Symbol.toPrimitive];
  if (prim !== void 0) {
    var res = prim.call(input, hint || "default");
    if (_typeof34(res) !== "object")
      return res;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (hint === "string" ? String : Number)(input);
}
var Bar = /* @__PURE__ */ function(_PureComponent) {
  _inherits10(Bar2, _PureComponent);
  var _super = _createSuper10(Bar2);
  function Bar2() {
    var _this;
    _classCallCheck11(this, Bar2);
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    _this = _super.call.apply(_super, [this].concat(args));
    _defineProperty29(_assertThisInitialized12(_this), "state", {
      isAnimationFinished: false
    });
    _defineProperty29(_assertThisInitialized12(_this), "id", uniqueId("recharts-bar-"));
    _defineProperty29(_assertThisInitialized12(_this), "handleAnimationEnd", function() {
      var onAnimationEnd2 = _this.props.onAnimationEnd;
      _this.setState({
        isAnimationFinished: true
      });
      if (onAnimationEnd2) {
        onAnimationEnd2();
      }
    });
    _defineProperty29(_assertThisInitialized12(_this), "handleAnimationStart", function() {
      var onAnimationStart2 = _this.props.onAnimationStart;
      _this.setState({
        isAnimationFinished: false
      });
      if (onAnimationStart2) {
        onAnimationStart2();
      }
    });
    return _this;
  }
  _createClass11(Bar2, [{
    key: "renderRectanglesStatically",
    value: function renderRectanglesStatically(data) {
      var _this2 = this;
      var _this$props = this.props, shape = _this$props.shape, dataKey = _this$props.dataKey, activeIndex = _this$props.activeIndex, activeBar = _this$props.activeBar;
      var baseProps = filterProps(this.props);
      return data && data.map(function(entry, i2) {
        var isActive = i2 === activeIndex;
        var option = isActive ? activeBar : shape;
        var props = _objectSpread29(_objectSpread29(_objectSpread29({}, baseProps), entry), {}, {
          isActive,
          option,
          index: i2,
          dataKey,
          onAnimationStart: _this2.handleAnimationStart,
          onAnimationEnd: _this2.handleAnimationEnd
        });
        return /* @__PURE__ */ import_react107.default.createElement(Layer, _extends30({
          className: "recharts-bar-rectangle"
        }, adaptEventsOfChild(_this2.props, entry, i2), {
          key: "rectangle-".concat(i2)
          // eslint-disable-line react/no-array-index-key
        }), /* @__PURE__ */ import_react107.default.createElement(BarRectangle, props));
      });
    }
  }, {
    key: "renderRectanglesWithAnimation",
    value: function renderRectanglesWithAnimation() {
      var _this3 = this;
      var _this$props2 = this.props, data = _this$props2.data, layout = _this$props2.layout, isAnimationActive = _this$props2.isAnimationActive, animationBegin = _this$props2.animationBegin, animationDuration = _this$props2.animationDuration, animationEasing = _this$props2.animationEasing, animationId = _this$props2.animationId;
      var prevData = this.state.prevData;
      return /* @__PURE__ */ import_react107.default.createElement(es6_default, {
        begin: animationBegin,
        duration: animationDuration,
        isActive: isAnimationActive,
        easing: animationEasing,
        from: {
          t: 0
        },
        to: {
          t: 1
        },
        key: "bar-".concat(animationId),
        onAnimationEnd: this.handleAnimationEnd,
        onAnimationStart: this.handleAnimationStart
      }, function(_ref18) {
        var t3 = _ref18.t;
        var stepData = data.map(function(entry, index) {
          var prev2 = prevData && prevData[index];
          if (prev2) {
            var interpolatorX = interpolateNumber(prev2.x, entry.x);
            var interpolatorY = interpolateNumber(prev2.y, entry.y);
            var interpolatorWidth = interpolateNumber(prev2.width, entry.width);
            var interpolatorHeight = interpolateNumber(prev2.height, entry.height);
            return _objectSpread29(_objectSpread29({}, entry), {}, {
              x: interpolatorX(t3),
              y: interpolatorY(t3),
              width: interpolatorWidth(t3),
              height: interpolatorHeight(t3)
            });
          }
          if (layout === "horizontal") {
            var _interpolatorHeight = interpolateNumber(0, entry.height);
            var h = _interpolatorHeight(t3);
            return _objectSpread29(_objectSpread29({}, entry), {}, {
              y: entry.y + entry.height - h,
              height: h
            });
          }
          var interpolator = interpolateNumber(0, entry.width);
          var w = interpolator(t3);
          return _objectSpread29(_objectSpread29({}, entry), {}, {
            width: w
          });
        });
        return /* @__PURE__ */ import_react107.default.createElement(Layer, null, _this3.renderRectanglesStatically(stepData));
      });
    }
  }, {
    key: "renderRectangles",
    value: function renderRectangles() {
      var _this$props3 = this.props, data = _this$props3.data, isAnimationActive = _this$props3.isAnimationActive;
      var prevData = this.state.prevData;
      if (isAnimationActive && data && data.length && (!prevData || !(0, import_isEqual4.default)(prevData, data))) {
        return this.renderRectanglesWithAnimation();
      }
      return this.renderRectanglesStatically(data);
    }
  }, {
    key: "renderBackground",
    value: function renderBackground() {
      var _this4 = this;
      var _this$props4 = this.props, data = _this$props4.data, dataKey = _this$props4.dataKey, activeIndex = _this$props4.activeIndex;
      var backgroundProps = filterProps(this.props.background);
      return data.map(function(entry, i2) {
        var value = entry.value, background2 = entry.background, rest = _objectWithoutProperties17(entry, _excluded21);
        if (!background2) {
          return null;
        }
        var props = _objectSpread29(_objectSpread29(_objectSpread29(_objectSpread29(_objectSpread29({}, rest), {}, {
          fill: "#eee"
        }, background2), backgroundProps), adaptEventsOfChild(_this4.props, entry, i2)), {}, {
          onAnimationStart: _this4.handleAnimationStart,
          onAnimationEnd: _this4.handleAnimationEnd,
          dataKey,
          index: i2,
          key: "background-bar-".concat(i2),
          className: "recharts-bar-background-rectangle"
        });
        return /* @__PURE__ */ import_react107.default.createElement(BarRectangle, _extends30({
          option: _this4.props.background,
          isActive: i2 === activeIndex
        }, props));
      });
    }
  }, {
    key: "renderErrorBar",
    value: function renderErrorBar(needClip, clipPathId) {
      if (this.props.isAnimationActive && !this.state.isAnimationFinished) {
        return null;
      }
      var _this$props5 = this.props, data = _this$props5.data, xAxis = _this$props5.xAxis, yAxis = _this$props5.yAxis, layout = _this$props5.layout, children = _this$props5.children;
      var errorBarItems = findAllByType(children, ErrorBar);
      if (!errorBarItems) {
        return null;
      }
      var offset = layout === "vertical" ? data[0].height / 2 : data[0].width / 2;
      var dataPointFormatter = function dataPointFormatter2(dataPoint, dataKey) {
        var value = Array.isArray(dataPoint.value) ? dataPoint.value[1] : dataPoint.value;
        return {
          x: dataPoint.x,
          y: dataPoint.y,
          value,
          errorVal: getValueByDataKey(dataPoint, dataKey)
        };
      };
      var errorBarProps = {
        clipPath: needClip ? "url(#clipPath-".concat(clipPathId, ")") : null
      };
      return /* @__PURE__ */ import_react107.default.createElement(Layer, errorBarProps, errorBarItems.map(function(item, i2) {
        return /* @__PURE__ */ import_react107.default.cloneElement(item, {
          key: "error-bar-".concat(i2),
          // eslint-disable-line react/no-array-index-key
          data,
          xAxis,
          yAxis,
          layout,
          offset,
          dataPointFormatter
        });
      }));
    }
  }, {
    key: "render",
    value: function render2() {
      var _this$props6 = this.props, hide = _this$props6.hide, data = _this$props6.data, className = _this$props6.className, xAxis = _this$props6.xAxis, yAxis = _this$props6.yAxis, left = _this$props6.left, top2 = _this$props6.top, width = _this$props6.width, height = _this$props6.height, isAnimationActive = _this$props6.isAnimationActive, background2 = _this$props6.background, id2 = _this$props6.id;
      if (hide || !data || !data.length) {
        return null;
      }
      var isAnimationFinished = this.state.isAnimationFinished;
      var layerClass = (0, import_classnames19.default)("recharts-bar", className);
      var needClipX = xAxis && xAxis.allowDataOverflow;
      var needClipY = yAxis && yAxis.allowDataOverflow;
      var needClip = needClipX || needClipY;
      var clipPathId = (0, import_isNil10.default)(id2) ? this.id : id2;
      return /* @__PURE__ */ import_react107.default.createElement(Layer, {
        className: layerClass
      }, needClipX || needClipY ? /* @__PURE__ */ import_react107.default.createElement("defs", null, /* @__PURE__ */ import_react107.default.createElement("clipPath", {
        id: "clipPath-".concat(clipPathId)
      }, /* @__PURE__ */ import_react107.default.createElement("rect", {
        x: needClipX ? left : left - width / 2,
        y: needClipY ? top2 : top2 - height / 2,
        width: needClipX ? width : width * 2,
        height: needClipY ? height : height * 2
      }))) : null, /* @__PURE__ */ import_react107.default.createElement(Layer, {
        className: "recharts-bar-rectangles",
        clipPath: needClip ? "url(#clipPath-".concat(clipPathId, ")") : null
      }, background2 ? this.renderBackground() : null, this.renderRectangles()), this.renderErrorBar(needClip, clipPathId), (!isAnimationActive || isAnimationFinished) && LabelList.renderCallByParent(this.props, data));
    }
  }], [{
    key: "getDerivedStateFromProps",
    value: function getDerivedStateFromProps(nextProps, prevState) {
      if (nextProps.animationId !== prevState.prevAnimationId) {
        return {
          prevAnimationId: nextProps.animationId,
          curData: nextProps.data,
          prevData: prevState.curData
        };
      }
      if (nextProps.data !== prevState.curData) {
        return {
          curData: nextProps.data
        };
      }
      return null;
    }
  }]);
  return Bar2;
}(import_react107.PureComponent);
_defineProperty29(Bar, "displayName", "Bar");
_defineProperty29(Bar, "defaultProps", {
  xAxisId: 0,
  yAxisId: 0,
  legendType: "rect",
  minPointSize: 0,
  hide: false,
  data: [],
  layout: "vertical",
  activeBar: true,
  isAnimationActive: !Global2.isSsr,
  animationBegin: 0,
  animationDuration: 400,
  animationEasing: "ease"
});
_defineProperty29(Bar, "getComposedData", function(_ref22) {
  var props = _ref22.props, item = _ref22.item, barPosition = _ref22.barPosition, bandSize = _ref22.bandSize, xAxis = _ref22.xAxis, yAxis = _ref22.yAxis, xAxisTicks = _ref22.xAxisTicks, yAxisTicks = _ref22.yAxisTicks, stackedData = _ref22.stackedData, dataStartIndex = _ref22.dataStartIndex, displayedData = _ref22.displayedData, offset = _ref22.offset;
  var pos = findPositionOfBar(barPosition, item);
  if (!pos) {
    return null;
  }
  var layout = props.layout;
  var _item$props = item.props, dataKey = _item$props.dataKey, children = _item$props.children, minPointSize = _item$props.minPointSize;
  var numericAxis = layout === "horizontal" ? yAxis : xAxis;
  var stackedDomain = stackedData ? numericAxis.scale.domain() : null;
  var baseValue = getBaseValueOfBar({
    numericAxis
  });
  var cells = findAllByType(children, Cell);
  var rects = displayedData.map(function(entry, index) {
    var value, x2, y2, width, height, background2;
    if (stackedData) {
      value = truncateByDomain(stackedData[dataStartIndex + index], stackedDomain);
    } else {
      value = getValueByDataKey(entry, dataKey);
      if (!(0, import_isArray7.default)(value)) {
        value = [baseValue, value];
      }
    }
    if (layout === "horizontal") {
      var _ref42;
      var _ref32 = [yAxis.scale(value[0]), yAxis.scale(value[1])], baseValueScale = _ref32[0], currentValueScale = _ref32[1];
      x2 = getCateCoordinateOfBar({
        axis: xAxis,
        ticks: xAxisTicks,
        bandSize,
        offset: pos.offset,
        entry,
        index
      });
      y2 = (_ref42 = currentValueScale !== null && currentValueScale !== void 0 ? currentValueScale : baseValueScale) !== null && _ref42 !== void 0 ? _ref42 : void 0;
      width = pos.size;
      var computedHeight = baseValueScale - currentValueScale;
      height = Number.isNaN(computedHeight) ? 0 : computedHeight;
      background2 = {
        x: x2,
        y: yAxis.y,
        width,
        height: yAxis.height
      };
      if (Math.abs(minPointSize) > 0 && Math.abs(height) < Math.abs(minPointSize)) {
        var delta = mathSign(height || minPointSize) * (Math.abs(minPointSize) - Math.abs(height));
        y2 -= delta;
        height += delta;
      }
    } else {
      var _ref52 = [xAxis.scale(value[0]), xAxis.scale(value[1])], _baseValueScale = _ref52[0], _currentValueScale = _ref52[1];
      x2 = _baseValueScale;
      y2 = getCateCoordinateOfBar({
        axis: yAxis,
        ticks: yAxisTicks,
        bandSize,
        offset: pos.offset,
        entry,
        index
      });
      width = _currentValueScale - _baseValueScale;
      height = pos.size;
      background2 = {
        x: xAxis.x,
        y: y2,
        width: xAxis.width,
        height
      };
      if (Math.abs(minPointSize) > 0 && Math.abs(width) < Math.abs(minPointSize)) {
        var _delta = mathSign(width || minPointSize) * (Math.abs(minPointSize) - Math.abs(width));
        width += _delta;
      }
    }
    return _objectSpread29(_objectSpread29(_objectSpread29({}, entry), {}, {
      x: x2,
      y: y2,
      width,
      height,
      value: stackedData ? value : value[1],
      payload: entry,
      background: background2
    }, cells && cells[index] && cells[index].props), {}, {
      tooltipPayload: [getTooltipItem(item, entry)],
      tooltipPosition: {
        x: x2 + width / 2,
        y: y2 + height / 2
      }
    });
  });
  return _objectSpread29({
    data: rects,
    layout
  }, offset);
});

// node_modules/recharts/es6/util/CartesianUtils.js
function _typeof35(o) {
  "@babel/helpers - typeof";
  return _typeof35 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
    return typeof o2;
  } : function(o2) {
    return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
  }, _typeof35(o);
}
function _classCallCheck12(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties12(target, props) {
  for (var i2 = 0; i2 < props.length; i2++) {
    var descriptor = props[i2];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor)
      descriptor.writable = true;
    Object.defineProperty(target, _toPropertyKey31(descriptor.key), descriptor);
  }
}
function _createClass12(Constructor, protoProps, staticProps) {
  if (protoProps)
    _defineProperties12(Constructor.prototype, protoProps);
  if (staticProps)
    _defineProperties12(Constructor, staticProps);
  Object.defineProperty(Constructor, "prototype", { writable: false });
  return Constructor;
}
function ownKeys30(e3, r3) {
  var t3 = Object.keys(e3);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e3);
    r3 && (o = o.filter(function(r4) {
      return Object.getOwnPropertyDescriptor(e3, r4).enumerable;
    })), t3.push.apply(t3, o);
  }
  return t3;
}
function _objectSpread30(e3) {
  for (var r3 = 1; r3 < arguments.length; r3++) {
    var t3 = null != arguments[r3] ? arguments[r3] : {};
    r3 % 2 ? ownKeys30(Object(t3), true).forEach(function(r4) {
      _defineProperty30(e3, r4, t3[r4]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e3, Object.getOwnPropertyDescriptors(t3)) : ownKeys30(Object(t3)).forEach(function(r4) {
      Object.defineProperty(e3, r4, Object.getOwnPropertyDescriptor(t3, r4));
    });
  }
  return e3;
}
function _defineProperty30(obj, key, value) {
  key = _toPropertyKey31(key);
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
function _toPropertyKey31(arg) {
  var key = _toPrimitive31(arg, "string");
  return _typeof35(key) === "symbol" ? key : String(key);
}
function _toPrimitive31(input, hint) {
  if (_typeof35(input) !== "object" || input === null)
    return input;
  var prim = input[Symbol.toPrimitive];
  if (prim !== void 0) {
    var res = prim.call(input, hint || "default");
    if (_typeof35(res) !== "object")
      return res;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (hint === "string" ? String : Number)(input);
}
var formatAxisMap3 = function formatAxisMap4(props, axisMap, offset, axisType, chartName) {
  var width = props.width, height = props.height, layout = props.layout, children = props.children;
  var ids = Object.keys(axisMap);
  var steps = {
    left: offset.left,
    leftMirror: offset.left,
    right: width - offset.right,
    rightMirror: width - offset.right,
    top: offset.top,
    topMirror: offset.top,
    bottom: height - offset.bottom,
    bottomMirror: height - offset.bottom
  };
  var hasBar = !!findChildByType(children, Bar);
  return ids.reduce(function(result, id2) {
    var axis = axisMap[id2];
    var orientation = axis.orientation, domain = axis.domain, _axis$padding = axis.padding, padding = _axis$padding === void 0 ? {} : _axis$padding, mirror = axis.mirror, reversed = axis.reversed;
    var offsetKey = "".concat(orientation).concat(mirror ? "Mirror" : "");
    var calculatedPadding, range4, x2, y2, needSpace;
    if (axis.type === "number" && (axis.padding === "gap" || axis.padding === "no-gap")) {
      var diff = domain[1] - domain[0];
      var smallestDistanceBetweenValues = Infinity;
      var sortedValues = axis.categoricalDomain.sort();
      sortedValues.forEach(function(value, index) {
        if (index > 0) {
          smallestDistanceBetweenValues = Math.min((value || 0) - (sortedValues[index - 1] || 0), smallestDistanceBetweenValues);
        }
      });
      var smallestDistanceInPercent = smallestDistanceBetweenValues / diff;
      var rangeWidth = axis.layout === "vertical" ? offset.height : offset.width;
      if (axis.padding === "gap") {
        calculatedPadding = smallestDistanceInPercent * rangeWidth / 2;
      }
      if (axis.padding === "no-gap") {
        var gap = getPercentValue(props.barCategoryGap, smallestDistanceInPercent * rangeWidth);
        var halfBand = smallestDistanceInPercent * rangeWidth / 2;
        calculatedPadding = halfBand - gap - (halfBand - gap) / rangeWidth * gap;
      }
    }
    if (axisType === "xAxis") {
      range4 = [offset.left + (padding.left || 0) + (calculatedPadding || 0), offset.left + offset.width - (padding.right || 0) - (calculatedPadding || 0)];
    } else if (axisType === "yAxis") {
      range4 = layout === "horizontal" ? [offset.top + offset.height - (padding.bottom || 0), offset.top + (padding.top || 0)] : [offset.top + (padding.top || 0) + (calculatedPadding || 0), offset.top + offset.height - (padding.bottom || 0) - (calculatedPadding || 0)];
    } else {
      range4 = axis.range;
    }
    if (reversed) {
      range4 = [range4[1], range4[0]];
    }
    var _parseScale = parseScale(axis, chartName, hasBar), scale = _parseScale.scale, realScaleType = _parseScale.realScaleType;
    scale.domain(domain).range(range4);
    checkDomainOfScale(scale);
    var ticks2 = getTicksOfScale(scale, _objectSpread30(_objectSpread30({}, axis), {}, {
      realScaleType
    }));
    if (axisType === "xAxis") {
      needSpace = orientation === "top" && !mirror || orientation === "bottom" && mirror;
      x2 = offset.left;
      y2 = steps[offsetKey] - needSpace * axis.height;
    } else if (axisType === "yAxis") {
      needSpace = orientation === "left" && !mirror || orientation === "right" && mirror;
      x2 = steps[offsetKey] - needSpace * axis.width;
      y2 = offset.top;
    }
    var finalAxis = _objectSpread30(_objectSpread30(_objectSpread30({}, axis), ticks2), {}, {
      realScaleType,
      x: x2,
      y: y2,
      scale,
      width: axisType === "xAxis" ? offset.width : axis.width,
      height: axisType === "yAxis" ? offset.height : axis.height
    });
    finalAxis.bandSize = getBandSizeOfAxis(finalAxis, ticks2);
    if (!axis.hide && axisType === "xAxis") {
      steps[offsetKey] += (needSpace ? -1 : 1) * finalAxis.height;
    } else if (!axis.hide) {
      steps[offsetKey] += (needSpace ? -1 : 1) * finalAxis.width;
    }
    return _objectSpread30(_objectSpread30({}, result), {}, _defineProperty30({}, id2, finalAxis));
  }, {});
};
var rectWithPoints = function rectWithPoints2(_ref18, _ref22) {
  var x1 = _ref18.x, y1 = _ref18.y;
  var x2 = _ref22.x, y2 = _ref22.y;
  return {
    x: Math.min(x1, x2),
    y: Math.min(y1, y2),
    width: Math.abs(x2 - x1),
    height: Math.abs(y2 - y1)
  };
};
var rectWithCoords = function rectWithCoords2(_ref32) {
  var x1 = _ref32.x1, y1 = _ref32.y1, x2 = _ref32.x2, y2 = _ref32.y2;
  return rectWithPoints({
    x: x1,
    y: y1
  }, {
    x: x2,
    y: y2
  });
};
var ScaleHelper = /* @__PURE__ */ function() {
  function ScaleHelper2(scale) {
    _classCallCheck12(this, ScaleHelper2);
    this.scale = scale;
  }
  _createClass12(ScaleHelper2, [{
    key: "domain",
    get: function get3() {
      return this.scale.domain;
    }
  }, {
    key: "range",
    get: function get3() {
      return this.scale.range;
    }
  }, {
    key: "rangeMin",
    get: function get3() {
      return this.range()[0];
    }
  }, {
    key: "rangeMax",
    get: function get3() {
      return this.range()[1];
    }
  }, {
    key: "bandwidth",
    get: function get3() {
      return this.scale.bandwidth;
    }
  }, {
    key: "apply",
    value: function apply(value) {
      var _ref42 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, bandAware = _ref42.bandAware, position2 = _ref42.position;
      if (value === void 0) {
        return void 0;
      }
      if (position2) {
        switch (position2) {
          case "start": {
            return this.scale(value);
          }
          case "middle": {
            var offset = this.bandwidth ? this.bandwidth() / 2 : 0;
            return this.scale(value) + offset;
          }
          case "end": {
            var _offset2 = this.bandwidth ? this.bandwidth() : 0;
            return this.scale(value) + _offset2;
          }
          default: {
            return this.scale(value);
          }
        }
      }
      if (bandAware) {
        var _offset22 = this.bandwidth ? this.bandwidth() / 2 : 0;
        return this.scale(value) + _offset22;
      }
      return this.scale(value);
    }
  }, {
    key: "isInRange",
    value: function isInRange(value) {
      var range4 = this.range();
      var first = range4[0];
      var last = range4[range4.length - 1];
      return first <= last ? value >= first && value <= last : value >= last && value <= first;
    }
  }], [{
    key: "create",
    value: function create4(obj) {
      return new ScaleHelper2(obj);
    }
  }]);
  return ScaleHelper2;
}();
_defineProperty30(ScaleHelper, "EPS", 1e-4);
var createLabeledScales = function createLabeledScales2(options) {
  var scales = Object.keys(options).reduce(function(res, key) {
    return _objectSpread30(_objectSpread30({}, res), {}, _defineProperty30({}, key, ScaleHelper.create(options[key])));
  }, {});
  return _objectSpread30(_objectSpread30({}, scales), {}, {
    apply: function apply(coord) {
      var _ref52 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, bandAware = _ref52.bandAware, position2 = _ref52.position;
      return (0, import_mapValues.default)(coord, function(value, label) {
        return scales[label].apply(value, {
          bandAware,
          position: position2
        });
      });
    },
    isInRange: function isInRange(coord) {
      return (0, import_every.default)(coord, function(value, label) {
        return scales[label].isInRange(value);
      });
    }
  });
};
function normalizeAngle(angle) {
  return (angle % 180 + 180) % 180;
}
var getAngledRectangleWidth = function getAngledRectangleWidth2(_ref62) {
  var width = _ref62.width, height = _ref62.height;
  var angle = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
  var normalizedAngle = normalizeAngle(angle);
  var angleRadians = normalizedAngle * Math.PI / 180;
  var angleThreshold = Math.atan(height / width);
  var angledWidth = angleRadians > angleThreshold && angleRadians < Math.PI - angleThreshold ? height / Math.sin(angleRadians) : width / Math.cos(angleRadians);
  return Math.abs(angledWidth);
};

// node_modules/recharts/es6/cartesian/ReferenceLine.js
function _typeof36(o) {
  "@babel/helpers - typeof";
  return _typeof36 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
    return typeof o2;
  } : function(o2) {
    return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
  }, _typeof36(o);
}
function ownKeys31(e3, r3) {
  var t3 = Object.keys(e3);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e3);
    r3 && (o = o.filter(function(r4) {
      return Object.getOwnPropertyDescriptor(e3, r4).enumerable;
    })), t3.push.apply(t3, o);
  }
  return t3;
}
function _objectSpread31(e3) {
  for (var r3 = 1; r3 < arguments.length; r3++) {
    var t3 = null != arguments[r3] ? arguments[r3] : {};
    r3 % 2 ? ownKeys31(Object(t3), true).forEach(function(r4) {
      _defineProperty31(e3, r4, t3[r4]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e3, Object.getOwnPropertyDescriptors(t3)) : ownKeys31(Object(t3)).forEach(function(r4) {
      Object.defineProperty(e3, r4, Object.getOwnPropertyDescriptor(t3, r4));
    });
  }
  return e3;
}
function _defineProperty31(obj, key, value) {
  key = _toPropertyKey32(key);
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
function _toPropertyKey32(arg) {
  var key = _toPrimitive32(arg, "string");
  return _typeof36(key) === "symbol" ? key : String(key);
}
function _toPrimitive32(input, hint) {
  if (_typeof36(input) !== "object" || input === null)
    return input;
  var prim = input[Symbol.toPrimitive];
  if (prim !== void 0) {
    var res = prim.call(input, hint || "default");
    if (_typeof36(res) !== "object")
      return res;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (hint === "string" ? String : Number)(input);
}
function _slicedToArray12(arr, i2) {
  return _arrayWithHoles13(arr) || _iterableToArrayLimit12(arr, i2) || _unsupportedIterableToArray21(arr, i2) || _nonIterableRest13();
}
function _nonIterableRest13() {
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _unsupportedIterableToArray21(o, minLen) {
  if (!o)
    return;
  if (typeof o === "string")
    return _arrayLikeToArray21(o, minLen);
  var n2 = Object.prototype.toString.call(o).slice(8, -1);
  if (n2 === "Object" && o.constructor)
    n2 = o.constructor.name;
  if (n2 === "Map" || n2 === "Set")
    return Array.from(o);
  if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2))
    return _arrayLikeToArray21(o, minLen);
}
function _arrayLikeToArray21(arr, len) {
  if (len == null || len > arr.length)
    len = arr.length;
  for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++)
    arr2[i2] = arr[i2];
  return arr2;
}
function _iterableToArrayLimit12(r3, l) {
  var t3 = null == r3 ? null : "undefined" != typeof Symbol && r3[Symbol.iterator] || r3["@@iterator"];
  if (null != t3) {
    var e3, n2, i2, u, a2 = [], f = true, o = false;
    try {
      if (i2 = (t3 = t3.call(r3)).next, 0 === l) {
        if (Object(t3) !== t3)
          return;
        f = false;
      } else
        for (; !(f = (e3 = i2.call(t3)).done) && (a2.push(e3.value), a2.length !== l); f = true)
          ;
    } catch (r4) {
      o = true, n2 = r4;
    } finally {
      try {
        if (!f && null != t3["return"] && (u = t3["return"](), Object(u) !== u))
          return;
      } finally {
        if (o)
          throw n2;
      }
    }
    return a2;
  }
}
function _arrayWithHoles13(arr) {
  if (Array.isArray(arr))
    return arr;
}
function _extends31() {
  _extends31 = Object.assign ? Object.assign.bind() : function(target) {
    for (var i2 = 1; i2 < arguments.length; i2++) {
      var source = arguments[i2];
      for (var key in source) {
        if (Object.prototype.hasOwnProperty.call(source, key)) {
          target[key] = source[key];
        }
      }
    }
    return target;
  };
  return _extends31.apply(this, arguments);
}
var renderLine = function renderLine2(option, props) {
  var line2;
  if (/* @__PURE__ */ import_react108.default.isValidElement(option)) {
    line2 = /* @__PURE__ */ import_react108.default.cloneElement(option, props);
  } else if ((0, import_isFunction14.default)(option)) {
    line2 = option(props);
  } else {
    line2 = /* @__PURE__ */ import_react108.default.createElement("line", _extends31({}, props, {
      className: "recharts-reference-line-line"
    }));
  }
  return line2;
};
var getEndPoints = function getEndPoints2(scales, isFixedX, isFixedY, isSegment, props) {
  var _props$viewBox = props.viewBox, x2 = _props$viewBox.x, y2 = _props$viewBox.y, width = _props$viewBox.width, height = _props$viewBox.height, position2 = props.position;
  if (isFixedY) {
    var yCoord = props.y, orientation = props.yAxis.orientation;
    var coord = scales.y.apply(yCoord, {
      position: position2
    });
    if (ifOverflowMatches(props, "discard") && !scales.y.isInRange(coord)) {
      return null;
    }
    var points = [{
      x: x2 + width,
      y: coord
    }, {
      x: x2,
      y: coord
    }];
    return orientation === "left" ? points.reverse() : points;
  }
  if (isFixedX) {
    var xCoord = props.x, _orientation2 = props.xAxis.orientation;
    var _coord = scales.x.apply(xCoord, {
      position: position2
    });
    if (ifOverflowMatches(props, "discard") && !scales.x.isInRange(_coord)) {
      return null;
    }
    var _points2 = [{
      x: _coord,
      y: y2 + height
    }, {
      x: _coord,
      y: y2
    }];
    return _orientation2 === "top" ? _points2.reverse() : _points2;
  }
  if (isSegment) {
    var segment = props.segment;
    var _points22 = segment.map(function(p) {
      return scales.apply(p, {
        position: position2
      });
    });
    if (ifOverflowMatches(props, "discard") && (0, import_some.default)(_points22, function(p) {
      return !scales.isInRange(p);
    })) {
      return null;
    }
    return _points22;
  }
  return null;
};
function ReferenceLine(props) {
  var fixedX = props.x, fixedY = props.y, segment = props.segment, xAxis = props.xAxis, yAxis = props.yAxis, shape = props.shape, className = props.className, alwaysShow = props.alwaysShow, clipPathId = props.clipPathId;
  warn(alwaysShow === void 0, 'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');
  var scales = createLabeledScales({
    x: xAxis.scale,
    y: yAxis.scale
  });
  var isX = isNumOrStr(fixedX);
  var isY = isNumOrStr(fixedY);
  var isSegment = segment && segment.length === 2;
  var endPoints = getEndPoints(scales, isX, isY, isSegment, props);
  if (!endPoints) {
    return null;
  }
  var _endPoints = _slicedToArray12(endPoints, 2), _endPoints$ = _endPoints[0], x1 = _endPoints$.x, y1 = _endPoints$.y, _endPoints$2 = _endPoints[1], x2 = _endPoints$2.x, y2 = _endPoints$2.y;
  var clipPath = ifOverflowMatches(props, "hidden") ? "url(#".concat(clipPathId, ")") : void 0;
  var lineProps = _objectSpread31(_objectSpread31({
    clipPath
  }, filterProps(props, true)), {}, {
    x1,
    y1,
    x2,
    y2
  });
  return /* @__PURE__ */ import_react108.default.createElement(Layer, {
    className: (0, import_classnames20.default)("recharts-reference-line", className)
  }, renderLine(shape, lineProps), Label3.renderCallByParent(props, rectWithCoords({
    x1,
    y1,
    x2,
    y2
  })));
}
ReferenceLine.displayName = "ReferenceLine";
ReferenceLine.defaultProps = {
  isFront: false,
  ifOverflow: "discard",
  xAxisId: 0,
  yAxisId: 0,
  fill: "none",
  stroke: "#ccc",
  fillOpacity: 1,
  strokeWidth: 1,
  position: "middle"
};

// node_modules/recharts/es6/cartesian/ReferenceDot.js
var import_isFunction15 = __toESM(require_isFunction());
var import_react109 = __toESM(require_react());
var import_classnames21 = __toESM(require_classnames());
function _typeof37(o) {
  "@babel/helpers - typeof";
  return _typeof37 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
    return typeof o2;
  } : function(o2) {
    return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
  }, _typeof37(o);
}
function _extends32() {
  _extends32 = Object.assign ? Object.assign.bind() : function(target) {
    for (var i2 = 1; i2 < arguments.length; i2++) {
      var source = arguments[i2];
      for (var key in source) {
        if (Object.prototype.hasOwnProperty.call(source, key)) {
          target[key] = source[key];
        }
      }
    }
    return target;
  };
  return _extends32.apply(this, arguments);
}
function ownKeys32(e3, r3) {
  var t3 = Object.keys(e3);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e3);
    r3 && (o = o.filter(function(r4) {
      return Object.getOwnPropertyDescriptor(e3, r4).enumerable;
    })), t3.push.apply(t3, o);
  }
  return t3;
}
function _objectSpread32(e3) {
  for (var r3 = 1; r3 < arguments.length; r3++) {
    var t3 = null != arguments[r3] ? arguments[r3] : {};
    r3 % 2 ? ownKeys32(Object(t3), true).forEach(function(r4) {
      _defineProperty32(e3, r4, t3[r4]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e3, Object.getOwnPropertyDescriptors(t3)) : ownKeys32(Object(t3)).forEach(function(r4) {
      Object.defineProperty(e3, r4, Object.getOwnPropertyDescriptor(t3, r4));
    });
  }
  return e3;
}
function _defineProperty32(obj, key, value) {
  key = _toPropertyKey33(key);
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
function _toPropertyKey33(arg) {
  var key = _toPrimitive33(arg, "string");
  return _typeof37(key) === "symbol" ? key : String(key);
}
function _toPrimitive33(input, hint) {
  if (_typeof37(input) !== "object" || input === null)
    return input;
  var prim = input[Symbol.toPrimitive];
  if (prim !== void 0) {
    var res = prim.call(input, hint || "default");
    if (_typeof37(res) !== "object")
      return res;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (hint === "string" ? String : Number)(input);
}
var getCoordinate = function getCoordinate2(props) {
  var x2 = props.x, y2 = props.y, xAxis = props.xAxis, yAxis = props.yAxis;
  var scales = createLabeledScales({
    x: xAxis.scale,
    y: yAxis.scale
  });
  var result = scales.apply({
    x: x2,
    y: y2
  }, {
    bandAware: true
  });
  if (ifOverflowMatches(props, "discard") && !scales.isInRange(result)) {
    return null;
  }
  return result;
};
function ReferenceDot(props) {
  var x2 = props.x, y2 = props.y, r3 = props.r, alwaysShow = props.alwaysShow, clipPathId = props.clipPathId;
  var isX = isNumOrStr(x2);
  var isY = isNumOrStr(y2);
  warn(alwaysShow === void 0, 'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');
  if (!isX || !isY) {
    return null;
  }
  var coordinate = getCoordinate(props);
  if (!coordinate) {
    return null;
  }
  var cx = coordinate.x, cy = coordinate.y;
  var shape = props.shape, className = props.className;
  var clipPath = ifOverflowMatches(props, "hidden") ? "url(#".concat(clipPathId, ")") : void 0;
  var dotProps = _objectSpread32(_objectSpread32({
    clipPath
  }, filterProps(props, true)), {}, {
    cx,
    cy
  });
  return /* @__PURE__ */ import_react109.default.createElement(Layer, {
    className: (0, import_classnames21.default)("recharts-reference-dot", className)
  }, ReferenceDot.renderDot(shape, dotProps), Label3.renderCallByParent(props, {
    x: cx - r3,
    y: cy - r3,
    width: 2 * r3,
    height: 2 * r3
  }));
}
ReferenceDot.displayName = "ReferenceDot";
ReferenceDot.defaultProps = {
  isFront: false,
  ifOverflow: "discard",
  xAxisId: 0,
  yAxisId: 0,
  r: 10,
  fill: "#fff",
  stroke: "#ccc",
  fillOpacity: 1,
  strokeWidth: 1
};
ReferenceDot.renderDot = function(option, props) {
  var dot2;
  if (/* @__PURE__ */ import_react109.default.isValidElement(option)) {
    dot2 = /* @__PURE__ */ import_react109.default.cloneElement(option, props);
  } else if ((0, import_isFunction15.default)(option)) {
    dot2 = option(props);
  } else {
    dot2 = /* @__PURE__ */ import_react109.default.createElement(Dot, _extends32({}, props, {
      cx: props.cx,
      cy: props.cy,
      className: "recharts-reference-dot-dot"
    }));
  }
  return dot2;
};

// node_modules/recharts/es6/cartesian/ReferenceArea.js
var import_isFunction16 = __toESM(require_isFunction());
var import_react110 = __toESM(require_react());
var import_classnames22 = __toESM(require_classnames());
function _typeof38(o) {
  "@babel/helpers - typeof";
  return _typeof38 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
    return typeof o2;
  } : function(o2) {
    return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
  }, _typeof38(o);
}
function _extends33() {
  _extends33 = Object.assign ? Object.assign.bind() : function(target) {
    for (var i2 = 1; i2 < arguments.length; i2++) {
      var source = arguments[i2];
      for (var key in source) {
        if (Object.prototype.hasOwnProperty.call(source, key)) {
          target[key] = source[key];
        }
      }
    }
    return target;
  };
  return _extends33.apply(this, arguments);
}
function ownKeys33(e3, r3) {
  var t3 = Object.keys(e3);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e3);
    r3 && (o = o.filter(function(r4) {
      return Object.getOwnPropertyDescriptor(e3, r4).enumerable;
    })), t3.push.apply(t3, o);
  }
  return t3;
}
function _objectSpread33(e3) {
  for (var r3 = 1; r3 < arguments.length; r3++) {
    var t3 = null != arguments[r3] ? arguments[r3] : {};
    r3 % 2 ? ownKeys33(Object(t3), true).forEach(function(r4) {
      _defineProperty33(e3, r4, t3[r4]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e3, Object.getOwnPropertyDescriptors(t3)) : ownKeys33(Object(t3)).forEach(function(r4) {
      Object.defineProperty(e3, r4, Object.getOwnPropertyDescriptor(t3, r4));
    });
  }
  return e3;
}
function _defineProperty33(obj, key, value) {
  key = _toPropertyKey34(key);
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
function _toPropertyKey34(arg) {
  var key = _toPrimitive34(arg, "string");
  return _typeof38(key) === "symbol" ? key : String(key);
}
function _toPrimitive34(input, hint) {
  if (_typeof38(input) !== "object" || input === null)
    return input;
  var prim = input[Symbol.toPrimitive];
  if (prim !== void 0) {
    var res = prim.call(input, hint || "default");
    if (_typeof38(res) !== "object")
      return res;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (hint === "string" ? String : Number)(input);
}
var getRect = function getRect2(hasX1, hasX2, hasY1, hasY2, props) {
  var xValue1 = props.x1, xValue2 = props.x2, yValue1 = props.y1, yValue2 = props.y2, xAxis = props.xAxis, yAxis = props.yAxis;
  if (!xAxis || !yAxis)
    return null;
  var scales = createLabeledScales({
    x: xAxis.scale,
    y: yAxis.scale
  });
  var p1 = {
    x: hasX1 ? scales.x.apply(xValue1, {
      position: "start"
    }) : scales.x.rangeMin,
    y: hasY1 ? scales.y.apply(yValue1, {
      position: "start"
    }) : scales.y.rangeMin
  };
  var p2 = {
    x: hasX2 ? scales.x.apply(xValue2, {
      position: "end"
    }) : scales.x.rangeMax,
    y: hasY2 ? scales.y.apply(yValue2, {
      position: "end"
    }) : scales.y.rangeMax
  };
  if (ifOverflowMatches(props, "discard") && (!scales.isInRange(p1) || !scales.isInRange(p2))) {
    return null;
  }
  return rectWithPoints(p1, p2);
};
function ReferenceArea(props) {
  var x1 = props.x1, x2 = props.x2, y1 = props.y1, y2 = props.y2, className = props.className, alwaysShow = props.alwaysShow, clipPathId = props.clipPathId;
  warn(alwaysShow === void 0, 'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');
  var hasX1 = isNumOrStr(x1);
  var hasX2 = isNumOrStr(x2);
  var hasY1 = isNumOrStr(y1);
  var hasY2 = isNumOrStr(y2);
  var shape = props.shape;
  if (!hasX1 && !hasX2 && !hasY1 && !hasY2 && !shape) {
    return null;
  }
  var rect = getRect(hasX1, hasX2, hasY1, hasY2, props);
  if (!rect && !shape) {
    return null;
  }
  var clipPath = ifOverflowMatches(props, "hidden") ? "url(#".concat(clipPathId, ")") : void 0;
  return /* @__PURE__ */ import_react110.default.createElement(Layer, {
    className: (0, import_classnames22.default)("recharts-reference-area", className)
  }, ReferenceArea.renderRect(shape, _objectSpread33(_objectSpread33({
    clipPath
  }, filterProps(props, true)), rect)), Label3.renderCallByParent(props, rect));
}
ReferenceArea.displayName = "ReferenceArea";
ReferenceArea.defaultProps = {
  isFront: false,
  ifOverflow: "discard",
  xAxisId: 0,
  yAxisId: 0,
  r: 10,
  fill: "#ccc",
  fillOpacity: 0.5,
  stroke: "none",
  strokeWidth: 1
};
ReferenceArea.renderRect = function(option, props) {
  var rect;
  if (/* @__PURE__ */ import_react110.default.isValidElement(option)) {
    rect = /* @__PURE__ */ import_react110.default.cloneElement(option, props);
  } else if ((0, import_isFunction16.default)(option)) {
    rect = option(props);
  } else {
    rect = /* @__PURE__ */ import_react110.default.createElement(Rectangle, _extends33({}, props, {
      className: "recharts-reference-area-rect"
    }));
  }
  return rect;
};

// node_modules/recharts/es6/cartesian/CartesianAxis.js
var import_isFunction18 = __toESM(require_isFunction());
var import_get5 = __toESM(require_get());
var import_react111 = __toESM(require_react());
var import_classnames23 = __toESM(require_classnames());

// node_modules/recharts/es6/cartesian/getTicks.js
var import_isFunction17 = __toESM(require_isFunction());

// node_modules/recharts/es6/util/getEveryNthWithCondition.js
function getEveryNthWithCondition(array, n2, isValid) {
  if (n2 < 1) {
    return [];
  }
  if (n2 === 1 && isValid === void 0) {
    return array;
  }
  var result = [];
  for (var i2 = 0; i2 < array.length; i2 += n2) {
    if (isValid === void 0 || isValid(array[i2]) === true) {
      result.push(array[i2]);
    } else {
      return void 0;
    }
  }
  return result;
}

// node_modules/recharts/es6/util/TickUtils.js
function getAngledTickWidth(contentSize, unitSize, angle) {
  var size = {
    width: contentSize.width + unitSize.width,
    height: contentSize.height + unitSize.height
  };
  return getAngledRectangleWidth(size, angle);
}
function getTickBoundaries(viewBox, sign3, sizeKey) {
  var isWidth = sizeKey === "width";
  var x2 = viewBox.x, y2 = viewBox.y, width = viewBox.width, height = viewBox.height;
  if (sign3 === 1) {
    return {
      start: isWidth ? x2 : y2,
      end: isWidth ? x2 + width : y2 + height
    };
  }
  return {
    start: isWidth ? x2 + width : y2 + height,
    end: isWidth ? x2 : y2
  };
}
function isVisible(sign3, tickPosition, size, start, end) {
  return sign3 * (tickPosition - sign3 * size / 2 - start) >= 0 && sign3 * (tickPosition + sign3 * size / 2 - end) <= 0;
}
function getNumberIntervalTicks(ticks2, interval) {
  return getEveryNthWithCondition(ticks2, interval + 1);
}

// node_modules/recharts/es6/cartesian/getEquidistantTicks.js
function getEquidistantTicks(sign3, boundaries, getTickSize, ticks2, minTickGap) {
  var result = (ticks2 || []).slice();
  var initialStart = boundaries.start, end = boundaries.end;
  var index = 0;
  var stepsize = 1;
  var start = initialStart;
  while (stepsize <= result.length) {
    var entry = ticks2 === null || ticks2 === void 0 ? void 0 : ticks2[index];
    if (entry === void 0) {
      return getEveryNthWithCondition(ticks2, stepsize);
    }
    var size = getTickSize(entry, index);
    var tickCoord = entry.coordinate;
    var isShow = index === 0 || isVisible(sign3, tickCoord, size, start, end);
    if (!isShow) {
      index = 0;
      start = initialStart;
      stepsize += 1;
    }
    if (isShow) {
      start = tickCoord + sign3 * (size / 2 + minTickGap);
      index += stepsize;
    }
  }
  return [];
}

// node_modules/recharts/es6/cartesian/getTicks.js
function _typeof39(o) {
  "@babel/helpers - typeof";
  return _typeof39 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
    return typeof o2;
  } : function(o2) {
    return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
  }, _typeof39(o);
}
function ownKeys34(e3, r3) {
  var t3 = Object.keys(e3);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e3);
    r3 && (o = o.filter(function(r4) {
      return Object.getOwnPropertyDescriptor(e3, r4).enumerable;
    })), t3.push.apply(t3, o);
  }
  return t3;
}
function _objectSpread34(e3) {
  for (var r3 = 1; r3 < arguments.length; r3++) {
    var t3 = null != arguments[r3] ? arguments[r3] : {};
    r3 % 2 ? ownKeys34(Object(t3), true).forEach(function(r4) {
      _defineProperty34(e3, r4, t3[r4]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e3, Object.getOwnPropertyDescriptors(t3)) : ownKeys34(Object(t3)).forEach(function(r4) {
      Object.defineProperty(e3, r4, Object.getOwnPropertyDescriptor(t3, r4));
    });
  }
  return e3;
}
function _defineProperty34(obj, key, value) {
  key = _toPropertyKey35(key);
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
function _toPropertyKey35(arg) {
  var key = _toPrimitive35(arg, "string");
  return _typeof39(key) === "symbol" ? key : String(key);
}
function _toPrimitive35(input, hint) {
  if (_typeof39(input) !== "object" || input === null)
    return input;
  var prim = input[Symbol.toPrimitive];
  if (prim !== void 0) {
    var res = prim.call(input, hint || "default");
    if (_typeof39(res) !== "object")
      return res;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (hint === "string" ? String : Number)(input);
}
function getTicksEnd(sign3, boundaries, getTickSize, ticks2, minTickGap) {
  var result = (ticks2 || []).slice();
  var len = result.length;
  var start = boundaries.start;
  var end = boundaries.end;
  for (var i2 = len - 1; i2 >= 0; i2--) {
    var entry = result[i2];
    var size = getTickSize(entry, i2);
    if (i2 === len - 1) {
      var gap = sign3 * (entry.coordinate + sign3 * size / 2 - end);
      result[i2] = entry = _objectSpread34(_objectSpread34({}, entry), {}, {
        tickCoord: gap > 0 ? entry.coordinate - gap * sign3 : entry.coordinate
      });
    } else {
      result[i2] = entry = _objectSpread34(_objectSpread34({}, entry), {}, {
        tickCoord: entry.coordinate
      });
    }
    var isShow = isVisible(sign3, entry.tickCoord, size, start, end);
    if (isShow) {
      end = entry.tickCoord - sign3 * (size / 2 + minTickGap);
      result[i2] = _objectSpread34(_objectSpread34({}, entry), {}, {
        isShow: true
      });
    }
  }
  return result;
}
function getTicksStart(sign3, boundaries, getTickSize, ticks2, minTickGap, preserveEnd) {
  var result = (ticks2 || []).slice();
  var len = result.length;
  var start = boundaries.start, end = boundaries.end;
  if (preserveEnd) {
    var tail = ticks2[len - 1];
    var tailSize = getTickSize(tail, len - 1);
    var tailGap = sign3 * (tail.coordinate + sign3 * tailSize / 2 - end);
    result[len - 1] = tail = _objectSpread34(_objectSpread34({}, tail), {}, {
      tickCoord: tailGap > 0 ? tail.coordinate - tailGap * sign3 : tail.coordinate
    });
    var isTailShow = isVisible(sign3, tail.tickCoord, tailSize, start, end);
    if (isTailShow) {
      end = tail.tickCoord - sign3 * (tailSize / 2 + minTickGap);
      result[len - 1] = _objectSpread34(_objectSpread34({}, tail), {}, {
        isShow: true
      });
    }
  }
  var count2 = preserveEnd ? len - 1 : len;
  for (var i2 = 0; i2 < count2; i2++) {
    var entry = result[i2];
    var size = getTickSize(entry, i2);
    if (i2 === 0) {
      var gap = sign3 * (entry.coordinate - sign3 * size / 2 - start);
      result[i2] = entry = _objectSpread34(_objectSpread34({}, entry), {}, {
        tickCoord: gap < 0 ? entry.coordinate - gap * sign3 : entry.coordinate
      });
    } else {
      result[i2] = entry = _objectSpread34(_objectSpread34({}, entry), {}, {
        tickCoord: entry.coordinate
      });
    }
    var isShow = isVisible(sign3, entry.tickCoord, size, start, end);
    if (isShow) {
      start = entry.tickCoord + sign3 * (size / 2 + minTickGap);
      result[i2] = _objectSpread34(_objectSpread34({}, entry), {}, {
        isShow: true
      });
    }
  }
  return result;
}
function getTicks(props, fontSize, letterSpacing) {
  var tick = props.tick, ticks2 = props.ticks, viewBox = props.viewBox, minTickGap = props.minTickGap, orientation = props.orientation, interval = props.interval, tickFormatter = props.tickFormatter, unit2 = props.unit, angle = props.angle;
  if (!ticks2 || !ticks2.length || !tick) {
    return [];
  }
  if (isNumber(interval) || Global2.isSsr) {
    return getNumberIntervalTicks(ticks2, typeof interval === "number" && isNumber(interval) ? interval : 0);
  }
  var candidates = [];
  var sizeKey = orientation === "top" || orientation === "bottom" ? "width" : "height";
  var unitSize = unit2 && sizeKey === "width" ? getStringSize(unit2, {
    fontSize,
    letterSpacing
  }) : {
    width: 0,
    height: 0
  };
  var getTickSize = function getTickSize2(content2, index) {
    var value = (0, import_isFunction17.default)(tickFormatter) ? tickFormatter(content2.value, index) : content2.value;
    return sizeKey === "width" ? getAngledTickWidth(getStringSize(value, {
      fontSize,
      letterSpacing
    }), unitSize, angle) : getStringSize(value, {
      fontSize,
      letterSpacing
    })[sizeKey];
  };
  var sign3 = ticks2.length >= 2 ? mathSign(ticks2[1].coordinate - ticks2[0].coordinate) : 1;
  var boundaries = getTickBoundaries(viewBox, sign3, sizeKey);
  if (interval === "equidistantPreserveStart") {
    return getEquidistantTicks(sign3, boundaries, getTickSize, ticks2, minTickGap);
  }
  if (interval === "preserveStart" || interval === "preserveStartEnd") {
    candidates = getTicksStart(sign3, boundaries, getTickSize, ticks2, minTickGap, interval === "preserveStartEnd");
  } else {
    candidates = getTicksEnd(sign3, boundaries, getTickSize, ticks2, minTickGap);
  }
  return candidates.filter(function(entry) {
    return entry.isShow;
  });
}

// node_modules/recharts/es6/cartesian/CartesianAxis.js
var _excluded27 = ["viewBox"];
var _excluded28 = ["viewBox"];
var _excluded33 = ["ticks"];
function _typeof40(o) {
  "@babel/helpers - typeof";
  return _typeof40 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
    return typeof o2;
  } : function(o2) {
    return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
  }, _typeof40(o);
}
function _extends34() {
  _extends34 = Object.assign ? Object.assign.bind() : function(target) {
    for (var i2 = 1; i2 < arguments.length; i2++) {
      var source = arguments[i2];
      for (var key in source) {
        if (Object.prototype.hasOwnProperty.call(source, key)) {
          target[key] = source[key];
        }
      }
    }
    return target;
  };
  return _extends34.apply(this, arguments);
}
function ownKeys35(e3, r3) {
  var t3 = Object.keys(e3);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e3);
    r3 && (o = o.filter(function(r4) {
      return Object.getOwnPropertyDescriptor(e3, r4).enumerable;
    })), t3.push.apply(t3, o);
  }
  return t3;
}
function _objectSpread35(e3) {
  for (var r3 = 1; r3 < arguments.length; r3++) {
    var t3 = null != arguments[r3] ? arguments[r3] : {};
    r3 % 2 ? ownKeys35(Object(t3), true).forEach(function(r4) {
      _defineProperty35(e3, r4, t3[r4]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e3, Object.getOwnPropertyDescriptors(t3)) : ownKeys35(Object(t3)).forEach(function(r4) {
      Object.defineProperty(e3, r4, Object.getOwnPropertyDescriptor(t3, r4));
    });
  }
  return e3;
}
function _objectWithoutProperties18(source, excluded) {
  if (source == null)
    return {};
  var target = _objectWithoutPropertiesLoose22(source, excluded);
  var key, i2;
  if (Object.getOwnPropertySymbols) {
    var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
    for (i2 = 0; i2 < sourceSymbolKeys.length; i2++) {
      key = sourceSymbolKeys[i2];
      if (excluded.indexOf(key) >= 0)
        continue;
      if (!Object.prototype.propertyIsEnumerable.call(source, key))
        continue;
      target[key] = source[key];
    }
  }
  return target;
}
function _objectWithoutPropertiesLoose22(source, excluded) {
  if (source == null)
    return {};
  var target = {};
  var sourceKeys = Object.keys(source);
  var key, i2;
  for (i2 = 0; i2 < sourceKeys.length; i2++) {
    key = sourceKeys[i2];
    if (excluded.indexOf(key) >= 0)
      continue;
    target[key] = source[key];
  }
  return target;
}
function _classCallCheck13(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties13(target, props) {
  for (var i2 = 0; i2 < props.length; i2++) {
    var descriptor = props[i2];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor)
      descriptor.writable = true;
    Object.defineProperty(target, _toPropertyKey36(descriptor.key), descriptor);
  }
}
function _createClass13(Constructor, protoProps, staticProps) {
  if (protoProps)
    _defineProperties13(Constructor.prototype, protoProps);
  if (staticProps)
    _defineProperties13(Constructor, staticProps);
  Object.defineProperty(Constructor, "prototype", { writable: false });
  return Constructor;
}
function _inherits11(subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function");
  }
  subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
  Object.defineProperty(subClass, "prototype", { writable: false });
  if (superClass)
    _setPrototypeOf13(subClass, superClass);
}
function _setPrototypeOf13(o, p) {
  _setPrototypeOf13 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf19(o2, p2) {
    o2.__proto__ = p2;
    return o2;
  };
  return _setPrototypeOf13(o, p);
}
function _createSuper11(Derived) {
  var hasNativeReflectConstruct = _isNativeReflectConstruct12();
  return function _createSuperInternal() {
    var Super = _getPrototypeOf12(Derived), result;
    if (hasNativeReflectConstruct) {
      var NewTarget = _getPrototypeOf12(this).constructor;
      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }
    return _possibleConstructorReturn11(this, result);
  };
}
function _possibleConstructorReturn11(self2, call) {
  if (call && (_typeof40(call) === "object" || typeof call === "function")) {
    return call;
  } else if (call !== void 0) {
    throw new TypeError("Derived constructors may only return object or undefined");
  }
  return _assertThisInitialized13(self2);
}
function _assertThisInitialized13(self2) {
  if (self2 === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }
  return self2;
}
function _isNativeReflectConstruct12() {
  if (typeof Reflect === "undefined" || !Reflect.construct)
    return false;
  if (Reflect.construct.sham)
    return false;
  if (typeof Proxy === "function")
    return true;
  try {
    Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
    return true;
  } catch (e3) {
    return false;
  }
}
function _getPrototypeOf12(o) {
  _getPrototypeOf12 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf18(o2) {
    return o2.__proto__ || Object.getPrototypeOf(o2);
  };
  return _getPrototypeOf12(o);
}
function _defineProperty35(obj, key, value) {
  key = _toPropertyKey36(key);
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
function _toPropertyKey36(arg) {
  var key = _toPrimitive36(arg, "string");
  return _typeof40(key) === "symbol" ? key : String(key);
}
function _toPrimitive36(input, hint) {
  if (_typeof40(input) !== "object" || input === null)
    return input;
  var prim = input[Symbol.toPrimitive];
  if (prim !== void 0) {
    var res = prim.call(input, hint || "default");
    if (_typeof40(res) !== "object")
      return res;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (hint === "string" ? String : Number)(input);
}
var CartesianAxis = /* @__PURE__ */ function(_Component) {
  _inherits11(CartesianAxis2, _Component);
  var _super = _createSuper11(CartesianAxis2);
  function CartesianAxis2(props) {
    var _this;
    _classCallCheck13(this, CartesianAxis2);
    _this = _super.call(this, props);
    _this.state = {
      fontSize: "",
      letterSpacing: ""
    };
    return _this;
  }
  _createClass13(CartesianAxis2, [{
    key: "shouldComponentUpdate",
    value: function shouldComponentUpdate(_ref18, nextState) {
      var viewBox = _ref18.viewBox, restProps = _objectWithoutProperties18(_ref18, _excluded27);
      var _this$props = this.props, viewBoxOld = _this$props.viewBox, restPropsOld = _objectWithoutProperties18(_this$props, _excluded28);
      return !shallowEqual(viewBox, viewBoxOld) || !shallowEqual(restProps, restPropsOld) || !shallowEqual(nextState, this.state);
    }
  }, {
    key: "componentDidMount",
    value: function componentDidMount() {
      var htmlLayer = this.layerReference;
      if (!htmlLayer)
        return;
      var tick = htmlLayer.getElementsByClassName("recharts-cartesian-axis-tick-value")[0];
      if (tick) {
        this.setState({
          fontSize: window.getComputedStyle(tick).fontSize,
          letterSpacing: window.getComputedStyle(tick).letterSpacing
        });
      }
    }
    /**
     * Calculate the coordinates of endpoints in ticks
     * @param  {Object} data The data of a simple tick
     * @return {Object} (x1, y1): The coordinate of endpoint close to tick text
     *  (x2, y2): The coordinate of endpoint close to axis
     */
  }, {
    key: "getTickLineCoord",
    value: function getTickLineCoord(data) {
      var _this$props2 = this.props, x2 = _this$props2.x, y2 = _this$props2.y, width = _this$props2.width, height = _this$props2.height, orientation = _this$props2.orientation, tickSize = _this$props2.tickSize, mirror = _this$props2.mirror, tickMargin = _this$props2.tickMargin;
      var x1, x22, y1, y22, tx, ty;
      var sign3 = mirror ? -1 : 1;
      var finalTickSize = data.tickSize || tickSize;
      var tickCoord = isNumber(data.tickCoord) ? data.tickCoord : data.coordinate;
      switch (orientation) {
        case "top":
          x1 = x22 = data.coordinate;
          y22 = y2 + +!mirror * height;
          y1 = y22 - sign3 * finalTickSize;
          ty = y1 - sign3 * tickMargin;
          tx = tickCoord;
          break;
        case "left":
          y1 = y22 = data.coordinate;
          x22 = x2 + +!mirror * width;
          x1 = x22 - sign3 * finalTickSize;
          tx = x1 - sign3 * tickMargin;
          ty = tickCoord;
          break;
        case "right":
          y1 = y22 = data.coordinate;
          x22 = x2 + +mirror * width;
          x1 = x22 + sign3 * finalTickSize;
          tx = x1 + sign3 * tickMargin;
          ty = tickCoord;
          break;
        default:
          x1 = x22 = data.coordinate;
          y22 = y2 + +mirror * height;
          y1 = y22 + sign3 * finalTickSize;
          ty = y1 + sign3 * tickMargin;
          tx = tickCoord;
          break;
      }
      return {
        line: {
          x1,
          y1,
          x2: x22,
          y2: y22
        },
        tick: {
          x: tx,
          y: ty
        }
      };
    }
  }, {
    key: "getTickTextAnchor",
    value: function getTickTextAnchor() {
      var _this$props3 = this.props, orientation = _this$props3.orientation, mirror = _this$props3.mirror;
      var textAnchor;
      switch (orientation) {
        case "left":
          textAnchor = mirror ? "start" : "end";
          break;
        case "right":
          textAnchor = mirror ? "end" : "start";
          break;
        default:
          textAnchor = "middle";
          break;
      }
      return textAnchor;
    }
  }, {
    key: "getTickVerticalAnchor",
    value: function getTickVerticalAnchor() {
      var _this$props4 = this.props, orientation = _this$props4.orientation, mirror = _this$props4.mirror;
      var verticalAnchor = "end";
      switch (orientation) {
        case "left":
        case "right":
          verticalAnchor = "middle";
          break;
        case "top":
          verticalAnchor = mirror ? "start" : "end";
          break;
        default:
          verticalAnchor = mirror ? "end" : "start";
          break;
      }
      return verticalAnchor;
    }
  }, {
    key: "renderAxisLine",
    value: function renderAxisLine() {
      var _this$props5 = this.props, x2 = _this$props5.x, y2 = _this$props5.y, width = _this$props5.width, height = _this$props5.height, orientation = _this$props5.orientation, mirror = _this$props5.mirror, axisLine = _this$props5.axisLine;
      var props = _objectSpread35(_objectSpread35(_objectSpread35({}, filterProps(this.props)), filterProps(axisLine)), {}, {
        fill: "none"
      });
      if (orientation === "top" || orientation === "bottom") {
        var needHeight = +(orientation === "top" && !mirror || orientation === "bottom" && mirror);
        props = _objectSpread35(_objectSpread35({}, props), {}, {
          x1: x2,
          y1: y2 + needHeight * height,
          x2: x2 + width,
          y2: y2 + needHeight * height
        });
      } else {
        var needWidth = +(orientation === "left" && !mirror || orientation === "right" && mirror);
        props = _objectSpread35(_objectSpread35({}, props), {}, {
          x1: x2 + needWidth * width,
          y1: y2,
          x2: x2 + needWidth * width,
          y2: y2 + height
        });
      }
      return /* @__PURE__ */ import_react111.default.createElement("line", _extends34({}, props, {
        className: (0, import_classnames23.default)("recharts-cartesian-axis-line", (0, import_get5.default)(axisLine, "className"))
      }));
    }
  }, {
    key: "renderTicks",
    value: (
      /**
       * render the ticks
       * @param {Array} ticks The ticks to actually render (overrides what was passed in props)
       * @param {string} fontSize Fontsize to consider for tick spacing
       * @param {string} letterSpacing Letterspacing to consider for tick spacing
       * @return {ReactComponent} renderedTicks
       */
      function renderTicks(ticks2, fontSize, letterSpacing) {
        var _this2 = this;
        var _this$props6 = this.props, tickLine = _this$props6.tickLine, stroke = _this$props6.stroke, tick = _this$props6.tick, tickFormatter = _this$props6.tickFormatter, unit2 = _this$props6.unit;
        var finalTicks = getTicks(_objectSpread35(_objectSpread35({}, this.props), {}, {
          ticks: ticks2
        }), fontSize, letterSpacing);
        var textAnchor = this.getTickTextAnchor();
        var verticalAnchor = this.getTickVerticalAnchor();
        var axisProps = filterProps(this.props);
        var customTickProps = filterProps(tick);
        var tickLineProps = _objectSpread35(_objectSpread35({}, axisProps), {}, {
          fill: "none"
        }, filterProps(tickLine));
        var items = finalTicks.map(function(entry, i2) {
          var _this2$getTickLineCoo = _this2.getTickLineCoord(entry), lineCoord = _this2$getTickLineCoo.line, tickCoord = _this2$getTickLineCoo.tick;
          var tickProps = _objectSpread35(_objectSpread35(_objectSpread35(_objectSpread35({
            textAnchor,
            verticalAnchor
          }, axisProps), {}, {
            stroke: "none",
            fill: stroke
          }, customTickProps), tickCoord), {}, {
            index: i2,
            payload: entry,
            visibleTicksCount: finalTicks.length,
            tickFormatter
          });
          return /* @__PURE__ */ import_react111.default.createElement(Layer, _extends34({
            className: "recharts-cartesian-axis-tick",
            key: "tick-".concat(i2)
            // eslint-disable-line react/no-array-index-key
          }, adaptEventsOfChild(_this2.props, entry, i2)), tickLine && /* @__PURE__ */ import_react111.default.createElement("line", _extends34({}, tickLineProps, lineCoord, {
            className: (0, import_classnames23.default)("recharts-cartesian-axis-tick-line", (0, import_get5.default)(tickLine, "className"))
          })), tick && CartesianAxis2.renderTickItem(tick, tickProps, "".concat((0, import_isFunction18.default)(tickFormatter) ? tickFormatter(entry.value, i2) : entry.value).concat(unit2 || "")));
        });
        return /* @__PURE__ */ import_react111.default.createElement("g", {
          className: "recharts-cartesian-axis-ticks"
        }, items);
      }
    )
  }, {
    key: "render",
    value: function render2() {
      var _this3 = this;
      var _this$props7 = this.props, axisLine = _this$props7.axisLine, width = _this$props7.width, height = _this$props7.height, ticksGenerator = _this$props7.ticksGenerator, className = _this$props7.className, hide = _this$props7.hide;
      if (hide) {
        return null;
      }
      var _this$props8 = this.props, ticks2 = _this$props8.ticks, noTicksProps = _objectWithoutProperties18(_this$props8, _excluded33);
      var finalTicks = ticks2;
      if ((0, import_isFunction18.default)(ticksGenerator)) {
        finalTicks = ticks2 && ticks2.length > 0 ? ticksGenerator(this.props) : ticksGenerator(noTicksProps);
      }
      if (width <= 0 || height <= 0 || !finalTicks || !finalTicks.length) {
        return null;
      }
      return /* @__PURE__ */ import_react111.default.createElement(Layer, {
        className: (0, import_classnames23.default)("recharts-cartesian-axis", className),
        ref: function ref(_ref22) {
          _this3.layerReference = _ref22;
        }
      }, axisLine && this.renderAxisLine(), this.renderTicks(finalTicks, this.state.fontSize, this.state.letterSpacing), Label3.renderCallByParent(this.props));
    }
  }], [{
    key: "renderTickItem",
    value: function renderTickItem(option, props, value) {
      var tickItem;
      if (/* @__PURE__ */ import_react111.default.isValidElement(option)) {
        tickItem = /* @__PURE__ */ import_react111.default.cloneElement(option, props);
      } else if ((0, import_isFunction18.default)(option)) {
        tickItem = option(props);
      } else {
        tickItem = /* @__PURE__ */ import_react111.default.createElement(Text3, _extends34({}, props, {
          className: "recharts-cartesian-axis-tick-value"
        }), value);
      }
      return tickItem;
    }
  }]);
  return CartesianAxis2;
}(import_react111.Component);
_defineProperty35(CartesianAxis, "displayName", "CartesianAxis");
_defineProperty35(CartesianAxis, "defaultProps", {
  x: 0,
  y: 0,
  width: 0,
  height: 0,
  viewBox: {
    x: 0,
    y: 0,
    width: 0,
    height: 0
  },
  // The orientation of axis
  orientation: "bottom",
  // The ticks
  ticks: [],
  stroke: "#666",
  tickLine: true,
  axisLine: true,
  tick: true,
  mirror: false,
  minTickGap: 5,
  // The width or height of tick
  tickSize: 6,
  tickMargin: 2,
  interval: "preserveEnd"
});

// node_modules/recharts/es6/cartesian/CartesianGrid.js
var import_isFunction19 = __toESM(require_isFunction());
var import_react112 = __toESM(require_react());
var _excluded29 = ["x1", "y1", "x2", "y2", "key"];
var _excluded210 = ["offset"];
function _typeof41(o) {
  "@babel/helpers - typeof";
  return _typeof41 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
    return typeof o2;
  } : function(o2) {
    return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
  }, _typeof41(o);
}
function _extends35() {
  _extends35 = Object.assign ? Object.assign.bind() : function(target) {
    for (var i2 = 1; i2 < arguments.length; i2++) {
      var source = arguments[i2];
      for (var key in source) {
        if (Object.prototype.hasOwnProperty.call(source, key)) {
          target[key] = source[key];
        }
      }
    }
    return target;
  };
  return _extends35.apply(this, arguments);
}
function _objectWithoutProperties19(source, excluded) {
  if (source == null)
    return {};
  var target = _objectWithoutPropertiesLoose23(source, excluded);
  var key, i2;
  if (Object.getOwnPropertySymbols) {
    var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
    for (i2 = 0; i2 < sourceSymbolKeys.length; i2++) {
      key = sourceSymbolKeys[i2];
      if (excluded.indexOf(key) >= 0)
        continue;
      if (!Object.prototype.propertyIsEnumerable.call(source, key))
        continue;
      target[key] = source[key];
    }
  }
  return target;
}
function _objectWithoutPropertiesLoose23(source, excluded) {
  if (source == null)
    return {};
  var target = {};
  var sourceKeys = Object.keys(source);
  var key, i2;
  for (i2 = 0; i2 < sourceKeys.length; i2++) {
    key = sourceKeys[i2];
    if (excluded.indexOf(key) >= 0)
      continue;
    target[key] = source[key];
  }
  return target;
}
function ownKeys36(e3, r3) {
  var t3 = Object.keys(e3);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e3);
    r3 && (o = o.filter(function(r4) {
      return Object.getOwnPropertyDescriptor(e3, r4).enumerable;
    })), t3.push.apply(t3, o);
  }
  return t3;
}
function _objectSpread36(e3) {
  for (var r3 = 1; r3 < arguments.length; r3++) {
    var t3 = null != arguments[r3] ? arguments[r3] : {};
    r3 % 2 ? ownKeys36(Object(t3), true).forEach(function(r4) {
      _defineProperty36(e3, r4, t3[r4]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e3, Object.getOwnPropertyDescriptors(t3)) : ownKeys36(Object(t3)).forEach(function(r4) {
      Object.defineProperty(e3, r4, Object.getOwnPropertyDescriptor(t3, r4));
    });
  }
  return e3;
}
function _classCallCheck14(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties14(target, props) {
  for (var i2 = 0; i2 < props.length; i2++) {
    var descriptor = props[i2];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor)
      descriptor.writable = true;
    Object.defineProperty(target, _toPropertyKey37(descriptor.key), descriptor);
  }
}
function _createClass14(Constructor, protoProps, staticProps) {
  if (protoProps)
    _defineProperties14(Constructor.prototype, protoProps);
  if (staticProps)
    _defineProperties14(Constructor, staticProps);
  Object.defineProperty(Constructor, "prototype", { writable: false });
  return Constructor;
}
function _inherits12(subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function");
  }
  subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
  Object.defineProperty(subClass, "prototype", { writable: false });
  if (superClass)
    _setPrototypeOf14(subClass, superClass);
}
function _setPrototypeOf14(o, p) {
  _setPrototypeOf14 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf19(o2, p2) {
    o2.__proto__ = p2;
    return o2;
  };
  return _setPrototypeOf14(o, p);
}
function _createSuper12(Derived) {
  var hasNativeReflectConstruct = _isNativeReflectConstruct13();
  return function _createSuperInternal() {
    var Super = _getPrototypeOf13(Derived), result;
    if (hasNativeReflectConstruct) {
      var NewTarget = _getPrototypeOf13(this).constructor;
      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }
    return _possibleConstructorReturn12(this, result);
  };
}
function _possibleConstructorReturn12(self2, call) {
  if (call && (_typeof41(call) === "object" || typeof call === "function")) {
    return call;
  } else if (call !== void 0) {
    throw new TypeError("Derived constructors may only return object or undefined");
  }
  return _assertThisInitialized14(self2);
}
function _assertThisInitialized14(self2) {
  if (self2 === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }
  return self2;
}
function _isNativeReflectConstruct13() {
  if (typeof Reflect === "undefined" || !Reflect.construct)
    return false;
  if (Reflect.construct.sham)
    return false;
  if (typeof Proxy === "function")
    return true;
  try {
    Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
    return true;
  } catch (e3) {
    return false;
  }
}
function _getPrototypeOf13(o) {
  _getPrototypeOf13 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf18(o2) {
    return o2.__proto__ || Object.getPrototypeOf(o2);
  };
  return _getPrototypeOf13(o);
}
function _defineProperty36(obj, key, value) {
  key = _toPropertyKey37(key);
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
function _toPropertyKey37(arg) {
  var key = _toPrimitive37(arg, "string");
  return _typeof41(key) === "symbol" ? key : String(key);
}
function _toPrimitive37(input, hint) {
  if (_typeof41(input) !== "object" || input === null)
    return input;
  var prim = input[Symbol.toPrimitive];
  if (prim !== void 0) {
    var res = prim.call(input, hint || "default");
    if (_typeof41(res) !== "object")
      return res;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (hint === "string" ? String : Number)(input);
}
var CartesianGrid = /* @__PURE__ */ function(_PureComponent) {
  _inherits12(CartesianGrid2, _PureComponent);
  var _super = _createSuper12(CartesianGrid2);
  function CartesianGrid2() {
    _classCallCheck14(this, CartesianGrid2);
    return _super.apply(this, arguments);
  }
  _createClass14(CartesianGrid2, [{
    key: "renderHorizontal",
    value: (
      /**
       * Draw the horizontal grid lines
       * @param {Array} horizontalPoints either passed in as props or generated from function
       * @return {Group} Horizontal lines
       */
      function renderHorizontal(horizontalPoints) {
        var _this = this;
        var _this$props = this.props, x2 = _this$props.x, width = _this$props.width, horizontal = _this$props.horizontal;
        if (!horizontalPoints || !horizontalPoints.length) {
          return null;
        }
        var items = horizontalPoints.map(function(entry, i2) {
          var props = _objectSpread36(_objectSpread36({}, _this.props), {}, {
            x1: x2,
            y1: entry,
            x2: x2 + width,
            y2: entry,
            key: "line-".concat(i2),
            index: i2
          });
          return CartesianGrid2.renderLineItem(horizontal, props);
        });
        return /* @__PURE__ */ import_react112.default.createElement("g", {
          className: "recharts-cartesian-grid-horizontal"
        }, items);
      }
    )
    /**
     * Draw vertical grid lines
     * @param {Array} verticalPoints either passed in as props or generated from function
     * @return {Group} Vertical lines
     */
  }, {
    key: "renderVertical",
    value: function renderVertical(verticalPoints) {
      var _this2 = this;
      var _this$props2 = this.props, y2 = _this$props2.y, height = _this$props2.height, vertical = _this$props2.vertical;
      if (!verticalPoints || !verticalPoints.length) {
        return null;
      }
      var items = verticalPoints.map(function(entry, i2) {
        var props = _objectSpread36(_objectSpread36({}, _this2.props), {}, {
          x1: entry,
          y1: y2,
          x2: entry,
          y2: y2 + height,
          key: "line-".concat(i2),
          index: i2
        });
        return CartesianGrid2.renderLineItem(vertical, props);
      });
      return /* @__PURE__ */ import_react112.default.createElement("g", {
        className: "recharts-cartesian-grid-vertical"
      }, items);
    }
    /**
     * Draw vertical grid stripes filled by colors
     * @param {Array} verticalPoints either passed in as props or generated from function
     * @return {Group} Vertical stripes
     */
  }, {
    key: "renderVerticalStripes",
    value: function renderVerticalStripes(verticalPoints) {
      var verticalFill = this.props.verticalFill;
      if (!verticalFill || !verticalFill.length) {
        return null;
      }
      var _this$props3 = this.props, fillOpacity = _this$props3.fillOpacity, x2 = _this$props3.x, y2 = _this$props3.y, width = _this$props3.width, height = _this$props3.height;
      var roundedSortedVerticalPoints = verticalPoints.map(function(e3) {
        return Math.round(e3 + x2 - x2);
      }).sort(function(a2, b) {
        return a2 - b;
      });
      if (x2 !== roundedSortedVerticalPoints[0]) {
        roundedSortedVerticalPoints.unshift(0);
      }
      var items = roundedSortedVerticalPoints.map(function(entry, i2) {
        var lastStripe = !roundedSortedVerticalPoints[i2 + 1];
        var lineWidth2 = lastStripe ? x2 + width - entry : roundedSortedVerticalPoints[i2 + 1] - entry;
        if (lineWidth2 <= 0) {
          return null;
        }
        var colorIndex = i2 % verticalFill.length;
        return /* @__PURE__ */ import_react112.default.createElement("rect", {
          key: "react-".concat(i2),
          x: entry,
          y: y2,
          width: lineWidth2,
          height,
          stroke: "none",
          fill: verticalFill[colorIndex],
          fillOpacity,
          className: "recharts-cartesian-grid-bg"
        });
      });
      return /* @__PURE__ */ import_react112.default.createElement("g", {
        className: "recharts-cartesian-gridstripes-vertical"
      }, items);
    }
    /**
     * Draw horizontal grid stripes filled by colors
     * @param {Array} horizontalPoints either passed in as props or generated from function
     * @return {Group} Horizontal stripes
     */
  }, {
    key: "renderHorizontalStripes",
    value: function renderHorizontalStripes(horizontalPoints) {
      var horizontalFill = this.props.horizontalFill;
      if (!horizontalFill || !horizontalFill.length) {
        return null;
      }
      var _this$props4 = this.props, fillOpacity = _this$props4.fillOpacity, x2 = _this$props4.x, y2 = _this$props4.y, width = _this$props4.width, height = _this$props4.height;
      var roundedSortedHorizontalPoints = horizontalPoints.map(function(e3) {
        return Math.round(e3 + y2 - y2);
      }).sort(function(a2, b) {
        return a2 - b;
      });
      if (y2 !== roundedSortedHorizontalPoints[0]) {
        roundedSortedHorizontalPoints.unshift(0);
      }
      var items = roundedSortedHorizontalPoints.map(function(entry, i2) {
        var lastStripe = !roundedSortedHorizontalPoints[i2 + 1];
        var lineHeight = lastStripe ? y2 + height - entry : roundedSortedHorizontalPoints[i2 + 1] - entry;
        if (lineHeight <= 0) {
          return null;
        }
        var colorIndex = i2 % horizontalFill.length;
        return /* @__PURE__ */ import_react112.default.createElement("rect", {
          key: "react-".concat(i2),
          y: entry,
          x: x2,
          height: lineHeight,
          width,
          stroke: "none",
          fill: horizontalFill[colorIndex],
          fillOpacity,
          className: "recharts-cartesian-grid-bg"
        });
      });
      return /* @__PURE__ */ import_react112.default.createElement("g", {
        className: "recharts-cartesian-gridstripes-horizontal"
      }, items);
    }
  }, {
    key: "renderBackground",
    value: function renderBackground() {
      var fill = this.props.fill;
      if (!fill || fill === "none") {
        return null;
      }
      var _this$props5 = this.props, fillOpacity = _this$props5.fillOpacity, x2 = _this$props5.x, y2 = _this$props5.y, width = _this$props5.width, height = _this$props5.height;
      return /* @__PURE__ */ import_react112.default.createElement("rect", {
        x: x2,
        y: y2,
        width,
        height,
        stroke: "none",
        fill,
        fillOpacity,
        className: "recharts-cartesian-grid-bg"
      });
    }
  }, {
    key: "render",
    value: function render2() {
      var _this$props6 = this.props, x2 = _this$props6.x, y2 = _this$props6.y, width = _this$props6.width, height = _this$props6.height, horizontal = _this$props6.horizontal, vertical = _this$props6.vertical, horizontalCoordinatesGenerator = _this$props6.horizontalCoordinatesGenerator, verticalCoordinatesGenerator = _this$props6.verticalCoordinatesGenerator, xAxis = _this$props6.xAxis, yAxis = _this$props6.yAxis, offset = _this$props6.offset, chartWidth = _this$props6.chartWidth, chartHeight = _this$props6.chartHeight, syncWithTicks = _this$props6.syncWithTicks, horizontalValues = _this$props6.horizontalValues, verticalValues = _this$props6.verticalValues;
      if (!isNumber(width) || width <= 0 || !isNumber(height) || height <= 0 || !isNumber(x2) || x2 !== +x2 || !isNumber(y2) || y2 !== +y2) {
        return null;
      }
      var _this$props7 = this.props, horizontalPoints = _this$props7.horizontalPoints, verticalPoints = _this$props7.verticalPoints;
      if ((!horizontalPoints || !horizontalPoints.length) && (0, import_isFunction19.default)(horizontalCoordinatesGenerator)) {
        var isHorizontalValues = horizontalValues && horizontalValues.length;
        horizontalPoints = horizontalCoordinatesGenerator({
          yAxis: yAxis ? _objectSpread36(_objectSpread36({}, yAxis), {}, {
            ticks: isHorizontalValues ? horizontalValues : yAxis.ticks
          }) : void 0,
          width: chartWidth,
          height: chartHeight,
          offset
        }, isHorizontalValues ? true : syncWithTicks);
      }
      if ((!verticalPoints || !verticalPoints.length) && (0, import_isFunction19.default)(verticalCoordinatesGenerator)) {
        var isVerticalValues = verticalValues && verticalValues.length;
        verticalPoints = verticalCoordinatesGenerator({
          xAxis: xAxis ? _objectSpread36(_objectSpread36({}, xAxis), {}, {
            ticks: isVerticalValues ? verticalValues : xAxis.ticks
          }) : void 0,
          width: chartWidth,
          height: chartHeight,
          offset
        }, isVerticalValues ? true : syncWithTicks);
      }
      return /* @__PURE__ */ import_react112.default.createElement("g", {
        className: "recharts-cartesian-grid"
      }, this.renderBackground(), horizontal && this.renderHorizontal(horizontalPoints), vertical && this.renderVertical(verticalPoints), horizontal && this.renderHorizontalStripes(horizontalPoints), vertical && this.renderVerticalStripes(verticalPoints));
    }
  }], [{
    key: "renderLineItem",
    value: function renderLineItem(option, props) {
      var lineItem;
      if (/* @__PURE__ */ import_react112.default.isValidElement(option)) {
        lineItem = /* @__PURE__ */ import_react112.default.cloneElement(option, props);
      } else if ((0, import_isFunction19.default)(option)) {
        lineItem = option(props);
      } else {
        var x1 = props.x1, y1 = props.y1, x2 = props.x2, y2 = props.y2, key = props.key, others = _objectWithoutProperties19(props, _excluded29);
        var _filterProps = filterProps(others), __ = _filterProps.offset, restOfFilteredProps = _objectWithoutProperties19(_filterProps, _excluded210);
        lineItem = /* @__PURE__ */ import_react112.default.createElement("line", _extends35({}, restOfFilteredProps, {
          x1,
          y1,
          x2,
          y2,
          fill: "none",
          key
        }));
      }
      return lineItem;
    }
  }]);
  return CartesianGrid2;
}(import_react112.PureComponent);
_defineProperty36(CartesianGrid, "displayName", "CartesianGrid");
_defineProperty36(CartesianGrid, "defaultProps", {
  horizontal: true,
  vertical: true,
  // The ordinates of horizontal grid lines
  horizontalPoints: [],
  // The abscissas of vertical grid lines
  verticalPoints: [],
  stroke: "#ccc",
  fill: "none",
  // The fill of colors of grid lines
  verticalFill: [],
  horizontalFill: []
});

// node_modules/recharts/es6/cartesian/Line.js
var import_isEqual5 = __toESM(require_isEqual());
var import_isFunction20 = __toESM(require_isFunction());
var import_isNil11 = __toESM(require_isNil());
var import_react113 = __toESM(require_react());
var import_classnames24 = __toESM(require_classnames());
var _excluded30 = ["type", "layout", "connectNulls", "ref"];
function _typeof42(o) {
  "@babel/helpers - typeof";
  return _typeof42 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
    return typeof o2;
  } : function(o2) {
    return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
  }, _typeof42(o);
}
function _objectWithoutProperties20(source, excluded) {
  if (source == null)
    return {};
  var target = _objectWithoutPropertiesLoose24(source, excluded);
  var key, i2;
  if (Object.getOwnPropertySymbols) {
    var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
    for (i2 = 0; i2 < sourceSymbolKeys.length; i2++) {
      key = sourceSymbolKeys[i2];
      if (excluded.indexOf(key) >= 0)
        continue;
      if (!Object.prototype.propertyIsEnumerable.call(source, key))
        continue;
      target[key] = source[key];
    }
  }
  return target;
}
function _objectWithoutPropertiesLoose24(source, excluded) {
  if (source == null)
    return {};
  var target = {};
  var sourceKeys = Object.keys(source);
  var key, i2;
  for (i2 = 0; i2 < sourceKeys.length; i2++) {
    key = sourceKeys[i2];
    if (excluded.indexOf(key) >= 0)
      continue;
    target[key] = source[key];
  }
  return target;
}
function _extends36() {
  _extends36 = Object.assign ? Object.assign.bind() : function(target) {
    for (var i2 = 1; i2 < arguments.length; i2++) {
      var source = arguments[i2];
      for (var key in source) {
        if (Object.prototype.hasOwnProperty.call(source, key)) {
          target[key] = source[key];
        }
      }
    }
    return target;
  };
  return _extends36.apply(this, arguments);
}
function ownKeys37(e3, r3) {
  var t3 = Object.keys(e3);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e3);
    r3 && (o = o.filter(function(r4) {
      return Object.getOwnPropertyDescriptor(e3, r4).enumerable;
    })), t3.push.apply(t3, o);
  }
  return t3;
}
function _objectSpread37(e3) {
  for (var r3 = 1; r3 < arguments.length; r3++) {
    var t3 = null != arguments[r3] ? arguments[r3] : {};
    r3 % 2 ? ownKeys37(Object(t3), true).forEach(function(r4) {
      _defineProperty37(e3, r4, t3[r4]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e3, Object.getOwnPropertyDescriptors(t3)) : ownKeys37(Object(t3)).forEach(function(r4) {
      Object.defineProperty(e3, r4, Object.getOwnPropertyDescriptor(t3, r4));
    });
  }
  return e3;
}
function _toConsumableArray11(arr) {
  return _arrayWithoutHoles11(arr) || _iterableToArray12(arr) || _unsupportedIterableToArray22(arr) || _nonIterableSpread11();
}
function _nonIterableSpread11() {
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _unsupportedIterableToArray22(o, minLen) {
  if (!o)
    return;
  if (typeof o === "string")
    return _arrayLikeToArray22(o, minLen);
  var n2 = Object.prototype.toString.call(o).slice(8, -1);
  if (n2 === "Object" && o.constructor)
    n2 = o.constructor.name;
  if (n2 === "Map" || n2 === "Set")
    return Array.from(o);
  if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2))
    return _arrayLikeToArray22(o, minLen);
}
function _iterableToArray12(iter) {
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
    return Array.from(iter);
}
function _arrayWithoutHoles11(arr) {
  if (Array.isArray(arr))
    return _arrayLikeToArray22(arr);
}
function _arrayLikeToArray22(arr, len) {
  if (len == null || len > arr.length)
    len = arr.length;
  for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++)
    arr2[i2] = arr[i2];
  return arr2;
}
function _classCallCheck15(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties15(target, props) {
  for (var i2 = 0; i2 < props.length; i2++) {
    var descriptor = props[i2];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor)
      descriptor.writable = true;
    Object.defineProperty(target, _toPropertyKey38(descriptor.key), descriptor);
  }
}
function _createClass15(Constructor, protoProps, staticProps) {
  if (protoProps)
    _defineProperties15(Constructor.prototype, protoProps);
  if (staticProps)
    _defineProperties15(Constructor, staticProps);
  Object.defineProperty(Constructor, "prototype", { writable: false });
  return Constructor;
}
function _inherits13(subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function");
  }
  subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
  Object.defineProperty(subClass, "prototype", { writable: false });
  if (superClass)
    _setPrototypeOf15(subClass, superClass);
}
function _setPrototypeOf15(o, p) {
  _setPrototypeOf15 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf19(o2, p2) {
    o2.__proto__ = p2;
    return o2;
  };
  return _setPrototypeOf15(o, p);
}
function _createSuper13(Derived) {
  var hasNativeReflectConstruct = _isNativeReflectConstruct14();
  return function _createSuperInternal() {
    var Super = _getPrototypeOf14(Derived), result;
    if (hasNativeReflectConstruct) {
      var NewTarget = _getPrototypeOf14(this).constructor;
      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }
    return _possibleConstructorReturn13(this, result);
  };
}
function _possibleConstructorReturn13(self2, call) {
  if (call && (_typeof42(call) === "object" || typeof call === "function")) {
    return call;
  } else if (call !== void 0) {
    throw new TypeError("Derived constructors may only return object or undefined");
  }
  return _assertThisInitialized15(self2);
}
function _assertThisInitialized15(self2) {
  if (self2 === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }
  return self2;
}
function _isNativeReflectConstruct14() {
  if (typeof Reflect === "undefined" || !Reflect.construct)
    return false;
  if (Reflect.construct.sham)
    return false;
  if (typeof Proxy === "function")
    return true;
  try {
    Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
    return true;
  } catch (e3) {
    return false;
  }
}
function _getPrototypeOf14(o) {
  _getPrototypeOf14 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf18(o2) {
    return o2.__proto__ || Object.getPrototypeOf(o2);
  };
  return _getPrototypeOf14(o);
}
function _defineProperty37(obj, key, value) {
  key = _toPropertyKey38(key);
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
function _toPropertyKey38(arg) {
  var key = _toPrimitive38(arg, "string");
  return _typeof42(key) === "symbol" ? key : String(key);
}
function _toPrimitive38(input, hint) {
  if (_typeof42(input) !== "object" || input === null)
    return input;
  var prim = input[Symbol.toPrimitive];
  if (prim !== void 0) {
    var res = prim.call(input, hint || "default");
    if (_typeof42(res) !== "object")
      return res;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (hint === "string" ? String : Number)(input);
}
var Line7 = /* @__PURE__ */ function(_PureComponent) {
  _inherits13(Line8, _PureComponent);
  var _super = _createSuper13(Line8);
  function Line8() {
    var _this;
    _classCallCheck15(this, Line8);
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    _this = _super.call.apply(_super, [this].concat(args));
    _defineProperty37(_assertThisInitialized15(_this), "state", {
      isAnimationFinished: true,
      totalLength: 0
    });
    _defineProperty37(_assertThisInitialized15(_this), "generateSimpleStrokeDasharray", function(totalLength, length2) {
      return "".concat(length2, "px ").concat(totalLength - length2, "px");
    });
    _defineProperty37(_assertThisInitialized15(_this), "getStrokeDasharray", function(length2, totalLength, lines) {
      var lineLength = lines.reduce(function(pre, next2) {
        return pre + next2;
      });
      if (!lineLength) {
        return _this.generateSimpleStrokeDasharray(totalLength, length2);
      }
      var count2 = Math.floor(length2 / lineLength);
      var remainLength = length2 % lineLength;
      var restLength = totalLength - length2;
      var remainLines = [];
      for (var i2 = 0, sum2 = 0; i2 < lines.length; sum2 += lines[i2], ++i2) {
        if (sum2 + lines[i2] > remainLength) {
          remainLines = [].concat(_toConsumableArray11(lines.slice(0, i2)), [remainLength - sum2]);
          break;
        }
      }
      var emptyLines = remainLines.length % 2 === 0 ? [0, restLength] : [restLength];
      return [].concat(_toConsumableArray11(Line8.repeat(lines, count2)), _toConsumableArray11(remainLines), emptyLines).map(function(line2) {
        return "".concat(line2, "px");
      }).join(", ");
    });
    _defineProperty37(_assertThisInitialized15(_this), "id", uniqueId("recharts-line-"));
    _defineProperty37(_assertThisInitialized15(_this), "pathRef", function(node56) {
      _this.mainCurve = node56;
    });
    _defineProperty37(_assertThisInitialized15(_this), "handleAnimationEnd", function() {
      _this.setState({
        isAnimationFinished: true
      });
      if (_this.props.onAnimationEnd) {
        _this.props.onAnimationEnd();
      }
    });
    _defineProperty37(_assertThisInitialized15(_this), "handleAnimationStart", function() {
      _this.setState({
        isAnimationFinished: false
      });
      if (_this.props.onAnimationStart) {
        _this.props.onAnimationStart();
      }
    });
    return _this;
  }
  _createClass15(Line8, [{
    key: "componentDidMount",
    value: function componentDidMount() {
      if (!this.props.isAnimationActive) {
        return;
      }
      var totalLength = this.getTotalLength();
      this.setState({
        totalLength
      });
    }
  }, {
    key: "getTotalLength",
    value: function getTotalLength() {
      var curveDom = this.mainCurve;
      try {
        return curveDom && curveDom.getTotalLength && curveDom.getTotalLength() || 0;
      } catch (err) {
        return 0;
      }
    }
  }, {
    key: "renderErrorBar",
    value: function renderErrorBar(needClip, clipPathId) {
      if (this.props.isAnimationActive && !this.state.isAnimationFinished) {
        return null;
      }
      var _this$props = this.props, points = _this$props.points, xAxis = _this$props.xAxis, yAxis = _this$props.yAxis, layout = _this$props.layout, children = _this$props.children;
      var errorBarItems = findAllByType(children, ErrorBar);
      if (!errorBarItems) {
        return null;
      }
      var dataPointFormatter = function dataPointFormatter2(dataPoint, dataKey) {
        return {
          x: dataPoint.x,
          y: dataPoint.y,
          value: dataPoint.value,
          errorVal: getValueByDataKey(dataPoint.payload, dataKey)
        };
      };
      var errorBarProps = {
        clipPath: needClip ? "url(#clipPath-".concat(clipPathId, ")") : null
      };
      return /* @__PURE__ */ import_react113.default.createElement(Layer, errorBarProps, errorBarItems.map(function(item, i2) {
        return /* @__PURE__ */ import_react113.default.cloneElement(item, {
          // eslint-disable-next-line react/no-array-index-key
          key: "bar-".concat(i2),
          data: points,
          xAxis,
          yAxis,
          layout,
          dataPointFormatter
        });
      }));
    }
  }, {
    key: "renderDots",
    value: function renderDots(needClip, clipDot, clipPathId) {
      var isAnimationActive = this.props.isAnimationActive;
      if (isAnimationActive && !this.state.isAnimationFinished) {
        return null;
      }
      var _this$props2 = this.props, dot2 = _this$props2.dot, points = _this$props2.points, dataKey = _this$props2.dataKey;
      var lineProps = filterProps(this.props);
      var customDotProps = filterProps(dot2, true);
      var dots = points.map(function(entry, i2) {
        var dotProps = _objectSpread37(_objectSpread37(_objectSpread37({
          key: "dot-".concat(i2),
          r: 3
        }, lineProps), customDotProps), {}, {
          value: entry.value,
          dataKey,
          cx: entry.x,
          cy: entry.y,
          index: i2,
          payload: entry.payload
        });
        return Line8.renderDotItem(dot2, dotProps);
      });
      var dotsProps = {
        clipPath: needClip ? "url(#clipPath-".concat(clipDot ? "" : "dots-").concat(clipPathId, ")") : null
      };
      return /* @__PURE__ */ import_react113.default.createElement(Layer, _extends36({
        className: "recharts-line-dots",
        key: "dots"
      }, dotsProps), dots);
    }
  }, {
    key: "renderCurveStatically",
    value: function renderCurveStatically(points, needClip, clipPathId, props) {
      var _this$props3 = this.props, type = _this$props3.type, layout = _this$props3.layout, connectNulls = _this$props3.connectNulls, ref = _this$props3.ref, others = _objectWithoutProperties20(_this$props3, _excluded30);
      var curveProps = _objectSpread37(_objectSpread37(_objectSpread37({}, filterProps(others, true)), {}, {
        fill: "none",
        className: "recharts-line-curve",
        clipPath: needClip ? "url(#clipPath-".concat(clipPathId, ")") : null,
        points
      }, props), {}, {
        type,
        layout,
        connectNulls
      });
      return /* @__PURE__ */ import_react113.default.createElement(Curve2, _extends36({}, curveProps, {
        pathRef: this.pathRef
      }));
    }
  }, {
    key: "renderCurveWithAnimation",
    value: function renderCurveWithAnimation(needClip, clipPathId) {
      var _this2 = this;
      var _this$props4 = this.props, points = _this$props4.points, strokeDasharray = _this$props4.strokeDasharray, isAnimationActive = _this$props4.isAnimationActive, animationBegin = _this$props4.animationBegin, animationDuration = _this$props4.animationDuration, animationEasing = _this$props4.animationEasing, animationId = _this$props4.animationId, animateNewValues = _this$props4.animateNewValues, width = _this$props4.width, height = _this$props4.height;
      var _this$state = this.state, prevPoints = _this$state.prevPoints, totalLength = _this$state.totalLength;
      return /* @__PURE__ */ import_react113.default.createElement(es6_default, {
        begin: animationBegin,
        duration: animationDuration,
        isActive: isAnimationActive,
        easing: animationEasing,
        from: {
          t: 0
        },
        to: {
          t: 1
        },
        key: "line-".concat(animationId),
        onAnimationEnd: this.handleAnimationEnd,
        onAnimationStart: this.handleAnimationStart
      }, function(_ref18) {
        var t3 = _ref18.t;
        if (prevPoints) {
          var prevPointsDiffFactor = prevPoints.length / points.length;
          var stepData = points.map(function(entry, index) {
            var prevPointIndex = Math.floor(index * prevPointsDiffFactor);
            if (prevPoints[prevPointIndex]) {
              var prev2 = prevPoints[prevPointIndex];
              var interpolatorX = interpolateNumber(prev2.x, entry.x);
              var interpolatorY = interpolateNumber(prev2.y, entry.y);
              return _objectSpread37(_objectSpread37({}, entry), {}, {
                x: interpolatorX(t3),
                y: interpolatorY(t3)
              });
            }
            if (animateNewValues) {
              var _interpolatorX = interpolateNumber(width * 2, entry.x);
              var _interpolatorY = interpolateNumber(height / 2, entry.y);
              return _objectSpread37(_objectSpread37({}, entry), {}, {
                x: _interpolatorX(t3),
                y: _interpolatorY(t3)
              });
            }
            return _objectSpread37(_objectSpread37({}, entry), {}, {
              x: entry.x,
              y: entry.y
            });
          });
          return _this2.renderCurveStatically(stepData, needClip, clipPathId);
        }
        var interpolator = interpolateNumber(0, totalLength);
        var curLength = interpolator(t3);
        var currentStrokeDasharray;
        if (strokeDasharray) {
          var lines = "".concat(strokeDasharray).split(/[,\s]+/gim).map(function(num) {
            return parseFloat(num);
          });
          currentStrokeDasharray = _this2.getStrokeDasharray(curLength, totalLength, lines);
        } else {
          currentStrokeDasharray = _this2.generateSimpleStrokeDasharray(totalLength, curLength);
        }
        return _this2.renderCurveStatically(points, needClip, clipPathId, {
          strokeDasharray: currentStrokeDasharray
        });
      });
    }
  }, {
    key: "renderCurve",
    value: function renderCurve(needClip, clipPathId) {
      var _this$props5 = this.props, points = _this$props5.points, isAnimationActive = _this$props5.isAnimationActive;
      var _this$state2 = this.state, prevPoints = _this$state2.prevPoints, totalLength = _this$state2.totalLength;
      if (isAnimationActive && points && points.length && (!prevPoints && totalLength > 0 || !(0, import_isEqual5.default)(prevPoints, points))) {
        return this.renderCurveWithAnimation(needClip, clipPathId);
      }
      return this.renderCurveStatically(points, needClip, clipPathId);
    }
  }, {
    key: "render",
    value: function render2() {
      var _filterProps;
      var _this$props6 = this.props, hide = _this$props6.hide, dot2 = _this$props6.dot, points = _this$props6.points, className = _this$props6.className, xAxis = _this$props6.xAxis, yAxis = _this$props6.yAxis, top2 = _this$props6.top, left = _this$props6.left, width = _this$props6.width, height = _this$props6.height, isAnimationActive = _this$props6.isAnimationActive, id2 = _this$props6.id;
      if (hide || !points || !points.length) {
        return null;
      }
      var isAnimationFinished = this.state.isAnimationFinished;
      var hasSinglePoint = points.length === 1;
      var layerClass = (0, import_classnames24.default)("recharts-line", className);
      var needClipX = xAxis && xAxis.allowDataOverflow;
      var needClipY = yAxis && yAxis.allowDataOverflow;
      var needClip = needClipX || needClipY;
      var clipPathId = (0, import_isNil11.default)(id2) ? this.id : id2;
      var _ref22 = (_filterProps = filterProps(dot2)) !== null && _filterProps !== void 0 ? _filterProps : {
        r: 3,
        strokeWidth: 2
      }, _ref2$r = _ref22.r, r3 = _ref2$r === void 0 ? 3 : _ref2$r, _ref2$strokeWidth = _ref22.strokeWidth, strokeWidth = _ref2$strokeWidth === void 0 ? 2 : _ref2$strokeWidth;
      var _ref32 = isDotProps(dot2) ? dot2 : {}, _ref3$clipDot = _ref32.clipDot, clipDot = _ref3$clipDot === void 0 ? true : _ref3$clipDot;
      var dotSize = r3 * 2 + strokeWidth;
      return /* @__PURE__ */ import_react113.default.createElement(Layer, {
        className: layerClass
      }, needClipX || needClipY ? /* @__PURE__ */ import_react113.default.createElement("defs", null, /* @__PURE__ */ import_react113.default.createElement("clipPath", {
        id: "clipPath-".concat(clipPathId)
      }, /* @__PURE__ */ import_react113.default.createElement("rect", {
        x: needClipX ? left : left - width / 2,
        y: needClipY ? top2 : top2 - height / 2,
        width: needClipX ? width : width * 2,
        height: needClipY ? height : height * 2
      })), !clipDot && /* @__PURE__ */ import_react113.default.createElement("clipPath", {
        id: "clipPath-dots-".concat(clipPathId)
      }, /* @__PURE__ */ import_react113.default.createElement("rect", {
        x: left - dotSize / 2,
        y: top2 - dotSize / 2,
        width: width + dotSize,
        height: height + dotSize
      }))) : null, !hasSinglePoint && this.renderCurve(needClip, clipPathId), this.renderErrorBar(needClip, clipPathId), (hasSinglePoint || dot2) && this.renderDots(needClip, clipDot, clipPathId), (!isAnimationActive || isAnimationFinished) && LabelList.renderCallByParent(this.props, points));
    }
  }], [{
    key: "getDerivedStateFromProps",
    value: function getDerivedStateFromProps(nextProps, prevState) {
      if (nextProps.animationId !== prevState.prevAnimationId) {
        return {
          prevAnimationId: nextProps.animationId,
          curPoints: nextProps.points,
          prevPoints: prevState.curPoints
        };
      }
      if (nextProps.points !== prevState.curPoints) {
        return {
          curPoints: nextProps.points
        };
      }
      return null;
    }
  }, {
    key: "repeat",
    value: function repeat(lines, count2) {
      var linesUnit = lines.length % 2 !== 0 ? [].concat(_toConsumableArray11(lines), [0]) : lines;
      var result = [];
      for (var i2 = 0; i2 < count2; ++i2) {
        result = [].concat(_toConsumableArray11(result), _toConsumableArray11(linesUnit));
      }
      return result;
    }
  }, {
    key: "renderDotItem",
    value: function renderDotItem(option, props) {
      var dotItem;
      if (/* @__PURE__ */ import_react113.default.isValidElement(option)) {
        dotItem = /* @__PURE__ */ import_react113.default.cloneElement(option, props);
      } else if ((0, import_isFunction20.default)(option)) {
        dotItem = option(props);
      } else {
        var className = (0, import_classnames24.default)("recharts-line-dot", option ? option.className : "");
        dotItem = /* @__PURE__ */ import_react113.default.createElement(Dot, _extends36({}, props, {
          className
        }));
      }
      return dotItem;
    }
  }]);
  return Line8;
}(import_react113.PureComponent);
_defineProperty37(Line7, "displayName", "Line");
_defineProperty37(Line7, "defaultProps", {
  xAxisId: 0,
  yAxisId: 0,
  connectNulls: false,
  activeDot: true,
  dot: true,
  legendType: "line",
  stroke: "#3182bd",
  strokeWidth: 1,
  fill: "#fff",
  points: [],
  isAnimationActive: !Global2.isSsr,
  animateNewValues: true,
  animationBegin: 0,
  animationDuration: 1500,
  animationEasing: "ease",
  hide: false,
  label: false
});
_defineProperty37(Line7, "getComposedData", function(_ref42) {
  var props = _ref42.props, xAxis = _ref42.xAxis, yAxis = _ref42.yAxis, xAxisTicks = _ref42.xAxisTicks, yAxisTicks = _ref42.yAxisTicks, dataKey = _ref42.dataKey, bandSize = _ref42.bandSize, displayedData = _ref42.displayedData, offset = _ref42.offset;
  var layout = props.layout;
  var points = displayedData.map(function(entry, index) {
    var value = getValueByDataKey(entry, dataKey);
    if (layout === "horizontal") {
      return {
        x: getCateCoordinateOfLine({
          axis: xAxis,
          ticks: xAxisTicks,
          bandSize,
          entry,
          index
        }),
        y: (0, import_isNil11.default)(value) ? null : yAxis.scale(value),
        value,
        payload: entry
      };
    }
    return {
      x: (0, import_isNil11.default)(value) ? null : xAxis.scale(value),
      y: getCateCoordinateOfLine({
        axis: yAxis,
        ticks: yAxisTicks,
        bandSize,
        entry,
        index
      }),
      value,
      payload: entry
    };
  });
  return _objectSpread37({
    points,
    layout
  }, offset);
});

// node_modules/recharts/es6/cartesian/Area.js
var import_isEqual6 = __toESM(require_isEqual());
var import_isNaN3 = __toESM(require_isNaN());
var import_max3 = __toESM(require_max());
var import_isFunction21 = __toESM(require_isFunction());
var import_get6 = __toESM(require_get());
var import_isNil12 = __toESM(require_isNil());
var import_isArray8 = __toESM(require_isArray());
var import_react114 = __toESM(require_react());
var import_classnames25 = __toESM(require_classnames());
var _excluded31 = ["layout", "type", "stroke", "connectNulls", "isRange", "ref"];
var _class2;
function _typeof43(o) {
  "@babel/helpers - typeof";
  return _typeof43 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
    return typeof o2;
  } : function(o2) {
    return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
  }, _typeof43(o);
}
function _objectWithoutProperties21(source, excluded) {
  if (source == null)
    return {};
  var target = _objectWithoutPropertiesLoose25(source, excluded);
  var key, i2;
  if (Object.getOwnPropertySymbols) {
    var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
    for (i2 = 0; i2 < sourceSymbolKeys.length; i2++) {
      key = sourceSymbolKeys[i2];
      if (excluded.indexOf(key) >= 0)
        continue;
      if (!Object.prototype.propertyIsEnumerable.call(source, key))
        continue;
      target[key] = source[key];
    }
  }
  return target;
}
function _objectWithoutPropertiesLoose25(source, excluded) {
  if (source == null)
    return {};
  var target = {};
  var sourceKeys = Object.keys(source);
  var key, i2;
  for (i2 = 0; i2 < sourceKeys.length; i2++) {
    key = sourceKeys[i2];
    if (excluded.indexOf(key) >= 0)
      continue;
    target[key] = source[key];
  }
  return target;
}
function _extends37() {
  _extends37 = Object.assign ? Object.assign.bind() : function(target) {
    for (var i2 = 1; i2 < arguments.length; i2++) {
      var source = arguments[i2];
      for (var key in source) {
        if (Object.prototype.hasOwnProperty.call(source, key)) {
          target[key] = source[key];
        }
      }
    }
    return target;
  };
  return _extends37.apply(this, arguments);
}
function ownKeys38(e3, r3) {
  var t3 = Object.keys(e3);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e3);
    r3 && (o = o.filter(function(r4) {
      return Object.getOwnPropertyDescriptor(e3, r4).enumerable;
    })), t3.push.apply(t3, o);
  }
  return t3;
}
function _objectSpread38(e3) {
  for (var r3 = 1; r3 < arguments.length; r3++) {
    var t3 = null != arguments[r3] ? arguments[r3] : {};
    r3 % 2 ? ownKeys38(Object(t3), true).forEach(function(r4) {
      _defineProperty38(e3, r4, t3[r4]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e3, Object.getOwnPropertyDescriptors(t3)) : ownKeys38(Object(t3)).forEach(function(r4) {
      Object.defineProperty(e3, r4, Object.getOwnPropertyDescriptor(t3, r4));
    });
  }
  return e3;
}
function _classCallCheck16(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties16(target, props) {
  for (var i2 = 0; i2 < props.length; i2++) {
    var descriptor = props[i2];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor)
      descriptor.writable = true;
    Object.defineProperty(target, _toPropertyKey39(descriptor.key), descriptor);
  }
}
function _createClass16(Constructor, protoProps, staticProps) {
  if (protoProps)
    _defineProperties16(Constructor.prototype, protoProps);
  if (staticProps)
    _defineProperties16(Constructor, staticProps);
  Object.defineProperty(Constructor, "prototype", { writable: false });
  return Constructor;
}
function _inherits14(subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function");
  }
  subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
  Object.defineProperty(subClass, "prototype", { writable: false });
  if (superClass)
    _setPrototypeOf16(subClass, superClass);
}
function _setPrototypeOf16(o, p) {
  _setPrototypeOf16 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf19(o2, p2) {
    o2.__proto__ = p2;
    return o2;
  };
  return _setPrototypeOf16(o, p);
}
function _createSuper14(Derived) {
  var hasNativeReflectConstruct = _isNativeReflectConstruct15();
  return function _createSuperInternal() {
    var Super = _getPrototypeOf15(Derived), result;
    if (hasNativeReflectConstruct) {
      var NewTarget = _getPrototypeOf15(this).constructor;
      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }
    return _possibleConstructorReturn14(this, result);
  };
}
function _possibleConstructorReturn14(self2, call) {
  if (call && (_typeof43(call) === "object" || typeof call === "function")) {
    return call;
  } else if (call !== void 0) {
    throw new TypeError("Derived constructors may only return object or undefined");
  }
  return _assertThisInitialized16(self2);
}
function _assertThisInitialized16(self2) {
  if (self2 === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }
  return self2;
}
function _isNativeReflectConstruct15() {
  if (typeof Reflect === "undefined" || !Reflect.construct)
    return false;
  if (Reflect.construct.sham)
    return false;
  if (typeof Proxy === "function")
    return true;
  try {
    Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
    return true;
  } catch (e3) {
    return false;
  }
}
function _getPrototypeOf15(o) {
  _getPrototypeOf15 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf18(o2) {
    return o2.__proto__ || Object.getPrototypeOf(o2);
  };
  return _getPrototypeOf15(o);
}
function _defineProperty38(obj, key, value) {
  key = _toPropertyKey39(key);
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
function _toPropertyKey39(arg) {
  var key = _toPrimitive39(arg, "string");
  return _typeof43(key) === "symbol" ? key : String(key);
}
function _toPrimitive39(input, hint) {
  if (_typeof43(input) !== "object" || input === null)
    return input;
  var prim = input[Symbol.toPrimitive];
  if (prim !== void 0) {
    var res = prim.call(input, hint || "default");
    if (_typeof43(res) !== "object")
      return res;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (hint === "string" ? String : Number)(input);
}
var Area = /* @__PURE__ */ function(_PureComponent) {
  _inherits14(Area2, _PureComponent);
  var _super = _createSuper14(Area2);
  function Area2() {
    var _this;
    _classCallCheck16(this, Area2);
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    _this = _super.call.apply(_super, [this].concat(args));
    _defineProperty38(_assertThisInitialized16(_this), "state", {
      isAnimationFinished: true
    });
    _defineProperty38(_assertThisInitialized16(_this), "id", uniqueId("recharts-area-"));
    _defineProperty38(_assertThisInitialized16(_this), "handleAnimationEnd", function() {
      var onAnimationEnd2 = _this.props.onAnimationEnd;
      _this.setState({
        isAnimationFinished: true
      });
      if ((0, import_isFunction21.default)(onAnimationEnd2)) {
        onAnimationEnd2();
      }
    });
    _defineProperty38(_assertThisInitialized16(_this), "handleAnimationStart", function() {
      var onAnimationStart2 = _this.props.onAnimationStart;
      _this.setState({
        isAnimationFinished: false
      });
      if ((0, import_isFunction21.default)(onAnimationStart2)) {
        onAnimationStart2();
      }
    });
    return _this;
  }
  _createClass16(Area2, [{
    key: "renderDots",
    value: function renderDots(needClip, clipDot, clipPathId) {
      var isAnimationActive = this.props.isAnimationActive;
      var isAnimationFinished = this.state.isAnimationFinished;
      if (isAnimationActive && !isAnimationFinished) {
        return null;
      }
      var _this$props = this.props, dot2 = _this$props.dot, points = _this$props.points, dataKey = _this$props.dataKey;
      var areaProps = filterProps(this.props);
      var customDotProps = filterProps(dot2, true);
      var dots = points.map(function(entry, i2) {
        var dotProps = _objectSpread38(_objectSpread38(_objectSpread38({
          key: "dot-".concat(i2),
          r: 3
        }, areaProps), customDotProps), {}, {
          dataKey,
          cx: entry.x,
          cy: entry.y,
          index: i2,
          value: entry.value,
          payload: entry.payload
        });
        return Area2.renderDotItem(dot2, dotProps);
      });
      var dotsProps = {
        clipPath: needClip ? "url(#clipPath-".concat(clipDot ? "" : "dots-").concat(clipPathId, ")") : null
      };
      return /* @__PURE__ */ import_react114.default.createElement(Layer, _extends37({
        className: "recharts-area-dots"
      }, dotsProps), dots);
    }
  }, {
    key: "renderHorizontalRect",
    value: function renderHorizontalRect(alpha3) {
      var _this$props2 = this.props, baseLine = _this$props2.baseLine, points = _this$props2.points, strokeWidth = _this$props2.strokeWidth;
      var startX = points[0].x;
      var endX = points[points.length - 1].x;
      var width = alpha3 * Math.abs(startX - endX);
      var maxY = (0, import_max3.default)(points.map(function(entry) {
        return entry.y || 0;
      }));
      if (isNumber(baseLine) && typeof baseLine === "number") {
        maxY = Math.max(baseLine, maxY);
      } else if (baseLine && (0, import_isArray8.default)(baseLine) && baseLine.length) {
        maxY = Math.max((0, import_max3.default)(baseLine.map(function(entry) {
          return entry.y || 0;
        })), maxY);
      }
      if (isNumber(maxY)) {
        return /* @__PURE__ */ import_react114.default.createElement("rect", {
          x: startX < endX ? startX : startX - width,
          y: 0,
          width,
          height: Math.floor(maxY + (strokeWidth ? parseInt("".concat(strokeWidth), 10) : 1))
        });
      }
      return null;
    }
  }, {
    key: "renderVerticalRect",
    value: function renderVerticalRect(alpha3) {
      var _this$props3 = this.props, baseLine = _this$props3.baseLine, points = _this$props3.points, strokeWidth = _this$props3.strokeWidth;
      var startY = points[0].y;
      var endY = points[points.length - 1].y;
      var height = alpha3 * Math.abs(startY - endY);
      var maxX = (0, import_max3.default)(points.map(function(entry) {
        return entry.x || 0;
      }));
      if (isNumber(baseLine) && typeof baseLine === "number") {
        maxX = Math.max(baseLine, maxX);
      } else if (baseLine && (0, import_isArray8.default)(baseLine) && baseLine.length) {
        maxX = Math.max((0, import_max3.default)(baseLine.map(function(entry) {
          return entry.x || 0;
        })), maxX);
      }
      if (isNumber(maxX)) {
        return /* @__PURE__ */ import_react114.default.createElement("rect", {
          x: 0,
          y: startY < endY ? startY : startY - height,
          width: maxX + (strokeWidth ? parseInt("".concat(strokeWidth), 10) : 1),
          height: Math.floor(height)
        });
      }
      return null;
    }
  }, {
    key: "renderClipRect",
    value: function renderClipRect(alpha3) {
      var layout = this.props.layout;
      if (layout === "vertical") {
        return this.renderVerticalRect(alpha3);
      }
      return this.renderHorizontalRect(alpha3);
    }
  }, {
    key: "renderAreaStatically",
    value: function renderAreaStatically(points, baseLine, needClip, clipPathId) {
      var _this$props4 = this.props, layout = _this$props4.layout, type = _this$props4.type, stroke = _this$props4.stroke, connectNulls = _this$props4.connectNulls, isRange = _this$props4.isRange, ref = _this$props4.ref, others = _objectWithoutProperties21(_this$props4, _excluded31);
      return /* @__PURE__ */ import_react114.default.createElement(Layer, {
        clipPath: needClip ? "url(#clipPath-".concat(clipPathId, ")") : null
      }, /* @__PURE__ */ import_react114.default.createElement(Curve2, _extends37({}, filterProps(others, true), {
        points,
        connectNulls,
        type,
        baseLine,
        layout,
        stroke: "none",
        className: "recharts-area-area"
      })), stroke !== "none" && /* @__PURE__ */ import_react114.default.createElement(Curve2, _extends37({}, filterProps(this.props), {
        className: "recharts-area-curve",
        layout,
        type,
        connectNulls,
        fill: "none",
        points
      })), stroke !== "none" && isRange && /* @__PURE__ */ import_react114.default.createElement(Curve2, _extends37({}, filterProps(this.props), {
        className: "recharts-area-curve",
        layout,
        type,
        connectNulls,
        fill: "none",
        points: baseLine
      })));
    }
  }, {
    key: "renderAreaWithAnimation",
    value: function renderAreaWithAnimation(needClip, clipPathId) {
      var _this2 = this;
      var _this$props5 = this.props, points = _this$props5.points, baseLine = _this$props5.baseLine, isAnimationActive = _this$props5.isAnimationActive, animationBegin = _this$props5.animationBegin, animationDuration = _this$props5.animationDuration, animationEasing = _this$props5.animationEasing, animationId = _this$props5.animationId;
      var _this$state = this.state, prevPoints = _this$state.prevPoints, prevBaseLine = _this$state.prevBaseLine;
      return /* @__PURE__ */ import_react114.default.createElement(es6_default, {
        begin: animationBegin,
        duration: animationDuration,
        isActive: isAnimationActive,
        easing: animationEasing,
        from: {
          t: 0
        },
        to: {
          t: 1
        },
        key: "area-".concat(animationId),
        onAnimationEnd: this.handleAnimationEnd,
        onAnimationStart: this.handleAnimationStart
      }, function(_ref18) {
        var t3 = _ref18.t;
        if (prevPoints) {
          var prevPointsDiffFactor = prevPoints.length / points.length;
          var stepPoints = points.map(function(entry, index) {
            var prevPointIndex = Math.floor(index * prevPointsDiffFactor);
            if (prevPoints[prevPointIndex]) {
              var prev2 = prevPoints[prevPointIndex];
              var interpolatorX = interpolateNumber(prev2.x, entry.x);
              var interpolatorY = interpolateNumber(prev2.y, entry.y);
              return _objectSpread38(_objectSpread38({}, entry), {}, {
                x: interpolatorX(t3),
                y: interpolatorY(t3)
              });
            }
            return entry;
          });
          var stepBaseLine;
          if (isNumber(baseLine) && typeof baseLine === "number") {
            var interpolator = interpolateNumber(prevBaseLine, baseLine);
            stepBaseLine = interpolator(t3);
          } else if ((0, import_isNil12.default)(baseLine) || (0, import_isNaN3.default)(baseLine)) {
            var _interpolator = interpolateNumber(prevBaseLine, 0);
            stepBaseLine = _interpolator(t3);
          } else {
            stepBaseLine = baseLine.map(function(entry, index) {
              var prevPointIndex = Math.floor(index * prevPointsDiffFactor);
              if (prevBaseLine[prevPointIndex]) {
                var prev2 = prevBaseLine[prevPointIndex];
                var interpolatorX = interpolateNumber(prev2.x, entry.x);
                var interpolatorY = interpolateNumber(prev2.y, entry.y);
                return _objectSpread38(_objectSpread38({}, entry), {}, {
                  x: interpolatorX(t3),
                  y: interpolatorY(t3)
                });
              }
              return entry;
            });
          }
          return _this2.renderAreaStatically(stepPoints, stepBaseLine, needClip, clipPathId);
        }
        return /* @__PURE__ */ import_react114.default.createElement(Layer, null, /* @__PURE__ */ import_react114.default.createElement("defs", null, /* @__PURE__ */ import_react114.default.createElement("clipPath", {
          id: "animationClipPath-".concat(clipPathId)
        }, _this2.renderClipRect(t3))), /* @__PURE__ */ import_react114.default.createElement(Layer, {
          clipPath: "url(#animationClipPath-".concat(clipPathId, ")")
        }, _this2.renderAreaStatically(points, baseLine, needClip, clipPathId)));
      });
    }
  }, {
    key: "renderArea",
    value: function renderArea(needClip, clipPathId) {
      var _this$props6 = this.props, points = _this$props6.points, baseLine = _this$props6.baseLine, isAnimationActive = _this$props6.isAnimationActive;
      var _this$state2 = this.state, prevPoints = _this$state2.prevPoints, prevBaseLine = _this$state2.prevBaseLine, totalLength = _this$state2.totalLength;
      if (isAnimationActive && points && points.length && (!prevPoints && totalLength > 0 || !(0, import_isEqual6.default)(prevPoints, points) || !(0, import_isEqual6.default)(prevBaseLine, baseLine))) {
        return this.renderAreaWithAnimation(needClip, clipPathId);
      }
      return this.renderAreaStatically(points, baseLine, needClip, clipPathId);
    }
  }, {
    key: "render",
    value: function render2() {
      var _filterProps;
      var _this$props7 = this.props, hide = _this$props7.hide, dot2 = _this$props7.dot, points = _this$props7.points, className = _this$props7.className, top2 = _this$props7.top, left = _this$props7.left, xAxis = _this$props7.xAxis, yAxis = _this$props7.yAxis, width = _this$props7.width, height = _this$props7.height, isAnimationActive = _this$props7.isAnimationActive, id2 = _this$props7.id;
      if (hide || !points || !points.length) {
        return null;
      }
      var isAnimationFinished = this.state.isAnimationFinished;
      var hasSinglePoint = points.length === 1;
      var layerClass = (0, import_classnames25.default)("recharts-area", className);
      var needClipX = xAxis && xAxis.allowDataOverflow;
      var needClipY = yAxis && yAxis.allowDataOverflow;
      var needClip = needClipX || needClipY;
      var clipPathId = (0, import_isNil12.default)(id2) ? this.id : id2;
      var _ref22 = (_filterProps = filterProps(dot2)) !== null && _filterProps !== void 0 ? _filterProps : {
        r: 3,
        strokeWidth: 2
      }, _ref2$r = _ref22.r, r3 = _ref2$r === void 0 ? 3 : _ref2$r, _ref2$strokeWidth = _ref22.strokeWidth, strokeWidth = _ref2$strokeWidth === void 0 ? 2 : _ref2$strokeWidth;
      var _ref32 = isDotProps(dot2) ? dot2 : {}, _ref3$clipDot = _ref32.clipDot, clipDot = _ref3$clipDot === void 0 ? true : _ref3$clipDot;
      var dotSize = r3 * 2 + strokeWidth;
      return /* @__PURE__ */ import_react114.default.createElement(Layer, {
        className: layerClass
      }, needClipX || needClipY ? /* @__PURE__ */ import_react114.default.createElement("defs", null, /* @__PURE__ */ import_react114.default.createElement("clipPath", {
        id: "clipPath-".concat(clipPathId)
      }, /* @__PURE__ */ import_react114.default.createElement("rect", {
        x: needClipX ? left : left - width / 2,
        y: needClipY ? top2 : top2 - height / 2,
        width: needClipX ? width : width * 2,
        height: needClipY ? height : height * 2
      })), !clipDot && /* @__PURE__ */ import_react114.default.createElement("clipPath", {
        id: "clipPath-dots-".concat(clipPathId)
      }, /* @__PURE__ */ import_react114.default.createElement("rect", {
        x: left - dotSize / 2,
        y: top2 - dotSize / 2,
        width: width + dotSize,
        height: height + dotSize
      }))) : null, !hasSinglePoint ? this.renderArea(needClip, clipPathId) : null, (dot2 || hasSinglePoint) && this.renderDots(needClip, clipDot, clipPathId), (!isAnimationActive || isAnimationFinished) && LabelList.renderCallByParent(this.props, points));
    }
  }], [{
    key: "getDerivedStateFromProps",
    value: function getDerivedStateFromProps(nextProps, prevState) {
      if (nextProps.animationId !== prevState.prevAnimationId) {
        return {
          prevAnimationId: nextProps.animationId,
          curPoints: nextProps.points,
          curBaseLine: nextProps.baseLine,
          prevPoints: prevState.curPoints,
          prevBaseLine: prevState.curBaseLine
        };
      }
      if (nextProps.points !== prevState.curPoints || nextProps.baseLine !== prevState.curBaseLine) {
        return {
          curPoints: nextProps.points,
          curBaseLine: nextProps.baseLine
        };
      }
      return null;
    }
  }]);
  return Area2;
}(import_react114.PureComponent);
_class2 = Area;
_defineProperty38(Area, "displayName", "Area");
_defineProperty38(Area, "defaultProps", {
  stroke: "#3182bd",
  fill: "#3182bd",
  fillOpacity: 0.6,
  xAxisId: 0,
  yAxisId: 0,
  legendType: "line",
  connectNulls: false,
  // points of area
  points: [],
  dot: false,
  activeDot: true,
  hide: false,
  isAnimationActive: !Global2.isSsr,
  animationBegin: 0,
  animationDuration: 1500,
  animationEasing: "ease"
});
_defineProperty38(Area, "getBaseValue", function(props, item, xAxis, yAxis) {
  var layout = props.layout, chartBaseValue = props.baseValue;
  var itemBaseValue = item.props.baseValue;
  var baseValue = itemBaseValue !== null && itemBaseValue !== void 0 ? itemBaseValue : chartBaseValue;
  if (isNumber(baseValue) && typeof baseValue === "number") {
    return baseValue;
  }
  var numericAxis = layout === "horizontal" ? yAxis : xAxis;
  var domain = numericAxis.scale.domain();
  if (numericAxis.type === "number") {
    var max3 = Math.max(domain[0], domain[1]);
    var min3 = Math.min(domain[0], domain[1]);
    if (baseValue === "dataMin") {
      return min3;
    }
    if (baseValue === "dataMax") {
      return max3;
    }
    return max3 < 0 ? max3 : Math.max(Math.min(domain[0], domain[1]), 0);
  }
  if (baseValue === "dataMin") {
    return domain[0];
  }
  if (baseValue === "dataMax") {
    return domain[1];
  }
  return domain[0];
});
_defineProperty38(Area, "getComposedData", function(_ref42) {
  var props = _ref42.props, item = _ref42.item, xAxis = _ref42.xAxis, yAxis = _ref42.yAxis, xAxisTicks = _ref42.xAxisTicks, yAxisTicks = _ref42.yAxisTicks, bandSize = _ref42.bandSize, dataKey = _ref42.dataKey, stackedData = _ref42.stackedData, dataStartIndex = _ref42.dataStartIndex, displayedData = _ref42.displayedData, offset = _ref42.offset;
  var layout = props.layout;
  var hasStack = stackedData && stackedData.length;
  var baseValue = _class2.getBaseValue(props, item, xAxis, yAxis);
  var isRange = false;
  var points = displayedData.map(function(entry, index) {
    var originalValue = getValueByDataKey(entry, dataKey);
    var value;
    if (hasStack) {
      value = stackedData[dataStartIndex + index];
    } else {
      value = originalValue;
      if (!(0, import_isArray8.default)(value)) {
        value = [baseValue, value];
      } else {
        isRange = true;
      }
    }
    var isBreakPoint = (0, import_isNil12.default)(value[1]) || hasStack && (0, import_isNil12.default)(originalValue);
    if (layout === "horizontal") {
      return {
        x: getCateCoordinateOfLine({
          axis: xAxis,
          ticks: xAxisTicks,
          bandSize,
          entry,
          index
        }),
        y: isBreakPoint ? null : yAxis.scale(value[1]),
        value,
        payload: entry
      };
    }
    return {
      x: isBreakPoint ? null : xAxis.scale(value[1]),
      y: getCateCoordinateOfLine({
        axis: yAxis,
        ticks: yAxisTicks,
        bandSize,
        entry,
        index
      }),
      value,
      payload: entry
    };
  });
  var baseLine;
  if (hasStack || isRange) {
    baseLine = points.map(function(entry) {
      if (layout === "horizontal") {
        return {
          x: entry.x,
          y: !(0, import_isNil12.default)((0, import_get6.default)(entry, "value[0]")) && !(0, import_isNil12.default)((0, import_get6.default)(entry, "y")) ? yAxis.scale((0, import_get6.default)(entry, "value[0]")) : null
        };
      }
      return {
        x: !(0, import_isNil12.default)((0, import_get6.default)(entry, "value[0]")) ? xAxis.scale((0, import_get6.default)(entry, "value[0]")) : null,
        y: entry.y
      };
    });
  } else if (layout === "horizontal") {
    baseLine = yAxis.scale(baseValue);
  } else {
    baseLine = xAxis.scale(baseValue);
  }
  return _objectSpread38({
    points,
    baseLine,
    layout,
    isRange
  }, offset);
});
_defineProperty38(Area, "renderDotItem", function(option, props) {
  var dotItem;
  if (/* @__PURE__ */ import_react114.default.isValidElement(option)) {
    dotItem = /* @__PURE__ */ import_react114.default.cloneElement(option, props);
  } else if ((0, import_isFunction21.default)(option)) {
    dotItem = option(props);
  } else {
    dotItem = /* @__PURE__ */ import_react114.default.createElement(Dot, _extends37({}, props, {
      className: "recharts-area-dot"
    }));
  }
  return dotItem;
});

// node_modules/recharts/es6/cartesian/Scatter.js
var import_isFunction22 = __toESM(require_isFunction());
var import_isEqual7 = __toESM(require_isEqual());
var import_isNil13 = __toESM(require_isNil());
var import_react116 = __toESM(require_react());
var import_classnames26 = __toESM(require_classnames());

// node_modules/recharts/es6/cartesian/ZAxis.js
var ZAxis = function ZAxis2() {
  return null;
};
ZAxis.displayName = "ZAxis";
ZAxis.defaultProps = {
  zAxisId: 0,
  range: [64, 64],
  scale: "auto",
  type: "number"
};

// node_modules/recharts/es6/util/ScatterUtils.js
var import_react115 = __toESM(require_react());
var _excluded34 = ["option", "isActive"];
function _extends38() {
  _extends38 = Object.assign ? Object.assign.bind() : function(target) {
    for (var i2 = 1; i2 < arguments.length; i2++) {
      var source = arguments[i2];
      for (var key in source) {
        if (Object.prototype.hasOwnProperty.call(source, key)) {
          target[key] = source[key];
        }
      }
    }
    return target;
  };
  return _extends38.apply(this, arguments);
}
function _objectWithoutProperties22(source, excluded) {
  if (source == null)
    return {};
  var target = _objectWithoutPropertiesLoose26(source, excluded);
  var key, i2;
  if (Object.getOwnPropertySymbols) {
    var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
    for (i2 = 0; i2 < sourceSymbolKeys.length; i2++) {
      key = sourceSymbolKeys[i2];
      if (excluded.indexOf(key) >= 0)
        continue;
      if (!Object.prototype.propertyIsEnumerable.call(source, key))
        continue;
      target[key] = source[key];
    }
  }
  return target;
}
function _objectWithoutPropertiesLoose26(source, excluded) {
  if (source == null)
    return {};
  var target = {};
  var sourceKeys = Object.keys(source);
  var key, i2;
  for (i2 = 0; i2 < sourceKeys.length; i2++) {
    key = sourceKeys[i2];
    if (excluded.indexOf(key) >= 0)
      continue;
    target[key] = source[key];
  }
  return target;
}
function ScatterSymbol(_ref18) {
  var option = _ref18.option, isActive = _ref18.isActive, props = _objectWithoutProperties22(_ref18, _excluded34);
  if (typeof option === "string") {
    return /* @__PURE__ */ import_react115.default.createElement(Shape2, _extends38({
      option: /* @__PURE__ */ import_react115.default.createElement(Symbols, _extends38({
        type: option
      }, props)),
      isActive,
      shapeType: "symbols"
    }, props));
  }
  return /* @__PURE__ */ import_react115.default.createElement(Shape2, _extends38({
    option,
    isActive,
    shapeType: "symbols"
  }, props));
}

// node_modules/recharts/es6/cartesian/Scatter.js
var _class3;
function _typeof44(o) {
  "@babel/helpers - typeof";
  return _typeof44 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
    return typeof o2;
  } : function(o2) {
    return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
  }, _typeof44(o);
}
function _extends39() {
  _extends39 = Object.assign ? Object.assign.bind() : function(target) {
    for (var i2 = 1; i2 < arguments.length; i2++) {
      var source = arguments[i2];
      for (var key in source) {
        if (Object.prototype.hasOwnProperty.call(source, key)) {
          target[key] = source[key];
        }
      }
    }
    return target;
  };
  return _extends39.apply(this, arguments);
}
function ownKeys39(e3, r3) {
  var t3 = Object.keys(e3);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e3);
    r3 && (o = o.filter(function(r4) {
      return Object.getOwnPropertyDescriptor(e3, r4).enumerable;
    })), t3.push.apply(t3, o);
  }
  return t3;
}
function _objectSpread39(e3) {
  for (var r3 = 1; r3 < arguments.length; r3++) {
    var t3 = null != arguments[r3] ? arguments[r3] : {};
    r3 % 2 ? ownKeys39(Object(t3), true).forEach(function(r4) {
      _defineProperty39(e3, r4, t3[r4]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e3, Object.getOwnPropertyDescriptors(t3)) : ownKeys39(Object(t3)).forEach(function(r4) {
      Object.defineProperty(e3, r4, Object.getOwnPropertyDescriptor(t3, r4));
    });
  }
  return e3;
}
function _classCallCheck17(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties17(target, props) {
  for (var i2 = 0; i2 < props.length; i2++) {
    var descriptor = props[i2];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor)
      descriptor.writable = true;
    Object.defineProperty(target, _toPropertyKey40(descriptor.key), descriptor);
  }
}
function _createClass17(Constructor, protoProps, staticProps) {
  if (protoProps)
    _defineProperties17(Constructor.prototype, protoProps);
  if (staticProps)
    _defineProperties17(Constructor, staticProps);
  Object.defineProperty(Constructor, "prototype", { writable: false });
  return Constructor;
}
function _inherits15(subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function");
  }
  subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
  Object.defineProperty(subClass, "prototype", { writable: false });
  if (superClass)
    _setPrototypeOf17(subClass, superClass);
}
function _setPrototypeOf17(o, p) {
  _setPrototypeOf17 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf19(o2, p2) {
    o2.__proto__ = p2;
    return o2;
  };
  return _setPrototypeOf17(o, p);
}
function _createSuper15(Derived) {
  var hasNativeReflectConstruct = _isNativeReflectConstruct16();
  return function _createSuperInternal() {
    var Super = _getPrototypeOf16(Derived), result;
    if (hasNativeReflectConstruct) {
      var NewTarget = _getPrototypeOf16(this).constructor;
      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }
    return _possibleConstructorReturn15(this, result);
  };
}
function _possibleConstructorReturn15(self2, call) {
  if (call && (_typeof44(call) === "object" || typeof call === "function")) {
    return call;
  } else if (call !== void 0) {
    throw new TypeError("Derived constructors may only return object or undefined");
  }
  return _assertThisInitialized17(self2);
}
function _assertThisInitialized17(self2) {
  if (self2 === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }
  return self2;
}
function _isNativeReflectConstruct16() {
  if (typeof Reflect === "undefined" || !Reflect.construct)
    return false;
  if (Reflect.construct.sham)
    return false;
  if (typeof Proxy === "function")
    return true;
  try {
    Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
    return true;
  } catch (e3) {
    return false;
  }
}
function _getPrototypeOf16(o) {
  _getPrototypeOf16 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf18(o2) {
    return o2.__proto__ || Object.getPrototypeOf(o2);
  };
  return _getPrototypeOf16(o);
}
function _defineProperty39(obj, key, value) {
  key = _toPropertyKey40(key);
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
function _toPropertyKey40(arg) {
  var key = _toPrimitive40(arg, "string");
  return _typeof44(key) === "symbol" ? key : String(key);
}
function _toPrimitive40(input, hint) {
  if (_typeof44(input) !== "object" || input === null)
    return input;
  var prim = input[Symbol.toPrimitive];
  if (prim !== void 0) {
    var res = prim.call(input, hint || "default");
    if (_typeof44(res) !== "object")
      return res;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (hint === "string" ? String : Number)(input);
}
var Scatter = /* @__PURE__ */ function(_PureComponent) {
  _inherits15(Scatter2, _PureComponent);
  var _super = _createSuper15(Scatter2);
  function Scatter2() {
    var _this;
    _classCallCheck17(this, Scatter2);
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    _this = _super.call.apply(_super, [this].concat(args));
    _defineProperty39(_assertThisInitialized17(_this), "state", {
      isAnimationFinished: false
    });
    _defineProperty39(_assertThisInitialized17(_this), "handleAnimationEnd", function() {
      _this.setState({
        isAnimationFinished: true
      });
    });
    _defineProperty39(_assertThisInitialized17(_this), "handleAnimationStart", function() {
      _this.setState({
        isAnimationFinished: false
      });
    });
    _defineProperty39(_assertThisInitialized17(_this), "id", uniqueId("recharts-scatter-"));
    return _this;
  }
  _createClass17(Scatter2, [{
    key: "renderSymbolsStatically",
    value: function renderSymbolsStatically(points) {
      var _this2 = this;
      var _this$props = this.props, shape = _this$props.shape, activeShape = _this$props.activeShape, activeIndex = _this$props.activeIndex;
      var baseProps = filterProps(this.props);
      return points.map(function(entry, i2) {
        var isActive = activeIndex === i2;
        var option = isActive ? activeShape : shape;
        var props = _objectSpread39(_objectSpread39({
          key: "symbol-".concat(i2)
        }, baseProps), entry);
        return /* @__PURE__ */ import_react116.default.createElement(Layer, _extends39({
          className: "recharts-scatter-symbol"
        }, adaptEventsOfChild(_this2.props, entry, i2), {
          key: "symbol-".concat(i2),
          role: "img"
        }), /* @__PURE__ */ import_react116.default.createElement(ScatterSymbol, _extends39({
          option,
          isActive
        }, props)));
      });
    }
  }, {
    key: "renderSymbolsWithAnimation",
    value: function renderSymbolsWithAnimation() {
      var _this3 = this;
      var _this$props2 = this.props, points = _this$props2.points, isAnimationActive = _this$props2.isAnimationActive, animationBegin = _this$props2.animationBegin, animationDuration = _this$props2.animationDuration, animationEasing = _this$props2.animationEasing, animationId = _this$props2.animationId;
      var prevPoints = this.state.prevPoints;
      return /* @__PURE__ */ import_react116.default.createElement(es6_default, {
        begin: animationBegin,
        duration: animationDuration,
        isActive: isAnimationActive,
        easing: animationEasing,
        from: {
          t: 0
        },
        to: {
          t: 1
        },
        key: "pie-".concat(animationId),
        onAnimationEnd: this.handleAnimationEnd,
        onAnimationStart: this.handleAnimationStart
      }, function(_ref18) {
        var t3 = _ref18.t;
        var stepData = points.map(function(entry, index) {
          var prev2 = prevPoints && prevPoints[index];
          if (prev2) {
            var interpolatorCx = interpolateNumber(prev2.cx, entry.cx);
            var interpolatorCy = interpolateNumber(prev2.cy, entry.cy);
            var interpolatorSize = interpolateNumber(prev2.size, entry.size);
            return _objectSpread39(_objectSpread39({}, entry), {}, {
              cx: interpolatorCx(t3),
              cy: interpolatorCy(t3),
              size: interpolatorSize(t3)
            });
          }
          var interpolator = interpolateNumber(0, entry.size);
          return _objectSpread39(_objectSpread39({}, entry), {}, {
            size: interpolator(t3)
          });
        });
        return /* @__PURE__ */ import_react116.default.createElement(Layer, null, _this3.renderSymbolsStatically(stepData));
      });
    }
  }, {
    key: "renderSymbols",
    value: function renderSymbols() {
      var _this$props3 = this.props, points = _this$props3.points, isAnimationActive = _this$props3.isAnimationActive;
      var prevPoints = this.state.prevPoints;
      if (isAnimationActive && points && points.length && (!prevPoints || !(0, import_isEqual7.default)(prevPoints, points))) {
        return this.renderSymbolsWithAnimation();
      }
      return this.renderSymbolsStatically(points);
    }
  }, {
    key: "renderErrorBar",
    value: function renderErrorBar() {
      var isAnimationActive = this.props.isAnimationActive;
      if (isAnimationActive && !this.state.isAnimationFinished) {
        return null;
      }
      var _this$props4 = this.props, points = _this$props4.points, xAxis = _this$props4.xAxis, yAxis = _this$props4.yAxis, children = _this$props4.children;
      var errorBarItems = findAllByType(children, ErrorBar);
      if (!errorBarItems) {
        return null;
      }
      return errorBarItems.map(function(item, i2) {
        var direction = item.props.direction;
        return /* @__PURE__ */ import_react116.default.cloneElement(item, {
          key: i2,
          // eslint-disable-line react/no-array-index-key
          data: points,
          xAxis,
          yAxis,
          layout: direction === "x" ? "vertical" : "horizontal",
          dataPointFormatter: function dataPointFormatter(dataPoint, dataKey) {
            return {
              x: dataPoint.cx,
              y: dataPoint.cy,
              value: direction === "x" ? +dataPoint.node.x : +dataPoint.node.y,
              errorVal: getValueByDataKey(dataPoint, dataKey)
            };
          }
        });
      });
    }
  }, {
    key: "renderLine",
    value: function renderLine3() {
      var _this$props5 = this.props, points = _this$props5.points, line2 = _this$props5.line, lineType = _this$props5.lineType, lineJointType = _this$props5.lineJointType;
      var scatterProps = filterProps(this.props);
      var customLineProps = filterProps(line2);
      var linePoints, lineItem;
      if (lineType === "joint") {
        linePoints = points.map(function(entry) {
          return {
            x: entry.cx,
            y: entry.cy
          };
        });
      } else if (lineType === "fitting") {
        var _getLinearRegression = getLinearRegression(points), xmin = _getLinearRegression.xmin, xmax = _getLinearRegression.xmax, a2 = _getLinearRegression.a, b = _getLinearRegression.b;
        var linearExp = function linearExp2(x2) {
          return a2 * x2 + b;
        };
        linePoints = [{
          x: xmin,
          y: linearExp(xmin)
        }, {
          x: xmax,
          y: linearExp(xmax)
        }];
      }
      var lineProps = _objectSpread39(_objectSpread39(_objectSpread39({}, scatterProps), {}, {
        fill: "none",
        stroke: scatterProps && scatterProps.fill
      }, customLineProps), {}, {
        points: linePoints
      });
      if (/* @__PURE__ */ import_react116.default.isValidElement(line2)) {
        lineItem = /* @__PURE__ */ import_react116.default.cloneElement(line2, lineProps);
      } else if ((0, import_isFunction22.default)(line2)) {
        lineItem = line2(lineProps);
      } else {
        lineItem = /* @__PURE__ */ import_react116.default.createElement(Curve2, _extends39({}, lineProps, {
          type: lineJointType
        }));
      }
      return /* @__PURE__ */ import_react116.default.createElement(Layer, {
        className: "recharts-scatter-line",
        key: "recharts-scatter-line"
      }, lineItem);
    }
  }, {
    key: "render",
    value: function render2() {
      var _this$props6 = this.props, hide = _this$props6.hide, points = _this$props6.points, line2 = _this$props6.line, className = _this$props6.className, xAxis = _this$props6.xAxis, yAxis = _this$props6.yAxis, left = _this$props6.left, top2 = _this$props6.top, width = _this$props6.width, height = _this$props6.height, id2 = _this$props6.id, isAnimationActive = _this$props6.isAnimationActive;
      if (hide || !points || !points.length) {
        return null;
      }
      var isAnimationFinished = this.state.isAnimationFinished;
      var layerClass = (0, import_classnames26.default)("recharts-scatter", className);
      var needClipX = xAxis && xAxis.allowDataOverflow;
      var needClipY = yAxis && yAxis.allowDataOverflow;
      var needClip = needClipX || needClipY;
      var clipPathId = (0, import_isNil13.default)(id2) ? this.id : id2;
      return /* @__PURE__ */ import_react116.default.createElement(Layer, {
        className: layerClass,
        clipPath: needClip ? "url(#clipPath-".concat(clipPathId, ")") : null
      }, needClipX || needClipY ? /* @__PURE__ */ import_react116.default.createElement("defs", null, /* @__PURE__ */ import_react116.default.createElement("clipPath", {
        id: "clipPath-".concat(clipPathId)
      }, /* @__PURE__ */ import_react116.default.createElement("rect", {
        x: needClipX ? left : left - width / 2,
        y: needClipY ? top2 : top2 - height / 2,
        width: needClipX ? width : width * 2,
        height: needClipY ? height : height * 2
      }))) : null, line2 && this.renderLine(), this.renderErrorBar(), /* @__PURE__ */ import_react116.default.createElement(Layer, {
        key: "recharts-scatter-symbols"
      }, this.renderSymbols()), (!isAnimationActive || isAnimationFinished) && LabelList.renderCallByParent(this.props, points));
    }
  }], [{
    key: "getDerivedStateFromProps",
    value: function getDerivedStateFromProps(nextProps, prevState) {
      if (nextProps.animationId !== prevState.prevAnimationId) {
        return {
          prevAnimationId: nextProps.animationId,
          curPoints: nextProps.points,
          prevPoints: prevState.curPoints
        };
      }
      if (nextProps.points !== prevState.curPoints) {
        return {
          curPoints: nextProps.points
        };
      }
      return null;
    }
  }]);
  return Scatter2;
}(import_react116.PureComponent);
_class3 = Scatter;
_defineProperty39(Scatter, "displayName", "Scatter");
_defineProperty39(Scatter, "defaultProps", {
  xAxisId: 0,
  yAxisId: 0,
  zAxisId: 0,
  legendType: "circle",
  lineType: "joint",
  lineJointType: "linear",
  data: [],
  shape: "circle",
  hide: false,
  isAnimationActive: !Global2.isSsr,
  animationBegin: 0,
  animationDuration: 400,
  animationEasing: "linear"
});
_defineProperty39(Scatter, "getComposedData", function(_ref22) {
  var xAxis = _ref22.xAxis, yAxis = _ref22.yAxis, zAxis = _ref22.zAxis, item = _ref22.item, displayedData = _ref22.displayedData, xAxisTicks = _ref22.xAxisTicks, yAxisTicks = _ref22.yAxisTicks, offset = _ref22.offset;
  var tooltipType = item.props.tooltipType;
  var cells = findAllByType(item.props.children, Cell);
  var xAxisDataKey = (0, import_isNil13.default)(xAxis.dataKey) ? item.props.dataKey : xAxis.dataKey;
  var yAxisDataKey = (0, import_isNil13.default)(yAxis.dataKey) ? item.props.dataKey : yAxis.dataKey;
  var zAxisDataKey = zAxis && zAxis.dataKey;
  var defaultRangeZ = zAxis ? zAxis.range : ZAxis.defaultProps.range;
  var defaultZ = defaultRangeZ && defaultRangeZ[0];
  var xBandSize = xAxis.scale.bandwidth ? xAxis.scale.bandwidth() : 0;
  var yBandSize = yAxis.scale.bandwidth ? yAxis.scale.bandwidth() : 0;
  var points = displayedData.map(function(entry, index) {
    var x2 = getValueByDataKey(entry, xAxisDataKey);
    var y2 = getValueByDataKey(entry, yAxisDataKey);
    var z = !(0, import_isNil13.default)(zAxisDataKey) && getValueByDataKey(entry, zAxisDataKey) || "-";
    var tooltipPayload = [{
      name: (0, import_isNil13.default)(xAxis.dataKey) ? item.props.name : xAxis.name || xAxis.dataKey,
      unit: xAxis.unit || "",
      value: x2,
      payload: entry,
      dataKey: xAxisDataKey,
      type: tooltipType
    }, {
      name: (0, import_isNil13.default)(yAxis.dataKey) ? item.props.name : yAxis.name || yAxis.dataKey,
      unit: yAxis.unit || "",
      value: y2,
      payload: entry,
      dataKey: yAxisDataKey,
      type: tooltipType
    }];
    if (z !== "-") {
      tooltipPayload.push({
        name: zAxis.name || zAxis.dataKey,
        unit: zAxis.unit || "",
        value: z,
        payload: entry,
        dataKey: zAxisDataKey,
        type: tooltipType
      });
    }
    var cx = getCateCoordinateOfLine({
      axis: xAxis,
      ticks: xAxisTicks,
      bandSize: xBandSize,
      entry,
      index,
      dataKey: xAxisDataKey
    });
    var cy = getCateCoordinateOfLine({
      axis: yAxis,
      ticks: yAxisTicks,
      bandSize: yBandSize,
      entry,
      index,
      dataKey: yAxisDataKey
    });
    var size = z !== "-" ? zAxis.scale(z) : defaultZ;
    var radius = Math.sqrt(Math.max(size, 0) / Math.PI);
    return _objectSpread39(_objectSpread39({}, entry), {}, {
      cx,
      cy,
      x: cx - radius,
      y: cy - radius,
      xAxis,
      yAxis,
      zAxis,
      width: 2 * radius,
      height: 2 * radius,
      size,
      node: {
        x: x2,
        y: y2,
        z
      },
      tooltipPayload,
      tooltipPosition: {
        x: cx,
        y: cy
      },
      payload: entry
    }, cells && cells[index] && cells[index].props);
  });
  return _objectSpread39({
    points
  }, offset);
});

// node_modules/recharts/es6/cartesian/XAxis.js
var XAxis = function XAxis2() {
  return null;
};
XAxis.displayName = "XAxis";
XAxis.defaultProps = {
  allowDecimals: true,
  hide: false,
  orientation: "bottom",
  width: 0,
  height: 30,
  mirror: false,
  xAxisId: 0,
  tickCount: 5,
  type: "category",
  padding: {
    left: 0,
    right: 0
  },
  allowDataOverflow: false,
  scale: "auto",
  reversed: false,
  allowDuplicatedCategory: true
};

// node_modules/recharts/es6/cartesian/YAxis.js
var YAxis = function YAxis2() {
  return null;
};
YAxis.displayName = "YAxis";
YAxis.defaultProps = {
  allowDuplicatedCategory: true,
  allowDecimals: true,
  hide: false,
  orientation: "left",
  width: 60,
  height: 0,
  mirror: false,
  yAxisId: 0,
  tickCount: 5,
  type: "number",
  padding: {
    top: 0,
    bottom: 0
  },
  allowDataOverflow: false,
  scale: "auto",
  reversed: false
};

// node_modules/recharts/es6/chart/generateCategoricalChart.js
var import_every2 = __toESM(require_every());
var import_find = __toESM(require_find());
var import_isFunction23 = __toESM(require_isFunction());
var import_throttle2 = __toESM(require_throttle());
var import_sortBy3 = __toESM(require_sortBy());
var import_get7 = __toESM(require_get());
var import_isNil14 = __toESM(require_isNil());
var import_range3 = __toESM(require_range());
var import_isBoolean2 = __toESM(require_isBoolean());
var import_isArray9 = __toESM(require_isArray());
var import_react117 = __toESM(require_react());
var import_classnames27 = __toESM(require_classnames());

// node_modules/tiny-invariant/dist/esm/tiny-invariant.js
var isProduction = false;
var prefix2 = "Invariant failed";
function invariant2(condition, message) {
  if (condition) {
    return;
  }
  if (isProduction) {
    throw new Error(prefix2);
  }
  var provided = typeof message === "function" ? message() : message;
  var value = provided ? "".concat(prefix2, ": ").concat(provided) : prefix2;
  throw new Error(value);
}

// node_modules/recharts/es6/util/cursor/getRadialCursorPoints.js
function getRadialCursorPoints(activeCoordinate) {
  var cx = activeCoordinate.cx, cy = activeCoordinate.cy, radius = activeCoordinate.radius, startAngle = activeCoordinate.startAngle, endAngle = activeCoordinate.endAngle;
  var startPoint = polarToCartesian(cx, cy, radius, startAngle);
  var endPoint = polarToCartesian(cx, cy, radius, endAngle);
  return {
    points: [startPoint, endPoint],
    cx,
    cy,
    radius,
    startAngle,
    endAngle
  };
}

// node_modules/recharts/es6/util/DetectReferenceElementsDomain.js
function _toConsumableArray12(arr) {
  return _arrayWithoutHoles12(arr) || _iterableToArray13(arr) || _unsupportedIterableToArray23(arr) || _nonIterableSpread12();
}
function _nonIterableSpread12() {
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _unsupportedIterableToArray23(o, minLen) {
  if (!o)
    return;
  if (typeof o === "string")
    return _arrayLikeToArray23(o, minLen);
  var n2 = Object.prototype.toString.call(o).slice(8, -1);
  if (n2 === "Object" && o.constructor)
    n2 = o.constructor.name;
  if (n2 === "Map" || n2 === "Set")
    return Array.from(o);
  if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2))
    return _arrayLikeToArray23(o, minLen);
}
function _iterableToArray13(iter) {
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
    return Array.from(iter);
}
function _arrayWithoutHoles12(arr) {
  if (Array.isArray(arr))
    return _arrayLikeToArray23(arr);
}
function _arrayLikeToArray23(arr, len) {
  if (len == null || len > arr.length)
    len = arr.length;
  for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++)
    arr2[i2] = arr[i2];
  return arr2;
}
var detectReferenceElementsDomain = function detectReferenceElementsDomain2(children, domain, axisId, axisType, specifiedTicks) {
  var lines = findAllByType(children, ReferenceLine);
  var dots = findAllByType(children, ReferenceDot);
  var elements = [].concat(_toConsumableArray12(lines), _toConsumableArray12(dots));
  var areas = findAllByType(children, ReferenceArea);
  var idKey = "".concat(axisType, "Id");
  var valueKey = axisType[0];
  var finalDomain = domain;
  if (elements.length) {
    finalDomain = elements.reduce(function(result, el) {
      if (el.props[idKey] === axisId && ifOverflowMatches(el.props, "extendDomain") && isNumber(el.props[valueKey])) {
        var value = el.props[valueKey];
        return [Math.min(result[0], value), Math.max(result[1], value)];
      }
      return result;
    }, finalDomain);
  }
  if (areas.length) {
    var key1 = "".concat(valueKey, "1");
    var key2 = "".concat(valueKey, "2");
    finalDomain = areas.reduce(function(result, el) {
      if (el.props[idKey] === axisId && ifOverflowMatches(el.props, "extendDomain") && isNumber(el.props[key1]) && isNumber(el.props[key2])) {
        var value1 = el.props[key1];
        var value2 = el.props[key2];
        return [Math.min(result[0], value1, value2), Math.max(result[1], value1, value2)];
      }
      return result;
    }, finalDomain);
  }
  if (specifiedTicks && specifiedTicks.length) {
    finalDomain = specifiedTicks.reduce(function(result, tick) {
      if (isNumber(tick)) {
        return [Math.min(result[0], tick), Math.max(result[1], tick)];
      }
      return result;
    }, finalDomain);
  }
  return finalDomain;
};

// node_modules/recharts/es6/util/Events.js
var import_eventemitter3 = __toESM(require_eventemitter3());
var eventCenter = new import_eventemitter3.default();
if (eventCenter.setMaxListeners) {
  eventCenter.setMaxListeners(10);
}
var SYNC_EVENT = "recharts.syncMouseEvents";

// node_modules/recharts/es6/chart/AccessibilityManager.js
function _typeof45(o) {
  "@babel/helpers - typeof";
  return _typeof45 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
    return typeof o2;
  } : function(o2) {
    return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
  }, _typeof45(o);
}
function _classCallCheck18(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties18(target, props) {
  for (var i2 = 0; i2 < props.length; i2++) {
    var descriptor = props[i2];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor)
      descriptor.writable = true;
    Object.defineProperty(target, _toPropertyKey41(descriptor.key), descriptor);
  }
}
function _createClass18(Constructor, protoProps, staticProps) {
  if (protoProps)
    _defineProperties18(Constructor.prototype, protoProps);
  if (staticProps)
    _defineProperties18(Constructor, staticProps);
  Object.defineProperty(Constructor, "prototype", { writable: false });
  return Constructor;
}
function _defineProperty40(obj, key, value) {
  key = _toPropertyKey41(key);
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
function _toPropertyKey41(arg) {
  var key = _toPrimitive41(arg, "string");
  return _typeof45(key) === "symbol" ? key : String(key);
}
function _toPrimitive41(input, hint) {
  if (_typeof45(input) !== "object" || input === null)
    return input;
  var prim = input[Symbol.toPrimitive];
  if (prim !== void 0) {
    var res = prim.call(input, hint || "default");
    if (_typeof45(res) !== "object")
      return res;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (hint === "string" ? String : Number)(input);
}
var AccessibilityManager = /* @__PURE__ */ function() {
  function AccessibilityManager2() {
    _classCallCheck18(this, AccessibilityManager2);
    _defineProperty40(this, "activeIndex", 0);
    _defineProperty40(this, "coordinateList", []);
    _defineProperty40(this, "layout", "horizontal");
  }
  _createClass18(AccessibilityManager2, [{
    key: "setDetails",
    value: function setDetails(_ref18) {
      var _ref$coordinateList = _ref18.coordinateList, coordinateList = _ref$coordinateList === void 0 ? [] : _ref$coordinateList, _ref$container = _ref18.container, container = _ref$container === void 0 ? null : _ref$container, _ref$layout = _ref18.layout, layout = _ref$layout === void 0 ? null : _ref$layout, _ref$offset = _ref18.offset, offset = _ref$offset === void 0 ? null : _ref$offset, _ref$mouseHandlerCall = _ref18.mouseHandlerCallback, mouseHandlerCallback = _ref$mouseHandlerCall === void 0 ? null : _ref$mouseHandlerCall;
      this.coordinateList = coordinateList !== null && coordinateList !== void 0 ? coordinateList : this.coordinateList;
      this.container = container !== null && container !== void 0 ? container : this.container;
      this.layout = layout !== null && layout !== void 0 ? layout : this.layout;
      this.offset = offset !== null && offset !== void 0 ? offset : this.offset;
      this.mouseHandlerCallback = mouseHandlerCallback !== null && mouseHandlerCallback !== void 0 ? mouseHandlerCallback : this.mouseHandlerCallback;
      this.activeIndex = Math.min(Math.max(this.activeIndex, 0), this.coordinateList.length - 1);
    }
  }, {
    key: "focus",
    value: function focus() {
      this.spoofMouse();
    }
  }, {
    key: "keyboardEvent",
    value: function keyboardEvent(e3) {
      if (this.coordinateList.length === 0) {
        return;
      }
      switch (e3.key) {
        case "ArrowRight": {
          if (this.layout !== "horizontal") {
            return;
          }
          this.activeIndex = Math.min(this.activeIndex + 1, this.coordinateList.length - 1);
          this.spoofMouse();
          break;
        }
        case "ArrowLeft": {
          if (this.layout !== "horizontal") {
            return;
          }
          this.activeIndex = Math.max(this.activeIndex - 1, 0);
          this.spoofMouse();
          break;
        }
        default: {
          break;
        }
      }
    }
  }, {
    key: "spoofMouse",
    value: function spoofMouse() {
      if (this.layout !== "horizontal") {
        return;
      }
      if (this.coordinateList.length === 0) {
        return;
      }
      var _this$container$getBo = this.container.getBoundingClientRect(), x2 = _this$container$getBo.x, y2 = _this$container$getBo.y, height = _this$container$getBo.height;
      var coordinate = this.coordinateList[this.activeIndex].coordinate;
      var pageX = x2 + coordinate;
      var pageY = y2 + this.offset.top + height / 2;
      this.mouseHandlerCallback({
        pageX,
        pageY
      });
    }
  }]);
  return AccessibilityManager2;
}();

// node_modules/recharts/es6/util/isDomainSpecifiedByUser.js
function isDomainSpecifiedByUser(domain, allowDataOverflow, axisType) {
  if (axisType === "number" && allowDataOverflow === true && Array.isArray(domain)) {
    var domainStart = domain === null || domain === void 0 ? void 0 : domain[0];
    var domainEnd = domain === null || domain === void 0 ? void 0 : domain[1];
    if (!!domainStart && !!domainEnd && isNumber(domainStart) && isNumber(domainEnd)) {
      return true;
    }
  }
  return false;
}

// node_modules/recharts/es6/util/deferer.js
function deferer(callback) {
  if (typeof requestAnimationFrame === "function") {
    var frame = requestAnimationFrame(callback);
    return function() {
      return cancelAnimationFrame(frame);
    };
  }
  if (typeof setImmediate === "function") {
    var handle = setImmediate(callback);
    return function() {
      return clearImmediate(handle);
    };
  }
  var timer = setTimeout(callback);
  return function() {
    return clearTimeout(timer);
  };
}

// node_modules/recharts/es6/util/cursor/getCursorPoints.js
function getCursorPoints(layout, activeCoordinate, offset) {
  var x1, y1, x2, y2;
  if (layout === "horizontal") {
    x1 = activeCoordinate.x;
    x2 = x1;
    y1 = offset.top;
    y2 = offset.top + offset.height;
  } else if (layout === "vertical") {
    y1 = activeCoordinate.y;
    y2 = y1;
    x1 = offset.left;
    x2 = offset.left + offset.width;
  } else if (activeCoordinate.cx != null && activeCoordinate.cy != null) {
    if (layout === "centric") {
      var cx = activeCoordinate.cx, cy = activeCoordinate.cy, innerRadius = activeCoordinate.innerRadius, outerRadius = activeCoordinate.outerRadius, angle = activeCoordinate.angle;
      var innerPoint = polarToCartesian(cx, cy, innerRadius, angle);
      var outerPoint = polarToCartesian(cx, cy, outerRadius, angle);
      x1 = innerPoint.x;
      y1 = innerPoint.y;
      x2 = outerPoint.x;
      y2 = outerPoint.y;
    } else {
      return getRadialCursorPoints(activeCoordinate);
    }
  }
  return [{
    x: x1,
    y: y1
  }, {
    x: x2,
    y: y2
  }];
}

// node_modules/recharts/es6/util/cursor/getCursorRectangle.js
function getCursorRectangle(layout, activeCoordinate, offset, tooltipAxisBandSize) {
  var halfSize = tooltipAxisBandSize / 2;
  return {
    stroke: "none",
    fill: "#ccc",
    x: layout === "horizontal" ? activeCoordinate.x - halfSize : offset.left + 0.5,
    y: layout === "horizontal" ? offset.top + 0.5 : activeCoordinate.y - halfSize,
    width: layout === "horizontal" ? tooltipAxisBandSize : offset.width - 1,
    height: layout === "horizontal" ? offset.height - 1 : tooltipAxisBandSize
  };
}

// node_modules/recharts/es6/chart/generateCategoricalChart.js
var _excluded35 = ["item"];
var _excluded211 = ["children", "className", "width", "height", "style", "compact", "title", "desc"];
function _typeof46(o) {
  "@babel/helpers - typeof";
  return _typeof46 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
    return typeof o2;
  } : function(o2) {
    return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
  }, _typeof46(o);
}
function _slicedToArray13(arr, i2) {
  return _arrayWithHoles14(arr) || _iterableToArrayLimit13(arr, i2) || _unsupportedIterableToArray24(arr, i2) || _nonIterableRest14();
}
function _nonIterableRest14() {
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _iterableToArrayLimit13(r3, l) {
  var t3 = null == r3 ? null : "undefined" != typeof Symbol && r3[Symbol.iterator] || r3["@@iterator"];
  if (null != t3) {
    var e3, n2, i2, u, a2 = [], f = true, o = false;
    try {
      if (i2 = (t3 = t3.call(r3)).next, 0 === l) {
        if (Object(t3) !== t3)
          return;
        f = false;
      } else
        for (; !(f = (e3 = i2.call(t3)).done) && (a2.push(e3.value), a2.length !== l); f = true)
          ;
    } catch (r4) {
      o = true, n2 = r4;
    } finally {
      try {
        if (!f && null != t3["return"] && (u = t3["return"](), Object(u) !== u))
          return;
      } finally {
        if (o)
          throw n2;
      }
    }
    return a2;
  }
}
function _arrayWithHoles14(arr) {
  if (Array.isArray(arr))
    return arr;
}
function _extends40() {
  _extends40 = Object.assign ? Object.assign.bind() : function(target) {
    for (var i2 = 1; i2 < arguments.length; i2++) {
      var source = arguments[i2];
      for (var key in source) {
        if (Object.prototype.hasOwnProperty.call(source, key)) {
          target[key] = source[key];
        }
      }
    }
    return target;
  };
  return _extends40.apply(this, arguments);
}
function _objectWithoutProperties23(source, excluded) {
  if (source == null)
    return {};
  var target = _objectWithoutPropertiesLoose27(source, excluded);
  var key, i2;
  if (Object.getOwnPropertySymbols) {
    var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
    for (i2 = 0; i2 < sourceSymbolKeys.length; i2++) {
      key = sourceSymbolKeys[i2];
      if (excluded.indexOf(key) >= 0)
        continue;
      if (!Object.prototype.propertyIsEnumerable.call(source, key))
        continue;
      target[key] = source[key];
    }
  }
  return target;
}
function _objectWithoutPropertiesLoose27(source, excluded) {
  if (source == null)
    return {};
  var target = {};
  var sourceKeys = Object.keys(source);
  var key, i2;
  for (i2 = 0; i2 < sourceKeys.length; i2++) {
    key = sourceKeys[i2];
    if (excluded.indexOf(key) >= 0)
      continue;
    target[key] = source[key];
  }
  return target;
}
function _classCallCheck19(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties19(target, props) {
  for (var i2 = 0; i2 < props.length; i2++) {
    var descriptor = props[i2];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor)
      descriptor.writable = true;
    Object.defineProperty(target, _toPropertyKey42(descriptor.key), descriptor);
  }
}
function _createClass19(Constructor, protoProps, staticProps) {
  if (protoProps)
    _defineProperties19(Constructor.prototype, protoProps);
  if (staticProps)
    _defineProperties19(Constructor, staticProps);
  Object.defineProperty(Constructor, "prototype", { writable: false });
  return Constructor;
}
function _inherits16(subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function");
  }
  subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
  Object.defineProperty(subClass, "prototype", { writable: false });
  if (superClass)
    _setPrototypeOf18(subClass, superClass);
}
function _setPrototypeOf18(o, p) {
  _setPrototypeOf18 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf19(o2, p2) {
    o2.__proto__ = p2;
    return o2;
  };
  return _setPrototypeOf18(o, p);
}
function _createSuper16(Derived) {
  var hasNativeReflectConstruct = _isNativeReflectConstruct17();
  return function _createSuperInternal() {
    var Super = _getPrototypeOf17(Derived), result;
    if (hasNativeReflectConstruct) {
      var NewTarget = _getPrototypeOf17(this).constructor;
      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }
    return _possibleConstructorReturn16(this, result);
  };
}
function _possibleConstructorReturn16(self2, call) {
  if (call && (_typeof46(call) === "object" || typeof call === "function")) {
    return call;
  } else if (call !== void 0) {
    throw new TypeError("Derived constructors may only return object or undefined");
  }
  return _assertThisInitialized18(self2);
}
function _assertThisInitialized18(self2) {
  if (self2 === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }
  return self2;
}
function _isNativeReflectConstruct17() {
  if (typeof Reflect === "undefined" || !Reflect.construct)
    return false;
  if (Reflect.construct.sham)
    return false;
  if (typeof Proxy === "function")
    return true;
  try {
    Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
    return true;
  } catch (e3) {
    return false;
  }
}
function _getPrototypeOf17(o) {
  _getPrototypeOf17 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf18(o2) {
    return o2.__proto__ || Object.getPrototypeOf(o2);
  };
  return _getPrototypeOf17(o);
}
function _toConsumableArray13(arr) {
  return _arrayWithoutHoles13(arr) || _iterableToArray14(arr) || _unsupportedIterableToArray24(arr) || _nonIterableSpread13();
}
function _nonIterableSpread13() {
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _unsupportedIterableToArray24(o, minLen) {
  if (!o)
    return;
  if (typeof o === "string")
    return _arrayLikeToArray24(o, minLen);
  var n2 = Object.prototype.toString.call(o).slice(8, -1);
  if (n2 === "Object" && o.constructor)
    n2 = o.constructor.name;
  if (n2 === "Map" || n2 === "Set")
    return Array.from(o);
  if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2))
    return _arrayLikeToArray24(o, minLen);
}
function _iterableToArray14(iter) {
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
    return Array.from(iter);
}
function _arrayWithoutHoles13(arr) {
  if (Array.isArray(arr))
    return _arrayLikeToArray24(arr);
}
function _arrayLikeToArray24(arr, len) {
  if (len == null || len > arr.length)
    len = arr.length;
  for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++)
    arr2[i2] = arr[i2];
  return arr2;
}
function ownKeys40(e3, r3) {
  var t3 = Object.keys(e3);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e3);
    r3 && (o = o.filter(function(r4) {
      return Object.getOwnPropertyDescriptor(e3, r4).enumerable;
    })), t3.push.apply(t3, o);
  }
  return t3;
}
function _objectSpread40(e3) {
  for (var r3 = 1; r3 < arguments.length; r3++) {
    var t3 = null != arguments[r3] ? arguments[r3] : {};
    r3 % 2 ? ownKeys40(Object(t3), true).forEach(function(r4) {
      _defineProperty41(e3, r4, t3[r4]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e3, Object.getOwnPropertyDescriptors(t3)) : ownKeys40(Object(t3)).forEach(function(r4) {
      Object.defineProperty(e3, r4, Object.getOwnPropertyDescriptor(t3, r4));
    });
  }
  return e3;
}
function _defineProperty41(obj, key, value) {
  key = _toPropertyKey42(key);
  if (key in obj) {
    Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
  } else {
    obj[key] = value;
  }
  return obj;
}
function _toPropertyKey42(arg) {
  var key = _toPrimitive42(arg, "string");
  return _typeof46(key) === "symbol" ? key : String(key);
}
function _toPrimitive42(input, hint) {
  if (_typeof46(input) !== "object" || input === null)
    return input;
  var prim = input[Symbol.toPrimitive];
  if (prim !== void 0) {
    var res = prim.call(input, hint || "default");
    if (_typeof46(res) !== "object")
      return res;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (hint === "string" ? String : Number)(input);
}
var ORIENT_MAP = {
  xAxis: ["bottom", "top"],
  yAxis: ["left", "right"]
};
var originCoordinate = {
  x: 0,
  y: 0
};
var isFinit = Number.isFinite ? Number.isFinite : isFinite;
var calculateTooltipPos = function calculateTooltipPos2(rangeObj, layout) {
  if (layout === "horizontal") {
    return rangeObj.x;
  }
  if (layout === "vertical") {
    return rangeObj.y;
  }
  if (layout === "centric") {
    return rangeObj.angle;
  }
  return rangeObj.radius;
};
var getActiveCoordinate = function getActiveCoordinate2(layout, tooltipTicks, activeIndex, rangeObj) {
  var entry = tooltipTicks.find(function(tick) {
    return tick && tick.index === activeIndex;
  });
  if (entry) {
    if (layout === "horizontal") {
      return {
        x: entry.coordinate,
        y: rangeObj.y
      };
    }
    if (layout === "vertical") {
      return {
        x: rangeObj.x,
        y: entry.coordinate
      };
    }
    if (layout === "centric") {
      var _angle = entry.coordinate;
      var _radius = rangeObj.radius;
      return _objectSpread40(_objectSpread40(_objectSpread40({}, rangeObj), polarToCartesian(rangeObj.cx, rangeObj.cy, _radius, _angle)), {}, {
        angle: _angle,
        radius: _radius
      });
    }
    var radius = entry.coordinate;
    var angle = rangeObj.angle;
    return _objectSpread40(_objectSpread40(_objectSpread40({}, rangeObj), polarToCartesian(rangeObj.cx, rangeObj.cy, radius, angle)), {}, {
      angle,
      radius
    });
  }
  return originCoordinate;
};
var getDisplayedData = function getDisplayedData2(data, _ref18, item) {
  var graphicalItems = _ref18.graphicalItems, dataStartIndex = _ref18.dataStartIndex, dataEndIndex = _ref18.dataEndIndex;
  var itemsData = (graphicalItems || []).reduce(function(result, child) {
    var itemData = child.props.data;
    if (itemData && itemData.length) {
      return [].concat(_toConsumableArray13(result), _toConsumableArray13(itemData));
    }
    return result;
  }, []);
  if (itemsData && itemsData.length > 0) {
    return itemsData;
  }
  if (item && item.props && item.props.data && item.props.data.length > 0) {
    return item.props.data;
  }
  if (data && data.length && isNumber(dataStartIndex) && isNumber(dataEndIndex)) {
    return data.slice(dataStartIndex, dataEndIndex + 1);
  }
  return [];
};
function getDefaultDomainByAxisType(axisType) {
  return axisType === "number" ? [0, "auto"] : void 0;
}
var getTooltipContent = function getTooltipContent2(state, chartData, activeIndex, activeLabel) {
  var graphicalItems = state.graphicalItems, tooltipAxis = state.tooltipAxis;
  var displayedData = getDisplayedData(chartData, state);
  if (activeIndex < 0 || !graphicalItems || !graphicalItems.length || activeIndex >= displayedData.length) {
    return null;
  }
  return graphicalItems.reduce(function(result, child) {
    var hide = child.props.hide;
    if (hide) {
      return result;
    }
    var _child$props$data = child.props.data, data = _child$props$data === void 0 ? chartData : _child$props$data;
    var payload;
    if (tooltipAxis.dataKey && !tooltipAxis.allowDuplicatedCategory) {
      var entries = data === void 0 ? displayedData : data;
      payload = findEntryInArray(entries, tooltipAxis.dataKey, activeLabel);
    } else {
      payload = data && data[activeIndex] || displayedData[activeIndex];
    }
    if (!payload) {
      return result;
    }
    return [].concat(_toConsumableArray13(result), [getTooltipItem(child, payload)]);
  }, []);
};
var getTooltipData = function getTooltipData2(state, chartData, layout, rangeObj) {
  var rangeData = rangeObj || {
    x: state.chartX,
    y: state.chartY
  };
  var pos = calculateTooltipPos(rangeData, layout);
  var ticks2 = state.orderedTooltipTicks, axis = state.tooltipAxis, tooltipTicks = state.tooltipTicks;
  var activeIndex = calculateActiveTickIndex(pos, ticks2, tooltipTicks, axis);
  if (activeIndex >= 0 && tooltipTicks) {
    var activeLabel = tooltipTicks[activeIndex] && tooltipTicks[activeIndex].value;
    var activePayload = getTooltipContent(state, chartData, activeIndex, activeLabel);
    var activeCoordinate = getActiveCoordinate(layout, ticks2, activeIndex, rangeData);
    return {
      activeTooltipIndex: activeIndex,
      activeLabel,
      activePayload,
      activeCoordinate
    };
  }
  return null;
};
var getAxisMapByAxes = function getAxisMapByAxes2(props, _ref22) {
  var axes = _ref22.axes, graphicalItems = _ref22.graphicalItems, axisType = _ref22.axisType, axisIdKey = _ref22.axisIdKey, stackGroups = _ref22.stackGroups, dataStartIndex = _ref22.dataStartIndex, dataEndIndex = _ref22.dataEndIndex;
  var layout = props.layout, children = props.children, stackOffset = props.stackOffset;
  var isCategorical = isCategoricalAxis(layout, axisType);
  var axisMap = axes.reduce(function(result, child) {
    var _child$props$domain2;
    var _child$props = child.props, type = _child$props.type, dataKey = _child$props.dataKey, allowDataOverflow = _child$props.allowDataOverflow, allowDuplicatedCategory = _child$props.allowDuplicatedCategory, scale = _child$props.scale, ticks2 = _child$props.ticks, includeHidden = _child$props.includeHidden;
    var axisId = child.props[axisIdKey];
    if (result[axisId]) {
      return result;
    }
    var displayedData = getDisplayedData(props.data, {
      graphicalItems: graphicalItems.filter(function(item) {
        return item.props[axisIdKey] === axisId;
      }),
      dataStartIndex,
      dataEndIndex
    });
    var len = displayedData.length;
    var domain, duplicateDomain, categoricalDomain;
    if (isDomainSpecifiedByUser(child.props.domain, allowDataOverflow, type)) {
      domain = parseSpecifiedDomain(child.props.domain, null, allowDataOverflow);
      if (isCategorical && (type === "number" || scale !== "auto")) {
        categoricalDomain = getDomainOfDataByKey(displayedData, dataKey, "category");
      }
    }
    var defaultDomain = getDefaultDomainByAxisType(type);
    if (!domain || domain.length === 0) {
      var _child$props$domain;
      var childDomain = (_child$props$domain = child.props.domain) !== null && _child$props$domain !== void 0 ? _child$props$domain : defaultDomain;
      if (dataKey) {
        domain = getDomainOfDataByKey(displayedData, dataKey, type);
        if (type === "category" && isCategorical) {
          var duplicate = hasDuplicate(domain);
          if (allowDuplicatedCategory && duplicate) {
            duplicateDomain = domain;
            domain = (0, import_range3.default)(0, len);
          } else if (!allowDuplicatedCategory) {
            domain = parseDomainOfCategoryAxis(childDomain, domain, child).reduce(function(finalDomain, entry) {
              return finalDomain.indexOf(entry) >= 0 ? finalDomain : [].concat(_toConsumableArray13(finalDomain), [entry]);
            }, []);
          }
        } else if (type === "category") {
          if (!allowDuplicatedCategory) {
            domain = parseDomainOfCategoryAxis(childDomain, domain, child).reduce(function(finalDomain, entry) {
              return finalDomain.indexOf(entry) >= 0 || entry === "" || (0, import_isNil14.default)(entry) ? finalDomain : [].concat(_toConsumableArray13(finalDomain), [entry]);
            }, []);
          } else {
            domain = domain.filter(function(entry) {
              return entry !== "" && !(0, import_isNil14.default)(entry);
            });
          }
        } else if (type === "number") {
          var errorBarsDomain = parseErrorBarsOfAxis(displayedData, graphicalItems.filter(function(item) {
            return item.props[axisIdKey] === axisId && (includeHidden || !item.props.hide);
          }), dataKey, axisType, layout);
          if (errorBarsDomain) {
            domain = errorBarsDomain;
          }
        }
        if (isCategorical && (type === "number" || scale !== "auto")) {
          categoricalDomain = getDomainOfDataByKey(displayedData, dataKey, "category");
        }
      } else if (isCategorical) {
        domain = (0, import_range3.default)(0, len);
      } else if (stackGroups && stackGroups[axisId] && stackGroups[axisId].hasStack && type === "number") {
        domain = stackOffset === "expand" ? [0, 1] : getDomainOfStackGroups(stackGroups[axisId].stackGroups, dataStartIndex, dataEndIndex);
      } else {
        domain = getDomainOfItemsWithSameAxis(displayedData, graphicalItems.filter(function(item) {
          return item.props[axisIdKey] === axisId && (includeHidden || !item.props.hide);
        }), type, layout, true);
      }
      if (type === "number") {
        domain = detectReferenceElementsDomain(children, domain, axisId, axisType, ticks2);
        if (childDomain) {
          domain = parseSpecifiedDomain(childDomain, domain, allowDataOverflow);
        }
      } else if (type === "category" && childDomain) {
        var axisDomain = childDomain;
        var isDomainValid = domain.every(function(entry) {
          return axisDomain.indexOf(entry) >= 0;
        });
        if (isDomainValid) {
          domain = axisDomain;
        }
      }
    }
    return _objectSpread40(_objectSpread40({}, result), {}, _defineProperty41({}, axisId, _objectSpread40(_objectSpread40({}, child.props), {}, {
      axisType,
      domain,
      categoricalDomain,
      duplicateDomain,
      originalDomain: (_child$props$domain2 = child.props.domain) !== null && _child$props$domain2 !== void 0 ? _child$props$domain2 : defaultDomain,
      isCategorical,
      layout
    })));
  }, {});
  return axisMap;
};
var getAxisMapByItems = function getAxisMapByItems2(props, _ref32) {
  var graphicalItems = _ref32.graphicalItems, Axis = _ref32.Axis, axisType = _ref32.axisType, axisIdKey = _ref32.axisIdKey, stackGroups = _ref32.stackGroups, dataStartIndex = _ref32.dataStartIndex, dataEndIndex = _ref32.dataEndIndex;
  var layout = props.layout, children = props.children;
  var displayedData = getDisplayedData(props.data, {
    graphicalItems,
    dataStartIndex,
    dataEndIndex
  });
  var len = displayedData.length;
  var isCategorical = isCategoricalAxis(layout, axisType);
  var index = -1;
  var axisMap = graphicalItems.reduce(function(result, child) {
    var axisId = child.props[axisIdKey];
    var originalDomain = getDefaultDomainByAxisType("number");
    if (!result[axisId]) {
      index++;
      var domain;
      if (isCategorical) {
        domain = (0, import_range3.default)(0, len);
      } else if (stackGroups && stackGroups[axisId] && stackGroups[axisId].hasStack) {
        domain = getDomainOfStackGroups(stackGroups[axisId].stackGroups, dataStartIndex, dataEndIndex);
        domain = detectReferenceElementsDomain(children, domain, axisId, axisType);
      } else {
        domain = parseSpecifiedDomain(originalDomain, getDomainOfItemsWithSameAxis(displayedData, graphicalItems.filter(function(item) {
          return item.props[axisIdKey] === axisId && !item.props.hide;
        }), "number", layout), Axis.defaultProps.allowDataOverflow);
        domain = detectReferenceElementsDomain(children, domain, axisId, axisType);
      }
      return _objectSpread40(_objectSpread40({}, result), {}, _defineProperty41({}, axisId, _objectSpread40(_objectSpread40({
        axisType
      }, Axis.defaultProps), {}, {
        hide: true,
        orientation: (0, import_get7.default)(ORIENT_MAP, "".concat(axisType, ".").concat(index % 2), null),
        domain,
        originalDomain,
        isCategorical,
        layout
        // specify scale when no Axis
        // scale: isCategorical ? 'band' : 'linear',
      })));
    }
    return result;
  }, {});
  return axisMap;
};
var getAxisMap = function getAxisMap2(props, _ref42) {
  var _ref4$axisType = _ref42.axisType, axisType = _ref4$axisType === void 0 ? "xAxis" : _ref4$axisType, AxisComp = _ref42.AxisComp, graphicalItems = _ref42.graphicalItems, stackGroups = _ref42.stackGroups, dataStartIndex = _ref42.dataStartIndex, dataEndIndex = _ref42.dataEndIndex;
  var children = props.children;
  var axisIdKey = "".concat(axisType, "Id");
  var axes = findAllByType(children, AxisComp);
  var axisMap = {};
  if (axes && axes.length) {
    axisMap = getAxisMapByAxes(props, {
      axes,
      graphicalItems,
      axisType,
      axisIdKey,
      stackGroups,
      dataStartIndex,
      dataEndIndex
    });
  } else if (graphicalItems && graphicalItems.length) {
    axisMap = getAxisMapByItems(props, {
      Axis: AxisComp,
      graphicalItems,
      axisType,
      axisIdKey,
      stackGroups,
      dataStartIndex,
      dataEndIndex
    });
  }
  return axisMap;
};
var tooltipTicksGenerator = function tooltipTicksGenerator2(axisMap) {
  var axis = getAnyElementOfObject(axisMap);
  var tooltipTicks = getTicksOfAxis(axis, false, true);
  return {
    tooltipTicks,
    orderedTooltipTicks: (0, import_sortBy3.default)(tooltipTicks, function(o) {
      return o.coordinate;
    }),
    tooltipAxis: axis,
    tooltipAxisBandSize: getBandSizeOfAxis(axis, tooltipTicks)
  };
};
var createDefaultState = function createDefaultState2(props) {
  var _brushItem$props, _brushItem$props2;
  var children = props.children, defaultShowTooltip = props.defaultShowTooltip;
  var brushItem = findChildByType(children, Brush);
  var startIndex = brushItem && brushItem.props && brushItem.props.startIndex || 0;
  var endIndex = (brushItem === null || brushItem === void 0 || (_brushItem$props = brushItem.props) === null || _brushItem$props === void 0 ? void 0 : _brushItem$props.endIndex) !== void 0 ? brushItem === null || brushItem === void 0 || (_brushItem$props2 = brushItem.props) === null || _brushItem$props2 === void 0 ? void 0 : _brushItem$props2.endIndex : props.data && props.data.length - 1 || 0;
  return {
    chartX: 0,
    chartY: 0,
    dataStartIndex: startIndex,
    dataEndIndex: endIndex,
    activeTooltipIndex: -1,
    isTooltipActive: !(0, import_isNil14.default)(defaultShowTooltip) ? defaultShowTooltip : false
  };
};
var hasGraphicalBarItem = function hasGraphicalBarItem2(graphicalItems) {
  if (!graphicalItems || !graphicalItems.length) {
    return false;
  }
  return graphicalItems.some(function(item) {
    var name2 = getDisplayName(item && item.type);
    return name2 && name2.indexOf("Bar") >= 0;
  });
};
var getAxisNameByLayout = function getAxisNameByLayout2(layout) {
  if (layout === "horizontal") {
    return {
      numericAxisName: "yAxis",
      cateAxisName: "xAxis"
    };
  }
  if (layout === "vertical") {
    return {
      numericAxisName: "xAxis",
      cateAxisName: "yAxis"
    };
  }
  if (layout === "centric") {
    return {
      numericAxisName: "radiusAxis",
      cateAxisName: "angleAxis"
    };
  }
  return {
    numericAxisName: "angleAxis",
    cateAxisName: "radiusAxis"
  };
};
var calculateOffset = function calculateOffset2(_ref52, prevLegendBBox) {
  var props = _ref52.props, graphicalItems = _ref52.graphicalItems, _ref5$xAxisMap = _ref52.xAxisMap, xAxisMap = _ref5$xAxisMap === void 0 ? {} : _ref5$xAxisMap, _ref5$yAxisMap = _ref52.yAxisMap, yAxisMap = _ref5$yAxisMap === void 0 ? {} : _ref5$yAxisMap;
  var width = props.width, height = props.height, children = props.children;
  var margin = props.margin || {};
  var brushItem = findChildByType(children, Brush);
  var legendItem = findChildByType(children, Legend);
  var offsetH = Object.keys(yAxisMap).reduce(function(result, id2) {
    var entry = yAxisMap[id2];
    var orientation = entry.orientation;
    if (!entry.mirror && !entry.hide) {
      return _objectSpread40(_objectSpread40({}, result), {}, _defineProperty41({}, orientation, result[orientation] + entry.width));
    }
    return result;
  }, {
    left: margin.left || 0,
    right: margin.right || 0
  });
  var offsetV = Object.keys(xAxisMap).reduce(function(result, id2) {
    var entry = xAxisMap[id2];
    var orientation = entry.orientation;
    if (!entry.mirror && !entry.hide) {
      return _objectSpread40(_objectSpread40({}, result), {}, _defineProperty41({}, orientation, (0, import_get7.default)(result, "".concat(orientation)) + entry.height));
    }
    return result;
  }, {
    top: margin.top || 0,
    bottom: margin.bottom || 0
  });
  var offset = _objectSpread40(_objectSpread40({}, offsetV), offsetH);
  var brushBottom = offset.bottom;
  if (brushItem) {
    offset.bottom += brushItem.props.height || Brush.defaultProps.height;
  }
  if (legendItem && prevLegendBBox) {
    offset = appendOffsetOfLegend(offset, graphicalItems, props, prevLegendBBox);
  }
  return _objectSpread40(_objectSpread40({
    brushBottom
  }, offset), {}, {
    width: width - offset.left - offset.right,
    height: height - offset.top - offset.bottom
  });
};
var generateCategoricalChart = function generateCategoricalChart2(_ref62) {
  var _class4;
  var chartName = _ref62.chartName, GraphicalChild = _ref62.GraphicalChild, _ref6$defaultTooltipE = _ref62.defaultTooltipEventType, defaultTooltipEventType = _ref6$defaultTooltipE === void 0 ? "axis" : _ref6$defaultTooltipE, _ref6$validateTooltip = _ref62.validateTooltipEventTypes, validateTooltipEventTypes = _ref6$validateTooltip === void 0 ? ["axis"] : _ref6$validateTooltip, axisComponents = _ref62.axisComponents, legendContent = _ref62.legendContent, formatAxisMap5 = _ref62.formatAxisMap, defaultProps5 = _ref62.defaultProps;
  var getFormatItems = function getFormatItems2(props, currentState2) {
    var graphicalItems = currentState2.graphicalItems, stackGroups = currentState2.stackGroups, offset = currentState2.offset, updateId = currentState2.updateId, dataStartIndex = currentState2.dataStartIndex, dataEndIndex = currentState2.dataEndIndex;
    var barSize = props.barSize, layout = props.layout, barGap = props.barGap, barCategoryGap = props.barCategoryGap, globalMaxBarSize = props.maxBarSize;
    var _getAxisNameByLayout = getAxisNameByLayout(layout), numericAxisName = _getAxisNameByLayout.numericAxisName, cateAxisName = _getAxisNameByLayout.cateAxisName;
    var hasBar = hasGraphicalBarItem(graphicalItems);
    var sizeList = hasBar && getBarSizeList({
      barSize,
      stackGroups
    });
    var formattedItems = [];
    graphicalItems.forEach(function(item, index) {
      var displayedData = getDisplayedData(props.data, {
        dataStartIndex,
        dataEndIndex
      }, item);
      var _item$props = item.props, dataKey = _item$props.dataKey, childMaxBarSize = _item$props.maxBarSize;
      var numericAxisId = item.props["".concat(numericAxisName, "Id")];
      var cateAxisId = item.props["".concat(cateAxisName, "Id")];
      var axisObjInitialValue = {};
      var axisObj = axisComponents.reduce(function(result, entry) {
        var _item$type$displayNam, _item$type, _objectSpread62;
        var axisMap = currentState2["".concat(entry.axisType, "Map")];
        var id2 = item.props["".concat(entry.axisType, "Id")];
        !(axisMap && axisMap[id2] || entry.axisType === "zAxis") ? true ? invariant2(false, "Specifying a(n) ".concat(entry.axisType, "Id requires a corresponding ").concat(
          entry.axisType,
          "Id on the targeted graphical component "
        ).concat((_item$type$displayNam = item === null || item === void 0 || (_item$type = item.type) === null || _item$type === void 0 ? void 0 : _item$type.displayName) !== null && _item$type$displayNam !== void 0 ? _item$type$displayNam : "")) : invariant2(false) : void 0;
        var axis = axisMap[id2];
        return _objectSpread40(_objectSpread40({}, result), {}, (_objectSpread62 = {}, _defineProperty41(_objectSpread62, entry.axisType, axis), _defineProperty41(_objectSpread62, "".concat(entry.axisType, "Ticks"), getTicksOfAxis(axis)), _objectSpread62));
      }, axisObjInitialValue);
      var cateAxis = axisObj[cateAxisName];
      var cateTicks = axisObj["".concat(cateAxisName, "Ticks")];
      var stackedData = stackGroups && stackGroups[numericAxisId] && stackGroups[numericAxisId].hasStack && getStackedDataOfItem(item, stackGroups[numericAxisId].stackGroups);
      var itemIsBar = getDisplayName(item.type).indexOf("Bar") >= 0;
      var bandSize = getBandSizeOfAxis(cateAxis, cateTicks);
      var barPosition = [];
      if (itemIsBar) {
        var _ref72, _getBandSizeOfAxis;
        var maxBarSize = (0, import_isNil14.default)(childMaxBarSize) ? globalMaxBarSize : childMaxBarSize;
        var barBandSize = (_ref72 = (_getBandSizeOfAxis = getBandSizeOfAxis(cateAxis, cateTicks, true)) !== null && _getBandSizeOfAxis !== void 0 ? _getBandSizeOfAxis : maxBarSize) !== null && _ref72 !== void 0 ? _ref72 : 0;
        barPosition = getBarPosition({
          barGap,
          barCategoryGap,
          bandSize: barBandSize !== bandSize ? barBandSize : bandSize,
          sizeList: sizeList[cateAxisId],
          maxBarSize
        });
        if (barBandSize !== bandSize) {
          barPosition = barPosition.map(function(pos) {
            return _objectSpread40(_objectSpread40({}, pos), {}, {
              position: _objectSpread40(_objectSpread40({}, pos.position), {}, {
                offset: pos.position.offset - barBandSize / 2
              })
            });
          });
        }
      }
      var composedFn = item && item.type && item.type.getComposedData;
      if (composedFn) {
        var _objectSpread72;
        formattedItems.push({
          props: _objectSpread40(_objectSpread40({}, composedFn(_objectSpread40(_objectSpread40({}, axisObj), {}, {
            displayedData,
            props,
            dataKey,
            item,
            bandSize,
            barPosition,
            offset,
            stackedData,
            layout,
            dataStartIndex,
            dataEndIndex
          }))), {}, (_objectSpread72 = {
            key: item.key || "item-".concat(index)
          }, _defineProperty41(_objectSpread72, numericAxisName, axisObj[numericAxisName]), _defineProperty41(_objectSpread72, cateAxisName, axisObj[cateAxisName]), _defineProperty41(_objectSpread72, "animationId", updateId), _objectSpread72)),
          childIndex: parseChildIndex(item, props.children),
          item
        });
      }
    });
    return formattedItems;
  };
  var updateStateOfAxisMapsOffsetAndStackGroups = function updateStateOfAxisMapsOffsetAndStackGroups2(_ref82, prevState) {
    var props = _ref82.props, dataStartIndex = _ref82.dataStartIndex, dataEndIndex = _ref82.dataEndIndex, updateId = _ref82.updateId;
    if (!validateWidthHeight({
      props
    })) {
      return null;
    }
    var children = props.children, layout = props.layout, stackOffset = props.stackOffset, data = props.data, reverseStackOrder = props.reverseStackOrder;
    var _getAxisNameByLayout2 = getAxisNameByLayout(layout), numericAxisName = _getAxisNameByLayout2.numericAxisName, cateAxisName = _getAxisNameByLayout2.cateAxisName;
    var graphicalItems = findAllByType(children, GraphicalChild);
    var stackGroups = getStackGroupsByAxisId(data, graphicalItems, "".concat(numericAxisName, "Id"), "".concat(cateAxisName, "Id"), stackOffset, reverseStackOrder);
    var axisObj = axisComponents.reduce(function(result, entry) {
      var name2 = "".concat(entry.axisType, "Map");
      return _objectSpread40(_objectSpread40({}, result), {}, _defineProperty41({}, name2, getAxisMap(props, _objectSpread40(_objectSpread40({}, entry), {}, {
        graphicalItems,
        stackGroups: entry.axisType === numericAxisName && stackGroups,
        dataStartIndex,
        dataEndIndex
      }))));
    }, {});
    var offset = calculateOffset(_objectSpread40(_objectSpread40({}, axisObj), {}, {
      props,
      graphicalItems
    }), prevState === null || prevState === void 0 ? void 0 : prevState.legendBBox);
    Object.keys(axisObj).forEach(function(key) {
      axisObj[key] = formatAxisMap5(props, axisObj[key], offset, key.replace("Map", ""), chartName);
    });
    var cateAxisMap = axisObj["".concat(cateAxisName, "Map")];
    var ticksObj = tooltipTicksGenerator(cateAxisMap);
    var formattedGraphicalItems = getFormatItems(props, _objectSpread40(_objectSpread40({}, axisObj), {}, {
      dataStartIndex,
      dataEndIndex,
      updateId,
      graphicalItems,
      stackGroups,
      offset
    }));
    return _objectSpread40(_objectSpread40({
      formattedGraphicalItems,
      graphicalItems,
      offset,
      stackGroups
    }, ticksObj), axisObj);
  };
  return _class4 = /* @__PURE__ */ function(_Component) {
    _inherits16(CategoricalChartWrapper, _Component);
    var _super = _createSuper16(CategoricalChartWrapper);
    function CategoricalChartWrapper(_props) {
      var _this;
      _classCallCheck19(this, CategoricalChartWrapper);
      _this = _super.call(this, _props);
      _defineProperty41(_assertThisInitialized18(_this), "accessibilityManager", new AccessibilityManager());
      _defineProperty41(_assertThisInitialized18(_this), "clearDefer", function() {
        if (_this.cancelDefer) {
          _this.cancelDefer();
          _this.cancelDefer = null;
        }
      });
      _defineProperty41(_assertThisInitialized18(_this), "handleLegendBBoxUpdate", function(box) {
        if (box) {
          var _this$state = _this.state, dataStartIndex = _this$state.dataStartIndex, dataEndIndex = _this$state.dataEndIndex, updateId = _this$state.updateId;
          _this.setState(_objectSpread40({
            legendBBox: box
          }, updateStateOfAxisMapsOffsetAndStackGroups({
            props: _this.props,
            dataStartIndex,
            dataEndIndex,
            updateId
          }, _objectSpread40(_objectSpread40({}, _this.state), {}, {
            legendBBox: box
          }))));
        }
      });
      _defineProperty41(_assertThisInitialized18(_this), "handleReceiveSyncEvent", function(cId, chartId, data) {
        var syncId = _this.props.syncId;
        if (syncId === cId && chartId !== _this.uniqueChartId) {
          _this.clearDefer();
          _this.cancelDefer = deferer(_this.applySyncEvent.bind(_assertThisInitialized18(_this), data));
        }
      });
      _defineProperty41(_assertThisInitialized18(_this), "handleBrushChange", function(_ref92) {
        var startIndex = _ref92.startIndex, endIndex = _ref92.endIndex;
        if (startIndex !== _this.state.dataStartIndex || endIndex !== _this.state.dataEndIndex) {
          var updateId = _this.state.updateId;
          _this.setState(function() {
            return _objectSpread40({
              dataStartIndex: startIndex,
              dataEndIndex: endIndex
            }, updateStateOfAxisMapsOffsetAndStackGroups({
              props: _this.props,
              dataStartIndex: startIndex,
              dataEndIndex: endIndex,
              updateId
            }, _this.state));
          });
          _this.triggerSyncEvent({
            dataStartIndex: startIndex,
            dataEndIndex: endIndex
          });
        }
      });
      _defineProperty41(_assertThisInitialized18(_this), "handleMouseEnter", function(e3) {
        var onMouseEnter = _this.props.onMouseEnter;
        var mouse = _this.getMouseInfo(e3);
        if (mouse) {
          var _nextState = _objectSpread40(_objectSpread40({}, mouse), {}, {
            isTooltipActive: true
          });
          _this.setState(_nextState);
          _this.triggerSyncEvent(_nextState);
          if ((0, import_isFunction23.default)(onMouseEnter)) {
            onMouseEnter(_nextState, e3);
          }
        }
      });
      _defineProperty41(_assertThisInitialized18(_this), "triggeredAfterMouseMove", function(e3) {
        var onMouseMove = _this.props.onMouseMove;
        var mouse = _this.getMouseInfo(e3);
        var nextState = mouse ? _objectSpread40(_objectSpread40({}, mouse), {}, {
          isTooltipActive: true
        }) : {
          isTooltipActive: false
        };
        _this.setState(nextState);
        _this.triggerSyncEvent(nextState);
        if ((0, import_isFunction23.default)(onMouseMove)) {
          onMouseMove(nextState, e3);
        }
      });
      _defineProperty41(_assertThisInitialized18(_this), "handleItemMouseEnter", function(el) {
        _this.setState(function() {
          return {
            isTooltipActive: true,
            activeItem: el,
            activePayload: el.tooltipPayload,
            activeCoordinate: el.tooltipPosition || {
              x: el.cx,
              y: el.cy
            }
          };
        });
      });
      _defineProperty41(_assertThisInitialized18(_this), "handleItemMouseLeave", function() {
        _this.setState(function() {
          return {
            isTooltipActive: false
          };
        });
      });
      _defineProperty41(_assertThisInitialized18(_this), "handleMouseMove", function(e3) {
        if (e3 && (0, import_isFunction23.default)(e3.persist)) {
          e3.persist();
        }
        _this.triggeredAfterMouseMove(e3);
      });
      _defineProperty41(_assertThisInitialized18(_this), "handleMouseLeave", function(e3) {
        var onMouseLeave = _this.props.onMouseLeave;
        var nextState = {
          isTooltipActive: false
        };
        _this.setState(nextState);
        _this.triggerSyncEvent(nextState);
        if ((0, import_isFunction23.default)(onMouseLeave)) {
          onMouseLeave(nextState, e3);
        }
        _this.cancelThrottledTriggerAfterMouseMove();
      });
      _defineProperty41(_assertThisInitialized18(_this), "handleOuterEvent", function(e3) {
        var eventName = getReactEventByType(e3);
        var event = (0, import_get7.default)(_this.props, "".concat(eventName));
        if (eventName && (0, import_isFunction23.default)(event)) {
          var mouse;
          if (/.*touch.*/i.test(eventName)) {
            mouse = _this.getMouseInfo(e3.changedTouches[0]);
          } else {
            mouse = _this.getMouseInfo(e3);
          }
          var handler = event;
          handler(mouse, e3);
        }
      });
      _defineProperty41(_assertThisInitialized18(_this), "handleClick", function(e3) {
        var onClick = _this.props.onClick;
        var mouse = _this.getMouseInfo(e3);
        if (mouse) {
          var _nextState2 = _objectSpread40(_objectSpread40({}, mouse), {}, {
            isTooltipActive: true
          });
          _this.setState(_nextState2);
          _this.triggerSyncEvent(_nextState2);
          if ((0, import_isFunction23.default)(onClick)) {
            onClick(_nextState2, e3);
          }
        }
      });
      _defineProperty41(_assertThisInitialized18(_this), "handleMouseDown", function(e3) {
        var onMouseDown = _this.props.onMouseDown;
        if ((0, import_isFunction23.default)(onMouseDown)) {
          var _nextState3 = _this.getMouseInfo(e3);
          onMouseDown(_nextState3, e3);
        }
      });
      _defineProperty41(_assertThisInitialized18(_this), "handleMouseUp", function(e3) {
        var onMouseUp = _this.props.onMouseUp;
        if ((0, import_isFunction23.default)(onMouseUp)) {
          var _nextState4 = _this.getMouseInfo(e3);
          onMouseUp(_nextState4, e3);
        }
      });
      _defineProperty41(_assertThisInitialized18(_this), "handleTouchMove", function(e3) {
        if (e3.changedTouches != null && e3.changedTouches.length > 0) {
          _this.handleMouseMove(e3.changedTouches[0]);
        }
      });
      _defineProperty41(_assertThisInitialized18(_this), "handleTouchStart", function(e3) {
        if (e3.changedTouches != null && e3.changedTouches.length > 0) {
          _this.handleMouseDown(e3.changedTouches[0]);
        }
      });
      _defineProperty41(_assertThisInitialized18(_this), "handleTouchEnd", function(e3) {
        if (e3.changedTouches != null && e3.changedTouches.length > 0) {
          _this.handleMouseUp(e3.changedTouches[0]);
        }
      });
      _defineProperty41(_assertThisInitialized18(_this), "verticalCoordinatesGenerator", function(_ref102, syncWithTicks) {
        var xAxis = _ref102.xAxis, width = _ref102.width, height = _ref102.height, offset = _ref102.offset;
        return getCoordinatesOfGrid(getTicks(_objectSpread40(_objectSpread40(_objectSpread40({}, CartesianAxis.defaultProps), xAxis), {}, {
          ticks: getTicksOfAxis(xAxis, true),
          viewBox: {
            x: 0,
            y: 0,
            width,
            height
          }
        })), offset.left, offset.left + offset.width, syncWithTicks);
      });
      _defineProperty41(_assertThisInitialized18(_this), "horizontalCoordinatesGenerator", function(_ref112, syncWithTicks) {
        var yAxis = _ref112.yAxis, width = _ref112.width, height = _ref112.height, offset = _ref112.offset;
        return getCoordinatesOfGrid(getTicks(_objectSpread40(_objectSpread40(_objectSpread40({}, CartesianAxis.defaultProps), yAxis), {}, {
          ticks: getTicksOfAxis(yAxis, true),
          viewBox: {
            x: 0,
            y: 0,
            width,
            height
          }
        })), offset.top, offset.top + offset.height, syncWithTicks);
      });
      _defineProperty41(_assertThisInitialized18(_this), "axesTicksGenerator", function(axis) {
        return getTicksOfAxis(axis, true);
      });
      _defineProperty41(_assertThisInitialized18(_this), "renderCursor", function(element2) {
        var _this$state2 = _this.state, isTooltipActive = _this$state2.isTooltipActive, activeCoordinate = _this$state2.activeCoordinate, activePayload = _this$state2.activePayload, offset = _this$state2.offset, activeTooltipIndex = _this$state2.activeTooltipIndex, tooltipAxisBandSize = _this$state2.tooltipAxisBandSize;
        var tooltipEventType = _this.getTooltipEventType();
        if (!element2 || !element2.props.cursor || !isTooltipActive || !activeCoordinate || chartName !== "ScatterChart" && tooltipEventType !== "axis") {
          return null;
        }
        var layout = _this.props.layout;
        var restProps;
        var cursorComp = Curve2;
        if (chartName === "ScatterChart") {
          restProps = activeCoordinate;
          cursorComp = Cross;
        } else if (chartName === "BarChart") {
          restProps = getCursorRectangle(layout, activeCoordinate, offset, tooltipAxisBandSize);
          cursorComp = Rectangle;
        } else if (layout === "radial") {
          var _getRadialCursorPoint = getRadialCursorPoints(activeCoordinate), cx = _getRadialCursorPoint.cx, cy = _getRadialCursorPoint.cy, radius = _getRadialCursorPoint.radius, startAngle = _getRadialCursorPoint.startAngle, endAngle = _getRadialCursorPoint.endAngle;
          restProps = {
            cx,
            cy,
            startAngle,
            endAngle,
            innerRadius: radius,
            outerRadius: radius
          };
          cursorComp = Sector;
        } else {
          restProps = {
            points: getCursorPoints(layout, activeCoordinate, offset)
          };
          cursorComp = Curve2;
        }
        var key = element2.key || "_recharts-cursor";
        var cursorProps = _objectSpread40(_objectSpread40(_objectSpread40(_objectSpread40({
          stroke: "#ccc",
          pointerEvents: "none"
        }, offset), restProps), filterProps(element2.props.cursor)), {}, {
          payload: activePayload,
          payloadIndex: activeTooltipIndex,
          key,
          className: "recharts-tooltip-cursor"
        });
        return /* @__PURE__ */ (0, import_react117.isValidElement)(element2.props.cursor) ? /* @__PURE__ */ (0, import_react117.cloneElement)(element2.props.cursor, cursorProps) : /* @__PURE__ */ (0, import_react117.createElement)(cursorComp, cursorProps);
      });
      _defineProperty41(_assertThisInitialized18(_this), "renderPolarAxis", function(element2, displayName, index) {
        var axisType = (0, import_get7.default)(element2, "type.axisType");
        var axisMap = (0, import_get7.default)(_this.state, "".concat(axisType, "Map"));
        var axisOption = axisMap && axisMap[element2.props["".concat(axisType, "Id")]];
        return /* @__PURE__ */ (0, import_react117.cloneElement)(element2, _objectSpread40(_objectSpread40({}, axisOption), {}, {
          className: axisType,
          key: element2.key || "".concat(displayName, "-").concat(index),
          ticks: getTicksOfAxis(axisOption, true)
        }));
      });
      _defineProperty41(_assertThisInitialized18(_this), "renderXAxis", function(element2, displayName, index) {
        var xAxisMap = _this.state.xAxisMap;
        var axisObj = xAxisMap[element2.props.xAxisId];
        return _this.renderAxis(axisObj, element2, displayName, index);
      });
      _defineProperty41(_assertThisInitialized18(_this), "renderYAxis", function(element2, displayName, index) {
        var yAxisMap = _this.state.yAxisMap;
        var axisObj = yAxisMap[element2.props.yAxisId];
        return _this.renderAxis(axisObj, element2, displayName, index);
      });
      _defineProperty41(_assertThisInitialized18(_this), "renderGrid", function(element2) {
        var _this$state3 = _this.state, xAxisMap = _this$state3.xAxisMap, yAxisMap = _this$state3.yAxisMap, offset = _this$state3.offset;
        var _this$props = _this.props, width = _this$props.width, height = _this$props.height;
        var xAxis = getAnyElementOfObject(xAxisMap);
        var yAxisWithFiniteDomain = (0, import_find.default)(yAxisMap, function(axis) {
          return (0, import_every2.default)(axis.domain, isFinit);
        });
        var yAxis = yAxisWithFiniteDomain || getAnyElementOfObject(yAxisMap);
        var props = element2.props || {};
        return /* @__PURE__ */ (0, import_react117.cloneElement)(element2, {
          key: element2.key || "grid",
          x: isNumber(props.x) ? props.x : offset.left,
          y: isNumber(props.y) ? props.y : offset.top,
          width: isNumber(props.width) ? props.width : offset.width,
          height: isNumber(props.height) ? props.height : offset.height,
          xAxis,
          yAxis,
          offset,
          chartWidth: width,
          chartHeight: height,
          verticalCoordinatesGenerator: props.verticalCoordinatesGenerator || _this.verticalCoordinatesGenerator,
          horizontalCoordinatesGenerator: props.horizontalCoordinatesGenerator || _this.horizontalCoordinatesGenerator
        });
      });
      _defineProperty41(_assertThisInitialized18(_this), "renderPolarGrid", function(element2) {
        var _element$props = element2.props, radialLines = _element$props.radialLines, polarAngles = _element$props.polarAngles, polarRadius = _element$props.polarRadius;
        var _this$state4 = _this.state, radiusAxisMap = _this$state4.radiusAxisMap, angleAxisMap = _this$state4.angleAxisMap;
        var radiusAxis = getAnyElementOfObject(radiusAxisMap);
        var angleAxis = getAnyElementOfObject(angleAxisMap);
        var cx = angleAxis.cx, cy = angleAxis.cy, innerRadius = angleAxis.innerRadius, outerRadius = angleAxis.outerRadius;
        return /* @__PURE__ */ (0, import_react117.cloneElement)(element2, {
          polarAngles: (0, import_isArray9.default)(polarAngles) ? polarAngles : getTicksOfAxis(angleAxis, true).map(function(entry) {
            return entry.coordinate;
          }),
          polarRadius: (0, import_isArray9.default)(polarRadius) ? polarRadius : getTicksOfAxis(radiusAxis, true).map(function(entry) {
            return entry.coordinate;
          }),
          cx,
          cy,
          innerRadius,
          outerRadius,
          key: element2.key || "polar-grid",
          radialLines
        });
      });
      _defineProperty41(_assertThisInitialized18(_this), "renderLegend", function() {
        var formattedGraphicalItems = _this.state.formattedGraphicalItems;
        var _this$props2 = _this.props, children = _this$props2.children, width = _this$props2.width, height = _this$props2.height;
        var margin = _this.props.margin || {};
        var legendWidth = width - (margin.left || 0) - (margin.right || 0);
        var props = getLegendProps({
          children,
          formattedGraphicalItems,
          legendWidth,
          legendContent
        });
        if (!props) {
          return null;
        }
        var item = props.item, otherProps = _objectWithoutProperties23(props, _excluded35);
        return /* @__PURE__ */ (0, import_react117.cloneElement)(item, _objectSpread40(_objectSpread40({}, otherProps), {}, {
          chartWidth: width,
          chartHeight: height,
          margin,
          onBBoxUpdate: _this.handleLegendBBoxUpdate
        }));
      });
      _defineProperty41(_assertThisInitialized18(_this), "renderTooltip", function() {
        var children = _this.props.children;
        var tooltipItem = findChildByType(children, Tooltip2);
        if (!tooltipItem) {
          return null;
        }
        var _this$state5 = _this.state, isTooltipActive = _this$state5.isTooltipActive, activeCoordinate = _this$state5.activeCoordinate, activePayload = _this$state5.activePayload, activeLabel = _this$state5.activeLabel, offset = _this$state5.offset;
        return /* @__PURE__ */ (0, import_react117.cloneElement)(tooltipItem, {
          viewBox: _objectSpread40(_objectSpread40({}, offset), {}, {
            x: offset.left,
            y: offset.top
          }),
          active: isTooltipActive,
          label: activeLabel,
          payload: isTooltipActive ? activePayload : [],
          coordinate: activeCoordinate
        });
      });
      _defineProperty41(_assertThisInitialized18(_this), "renderBrush", function(element2) {
        var _this$props3 = _this.props, margin = _this$props3.margin, data = _this$props3.data;
        var _this$state6 = _this.state, offset = _this$state6.offset, dataStartIndex = _this$state6.dataStartIndex, dataEndIndex = _this$state6.dataEndIndex, updateId = _this$state6.updateId;
        return /* @__PURE__ */ (0, import_react117.cloneElement)(element2, {
          key: element2.key || "_recharts-brush",
          onChange: combineEventHandlers(_this.handleBrushChange, null, element2.props.onChange),
          data,
          x: isNumber(element2.props.x) ? element2.props.x : offset.left,
          y: isNumber(element2.props.y) ? element2.props.y : offset.top + offset.height + offset.brushBottom - (margin.bottom || 0),
          width: isNumber(element2.props.width) ? element2.props.width : offset.width,
          startIndex: dataStartIndex,
          endIndex: dataEndIndex,
          updateId: "brush-".concat(updateId)
        });
      });
      _defineProperty41(_assertThisInitialized18(_this), "renderReferenceElement", function(element2, displayName, index) {
        if (!element2) {
          return null;
        }
        var _assertThisInitialize = _assertThisInitialized18(_this), clipPathId = _assertThisInitialize.clipPathId;
        var _this$state7 = _this.state, xAxisMap = _this$state7.xAxisMap, yAxisMap = _this$state7.yAxisMap, offset = _this$state7.offset;
        var _element$props2 = element2.props, xAxisId = _element$props2.xAxisId, yAxisId = _element$props2.yAxisId;
        return /* @__PURE__ */ (0, import_react117.cloneElement)(element2, {
          key: element2.key || "".concat(displayName, "-").concat(index),
          xAxis: xAxisMap[xAxisId],
          yAxis: yAxisMap[yAxisId],
          viewBox: {
            x: offset.left,
            y: offset.top,
            width: offset.width,
            height: offset.height
          },
          clipPathId
        });
      });
      _defineProperty41(_assertThisInitialized18(_this), "renderActivePoints", function(_ref122) {
        var item = _ref122.item, activePoint = _ref122.activePoint, basePoint = _ref122.basePoint, childIndex = _ref122.childIndex, isRange = _ref122.isRange;
        var result = [];
        var key = item.props.key;
        var _item$item$props = item.item.props, activeDot = _item$item$props.activeDot, dataKey = _item$item$props.dataKey;
        var dotProps = _objectSpread40(_objectSpread40({
          index: childIndex,
          dataKey,
          cx: activePoint.x,
          cy: activePoint.y,
          r: 4,
          fill: getMainColorOfGraphicItem(item.item),
          strokeWidth: 2,
          stroke: "#fff",
          payload: activePoint.payload,
          value: activePoint.value,
          key: "".concat(key, "-activePoint-").concat(childIndex)
        }, filterProps(activeDot)), adaptEventHandlers(activeDot));
        result.push(CategoricalChartWrapper.renderActiveDot(activeDot, dotProps));
        if (basePoint) {
          result.push(CategoricalChartWrapper.renderActiveDot(activeDot, _objectSpread40(_objectSpread40({}, dotProps), {}, {
            cx: basePoint.x,
            cy: basePoint.y,
            key: "".concat(key, "-basePoint-").concat(childIndex)
          })));
        } else if (isRange) {
          result.push(null);
        }
        return result;
      });
      _defineProperty41(_assertThisInitialized18(_this), "renderGraphicChild", function(element2, displayName, index) {
        var item = _this.filterFormatItem(element2, displayName, index);
        if (!item) {
          return null;
        }
        var tooltipEventType = _this.getTooltipEventType();
        var _this$state8 = _this.state, isTooltipActive = _this$state8.isTooltipActive, tooltipAxis = _this$state8.tooltipAxis, activeTooltipIndex = _this$state8.activeTooltipIndex, activeLabel = _this$state8.activeLabel;
        var children = _this.props.children;
        var tooltipItem = findChildByType(children, Tooltip2);
        var _item$props2 = item.props, points = _item$props2.points, isRange = _item$props2.isRange, baseLine = _item$props2.baseLine;
        var _item$item$props2 = item.item.props, activeDot = _item$item$props2.activeDot, hide = _item$item$props2.hide, activeBar = _item$item$props2.activeBar, activeShape = _item$item$props2.activeShape;
        var hasActive = Boolean(!hide && isTooltipActive && tooltipItem && (activeDot || activeBar || activeShape));
        var itemEvents = {};
        if (tooltipEventType !== "axis" && tooltipItem && tooltipItem.props.trigger === "click") {
          itemEvents = {
            onClick: combineEventHandlers(_this.handleItemMouseEnter, null, element2.props.onCLick)
          };
        } else if (tooltipEventType !== "axis") {
          itemEvents = {
            onMouseLeave: combineEventHandlers(_this.handleItemMouseLeave, null, element2.props.onMouseLeave),
            onMouseEnter: combineEventHandlers(_this.handleItemMouseEnter, null, element2.props.onMouseEnter)
          };
        }
        var graphicalItem = /* @__PURE__ */ (0, import_react117.cloneElement)(element2, _objectSpread40(_objectSpread40({}, item.props), itemEvents));
        function findWithPayload(entry) {
          return typeof tooltipAxis.dataKey === "function" ? tooltipAxis.dataKey(entry.payload) : null;
        }
        if (hasActive) {
          if (activeTooltipIndex >= 0) {
            var activePoint, basePoint;
            if (tooltipAxis.dataKey && !tooltipAxis.allowDuplicatedCategory) {
              var specifiedKey = typeof tooltipAxis.dataKey === "function" ? findWithPayload : "payload.".concat(tooltipAxis.dataKey.toString());
              activePoint = findEntryInArray(points, specifiedKey, activeLabel);
              basePoint = isRange && baseLine && findEntryInArray(baseLine, specifiedKey, activeLabel);
            } else {
              activePoint = points === null || points === void 0 ? void 0 : points[activeTooltipIndex];
              basePoint = isRange && baseLine && baseLine[activeTooltipIndex];
            }
            if (activeShape || activeBar) {
              var activeIndex = element2.props.activeIndex !== void 0 ? element2.props.activeIndex : activeTooltipIndex;
              return [/* @__PURE__ */ (0, import_react117.cloneElement)(element2, _objectSpread40(_objectSpread40(_objectSpread40({}, item.props), itemEvents), {}, {
                activeIndex
              })), null, null];
            }
            if (!(0, import_isNil14.default)(activePoint)) {
              return [graphicalItem].concat(_toConsumableArray13(_this.renderActivePoints({
                item,
                activePoint,
                basePoint,
                childIndex: activeTooltipIndex,
                isRange
              })));
            }
          } else {
            var _this$getItemByXY;
            var _ref132 = (_this$getItemByXY = _this.getItemByXY(_this.state.activeCoordinate)) !== null && _this$getItemByXY !== void 0 ? _this$getItemByXY : {
              graphicalItem
            }, _ref13$graphicalItem = _ref132.graphicalItem, _ref13$graphicalItem$ = _ref13$graphicalItem.item, xyItem = _ref13$graphicalItem$ === void 0 ? element2 : _ref13$graphicalItem$, childIndex = _ref13$graphicalItem.childIndex;
            var elementProps = _objectSpread40(_objectSpread40(_objectSpread40({}, item.props), itemEvents), {}, {
              activeIndex: childIndex
            });
            return [/* @__PURE__ */ (0, import_react117.cloneElement)(xyItem, elementProps), null, null];
          }
        }
        if (isRange) {
          return [graphicalItem, null, null];
        }
        return [graphicalItem, null];
      });
      _defineProperty41(_assertThisInitialized18(_this), "renderCustomized", function(element2, displayName, index) {
        return /* @__PURE__ */ (0, import_react117.cloneElement)(element2, _objectSpread40(_objectSpread40({
          key: "recharts-customized-".concat(index)
        }, _this.props), _this.state));
      });
      _this.uniqueChartId = (0, import_isNil14.default)(_props.id) ? uniqueId("recharts") : _props.id;
      _this.clipPathId = "".concat(_this.uniqueChartId, "-clip");
      if (_props.throttleDelay) {
        _this.triggeredAfterMouseMove = (0, import_throttle2.default)(_this.triggeredAfterMouseMove, _props.throttleDelay);
      }
      _this.state = {};
      return _this;
    }
    _createClass19(CategoricalChartWrapper, [{
      key: "componentDidMount",
      value: function componentDidMount() {
        var _this$props$margin$le, _this$props$margin$to;
        if (!(0, import_isNil14.default)(this.props.syncId)) {
          this.addListener();
        }
        this.accessibilityManager.setDetails({
          container: this.container,
          offset: {
            left: (_this$props$margin$le = this.props.margin.left) !== null && _this$props$margin$le !== void 0 ? _this$props$margin$le : 0,
            top: (_this$props$margin$to = this.props.margin.top) !== null && _this$props$margin$to !== void 0 ? _this$props$margin$to : 0
          },
          coordinateList: this.state.tooltipTicks,
          mouseHandlerCallback: this.handleMouseMove,
          layout: this.props.layout
        });
      }
    }, {
      key: "getSnapshotBeforeUpdate",
      value: function getSnapshotBeforeUpdate(prevProps, prevState) {
        if (!this.props.accessibilityLayer) {
          return null;
        }
        if (this.state.tooltipTicks !== prevState.tooltipTicks) {
          this.accessibilityManager.setDetails({
            coordinateList: this.state.tooltipTicks
          });
        }
        if (this.props.layout !== prevProps.layout) {
          this.accessibilityManager.setDetails({
            layout: this.props.layout
          });
        }
        if (this.props.margin !== prevProps.margin) {
          var _this$props$margin$le2, _this$props$margin$to2;
          this.accessibilityManager.setDetails({
            offset: {
              left: (_this$props$margin$le2 = this.props.margin.left) !== null && _this$props$margin$le2 !== void 0 ? _this$props$margin$le2 : 0,
              top: (_this$props$margin$to2 = this.props.margin.top) !== null && _this$props$margin$to2 !== void 0 ? _this$props$margin$to2 : 0
            }
          });
        }
        return null;
      }
    }, {
      key: "componentDidUpdate",
      value: function componentDidUpdate(prevProps) {
        if ((0, import_isNil14.default)(prevProps.syncId) && !(0, import_isNil14.default)(this.props.syncId)) {
          this.addListener();
        }
        if (!(0, import_isNil14.default)(prevProps.syncId) && (0, import_isNil14.default)(this.props.syncId)) {
          this.removeListener();
        }
      }
    }, {
      key: "componentWillUnmount",
      value: function componentWillUnmount() {
        this.clearDefer();
        if (!(0, import_isNil14.default)(this.props.syncId)) {
          this.removeListener();
        }
        this.cancelThrottledTriggerAfterMouseMove();
      }
    }, {
      key: "cancelThrottledTriggerAfterMouseMove",
      value: function cancelThrottledTriggerAfterMouseMove() {
        if (typeof this.triggeredAfterMouseMove.cancel === "function") {
          this.triggeredAfterMouseMove.cancel();
        }
      }
    }, {
      key: "getTooltipEventType",
      value: function getTooltipEventType() {
        var tooltipItem = findChildByType(this.props.children, Tooltip2);
        if (tooltipItem && (0, import_isBoolean2.default)(tooltipItem.props.shared)) {
          var eventType = tooltipItem.props.shared ? "axis" : "item";
          return validateTooltipEventTypes.indexOf(eventType) >= 0 ? eventType : defaultTooltipEventType;
        }
        return defaultTooltipEventType;
      }
      /**
       * Get the information of mouse in chart, return null when the mouse is not in the chart
       * @param  {Object} event    The event object
       * @return {Object}          Mouse data
       */
    }, {
      key: "getMouseInfo",
      value: function getMouseInfo(event) {
        var _element$getBoundingC;
        if (!this.container) {
          return null;
        }
        var containerOffset = getOffset(this.container);
        var e3 = calculateChartCoordinate(event, containerOffset);
        var element2 = this.container;
        var boundingRectWidth = element2 === null || element2 === void 0 || (_element$getBoundingC = element2.getBoundingClientRect()) === null || _element$getBoundingC === void 0 ? void 0 : _element$getBoundingC.width;
        var offsetWidth = element2.offsetWidth;
        var scale = boundingRectWidth / offsetWidth || 1;
        var rangeObj = this.inRange(e3.chartX, e3.chartY, scale);
        if (!rangeObj) {
          return null;
        }
        var _this$state9 = this.state, xAxisMap = _this$state9.xAxisMap, yAxisMap = _this$state9.yAxisMap;
        var tooltipEventType = this.getTooltipEventType();
        if (tooltipEventType !== "axis" && xAxisMap && yAxisMap) {
          var xScale = getAnyElementOfObject(xAxisMap).scale;
          var yScale = getAnyElementOfObject(yAxisMap).scale;
          var xValue = xScale && xScale.invert ? xScale.invert(e3.chartX) : null;
          var yValue = yScale && yScale.invert ? yScale.invert(e3.chartY) : null;
          return _objectSpread40(_objectSpread40({}, e3), {}, {
            xValue,
            yValue
          });
        }
        var toolTipData = getTooltipData(this.state, this.props.data, this.props.layout, rangeObj);
        if (toolTipData) {
          return _objectSpread40(_objectSpread40({}, e3), toolTipData);
        }
        return null;
      }
    }, {
      key: "inRange",
      value: function inRange(x2, y2) {
        var scale = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 1;
        var layout = this.props.layout;
        var scaledX = x2 / scale, scaledY = y2 / scale;
        if (layout === "horizontal" || layout === "vertical") {
          var offset = this.state.offset;
          var isInRange = scaledX >= offset.left && scaledX <= offset.left + offset.width && scaledY >= offset.top && scaledY <= offset.top + offset.height;
          return isInRange ? {
            x: scaledX,
            y: scaledY
          } : null;
        }
        var _this$state10 = this.state, angleAxisMap = _this$state10.angleAxisMap, radiusAxisMap = _this$state10.radiusAxisMap;
        if (angleAxisMap && radiusAxisMap) {
          var angleAxis = getAnyElementOfObject(angleAxisMap);
          return inRangeOfSector({
            x: scaledX,
            y: scaledY
          }, angleAxis);
        }
        return null;
      }
    }, {
      key: "parseEventsOfWrapper",
      value: function parseEventsOfWrapper() {
        var children = this.props.children;
        var tooltipEventType = this.getTooltipEventType();
        var tooltipItem = findChildByType(children, Tooltip2);
        var tooltipEvents = {};
        if (tooltipItem && tooltipEventType === "axis") {
          if (tooltipItem.props.trigger === "click") {
            tooltipEvents = {
              onClick: this.handleClick
            };
          } else {
            tooltipEvents = {
              onMouseEnter: this.handleMouseEnter,
              onMouseMove: this.handleMouseMove,
              onMouseLeave: this.handleMouseLeave,
              onTouchMove: this.handleTouchMove,
              onTouchStart: this.handleTouchStart,
              onTouchEnd: this.handleTouchEnd
            };
          }
        }
        var outerEvents = adaptEventHandlers(this.props, this.handleOuterEvent);
        return _objectSpread40(_objectSpread40({}, outerEvents), tooltipEvents);
      }
      /* eslint-disable  no-underscore-dangle */
    }, {
      key: "addListener",
      value: function addListener() {
        eventCenter.on(SYNC_EVENT, this.handleReceiveSyncEvent);
        if (eventCenter.setMaxListeners && eventCenter._maxListeners) {
          eventCenter.setMaxListeners(eventCenter._maxListeners + 1);
        }
      }
    }, {
      key: "removeListener",
      value: function removeListener() {
        eventCenter.removeListener(SYNC_EVENT, this.handleReceiveSyncEvent);
        if (eventCenter.setMaxListeners && eventCenter._maxListeners) {
          eventCenter.setMaxListeners(eventCenter._maxListeners - 1);
        }
      }
    }, {
      key: "triggerSyncEvent",
      value: function triggerSyncEvent(data) {
        var syncId = this.props.syncId;
        if (!(0, import_isNil14.default)(syncId)) {
          eventCenter.emit(SYNC_EVENT, syncId, this.uniqueChartId, data);
        }
      }
    }, {
      key: "applySyncEvent",
      value: function applySyncEvent(data) {
        var _this$props4 = this.props, layout = _this$props4.layout, syncMethod = _this$props4.syncMethod;
        var updateId = this.state.updateId;
        var dataStartIndex = data.dataStartIndex, dataEndIndex = data.dataEndIndex;
        if (!(0, import_isNil14.default)(data.dataStartIndex) || !(0, import_isNil14.default)(data.dataEndIndex)) {
          this.setState(_objectSpread40({
            dataStartIndex,
            dataEndIndex
          }, updateStateOfAxisMapsOffsetAndStackGroups({
            props: this.props,
            dataStartIndex,
            dataEndIndex,
            updateId
          }, this.state)));
        } else if (!(0, import_isNil14.default)(data.activeTooltipIndex)) {
          var chartX = data.chartX, chartY = data.chartY;
          var activeTooltipIndex = data.activeTooltipIndex;
          var _this$state11 = this.state, offset = _this$state11.offset, tooltipTicks = _this$state11.tooltipTicks;
          if (!offset) {
            return;
          }
          if (typeof syncMethod === "function") {
            activeTooltipIndex = syncMethod(tooltipTicks, data);
          } else if (syncMethod === "value") {
            activeTooltipIndex = -1;
            for (var i2 = 0; i2 < tooltipTicks.length; i2++) {
              if (tooltipTicks[i2].value === data.activeLabel) {
                activeTooltipIndex = i2;
                break;
              }
            }
          }
          var viewBox = _objectSpread40(_objectSpread40({}, offset), {}, {
            x: offset.left,
            y: offset.top
          });
          var validateChartX = Math.min(chartX, viewBox.x + viewBox.width);
          var validateChartY = Math.min(chartY, viewBox.y + viewBox.height);
          var activeLabel = tooltipTicks[activeTooltipIndex] && tooltipTicks[activeTooltipIndex].value;
          var activePayload = getTooltipContent(this.state, this.props.data, activeTooltipIndex);
          var activeCoordinate = tooltipTicks[activeTooltipIndex] ? {
            x: layout === "horizontal" ? tooltipTicks[activeTooltipIndex].coordinate : validateChartX,
            y: layout === "horizontal" ? validateChartY : tooltipTicks[activeTooltipIndex].coordinate
          } : originCoordinate;
          this.setState(_objectSpread40(_objectSpread40({}, data), {}, {
            activeLabel,
            activeCoordinate,
            activePayload,
            activeTooltipIndex
          }));
        } else {
          this.setState(data);
        }
      }
    }, {
      key: "filterFormatItem",
      value: function filterFormatItem(item, displayName, childIndex) {
        var formattedGraphicalItems = this.state.formattedGraphicalItems;
        for (var i2 = 0, len = formattedGraphicalItems.length; i2 < len; i2++) {
          var entry = formattedGraphicalItems[i2];
          if (entry.item === item || entry.props.key === item.key || displayName === getDisplayName(entry.item.type) && childIndex === entry.childIndex) {
            return entry;
          }
        }
        return null;
      }
    }, {
      key: "renderAxis",
      value: (
        /**
         * Draw axis
         * @param {Object} axisOptions The options of axis
         * @param {Object} element      The axis element
         * @param {String} displayName  The display name of axis
         * @param {Number} index        The index of element
         * @return {ReactElement}       The instance of x-axes
         */
        function renderAxis(axisOptions, element2, displayName, index) {
          var _this$props5 = this.props, width = _this$props5.width, height = _this$props5.height;
          return /* @__PURE__ */ import_react117.default.createElement(CartesianAxis, _extends40({}, axisOptions, {
            className: (0, import_classnames27.default)("recharts-".concat(axisOptions.axisType, " ").concat(axisOptions.axisType), axisOptions.className),
            key: element2.key || "".concat(displayName, "-").concat(index),
            viewBox: {
              x: 0,
              y: 0,
              width,
              height
            },
            ticksGenerator: this.axesTicksGenerator
          }));
        }
      )
    }, {
      key: "renderClipPath",
      value: function renderClipPath() {
        var clipPathId = this.clipPathId;
        var _this$state$offset = this.state.offset, left = _this$state$offset.left, top2 = _this$state$offset.top, height = _this$state$offset.height, width = _this$state$offset.width;
        return /* @__PURE__ */ import_react117.default.createElement("defs", null, /* @__PURE__ */ import_react117.default.createElement("clipPath", {
          id: clipPathId
        }, /* @__PURE__ */ import_react117.default.createElement("rect", {
          x: left,
          y: top2,
          height,
          width
        })));
      }
    }, {
      key: "getXScales",
      value: function getXScales() {
        var xAxisMap = this.state.xAxisMap;
        return xAxisMap ? Object.entries(xAxisMap).reduce(function(res, _ref142) {
          var _ref152 = _slicedToArray13(_ref142, 2), axisId = _ref152[0], axisProps = _ref152[1];
          return _objectSpread40(_objectSpread40({}, res), {}, _defineProperty41({}, axisId, axisProps.scale));
        }, {}) : null;
      }
    }, {
      key: "getYScales",
      value: function getYScales() {
        var yAxisMap = this.state.yAxisMap;
        return yAxisMap ? Object.entries(yAxisMap).reduce(function(res, _ref162) {
          var _ref172 = _slicedToArray13(_ref162, 2), axisId = _ref172[0], axisProps = _ref172[1];
          return _objectSpread40(_objectSpread40({}, res), {}, _defineProperty41({}, axisId, axisProps.scale));
        }, {}) : null;
      }
    }, {
      key: "getXScaleByAxisId",
      value: function getXScaleByAxisId(axisId) {
        var _this$state$xAxisMap;
        return (_this$state$xAxisMap = this.state.xAxisMap) === null || _this$state$xAxisMap === void 0 || (_this$state$xAxisMap = _this$state$xAxisMap[axisId]) === null || _this$state$xAxisMap === void 0 ? void 0 : _this$state$xAxisMap.scale;
      }
    }, {
      key: "getYScaleByAxisId",
      value: function getYScaleByAxisId(axisId) {
        var _this$state$yAxisMap;
        return (_this$state$yAxisMap = this.state.yAxisMap) === null || _this$state$yAxisMap === void 0 || (_this$state$yAxisMap = _this$state$yAxisMap[axisId]) === null || _this$state$yAxisMap === void 0 ? void 0 : _this$state$yAxisMap.scale;
      }
    }, {
      key: "getItemByXY",
      value: function getItemByXY(chartXY) {
        var _this$state12 = this.state, formattedGraphicalItems = _this$state12.formattedGraphicalItems, activeItem = _this$state12.activeItem;
        if (formattedGraphicalItems && formattedGraphicalItems.length) {
          for (var i2 = 0, len = formattedGraphicalItems.length; i2 < len; i2++) {
            var graphicalItem = formattedGraphicalItems[i2];
            var props = graphicalItem.props, item = graphicalItem.item;
            var itemDisplayName = getDisplayName(item.type);
            if (itemDisplayName === "Bar") {
              var activeBarItem = (props.data || []).find(function(entry) {
                return isInRectangle(chartXY, entry);
              });
              if (activeBarItem) {
                return {
                  graphicalItem,
                  payload: activeBarItem
                };
              }
            } else if (itemDisplayName === "RadialBar") {
              var _activeBarItem = (props.data || []).find(function(entry) {
                return inRangeOfSector(chartXY, entry);
              });
              if (_activeBarItem) {
                return {
                  graphicalItem,
                  payload: _activeBarItem
                };
              }
            } else if (isFunnel(graphicalItem, activeItem) || isPie(graphicalItem, activeItem) || isScatter(graphicalItem, activeItem)) {
              var activeIndex = getActiveShapeIndexForTooltip({
                graphicalItem,
                activeTooltipItem: activeItem,
                itemData: item.props.data
              });
              var childIndex = item.props.activeIndex === void 0 ? activeIndex : item.props.activeIndex;
              return {
                graphicalItem: _objectSpread40(_objectSpread40({}, graphicalItem), {}, {
                  childIndex
                }),
                payload: isScatter(graphicalItem, activeItem) ? item.props.data[activeIndex] : graphicalItem.props.data[activeIndex]
              };
            }
          }
        }
        return null;
      }
    }, {
      key: "render",
      value: function render2() {
        var _this2 = this;
        if (!validateWidthHeight(this)) {
          return null;
        }
        var _this$props6 = this.props, children = _this$props6.children, className = _this$props6.className, width = _this$props6.width, height = _this$props6.height, style = _this$props6.style, compact2 = _this$props6.compact, title = _this$props6.title, desc = _this$props6.desc, others = _objectWithoutProperties23(_this$props6, _excluded211);
        var attrs = filterProps(others);
        var map3 = {
          CartesianGrid: {
            handler: this.renderGrid,
            once: true
          },
          ReferenceArea: {
            handler: this.renderReferenceElement
          },
          ReferenceLine: {
            handler: this.renderReferenceElement
          },
          ReferenceDot: {
            handler: this.renderReferenceElement
          },
          XAxis: {
            handler: this.renderXAxis
          },
          YAxis: {
            handler: this.renderYAxis
          },
          Brush: {
            handler: this.renderBrush,
            once: true
          },
          Bar: {
            handler: this.renderGraphicChild
          },
          Line: {
            handler: this.renderGraphicChild
          },
          Area: {
            handler: this.renderGraphicChild
          },
          Radar: {
            handler: this.renderGraphicChild
          },
          RadialBar: {
            handler: this.renderGraphicChild
          },
          Scatter: {
            handler: this.renderGraphicChild
          },
          Pie: {
            handler: this.renderGraphicChild
          },
          Funnel: {
            handler: this.renderGraphicChild
          },
          Tooltip: {
            handler: this.renderCursor,
            once: true
          },
          PolarGrid: {
            handler: this.renderPolarGrid,
            once: true
          },
          PolarAngleAxis: {
            handler: this.renderPolarAxis
          },
          PolarRadiusAxis: {
            handler: this.renderPolarAxis
          },
          Customized: {
            handler: this.renderCustomized
          }
        };
        if (compact2) {
          return /* @__PURE__ */ import_react117.default.createElement(Surface, _extends40({}, attrs, {
            width,
            height,
            title,
            desc
          }), this.renderClipPath(), renderByOrder(children, map3));
        }
        if (this.props.accessibilityLayer) {
          var _2, _img;
          attrs.tabIndex = (_2 = 0) !== null && _2 !== void 0 ? _2 : this.props.tabIndex;
          attrs.role = (_img = "img") !== null && _img !== void 0 ? _img : this.props.role;
          attrs.onKeyDown = function(e3) {
            _this2.accessibilityManager.keyboardEvent(e3);
          };
          attrs.onFocus = function() {
            _this2.accessibilityManager.focus();
          };
        }
        var events = this.parseEventsOfWrapper();
        return /* @__PURE__ */ import_react117.default.createElement("div", _extends40({
          className: (0, import_classnames27.default)("recharts-wrapper", className),
          style: _objectSpread40({
            position: "relative",
            cursor: "default",
            width,
            height
          }, style)
        }, events, {
          ref: function ref(node56) {
            _this2.container = node56;
          },
          role: "region"
        }), /* @__PURE__ */ import_react117.default.createElement(Surface, _extends40({}, attrs, {
          width,
          height,
          title,
          desc
        }), this.renderClipPath(), renderByOrder(children, map3)), this.renderLegend(), this.renderTooltip());
      }
    }]);
    return CategoricalChartWrapper;
  }(import_react117.Component), _defineProperty41(_class4, "displayName", chartName), _defineProperty41(_class4, "defaultProps", _objectSpread40({
    layout: "horizontal",
    stackOffset: "none",
    barCategoryGap: "10%",
    barGap: 4,
    margin: {
      top: 5,
      right: 5,
      bottom: 5,
      left: 5
    },
    reverseStackOrder: false,
    syncMethod: "index"
  }, defaultProps5)), _defineProperty41(_class4, "getDerivedStateFromProps", function(nextProps, prevState) {
    var data = nextProps.data, children = nextProps.children, width = nextProps.width, height = nextProps.height, layout = nextProps.layout, stackOffset = nextProps.stackOffset, margin = nextProps.margin;
    if ((0, import_isNil14.default)(prevState.updateId)) {
      var defaultState = createDefaultState(nextProps);
      return _objectSpread40(_objectSpread40(_objectSpread40({}, defaultState), {}, {
        updateId: 0
      }, updateStateOfAxisMapsOffsetAndStackGroups(_objectSpread40(_objectSpread40({
        props: nextProps
      }, defaultState), {}, {
        updateId: 0
      }), prevState)), {}, {
        prevData: data,
        prevWidth: width,
        prevHeight: height,
        prevLayout: layout,
        prevStackOffset: stackOffset,
        prevMargin: margin,
        prevChildren: children
      });
    }
    if (data !== prevState.prevData || width !== prevState.prevWidth || height !== prevState.prevHeight || layout !== prevState.prevLayout || stackOffset !== prevState.prevStackOffset || !shallowEqual(margin, prevState.prevMargin)) {
      var _defaultState = createDefaultState(nextProps);
      var keepFromPrevState = {
        // (chartX, chartY) are (0,0) in default state, but we want to keep the last mouse position to avoid
        // any flickering
        chartX: prevState.chartX,
        chartY: prevState.chartY,
        // The tooltip should stay active when it was active in the previous render. If this is not
        // the case, the tooltip disappears and immediately re-appears, causing a flickering effect
        isTooltipActive: prevState.isTooltipActive
      };
      var updatesToState = _objectSpread40(_objectSpread40({}, getTooltipData(prevState, data, layout)), {}, {
        updateId: prevState.updateId + 1
      });
      var newState = _objectSpread40(_objectSpread40(_objectSpread40({}, _defaultState), keepFromPrevState), updatesToState);
      return _objectSpread40(_objectSpread40(_objectSpread40({}, newState), updateStateOfAxisMapsOffsetAndStackGroups(_objectSpread40({
        props: nextProps
      }, newState), prevState)), {}, {
        prevData: data,
        prevWidth: width,
        prevHeight: height,
        prevLayout: layout,
        prevStackOffset: stackOffset,
        prevMargin: margin,
        prevChildren: children
      });
    }
    if (!isChildrenEqual(children, prevState.prevChildren)) {
      var hasGlobalData = !(0, import_isNil14.default)(data);
      var newUpdateId = hasGlobalData ? prevState.updateId : prevState.updateId + 1;
      return _objectSpread40(_objectSpread40({
        updateId: newUpdateId
      }, updateStateOfAxisMapsOffsetAndStackGroups(_objectSpread40(_objectSpread40({
        props: nextProps
      }, prevState), {}, {
        updateId: newUpdateId
      }), prevState)), {}, {
        prevChildren: children
      });
    }
    return null;
  }), _defineProperty41(_class4, "renderActiveDot", function(option, props) {
    var dot2;
    if (/* @__PURE__ */ (0, import_react117.isValidElement)(option)) {
      dot2 = /* @__PURE__ */ (0, import_react117.cloneElement)(option, props);
    } else if ((0, import_isFunction23.default)(option)) {
      dot2 = option(props);
    } else {
      dot2 = /* @__PURE__ */ import_react117.default.createElement(Dot, props);
    }
    return /* @__PURE__ */ import_react117.default.createElement(Layer, {
      className: "recharts-active-dot",
      key: props.key
    }, dot2);
  }), _class4;
};

// node_modules/recharts/es6/chart/BarChart.js
var BarChart = generateCategoricalChart({
  chartName: "BarChart",
  GraphicalChild: Bar,
  defaultTooltipEventType: "axis",
  validateTooltipEventTypes: ["axis", "item"],
  axisComponents: [{
    axisType: "xAxis",
    AxisComp: XAxis
  }, {
    axisType: "yAxis",
    AxisComp: YAxis
  }],
  formatAxisMap: formatAxisMap3
});

// node_modules/recharts/es6/chart/PieChart.js
var PieChart = generateCategoricalChart({
  chartName: "PieChart",
  GraphicalChild: Pie,
  validateTooltipEventTypes: ["item"],
  defaultTooltipEventType: "item",
  legendContent: "children",
  axisComponents: [{
    axisType: "angleAxis",
    AxisComp: PolarAngleAxis
  }, {
    axisType: "radiusAxis",
    AxisComp: PolarRadiusAxis
  }],
  formatAxisMap,
  defaultProps: {
    layout: "centric",
    startAngle: 0,
    endAngle: 360,
    cx: "50%",
    cy: "50%",
    innerRadius: 0,
    outerRadius: "80%"
  }
});

// node_modules/recharts/es6/chart/ComposedChart.js
var ComposedChart = generateCategoricalChart({
  chartName: "ComposedChart",
  GraphicalChild: [Line7, Area, Bar, Scatter],
  axisComponents: [{
    axisType: "xAxis",
    AxisComp: XAxis
  }, {
    axisType: "yAxis",
    AxisComp: YAxis
  }, {
    axisType: "zAxis",
    AxisComp: ZAxis
  }],
  formatAxisMap: formatAxisMap3
});

// src/components/chart/ChartTooltip.tsx
function ChartTooltip(props) {
  return /* @__PURE__ */ jsx5(
    "div",
    {
      css: css`
        background-color: var(--ac-global-color-grey-200);
        border: 1px solid var(--ac-global-color-grey-300);
        padding: var(--px-spacing-med);
        border-radius: var(--ac-global-rounding-medium);
        display: flex;
        flex-direction: column;
        gap: var(--px-spacing-sm);
        min-width: 200px;
      `,
      children: props.children
    }
  );
}
function ChartTooltipItem(props) {
  return /* @__PURE__ */ jsxs2(
    "div",
    {
      css: css`
        display: flex;
        flex-direction: row;
        justify-content: space-between;
      `,
      children: [
        /* @__PURE__ */ jsxs2(
          "div",
          {
            css: css`
          display: flex;
          flex-direction: row;
          gap: var(--px-spacing-med);
          align-items: center;
        `,
            children: [
              /* @__PURE__ */ jsx5(PreviewShape, { color: props.color, shape: props.shape ?? "line" }),
              /* @__PURE__ */ jsx5(_Text, { children: props.name })
            ]
          }
        ),
        /* @__PURE__ */ jsx5(_Text, { children: props.value })
      ]
    }
  );
}
function ChartTooltipDivider() {
  return /* @__PURE__ */ jsx5(
    "div",
    {
      css: css`
        height: 1px;
        background-color: var(--ac-global-color-grey-300);
        width: 100%;
      `
    }
  );
}
var colorPreviewCSS = (previewShape) => {
  if (previewShape === "line") {
    return css`
      width: 8px;
      height: 2px;
    `;
  } else if (previewShape === "circle") {
    return css`
      width: 8px;
      height: 8px;
      border-radius: 50%;
    `;
  } else if (previewShape === "square") {
    return css`
      width: 8px;
      height: 8px;
    `;
  }
};
function PreviewShape({ color: color2, shape = "line" }) {
  return /* @__PURE__ */ jsx5(
    "div",
    {
      css: css(
        colorPreviewCSS(shape),
        css`
          background-color: ${color2};
          flex: none;
        `
      )
    }
  );
}

// src/components/chart/defaults.tsx
var defaultTimeXAxisProps = {
  dataKey: "timestamp",
  stroke: "var(--ac-global-colo-grey-400)",
  style: { fill: "var(--ac-global-text-color-700)" },
  scale: "time",
  type: "number",
  domain: ["auto", "auto"],
  padding: "gap"
};
var defaultSelectedTimestampReferenceLineProps = {
  stroke: "var(--ac-global-color-grey-900)",
  label: {
    value: "\u25BC",
    position: "top",
    style: {
      fill: "#fabe32",
      fontSize: theme.typography.sizes.small.fontSize
    }
  }
};
var defaultBarChartTooltipProps = {
  cursor: {
    fill: "var(--ac-global-color-grey-300)"
  }
};

// src/components/chart/useTimeTickFormatter.ts
var import_react119 = __toESM(require_react());

// src/utils/timeSeriesUtils.ts
var ONE_HOUR_IN_MINUTES = 60;
var ONE_DAY_IN_MINUTES = ONE_HOUR_IN_MINUTES * 24;
var MIN_EVALUATION_WINDOW_IN_MINUTES = 2 * ONE_DAY_IN_MINUTES;
function calculateGranularity(timeRange) {
  const { start, end } = timeRange;
  const timeRangeInHours = Math.floor(
    (end.valueOf() - start.valueOf()) / 1e3 / 60 / 60
  );
  if (timeRangeInHours <= 1) {
    return {
      evaluationWindowMinutes: 1,
      samplingIntervalMinutes: 1
    };
  } else if (timeRangeInHours <= 24) {
    return {
      evaluationWindowMinutes: ONE_HOUR_IN_MINUTES,
      samplingIntervalMinutes: ONE_HOUR_IN_MINUTES
    };
  } else {
    return {
      evaluationWindowMinutes: ONE_DAY_IN_MINUTES,
      samplingIntervalMinutes: ONE_DAY_IN_MINUTES
    };
  }
}
function calculateGranularityWithRollingAverage(timeRange) {
  const { start, end } = timeRange;
  const timeRangeInHours = Math.floor(
    (end.valueOf() - start.valueOf()) / 1e3 / 60 / 60
  );
  if (timeRangeInHours <= 1) {
    return {
      evaluationWindowMinutes: MIN_EVALUATION_WINDOW_IN_MINUTES,
      samplingIntervalMinutes: 1
    };
  } else if (timeRangeInHours <= 24) {
    return {
      evaluationWindowMinutes: MIN_EVALUATION_WINDOW_IN_MINUTES,
      samplingIntervalMinutes: ONE_HOUR_IN_MINUTES
    };
  } else {
    return {
      evaluationWindowMinutes: MIN_EVALUATION_WINDOW_IN_MINUTES,
      samplingIntervalMinutes: ONE_DAY_IN_MINUTES
    };
  }
}

// src/components/chart/useTimeTickFormatter.ts
function getFormatFromSamplingInterval(samplingIntervalMinutes) {
  let format3;
  if (samplingIntervalMinutes < ONE_HOUR_IN_MINUTES) {
    format3 = "%H:%M %p";
  } else if (samplingIntervalMinutes < ONE_DAY_IN_MINUTES) {
    format3 = "%x %H:%M %p";
  } else {
    format3 = "%-m/%-d";
  }
  return format3;
}
function useTimeTickFormatter(config2) {
  const samplingIntervalMinutes = config2.samplingIntervalMinutes;
  const formatter3 = (0, import_react119.useMemo)(() => {
    return timeFormat(getFormatFromSamplingInterval(samplingIntervalMinutes));
  }, [samplingIntervalMinutes]);
  return formatter3;
}

// src/components/chart/colors.tsx
var import_react120 = __toESM(require_react());
var darkColors = Object.freeze({
  blue100: "#A4C7E0",
  blue200: "#7EB0D2",
  blue300: "#5899C5",
  blue400: "#3C80AE",
  blue500: "#2F6488",
  orange100: "#FECC95",
  orange200: "#FDB462",
  orange300: "#FC9C31",
  orange400: "#F78403",
  orange500: "#C46903",
  purple100: "#BEBADA",
  purple200: "#9E98C8",
  purple300: "#7F77B6",
  purple400: "#6157A3",
  purple500: "#4D4581",
  pink100: "#FCCDE5",
  pink200: "#F99FCD",
  pink300: "#F66FB4",
  pink400: "#F33F9B",
  pink500: "#F10E82",
  gray100: "#f0f0f0",
  gray200: "#d9d9d9",
  gray300: "#bdbdbd",
  gray400: "#969696",
  gray500: "#737373",
  gray600: "#525252",
  gray700: "#252525",
  default: "#ffffff",
  // Colors specific to the dataset role
  primary: "#9efcfd",
  reference: "#baa1f9"
});
var lightColors = Object.freeze({
  default: "#000000",
  blue100: "#2F6488",
  blue200: "#3C80AE",
  blue300: "#5899C5",
  blue400: "#7EB0D2",
  blue500: "#A4C7E0",
  orange100: "#C46903",
  orange200: "#F78403",
  orange300: "#FC9C31",
  orange400: "#FDB462",
  orange500: "#FECC95",
  purple100: "#4D4581",
  purple200: "#6157A3",
  purple300: "#7F77B6",
  purple400: "#9E98C8",
  purple500: "#BEBADA",
  pink100: "#F10E82",
  pink200: "#F33F9B",
  pink300: "#F66FB4",
  pink400: "#F99FCD",
  pink500: "#FCCDE5",
  gray100: "#252525",
  gray200: "#525252",
  gray300: "#737373",
  gray400: "#969696",
  gray500: "#bdbdbd",
  gray600: "#d9d9d9",
  gray700: "#f0f0f0",
  // Colors specific to the dataset role
  primary: "#00add0",
  reference: "#4500d9"
});
var useChartColors = () => {
  const { theme: theme3 } = useTheme2();
  return (0, import_react120.useMemo)(() => theme3 === "dark" ? darkColors : lightColors, [theme3]);
};

// src/components/chart/binning.tsx
function getBinName(bin) {
  const binType = bin.__typename;
  switch (binType) {
    case "NominalBin":
      return bin.name;
    case "IntervalBin":
      return `${formatNumber(bin.range.start)} - ${formatNumber(
        bin.range.end
      )}`;
    case "MissingValueBin":
      return "(empty)";
    case "%other":
      throw new Error("Unexpected bin type %other");
    default:
      assertUnreachable2(binType);
  }
}

// src/pages/tracing/EvaluationSummary.tsx
function EvaluationSummary({ evaluationName }) {
  const data = (0, import_react_relay7.useLazyLoadQuery)(
    EvaluationSummaryQuery_graphql_default,
    {
      evaluationName
    }
  );
  return /* @__PURE__ */ jsxs2(_Flex, { direction: "column", flex: "none", children: [
    /* @__PURE__ */ jsx5(_Text, { elementType: "h3", textSize: "medium", color: "text-700", children: evaluationName }),
    /* @__PURE__ */ jsx5(import_react121.Suspense, { fallback: /* @__PURE__ */ jsx5(_Text, { textSize: "xlarge", children: "--" }), children: /* @__PURE__ */ jsx5(EvaluationSummaryValue2, { evaluationName, query: data }) })
  ] });
}
function EvaluationSummaryValue2(props) {
  const { query: query2 } = props;
  const { fetchKey } = useStreamState();
  const [data, refetch] = (0, import_react_relay7.useRefetchableFragment)(
    EvaluationSummaryValueFragment_graphql_default,
    query2
  );
  (0, import_react121.useEffect)(() => {
    (0, import_react121.startTransition)(() => {
      refetch({}, { fetchPolicy: "store-and-network" });
    });
  }, [fetchKey, refetch]);
  const chartColors = useChartColors();
  const colors = [
    chartColors.default,
    chartColors.gray600,
    chartColors.gray400,
    chartColors.gray200
  ];
  const meanScore = data?.spanEvaluationSummary?.meanScore;
  const labelFractions = data?.spanEvaluationSummary?.labelFractions;
  const hasMeanScore = typeof meanScore === "number";
  const hasLabelFractions = Array.isArray(labelFractions) && labelFractions.length > 0;
  return /* @__PURE__ */ jsxs2(TooltipTrigger, { delay: 0, placement: "bottom", children: [
    /* @__PURE__ */ jsx5(_TriggerWrap, { children: /* @__PURE__ */ jsxs2(_Flex, { direction: "row", alignItems: "center", gap: "size-50", children: [
      hasLabelFractions ? /* @__PURE__ */ jsx5(PieChart, { width: 24, height: 24, children: /* @__PURE__ */ jsx5(
        Pie,
        {
          data: labelFractions,
          dataKey: "fraction",
          nameKey: "label",
          cx: "50%",
          cy: "50%",
          innerRadius: 8,
          outerRadius: 11,
          strokeWidth: 0,
          stroke: "transparent",
          children: labelFractions.map((entry, index) => /* @__PURE__ */ jsx5(
            Cell,
            {
              fill: colors[index % colors.length]
            },
            `cell-${index}`
          ))
        }
      ) }) : null,
      /* @__PURE__ */ jsx5(_Text, { textSize: "xlarge", children: hasMeanScore ? formatFloat(meanScore) : "--" })
    ] }) }),
    /* @__PURE__ */ jsx5(_HelpTooltip, { children: /* @__PURE__ */ jsx5(_View, { width: "size-2400", children: /* @__PURE__ */ jsxs2(_Flex, { direction: "column", gap: "size-50", children: [
      hasLabelFractions && /* @__PURE__ */ jsx5("ul", { children: labelFractions.map((entry, index) => /* @__PURE__ */ jsx5("li", { children: /* @__PURE__ */ jsx5(
        ChartTooltipItem,
        {
          color: colors[index % colors.length],
          name: entry.label,
          shape: "square",
          value: formatPercent(entry.fraction * 100)
        }
      ) }, entry.label)) }),
      hasLabelFractions && hasMeanScore ? /* @__PURE__ */ jsx5(ChartTooltipDivider, {}) : null,
      hasMeanScore ? /* @__PURE__ */ jsxs2(_Flex, { direction: "row", justifyContent: "space-between", children: [
        /* @__PURE__ */ jsx5(_Text, { children: "mean" }),
        /* @__PURE__ */ jsx5(_Text, { children: formatFloat(meanScore) })
      ] }) : null
    ] }) }) })
  ] });
}

// src/pages/tracing/TracingHomePageHeader.tsx
function TracingHomePageHeader(props) {
  const { extra } = props;
  const { fetchKey } = useStreamState();
  const [data, refetch] = (0, import_react_relay8.useRefetchableFragment)(
    TracingHomePageHeader_stats_graphql_default,
    props.query
  );
  (0, import_react122.useEffect)(() => {
    (0, import_react122.startTransition)(() => {
      refetch({}, { fetchPolicy: "store-and-network" });
    });
  }, [fetchKey, refetch]);
  const latencyMsP50 = data?.traceDatasetInfo?.latencyMsP50;
  const latencyMsP99 = data?.traceDatasetInfo?.latencyMsP99;
  const tokenCountTotal = data?.traceDatasetInfo?.tokenCountTotal;
  const spanEvaluationNames = data?.spanEvaluationNames;
  const documentEvaluationNames = data?.documentEvaluationNames;
  return /* @__PURE__ */ jsx5(
    _View,
    {
      paddingStart: "size-200",
      paddingEnd: "size-200",
      paddingTop: "size-200",
      paddingBottom: "size-50",
      flex: "none",
      children: /* @__PURE__ */ jsxs2(_Flex, { direction: "row", justifyContent: "space-between", alignItems: "center", children: [
        /* @__PURE__ */ jsx5(
          "div",
          {
            css: css`
            overflow-x: auto;
            overflow-y: hidden;
            flex: 1 1 auto;
            background-image: linear-gradient(
                to right,
                var(--ac-global-color-grey-75),
                var(--ac-global-color-grey-75)
              ),
              linear-gradient(
                to right,
                var(--ac-global-color-grey-75),
                var(--ac-global-color-grey-75)
              ),
              linear-gradient(
                to right,
                rgba(var(--ac-global-color-grey-300-rgb), 0.9),
                rgba(var(--ac-global-color-grey-300-rgb), 0)
              ),
              linear-gradient(
                to left,
                rgba(var(--ac-global-color-grey-300-rgb), 0.9),
                rgba(var(--ac-global-color-grey-300-rgb), 0)
              );
            background-repeat: no-repeat;
            background-size: 32px 100%, 32px 100%, 32px 100%, 32px 100%;
            background-position: left center, right center, left center,
              right center;
            background-attachment: local, local, scroll, scroll;
          `,
            children: /* @__PURE__ */ jsxs2(_Flex, { direction: "row", gap: "size-400", alignItems: "center", children: [
              /* @__PURE__ */ jsxs2(_Flex, { direction: "column", flex: "none", children: [
                /* @__PURE__ */ jsx5(_Text, { elementType: "h3", textSize: "medium", color: "text-700", children: "Total Traces" }),
                /* @__PURE__ */ jsx5(_Text, { textSize: "xlarge", children: intFormatter(data?.totalTraces.pageInfo.totalCount) })
              ] }),
              /* @__PURE__ */ jsxs2(_Flex, { direction: "column", flex: "none", children: [
                /* @__PURE__ */ jsx5(_Text, { elementType: "h3", textSize: "medium", color: "text-700", children: "Total Tokens" }),
                /* @__PURE__ */ jsx5(_Text, { textSize: "xlarge", children: intFormatter(tokenCountTotal) })
              ] }),
              /* @__PURE__ */ jsxs2(_Flex, { direction: "column", flex: "none", children: [
                /* @__PURE__ */ jsx5(_Text, { elementType: "h3", textSize: "medium", color: "text-700", children: "Latency P50" }),
                latencyMsP50 != null ? /* @__PURE__ */ jsx5(LatencyText, { latencyMs: latencyMsP50, textSize: "xlarge" }) : /* @__PURE__ */ jsx5(_Text, { textSize: "xlarge", children: "--" })
              ] }),
              /* @__PURE__ */ jsxs2(_Flex, { direction: "column", flex: "none", children: [
                /* @__PURE__ */ jsx5(_Text, { elementType: "h3", textSize: "medium", color: "text-700", children: "Latency P99" }),
                latencyMsP99 != null ? /* @__PURE__ */ jsx5(LatencyText, { latencyMs: latencyMsP99, textSize: "xlarge" }) : /* @__PURE__ */ jsx5(_Text, { textSize: "xlarge", children: "--" })
              ] }),
              spanEvaluationNames.map((name2) => /* @__PURE__ */ jsx5(EvaluationSummary, { evaluationName: name2 }, name2)),
              documentEvaluationNames.map((name2) => /* @__PURE__ */ jsx5(
                DocumentEvaluationSummary,
                {
                  evaluationName: name2
                },
                `document-${name2}`
              ))
            ] })
          }
        ),
        /* @__PURE__ */ jsx5(_View, { flex: "none", paddingStart: "size-100", children: extra })
      ] })
    }
  );
}

// src/pages/tracing/TracingHomePage.tsx
var mainCSS = css`
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  .ac-tabs {
    flex: 1 1 auto;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    .ac-tabs__pane-container {
      flex: 1 1 auto;
      display: flex;
      flex-direction: column;
      overflow: hidden;
      div[role="tabpanel"]:not([hidden]) {
        flex: 1 1 auto;
        display: flex;
        flex-direction: column;
        overflow: hidden;
      }
    }
  }
`;
function TracingHomePage() {
  const data = (0, import_react_relay9.useLazyLoadQuery)(
    TracingHomePageQuery_graphql_default,
    {},
    {
      fetchPolicy: "store-and-network"
    }
  );
  return /* @__PURE__ */ jsxs2("main", { css: mainCSS, children: [
    /* @__PURE__ */ jsx5(
      TracingHomePageHeader,
      {
        query: data,
        extra: /* @__PURE__ */ jsx5(StreamToggle, { query: data })
      }
    ),
    /* @__PURE__ */ jsxs2(Tabs, { children: [
      /* @__PURE__ */ jsx5(TabPane, { name: "Traces", children: ({ isSelected }) => {
        return isSelected && /* @__PURE__ */ jsx5(import_react124.Suspense, { children: /* @__PURE__ */ jsx5(TracesTable, { query: data }) });
      } }),
      /* @__PURE__ */ jsx5(TabPane, { name: "Spans", title: "Spans", children: ({ isSelected }) => {
        return isSelected && /* @__PURE__ */ jsx5(import_react124.Suspense, { children: /* @__PURE__ */ jsx5(SpansTable, { query: data }) });
      } })
    ] }),
    /* @__PURE__ */ jsx5(import_react124.Suspense, { children: /* @__PURE__ */ jsx5(Outlet, {}) })
  ] });
}

// src/pages/home/__generated__/homeLoaderQuery.graphql.ts
var node23 = function() {
  var v0 = [
    {
      "alias": null,
      "args": null,
      "concreteType": "Functionality",
      "kind": "LinkedField",
      "name": "functionality",
      "plural": false,
      "selections": [
        {
          "alias": null,
          "args": null,
          "kind": "ScalarField",
          "name": "modelInferences",
          "storageKey": null
        },
        {
          "alias": null,
          "args": null,
          "kind": "ScalarField",
          "name": "tracing",
          "storageKey": null
        }
      ],
      "storageKey": null
    }
  ];
  return {
    "fragment": {
      "argumentDefinitions": [],
      "kind": "Fragment",
      "metadata": null,
      "name": "homeLoaderQuery",
      "selections": v0,
      "type": "Query",
      "abstractKey": null
    },
    "kind": "Request",
    "operation": {
      "argumentDefinitions": [],
      "kind": "Operation",
      "name": "homeLoaderQuery",
      "selections": v0
    },
    "params": {
      "cacheID": "d3fc3d6b214f7c10a10692e6b0bd954b",
      "id": null,
      "metadata": {},
      "name": "homeLoaderQuery",
      "operationKind": "query",
      "text": "query homeLoaderQuery {\n  functionality {\n    modelInferences\n    tracing\n  }\n}\n"
    }
  };
}();
node23.hash = "b809abc9d06bd4048d3c78598193ec84";
var homeLoaderQuery_graphql_default = node23;

// src/pages/home/homeLoader.ts
var import_react_relay10 = __toESM(require_react_relay());
async function homeLoader(_args) {
  const data = await (0, import_react_relay10.fetchQuery)(
    RelayEnvironment_default,
    homeLoaderQuery_graphql_default,
    {}
  ).toPromise();
  if (data?.functionality.modelInferences) {
    return redirect("/model");
  } else if (data?.functionality.tracing) {
    return redirect("/tracing");
  } else {
    throw new Error("No functionality available");
  }
}

// src/pages/model/__generated__/ModelPageQuery.graphql.ts
var node24 = function() {
  var v0 = {
    "defaultValue": null,
    "kind": "LocalArgument",
    "name": "endTime"
  }, v12 = {
    "defaultValue": null,
    "kind": "LocalArgument",
    "name": "startTime"
  }, v22 = [
    {
      "kind": "Variable",
      "name": "endTime",
      "variableName": "endTime"
    },
    {
      "kind": "Variable",
      "name": "startTime",
      "variableName": "startTime"
    }
  ], v32 = [
    {
      "kind": "Literal",
      "name": "first",
      "value": 50
    }
  ], v4 = {
    "alias": null,
    "args": null,
    "kind": "ScalarField",
    "name": "id",
    "storageKey": null
  }, v5 = {
    "alias": null,
    "args": null,
    "kind": "ScalarField",
    "name": "name",
    "storageKey": null
  }, v6 = {
    "fields": [
      {
        "kind": "Variable",
        "name": "end",
        "variableName": "endTime"
      },
      {
        "kind": "Variable",
        "name": "start",
        "variableName": "startTime"
      }
    ],
    "kind": "ObjectValue",
    "name": "timeRange"
  }, v7 = {
    "alias": null,
    "args": null,
    "kind": "ScalarField",
    "name": "cursor",
    "storageKey": null
  }, v8 = [
    {
      "alias": null,
      "args": null,
      "kind": "ScalarField",
      "name": "__typename",
      "storageKey": null
    }
  ], v9 = {
    "alias": null,
    "args": null,
    "concreteType": "PageInfo",
    "kind": "LinkedField",
    "name": "pageInfo",
    "plural": false,
    "selections": [
      {
        "alias": null,
        "args": null,
        "kind": "ScalarField",
        "name": "endCursor",
        "storageKey": null
      },
      {
        "alias": null,
        "args": null,
        "kind": "ScalarField",
        "name": "hasNextPage",
        "storageKey": null
      }
    ],
    "storageKey": null
  };
  return {
    "fragment": {
      "argumentDefinitions": [
        v0,
        v12
      ],
      "kind": "Fragment",
      "metadata": null,
      "name": "ModelPageQuery",
      "selections": [
        {
          "args": v22,
          "kind": "FragmentSpread",
          "name": "ModelSchemaTable_dimensions"
        },
        {
          "args": v22,
          "kind": "FragmentSpread",
          "name": "ModelEmbeddingsTable_embeddingDimensions"
        }
      ],
      "type": "Query",
      "abstractKey": null
    },
    "kind": "Request",
    "operation": {
      "argumentDefinitions": [
        v12,
        v0
      ],
      "kind": "Operation",
      "name": "ModelPageQuery",
      "selections": [
        {
          "alias": null,
          "args": null,
          "concreteType": "Model",
          "kind": "LinkedField",
          "name": "model",
          "plural": false,
          "selections": [
            {
              "alias": null,
              "args": v32,
              "concreteType": "DimensionConnection",
              "kind": "LinkedField",
              "name": "dimensions",
              "plural": false,
              "selections": [
                {
                  "alias": null,
                  "args": null,
                  "concreteType": "DimensionEdge",
                  "kind": "LinkedField",
                  "name": "edges",
                  "plural": true,
                  "selections": [
                    {
                      "alias": "dimension",
                      "args": null,
                      "concreteType": "Dimension",
                      "kind": "LinkedField",
                      "name": "node",
                      "plural": false,
                      "selections": [
                        v4,
                        v5,
                        {
                          "alias": null,
                          "args": null,
                          "kind": "ScalarField",
                          "name": "type",
                          "storageKey": null
                        },
                        {
                          "alias": null,
                          "args": null,
                          "kind": "ScalarField",
                          "name": "dataType",
                          "storageKey": null
                        },
                        {
                          "alias": "cardinality",
                          "args": [
                            {
                              "kind": "Literal",
                              "name": "metric",
                              "value": "cardinality"
                            },
                            v6
                          ],
                          "kind": "ScalarField",
                          "name": "dataQualityMetric",
                          "storageKey": null
                        },
                        {
                          "alias": "percentEmpty",
                          "args": [
                            {
                              "kind": "Literal",
                              "name": "metric",
                              "value": "percentEmpty"
                            },
                            v6
                          ],
                          "kind": "ScalarField",
                          "name": "dataQualityMetric",
                          "storageKey": null
                        },
                        {
                          "alias": "min",
                          "args": [
                            {
                              "kind": "Literal",
                              "name": "metric",
                              "value": "min"
                            },
                            v6
                          ],
                          "kind": "ScalarField",
                          "name": "dataQualityMetric",
                          "storageKey": null
                        },
                        {
                          "alias": "mean",
                          "args": [
                            {
                              "kind": "Literal",
                              "name": "metric",
                              "value": "mean"
                            },
                            v6
                          ],
                          "kind": "ScalarField",
                          "name": "dataQualityMetric",
                          "storageKey": null
                        },
                        {
                          "alias": "max",
                          "args": [
                            {
                              "kind": "Literal",
                              "name": "metric",
                              "value": "max"
                            },
                            v6
                          ],
                          "kind": "ScalarField",
                          "name": "dataQualityMetric",
                          "storageKey": null
                        },
                        {
                          "alias": "psi",
                          "args": [
                            {
                              "kind": "Literal",
                              "name": "metric",
                              "value": "psi"
                            },
                            v6
                          ],
                          "kind": "ScalarField",
                          "name": "driftMetric",
                          "storageKey": null
                        }
                      ],
                      "storageKey": null
                    },
                    v7,
                    {
                      "alias": null,
                      "args": null,
                      "concreteType": "Dimension",
                      "kind": "LinkedField",
                      "name": "node",
                      "plural": false,
                      "selections": v8,
                      "storageKey": null
                    }
                  ],
                  "storageKey": null
                },
                v9
              ],
              "storageKey": "dimensions(first:50)"
            },
            {
              "alias": null,
              "args": v32,
              "filters": null,
              "handle": "connection",
              "key": "ModelSchemaTable_dimensions",
              "kind": "LinkedHandle",
              "name": "dimensions"
            },
            {
              "alias": null,
              "args": v32,
              "concreteType": "EmbeddingDimensionConnection",
              "kind": "LinkedField",
              "name": "embeddingDimensions",
              "plural": false,
              "selections": [
                {
                  "alias": null,
                  "args": null,
                  "concreteType": "EmbeddingDimensionEdge",
                  "kind": "LinkedField",
                  "name": "edges",
                  "plural": true,
                  "selections": [
                    {
                      "alias": "embedding",
                      "args": null,
                      "concreteType": "EmbeddingDimension",
                      "kind": "LinkedField",
                      "name": "node",
                      "plural": false,
                      "selections": [
                        v4,
                        v5,
                        {
                          "alias": "euclideanDistance",
                          "args": [
                            {
                              "kind": "Literal",
                              "name": "metric",
                              "value": "euclideanDistance"
                            },
                            v6
                          ],
                          "kind": "ScalarField",
                          "name": "driftMetric",
                          "storageKey": null
                        }
                      ],
                      "storageKey": null
                    },
                    v7,
                    {
                      "alias": null,
                      "args": null,
                      "concreteType": "EmbeddingDimension",
                      "kind": "LinkedField",
                      "name": "node",
                      "plural": false,
                      "selections": v8,
                      "storageKey": null
                    }
                  ],
                  "storageKey": null
                },
                v9
              ],
              "storageKey": "embeddingDimensions(first:50)"
            },
            {
              "alias": null,
              "args": v32,
              "filters": null,
              "handle": "connection",
              "key": "ModelEmbeddingsTable_embeddingDimensions",
              "kind": "LinkedHandle",
              "name": "embeddingDimensions"
            }
          ],
          "storageKey": null
        }
      ]
    },
    "params": {
      "cacheID": "18059ac8df6b3c15d5e4bc04ca2c9877",
      "id": null,
      "metadata": {},
      "name": "ModelPageQuery",
      "operationKind": "query",
      "text": "query ModelPageQuery(\n  $startTime: DateTime!\n  $endTime: DateTime!\n) {\n  ...ModelSchemaTable_dimensions_3uKjWt\n  ...ModelEmbeddingsTable_embeddingDimensions_3uKjWt\n}\n\nfragment ModelEmbeddingsTable_embeddingDimensions_3uKjWt on Query {\n  model {\n    embeddingDimensions(first: 50) {\n      edges {\n        embedding: node {\n          id\n          name\n          euclideanDistance: driftMetric(metric: euclideanDistance, timeRange: {start: $startTime, end: $endTime})\n        }\n        cursor\n        node {\n          __typename\n        }\n      }\n      pageInfo {\n        endCursor\n        hasNextPage\n      }\n    }\n  }\n}\n\nfragment ModelSchemaTable_dimensions_3uKjWt on Query {\n  model {\n    dimensions(first: 50) {\n      edges {\n        dimension: node {\n          id\n          name\n          type\n          dataType\n          cardinality: dataQualityMetric(metric: cardinality, timeRange: {start: $startTime, end: $endTime})\n          percentEmpty: dataQualityMetric(metric: percentEmpty, timeRange: {start: $startTime, end: $endTime})\n          min: dataQualityMetric(metric: min, timeRange: {start: $startTime, end: $endTime})\n          mean: dataQualityMetric(metric: mean, timeRange: {start: $startTime, end: $endTime})\n          max: dataQualityMetric(metric: max, timeRange: {start: $startTime, end: $endTime})\n          psi: driftMetric(metric: psi, timeRange: {start: $startTime, end: $endTime})\n        }\n        cursor\n        node {\n          __typename\n        }\n      }\n      pageInfo {\n        endCursor\n        hasNextPage\n      }\n    }\n  }\n}\n"
    }
  };
}();
node24.hash = "b612239336c7638df42037315b00f635";
var ModelPageQuery_graphql_default = node24;

// src/pages/model/ModelPage.tsx
var import_react_relay13 = __toESM(require_react_relay());

// src/components/filter/Toolbar.tsx
function Toolbar(props) {
  return /* @__PURE__ */ jsxs2(
    "div",
    {
      role: "toolbar",
      css: css`
        padding: var(--px-spacing-sm) var(--px-spacing-lg);
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: var(--px-spacing-med);
        border-bottom: 1px solid var(--ac-global-border-color-dark);
        flex: none;
        min-height: 29px;
        .toolbar__main {
          display: flex;
          flex-direction: row;
          gap: var(--px-spacing-med);
        }
      `,
      children: [
        /* @__PURE__ */ jsx5("div", { "data-testid": "toolbar-main", className: "toolbar__main", children: props.children }),
        props.extra ? /* @__PURE__ */ jsx5("div", { "data-testid": "toolbar-extra", children: props.extra }) : null
      ]
    }
  );
}

// src/utils/timeFormatUtils.ts
var fullTimeFormatter = timeFormat("%x %H:%M %p");
var shortTimeFormatter = timeFormat("%H:%M %p");

// src/components/filter/PrimaryDatasetTimeRange.tsx
function PrimaryDatasetTimeRange(_) {
  const {
    timeRange,
    timePreset: selectedTimePreset,
    setTimePreset
  } = useTimeRange();
  const {
    primaryDataset: { name: name2 }
  } = useDatasets();
  const nameAbbr = name2.slice(0, 10);
  return /* @__PURE__ */ jsx5(FieldColorDesignation, { color: "designationTurquoise", children: /* @__PURE__ */ jsxs2(TooltipTrigger, { delay: 0, placement: "bottom right", children: [
    /* @__PURE__ */ jsx5(_TriggerWrap, { children: /* @__PURE__ */ jsxs2(
      _Picker,
      {
        label: "primary dataset",
        defaultSelectedKey: selectedTimePreset,
        "data-testid": "dataset-time-range",
        "aria-label": `Time range for the primary dataset`,
        addonBefore: nameAbbr,
        onSelectionChange: (key) => {
          if (key !== selectedTimePreset) {
            setTimePreset(key);
          }
        },
        children: [
          /* @__PURE__ */ jsx5($c1d7fb2ec91bae71$export$6d08773d2e66f8f2, { children: "All" }, "All" /* all */),
          /* @__PURE__ */ jsx5($c1d7fb2ec91bae71$export$6d08773d2e66f8f2, { children: "Last Day" }, "Last Day" /* last_day */),
          /* @__PURE__ */ jsx5($c1d7fb2ec91bae71$export$6d08773d2e66f8f2, { children: "Last Week" }, "Last Week" /* last_week */),
          /* @__PURE__ */ jsx5($c1d7fb2ec91bae71$export$6d08773d2e66f8f2, { children: "Last Month" }, "Last Month" /* last_month */),
          /* @__PURE__ */ jsx5($c1d7fb2ec91bae71$export$6d08773d2e66f8f2, { children: "Last 3 Months" }, "Last 3 Months" /* last_3_months */),
          /* @__PURE__ */ jsx5($c1d7fb2ec91bae71$export$6d08773d2e66f8f2, { children: "First Day" }, "First Day" /* first_day */),
          /* @__PURE__ */ jsx5($c1d7fb2ec91bae71$export$6d08773d2e66f8f2, { children: "First Week" }, "First Week" /* first_week */),
          /* @__PURE__ */ jsx5($c1d7fb2ec91bae71$export$6d08773d2e66f8f2, { children: "First Month" }, "First Month" /* first_month */)
        ]
      }
    ) }),
    /* @__PURE__ */ jsx5(_Tooltip, { children: /* @__PURE__ */ jsxs2(
      "section",
      {
        css: css`
              h4 {
                margin-bottom: 0.5rem;
              }
            `,
        children: [
          /* @__PURE__ */ jsx5(_Heading, { level: 4, children: "primary dataset time range" }),
          /* @__PURE__ */ jsxs2("div", { children: [
            "start: ",
            fullTimeFormatter(timeRange.start)
          ] }),
          /* @__PURE__ */ jsxs2("div", { children: [
            "end: ",
            fullTimeFormatter(timeRange.end)
          ] })
        ]
      }
    ) })
  ] }) });
}

// src/components/filter/ReferenceDatasetTimeRange.tsx
var timeFormatter = timeFormat("%x %X");
function ReferenceDatasetTimeRange({
  timeRange
}) {
  const { referenceDataset } = useDatasets();
  const name2 = referenceDataset?.name ?? "reference";
  const nameAbbr = name2.slice(0, 10);
  return /* @__PURE__ */ jsx5(
    "div",
    {
      css: css`
        .ac-textfield {
          min-width: 371px;
        }
      `,
      children: /* @__PURE__ */ jsx5(FieldColorDesignation, { color: "designationPurple", children: /* @__PURE__ */ jsxs2(TooltipTrigger, { children: [
        /* @__PURE__ */ jsx5(_TriggerWrap, { children: /* @__PURE__ */ jsx5(
          _TextField,
          {
            label: "reference dataset",
            isReadOnly: true,
            "aria-label": "reference dataset time range",
            value: `${timeFormatter(timeRange.start)} - ${timeFormatter(
              timeRange.end
            )}`,
            addonBefore: nameAbbr
          }
        ) }),
        /* @__PURE__ */ jsx5(_Tooltip, { children: "The static time range of the reference dataset" })
      ] }) })
    }
  );
}

// src/components/model/__generated__/ModelSchemaTable_dimensions.graphql.ts
var node26 = function() {
  var v0 = [
    "model",
    "dimensions"
  ], v12 = {
    "fields": [
      {
        "kind": "Variable",
        "name": "end",
        "variableName": "endTime"
      },
      {
        "kind": "Variable",
        "name": "start",
        "variableName": "startTime"
      }
    ],
    "kind": "ObjectValue",
    "name": "timeRange"
  };
  return {
    "argumentDefinitions": [
      {
        "defaultValue": 50,
        "kind": "LocalArgument",
        "name": "count"
      },
      {
        "defaultValue": null,
        "kind": "LocalArgument",
        "name": "cursor"
      },
      {
        "defaultValue": null,
        "kind": "LocalArgument",
        "name": "endTime"
      },
      {
        "defaultValue": null,
        "kind": "LocalArgument",
        "name": "startTime"
      }
    ],
    "kind": "Fragment",
    "metadata": {
      "connection": [
        {
          "count": "count",
          "cursor": "cursor",
          "direction": "forward",
          "path": v0
        }
      ],
      "refetch": {
        "connection": {
          "forward": {
            "count": "count",
            "cursor": "cursor"
          },
          "backward": null,
          "path": v0
        },
        "fragmentPathInResult": [],
        "operation": (init_ModelSchemaTableDimensionsQuery_graphql(), __toCommonJS(ModelSchemaTableDimensionsQuery_graphql_exports))
      }
    },
    "name": "ModelSchemaTable_dimensions",
    "selections": [
      {
        "alias": null,
        "args": null,
        "concreteType": "Model",
        "kind": "LinkedField",
        "name": "model",
        "plural": false,
        "selections": [
          {
            "alias": "dimensions",
            "args": null,
            "concreteType": "DimensionConnection",
            "kind": "LinkedField",
            "name": "__ModelSchemaTable_dimensions_connection",
            "plural": false,
            "selections": [
              {
                "alias": null,
                "args": null,
                "concreteType": "DimensionEdge",
                "kind": "LinkedField",
                "name": "edges",
                "plural": true,
                "selections": [
                  {
                    "alias": "dimension",
                    "args": null,
                    "concreteType": "Dimension",
                    "kind": "LinkedField",
                    "name": "node",
                    "plural": false,
                    "selections": [
                      {
                        "alias": null,
                        "args": null,
                        "kind": "ScalarField",
                        "name": "id",
                        "storageKey": null
                      },
                      {
                        "alias": null,
                        "args": null,
                        "kind": "ScalarField",
                        "name": "name",
                        "storageKey": null
                      },
                      {
                        "alias": null,
                        "args": null,
                        "kind": "ScalarField",
                        "name": "type",
                        "storageKey": null
                      },
                      {
                        "alias": null,
                        "args": null,
                        "kind": "ScalarField",
                        "name": "dataType",
                        "storageKey": null
                      },
                      {
                        "alias": "cardinality",
                        "args": [
                          {
                            "kind": "Literal",
                            "name": "metric",
                            "value": "cardinality"
                          },
                          v12
                        ],
                        "kind": "ScalarField",
                        "name": "dataQualityMetric",
                        "storageKey": null
                      },
                      {
                        "alias": "percentEmpty",
                        "args": [
                          {
                            "kind": "Literal",
                            "name": "metric",
                            "value": "percentEmpty"
                          },
                          v12
                        ],
                        "kind": "ScalarField",
                        "name": "dataQualityMetric",
                        "storageKey": null
                      },
                      {
                        "alias": "min",
                        "args": [
                          {
                            "kind": "Literal",
                            "name": "metric",
                            "value": "min"
                          },
                          v12
                        ],
                        "kind": "ScalarField",
                        "name": "dataQualityMetric",
                        "storageKey": null
                      },
                      {
                        "alias": "mean",
                        "args": [
                          {
                            "kind": "Literal",
                            "name": "metric",
                            "value": "mean"
                          },
                          v12
                        ],
                        "kind": "ScalarField",
                        "name": "dataQualityMetric",
                        "storageKey": null
                      },
                      {
                        "alias": "max",
                        "args": [
                          {
                            "kind": "Literal",
                            "name": "metric",
                            "value": "max"
                          },
                          v12
                        ],
                        "kind": "ScalarField",
                        "name": "dataQualityMetric",
                        "storageKey": null
                      },
                      {
                        "alias": "psi",
                        "args": [
                          {
                            "kind": "Literal",
                            "name": "metric",
                            "value": "psi"
                          },
                          v12
                        ],
                        "kind": "ScalarField",
                        "name": "driftMetric",
                        "storageKey": null
                      }
                    ],
                    "storageKey": null
                  },
                  {
                    "alias": null,
                    "args": null,
                    "kind": "ScalarField",
                    "name": "cursor",
                    "storageKey": null
                  },
                  {
                    "alias": null,
                    "args": null,
                    "concreteType": "Dimension",
                    "kind": "LinkedField",
                    "name": "node",
                    "plural": false,
                    "selections": [
                      {
                        "alias": null,
                        "args": null,
                        "kind": "ScalarField",
                        "name": "__typename",
                        "storageKey": null
                      }
                    ],
                    "storageKey": null
                  }
                ],
                "storageKey": null
              },
              {
                "alias": null,
                "args": null,
                "concreteType": "PageInfo",
                "kind": "LinkedField",
                "name": "pageInfo",
                "plural": false,
                "selections": [
                  {
                    "alias": null,
                    "args": null,
                    "kind": "ScalarField",
                    "name": "endCursor",
                    "storageKey": null
                  },
                  {
                    "alias": null,
                    "args": null,
                    "kind": "ScalarField",
                    "name": "hasNextPage",
                    "storageKey": null
                  }
                ],
                "storageKey": null
              }
            ],
            "storageKey": null
          }
        ],
        "storageKey": null
      }
    ],
    "type": "Query",
    "abstractKey": null
  };
}();
node26.hash = "fb4c57e0ea77548c4e96ceb418e06614";
var ModelSchemaTable_dimensions_graphql_default = node26;

// src/components/model/ModelSchemaTable.tsx
var import_react129 = __toESM(require_react());
var import_react_relay11 = __toESM(require_react_relay());
function ModelSchemaTable(props) {
  const { data } = (0, import_react_relay11.usePaginationFragment)(
    ModelSchemaTable_dimensions_graphql_default,
    props.model
  );
  const tableData = (0, import_react129.useMemo)(
    () => data.model.dimensions.edges.map(({ dimension }) => {
      return {
        ...dimension
      };
    }),
    [data]
  );
  const columns2 = import_react129.default.useMemo(() => {
    const cols = [
      {
        header: "name",
        accessorKey: "name",
        cell: (props2) => {
          return /* @__PURE__ */ jsx5(Link2, { to: `dimensions/${props2.row.original.id}`, children: props2.renderValue() });
        }
      },
      {
        header: "type",
        accessorKey: "type"
      },
      {
        header: "data type",
        accessorKey: "dataType"
      },
      {
        header: "cardinality",
        accessorKey: "cardinality",
        cell: IntCell
      },
      {
        header: "% empty",
        accessorKey: "percentEmpty",
        cell: PercentCell
      },
      {
        header: "min",
        accessorKey: "min",
        cell: FloatCell
      },
      {
        header: "mean",
        accessorKey: "mean",
        cell: FloatCell
      },
      {
        header: "max",
        accessorKey: "max",
        cell: FloatCell
      },
      {
        header: "PSI",
        accessorKey: "psi",
        cell: FloatCell
      }
    ];
    return cols;
  }, []);
  return /* @__PURE__ */ jsx5(Table, { columns: columns2, data: tableData });
}

// src/components/model/__generated__/ModelEmbeddingsTable_embeddingDimensions.graphql.ts
var node28 = function() {
  var v0 = [
    "model",
    "embeddingDimensions"
  ];
  return {
    "argumentDefinitions": [
      {
        "defaultValue": 50,
        "kind": "LocalArgument",
        "name": "count"
      },
      {
        "defaultValue": null,
        "kind": "LocalArgument",
        "name": "cursor"
      },
      {
        "defaultValue": null,
        "kind": "LocalArgument",
        "name": "endTime"
      },
      {
        "defaultValue": null,
        "kind": "LocalArgument",
        "name": "startTime"
      }
    ],
    "kind": "Fragment",
    "metadata": {
      "connection": [
        {
          "count": "count",
          "cursor": "cursor",
          "direction": "forward",
          "path": v0
        }
      ],
      "refetch": {
        "connection": {
          "forward": {
            "count": "count",
            "cursor": "cursor"
          },
          "backward": null,
          "path": v0
        },
        "fragmentPathInResult": [],
        "operation": (init_ModelEmbeddingsTableEmbeddingDimensionsQuery_graphql(), __toCommonJS(ModelEmbeddingsTableEmbeddingDimensionsQuery_graphql_exports))
      }
    },
    "name": "ModelEmbeddingsTable_embeddingDimensions",
    "selections": [
      {
        "alias": null,
        "args": null,
        "concreteType": "Model",
        "kind": "LinkedField",
        "name": "model",
        "plural": false,
        "selections": [
          {
            "alias": "embeddingDimensions",
            "args": null,
            "concreteType": "EmbeddingDimensionConnection",
            "kind": "LinkedField",
            "name": "__ModelEmbeddingsTable_embeddingDimensions_connection",
            "plural": false,
            "selections": [
              {
                "alias": null,
                "args": null,
                "concreteType": "EmbeddingDimensionEdge",
                "kind": "LinkedField",
                "name": "edges",
                "plural": true,
                "selections": [
                  {
                    "alias": "embedding",
                    "args": null,
                    "concreteType": "EmbeddingDimension",
                    "kind": "LinkedField",
                    "name": "node",
                    "plural": false,
                    "selections": [
                      {
                        "alias": null,
                        "args": null,
                        "kind": "ScalarField",
                        "name": "id",
                        "storageKey": null
                      },
                      {
                        "alias": null,
                        "args": null,
                        "kind": "ScalarField",
                        "name": "name",
                        "storageKey": null
                      },
                      {
                        "alias": "euclideanDistance",
                        "args": [
                          {
                            "kind": "Literal",
                            "name": "metric",
                            "value": "euclideanDistance"
                          },
                          {
                            "fields": [
                              {
                                "kind": "Variable",
                                "name": "end",
                                "variableName": "endTime"
                              },
                              {
                                "kind": "Variable",
                                "name": "start",
                                "variableName": "startTime"
                              }
                            ],
                            "kind": "ObjectValue",
                            "name": "timeRange"
                          }
                        ],
                        "kind": "ScalarField",
                        "name": "driftMetric",
                        "storageKey": null
                      }
                    ],
                    "storageKey": null
                  },
                  {
                    "alias": null,
                    "args": null,
                    "kind": "ScalarField",
                    "name": "cursor",
                    "storageKey": null
                  },
                  {
                    "alias": null,
                    "args": null,
                    "concreteType": "EmbeddingDimension",
                    "kind": "LinkedField",
                    "name": "node",
                    "plural": false,
                    "selections": [
                      {
                        "alias": null,
                        "args": null,
                        "kind": "ScalarField",
                        "name": "__typename",
                        "storageKey": null
                      }
                    ],
                    "storageKey": null
                  }
                ],
                "storageKey": null
              },
              {
                "alias": null,
                "args": null,
                "concreteType": "PageInfo",
                "kind": "LinkedField",
                "name": "pageInfo",
                "plural": false,
                "selections": [
                  {
                    "alias": null,
                    "args": null,
                    "kind": "ScalarField",
                    "name": "endCursor",
                    "storageKey": null
                  },
                  {
                    "alias": null,
                    "args": null,
                    "kind": "ScalarField",
                    "name": "hasNextPage",
                    "storageKey": null
                  }
                ],
                "storageKey": null
              }
            ],
            "storageKey": null
          }
        ],
        "storageKey": null
      }
    ],
    "type": "Query",
    "abstractKey": null
  };
}();
node28.hash = "fb7f125f75d1d33a555c16e198dbcbf8";
var ModelEmbeddingsTable_embeddingDimensions_graphql_default = node28;

// src/components/model/ModelEmbeddingsTable.tsx
var import_react134 = __toESM(require_react());
var import_react_relay12 = __toESM(require_react_relay());

// src/components/LinkButton.tsx
var linkButtonCSS = css`
  display: inline-flex;
  align-items: center;
  background: none;
  color: var(--ac-global-color-primary);

  background: none;
  border: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
  outline: inherit;
  &:hover {
    text-decoration: underline;
  }
`;
function LinkButton(props) {
  const { children, onClick } = props;
  return /* @__PURE__ */ jsxs2("button", { css: linkButtonCSS, onClick, children: [
    children,
    " ",
    /* @__PURE__ */ jsx5(Icon, { svg: /* @__PURE__ */ jsx5(ArrowIosForwardOutline, {}) })
  ] });
}

// src/components/ExternalLink.tsx
function ExternalLink({ href, children }) {
  return /* @__PURE__ */ jsxs2(
    "a",
    {
      href,
      target: "_blank",
      css: css`
        color: var(--ac-global-color-primary);
        text-decoration: none;
        display: flex;
        flex-direction: row;
        align-items: end;
        gap: var(--px-spacing-sm);
        &:hover {
          text-decoration: underline;
        }
        .ac-icon-wrap {
          font-size: 1em;
        }
      `,
      rel: "noreferrer",
      children: [
        children,
        /* @__PURE__ */ jsx5(Icon, { svg: /* @__PURE__ */ jsx5(Icons.ExternalLinkOutline, {}) })
      ]
    }
  );
}

// src/components/LoadingMask.tsx
var LoadingMask = () => {
  return /* @__PURE__ */ jsx5(
    "div",
    {
      css: css`
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        display: flex;
        justify-content: center;
        align-items: center;
        background-color: rgba(0, 0, 0, 0.2);
      `,
      children: /* @__PURE__ */ jsx5(_ProgressCircle, { isIndeterminate: true, "aria-label": "loading" })
    }
  );
};

// src/components/Loading.tsx
var Loading = ({ message }) => {
  return /* @__PURE__ */ jsxs2(
    "div",
    {
      css: css`
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        width: 100%;
        height: 100%;
        gap: var(--px-spacing-med);
      `,
      children: [
        /* @__PURE__ */ jsx5(_ProgressCircle, { isIndeterminate: true, "aria-label": "loading" }),
        message != null ? /* @__PURE__ */ jsx5(_Text, { children: message }) : null
      ]
    }
  );
};

// src/components/ViewSummaryAside.tsx
function ViewSummaryAside(props) {
  return /* @__PURE__ */ jsx5(
    _View,
    {
      width: "size-1250",
      backgroundColor: "light",
      borderStartWidth: "thin",
      borderStartColor: "dark",
      padding: "size-200",
      flex: "none",
      children: /* @__PURE__ */ jsx5(
        _Flex,
        {
          direction: "column",
          alignItems: "end",
          justifyContent: "center",
          height: "100%",
          children: props.children
        }
      )
    }
  );
}

// src/components/model/ModelEmbeddingsTable.tsx
function ModelEmbeddingsTable(props) {
  const { data } = (0, import_react_relay12.usePaginationFragment)(
    ModelEmbeddingsTable_embeddingDimensions_graphql_default,
    props.model
  );
  const tableData = (0, import_react134.useMemo)(
    () => data.model.embeddingDimensions.edges.map(({ embedding }) => {
      return {
        ...embedding
      };
    }),
    [data]
  );
  const columns2 = import_react134.default.useMemo(() => {
    const cols = [
      {
        header: "name",
        accessorKey: "name",
        cell: ({ row, renderValue }) => /* @__PURE__ */ jsx5(Link2, { to: `embeddings/${row.original.id}`, children: renderValue() })
      },
      {
        header: "euclidean distance",
        accessorKey: "euclideanDistance",
        cell: FloatCell
      }
    ];
    return cols;
  }, []);
  return /* @__PURE__ */ jsx5(Table, { columns: columns2, data: tableData });
}

// src/pages/model/ModelPage.tsx
function ModelPage(_props) {
  const { referenceDataset } = useDatasets();
  const { timeRange } = useTimeRange();
  const data = (0, import_react_relay13.useLazyLoadQuery)(
    ModelPageQuery_graphql_default,
    {
      startTime: timeRange.start.toISOString(),
      endTime: timeRange.end.toISOString()
    }
  );
  return /* @__PURE__ */ jsxs2("main", { children: [
    /* @__PURE__ */ jsxs2(Toolbar, { children: [
      /* @__PURE__ */ jsx5(PrimaryDatasetTimeRange, {}),
      referenceDataset ? /* @__PURE__ */ jsx5(
        ReferenceDatasetTimeRange,
        {
          datasetRole: "reference",
          timeRange: {
            start: new Date(referenceDataset.startTime),
            end: new Date(referenceDataset.endTime)
          }
        }
      ) : null
    ] }),
    /* @__PURE__ */ jsx5(
      "section",
      {
        css: css`
          margin: var(--px-spacing-lg);
        `,
        children: /* @__PURE__ */ jsx5(
          TabbedCard,
          {
            title: "Model Schema",
            variant: "compact",
            bodyStyle: { padding: 0 },
            children: /* @__PURE__ */ jsxs2(Tabs, { children: [
              /* @__PURE__ */ jsx5(TabPane, { name: "All", children: /* @__PURE__ */ jsxs2(Accordion, { children: [
                /* @__PURE__ */ jsx5(AccordionItem, { title: "Embeddings", id: "embeddings", children: /* @__PURE__ */ jsx5(ModelEmbeddingsTable, { model: data }) }),
                /* @__PURE__ */ jsx5(AccordionItem, { title: "Dimensions", id: "dimensions", children: /* @__PURE__ */ jsx5(ModelSchemaTable, { model: data }) })
              ] }) }, "all"),
              /* @__PURE__ */ jsx5(TabPane, { name: "Embeddings", children: /* @__PURE__ */ jsx5(ModelEmbeddingsTable, { model: data }) }, "embeddings"),
              /* @__PURE__ */ jsx5(TabPane, { name: "Dimensions", children: /* @__PURE__ */ jsx5(ModelSchemaTable, { model: data }) }, "dimensions")
            ] })
          }
        )
      }
    ),
    /* @__PURE__ */ jsx5(Outlet, {})
  ] });
}

// src/pages/embedding/__generated__/EmbeddingPageUMAPQuery.graphql.ts
var node29 = function() {
  var v0 = {
    "defaultValue": null,
    "kind": "LocalArgument",
    "name": "clusterMinSamples"
  }, v12 = {
    "defaultValue": null,
    "kind": "LocalArgument",
    "name": "clusterSelectionEpsilon"
  }, v22 = {
    "defaultValue": null,
    "kind": "LocalArgument",
    "name": "dataQualityMetricColumnName"
  }, v32 = {
    "defaultValue": null,
    "kind": "LocalArgument",
    "name": "fetchDataQualityMetric"
  }, v4 = {
    "defaultValue": null,
    "kind": "LocalArgument",
    "name": "fetchPerformanceMetric"
  }, v5 = {
    "defaultValue": null,
    "kind": "LocalArgument",
    "name": "id"
  }, v6 = {
    "defaultValue": null,
    "kind": "LocalArgument",
    "name": "minClusterSize"
  }, v7 = {
    "defaultValue": null,
    "kind": "LocalArgument",
    "name": "minDist"
  }, v8 = {
    "defaultValue": null,
    "kind": "LocalArgument",
    "name": "nNeighbors"
  }, v9 = {
    "defaultValue": null,
    "kind": "LocalArgument",
    "name": "nSamples"
  }, v10 = {
    "defaultValue": null,
    "kind": "LocalArgument",
    "name": "performanceMetric"
  }, v11 = {
    "defaultValue": null,
    "kind": "LocalArgument",
    "name": "timeRange"
  }, v122 = [
    {
      "kind": "Variable",
      "name": "id",
      "variableName": "id"
    }
  ], v13 = {
    "alias": null,
    "args": null,
    "kind": "ScalarField",
    "name": "id",
    "storageKey": null
  }, v14 = {
    "alias": null,
    "args": null,
    "kind": "ScalarField",
    "name": "__typename",
    "storageKey": null
  }, v15 = {
    "alias": null,
    "args": null,
    "kind": "ScalarField",
    "name": "x",
    "storageKey": null
  }, v16 = {
    "alias": null,
    "args": null,
    "kind": "ScalarField",
    "name": "y",
    "storageKey": null
  }, v17 = [
    v13,
    {
      "alias": null,
      "args": null,
      "kind": "ScalarField",
      "name": "eventId",
      "storageKey": null
    },
    {
      "alias": null,
      "args": null,
      "concreteType": null,
      "kind": "LinkedField",
      "name": "coordinates",
      "plural": false,
      "selections": [
        v14,
        {
          "kind": "InlineFragment",
          "selections": [
            v15,
            v16,
            {
              "alias": null,
              "args": null,
              "kind": "ScalarField",
              "name": "z",
              "storageKey": null
            }
          ],
          "type": "Point3D",
          "abstractKey": null
        },
        {
          "kind": "InlineFragment",
          "selections": [
            v15,
            v16
          ],
          "type": "Point2D",
          "abstractKey": null
        }
      ],
      "storageKey": null
    },
    {
      "alias": null,
      "args": null,
      "concreteType": "EmbeddingMetadata",
      "kind": "LinkedField",
      "name": "embeddingMetadata",
      "plural": false,
      "selections": [
        {
          "alias": null,
          "args": null,
          "kind": "ScalarField",
          "name": "linkToData",
          "storageKey": null
        },
        {
          "alias": null,
          "args": null,
          "kind": "ScalarField",
          "name": "rawData",
          "storageKey": null
        }
      ],
      "storageKey": null
    },
    {
      "alias": null,
      "args": null,
      "concreteType": "EventMetadata",
      "kind": "LinkedField",
      "name": "eventMetadata",
      "plural": false,
      "selections": [
        {
          "alias": null,
          "args": null,
          "kind": "ScalarField",
          "name": "predictionId",
          "storageKey": null
        },
        {
          "alias": null,
          "args": null,
          "kind": "ScalarField",
          "name": "predictionLabel",
          "storageKey": null
        },
        {
          "alias": null,
          "args": null,
          "kind": "ScalarField",
          "name": "actualLabel",
          "storageKey": null
        },
        {
          "alias": null,
          "args": null,
          "kind": "ScalarField",
          "name": "predictionScore",
          "storageKey": null
        },
        {
          "alias": null,
          "args": null,
          "kind": "ScalarField",
          "name": "actualScore",
          "storageKey": null
        }
      ],
      "storageKey": null
    }
  ], v18 = [
    {
      "alias": null,
      "args": null,
      "kind": "ScalarField",
      "name": "primaryValue",
      "storageKey": null
    },
    {
      "alias": null,
      "args": null,
      "kind": "ScalarField",
      "name": "referenceValue",
      "storageKey": null
    }
  ], v19 = {
    "kind": "InlineFragment",
    "selections": [
      {
        "alias": null,
        "args": [
          {
            "kind": "Variable",
            "name": "clusterMinSamples",
            "variableName": "clusterMinSamples"
          },
          {
            "kind": "Variable",
            "name": "clusterSelectionEpsilon",
            "variableName": "clusterSelectionEpsilon"
          },
          {
            "kind": "Variable",
            "name": "minClusterSize",
            "variableName": "minClusterSize"
          },
          {
            "kind": "Variable",
            "name": "minDist",
            "variableName": "minDist"
          },
          {
            "kind": "Variable",
            "name": "nNeighbors",
            "variableName": "nNeighbors"
          },
          {
            "kind": "Variable",
            "name": "nSamples",
            "variableName": "nSamples"
          },
          {
            "kind": "Variable",
            "name": "timeRange",
            "variableName": "timeRange"
          }
        ],
        "concreteType": "UMAPPoints",
        "kind": "LinkedField",
        "name": "UMAPPoints",
        "plural": false,
        "selections": [
          {
            "alias": null,
            "args": null,
            "concreteType": "UMAPPoint",
            "kind": "LinkedField",
            "name": "data",
            "plural": true,
            "selections": v17,
            "storageKey": null
          },
          {
            "alias": null,
            "args": null,
            "concreteType": "UMAPPoint",
            "kind": "LinkedField",
            "name": "referenceData",
            "plural": true,
            "selections": v17,
            "storageKey": null
          },
          {
            "alias": null,
            "args": null,
            "concreteType": "UMAPPoint",
            "kind": "LinkedField",
            "name": "corpusData",
            "plural": true,
            "selections": v17,
            "storageKey": null
          },
          {
            "alias": null,
            "args": null,
            "concreteType": "Cluster",
            "kind": "LinkedField",
            "name": "clusters",
            "plural": true,
            "selections": [
              v13,
              {
                "alias": null,
                "args": null,
                "kind": "ScalarField",
                "name": "eventIds",
                "storageKey": null
              },
              {
                "alias": null,
                "args": null,
                "kind": "ScalarField",
                "name": "driftRatio",
                "storageKey": null
              },
              {
                "alias": null,
                "args": null,
                "kind": "ScalarField",
                "name": "primaryToCorpusRatio",
                "storageKey": null
              },
              {
                "condition": "fetchDataQualityMetric",
                "kind": "Condition",
                "passingValue": true,
                "selections": [
                  {
                    "alias": null,
                    "args": [
                      {
                        "fields": [
                          {
                            "kind": "Variable",
                            "name": "columnName",
                            "variableName": "dataQualityMetricColumnName"
                          },
                          {
                            "kind": "Literal",
                            "name": "metric",
                            "value": "mean"
                          }
                        ],
                        "kind": "ObjectValue",
                        "name": "metric"
                      }
                    ],
                    "concreteType": "DatasetValues",
                    "kind": "LinkedField",
                    "name": "dataQualityMetric",
                    "plural": false,
                    "selections": v18,
                    "storageKey": null
                  }
                ]
              },
              {
                "condition": "fetchPerformanceMetric",
                "kind": "Condition",
                "passingValue": true,
                "selections": [
                  {
                    "alias": null,
                    "args": [
                      {
                        "fields": [
                          {
                            "kind": "Variable",
                            "name": "metric",
                            "variableName": "performanceMetric"
                          }
                        ],
                        "kind": "ObjectValue",
                        "name": "metric"
                      }
                    ],
                    "concreteType": "DatasetValues",
                    "kind": "LinkedField",
                    "name": "performanceMetric",
                    "plural": false,
                    "selections": v18,
                    "storageKey": null
                  }
                ]
              }
            ],
            "storageKey": null
          },
          {
            "alias": null,
            "args": null,
            "concreteType": "Retrieval",
            "kind": "LinkedField",
            "name": "contextRetrievals",
            "plural": true,
            "selections": [
              {
                "alias": null,
                "args": null,
                "kind": "ScalarField",
                "name": "queryId",
                "storageKey": null
              },
              {
                "alias": null,
                "args": null,
                "kind": "ScalarField",
                "name": "documentId",
                "storageKey": null
              },
              {
                "alias": null,
                "args": null,
                "kind": "ScalarField",
                "name": "relevance",
                "storageKey": null
              }
            ],
            "storageKey": null
          }
        ],
        "storageKey": null
      }
    ],
    "type": "EmbeddingDimension",
    "abstractKey": null
  };
  return {
    "fragment": {
      "argumentDefinitions": [
        v0,
        v12,
        v22,
        v32,
        v4,
        v5,
        v6,
        v7,
        v8,
        v9,
        v10,
        v11
      ],
      "kind": "Fragment",
      "metadata": null,
      "name": "EmbeddingPageUMAPQuery",
      "selections": [
        {
          "alias": "embedding",
          "args": v122,
          "concreteType": null,
          "kind": "LinkedField",
          "name": "node",
          "plural": false,
          "selections": [
            v19
          ],
          "storageKey": null
        }
      ],
      "type": "Query",
      "abstractKey": null
    },
    "kind": "Request",
    "operation": {
      "argumentDefinitions": [
        v5,
        v11,
        v7,
        v8,
        v9,
        v6,
        v0,
        v12,
        v32,
        v22,
        v4,
        v10
      ],
      "kind": "Operation",
      "name": "EmbeddingPageUMAPQuery",
      "selections": [
        {
          "alias": "embedding",
          "args": v122,
          "concreteType": null,
          "kind": "LinkedField",
          "name": "node",
          "plural": false,
          "selections": [
            v14,
            v19,
            {
              "kind": "TypeDiscriminator",
              "abstractKey": "__isNode"
            },
            v13
          ],
          "storageKey": null
        }
      ]
    },
    "params": {
      "cacheID": "d30210c52f86b9d9a7ac958f866aa93e",
      "id": null,
      "metadata": {},
      "name": "EmbeddingPageUMAPQuery",
      "operationKind": "query",
      "text": "query EmbeddingPageUMAPQuery(\n  $id: GlobalID!\n  $timeRange: TimeRange!\n  $minDist: Float!\n  $nNeighbors: Int!\n  $nSamples: Int!\n  $minClusterSize: Int!\n  $clusterMinSamples: Int!\n  $clusterSelectionEpsilon: Float!\n  $fetchDataQualityMetric: Boolean!\n  $dataQualityMetricColumnName: String\n  $fetchPerformanceMetric: Boolean!\n  $performanceMetric: PerformanceMetric!\n) {\n  embedding: node(id: $id) {\n    __typename\n    ... on EmbeddingDimension {\n      UMAPPoints(timeRange: $timeRange, minDist: $minDist, nNeighbors: $nNeighbors, nSamples: $nSamples, minClusterSize: $minClusterSize, clusterMinSamples: $clusterMinSamples, clusterSelectionEpsilon: $clusterSelectionEpsilon) {\n        data {\n          id\n          eventId\n          coordinates {\n            __typename\n            ... on Point3D {\n              x\n              y\n              z\n            }\n            ... on Point2D {\n              x\n              y\n            }\n          }\n          embeddingMetadata {\n            linkToData\n            rawData\n          }\n          eventMetadata {\n            predictionId\n            predictionLabel\n            actualLabel\n            predictionScore\n            actualScore\n          }\n        }\n        referenceData {\n          id\n          eventId\n          coordinates {\n            __typename\n            ... on Point3D {\n              x\n              y\n              z\n            }\n            ... on Point2D {\n              x\n              y\n            }\n          }\n          embeddingMetadata {\n            linkToData\n            rawData\n          }\n          eventMetadata {\n            predictionId\n            predictionLabel\n            actualLabel\n            predictionScore\n            actualScore\n          }\n        }\n        corpusData {\n          id\n          eventId\n          coordinates {\n            __typename\n            ... on Point3D {\n              x\n              y\n              z\n            }\n            ... on Point2D {\n              x\n              y\n            }\n          }\n          embeddingMetadata {\n            linkToData\n            rawData\n          }\n          eventMetadata {\n            predictionId\n            predictionLabel\n            actualLabel\n            predictionScore\n            actualScore\n          }\n        }\n        clusters {\n          id\n          eventIds\n          driftRatio\n          primaryToCorpusRatio\n          dataQualityMetric(metric: {columnName: $dataQualityMetricColumnName, metric: mean}) @include(if: $fetchDataQualityMetric) {\n            primaryValue\n            referenceValue\n          }\n          performanceMetric(metric: {metric: $performanceMetric}) @include(if: $fetchPerformanceMetric) {\n            primaryValue\n            referenceValue\n          }\n        }\n        contextRetrievals {\n          queryId\n          documentId\n          relevance\n        }\n      }\n    }\n    __isNode: __typename\n    id\n  }\n}\n"
    }
  };
}();
node29.hash = "f1ee7ce02317f1c3fe96b77af405095f";
var EmbeddingPageUMAPQuery_graphql_default = node29;

// src/pages/embedding/__generated__/EmbeddingPageModelQuery.graphql.ts
var node30 = {
  "fragment": {
    "argumentDefinitions": [],
    "kind": "Fragment",
    "metadata": null,
    "name": "EmbeddingPageModelQuery",
    "selections": [
      {
        "alias": null,
        "args": null,
        "concreteType": "Model",
        "kind": "LinkedField",
        "name": "model",
        "plural": false,
        "selections": [
          {
            "args": null,
            "kind": "FragmentSpread",
            "name": "MetricSelector_dimensions"
          }
        ],
        "storageKey": null
      }
    ],
    "type": "Query",
    "abstractKey": null
  },
  "kind": "Request",
  "operation": {
    "argumentDefinitions": [],
    "kind": "Operation",
    "name": "EmbeddingPageModelQuery",
    "selections": [
      {
        "alias": null,
        "args": null,
        "concreteType": "Model",
        "kind": "LinkedField",
        "name": "model",
        "plural": false,
        "selections": [
          {
            "alias": "numericDimensions",
            "args": [
              {
                "kind": "Literal",
                "name": "include",
                "value": {
                  "dataTypes": [
                    "numeric"
                  ]
                }
              }
            ],
            "concreteType": "DimensionConnection",
            "kind": "LinkedField",
            "name": "dimensions",
            "plural": false,
            "selections": [
              {
                "alias": null,
                "args": null,
                "concreteType": "DimensionEdge",
                "kind": "LinkedField",
                "name": "edges",
                "plural": true,
                "selections": [
                  {
                    "alias": null,
                    "args": null,
                    "concreteType": "Dimension",
                    "kind": "LinkedField",
                    "name": "node",
                    "plural": false,
                    "selections": [
                      {
                        "alias": null,
                        "args": null,
                        "kind": "ScalarField",
                        "name": "id",
                        "storageKey": null
                      },
                      {
                        "alias": null,
                        "args": null,
                        "kind": "ScalarField",
                        "name": "name",
                        "storageKey": null
                      },
                      {
                        "alias": null,
                        "args": null,
                        "kind": "ScalarField",
                        "name": "type",
                        "storageKey": null
                      }
                    ],
                    "storageKey": null
                  }
                ],
                "storageKey": null
              }
            ],
            "storageKey": 'dimensions(include:{"dataTypes":["numeric"]})'
          }
        ],
        "storageKey": null
      }
    ]
  },
  "params": {
    "cacheID": "4ccf476dd862525b059197daccd0d4d9",
    "id": null,
    "metadata": {},
    "name": "EmbeddingPageModelQuery",
    "operationKind": "query",
    "text": "query EmbeddingPageModelQuery {\n  model {\n    ...MetricSelector_dimensions\n  }\n}\n\nfragment MetricSelector_dimensions on Model {\n  numericDimensions: dimensions(include: {dataTypes: [numeric]}) {\n    edges {\n      node {\n        id\n        name\n        type\n      }\n    }\n  }\n}\n"
  }
};
node30.hash = "374499f7f8ce6919e4a0a4ecbe380c52";
var EmbeddingPageModelQuery_graphql_default = node30;

// src/pages/embedding/EmbeddingPage.tsx
var import_react180 = __toESM(require_react());
var import_react_relay20 = __toESM(require_react_relay());

// node_modules/react-resizable-panels/dist/react-resizable-panels.browser.esm.js
var React84 = __toESM(require_react());
var {
  createElement: createElement16,
  createContext: createContext15,
  forwardRef: forwardRef14,
  useCallback: useCallback16,
  useContext: useContext15,
  useEffect: useEffect26,
  useImperativeHandle: useImperativeHandle4,
  useLayoutEffect: useLayoutEffect11,
  useMemo: useMemo26,
  useRef: useRef25,
  useState: useState24
} = React84;
var useId = React84["useId".toString()];
var useIsomorphicLayoutEffect4 = useLayoutEffect11;
var wrappedUseId = typeof useId === "function" ? useId : () => null;
var counter = 0;
function useUniqueId(idFromParams = null) {
  const idFromUseId = wrappedUseId();
  const idRef = useRef25(idFromParams || idFromUseId || null);
  if (idRef.current === null) {
    idRef.current = "" + counter++;
  }
  return idRef.current;
}
var PanelGroupContext = createContext15(null);
PanelGroupContext.displayName = "PanelGroupContext";
function PanelWithForwardedRef({
  children = null,
  className: classNameFromProps = "",
  collapsedSize = 0,
  collapsible = false,
  defaultSize = null,
  forwardedRef,
  id: idFromProps = null,
  maxSize = 100,
  minSize = 10,
  onCollapse = null,
  onResize = null,
  order = null,
  style: styleFromProps = {},
  tagName: Type = "div"
}) {
  const context2 = useContext15(PanelGroupContext);
  if (context2 === null) {
    throw Error(`Panel components must be rendered within a PanelGroup container`);
  }
  const panelId = useUniqueId(idFromProps);
  const {
    collapsePanel,
    expandPanel,
    getPanelStyle,
    registerPanel,
    resizePanel,
    unregisterPanel
  } = context2;
  const callbacksRef = useRef25({
    onCollapse,
    onResize
  });
  useEffect26(() => {
    callbacksRef.current.onCollapse = onCollapse;
    callbacksRef.current.onResize = onResize;
  });
  if (minSize < 0 || minSize > 100) {
    throw Error(`Panel minSize must be between 0 and 100, but was ${minSize}`);
  } else if (maxSize < 0 || maxSize > 100) {
    throw Error(`Panel maxSize must be between 0 and 100, but was ${maxSize}`);
  } else {
    if (defaultSize !== null) {
      if (defaultSize < 0 || defaultSize > 100) {
        throw Error(`Panel defaultSize must be between 0 and 100, but was ${defaultSize}`);
      } else if (minSize > defaultSize && !collapsible) {
        console.error(`Panel minSize ${minSize} cannot be greater than defaultSize ${defaultSize}`);
        defaultSize = minSize;
      }
    }
  }
  const style = getPanelStyle(panelId, defaultSize);
  const committedValuesRef = useRef25({
    size: parseSizeFromStyle(style)
  });
  const panelDataRef = useRef25({
    callbacksRef,
    collapsedSize,
    collapsible,
    defaultSize,
    id: panelId,
    idWasAutoGenerated: idFromProps == null,
    maxSize,
    minSize,
    order
  });
  useIsomorphicLayoutEffect4(() => {
    committedValuesRef.current.size = parseSizeFromStyle(style);
    panelDataRef.current.callbacksRef = callbacksRef;
    panelDataRef.current.collapsedSize = collapsedSize;
    panelDataRef.current.collapsible = collapsible;
    panelDataRef.current.defaultSize = defaultSize;
    panelDataRef.current.id = panelId;
    panelDataRef.current.idWasAutoGenerated = idFromProps == null;
    panelDataRef.current.maxSize = maxSize;
    panelDataRef.current.minSize = minSize;
    panelDataRef.current.order = order;
  });
  useIsomorphicLayoutEffect4(() => {
    registerPanel(panelId, panelDataRef);
    return () => {
      unregisterPanel(panelId);
    };
  }, [order, panelId, registerPanel, unregisterPanel]);
  useImperativeHandle4(forwardedRef, () => ({
    collapse: () => collapsePanel(panelId),
    expand: () => expandPanel(panelId),
    getCollapsed() {
      return committedValuesRef.current.size === 0;
    },
    getSize() {
      return committedValuesRef.current.size;
    },
    resize: (percentage) => resizePanel(panelId, percentage)
  }), [collapsePanel, expandPanel, panelId, resizePanel]);
  return createElement16(Type, {
    children,
    className: classNameFromProps,
    "data-panel": "",
    "data-panel-collapsible": collapsible || void 0,
    "data-panel-id": panelId,
    "data-panel-size": parseFloat("" + style.flexGrow).toFixed(1),
    id: `data-panel-id-${panelId}`,
    style: {
      ...style,
      ...styleFromProps
    }
  });
}
var Panel = forwardRef14((props, ref) => createElement16(PanelWithForwardedRef, {
  ...props,
  forwardedRef: ref
}));
PanelWithForwardedRef.displayName = "Panel";
Panel.displayName = "forwardRef(Panel)";
function parseSizeFromStyle(style) {
  const {
    flexGrow
  } = style;
  if (typeof flexGrow === "string") {
    return parseFloat(flexGrow);
  } else {
    return flexGrow;
  }
}
var PRECISION = 10;
function adjustByDelta(event, panels, idBefore, idAfter, delta, prevSizes, panelSizeBeforeCollapse, initialDragState) {
  const {
    sizes: initialSizes
  } = initialDragState || {};
  const baseSizes = initialSizes || prevSizes;
  if (delta === 0) {
    return baseSizes;
  }
  const panelsArray = panelsMapToSortedArray(panels);
  const nextSizes = baseSizes.concat();
  let deltaApplied = 0;
  {
    const pivotId2 = delta < 0 ? idAfter : idBefore;
    const index2 = panelsArray.findIndex((panel2) => panel2.current.id === pivotId2);
    const panel = panelsArray[index2];
    const baseSize = baseSizes[index2];
    const nextSize = safeResizePanel(panel, Math.abs(delta), baseSize, event);
    if (baseSize === nextSize) {
      return baseSizes;
    } else {
      if (nextSize === 0 && baseSize > 0) {
        panelSizeBeforeCollapse.set(pivotId2, baseSize);
      }
      delta = delta < 0 ? baseSize - nextSize : nextSize - baseSize;
    }
  }
  let pivotId = delta < 0 ? idBefore : idAfter;
  let index = panelsArray.findIndex((panel) => panel.current.id === pivotId);
  while (true) {
    const panel = panelsArray[index];
    const baseSize = baseSizes[index];
    const deltaRemaining = Math.abs(delta) - Math.abs(deltaApplied);
    const nextSize = safeResizePanel(panel, 0 - deltaRemaining, baseSize, event);
    if (baseSize !== nextSize) {
      if (nextSize === 0 && baseSize > 0) {
        panelSizeBeforeCollapse.set(panel.current.id, baseSize);
      }
      deltaApplied += baseSize - nextSize;
      nextSizes[index] = nextSize;
      if (deltaApplied.toPrecision(PRECISION).localeCompare(Math.abs(delta).toPrecision(PRECISION), void 0, {
        numeric: true
      }) >= 0) {
        break;
      }
    }
    if (delta < 0) {
      if (--index < 0) {
        break;
      }
    } else {
      if (++index >= panelsArray.length) {
        break;
      }
    }
  }
  if (deltaApplied === 0) {
    return baseSizes;
  }
  pivotId = delta < 0 ? idAfter : idBefore;
  index = panelsArray.findIndex((panel) => panel.current.id === pivotId);
  nextSizes[index] = baseSizes[index] + deltaApplied;
  return nextSizes;
}
function callPanelCallbacks(panelsArray, sizes2, panelIdToLastNotifiedSizeMap) {
  sizes2.forEach((size, index) => {
    const panelRef = panelsArray[index];
    if (!panelRef) {
      return;
    }
    const {
      callbacksRef,
      collapsedSize,
      collapsible,
      id: id2
    } = panelRef.current;
    const lastNotifiedSize = panelIdToLastNotifiedSizeMap[id2];
    if (lastNotifiedSize !== size) {
      panelIdToLastNotifiedSizeMap[id2] = size;
      const {
        onCollapse,
        onResize
      } = callbacksRef.current;
      if (onResize) {
        onResize(size, lastNotifiedSize);
      }
      if (collapsible && onCollapse) {
        if ((lastNotifiedSize == null || lastNotifiedSize === collapsedSize) && size !== collapsedSize) {
          onCollapse(false);
        } else if (lastNotifiedSize !== collapsedSize && size === collapsedSize) {
          onCollapse(true);
        }
      }
    }
  });
}
function getBeforeAndAfterIds(id2, panelsArray) {
  if (panelsArray.length < 2) {
    return [null, null];
  }
  const index = panelsArray.findIndex((panel) => panel.current.id === id2);
  if (index < 0) {
    return [null, null];
  }
  const isLastPanel = index === panelsArray.length - 1;
  const idBefore = isLastPanel ? panelsArray[index - 1].current.id : id2;
  const idAfter = isLastPanel ? id2 : panelsArray[index + 1].current.id;
  return [idBefore, idAfter];
}
function getFlexGrow(panels, id2, sizes2) {
  if (panels.size === 1) {
    return "100";
  }
  const panelsArray = panelsMapToSortedArray(panels);
  const index = panelsArray.findIndex((panel) => panel.current.id === id2);
  const size = sizes2[index];
  if (size == null) {
    return "0";
  }
  return size.toPrecision(PRECISION);
}
function getPanel2(id2) {
  const element2 = document.querySelector(`[data-panel-id="${id2}"]`);
  if (element2) {
    return element2;
  }
  return null;
}
function getPanelGroup(id2) {
  const element2 = document.querySelector(`[data-panel-group-id="${id2}"]`);
  if (element2) {
    return element2;
  }
  return null;
}
function getResizeHandle(id2) {
  const element2 = document.querySelector(`[data-panel-resize-handle-id="${id2}"]`);
  if (element2) {
    return element2;
  }
  return null;
}
function getResizeHandleIndex(id2) {
  const handles = getResizeHandles();
  const index = handles.findIndex((handle) => handle.getAttribute("data-panel-resize-handle-id") === id2);
  return index ?? null;
}
function getResizeHandles() {
  return Array.from(document.querySelectorAll(`[data-panel-resize-handle-id]`));
}
function getResizeHandlesForGroup(groupId) {
  return Array.from(document.querySelectorAll(`[data-panel-resize-handle-id][data-panel-group-id="${groupId}"]`));
}
function getResizeHandlePanelIds(groupId, handleId, panelsArray) {
  const handle = getResizeHandle(handleId);
  const handles = getResizeHandlesForGroup(groupId);
  const index = handle ? handles.indexOf(handle) : -1;
  const idBefore = panelsArray[index]?.current?.id ?? null;
  const idAfter = panelsArray[index + 1]?.current?.id ?? null;
  return [idBefore, idAfter];
}
function panelsMapToSortedArray(panels) {
  return Array.from(panels.values()).sort((panelA, panelB) => {
    const orderA = panelA.current.order;
    const orderB = panelB.current.order;
    if (orderA == null && orderB == null) {
      return 0;
    } else if (orderA == null) {
      return -1;
    } else if (orderB == null) {
      return 1;
    } else {
      return orderA - orderB;
    }
  });
}
function safeResizePanel(panel, delta, prevSize, event) {
  const nextSizeUnsafe = prevSize + delta;
  const {
    collapsedSize,
    collapsible,
    maxSize,
    minSize
  } = panel.current;
  if (collapsible) {
    if (prevSize > collapsedSize) {
      if (nextSizeUnsafe <= minSize / 2 + collapsedSize) {
        return collapsedSize;
      }
    } else {
      const isKeyboardEvent = event?.type?.startsWith("key");
      if (!isKeyboardEvent) {
        if (nextSizeUnsafe < minSize) {
          return collapsedSize;
        }
      }
    }
  }
  const nextSize = Math.min(maxSize, Math.max(minSize, nextSizeUnsafe));
  return nextSize;
}
function assert(expectedCondition, message = "Assertion failed!") {
  if (!expectedCondition) {
    console.error(message);
    throw Error(message);
  }
}
function useWindowSplitterPanelGroupBehavior({
  committedValuesRef,
  groupId,
  panels,
  setSizes,
  sizes: sizes2,
  panelSizeBeforeCollapse
}) {
  useEffect26(() => {
    const {
      direction,
      panels: panels2
    } = committedValuesRef.current;
    const groupElement = getPanelGroup(groupId);
    const {
      height,
      width
    } = groupElement.getBoundingClientRect();
    const handles = getResizeHandlesForGroup(groupId);
    const cleanupFunctions = handles.map((handle) => {
      const handleId = handle.getAttribute("data-panel-resize-handle-id");
      const panelsArray = panelsMapToSortedArray(panels2);
      const [idBefore, idAfter] = getResizeHandlePanelIds(groupId, handleId, panelsArray);
      if (idBefore == null || idAfter == null) {
        return () => {
        };
      }
      let minSize = 0;
      let maxSize = 100;
      let totalMinSize = 0;
      let totalMaxSize = 0;
      panelsArray.forEach((panelData) => {
        if (panelData.current.id === idBefore) {
          maxSize = panelData.current.maxSize;
          minSize = panelData.current.minSize;
        } else {
          totalMinSize += panelData.current.minSize;
          totalMaxSize += panelData.current.maxSize;
        }
      });
      const ariaValueMax = Math.min(maxSize, 100 - totalMinSize);
      const ariaValueMin = Math.max(minSize, (panelsArray.length - 1) * 100 - totalMaxSize);
      const flexGrow = getFlexGrow(panels2, idBefore, sizes2);
      handle.setAttribute("aria-valuemax", "" + Math.round(ariaValueMax));
      handle.setAttribute("aria-valuemin", "" + Math.round(ariaValueMin));
      handle.setAttribute("aria-valuenow", "" + Math.round(parseInt(flexGrow)));
      const onKeyDown = (event) => {
        if (event.defaultPrevented) {
          return;
        }
        switch (event.key) {
          case "Enter": {
            event.preventDefault();
            const index = panelsArray.findIndex((panel) => panel.current.id === idBefore);
            if (index >= 0) {
              const panelData = panelsArray[index];
              const size = sizes2[index];
              if (size != null) {
                let delta = 0;
                if (size.toPrecision(PRECISION) <= panelData.current.minSize.toPrecision(PRECISION)) {
                  delta = direction === "horizontal" ? width : height;
                } else {
                  delta = -(direction === "horizontal" ? width : height);
                }
                const nextSizes = adjustByDelta(event, panels2, idBefore, idAfter, delta, sizes2, panelSizeBeforeCollapse.current, null);
                if (sizes2 !== nextSizes) {
                  setSizes(nextSizes);
                }
              }
            }
            break;
          }
        }
      };
      handle.addEventListener("keydown", onKeyDown);
      const panelBefore = getPanel2(idBefore);
      if (panelBefore != null) {
        handle.setAttribute("aria-controls", panelBefore.id);
      }
      return () => {
        handle.removeAttribute("aria-valuemax");
        handle.removeAttribute("aria-valuemin");
        handle.removeAttribute("aria-valuenow");
        handle.removeEventListener("keydown", onKeyDown);
        if (panelBefore != null) {
          handle.removeAttribute("aria-controls");
        }
      };
    });
    return () => {
      cleanupFunctions.forEach((cleanupFunction) => cleanupFunction());
    };
  }, [committedValuesRef, groupId, panels, panelSizeBeforeCollapse, setSizes, sizes2]);
}
function useWindowSplitterResizeHandlerBehavior({
  disabled,
  handleId,
  resizeHandler
}) {
  useEffect26(() => {
    if (disabled || resizeHandler == null) {
      return;
    }
    const handleElement = getResizeHandle(handleId);
    if (handleElement == null) {
      return;
    }
    const onKeyDown = (event) => {
      if (event.defaultPrevented) {
        return;
      }
      switch (event.key) {
        case "ArrowDown":
        case "ArrowLeft":
        case "ArrowRight":
        case "ArrowUp":
        case "End":
        case "Home": {
          event.preventDefault();
          resizeHandler(event);
          break;
        }
        case "F6": {
          event.preventDefault();
          const handles = getResizeHandles();
          const index = getResizeHandleIndex(handleId);
          assert(index !== null);
          const nextIndex = event.shiftKey ? index > 0 ? index - 1 : handles.length - 1 : index + 1 < handles.length ? index + 1 : 0;
          const nextHandle = handles[nextIndex];
          nextHandle.focus();
          break;
        }
      }
    };
    handleElement.addEventListener("keydown", onKeyDown);
    return () => {
      handleElement.removeEventListener("keydown", onKeyDown);
    };
  }, [disabled, handleId, resizeHandler]);
}
function areEqual(arrayA, arrayB) {
  if (arrayA.length !== arrayB.length) {
    return false;
  }
  for (let index = 0; index < arrayA.length; index++) {
    if (arrayA[index] !== arrayB[index]) {
      return false;
    }
  }
  return true;
}
function getDragOffset(event, handleId, direction, initialOffset = 0, initialHandleElementRect = null) {
  const isHorizontal = direction === "horizontal";
  let pointerOffset = 0;
  if (isMouseEvent(event)) {
    pointerOffset = isHorizontal ? event.clientX : event.clientY;
  } else if (isTouchEvent(event)) {
    const firstTouch = event.touches[0];
    pointerOffset = isHorizontal ? firstTouch.screenX : firstTouch.screenY;
  } else {
    return 0;
  }
  const handleElement = getResizeHandle(handleId);
  const rect = initialHandleElementRect || handleElement.getBoundingClientRect();
  const elementOffset = isHorizontal ? rect.left : rect.top;
  return pointerOffset - elementOffset - initialOffset;
}
function getMovement(event, groupId, handleId, panelsArray, direction, prevSizes, initialDragState) {
  const {
    dragOffset = 0,
    dragHandleRect,
    sizes: initialSizes
  } = initialDragState || {};
  const baseSizes = initialSizes || prevSizes;
  if (isKeyDown(event)) {
    const isHorizontal = direction === "horizontal";
    const groupElement = getPanelGroup(groupId);
    const rect = groupElement.getBoundingClientRect();
    const groupSizeInPixels = isHorizontal ? rect.width : rect.height;
    const denominator = event.shiftKey ? 10 : 100;
    const delta = groupSizeInPixels / denominator;
    let movement = 0;
    switch (event.key) {
      case "ArrowDown":
        movement = isHorizontal ? 0 : delta;
        break;
      case "ArrowLeft":
        movement = isHorizontal ? -delta : 0;
        break;
      case "ArrowRight":
        movement = isHorizontal ? delta : 0;
        break;
      case "ArrowUp":
        movement = isHorizontal ? 0 : -delta;
        break;
      case "End":
        movement = groupSizeInPixels;
        break;
      case "Home":
        movement = -groupSizeInPixels;
        break;
    }
    const [idBefore, idAfter] = getResizeHandlePanelIds(groupId, handleId, panelsArray);
    const targetPanelId = movement < 0 ? idBefore : idAfter;
    const targetPanelIndex = panelsArray.findIndex((panel) => panel.current.id === targetPanelId);
    const targetPanel = panelsArray[targetPanelIndex];
    if (targetPanel.current.collapsible) {
      const baseSize = baseSizes[targetPanelIndex];
      if (baseSize === 0 || baseSize.toPrecision(PRECISION) === targetPanel.current.minSize.toPrecision(PRECISION)) {
        movement = movement < 0 ? -targetPanel.current.minSize * groupSizeInPixels : targetPanel.current.minSize * groupSizeInPixels;
      }
    }
    return movement;
  } else {
    return getDragOffset(event, handleId, direction, dragOffset, dragHandleRect);
  }
}
function isKeyDown(event) {
  return event.type === "keydown";
}
function isMouseEvent(event) {
  return event.type.startsWith("mouse");
}
function isTouchEvent(event) {
  return event.type.startsWith("touch");
}
var currentState = null;
var element = null;
function getCursorStyle(state) {
  switch (state) {
    case "horizontal":
      return "ew-resize";
    case "horizontal-max":
      return "w-resize";
    case "horizontal-min":
      return "e-resize";
    case "vertical":
      return "ns-resize";
    case "vertical-max":
      return "n-resize";
    case "vertical-min":
      return "s-resize";
  }
}
function resetGlobalCursorStyle() {
  if (element !== null) {
    document.head.removeChild(element);
    currentState = null;
    element = null;
  }
}
function setGlobalCursorStyle(state) {
  if (currentState === state) {
    return;
  }
  currentState = state;
  const style = getCursorStyle(state);
  if (element === null) {
    element = document.createElement("style");
    document.head.appendChild(element);
  }
  element.innerHTML = `*{cursor: ${style}!important;}`;
}
function debounce2(callback, durationMs = 10) {
  let timeoutId = null;
  let callable = (...args) => {
    if (timeoutId !== null) {
      clearTimeout(timeoutId);
    }
    timeoutId = setTimeout(() => {
      callback(...args);
    }, durationMs);
  };
  return callable;
}
function getSerializationKey(panels) {
  return panels.map((panel) => {
    const {
      minSize,
      order
    } = panel.current;
    return order ? `${order}:${minSize}` : `${minSize}`;
  }).sort((a2, b) => a2.localeCompare(b)).join(",");
}
function loadSerializedPanelGroupState(autoSaveId, storage) {
  try {
    const serialized = storage.getItem(`PanelGroup:sizes:${autoSaveId}`);
    if (serialized) {
      const parsed = JSON.parse(serialized);
      if (typeof parsed === "object" && parsed != null) {
        return parsed;
      }
    }
  } catch (error) {
  }
  return null;
}
function loadPanelLayout(autoSaveId, panels, storage) {
  const state = loadSerializedPanelGroupState(autoSaveId, storage);
  if (state) {
    const key = getSerializationKey(panels);
    return state[key] ?? null;
  }
  return null;
}
function savePanelGroupLayout(autoSaveId, panels, sizes2, storage) {
  const key = getSerializationKey(panels);
  const state = loadSerializedPanelGroupState(autoSaveId, storage) || {};
  state[key] = sizes2;
  try {
    storage.setItem(`PanelGroup:sizes:${autoSaveId}`, JSON.stringify(state));
  } catch (error) {
    console.error(error);
  }
}
var debounceMap = {};
function initializeDefaultStorage(storageObject) {
  try {
    if (typeof localStorage !== "undefined") {
      storageObject.getItem = (name2) => {
        return localStorage.getItem(name2);
      };
      storageObject.setItem = (name2, value) => {
        localStorage.setItem(name2, value);
      };
    } else {
      throw new Error("localStorage not supported in this environment");
    }
  } catch (error) {
    console.error(error);
    storageObject.getItem = () => null;
    storageObject.setItem = () => {
    };
  }
}
var defaultStorage = {
  getItem: (name2) => {
    initializeDefaultStorage(defaultStorage);
    return defaultStorage.getItem(name2);
  },
  setItem: (name2, value) => {
    initializeDefaultStorage(defaultStorage);
    defaultStorage.setItem(name2, value);
  }
};
function PanelGroupWithForwardedRef({
  autoSaveId,
  children = null,
  className: classNameFromProps = "",
  direction,
  disablePointerEventsDuringResize = false,
  forwardedRef,
  id: idFromProps = null,
  onLayout,
  storage = defaultStorage,
  style: styleFromProps = {},
  tagName: Type = "div"
}) {
  const groupId = useUniqueId(idFromProps);
  const [activeHandleId, setActiveHandleId] = useState24(null);
  const [panels, setPanels] = useState24(/* @__PURE__ */ new Map());
  const initialDragStateRef = useRef25(null);
  useRef25({
    didLogDefaultSizeWarning: false,
    didLogIdAndOrderWarning: false,
    prevPanelIds: []
  });
  const callbacksRef = useRef25({
    onLayout
  });
  useEffect26(() => {
    callbacksRef.current.onLayout = onLayout;
  });
  const panelIdToLastNotifiedSizeMapRef = useRef25({});
  const [sizes2, setSizes] = useState24([]);
  const panelSizeBeforeCollapse = useRef25(/* @__PURE__ */ new Map());
  const prevDeltaRef = useRef25(0);
  const committedValuesRef = useRef25({
    direction,
    panels,
    sizes: sizes2
  });
  useImperativeHandle4(forwardedRef, () => ({
    getLayout: () => {
      const {
        sizes: sizes3
      } = committedValuesRef.current;
      return sizes3;
    },
    setLayout: (sizes3) => {
      const total = sizes3.reduce((accumulated, current) => accumulated + current, 0);
      assert(total === 100, "Panel sizes must add up to 100%");
      const {
        panels: panels2
      } = committedValuesRef.current;
      const panelIdToLastNotifiedSizeMap = panelIdToLastNotifiedSizeMapRef.current;
      const panelsArray = panelsMapToSortedArray(panels2);
      setSizes(sizes3);
      callPanelCallbacks(panelsArray, sizes3, panelIdToLastNotifiedSizeMap);
    }
  }), []);
  useIsomorphicLayoutEffect4(() => {
    committedValuesRef.current.direction = direction;
    committedValuesRef.current.panels = panels;
    committedValuesRef.current.sizes = sizes2;
  });
  useWindowSplitterPanelGroupBehavior({
    committedValuesRef,
    groupId,
    panels,
    setSizes,
    sizes: sizes2,
    panelSizeBeforeCollapse
  });
  useEffect26(() => {
    const {
      onLayout: onLayout2
    } = callbacksRef.current;
    const {
      panels: panels2,
      sizes: sizes3
    } = committedValuesRef.current;
    if (sizes3.length > 0) {
      if (onLayout2) {
        onLayout2(sizes3);
      }
      const panelIdToLastNotifiedSizeMap = panelIdToLastNotifiedSizeMapRef.current;
      const panelsArray = panelsMapToSortedArray(panels2);
      callPanelCallbacks(panelsArray, sizes3, panelIdToLastNotifiedSizeMap);
    }
  }, [sizes2]);
  useIsomorphicLayoutEffect4(() => {
    const sizes3 = committedValuesRef.current.sizes;
    if (sizes3.length === panels.size) {
      return;
    }
    let defaultSizes = null;
    if (autoSaveId) {
      const panelsArray = panelsMapToSortedArray(panels);
      defaultSizes = loadPanelLayout(autoSaveId, panelsArray, storage);
    }
    if (defaultSizes != null) {
      setSizes(defaultSizes);
    } else {
      const panelsArray = panelsMapToSortedArray(panels);
      let panelsWithNullDefaultSize = 0;
      let totalDefaultSize = 0;
      let totalMinSize = 0;
      panelsArray.forEach((panel) => {
        totalMinSize += panel.current.minSize;
        if (panel.current.defaultSize === null) {
          panelsWithNullDefaultSize++;
        } else {
          totalDefaultSize += panel.current.defaultSize;
        }
      });
      if (totalDefaultSize > 100) {
        throw new Error(`Default panel sizes cannot exceed 100%`);
      } else if (panelsArray.length > 1 && panelsWithNullDefaultSize === 0 && totalDefaultSize !== 100) {
        throw new Error(`Invalid default sizes specified for panels`);
      } else if (totalMinSize > 100) {
        throw new Error(`Minimum panel sizes cannot exceed 100%`);
      }
      setSizes(panelsArray.map((panel) => {
        if (panel.current.defaultSize === null) {
          return (100 - totalDefaultSize) / panelsWithNullDefaultSize;
        }
        return panel.current.defaultSize;
      }));
    }
  }, [autoSaveId, panels, storage]);
  useEffect26(() => {
    if (autoSaveId) {
      if (sizes2.length === 0 || sizes2.length !== panels.size) {
        return;
      }
      const panelsArray = panelsMapToSortedArray(panels);
      if (!debounceMap[autoSaveId]) {
        debounceMap[autoSaveId] = debounce2(savePanelGroupLayout, 100);
      }
      debounceMap[autoSaveId](autoSaveId, panelsArray, sizes2, storage);
    }
  }, [autoSaveId, panels, sizes2, storage]);
  const getPanelStyle = useCallback16((id2, defaultSize) => {
    const {
      panels: panels2
    } = committedValuesRef.current;
    if (panels2.size === 0) {
      return {
        flexBasis: 0,
        flexGrow: defaultSize != null ? defaultSize : void 0,
        flexShrink: 1,
        // Without this, Panel sizes may be unintentionally overridden by their content.
        overflow: "hidden"
      };
    }
    const flexGrow = getFlexGrow(panels2, id2, sizes2);
    return {
      flexBasis: 0,
      flexGrow,
      flexShrink: 1,
      // Without this, Panel sizes may be unintentionally overridden by their content.
      overflow: "hidden",
      // Disable pointer events inside of a panel during resize.
      // This avoid edge cases like nested iframes.
      pointerEvents: disablePointerEventsDuringResize && activeHandleId !== null ? "none" : void 0
    };
  }, [activeHandleId, disablePointerEventsDuringResize, sizes2]);
  const registerPanel = useCallback16((id2, panelRef) => {
    setPanels((prevPanels) => {
      if (prevPanels.has(id2)) {
        return prevPanels;
      }
      const nextPanels = new Map(prevPanels);
      nextPanels.set(id2, panelRef);
      return nextPanels;
    });
  }, []);
  const registerResizeHandle = useCallback16((handleId) => {
    const resizeHandler = (event) => {
      event.preventDefault();
      const {
        direction: direction2,
        panels: panels2,
        sizes: prevSizes
      } = committedValuesRef.current;
      const panelsArray = panelsMapToSortedArray(panels2);
      const [idBefore, idAfter] = getResizeHandlePanelIds(groupId, handleId, panelsArray);
      if (idBefore == null || idAfter == null) {
        return;
      }
      let movement = getMovement(event, groupId, handleId, panelsArray, direction2, prevSizes, initialDragStateRef.current);
      if (movement === 0) {
        return;
      }
      const groupElement = getPanelGroup(groupId);
      const rect = groupElement.getBoundingClientRect();
      const isHorizontal = direction2 === "horizontal";
      if (document.dir === "rtl" && isHorizontal) {
        movement = -movement;
      }
      const size = isHorizontal ? rect.width : rect.height;
      const delta = movement / size * 100;
      const nextSizes = adjustByDelta(event, panels2, idBefore, idAfter, delta, prevSizes, panelSizeBeforeCollapse.current, initialDragStateRef.current);
      const sizesChanged = !areEqual(prevSizes, nextSizes);
      if (isMouseEvent(event) || isTouchEvent(event)) {
        if (prevDeltaRef.current != delta) {
          if (!sizesChanged) {
            if (isHorizontal) {
              setGlobalCursorStyle(movement < 0 ? "horizontal-min" : "horizontal-max");
            } else {
              setGlobalCursorStyle(movement < 0 ? "vertical-min" : "vertical-max");
            }
          } else {
            setGlobalCursorStyle(isHorizontal ? "horizontal" : "vertical");
          }
        }
      }
      if (sizesChanged) {
        const panelIdToLastNotifiedSizeMap = panelIdToLastNotifiedSizeMapRef.current;
        setSizes(nextSizes);
        callPanelCallbacks(panelsArray, nextSizes, panelIdToLastNotifiedSizeMap);
      }
      prevDeltaRef.current = delta;
    };
    return resizeHandler;
  }, [groupId]);
  const unregisterPanel = useCallback16((id2) => {
    setPanels((prevPanels) => {
      if (!prevPanels.has(id2)) {
        return prevPanels;
      }
      const nextPanels = new Map(prevPanels);
      nextPanels.delete(id2);
      return nextPanels;
    });
  }, []);
  const collapsePanel = useCallback16((id2) => {
    const {
      panels: panels2,
      sizes: prevSizes
    } = committedValuesRef.current;
    const panel = panels2.get(id2);
    if (panel == null) {
      return;
    }
    const {
      collapsedSize,
      collapsible
    } = panel.current;
    if (!collapsible) {
      return;
    }
    const panelsArray = panelsMapToSortedArray(panels2);
    const index = panelsArray.indexOf(panel);
    if (index < 0) {
      return;
    }
    const currentSize = prevSizes[index];
    if (currentSize === collapsedSize) {
      return;
    }
    panelSizeBeforeCollapse.current.set(id2, currentSize);
    const [idBefore, idAfter] = getBeforeAndAfterIds(id2, panelsArray);
    if (idBefore == null || idAfter == null) {
      return;
    }
    const isLastPanel = index === panelsArray.length - 1;
    const delta = isLastPanel ? currentSize : collapsedSize - currentSize;
    const nextSizes = adjustByDelta(null, panels2, idBefore, idAfter, delta, prevSizes, panelSizeBeforeCollapse.current, null);
    if (prevSizes !== nextSizes) {
      const panelIdToLastNotifiedSizeMap = panelIdToLastNotifiedSizeMapRef.current;
      setSizes(nextSizes);
      callPanelCallbacks(panelsArray, nextSizes, panelIdToLastNotifiedSizeMap);
    }
  }, []);
  const expandPanel = useCallback16((id2) => {
    const {
      panels: panels2,
      sizes: prevSizes
    } = committedValuesRef.current;
    const panel = panels2.get(id2);
    if (panel == null) {
      return;
    }
    const {
      collapsedSize,
      minSize
    } = panel.current;
    const sizeBeforeCollapse = panelSizeBeforeCollapse.current.get(id2) || minSize;
    if (!sizeBeforeCollapse) {
      return;
    }
    const panelsArray = panelsMapToSortedArray(panels2);
    const index = panelsArray.indexOf(panel);
    if (index < 0) {
      return;
    }
    const currentSize = prevSizes[index];
    if (currentSize !== collapsedSize) {
      return;
    }
    const [idBefore, idAfter] = getBeforeAndAfterIds(id2, panelsArray);
    if (idBefore == null || idAfter == null) {
      return;
    }
    const isLastPanel = index === panelsArray.length - 1;
    const delta = isLastPanel ? collapsedSize - sizeBeforeCollapse : sizeBeforeCollapse;
    const nextSizes = adjustByDelta(null, panels2, idBefore, idAfter, delta, prevSizes, panelSizeBeforeCollapse.current, null);
    if (prevSizes !== nextSizes) {
      const panelIdToLastNotifiedSizeMap = panelIdToLastNotifiedSizeMapRef.current;
      setSizes(nextSizes);
      callPanelCallbacks(panelsArray, nextSizes, panelIdToLastNotifiedSizeMap);
    }
  }, []);
  const resizePanel = useCallback16((id2, nextSize) => {
    const {
      panels: panels2,
      sizes: prevSizes
    } = committedValuesRef.current;
    const panel = panels2.get(id2);
    if (panel == null) {
      return;
    }
    const {
      collapsedSize,
      collapsible,
      maxSize,
      minSize
    } = panel.current;
    const panelsArray = panelsMapToSortedArray(panels2);
    const index = panelsArray.indexOf(panel);
    if (index < 0) {
      return;
    }
    const currentSize = prevSizes[index];
    if (currentSize === nextSize) {
      return;
    }
    if (collapsible && nextSize === collapsedSize)
      ;
    else {
      nextSize = Math.min(maxSize, Math.max(minSize, nextSize));
    }
    const [idBefore, idAfter] = getBeforeAndAfterIds(id2, panelsArray);
    if (idBefore == null || idAfter == null) {
      return;
    }
    const isLastPanel = index === panelsArray.length - 1;
    const delta = isLastPanel ? currentSize - nextSize : nextSize - currentSize;
    const nextSizes = adjustByDelta(null, panels2, idBefore, idAfter, delta, prevSizes, panelSizeBeforeCollapse.current, null);
    if (prevSizes !== nextSizes) {
      const panelIdToLastNotifiedSizeMap = panelIdToLastNotifiedSizeMapRef.current;
      setSizes(nextSizes);
      callPanelCallbacks(panelsArray, nextSizes, panelIdToLastNotifiedSizeMap);
    }
  }, []);
  const context2 = useMemo26(() => ({
    activeHandleId,
    collapsePanel,
    direction,
    expandPanel,
    getPanelStyle,
    groupId,
    registerPanel,
    registerResizeHandle,
    resizePanel,
    startDragging: (id2, event) => {
      setActiveHandleId(id2);
      if (isMouseEvent(event) || isTouchEvent(event)) {
        const handleElement = getResizeHandle(id2);
        initialDragStateRef.current = {
          dragHandleRect: handleElement.getBoundingClientRect(),
          dragOffset: getDragOffset(event, id2, direction),
          sizes: committedValuesRef.current.sizes
        };
      }
    },
    stopDragging: () => {
      resetGlobalCursorStyle();
      setActiveHandleId(null);
      initialDragStateRef.current = null;
    },
    unregisterPanel
  }), [activeHandleId, collapsePanel, direction, expandPanel, getPanelStyle, groupId, registerPanel, registerResizeHandle, resizePanel, unregisterPanel]);
  const style = {
    display: "flex",
    flexDirection: direction === "horizontal" ? "row" : "column",
    height: "100%",
    overflow: "hidden",
    width: "100%"
  };
  return createElement16(PanelGroupContext.Provider, {
    children: createElement16(Type, {
      children,
      className: classNameFromProps,
      "data-panel-group": "",
      "data-panel-group-direction": direction,
      "data-panel-group-id": groupId,
      style: {
        ...style,
        ...styleFromProps
      }
    }),
    value: context2
  });
}
var PanelGroup2 = forwardRef14((props, ref) => createElement16(PanelGroupWithForwardedRef, {
  ...props,
  forwardedRef: ref
}));
PanelGroupWithForwardedRef.displayName = "PanelGroup";
PanelGroup2.displayName = "forwardRef(PanelGroup)";
function PanelResizeHandle({
  children = null,
  className: classNameFromProps = "",
  disabled = false,
  id: idFromProps = null,
  onDragging,
  style: styleFromProps = {},
  tagName: Type = "div"
}) {
  const divElementRef = useRef25(null);
  const callbacksRef = useRef25({
    onDragging
  });
  useEffect26(() => {
    callbacksRef.current.onDragging = onDragging;
  });
  const panelGroupContext = useContext15(PanelGroupContext);
  if (panelGroupContext === null) {
    throw Error(`PanelResizeHandle components must be rendered within a PanelGroup container`);
  }
  const {
    activeHandleId,
    direction,
    groupId,
    registerResizeHandle,
    startDragging,
    stopDragging
  } = panelGroupContext;
  const resizeHandleId = useUniqueId(idFromProps);
  const isDragging = activeHandleId === resizeHandleId;
  const [isFocused, setIsFocused] = useState24(false);
  const [resizeHandler, setResizeHandler] = useState24(null);
  const stopDraggingAndBlur = useCallback16(() => {
    const div = divElementRef.current;
    div.blur();
    stopDragging();
    const {
      onDragging: onDragging2
    } = callbacksRef.current;
    if (onDragging2) {
      onDragging2(false);
    }
  }, [stopDragging]);
  useEffect26(() => {
    if (disabled) {
      setResizeHandler(null);
    } else {
      const resizeHandler2 = registerResizeHandle(resizeHandleId);
      setResizeHandler(() => resizeHandler2);
    }
  }, [disabled, resizeHandleId, registerResizeHandle]);
  useEffect26(() => {
    if (disabled || resizeHandler == null || !isDragging) {
      return;
    }
    const onMove = (event) => {
      resizeHandler(event);
    };
    const onMouseLeave = (event) => {
      resizeHandler(event);
    };
    const divElement = divElementRef.current;
    const targetDocument = divElement.ownerDocument;
    targetDocument.body.addEventListener("contextmenu", stopDraggingAndBlur);
    targetDocument.body.addEventListener("mousemove", onMove);
    targetDocument.body.addEventListener("touchmove", onMove);
    targetDocument.body.addEventListener("mouseleave", onMouseLeave);
    window.addEventListener("mouseup", stopDraggingAndBlur);
    window.addEventListener("touchend", stopDraggingAndBlur);
    return () => {
      targetDocument.body.removeEventListener("contextmenu", stopDraggingAndBlur);
      targetDocument.body.removeEventListener("mousemove", onMove);
      targetDocument.body.removeEventListener("touchmove", onMove);
      targetDocument.body.removeEventListener("mouseleave", onMouseLeave);
      window.removeEventListener("mouseup", stopDraggingAndBlur);
      window.removeEventListener("touchend", stopDraggingAndBlur);
    };
  }, [direction, disabled, isDragging, resizeHandler, stopDraggingAndBlur]);
  useWindowSplitterResizeHandlerBehavior({
    disabled,
    handleId: resizeHandleId,
    resizeHandler
  });
  const style = {
    cursor: getCursorStyle(direction),
    touchAction: "none",
    userSelect: "none"
  };
  return createElement16(Type, {
    children,
    className: classNameFromProps,
    "data-resize-handle-active": isDragging ? "pointer" : isFocused ? "keyboard" : void 0,
    "data-panel-group-direction": direction,
    "data-panel-group-id": groupId,
    "data-panel-resize-handle-enabled": !disabled,
    "data-panel-resize-handle-id": resizeHandleId,
    onBlur: () => setIsFocused(false),
    onFocus: () => setIsFocused(true),
    onMouseDown: (event) => {
      startDragging(resizeHandleId, event.nativeEvent);
      const {
        onDragging: onDragging2
      } = callbacksRef.current;
      if (onDragging2) {
        onDragging2(true);
      }
    },
    onMouseUp: stopDraggingAndBlur,
    onTouchCancel: stopDraggingAndBlur,
    onTouchEnd: stopDraggingAndBlur,
    onTouchStart: (event) => {
      startDragging(resizeHandleId, event.nativeEvent);
      const {
        onDragging: onDragging2
      } = callbacksRef.current;
      if (onDragging2) {
        onDragging2(true);
      }
    },
    ref: divElementRef,
    role: "separator",
    style: {
      ...style,
      ...styleFromProps
    },
    tabIndex: 0
  });
}
PanelResizeHandle.displayName = "PanelResizeHandle";

// node_modules/use-deep-compare-effect/dist/use-deep-compare-effect.esm.js
var React85 = __toESM(require_react());

// node_modules/dequal/dist/index.mjs
var has = Object.prototype.hasOwnProperty;
function find2(iter, tar, key) {
  for (key of iter.keys()) {
    if (dequal(key, tar))
      return key;
  }
}
function dequal(foo, bar) {
  var ctor, len, tmp2;
  if (foo === bar)
    return true;
  if (foo && bar && (ctor = foo.constructor) === bar.constructor) {
    if (ctor === Date)
      return foo.getTime() === bar.getTime();
    if (ctor === RegExp)
      return foo.toString() === bar.toString();
    if (ctor === Array) {
      if ((len = foo.length) === bar.length) {
        while (len-- && dequal(foo[len], bar[len]))
          ;
      }
      return len === -1;
    }
    if (ctor === Set) {
      if (foo.size !== bar.size) {
        return false;
      }
      for (len of foo) {
        tmp2 = len;
        if (tmp2 && typeof tmp2 === "object") {
          tmp2 = find2(bar, tmp2);
          if (!tmp2)
            return false;
        }
        if (!bar.has(tmp2))
          return false;
      }
      return true;
    }
    if (ctor === Map) {
      if (foo.size !== bar.size) {
        return false;
      }
      for (len of foo) {
        tmp2 = len[0];
        if (tmp2 && typeof tmp2 === "object") {
          tmp2 = find2(bar, tmp2);
          if (!tmp2)
            return false;
        }
        if (!dequal(len[1], bar.get(tmp2))) {
          return false;
        }
      }
      return true;
    }
    if (ctor === ArrayBuffer) {
      foo = new Uint8Array(foo);
      bar = new Uint8Array(bar);
    } else if (ctor === DataView) {
      if ((len = foo.byteLength) === bar.byteLength) {
        while (len-- && foo.getInt8(len) === bar.getInt8(len))
          ;
      }
      return len === -1;
    }
    if (ArrayBuffer.isView(foo)) {
      if ((len = foo.byteLength) === bar.byteLength) {
        while (len-- && foo[len] === bar[len])
          ;
      }
      return len === -1;
    }
    if (!ctor || typeof foo === "object") {
      len = 0;
      for (ctor in foo) {
        if (has.call(foo, ctor) && ++len && !has.call(bar, ctor))
          return false;
        if (!(ctor in bar) || !dequal(foo[ctor], bar[ctor]))
          return false;
      }
      return Object.keys(bar).length === len;
    }
  }
  return foo !== foo && bar !== bar;
}

// node_modules/use-deep-compare-effect/dist/use-deep-compare-effect.esm.js
function checkDeps(deps) {
  if (!deps || !deps.length) {
    throw new Error("useDeepCompareEffect should not be used with no dependencies. Use React.useEffect instead.");
  }
  if (deps.every(isPrimitive)) {
    throw new Error("useDeepCompareEffect should not be used with dependencies that are all primitive values. Use React.useEffect instead.");
  }
}
function isPrimitive(val) {
  return val == null || /^[sbn]/.test(typeof val);
}
function useDeepCompareMemoize(value) {
  var ref = React85.useRef(value);
  var signalRef = React85.useRef(0);
  if (!dequal(value, ref.current)) {
    ref.current = value;
    signalRef.current += 1;
  }
  return React85.useMemo(function() {
    return ref.current;
  }, [signalRef.current]);
}
function useDeepCompareEffect(callback, dependencies) {
  if (true) {
    checkDeps(dependencies);
  }
  return React85.useEffect(callback, useDeepCompareMemoize(dependencies));
}

// src/components/pointcloud/PointCloud.tsx
var import_react146 = __toESM(require_react());

// src/contexts/TimeSliceContext.tsx
var import_react136 = __toESM(require_react());
var TimeSliceContext = (0, import_react136.createContext)(null);
var useTimeSlice = () => {
  const context2 = (0, import_react136.useContext)(TimeSliceContext);
  if (context2 === null) {
    throw new Error("useTimeSlice must be used within a TimeSliceProvider");
  }
  return context2;
};
var TimeSliceContextProvider = ({
  initialTimestamp,
  children
}) => {
  const [selectedTimestamp, _setSelectedTimestamp] = (0, import_react136.useState)(
    initialTimestamp
  );
  const setSelectedTimestamp = (newTimestamp) => {
    (0, import_react136.startTransition)(() => {
      _setSelectedTimestamp(newTimestamp);
    });
  };
  return /* @__PURE__ */ jsx5(
    TimeSliceContext.Provider,
    {
      value: {
        selectedTimestamp,
        setSelectedTimestamp
      },
      children
    }
  );
};

// src/components/pointcloud/CanvasDisplaySettingsDropdown.tsx
function CanvasDisplaySettingsDropdown() {
  const setPointSizeScale = usePointCloudContext(
    (state) => state.setPointSizeScale
  );
  const pointSizeScale = usePointCloudContext((state) => state.pointSizeScale);
  return /* @__PURE__ */ jsxs2(PopoverTrigger, { placement: "bottom left", children: [
    /* @__PURE__ */ jsx5(
      _Button,
      {
        variant: "default",
        size: "compact",
        icon: /* @__PURE__ */ jsx5(Icon, { svg: /* @__PURE__ */ jsx5(Icons.OptionsOutline, {}) }),
        "aria-label": "Display Settings"
      }
    ),
    /* @__PURE__ */ jsx5(_DropdownMenu, { children: /* @__PURE__ */ jsx5(_View, { padding: "size-100", children: /* @__PURE__ */ jsx5(_Flex, { direction: "column", gap: "size-100", children: /* @__PURE__ */ jsx5(
      _Slider,
      {
        label: "Point Scale",
        minValue: 0,
        maxValue: 3,
        step: 0.1,
        value: pointSizeScale,
        onChange: setPointSizeScale
      }
    ) }) }) })
  ] });
}

// src/components/pointcloud/CanvasModeRadioGroup.tsx
var radioItemCSS = css`
  display: flex;
  flex-direction: row;
  gap: var(--px-spacing-sm);
`;
function isCanvasMode(m) {
  return typeof m === "string" && m in CanvasMode;
}
function CanvasModeRadioGroup(props) {
  return /* @__PURE__ */ jsxs2(
    RadioGroup,
    {
      defaultValue: props.mode,
      variant: "inline-button",
      size: "compact",
      onChange: (v4) => {
        if (isCanvasMode(v4)) {
          props.onChange(v4);
        } else {
          throw new Error(`Unknown canvas mode: ${v4}`);
        }
      },
      children: [
        /* @__PURE__ */ jsx5(Radio, { label: "Move", value: "move" /* move */, children: /* @__PURE__ */ jsxs2(TooltipTrigger, { placement: "top", delay: 0, offset: 10, children: [
          /* @__PURE__ */ jsx5(_TriggerWrap, { children: /* @__PURE__ */ jsxs2("div", { css: radioItemCSS, children: [
            /* @__PURE__ */ jsx5(Icon, { svg: /* @__PURE__ */ jsx5(Icons.MoveFilled, {}) }),
            " Move"
          ] }) }),
          /* @__PURE__ */ jsx5(_Tooltip, { children: "Move around the canvas using orbital controls" })
        ] }) }),
        /* @__PURE__ */ jsx5(Radio, { label: "Select", value: "select" /* select */, children: /* @__PURE__ */ jsxs2(TooltipTrigger, { placement: "top", delay: 0, offset: 10, children: [
          /* @__PURE__ */ jsx5(_TriggerWrap, { children: /* @__PURE__ */ jsxs2("div", { css: radioItemCSS, children: [
            /* @__PURE__ */ jsx5(Icon, { svg: /* @__PURE__ */ jsx5(Icons.LassoOutline, {}) }),
            " Select"
          ] }) }),
          /* @__PURE__ */ jsx5(_Tooltip, { children: "Select points using the lasso tool" })
        ] }) })
      ]
    }
  );
}

// src/components/pointcloud/PointCloudClusters.tsx
var import_react138 = __toESM(require_react());
function PointCloudClusters({ radius }) {
  const eventIdToDataMap = usePointCloudContext(
    (state) => state.eventIdToDataMap
  );
  const highlightedClusterId = usePointCloudContext(
    (state) => state.highlightedClusterId
  );
  const selectedClusterId = usePointCloudContext(
    (state) => state.selectedClusterId
  );
  const clusters = usePointCloudContext((state) => state.clusters);
  const { theme: theme3 } = useTheme2();
  const clusterColorMode = usePointCloudContext(
    (state) => state.clusterColorMode
  );
  const clustersWithData = (0, import_react138.useMemo)(() => {
    return clusters.map((cluster) => {
      const { eventIds } = cluster;
      const positionData = eventIds.map((eventId) => {
        const position2 = eventIdToDataMap.get(eventId)?.position;
        return {
          position: position2
        };
      }).filter(
        (positionInfo) => positionInfo.position !== null
      );
      return {
        ...cluster,
        data: positionData
      };
    }).filter((cluster) => cluster.data.length > 0);
  }, [clusters, eventIdToDataMap]);
  return /* @__PURE__ */ jsx5(Fragment5, { children: clustersWithData.map((cluster, index) => {
    const opacity = clusterOpacity({
      selected: cluster.id === selectedClusterId,
      highlighted: cluster.id === highlightedClusterId,
      clusterColorMode
    });
    return /* @__PURE__ */ jsx5(
      Cluster,
      {
        data: cluster.data,
        opacity,
        wireframe: true,
        pointRadius: radius,
        color: clusterColor({
          theme: theme3,
          clusterColorMode,
          index,
          clusterCount: clustersWithData.length
        })
      },
      `${cluster.id}__opacity_${String(opacity)}`
    );
  }) });
}
function clusterColor({
  theme: theme3,
  clusterColorMode,
  index,
  clusterCount
}) {
  if (clusterColorMode === "default" /* default */) {
    return theme3 === "dark" ? "#999999" : "#bbbbbb";
  }
  return sinebow_default(index / clusterCount);
}
function clusterOpacity({
  selected,
  highlighted,
  clusterColorMode
}) {
  if (clusterColorMode === "highlight" /* highlight */) {
    return 1;
  } else if (selected) {
    return 0.7;
  } else if (highlighted) {
    return 0.5;
  }
  return 0;
}

// src/components/pointcloud/PointCloudPointHoverHalo.tsx
var POINT_RADIUS_MULTIPLIER = 1.5;
function PointCloudPointHoverHalo({
  pointRadius
}) {
  const hoveredEventId = usePointCloudContext((state) => state.hoveredEventId);
  const pointSizeScale = usePointCloudContext((state) => state.pointSizeScale);
  const eventIdToDataMap = usePointCloudContext(
    (state) => state.eventIdToDataMap
  );
  const pointGroupColors = usePointCloudContext(
    (state) => state.pointGroupColors
  );
  const eventIdToGroup = usePointCloudContext((state) => state.eventIdToGroup);
  if (hoveredEventId == null || eventIdToDataMap == null)
    return null;
  const event = eventIdToDataMap.get(hoveredEventId);
  const group = eventIdToGroup[hoveredEventId];
  const color2 = pointGroupColors[group];
  if (event == null)
    return null;
  return /* @__PURE__ */ jsx5(
    Sphere2,
    {
      position: event.position,
      args: [pointRadius * POINT_RADIUS_MULTIPLIER],
      scale: [pointSizeScale, pointSizeScale, pointSizeScale],
      children: /* @__PURE__ */ jsx5("meshMatcapMaterial", { color: color2, opacity: 0.5, transparent: true })
    }
  );
}

// src/components/pointcloud/PointCloudPointRelationships.tsx
var import_react139 = __toESM(require_react());
var lineWidth = 1;
function PointCloudPointRelationships() {
  const hoveredEventId = usePointCloudContext((state) => state.hoveredEventId);
  const eventIdToDataMap = usePointCloudContext(
    (state) => state.eventIdToDataMap
  );
  const group = (0, import_react139.useRef)(null);
  useFrame((_, delta) => {
    if (group.current) {
      group.current.children.forEach(
        (group2) => (
          // eslint-disable-next-line @typescript-eslint/ban-ts-comment
          // @ts-ignore
          group2.children[0].material.uniforms.dashOffset.value -= delta * 5
        )
      );
    }
  });
  const lines = (0, import_react139.useMemo)(() => {
    if (hoveredEventId == null)
      return [];
    const hoveredPoint = eventIdToDataMap.get(hoveredEventId);
    if (hoveredPoint == null)
      return [];
    const hoveredPointRetrievals = hoveredPoint.retrievals ?? [];
    if (hoveredPointRetrievals?.length === 0)
      return [];
    const lines2 = hoveredPointRetrievals.map((retrieval) => {
      const retrievalPoint = eventIdToDataMap.get(retrieval.documentId);
      if (retrievalPoint == null)
        return null;
      return [hoveredPoint.position, retrievalPoint.position];
    }).filter((line2) => line2 != null);
    return lines2;
  }, [eventIdToDataMap, hoveredEventId]);
  return /* @__PURE__ */ jsx5("group", { ref: group, children: lines.map((line2, i2) => {
    return /* @__PURE__ */ jsxs2("group", { children: [
      /* @__PURE__ */ jsx5(
        QuadraticBezierLine,
        {
          start: line2[0],
          end: line2[1],
          color: 16777215,
          opacity: 1,
          transparent: true,
          dashed: true,
          dashScale: 50,
          gapSize: 20,
          linewidth: lineWidth
        }
      ),
      /* @__PURE__ */ jsx5(
        QuadraticBezierLine,
        {
          start: line2[0],
          end: line2[1],
          color: 16777215,
          linewidth: lineWidth / 2,
          transparent: true,
          opacity: 0.8
        }
      )
    ] }, i2);
  }) });
}

// src/components/pointcloud/PointCloudPoints.tsx
var import_react140 = __toESM(require_react());
var import_react141 = __toESM(require_react());
var import_debounce3 = __toESM(require_debounce2());
var SHADE_AMOUNT = 0.5;
var LIGHTEN_AMOUNT = 0.5;
var DEBOUNCE_WAIT = 100;
var CUBE_RADIUS_MULTIPLIER = 1.7;
function invokeColor(point4, color2) {
  if (typeof color2 === "function") {
    return color2(point4);
  }
  return color2;
}
function PointCloudPoints({
  primaryData,
  referenceData,
  corpusData,
  color: color2,
  radius
}) {
  const datasetVisibility = usePointCloudContext(
    (state) => state.datasetVisibility
  );
  const coloringStrategy = usePointCloudContext(
    (state) => state.coloringStrategy
  );
  const { theme: theme3 } = useTheme2();
  const setSelectedEventIds = usePointCloudContext(
    (state) => state.setSelectedEventIds
  );
  const selectedEventIds = usePointCloudContext(
    (state) => state.selectedEventIds
  );
  const setSelectedClusterId = usePointCloudContext(
    (state) => state.setSelectedClusterId
  );
  const setHoveredEventId = usePointCloudContext(
    (state) => state.setHoveredEventId
  );
  const pointSizeScale = usePointCloudContext((state) => state.pointSizeScale);
  const debouncedSetHoveredEventId = (0, import_react141.useMemo)(() => {
    return (0, import_debounce3.default)(setHoveredEventId, DEBOUNCE_WAIT);
  }, [setHoveredEventId]);
  const referenceDatasetPointShape = (0, import_react141.useMemo)(
    () => coloringStrategy !== "dataset" /* dataset */ ? "cube" : "sphere",
    [coloringStrategy]
  );
  const corpusDatasetPointShape = (0, import_react141.useMemo)(
    () => coloringStrategy !== "dataset" /* dataset */ ? "octahedron" : "sphere",
    [coloringStrategy]
  );
  const colorDimFn = (0, import_react141.useMemo)(() => {
    return theme3 === "dark" ? curriedShade$1(SHADE_AMOUNT) : curriedLighten$1(LIGHTEN_AMOUNT);
  }, [theme3]);
  const dimmedColor = (0, import_react141.useMemo)(() => {
    if (typeof color2 === "function") {
      return (p) => colorDimFn(color2(p));
    }
    return colorDimFn(color2);
  }, [color2, colorDimFn]);
  const colorByFn = (0, import_react141.useCallback)(
    (point4) => {
      if (!selectedEventIds.has(point4.metaData.id) && selectedEventIds.size > 0) {
        return invokeColor(point4, dimmedColor);
      }
      return invokeColor(point4, color2);
    },
    [selectedEventIds, color2, dimmedColor]
  );
  const showReferencePoints = datasetVisibility.reference && referenceData;
  const showCorpusPoints = datasetVisibility.corpus && corpusData;
  const onPointClicked = (0, import_react141.useCallback)(
    (point4) => {
      (0, import_react140.startTransition)(() => {
        setSelectedEventIds(/* @__PURE__ */ new Set([point4.metaData.id]));
        setSelectedClusterId(null);
      });
    },
    [setSelectedClusterId, setSelectedEventIds]
  );
  const onPointHovered = (0, import_react141.useCallback)(
    (point4) => {
      if (point4 == null || point4.metaData == null) {
        return;
      }
      debouncedSetHoveredEventId(point4.metaData.id);
    },
    [debouncedSetHoveredEventId]
  );
  const onPointerLeave = (0, import_react141.useCallback)(() => {
    debouncedSetHoveredEventId(null);
  }, [debouncedSetHoveredEventId]);
  return /* @__PURE__ */ jsxs2(Fragment5, { children: [
    datasetVisibility.primary ? /* @__PURE__ */ jsx5(
      Points2,
      {
        data: primaryData,
        pointProps: { color: colorByFn, radius, scale: pointSizeScale },
        onPointClicked,
        onPointHovered,
        onPointerLeave
      }
    ) : null,
    showReferencePoints ? /* @__PURE__ */ jsx5(
      Points2,
      {
        data: referenceData,
        pointProps: {
          color: colorByFn,
          radius,
          size: radius ? radius * CUBE_RADIUS_MULTIPLIER : void 0,
          scale: pointSizeScale
        },
        onPointHovered,
        onPointerLeave,
        pointShape: referenceDatasetPointShape,
        onPointClicked
      }
    ) : null,
    showCorpusPoints ? /* @__PURE__ */ jsx5(
      Points2,
      {
        data: corpusData,
        pointProps: {
          color: colorByFn,
          radius,
          size: radius ? radius * CUBE_RADIUS_MULTIPLIER : void 0,
          scale: pointSizeScale
        },
        onPointHovered,
        onPointerLeave,
        pointShape: corpusDatasetPointShape,
        onPointClicked
      }
    ) : null
  ] });
}

// src/utils/urlUtils.ts
var videoUrlRegex = /\.(mp4|mov|webm|ogg)(\?|$)/i;
var audioUrlRegex = /\.(mp3|wav)(\?|$)/i;
function isVideoUrl(url) {
  return videoUrlRegex.test(url);
}
function isAudioUrl(url) {
  return audioUrlRegex.test(url);
}

// src/components/pointcloud/ShapeIcon.tsx
var import_react142 = __toESM(require_react());
var SquareSVG = () => /* @__PURE__ */ jsx5(
  "svg",
  {
    width: "12px",
    height: "12px",
    viewBox: "0 0 12 12",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg",
    children: /* @__PURE__ */ jsx5("rect", { width: "12", height: "12", rx: "1", fill: "currentColor" })
  }
);
var CircleSVG = () => {
  return /* @__PURE__ */ jsx5(
    "svg",
    {
      width: "12px",
      height: "12px",
      viewBox: "0 0 12 12",
      fill: "none",
      xmlns: "http://www.w3.org/2000/svg",
      children: /* @__PURE__ */ jsx5("circle", { cx: "6", cy: "6", r: "6", fill: "currentColor" })
    }
  );
};
var DiamondSVG = () => {
  return /* @__PURE__ */ jsx5(
    "svg",
    {
      width: "12px",
      height: "12px",
      viewBox: "0 0 12 12",
      fill: "none",
      xmlns: "http://www.w3.org/2000/svg",
      children: /* @__PURE__ */ jsx5("path", { d: "M6 0L12 6L6 12L0 6L6 0Z", fill: "currentColor" })
    }
  );
};
function ShapeIcon(props) {
  const { shape, color: color2 } = props;
  const shapeSVG = (0, import_react142.useMemo)(() => {
    switch (shape) {
      case "square" /* square */:
        return /* @__PURE__ */ jsx5(SquareSVG, {});
      case "circle" /* circle */:
        return /* @__PURE__ */ jsx5(CircleSVG, {});
      case "diamond" /* diamond */:
        return /* @__PURE__ */ jsx5(DiamondSVG, {});
      default:
        assertUnreachable2(shape);
    }
  }, [shape]);
  return /* @__PURE__ */ jsx5(
    "i",
    {
      className: "shape-icon",
      style: { color: color2 },
      css: css`
        display: flex;
        flex-direction: row;
        align-items: center;
      `,
      "aria-hidden": true,
      children: shapeSVG
    }
  );
}

// src/components/pointcloud/EventItem.tsx
function getPrimaryPreviewType(props) {
  const { rawData, linkToData, promptAndResponse, documentText } = props;
  if (documentText != null) {
    return "document";
  }
  if (promptAndResponse != null) {
    return "prompt_response";
  }
  if (linkToData != null) {
    if (isVideoUrl(linkToData)) {
      return "video";
    }
    if (isAudioUrl(linkToData)) {
      return "audio";
    }
    return "image";
  } else if (rawData != null) {
    return "raw";
  } else {
    return "event_metadata";
  }
}
function getSecondaryPreviewType(primaryPreviewType, props) {
  const { rawData } = props;
  switch (primaryPreviewType) {
    case "document":
      return null;
    case "prompt_response":
      return null;
    case "image":
      return rawData != null ? "raw" : null;
    case "video":
      return rawData != null ? "raw" : null;
    case "audio":
      return rawData != null ? "raw" : null;
    case "raw":
      return "event_metadata";
    case "event_metadata":
      return null;
    default:
      assertUnreachable2(primaryPreviewType);
  }
}
function EventItem(props) {
  const { onClick, color: color2, size, datasetName, group } = props;
  const primaryPreviewType = getPrimaryPreviewType(props);
  const secondaryPreviewType = size === "large" ? getSecondaryPreviewType(primaryPreviewType, props) : null;
  return /* @__PURE__ */ jsxs2(
    "div",
    {
      "data-testid": "event-item",
      role: "button",
      "data-size": size,
      css: css`
        width: 100%;
        height: 100%;
        box-sizing: border-box;
        border-style: solid;
        border-radius: 4px;
        overflow: hidden;

        display: flex;
        flex-direction: column;
        cursor: pointer;
        overflow: hidden;

        border-width: 1px;
        border-color: ${color2};
        border-radius: var(--ac-global-rounding-medium);
        transition: border-color 0.2s ease-in-out;
        transition: transform 0.2s ease-in-out;
        &:hover {
          transform: scale(1.04);
        }
        &[data-size="small"] {
          border-width: 2px;
        }
      `,
      onClick,
      children: [
        /* @__PURE__ */ jsxs2(
          "div",
          {
            className: "event-item__preview-wrap",
            "data-size": size,
            css: css`
          display: flex;
          flex-direction: row;
          flex: 1 1 auto;
          overflow: hidden;
          & > *:nth-child(1) {
            flex: 1 1 auto;
            overflow: hidden;
          }
          & > *:nth-child(2) {
            flex: none;
            width: 43%;
          }
          &[data-size="large"] {
            & > *:nth-child(1) {
              margin: var(--px-spacing-med);
              border-radius: 8px;
            }
          }
        `,
            children: [
              /* @__PURE__ */ jsx5(EventPreview, { previewType: primaryPreviewType, ...props }),
              secondaryPreviewType != null && /* @__PURE__ */ jsx5(EventPreview, { previewType: secondaryPreviewType, ...props })
            ]
          }
        ),
        size !== "small" && /* @__PURE__ */ jsx5(
          EventItemFooter,
          {
            color: color2,
            group,
            datasetName,
            showDataset: size === "large"
          }
        )
      ]
    }
  );
}
function EventPreview(props) {
  const { previewType } = props;
  let preview = null;
  switch (previewType) {
    case "document": {
      preview = /* @__PURE__ */ jsx5(DocumentPreview, { ...props });
      break;
    }
    case "prompt_response": {
      preview = /* @__PURE__ */ jsx5(PromptResponsePreview, { ...props });
      break;
    }
    case "image": {
      preview = /* @__PURE__ */ jsx5(ImagePreview, { ...props });
      break;
    }
    case "video": {
      preview = /* @__PURE__ */ jsx5(VideoPreview, { ...props });
      break;
    }
    case "audio": {
      preview = /* @__PURE__ */ jsx5(AudioPreview, { ...props });
      break;
    }
    case "raw": {
      preview = /* @__PURE__ */ jsx5(RawTextPreview, { ...props });
      break;
    }
    case "event_metadata": {
      preview = /* @__PURE__ */ jsx5(EventMetadataPreview, { ...props });
      break;
    }
    default:
      assertUnreachable2(previewType);
  }
  return preview;
}
function ImagePreview(props) {
  return /* @__PURE__ */ jsx5(
    "img",
    {
      src: props.linkToData || "[error] unexpected missing url",
      css: css`
        min-height: 0;
        // Maintain aspect ratio while having normalized height
        object-fit: contain;
        transition: background-color 0.2s ease-in-out;
        background-color: ${curriedTransparentize$1(0.85, props.color)};
      `
    }
  );
}
function VideoPreview(props) {
  return /* @__PURE__ */ jsx5(
    "video",
    {
      src: props.linkToData || "[error] unexpected missing url",
      css: css`
        min-height: 0;
        // Maintain aspect ratio while having normalized height
        object-fit: contain;
        transition: background-color 0.2s ease-in-out;
        background-color: ${curriedTransparentize$1(0.85, props.color)};
      `
    }
  );
}
function AudioPreview(props) {
  return /* @__PURE__ */ jsx5(
    "audio",
    {
      src: props.linkToData || "[error] unexpected missing url",
      autoPlay: props.autoPlay,
      controls: true
    }
  );
}
function PromptResponsePreview(props) {
  return /* @__PURE__ */ jsxs2(
    "div",
    {
      "data-size": props.size,
      css: css`
        --prompt-response-preview-background-color: var(
          --ac-global-color-grey-200
        );
        background-color: var(--prompt-response-preview-background-color);
        &[data-size="small"] {
          display: flex;
          flex-direction: column;
          padding: var(--px-spacing-sm);
          font-size: var(--px-font-size-sm);
          section {
            flex: 1 1 0;
            overflow: hidden;
            header {
              display: none;
            }
          }
        }
        &[data-size="medium"] {
          display: flex;
          flex-direction: column;
          gap: var(--px-spacing-sm);
          padding: var(--px-spacing-med);
          section {
            flex: 1 1 0;
            overflow: hidden;
          }
        }
        &[data-size="large"] {
          display: flex;
          flex-direction: row;
          section {
            padding: var(--px-spacing-sm);
            flex: 1 1 0;
          }
        }
        & > section {
          position: relative;

          header {
            font-weight: bold;
            margin-bottom: var(--px-spacing-sm);
          }
          &:before {
            content: "";
            width: 100%;
            height: 100%;
            position: absolute;
            left: 0;
            top: 0;
            background: linear-gradient(
              transparent 80%,
              var(--prompt-response-preview-background-color) 100%
            );
          }
        }
      `,
      children: [
        /* @__PURE__ */ jsxs2("section", { children: [
          /* @__PURE__ */ jsx5("header", { children: "prompt" }),
          props.promptAndResponse?.prompt
        ] }),
        /* @__PURE__ */ jsxs2("section", { children: [
          /* @__PURE__ */ jsx5("header", { children: "response" }),
          props.promptAndResponse?.response
        ] })
      ]
    }
  );
}
function DocumentPreview(props) {
  return /* @__PURE__ */ jsx5(
    "p",
    {
      "data-size": props.size,
      css: css`
        flex: 1 1 auto;
        padding: var(--px-spacing-med);
        margin-block-start: 0;
        margin-block-end: 0;
        position: relative;
        --text-preview-background-color: var(--ac-global-color-grey-100);
        background-color: var(--text-preview-background-color);

        &[data-size="small"] {
          padding: var(--px-spacing-sm);
          box-sizing: border-box;
        }
        &:before {
          content: "";
          width: 100%;
          height: 100%;
          position: absolute;
          left: 0;
          top: 0;
          background: linear-gradient(
            transparent 90%,
            var(--text-preview-background-color) 98%,
            var(--text-preview-background-color) 100%
          );
        }
      `,
      children: props.documentText
    }
  );
}
function RawTextPreview(props) {
  return /* @__PURE__ */ jsx5(
    "p",
    {
      "data-size": props.size,
      css: css`
        flex: 1 1 auto;
        padding: var(--px-spacing-med);
        margin-block-start: 0;
        margin-block-end: 0;
        position: relative;
        --text-preview-background-color: var(--ac-background-color-light);
        background-color: var(--text-preview-background-color);

        &[data-size="small"] {
          padding: var(--px-spacing-sm);
          font-size: var(--ac-global-color-gray-600);
          box-sizing: border-box;
        }
        &:before {
          content: "";
          width: 100%;
          height: 100%;
          position: absolute;
          left: 0;
          top: 0;
          background: linear-gradient(
            transparent 90%,
            var(--text-preview-background-color) 98%,
            var(--text-preview-background-color) 100%
          );
        }
      `,
      children: props.rawData
    }
  );
}
function EventMetadataPreview(props) {
  return /* @__PURE__ */ jsxs2(
    "dl",
    {
      css: css`
        margin: 0;
        padding: var(--px-spacing-lg);
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: var(--px-spacing-med);

        dt {
          font-weight: bold;
        }
        dd {
          margin-inline-start: var(--px-spacing-med);
        }
      `,
      children: [
        /* @__PURE__ */ jsxs2("div", { children: [
          /* @__PURE__ */ jsx5("dt", { children: "prediction label" }),
          /* @__PURE__ */ jsx5("dd", { children: props.predictionLabel || "--" })
        ] }),
        /* @__PURE__ */ jsxs2("div", { children: [
          /* @__PURE__ */ jsx5("dt", { children: "actual label" }),
          /* @__PURE__ */ jsx5("dd", { children: props.actualLabel || "--" })
        ] })
      ]
    }
  );
}
function EventItemFooter({
  color: color2,
  group,
  showDataset,
  datasetName
}) {
  return /* @__PURE__ */ jsxs2(
    "footer",
    {
      css: css`
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        padding: var(--px-spacing-sm) var(--px-spacing-med) var(--px-spacing-sm)
          7px;
        border-top: 1px solid var(--ac-global-border-color-dark);
      `,
      children: [
        /* @__PURE__ */ jsxs2(
          "div",
          {
            css: css`
          display: flex;
          flex-direction: row;
          align-items: center;
          gap: var(--px-spacing-sm);
        `,
            children: [
              /* @__PURE__ */ jsx5(ShapeIcon, { shape: "circle" /* circle */, color: color2 }),
              group
            ]
          }
        ),
        showDataset ? /* @__PURE__ */ jsx5("div", { title: "the dataset the point belongs to", children: datasetName }) : null
      ]
    }
  );
}

// src/components/pointcloud/PointCloudPointTooltip.tsx
var TOOLTIP_SIZE = 200;
var TOOLTIP_OFFSET = 10;
var vec = new Vector3();
var PointCloudPointTooltip = () => {
  const { getDatasetNameByRole } = useDatasets();
  const hoveredEventId = usePointCloudContext((state) => state.hoveredEventId);
  const eventIdToDataMap = usePointCloudContext(
    (state) => state.eventIdToDataMap
  );
  const pointData = usePointCloudContext((state) => state.pointData);
  const pointGroupColors = usePointCloudContext(
    (state) => state.pointGroupColors
  );
  const eventIdToGroup = usePointCloudContext((state) => state.eventIdToGroup);
  if (hoveredEventId == null || pointData == null || pointData == null)
    return null;
  const baseEvent = eventIdToDataMap.get(hoveredEventId);
  const eventDetails = pointData[hoveredEventId];
  if (baseEvent == null || eventDetails == null)
    return null;
  const group = eventIdToGroup[hoveredEventId];
  const color2 = pointGroupColors[eventIdToGroup[hoveredEventId]];
  const datasetRole = getDatasetRoleFromEventId(hoveredEventId);
  const datasetName = getDatasetNameByRole(datasetRole);
  return /* @__PURE__ */ jsx5(
    Html,
    {
      position: baseEvent.position,
      pointerEvents: "none",
      zIndexRange: [0, 1],
      calculatePosition: (el, camera, size) => {
        const objectPos = vec.setFromMatrixPosition(el.matrixWorld);
        objectPos.project(camera);
        const widthHalf = size.width / 2;
        const heightHalf = size.height / 2;
        return [
          Math.min(
            size.width - TOOLTIP_SIZE - TOOLTIP_OFFSET,
            Math.max(0, objectPos.x * widthHalf + widthHalf + TOOLTIP_OFFSET)
          ),
          Math.min(
            size.height - TOOLTIP_SIZE - TOOLTIP_OFFSET,
            Math.max(
              0,
              -(objectPos.y * heightHalf) + heightHalf + TOOLTIP_OFFSET
            )
          )
        ];
      },
      children: /* @__PURE__ */ jsx5(
        "div",
        {
          css: css`
          --grid-item-min-width: ${TOOLTIP_SIZE}px;
          width: ${TOOLTIP_SIZE}px;
          height: ${TOOLTIP_SIZE}px;
          background-color: var(--ac-global-background-color-dark);
          border-radius: var(--ac-global-rounding-medium);
        `,
          children: /* @__PURE__ */ jsx5(
            EventItem,
            {
              rawData: baseEvent.embeddingMetadata.rawData,
              linkToData: baseEvent.embeddingMetadata.linkToData,
              predictionLabel: baseEvent.eventMetadata.predictionLabel,
              actualLabel: baseEvent.eventMetadata.actualLabel,
              promptAndResponse: eventDetails.promptAndResponse,
              documentText: eventDetails.documentText,
              datasetName,
              group,
              color: color2,
              size: "medium",
              autoPlay: true
            }
          )
        }
      )
    }
  );
};

// src/components/pointcloud/PointCloud.tsx
var RADIUS_BOUNDS_3D_DIVISOR = 300;
var CLUSTER_POINT_RADIUS_MULTIPLIER = 3;
var BOUNDS_3D_ZOOM_PADDING_FACTOR = 0.2;
var PointCloudInfo = function PointCloudInfo2() {
  const { selectedTimestamp } = useTimeSlice();
  const points = usePointCloudContext((state) => state.points);
  const hdbscanParameters = usePointCloudContext(
    (state) => state.hdbscanParameters
  );
  const umapParameters = usePointCloudContext((state) => state.umapParameters);
  const [numPrimary, numReference, numCorpus] = (0, import_react146.useMemo)(() => {
    const { primaryEventIds, referenceEventIds, corpusEventIds } = splitEventIdsByDataset(points.map((point4) => point4.eventId));
    return [
      primaryEventIds.length,
      referenceEventIds.length,
      corpusEventIds.length
    ];
  }, [points]);
  if (!selectedTimestamp) {
    return null;
  }
  return /* @__PURE__ */ jsxs2(
    "section",
    {
      css: css`
        width: 300px;
        padding: var(--px-spacing-med);
      `,
      children: [
        /* @__PURE__ */ jsxs2("dl", { css: descriptionListCSS, children: [
          /* @__PURE__ */ jsxs2("div", { children: [
            /* @__PURE__ */ jsx5("dt", { children: "Timestamp" }),
            /* @__PURE__ */ jsx5("dd", { children: fullTimeFormatter(selectedTimestamp) })
          ] }),
          /* @__PURE__ */ jsxs2("div", { children: [
            /* @__PURE__ */ jsx5("dt", { children: "primary points" }),
            /* @__PURE__ */ jsx5("dd", { children: numPrimary })
          ] }),
          numReference > 0 ? /* @__PURE__ */ jsxs2("div", { children: [
            /* @__PURE__ */ jsx5("dt", { children: "reference points" }),
            /* @__PURE__ */ jsx5("dd", { children: numReference })
          ] }) : null,
          numCorpus > 0 ? /* @__PURE__ */ jsxs2("div", { children: [
            /* @__PURE__ */ jsx5("dt", { children: "corpus points" }),
            /* @__PURE__ */ jsx5("dd", { children: numCorpus })
          ] }) : null
        ] }),
        /* @__PURE__ */ jsx5("br", {}),
        /* @__PURE__ */ jsx5(_Heading, { level: 4, weight: "heavy", children: "Clustering Parameters" }),
        /* @__PURE__ */ jsxs2("dl", { css: descriptionListCSS, children: [
          /* @__PURE__ */ jsxs2("div", { children: [
            /* @__PURE__ */ jsx5("dt", { children: "min cluster size" }),
            /* @__PURE__ */ jsx5("dd", { children: hdbscanParameters.minClusterSize })
          ] }),
          /* @__PURE__ */ jsxs2("div", { children: [
            /* @__PURE__ */ jsx5("dt", { children: "cluster min samples" }),
            /* @__PURE__ */ jsx5("dd", { children: hdbscanParameters.clusterMinSamples })
          ] }),
          /* @__PURE__ */ jsxs2("div", { children: [
            /* @__PURE__ */ jsx5("dt", { children: "cluster selection epsilon" }),
            /* @__PURE__ */ jsx5("dd", { children: hdbscanParameters.clusterSelectionEpsilon })
          ] })
        ] }),
        /* @__PURE__ */ jsx5("br", {}),
        /* @__PURE__ */ jsx5(_Heading, { level: 4, weight: "heavy", children: "UMAP Parameters" }),
        /* @__PURE__ */ jsxs2("dl", { css: descriptionListCSS, children: [
          /* @__PURE__ */ jsxs2("div", { children: [
            /* @__PURE__ */ jsx5("dt", { children: "min distance" }),
            /* @__PURE__ */ jsx5("dd", { children: umapParameters.minDist })
          ] }),
          /* @__PURE__ */ jsxs2("div", { children: [
            /* @__PURE__ */ jsx5("dt", { children: "n neighbors" }),
            /* @__PURE__ */ jsx5("dd", { children: umapParameters.nNeighbors })
          ] }),
          /* @__PURE__ */ jsxs2("div", { children: [
            /* @__PURE__ */ jsx5("dt", { children: "n samples per dataset" }),
            /* @__PURE__ */ jsx5("dd", { children: umapParameters.nSamples })
          ] })
        ] })
      ]
    }
  );
};
var descriptionListCSS = css`
  margin: 0;
  padding: 0;
  div {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: var(--px-spacing-sm);
  }
`;
function CanvasTools() {
  const canvasMode = usePointCloudContext((state) => state.canvasMode);
  const setCanvasMode = usePointCloudContext((state) => state.setCanvasMode);
  return /* @__PURE__ */ jsxs2(
    "div",
    {
      css: css`
        position: absolute;
        left: var(--px-spacing-med);
        top: var(--px-spacing-med);
        z-index: 1;
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: var(--px-spacing-med);
      `,
      children: [
        /* @__PURE__ */ jsx5(CanvasModeRadioGroup, { mode: canvasMode, onChange: setCanvasMode }),
        /* @__PURE__ */ jsx5(CanvasDisplaySettingsDropdown, {}),
        /* @__PURE__ */ jsx5(CanvasInfo, {})
      ]
    }
  );
}
function CanvasInfo() {
  return /* @__PURE__ */ jsxs2(TooltipTrigger, { placement: "bottom left", delay: 0, children: [
    /* @__PURE__ */ jsx5(
      _Button,
      {
        variant: "default",
        size: "compact",
        icon: /* @__PURE__ */ jsx5(Icon, { svg: /* @__PURE__ */ jsx5(InfoOutline, {}) }),
        "aria-label": "Information bout the point-cloud display"
      }
    ),
    /* @__PURE__ */ jsx5(_ActionTooltip, { title: "Point Cloud Summary", children: /* @__PURE__ */ jsx5(PointCloudInfo, {}) })
  ] });
}
function CanvasWrap({ children }) {
  const { theme: theme3 } = useTheme2();
  return /* @__PURE__ */ jsx5(
    "div",
    {
      css: css`
        flex: 1 1 auto;
        height: 100%;
        position: relative;
        &[data-theme="dark"] {
          background: linear-gradient(
            rgb(21, 25, 31) 11.4%,
            rgb(11, 12, 14) 70.2%
          );
        }
        &[data-theme="light"] {
          background: linear-gradient(#f2f6fd 0%, #dbe6fc 74%);
        }
      `,
      "data-theme": theme3,
      children
    }
  );
}
function PointCloud2() {
  return /* @__PURE__ */ jsxs2(CanvasWrap, { children: [
    /* @__PURE__ */ jsx5(CanvasTools, {}, "canvas-tools"),
    /* @__PURE__ */ jsx5(Projection, {}, "projection")
  ] });
}
var Projection = import_react146.default.memo(function Projection2() {
  const points = usePointCloudContext((state) => state.points);
  const canvasMode = usePointCloudContext((state) => state.canvasMode);
  const setSelectedEventIds = usePointCloudContext(
    (state) => state.setSelectedEventIds
  );
  const setSelectedClusterId = usePointCloudContext(
    (state) => state.setSelectedClusterId
  );
  const pointGroupColors = usePointCloudContext(
    (state) => state.pointGroupColors
  );
  const pointGroupVisibility = usePointCloudContext(
    (state) => state.pointGroupVisibility
  );
  const { theme: theme3 } = useTheme2();
  const datasetVisibility = usePointCloudContext(
    (state) => state.datasetVisibility
  );
  const [autoRotate, setAutoRotate] = (0, import_react146.useState)(true);
  const bounds = (0, import_react146.useMemo)(() => {
    return getThreeDimensionalBounds(points.map((p) => p.position));
  }, [points]);
  const radius = (bounds.maxX - bounds.minX + (bounds.maxY - bounds.minY)) / 2 / RADIUS_BOUNDS_3D_DIVISOR;
  const clusterPointRadius = radius * CLUSTER_POINT_RADIUS_MULTIPLIER;
  const isMoveMode = canvasMode === "move" /* move */;
  const eventIdToGroup = usePointCloudContext((state) => state.eventIdToGroup);
  const colorFn = (0, import_react146.useCallback)(
    (point4) => {
      const group = eventIdToGroup[point4.metaData.id] || "unknown";
      return pointGroupColors[group] || UNKNOWN_COLOR;
    },
    [pointGroupColors, eventIdToGroup]
  );
  const primaryData = (0, import_react146.useMemo)(() => {
    return points.filter((point4) => {
      return point4.eventId.includes("PRIMARY");
    });
  }, [points]);
  const referenceData = (0, import_react146.useMemo)(() => {
    return points.filter((point4) => {
      return point4.eventId.includes("REFERENCE");
    });
  }, [points]);
  const corpusData = (0, import_react146.useMemo)(() => {
    return points.filter((point4) => {
      return point4.eventId.includes("CORPUS");
    });
  }, [points]);
  const filteredPrimaryData = (0, import_react146.useMemo)(() => {
    return primaryData.filter((point4) => {
      const group = eventIdToGroup[point4.eventId];
      return pointGroupVisibility[group];
    });
  }, [primaryData, eventIdToGroup, pointGroupVisibility]);
  const filteredReferenceData = (0, import_react146.useMemo)(() => {
    if (!referenceData || referenceData.length === 0) {
      return null;
    }
    return referenceData.filter((point4) => {
      const group = eventIdToGroup[point4.eventId];
      return pointGroupVisibility[group];
    });
  }, [referenceData, eventIdToGroup, pointGroupVisibility]);
  const filteredCorpusData = (0, import_react146.useMemo)(() => {
    return corpusData.filter((point4) => {
      const group = eventIdToGroup[point4.eventId];
      return pointGroupVisibility[group];
    });
  }, [corpusData, eventIdToGroup, pointGroupVisibility]);
  const allVisiblePoints = (0, import_react146.useMemo)(() => {
    const visiblePrimaryPoints = datasetVisibility.primary ? filteredPrimaryData : [];
    const visibleReferencePoints = datasetVisibility.reference ? filteredReferenceData : [];
    const visibleCorpusPoints = datasetVisibility.corpus ? filteredCorpusData : [];
    const visiblePoints = [
      ...visiblePrimaryPoints,
      ...visibleReferencePoints || [],
      ...visibleCorpusPoints || []
    ];
    return visiblePoints;
  }, [
    filteredPrimaryData,
    filteredReferenceData,
    filteredCorpusData,
    datasetVisibility
  ]);
  const ContextBridge = useContextBridge(
    PointCloudContext,
    DatasetsContext,
    ThemeContext,
    ThemeContext2
  );
  return /* @__PURE__ */ jsx5(ThreeDimensionalCanvas, { camera: { position: [3, 3, 3] }, children: /* @__PURE__ */ jsxs2(ContextBridge, { children: [
    /* @__PURE__ */ jsx5(
      ThreeDimensionalControls,
      {
        autoRotate,
        autoRotateSpeed: 2,
        enableRotate: isMoveMode,
        enablePan: isMoveMode,
        onEnd: () => {
          setAutoRotate(false);
        }
      }
    ),
    /* @__PURE__ */ jsxs2(
      ThreeDimensionalBounds,
      {
        bounds,
        boundsZoomPaddingFactor: BOUNDS_3D_ZOOM_PADDING_FACTOR,
        children: [
          /* @__PURE__ */ jsx5(
            LassoSelect,
            {
              points: allVisiblePoints,
              onChange: (selection2) => {
                setSelectedEventIds(new Set(selection2.map((s2) => s2.metaData.id)));
                setSelectedClusterId(null);
              },
              enabled: canvasMode === "select" /* select */
            }
          ),
          /* @__PURE__ */ jsx5(
            Axes,
            {
              size: (bounds.maxX - bounds.minX) / 4,
              color: theme3 == "dark" ? "#fff" : "#505050"
            }
          ),
          /* @__PURE__ */ jsx5(
            PointCloudPoints,
            {
              primaryData: filteredPrimaryData,
              referenceData: filteredReferenceData,
              corpusData: filteredCorpusData,
              color: colorFn,
              radius
            }
          ),
          /* @__PURE__ */ jsx5(PointCloudClusters, { radius: clusterPointRadius }),
          /* @__PURE__ */ jsx5(PointCloudPointTooltip, {}),
          /* @__PURE__ */ jsx5(PointCloudPointHoverHalo, { pointRadius: radius }),
          /* @__PURE__ */ jsx5(PointCloudPointRelationships, {})
        ]
      }
    )
  ] }) });
});

// src/components/form/__generated__/DimensionPickerQuery.graphql.ts
var node31 = function() {
  var v0 = [
    {
      "alias": null,
      "args": null,
      "concreteType": "Model",
      "kind": "LinkedField",
      "name": "model",
      "plural": false,
      "selections": [
        {
          "alias": null,
          "args": null,
          "concreteType": "DimensionConnection",
          "kind": "LinkedField",
          "name": "dimensions",
          "plural": false,
          "selections": [
            {
              "alias": null,
              "args": null,
              "concreteType": "DimensionEdge",
              "kind": "LinkedField",
              "name": "edges",
              "plural": true,
              "selections": [
                {
                  "alias": null,
                  "args": null,
                  "concreteType": "Dimension",
                  "kind": "LinkedField",
                  "name": "node",
                  "plural": false,
                  "selections": [
                    {
                      "alias": null,
                      "args": null,
                      "kind": "ScalarField",
                      "name": "id",
                      "storageKey": null
                    },
                    {
                      "alias": null,
                      "args": null,
                      "kind": "ScalarField",
                      "name": "name",
                      "storageKey": null
                    },
                    {
                      "alias": null,
                      "args": null,
                      "kind": "ScalarField",
                      "name": "type",
                      "storageKey": null
                    },
                    {
                      "alias": null,
                      "args": null,
                      "kind": "ScalarField",
                      "name": "dataType",
                      "storageKey": null
                    }
                  ],
                  "storageKey": null
                }
              ],
              "storageKey": null
            }
          ],
          "storageKey": null
        }
      ],
      "storageKey": null
    }
  ];
  return {
    "fragment": {
      "argumentDefinitions": [],
      "kind": "Fragment",
      "metadata": null,
      "name": "DimensionPickerQuery",
      "selections": v0,
      "type": "Query",
      "abstractKey": null
    },
    "kind": "Request",
    "operation": {
      "argumentDefinitions": [],
      "kind": "Operation",
      "name": "DimensionPickerQuery",
      "selections": v0
    },
    "params": {
      "cacheID": "56e356d226d322dabfd9db8010884e4f",
      "id": null,
      "metadata": {},
      "name": "DimensionPickerQuery",
      "operationKind": "query",
      "text": "query DimensionPickerQuery {\n  model {\n    dimensions {\n      edges {\n        node {\n          id\n          name\n          type\n          dataType\n        }\n      }\n    }\n  }\n}\n"
    }
  };
}();
node31.hash = "747256fac1de97803ae6f96e3cb58d98";
var DimensionPickerQuery_graphql_default = node31;

// src/components/form/DimensionPicker.tsx
var import_react149 = __toESM(require_react());
var import_react_relay14 = __toESM(require_react_relay());
function DimensionTypeLabel(props) {
  const { type } = props;
  let labelColor = "gray";
  let text2 = "";
  switch (type) {
    case "feature":
      labelColor = "blue";
      text2 = "FEA";
      break;
    case "tag":
      labelColor = "purple";
      text2 = "TAG";
      break;
    case "prediction":
      labelColor = "white";
      text2 = "PRE";
      break;
    case "actual":
      labelColor = "orange";
      text2 = "ACT";
      break;
    default:
      assertUnreachable2(type);
  }
  return /* @__PURE__ */ jsx5(Label, { color: labelColor, "aria-label": type, title: "type", children: text2 });
}
var contextualHelp = /* @__PURE__ */ jsxs2(_ContextualHelp, { children: [
  /* @__PURE__ */ jsx5(_Heading, { weight: "heavy", level: 4, children: "Model Dimension" }),
  /* @__PURE__ */ jsx5(_Content, { children: /* @__PURE__ */ jsx5(_Text, { children: "A dimension is a feature, tag, prediction, or actual value that is associated with a model inference. Features represent inputs, tags represent metadata, predictions represent outputs, and actuals represent ground truth." }) })
] });
function DimensionPicker(props) {
  const { selectedDimension, dimensions, onChange, isLoading, ...restProps } = props;
  return /* @__PURE__ */ jsx5(
    _Picker,
    {
      ...restProps,
      defaultSelectedKey: selectedDimension ? selectedDimension.name : void 0,
      "aria-label": "Select a dimension",
      onSelectionChange: (key) => {
        const dimension = dimensions.find((d) => d.name === key);
        if (dimension) {
          (0, import_react149.startTransition)(() => onChange(dimension));
        }
      },
      label: "Dimension",
      labelExtra: contextualHelp,
      isDisabled: isLoading,
      placeholder: isLoading ? "Loading..." : "Select a dimension...",
      children: dimensions.map((dimension) => /* @__PURE__ */ jsx5($c1d7fb2ec91bae71$export$6d08773d2e66f8f2, { textValue: dimension.name, children: /* @__PURE__ */ jsxs2(
        "div",
        {
          css: css`
              .ac-label {
                margin-right: var(--px-spacing-med);
              }
            `,
          children: [
            /* @__PURE__ */ jsx5(DimensionTypeLabel, { type: dimension.type }),
            dimension.name
          ]
        }
      ) }, dimension.name))
    }
  );
}
function ConnectedDimensionPicker(props) {
  const [dimensions, setDimensions] = (0, import_react149.useState)([]);
  const [isLoading, setIsLoading] = (0, import_react149.useState)(true);
  const { selectedDimension, onChange, ...restProps } = props;
  (0, import_react149.useEffect)(() => {
    (0, import_react_relay14.fetchQuery)(
      RelayEnvironment_default,
      DimensionPickerQuery_graphql_default,
      {},
      {
        fetchPolicy: "store-or-network"
      }
    ).toPromise().then((data) => {
      const dims = data?.model.dimensions.edges.map((edge) => edge.node) ?? [];
      setDimensions(dims);
      setIsLoading(false);
    });
  }, []);
  return /* @__PURE__ */ jsx5(
    DimensionPicker,
    {
      ...restProps,
      onChange,
      dimensions,
      label: "Dimension",
      selectedDimension,
      isLoading
    }
  );
}

// src/components/pointcloud/ColoringStrategyPicker.tsx
function isColoringStrategy(strategy) {
  return typeof strategy === "string" && strategy in ColoringStrategy;
}
var ColoringStrategies = Object.values(ColoringStrategy);
var contextualHelp2 = /* @__PURE__ */ jsxs2(_ContextualHelp, { children: [
  /* @__PURE__ */ jsx5(_Heading, { weight: "heavy", level: 4, children: "Coloring Strategy" }),
  /* @__PURE__ */ jsx5(_Content, { children: /* @__PURE__ */ jsx5(_Text, { children: "The way in which inference point is colored. Each point in the point-cloud represents a model inference. These inferences can be colored by a particular attribute (such as dataset and dimension) or by a performance value such as correctness (predicted value equals the actual value)" }) })
] });
function ColoringStrategyPicker(props) {
  const { strategy, onChange } = props;
  return /* @__PURE__ */ jsx5(
    _Picker,
    {
      defaultSelectedKey: strategy,
      "aria-label": "Coloring strategy",
      onSelectionChange: (key) => {
        if (isColoringStrategy(key)) {
          onChange(key);
        }
      },
      label: "Color By",
      labelExtra: contextualHelp2,
      children: ColoringStrategies.map((item) => /* @__PURE__ */ jsx5($c1d7fb2ec91bae71$export$6d08773d2e66f8f2, { children: item }, item))
    }
  );
}

// src/components/pointcloud/DatasetVisibilitySettings.tsx
var import_react153 = __toESM(require_react());

// src/pages/embedding/useDefaultColorScheme.ts
var import_react151 = __toESM(require_react());
function useDefaultColorScheme() {
  const { theme: theme3 } = useTheme2();
  return (0, import_react151.useMemo)(() => {
    if (theme3 === "light") {
      return DEFAULT_LIGHT_COLOR_SCHEME;
    }
    return DEFAULT_DARK_COLOR_SCHEME;
  }, [theme3]);
}

// src/components/pointcloud/VisibilityCheckboxField.tsx
var fieldCSS2 = css`
  display: flex;
  flex-direction: row;
  gap: var(--px-flex-gap-sm);
  align-items: center;
`;
function VisibilityCheckboxField(props) {
  const { name: name2, checked, onChange, color: color2, iconShape = "circle" /* circle */ } = props;
  return /* @__PURE__ */ jsxs2("label", { css: fieldCSS2, children: [
    /* @__PURE__ */ jsx5(
      "input",
      {
        type: "checkbox",
        checked,
        name: name2,
        onChange
      }
    ),
    /* @__PURE__ */ jsx5(ShapeIcon, { shape: iconShape, color: color2 }),
    name2
  ] }, name2);
}

// src/components/pointcloud/DatasetVisibilitySettings.tsx
function DatasetVisibilitySettings({
  hasReference,
  hasCorpus
}) {
  const datasetVisibility = usePointCloudContext(
    (state) => state.datasetVisibility
  );
  const setDatasetVisibility = usePointCloudContext(
    (state) => state.setDatasetVisibility
  );
  const coloringStrategy = usePointCloudContext(
    (state) => state.coloringStrategy
  );
  const handleDatasetVisibilityChange = (0, import_react153.useCallback)(
    (event) => {
      const { name: name2, checked } = event.target;
      setDatasetVisibility({
        ...datasetVisibility,
        [name2]: checked
      });
    },
    [datasetVisibility, setDatasetVisibility]
  );
  const DEFAULT_COLOR_SCHEME = useDefaultColorScheme();
  const primaryColor = (0, import_react153.useMemo)(() => {
    switch (coloringStrategy) {
      case "dataset" /* dataset */:
        return DEFAULT_COLOR_SCHEME[0];
      case "correctness" /* correctness */:
      case "dimension" /* dimension */:
        return FALLBACK_COLOR;
      default:
        assertUnreachable2(coloringStrategy);
    }
  }, [coloringStrategy, DEFAULT_COLOR_SCHEME]);
  const referenceColor = (0, import_react153.useMemo)(() => {
    switch (coloringStrategy) {
      case "dataset" /* dataset */:
        return DEFAULT_COLOR_SCHEME[1];
      case "correctness" /* correctness */:
      case "dimension" /* dimension */:
        return FALLBACK_COLOR;
      default:
        assertUnreachable2(coloringStrategy);
    }
  }, [coloringStrategy, DEFAULT_COLOR_SCHEME]);
  const corpusColor = FALLBACK_COLOR;
  const referenceShape = coloringStrategy === "dataset" /* dataset */ ? "circle" /* circle */ : "square" /* square */;
  const corpusShape = coloringStrategy === "dataset" /* dataset */ ? "circle" /* circle */ : "diamond" /* diamond */;
  return /* @__PURE__ */ jsxs2(
    "form",
    {
      css: css`
        display: flex;
        flex-direction: column;
        padding: var(--px-spacing-med);
      `,
      children: [
        /* @__PURE__ */ jsx5(
          VisibilityCheckboxField,
          {
            checked: datasetVisibility.primary,
            name: "primary",
            color: primaryColor,
            onChange: handleDatasetVisibilityChange
          }
        ),
        hasReference ? /* @__PURE__ */ jsx5(
          VisibilityCheckboxField,
          {
            checked: datasetVisibility.reference,
            name: "reference",
            onChange: handleDatasetVisibilityChange,
            color: referenceColor,
            iconShape: referenceShape
          }
        ) : null,
        hasCorpus ? /* @__PURE__ */ jsx5(
          VisibilityCheckboxField,
          {
            checked: datasetVisibility.corpus,
            name: "corpus",
            onChange: handleDatasetVisibilityChange,
            color: corpusColor,
            iconShape: corpusShape
          }
        ) : null
      ]
    }
  );
}

// src/components/pointcloud/PointGroupVisibilitySettings.tsx
var import_react155 = __toESM(require_react());
function PointGroupVisibilitySettings() {
  const pointGroupVisibility = usePointCloudContext(
    (state) => state.pointGroupVisibility
  );
  const setPointGroupVisibility = usePointCloudContext(
    (state) => state.setPointGroupVisibility
  );
  const pointGroupColors = usePointCloudContext(
    (state) => state.pointGroupColors
  );
  const pointGroups = (0, import_react155.useMemo)(
    () => Object.keys(pointGroupVisibility),
    [pointGroupVisibility]
  );
  const onChange = (0, import_react155.useCallback)(
    (event) => {
      const { name: name2, checked } = event.target;
      setPointGroupVisibility({
        ...pointGroupVisibility,
        [name2]: checked
      });
    },
    [pointGroupVisibility, setPointGroupVisibility]
  );
  return /* @__PURE__ */ jsxs2(
    "form",
    {
      css: css`
        display: flex;
        flex-direction: column;
      `,
      children: [
        /* @__PURE__ */ jsx5(PointGroupCheckbox, {}),
        /* @__PURE__ */ jsx5(
          "div",
          {
            css: css`
          padding: var(--px-spacing-med);
        `,
            children: pointGroups.map((groupName) => {
              const groupVisibility = pointGroupVisibility[groupName];
              const groupColor = pointGroupColors[groupName];
              return /* @__PURE__ */ jsx5(
                VisibilityCheckboxField,
                {
                  name: groupName,
                  checked: groupVisibility,
                  color: groupColor,
                  onChange
                },
                groupName
              );
            })
          }
        )
      ]
    }
  );
}
function PointGroupCheckbox() {
  const pointGroupVisibility = usePointCloudContext(
    (state) => state.pointGroupVisibility
  );
  const setPointGroupVisibility = usePointCloudContext(
    (state) => state.setPointGroupVisibility
  );
  const coloringStrategy = usePointCloudContext(
    (state) => state.coloringStrategy
  );
  const allNotVisible = (0, import_react155.useMemo)(
    () => Object.values(pointGroupVisibility).every((visible) => !visible),
    [pointGroupVisibility]
  );
  const onChange = (0, import_react155.useCallback)(
    (e3) => {
      const { checked } = e3.target;
      const newPointGroupVisibility = Object.keys(pointGroupVisibility).reduce(
        (acc, groupName) => {
          acc[groupName] = checked;
          return acc;
        },
        {}
      );
      setPointGroupVisibility(newPointGroupVisibility);
    },
    [pointGroupVisibility, setPointGroupVisibility]
  );
  return /* @__PURE__ */ jsxs2(
    "label",
    {
      css: () => css`
        display: flex;
        flex-direction: row;
        gap: var(--px-flex-gap-sm);
        padding: var(--px-spacing-sm) var(--px-spacing-med);
        background-color: var(--ac-global-background-color-light);
      `,
      children: [
        /* @__PURE__ */ jsx5("input", { type: "checkbox", checked: !allNotVisible, onChange }),
        `${coloringStrategy}`
      ]
    }
  );
}

// src/components/pointcloud/PointCloudDisplaySettings.tsx
function PointCloudDisplaySettings() {
  const { referenceDataset, corpusDataset } = useDatasets();
  const coloringStrategy = usePointCloudContext(
    (state) => state.coloringStrategy
  );
  const setColoringStrategy = usePointCloudContext(
    (state) => state.setColoringStrategy
  );
  const dimension = usePointCloudContext((state) => state.dimension);
  const dimensionMetadata = usePointCloudContext(
    (state) => state.dimensionMetadata
  );
  const setDimension = usePointCloudContext((state) => state.setDimension);
  const showDatasetVisibilitySettings = referenceDataset != null || corpusDataset != null;
  const isAwaitingDimensionSelection = coloringStrategy === "dimension" /* dimension */ && dimension == null;
  const isAwaitingDimensionMetadataRetrieval = coloringStrategy === "dimension" /* dimension */ && dimension != null && dimensionMetadata == null;
  const showPointGroupVisibilitySettings = coloringStrategy !== "dataset" /* dataset */ && !isAwaitingDimensionSelection && !isAwaitingDimensionMetadataRetrieval;
  return /* @__PURE__ */ jsxs2(
    "section",
    {
      css: css`
        & > .ac-form {
          padding: var(--px-spacing-med) var(--px-spacing-med) 0
            var(--px-spacing-med);
        }
        & > .ac-alert {
          margin: var(--px-spacing-med);
        }
      `,
      children: [
        /* @__PURE__ */ jsx5(_Form, { children: /* @__PURE__ */ jsxs2(Fragment5, { children: [
          /* @__PURE__ */ jsx5(
            ColoringStrategyPicker,
            {
              strategy: coloringStrategy,
              onChange: setColoringStrategy
            }
          ),
          coloringStrategy === "dimension" /* dimension */ ? /* @__PURE__ */ jsx5(
            ConnectedDimensionPicker,
            {
              selectedDimension: null,
              onChange: (dimension2) => {
                setDimension(dimension2);
              }
            }
          ) : null
        ] }) }),
        showDatasetVisibilitySettings ? /* @__PURE__ */ jsx5(
          DatasetVisibilitySettings,
          {
            hasReference: referenceDataset != null,
            hasCorpus: corpusDataset != null
          }
        ) : null,
        showPointGroupVisibilitySettings ? /* @__PURE__ */ jsx5(PointGroupVisibilitySettings, {}) : null,
        isAwaitingDimensionSelection ? /* @__PURE__ */ jsx5(Alert, { variant: "info", showIcon: false, children: "Please select a dimension to color the point cloud by" }) : null,
        isAwaitingDimensionMetadataRetrieval ? /* @__PURE__ */ jsx5(
          "div",
          {
            css: css`
            padding: var(--px-spacing-med);
            min-height: 100px;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
          `,
            children: /* @__PURE__ */ jsx5(Loading, { message: "Calculating point colors" })
          }
        ) : null
      ]
    }
  );
}

// src/components/pointcloud/SelectionDisplayRadioGroup.tsx
function isSelectionDisplay(m) {
  return typeof m === "string" && m in SelectionDisplay;
}
function SelectionDisplayRadioGroup(props) {
  return /* @__PURE__ */ jsxs2(
    RadioGroup,
    {
      defaultValue: props.mode,
      variant: "inline-button",
      size: "compact",
      onChange: (v4) => {
        if (isSelectionDisplay(v4)) {
          props.onChange(v4);
        } else {
          throw new Error(`Unknown view mode: ${v4}`);
        }
      },
      children: [
        /* @__PURE__ */ jsx5(Radio, { label: "List", value: "list" /* list */, children: /* @__PURE__ */ jsx5(Icon, { svg: /* @__PURE__ */ jsx5(Icons.ListOutline, {}) }) }),
        /* @__PURE__ */ jsx5(Radio, { label: "Grid", value: "gallery" /* gallery */, children: /* @__PURE__ */ jsx5(Icon, { svg: /* @__PURE__ */ jsx5(Icons.Grid, {}) }) })
      ]
    }
  );
}

// src/components/pointcloud/ClusterItem.tsx
var import_react158 = __toESM(require_react());
function ClusterItem(props) {
  const {
    driftRatio,
    primaryToCorpusRatio,
    clusterId,
    isSelected,
    onClick,
    onMouseEnter,
    onMouseLeave,
    metricName,
    primaryMetricValue,
    referenceMetricValue,
    hideReference
  } = props;
  const { percentage: primaryPercentage, comparisonDatasetRole } = (0, import_react158.useMemo)(() => {
    if (typeof primaryToCorpusRatio === "number") {
      return {
        percentage: (primaryToCorpusRatio + 1) / 2 * 100,
        comparisonDatasetRole: "corpus" /* corpus */
      };
    } else if (typeof driftRatio === "number") {
      return {
        percentage: (driftRatio + 1) / 2 * 100,
        comparisonDatasetRole: "reference" /* reference */
      };
    }
    return { percentage: 100, comparisonDatasetRole: null };
  }, [driftRatio, primaryToCorpusRatio]);
  return /* @__PURE__ */ jsxs2(
    "div",
    {
      css: css`
        border: 1px solid var(--ac-global-border-color-light);
        border-radius: var(--ac-global-rounding-medium);
        overflow: hidden;
        transition: background-color 0.2s ease-in-out;
        cursor: pointer;
        &:hover {
          background-color: var(--ac-global-color-primary-700);
          border-color: var(--ac-global-color-primary);
        }
        &.is-selected {
          border-color: var(--ac-global-color-primary);
          background-color: var(--ac-global-color-primary-700);
        }
      `,
      className: isSelected ? "is-selected" : "",
      role: "button",
      onClick,
      onMouseEnter,
      onMouseLeave,
      children: [
        /* @__PURE__ */ jsxs2(
          "div",
          {
            css: css`
          padding: var(--ac-global-dimension-static-size-100);
          display: flex;
          flex-direction: row;
          justify-content: space-between;
          align-items: center;
        `,
            children: [
              /* @__PURE__ */ jsx5(
                _Flex,
                {
                  "data-testid": "cluster-description",
                  direction: "column",
                  gap: "size-50",
                  alignItems: "start",
                  children: /* @__PURE__ */ jsxs2(_Flex, { direction: "column", alignItems: "start", children: [
                    /* @__PURE__ */ jsx5(_Heading, { level: 3, children: `Cluster ${clusterId}` }),
                    /* @__PURE__ */ jsx5(
                      _Text,
                      {
                        color: "text-700",
                        textSize: "small",
                        children: `${props.numPoints} points`
                      }
                    )
                  ] })
                }
              ),
              /* @__PURE__ */ jsxs2(
                "div",
                {
                  "data-testid": "cluster-metric",
                  css: css`
            display: flex;
            flex-direction: column;
            align-items: end;
          `,
                  children: [
                    /* @__PURE__ */ jsx5(_Text, { color: "text-700", textSize: "small", children: metricName }),
                    /* @__PURE__ */ jsx5(_Text, { color: "text-900", textSize: "medium", children: numberFormatter2(primaryMetricValue) }),
                    !hideReference ? /* @__PURE__ */ jsx5(_Text, { color: "designationPurple", textSize: "small", children: numberFormatter2(referenceMetricValue) }) : null
                  ]
                }
              )
            ]
          }
        ),
        /* @__PURE__ */ jsx5(
          DistributionBar,
          {
            primaryPercentage,
            comparisonDatasetRole
          }
        )
      ]
    }
  );
}
function DistributionBar({
  primaryPercentage,
  comparisonDatasetRole
}) {
  return /* @__PURE__ */ jsxs2(
    "div",
    {
      "data-testid": "dataset-distribution",
      css: css`
        display: flex;
        flex-direction: row;
      `,
      children: [
        /* @__PURE__ */ jsx5(
          "div",
          {
            "data-testid": "primary-distribution",
            css: css`
          background-image: linear-gradient(
            to right,
            var(--px-primary-color--transparent) 0%,
            var(--px-primary-color)
          );
          height: var(--px-gradient-bar-height);
          width: ${primaryPercentage}%;
        `
          }
        ),
        /* @__PURE__ */ jsx5(
          "div",
          {
            "data-testid": "reference-distribution",
            "data-reference-dataset-role": `${comparisonDatasetRole ?? "none"}`,
            css: css`
          &[data-reference-dataset-role="reference"] {
            background-image: linear-gradient(
              to right,
              var(--px-reference-color) 0%,
              var(--px-reference-color--transparent)
            );
          }
          &[data-reference-dataset-role="corpus"] {
            background-image: linear-gradient(
              to right,
              var(--px-corpus-color) 0%,
              var(--px-corpus-color--transparent)
            );
          }

          height: var(--px-gradient-bar-height);
          width: ${100 - primaryPercentage}%;
        `
          }
        )
      ]
    }
  );
}

// src/components/pointcloud/PointCloudParameterSettings.tsx
var import_react161 = __toESM(require_react());

// node_modules/react-hook-form/dist/index.esm.mjs
var import_react160 = __toESM(require_react(), 1);
var isCheckBoxInput = (element2) => element2.type === "checkbox";
var isDateObject = (value) => value instanceof Date;
var isNullOrUndefined = (value) => value == null;
var isObjectType = (value) => typeof value === "object";
var isObject = (value) => !isNullOrUndefined(value) && !Array.isArray(value) && isObjectType(value) && !isDateObject(value);
var getEventValue = (event) => isObject(event) && event.target ? isCheckBoxInput(event.target) ? event.target.checked : event.target.value : event;
var getNodeParentName = (name2) => name2.substring(0, name2.search(/\.\d+(\.|$)/)) || name2;
var isNameInFieldArray = (names, name2) => names.has(getNodeParentName(name2));
var isPlainObject = (tempObject2) => {
  const prototypeCopy = tempObject2.constructor && tempObject2.constructor.prototype;
  return isObject(prototypeCopy) && prototypeCopy.hasOwnProperty("isPrototypeOf");
};
var isWeb = typeof window !== "undefined" && typeof window.HTMLElement !== "undefined" && typeof document !== "undefined";
function cloneObject(data) {
  let copy4;
  const isArray2 = Array.isArray(data);
  if (data instanceof Date) {
    copy4 = new Date(data);
  } else if (data instanceof Set) {
    copy4 = new Set(data);
  } else if (!(isWeb && (data instanceof Blob || data instanceof FileList)) && (isArray2 || isObject(data))) {
    copy4 = isArray2 ? [] : {};
    if (!isArray2 && !isPlainObject(data)) {
      copy4 = data;
    } else {
      for (const key in data) {
        if (data.hasOwnProperty(key)) {
          copy4[key] = cloneObject(data[key]);
        }
      }
    }
  } else {
    return data;
  }
  return copy4;
}
var compact = (value) => Array.isArray(value) ? value.filter(Boolean) : [];
var isUndefined = (val) => val === void 0;
var get2 = (obj, path2, defaultValue) => {
  if (!path2 || !isObject(obj)) {
    return defaultValue;
  }
  const result = compact(path2.split(/[,[\].]+?/)).reduce((result2, key) => isNullOrUndefined(result2) ? result2 : result2[key], obj);
  return isUndefined(result) || result === obj ? isUndefined(obj[path2]) ? defaultValue : obj[path2] : result;
};
var isBoolean = (value) => typeof value === "boolean";
var EVENTS = {
  BLUR: "blur",
  FOCUS_OUT: "focusout",
  CHANGE: "change"
};
var VALIDATION_MODE = {
  onBlur: "onBlur",
  onChange: "onChange",
  onSubmit: "onSubmit",
  onTouched: "onTouched",
  all: "all"
};
var INPUT_VALIDATION_RULES = {
  max: "max",
  min: "min",
  maxLength: "maxLength",
  minLength: "minLength",
  pattern: "pattern",
  required: "required",
  validate: "validate"
};
var HookFormContext = import_react160.default.createContext(null);
var useFormContext = () => import_react160.default.useContext(HookFormContext);
var getProxyFormState = (formState, control, localProxyFormState, isRoot = true) => {
  const result = {
    defaultValues: control._defaultValues
  };
  for (const key in formState) {
    Object.defineProperty(result, key, {
      get: () => {
        const _key = key;
        if (control._proxyFormState[_key] !== VALIDATION_MODE.all) {
          control._proxyFormState[_key] = !isRoot || VALIDATION_MODE.all;
        }
        localProxyFormState && (localProxyFormState[_key] = true);
        return formState[_key];
      }
    });
  }
  return result;
};
var isEmptyObject = (value) => isObject(value) && !Object.keys(value).length;
var shouldRenderFormState = (formStateData, _proxyFormState, updateFormState, isRoot) => {
  updateFormState(formStateData);
  const { name: name2, ...formState } = formStateData;
  return isEmptyObject(formState) || Object.keys(formState).length >= Object.keys(_proxyFormState).length || Object.keys(formState).find((key) => _proxyFormState[key] === (!isRoot || VALIDATION_MODE.all));
};
var convertToArrayPayload = (value) => Array.isArray(value) ? value : [value];
var shouldSubscribeByName = (name2, signalName, exact) => !name2 || !signalName || name2 === signalName || convertToArrayPayload(name2).some((currentName) => currentName && (exact ? currentName === signalName : currentName.startsWith(signalName) || signalName.startsWith(currentName)));
function useSubscribe(props) {
  const _props = import_react160.default.useRef(props);
  _props.current = props;
  import_react160.default.useEffect(() => {
    const subscription2 = !props.disabled && _props.current.subject && _props.current.subject.subscribe({
      next: _props.current.next
    });
    return () => {
      subscription2 && subscription2.unsubscribe();
    };
  }, [props.disabled]);
}
function useFormState(props) {
  const methods = useFormContext();
  const { control = methods.control, disabled, name: name2, exact } = props || {};
  const [formState, updateFormState] = import_react160.default.useState(control._formState);
  const _mounted = import_react160.default.useRef(true);
  const _localProxyFormState = import_react160.default.useRef({
    isDirty: false,
    isLoading: false,
    dirtyFields: false,
    touchedFields: false,
    isValidating: false,
    isValid: false,
    errors: false
  });
  const _name = import_react160.default.useRef(name2);
  _name.current = name2;
  useSubscribe({
    disabled,
    next: (value) => _mounted.current && shouldSubscribeByName(_name.current, value.name, exact) && shouldRenderFormState(value, _localProxyFormState.current, control._updateFormState) && updateFormState({
      ...control._formState,
      ...value
    }),
    subject: control._subjects.state
  });
  import_react160.default.useEffect(() => {
    _mounted.current = true;
    _localProxyFormState.current.isValid && control._updateValid(true);
    return () => {
      _mounted.current = false;
    };
  }, [control]);
  return getProxyFormState(formState, control, _localProxyFormState.current, false);
}
var isString = (value) => typeof value === "string";
var generateWatchOutput = (names, _names, formValues, isGlobal, defaultValue) => {
  if (isString(names)) {
    isGlobal && _names.watch.add(names);
    return get2(formValues, names, defaultValue);
  }
  if (Array.isArray(names)) {
    return names.map((fieldName) => (isGlobal && _names.watch.add(fieldName), get2(formValues, fieldName)));
  }
  isGlobal && (_names.watchAll = true);
  return formValues;
};
function useWatch(props) {
  const methods = useFormContext();
  const { control = methods.control, name: name2, defaultValue, disabled, exact } = props || {};
  const _name = import_react160.default.useRef(name2);
  _name.current = name2;
  useSubscribe({
    disabled,
    subject: control._subjects.values,
    next: (formState) => {
      if (shouldSubscribeByName(_name.current, formState.name, exact)) {
        updateValue(cloneObject(generateWatchOutput(_name.current, control._names, formState.values || control._formValues, false, defaultValue)));
      }
    }
  });
  const [value, updateValue] = import_react160.default.useState(control._getWatch(name2, defaultValue));
  import_react160.default.useEffect(() => control._removeUnmounted());
  return value;
}
var isKey = (value) => /^\w*$/.test(value);
var stringToPath = (input) => compact(input.replace(/["|']|\]/g, "").split(/\.|\[/));
function set2(object, path2, value) {
  let index = -1;
  const tempPath = isKey(path2) ? [path2] : stringToPath(path2);
  const length2 = tempPath.length;
  const lastIndex = length2 - 1;
  while (++index < length2) {
    const key = tempPath[index];
    let newValue = value;
    if (index !== lastIndex) {
      const objValue = object[key];
      newValue = isObject(objValue) || Array.isArray(objValue) ? objValue : !isNaN(+tempPath[index + 1]) ? [] : {};
    }
    object[key] = newValue;
    object = object[key];
  }
  return object;
}
function useController(props) {
  const methods = useFormContext();
  const { name: name2, disabled, control = methods.control, shouldUnregister } = props;
  const isArrayField = isNameInFieldArray(control._names.array, name2);
  const value = useWatch({
    control,
    name: name2,
    defaultValue: get2(control._formValues, name2, get2(control._defaultValues, name2, props.defaultValue)),
    exact: true
  });
  const formState = useFormState({
    control,
    name: name2
  });
  const _registerProps = import_react160.default.useRef(control.register(name2, {
    ...props.rules,
    value
  }));
  _registerProps.current = control.register(name2, props.rules);
  import_react160.default.useEffect(() => {
    const _shouldUnregisterField = control._options.shouldUnregister || shouldUnregister;
    const updateMounted = (name3, value2) => {
      const field = get2(control._fields, name3);
      if (field) {
        field._f.mount = value2;
      }
    };
    updateMounted(name2, true);
    if (_shouldUnregisterField) {
      const value2 = cloneObject(get2(control._options.defaultValues, name2));
      set2(control._defaultValues, name2, value2);
      if (isUndefined(get2(control._formValues, name2))) {
        set2(control._formValues, name2, value2);
      }
    }
    return () => {
      (isArrayField ? _shouldUnregisterField && !control._state.action : _shouldUnregisterField) ? control.unregister(name2) : updateMounted(name2, false);
    };
  }, [name2, control, isArrayField, shouldUnregister]);
  import_react160.default.useEffect(() => {
    if (get2(control._fields, name2)) {
      control._updateDisabledField({
        disabled,
        fields: control._fields,
        name: name2
      });
    }
  }, [disabled, name2, control]);
  return {
    field: {
      name: name2,
      value,
      ...isBoolean(disabled) ? { disabled } : {},
      onChange: import_react160.default.useCallback((event) => _registerProps.current.onChange({
        target: {
          value: getEventValue(event),
          name: name2
        },
        type: EVENTS.CHANGE
      }), [name2]),
      onBlur: import_react160.default.useCallback(() => _registerProps.current.onBlur({
        target: {
          value: get2(control._formValues, name2),
          name: name2
        },
        type: EVENTS.BLUR
      }), [name2, control]),
      ref: (elm) => {
        const field = get2(control._fields, name2);
        if (field && elm) {
          field._f.ref = {
            focus: () => elm.focus(),
            select: () => elm.select(),
            setCustomValidity: (message) => elm.setCustomValidity(message),
            reportValidity: () => elm.reportValidity()
          };
        }
      }
    },
    formState,
    fieldState: Object.defineProperties({}, {
      invalid: {
        enumerable: true,
        get: () => !!get2(formState.errors, name2)
      },
      isDirty: {
        enumerable: true,
        get: () => !!get2(formState.dirtyFields, name2)
      },
      isTouched: {
        enumerable: true,
        get: () => !!get2(formState.touchedFields, name2)
      },
      error: {
        enumerable: true,
        get: () => get2(formState.errors, name2)
      }
    })
  };
}
var Controller = (props) => props.render(useController(props));
var appendErrors = (name2, validateAllFieldCriteria, errors, type, message) => validateAllFieldCriteria ? {
  ...errors[name2],
  types: {
    ...errors[name2] && errors[name2].types ? errors[name2].types : {},
    [type]: message || true
  }
} : {};
var focusFieldBy = (fields, callback, fieldsNames) => {
  for (const key of fieldsNames || Object.keys(fields)) {
    const field = get2(fields, key);
    if (field) {
      const { _f, ...currentField } = field;
      if (_f && callback(_f.name)) {
        if (_f.ref.focus) {
          _f.ref.focus();
          break;
        } else if (_f.refs && _f.refs[0].focus) {
          _f.refs[0].focus();
          break;
        }
      } else if (isObject(currentField)) {
        focusFieldBy(currentField, callback);
      }
    }
  }
};
var getValidationModes = (mode) => ({
  isOnSubmit: !mode || mode === VALIDATION_MODE.onSubmit,
  isOnBlur: mode === VALIDATION_MODE.onBlur,
  isOnChange: mode === VALIDATION_MODE.onChange,
  isOnAll: mode === VALIDATION_MODE.all,
  isOnTouch: mode === VALIDATION_MODE.onTouched
});
var isWatched = (name2, _names, isBlurEvent) => !isBlurEvent && (_names.watchAll || _names.watch.has(name2) || [..._names.watch].some((watchName) => name2.startsWith(watchName) && /^\.\w+/.test(name2.slice(watchName.length))));
var updateFieldArrayRootError = (errors, error, name2) => {
  const fieldArrayErrors = compact(get2(errors, name2));
  set2(fieldArrayErrors, "root", error[name2]);
  set2(errors, name2, fieldArrayErrors);
  return errors;
};
var isFileInput = (element2) => element2.type === "file";
var isFunction3 = (value) => typeof value === "function";
var isHTMLElement = (value) => {
  if (!isWeb) {
    return false;
  }
  const owner = value ? value.ownerDocument : 0;
  return value instanceof (owner && owner.defaultView ? owner.defaultView.HTMLElement : HTMLElement);
};
var isMessage = (value) => isString(value);
var isRadioInput = (element2) => element2.type === "radio";
var isRegex = (value) => value instanceof RegExp;
var defaultResult = {
  value: false,
  isValid: false
};
var validResult = { value: true, isValid: true };
var getCheckboxValue = (options) => {
  if (Array.isArray(options)) {
    if (options.length > 1) {
      const values2 = options.filter((option) => option && option.checked && !option.disabled).map((option) => option.value);
      return { value: values2, isValid: !!values2.length };
    }
    return options[0].checked && !options[0].disabled ? (
      // @ts-expect-error expected to work in the browser
      options[0].attributes && !isUndefined(options[0].attributes.value) ? isUndefined(options[0].value) || options[0].value === "" ? validResult : { value: options[0].value, isValid: true } : validResult
    ) : defaultResult;
  }
  return defaultResult;
};
var defaultReturn = {
  isValid: false,
  value: null
};
var getRadioValue = (options) => Array.isArray(options) ? options.reduce((previous, option) => option && option.checked && !option.disabled ? {
  isValid: true,
  value: option.value
} : previous, defaultReturn) : defaultReturn;
function getValidateError(result, ref, type = "validate") {
  if (isMessage(result) || Array.isArray(result) && result.every(isMessage) || isBoolean(result) && !result) {
    return {
      type,
      message: isMessage(result) ? result : "",
      ref
    };
  }
}
var getValueAndMessage = (validationData) => isObject(validationData) && !isRegex(validationData) ? validationData : {
  value: validationData,
  message: ""
};
var validateField = async (field, formValues, validateAllFieldCriteria, shouldUseNativeValidation, isFieldArray) => {
  const { ref, refs, required, maxLength, minLength, min: min3, max: max3, pattern, validate, name: name2, valueAsNumber, mount, disabled } = field._f;
  const inputValue = get2(formValues, name2);
  if (!mount || disabled) {
    return {};
  }
  const inputRef = refs ? refs[0] : ref;
  const setCustomValidity = (message) => {
    if (shouldUseNativeValidation && inputRef.reportValidity) {
      inputRef.setCustomValidity(isBoolean(message) ? "" : message || "");
      inputRef.reportValidity();
    }
  };
  const error = {};
  const isRadio = isRadioInput(ref);
  const isCheckBox = isCheckBoxInput(ref);
  const isRadioOrCheckbox2 = isRadio || isCheckBox;
  const isEmpty = (valueAsNumber || isFileInput(ref)) && isUndefined(ref.value) && isUndefined(inputValue) || isHTMLElement(ref) && ref.value === "" || inputValue === "" || Array.isArray(inputValue) && !inputValue.length;
  const appendErrorsCurry = appendErrors.bind(null, name2, validateAllFieldCriteria, error);
  const getMinMaxMessage = (exceedMax, maxLengthMessage, minLengthMessage, maxType = INPUT_VALIDATION_RULES.maxLength, minType = INPUT_VALIDATION_RULES.minLength) => {
    const message = exceedMax ? maxLengthMessage : minLengthMessage;
    error[name2] = {
      type: exceedMax ? maxType : minType,
      message,
      ref,
      ...appendErrorsCurry(exceedMax ? maxType : minType, message)
    };
  };
  if (isFieldArray ? !Array.isArray(inputValue) || !inputValue.length : required && (!isRadioOrCheckbox2 && (isEmpty || isNullOrUndefined(inputValue)) || isBoolean(inputValue) && !inputValue || isCheckBox && !getCheckboxValue(refs).isValid || isRadio && !getRadioValue(refs).isValid)) {
    const { value, message } = isMessage(required) ? { value: !!required, message: required } : getValueAndMessage(required);
    if (value) {
      error[name2] = {
        type: INPUT_VALIDATION_RULES.required,
        message,
        ref: inputRef,
        ...appendErrorsCurry(INPUT_VALIDATION_RULES.required, message)
      };
      if (!validateAllFieldCriteria) {
        setCustomValidity(message);
        return error;
      }
    }
  }
  if (!isEmpty && (!isNullOrUndefined(min3) || !isNullOrUndefined(max3))) {
    let exceedMax;
    let exceedMin;
    const maxOutput = getValueAndMessage(max3);
    const minOutput = getValueAndMessage(min3);
    if (!isNullOrUndefined(inputValue) && !isNaN(inputValue)) {
      const valueNumber = ref.valueAsNumber || (inputValue ? +inputValue : inputValue);
      if (!isNullOrUndefined(maxOutput.value)) {
        exceedMax = valueNumber > maxOutput.value;
      }
      if (!isNullOrUndefined(minOutput.value)) {
        exceedMin = valueNumber < minOutput.value;
      }
    } else {
      const valueDate = ref.valueAsDate || new Date(inputValue);
      const convertTimeToDate = (time2) => /* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).toDateString() + " " + time2);
      const isTime = ref.type == "time";
      const isWeek = ref.type == "week";
      if (isString(maxOutput.value) && inputValue) {
        exceedMax = isTime ? convertTimeToDate(inputValue) > convertTimeToDate(maxOutput.value) : isWeek ? inputValue > maxOutput.value : valueDate > new Date(maxOutput.value);
      }
      if (isString(minOutput.value) && inputValue) {
        exceedMin = isTime ? convertTimeToDate(inputValue) < convertTimeToDate(minOutput.value) : isWeek ? inputValue < minOutput.value : valueDate < new Date(minOutput.value);
      }
    }
    if (exceedMax || exceedMin) {
      getMinMaxMessage(!!exceedMax, maxOutput.message, minOutput.message, INPUT_VALIDATION_RULES.max, INPUT_VALIDATION_RULES.min);
      if (!validateAllFieldCriteria) {
        setCustomValidity(error[name2].message);
        return error;
      }
    }
  }
  if ((maxLength || minLength) && !isEmpty && (isString(inputValue) || isFieldArray && Array.isArray(inputValue))) {
    const maxLengthOutput = getValueAndMessage(maxLength);
    const minLengthOutput = getValueAndMessage(minLength);
    const exceedMax = !isNullOrUndefined(maxLengthOutput.value) && inputValue.length > +maxLengthOutput.value;
    const exceedMin = !isNullOrUndefined(minLengthOutput.value) && inputValue.length < +minLengthOutput.value;
    if (exceedMax || exceedMin) {
      getMinMaxMessage(exceedMax, maxLengthOutput.message, minLengthOutput.message);
      if (!validateAllFieldCriteria) {
        setCustomValidity(error[name2].message);
        return error;
      }
    }
  }
  if (pattern && !isEmpty && isString(inputValue)) {
    const { value: patternValue, message } = getValueAndMessage(pattern);
    if (isRegex(patternValue) && !inputValue.match(patternValue)) {
      error[name2] = {
        type: INPUT_VALIDATION_RULES.pattern,
        message,
        ref,
        ...appendErrorsCurry(INPUT_VALIDATION_RULES.pattern, message)
      };
      if (!validateAllFieldCriteria) {
        setCustomValidity(message);
        return error;
      }
    }
  }
  if (validate) {
    if (isFunction3(validate)) {
      const result = await validate(inputValue, formValues);
      const validateError = getValidateError(result, inputRef);
      if (validateError) {
        error[name2] = {
          ...validateError,
          ...appendErrorsCurry(INPUT_VALIDATION_RULES.validate, validateError.message)
        };
        if (!validateAllFieldCriteria) {
          setCustomValidity(validateError.message);
          return error;
        }
      }
    } else if (isObject(validate)) {
      let validationResult = {};
      for (const key in validate) {
        if (!isEmptyObject(validationResult) && !validateAllFieldCriteria) {
          break;
        }
        const validateError = getValidateError(await validate[key](inputValue, formValues), inputRef, key);
        if (validateError) {
          validationResult = {
            ...validateError,
            ...appendErrorsCurry(key, validateError.message)
          };
          setCustomValidity(validateError.message);
          if (validateAllFieldCriteria) {
            error[name2] = validationResult;
          }
        }
      }
      if (!isEmptyObject(validationResult)) {
        error[name2] = {
          ref: inputRef,
          ...validationResult
        };
        if (!validateAllFieldCriteria) {
          return error;
        }
      }
    }
  }
  setCustomValidity(true);
  return error;
};
function baseGet(object, updatePath) {
  const length2 = updatePath.slice(0, -1).length;
  let index = 0;
  while (index < length2) {
    object = isUndefined(object) ? index++ : object[updatePath[index++]];
  }
  return object;
}
function isEmptyArray(obj) {
  for (const key in obj) {
    if (obj.hasOwnProperty(key) && !isUndefined(obj[key])) {
      return false;
    }
  }
  return true;
}
function unset(object, path2) {
  const paths = Array.isArray(path2) ? path2 : isKey(path2) ? [path2] : stringToPath(path2);
  const childObject = paths.length === 1 ? object : baseGet(object, paths);
  const index = paths.length - 1;
  const key = paths[index];
  if (childObject) {
    delete childObject[key];
  }
  if (index !== 0 && (isObject(childObject) && isEmptyObject(childObject) || Array.isArray(childObject) && isEmptyArray(childObject))) {
    unset(object, paths.slice(0, -1));
  }
  return object;
}
function createSubject() {
  let _observers = [];
  const next2 = (value) => {
    for (const observer of _observers) {
      observer.next && observer.next(value);
    }
  };
  const subscribe = (observer) => {
    _observers.push(observer);
    return {
      unsubscribe: () => {
        _observers = _observers.filter((o) => o !== observer);
      }
    };
  };
  const unsubscribe = () => {
    _observers = [];
  };
  return {
    get observers() {
      return _observers;
    },
    next: next2,
    subscribe,
    unsubscribe
  };
}
var isPrimitive2 = (value) => isNullOrUndefined(value) || !isObjectType(value);
function deepEqual3(object1, object2) {
  if (isPrimitive2(object1) || isPrimitive2(object2)) {
    return object1 === object2;
  }
  if (isDateObject(object1) && isDateObject(object2)) {
    return object1.getTime() === object2.getTime();
  }
  const keys1 = Object.keys(object1);
  const keys22 = Object.keys(object2);
  if (keys1.length !== keys22.length) {
    return false;
  }
  for (const key of keys1) {
    const val1 = object1[key];
    if (!keys22.includes(key)) {
      return false;
    }
    if (key !== "ref") {
      const val2 = object2[key];
      if (isDateObject(val1) && isDateObject(val2) || isObject(val1) && isObject(val2) || Array.isArray(val1) && Array.isArray(val2) ? !deepEqual3(val1, val2) : val1 !== val2) {
        return false;
      }
    }
  }
  return true;
}
var isMultipleSelect = (element2) => element2.type === `select-multiple`;
var isRadioOrCheckbox = (ref) => isRadioInput(ref) || isCheckBoxInput(ref);
var live = (ref) => isHTMLElement(ref) && ref.isConnected;
var objectHasFunction = (data) => {
  for (const key in data) {
    if (isFunction3(data[key])) {
      return true;
    }
  }
  return false;
};
function markFieldsDirty(data, fields = {}) {
  const isParentNodeArray = Array.isArray(data);
  if (isObject(data) || isParentNodeArray) {
    for (const key in data) {
      if (Array.isArray(data[key]) || isObject(data[key]) && !objectHasFunction(data[key])) {
        fields[key] = Array.isArray(data[key]) ? [] : {};
        markFieldsDirty(data[key], fields[key]);
      } else if (!isNullOrUndefined(data[key])) {
        fields[key] = true;
      }
    }
  }
  return fields;
}
function getDirtyFieldsFromDefaultValues(data, formValues, dirtyFieldsFromValues) {
  const isParentNodeArray = Array.isArray(data);
  if (isObject(data) || isParentNodeArray) {
    for (const key in data) {
      if (Array.isArray(data[key]) || isObject(data[key]) && !objectHasFunction(data[key])) {
        if (isUndefined(formValues) || isPrimitive2(dirtyFieldsFromValues[key])) {
          dirtyFieldsFromValues[key] = Array.isArray(data[key]) ? markFieldsDirty(data[key], []) : { ...markFieldsDirty(data[key]) };
        } else {
          getDirtyFieldsFromDefaultValues(data[key], isNullOrUndefined(formValues) ? {} : formValues[key], dirtyFieldsFromValues[key]);
        }
      } else {
        dirtyFieldsFromValues[key] = !deepEqual3(data[key], formValues[key]);
      }
    }
  }
  return dirtyFieldsFromValues;
}
var getDirtyFields = (defaultValues, formValues) => getDirtyFieldsFromDefaultValues(defaultValues, formValues, markFieldsDirty(formValues));
var getFieldValueAs = (value, { valueAsNumber, valueAsDate, setValueAs }) => isUndefined(value) ? value : valueAsNumber ? value === "" ? NaN : value ? +value : value : valueAsDate && isString(value) ? new Date(value) : setValueAs ? setValueAs(value) : value;
function getFieldValue(_f) {
  const ref = _f.ref;
  if (_f.refs ? _f.refs.every((ref2) => ref2.disabled) : ref.disabled) {
    return;
  }
  if (isFileInput(ref)) {
    return ref.files;
  }
  if (isRadioInput(ref)) {
    return getRadioValue(_f.refs).value;
  }
  if (isMultipleSelect(ref)) {
    return [...ref.selectedOptions].map(({ value }) => value);
  }
  if (isCheckBoxInput(ref)) {
    return getCheckboxValue(_f.refs).value;
  }
  return getFieldValueAs(isUndefined(ref.value) ? _f.ref.value : ref.value, _f);
}
var getResolverOptions = (fieldsNames, _fields, criteriaMode, shouldUseNativeValidation) => {
  const fields = {};
  for (const name2 of fieldsNames) {
    const field = get2(_fields, name2);
    field && set2(fields, name2, field._f);
  }
  return {
    criteriaMode,
    names: [...fieldsNames],
    fields,
    shouldUseNativeValidation
  };
};
var getRuleValue = (rule) => isUndefined(rule) ? rule : isRegex(rule) ? rule.source : isObject(rule) ? isRegex(rule.value) ? rule.value.source : rule.value : rule;
var hasValidation = (options) => options.mount && (options.required || options.min || options.max || options.maxLength || options.minLength || options.pattern || options.validate);
function schemaErrorLookup(errors, _fields, name2) {
  const error = get2(errors, name2);
  if (error || isKey(name2)) {
    return {
      error,
      name: name2
    };
  }
  const names = name2.split(".");
  while (names.length) {
    const fieldName = names.join(".");
    const field = get2(_fields, fieldName);
    const foundError = get2(errors, fieldName);
    if (field && !Array.isArray(field) && name2 !== fieldName) {
      return { name: name2 };
    }
    if (foundError && foundError.type) {
      return {
        name: fieldName,
        error: foundError
      };
    }
    names.pop();
  }
  return {
    name: name2
  };
}
var skipValidation = (isBlurEvent, isTouched, isSubmitted, reValidateMode, mode) => {
  if (mode.isOnAll) {
    return false;
  } else if (!isSubmitted && mode.isOnTouch) {
    return !(isTouched || isBlurEvent);
  } else if (isSubmitted ? reValidateMode.isOnBlur : mode.isOnBlur) {
    return !isBlurEvent;
  } else if (isSubmitted ? reValidateMode.isOnChange : mode.isOnChange) {
    return isBlurEvent;
  }
  return true;
};
var unsetEmptyArray = (ref, name2) => !compact(get2(ref, name2)).length && unset(ref, name2);
var defaultOptions = {
  mode: VALIDATION_MODE.onSubmit,
  reValidateMode: VALIDATION_MODE.onChange,
  shouldFocusError: true
};
function createFormControl(props = {}, flushRootRender) {
  let _options = {
    ...defaultOptions,
    ...props
  };
  let _formState = {
    submitCount: 0,
    isDirty: false,
    isLoading: isFunction3(_options.defaultValues),
    isValidating: false,
    isSubmitted: false,
    isSubmitting: false,
    isSubmitSuccessful: false,
    isValid: false,
    touchedFields: {},
    dirtyFields: {},
    errors: {}
  };
  let _fields = {};
  let _defaultValues = isObject(_options.defaultValues) || isObject(_options.values) ? cloneObject(_options.defaultValues || _options.values) || {} : {};
  let _formValues = _options.shouldUnregister ? {} : cloneObject(_defaultValues);
  let _state = {
    action: false,
    mount: false,
    watch: false
  };
  let _names = {
    mount: /* @__PURE__ */ new Set(),
    unMount: /* @__PURE__ */ new Set(),
    array: /* @__PURE__ */ new Set(),
    watch: /* @__PURE__ */ new Set()
  };
  let delayErrorCallback;
  let timer = 0;
  const _proxyFormState = {
    isDirty: false,
    dirtyFields: false,
    touchedFields: false,
    isValidating: false,
    isValid: false,
    errors: false
  };
  const _subjects = {
    values: createSubject(),
    array: createSubject(),
    state: createSubject()
  };
  const shouldCaptureDirtyFields = props.resetOptions && props.resetOptions.keepDirtyValues;
  const validationModeBeforeSubmit = getValidationModes(_options.mode);
  const validationModeAfterSubmit = getValidationModes(_options.reValidateMode);
  const shouldDisplayAllAssociatedErrors = _options.criteriaMode === VALIDATION_MODE.all;
  const debounce4 = (callback) => (wait) => {
    clearTimeout(timer);
    timer = setTimeout(callback, wait);
  };
  const _updateValid = async (shouldUpdateValid) => {
    if (_proxyFormState.isValid || shouldUpdateValid) {
      const isValid = _options.resolver ? isEmptyObject((await _executeSchema()).errors) : await executeBuiltInValidation(_fields, true);
      if (isValid !== _formState.isValid) {
        _subjects.state.next({
          isValid
        });
      }
    }
  };
  const _updateIsValidating = (value) => _proxyFormState.isValidating && _subjects.state.next({
    isValidating: value
  });
  const _updateFieldArray = (name2, values2 = [], method, args, shouldSetValues = true, shouldUpdateFieldsAndState = true) => {
    if (args && method) {
      _state.action = true;
      if (shouldUpdateFieldsAndState && Array.isArray(get2(_fields, name2))) {
        const fieldValues = method(get2(_fields, name2), args.argA, args.argB);
        shouldSetValues && set2(_fields, name2, fieldValues);
      }
      if (shouldUpdateFieldsAndState && Array.isArray(get2(_formState.errors, name2))) {
        const errors = method(get2(_formState.errors, name2), args.argA, args.argB);
        shouldSetValues && set2(_formState.errors, name2, errors);
        unsetEmptyArray(_formState.errors, name2);
      }
      if (_proxyFormState.touchedFields && shouldUpdateFieldsAndState && Array.isArray(get2(_formState.touchedFields, name2))) {
        const touchedFields = method(get2(_formState.touchedFields, name2), args.argA, args.argB);
        shouldSetValues && set2(_formState.touchedFields, name2, touchedFields);
      }
      if (_proxyFormState.dirtyFields) {
        _formState.dirtyFields = getDirtyFields(_defaultValues, _formValues);
      }
      _subjects.state.next({
        name: name2,
        isDirty: _getDirty(name2, values2),
        dirtyFields: _formState.dirtyFields,
        errors: _formState.errors,
        isValid: _formState.isValid
      });
    } else {
      set2(_formValues, name2, values2);
    }
  };
  const updateErrors = (name2, error) => {
    set2(_formState.errors, name2, error);
    _subjects.state.next({
      errors: _formState.errors
    });
  };
  const updateValidAndValue = (name2, shouldSkipSetValueAs, value, ref) => {
    const field = get2(_fields, name2);
    if (field) {
      const defaultValue = get2(_formValues, name2, isUndefined(value) ? get2(_defaultValues, name2) : value);
      isUndefined(defaultValue) || ref && ref.defaultChecked || shouldSkipSetValueAs ? set2(_formValues, name2, shouldSkipSetValueAs ? defaultValue : getFieldValue(field._f)) : setFieldValue(name2, defaultValue);
      _state.mount && _updateValid();
    }
  };
  const updateTouchAndDirty = (name2, fieldValue, isBlurEvent, shouldDirty, shouldRender) => {
    let shouldUpdateField = false;
    let isPreviousDirty = false;
    const output = {
      name: name2
    };
    if (!isBlurEvent || shouldDirty) {
      if (_proxyFormState.isDirty) {
        isPreviousDirty = _formState.isDirty;
        _formState.isDirty = output.isDirty = _getDirty();
        shouldUpdateField = isPreviousDirty !== output.isDirty;
      }
      const isCurrentFieldPristine = deepEqual3(get2(_defaultValues, name2), fieldValue);
      isPreviousDirty = get2(_formState.dirtyFields, name2);
      isCurrentFieldPristine ? unset(_formState.dirtyFields, name2) : set2(_formState.dirtyFields, name2, true);
      output.dirtyFields = _formState.dirtyFields;
      shouldUpdateField = shouldUpdateField || _proxyFormState.dirtyFields && isPreviousDirty !== !isCurrentFieldPristine;
    }
    if (isBlurEvent) {
      const isPreviousFieldTouched = get2(_formState.touchedFields, name2);
      if (!isPreviousFieldTouched) {
        set2(_formState.touchedFields, name2, isBlurEvent);
        output.touchedFields = _formState.touchedFields;
        shouldUpdateField = shouldUpdateField || _proxyFormState.touchedFields && isPreviousFieldTouched !== isBlurEvent;
      }
    }
    shouldUpdateField && shouldRender && _subjects.state.next(output);
    return shouldUpdateField ? output : {};
  };
  const shouldRenderByError = (name2, isValid, error, fieldState) => {
    const previousFieldError = get2(_formState.errors, name2);
    const shouldUpdateValid = _proxyFormState.isValid && isBoolean(isValid) && _formState.isValid !== isValid;
    if (props.delayError && error) {
      delayErrorCallback = debounce4(() => updateErrors(name2, error));
      delayErrorCallback(props.delayError);
    } else {
      clearTimeout(timer);
      delayErrorCallback = null;
      error ? set2(_formState.errors, name2, error) : unset(_formState.errors, name2);
    }
    if ((error ? !deepEqual3(previousFieldError, error) : previousFieldError) || !isEmptyObject(fieldState) || shouldUpdateValid) {
      const updatedFormState = {
        ...fieldState,
        ...shouldUpdateValid && isBoolean(isValid) ? { isValid } : {},
        errors: _formState.errors,
        name: name2
      };
      _formState = {
        ..._formState,
        ...updatedFormState
      };
      _subjects.state.next(updatedFormState);
    }
    _updateIsValidating(false);
  };
  const _executeSchema = async (name2) => _options.resolver(_formValues, _options.context, getResolverOptions(name2 || _names.mount, _fields, _options.criteriaMode, _options.shouldUseNativeValidation));
  const executeSchemaAndUpdateState = async (names) => {
    const { errors } = await _executeSchema(names);
    if (names) {
      for (const name2 of names) {
        const error = get2(errors, name2);
        error ? set2(_formState.errors, name2, error) : unset(_formState.errors, name2);
      }
    } else {
      _formState.errors = errors;
    }
    return errors;
  };
  const executeBuiltInValidation = async (fields, shouldOnlyCheckValid, context2 = {
    valid: true
  }) => {
    for (const name2 in fields) {
      const field = fields[name2];
      if (field) {
        const { _f, ...fieldValue } = field;
        if (_f) {
          const isFieldArrayRoot = _names.array.has(_f.name);
          const fieldError = await validateField(field, _formValues, shouldDisplayAllAssociatedErrors, _options.shouldUseNativeValidation && !shouldOnlyCheckValid, isFieldArrayRoot);
          if (fieldError[_f.name]) {
            context2.valid = false;
            if (shouldOnlyCheckValid) {
              break;
            }
          }
          !shouldOnlyCheckValid && (get2(fieldError, _f.name) ? isFieldArrayRoot ? updateFieldArrayRootError(_formState.errors, fieldError, _f.name) : set2(_formState.errors, _f.name, fieldError[_f.name]) : unset(_formState.errors, _f.name));
        }
        fieldValue && await executeBuiltInValidation(fieldValue, shouldOnlyCheckValid, context2);
      }
    }
    return context2.valid;
  };
  const _removeUnmounted = () => {
    for (const name2 of _names.unMount) {
      const field = get2(_fields, name2);
      field && (field._f.refs ? field._f.refs.every((ref) => !live(ref)) : !live(field._f.ref)) && unregister(name2);
    }
    _names.unMount = /* @__PURE__ */ new Set();
  };
  const _getDirty = (name2, data) => (name2 && data && set2(_formValues, name2, data), !deepEqual3(getValues(), _defaultValues));
  const _getWatch = (names, defaultValue, isGlobal) => generateWatchOutput(names, _names, {
    ..._state.mount ? _formValues : isUndefined(defaultValue) ? _defaultValues : isString(names) ? { [names]: defaultValue } : defaultValue
  }, isGlobal, defaultValue);
  const _getFieldArray = (name2) => compact(get2(_state.mount ? _formValues : _defaultValues, name2, props.shouldUnregister ? get2(_defaultValues, name2, []) : []));
  const setFieldValue = (name2, value, options = {}) => {
    const field = get2(_fields, name2);
    let fieldValue = value;
    if (field) {
      const fieldReference = field._f;
      if (fieldReference) {
        !fieldReference.disabled && set2(_formValues, name2, getFieldValueAs(value, fieldReference));
        fieldValue = isHTMLElement(fieldReference.ref) && isNullOrUndefined(value) ? "" : value;
        if (isMultipleSelect(fieldReference.ref)) {
          [...fieldReference.ref.options].forEach((optionRef) => optionRef.selected = fieldValue.includes(optionRef.value));
        } else if (fieldReference.refs) {
          if (isCheckBoxInput(fieldReference.ref)) {
            fieldReference.refs.length > 1 ? fieldReference.refs.forEach((checkboxRef) => (!checkboxRef.defaultChecked || !checkboxRef.disabled) && (checkboxRef.checked = Array.isArray(fieldValue) ? !!fieldValue.find((data) => data === checkboxRef.value) : fieldValue === checkboxRef.value)) : fieldReference.refs[0] && (fieldReference.refs[0].checked = !!fieldValue);
          } else {
            fieldReference.refs.forEach((radioRef) => radioRef.checked = radioRef.value === fieldValue);
          }
        } else if (isFileInput(fieldReference.ref)) {
          fieldReference.ref.value = "";
        } else {
          fieldReference.ref.value = fieldValue;
          if (!fieldReference.ref.type) {
            _subjects.values.next({
              name: name2,
              values: { ..._formValues }
            });
          }
        }
      }
    }
    (options.shouldDirty || options.shouldTouch) && updateTouchAndDirty(name2, fieldValue, options.shouldTouch, options.shouldDirty, true);
    options.shouldValidate && trigger(name2);
  };
  const setValues = (name2, value, options) => {
    for (const fieldKey in value) {
      const fieldValue = value[fieldKey];
      const fieldName = `${name2}.${fieldKey}`;
      const field = get2(_fields, fieldName);
      (_names.array.has(name2) || !isPrimitive2(fieldValue) || field && !field._f) && !isDateObject(fieldValue) ? setValues(fieldName, fieldValue, options) : setFieldValue(fieldName, fieldValue, options);
    }
  };
  const setValue = (name2, value, options = {}) => {
    const field = get2(_fields, name2);
    const isFieldArray = _names.array.has(name2);
    const cloneValue = cloneObject(value);
    set2(_formValues, name2, cloneValue);
    if (isFieldArray) {
      _subjects.array.next({
        name: name2,
        values: { ..._formValues }
      });
      if ((_proxyFormState.isDirty || _proxyFormState.dirtyFields) && options.shouldDirty) {
        _subjects.state.next({
          name: name2,
          dirtyFields: getDirtyFields(_defaultValues, _formValues),
          isDirty: _getDirty(name2, cloneValue)
        });
      }
    } else {
      field && !field._f && !isNullOrUndefined(cloneValue) ? setValues(name2, cloneValue, options) : setFieldValue(name2, cloneValue, options);
    }
    isWatched(name2, _names) && _subjects.state.next({ ..._formState });
    _subjects.values.next({
      name: name2,
      values: { ..._formValues }
    });
    !_state.mount && flushRootRender();
  };
  const onChange = async (event) => {
    const target = event.target;
    let name2 = target.name;
    let isFieldValueUpdated = true;
    const field = get2(_fields, name2);
    const getCurrentFieldValue = () => target.type ? getFieldValue(field._f) : getEventValue(event);
    if (field) {
      let error;
      let isValid;
      const fieldValue = getCurrentFieldValue();
      const isBlurEvent = event.type === EVENTS.BLUR || event.type === EVENTS.FOCUS_OUT;
      const shouldSkipValidation = !hasValidation(field._f) && !_options.resolver && !get2(_formState.errors, name2) && !field._f.deps || skipValidation(isBlurEvent, get2(_formState.touchedFields, name2), _formState.isSubmitted, validationModeAfterSubmit, validationModeBeforeSubmit);
      const watched = isWatched(name2, _names, isBlurEvent);
      set2(_formValues, name2, fieldValue);
      if (isBlurEvent) {
        field._f.onBlur && field._f.onBlur(event);
        delayErrorCallback && delayErrorCallback(0);
      } else if (field._f.onChange) {
        field._f.onChange(event);
      }
      const fieldState = updateTouchAndDirty(name2, fieldValue, isBlurEvent, false);
      const shouldRender = !isEmptyObject(fieldState) || watched;
      !isBlurEvent && _subjects.values.next({
        name: name2,
        type: event.type,
        values: { ..._formValues }
      });
      if (shouldSkipValidation) {
        _proxyFormState.isValid && _updateValid();
        return shouldRender && _subjects.state.next({ name: name2, ...watched ? {} : fieldState });
      }
      !isBlurEvent && watched && _subjects.state.next({ ..._formState });
      _updateIsValidating(true);
      if (_options.resolver) {
        const { errors } = await _executeSchema([name2]);
        const previousErrorLookupResult = schemaErrorLookup(_formState.errors, _fields, name2);
        const errorLookupResult = schemaErrorLookup(errors, _fields, previousErrorLookupResult.name || name2);
        error = errorLookupResult.error;
        name2 = errorLookupResult.name;
        isValid = isEmptyObject(errors);
      } else {
        error = (await validateField(field, _formValues, shouldDisplayAllAssociatedErrors, _options.shouldUseNativeValidation))[name2];
        isFieldValueUpdated = Number.isNaN(fieldValue) || fieldValue === get2(_formValues, name2, fieldValue);
        if (isFieldValueUpdated) {
          if (error) {
            isValid = false;
          } else if (_proxyFormState.isValid) {
            isValid = await executeBuiltInValidation(_fields, true);
          }
        }
      }
      if (isFieldValueUpdated) {
        field._f.deps && trigger(field._f.deps);
        shouldRenderByError(name2, isValid, error, fieldState);
      }
    }
  };
  const trigger = async (name2, options = {}) => {
    let isValid;
    let validationResult;
    const fieldNames = convertToArrayPayload(name2);
    _updateIsValidating(true);
    if (_options.resolver) {
      const errors = await executeSchemaAndUpdateState(isUndefined(name2) ? name2 : fieldNames);
      isValid = isEmptyObject(errors);
      validationResult = name2 ? !fieldNames.some((name3) => get2(errors, name3)) : isValid;
    } else if (name2) {
      validationResult = (await Promise.all(fieldNames.map(async (fieldName) => {
        const field = get2(_fields, fieldName);
        return await executeBuiltInValidation(field && field._f ? { [fieldName]: field } : field);
      }))).every(Boolean);
      !(!validationResult && !_formState.isValid) && _updateValid();
    } else {
      validationResult = isValid = await executeBuiltInValidation(_fields);
    }
    _subjects.state.next({
      ...!isString(name2) || _proxyFormState.isValid && isValid !== _formState.isValid ? {} : { name: name2 },
      ..._options.resolver || !name2 ? { isValid } : {},
      errors: _formState.errors,
      isValidating: false
    });
    options.shouldFocus && !validationResult && focusFieldBy(_fields, (key) => key && get2(_formState.errors, key), name2 ? fieldNames : _names.mount);
    return validationResult;
  };
  const getValues = (fieldNames) => {
    const values2 = {
      ..._defaultValues,
      ..._state.mount ? _formValues : {}
    };
    return isUndefined(fieldNames) ? values2 : isString(fieldNames) ? get2(values2, fieldNames) : fieldNames.map((name2) => get2(values2, name2));
  };
  const getFieldState = (name2, formState) => ({
    invalid: !!get2((formState || _formState).errors, name2),
    isDirty: !!get2((formState || _formState).dirtyFields, name2),
    isTouched: !!get2((formState || _formState).touchedFields, name2),
    error: get2((formState || _formState).errors, name2)
  });
  const clearErrors = (name2) => {
    name2 && convertToArrayPayload(name2).forEach((inputName) => unset(_formState.errors, inputName));
    _subjects.state.next({
      errors: name2 ? _formState.errors : {}
    });
  };
  const setError = (name2, error, options) => {
    const ref = (get2(_fields, name2, { _f: {} })._f || {}).ref;
    set2(_formState.errors, name2, {
      ...error,
      ref
    });
    _subjects.state.next({
      name: name2,
      errors: _formState.errors,
      isValid: false
    });
    options && options.shouldFocus && ref && ref.focus && ref.focus();
  };
  const watch = (name2, defaultValue) => isFunction3(name2) ? _subjects.values.subscribe({
    next: (payload) => name2(_getWatch(void 0, defaultValue), payload)
  }) : _getWatch(name2, defaultValue, true);
  const unregister = (name2, options = {}) => {
    for (const fieldName of name2 ? convertToArrayPayload(name2) : _names.mount) {
      _names.mount.delete(fieldName);
      _names.array.delete(fieldName);
      if (!options.keepValue) {
        unset(_fields, fieldName);
        unset(_formValues, fieldName);
      }
      !options.keepError && unset(_formState.errors, fieldName);
      !options.keepDirty && unset(_formState.dirtyFields, fieldName);
      !options.keepTouched && unset(_formState.touchedFields, fieldName);
      !_options.shouldUnregister && !options.keepDefaultValue && unset(_defaultValues, fieldName);
    }
    _subjects.values.next({
      values: { ..._formValues }
    });
    _subjects.state.next({
      ..._formState,
      ...!options.keepDirty ? {} : { isDirty: _getDirty() }
    });
    !options.keepIsValid && _updateValid();
  };
  const _updateDisabledField = ({ disabled, name: name2, field, fields }) => {
    if (isBoolean(disabled)) {
      const value = disabled ? void 0 : get2(_formValues, name2, getFieldValue(field ? field._f : get2(fields, name2)._f));
      set2(_formValues, name2, value);
      updateTouchAndDirty(name2, value, false, false, true);
    }
  };
  const register = (name2, options = {}) => {
    let field = get2(_fields, name2);
    const disabledIsDefined = isBoolean(options.disabled);
    set2(_fields, name2, {
      ...field || {},
      _f: {
        ...field && field._f ? field._f : { ref: { name: name2 } },
        name: name2,
        mount: true,
        ...options
      }
    });
    _names.mount.add(name2);
    if (field) {
      _updateDisabledField({
        field,
        disabled: options.disabled,
        name: name2
      });
    } else {
      updateValidAndValue(name2, true, options.value);
    }
    return {
      ...disabledIsDefined ? { disabled: options.disabled } : {},
      ..._options.progressive ? {
        required: !!options.required,
        min: getRuleValue(options.min),
        max: getRuleValue(options.max),
        minLength: getRuleValue(options.minLength),
        maxLength: getRuleValue(options.maxLength),
        pattern: getRuleValue(options.pattern)
      } : {},
      name: name2,
      onChange,
      onBlur: onChange,
      ref: (ref) => {
        if (ref) {
          register(name2, options);
          field = get2(_fields, name2);
          const fieldRef = isUndefined(ref.value) ? ref.querySelectorAll ? ref.querySelectorAll("input,select,textarea")[0] || ref : ref : ref;
          const radioOrCheckbox = isRadioOrCheckbox(fieldRef);
          const refs = field._f.refs || [];
          if (radioOrCheckbox ? refs.find((option) => option === fieldRef) : fieldRef === field._f.ref) {
            return;
          }
          set2(_fields, name2, {
            _f: {
              ...field._f,
              ...radioOrCheckbox ? {
                refs: [
                  ...refs.filter(live),
                  fieldRef,
                  ...Array.isArray(get2(_defaultValues, name2)) ? [{}] : []
                ],
                ref: { type: fieldRef.type, name: name2 }
              } : { ref: fieldRef }
            }
          });
          updateValidAndValue(name2, false, void 0, fieldRef);
        } else {
          field = get2(_fields, name2, {});
          if (field._f) {
            field._f.mount = false;
          }
          (_options.shouldUnregister || options.shouldUnregister) && !(isNameInFieldArray(_names.array, name2) && _state.action) && _names.unMount.add(name2);
        }
      }
    };
  };
  const _focusError = () => _options.shouldFocusError && focusFieldBy(_fields, (key) => key && get2(_formState.errors, key), _names.mount);
  const handleSubmit = (onValid, onInvalid) => async (e3) => {
    if (e3) {
      e3.preventDefault && e3.preventDefault();
      e3.persist && e3.persist();
    }
    let fieldValues = cloneObject(_formValues);
    _subjects.state.next({
      isSubmitting: true
    });
    if (_options.resolver) {
      const { errors, values: values2 } = await _executeSchema();
      _formState.errors = errors;
      fieldValues = values2;
    } else {
      await executeBuiltInValidation(_fields);
    }
    unset(_formState.errors, "root");
    if (isEmptyObject(_formState.errors)) {
      _subjects.state.next({
        errors: {}
      });
      await onValid(fieldValues, e3);
    } else {
      if (onInvalid) {
        await onInvalid({ ..._formState.errors }, e3);
      }
      _focusError();
      setTimeout(_focusError);
    }
    _subjects.state.next({
      isSubmitted: true,
      isSubmitting: false,
      isSubmitSuccessful: isEmptyObject(_formState.errors),
      submitCount: _formState.submitCount + 1,
      errors: _formState.errors
    });
  };
  const resetField = (name2, options = {}) => {
    if (get2(_fields, name2)) {
      if (isUndefined(options.defaultValue)) {
        setValue(name2, get2(_defaultValues, name2));
      } else {
        setValue(name2, options.defaultValue);
        set2(_defaultValues, name2, options.defaultValue);
      }
      if (!options.keepTouched) {
        unset(_formState.touchedFields, name2);
      }
      if (!options.keepDirty) {
        unset(_formState.dirtyFields, name2);
        _formState.isDirty = options.defaultValue ? _getDirty(name2, get2(_defaultValues, name2)) : _getDirty();
      }
      if (!options.keepError) {
        unset(_formState.errors, name2);
        _proxyFormState.isValid && _updateValid();
      }
      _subjects.state.next({ ..._formState });
    }
  };
  const _reset = (formValues, keepStateOptions = {}) => {
    const updatedValues = formValues ? cloneObject(formValues) : _defaultValues;
    const cloneUpdatedValues = cloneObject(updatedValues);
    const values2 = formValues && !isEmptyObject(formValues) ? cloneUpdatedValues : _defaultValues;
    if (!keepStateOptions.keepDefaultValues) {
      _defaultValues = updatedValues;
    }
    if (!keepStateOptions.keepValues) {
      if (keepStateOptions.keepDirtyValues || shouldCaptureDirtyFields) {
        for (const fieldName of _names.mount) {
          get2(_formState.dirtyFields, fieldName) ? set2(values2, fieldName, get2(_formValues, fieldName)) : setValue(fieldName, get2(values2, fieldName));
        }
      } else {
        if (isWeb && isUndefined(formValues)) {
          for (const name2 of _names.mount) {
            const field = get2(_fields, name2);
            if (field && field._f) {
              const fieldReference = Array.isArray(field._f.refs) ? field._f.refs[0] : field._f.ref;
              if (isHTMLElement(fieldReference)) {
                const form = fieldReference.closest("form");
                if (form) {
                  form.reset();
                  break;
                }
              }
            }
          }
        }
        _fields = {};
      }
      _formValues = props.shouldUnregister ? keepStateOptions.keepDefaultValues ? cloneObject(_defaultValues) : {} : cloneObject(values2);
      _subjects.array.next({
        values: { ...values2 }
      });
      _subjects.values.next({
        values: { ...values2 }
      });
    }
    _names = {
      mount: /* @__PURE__ */ new Set(),
      unMount: /* @__PURE__ */ new Set(),
      array: /* @__PURE__ */ new Set(),
      watch: /* @__PURE__ */ new Set(),
      watchAll: false,
      focus: ""
    };
    !_state.mount && flushRootRender();
    _state.mount = !_proxyFormState.isValid || !!keepStateOptions.keepIsValid;
    _state.watch = !!props.shouldUnregister;
    _subjects.state.next({
      submitCount: keepStateOptions.keepSubmitCount ? _formState.submitCount : 0,
      isDirty: keepStateOptions.keepDirty ? _formState.isDirty : !!(keepStateOptions.keepDefaultValues && !deepEqual3(formValues, _defaultValues)),
      isSubmitted: keepStateOptions.keepIsSubmitted ? _formState.isSubmitted : false,
      dirtyFields: keepStateOptions.keepDirtyValues ? _formState.dirtyFields : keepStateOptions.keepDefaultValues && formValues ? getDirtyFields(_defaultValues, formValues) : {},
      touchedFields: keepStateOptions.keepTouched ? _formState.touchedFields : {},
      errors: keepStateOptions.keepErrors ? _formState.errors : {},
      isSubmitSuccessful: keepStateOptions.keepIsSubmitSuccessful ? _formState.isSubmitSuccessful : false,
      isSubmitting: false
    });
  };
  const reset = (formValues, keepStateOptions) => _reset(isFunction3(formValues) ? formValues(_formValues) : formValues, keepStateOptions);
  const setFocus = (name2, options = {}) => {
    const field = get2(_fields, name2);
    const fieldReference = field && field._f;
    if (fieldReference) {
      const fieldRef = fieldReference.refs ? fieldReference.refs[0] : fieldReference.ref;
      if (fieldRef.focus) {
        fieldRef.focus();
        options.shouldSelect && fieldRef.select();
      }
    }
  };
  const _updateFormState = (updatedFormState) => {
    _formState = {
      ..._formState,
      ...updatedFormState
    };
  };
  const _resetDefaultValues = () => isFunction3(_options.defaultValues) && _options.defaultValues().then((values2) => {
    reset(values2, _options.resetOptions);
    _subjects.state.next({
      isLoading: false
    });
  });
  return {
    control: {
      register,
      unregister,
      getFieldState,
      handleSubmit,
      setError,
      _executeSchema,
      _getWatch,
      _getDirty,
      _updateValid,
      _removeUnmounted,
      _updateFieldArray,
      _updateDisabledField,
      _getFieldArray,
      _reset,
      _resetDefaultValues,
      _updateFormState,
      _subjects,
      _proxyFormState,
      get _fields() {
        return _fields;
      },
      get _formValues() {
        return _formValues;
      },
      get _state() {
        return _state;
      },
      set _state(value) {
        _state = value;
      },
      get _defaultValues() {
        return _defaultValues;
      },
      get _names() {
        return _names;
      },
      set _names(value) {
        _names = value;
      },
      get _formState() {
        return _formState;
      },
      set _formState(value) {
        _formState = value;
      },
      get _options() {
        return _options;
      },
      set _options(value) {
        _options = {
          ..._options,
          ...value
        };
      }
    },
    trigger,
    register,
    handleSubmit,
    watch,
    setValue,
    getValues,
    reset,
    resetField,
    clearErrors,
    unregister,
    setError,
    setFocus,
    getFieldState
  };
}
function useForm(props = {}) {
  const _formControl = import_react160.default.useRef();
  const _values = import_react160.default.useRef();
  const [formState, updateFormState] = import_react160.default.useState({
    isDirty: false,
    isValidating: false,
    isLoading: isFunction3(props.defaultValues),
    isSubmitted: false,
    isSubmitting: false,
    isSubmitSuccessful: false,
    isValid: false,
    submitCount: 0,
    dirtyFields: {},
    touchedFields: {},
    errors: {},
    defaultValues: isFunction3(props.defaultValues) ? void 0 : props.defaultValues
  });
  if (!_formControl.current) {
    _formControl.current = {
      ...createFormControl(props, () => updateFormState((formState2) => ({ ...formState2 }))),
      formState
    };
  }
  const control = _formControl.current.control;
  control._options = props;
  useSubscribe({
    subject: control._subjects.state,
    next: (value) => {
      if (shouldRenderFormState(value, control._proxyFormState, control._updateFormState, true)) {
        updateFormState({ ...control._formState });
      }
    }
  });
  import_react160.default.useEffect(() => {
    if (props.values && !deepEqual3(props.values, _values.current)) {
      control._reset(props.values, control._options.resetOptions);
      _values.current = props.values;
    } else {
      control._resetDefaultValues();
    }
  }, [props.values, control]);
  import_react160.default.useEffect(() => {
    if (!control._state.mount) {
      control._updateValid();
      control._state.mount = true;
    }
    if (control._state.watch) {
      control._state.watch = false;
      control._subjects.state.next({ ...control._formState });
    }
    control._removeUnmounted();
  });
  _formControl.current.formState = getProxyFormState(formState, control);
  return _formControl.current;
}

// src/components/pointcloud/PointCloudParameterSettings.tsx
var nNeighborsContextualHelp = /* @__PURE__ */ jsxs2(_ContextualHelp, { children: [
  /* @__PURE__ */ jsx5(_Heading, { weight: "heavy", level: 4, children: "UMAP N Neighbors" }),
  /* @__PURE__ */ jsx5(_Content, { children: /* @__PURE__ */ jsx5(_Text, { children: "This parameter controls how UMAP balances local versus global structure in the data. It does this by constraining the size of the local neighborhood UMAP will look at when attempting to learn the manifold structure of the data. This means that low values of n_neighbors will force UMAP to concentrate on very local structure (potentially to the detriment of the big picture), while large values will push UMAP to look at larger neighborhoods of each point when estimating the manifold structure of the data, losing fine detail structure for the sake of getting the broader of the data." }) }),
  /* @__PURE__ */ jsx5("footer", { children: /* @__PURE__ */ jsx5(ExternalLink, { href: "https://umap-learn.readthedocs.io/en/latest/parameters.html#n-neighbors", children: "View UMAP documentation" }) })
] });
var minDistContextualHelp = /* @__PURE__ */ jsxs2(_ContextualHelp, { children: [
  /* @__PURE__ */ jsx5(_Heading, { weight: "heavy", level: 4, children: "UMAP Minimum Distance" }),
  /* @__PURE__ */ jsx5(_Content, { children: /* @__PURE__ */ jsx5(_Text, { children: "The min_dist parameter controls how tightly UMAP is allowed to pack points together. It, quite literally, provides the minimum distance apart that points are allowed to be in the low dimensional representation. This means that low values of min_dist will result in clumpier embeddings. This can be useful if you are interested in clustering, or in finer topological structure. Larger values of min_dist will prevent UMAP from packing points together and will focus on the preservation of the broad topological structure instead." }) }),
  /* @__PURE__ */ jsx5("footer", { children: /* @__PURE__ */ jsx5(ExternalLink, { href: "https://umap-learn.readthedocs.io/en/latest/parameters.html#min-dist", children: "View UMAP documentation" }) })
] });
var nSamplesContextualHelp = /* @__PURE__ */ jsxs2(_ContextualHelp, { children: [
  /* @__PURE__ */ jsx5(_Heading, { weight: "heavy", level: 4, children: "Number of Samples" }),
  /* @__PURE__ */ jsxs2(_Content, { children: [
    /* @__PURE__ */ jsx5(_Text, { elementType: "p", children: "Determines the number of samples from each dataset to use when projecting the point cloud using UMAP. This number is per-dataset so a value of 500 means that the point cloud will contain up to 1000 points." }),
    /* @__PURE__ */ jsx5("br", {}),
    /* @__PURE__ */ jsx5(_Text, { elementType: "p", children: "For best results keep this value low until you have identified a sample that you would like to analyze in more detail." })
  ] })
] });
function PointCloudParameterSettings() {
  const umapParameters = usePointCloudContext((state) => state.umapParameters);
  const setUMAPParameters = usePointCloudContext(
    (state) => state.setUMAPParameters
  );
  const {
    handleSubmit,
    control,
    setError,
    formState: { isDirty, isValid }
  } = useForm({
    reValidateMode: "onChange",
    defaultValues: umapParameters
  });
  const onSubmit = (0, import_react161.useCallback)(
    (newUMAPParameters) => {
      const minDist = parseFloat(
        newUMAPParameters.minDist
      );
      if (minDist < MIN_MIN_DIST || minDist > MAX_MIN_DIST) {
        setError("minDist", {
          message: `must be between ${MIN_MIN_DIST} and ${MAX_MIN_DIST}`
        });
        return;
      }
      setUMAPParameters({
        minDist,
        nNeighbors: parseInt(
          newUMAPParameters.nNeighbors,
          10
        ),
        nSamples: parseInt(newUMAPParameters.nSamples, 10)
      });
    },
    [setUMAPParameters, setError]
  );
  return /* @__PURE__ */ jsx5(
    "section",
    {
      css: css`
        & > .ac-form {
          padding: var(--px-spacing-med) var(--px-spacing-med) 0
            var(--px-spacing-med);
        }
      `,
      children: /* @__PURE__ */ jsxs2(_Form, { onSubmit: handleSubmit(onSubmit), children: [
        /* @__PURE__ */ jsx5(
          Controller,
          {
            name: "minDist",
            control,
            rules: {
              required: "field is required"
            },
            render: ({
              field: { onChange, onBlur, value },
              fieldState: { invalid: invalid2, error }
            }) => /* @__PURE__ */ jsx5(
              _TextField,
              {
                label: "min distance",
                labelExtra: minDistContextualHelp,
                type: "number",
                description: `how tightly to pack points`,
                errorMessage: error?.message,
                validationState: invalid2 ? "invalid" : "valid",
                onChange: (v4) => onChange(parseFloat(v4)),
                onBlur,
                value: value.toString()
              }
            )
          }
        ),
        /* @__PURE__ */ jsx5(
          Controller,
          {
            name: "nNeighbors",
            control,
            rules: {
              required: "n neighbors is required",
              min: {
                value: MIN_N_NEIGHBORS,
                message: `greater than or equal to ${MIN_N_NEIGHBORS}`
              },
              max: {
                value: MAX_N_NEIGHBORS,
                message: `less than or equal to ${MAX_N_NEIGHBORS}`
              }
            },
            render: ({ field, fieldState: { invalid: invalid2, error } }) => /* @__PURE__ */ jsx5(
              _TextField,
              {
                label: "n neighbors",
                labelExtra: nNeighborsContextualHelp,
                type: "number",
                step: "0.01",
                description: `balances local versus global structure`,
                errorMessage: error?.message,
                validationState: invalid2 ? "invalid" : "valid",
                ...field,
                value: field.value
              }
            )
          }
        ),
        /* @__PURE__ */ jsx5(
          Controller,
          {
            name: "nSamples",
            control,
            rules: {
              required: "n samples is required",
              max: {
                value: MAX_DATASET_SAMPLE_SIZE,
                message: `must be below ${MAX_DATASET_SAMPLE_SIZE}`
              },
              min: {
                value: MIN_DATASET_SAMPLE_SIZE,
                message: `must be above ${MIN_DATASET_SAMPLE_SIZE}`
              }
            },
            render: ({
              field: { onChange, onBlur, value },
              fieldState: { invalid: invalid2, error }
            }) => /* @__PURE__ */ jsx5(
              _TextField,
              {
                label: "n samples",
                labelExtra: nSamplesContextualHelp,
                defaultValue: "500",
                type: "number",
                description: `number of points to use per dataset`,
                errorMessage: error?.message,
                validationState: invalid2 ? "invalid" : "valid",
                onChange: (v4) => onChange(parseInt(v4, 10)),
                onBlur,
                value: value.toString()
              }
            )
          }
        ),
        /* @__PURE__ */ jsx5(
          "div",
          {
            css: css`
            display: flex;
            flex-direction: row;
            justify-content: flex-end;
            margin-top: var(--px-spacing-med);
          `,
            children: /* @__PURE__ */ jsx5(
              _Button,
              {
                variant: isDirty ? "primary" : "default",
                type: "submit",
                isDisabled: !isValid,
                css: css`
              width: 100%;
            `,
                children: "Apply UMAP Parameters"
              }
            )
          }
        )
      ] })
    }
  );
}

// src/components/pointcloud/ClusteringSettings.tsx
var import_react163 = __toESM(require_react());

// src/constants/numberConstants.ts
var MAX_32_BIT_INTEGER = 2147483647;

// src/components/pointcloud/ClusteringSettings.tsx
var minClusterSizeContextualHelp = /* @__PURE__ */ jsxs2(_ContextualHelp, { children: [
  /* @__PURE__ */ jsx5(_Heading, { weight: "heavy", level: 4, children: "Minimum Cluster Size" }),
  /* @__PURE__ */ jsx5(_Content, { children: /* @__PURE__ */ jsx5(_Text, { elementType: "p", children: "The primary parameter to effect the resulting clustering is min_cluster_size. Ideally this is a relatively intuitive parameter to select \u2013 set it to the smallest size grouping that you wish to consider a cluster." }) }),
  /* @__PURE__ */ jsx5("footer", { children: /* @__PURE__ */ jsx5(ExternalLink, { href: "https://hdbscan.readthedocs.io/en/latest/parameter_selection.html#selecting-min-cluster-size", children: "View HDBSCAN documentation" }) })
] });
var minSamplesContextualHelp = /* @__PURE__ */ jsxs2(_ContextualHelp, { children: [
  /* @__PURE__ */ jsx5(_Heading, { weight: "heavy", level: 4, children: "Minimum Samples" }),
  /* @__PURE__ */ jsx5(_Content, { children: /* @__PURE__ */ jsx5(_Text, { elementType: "p", children: "The simplest intuition for what min_samples does is provide a measure of how conservative you want you clustering to be. The larger the value of min_samples you provide, the more conservative the clustering \u2013 more points will be declared as noise, and clusters will be restricted to progressively more dense areas." }) }),
  /* @__PURE__ */ jsx5("footer", { children: /* @__PURE__ */ jsx5(ExternalLink, { href: "https://hdbscan.readthedocs.io/en/latest/parameter_selection.html#selecting-min-samples", children: "View HDBSCAN documentation" }) })
] });
var clusterSelectionEpsilonContextualHelp = /* @__PURE__ */ jsxs2(_ContextualHelp, { children: [
  /* @__PURE__ */ jsx5(_Heading, { weight: "heavy", level: 4, children: "Cluster Selection Epsilon" }),
  /* @__PURE__ */ jsx5(_Content, { children: /* @__PURE__ */ jsx5(_Text, { elementType: "p", children: "In some cases, we want to choose a small min_cluster_size because even groups of few points might be of interest to us. However, if our data set also contains partitions with high concentrations of objects, this parameter setting can result in a large number of micro-clusters. Selecting a value for cluster_selection_epsilon helps us to merge clusters in these regions. Or in other words, it ensures that clusters below the given threshold are not split up any further." }) }),
  /* @__PURE__ */ jsx5("footer", { children: /* @__PURE__ */ jsx5(ExternalLink, { href: "https://hdbscan.readthedocs.io/en/latest/parameter_selection.html#selecting-cluster-selection-epsilon", children: "View HDBSCAN documentation" }) })
] });
function ClusteringSettings() {
  const hdbscanParameters = usePointCloudContext(
    (state) => state.hdbscanParameters
  );
  const setHDBSCANParameters = usePointCloudContext(
    (state) => state.setHDBSCANParameters
  );
  const clustersLoading = usePointCloudContext(
    (state) => state.clustersLoading
  );
  const {
    control,
    handleSubmit,
    formState: { isDirty, isValid },
    reset
  } = useForm({
    defaultValues: hdbscanParameters
  });
  const onSubmit = (0, import_react163.useCallback)(
    (newHDBSCANParameters) => {
      const values2 = {
        minClusterSize: parseInt(
          newHDBSCANParameters.minClusterSize,
          10
        ),
        clusterMinSamples: parseInt(
          newHDBSCANParameters.clusterMinSamples,
          10
        ),
        clusterSelectionEpsilon: parseFloat(
          newHDBSCANParameters.clusterSelectionEpsilon
        )
      };
      setHDBSCANParameters(values2);
      reset(values2);
    },
    [setHDBSCANParameters, reset]
  );
  return /* @__PURE__ */ jsx5(
    "section",
    {
      css: css`
        & > .ac-form {
          padding: var(--px-spacing-med) var(--px-spacing-med) 0
            var(--px-spacing-med);
        }
      `,
      children: /* @__PURE__ */ jsxs2(_Form, { onSubmit: handleSubmit(onSubmit), children: [
        /* @__PURE__ */ jsx5(
          Controller,
          {
            name: "minClusterSize",
            control,
            rules: {
              required: "field is required",
              min: {
                value: MIN_MIN_CLUSTER_SIZE,
                message: "must be greater than 1"
              },
              max: {
                value: MAX_32_BIT_INTEGER,
                message: "must be less than 2,147,483,647"
              }
            },
            render: ({
              field: { onChange, onBlur, value },
              fieldState: { invalid: invalid2, error }
            }) => /* @__PURE__ */ jsx5(
              _TextField,
              {
                label: "min cluster size",
                labelExtra: minClusterSizeContextualHelp,
                type: "number",
                description: `the smallest size for a cluster`,
                errorMessage: error?.message,
                validationState: invalid2 ? "invalid" : "valid",
                onChange: (v4) => onChange(parseInt(v4, 10)),
                onBlur,
                value: value.toString()
              }
            )
          }
        ),
        /* @__PURE__ */ jsx5(
          Controller,
          {
            name: "clusterMinSamples",
            control,
            rules: {
              required: "field is required",
              min: {
                value: MIN_CLUSTER_MIN_SAMPLES,
                message: `must be greater than ${MIN_CLUSTER_MIN_SAMPLES}`
              },
              max: {
                value: MAX_32_BIT_INTEGER,
                message: "must be less than 2,147,483,647"
              }
            },
            render: ({
              field: { onBlur, onChange, value },
              fieldState: { invalid: invalid2, error }
            }) => /* @__PURE__ */ jsx5(
              _TextField,
              {
                label: "cluster minimum samples",
                labelExtra: minSamplesContextualHelp,
                type: "number",
                description: `determines if a point is a core point`,
                errorMessage: error?.message,
                validationState: invalid2 ? "invalid" : "valid",
                onChange: (v4) => onChange(parseInt(v4, 10)),
                onBlur,
                value: value.toString()
              }
            )
          }
        ),
        /* @__PURE__ */ jsx5(
          Controller,
          {
            name: "clusterSelectionEpsilon",
            control,
            rules: {
              required: "field is required",
              min: {
                value: 0,
                message: "must be a non-negative number"
              },
              max: {
                value: MAX_32_BIT_INTEGER,
                message: "must be less than 2,147,483,647"
              }
            },
            render: ({
              field: { onBlur, onChange, value },
              fieldState: { invalid: invalid2, error }
            }) => /* @__PURE__ */ jsx5(
              _TextField,
              {
                label: "cluster selection epsilon",
                labelExtra: clusterSelectionEpsilonContextualHelp,
                type: "number",
                description: `A distance threshold`,
                errorMessage: error?.message,
                validationState: invalid2 ? "invalid" : "valid",
                onChange: (v4) => onChange(parseInt(v4, 10)),
                onBlur,
                value: value.toString()
              }
            )
          }
        ),
        /* @__PURE__ */ jsx5(
          "div",
          {
            css: css`
            display: flex;
            flex-direction: row;
            justify-content: flex-end;
            margin-top: var(--px-spacing-med);
          `,
            children: /* @__PURE__ */ jsx5(
              _Button,
              {
                variant: isDirty ? "primary" : "default",
                type: "submit",
                isDisabled: !isValid,
                loading: clustersLoading,
                css: css`
              width: 100%;
            `,
                children: clustersLoading ? "Applying parameters" : "Apply Clustering Config"
              }
            )
          }
        )
      ] })
    }
  );
}

// src/components/resize/styles.tsx
var resizeHandleCSS = css`
  transition: 250ms linear all;
  background-color: var(--ac-global-color-grey-200);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.8px;
  --px-resize-handle-size: 8px;
  --px-resize-icon-width: 24px;
  --px-resize-icon-height: 2px;
  outline: none;
  &[data-panel-group-direction="vertical"] {
    height: var(--px-resize-handle-size);
    flex-direction: column;
    &:before,
    &:after {
      width: var(--px-resize-icon-width);
      height: var(--px-resize-icon-height);
    }
  }
  &[data-panel-group-direction="horizontal"] {
    width: var(--px-resize-handle-size);
    flex-direction: row;
    &:before,
    &:after {
      width: var(--px-resize-icon-height);
      height: var(--px-resize-icon-width);
    }
  }

  &:hover {
    background-color: var(--ac-global-color-grey-300);
    border-radius: 4px;
    &:before,
    &:after {
      background-color: var(--ac-global-color-primary);
    }
  }

  &:before,
  &:after {
    content: "";
    color: var(--color-solid-resize-bar);
    flex: 0 0 1rem;
    border-radius: 6px;
    background-color: var(--ac-global-color-grey-300);
    flex: none;
  }
`;
var compactResizeHandleCSS = (theme3) => css`
  transition: 250ms linear all;
  background-color: var(--ac-global-color-grey-200);
  --px-resize-handle-size: 4px;
  outline: none;
  &[data-panel-group-direction="vertical"] {
    height: var(--px-resize-handle-size);
  }
  &[data-panel-group-direction="horizontal"] {
    width: var(--px-resize-handle-size);
  }

  &:hover {
    background-color: ${theme3.colors.arizeLightBlue};
  }
`;

// src/hooks.ts
function useEmbeddingDimensionId() {
  const { embeddingDimensionId } = useParams();
  if (!embeddingDimensionId)
    throw new Error("Missing embeddingDimensionId in URL params");
  return embeddingDimensionId;
}

// src/utils/metricFormatUtils.ts
var METRIC_DEFINITIONS = {
  euclideanDistance: {
    name: "Euclidean Distance",
    shortName: "Euc. Distance",
    definition: `Euclidean distance over time captures how much your primary dataset's embeddings are drifting from the reference data. Euclidean distance of the embeddings is calculated by taking the centroid of the embedding vectors for each dataset and calculating the distance between the two centroids.`
  },
  queryDistance: {
    name: "Query Distance",
    shortName: "Query Distance",
    definition: `The query distance is the euclidean distance of the centroid of queries from the centroid of the corpus.`
  },
  accuracyScore: {
    name: "Accuracy Score",
    shortName: "Accuracy",
    definition: `Accuracy classification score. In multi-label classification, this function computes subset accuracy: the set of labels predicted for a sample must exactly match the corresponding set of labels in the ground truth.`
  }
};
function getMetricShortNameByMetricKey(metricKey) {
  const definition = METRIC_DEFINITIONS[metricKey];
  if (definition != null) {
    return definition.shortName;
  }
  return metricKey;
}
function getMetricDescriptionByMetricKey(metricKey) {
  const definition = METRIC_DEFINITIONS[metricKey];
  if (definition && definition.definition != null) {
    return definition.definition || null;
  }
  return null;
}

// src/pages/embedding/ClusterSortPicker.tsx
var import_react166 = __toESM(require_react());
function getSortKey(sort) {
  return `${sort.column}:${sort.dir}`;
}
function ClusterSortPicker() {
  const { referenceDataset } = useDatasets();
  const hasReferenceDataset = !!referenceDataset;
  const sort = usePointCloudContext((state) => state.clusterSort);
  const setSort = usePointCloudContext((state) => state.setClusterSort);
  const [isOpen, setIsOpen] = (0, import_react166.useState)(false);
  const items = (0, import_react166.useMemo)(() => {
    const dynamicItems = [];
    if (hasReferenceDataset) {
      dynamicItems.push({
        label: "Most drift",
        value: getSortKey({
          column: "driftRatio",
          dir: "desc"
        })
      });
    }
    return [
      ...dynamicItems,
      {
        label: "Largest clusters",
        value: getSortKey({
          column: "size",
          dir: "desc"
        })
      },
      {
        label: "Smallest clusters",
        value: getSortKey({
          column: "size",
          dir: "asc"
        })
      },
      {
        label: "Highest metric value",
        value: getSortKey({
          column: "primaryMetricValue",
          dir: "desc"
        })
      },
      {
        label: "Lowest metric value",
        value: getSortKey({
          column: "primaryMetricValue",
          dir: "asc"
        })
      }
    ];
  }, [hasReferenceDataset]);
  const selectedSortKey = getSortKey(sort);
  return /* @__PURE__ */ jsx5(
    "div",
    {
      css: (theme3) => css`
        .ac-action-button {
          background: none;
          border: none;
          color: ${"var(--ac-global-text-color-700)"};
          font-size: ${theme3.typography.sizes.small.fontSize}px;
          line-height: ${theme3.typography.sizes.small.lineHeight}px;
          cursor: pointer;
          outline: none;
          &:hover {
            color: var(--ac-global-text-color-900);
          }
        }
      `,
      children: /* @__PURE__ */ jsxs2(
        PopoverTrigger,
        {
          placement: "bottom right",
          "aria-label": "Sort clusters by",
          isOpen,
          onOpenChange: (newIsOpen) => setIsOpen(newIsOpen),
          children: [
            /* @__PURE__ */ jsxs2(_ActionButton, { children: [
              "Sort",
              /* @__PURE__ */ jsx5(
                "span",
                {
                  "aria-hidden": true,
                  "data-testid": "dropdown-caret",
                  css: css`
              margin-left: var(--px-spacing-sm);
              border-bottom-color: #0000;
              border-left-color: #0000;
              border-right-color: #0000;
              border-style: solid;
              border-width: 3px 3px 0;
              content: "";
              display: inline-block;
              height: 0;
              vertical-align: middle;
              width: 0;
            `
                }
              )
            ] }),
            /* @__PURE__ */ jsx5(_DropdownMenu, { children: /* @__PURE__ */ jsx5(
              _ListBox,
              {
                style: { width: 200 },
                selectedKeys: [selectedSortKey],
                selectionMode: "single",
                items,
                onSelectionChange: (selection2) => {
                  if (selection2 instanceof Set && selection2.size > 0) {
                    const [sortKey] = selection2.values();
                    const [column2, dir] = sortKey.split(":");
                    setSort({
                      column: column2,
                      dir
                    });
                  }
                  setIsOpen(false);
                },
                children: (item) => /* @__PURE__ */ jsx5($c1d7fb2ec91bae71$export$6d08773d2e66f8f2, { children: item.label }, item.value)
              }
            ) })
          ]
        }
      )
    }
  );
}

// src/pages/embedding/__generated__/EmbeddingActionMenuExportClustersMutation.graphql.ts
var node32 = function() {
  var v0 = [
    {
      "defaultValue": null,
      "kind": "LocalArgument",
      "name": "clusters"
    }
  ], v12 = [
    {
      "alias": null,
      "args": [
        {
          "kind": "Variable",
          "name": "clusters",
          "variableName": "clusters"
        }
      ],
      "concreteType": "ExportedFile",
      "kind": "LinkedField",
      "name": "exportClusters",
      "plural": false,
      "selections": [
        {
          "alias": null,
          "args": null,
          "kind": "ScalarField",
          "name": "fileName",
          "storageKey": null
        }
      ],
      "storageKey": null
    }
  ];
  return {
    "fragment": {
      "argumentDefinitions": v0,
      "kind": "Fragment",
      "metadata": null,
      "name": "EmbeddingActionMenuExportClustersMutation",
      "selections": v12,
      "type": "Mutation",
      "abstractKey": null
    },
    "kind": "Request",
    "operation": {
      "argumentDefinitions": v0,
      "kind": "Operation",
      "name": "EmbeddingActionMenuExportClustersMutation",
      "selections": v12
    },
    "params": {
      "cacheID": "1bef6586fcb3d6eb7034204fbe49633c",
      "id": null,
      "metadata": {},
      "name": "EmbeddingActionMenuExportClustersMutation",
      "operationKind": "mutation",
      "text": "mutation EmbeddingActionMenuExportClustersMutation(\n  $clusters: [ClusterInput!]!\n) {\n  exportClusters(clusters: $clusters) {\n    fileName\n  }\n}\n"
    }
  };
}();
node32.hash = "b5ff2517dbb0d19a1b24dea1796a3576";
var EmbeddingActionMenuExportClustersMutation_graphql_default = node32;

// src/pages/embedding/EmbeddingActionMenu.tsx
var import_react_relay15 = __toESM(require_react_relay());
function EmbeddingActionMenu() {
  const clusters = usePointCloudContext((state) => state.clusters);
  const { notifyError, notifySuccess } = useGlobalNotification();
  const [commitExportCluster, isExportInFlight] = (0, import_react_relay15.useMutation)(EmbeddingActionMenuExportClustersMutation_graphql_default);
  return /* @__PURE__ */ jsx5(
    _ActionMenu,
    {
      align: "end",
      buttonSize: "compact",
      icon: isExportInFlight ? /* @__PURE__ */ jsx5(Icon, { svg: /* @__PURE__ */ jsx5(Icons.LoadingOutline, {}) }) : null,
      onAction: (action) => {
        switch (action) {
          case "export_cluster":
            commitExportCluster({
              variables: {
                clusters: clusters.map((cluster) => ({
                  eventIds: cluster.eventIds,
                  id: cluster.id
                }))
              },
              onCompleted: (data) => {
                const { fileName } = data.exportClusters;
                notifySuccess({
                  title: "Clusters Exported",
                  message: `dataframe is available via px.active_session().exports or can be downloaded by clicking below`,
                  action: {
                    text: "Download",
                    onClick: () => {
                      window.open(`/exports?filename=${fileName}`, "_self");
                    }
                  }
                });
              },
              onError: (error) => {
                notifyError({
                  title: "Failed to export clusters",
                  message: `Failed to export clusters: ${error.message}`
                });
              }
            });
            break;
        }
      },
      children: /* @__PURE__ */ jsxs2($c1d7fb2ec91bae71$export$6d08773d2e66f8f2, { children: [
        /* @__PURE__ */ jsx5(Icon, { svg: /* @__PURE__ */ jsx5(Icons.Download, {}) }),
        "Export clusters"
      ] }, "export_cluster")
    }
  );
}

// src/pages/embedding/__generated__/MetricSelector_dimensions.graphql.ts
var node33 = {
  "argumentDefinitions": [],
  "kind": "Fragment",
  "metadata": null,
  "name": "MetricSelector_dimensions",
  "selections": [
    {
      "alias": "numericDimensions",
      "args": [
        {
          "kind": "Literal",
          "name": "include",
          "value": {
            "dataTypes": [
              "numeric"
            ]
          }
        }
      ],
      "concreteType": "DimensionConnection",
      "kind": "LinkedField",
      "name": "dimensions",
      "plural": false,
      "selections": [
        {
          "alias": null,
          "args": null,
          "concreteType": "DimensionEdge",
          "kind": "LinkedField",
          "name": "edges",
          "plural": true,
          "selections": [
            {
              "alias": null,
              "args": null,
              "concreteType": "Dimension",
              "kind": "LinkedField",
              "name": "node",
              "plural": false,
              "selections": [
                {
                  "alias": null,
                  "args": null,
                  "kind": "ScalarField",
                  "name": "id",
                  "storageKey": null
                },
                {
                  "alias": null,
                  "args": null,
                  "kind": "ScalarField",
                  "name": "name",
                  "storageKey": null
                },
                {
                  "alias": null,
                  "args": null,
                  "kind": "ScalarField",
                  "name": "type",
                  "storageKey": null
                }
              ],
              "storageKey": null
            }
          ],
          "storageKey": null
        }
      ],
      "storageKey": 'dimensions(include:{"dataTypes":["numeric"]})'
    }
  ],
  "type": "Model",
  "abstractKey": null
};
node33.hash = "55d03de16503d7af254c17cef7d18ee0";
var MetricSelector_dimensions_graphql_default = node33;

// src/pages/embedding/MetricSelector.tsx
var import_react168 = __toESM(require_react());
var import_react_relay16 = __toESM(require_react_relay());
var METRIC_KEY_SEPARATOR = ":";
function isMetricType(maybeType) {
  return ["drift", "performance", "dataQuality", "retrieval"].includes(
    maybeType
  );
}
function getMetricKey(metric) {
  const { type, metric: metricName } = metric;
  switch (type) {
    case "drift":
      return `${type}${METRIC_KEY_SEPARATOR}${metricName}`;
    case "retrieval":
      return `${type}${METRIC_KEY_SEPARATOR}${metricName}`;
    case "performance":
      return `${type}${METRIC_KEY_SEPARATOR}${metricName}`;
    case "dataQuality": {
      const { name: name2 } = metric.dimension;
      return `${type}${METRIC_KEY_SEPARATOR}${metricName}${METRIC_KEY_SEPARATOR}${name2}`;
    }
    default:
      assertUnreachable2(type);
  }
}
function parseMetricKey({
  metricKey,
  dimensions
}) {
  const [type, metricName, dimensionName] = metricKey.split(METRIC_KEY_SEPARATOR);
  if (!isMetricType(type)) {
    throw new Error(`Invalid metric type: ${type}`);
  }
  switch (type) {
    case "drift":
      return { type, metric: metricName };
    case "retrieval":
      return {
        type,
        metric: metricName
      };
    case "performance":
      return {
        type,
        metric: metricName
      };
    case "dataQuality": {
      const dimension = dimensions.find((d) => d.name === dimensionName);
      if (!dimension) {
        throw new Error(`Invalid dimension name: ${dimensionName}`);
      }
      return {
        type,
        metric: metricName,
        dimension
      };
    }
    default:
      assertUnreachable2(type);
  }
}
var contextualHelp3 = /* @__PURE__ */ jsxs2(_ContextualHelp, { variant: "info", children: [
  /* @__PURE__ */ jsx5(_Heading, { level: 4, children: "Analysis Metric" }),
  /* @__PURE__ */ jsxs2(_Content, { children: [
    /* @__PURE__ */ jsx5("p", { children: "Select a metric to drive the analysis of your embeddings." }),
    /* @__PURE__ */ jsx5("p", { children: "To analyze the the drift between your two datasets, select a drift metric and the UI will highlight areas of high drift." }),
    /* @__PURE__ */ jsx5("p", { children: "To analyze the quality of your embeddings, select a dimension data quality metric by which to analyze the point cloud. The UI will highlight areas where the data quality is degrading." })
  ] })
] });
function MetricSelector({
  model
}) {
  const [, startTransition13] = (0, import_react168.useTransition)();
  const data = (0, import_react_relay16.useFragment)(
    MetricSelector_dimensions_graphql_default,
    model
  );
  const { referenceDataset, corpusDataset } = useDatasets();
  const hasReferenceDataset = !!referenceDataset;
  const hasCorpusDataset = !!corpusDataset;
  const metric = usePointCloudContext((state) => state.metric);
  const loading2 = usePointCloudContext((state) => state.loading);
  const setMetric = usePointCloudContext((state) => state.setMetric);
  const numericDimensions = data.numericDimensions.edges.map(
    (edge) => edge.node
  );
  const hasNumericDimensions = numericDimensions.length > 0;
  const onSelectionChange = (0, import_react168.useCallback)(
    (key) => {
      const metricDefinition = parseMetricKey({
        metricKey: key,
        dimensions: numericDimensions
      });
      startTransition13(() => {
        setMetric(metricDefinition);
      });
    },
    [setMetric, numericDimensions, startTransition13]
  );
  return /* @__PURE__ */ jsxs2(
    _Picker,
    {
      label: "metric",
      labelExtra: contextualHelp3,
      selectedKey: metric ? getMetricKey(metric) : void 0,
      onSelectionChange,
      placeholder: "Select a metric...",
      isDisabled: loading2,
      children: [
        hasReferenceDataset ? /* @__PURE__ */ jsx5($9fc4852771d079eb$export$6e2c8f0811a474ce, { title: "Drift", children: /* @__PURE__ */ jsx5(
          $c1d7fb2ec91bae71$export$6d08773d2e66f8f2,
          {
            children: "Euclidean Distance"
          },
          getMetricKey({
            type: "drift",
            metric: "euclideanDistance"
          })
        ) }) : null,
        hasCorpusDataset ? /* @__PURE__ */ jsx5($9fc4852771d079eb$export$6e2c8f0811a474ce, { title: "Retrieval", children: /* @__PURE__ */ jsx5(
          $c1d7fb2ec91bae71$export$6d08773d2e66f8f2,
          {
            children: "Query Distance"
          },
          getMetricKey({
            type: "retrieval",
            metric: "queryDistance"
          })
        ) }) : null,
        /* @__PURE__ */ jsx5($9fc4852771d079eb$export$6e2c8f0811a474ce, { title: "Performance", children: /* @__PURE__ */ jsx5(
          $c1d7fb2ec91bae71$export$6d08773d2e66f8f2,
          {
            children: "Accuracy Score"
          },
          getMetricKey({
            type: "performance",
            metric: "accuracyScore"
          })
        ) }),
        hasNumericDimensions ? /* @__PURE__ */ jsx5($9fc4852771d079eb$export$6e2c8f0811a474ce, { title: "Data Quality", children: numericDimensions.map((dimension) => {
          return /* @__PURE__ */ jsx5(
            $c1d7fb2ec91bae71$export$6d08773d2e66f8f2,
            {
              children: `${dimension.name} avg`
            },
            getMetricKey({
              type: "dataQuality",
              metric: "average",
              dimension
            })
          );
        }) }) : null
      ]
    }
  );
}

// src/pages/embedding/__generated__/MetricTimeSeriesQuery.graphql.ts
var node34 = function() {
  var v0 = {
    "defaultValue": null,
    "kind": "LocalArgument",
    "name": "countGranularity"
  }, v12 = {
    "defaultValue": null,
    "kind": "LocalArgument",
    "name": "dimensionId"
  }, v22 = {
    "defaultValue": null,
    "kind": "LocalArgument",
    "name": "embeddingDimensionId"
  }, v32 = {
    "defaultValue": null,
    "kind": "LocalArgument",
    "name": "fetchDataQuality"
  }, v4 = {
    "defaultValue": null,
    "kind": "LocalArgument",
    "name": "fetchDrift"
  }, v5 = {
    "defaultValue": null,
    "kind": "LocalArgument",
    "name": "fetchPerformance"
  }, v6 = {
    "defaultValue": null,
    "kind": "LocalArgument",
    "name": "fetchQueryDistance"
  }, v7 = {
    "defaultValue": null,
    "kind": "LocalArgument",
    "name": "metricGranularity"
  }, v8 = {
    "defaultValue": null,
    "kind": "LocalArgument",
    "name": "performanceMetric"
  }, v9 = {
    "defaultValue": null,
    "kind": "LocalArgument",
    "name": "timeRange"
  }, v10 = [
    {
      "kind": "Variable",
      "name": "id",
      "variableName": "embeddingDimensionId"
    }
  ], v11 = {
    "alias": null,
    "args": null,
    "kind": "ScalarField",
    "name": "id",
    "storageKey": null
  }, v122 = {
    "kind": "Variable",
    "name": "granularity",
    "variableName": "metricGranularity"
  }, v13 = {
    "kind": "Variable",
    "name": "timeRange",
    "variableName": "timeRange"
  }, v14 = [
    v122,
    {
      "kind": "Literal",
      "name": "metric",
      "value": "euclideanDistance"
    },
    v13
  ], v15 = [
    {
      "alias": null,
      "args": null,
      "concreteType": "TimeSeriesDataPoint",
      "kind": "LinkedField",
      "name": "data",
      "plural": true,
      "selections": [
        {
          "alias": null,
          "args": null,
          "kind": "ScalarField",
          "name": "timestamp",
          "storageKey": null
        },
        {
          "alias": null,
          "args": null,
          "kind": "ScalarField",
          "name": "value",
          "storageKey": null
        }
      ],
      "storageKey": null
    }
  ], v16 = {
    "kind": "InlineFragment",
    "selections": [
      {
        "condition": "fetchDrift",
        "kind": "Condition",
        "passingValue": true,
        "selections": [
          {
            "alias": "euclideanDistanceTimeSeries",
            "args": v14,
            "concreteType": "DriftTimeSeries",
            "kind": "LinkedField",
            "name": "driftTimeSeries",
            "plural": false,
            "selections": v15,
            "storageKey": null
          }
        ]
      },
      {
        "condition": "fetchQueryDistance",
        "kind": "Condition",
        "passingValue": true,
        "selections": [
          {
            "alias": null,
            "args": v14,
            "concreteType": "DriftTimeSeries",
            "kind": "LinkedField",
            "name": "retrievalMetricTimeSeries",
            "plural": false,
            "selections": v15,
            "storageKey": null
          }
        ]
      },
      {
        "alias": "trafficTimeSeries",
        "args": [
          {
            "kind": "Variable",
            "name": "granularity",
            "variableName": "countGranularity"
          },
          {
            "kind": "Literal",
            "name": "metric",
            "value": "count"
          },
          v13
        ],
        "concreteType": "DataQualityTimeSeries",
        "kind": "LinkedField",
        "name": "dataQualityTimeSeries",
        "plural": false,
        "selections": v15,
        "storageKey": null
      }
    ],
    "type": "EmbeddingDimension",
    "abstractKey": null
  }, v17 = [
    {
      "kind": "Variable",
      "name": "id",
      "variableName": "dimensionId"
    }
  ], v18 = {
    "kind": "InlineFragment",
    "selections": [
      {
        "alias": null,
        "args": null,
        "kind": "ScalarField",
        "name": "name",
        "storageKey": null
      },
      {
        "alias": null,
        "args": [
          v122,
          {
            "kind": "Literal",
            "name": "metric",
            "value": "mean"
          },
          v13
        ],
        "concreteType": "DataQualityTimeSeries",
        "kind": "LinkedField",
        "name": "dataQualityTimeSeries",
        "plural": false,
        "selections": v15,
        "storageKey": null
      }
    ],
    "type": "Dimension",
    "abstractKey": null
  }, v19 = {
    "alias": null,
    "args": null,
    "concreteType": "Model",
    "kind": "LinkedField",
    "name": "model",
    "plural": false,
    "selections": [
      {
        "condition": "fetchPerformance",
        "kind": "Condition",
        "passingValue": true,
        "selections": [
          {
            "alias": null,
            "args": [
              v122,
              {
                "fields": [
                  {
                    "kind": "Variable",
                    "name": "metric",
                    "variableName": "performanceMetric"
                  }
                ],
                "kind": "ObjectValue",
                "name": "metric"
              },
              v13
            ],
            "concreteType": "PerformanceTimeSeries",
            "kind": "LinkedField",
            "name": "performanceTimeSeries",
            "plural": false,
            "selections": v15,
            "storageKey": null
          }
        ]
      }
    ],
    "storageKey": null
  }, v20 = {
    "alias": null,
    "args": null,
    "kind": "ScalarField",
    "name": "__typename",
    "storageKey": null
  };
  return {
    "fragment": {
      "argumentDefinitions": [
        v0,
        v12,
        v22,
        v32,
        v4,
        v5,
        v6,
        v7,
        v8,
        v9
      ],
      "kind": "Fragment",
      "metadata": null,
      "name": "MetricTimeSeriesQuery",
      "selections": [
        {
          "alias": "embedding",
          "args": v10,
          "concreteType": null,
          "kind": "LinkedField",
          "name": "node",
          "plural": false,
          "selections": [
            v11,
            v16
          ],
          "storageKey": null
        },
        {
          "condition": "fetchDataQuality",
          "kind": "Condition",
          "passingValue": true,
          "selections": [
            {
              "alias": "dimension",
              "args": v17,
              "concreteType": null,
              "kind": "LinkedField",
              "name": "node",
              "plural": false,
              "selections": [
                v18
              ],
              "storageKey": null
            }
          ]
        },
        v19
      ],
      "type": "Query",
      "abstractKey": null
    },
    "kind": "Request",
    "operation": {
      "argumentDefinitions": [
        v22,
        v9,
        v7,
        v0,
        v4,
        v6,
        v32,
        v12,
        v5,
        v8
      ],
      "kind": "Operation",
      "name": "MetricTimeSeriesQuery",
      "selections": [
        {
          "alias": "embedding",
          "args": v10,
          "concreteType": null,
          "kind": "LinkedField",
          "name": "node",
          "plural": false,
          "selections": [
            v20,
            v11,
            v16
          ],
          "storageKey": null
        },
        {
          "condition": "fetchDataQuality",
          "kind": "Condition",
          "passingValue": true,
          "selections": [
            {
              "alias": "dimension",
              "args": v17,
              "concreteType": null,
              "kind": "LinkedField",
              "name": "node",
              "plural": false,
              "selections": [
                v20,
                v18,
                {
                  "kind": "TypeDiscriminator",
                  "abstractKey": "__isNode"
                },
                v11
              ],
              "storageKey": null
            }
          ]
        },
        v19
      ]
    },
    "params": {
      "cacheID": "a68a8204bf7fdd13e6915b338d4b5497",
      "id": null,
      "metadata": {},
      "name": "MetricTimeSeriesQuery",
      "operationKind": "query",
      "text": "query MetricTimeSeriesQuery(\n  $embeddingDimensionId: GlobalID!\n  $timeRange: TimeRange!\n  $metricGranularity: Granularity!\n  $countGranularity: Granularity!\n  $fetchDrift: Boolean!\n  $fetchQueryDistance: Boolean!\n  $fetchDataQuality: Boolean!\n  $dimensionId: GlobalID!\n  $fetchPerformance: Boolean!\n  $performanceMetric: PerformanceMetric!\n) {\n  embedding: node(id: $embeddingDimensionId) {\n    __typename\n    id\n    ... on EmbeddingDimension {\n      euclideanDistanceTimeSeries: driftTimeSeries(metric: euclideanDistance, timeRange: $timeRange, granularity: $metricGranularity) @include(if: $fetchDrift) {\n        data {\n          timestamp\n          value\n        }\n      }\n      retrievalMetricTimeSeries(metric: euclideanDistance, timeRange: $timeRange, granularity: $metricGranularity) @include(if: $fetchQueryDistance) {\n        data {\n          timestamp\n          value\n        }\n      }\n      trafficTimeSeries: dataQualityTimeSeries(metric: count, timeRange: $timeRange, granularity: $countGranularity) {\n        data {\n          timestamp\n          value\n        }\n      }\n    }\n  }\n  dimension: node(id: $dimensionId) @include(if: $fetchDataQuality) {\n    __typename\n    ... on Dimension {\n      name\n      dataQualityTimeSeries(metric: mean, timeRange: $timeRange, granularity: $metricGranularity) {\n        data {\n          timestamp\n          value\n        }\n      }\n    }\n    __isNode: __typename\n    id\n  }\n  model {\n    performanceTimeSeries(metric: {metric: $performanceMetric}, timeRange: $timeRange, granularity: $metricGranularity) @include(if: $fetchPerformance) {\n      data {\n        timestamp\n        value\n      }\n    }\n  }\n}\n"
    }
  };
}();
node34.hash = "f31abad2141a5a1c461ef2a598ffa4f3";
var MetricTimeSeriesQuery_graphql_default = node34;

// src/pages/embedding/MetricTimeSeries.tsx
var import_react169 = __toESM(require_react());
var import_react_relay17 = __toESM(require_react_relay());
var numberFormatter3 = new Intl.NumberFormat([], {
  maximumFractionDigits: 2
});
var useColors = () => {
  const colors = useChartColors();
  const color2 = colors.blue400;
  const barColor = colors.gray500;
  return {
    color: color2,
    barColor
  };
};
function TooltipContent({
  active,
  payload,
  label
}) {
  const { color: color2, barColor } = useColors();
  if (active && payload && payload.length) {
    const metricValue = payload[1]?.value ?? null;
    const count2 = payload[0]?.value ?? null;
    const metricString = typeof metricValue === "number" ? numberFormatter3.format(metricValue) : "--";
    const predictionCountString = typeof count2 === "number" ? numberFormatter3.format(count2) : "--";
    return /* @__PURE__ */ jsxs2(ChartTooltip, { children: [
      /* @__PURE__ */ jsx5(_Text, { weight: "heavy", textSize: "medium", children: `${fullTimeFormatter(
        new Date(label)
      )}` }),
      /* @__PURE__ */ jsx5(
        ChartTooltipItem,
        {
          color: color2,
          name: payload[1]?.payload.metricName ?? "Metric",
          value: metricString
        }
      ),
      /* @__PURE__ */ jsx5(
        ChartTooltipItem,
        {
          color: barColor,
          shape: "square",
          name: "Count",
          value: predictionCountString
        }
      ),
      /* @__PURE__ */ jsx5(ChartTooltipDivider, {}),
      /* @__PURE__ */ jsxs2(
        "div",
        {
          css: css`
            display: flex;
            flex-direction: row;
            align-items: center;
            color: var(--ac-global-color-primary);
            gap: var(--px-spacing-sm);

            margin-top: var(--px-spacing-sm);
          `,
          children: [
            /* @__PURE__ */ jsx5(Icon, { svg: /* @__PURE__ */ jsx5(InfoOutline, {}) }),
            /* @__PURE__ */ jsx5("span", { children: "Click to view the point cloud at this time" })
          ]
        }
      )
    ] });
  }
  return null;
}
function getChartTitle(metric) {
  switch (metric.type) {
    case "drift":
      return "Embedding Drift";
    case "performance":
      return "Model Performance";
    case "dataQuality":
      return "Data Quality";
    case "retrieval":
      return "Query Distance";
    default:
      assertUnreachable2(metric);
  }
}
function getMetricShortName(metric) {
  if (!metric) {
    return "Count";
  } else {
    const metricType = metric.type;
    switch (metricType) {
      case "drift":
        return getMetricShortNameByMetricKey(metric.metric);
      case "performance":
        return getMetricShortNameByMetricKey(metric.metric);
      case "dataQuality":
        return `${metric.dimension.name} avg`;
      case "retrieval":
        return getMetricShortNameByMetricKey(metric.metric);
      default:
        assertUnreachable2(metricType);
    }
  }
}
function getMetricDescription(metric) {
  switch (metric.type) {
    case "drift":
      return getMetricDescriptionByMetricKey(metric.metric);
    case "performance":
      return getMetricDescriptionByMetricKey(metric.metric);
    case "dataQuality":
      return null;
    case "retrieval":
      return getMetricDescriptionByMetricKey(metric.metric);
    default:
      assertUnreachable2(metric);
  }
}
function MetricTimeSeries({
  embeddingDimensionId
}) {
  const metric = usePointCloudContext((state) => state.metric);
  const fetchDrift = metric.type === "drift";
  const fetchQueryDistance = metric.type === "retrieval";
  const fetchDataQuality = metric.type === "dataQuality";
  const fetchPerformance = metric.type === "performance";
  const { timeRange } = useTimeRange();
  const { selectedTimestamp, setSelectedTimestamp } = useTimeSlice();
  const granularity = calculateGranularity(timeRange);
  const data = (0, import_react_relay17.useLazyLoadQuery)(
    MetricTimeSeriesQuery_graphql_default,
    {
      embeddingDimensionId,
      timeRange: {
        start: timeRange.start.toISOString(),
        end: timeRange.end.toISOString()
      },
      metricGranularity: calculateGranularityWithRollingAverage(timeRange),
      countGranularity: granularity,
      fetchDrift,
      fetchQueryDistance,
      fetchDataQuality,
      fetchPerformance,
      dimensionId: metric.type === "dataQuality" ? metric.dimension.id : embeddingDimensionId,
      // NEED to provide a placeholder id. This is super hacky but it works for now
      performanceMetric: metric.type === "performance" ? metric.metric : "accuracyScore"
      // Need a placeholder metric
    }
  );
  const timeTickFormatter = useTimeTickFormatter({
    samplingIntervalMinutes: granularity.samplingIntervalMinutes
  });
  const onClick = (0, import_react169.useCallback)(
    (state) => {
      const { activePayload } = state;
      if (activePayload != null && activePayload.length > 0) {
        const payload = activePayload[0].payload;
        setSelectedTimestamp(new Date(payload.timestamp));
      }
    },
    [setSelectedTimestamp]
  );
  const chartPrimaryRawData = getChartPrimaryData({ data, metric });
  const chartSecondaryRawData = getTrafficData(data);
  const trafficDataMap = chartSecondaryRawData.reduce((acc, traffic) => {
    acc[traffic.timestamp] = traffic.value;
    return acc;
  }, {}) ?? {};
  const chartData = chartPrimaryRawData.map((d) => {
    const traffic = trafficDataMap[d.timestamp];
    return {
      ...d,
      traffic,
      timestamp: new Date(d.timestamp).getTime()
    };
  });
  const metricShortName = getMetricShortName(metric);
  const metricDescription = getMetricDescription(metric);
  const { color: color2, barColor } = useColors();
  return /* @__PURE__ */ jsxs2(
    "section",
    {
      css: css`
        width: 100%;
        height: 100%;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        h3 {
          padding: var(--px-spacing-sm) var(--px-spacing-lg) 0
            var(--px-spacing-lg);
          flex: none;
          display: flex;
          flex-direction: row;
          align-items: center;
          gap: var(--px-spacing-sm);
        }
        & > div {
          flex: 1 1 auto;
          width: 100%;
          overflow: hidden;
        }
      `,
      children: [
        /* @__PURE__ */ jsxs2(_Heading, { level: 3, children: [
          getChartTitle(metric),
          metricDescription != null ? /* @__PURE__ */ jsxs2(_ContextualHelp, { children: [
            /* @__PURE__ */ jsx5(_Heading, { level: 4, children: metricShortName }),
            /* @__PURE__ */ jsx5(_Content, { children: metricDescription })
          ] }) : null
        ] }),
        /* @__PURE__ */ jsx5("div", { children: /* @__PURE__ */ jsx5(ResponsiveContainer, { width: "100%", height: "100%", children: /* @__PURE__ */ jsxs2(
          ComposedChart,
          {
            data: chartData,
            margin: { top: 25, right: 18, left: 18, bottom: 10 },
            onClick,
            children: [
              /* @__PURE__ */ jsxs2("defs", { children: [
                /* @__PURE__ */ jsxs2("linearGradient", { id: "colorUv", x1: "0", y1: "0", x2: "0", y2: "1", children: [
                  /* @__PURE__ */ jsx5("stop", { offset: "5%", stopColor: color2, stopOpacity: 0.8 }),
                  /* @__PURE__ */ jsx5("stop", { offset: "95%", stopColor: color2, stopOpacity: 0 })
                ] }),
                /* @__PURE__ */ jsxs2("linearGradient", { id: "barColor", x1: "0", y1: "0", x2: "0", y2: "1", children: [
                  /* @__PURE__ */ jsx5("stop", { offset: "5%", stopColor: barColor, stopOpacity: 0.3 }),
                  /* @__PURE__ */ jsx5("stop", { offset: "95%", stopColor: barColor, stopOpacity: 0 })
                ] })
              ] }),
              /* @__PURE__ */ jsx5(
                XAxis,
                {
                  ...defaultTimeXAxisProps,
                  tickFormatter: (x2) => timeTickFormatter(new Date(x2)),
                  style: { fill: "var(--ac-global-text-color-700)" }
                }
              ),
              /* @__PURE__ */ jsx5(
                YAxis,
                {
                  stroke: theme.colors.gray200,
                  label: {
                    value: metricShortName,
                    angle: -90,
                    position: "insideLeft",
                    style: {
                      textAnchor: "middle",
                      fill: "var(--ac-global-text-color-900)"
                    }
                  },
                  style: { fill: "var(--ac-global-text-color-700)" }
                }
              ),
              /* @__PURE__ */ jsx5(
                YAxis,
                {
                  yAxisId: "right",
                  orientation: "right",
                  label: {
                    value: "Count",
                    angle: 90,
                    position: "insideRight",
                    style: {
                      textAnchor: "middle",
                      fill: "var(--ac-global-text-color-900)"
                    }
                  },
                  style: { fill: "var(--ac-global-text-color-700)" }
                }
              ),
              /* @__PURE__ */ jsx5(
                CartesianGrid,
                {
                  strokeDasharray: "4 4",
                  stroke: theme.colors.gray200,
                  strokeOpacity: 0.5
                }
              ),
              /* @__PURE__ */ jsx5(Tooltip2, { content: /* @__PURE__ */ jsx5(TooltipContent, {}) }),
              /* @__PURE__ */ jsx5(
                Bar,
                {
                  yAxisId: "right",
                  dataKey: "traffic",
                  fill: "url(#barColor)",
                  spacing: 5
                }
              ),
              /* @__PURE__ */ jsx5(
                Area,
                {
                  type: "monotone",
                  dataKey: "value",
                  stroke: color2,
                  fillOpacity: 1,
                  fill: "url(#colorUv)"
                }
              ),
              selectedTimestamp != null ? /* @__PURE__ */ jsx5(
                ReferenceLine,
                {
                  ...defaultSelectedTimestampReferenceLineProps,
                  x: selectedTimestamp.getTime()
                }
              ) : null
            ]
          }
        ) }) })
      ]
    }
  );
}
function getChartPrimaryData({
  data,
  metric
}) {
  if (data.embedding.euclideanDistanceTimeSeries?.data != null && data.embedding.euclideanDistanceTimeSeries.data.length > 0) {
    return data.embedding.euclideanDistanceTimeSeries.data.map((d) => ({
      metricName: getMetricShortNameByMetricKey(metric.metric),
      ...d
    }));
  }
  if (data.embedding.retrievalMetricTimeSeries?.data != null && data.embedding.retrievalMetricTimeSeries.data.length > 0) {
    return data.embedding.retrievalMetricTimeSeries.data.map((d) => ({
      metricName: getMetricShortNameByMetricKey(metric.metric),
      ...d
    }));
  } else if (data.dimension && data.dimension?.dataQualityTimeSeries?.data != null && data.dimension.dataQualityTimeSeries.data.length > 0) {
    const dimensionName = data.dimension.name || "unknown";
    return data.dimension.dataQualityTimeSeries.data.map((d) => ({
      metricName: `${dimensionName} avg`,
      ...d
    }));
  } else if (data.model && data.model.performanceTimeSeries?.data != null && data.model.performanceTimeSeries.data.length > 0) {
    return data.model.performanceTimeSeries.data.map((d) => ({
      metricName: getMetricShortNameByMetricKey(metric.metric),
      ...d
    }));
  } else if (data.embedding.trafficTimeSeries?.data != null) {
    return data.embedding.trafficTimeSeries.data.map((d) => ({
      metricName: "Count",
      ...d
    }));
  }
  return [];
}
function getTrafficData(data) {
  if (data.embedding.trafficTimeSeries?.data != null) {
    return [...data.embedding.trafficTimeSeries.data];
  }
  return [];
}

// src/pages/embedding/__generated__/PointSelectionPanelContentQuery.graphql.ts
var node35 = function() {
  var v0 = {
    "defaultValue": null,
    "kind": "LocalArgument",
    "name": "corpusEventIds"
  }, v12 = {
    "defaultValue": null,
    "kind": "LocalArgument",
    "name": "primaryEventIds"
  }, v22 = {
    "defaultValue": null,
    "kind": "LocalArgument",
    "name": "referenceEventIds"
  }, v32 = [
    {
      "alias": null,
      "args": null,
      "kind": "ScalarField",
      "name": "id",
      "storageKey": null
    },
    {
      "alias": null,
      "args": null,
      "concreteType": "DimensionWithValue",
      "kind": "LinkedField",
      "name": "dimensions",
      "plural": true,
      "selections": [
        {
          "alias": null,
          "args": null,
          "concreteType": "Dimension",
          "kind": "LinkedField",
          "name": "dimension",
          "plural": false,
          "selections": [
            {
              "alias": null,
              "args": null,
              "kind": "ScalarField",
              "name": "name",
              "storageKey": null
            },
            {
              "alias": null,
              "args": null,
              "kind": "ScalarField",
              "name": "type",
              "storageKey": null
            }
          ],
          "storageKey": null
        },
        {
          "alias": null,
          "args": null,
          "kind": "ScalarField",
          "name": "value",
          "storageKey": null
        }
      ],
      "storageKey": null
    },
    {
      "alias": null,
      "args": null,
      "concreteType": "EventMetadata",
      "kind": "LinkedField",
      "name": "eventMetadata",
      "plural": false,
      "selections": [
        {
          "alias": null,
          "args": null,
          "kind": "ScalarField",
          "name": "predictionId",
          "storageKey": null
        },
        {
          "alias": null,
          "args": null,
          "kind": "ScalarField",
          "name": "predictionLabel",
          "storageKey": null
        },
        {
          "alias": null,
          "args": null,
          "kind": "ScalarField",
          "name": "predictionScore",
          "storageKey": null
        },
        {
          "alias": null,
          "args": null,
          "kind": "ScalarField",
          "name": "actualLabel",
          "storageKey": null
        },
        {
          "alias": null,
          "args": null,
          "kind": "ScalarField",
          "name": "actualScore",
          "storageKey": null
        }
      ],
      "storageKey": null
    },
    {
      "alias": null,
      "args": null,
      "concreteType": "PromptResponse",
      "kind": "LinkedField",
      "name": "promptAndResponse",
      "plural": false,
      "selections": [
        {
          "alias": null,
          "args": null,
          "kind": "ScalarField",
          "name": "prompt",
          "storageKey": null
        },
        {
          "alias": null,
          "args": null,
          "kind": "ScalarField",
          "name": "response",
          "storageKey": null
        }
      ],
      "storageKey": null
    },
    {
      "alias": null,
      "args": null,
      "kind": "ScalarField",
      "name": "documentText",
      "storageKey": null
    }
  ], v4 = [
    {
      "alias": null,
      "args": null,
      "concreteType": "Model",
      "kind": "LinkedField",
      "name": "model",
      "plural": false,
      "selections": [
        {
          "alias": null,
          "args": null,
          "concreteType": "Dataset",
          "kind": "LinkedField",
          "name": "primaryDataset",
          "plural": false,
          "selections": [
            {
              "alias": null,
              "args": [
                {
                  "kind": "Variable",
                  "name": "eventIds",
                  "variableName": "primaryEventIds"
                }
              ],
              "concreteType": "Event",
              "kind": "LinkedField",
              "name": "events",
              "plural": true,
              "selections": v32,
              "storageKey": null
            }
          ],
          "storageKey": null
        },
        {
          "alias": null,
          "args": null,
          "concreteType": "Dataset",
          "kind": "LinkedField",
          "name": "referenceDataset",
          "plural": false,
          "selections": [
            {
              "alias": null,
              "args": [
                {
                  "kind": "Variable",
                  "name": "eventIds",
                  "variableName": "referenceEventIds"
                }
              ],
              "concreteType": "Event",
              "kind": "LinkedField",
              "name": "events",
              "plural": true,
              "selections": v32,
              "storageKey": null
            }
          ],
          "storageKey": null
        },
        {
          "alias": null,
          "args": null,
          "concreteType": "Dataset",
          "kind": "LinkedField",
          "name": "corpusDataset",
          "plural": false,
          "selections": [
            {
              "alias": null,
              "args": [
                {
                  "kind": "Variable",
                  "name": "eventIds",
                  "variableName": "corpusEventIds"
                }
              ],
              "concreteType": "Event",
              "kind": "LinkedField",
              "name": "events",
              "plural": true,
              "selections": v32,
              "storageKey": null
            }
          ],
          "storageKey": null
        }
      ],
      "storageKey": null
    }
  ];
  return {
    "fragment": {
      "argumentDefinitions": [
        v0,
        v12,
        v22
      ],
      "kind": "Fragment",
      "metadata": null,
      "name": "PointSelectionPanelContentQuery",
      "selections": v4,
      "type": "Query",
      "abstractKey": null
    },
    "kind": "Request",
    "operation": {
      "argumentDefinitions": [
        v12,
        v22,
        v0
      ],
      "kind": "Operation",
      "name": "PointSelectionPanelContentQuery",
      "selections": v4
    },
    "params": {
      "cacheID": "a1ce797d7fc303bb85730466d1a14bdd",
      "id": null,
      "metadata": {},
      "name": "PointSelectionPanelContentQuery",
      "operationKind": "query",
      "text": "query PointSelectionPanelContentQuery(\n  $primaryEventIds: [ID!]!\n  $referenceEventIds: [ID!]!\n  $corpusEventIds: [ID!]!\n) {\n  model {\n    primaryDataset {\n      events(eventIds: $primaryEventIds) {\n        id\n        dimensions {\n          dimension {\n            name\n            type\n          }\n          value\n        }\n        eventMetadata {\n          predictionId\n          predictionLabel\n          predictionScore\n          actualLabel\n          actualScore\n        }\n        promptAndResponse {\n          prompt\n          response\n        }\n        documentText\n      }\n    }\n    referenceDataset {\n      events(eventIds: $referenceEventIds) {\n        id\n        dimensions {\n          dimension {\n            name\n            type\n          }\n          value\n        }\n        eventMetadata {\n          predictionId\n          predictionLabel\n          predictionScore\n          actualLabel\n          actualScore\n        }\n        promptAndResponse {\n          prompt\n          response\n        }\n        documentText\n      }\n    }\n    corpusDataset {\n      events(eventIds: $corpusEventIds) {\n        id\n        dimensions {\n          dimension {\n            name\n            type\n          }\n          value\n        }\n        eventMetadata {\n          predictionId\n          predictionLabel\n          predictionScore\n          actualLabel\n          actualScore\n        }\n        promptAndResponse {\n          prompt\n          response\n        }\n        documentText\n      }\n    }\n  }\n}\n"
    }
  };
}();
node35.hash = "6238f84e3d942c6c9af51ea7180b7608";
var PointSelectionPanelContentQuery_graphql_default = node35;

// src/pages/embedding/PointSelectionPanelContent.tsx
var import_react178 = __toESM(require_react());
var import_react_relay19 = __toESM(require_react_relay());

// src/components/pointcloud/SelectionGridSizeRadioGroup.tsx
function isSelectionGridSize(m) {
  return typeof m === "string" && m in SelectionGridSize;
}
function SelectionGridSizeRadioGroup(props) {
  return /* @__PURE__ */ jsxs2(
    RadioGroup,
    {
      defaultValue: props.size,
      variant: "inline-button",
      size: "compact",
      onChange: (v4) => {
        if (isSelectionGridSize(v4)) {
          props.onChange(v4);
        } else {
          throw new Error(`Unknown grid size: ${v4}`);
        }
      },
      children: [
        /* @__PURE__ */ jsx5(Radio, { label: "Small", value: "small" /* small */, children: "S" }),
        /* @__PURE__ */ jsx5(Radio, { label: "Medium", value: "medium" /* medium */, children: "M" }),
        /* @__PURE__ */ jsx5(Radio, { label: "Large", value: "large" /* large */, children: "L" })
      ]
    }
  );
}

// src/pages/embedding/EventDetails.tsx
var import_react172 = __toESM(require_react());

// src/components/Empty.tsx
function Empty(props) {
  const { message, ...graphicsProps } = props;
  return /* @__PURE__ */ jsx5(
    "div",
    {
      css: css`
        width: 100%;
        display: flex;
        justify-content: center;
      `,
      children: /* @__PURE__ */ jsxs2(
        "div",
        {
          css: (theme3) => css`
          margin: ${theme3.spacing.margin24}px;
          display: flex;
          flex-direction: column;
          align-items: center;
        `,
          children: [
            /* @__PURE__ */ jsx5(EmptyGraphic, { ...graphicsProps }),
            message && /* @__PURE__ */ jsx5(_Text, { children: message })
          ]
        }
      )
    }
  );
}

// src/pages/embedding/EventDetails.tsx
var detailsListCSS = css`
  margin: var(--px-spacing-lg);
  display: flex;
  flex-direction: column;
  gap: var(--px-spacing-med);
  & > div {
    display: flex;
    flex-direction: row;
    dt {
      font-weight: bold;
      flex: none;
      width: 130px;
    }
    dd {
      flex: 1 1 auto;
      margin-inline-start: 0;
    }
  }
`;
function TextPre(props) {
  return /* @__PURE__ */ jsx5(
    "div",
    {
      css: css`
        max-height: 200px;
        overflow-y: auto;
      `,
      children: /* @__PURE__ */ jsx5(
        "pre",
        {
          css: css`
          padding: var(--px-spacing-lg);
          color: var(--ac-global-text-color-900);
          white-space: normal;
          margin: 0;
        `,
          children: props.children
        }
      )
    }
  );
}
function EventDetails({ event }) {
  const hasRetrievals = event.retrievedDocuments && event.retrievedDocuments.length > 0;
  const isPredictionRecord = !event.id.includes("CORPUS");
  return /* @__PURE__ */ jsxs2(
    "section",
    {
      css: css`
        height: 100%;
        overflow-y: auto;
      `,
      children: [
        /* @__PURE__ */ jsx5(EventPreview2, { event }),
        /* @__PURE__ */ jsxs2(Accordion, { children: [
          isPredictionRecord ? /* @__PURE__ */ jsx5(AccordionItem, { id: "prediction", title: "Prediction Details", children: /* @__PURE__ */ jsxs2("dl", { css: detailsListCSS, children: [
            event.predictionId != null && /* @__PURE__ */ jsxs2("div", { children: [
              /* @__PURE__ */ jsx5("dt", { children: "Prediction ID" }),
              /* @__PURE__ */ jsx5(
                "dd",
                {
                  css: css`
                      display: flex;
                      align-items: center;
                    `,
                  children: event.predictionId
                }
              )
            ] }),
            event.predictionLabel != null && /* @__PURE__ */ jsxs2("div", { children: [
              /* @__PURE__ */ jsx5("dt", { children: "Prediction Label" }),
              /* @__PURE__ */ jsx5("dd", { children: event.predictionLabel })
            ] }),
            event.predictionScore != null && /* @__PURE__ */ jsxs2("div", { children: [
              /* @__PURE__ */ jsx5("dt", { children: "Prediction Score" }),
              /* @__PURE__ */ jsx5("dd", { children: event.predictionScore })
            ] }),
            event.actualLabel != null && /* @__PURE__ */ jsxs2("div", { children: [
              /* @__PURE__ */ jsx5("dt", { children: "Actual Label" }),
              /* @__PURE__ */ jsx5("dd", { children: event.actualLabel })
            ] }),
            event.actualScore != null && /* @__PURE__ */ jsxs2("div", { children: [
              /* @__PURE__ */ jsx5("dt", { children: "Actual Score" }),
              /* @__PURE__ */ jsx5("dd", { children: event.actualScore })
            ] })
          ] }) }) : /* @__PURE__ */ jsx5(AccordionItem, { id: "document", title: "Document Details", children: /* @__PURE__ */ jsx5("dl", { css: detailsListCSS, children: event.predictionId != null && /* @__PURE__ */ jsxs2("div", { children: [
            /* @__PURE__ */ jsx5("dt", { children: "Document ID" }),
            /* @__PURE__ */ jsx5(
              "dd",
              {
                css: css`
                      display: flex;
                      align-items: center;
                    `,
                children: event.predictionId
              }
            )
          ] }) }) }),
          /* @__PURE__ */ jsx5(AccordionItem, { id: "dimensions", title: "Dimensions", children: /* @__PURE__ */ jsx5(EmbeddingDimensionsTable, { dimensions: event.dimensions }) }),
          hasRetrievals && /* @__PURE__ */ jsx5(
            AccordionItem,
            {
              id: "retrievals",
              title: "Retrieved Documents",
              titleExtra: /* @__PURE__ */ jsx5(Counter, { variant: "light", children: event.retrievedDocuments.length }),
              children: /* @__PURE__ */ jsx5(
                "ul",
                {
                  css: css`
                padding: var(--px-spacing-med);
                li + li {
                  margin-top: var(--px-spacing-med);
                }
              `,
                  children: event.retrievedDocuments.map((document2) => {
                    return /* @__PURE__ */ jsx5("li", { children: /* @__PURE__ */ jsx5(DocumentItem, { document: document2 }) }, document2.id);
                  })
                }
              )
            }
          )
        ] })
      ]
    }
  );
}
function DocumentItem({ document: document2 }) {
  return /* @__PURE__ */ jsx5(_View, { borderRadius: "medium", backgroundColor: "light", children: /* @__PURE__ */ jsxs2(_Flex, { direction: "column", children: [
    /* @__PURE__ */ jsx5(_View, { width: "100%", borderBottomWidth: "thin", borderBottomColor: "dark", children: /* @__PURE__ */ jsxs2(
      _Flex,
      {
        direction: "row",
        justifyContent: "space-between",
        margin: "size-100",
        alignItems: "center",
        children: [
          /* @__PURE__ */ jsxs2(_Flex, { direction: "row", gap: "size-50", alignItems: "center", children: [
            /* @__PURE__ */ jsx5(Icon, { svg: /* @__PURE__ */ jsx5(Icons.FileOutline, {}) }),
            /* @__PURE__ */ jsxs2(_Heading, { level: 4, children: [
              "document ",
              document2.id
            ] })
          ] }),
          typeof document2.relevance === "number" && /* @__PURE__ */ jsx5(Label, { color: "blue", children: `relevance ${numberFormatter2(
            document2.relevance
          )}` })
        ]
      }
    ) }),
    /* @__PURE__ */ jsx5(
      "pre",
      {
        css: css`
            padding: var(--px-spacing-lg);
            white-space: normal;
            margin: 0;
          `,
        children: document2.text
      }
    )
  ] }) });
}
function EmbeddingDimensionsTable({
  dimensions
}) {
  const data = (0, import_react172.useMemo)(() => {
    return dimensions.map((dimension) => {
      return {
        name: dimension.dimension.name,
        type: dimension.dimension.type,
        value: dimension.value ?? "--"
      };
    });
  }, [dimensions]);
  const columns2 = (0, import_react172.useMemo)(
    () => [
      {
        header: () => "Name",
        accessorKey: "name"
      },
      {
        header: () => "Type",
        accessorKey: "type"
      },
      {
        header: () => "Value",
        accessorKey: "value"
      }
    ],
    []
  );
  const table = useReactTable({
    columns: columns2,
    data,
    getCoreRowModel: getCoreRowModel()
  });
  return /* @__PURE__ */ jsxs2("table", { css: tableCSS, children: [
    /* @__PURE__ */ jsx5("thead", { children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx5("tr", { children: headerGroup.headers.map((header) => {
      return /* @__PURE__ */ jsx5("th", { colSpan: header.colSpan, children: header.isPlaceholder ? null : /* @__PURE__ */ jsx5("div", { children: flexRender(
        header.column.columnDef.header,
        header.getContext()
      ) }) }, header.id);
    }) }, headerGroup.id)) }),
    table.getCoreRowModel().rows.length ? /* @__PURE__ */ jsx5("tbody", { children: table.getRowModel().rows.map((row) => {
      return /* @__PURE__ */ jsx5("tr", { children: row.getVisibleCells().map((cell) => {
        return /* @__PURE__ */ jsx5("td", { children: flexRender(
          cell.column.columnDef.cell,
          cell.getContext()
        ) }, cell.id);
      }) }, row.id);
    }) }) : /* @__PURE__ */ jsx5(TableEmpty2, {})
  ] });
}
function DataURLPreview({ dataUrl }) {
  const isVideo = isVideoUrl(dataUrl);
  const isAudio = isAudioUrl(dataUrl);
  if (isVideo) {
    return /* @__PURE__ */ jsx5(
      "video",
      {
        src: dataUrl,
        controls: true,
        css: css`
          width: 100%;
          height: 500px;
          background-color: black;
        `
      }
    );
  }
  if (isAudio) {
    return /* @__PURE__ */ jsx5("audio", { src: dataUrl, controls: true, autoPlay: true });
  }
  return /* @__PURE__ */ jsx5(
    "img",
    {
      src: dataUrl,
      alt: "event image",
      width: "100%",
      height: "200px",
      css: css`
        object-fit: contain;
        background-color: black;
      `
    }
  );
}
function EventPreview2({ event }) {
  const dataUrl = event.linkToData || void 0;
  const rawData = event.rawData;
  const promptAndResponse = event.prompt || event.response ? { prompt: event.prompt, response: event.response } : null;
  const documentText = event.documentText;
  let content2 = null;
  if (dataUrl) {
    content2 = /* @__PURE__ */ jsxs2(_Flex, { direction: "column", children: [
      /* @__PURE__ */ jsx5(DataURLPreview, { dataUrl }),
      rawData && /* @__PURE__ */ jsx5(Accordion, { children: /* @__PURE__ */ jsx5(AccordionItem, { id: "raw", title: "Raw Data", children: /* @__PURE__ */ jsx5(TextPre, { children: rawData }) }) })
    ] });
  } else if (documentText) {
    content2 = /* @__PURE__ */ jsx5(Accordion, { children: /* @__PURE__ */ jsx5(AccordionItem, { id: "document", title: "Document", children: /* @__PURE__ */ jsx5(TextPre, { children: documentText }) }) });
  } else if (promptAndResponse) {
    content2 = /* @__PURE__ */ jsxs2(Accordion, { children: [
      /* @__PURE__ */ jsx5(AccordionItem, { id: "prompt", title: "Prompt", children: /* @__PURE__ */ jsx5(TextPre, { children: promptAndResponse.prompt }) }),
      /* @__PURE__ */ jsx5(AccordionItem, { id: "response", title: "Response", children: /* @__PURE__ */ jsx5(TextPre, { children: promptAndResponse.response }) })
    ] });
  } else if (event.rawData) {
    {
      event.rawData ? /* @__PURE__ */ jsx5(TextPre, { children: event.rawData }) : null;
    }
  }
  return content2;
}
function TableEmpty2() {
  return /* @__PURE__ */ jsx5("tbody", { className: "is-empty", children: /* @__PURE__ */ jsx5("tr", { children: /* @__PURE__ */ jsx5(
    "td",
    {
      colSpan: 100,
      css: (theme3) => css`
            text-align: center;
            padding: ${theme3.spacing.margin24}px ${theme3.spacing.margin24}px !important;
          `,
      children: /* @__PURE__ */ jsx5(
        Empty,
        {
          graphicKey: "documents",
          message: "This embedding has no associated dimensions"
        }
      )
    }
  ) }) });
}

// src/pages/embedding/__generated__/ExportSelectionButtonMutation.graphql.ts
var node36 = function() {
  var v0 = [
    {
      "defaultValue": null,
      "kind": "LocalArgument",
      "name": "eventIds"
    }
  ], v12 = [
    {
      "alias": null,
      "args": [
        {
          "kind": "Variable",
          "name": "eventIds",
          "variableName": "eventIds"
        }
      ],
      "concreteType": "ExportedFile",
      "kind": "LinkedField",
      "name": "exportEvents",
      "plural": false,
      "selections": [
        {
          "alias": null,
          "args": null,
          "kind": "ScalarField",
          "name": "fileName",
          "storageKey": null
        }
      ],
      "storageKey": null
    }
  ];
  return {
    "fragment": {
      "argumentDefinitions": v0,
      "kind": "Fragment",
      "metadata": null,
      "name": "ExportSelectionButtonMutation",
      "selections": v12,
      "type": "Mutation",
      "abstractKey": null
    },
    "kind": "Request",
    "operation": {
      "argumentDefinitions": v0,
      "kind": "Operation",
      "name": "ExportSelectionButtonMutation",
      "selections": v12
    },
    "params": {
      "cacheID": "d370df04ca30a5059288c7aa298239a8",
      "id": null,
      "metadata": {},
      "name": "ExportSelectionButtonMutation",
      "operationKind": "mutation",
      "text": "mutation ExportSelectionButtonMutation(\n  $eventIds: [ID!]!\n) {\n  exportEvents(eventIds: $eventIds) {\n    fileName\n  }\n}\n"
    }
  };
}();
node36.hash = "8b0d6962e2034d4c148d1b9919111d2f";
var ExportSelectionButtonMutation_graphql_default = node36;

// src/pages/embedding/__generated__/ExportSelectionButtonExportsQuery.graphql.ts
var node37 = function() {
  var v0 = [
    {
      "alias": null,
      "args": null,
      "concreteType": "Model",
      "kind": "LinkedField",
      "name": "model",
      "plural": false,
      "selections": [
        {
          "alias": null,
          "args": null,
          "concreteType": "ExportedFile",
          "kind": "LinkedField",
          "name": "exportedFiles",
          "plural": true,
          "selections": [
            {
              "alias": null,
              "args": null,
              "kind": "ScalarField",
              "name": "fileName",
              "storageKey": null
            }
          ],
          "storageKey": null
        }
      ],
      "storageKey": null
    }
  ];
  return {
    "fragment": {
      "argumentDefinitions": [],
      "kind": "Fragment",
      "metadata": null,
      "name": "ExportSelectionButtonExportsQuery",
      "selections": v0,
      "type": "Query",
      "abstractKey": null
    },
    "kind": "Request",
    "operation": {
      "argumentDefinitions": [],
      "kind": "Operation",
      "name": "ExportSelectionButtonExportsQuery",
      "selections": v0
    },
    "params": {
      "cacheID": "2f7e3554305121746dc799b6a8d120da",
      "id": null,
      "metadata": {},
      "name": "ExportSelectionButtonExportsQuery",
      "operationKind": "query",
      "text": "query ExportSelectionButtonExportsQuery {\n  model {\n    exportedFiles {\n      fileName\n    }\n  }\n}\n"
    }
  };
}();
node37.hash = "7e6db431afe21f137e54505645c787f4";
var ExportSelectionButtonExportsQuery_graphql_default = node37;

// src/pages/embedding/ExportSelectionButton.tsx
var import_react174 = __toESM(require_react());
var import_react_relay18 = __toESM(require_react_relay());
var EXPORTS_CODE_SNIPPET = `import phoenix as px

exports = px.active_session().exports
dataframe = exports[-1]
dataframe`;
var codeMirrorCSS2 = css`
  .cm-content {
    padding: var(--ac-global-dimension-static-size-100);
  }
`;
function CodeBlock({ value }) {
  const { theme: theme3 } = useTheme2();
  const codeMirrorTheme = theme3 === "light" ? void 0 : nord;
  return /* @__PURE__ */ jsx5(
    esm_default,
    {
      value,
      basicSetup: false,
      extensions: [python()],
      editable: false,
      theme: codeMirrorTheme,
      css: codeMirrorCSS2
    }
  );
}
function ExportSelectionButton() {
  const selectedEventIds = usePointCloudContext(
    (state) => state.selectedEventIds
  );
  const [commit, isInFlight] = (0, import_react_relay18.useMutation)(
    ExportSelectionButtonMutation_graphql_default
  );
  const [exportInfo, setExportInfo] = (0, import_react174.useState)(null);
  const onClick = (0, import_react174.useCallback)(() => {
    commit({
      variables: {
        eventIds: [...selectedEventIds]
      },
      onCompleted: (data) => {
        setExportInfo(data.exportEvents);
      }
    });
  }, [commit, selectedEventIds]);
  return /* @__PURE__ */ jsxs2(Fragment5, { children: [
    /* @__PURE__ */ jsx5(
      _Button,
      {
        variant: "default",
        size: "compact",
        icon: /* @__PURE__ */ jsx5(Icon, { svg: /* @__PURE__ */ jsx5(Download, {}) }),
        "aria-label": "Export selection / cluster",
        loading: isInFlight,
        onClick,
        children: isInFlight ? "Exporting" : "Export"
      }
    ),
    /* @__PURE__ */ jsx5(
      DialogContainer,
      {
        type: "slideOver",
        isDismissable: true,
        onDismiss: () => setExportInfo(null),
        children: exportInfo != null && /* @__PURE__ */ jsxs2(_Dialog, { title: "Cluster Exports", size: "M", children: [
          /* @__PURE__ */ jsx5(
            Alert,
            {
              variant: "success",
              banner: true,
              title: "Export succeeded",
              extra: /* @__PURE__ */ jsx5(
                _Button,
                {
                  variant: "success",
                  size: "compact",
                  onClick: () => {
                    window.open(
                      `/exports?filename=${exportInfo.fileName}`,
                      "_self"
                    );
                  },
                  children: "Download"
                }
              )
            }
          ),
          /* @__PURE__ */ jsxs2(
            "div",
            {
              css: css`
                display: flex;
                flex-direction: column;
                justify-content: space-between;
                align-items: flex-start;
                padding: 16px;
                gap: 16px;
              `,
              children: [
                /* @__PURE__ */ jsx5(
                  "p",
                  {
                    css: css`
                  margin: 0;
                  flex: 1 1 auto;
                `,
                    children: "You can retrieve your export in your notebook via"
                  }
                ),
                /* @__PURE__ */ jsx5(
                  _View,
                  {
                    borderColor: "light",
                    borderWidth: "thin",
                    borderRadius: "medium",
                    children: /* @__PURE__ */ jsx5(CodeBlock, { value: EXPORTS_CODE_SNIPPET })
                  }
                )
              ]
            }
          ),
          /* @__PURE__ */ jsx5(Accordion, { children: /* @__PURE__ */ jsx5(AccordionItem, { id: "all-exports", title: "Latest Exports", children: /* @__PURE__ */ jsx5(import_react174.Suspense, { fallback: /* @__PURE__ */ jsx5(Loading, {}), children: /* @__PURE__ */ jsx5(ExportsList, {}) }) }) })
        ] })
      }
    )
  ] });
}
function ExportsList() {
  const data = (0, import_react_relay18.useLazyLoadQuery)(
    ExportSelectionButtonExportsQuery_graphql_default,
    {},
    {
      fetchPolicy: "network-only"
    }
  );
  return /* @__PURE__ */ jsx5(List, { children: data.model.exportedFiles.map((fileInfo, index) => /* @__PURE__ */ jsx5(ListItem, { children: /* @__PURE__ */ jsxs2(
    "div",
    {
      css: css`
              display: flex;
              flex-direction: row;
              justify-content: space-between;
              align-items: center;
            `,
      children: [
        fileInfo.fileName,
        /* @__PURE__ */ jsx5(
          _Button,
          {
            size: "compact",
            "aria-label": "Download",
            variant: "default",
            icon: /* @__PURE__ */ jsx5(Icon, { svg: /* @__PURE__ */ jsx5(Download, {}) }),
            onClick: () => {
              window.open(`/exports?filename=${fileInfo.fileName}`, "_self");
            }
          }
        )
      ]
    }
  ) }, index)) });
}

// src/pages/embedding/PointSelectionGrid.tsx
function PointSelectionGrid(props) {
  const { getDatasetNameByRole } = useDatasets();
  const { events, onItemSelected } = props;
  const eventIdToDataMap = usePointCloudContext(
    (state) => state.eventIdToDataMap
  );
  const eventIdToGroup = usePointCloudContext((state) => state.eventIdToGroup);
  const pointGroupColors = usePointCloudContext(
    (state) => state.pointGroupColors
  );
  const selectionGridSize = usePointCloudContext(
    (state) => state.selectionGridSize
  );
  return /* @__PURE__ */ jsx5(
    "div",
    {
      css: css`
        flex: 1 1 auto;
        overflow-y: auto;
      `,
      "data-testid": "grid-view-scroll-container",
      children: /* @__PURE__ */ jsx5(
        "ul",
        {
          "data-grid-size": selectionGridSize,
          css: css`
          &[data-grid-size="small"] {
            --grid-item-min-width: 100px;
            --grid-item-height: 100px;
          }
          &[data-grid-size="medium"] {
            --grid-item-min-width: 200px;
            --grid-item-height: 200px;
          }
          &[data-grid-size="large"] {
            --grid-item-min-width: 300px;
            --grid-item-height: 200px;
          }
          padding: var(--px-spacing-lg);
          transition: all 0.2s ease-in-out;
          display: grid;
          grid-template-columns: repeat(
            auto-fill,
            minmax(var(--grid-item-min-width), 1fr)
          );
          flex-wrap: wrap;
          gap: var(--px-spacing-lg);
          & > li {
            min-width: var(--grid-item-min-width);
            height: var(--grid-item-height);
          }
        `,
          children: events.map((event, idx) => {
            const data = eventIdToDataMap.get(event.id);
            const { rawData = null, linkToData = null } = data?.embeddingMetadata ?? {};
            const { predictionLabel = null, actualLabel = null } = data?.eventMetadata ?? {};
            const datasetRole = getDatasetRoleFromEventId(event.id);
            const datasetName = getDatasetNameByRole(datasetRole);
            const group = eventIdToGroup[event.id];
            const color2 = pointGroupColors[group];
            return /* @__PURE__ */ jsx5("li", { children: /* @__PURE__ */ jsx5(
              EventItem,
              {
                rawData,
                linkToData,
                datasetName,
                group,
                onClick: () => {
                  onItemSelected(event.id);
                },
                color: color2,
                size: selectionGridSize,
                predictionLabel,
                actualLabel,
                promptAndResponse: event.promptAndResponse,
                documentText: event.documentText,
                autoPlay: false
              }
            ) }, idx);
          })
        }
      )
    }
  );
}

// src/pages/embedding/PointSelectionTable.tsx
var import_react177 = __toESM(require_react());
function PointSelectionTable({
  data,
  onPointSelected
}) {
  const { primaryDataset, referenceDataset } = useDatasets();
  const metric = usePointCloudContext((state) => state.metric);
  const [sorting, setSorting] = (0, import_react177.useState)([]);
  const { columns: columns2, tableData } = (0, import_react177.useMemo)(() => {
    const tableData2 = data.filter((point4) => {
      return point4.id.includes("CORPUS") === false;
    });
    let hasLinkToData = false, hasRawData = false, hasPromptAndResponse = false, hasPredictionLabels = false, hasActualLabels = false;
    data.forEach((point4) => {
      if (point4.linkToData) {
        hasLinkToData = true;
      }
      if (point4.rawData) {
        hasRawData = true;
      }
      if (point4.prompt || point4.response) {
        hasPromptAndResponse = true;
      }
      if (point4.predictionLabel) {
        hasPredictionLabels = true;
      }
      if (point4.actualLabel) {
        hasActualLabels = true;
      }
    });
    const dataDrivenColumns = [];
    if (referenceDataset) {
      dataDrivenColumns.push({
        header: "Dataset",
        accessorKey: "id",
        size: 50,
        cell: ({ getValue }) => {
          return /* @__PURE__ */ jsx5(
            EventDatasetCell,
            {
              id: getValue(),
              primaryDatasetName: primaryDataset.name,
              referenceDatasetName: referenceDataset?.name ?? "reference"
            }
          );
        }
      });
    }
    if (hasLinkToData) {
      dataDrivenColumns.push({
        header: "Link",
        accessorKey: "linkToData",
        cell: ({ getValue }) => {
          const value = getValue();
          if (typeof value === "string") {
            const fileName = value.split("/").pop();
            return /* @__PURE__ */ jsx5(ExternalLink, { href: value, children: fileName });
          }
          return null;
        }
      });
    }
    if (hasPromptAndResponse) {
      dataDrivenColumns.push({
        header: "Prompt",
        accessorKey: "prompt",
        cell: TextCell,
        size: 200
      });
      dataDrivenColumns.push({
        header: "Response",
        accessorKey: "response",
        cell: TextCell,
        size: 200
      });
    } else if (hasRawData) {
      dataDrivenColumns.push({
        header: "Raw Data",
        accessorKey: "rawData"
      });
    }
    if (hasPredictionLabels) {
      dataDrivenColumns.push({
        header: "Prediction Label",
        accessorKey: "predictionLabel",
        size: 50
      });
    }
    if (hasActualLabels) {
      dataDrivenColumns.push({
        header: "Actual Label",
        accessorKey: "actualLabel",
        size: 50
      });
    }
    const analysisColumns = [];
    if (metric && metric.type === "dataQuality") {
      const dimensionName = metric.dimension.name;
      analysisColumns.push({
        header: metric.dimension.name,
        accessorKey: "metric",
        cell: FloatCell,
        sortingFn: "basic"
      });
      tableData2.forEach((dataItem) => {
        const metricValue = dataItem.dimensions.find(
          (dimension) => dimension.dimension.name === dimensionName
        )?.value;
        dataItem.metric = metricValue != null ? Number(metricValue) : null;
      });
    }
    const columns3 = [
      ...dataDrivenColumns,
      ...analysisColumns,
      {
        header: "",
        id: "view-details",
        size: 50,
        cell: ({ row }) => {
          return /* @__PURE__ */ jsx5(
            LinkButton,
            {
              "aria-label": "view point details",
              onClick: () => {
                onPointSelected(row.original.id);
              },
              children: "view details"
            }
          );
        }
      }
    ];
    return { columns: columns3, tableData: tableData2 };
  }, [data, onPointSelected, primaryDataset, referenceDataset, metric]);
  const table = useReactTable({
    columns: columns2,
    data: tableData,
    state: {
      sorting
    },
    getCoreRowModel: getCoreRowModel(),
    onSortingChange: setSorting,
    getSortedRowModel: getSortedRowModel()
  });
  return /* @__PURE__ */ jsxs2("table", { css: tableCSS, children: [
    /* @__PURE__ */ jsx5("thead", { children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx5("tr", { children: headerGroup.headers.map((header) => /* @__PURE__ */ jsxs2("th", { children: [
      header.isPlaceholder ? null : /* @__PURE__ */ jsxs2(
        "div",
        {
          ...{
            className: header.column.getCanSort() ? "cursor-pointer" : "",
            onClick: header.column.getToggleSortingHandler()
          },
          children: [
            flexRender(
              header.column.columnDef.header,
              header.getContext()
            ),
            header.column.getIsSorted() ? /* @__PURE__ */ jsx5(
              Icon,
              {
                className: "sort-icon",
                svg: header.column.getIsSorted() === "asc" ? /* @__PURE__ */ jsx5(Icons.ArrowDownFilled, {}) : /* @__PURE__ */ jsx5(Icons.ArrowUpFilled, {})
              }
            ) : null
          ]
        }
      ),
      /* @__PURE__ */ jsx5(
        "div",
        {
          ...{
            onMouseDown: header.getResizeHandler(),
            onTouchStart: header.getResizeHandler(),
            className: `resizer ${header.column.getIsResizing() ? "isResizing" : ""}`,
            style: {
              transform: header.column.getIsResizing() ? `translateX(${table.getState().columnSizingInfo.deltaOffset}px)` : ""
            }
          }
        }
      )
    ] }, header.id)) }, headerGroup.id)) }),
    /* @__PURE__ */ jsx5("tbody", { children: table.getRowModel().rows.map((row) => /* @__PURE__ */ jsx5("tr", { children: row.getVisibleCells().map((cell) => /* @__PURE__ */ jsx5(
      "td",
      {
        style: {
          width: cell.column.getSize()
        },
        children: flexRender(cell.column.columnDef.cell, cell.getContext())
      },
      cell.id
    )) }, row.id)) })
  ] });
}
function EventDatasetCell({
  id: id2,
  primaryDatasetName,
  referenceDatasetName
}) {
  const isPrimary = id2.includes("PRIMARY");
  const DEFAULT_COLOR_SCHEME = useDefaultColorScheme();
  return /* @__PURE__ */ jsxs2(_Flex, { direction: "row", gap: "size-100", alignItems: "center", children: [
    /* @__PURE__ */ jsx5(
      ShapeIcon,
      {
        shape: "circle" /* circle */,
        color: DEFAULT_COLOR_SCHEME[isPrimary ? 0 : 1]
      }
    ),
    isPrimary ? primaryDatasetName : referenceDatasetName
  ] });
}

// src/pages/embedding/PointSelectionPanelContent.tsx
var pointSelectionPanelCSS = css`
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  /* Give spacing for the close icon */
  & > .ac-tabs {
    padding-top: 17px;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    [role="tablist"] {
      flex: none;
    }
    .ac-tabs__pane-container {
      display: flex;
      flex-direction: column;
      flex: 1 1 auto;
      overflow: hidden;
      [role="tabpanel"] {
        display: flex;
        flex-direction: column;
        flex: 1 1 auto;
        overflow: hidden;
      }
    }
  }
`;
function convertGqlEventToRetrievalDocument({
  event,
  relevance
}) {
  return {
    id: event.eventMetadata.predictionId || "unknown id",
    text: event.documentText ?? "empty document",
    relevance
  };
}
function PointSelectionPanelContent() {
  const selectedEventIds = usePointCloudContext(
    (state) => state.selectedEventIds
  );
  const setSelectedEventIds = usePointCloudContext(
    (state) => state.setSelectedEventIds
  );
  const setSelectedClusterId = usePointCloudContext(
    (state) => state.setSelectedClusterId
  );
  const selectionDisplay = usePointCloudContext(
    (state) => state.selectionDisplay
  );
  const setSelectionDisplay = usePointCloudContext(
    (state) => state.setSelectionDisplay
  );
  const selectionGridSize = usePointCloudContext(
    (state) => state.selectionGridSize
  );
  const setSelectionGridSize = usePointCloudContext(
    (state) => state.setSelectionGridSize
  );
  const [selectedDetailPointId, setSelectedDetailPointId] = import_react178.default.useState(null);
  const { primaryEventIds, referenceEventIds, corpusEventIds } = (0, import_react178.useMemo)(() => {
    const primaryEventIds2 = [];
    const referenceEventIds2 = [];
    const corpusEventIds2 = [];
    selectedEventIds.forEach((id2) => {
      if (id2.includes("PRIMARY")) {
        primaryEventIds2.push(id2);
      } else if (id2.includes("CORPUS")) {
        corpusEventIds2.push(id2);
      } else {
        referenceEventIds2.push(id2);
      }
    });
    return { primaryEventIds: primaryEventIds2, referenceEventIds: referenceEventIds2, corpusEventIds: corpusEventIds2 };
  }, [selectedEventIds]);
  const data = (0, import_react_relay19.useLazyLoadQuery)(
    PointSelectionPanelContentQuery_graphql_default,
    {
      primaryEventIds: [...primaryEventIds],
      referenceEventIds: [...referenceEventIds],
      corpusEventIds: [...corpusEventIds]
    }
  );
  const allSelectedEvents = (0, import_react178.useMemo)(() => {
    const primaryEvents = data.model?.primaryDataset?.events ?? [];
    const referenceEvents = data.model?.referenceDataset?.events ?? [];
    const corpusEvents = data.model?.corpusDataset?.events ?? [];
    return [...primaryEvents, ...referenceEvents, ...corpusEvents];
  }, [data]);
  const onClose = () => {
    setSelectedEventIds(/* @__PURE__ */ new Set());
    setSelectedClusterId(null);
  };
  const eventIdToDataMap = usePointCloudContext(
    (state) => state.eventIdToDataMap
  );
  const pointData = usePointCloudContext((state) => state.pointData);
  const allData = (0, import_react178.useMemo)(() => {
    return allSelectedEvents.map((event) => {
      const point4 = eventIdToDataMap.get(event.id);
      const documents = [];
      if (pointData != null && point4?.retrievals != null) {
        point4.retrievals.forEach(({ documentId, relevance }) => {
          const documentEvent = pointData[documentId];
          if (documentEvent != null) {
            documents.push(
              convertGqlEventToRetrievalDocument({
                event: documentEvent,
                relevance
              })
            );
          }
        });
      }
      return {
        id: event.id,
        predictionId: event.eventMetadata?.predictionId ?? null,
        actualLabel: event.eventMetadata?.actualLabel ?? null,
        actualScore: event.eventMetadata?.actualScore ?? null,
        predictionLabel: event.eventMetadata?.predictionLabel ?? null,
        predictionScore: event.eventMetadata?.predictionScore ?? null,
        rawData: point4?.embeddingMetadata.rawData ?? null,
        linkToData: point4?.embeddingMetadata.linkToData ?? null,
        dimensions: event.dimensions,
        prompt: event.promptAndResponse?.prompt ?? null,
        response: event.promptAndResponse?.response ?? null,
        retrievedDocuments: documents,
        documentText: event.documentText ?? null
      };
    });
  }, [allSelectedEvents, eventIdToDataMap, pointData]);
  const eventDetails = (0, import_react178.useMemo)(() => {
    if (selectedDetailPointId) {
      const event = allData.find((event2) => event2.id === selectedDetailPointId);
      return event ?? null;
    }
    return null;
  }, [allData, selectedDetailPointId]);
  return /* @__PURE__ */ jsxs2("section", { css: pointSelectionPanelCSS, children: [
    /* @__PURE__ */ jsxs2(
      "div",
      {
        role: "toolbar",
        css: css`
          position: absolute;
          top: var(--px-spacing-med);
          right: var(--px-spacing-lg);
          display: flex;
          flex-direction: row-reverse;
          gap: var(--px-spacing-med);
        `,
        children: [
          /* @__PURE__ */ jsx5(
            _Button,
            {
              variant: "default",
              size: "compact",
              icon: /* @__PURE__ */ jsx5(Icon, { svg: /* @__PURE__ */ jsx5(CloseOutline, {}) }),
              "aria-label": "Clear selection",
              onClick: onClose
            }
          ),
          /* @__PURE__ */ jsx5(ExportSelectionButton, {})
        ]
      }
    ),
    /* @__PURE__ */ jsx5(Tabs, { children: /* @__PURE__ */ jsxs2(TabPane, { name: "Selection", children: [
      /* @__PURE__ */ jsx5(
        Toolbar,
        {
          extra: /* @__PURE__ */ jsxs2(
            "div",
            {
              css: css`
                  display: flex;
                  flex-direction: row;
                  gap: var(--px-spacing-med);
                `,
              children: [
                selectionDisplay === "gallery" /* gallery */ && /* @__PURE__ */ jsx5(
                  SelectionGridSizeRadioGroup,
                  {
                    size: selectionGridSize,
                    onChange: setSelectionGridSize
                  }
                ),
                /* @__PURE__ */ jsx5(
                  SelectionDisplayRadioGroup,
                  {
                    mode: selectionDisplay,
                    onChange: (displayMode) => {
                      setSelectionDisplay(displayMode);
                    }
                  }
                )
              ]
            }
          ),
          children: /* @__PURE__ */ jsx5(_Text, { children: `${allSelectedEvents.length} points selected` })
        }
      ),
      selectionDisplay === "list" /* list */ ? /* @__PURE__ */ jsx5(
        "div",
        {
          css: css`
                flex: 1 1 auto;
                overflow-y: auto;
              `,
          children: /* @__PURE__ */ jsx5(
            PointSelectionTable,
            {
              data: allData,
              onPointSelected: setSelectedDetailPointId
            }
          )
        }
      ) : /* @__PURE__ */ jsx5(
        PointSelectionGrid,
        {
          events: allSelectedEvents,
          onItemSelected: setSelectedDetailPointId
        }
      )
    ] }) }),
    /* @__PURE__ */ jsx5(
      DialogContainer,
      {
        type: "slideOver",
        isDismissable: true,
        onDismiss: () => setSelectedDetailPointId(null),
        children: eventDetails && /* @__PURE__ */ jsx5(_Dialog, { title: "Embedding Details", size: "L", children: /* @__PURE__ */ jsx5(EventDetails, { event: eventDetails }) })
      }
    )
  ] });
}

// src/pages/embedding/EmbeddingPage.tsx
var EmbeddingPageUMAPQuery = EmbeddingPageUMAPQuery_graphql_default;
function EmbeddingPage() {
  const { referenceDataset, corpusDataset } = useDatasets();
  const { timeRange } = useTimeRange();
  const defaultPointCloudProps = (0, import_react180.useMemo)(() => {
    let defaultPointCloudProps2 = {};
    if (corpusDataset != null) {
      defaultPointCloudProps2 = getDefaultRetrievalTroubleshootingPointCloudProps();
    } else if (referenceDataset != null) {
      defaultPointCloudProps2 = getDefaultDriftPointCloudProps();
    } else {
      defaultPointCloudProps2 = getDefaultSingleDatasetPointCloudProps();
    }
    defaultPointCloudProps2 = {
      ...defaultPointCloudProps2,
      umapParameters: {
        ...window.Config.UMAP
      }
    };
    return defaultPointCloudProps2;
  }, [corpusDataset, referenceDataset]);
  return /* @__PURE__ */ jsx5(TimeSliceContextProvider, { initialTimestamp: timeRange.end, children: /* @__PURE__ */ jsx5(PointCloudProvider, { ...defaultPointCloudProps, children: /* @__PURE__ */ jsx5(EmbeddingMain, {}) }) });
}
function EmbeddingMain() {
  const embeddingDimensionId = useEmbeddingDimensionId();
  const { primaryDataset, referenceDataset } = useDatasets();
  const umapParameters = usePointCloudContext((state) => state.umapParameters);
  const getHDSCANParameters = usePointCloudContext(
    (state) => state.getHDSCANParameters
  );
  const getMetric = usePointCloudContext((state) => state.getMetric);
  const resetPointCloud = usePointCloudContext((state) => state.reset);
  const setLoading = usePointCloudContext((state) => state.setLoading);
  const [showChart, setShowChart] = (0, import_react180.useState)(true);
  const [queryReference, loadQuery, disposeQuery] = (0, import_react_relay20.useQueryLoader)(EmbeddingPageUMAPQuery);
  const { selectedTimestamp } = useTimeSlice();
  const endTime = (0, import_react180.useMemo)(
    () => selectedTimestamp ?? new Date(primaryDataset.endTime),
    [selectedTimestamp, primaryDataset.endTime]
  );
  const timeRange = (0, import_react180.useMemo)(() => {
    return {
      start: subDays(endTime, 2).toISOString(),
      end: endTime.toISOString()
    };
  }, [endTime]);
  const modelData = (0, import_react_relay20.useLazyLoadQuery)(
    EmbeddingPageModelQuery_graphql_default,
    {}
  );
  (0, import_react180.useEffect)(() => {
    resetPointCloud();
    setLoading(true);
    const metric = getMetric();
    loadQuery(
      {
        id: embeddingDimensionId,
        timeRange,
        ...umapParameters,
        ...getHDSCANParameters(),
        fetchDataQualityMetric: metric.type === "dataQuality",
        fetchPerformanceMetric: metric.type === "performance",
        dataQualityMetricColumnName: metric.type === "dataQuality" ? metric.dimension.name : null,
        performanceMetric: metric.type === "performance" ? metric.metric : "accuracyScore"
        // Note that the fallback should never happen but is to satisfy the type checker
      },
      {
        fetchPolicy: "network-only"
      }
    );
    return () => {
      disposeQuery();
    };
  }, [
    setLoading,
    resetPointCloud,
    embeddingDimensionId,
    loadQuery,
    disposeQuery,
    umapParameters,
    getHDSCANParameters,
    getMetric,
    timeRange
  ]);
  return /* @__PURE__ */ jsxs2(
    "main",
    {
      css: css`
        flex: 1 1 auto;
        display: flex;
        flex-direction: column;
        overflow: hidden;
      `,
      children: [
        /* @__PURE__ */ jsx5(PointCloudNotifications, {}),
        /* @__PURE__ */ jsxs2(
          Toolbar,
          {
            extra: /* @__PURE__ */ jsxs2(
              _Flex,
              {
                direction: "row",
                justifyContent: "center",
                alignItems: "center",
                gap: "size-100",
                children: [
                  /* @__PURE__ */ jsx5(
                    _Switch,
                    {
                      onChange: (isSelected) => {
                        setShowChart(isSelected);
                      },
                      defaultSelected: true,
                      labelPlacement: "start",
                      children: "Show Timeseries"
                    }
                  ),
                  /* @__PURE__ */ jsx5(EmbeddingActionMenu, {})
                ]
              }
            ),
            children: [
              /* @__PURE__ */ jsx5(PrimaryDatasetTimeRange, {}),
              referenceDataset ? /* @__PURE__ */ jsx5(
                ReferenceDatasetTimeRange,
                {
                  datasetRole: "reference",
                  timeRange: {
                    start: new Date(referenceDataset.startTime),
                    end: new Date(referenceDataset.endTime)
                  }
                }
              ) : null,
              /* @__PURE__ */ jsx5(MetricSelector, { model: modelData.model })
            ]
          }
        ),
        /* @__PURE__ */ jsxs2(PanelGroup2, { direction: "vertical", children: [
          showChart ? /* @__PURE__ */ jsxs2(Fragment5, { children: [
            /* @__PURE__ */ jsx5(Panel, { defaultSize: 20, collapsible: true, order: 1, children: /* @__PURE__ */ jsx5(import_react180.Suspense, { fallback: /* @__PURE__ */ jsx5(Loading, {}), children: /* @__PURE__ */ jsx5(MetricTimeSeries, { embeddingDimensionId }) }) }),
            /* @__PURE__ */ jsx5(PanelResizeHandle, { css: resizeHandleCSS })
          ] }) : null,
          /* @__PURE__ */ jsx5(Panel, { order: 2, children: /* @__PURE__ */ jsx5(
            "div",
            {
              css: css`
              width: 100%;
              height: 100%;
              position: relative;
            `,
              children: /* @__PURE__ */ jsx5(import_react180.Suspense, { fallback: /* @__PURE__ */ jsx5(LoadingMask, {}), children: queryReference ? /* @__PURE__ */ jsx5(PointCloudDisplay, { queryReference }) : null })
            }
          ) })
        ] })
      ]
    }
  );
}
function coordinatesToThreeDimensionalPoint(coordinates) {
  if (coordinates.__typename !== "Point3D") {
    throw new Error(
      `Expected Point3D but got ${coordinates.__typename} for coordinates`
    );
  }
  return [coordinates.x, coordinates.y, coordinates.z];
}
function PointCloudDisplay({
  queryReference
}) {
  const data = (0, import_react_relay20.usePreloadedQuery)(
    EmbeddingPageUMAPQuery,
    queryReference
  );
  const sourceData = (0, import_react180.useMemo)(
    () => data.embedding?.UMAPPoints?.data ?? [],
    [data]
  );
  const referenceSourceData = (0, import_react180.useMemo)(
    () => data.embedding?.UMAPPoints?.referenceData ?? [],
    [data]
  );
  const corpusSourceData = (0, import_react180.useMemo)(
    () => data.embedding?.UMAPPoints?.corpusData ?? [],
    [data]
  );
  const contextRetrievals = (0, import_react180.useMemo)(() => {
    return data.embedding?.UMAPPoints?.contextRetrievals ?? [];
  }, [data]);
  const allSourceData = (0, import_react180.useMemo)(() => {
    const allData = [
      ...sourceData,
      ...referenceSourceData,
      ...corpusSourceData
    ];
    return allData.map((d) => ({
      ...d,
      position: coordinatesToThreeDimensionalPoint(d.coordinates),
      metaData: {
        id: d.eventId
      }
    }));
  }, [referenceSourceData, sourceData, corpusSourceData]);
  const setInitialData = usePointCloudContext((state) => state.setInitialData);
  const setClusters = usePointCloudContext((state) => state.setClusters);
  useDeepCompareEffect(() => {
    const clusters = data.embedding?.UMAPPoints?.clusters || [];
    setInitialData({
      points: allSourceData,
      clusters,
      retrievals: contextRetrievals
    });
  }, [
    allSourceData,
    queryReference,
    contextRetrievals,
    setInitialData,
    setClusters
  ]);
  return /* @__PURE__ */ jsx5(
    "div",
    {
      css: css`
        flex: 1 1 auto;
        display: flex;
        flex-direction: row;
        align-items: stretch;
        width: 100%;
        height: 100%;
      `,
      "data-testid": "point-cloud-display",
      children: /* @__PURE__ */ jsxs2(PanelGroup2, { direction: "horizontal", children: [
        /* @__PURE__ */ jsx5(
          Panel,
          {
            id: "embedding-left",
            defaultSize: 15,
            maxSize: 30,
            minSize: 10,
            collapsible: true,
            children: /* @__PURE__ */ jsxs2(
              PanelGroup2,
              {
                autoSaveId: "embedding-controls-vertical",
                direction: "vertical",
                children: [
                  /* @__PURE__ */ jsx5(
                    Panel,
                    {
                      css: css`
                display: flex;
                flex-direction: column;
                .ac-tabs {
                  height: 100%;
                  overflow: hidden;
                  display: flex;
                  flex-direction: column;
                  [role="tablist"] {
                    flex: none;
                  }
                  .ac-tabs__pane-container {
                    flex: 1 1 auto;
                    overflow: hidden;
                    display: flex;
                    flex-direction: column;
                    & > div {
                      height: 100%;
                    }
                  }
                }
              `,
                      children: /* @__PURE__ */ jsx5(ClustersPanelContents, {})
                    }
                  ),
                  /* @__PURE__ */ jsx5(PanelResizeHandle, { css: resizeHandleCSS }),
                  /* @__PURE__ */ jsx5(
                    Panel,
                    {
                      css: css`
                .ac-tabs {
                  height: 100%;
                  overflow: hidden;
                  .ac-tabs__pane-container {
                    height: 100%;
                    overflow-y: auto;
                  }
                }
              `,
                      children: /* @__PURE__ */ jsxs2(Tabs, { children: [
                        /* @__PURE__ */ jsx5(TabPane, { name: "Display", children: /* @__PURE__ */ jsx5(PointCloudDisplaySettings, {}) }),
                        /* @__PURE__ */ jsx5(TabPane, { name: "Hyperparameters", children: /* @__PURE__ */ jsx5(PointCloudParameterSettings, {}) })
                      ] })
                    }
                  )
                ]
              }
            )
          }
        ),
        /* @__PURE__ */ jsx5(PanelResizeHandle, { css: compactResizeHandleCSS }),
        /* @__PURE__ */ jsx5(Panel, { children: /* @__PURE__ */ jsxs2(
          "div",
          {
            css: css`
              position: relative;
              width: 100%;
              height: 100%;
            `,
            children: [
              /* @__PURE__ */ jsx5(SelectionPanel, {}),
              /* @__PURE__ */ jsx5(PointCloud2, {})
            ]
          }
        ) })
      ] })
    }
  );
}
function SelectionPanel() {
  const selectedEventIds = usePointCloudContext(
    (state) => state.selectedEventIds
  );
  if (selectedEventIds.size === 0) {
    return null;
  }
  return /* @__PURE__ */ jsx5(
    "div",
    {
      css: css`
        position: absolute;
        top: 0;
        left: 0;
        bottom: 0;
        right: 0;
      `,
      "data-testid": "selection-panel",
      children: /* @__PURE__ */ jsxs2(PanelGroup2, { direction: "vertical", children: [
        /* @__PURE__ */ jsx5(Panel, {}),
        /* @__PURE__ */ jsx5(PanelResizeHandle, { css: resizeHandleCSS, style: { zIndex: 1 } }),
        /* @__PURE__ */ jsx5(
          Panel,
          {
            id: "embedding-point-selection",
            defaultSize: 40,
            minSize: 20,
            order: 2,
            style: { zIndex: 1 },
            children: /* @__PURE__ */ jsx5(PointSelectionPanelContentWrap, { children: /* @__PURE__ */ jsx5(import_react180.Suspense, { fallback: /* @__PURE__ */ jsx5(Loading, {}), children: /* @__PURE__ */ jsx5(PointSelectionPanelContent, {}) }) })
          }
        )
      ] })
    }
  );
}
function PointSelectionPanelContentWrap(props) {
  return /* @__PURE__ */ jsx5(
    "div",
    {
      css: css`
        background-color: var(--ac-global-color-grey-75);
        width: 100%;
        height: 100%;
      `,
      children: props.children
    }
  );
}
var CLUSTERING_CONFIG_TAB_INDEX = 1;
var ClustersPanelContents = import_react180.default.memo(function ClustersPanelContents2() {
  const { referenceDataset } = useDatasets();
  const clusters = usePointCloudContext((state) => state.clusters);
  const selectedClusterId = usePointCloudContext(
    (state) => state.selectedClusterId
  );
  const metric = usePointCloudContext((state) => state.metric);
  const setSelectedClusterId = usePointCloudContext(
    (state) => state.setSelectedClusterId
  );
  const setSelectedEventIds = usePointCloudContext(
    (state) => state.setSelectedEventIds
  );
  const setHighlightedClusterId = usePointCloudContext(
    (state) => state.setHighlightedClusterId
  );
  const setClusterColorMode = usePointCloudContext(
    (state) => state.setClusterColorMode
  );
  const hideReference = referenceDataset == null || metric.type === "drift";
  const onTabChange = (0, import_react180.useCallback)(
    (index) => {
      if (index === CLUSTERING_CONFIG_TAB_INDEX) {
        setClusterColorMode("highlight" /* highlight */);
      } else {
        setClusterColorMode("default" /* default */);
      }
    },
    [setClusterColorMode]
  );
  return /* @__PURE__ */ jsxs2(Tabs, { onChange: onTabChange, children: [
    /* @__PURE__ */ jsx5(TabPane, { name: "Clusters", extra: /* @__PURE__ */ jsx5(Counter, { children: clusters.length }), children: /* @__PURE__ */ jsxs2(_Flex, { direction: "column", height: "100%", children: [
      /* @__PURE__ */ jsx5(
        _View,
        {
          borderBottomColor: "dark",
          borderBottomWidth: "thin",
          backgroundColor: "dark",
          flex: "none",
          padding: "size-50",
          children: /* @__PURE__ */ jsx5(_Flex, { direction: "row", justifyContent: "end", children: /* @__PURE__ */ jsx5(ClusterSortPicker, {}) })
        }
      ),
      /* @__PURE__ */ jsx5(_View, { flex: "1 1 auto", overflow: "auto", children: /* @__PURE__ */ jsx5(
        "ul",
        {
          css: (theme3) => css`
                flex: 1 1 auto;
                display: flex;
                flex-direction: column;
                gap: ${theme3.spacing.margin8}px;
                margin: ${theme3.spacing.margin8}px;
              `,
          children: clusters.map((cluster) => {
            return /* @__PURE__ */ jsx5("li", { children: /* @__PURE__ */ jsx5(
              ClusterItem,
              {
                clusterId: cluster.id,
                numPoints: cluster.eventIds.length,
                isSelected: selectedClusterId === cluster.id,
                driftRatio: cluster.driftRatio,
                primaryToCorpusRatio: cluster.primaryToCorpusRatio,
                primaryMetricValue: cluster.primaryMetricValue,
                referenceMetricValue: cluster.referenceMetricValue,
                metricName: getClusterMetricName(metric),
                hideReference,
                onClick: () => {
                  if (selectedClusterId !== cluster.id) {
                    setSelectedClusterId(cluster.id);
                    setSelectedEventIds(new Set(cluster.eventIds));
                  } else {
                    setSelectedClusterId(null);
                    setSelectedEventIds(/* @__PURE__ */ new Set());
                  }
                },
                onMouseEnter: () => {
                  setHighlightedClusterId(cluster.id);
                },
                onMouseLeave: () => {
                  setHighlightedClusterId(null);
                }
              }
            ) }, cluster.id);
          })
        }
      ) })
    ] }) }),
    /* @__PURE__ */ jsx5(TabPane, { name: "Configuration", children: /* @__PURE__ */ jsx5(_View, { overflow: "auto", height: "100%", children: /* @__PURE__ */ jsx5(ClusteringSettings, {}) }) })
  ] });
});
function getClusterMetricName(metric) {
  const { type: metricType, metric: metricEnum } = metric;
  switch (metricType) {
    case "dataQuality":
      return `${metric.dimension.name} avg`;
    case "drift": {
      switch (metricEnum) {
        case "euclideanDistance":
          return "Cluster Drift";
        default:
          assertUnreachable2(metricEnum);
      }
      break;
    }
    case "performance":
      return getMetricShortNameByMetricKey(metricEnum);
    case "retrieval": {
      switch (metricEnum) {
        case "queryDistance":
          return "% Query";
        default:
          assertUnreachable2(metricEnum);
      }
      break;
    }
    default:
      assertUnreachable2(metricType);
  }
}
function PointCloudNotifications() {
  const { notifyError } = useGlobalNotification();
  const errorMessage = usePointCloudContext((state) => state.errorMessage);
  const setErrorMessage = usePointCloudContext(
    (state) => state.setErrorMessage
  );
  (0, import_react180.useEffect)(() => {
    if (errorMessage !== null) {
      notifyError({
        title: "An error occurred",
        message: errorMessage,
        action: {
          text: "Dismiss",
          onClick: () => {
            setErrorMessage(null);
          }
        }
      });
    }
  }, [errorMessage, notifyError, setErrorMessage]);
  return null;
}

// src/pages/embedding/__generated__/embeddingLoaderQuery.graphql.ts
var node38 = function() {
  var v0 = [
    {
      "defaultValue": null,
      "kind": "LocalArgument",
      "name": "id"
    }
  ], v12 = [
    {
      "kind": "Variable",
      "name": "id",
      "variableName": "id"
    }
  ], v22 = {
    "alias": null,
    "args": null,
    "kind": "ScalarField",
    "name": "id",
    "storageKey": null
  }, v32 = {
    "alias": null,
    "args": null,
    "kind": "ScalarField",
    "name": "name",
    "storageKey": null
  };
  return {
    "fragment": {
      "argumentDefinitions": v0,
      "kind": "Fragment",
      "metadata": null,
      "name": "embeddingLoaderQuery",
      "selections": [
        {
          "alias": "embedding",
          "args": v12,
          "concreteType": null,
          "kind": "LinkedField",
          "name": "node",
          "plural": false,
          "selections": [
            {
              "kind": "InlineFragment",
              "selections": [
                v22,
                v32
              ],
              "type": "EmbeddingDimension",
              "abstractKey": null
            }
          ],
          "storageKey": null
        }
      ],
      "type": "Query",
      "abstractKey": null
    },
    "kind": "Request",
    "operation": {
      "argumentDefinitions": v0,
      "kind": "Operation",
      "name": "embeddingLoaderQuery",
      "selections": [
        {
          "alias": "embedding",
          "args": v12,
          "concreteType": null,
          "kind": "LinkedField",
          "name": "node",
          "plural": false,
          "selections": [
            {
              "alias": null,
              "args": null,
              "kind": "ScalarField",
              "name": "__typename",
              "storageKey": null
            },
            {
              "kind": "TypeDiscriminator",
              "abstractKey": "__isNode"
            },
            v22,
            {
              "kind": "InlineFragment",
              "selections": [
                v32
              ],
              "type": "EmbeddingDimension",
              "abstractKey": null
            }
          ],
          "storageKey": null
        }
      ]
    },
    "params": {
      "cacheID": "cff0ac130f1ef79784f7bef4161ac60d",
      "id": null,
      "metadata": {},
      "name": "embeddingLoaderQuery",
      "operationKind": "query",
      "text": "query embeddingLoaderQuery(\n  $id: GlobalID!\n) {\n  embedding: node(id: $id) {\n    __typename\n    ... on EmbeddingDimension {\n      id\n      name\n    }\n    __isNode: __typename\n    id\n  }\n}\n"
    }
  };
}();
node38.hash = "c049e57d92943f64b5e751e0daa89dc8";
var embeddingLoaderQuery_graphql_default = node38;

// src/pages/embedding/embeddingLoader.ts
var import_react_relay21 = __toESM(require_react_relay());
async function embeddingLoader(args) {
  const { embeddingDimensionId } = args.params;
  return (0, import_react_relay21.fetchQuery)(
    RelayEnvironment_default,
    embeddingLoaderQuery_graphql_default,
    {
      id: embeddingDimensionId
    }
  ).toPromise();
}

// src/pages/dimension/__generated__/DimensionPageQuery.graphql.ts
var node39 = function() {
  var v0 = {
    "defaultValue": null,
    "kind": "LocalArgument",
    "name": "dimensionId"
  }, v12 = {
    "defaultValue": null,
    "kind": "LocalArgument",
    "name": "hasReference"
  }, v22 = {
    "defaultValue": null,
    "kind": "LocalArgument",
    "name": "timeRange"
  }, v32 = [
    {
      "kind": "Variable",
      "name": "id",
      "variableName": "dimensionId"
    }
  ], v4 = {
    "alias": null,
    "args": null,
    "kind": "ScalarField",
    "name": "id",
    "storageKey": null
  }, v5 = {
    "kind": "Variable",
    "name": "timeRange",
    "variableName": "timeRange"
  }, v6 = [
    v5
  ], v7 = [
    {
      "kind": "Variable",
      "name": "hasReference",
      "variableName": "hasReference"
    },
    v5
  ], v8 = {
    "alias": null,
    "args": null,
    "kind": "ScalarField",
    "name": "__typename",
    "storageKey": null
  }, v9 = [
    {
      "alias": null,
      "args": null,
      "kind": "ScalarField",
      "name": "primaryValue",
      "storageKey": null
    }
  ], v10 = {
    "kind": "Literal",
    "name": "metric",
    "value": "cardinality"
  }, v11 = {
    "kind": "Literal",
    "name": "metric",
    "value": "percentEmpty"
  }, v122 = {
    "kind": "Literal",
    "name": "datasetRole",
    "value": "reference"
  };
  return {
    "fragment": {
      "argumentDefinitions": [
        v0,
        v12,
        v22
      ],
      "kind": "Fragment",
      "metadata": null,
      "name": "DimensionPageQuery",
      "selections": [
        {
          "alias": "dimension",
          "args": v32,
          "concreteType": null,
          "kind": "LinkedField",
          "name": "node",
          "plural": false,
          "selections": [
            {
              "kind": "InlineFragment",
              "selections": [
                v4,
                {
                  "args": v6,
                  "kind": "FragmentSpread",
                  "name": "DimensionSegmentsBarChart_dimension"
                },
                {
                  "args": v6,
                  "kind": "FragmentSpread",
                  "name": "DimensionCountStats_dimension"
                },
                {
                  "args": v6,
                  "kind": "FragmentSpread",
                  "name": "DimensionDriftStats_dimension"
                },
                {
                  "args": v7,
                  "kind": "FragmentSpread",
                  "name": "DimensionCardinalityStats_dimension"
                },
                {
                  "args": v7,
                  "kind": "FragmentSpread",
                  "name": "DimensionPercentEmptyStats_dimension"
                },
                {
                  "args": v6,
                  "kind": "FragmentSpread",
                  "name": "DimensionQuantilesStats_dimension"
                }
              ],
              "type": "Dimension",
              "abstractKey": null
            }
          ],
          "storageKey": null
        }
      ],
      "type": "Query",
      "abstractKey": null
    },
    "kind": "Request",
    "operation": {
      "argumentDefinitions": [
        v0,
        v22,
        v12
      ],
      "kind": "Operation",
      "name": "DimensionPageQuery",
      "selections": [
        {
          "alias": "dimension",
          "args": v32,
          "concreteType": null,
          "kind": "LinkedField",
          "name": "node",
          "plural": false,
          "selections": [
            v8,
            {
              "kind": "TypeDiscriminator",
              "abstractKey": "__isNode"
            },
            v4,
            {
              "kind": "InlineFragment",
              "selections": [
                {
                  "alias": null,
                  "args": [
                    {
                      "kind": "Variable",
                      "name": "primaryTimeRange",
                      "variableName": "timeRange"
                    }
                  ],
                  "concreteType": "Segments",
                  "kind": "LinkedField",
                  "name": "segmentsComparison",
                  "plural": false,
                  "selections": [
                    {
                      "alias": null,
                      "args": null,
                      "concreteType": "Segment",
                      "kind": "LinkedField",
                      "name": "segments",
                      "plural": true,
                      "selections": [
                        {
                          "alias": null,
                          "args": null,
                          "concreteType": null,
                          "kind": "LinkedField",
                          "name": "bin",
                          "plural": false,
                          "selections": [
                            v8,
                            {
                              "kind": "InlineFragment",
                              "selections": [
                                {
                                  "alias": null,
                                  "args": null,
                                  "kind": "ScalarField",
                                  "name": "name",
                                  "storageKey": null
                                }
                              ],
                              "type": "NominalBin",
                              "abstractKey": null
                            },
                            {
                              "kind": "InlineFragment",
                              "selections": [
                                {
                                  "alias": null,
                                  "args": null,
                                  "concreteType": "NumericRange",
                                  "kind": "LinkedField",
                                  "name": "range",
                                  "plural": false,
                                  "selections": [
                                    {
                                      "alias": null,
                                      "args": null,
                                      "kind": "ScalarField",
                                      "name": "start",
                                      "storageKey": null
                                    },
                                    {
                                      "alias": null,
                                      "args": null,
                                      "kind": "ScalarField",
                                      "name": "end",
                                      "storageKey": null
                                    }
                                  ],
                                  "storageKey": null
                                }
                              ],
                              "type": "IntervalBin",
                              "abstractKey": null
                            }
                          ],
                          "storageKey": null
                        },
                        {
                          "alias": null,
                          "args": null,
                          "concreteType": "DatasetValues",
                          "kind": "LinkedField",
                          "name": "counts",
                          "plural": false,
                          "selections": v9,
                          "storageKey": null
                        }
                      ],
                      "storageKey": null
                    },
                    {
                      "alias": null,
                      "args": null,
                      "concreteType": "DatasetValues",
                      "kind": "LinkedField",
                      "name": "totalCounts",
                      "plural": false,
                      "selections": v9,
                      "storageKey": null
                    }
                  ],
                  "storageKey": null
                },
                {
                  "alias": "count",
                  "args": [
                    {
                      "kind": "Literal",
                      "name": "metric",
                      "value": "count"
                    },
                    v5
                  ],
                  "kind": "ScalarField",
                  "name": "dataQualityMetric",
                  "storageKey": null
                },
                {
                  "alias": "psi",
                  "args": [
                    {
                      "kind": "Literal",
                      "name": "metric",
                      "value": "psi"
                    },
                    v5
                  ],
                  "kind": "ScalarField",
                  "name": "driftMetric",
                  "storageKey": null
                },
                {
                  "alias": "cardinality",
                  "args": [
                    v10,
                    v5
                  ],
                  "kind": "ScalarField",
                  "name": "dataQualityMetric",
                  "storageKey": null
                },
                {
                  "alias": "percentEmpty",
                  "args": [
                    v11,
                    v5
                  ],
                  "kind": "ScalarField",
                  "name": "dataQualityMetric",
                  "storageKey": null
                },
                {
                  "alias": "p99",
                  "args": [
                    {
                      "kind": "Literal",
                      "name": "metric",
                      "value": "p99"
                    },
                    v5
                  ],
                  "kind": "ScalarField",
                  "name": "dataQualityMetric",
                  "storageKey": null
                },
                {
                  "alias": "p75",
                  "args": [
                    {
                      "kind": "Literal",
                      "name": "metric",
                      "value": "p75"
                    },
                    v5
                  ],
                  "kind": "ScalarField",
                  "name": "dataQualityMetric",
                  "storageKey": null
                },
                {
                  "alias": "p50",
                  "args": [
                    {
                      "kind": "Literal",
                      "name": "metric",
                      "value": "p50"
                    },
                    v5
                  ],
                  "kind": "ScalarField",
                  "name": "dataQualityMetric",
                  "storageKey": null
                },
                {
                  "alias": "p25",
                  "args": [
                    {
                      "kind": "Literal",
                      "name": "metric",
                      "value": "p25"
                    },
                    v5
                  ],
                  "kind": "ScalarField",
                  "name": "dataQualityMetric",
                  "storageKey": null
                },
                {
                  "alias": "p1",
                  "args": [
                    {
                      "kind": "Literal",
                      "name": "metric",
                      "value": "p01"
                    },
                    v5
                  ],
                  "kind": "ScalarField",
                  "name": "dataQualityMetric",
                  "storageKey": null
                },
                {
                  "condition": "hasReference",
                  "kind": "Condition",
                  "passingValue": true,
                  "selections": [
                    {
                      "alias": "referenceCardinality",
                      "args": [
                        v122,
                        v10
                      ],
                      "kind": "ScalarField",
                      "name": "dataQualityMetric",
                      "storageKey": 'dataQualityMetric(datasetRole:"reference",metric:"cardinality")'
                    },
                    {
                      "alias": "referencePercentEmpty",
                      "args": [
                        v122,
                        v11
                      ],
                      "kind": "ScalarField",
                      "name": "dataQualityMetric",
                      "storageKey": 'dataQualityMetric(datasetRole:"reference",metric:"percentEmpty")'
                    }
                  ]
                }
              ],
              "type": "Dimension",
              "abstractKey": null
            }
          ],
          "storageKey": null
        }
      ]
    },
    "params": {
      "cacheID": "9c8cfb791dbd8ff321722f2864db30e9",
      "id": null,
      "metadata": {},
      "name": "DimensionPageQuery",
      "operationKind": "query",
      "text": "query DimensionPageQuery(\n  $dimensionId: GlobalID!\n  $timeRange: TimeRange!\n  $hasReference: Boolean!\n) {\n  dimension: node(id: $dimensionId) {\n    __typename\n    ... on Dimension {\n      id\n      ...DimensionSegmentsBarChart_dimension_3E0ZE6\n      ...DimensionCountStats_dimension_3E0ZE6\n      ...DimensionDriftStats_dimension_3E0ZE6\n      ...DimensionCardinalityStats_dimension_1JBzL3\n      ...DimensionPercentEmptyStats_dimension_1JBzL3\n      ...DimensionQuantilesStats_dimension_3E0ZE6\n    }\n    __isNode: __typename\n    id\n  }\n}\n\nfragment DimensionCardinalityStats_dimension_1JBzL3 on Dimension {\n  id\n  cardinality: dataQualityMetric(metric: cardinality, timeRange: $timeRange)\n  referenceCardinality: dataQualityMetric(metric: cardinality, datasetRole: reference) @include(if: $hasReference)\n}\n\nfragment DimensionCountStats_dimension_3E0ZE6 on Dimension {\n  id\n  count: dataQualityMetric(metric: count, timeRange: $timeRange)\n}\n\nfragment DimensionDriftStats_dimension_3E0ZE6 on Dimension {\n  id\n  psi: driftMetric(metric: psi, timeRange: $timeRange)\n}\n\nfragment DimensionPercentEmptyStats_dimension_1JBzL3 on Dimension {\n  id\n  percentEmpty: dataQualityMetric(metric: percentEmpty, timeRange: $timeRange)\n  referencePercentEmpty: dataQualityMetric(metric: percentEmpty, datasetRole: reference) @include(if: $hasReference)\n}\n\nfragment DimensionQuantilesStats_dimension_3E0ZE6 on Dimension {\n  p99: dataQualityMetric(metric: p99, timeRange: $timeRange)\n  p75: dataQualityMetric(metric: p75, timeRange: $timeRange)\n  p50: dataQualityMetric(metric: p50, timeRange: $timeRange)\n  p25: dataQualityMetric(metric: p25, timeRange: $timeRange)\n  p1: dataQualityMetric(metric: p01, timeRange: $timeRange)\n}\n\nfragment DimensionSegmentsBarChart_dimension_3E0ZE6 on Dimension {\n  id\n  segmentsComparison(primaryTimeRange: $timeRange) {\n    segments {\n      bin {\n        __typename\n        ... on NominalBin {\n          __typename\n          name\n        }\n        ... on IntervalBin {\n          __typename\n          range {\n            start\n            end\n          }\n        }\n        ... on MissingValueBin {\n          __typename\n        }\n      }\n      counts {\n        primaryValue\n      }\n    }\n    totalCounts {\n      primaryValue\n    }\n  }\n}\n"
    }
  };
}();
node39.hash = "d194bfd656408e8ba7cb427ddc80fc85";
var DimensionPageQuery_graphql_default = node39;

// src/pages/dimension/DimensionPage.tsx
var import_react188 = __toESM(require_react());
var import_react_relay34 = __toESM(require_react_relay());

// src/pages/dimension/__generated__/DimensionCardinalityStats_dimension.graphql.ts
var node40 = function() {
  var v0 = {
    "kind": "Literal",
    "name": "metric",
    "value": "cardinality"
  };
  return {
    "argumentDefinitions": [
      {
        "defaultValue": null,
        "kind": "LocalArgument",
        "name": "hasReference"
      },
      {
        "defaultValue": null,
        "kind": "LocalArgument",
        "name": "timeRange"
      }
    ],
    "kind": "Fragment",
    "metadata": null,
    "name": "DimensionCardinalityStats_dimension",
    "selections": [
      {
        "alias": null,
        "args": null,
        "kind": "ScalarField",
        "name": "id",
        "storageKey": null
      },
      {
        "alias": "cardinality",
        "args": [
          v0,
          {
            "kind": "Variable",
            "name": "timeRange",
            "variableName": "timeRange"
          }
        ],
        "kind": "ScalarField",
        "name": "dataQualityMetric",
        "storageKey": null
      },
      {
        "condition": "hasReference",
        "kind": "Condition",
        "passingValue": true,
        "selections": [
          {
            "alias": "referenceCardinality",
            "args": [
              {
                "kind": "Literal",
                "name": "datasetRole",
                "value": "reference"
              },
              v0
            ],
            "kind": "ScalarField",
            "name": "dataQualityMetric",
            "storageKey": 'dataQualityMetric(datasetRole:"reference",metric:"cardinality")'
          }
        ]
      }
    ],
    "type": "Dimension",
    "abstractKey": null
  };
}();
node40.hash = "64914c9034900600ea929cfbc657a000";
var DimensionCardinalityStats_dimension_graphql_default = node40;

// src/pages/dimension/DimensionCardinalityStats.tsx
var import_react_relay22 = __toESM(require_react_relay());
function DimensionCardinalityStats(props) {
  const data = (0, import_react_relay22.useFragment)(
    DimensionCardinalityStats_dimension_graphql_default,
    props.dimension
  );
  return /* @__PURE__ */ jsxs2(Fragment5, { children: [
    /* @__PURE__ */ jsx5(_Text, { elementType: "h3", textSize: "small", color: "text-700", children: "Cardinality" }),
    /* @__PURE__ */ jsx5(_Text, { textSize: "xlarge", children: intFormatter(data.cardinality) }),
    data.referenceCardinality != null && /* @__PURE__ */ jsx5(_Text, { textSize: "medium", color: "designationPurple", children: intFormatter(data.referenceCardinality) })
  ] });
}

// src/pages/dimension/__generated__/DimensionCardinalityTimeSeriesQuery.graphql.ts
var node41 = function() {
  var v0 = {
    "defaultValue": null,
    "kind": "LocalArgument",
    "name": "dimensionId"
  }, v12 = {
    "defaultValue": null,
    "kind": "LocalArgument",
    "name": "granularity"
  }, v22 = {
    "defaultValue": null,
    "kind": "LocalArgument",
    "name": "timeRange"
  }, v32 = [
    {
      "kind": "Variable",
      "name": "id",
      "variableName": "dimensionId"
    }
  ], v4 = {
    "alias": null,
    "args": null,
    "kind": "ScalarField",
    "name": "id",
    "storageKey": null
  }, v5 = {
    "kind": "InlineFragment",
    "selections": [
      {
        "alias": "cardinalityTimeSeries",
        "args": [
          {
            "kind": "Variable",
            "name": "granularity",
            "variableName": "granularity"
          },
          {
            "kind": "Literal",
            "name": "metric",
            "value": "cardinality"
          },
          {
            "kind": "Variable",
            "name": "timeRange",
            "variableName": "timeRange"
          }
        ],
        "concreteType": "DataQualityTimeSeries",
        "kind": "LinkedField",
        "name": "dataQualityTimeSeries",
        "plural": false,
        "selections": [
          {
            "alias": null,
            "args": null,
            "concreteType": "TimeSeriesDataPoint",
            "kind": "LinkedField",
            "name": "data",
            "plural": true,
            "selections": [
              {
                "alias": null,
                "args": null,
                "kind": "ScalarField",
                "name": "timestamp",
                "storageKey": null
              },
              {
                "alias": null,
                "args": null,
                "kind": "ScalarField",
                "name": "value",
                "storageKey": null
              }
            ],
            "storageKey": null
          }
        ],
        "storageKey": null
      }
    ],
    "type": "Dimension",
    "abstractKey": null
  };
  return {
    "fragment": {
      "argumentDefinitions": [
        v0,
        v12,
        v22
      ],
      "kind": "Fragment",
      "metadata": null,
      "name": "DimensionCardinalityTimeSeriesQuery",
      "selections": [
        {
          "alias": "dimension",
          "args": v32,
          "concreteType": null,
          "kind": "LinkedField",
          "name": "node",
          "plural": false,
          "selections": [
            v4,
            v5
          ],
          "storageKey": null
        }
      ],
      "type": "Query",
      "abstractKey": null
    },
    "kind": "Request",
    "operation": {
      "argumentDefinitions": [
        v0,
        v22,
        v12
      ],
      "kind": "Operation",
      "name": "DimensionCardinalityTimeSeriesQuery",
      "selections": [
        {
          "alias": "dimension",
          "args": v32,
          "concreteType": null,
          "kind": "LinkedField",
          "name": "node",
          "plural": false,
          "selections": [
            {
              "alias": null,
              "args": null,
              "kind": "ScalarField",
              "name": "__typename",
              "storageKey": null
            },
            v4,
            v5
          ],
          "storageKey": null
        }
      ]
    },
    "params": {
      "cacheID": "f53e5ac5e0bfd6a0a6c50b761223a617",
      "id": null,
      "metadata": {},
      "name": "DimensionCardinalityTimeSeriesQuery",
      "operationKind": "query",
      "text": "query DimensionCardinalityTimeSeriesQuery(\n  $dimensionId: GlobalID!\n  $timeRange: TimeRange!\n  $granularity: Granularity!\n) {\n  dimension: node(id: $dimensionId) {\n    __typename\n    id\n    ... on Dimension {\n      cardinalityTimeSeries: dataQualityTimeSeries(metric: cardinality, timeRange: $timeRange, granularity: $granularity) {\n        data {\n          timestamp\n          value\n        }\n      }\n    }\n  }\n}\n"
    }
  };
}();
node41.hash = "88ce04bb2022d5e2bc75c663abd7e5de";
var DimensionCardinalityTimeSeriesQuery_graphql_default = node41;

// src/pages/dimension/DimensionCardinalityTimeSeries.tsx
var import_react_relay23 = __toESM(require_react_relay());

// src/pages/dimension/dimensionChartConstants.tsx
var timeSeriesChartMargins = {
  top: 25,
  right: 18,
  left: 18,
  bottom: 5
};

// src/pages/dimension/DimensionCardinalityTimeSeries.tsx
var numberFormatter4 = new Intl.NumberFormat([], {
  maximumFractionDigits: 2
});
var useColors2 = () => {
  const { gray300 } = useChartColors();
  return {
    color: gray300
  };
};
function TooltipContent2({
  active,
  payload,
  label
}) {
  const { color: color2 } = useColors2();
  if (active && payload && payload.length) {
    const cardinality = payload[0]?.value ?? null;
    const cardinalityString = typeof cardinality === "number" ? numberFormatter4.format(cardinality) : "--";
    return /* @__PURE__ */ jsxs2(ChartTooltip, { children: [
      /* @__PURE__ */ jsx5(_Text, { weight: "heavy", textSize: "medium", children: `${fullTimeFormatter(
        new Date(label)
      )}` }),
      /* @__PURE__ */ jsx5(
        ChartTooltipItem,
        {
          color: color2,
          name: "Cardinality",
          value: cardinalityString
        }
      ),
      /* @__PURE__ */ jsx5(ChartTooltipDivider, {})
    ] });
  }
  return null;
}
function DimensionCardinalityTimeSeries({
  dimensionId
}) {
  const { timeRange } = useTimeRange();
  const granularity = calculateGranularity(timeRange);
  const data = (0, import_react_relay23.useLazyLoadQuery)(
    DimensionCardinalityTimeSeriesQuery_graphql_default,
    {
      dimensionId,
      timeRange: {
        start: timeRange.start.toISOString(),
        end: timeRange.end.toISOString()
      },
      granularity
    }
  );
  const { color: color2 } = useColors2();
  const chartData = data.dimension.cardinalityTimeSeries?.data.map((d) => {
    return {
      timestamp: new Date(d.timestamp).valueOf(),
      value: d.value
    };
  }) || [];
  const timeTickFormatter = useTimeTickFormatter({
    samplingIntervalMinutes: granularity.samplingIntervalMinutes
  });
  return /* @__PURE__ */ jsx5(ResponsiveContainer, { width: "100%", height: "100%", children: /* @__PURE__ */ jsxs2(
    ComposedChart,
    {
      data: chartData,
      margin: timeSeriesChartMargins,
      syncId: "dimensionDetails",
      children: [
        /* @__PURE__ */ jsx5("defs", { children: /* @__PURE__ */ jsxs2("linearGradient", { id: "cardinalityColorUv", x1: "0", y1: "0", x2: "0", y2: "1", children: [
          /* @__PURE__ */ jsx5("stop", { offset: "5%", stopColor: color2, stopOpacity: 0.8 }),
          /* @__PURE__ */ jsx5("stop", { offset: "95%", stopColor: color2, stopOpacity: 0 })
        ] }) }),
        /* @__PURE__ */ jsx5(
          XAxis,
          {
            ...defaultTimeXAxisProps,
            tickFormatter: (x2) => timeTickFormatter(new Date(x2))
          }
        ),
        /* @__PURE__ */ jsx5(
          YAxis,
          {
            stroke: theme.colors.gray200,
            label: {
              value: "Cardinality",
              angle: -90,
              position: "insideLeft",
              style: {
                textAnchor: "middle",
                fill: "var(--ac-global-text-color-900)"
              }
            },
            style: { fill: "var(--ac-global-text-color-700)" }
          }
        ),
        /* @__PURE__ */ jsx5(
          CartesianGrid,
          {
            strokeDasharray: "4 4",
            stroke: theme.colors.gray200,
            strokeOpacity: 0.5
          }
        ),
        /* @__PURE__ */ jsx5(Tooltip2, { content: /* @__PURE__ */ jsx5(TooltipContent2, {}) }),
        /* @__PURE__ */ jsx5(
          Area,
          {
            type: "monotone",
            dataKey: "value",
            stroke: color2,
            fillOpacity: 1,
            fill: "url(#cardinalityColorUv)"
          }
        )
      ]
    }
  ) });
}

// src/pages/dimension/__generated__/DimensionCountStats_dimension.graphql.ts
var node42 = {
  "argumentDefinitions": [
    {
      "defaultValue": null,
      "kind": "LocalArgument",
      "name": "timeRange"
    }
  ],
  "kind": "Fragment",
  "metadata": null,
  "name": "DimensionCountStats_dimension",
  "selections": [
    {
      "alias": null,
      "args": null,
      "kind": "ScalarField",
      "name": "id",
      "storageKey": null
    },
    {
      "alias": "count",
      "args": [
        {
          "kind": "Literal",
          "name": "metric",
          "value": "count"
        },
        {
          "kind": "Variable",
          "name": "timeRange",
          "variableName": "timeRange"
        }
      ],
      "kind": "ScalarField",
      "name": "dataQualityMetric",
      "storageKey": null
    }
  ],
  "type": "Dimension",
  "abstractKey": null
};
node42.hash = "6dccac51f3fb0853276677c692af5a43";
var DimensionCountStats_dimension_graphql_default = node42;

// src/pages/dimension/DimensionCountStats.tsx
var import_react_relay24 = __toESM(require_react_relay());
function DimensionCountStats(props) {
  const data = (0, import_react_relay24.useFragment)(
    DimensionCountStats_dimension_graphql_default,
    props.dimension
  );
  const count2 = data.count ?? 0;
  return /* @__PURE__ */ jsxs2(Fragment5, { children: [
    /* @__PURE__ */ jsx5(_Text, { elementType: "h3", textSize: "small", color: "text-700", children: "Total Count" }),
    /* @__PURE__ */ jsx5(_Text, { textSize: "xlarge", children: intFormatter(count2) })
  ] });
}

// src/pages/dimension/__generated__/DimensionCountTimeSeriesQuery.graphql.ts
var node43 = function() {
  var v0 = {
    "defaultValue": null,
    "kind": "LocalArgument",
    "name": "countGranularity"
  }, v12 = {
    "defaultValue": null,
    "kind": "LocalArgument",
    "name": "dimensionId"
  }, v22 = {
    "defaultValue": null,
    "kind": "LocalArgument",
    "name": "timeRange"
  }, v32 = [
    {
      "kind": "Variable",
      "name": "id",
      "variableName": "dimensionId"
    }
  ], v4 = {
    "alias": null,
    "args": null,
    "kind": "ScalarField",
    "name": "id",
    "storageKey": null
  }, v5 = {
    "kind": "InlineFragment",
    "selections": [
      {
        "alias": "trafficTimeSeries",
        "args": [
          {
            "kind": "Variable",
            "name": "granularity",
            "variableName": "countGranularity"
          },
          {
            "kind": "Literal",
            "name": "metric",
            "value": "count"
          },
          {
            "kind": "Variable",
            "name": "timeRange",
            "variableName": "timeRange"
          }
        ],
        "concreteType": "DataQualityTimeSeries",
        "kind": "LinkedField",
        "name": "dataQualityTimeSeries",
        "plural": false,
        "selections": [
          {
            "alias": null,
            "args": null,
            "concreteType": "TimeSeriesDataPoint",
            "kind": "LinkedField",
            "name": "data",
            "plural": true,
            "selections": [
              {
                "alias": null,
                "args": null,
                "kind": "ScalarField",
                "name": "timestamp",
                "storageKey": null
              },
              {
                "alias": null,
                "args": null,
                "kind": "ScalarField",
                "name": "value",
                "storageKey": null
              }
            ],
            "storageKey": null
          }
        ],
        "storageKey": null
      }
    ],
    "type": "Dimension",
    "abstractKey": null
  };
  return {
    "fragment": {
      "argumentDefinitions": [
        v0,
        v12,
        v22
      ],
      "kind": "Fragment",
      "metadata": null,
      "name": "DimensionCountTimeSeriesQuery",
      "selections": [
        {
          "alias": "embedding",
          "args": v32,
          "concreteType": null,
          "kind": "LinkedField",
          "name": "node",
          "plural": false,
          "selections": [
            v4,
            v5
          ],
          "storageKey": null
        }
      ],
      "type": "Query",
      "abstractKey": null
    },
    "kind": "Request",
    "operation": {
      "argumentDefinitions": [
        v12,
        v22,
        v0
      ],
      "kind": "Operation",
      "name": "DimensionCountTimeSeriesQuery",
      "selections": [
        {
          "alias": "embedding",
          "args": v32,
          "concreteType": null,
          "kind": "LinkedField",
          "name": "node",
          "plural": false,
          "selections": [
            {
              "alias": null,
              "args": null,
              "kind": "ScalarField",
              "name": "__typename",
              "storageKey": null
            },
            v4,
            v5
          ],
          "storageKey": null
        }
      ]
    },
    "params": {
      "cacheID": "1f9eff6d8d453148844edae32b844df7",
      "id": null,
      "metadata": {},
      "name": "DimensionCountTimeSeriesQuery",
      "operationKind": "query",
      "text": "query DimensionCountTimeSeriesQuery(\n  $dimensionId: GlobalID!\n  $timeRange: TimeRange!\n  $countGranularity: Granularity!\n) {\n  embedding: node(id: $dimensionId) {\n    __typename\n    id\n    ... on Dimension {\n      trafficTimeSeries: dataQualityTimeSeries(metric: count, timeRange: $timeRange, granularity: $countGranularity) {\n        data {\n          timestamp\n          value\n        }\n      }\n    }\n  }\n}\n"
    }
  };
}();
node43.hash = "9677ef7c6b298554824fe3fd3904c7aa";
var DimensionCountTimeSeriesQuery_graphql_default = node43;

// src/pages/dimension/DimensionCountTimeSeries.tsx
var import_react_relay25 = __toESM(require_react_relay());
var numberFormatter5 = new Intl.NumberFormat([], {
  maximumFractionDigits: 2
});
var useColors3 = () => {
  const { gray300 } = useChartColors();
  return {
    barColor: gray300
  };
};
function TooltipContent3({
  active,
  payload,
  label
}) {
  const { barColor } = useColors3();
  if (active && payload && payload.length) {
    const count2 = payload[0]?.value ?? null;
    const predictionCountString = typeof count2 === "number" ? numberFormatter5.format(count2) : "--";
    return /* @__PURE__ */ jsxs2(ChartTooltip, { children: [
      /* @__PURE__ */ jsx5(_Text, { weight: "heavy", textSize: "medium", children: `${fullTimeFormatter(
        new Date(label)
      )}` }),
      /* @__PURE__ */ jsx5(
        ChartTooltipItem,
        {
          color: barColor,
          shape: "square",
          name: "Count",
          value: predictionCountString
        }
      )
    ] });
  }
  return null;
}
function DimensionCountTimeSeries({
  dimensionId
}) {
  const { timeRange } = useTimeRange();
  const countGranularity = calculateGranularity(timeRange);
  const data = (0, import_react_relay25.useLazyLoadQuery)(
    DimensionCountTimeSeriesQuery_graphql_default,
    {
      dimensionId,
      timeRange: {
        start: timeRange.start.toISOString(),
        end: timeRange.end.toISOString()
      },
      countGranularity
    }
  );
  const chartRawData = data.embedding.trafficTimeSeries?.data || [];
  const chartData = chartRawData.map((d) => {
    return {
      ...d,
      timestamp: new Date(d.timestamp).valueOf()
    };
  });
  const timeTickFormatter = useTimeTickFormatter({
    samplingIntervalMinutes: countGranularity.samplingIntervalMinutes
  });
  const { barColor } = useColors3();
  return /* @__PURE__ */ jsx5(ResponsiveContainer, { width: "100%", height: "100%", children: /* @__PURE__ */ jsxs2(
    BarChart,
    {
      data: chartData,
      margin: timeSeriesChartMargins,
      syncId: "dimensionDetails",
      children: [
        /* @__PURE__ */ jsx5("defs", { children: /* @__PURE__ */ jsxs2("linearGradient", { id: "countBarColor", x1: "0", y1: "0", x2: "0", y2: "1", children: [
          /* @__PURE__ */ jsx5("stop", { offset: "5%", stopColor: barColor, stopOpacity: 1 }),
          /* @__PURE__ */ jsx5("stop", { offset: "95%", stopColor: barColor, stopOpacity: 0.5 })
        ] }) }),
        /* @__PURE__ */ jsx5(
          XAxis,
          {
            ...defaultTimeXAxisProps,
            tickFormatter: (x2) => timeTickFormatter(new Date(x2))
          }
        ),
        /* @__PURE__ */ jsx5(
          YAxis,
          {
            stroke: theme.colors.gray200,
            label: {
              value: "Count",
              angle: -90,
              position: "insideLeft",
              style: {
                textAnchor: "middle",
                fill: "var(--ac-global-text-color-900)"
              }
            },
            style: { fill: "var(--ac-global-text-color-700)" }
          }
        ),
        /* @__PURE__ */ jsx5(
          CartesianGrid,
          {
            strokeDasharray: "4 4",
            stroke: theme.colors.gray200,
            strokeOpacity: 0.5
          }
        ),
        /* @__PURE__ */ jsx5(
          Tooltip2,
          {
            ...defaultBarChartTooltipProps,
            content: /* @__PURE__ */ jsx5(TooltipContent3, {})
          }
        ),
        /* @__PURE__ */ jsx5(Bar, { dataKey: "value", fill: "url(#countBarColor)", spacing: 5 })
      ]
    }
  ) });
}

// src/pages/dimension/__generated__/DimensionDriftBreakdownSegmentBarChartQuery.graphql.ts
var node44 = function() {
  var v0 = [
    {
      "defaultValue": null,
      "kind": "LocalArgument",
      "name": "dimensionId"
    },
    {
      "defaultValue": null,
      "kind": "LocalArgument",
      "name": "timeRange"
    }
  ], v12 = [
    {
      "kind": "Variable",
      "name": "id",
      "variableName": "dimensionId"
    }
  ], v22 = {
    "alias": null,
    "args": null,
    "kind": "ScalarField",
    "name": "id",
    "storageKey": null
  }, v32 = [
    {
      "kind": "Variable",
      "name": "primaryTimeRange",
      "variableName": "timeRange"
    }
  ], v4 = {
    "alias": null,
    "args": null,
    "kind": "ScalarField",
    "name": "__typename",
    "storageKey": null
  }, v5 = {
    "alias": null,
    "args": null,
    "kind": "ScalarField",
    "name": "name",
    "storageKey": null
  }, v6 = {
    "alias": null,
    "args": null,
    "concreteType": "NumericRange",
    "kind": "LinkedField",
    "name": "range",
    "plural": false,
    "selections": [
      {
        "alias": null,
        "args": null,
        "kind": "ScalarField",
        "name": "start",
        "storageKey": null
      },
      {
        "alias": null,
        "args": null,
        "kind": "ScalarField",
        "name": "end",
        "storageKey": null
      }
    ],
    "storageKey": null
  }, v7 = [
    {
      "alias": null,
      "args": null,
      "kind": "ScalarField",
      "name": "primaryValue",
      "storageKey": null
    },
    {
      "alias": null,
      "args": null,
      "kind": "ScalarField",
      "name": "referenceValue",
      "storageKey": null
    }
  ], v8 = {
    "alias": null,
    "args": null,
    "concreteType": "DatasetValues",
    "kind": "LinkedField",
    "name": "counts",
    "plural": false,
    "selections": v7,
    "storageKey": null
  }, v9 = {
    "alias": null,
    "args": null,
    "concreteType": "DatasetValues",
    "kind": "LinkedField",
    "name": "totalCounts",
    "plural": false,
    "selections": v7,
    "storageKey": null
  };
  return {
    "fragment": {
      "argumentDefinitions": v0,
      "kind": "Fragment",
      "metadata": null,
      "name": "DimensionDriftBreakdownSegmentBarChartQuery",
      "selections": [
        {
          "alias": "dimension",
          "args": v12,
          "concreteType": null,
          "kind": "LinkedField",
          "name": "node",
          "plural": false,
          "selections": [
            v22,
            {
              "kind": "InlineFragment",
              "selections": [
                {
                  "kind": "RequiredField",
                  "field": {
                    "alias": null,
                    "args": v32,
                    "concreteType": "Segments",
                    "kind": "LinkedField",
                    "name": "segmentsComparison",
                    "plural": false,
                    "selections": [
                      {
                        "alias": null,
                        "args": null,
                        "concreteType": "Segment",
                        "kind": "LinkedField",
                        "name": "segments",
                        "plural": true,
                        "selections": [
                          {
                            "alias": null,
                            "args": null,
                            "concreteType": null,
                            "kind": "LinkedField",
                            "name": "bin",
                            "plural": false,
                            "selections": [
                              {
                                "kind": "InlineFragment",
                                "selections": [
                                  v4,
                                  v5
                                ],
                                "type": "NominalBin",
                                "abstractKey": null
                              },
                              {
                                "kind": "InlineFragment",
                                "selections": [
                                  v4,
                                  v6
                                ],
                                "type": "IntervalBin",
                                "abstractKey": null
                              },
                              {
                                "kind": "InlineFragment",
                                "selections": [
                                  v4
                                ],
                                "type": "MissingValueBin",
                                "abstractKey": null
                              }
                            ],
                            "storageKey": null
                          },
                          v8
                        ],
                        "storageKey": null
                      },
                      v9
                    ],
                    "storageKey": null
                  },
                  "action": "THROW",
                  "path": "dimension.segmentsComparison"
                }
              ],
              "type": "Dimension",
              "abstractKey": null
            }
          ],
          "storageKey": null
        }
      ],
      "type": "Query",
      "abstractKey": null
    },
    "kind": "Request",
    "operation": {
      "argumentDefinitions": v0,
      "kind": "Operation",
      "name": "DimensionDriftBreakdownSegmentBarChartQuery",
      "selections": [
        {
          "alias": "dimension",
          "args": v12,
          "concreteType": null,
          "kind": "LinkedField",
          "name": "node",
          "plural": false,
          "selections": [
            v4,
            v22,
            {
              "kind": "InlineFragment",
              "selections": [
                {
                  "alias": null,
                  "args": v32,
                  "concreteType": "Segments",
                  "kind": "LinkedField",
                  "name": "segmentsComparison",
                  "plural": false,
                  "selections": [
                    {
                      "alias": null,
                      "args": null,
                      "concreteType": "Segment",
                      "kind": "LinkedField",
                      "name": "segments",
                      "plural": true,
                      "selections": [
                        {
                          "alias": null,
                          "args": null,
                          "concreteType": null,
                          "kind": "LinkedField",
                          "name": "bin",
                          "plural": false,
                          "selections": [
                            v4,
                            {
                              "kind": "InlineFragment",
                              "selections": [
                                v5
                              ],
                              "type": "NominalBin",
                              "abstractKey": null
                            },
                            {
                              "kind": "InlineFragment",
                              "selections": [
                                v6
                              ],
                              "type": "IntervalBin",
                              "abstractKey": null
                            }
                          ],
                          "storageKey": null
                        },
                        v8
                      ],
                      "storageKey": null
                    },
                    v9
                  ],
                  "storageKey": null
                }
              ],
              "type": "Dimension",
              "abstractKey": null
            }
          ],
          "storageKey": null
        }
      ]
    },
    "params": {
      "cacheID": "7d11d88f419003f5ee8cd9d11312e427",
      "id": null,
      "metadata": {},
      "name": "DimensionDriftBreakdownSegmentBarChartQuery",
      "operationKind": "query",
      "text": "query DimensionDriftBreakdownSegmentBarChartQuery(\n  $dimensionId: GlobalID!\n  $timeRange: TimeRange!\n) {\n  dimension: node(id: $dimensionId) {\n    __typename\n    id\n    ... on Dimension {\n      segmentsComparison(primaryTimeRange: $timeRange) {\n        segments {\n          bin {\n            __typename\n            ... on NominalBin {\n              __typename\n              name\n            }\n            ... on IntervalBin {\n              __typename\n              range {\n                start\n                end\n              }\n            }\n            ... on MissingValueBin {\n              __typename\n            }\n          }\n          counts {\n            primaryValue\n            referenceValue\n          }\n        }\n        totalCounts {\n          primaryValue\n          referenceValue\n        }\n      }\n    }\n  }\n}\n"
    }
  };
}();
node44.hash = "6bb76e3cce4ee28c333e485b3aa2dffd";
var DimensionDriftBreakdownSegmentBarChartQuery_graphql_default = node44;

// src/pages/dimension/DimensionDriftBreakdownSegmentBarChart.tsx
var import_react182 = __toESM(require_react());
var import_react_relay26 = __toESM(require_react_relay());
var formatter = format2(".2f");
var useColors4 = () => {
  const { primary, reference } = useChartColors();
  return {
    primaryBarColor: primary,
    referenceBarColor: reference
  };
};
function TooltipContent4({
  active,
  payload,
  label
}) {
  const { primaryBarColor, referenceBarColor } = useColors4();
  if (active && payload && payload.length) {
    const primaryLabel = payload[0]?.payload?.primaryName;
    const primaryValue = payload[0]?.value;
    const referenceLabel = payload[0]?.payload?.referenceName;
    const referenceValue = payload[1]?.value;
    return /* @__PURE__ */ jsxs2(ChartTooltip, { children: [
      /* @__PURE__ */ jsx5(_Text, { elementType: "h3", textSize: "medium", weight: "heavy", children: label }),
      /* @__PURE__ */ jsx5(
        ChartTooltipItem,
        {
          color: primaryBarColor,
          shape: "square",
          name: primaryLabel,
          value: primaryValue != null ? `${formatter(primaryValue)}%` : "--"
        }
      ),
      /* @__PURE__ */ jsx5(
        ChartTooltipItem,
        {
          color: referenceBarColor,
          shape: "square",
          name: referenceLabel,
          value: referenceValue != null ? `${formatter(referenceValue)}%` : "--"
        }
      )
    ] });
  }
  return null;
}
function DimensionDriftBreakdownSegmentBarChart(props) {
  const { primaryDataset, referenceDataset } = useDatasets();
  const primaryName = primaryDataset.name;
  const referenceName = referenceDataset?.name || "reference";
  const { selectedTimestamp } = useTimeSlice();
  const endTime = (0, import_react182.useMemo)(
    () => selectedTimestamp ?? new Date(primaryDataset.endTime),
    [selectedTimestamp, primaryDataset.endTime]
  );
  const timeRange = (0, import_react182.useMemo)(() => {
    return {
      start: subDays(endTime, 2).toISOString(),
      end: endTime.toISOString()
    };
  }, [endTime]);
  const data = (0, import_react_relay26.useLazyLoadQuery)(
    DimensionDriftBreakdownSegmentBarChartQuery_graphql_default,
    { dimensionId: props.dimensionId, timeRange }
  );
  const chartData = (0, import_react182.useMemo)(() => {
    const segments = data.dimension.segmentsComparison?.segments ?? [];
    const primaryTotal = data.dimension.segmentsComparison?.totalCounts?.primaryValue ?? 0;
    const referenceTotal = data.dimension.segmentsComparison?.totalCounts?.referenceValue ?? 0;
    return segments.map((segment) => {
      const primarySegmentCount = segment.counts?.primaryValue ?? 0;
      const referenceSegmentCount = segment.counts?.referenceValue ?? 0;
      const binName = getBinName(segment.bin);
      const primaryPercent = primarySegmentCount / primaryTotal * 100;
      const referencePercent = referenceSegmentCount / referenceTotal * 100;
      return {
        name: binName,
        primaryName,
        referenceName,
        primaryPercent,
        referencePercent
      };
    });
  }, [
    data.dimension.segmentsComparison?.segments,
    data.dimension.segmentsComparison?.totalCounts?.primaryValue,
    data.dimension.segmentsComparison?.totalCounts?.referenceValue,
    primaryName,
    referenceName
  ]);
  const { primaryBarColor, referenceBarColor } = useColors4();
  return /* @__PURE__ */ jsxs2(_Flex, { direction: "column", height: "100%", children: [
    /* @__PURE__ */ jsx5(_View, { flex: "none", paddingTop: "size-100", paddingStart: "size-200", children: /* @__PURE__ */ jsx5(
      _Text,
      {
        elementType: "h3",
        textSize: "medium",
        color: "text-700",
        children: `Distribution comparison at ${fullTimeFormatter(
          new Date(timeRange.end)
        )}`
      }
    ) }),
    /* @__PURE__ */ jsx5(_View, { flex: true, children: /* @__PURE__ */ jsx5(ResponsiveContainer, { children: /* @__PURE__ */ jsxs2(
      BarChart,
      {
        data: chartData,
        margin: {
          top: 15,
          right: 18,
          left: 18,
          bottom: 5
        },
        children: [
          /* @__PURE__ */ jsxs2("defs", { children: [
            /* @__PURE__ */ jsxs2(
              "linearGradient",
              {
                id: "dimensionPrimarySegmentsBarColor",
                x1: "0",
                y1: "0",
                x2: "0",
                y2: "1",
                children: [
                  /* @__PURE__ */ jsx5("stop", { offset: "5%", stopColor: primaryBarColor, stopOpacity: 1 }),
                  /* @__PURE__ */ jsx5(
                    "stop",
                    {
                      offset: "95%",
                      stopColor: primaryBarColor,
                      stopOpacity: 0.5
                    }
                  )
                ]
              }
            ),
            /* @__PURE__ */ jsxs2(
              "linearGradient",
              {
                id: "dimensionReferenceSegmentsBarColor",
                x1: "0",
                y1: "0",
                x2: "0",
                y2: "1",
                children: [
                  /* @__PURE__ */ jsx5(
                    "stop",
                    {
                      offset: "5%",
                      stopColor: referenceBarColor,
                      stopOpacity: 1
                    }
                  ),
                  /* @__PURE__ */ jsx5(
                    "stop",
                    {
                      offset: "95%",
                      stopColor: referenceBarColor,
                      stopOpacity: 0.5
                    }
                  )
                ]
              }
            )
          ] }),
          /* @__PURE__ */ jsx5(
            XAxis,
            {
              dataKey: "name",
              style: { fill: "var(--ac-global-text-color-700)" }
            }
          ),
          /* @__PURE__ */ jsx5(
            YAxis,
            {
              stroke: theme.colors.gray200,
              label: {
                value: "Percent",
                angle: -90,
                position: "insideLeft",
                style: {
                  textAnchor: "middle",
                  fill: "var(--ac-global-text-color-900)"
                }
              },
              style: { fill: "var(--ac-global-text-color-700)" }
            }
          ),
          /* @__PURE__ */ jsx5(
            CartesianGrid,
            {
              strokeDasharray: "4 4",
              stroke: theme.colors.gray200,
              strokeOpacity: 0.5
            }
          ),
          /* @__PURE__ */ jsx5(
            Tooltip2,
            {
              ...defaultBarChartTooltipProps,
              content: /* @__PURE__ */ jsx5(TooltipContent4, {})
            }
          ),
          /* @__PURE__ */ jsx5(
            Bar,
            {
              dataKey: "primaryPercent",
              fill: "url(#dimensionPrimarySegmentsBarColor)"
            }
          ),
          /* @__PURE__ */ jsx5(
            Bar,
            {
              dataKey: "referencePercent",
              fill: "url(#dimensionReferenceSegmentsBarColor)"
            }
          )
        ]
      }
    ) }) })
  ] });
}

// src/pages/dimension/__generated__/DimensionDriftStats_dimension.graphql.ts
var node45 = {
  "argumentDefinitions": [
    {
      "defaultValue": null,
      "kind": "LocalArgument",
      "name": "timeRange"
    }
  ],
  "kind": "Fragment",
  "metadata": null,
  "name": "DimensionDriftStats_dimension",
  "selections": [
    {
      "alias": null,
      "args": null,
      "kind": "ScalarField",
      "name": "id",
      "storageKey": null
    },
    {
      "alias": "psi",
      "args": [
        {
          "kind": "Literal",
          "name": "metric",
          "value": "psi"
        },
        {
          "kind": "Variable",
          "name": "timeRange",
          "variableName": "timeRange"
        }
      ],
      "kind": "ScalarField",
      "name": "driftMetric",
      "storageKey": null
    }
  ],
  "type": "Dimension",
  "abstractKey": null
};
node45.hash = "f8a9fb08a14f63906e38bc247d50b189";
var DimensionDriftStats_dimension_graphql_default = node45;

// src/pages/dimension/DimensionDriftStats.tsx
var import_react_relay27 = __toESM(require_react_relay());
var contextualHelp4 = /* @__PURE__ */ jsxs2(_ContextualHelp, { variant: "info", placement: "top end", children: [
  /* @__PURE__ */ jsx5(_Heading, { weight: "heavy", level: 4, children: "Population Stability Index" }),
  /* @__PURE__ */ jsx5(_Content, { children: /* @__PURE__ */ jsx5(_Text, { children: "PSI is a symmetric metric that measures the relative entropy, or difference in information represented by two distributions. It can be thought of as measuring the distance between two data distributions showing how different the two distributions are from each other." }) }),
  /* @__PURE__ */ jsx5("footer", { children: /* @__PURE__ */ jsx5(ExternalLink, { href: "https://arize.com/blog-course/population-stability-index-psi/#:~:text=Population%20Stability%20Index%20(PSI)%20Overview,distributions%20are%20from%20each%20other.", children: "Learn more" }) })
] });
function DimensionDriftStats(props) {
  const data = (0, import_react_relay27.useFragment)(
    DimensionDriftStats_dimension_graphql_default,
    props.dimension
  );
  return /* @__PURE__ */ jsxs2(Fragment5, { children: [
    /* @__PURE__ */ jsxs2(_Flex, { direction: "row", alignItems: "center", gap: "size-25", children: [
      /* @__PURE__ */ jsx5(_Text, { elementType: "h3", textSize: "small", color: "text-700", children: "PSI" }),
      contextualHelp4
    ] }),
    /* @__PURE__ */ jsx5(_Text, { textSize: "xlarge", children: floatFormatter(data.psi) })
  ] });
}

// src/pages/dimension/__generated__/DimensionDriftTimeSeriesQuery.graphql.ts
var node46 = function() {
  var v0 = {
    "defaultValue": null,
    "kind": "LocalArgument",
    "name": "countGranularity"
  }, v12 = {
    "defaultValue": null,
    "kind": "LocalArgument",
    "name": "dimensionId"
  }, v22 = {
    "defaultValue": null,
    "kind": "LocalArgument",
    "name": "driftGranularity"
  }, v32 = {
    "defaultValue": null,
    "kind": "LocalArgument",
    "name": "timeRange"
  }, v4 = [
    {
      "kind": "Variable",
      "name": "id",
      "variableName": "dimensionId"
    }
  ], v5 = {
    "alias": null,
    "args": null,
    "kind": "ScalarField",
    "name": "id",
    "storageKey": null
  }, v6 = {
    "kind": "Variable",
    "name": "timeRange",
    "variableName": "timeRange"
  }, v7 = [
    {
      "alias": null,
      "args": null,
      "concreteType": "TimeSeriesDataPoint",
      "kind": "LinkedField",
      "name": "data",
      "plural": true,
      "selections": [
        {
          "alias": null,
          "args": null,
          "kind": "ScalarField",
          "name": "timestamp",
          "storageKey": null
        },
        {
          "alias": null,
          "args": null,
          "kind": "ScalarField",
          "name": "value",
          "storageKey": null
        }
      ],
      "storageKey": null
    }
  ], v8 = {
    "kind": "InlineFragment",
    "selections": [
      {
        "alias": null,
        "args": [
          {
            "kind": "Variable",
            "name": "granularity",
            "variableName": "driftGranularity"
          },
          {
            "kind": "Literal",
            "name": "metric",
            "value": "psi"
          },
          v6
        ],
        "concreteType": "DriftTimeSeries",
        "kind": "LinkedField",
        "name": "driftTimeSeries",
        "plural": false,
        "selections": v7,
        "storageKey": null
      },
      {
        "alias": "trafficTimeSeries",
        "args": [
          {
            "kind": "Variable",
            "name": "granularity",
            "variableName": "countGranularity"
          },
          {
            "kind": "Literal",
            "name": "metric",
            "value": "count"
          },
          v6
        ],
        "concreteType": "DataQualityTimeSeries",
        "kind": "LinkedField",
        "name": "dataQualityTimeSeries",
        "plural": false,
        "selections": v7,
        "storageKey": null
      }
    ],
    "type": "Dimension",
    "abstractKey": null
  };
  return {
    "fragment": {
      "argumentDefinitions": [
        v0,
        v12,
        v22,
        v32
      ],
      "kind": "Fragment",
      "metadata": null,
      "name": "DimensionDriftTimeSeriesQuery",
      "selections": [
        {
          "alias": "embedding",
          "args": v4,
          "concreteType": null,
          "kind": "LinkedField",
          "name": "node",
          "plural": false,
          "selections": [
            v5,
            v8
          ],
          "storageKey": null
        }
      ],
      "type": "Query",
      "abstractKey": null
    },
    "kind": "Request",
    "operation": {
      "argumentDefinitions": [
        v12,
        v32,
        v22,
        v0
      ],
      "kind": "Operation",
      "name": "DimensionDriftTimeSeriesQuery",
      "selections": [
        {
          "alias": "embedding",
          "args": v4,
          "concreteType": null,
          "kind": "LinkedField",
          "name": "node",
          "plural": false,
          "selections": [
            {
              "alias": null,
              "args": null,
              "kind": "ScalarField",
              "name": "__typename",
              "storageKey": null
            },
            v5,
            v8
          ],
          "storageKey": null
        }
      ]
    },
    "params": {
      "cacheID": "af2d25e28675891b3c8a6bc75027f731",
      "id": null,
      "metadata": {},
      "name": "DimensionDriftTimeSeriesQuery",
      "operationKind": "query",
      "text": "query DimensionDriftTimeSeriesQuery(\n  $dimensionId: GlobalID!\n  $timeRange: TimeRange!\n  $driftGranularity: Granularity!\n  $countGranularity: Granularity!\n) {\n  embedding: node(id: $dimensionId) {\n    __typename\n    id\n    ... on Dimension {\n      driftTimeSeries(metric: psi, timeRange: $timeRange, granularity: $driftGranularity) {\n        data {\n          timestamp\n          value\n        }\n      }\n      trafficTimeSeries: dataQualityTimeSeries(metric: count, timeRange: $timeRange, granularity: $countGranularity) {\n        data {\n          timestamp\n          value\n        }\n      }\n    }\n  }\n}\n"
    }
  };
}();
node46.hash = "6312b58dbb252b17efdf08d44dd58630";
var DimensionDriftTimeSeriesQuery_graphql_default = node46;

// src/pages/dimension/DimensionDriftTimeSeries.tsx
var import_react183 = __toESM(require_react());
var import_react_relay28 = __toESM(require_react_relay());
var useColors5 = () => {
  const { orange300, gray300 } = useChartColors();
  return {
    color: orange300,
    barColor: gray300
  };
};
function TooltipContent5({
  active,
  payload,
  label
}) {
  const { color: color2 } = useColors5();
  if (active && payload && payload.length) {
    const euclideanDistance = payload[1]?.value ?? null;
    return /* @__PURE__ */ jsxs2(ChartTooltip, { children: [
      /* @__PURE__ */ jsx5(_Text, { weight: "heavy", textSize: "medium", children: `${fullTimeFormatter(
        new Date(label)
      )}` }),
      /* @__PURE__ */ jsx5(
        ChartTooltipItem,
        {
          color: color2,
          name: "PSI",
          value: floatFormatter(euclideanDistance)
        }
      ),
      /* @__PURE__ */ jsx5(ChartTooltipDivider, {}),
      /* @__PURE__ */ jsxs2(
        "div",
        {
          css: css`
            display: flex;
            flex-direction: row;
            align-items: center;
            color: var(--ac-global-color-primary);
            gap: var(--px-spacing-sm);

            margin-top: var(--px-spacing-sm);
          `,
          children: [
            /* @__PURE__ */ jsx5(Icon, { svg: /* @__PURE__ */ jsx5(InfoOutline, {}) }),
            /* @__PURE__ */ jsx5("span", { children: "Click to view details" })
          ]
        }
      )
    ] });
  }
  return null;
}
function DimensionDriftTimeSeries({
  dimensionId
}) {
  const { timeRange } = useTimeRange();
  const { selectedTimestamp, setSelectedTimestamp } = useTimeSlice();
  const countGranularity = calculateGranularity(timeRange);
  const data = (0, import_react_relay28.useLazyLoadQuery)(
    DimensionDriftTimeSeriesQuery_graphql_default,
    {
      dimensionId,
      timeRange: {
        start: timeRange.start.toISOString(),
        end: timeRange.end.toISOString()
      },
      driftGranularity: calculateGranularityWithRollingAverage(timeRange),
      countGranularity
    }
  );
  const chartRawData = data.embedding.driftTimeSeries?.data || [];
  const trafficDataMap = data.embedding.trafficTimeSeries?.data.reduce((acc, traffic) => {
    acc[traffic.timestamp] = traffic.value;
    return acc;
  }, {}) ?? {};
  const chartData = chartRawData.map((d) => {
    const traffic = trafficDataMap[d.timestamp];
    return {
      ...d,
      traffic,
      timestamp: new Date(d.timestamp).valueOf()
    };
  });
  const timeTickFormatter = useTimeTickFormatter({
    samplingIntervalMinutes: countGranularity.samplingIntervalMinutes
  });
  const onClick = (0, import_react183.useCallback)(
    (state) => {
      const { activePayload } = state;
      if (activePayload != null && activePayload.length > 0) {
        const payload = activePayload[0].payload;
        setSelectedTimestamp(new Date(payload.timestamp));
      }
    },
    [setSelectedTimestamp]
  );
  const { color: color2, barColor } = useColors5();
  return /* @__PURE__ */ jsx5(ResponsiveContainer, { width: "100%", height: "100%", children: /* @__PURE__ */ jsxs2(
    ComposedChart,
    {
      data: chartData,
      margin: timeSeriesChartMargins,
      onClick,
      syncId: "dimensionDetails",
      children: [
        /* @__PURE__ */ jsxs2("defs", { children: [
          /* @__PURE__ */ jsxs2(
            "linearGradient",
            {
              id: "dimensionDriftColorUv",
              x1: "0",
              y1: "0",
              x2: "0",
              y2: "1",
              children: [
                /* @__PURE__ */ jsx5("stop", { offset: "5%", stopColor: color2, stopOpacity: 0.8 }),
                /* @__PURE__ */ jsx5("stop", { offset: "95%", stopColor: color2, stopOpacity: 0 })
              ]
            }
          ),
          /* @__PURE__ */ jsxs2("linearGradient", { id: "barColor", x1: "0", y1: "0", x2: "0", y2: "1", children: [
            /* @__PURE__ */ jsx5("stop", { offset: "5%", stopColor: barColor, stopOpacity: 0.8 }),
            /* @__PURE__ */ jsx5("stop", { offset: "95%", stopColor: barColor, stopOpacity: 0 })
          ] })
        ] }),
        /* @__PURE__ */ jsx5(
          XAxis,
          {
            ...defaultTimeXAxisProps,
            tickFormatter: (x2) => timeTickFormatter(new Date(x2))
          }
        ),
        /* @__PURE__ */ jsx5(
          YAxis,
          {
            stroke: theme.colors.gray200,
            label: {
              value: "PSI",
              angle: -90,
              position: "insideLeft",
              style: {
                textAnchor: "middle",
                fill: "var(--ac-global-text-color-900)"
              }
            },
            style: { fill: "var(--ac-global-text-color-700)" }
          }
        ),
        /* @__PURE__ */ jsx5(
          YAxis,
          {
            yAxisId: "right",
            orientation: "right",
            tick: false,
            tickLine: false,
            width: 0
          }
        ),
        /* @__PURE__ */ jsx5(
          CartesianGrid,
          {
            strokeDasharray: "4 4",
            stroke: theme.colors.gray200,
            strokeOpacity: 0.5
          }
        ),
        /* @__PURE__ */ jsx5(Tooltip2, { content: /* @__PURE__ */ jsx5(TooltipContent5, {}) }),
        /* @__PURE__ */ jsx5(
          Bar,
          {
            yAxisId: "right",
            dataKey: "traffic",
            fill: "url(#barColor)",
            spacing: 5
          }
        ),
        /* @__PURE__ */ jsx5(
          Area,
          {
            type: "monotone",
            dataKey: "value",
            stroke: color2,
            fillOpacity: 1,
            fill: "url(#dimensionDriftColorUv)"
          }
        ),
        selectedTimestamp != null ? /* @__PURE__ */ jsx5(
          ReferenceLine,
          {
            ...defaultSelectedTimestampReferenceLineProps,
            x: selectedTimestamp.getTime()
          }
        ) : null
      ]
    }
  ) });
}

// src/pages/dimension/__generated__/DimensionPercentEmptyStats_dimension.graphql.ts
var node47 = function() {
  var v0 = {
    "kind": "Literal",
    "name": "metric",
    "value": "percentEmpty"
  };
  return {
    "argumentDefinitions": [
      {
        "defaultValue": null,
        "kind": "LocalArgument",
        "name": "hasReference"
      },
      {
        "defaultValue": null,
        "kind": "LocalArgument",
        "name": "timeRange"
      }
    ],
    "kind": "Fragment",
    "metadata": null,
    "name": "DimensionPercentEmptyStats_dimension",
    "selections": [
      {
        "alias": null,
        "args": null,
        "kind": "ScalarField",
        "name": "id",
        "storageKey": null
      },
      {
        "alias": "percentEmpty",
        "args": [
          v0,
          {
            "kind": "Variable",
            "name": "timeRange",
            "variableName": "timeRange"
          }
        ],
        "kind": "ScalarField",
        "name": "dataQualityMetric",
        "storageKey": null
      },
      {
        "condition": "hasReference",
        "kind": "Condition",
        "passingValue": true,
        "selections": [
          {
            "alias": "referencePercentEmpty",
            "args": [
              {
                "kind": "Literal",
                "name": "datasetRole",
                "value": "reference"
              },
              v0
            ],
            "kind": "ScalarField",
            "name": "dataQualityMetric",
            "storageKey": 'dataQualityMetric(datasetRole:"reference",metric:"percentEmpty")'
          }
        ]
      }
    ],
    "type": "Dimension",
    "abstractKey": null
  };
}();
node47.hash = "1c925328033ee2cc2139a0b1f9ab212f";
var DimensionPercentEmptyStats_dimension_graphql_default = node47;

// src/pages/dimension/DimensionPercentEmptyStats.tsx
var import_react_relay29 = __toESM(require_react_relay());
function DimensionPercentEmptyStats(props) {
  const data = (0, import_react_relay29.useFragment)(
    DimensionPercentEmptyStats_dimension_graphql_default,
    props.dimension
  );
  return /* @__PURE__ */ jsxs2(Fragment5, { children: [
    /* @__PURE__ */ jsx5(_Text, { elementType: "h3", textSize: "small", color: "text-700", children: "% Empty" }),
    /* @__PURE__ */ jsx5(_Text, { textSize: "xlarge", children: percentFormatter(data.percentEmpty) }),
    data.referencePercentEmpty != null && /* @__PURE__ */ jsx5(_Text, { textSize: "medium", color: "designationPurple", children: percentFormatter(data.referencePercentEmpty) })
  ] });
}

// src/pages/dimension/__generated__/DimensionPercentEmptyTimeSeriesQuery.graphql.ts
var node48 = function() {
  var v0 = {
    "defaultValue": null,
    "kind": "LocalArgument",
    "name": "dimensionId"
  }, v12 = {
    "defaultValue": null,
    "kind": "LocalArgument",
    "name": "granularity"
  }, v22 = {
    "defaultValue": null,
    "kind": "LocalArgument",
    "name": "timeRange"
  }, v32 = [
    {
      "kind": "Variable",
      "name": "id",
      "variableName": "dimensionId"
    }
  ], v4 = {
    "alias": null,
    "args": null,
    "kind": "ScalarField",
    "name": "id",
    "storageKey": null
  }, v5 = {
    "kind": "InlineFragment",
    "selections": [
      {
        "alias": "percentEmptyTimeSeries",
        "args": [
          {
            "kind": "Variable",
            "name": "granularity",
            "variableName": "granularity"
          },
          {
            "kind": "Literal",
            "name": "metric",
            "value": "percentEmpty"
          },
          {
            "kind": "Variable",
            "name": "timeRange",
            "variableName": "timeRange"
          }
        ],
        "concreteType": "DataQualityTimeSeries",
        "kind": "LinkedField",
        "name": "dataQualityTimeSeries",
        "plural": false,
        "selections": [
          {
            "alias": null,
            "args": null,
            "concreteType": "TimeSeriesDataPoint",
            "kind": "LinkedField",
            "name": "data",
            "plural": true,
            "selections": [
              {
                "alias": null,
                "args": null,
                "kind": "ScalarField",
                "name": "timestamp",
                "storageKey": null
              },
              {
                "alias": null,
                "args": null,
                "kind": "ScalarField",
                "name": "value",
                "storageKey": null
              }
            ],
            "storageKey": null
          }
        ],
        "storageKey": null
      }
    ],
    "type": "Dimension",
    "abstractKey": null
  };
  return {
    "fragment": {
      "argumentDefinitions": [
        v0,
        v12,
        v22
      ],
      "kind": "Fragment",
      "metadata": null,
      "name": "DimensionPercentEmptyTimeSeriesQuery",
      "selections": [
        {
          "alias": "embedding",
          "args": v32,
          "concreteType": null,
          "kind": "LinkedField",
          "name": "node",
          "plural": false,
          "selections": [
            v4,
            v5
          ],
          "storageKey": null
        }
      ],
      "type": "Query",
      "abstractKey": null
    },
    "kind": "Request",
    "operation": {
      "argumentDefinitions": [
        v0,
        v22,
        v12
      ],
      "kind": "Operation",
      "name": "DimensionPercentEmptyTimeSeriesQuery",
      "selections": [
        {
          "alias": "embedding",
          "args": v32,
          "concreteType": null,
          "kind": "LinkedField",
          "name": "node",
          "plural": false,
          "selections": [
            {
              "alias": null,
              "args": null,
              "kind": "ScalarField",
              "name": "__typename",
              "storageKey": null
            },
            v4,
            v5
          ],
          "storageKey": null
        }
      ]
    },
    "params": {
      "cacheID": "9be05c72f19755036f4829777a96f97d",
      "id": null,
      "metadata": {},
      "name": "DimensionPercentEmptyTimeSeriesQuery",
      "operationKind": "query",
      "text": "query DimensionPercentEmptyTimeSeriesQuery(\n  $dimensionId: GlobalID!\n  $timeRange: TimeRange!\n  $granularity: Granularity!\n) {\n  embedding: node(id: $dimensionId) {\n    __typename\n    id\n    ... on Dimension {\n      percentEmptyTimeSeries: dataQualityTimeSeries(metric: percentEmpty, timeRange: $timeRange, granularity: $granularity) {\n        data {\n          timestamp\n          value\n        }\n      }\n    }\n  }\n}\n"
    }
  };
}();
node48.hash = "1e843d6c8dbe05b389b24188c6bdb394";
var DimensionPercentEmptyTimeSeriesQuery_graphql_default = node48;

// src/pages/dimension/DimensionPercentEmptyTimeSeries.tsx
var import_react_relay30 = __toESM(require_react_relay());
var numberFormatter6 = new Intl.NumberFormat([], {
  maximumFractionDigits: 2
});
var useColors6 = () => {
  const { gray100 } = useChartColors();
  return {
    color: gray100
  };
};
function TooltipContent6({
  active,
  payload,
  label
}) {
  const { color: color2 } = useColors6();
  if (active && payload && payload.length) {
    const percentEmpty = payload[0]?.value ?? null;
    const percentEmptyString = typeof percentEmpty === "number" ? numberFormatter6.format(percentEmpty) : "--";
    return /* @__PURE__ */ jsxs2(ChartTooltip, { children: [
      /* @__PURE__ */ jsx5(_Text, { weight: "heavy", textSize: "medium", children: `${fullTimeFormatter(
        new Date(label)
      )}` }),
      /* @__PURE__ */ jsx5(
        ChartTooltipItem,
        {
          color: color2,
          name: "% Empty",
          value: percentEmptyString
        }
      )
    ] });
  }
  return null;
}
function DimensionPercentEmptyTimeSeries({
  dimensionId
}) {
  const { timeRange } = useTimeRange();
  const granularity = calculateGranularity(timeRange);
  const data = (0, import_react_relay30.useLazyLoadQuery)(
    DimensionPercentEmptyTimeSeriesQuery_graphql_default,
    {
      dimensionId,
      timeRange: {
        start: timeRange.start.toISOString(),
        end: timeRange.end.toISOString()
      },
      granularity
    }
  );
  const chartData = data.embedding.percentEmptyTimeSeries?.data.map((d) => ({
    timestamp: new Date(d.timestamp).valueOf(),
    value: d.value
  })) || [];
  const timeTickFormatter = useTimeTickFormatter({
    samplingIntervalMinutes: granularity.samplingIntervalMinutes
  });
  const { color: color2 } = useColors6();
  return /* @__PURE__ */ jsx5(ResponsiveContainer, { width: "100%", height: "100%", children: /* @__PURE__ */ jsxs2(
    ComposedChart,
    {
      data: chartData,
      margin: timeSeriesChartMargins,
      syncId: "dimensionDetails",
      children: [
        /* @__PURE__ */ jsx5("defs", { children: /* @__PURE__ */ jsxs2("linearGradient", { id: "percentEmptyColorUv", x1: "0", y1: "0", x2: "0", y2: "1", children: [
          /* @__PURE__ */ jsx5("stop", { offset: "5%", stopColor: color2, stopOpacity: 0.8 }),
          /* @__PURE__ */ jsx5("stop", { offset: "95%", stopColor: color2, stopOpacity: 0 })
        ] }) }),
        /* @__PURE__ */ jsx5(
          XAxis,
          {
            ...defaultTimeXAxisProps,
            tickFormatter: (x2) => timeTickFormatter(new Date(x2))
          }
        ),
        /* @__PURE__ */ jsx5(
          YAxis,
          {
            stroke: theme.colors.gray200,
            label: {
              value: "% Empty",
              angle: -90,
              position: "insideLeft",
              style: {
                textAnchor: "middle",
                fill: "var(--ac-global-text-color-900)"
              }
            },
            style: { fill: "var(--ac-global-text-color-700)" }
          }
        ),
        /* @__PURE__ */ jsx5(
          CartesianGrid,
          {
            strokeDasharray: "4 4",
            stroke: theme.colors.gray200,
            strokeOpacity: 0.5
          }
        ),
        /* @__PURE__ */ jsx5(Tooltip2, { content: /* @__PURE__ */ jsx5(TooltipContent6, {}) }),
        /* @__PURE__ */ jsx5(
          Line7,
          {
            type: "monotone",
            dataKey: "value",
            stroke: color2,
            fillOpacity: 1,
            fill: "url(#percentEmptyColorUv)"
          }
        )
      ]
    }
  ) });
}

// src/pages/dimension/__generated__/DimensionQuantilesStats_dimension.graphql.ts
var node49 = function() {
  var v0 = {
    "kind": "Variable",
    "name": "timeRange",
    "variableName": "timeRange"
  };
  return {
    "argumentDefinitions": [
      {
        "defaultValue": null,
        "kind": "LocalArgument",
        "name": "timeRange"
      }
    ],
    "kind": "Fragment",
    "metadata": null,
    "name": "DimensionQuantilesStats_dimension",
    "selections": [
      {
        "alias": "p99",
        "args": [
          {
            "kind": "Literal",
            "name": "metric",
            "value": "p99"
          },
          v0
        ],
        "kind": "ScalarField",
        "name": "dataQualityMetric",
        "storageKey": null
      },
      {
        "alias": "p75",
        "args": [
          {
            "kind": "Literal",
            "name": "metric",
            "value": "p75"
          },
          v0
        ],
        "kind": "ScalarField",
        "name": "dataQualityMetric",
        "storageKey": null
      },
      {
        "alias": "p50",
        "args": [
          {
            "kind": "Literal",
            "name": "metric",
            "value": "p50"
          },
          v0
        ],
        "kind": "ScalarField",
        "name": "dataQualityMetric",
        "storageKey": null
      },
      {
        "alias": "p25",
        "args": [
          {
            "kind": "Literal",
            "name": "metric",
            "value": "p25"
          },
          v0
        ],
        "kind": "ScalarField",
        "name": "dataQualityMetric",
        "storageKey": null
      },
      {
        "alias": "p1",
        "args": [
          {
            "kind": "Literal",
            "name": "metric",
            "value": "p01"
          },
          v0
        ],
        "kind": "ScalarField",
        "name": "dataQualityMetric",
        "storageKey": null
      }
    ],
    "type": "Dimension",
    "abstractKey": null
  };
}();
node49.hash = "c306c8eafb1d34be464d3a658d5f94a7";
var DimensionQuantilesStats_dimension_graphql_default = node49;

// src/pages/dimension/DimensionQuantilesStats.tsx
var import_react_relay31 = __toESM(require_react_relay());
function DimensionQuantilesStats(props) {
  const data = (0, import_react_relay31.useFragment)(
    DimensionQuantilesStats_dimension_graphql_default,
    props.dimension
  );
  return /* @__PURE__ */ jsx5(
    "ul",
    {
      css: css`
        display: flex;
        flex-direction: column;
        gap: var(--px-spacing-sm);
      `,
      children: Object.keys(data).map((statName) => {
        const stat = data[statName];
        return /* @__PURE__ */ jsxs2(
          "li",
          {
            css: css`
              display: flex;
              flex-direction: column;
              align-items: flex-end;
            `,
            children: [
              /* @__PURE__ */ jsx5(_Text, { elementType: "h3", textSize: "xsmall", color: "text-700", children: statName }),
              /* @__PURE__ */ jsx5(_Text, { textSize: "medium", "data-raw": stat, children: numberFormatter2(stat) })
            ]
          },
          statName
        );
      })
    }
  );
}

// src/pages/dimension/__generated__/DimensionQuantilesTimeSeriesQuery.graphql.ts
var node50 = function() {
  var v0 = {
    "defaultValue": null,
    "kind": "LocalArgument",
    "name": "dimensionId"
  }, v12 = {
    "defaultValue": null,
    "kind": "LocalArgument",
    "name": "granularity"
  }, v22 = {
    "defaultValue": null,
    "kind": "LocalArgument",
    "name": "timeRange"
  }, v32 = [
    {
      "kind": "Variable",
      "name": "id",
      "variableName": "dimensionId"
    }
  ], v4 = {
    "alias": null,
    "args": null,
    "kind": "ScalarField",
    "name": "id",
    "storageKey": null
  }, v5 = {
    "kind": "Variable",
    "name": "granularity",
    "variableName": "granularity"
  }, v6 = {
    "kind": "Variable",
    "name": "timeRange",
    "variableName": "timeRange"
  }, v7 = [
    {
      "alias": null,
      "args": null,
      "concreteType": "TimeSeriesDataPoint",
      "kind": "LinkedField",
      "name": "data",
      "plural": true,
      "selections": [
        {
          "alias": null,
          "args": null,
          "kind": "ScalarField",
          "name": "timestamp",
          "storageKey": null
        },
        {
          "alias": null,
          "args": null,
          "kind": "ScalarField",
          "name": "value",
          "storageKey": null
        }
      ],
      "storageKey": null
    }
  ], v8 = {
    "kind": "InlineFragment",
    "selections": [
      {
        "alias": "p99TimeSeries",
        "args": [
          v5,
          {
            "kind": "Literal",
            "name": "metric",
            "value": "p99"
          },
          v6
        ],
        "concreteType": "DataQualityTimeSeries",
        "kind": "LinkedField",
        "name": "dataQualityTimeSeries",
        "plural": false,
        "selections": v7,
        "storageKey": null
      },
      {
        "alias": "p75TimeSeries",
        "args": [
          v5,
          {
            "kind": "Literal",
            "name": "metric",
            "value": "p75"
          },
          v6
        ],
        "concreteType": "DataQualityTimeSeries",
        "kind": "LinkedField",
        "name": "dataQualityTimeSeries",
        "plural": false,
        "selections": v7,
        "storageKey": null
      },
      {
        "alias": "p50TimeSeries",
        "args": [
          v5,
          {
            "kind": "Literal",
            "name": "metric",
            "value": "p50"
          },
          v6
        ],
        "concreteType": "DataQualityTimeSeries",
        "kind": "LinkedField",
        "name": "dataQualityTimeSeries",
        "plural": false,
        "selections": v7,
        "storageKey": null
      },
      {
        "alias": "p25TimeSeries",
        "args": [
          v5,
          {
            "kind": "Literal",
            "name": "metric",
            "value": "p25"
          },
          v6
        ],
        "concreteType": "DataQualityTimeSeries",
        "kind": "LinkedField",
        "name": "dataQualityTimeSeries",
        "plural": false,
        "selections": v7,
        "storageKey": null
      },
      {
        "alias": "p01TimeSeries",
        "args": [
          v5,
          {
            "kind": "Literal",
            "name": "metric",
            "value": "p01"
          },
          v6
        ],
        "concreteType": "DataQualityTimeSeries",
        "kind": "LinkedField",
        "name": "dataQualityTimeSeries",
        "plural": false,
        "selections": v7,
        "storageKey": null
      }
    ],
    "type": "Dimension",
    "abstractKey": null
  };
  return {
    "fragment": {
      "argumentDefinitions": [
        v0,
        v12,
        v22
      ],
      "kind": "Fragment",
      "metadata": null,
      "name": "DimensionQuantilesTimeSeriesQuery",
      "selections": [
        {
          "alias": "dimension",
          "args": v32,
          "concreteType": null,
          "kind": "LinkedField",
          "name": "node",
          "plural": false,
          "selections": [
            v4,
            v8
          ],
          "storageKey": null
        }
      ],
      "type": "Query",
      "abstractKey": null
    },
    "kind": "Request",
    "operation": {
      "argumentDefinitions": [
        v0,
        v22,
        v12
      ],
      "kind": "Operation",
      "name": "DimensionQuantilesTimeSeriesQuery",
      "selections": [
        {
          "alias": "dimension",
          "args": v32,
          "concreteType": null,
          "kind": "LinkedField",
          "name": "node",
          "plural": false,
          "selections": [
            {
              "alias": null,
              "args": null,
              "kind": "ScalarField",
              "name": "__typename",
              "storageKey": null
            },
            v4,
            v8
          ],
          "storageKey": null
        }
      ]
    },
    "params": {
      "cacheID": "0bb3d9faf9d7f0c2e27995120ae24e1c",
      "id": null,
      "metadata": {},
      "name": "DimensionQuantilesTimeSeriesQuery",
      "operationKind": "query",
      "text": "query DimensionQuantilesTimeSeriesQuery(\n  $dimensionId: GlobalID!\n  $timeRange: TimeRange!\n  $granularity: Granularity!\n) {\n  dimension: node(id: $dimensionId) {\n    __typename\n    id\n    ... on Dimension {\n      p99TimeSeries: dataQualityTimeSeries(metric: p99, timeRange: $timeRange, granularity: $granularity) {\n        data {\n          timestamp\n          value\n        }\n      }\n      p75TimeSeries: dataQualityTimeSeries(metric: p75, timeRange: $timeRange, granularity: $granularity) {\n        data {\n          timestamp\n          value\n        }\n      }\n      p50TimeSeries: dataQualityTimeSeries(metric: p50, timeRange: $timeRange, granularity: $granularity) {\n        data {\n          timestamp\n          value\n        }\n      }\n      p25TimeSeries: dataQualityTimeSeries(metric: p25, timeRange: $timeRange, granularity: $granularity) {\n        data {\n          timestamp\n          value\n        }\n      }\n      p01TimeSeries: dataQualityTimeSeries(metric: p01, timeRange: $timeRange, granularity: $granularity) {\n        data {\n          timestamp\n          value\n        }\n      }\n    }\n  }\n}\n"
    }
  };
}();
node50.hash = "134f0dad0e0ecc7863dfbb0f437d829b";
var DimensionQuantilesTimeSeriesQuery_graphql_default = node50;

// src/pages/dimension/DimensionQuantilesTimeSeries.tsx
var import_react186 = __toESM(require_react());
var import_react_relay32 = __toESM(require_react_relay());
var yTickFormatter = format2("~s");
var Label4 = /* @__PURE__ */ ((Label5) => {
  Label5["p99_p01"] = "p99_p01";
  Label5["p75_p25"] = "p75_p25";
  Label5["p50"] = "p50";
  return Label5;
})(Label4 || {});
var numberFormatter7 = new Intl.NumberFormat([], {
  maximumFractionDigits: 2
});
function formatValue(value) {
  return typeof value === "number" ? numberFormatter7.format(value) : "--";
}
var useColors7 = () => {
  const colors = useChartColors();
  return {
    outerColor: colors.gray500,
    innerColor: colors.gray300,
    lineColor: colors.default
  };
};
function TooltipContent7({
  active,
  payload,
  label
}) {
  const { outerColor, innerColor, lineColor } = useColors7();
  if (active && payload && payload.length) {
    const data = payload[0].payload;
    return /* @__PURE__ */ jsxs2(ChartTooltip, { children: [
      /* @__PURE__ */ jsx5(_Text, { weight: "heavy", textSize: "medium", children: `${fullTimeFormatter(
        new Date(label)
      )}` }),
      /* @__PURE__ */ jsx5(
        ChartTooltipItem,
        {
          color: outerColor,
          name: "p99",
          value: formatValue(data["p99_p01" /* p99_p01 */][0])
        }
      ),
      /* @__PURE__ */ jsx5(
        ChartTooltipItem,
        {
          color: innerColor,
          name: "p75",
          value: formatValue(data["p75_p25" /* p75_p25 */][0])
        }
      ),
      /* @__PURE__ */ jsx5(
        ChartTooltipItem,
        {
          color: lineColor,
          name: "p50",
          value: formatValue(data.p50)
        }
      ),
      /* @__PURE__ */ jsx5(
        ChartTooltipItem,
        {
          color: innerColor,
          name: "p25",
          value: formatValue(data["p75_p25" /* p75_p25 */][1])
        }
      ),
      /* @__PURE__ */ jsx5(
        ChartTooltipItem,
        {
          color: outerColor,
          name: "p01",
          value: formatValue(data["p99_p01" /* p99_p01 */][1])
        }
      )
    ] });
  }
  return null;
}
function DimensionQuantilesTimeSeries({
  dimensionId
}) {
  const { timeRange } = useTimeRange();
  const granularity = calculateGranularity(timeRange);
  const data = (0, import_react_relay32.useLazyLoadQuery)(
    DimensionQuantilesTimeSeriesQuery_graphql_default,
    {
      dimensionId,
      timeRange: {
        start: timeRange.start.toISOString(),
        end: timeRange.end.toISOString()
      },
      granularity
    }
  );
  const p99data = data.dimension.p99TimeSeries?.data.map((d) => d) || [];
  const p01data = data.dimension.p01TimeSeries?.data.map((d) => d) || [];
  const p75data = data.dimension.p75TimeSeries?.data.map((d) => d) || [];
  const p25data = data.dimension.p25TimeSeries?.data.map((d) => d) || [];
  const p50data = data.dimension.p50TimeSeries?.data.map((d) => d) || [];
  const chartData = p99data.map((d, i2) => {
    return {
      timestamp: new Date(d.timestamp).valueOf(),
      p99_p01: [d.value, p01data[i2].value],
      p75_p25: [p75data[i2].value, p25data[i2].value],
      p50: p50data[i2].value
    };
  });
  const timeTickFormatter = useTimeTickFormatter({
    samplingIntervalMinutes: granularity.samplingIntervalMinutes
  });
  const [chartState, setChartState] = (0, import_react186.useState)(
    Object.keys(Label4).reduce((a2, key) => {
      a2[key] = false;
      return a2;
    }, {})
  );
  const handleLegendMouseEnter = (e3) => {
    if (!chartState[e3.dataKey]) {
      setChartState({ ...chartState });
    }
  };
  const handleLegendMouseLeave = () => {
    setChartState({ ...chartState });
  };
  const selectChartItem = (e3) => {
    setChartState({
      ...chartState,
      [e3.dataKey]: !chartState[e3.dataKey]
    });
  };
  const { outerColor, innerColor, lineColor } = useColors7();
  return /* @__PURE__ */ jsx5(ResponsiveContainer, { width: "100%", height: "100%", children: /* @__PURE__ */ jsxs2(
    ComposedChart,
    {
      data: chartData,
      margin: timeSeriesChartMargins,
      syncId: "dimensionDetails",
      children: [
        /* @__PURE__ */ jsxs2("defs", { children: [
          /* @__PURE__ */ jsxs2("linearGradient", { id: "p99_p01ColorUV", x1: "0", y1: "0", x2: "0", y2: "1", children: [
            /* @__PURE__ */ jsx5("stop", { offset: "10%", stopColor: outerColor, stopOpacity: 0.7 }),
            /* @__PURE__ */ jsx5("stop", { offset: "50%", stopColor: outerColor, stopOpacity: 0.3 }),
            /* @__PURE__ */ jsx5("stop", { offset: "90%", stopColor: outerColor, stopOpacity: 0.7 })
          ] }),
          /* @__PURE__ */ jsxs2("linearGradient", { id: "p75_p25ColorUV", x1: "0", y1: "0", x2: "0", y2: "1", children: [
            /* @__PURE__ */ jsx5("stop", { offset: "10%", stopColor: innerColor, stopOpacity: 0.7 }),
            /* @__PURE__ */ jsx5("stop", { offset: "50%", stopColor: innerColor, stopOpacity: 0.3 }),
            /* @__PURE__ */ jsx5("stop", { offset: "90%", stopColor: innerColor, stopOpacity: 0.7 })
          ] })
        ] }),
        /* @__PURE__ */ jsx5(
          XAxis,
          {
            ...defaultTimeXAxisProps,
            tickFormatter: (x2) => timeTickFormatter(new Date(x2))
          }
        ),
        /* @__PURE__ */ jsx5(
          YAxis,
          {
            stroke: theme.colors.gray200,
            label: {
              value: "Value",
              angle: -90,
              position: "insideLeft",
              style: {
                textAnchor: "middle",
                fill: "var(--ac-global-text-color-900)"
              }
            },
            tickFormatter: (x2) => yTickFormatter(x2),
            style: { fill: "var(--ac-global-text-color-700)" }
          }
        ),
        /* @__PURE__ */ jsx5(
          CartesianGrid,
          {
            strokeDasharray: "4 4",
            stroke: theme.colors.gray200,
            strokeOpacity: 0.5
          }
        ),
        /* @__PURE__ */ jsx5(Tooltip2, { content: /* @__PURE__ */ jsx5(TooltipContent7, {}) }),
        /* @__PURE__ */ jsx5(
          Legend,
          {
            onClick: selectChartItem,
            onMouseOver: handleLegendMouseEnter,
            onMouseOut: handleLegendMouseLeave
          }
        ),
        /* @__PURE__ */ jsx5(
          Area,
          {
            type: "monotone",
            dataKey: "p99_p01" /* p99_p01 */,
            name: "p99 - p01",
            fillOpacity: 1,
            fill: "url(#p99_p01ColorUV)",
            stroke: outerColor,
            hide: chartState["p99_p01" /* p99_p01 */] === true
          }
        ),
        /* @__PURE__ */ jsx5(
          Area,
          {
            type: "monotone",
            dataKey: "p75_p25" /* p75_p25 */,
            name: "p75 - p25",
            fillOpacity: 1,
            stroke: innerColor,
            fill: "url(#p75_p25ColorUV)",
            hide: chartState["p75_p25" /* p75_p25 */] === true
          }
        ),
        /* @__PURE__ */ jsx5(
          Line7,
          {
            type: "monotone",
            dataKey: "p50" /* p50 */,
            stroke: lineColor,
            hide: chartState["p50" /* p50 */] === true
          }
        )
      ]
    }
  ) });
}

// src/pages/dimension/__generated__/DimensionSegmentsBarChart_dimension.graphql.ts
var node51 = function() {
  var v0 = {
    "alias": null,
    "args": null,
    "kind": "ScalarField",
    "name": "__typename",
    "storageKey": null
  }, v12 = [
    {
      "alias": null,
      "args": null,
      "kind": "ScalarField",
      "name": "primaryValue",
      "storageKey": null
    }
  ];
  return {
    "argumentDefinitions": [
      {
        "defaultValue": null,
        "kind": "LocalArgument",
        "name": "timeRange"
      }
    ],
    "kind": "Fragment",
    "metadata": null,
    "name": "DimensionSegmentsBarChart_dimension",
    "selections": [
      {
        "alias": null,
        "args": null,
        "kind": "ScalarField",
        "name": "id",
        "storageKey": null
      },
      {
        "alias": null,
        "args": [
          {
            "kind": "Variable",
            "name": "primaryTimeRange",
            "variableName": "timeRange"
          }
        ],
        "concreteType": "Segments",
        "kind": "LinkedField",
        "name": "segmentsComparison",
        "plural": false,
        "selections": [
          {
            "alias": null,
            "args": null,
            "concreteType": "Segment",
            "kind": "LinkedField",
            "name": "segments",
            "plural": true,
            "selections": [
              {
                "alias": null,
                "args": null,
                "concreteType": null,
                "kind": "LinkedField",
                "name": "bin",
                "plural": false,
                "selections": [
                  {
                    "kind": "InlineFragment",
                    "selections": [
                      v0,
                      {
                        "alias": null,
                        "args": null,
                        "kind": "ScalarField",
                        "name": "name",
                        "storageKey": null
                      }
                    ],
                    "type": "NominalBin",
                    "abstractKey": null
                  },
                  {
                    "kind": "InlineFragment",
                    "selections": [
                      v0,
                      {
                        "alias": null,
                        "args": null,
                        "concreteType": "NumericRange",
                        "kind": "LinkedField",
                        "name": "range",
                        "plural": false,
                        "selections": [
                          {
                            "alias": null,
                            "args": null,
                            "kind": "ScalarField",
                            "name": "start",
                            "storageKey": null
                          },
                          {
                            "alias": null,
                            "args": null,
                            "kind": "ScalarField",
                            "name": "end",
                            "storageKey": null
                          }
                        ],
                        "storageKey": null
                      }
                    ],
                    "type": "IntervalBin",
                    "abstractKey": null
                  },
                  {
                    "kind": "InlineFragment",
                    "selections": [
                      v0
                    ],
                    "type": "MissingValueBin",
                    "abstractKey": null
                  }
                ],
                "storageKey": null
              },
              {
                "alias": null,
                "args": null,
                "concreteType": "DatasetValues",
                "kind": "LinkedField",
                "name": "counts",
                "plural": false,
                "selections": v12,
                "storageKey": null
              }
            ],
            "storageKey": null
          },
          {
            "alias": null,
            "args": null,
            "concreteType": "DatasetValues",
            "kind": "LinkedField",
            "name": "totalCounts",
            "plural": false,
            "selections": v12,
            "storageKey": null
          }
        ],
        "storageKey": null
      }
    ],
    "type": "Dimension",
    "abstractKey": null
  };
}();
node51.hash = "8cef9841e9a5bd7d0d50acb5db9028b0";
var DimensionSegmentsBarChart_dimension_graphql_default = node51;

// src/pages/dimension/DimensionSegmentsBarChart.tsx
var import_react187 = __toESM(require_react());
var import_react_relay33 = __toESM(require_react_relay());
var formatter2 = format2(".2f");
var useColors8 = () => {
  const { primary } = useChartColors();
  return {
    color: primary
  };
};
function TooltipContent8({
  active,
  payload,
  label
}) {
  const { color: color2 } = useColors8();
  if (active && payload && payload.length) {
    const value = payload[0]?.value;
    return /* @__PURE__ */ jsx5(ChartTooltip, { children: /* @__PURE__ */ jsx5(
      ChartTooltipItem,
      {
        color: color2,
        shape: "square",
        name: label,
        value: value != null ? `${formatter2(value)}%` : "--"
      }
    ) });
  }
  return null;
}
function DimensionSegmentsBarChart(props) {
  const data = (0, import_react_relay33.useFragment)(
    DimensionSegmentsBarChart_dimension_graphql_default,
    props.dimension
  );
  const chartData = (0, import_react187.useMemo)(() => {
    const segments = data.segmentsComparison?.segments ?? [];
    const total = data.segmentsComparison?.totalCounts?.primaryValue ?? 0;
    return segments.map((segment) => {
      const segmentCount = segment.counts?.primaryValue ?? 0;
      const binName = getBinName(segment.bin);
      const percent = segmentCount / total * 100;
      return {
        name: binName,
        percent
      };
    });
  }, [data]);
  const { color: color2 } = useColors8();
  return /* @__PURE__ */ jsx5(ResponsiveContainer, { children: /* @__PURE__ */ jsxs2(
    BarChart,
    {
      data: chartData,
      margin: {
        top: 25,
        right: 18,
        left: 18,
        bottom: 5
      },
      children: [
        /* @__PURE__ */ jsx5("defs", { children: /* @__PURE__ */ jsxs2(
          "linearGradient",
          {
            id: "dimensionSegmentsBarColor",
            x1: "0",
            y1: "0",
            x2: "0",
            y2: "1",
            children: [
              /* @__PURE__ */ jsx5("stop", { offset: "5%", stopColor: color2, stopOpacity: 1 }),
              /* @__PURE__ */ jsx5("stop", { offset: "95%", stopColor: color2, stopOpacity: 0.5 })
            ]
          }
        ) }),
        /* @__PURE__ */ jsx5(
          XAxis,
          {
            dataKey: "name",
            style: { fill: "var(--ac-global-text-color-700)" }
          }
        ),
        /* @__PURE__ */ jsx5(
          YAxis,
          {
            stroke: theme.colors.gray200,
            label: {
              value: "% Volume",
              angle: -90,
              position: "insideLeft",
              style: {
                textAnchor: "middle",
                fill: "var(--ac-global-text-color-900)"
              }
            },
            style: { fill: "var(--ac-global-text-color-700)" }
          }
        ),
        /* @__PURE__ */ jsx5(
          CartesianGrid,
          {
            strokeDasharray: "4 4",
            stroke: theme.colors.gray200,
            strokeOpacity: 0.5
          }
        ),
        /* @__PURE__ */ jsx5(
          Tooltip2,
          {
            ...defaultBarChartTooltipProps,
            content: /* @__PURE__ */ jsx5(TooltipContent8, {})
          }
        ),
        /* @__PURE__ */ jsx5(
          Bar,
          {
            dataKey: "percent",
            fill: "url(#dimensionSegmentsBarColor)",
            spacing: 15
          }
        )
      ]
    }
  ) });
}

// src/pages/dimension/DimensionPage.tsx
function DimensionPage() {
  const { dimensionId } = useParams();
  const { timeRange } = useTimeRange();
  const loaderData = useLoaderData();
  const { referenceDataset } = useDatasets();
  const hasReference = referenceDataset !== null;
  const showDrift = hasReference;
  const showCardinality = loaderData.dimension.shape !== "continuous";
  const showQuantiles = loaderData.dimension.dataType === "numeric";
  const navigate = useNavigate();
  const data = (0, import_react_relay34.useLazyLoadQuery)(
    DimensionPageQuery_graphql_default,
    {
      // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
      dimensionId,
      timeRange: {
        start: timeRange.start.toISOString(),
        end: timeRange.end.toISOString()
      },
      hasReference
    }
  );
  if (!dimensionId) {
    throw new Error("Dimension ID is required to display a dimension");
  }
  return /* @__PURE__ */ jsx5(TimeSliceContextProvider, { initialTimestamp: new Date(timeRange.end), children: /* @__PURE__ */ jsx5(
    DialogContainer,
    {
      type: "slideOver",
      isDismissable: true,
      onDismiss: () => navigate(-1),
      children: /* @__PURE__ */ jsx5(_Dialog, { size: "L", title: loaderData.dimension.name, children: /* @__PURE__ */ jsx5(
        "main",
        {
          css: css`
              padding: var(--px-spacing-med);
              display: flex;
              flex-direction: column;
              min-height: 400px;
              overflow-y: auto;
              height: 100%;
            `,
          children: /* @__PURE__ */ jsx5(import_react188.Suspense, { fallback: /* @__PURE__ */ jsx5(Loading, {}), children: /* @__PURE__ */ jsxs2(_Flex, { direction: "column", gap: "size-100", children: [
            /* @__PURE__ */ jsx5(
              _View,
              {
                borderColor: "dark",
                borderRadius: "medium",
                borderWidth: "thin",
                height: "size-1600",
                children: /* @__PURE__ */ jsx5(DimensionSegmentsBarChart, { dimension: data.dimension })
              }
            ),
            /* @__PURE__ */ jsx5(
              _View,
              {
                borderColor: "dark",
                borderRadius: "medium",
                borderWidth: "thin",
                height: "size-1600",
                "data-testid": "dimension-count-time-series-view",
                children: /* @__PURE__ */ jsxs2(_Flex, { direction: "row", alignItems: "stretch", height: "100%", children: [
                  /* @__PURE__ */ jsx5(DimensionCountTimeSeries, { dimensionId }),
                  /* @__PURE__ */ jsx5(ViewSummaryAside, { children: /* @__PURE__ */ jsx5(DimensionCountStats, { dimension: data.dimension }) })
                ] })
              }
            ),
            showDrift ? /* @__PURE__ */ jsx5(
              _View,
              {
                borderColor: "dark",
                borderRadius: "medium",
                borderWidth: "thin",
                children: /* @__PURE__ */ jsxs2(_Flex, { direction: "column", alignItems: "stretch", children: [
                  /* @__PURE__ */ jsx5(_View, { width: "100%", height: "size-1600", children: /* @__PURE__ */ jsxs2(
                    _Flex,
                    {
                      direction: "row",
                      alignItems: "stretch",
                      height: "100%",
                      children: [
                        /* @__PURE__ */ jsx5(_View, { flex: true, children: /* @__PURE__ */ jsx5(
                          DimensionDriftTimeSeries,
                          {
                            dimensionId
                          }
                        ) }),
                        /* @__PURE__ */ jsx5(ViewSummaryAside, { children: /* @__PURE__ */ jsx5(DimensionDriftStats, { dimension: data.dimension }) })
                      ]
                    }
                  ) }),
                  /* @__PURE__ */ jsx5(
                    _View,
                    {
                      height: "size-1600",
                      width: "100%",
                      borderTopColor: "dark",
                      borderTopWidth: "thin",
                      children: /* @__PURE__ */ jsx5(import_react188.Suspense, { fallback: /* @__PURE__ */ jsx5(Loading, {}), children: /* @__PURE__ */ jsx5(
                        DimensionDriftBreakdownSegmentBarChart,
                        {
                          dimensionId
                        }
                      ) })
                    }
                  )
                ] })
              }
            ) : null,
            showQuantiles ? /* @__PURE__ */ jsx5(
              _View,
              {
                borderColor: "dark",
                borderRadius: "medium",
                borderWidth: "thin",
                height: "size-3000",
                children: /* @__PURE__ */ jsxs2(_Flex, { direction: "row", alignItems: "stretch", height: "100%", children: [
                  /* @__PURE__ */ jsx5(_View, { flex: true, children: /* @__PURE__ */ jsx5(
                    DimensionQuantilesTimeSeries,
                    {
                      dimensionId
                    }
                  ) }),
                  /* @__PURE__ */ jsx5(ViewSummaryAside, { children: /* @__PURE__ */ jsx5(DimensionQuantilesStats, { dimension: data.dimension }) })
                ] })
              }
            ) : null,
            showCardinality ? /* @__PURE__ */ jsx5(
              _View,
              {
                borderColor: "dark",
                borderRadius: "medium",
                borderWidth: "thin",
                height: "size-1600",
                children: /* @__PURE__ */ jsxs2(_Flex, { direction: "row", alignItems: "stretch", height: "100%", children: [
                  /* @__PURE__ */ jsx5(_View, { flex: true, children: /* @__PURE__ */ jsx5(
                    DimensionCardinalityTimeSeries,
                    {
                      dimensionId
                    }
                  ) }),
                  /* @__PURE__ */ jsx5(ViewSummaryAside, { children: /* @__PURE__ */ jsx5(DimensionCardinalityStats, { dimension: data.dimension }) })
                ] })
              }
            ) : null,
            /* @__PURE__ */ jsx5(
              _View,
              {
                borderColor: "dark",
                borderRadius: "medium",
                borderWidth: "thin",
                height: "size-1600",
                children: /* @__PURE__ */ jsxs2(_Flex, { direction: "row", alignItems: "stretch", height: "100%", children: [
                  /* @__PURE__ */ jsx5(
                    DimensionPercentEmptyTimeSeries,
                    {
                      dimensionId
                    }
                  ),
                  /* @__PURE__ */ jsx5(ViewSummaryAside, { children: /* @__PURE__ */ jsx5(DimensionPercentEmptyStats, { dimension: data.dimension }) })
                ] })
              }
            )
          ] }) })
        }
      ) })
    }
  ) });
}

// src/pages/dimension/__generated__/dimensionLoaderQuery.graphql.ts
var node52 = function() {
  var v0 = [
    {
      "defaultValue": null,
      "kind": "LocalArgument",
      "name": "id"
    }
  ], v12 = [
    {
      "kind": "Variable",
      "name": "id",
      "variableName": "id"
    }
  ], v22 = {
    "alias": null,
    "args": null,
    "kind": "ScalarField",
    "name": "id",
    "storageKey": null
  }, v32 = {
    "alias": null,
    "args": null,
    "kind": "ScalarField",
    "name": "name",
    "storageKey": null
  }, v4 = {
    "alias": null,
    "args": null,
    "kind": "ScalarField",
    "name": "dataType",
    "storageKey": null
  }, v5 = {
    "alias": null,
    "args": null,
    "kind": "ScalarField",
    "name": "shape",
    "storageKey": null
  };
  return {
    "fragment": {
      "argumentDefinitions": v0,
      "kind": "Fragment",
      "metadata": null,
      "name": "dimensionLoaderQuery",
      "selections": [
        {
          "alias": "dimension",
          "args": v12,
          "concreteType": null,
          "kind": "LinkedField",
          "name": "node",
          "plural": false,
          "selections": [
            {
              "kind": "InlineFragment",
              "selections": [
                v22,
                v32,
                v4,
                v5
              ],
              "type": "Dimension",
              "abstractKey": null
            }
          ],
          "storageKey": null
        }
      ],
      "type": "Query",
      "abstractKey": null
    },
    "kind": "Request",
    "operation": {
      "argumentDefinitions": v0,
      "kind": "Operation",
      "name": "dimensionLoaderQuery",
      "selections": [
        {
          "alias": "dimension",
          "args": v12,
          "concreteType": null,
          "kind": "LinkedField",
          "name": "node",
          "plural": false,
          "selections": [
            {
              "alias": null,
              "args": null,
              "kind": "ScalarField",
              "name": "__typename",
              "storageKey": null
            },
            {
              "kind": "TypeDiscriminator",
              "abstractKey": "__isNode"
            },
            v22,
            {
              "kind": "InlineFragment",
              "selections": [
                v32,
                v4,
                v5
              ],
              "type": "Dimension",
              "abstractKey": null
            }
          ],
          "storageKey": null
        }
      ]
    },
    "params": {
      "cacheID": "03a9aafe3f08a9d093b029ff4a9e3253",
      "id": null,
      "metadata": {},
      "name": "dimensionLoaderQuery",
      "operationKind": "query",
      "text": "query dimensionLoaderQuery(\n  $id: GlobalID!\n) {\n  dimension: node(id: $id) {\n    __typename\n    ... on Dimension {\n      id\n      name\n      dataType\n      shape\n    }\n    __isNode: __typename\n    id\n  }\n}\n"
    }
  };
}();
node52.hash = "5a662d77e69d2e9bb4eb2af4cad6b722";
var dimensionLoaderQuery_graphql_default = node52;

// src/pages/dimension/dimensionLoader.ts
var import_react_relay35 = __toESM(require_react_relay());
async function dimensionLoader(args) {
  const { dimensionId } = args.params;
  return (0, import_react_relay35.fetchQuery)(
    RelayEnvironment_default,
    dimensionLoaderQuery_graphql_default,
    {
      id: dimensionId
    }
  ).toPromise();
}

// src/pages/trace/__generated__/TracePageQuery.graphql.ts
var node53 = function() {
  var v0 = [
    {
      "defaultValue": null,
      "kind": "LocalArgument",
      "name": "traceId"
    }
  ], v12 = [
    {
      "kind": "Literal",
      "name": "sort",
      "value": {
        "col": "startTime",
        "dir": "asc"
      }
    },
    {
      "items": [
        {
          "kind": "Variable",
          "name": "traceIds.0",
          "variableName": "traceId"
        }
      ],
      "kind": "ListValue",
      "name": "traceIds"
    }
  ], v22 = {
    "alias": null,
    "args": null,
    "concreteType": "SpanContext",
    "kind": "LinkedField",
    "name": "context",
    "plural": false,
    "selections": [
      {
        "alias": null,
        "args": null,
        "kind": "ScalarField",
        "name": "spanId",
        "storageKey": null
      }
    ],
    "storageKey": null
  }, v32 = {
    "alias": null,
    "args": null,
    "kind": "ScalarField",
    "name": "name",
    "storageKey": null
  }, v4 = {
    "alias": null,
    "args": null,
    "kind": "ScalarField",
    "name": "spanKind",
    "storageKey": null
  }, v5 = {
    "alias": "statusCode",
    "args": null,
    "kind": "ScalarField",
    "name": "propagatedStatusCode",
    "storageKey": null
  }, v6 = {
    "alias": null,
    "args": null,
    "kind": "ScalarField",
    "name": "startTime",
    "storageKey": null
  }, v7 = {
    "alias": null,
    "args": null,
    "kind": "ScalarField",
    "name": "parentId",
    "storageKey": null
  }, v8 = {
    "alias": null,
    "args": null,
    "kind": "ScalarField",
    "name": "latencyMs",
    "storageKey": null
  }, v9 = {
    "alias": null,
    "args": null,
    "kind": "ScalarField",
    "name": "tokenCountTotal",
    "storageKey": null
  }, v10 = {
    "alias": null,
    "args": null,
    "kind": "ScalarField",
    "name": "tokenCountPrompt",
    "storageKey": null
  }, v11 = {
    "alias": null,
    "args": null,
    "kind": "ScalarField",
    "name": "tokenCountCompletion",
    "storageKey": null
  }, v122 = [
    {
      "alias": null,
      "args": null,
      "kind": "ScalarField",
      "name": "value",
      "storageKey": null
    },
    {
      "alias": null,
      "args": null,
      "kind": "ScalarField",
      "name": "mimeType",
      "storageKey": null
    }
  ], v13 = {
    "alias": null,
    "args": null,
    "concreteType": "SpanIOValue",
    "kind": "LinkedField",
    "name": "input",
    "plural": false,
    "selections": v122,
    "storageKey": null
  }, v14 = {
    "alias": null,
    "args": null,
    "concreteType": "SpanIOValue",
    "kind": "LinkedField",
    "name": "output",
    "plural": false,
    "selections": v122,
    "storageKey": null
  }, v15 = {
    "alias": null,
    "args": null,
    "kind": "ScalarField",
    "name": "attributes",
    "storageKey": null
  }, v16 = {
    "alias": null,
    "args": null,
    "concreteType": "SpanEvent",
    "kind": "LinkedField",
    "name": "events",
    "plural": true,
    "selections": [
      v32,
      {
        "alias": null,
        "args": null,
        "kind": "ScalarField",
        "name": "message",
        "storageKey": null
      },
      {
        "alias": null,
        "args": null,
        "kind": "ScalarField",
        "name": "timestamp",
        "storageKey": null
      }
    ],
    "storageKey": null
  }, v17 = {
    "alias": null,
    "args": null,
    "kind": "ScalarField",
    "name": "label",
    "storageKey": null
  }, v18 = {
    "alias": null,
    "args": null,
    "kind": "ScalarField",
    "name": "score",
    "storageKey": null
  }, v19 = {
    "alias": null,
    "args": null,
    "concreteType": "DocumentRetrievalMetrics",
    "kind": "LinkedField",
    "name": "documentRetrievalMetrics",
    "plural": true,
    "selections": [
      {
        "alias": null,
        "args": null,
        "kind": "ScalarField",
        "name": "evaluationName",
        "storageKey": null
      },
      {
        "alias": null,
        "args": null,
        "kind": "ScalarField",
        "name": "ndcg",
        "storageKey": null
      },
      {
        "alias": null,
        "args": null,
        "kind": "ScalarField",
        "name": "precision",
        "storageKey": null
      },
      {
        "alias": null,
        "args": null,
        "kind": "ScalarField",
        "name": "hit",
        "storageKey": null
      }
    ],
    "storageKey": null
  }, v20 = {
    "alias": null,
    "args": null,
    "kind": "ScalarField",
    "name": "explanation",
    "storageKey": null
  }, v21 = {
    "alias": null,
    "args": null,
    "concreteType": "DocumentEvaluation",
    "kind": "LinkedField",
    "name": "documentEvaluations",
    "plural": true,
    "selections": [
      {
        "alias": null,
        "args": null,
        "kind": "ScalarField",
        "name": "documentPosition",
        "storageKey": null
      },
      v32,
      v17,
      v18,
      v20
    ],
    "storageKey": null
  };
  return {
    "fragment": {
      "argumentDefinitions": v0,
      "kind": "Fragment",
      "metadata": null,
      "name": "TracePageQuery",
      "selections": [
        {
          "alias": null,
          "args": v12,
          "concreteType": "SpanConnection",
          "kind": "LinkedField",
          "name": "spans",
          "plural": false,
          "selections": [
            {
              "alias": null,
              "args": null,
              "concreteType": "SpanEdge",
              "kind": "LinkedField",
              "name": "edges",
              "plural": true,
              "selections": [
                {
                  "alias": "span",
                  "args": null,
                  "concreteType": "Span",
                  "kind": "LinkedField",
                  "name": "node",
                  "plural": false,
                  "selections": [
                    v22,
                    v32,
                    v4,
                    v5,
                    v6,
                    v7,
                    v8,
                    v9,
                    v10,
                    v11,
                    v13,
                    v14,
                    v15,
                    v16,
                    {
                      "alias": null,
                      "args": null,
                      "concreteType": "SpanEvaluation",
                      "kind": "LinkedField",
                      "name": "spanEvaluations",
                      "plural": true,
                      "selections": [
                        v32,
                        v17,
                        v18
                      ],
                      "storageKey": null
                    },
                    v19,
                    v21,
                    {
                      "args": null,
                      "kind": "FragmentSpread",
                      "name": "SpanEvaluationsTable_evals"
                    }
                  ],
                  "storageKey": null
                }
              ],
              "storageKey": null
            }
          ],
          "storageKey": null
        }
      ],
      "type": "Query",
      "abstractKey": null
    },
    "kind": "Request",
    "operation": {
      "argumentDefinitions": v0,
      "kind": "Operation",
      "name": "TracePageQuery",
      "selections": [
        {
          "alias": null,
          "args": v12,
          "concreteType": "SpanConnection",
          "kind": "LinkedField",
          "name": "spans",
          "plural": false,
          "selections": [
            {
              "alias": null,
              "args": null,
              "concreteType": "SpanEdge",
              "kind": "LinkedField",
              "name": "edges",
              "plural": true,
              "selections": [
                {
                  "alias": "span",
                  "args": null,
                  "concreteType": "Span",
                  "kind": "LinkedField",
                  "name": "node",
                  "plural": false,
                  "selections": [
                    v22,
                    v32,
                    v4,
                    v5,
                    v6,
                    v7,
                    v8,
                    v9,
                    v10,
                    v11,
                    v13,
                    v14,
                    v15,
                    v16,
                    {
                      "alias": null,
                      "args": null,
                      "concreteType": "SpanEvaluation",
                      "kind": "LinkedField",
                      "name": "spanEvaluations",
                      "plural": true,
                      "selections": [
                        v32,
                        v17,
                        v18,
                        v20
                      ],
                      "storageKey": null
                    },
                    v19,
                    v21
                  ],
                  "storageKey": null
                }
              ],
              "storageKey": null
            }
          ],
          "storageKey": null
        }
      ]
    },
    "params": {
      "cacheID": "dca150f939e9f25ebb459389fdbaf0c3",
      "id": null,
      "metadata": {},
      "name": "TracePageQuery",
      "operationKind": "query",
      "text": "query TracePageQuery(\n  $traceId: ID!\n) {\n  spans(traceIds: [$traceId], sort: {col: startTime, dir: asc}) {\n    edges {\n      span: node {\n        context {\n          spanId\n        }\n        name\n        spanKind\n        statusCode: propagatedStatusCode\n        startTime\n        parentId\n        latencyMs\n        tokenCountTotal\n        tokenCountPrompt\n        tokenCountCompletion\n        input {\n          value\n          mimeType\n        }\n        output {\n          value\n          mimeType\n        }\n        attributes\n        events {\n          name\n          message\n          timestamp\n        }\n        spanEvaluations {\n          name\n          label\n          score\n        }\n        documentRetrievalMetrics {\n          evaluationName\n          ndcg\n          precision\n          hit\n        }\n        documentEvaluations {\n          documentPosition\n          name\n          label\n          score\n          explanation\n        }\n        ...SpanEvaluationsTable_evals\n      }\n    }\n  }\n}\n\nfragment SpanEvaluationsTable_evals on Span {\n  spanEvaluations {\n    name\n    label\n    score\n    explanation\n  }\n}\n"
    }
  };
}();
node53.hash = "3d1fcabaf101ad2f4bb462aa0b173ac1";
var TracePageQuery_graphql_default = node53;

// src/pages/trace/TracePage.tsx
var import_react194 = __toESM(require_react());
var import_react_relay37 = __toESM(require_react_relay());

// node_modules/@lezer/json/dist/index.js
var jsonHighlighting = styleTags({
  String: tags.string,
  Number: tags.number,
  "True False": tags.bool,
  PropertyName: tags.propertyName,
  Null: tags.null,
  ",": tags.separator,
  "[ ]": tags.squareBracket,
  "{ }": tags.brace
});
var parser2 = LRParser.deserialize({
  version: 14,
  states: "$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#CjOOQO'#Cp'#CpQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CrOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59U,59UO!iQPO,59UOVQPO,59QOqQPO'#CkO!nQPO,59^OOQO1G.k1G.kOVQPO'#ClO!vQPO,59aOOQO1G.p1G.pOOQO1G.l1G.lOOQO,59V,59VOOQO-E6i-E6iOOQO,59W,59WOOQO-E6j-E6j",
  stateData: "#O~OcOS~OQSORSOSSOTSOWQO]ROePO~OVXOeUO~O[[O~PVOg^O~Oh_OVfX~OVaO~OhbO[iX~O[dO~Oh_OVfa~OhbO[ia~O",
  goto: "!kjPPPPPPkPPkqwPPk{!RPPP!XP!ePP!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",
  nodeNames: "\u26A0 JsonText True False Null Number String } { Object Property PropertyName ] [ Array",
  maxTerm: 25,
  nodeProps: [
    ["openedBy", 7, "{", 12, "["],
    ["closedBy", 8, "}", 13, "]"]
  ],
  propSources: [jsonHighlighting],
  skippedNodes: [0],
  repeatNodeCount: 2,
  tokenData: "(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oc~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Oe~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zOh~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yOg~~'OO]~~'TO[~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",
  tokenizers: [0],
  topRules: { "JsonText": [0, 1] },
  tokenPrec: 0
});

// node_modules/@codemirror/lang-json/dist/index.js
var jsonLanguage = /* @__PURE__ */ LRLanguage.define({
  name: "json",
  parser: /* @__PURE__ */ parser2.configure({
    props: [
      /* @__PURE__ */ indentNodeProp.add({
        Object: /* @__PURE__ */ continuedIndent({ except: /^\s*\}/ }),
        Array: /* @__PURE__ */ continuedIndent({ except: /^\s*\]/ })
      }),
      /* @__PURE__ */ foldNodeProp.add({
        "Object Array": foldInside
      })
    ]
  }),
  languageData: {
    closeBrackets: { brackets: ["[", "{", '"'] },
    indentOnInput: /^\s*[\}\]]$/
  }
});
function json2() {
  return new LanguageSupport(jsonLanguage);
}

// node_modules/@arizeai/openinference-semantic-conventions/dist/esm/trace/SemanticConventions.js
var SemanticAttributePrefixes = {
  llm: "llm",
  retrieval: "retrieval",
  reranker: "reranker",
  messages: "messages",
  message: "message",
  document: "document",
  embedding: "embedding",
  tool: "tool",
  tool_call: "tool_call"
};
var LLMAttributePostfixes = {
  model_name: "model_name",
  input_messages: "input_messages",
  output_messages: "output_messages",
  invocation_parameters: "invocation_parameters",
  prompts: "prompts",
  prompt_template: "prompt_template"
};
var LLMPromptTemplateAttributePostfixes = {
  variables: "variables",
  template: "template"
};
var RetrievalAttributePostfixes = {
  documents: "documents"
};
var RerankerAttributePostfixes = {
  input_documents: "input_documents",
  output_documents: "output_documents",
  query: "query",
  model_name: "model_name",
  top_k: "top_k"
};
var EmbeddingAttributePostfixes = {
  embeddings: "embeddings",
  text: "text",
  model_name: "model_name"
};
var ToolAttributePostfixes = {
  name: "name",
  description: "description",
  parameters: "parameters"
};
var MessageAttributePostfixes = {
  role: "role",
  content: "content",
  name: "name",
  function_call_name: "function_call_name",
  function_call_arguments_json: "function_call_arguments_json",
  tool_calls: "tool_calls"
};
var ToolCallAttributePostfixes = {
  function_name: "function.name",
  function_arguments_json: "function.arguments"
};
var DocumentAttributePostfixes = {
  id: "id",
  content: "content",
  score: "score",
  metadata: "metadata"
};
var LLM_INPUT_MESSAGES = "".concat(SemanticAttributePrefixes.llm, ".").concat(LLMAttributePostfixes.input_messages);
var LLM_OUTPUT_MESSAGES = "".concat(SemanticAttributePrefixes.llm, ".").concat(LLMAttributePostfixes.output_messages);
var MESSAGE_ROLE = "".concat(SemanticAttributePrefixes.message, ".").concat(MessageAttributePostfixes.role);
var MESSAGE_NAME = "".concat(SemanticAttributePrefixes.message, ".").concat(MessageAttributePostfixes.name);
var MESSAGE_TOOL_CALLS = "".concat(SemanticAttributePrefixes.message, ".").concat(MessageAttributePostfixes.tool_calls);
var TOOL_CALL_FUNCTION_NAME = "".concat(SemanticAttributePrefixes.tool_call, ".").concat(ToolCallAttributePostfixes.function_name);
var TOOL_CALL_FUNCTION_ARGUMENTS_JSON = "".concat(SemanticAttributePrefixes.tool_call, ".").concat(ToolCallAttributePostfixes.function_arguments_json);
var MESSAGE_FUNCTION_CALL_NAME = "".concat(SemanticAttributePrefixes.message, ".").concat(MessageAttributePostfixes.function_call_name);
var MESSAGE_FUNCTION_CALL_ARGUMENTS_JSON = "".concat(SemanticAttributePrefixes.message, ".").concat(MessageAttributePostfixes.function_call_arguments_json);
var MESSAGE_CONTENT = "".concat(SemanticAttributePrefixes.message, ".").concat(MessageAttributePostfixes.content);
var DOCUMENT_ID = "".concat(SemanticAttributePrefixes.document, ".").concat(DocumentAttributePostfixes.id);
var DOCUMENT_CONTENT = "".concat(SemanticAttributePrefixes.document, ".").concat(DocumentAttributePostfixes.content);
var DOCUMENT_SCORE = "".concat(SemanticAttributePrefixes.document, ".").concat(DocumentAttributePostfixes.score);
var DOCUMENT_METADATA = "".concat(SemanticAttributePrefixes.document, ".").concat(DocumentAttributePostfixes.metadata);
var EMBEDDING_TEXT = "".concat(SemanticAttributePrefixes.embedding, ".").concat(EmbeddingAttributePostfixes.text);
var EMBEDDING_MODEL_NAME = "".concat(SemanticAttributePrefixes.embedding, ".").concat(EmbeddingAttributePostfixes.model_name);

// src/components/trace/SpanItem.tsx
function SpanItem(props) {
  const {
    name: name2,
    latencyMs,
    spanKind,
    statusCode,
    tokenCountTotal,
    tokenCountPrompt,
    tokenCountCompletion
  } = props;
  return /* @__PURE__ */ jsx5(_View, { height: "size-500", width: "100%", children: /* @__PURE__ */ jsxs2(
    _Flex,
    {
      direction: "row",
      gap: "size-150",
      width: "100%",
      height: "100%",
      alignItems: "center",
      children: [
        /* @__PURE__ */ jsx5(SpanKindLabel, { spanKind }),
        /* @__PURE__ */ jsx5(_View, { flex: "1 1 auto", children: /* @__PURE__ */ jsx5(
          "div",
          {
            css: css`
              float: left;
            `,
            children: /* @__PURE__ */ jsx5(_Text, { children: name2 })
          }
        ) }),
        typeof tokenCountTotal === "number" ? /* @__PURE__ */ jsx5(
          TokenCount,
          {
            tokenCountTotal,
            tokenCountPrompt: tokenCountPrompt ?? 0,
            tokenCountCompletion: tokenCountCompletion ?? 0
          }
        ) : null,
        latencyMs === null ? null : /* @__PURE__ */ jsx5(LatencyText, { latencyMs }),
        statusCode === "ERROR" ? /* @__PURE__ */ jsx5(SpanStatusCodeIcon, { statusCode: "ERROR" }) : null
      ]
    }
  ) });
}

// src/components/trace/SpanKindIcon.tsx
var ToolSVG = () => /* @__PURE__ */ jsxs2(
  "svg",
  {
    width: "20",
    height: "20",
    viewBox: "0 0 20 20",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg",
    children: [
      /* @__PURE__ */ jsx5(
        "rect",
        {
          x: "0.5",
          y: "0.5",
          width: "19",
          height: "19",
          rx: "3.5",
          stroke: "currentColor",
          strokeOpacity: "0.9"
        }
      ),
      /* @__PURE__ */ jsx5("mask", { id: "path-2-inside-1_33_16916", fill: "currentColor", children: /* @__PURE__ */ jsx5(
        "path",
        {
          fillRule: "evenodd",
          clipRule: "evenodd",
          d: "M13 8C13 8.64491 12.8779 9.2613 12.6556 9.82732L17.1924 14.3641L14.364 17.1926L9.82706 12.6557C9.26111 12.8779 8.64481 13 8 13C5.23858 13 3 10.7614 3 8C3 7.13361 3.22036 6.31869 3.60809 5.60822L6 8L7.5 7.50016L8 6.00016L5.60803 3.60819C6.31854 3.2204 7.13353 3 8 3C10.7614 3 13 5.23858 13 8Z"
        }
      ) }),
      /* @__PURE__ */ jsx5(
        "path",
        {
          d: "M12.6556 9.82732L11.7248 9.46171L11.4853 10.0713L11.9485 10.5344L12.6556 9.82732ZM17.1924 14.3641L17.8995 15.0713L18.6066 14.3641L17.8995 13.657L17.1924 14.3641ZM14.364 17.1926L13.6569 17.8997L14.364 18.6068L15.0711 17.8997L14.364 17.1926ZM9.82706 12.6557L10.5342 11.9486L10.0711 11.4855L9.4615 11.7249L9.82706 12.6557ZM3.60809 5.60822L4.31518 4.90109L3.37037 3.95634L2.7303 5.12917L3.60809 5.60822ZM6 8L5.29291 8.70713L5.72988 9.14407L6.31613 8.94871L6 8ZM7.5 7.50016L7.81614 8.44888L8.29055 8.29079L8.44869 7.81639L7.5 7.50016ZM8 6.00016L8.94869 6.31639L9.14413 5.73007L8.70711 5.29306L8 6.00016ZM5.60803 3.60819L5.12895 2.73042L3.95616 3.37053L4.90093 4.3153L5.60803 3.60819ZM13.5863 10.1929C13.8537 9.51235 14 8.77206 14 8H12C12 8.51776 11.9021 9.01026 11.7248 9.46171L13.5863 10.1929ZM17.8995 13.657L13.3627 9.12022L11.9485 10.5344L16.4853 15.0713L17.8995 13.657ZM15.0711 17.8997L17.8995 15.0713L16.4853 13.657L13.6569 16.4855L15.0711 17.8997ZM9.11995 13.3628L13.6569 17.8997L15.0711 16.4855L10.5342 11.9486L9.11995 13.3628ZM8 14C8.77194 14 9.51211 13.8537 10.1926 13.5865L9.4615 11.7249C9.0101 11.9022 8.51768 12 8 12V14ZM2 8C2 11.3137 4.68629 14 8 14V12C5.79086 12 4 10.2091 4 8H2ZM2.7303 5.12917C2.2644 5.98288 2 6.96206 2 8H4C4 7.30516 4.17633 6.65449 4.48588 6.08727L2.7303 5.12917ZM6.70709 7.29287L4.31518 4.90109L2.901 6.31535L5.29291 8.70713L6.70709 7.29287ZM7.18387 6.55145L5.68387 7.05129L6.31613 8.94871L7.81614 8.44888L7.18387 6.55145ZM7.05132 5.68394L6.55132 7.18394L8.44869 7.81639L8.94869 6.31639L7.05132 5.68394ZM4.90093 4.3153L7.2929 6.70727L8.70711 5.29306L6.31514 2.90109L4.90093 4.3153ZM8 2C6.96197 2 5.98271 2.26444 5.12895 2.73042L6.08712 4.48596C6.65437 4.17636 7.3051 4 8 4V2ZM14 8C14 4.68629 11.3137 2 8 2V4C10.2091 4 12 5.79086 12 8H14Z",
          fill: "currentColor",
          fillOpacity: "0.9",
          mask: "url(#path-2-inside-1_33_16916)"
        }
      )
    ]
  }
);
var LLMSVG = () => /* @__PURE__ */ jsxs2(
  "svg",
  {
    width: "20",
    height: "20",
    viewBox: "0 0 20 20",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg",
    children: [
      /* @__PURE__ */ jsx5(
        "rect",
        {
          x: "0.5",
          y: "0.5",
          width: "19",
          height: "19",
          rx: "3.5",
          stroke: "currentColor",
          strokeOpacity: "0.9"
        }
      ),
      /* @__PURE__ */ jsx5(
        "path",
        {
          d: "M4.43782 6.78868L10 3.57735L15.5622 6.78868V13.2113L10 16.4226L4.43782 13.2113V6.78868Z",
          stroke: "currentColor",
          strokeOpacity: "0.9"
        }
      )
    ]
  }
);
var AgentSVG = () => /* @__PURE__ */ jsxs2(
  "svg",
  {
    width: "20",
    height: "20",
    viewBox: "0 0 20 20",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg",
    children: [
      /* @__PURE__ */ jsx5(
        "rect",
        {
          x: "0.5",
          y: "0.5",
          width: "19",
          height: "19",
          rx: "3.5",
          stroke: "currentColor",
          strokeOpacity: "0.9"
        }
      ),
      /* @__PURE__ */ jsx5(
        "path",
        {
          d: "M5 16C5 16 5 11 10 11C15 11 15 16 15 16",
          stroke: "currentColor",
          strokeOpacity: "0.9"
        }
      ),
      /* @__PURE__ */ jsx5(
        "rect",
        {
          x: "6.5",
          y: "4.5",
          width: "7",
          height: "5",
          rx: "0.5",
          stroke: "currentColor",
          strokeOpacity: "0.9"
        }
      )
    ]
  }
);
var EmbeddingSVG = () => /* @__PURE__ */ jsxs2(
  "svg",
  {
    width: "20",
    height: "20",
    viewBox: "0 0 20 20",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg",
    children: [
      /* @__PURE__ */ jsx5(
        "rect",
        {
          x: "0.5",
          y: "0.5",
          width: "19",
          height: "19",
          rx: "3.5",
          stroke: "currentColor",
          strokeOpacity: "0.9"
        }
      ),
      /* @__PURE__ */ jsx5(
        "path",
        {
          fillRule: "evenodd",
          clipRule: "evenodd",
          d: "M10 6C10 7.10457 9.10457 8 8 8C6.89543 8 6 7.10457 6 6C6 4.89543 6.89543 4 8 4C9.10457 4 10 4.89543 10 6ZM10.0558 8.18487C9.51887 8.6903 8.7956 9 8 9C7.91155 9 7.824 8.99617 7.7375 8.98867L7.10304 11.2093C8.21409 11.6488 9 12.7326 9 14C9 15.6569 7.65685 17 6 17C4.34315 17 3 15.6569 3 14C3 12.3431 4.34315 11 6 11C6.0409 11 6.08161 11.0008 6.12212 11.0024L6.76944 8.73682C5.72625 8.26703 5 7.21833 5 6C5 4.34315 6.34315 3 8 3C9.65685 3 11 4.34315 11 6C11 6.50075 10.8773 6.97285 10.6604 7.38788L12.1873 8.6094C12.6908 8.22697 13.3189 8 14 8C15.6569 8 17 9.34315 17 11C17 12.6569 15.6569 14 14 14C12.3431 14 11 12.6569 11 11C11 10.3864 11.1842 9.81579 11.5004 9.34053L10.0558 8.18487ZM16 11C16 12.1046 15.1046 13 14 13C12.8954 13 12 12.1046 12 11C12 9.89543 12.8954 9 14 9C15.1046 9 16 9.89543 16 11ZM6 16C7.10457 16 8 15.1046 8 14C8 12.8954 7.10457 12 6 12C4.89543 12 4 12.8954 4 14C4 15.1046 4.89543 16 6 16Z",
          fill: "currentColor",
          fillOpacity: "0.9"
        }
      )
    ]
  }
);
var RetrieverSVG = () => /* @__PURE__ */ jsxs2(
  "svg",
  {
    width: "20",
    height: "20",
    viewBox: "0 0 20 20",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg",
    children: [
      /* @__PURE__ */ jsx5(
        "rect",
        {
          x: "0.5",
          y: "0.5",
          width: "19",
          height: "19",
          rx: "3.5",
          stroke: "currentColor",
          strokeOpacity: "0.9"
        }
      ),
      /* @__PURE__ */ jsx5(
        "path",
        {
          d: "M14.65 6.5C14.65 6.98637 14.2466 7.52091 13.379 7.95472C12.5323 8.37806 11.3382 8.65 10 8.65C8.66184 8.65 7.46767 8.37806 6.62099 7.95472C5.75338 7.52091 5.35 6.98637 5.35 6.5C5.35 6.01363 5.75338 5.47909 6.62099 5.04528C7.46767 4.62194 8.66184 4.35 10 4.35C11.3382 4.35 12.5323 4.62194 13.379 5.04528C14.2466 5.47909 14.65 6.01363 14.65 6.5Z",
          stroke: "currentColor",
          strokeOpacity: "0.9",
          strokeWidth: "0.7"
        }
      ),
      /* @__PURE__ */ jsx5(
        "path",
        {
          d: "M14.6875 6.83482V9.62479C14.6875 9.62479 13.0769 11.1873 10 11.1873C6.92308 11.1873 5.3125 9.62479 5.3125 9.62479V6.7437",
          stroke: "currentColor",
          strokeOpacity: "0.9",
          strokeWidth: "0.7"
        }
      ),
      /* @__PURE__ */ jsx5(
        "path",
        {
          d: "M14.6875 9.625V12.125C14.6875 12.125 13.0769 13.6875 10 13.6875C6.92308 13.6875 5.3125 12.125 5.3125 12.125V9.625",
          stroke: "currentColor",
          strokeOpacity: "0.9",
          strokeWidth: "0.7"
        }
      ),
      /* @__PURE__ */ jsx5(
        "path",
        {
          d: "M14.6875 12.125V14.625C14.6875 14.625 13.0769 16.1875 10 16.1875C6.92308 16.1875 5.3125 14.625 5.3125 14.625V12.125",
          stroke: "currentColor",
          strokeOpacity: "0.9",
          strokeWidth: "0.7"
        }
      )
    ]
  }
);
var RerankerSVG = () => /* @__PURE__ */ jsxs2(
  "svg",
  {
    width: "20",
    height: "20",
    viewBox: "0 0 20 20",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg",
    children: [
      /* @__PURE__ */ jsx5(
        "rect",
        {
          x: "0.5",
          y: "0.5",
          width: "19",
          height: "19",
          rx: "3.5",
          stroke: "currentColor"
        }
      ),
      /* @__PURE__ */ jsx5("path", { d: "M4.5359 10L8 4L11.4641 10H4.5359Z", stroke: "currentColor" }),
      /* @__PURE__ */ jsx5("path", { d: "M8.5359 10L12 16L15.4641 10H8.5359Z", stroke: "currentColor" })
    ]
  }
);
var ChainSVG = () => /* @__PURE__ */ jsxs2(
  "svg",
  {
    width: "20",
    height: "20",
    viewBox: "0 0 20 20",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg",
    children: [
      /* @__PURE__ */ jsx5(
        "rect",
        {
          x: "0.5",
          y: "0.5",
          width: "19",
          height: "19",
          rx: "3.5",
          stroke: "currentColor",
          strokeOpacity: "0.9"
        }
      ),
      /* @__PURE__ */ jsx5(
        "path",
        {
          fillRule: "evenodd",
          clipRule: "evenodd",
          d: "M10 15C12.7614 15 15 12.7614 15 10C15 7.23858 12.7614 5 10 5C7.23858 5 5 7.23858 5 10C5 12.7614 7.23858 15 10 15ZM10 16C13.3137 16 16 13.3137 16 10C16 6.68629 13.3137 4 10 4C6.68629 4 4 6.68629 4 10C4 13.3137 6.68629 16 10 16Z",
          fill: "currentColor",
          fillOpacity: "0.9"
        }
      )
    ]
  }
);
function SpanKindIcon({ spanKind }) {
  let icon = /* @__PURE__ */ jsx5(Fragment5, {});
  let color2 = "--ac-global-grey-900";
  switch (spanKind) {
    case "llm":
      color2 = "--ac-global-color-orange-1000";
      icon = /* @__PURE__ */ jsx5(LLMSVG, {});
      break;
    case "chain":
      color2 = "--ac-global-color-blue-1000";
      icon = /* @__PURE__ */ jsx5(ChainSVG, {});
      break;
    case "retriever":
      color2 = "--ac-global-color-seafoam-1000";
      icon = /* @__PURE__ */ jsx5(RetrieverSVG, {});
      break;
    case "embedding":
      color2 = "--ac-global-color-indigo-1000";
      icon = /* @__PURE__ */ jsx5(EmbeddingSVG, {});
      break;
    case "agent":
      color2 = "--ac-global-text-color-900";
      icon = /* @__PURE__ */ jsx5(AgentSVG, {});
      break;
    case "tool":
      color2 = "--ac-global-color-yellow-1200";
      icon = /* @__PURE__ */ jsx5(ToolSVG, {});
      break;
    case "reranker":
      color2 = "--ac-global-color-celery-1000";
      icon = /* @__PURE__ */ jsx5(RerankerSVG, {});
      break;
  }
  return /* @__PURE__ */ jsx5(
    "div",
    {
      css: css`
        color: var(${color2});
        width: 20px;
        height: 20px;
      `,
      children: icon
    }
  );
}

// src/components/trace/TraceTree.tsx
function TraceTree(props) {
  const { spans, onSpanClick, selectedSpanId } = props;
  const spanTree = createSpanTree(spans);
  return /* @__PURE__ */ jsx5(
    "ul",
    {
      css: (theme3) => css`
        margin: ${theme3.spacing.margin16}px;
        display: flex;
        flex-direction: column;
        gap: ${theme3.spacing.padding8}px;
      `,
      children: spanTree.map((spanNode) => /* @__PURE__ */ jsx5(
        SpanTreeItem,
        {
          node: spanNode,
          onSpanClick,
          selectedSpanId
        },
        spanNode.span.context.spanId
      ))
    }
  );
}
function SpanTreeItem(props) {
  const { node: node56, selectedSpanId, onSpanClick } = props;
  const childNodes = node56.children;
  return /* @__PURE__ */ jsxs2("div", { children: [
    /* @__PURE__ */ jsx5(
      "button",
      {
        className: "button--reset",
        css: css`
          min-width: var(--ac-global-dimension-static-size-5000);
          cursor: pointer;
        `,
        onClick: () => {
          onSpanClick && onSpanClick(node56.span.context.spanId);
        },
        children: /* @__PURE__ */ jsx5(SpanNodeWrap, { isSelected: selectedSpanId === node56.span.context.spanId, children: /* @__PURE__ */ jsxs2(
          _Flex,
          {
            direction: "row",
            gap: "size-100",
            justifyContent: "start",
            alignItems: "center",
            children: [
              /* @__PURE__ */ jsx5(SpanKindIcon, { spanKind: node56.span.spanKind }),
              /* @__PURE__ */ jsx5(SpanItem, { ...node56.span })
            ]
          }
        ) })
      }
    ),
    childNodes.length ? /* @__PURE__ */ jsx5(
      "ul",
      {
        css: (theme3) => css`
            margin: var(--ac-global-dimension-static-size-100) 0 0
              var(--ac-global-dimension-static-size-600);
            display: flex;
            flex-direction: column;
            gap: ${theme3.spacing.padding8}px;
          `,
        children: childNodes.map((leafNode, index) => {
          const nexSibling = childNodes[index + 1];
          return /* @__PURE__ */ jsxs2(
            "div",
            {
              css: css`
                  position: relative;
                `,
              children: [
                nexSibling ? /* @__PURE__ */ jsx5(SpanTreeEdgeConnector, { ...nexSibling.span }) : null,
                /* @__PURE__ */ jsx5(SpanTreeEdge, { ...leafNode.span }),
                /* @__PURE__ */ jsx5(
                  SpanTreeItem,
                  {
                    node: leafNode,
                    onSpanClick,
                    selectedSpanId
                  }
                )
              ]
            },
            leafNode.span.context.spanId
          );
        })
      }
    ) : null
  ] });
}
function SpanNodeWrap(props) {
  return /* @__PURE__ */ jsx5(
    "div",
    {
      className: props.isSelected ? "is-selected" : "",
      css: css`
        border-radius: var(--ac-global-dimension-static-size-150);
        background-color: var(--ac-global-color-grey-200);
        padding: var(--ac-global-dimension-static-size-100)
          var(--ac-global-dimension-static-size-200)
          var(--ac-global-dimension-static-size-100)
          var(--ac-global-dimension-static-size-200);
        border-width: var(--ac-global-dimension-static-size-10);
        border-style: solid;
        border-color: var(--ac-global-color-grey-300);
        &:hover {
          border-color: var(--ac-global-color-grey-400);
          background-color: var(--ac-global-color-grey-300);
        }
        &.is-selected {
          border-color: var(--ac-global-color-primary);
        }
      `,
      children: props.children
    }
  );
}
function SpanTreeEdgeConnector({
  statusCode
}) {
  return /* @__PURE__ */ jsx5(
    "div",
    {
      "aria-hidden": "true",
      "data-testid": "span-tree-edge-connector",
      css: (theme3) => css`
        position: absolute;
        border-left: 1px solid
          ${statusCode === "ERROR" ? theme3.colors.statusDanger : "rgb(204, 204, 204)"};
        top: 0;
        left: -22px;
        width: 42px;
        bottom: 0;
      `
    }
  );
}
function SpanTreeEdge({ statusCode }) {
  return /* @__PURE__ */ jsx5(
    "div",
    {
      "aria-hidden": "true",
      css: (theme3) => {
        const color2 = statusCode === "ERROR" ? theme3.colors.statusDanger : "rgb(204, 204, 204)";
        return css`
          position: absolute;
          border-left: 1px solid ${color2};
          border-bottom: 1px solid ${color2};
          border-radius: 0 0 0 var(--ac-global-dimension-static-size-150);
          top: -27px;
          left: -22px;
          width: 38px;
          height: 56px;
        `;
      }
    }
  );
}

// src/pages/trace/__generated__/SpanEvaluationsTable_evals.graphql.ts
var node54 = {
  "argumentDefinitions": [],
  "kind": "Fragment",
  "metadata": null,
  "name": "SpanEvaluationsTable_evals",
  "selections": [
    {
      "alias": null,
      "args": null,
      "concreteType": "SpanEvaluation",
      "kind": "LinkedField",
      "name": "spanEvaluations",
      "plural": true,
      "selections": [
        {
          "alias": null,
          "args": null,
          "kind": "ScalarField",
          "name": "name",
          "storageKey": null
        },
        {
          "alias": null,
          "args": null,
          "kind": "ScalarField",
          "name": "label",
          "storageKey": null
        },
        {
          "alias": null,
          "args": null,
          "kind": "ScalarField",
          "name": "score",
          "storageKey": null
        },
        {
          "alias": null,
          "args": null,
          "kind": "ScalarField",
          "name": "explanation",
          "storageKey": null
        }
      ],
      "storageKey": null
    }
  ],
  "type": "Span",
  "abstractKey": null
};
node54.hash = "0604d02236eeb7e73817a68e2e6f12e2";
var SpanEvaluationsTable_evals_graphql_default = node54;

// src/pages/trace/SpanEvaluationsTable.tsx
var import_react193 = __toESM(require_react());
var import_react_relay36 = __toESM(require_react_relay());
var columns = [
  {
    header: "name",
    accessorKey: "name",
    size: 100
  },
  {
    header: "label",
    accessorKey: "label",
    size: 100
  },
  {
    header: "score",
    accessorKey: "score",
    size: 100
  },
  {
    header: "explanation",
    accessorKey: "explanation",
    Cell: TextCell,
    size: 400
  }
];
function SpanEvaluationsTable(props) {
  const data = (0, import_react_relay36.useFragment)(
    SpanEvaluationsTable_evals_graphql_default,
    props.span
  );
  const evaluations = (0, import_react193.useMemo)(() => {
    return [...data.spanEvaluations];
  }, [data.spanEvaluations]);
  const table = useReactTable({
    columns,
    data: evaluations,
    getCoreRowModel: getCoreRowModel()
  });
  const rows = table.getRowModel().rows;
  const isEmpty = rows.length === 0;
  return /* @__PURE__ */ jsxs2("table", { css: tableCSS, children: [
    /* @__PURE__ */ jsx5("thead", { children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx5("tr", { children: headerGroup.headers.map((header) => /* @__PURE__ */ jsx5("th", { colSpan: header.colSpan, children: header.isPlaceholder ? null : /* @__PURE__ */ jsx5(Fragment5, { children: flexRender(
      header.column.columnDef.header,
      header.getContext()
    ) }) }, header.id)) }, headerGroup.id)) }),
    isEmpty ? /* @__PURE__ */ jsx5(TableEmpty, {}) : /* @__PURE__ */ jsx5("tbody", { children: table.getRowModel().rows.map((row) => /* @__PURE__ */ jsx5("tr", { children: row.getVisibleCells().map((cell) => /* @__PURE__ */ jsx5(
      "td",
      {
        style: {
          width: cell.column.getSize()
        },
        children: flexRender(cell.column.columnDef.cell, cell.getContext())
      },
      cell.id
    )) }, row.id)) })
  ] });
}

// src/pages/trace/TracePage.tsx
function isAttributeObject(value) {
  if (value != null && typeof value === "object" && !Object.keys(value).find((key) => typeof key != "string")) {
    return true;
  }
  return false;
}
function isAttributePromptTemplate(value) {
  if (isAttributeObject(value) && typeof value[LLMPromptTemplateAttributePostfixes.template] === "string" && typeof value[LLMPromptTemplateAttributePostfixes.variables] === "object") {
    return true;
  }
  return false;
}
var spanHasException = (span) => {
  return span.events.some((event) => event.name === "exception");
};
var defaultCardProps = {
  backgroundColor: "light",
  borderColor: "light",
  bodyStyle: {
    padding: 0
  },
  variant: "compact",
  collapsible: true
};
function TracePage() {
  const { traceId } = useParams();
  const [searchParams, setSearchParams] = useSearchParams();
  const navigate = useNavigate();
  const data = (0, import_react_relay37.useLazyLoadQuery)(
    TracePageQuery_graphql_default,
    { traceId }
  );
  const spansList = data.spans.edges.map((edge) => edge.span);
  const urlSelectedSpanId = searchParams.get("selectedSpanId");
  const selectedSpanId = urlSelectedSpanId ?? spansList[0].context.spanId;
  const selectedSpan = spansList.find(
    (span) => span.context.spanId === selectedSpanId
  );
  const rootSpan = (0, import_react194.useMemo)(() => {
    return spansList.find((span) => span.parentId == null);
  }, [spansList]);
  if (rootSpan == null) {
    throw new Error("rootSpan is required to view a trace");
  }
  return /* @__PURE__ */ jsx5(
    DialogContainer,
    {
      type: "slideOver",
      isDismissable: true,
      onDismiss: () => navigate(-1),
      children: /* @__PURE__ */ jsx5(_Dialog, { size: "XL", title: "Trace Details", children: /* @__PURE__ */ jsxs2(
        "main",
        {
          css: css`
            flex: 1 1 auto;
            overflow: hidden;
            display: flex;
            flex-direction: column;
          `,
          children: [
            /* @__PURE__ */ jsx5(TraceHeader, { rootSpan }),
            /* @__PURE__ */ jsxs2(
              PanelGroup2,
              {
                direction: "horizontal",
                autoSaveId: "trace-panel-group",
                css: css`
              flex: 1 1 auto;
              overflow: hidden;
            `,
                children: [
                  /* @__PURE__ */ jsx5(Panel, { defaultSize: 30, minSize: 10, maxSize: 40, children: /* @__PURE__ */ jsx5(
                    TraceTree,
                    {
                      spans: spansList,
                      selectedSpanId,
                      onSpanClick: (spanId) => {
                        setSearchParams(
                          {
                            selectedSpanId: spanId
                          },
                          { replace: true }
                        );
                      }
                    }
                  ) }),
                  /* @__PURE__ */ jsx5(PanelResizeHandle, { css: resizeHandleCSS }),
                  /* @__PURE__ */ jsx5(Panel, { children: /* @__PURE__ */ jsx5(ScrollingTabsWrapper, { children: selectedSpan ? /* @__PURE__ */ jsx5(SelectedSpanDetails, { selectedSpan }) : null }) })
                ]
              }
            )
          ]
        }
      ) })
    }
  );
}
function TraceHeader({ rootSpan }) {
  const { latencyMs, statusCode, spanEvaluations } = rootSpan;
  const statusColor = useSpanStatusCodeColor(statusCode);
  const hasEvaluations = spanEvaluations.length;
  return /* @__PURE__ */ jsx5(_View, { padding: "size-200", borderBottomWidth: "thin", borderBottomColor: "dark", children: /* @__PURE__ */ jsxs2(_Flex, { direction: "row", gap: "size-400", children: [
    /* @__PURE__ */ jsxs2(_Flex, { direction: "column", children: [
      /* @__PURE__ */ jsx5(_Text, { elementType: "h3", textSize: "medium", color: "text-700", children: "Trace Status" }),
      /* @__PURE__ */ jsx5(_Text, { textSize: "xlarge", children: /* @__PURE__ */ jsxs2(_Flex, { direction: "row", gap: "size-50", alignItems: "center", children: [
        /* @__PURE__ */ jsx5(SpanStatusCodeIcon, { statusCode }),
        /* @__PURE__ */ jsx5(_Text, { textSize: "xlarge", color: statusColor, children: statusCode })
      ] }) })
    ] }),
    /* @__PURE__ */ jsxs2(_Flex, { direction: "column", children: [
      /* @__PURE__ */ jsx5(_Text, { elementType: "h3", textSize: "medium", color: "text-700", children: "Latency" }),
      /* @__PURE__ */ jsx5(_Text, { textSize: "xlarge", children: typeof latencyMs === "number" ? /* @__PURE__ */ jsx5(LatencyText, { latencyMs, textSize: "xlarge" }) : "--" })
    ] }),
    hasEvaluations ? /* @__PURE__ */ jsxs2(_Flex, { direction: "column", gap: "size-50", children: [
      /* @__PURE__ */ jsx5(_Text, { elementType: "h3", textSize: "medium", color: "text-700", children: "Evaluations" }),
      /* @__PURE__ */ jsx5(_Flex, { direction: "row", gap: "size-50", children: spanEvaluations.map((evaluation) => {
        return /* @__PURE__ */ jsx5(
          EvaluationLabel,
          {
            evaluation
          },
          evaluation.name
        );
      }) })
    ] }) : null
  ] }) });
}
function ScrollingTabsWrapper({ children }) {
  return /* @__PURE__ */ jsx5(
    "div",
    {
      "data-testid": "scrolling-tabs-wrapper",
      css: css`
        height: 100%;
        overflow: hidden;
        .ac-tabs {
          height: 100%;
          overflow: hidden;
          .ac-tabs__pane-container {
            height: 100%;
            overflow-y: auto;
          }
        }
      `,
      children
    }
  );
}
var attributesContextualHelp = /* @__PURE__ */ jsx5(_Flex, { alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx5(_View, { marginStart: "size-100", children: /* @__PURE__ */ jsxs2(_ContextualHelp, { children: [
  /* @__PURE__ */ jsx5(_Heading, { weight: "heavy", level: 4, children: "Span Attributes" }),
  /* @__PURE__ */ jsx5(_Content, { children: /* @__PURE__ */ jsx5(_Text, { children: "All attributes associated with the span. Attributes are key-value pairs that represent metadata associated with a span. For a detailed description of the attributes, consult the semantic conventions of the OpenInference tracing specification." }) }),
  /* @__PURE__ */ jsx5("footer", { children: /* @__PURE__ */ jsx5(ExternalLink, { href: "https://arize-ai.github.io/open-inference-spec/trace/spec/semantic_conventions.html", children: "Semantic Conventions" }) })
] }) }) });
function SelectedSpanDetails({ selectedSpan }) {
  const hasExceptions = (0, import_react194.useMemo)(() => {
    return spanHasException(selectedSpan);
  }, [selectedSpan]);
  return /* @__PURE__ */ jsxs2(_Flex, { direction: "column", flex: "1 1 auto", height: "100%", children: [
    /* @__PURE__ */ jsx5(
      _View,
      {
        paddingTop: "size-75",
        paddingBottom: "size-75",
        paddingStart: "size-150",
        paddingEnd: "size-200",
        flex: "none",
        children: /* @__PURE__ */ jsx5(SpanItem, { ...selectedSpan })
      }
    ),
    /* @__PURE__ */ jsxs2(Tabs, { children: [
      /* @__PURE__ */ jsx5(TabPane, { name: "Info", children: /* @__PURE__ */ jsx5(SpanInfo, { span: selectedSpan }) }),
      /* @__PURE__ */ jsx5(
        TabPane,
        {
          name: "Evaluations",
          extra: /* @__PURE__ */ jsx5(Counter, { variant: "light", children: selectedSpan.spanEvaluations.length }),
          children: (selected) => {
            return selected ? /* @__PURE__ */ jsx5(SpanEvaluations, { span: selectedSpan }) : null;
          }
        }
      ),
      /* @__PURE__ */ jsx5(TabPane, { name: "Attributes", title: "Attributes", children: /* @__PURE__ */ jsx5(_View, { padding: "size-200", children: /* @__PURE__ */ jsx5(
        Card,
        {
          title: "All Attributes",
          ...defaultCardProps,
          titleExtra: attributesContextualHelp,
          children: /* @__PURE__ */ jsx5(CodeBlock2, { value: selectedSpan.attributes, mimeType: "json" })
        }
      ) }) }),
      /* @__PURE__ */ jsx5(
        TabPane,
        {
          name: "Events",
          extra: /* @__PURE__ */ jsx5(Counter, { variant: hasExceptions ? "danger" : "light", children: selectedSpan.events.length }),
          children: /* @__PURE__ */ jsx5(SpanEventsList, { events: selectedSpan.events })
        }
      )
    ] })
  ] });
}
function SpanInfo({ span }) {
  const { spanKind, attributes } = span;
  const attributesObject = (0, import_react194.useMemo)(() => {
    return JSON.parse(attributes);
  }, [attributes]);
  let content2;
  switch (spanKind) {
    case "llm": {
      content2 = /* @__PURE__ */ jsx5(LLMSpanInfo, { span, spanAttributes: attributesObject });
      break;
    }
    case "retriever": {
      content2 = /* @__PURE__ */ jsx5(RetrieverSpanInfo, { span, spanAttributes: attributesObject });
      break;
    }
    case "reranker": {
      content2 = /* @__PURE__ */ jsx5(RerankerSpanInfo, { span, spanAttributes: attributesObject });
      break;
    }
    case "embedding": {
      content2 = /* @__PURE__ */ jsx5(EmbeddingSpanInfo, { span, spanAttributes: attributesObject });
      break;
    }
    case "tool": {
      content2 = /* @__PURE__ */ jsx5(ToolSpanInfo, { span, spanAttributes: attributesObject });
      break;
    }
    default:
      content2 = /* @__PURE__ */ jsx5(SpanIO, { span });
  }
  return /* @__PURE__ */ jsx5(_View, { padding: "size-200", children: content2 });
}
function LLMSpanInfo(props) {
  const { spanAttributes, span } = props;
  const { input, output } = span;
  const llmAttributes = (0, import_react194.useMemo)(() => {
    const llmAttrs = spanAttributes[SemanticAttributePrefixes.llm];
    if (typeof llmAttrs === "object") {
      return llmAttrs;
    }
    return null;
  }, [spanAttributes]);
  const modelName = (0, import_react194.useMemo)(() => {
    if (llmAttributes == null) {
      return null;
    }
    const maybeModelName = llmAttributes[LLMAttributePostfixes.model_name];
    if (typeof maybeModelName === "string") {
      return maybeModelName;
    }
    return null;
  }, [llmAttributes]);
  const inputMessages = (0, import_react194.useMemo)(() => {
    if (llmAttributes == null) {
      return [];
    }
    return llmAttributes[LLMAttributePostfixes.input_messages] || [];
  }, [llmAttributes]);
  const outputMessages = (0, import_react194.useMemo)(() => {
    if (llmAttributes == null) {
      return [];
    }
    return llmAttributes[LLMAttributePostfixes.output_messages] || [];
  }, [llmAttributes]);
  const prompts = (0, import_react194.useMemo)(() => {
    if (llmAttributes == null) {
      return [];
    }
    const maybePrompts = llmAttributes[LLMAttributePostfixes.prompts];
    if (!isStringArray(maybePrompts)) {
      return [];
    }
    return maybePrompts;
  }, [llmAttributes]);
  const promptTemplateObject = (0, import_react194.useMemo)(() => {
    if (llmAttributes == null) {
      return null;
    }
    const maybePromptTemplate = llmAttributes[LLMAttributePostfixes.prompt_template];
    if (!isAttributePromptTemplate(maybePromptTemplate)) {
      return null;
    }
    return maybePromptTemplate;
  }, [llmAttributes]);
  const invocation_parameters_str = (0, import_react194.useMemo)(() => {
    if (llmAttributes == null) {
      return "{}";
    }
    return llmAttributes[LLMAttributePostfixes.invocation_parameters] || "{}";
  }, [llmAttributes]);
  const modelNameTitleEl = (0, import_react194.useMemo)(() => {
    if (modelName == null) {
      return null;
    }
    return /* @__PURE__ */ jsxs2(_Flex, { direction: "row", gap: "size-100", alignItems: "center", children: [
      /* @__PURE__ */ jsx5(SpanKindIcon, { spanKind: "llm" }),
      /* @__PURE__ */ jsx5(_Text, { textSize: "large", weight: "heavy", children: modelName })
    ] });
  }, [modelName]);
  const hasInput = input != null && input.value != null;
  const hasInputMessages = inputMessages.length > 0;
  const hasOutput = output != null && output.value != null;
  const hasOutputMessages = outputMessages.length > 0;
  const hasPrompts = prompts.length > 0;
  const hasInvocationParams = Object.keys(JSON.parse(invocation_parameters_str)).length > 0;
  const hasPromptTemplateObject = promptTemplateObject != null;
  return /* @__PURE__ */ jsxs2(_Flex, { direction: "column", gap: "size-200", children: [
    /* @__PURE__ */ jsx5(
      TabbedCard,
      {
        backgroundColor: "light",
        borderColor: "light",
        bodyStyle: {
          padding: 0
        },
        variant: "compact",
        title: modelNameTitleEl,
        children: /* @__PURE__ */ jsxs2(Tabs, { children: [
          hasInputMessages ? /* @__PURE__ */ jsx5(TabPane, { name: "Input Messages", hidden: !hasInputMessages, children: /* @__PURE__ */ jsx5(LLMMessagesList, { messages: inputMessages }) }) : null,
          hasInput ? /* @__PURE__ */ jsx5(TabPane, { name: "Input", hidden: !hasInput, children: /* @__PURE__ */ jsx5(CodeBlock2, { ...input }) }) : null,
          hasPromptTemplateObject ? /* @__PURE__ */ jsx5(TabPane, { name: "Prompt Template", hidden: !hasPromptTemplateObject, children: /* @__PURE__ */ jsx5(_View, { padding: "size-200", children: /* @__PURE__ */ jsxs2(_Flex, { direction: "column", gap: "size-100", children: [
            /* @__PURE__ */ jsxs2(
              _View,
              {
                borderRadius: "medium",
                borderColor: "light",
                backgroundColor: "light",
                borderWidth: "thin",
                padding: "size-200",
                children: [
                  /* @__PURE__ */ jsx5(_Text, { color: "text-700", fontStyle: "italic", children: "prompt template" }),
                  /* @__PURE__ */ jsx5(
                    CodeBlock2,
                    {
                      value: promptTemplateObject.template,
                      mimeType: "text"
                    }
                  )
                ]
              }
            ),
            /* @__PURE__ */ jsxs2(
              _View,
              {
                borderRadius: "medium",
                borderColor: "light",
                backgroundColor: "light",
                borderWidth: "thin",
                padding: "size-200",
                children: [
                  /* @__PURE__ */ jsx5(_Text, { color: "text-700", fontStyle: "italic", children: "template variables" }),
                  /* @__PURE__ */ jsx5(
                    CodeBlock2,
                    {
                      value: JSON.stringify(promptTemplateObject.variables),
                      mimeType: "json"
                    }
                  )
                ]
              }
            )
          ] }) }) }) : null,
          /* @__PURE__ */ jsx5(TabPane, { name: "Prompts", hidden: !hasPrompts, children: /* @__PURE__ */ jsx5(LLMPromptsList, { prompts }) }),
          /* @__PURE__ */ jsx5(TabPane, { name: "Invocation Params", hidden: !hasInvocationParams, children: /* @__PURE__ */ jsx5(
            CodeBlock2,
            {
              ...{
                mimeType: "json",
                value: invocation_parameters_str
              }
            }
          ) })
        ] })
      }
    ),
    hasOutput || hasOutputMessages ? /* @__PURE__ */ jsx5(TabbedCard, { ...defaultCardProps, children: /* @__PURE__ */ jsxs2(Tabs, { children: [
      hasOutputMessages ? /* @__PURE__ */ jsx5(TabPane, { name: "Output Messages", hidden: !hasOutputMessages, children: /* @__PURE__ */ jsx5(LLMMessagesList, { messages: outputMessages }) }) : null,
      hasOutput ? /* @__PURE__ */ jsx5(TabPane, { name: "Output", hidden: !hasOutput, children: /* @__PURE__ */ jsx5(CodeBlock2, { ...output }) }) : null
    ] }) }) : null
  ] });
}
function RetrieverSpanInfo(props) {
  const { spanAttributes, span } = props;
  const { input } = span;
  const retrieverAttributes = (0, import_react194.useMemo)(() => {
    const retrieverAttrs = spanAttributes[SemanticAttributePrefixes.retrieval];
    if (typeof retrieverAttrs === "object") {
      return retrieverAttrs;
    }
    return null;
  }, [spanAttributes]);
  const documents = (0, import_react194.useMemo)(() => {
    if (retrieverAttributes == null) {
      return [];
    }
    return retrieverAttributes[RetrievalAttributePostfixes.documents] || [];
  }, [retrieverAttributes]);
  const documentEvaluationsMap = (0, import_react194.useMemo)(() => {
    const documentEvaluations = span.documentEvaluations;
    return documentEvaluations.reduce((acc, documentEvaluation) => {
      const documentPosition = documentEvaluation.documentPosition;
      const evaluations = acc[documentPosition] || [];
      return {
        ...acc,
        [documentPosition]: [...evaluations, documentEvaluation]
      };
    }, {});
  }, [span.documentEvaluations]);
  const hasInput = input != null && input.value != null;
  const hasDocuments = documents.length > 0;
  const hasDocumentRetrievalMetrics = span.documentRetrievalMetrics.length > 0;
  return /* @__PURE__ */ jsxs2(_Flex, { direction: "column", gap: "size-200", children: [
    /* @__PURE__ */ jsx5(Card, { title: "Input", ...defaultCardProps, children: hasInput ? /* @__PURE__ */ jsx5(CodeBlock2, { ...input }) : null }),
    hasDocuments ? /* @__PURE__ */ jsx5(
      Card,
      {
        title: "Documents",
        ...defaultCardProps,
        extra: hasDocumentRetrievalMetrics && /* @__PURE__ */ jsx5(_Flex, { direction: "row", gap: "size-100", children: span.documentRetrievalMetrics.map((retrievalMetric) => {
          return /* @__PURE__ */ jsxs2(Fragment5, { children: [
            /* @__PURE__ */ jsx5(
              RetrievalEvaluationLabel,
              {
                name: retrievalMetric.evaluationName,
                metric: "ndcg",
                score: retrievalMetric.ndcg
              },
              "ndcg"
            ),
            /* @__PURE__ */ jsx5(
              RetrievalEvaluationLabel,
              {
                name: retrievalMetric.evaluationName,
                metric: "precision",
                score: retrievalMetric.precision
              },
              "precision"
            ),
            /* @__PURE__ */ jsx5(
              RetrievalEvaluationLabel,
              {
                name: retrievalMetric.evaluationName,
                metric: "hit",
                score: retrievalMetric.hit
              },
              "hit"
            )
          ] });
        }) }),
        children: /* @__PURE__ */ jsx5(
          "ul",
          {
            css: css`
              padding: var(--ac-global-dimension-static-size-200);
              display: flex;
              flex-direction: column;
              gap: var(--ac-global-dimension-static-size-200);
            `,
            children: documents.map((document2, idx) => {
              return /* @__PURE__ */ jsx5("li", { children: /* @__PURE__ */ jsx5(
                DocumentItem2,
                {
                  document: document2,
                  documentEvaluations: documentEvaluationsMap[idx],
                  borderColor: "seafoam-700",
                  backgroundColor: "seafoam-100",
                  labelColor: "seafoam-1000"
                }
              ) }, idx);
            })
          }
        )
      }
    ) : null
  ] });
}
function RerankerSpanInfo(props) {
  const { spanAttributes } = props;
  const rerankerAttributes = (0, import_react194.useMemo)(() => {
    const rerankerAttrs = spanAttributes[SemanticAttributePrefixes.reranker];
    if (typeof rerankerAttrs === "object") {
      return rerankerAttrs;
    }
    return null;
  }, [spanAttributes]);
  const query2 = (0, import_react194.useMemo)(() => {
    if (rerankerAttributes == null) {
      return "";
    }
    return rerankerAttributes[RerankerAttributePostfixes.query] || "";
  }, [rerankerAttributes]);
  const input_documents = (0, import_react194.useMemo)(() => {
    if (rerankerAttributes == null) {
      return [];
    }
    return rerankerAttributes[RerankerAttributePostfixes.input_documents] || [];
  }, [rerankerAttributes]);
  const output_documents = (0, import_react194.useMemo)(() => {
    if (rerankerAttributes == null) {
      return [];
    }
    return rerankerAttributes[RerankerAttributePostfixes.output_documents] || [];
  }, [rerankerAttributes]);
  const numInputDocuments = input_documents.length;
  const numOutputDocuments = output_documents.length;
  return /* @__PURE__ */ jsxs2(_Flex, { direction: "column", gap: "size-200", children: [
    /* @__PURE__ */ jsx5(Card, { title: "Query", ...defaultCardProps, children: /* @__PURE__ */ jsx5(CodeBlock2, { value: query2, mimeType: "text" }) }),
    /* @__PURE__ */ jsx5(
      Card,
      {
        title: "Input Documents",
        titleExtra: /* @__PURE__ */ jsx5(Counter, { variant: "light", children: numInputDocuments }),
        ...defaultCardProps,
        defaultOpen: false,
        children: /* @__PURE__ */ jsx5(
          "ul",
          {
            css: css`
              padding: var(--ac-global-dimension-static-size-200);
              display: flex;
              flex-direction: column;
              gap: var(--ac-global-dimension-static-size-200);
            `,
            children: input_documents.map((document2, idx) => {
              return /* @__PURE__ */ jsx5("li", { children: /* @__PURE__ */ jsx5(
                DocumentItem2,
                {
                  document: document2,
                  borderColor: "seafoam-700",
                  backgroundColor: "seafoam-100",
                  labelColor: "seafoam-1000"
                }
              ) }, idx);
            })
          }
        )
      }
    ),
    /* @__PURE__ */ jsx5(
      Card,
      {
        title: "Output Documents",
        titleExtra: /* @__PURE__ */ jsx5(Counter, { variant: "light", children: numOutputDocuments }),
        ...defaultCardProps,
        children: /* @__PURE__ */ jsx5(
          "ul",
          {
            css: css`
              padding: var(--ac-global-dimension-static-size-200);
              display: flex;
              flex-direction: column;
              gap: var(--ac-global-dimension-static-size-200);
            `,
            children: output_documents.map((document2, idx) => {
              return /* @__PURE__ */ jsx5("li", { children: /* @__PURE__ */ jsx5(
                DocumentItem2,
                {
                  document: document2,
                  borderColor: "celery-700",
                  backgroundColor: "celery-100",
                  labelColor: "celery-1000"
                }
              ) }, idx);
            })
          }
        )
      }
    )
  ] });
}
function EmbeddingSpanInfo(props) {
  const { spanAttributes } = props;
  const embeddingAttributes = (0, import_react194.useMemo)(() => {
    const embeddingAttrs = spanAttributes[SemanticAttributePrefixes.embedding];
    if (typeof embeddingAttrs === "object") {
      return embeddingAttrs;
    }
    return null;
  }, [spanAttributes]);
  const embeddings = (0, import_react194.useMemo)(() => {
    if (embeddingAttributes == null) {
      return [];
    }
    return embeddingAttributes[EmbeddingAttributePostfixes.embeddings] || [];
  }, [embeddingAttributes]);
  const hasEmbeddings = embeddings.length > 0;
  const modelName = embeddingAttributes?.[EmbeddingAttributePostfixes.model_name];
  return /* @__PURE__ */ jsx5(_Flex, { direction: "column", gap: "size-200", children: hasEmbeddings ? /* @__PURE__ */ jsx5(
    Card,
    {
      title: "Embeddings" + (typeof modelName === "string" ? `: ${modelName}` : ""),
      ...defaultCardProps,
      children: /* @__PURE__ */ jsx5(
        "ul",
        {
          css: css`
                padding: var(--ac-global-dimension-static-size-200);
                display: flex;
                flex-direction: column;
                gap: var(--ac-global-dimension-static-size-200);
              `,
          children: embeddings.map((embedding, idx) => {
            return /* @__PURE__ */ jsx5("li", { children: /* @__PURE__ */ jsxs2(
              _View,
              {
                padding: "size-200",
                backgroundColor: "purple-100",
                borderColor: "purple-700",
                borderWidth: "thin",
                borderRadius: "medium",
                children: [
                  /* @__PURE__ */ jsx5(_Text, { color: "text-700", fontStyle: "italic", children: "embedded text" }),
                  /* @__PURE__ */ jsx5(
                    "pre",
                    {
                      css: css`
                          margin: var(--ac-global-dimension-static-size-100) 0;
                        `,
                      children: embedding[EMBEDDING_TEXT]
                    }
                  )
                ]
              }
            ) }, idx);
          })
        }
      )
    }
  ) : null });
}
function ToolSpanInfo(props) {
  const { spanAttributes } = props;
  const toolAttributes = (0, import_react194.useMemo)(() => {
    const toolAttrs = spanAttributes[SemanticAttributePrefixes.tool];
    if (typeof toolAttrs === "object") {
      return toolAttrs;
    }
    return {};
  }, [spanAttributes]);
  const hasToolAttributes = Object.keys(toolAttributes).length > 0;
  if (!hasToolAttributes) {
    return null;
  }
  const toolName = toolAttributes[ToolAttributePostfixes.name];
  const toolDescription = toolAttributes[ToolAttributePostfixes.description];
  const toolParameters = toolAttributes[ToolAttributePostfixes.parameters];
  return /* @__PURE__ */ jsx5(_Flex, { direction: "column", gap: "size-200", children: /* @__PURE__ */ jsx5(
    Card,
    {
      title: "Tool" + (typeof toolName === "string" ? `: ${toolName}` : ""),
      ...defaultCardProps,
      children: /* @__PURE__ */ jsxs2(_Flex, { direction: "column", children: [
        toolDescription != null ? /* @__PURE__ */ jsx5(
          _View,
          {
            paddingStart: "size-200",
            paddingEnd: "size-200",
            paddingTop: "size-100",
            paddingBottom: "size-100",
            borderBottomColor: "dark",
            borderBottomWidth: "thin",
            backgroundColor: "light",
            children: /* @__PURE__ */ jsxs2(_Flex, { direction: "column", alignItems: "start", gap: "size-50", children: [
              /* @__PURE__ */ jsx5(_Text, { color: "text-700", fontStyle: "italic", children: "Description" }),
              /* @__PURE__ */ jsx5(_Text, { children: toolDescription })
            ] })
          }
        ) : null,
        toolParameters != null ? /* @__PURE__ */ jsx5(
          _View,
          {
            paddingStart: "size-200",
            paddingEnd: "size-200",
            paddingTop: "size-100",
            paddingBottom: "size-100",
            borderBottomColor: "dark",
            borderBottomWidth: "thin",
            children: /* @__PURE__ */ jsxs2(_Flex, { direction: "column", alignItems: "start", width: "100%", children: [
              /* @__PURE__ */ jsx5(_Text, { color: "text-700", fontStyle: "italic", children: "Parameters" }),
              /* @__PURE__ */ jsx5(
                CodeBlock2,
                {
                  value: JSON.stringify(toolParameters),
                  mimeType: "json"
                }
              )
            ] })
          }
        ) : null
      ] })
    }
  ) });
}
var DANGER_DOCUMENT_EVALUATION_LABELS = ["irrelevant"];
function DocumentItem2({
  document: document2,
  documentEvaluations,
  backgroundColor,
  borderColor,
  labelColor
}) {
  const metadata = document2[DOCUMENT_METADATA];
  const hasEvaluations = documentEvaluations && documentEvaluations.length;
  return /* @__PURE__ */ jsx5(
    _View,
    {
      borderRadius: "medium",
      backgroundColor,
      borderColor,
      borderWidth: "thin",
      children: /* @__PURE__ */ jsxs2(_Flex, { direction: "column", children: [
        /* @__PURE__ */ jsx5(
          _View,
          {
            width: "100%",
            borderBottomWidth: "thin",
            borderBottomColor: borderColor,
            children: /* @__PURE__ */ jsxs2(
              _Flex,
              {
                direction: "row",
                justifyContent: "space-between",
                margin: "size-200",
                alignItems: "center",
                children: [
                  /* @__PURE__ */ jsxs2(_Flex, { direction: "row", gap: "size-50", alignItems: "center", children: [
                    /* @__PURE__ */ jsx5(Icon, { svg: /* @__PURE__ */ jsx5(Icons.FileOutline, {}) }),
                    /* @__PURE__ */ jsxs2(_Heading, { level: 4, children: [
                      "document ",
                      document2[DOCUMENT_ID]
                    ] })
                  ] }),
                  typeof document2[DOCUMENT_SCORE] === "number" && /* @__PURE__ */ jsx5(Label, { color: labelColor, children: `score ${numberFormatter2(
                    document2[DOCUMENT_SCORE]
                  )}` })
                ]
              }
            )
          }
        ),
        /* @__PURE__ */ jsx5(
          "pre",
          {
            css: css`
            padding: var(--ac-global-dimension-static-size-200);
            white-space: normal;
            margin: 0;
          `,
            children: document2[DOCUMENT_CONTENT]
          }
        ),
        metadata && /* @__PURE__ */ jsx5(Fragment5, { children: /* @__PURE__ */ jsx5(_View, { borderColor, borderTopWidth: "thin", children: /* @__PURE__ */ jsx5(CodeBlock2, { value: JSON.stringify(metadata), mimeType: "json" }) }) }),
        hasEvaluations && /* @__PURE__ */ jsx5(
          _View,
          {
            borderColor,
            borderTopWidth: "thin",
            padding: "size-200",
            children: /* @__PURE__ */ jsxs2(_Flex, { direction: "column", gap: "size-100", children: [
              /* @__PURE__ */ jsx5(_Heading, { level: 3, weight: "heavy", children: "Evaluations" }),
              /* @__PURE__ */ jsx5("ul", { children: documentEvaluations.map((documentEvaluation, idx) => {
                const evalLabelColor = documentEvaluation.label && DANGER_DOCUMENT_EVALUATION_LABELS.includes(
                  documentEvaluation.label
                ) ? "danger" : labelColor;
                return /* @__PURE__ */ jsx5("li", { children: /* @__PURE__ */ jsx5(
                  _View,
                  {
                    padding: "size-200",
                    borderWidth: "thin",
                    borderColor,
                    borderRadius: "medium",
                    children: /* @__PURE__ */ jsxs2(_Flex, { direction: "column", gap: "size-50", children: [
                      /* @__PURE__ */ jsxs2(_Flex, { direction: "row", gap: "size-100", children: [
                        /* @__PURE__ */ jsx5(_Text, { weight: "heavy", elementType: "h5", children: documentEvaluation.name }),
                        documentEvaluation.label && /* @__PURE__ */ jsx5(Label, { color: evalLabelColor, shape: "badge", children: documentEvaluation.label }),
                        typeof documentEvaluation.score === "number" && /* @__PURE__ */ jsx5(Label, { color: evalLabelColor, shape: "badge", children: /* @__PURE__ */ jsxs2(_Flex, { direction: "row", gap: "size-50", children: [
                          /* @__PURE__ */ jsx5(
                            _Text,
                            {
                              textSize: "xsmall",
                              weight: "heavy",
                              color: "inherit",
                              children: "score"
                            }
                          ),
                          /* @__PURE__ */ jsx5(_Text, { textSize: "xsmall", children: formatFloat(documentEvaluation.score) })
                        ] }) })
                      ] }),
                      typeof documentEvaluation.explanation && /* @__PURE__ */ jsx5(
                        "p",
                        {
                          css: css`
                                margin-top: var(
                                  --ac-global-dimension-static-size-100
                                );
                                margin-bottom: 0;
                              `,
                          children: documentEvaluation.explanation
                        }
                      )
                    ] })
                  }
                ) }, idx);
              }) })
            ] })
          }
        )
      ] })
    }
  );
}
function LLMMessage({ message }) {
  const messageContent = message[MESSAGE_CONTENT];
  const toolCalls = message[MESSAGE_TOOL_CALLS] || [];
  const hasFunctionCall = message[MESSAGE_FUNCTION_CALL_ARGUMENTS_JSON] && message[MESSAGE_FUNCTION_CALL_NAME];
  const role = message[MESSAGE_ROLE];
  const messageStyles = (0, import_react194.useMemo)(() => {
    if (role === "user") {
      return {
        backgroundColor: "gray-600",
        borderColor: "gray-100"
      };
    } else if (role === "assistant") {
      return {
        backgroundColor: "blue-100",
        borderColor: "blue-700"
      };
    } else if (role === "system") {
      return {
        backgroundColor: "indigo-100",
        borderColor: "indigo-700"
      };
    } else if (["function", "tool"].includes(role)) {
      return {
        backgroundColor: "yellow-100",
        borderColor: "yellow-700"
      };
    }
    return {
      backgroundColor: "gray-600",
      borderColor: "gray-400"
    };
  }, [role]);
  return /* @__PURE__ */ jsx5(
    _View,
    {
      borderWidth: "thin",
      borderRadius: "medium",
      padding: "size-200",
      ...messageStyles,
      children: /* @__PURE__ */ jsxs2(_Flex, { direction: "column", alignItems: "start", children: [
        /* @__PURE__ */ jsxs2(_Text, { color: "text-700", fontStyle: "italic", children: [
          role,
          message[MESSAGE_NAME] ? `: ${message[MESSAGE_NAME]}` : ""
        ] }),
        messageContent ? /* @__PURE__ */ jsx5(
          "pre",
          {
            css: css`
              text-wrap: wrap;
              margin: var(--ac-global-dimension-static-size-100) 0;
            `,
            children: message[MESSAGE_CONTENT]
          }
        ) : null,
        toolCalls.length > 0 ? toolCalls.map((toolCall, idx) => {
          return /* @__PURE__ */ jsxs2(
            "pre",
            {
              css: css`
                    text-wrap: wrap;
                    margin: var(--ac-global-dimension-static-size-100) 0;
                  `,
              children: [
                toolCall[TOOL_CALL_FUNCTION_NAME],
                "(",
                JSON.stringify(
                  JSON.parse(
                    toolCall[TOOL_CALL_FUNCTION_ARGUMENTS_JSON]
                  ),
                  null,
                  2
                ),
                ")"
              ]
            },
            idx
          );
        }) : null,
        hasFunctionCall ? /* @__PURE__ */ jsxs2(
          "pre",
          {
            css: css`
              text-wrap: wrap;
              margin: var(--ac-global-dimension-static-size-100) 0;
            `,
            children: [
              message[MESSAGE_FUNCTION_CALL_NAME],
              "(",
              JSON.stringify(
                JSON.parse(
                  message[MESSAGE_FUNCTION_CALL_ARGUMENTS_JSON]
                ),
                null,
                2
              ),
              ")"
            ]
          }
        ) : null
      ] })
    }
  );
}
function LLMMessagesList({ messages }) {
  return /* @__PURE__ */ jsx5(
    "ul",
    {
      css: css`
        display: flex;
        flex-direction: column;
        gap: var(--ac-global-dimension-static-size-100);
        padding: var(--ac-global-dimension-static-size-200);
      `,
      children: messages.map((message, idx) => {
        return /* @__PURE__ */ jsx5("li", { children: /* @__PURE__ */ jsx5(LLMMessage, { message }) }, idx);
      })
    }
  );
}
function LLMPromptsList({ prompts }) {
  return /* @__PURE__ */ jsx5(
    "ul",
    {
      "data-testid": "llm-prompts-list",
      css: css`
        padding: var(--ac-global-dimension-size-200);
        display: flex;
        flex-direction: column;
        gap: var(--ac-global-dimension-size-100);
      `,
      children: prompts.map((prompt, idx) => {
        return /* @__PURE__ */ jsx5("li", { children: /* @__PURE__ */ jsx5(
          _View,
          {
            backgroundColor: "gray-600",
            borderColor: "gray-400",
            borderWidth: "thin",
            borderRadius: "medium",
            padding: "size-100",
            children: /* @__PURE__ */ jsx5(
              "pre",
              {
                css: css`
                  text-wrap: wrap;
                  margin: 0;
                `,
                children: prompt
              }
            )
          }
        ) }, idx);
      })
    }
  );
}
function SpanIO({ span }) {
  const { input, output } = span;
  const isMissingIO = input == null && output == null;
  return /* @__PURE__ */ jsxs2(_Flex, { direction: "column", gap: "size-200", children: [
    input && input.value != null ? /* @__PURE__ */ jsx5(Card, { title: "Input", ...defaultCardProps, children: /* @__PURE__ */ jsx5(CodeBlock2, { ...input }) }) : null,
    output && output.value != null ? /* @__PURE__ */ jsx5(
      Card,
      {
        title: "Output",
        ...defaultCardProps,
        backgroundColor: "green-100",
        borderColor: "green-700",
        children: /* @__PURE__ */ jsx5(CodeBlock2, { ...output })
      }
    ) : null,
    isMissingIO ? /* @__PURE__ */ jsx5(
      Card,
      {
        title: "All Attributes",
        titleExtra: attributesContextualHelp,
        ...defaultCardProps,
        children: /* @__PURE__ */ jsx5(CodeBlock2, { value: span.attributes, mimeType: "json" })
      }
    ) : null
  ] });
}
var codeMirrorCSS3 = css`
  .cm-content {
    padding: var(--ac-global-dimension-static-size-100) 0;
  }
  .cm-editor,
  .cm-gutters {
    background-color: transparent;
  }
`;
function CodeBlock2({ value, mimeType }) {
  const { theme: theme3 } = useTheme2();
  const codeMirrorTheme = theme3 === "light" ? void 0 : nord;
  let content2;
  switch (mimeType) {
    case "json":
      content2 = /* @__PURE__ */ jsx5(
        esm_default,
        {
          value: JSON.stringify(JSON.parse(value), null, 2),
          basicSetup: {
            lineNumbers: true,
            foldGutter: true,
            bracketMatching: true,
            syntaxHighlighting: true,
            highlightActiveLine: false,
            highlightActiveLineGutter: false
          },
          extensions: [json2(), EditorView.lineWrapping],
          editable: false,
          theme: codeMirrorTheme,
          css: codeMirrorCSS3
        }
      );
      break;
    case "text":
      content2 = /* @__PURE__ */ jsx5(
        esm_default,
        {
          value,
          theme: codeMirrorTheme,
          editable: false,
          basicSetup: {
            lineNumbers: false,
            highlightActiveLine: false,
            highlightActiveLineGutter: false,
            syntaxHighlighting: true
          },
          extensions: [EditorView.lineWrapping],
          css: codeMirrorCSS3
        }
      );
      break;
    default:
      assertUnreachable2(mimeType);
  }
  return content2;
}
function EmptyIndicator({ text: text2 }) {
  return /* @__PURE__ */ jsxs2(
    _Flex,
    {
      direction: "column",
      alignItems: "center",
      flex: "1 1 auto",
      height: "size-2400",
      justifyContent: "center",
      gap: "size-100",
      children: [
        /* @__PURE__ */ jsx5(EmptyGraphic, { graphicKey: "documents" }),
        /* @__PURE__ */ jsx5(_Text, { children: text2 })
      ]
    }
  );
}
function SpanEventsList({ events }) {
  if (events.length === 0) {
    return /* @__PURE__ */ jsx5(EmptyIndicator, { text: "No events" });
  }
  return /* @__PURE__ */ jsx5(List, { children: events.map((event, idx) => {
    const isException = event.name === "exception";
    return /* @__PURE__ */ jsx5(ListItem, { children: /* @__PURE__ */ jsxs2(_Flex, { direction: "row", alignItems: "center", gap: "size-100", children: [
      /* @__PURE__ */ jsx5(_View, { flex: "none", children: /* @__PURE__ */ jsx5(
        "div",
        {
          "data-event-type": isException ? "exception" : "info",
          css: (theme3) => css`
                    &[data-event-type="exception"] {
                      --px-event-icon-color: ${theme3.colors.statusDanger};
                    }
                    &[data-event-type="info"] {
                      --px-event-icon-color: ${theme3.colors.statusInfo};
                    }
                    .ac-icon-wrap {
                      color: var(--px-event-icon-color);
                    }
                  `,
          children: /* @__PURE__ */ jsx5(
            Icon,
            {
              svg: isException ? /* @__PURE__ */ jsx5(Icons.AlertTriangleOutline, {}) : /* @__PURE__ */ jsx5(Icons.InfoOutline, {})
            }
          )
        }
      ) }),
      /* @__PURE__ */ jsxs2(_Flex, { direction: "column", gap: "size-25", flex: "1 1 auto", children: [
        /* @__PURE__ */ jsx5(_Text, { weight: "heavy", children: event.name }),
        /* @__PURE__ */ jsx5(_Text, { color: "text-700", children: event.message })
      ] }),
      /* @__PURE__ */ jsx5(_View, { children: /* @__PURE__ */ jsx5(_Text, { color: "text-700", children: new Date(event.timestamp).toLocaleString() }) })
    ] }) }, idx);
  }) });
}
function SpanEvaluations(props) {
  return /* @__PURE__ */ jsx5(SpanEvaluationsTable, { span: props.span });
}

// src/components/nav/Logo.tsx
function Logo() {
  return /* @__PURE__ */ jsxs2(
    "svg",
    {
      xmlns: "http://www.w3.org/2000/svg",
      xmlnsXlink: "http://www.w3.org/1999/xlink",
      viewBox: "0 0 305.92 350.13",
      width: 28,
      height: 28,
      css: css`
        .cls-1 {
          fill: url(#linear-gradient);
        }

        .cls-2 {
          fill: url(#Fade_to_Black_2-2);
        }

        .cls-2,
        .cls-3 {
          opacity: 0.5;
        }

        .cls-4 {
          fill: #fedbb5;
        }

        .cls-5 {
          fill: #e5b4a6;
        }

        .cls-6 {
          fill: url(#Fade_to_Black_2);
        }

        .cls-6,
        .cls-7,
        .cls-8,
        .cls-9,
        .cls-10,
        .cls-11,
        .cls-12,
        .cls-13,
        .cls-14 {
          opacity: 0.4;
        }

        .cls-3 {
          fill: url(#linear-gradient-10);
        }

        .cls-7 {
          fill: url(#linear-gradient-6);
        }

        .cls-8 {
          fill: url(#linear-gradient-3);
        }

        .cls-9 {
          fill: url(#linear-gradient-4);
        }

        .cls-10 {
          fill: url(#linear-gradient-2);
        }

        .cls-11 {
          fill: url(#linear-gradient-7);
        }

        .cls-12 {
          fill: url(#linear-gradient-5);
        }

        .cls-13 {
          fill: url(#linear-gradient-8);
        }

        .cls-14 {
          fill: url(#linear-gradient-9);
        }
      `,
      children: [
        /* @__PURE__ */ jsxs2("defs", { children: [
          /* @__PURE__ */ jsxs2(
            "linearGradient",
            {
              id: "linear-gradient",
              x1: "45.77",
              y1: "21.43",
              x2: "201.89",
              y2: "291.83",
              gradientUnits: "userSpaceOnUse",
              children: [
                /* @__PURE__ */ jsx5("stop", { offset: "0", stopColor: "#18bab6" }),
                /* @__PURE__ */ jsx5("stop", { offset: ".5", stopColor: "#00adee" }),
                /* @__PURE__ */ jsx5("stop", { offset: "1", stopColor: "#0095c4" })
              ]
            }
          ),
          /* @__PURE__ */ jsxs2(
            "linearGradient",
            {
              id: "linear-gradient-2",
              x1: "197.65",
              y1: "237.84",
              x2: "65.97",
              y2: "9.77",
              gradientUnits: "userSpaceOnUse",
              children: [
                /* @__PURE__ */ jsx5("stop", { offset: "0", stopColor: "#fdfdfe", stopOpacity: "0" }),
                /* @__PURE__ */ jsx5("stop", { offset: ".11", stopColor: "#fdfdfe", stopOpacity: ".17" }),
                /* @__PURE__ */ jsx5("stop", { offset: ".3", stopColor: "#fdfdfe", stopOpacity: ".42" }),
                /* @__PURE__ */ jsx5("stop", { offset: ".47", stopColor: "#fdfdfe", stopOpacity: ".63" }),
                /* @__PURE__ */ jsx5("stop", { offset: ".64", stopColor: "#fdfdfe", stopOpacity: ".79" }),
                /* @__PURE__ */ jsx5("stop", { offset: ".78", stopColor: "#fdfdfe", stopOpacity: ".9" }),
                /* @__PURE__ */ jsx5("stop", { offset: ".91", stopColor: "#fdfdfe", stopOpacity: ".97" }),
                /* @__PURE__ */ jsx5("stop", { offset: "1", stopColor: "#fdfdfe" })
              ]
            }
          ),
          /* @__PURE__ */ jsx5(
            "linearGradient",
            {
              id: "linear-gradient-3",
              x1: "158.8",
              y1: "236.43",
              x2: "63.93",
              y2: "72.09",
              xlinkHref: "#linear-gradient-2"
            }
          ),
          /* @__PURE__ */ jsx5(
            "linearGradient",
            {
              id: "linear-gradient-4",
              x1: "145.73",
              y1: "248.43",
              x2: "92.77",
              y2: "156.7",
              xlinkHref: "#linear-gradient-2"
            }
          ),
          /* @__PURE__ */ jsx5(
            "linearGradient",
            {
              id: "linear-gradient-5",
              x1: "147.93",
              y1: "266.95",
              x2: "114.95",
              y2: "209.83",
              xlinkHref: "#linear-gradient-2"
            }
          ),
          /* @__PURE__ */ jsxs2(
            "linearGradient",
            {
              id: "linear-gradient-6",
              x1: "92.25",
              y1: "261.75",
              x2: "92.25",
              y2: "321.91",
              gradientUnits: "userSpaceOnUse",
              children: [
                /* @__PURE__ */ jsx5("stop", { offset: "0", stopColor: "#231f20" }),
                /* @__PURE__ */ jsx5("stop", { offset: ".03", stopColor: "#231f20", stopOpacity: ".9" }),
                /* @__PURE__ */ jsx5("stop", { offset: ".22", stopColor: "#231f20", stopOpacity: ".4" }),
                /* @__PURE__ */ jsx5("stop", { offset: ".42", stopColor: "#231f20", stopOpacity: ".1" }),
                /* @__PURE__ */ jsx5("stop", { offset: ".65", stopColor: "#231f20", stopOpacity: "0" })
              ]
            }
          ),
          /* @__PURE__ */ jsxs2(
            "linearGradient",
            {
              id: "Fade_to_Black_2",
              "data-name": "Fade to Black 2",
              x1: "159.88",
              y1: "256.07",
              x2: "159.88",
              y2: "286.75",
              gradientUnits: "userSpaceOnUse",
              children: [
                /* @__PURE__ */ jsx5("stop", { offset: "0", stopColor: "#231f20" }),
                /* @__PURE__ */ jsx5("stop", { offset: "1", stopColor: "#231f20", stopOpacity: "0" })
              ]
            }
          ),
          /* @__PURE__ */ jsxs2(
            "linearGradient",
            {
              id: "linear-gradient-7",
              x1: "174.69",
              y1: "176.58",
              x2: "174.69",
              y2: "151.5",
              gradientUnits: "userSpaceOnUse",
              children: [
                /* @__PURE__ */ jsx5("stop", { offset: "0", stopColor: "#231f20" }),
                /* @__PURE__ */ jsx5("stop", { offset: ".03", stopColor: "#231f20", stopOpacity: ".95" }),
                /* @__PURE__ */ jsx5("stop", { offset: ".51", stopColor: "#231f20", stopOpacity: ".26" }),
                /* @__PURE__ */ jsx5("stop", { offset: ".81", stopColor: "#231f20", stopOpacity: "0" })
              ]
            }
          ),
          /* @__PURE__ */ jsxs2(
            "linearGradient",
            {
              id: "linear-gradient-8",
              x1: "229.53",
              y1: "195.1",
              x2: "229.53",
              y2: "134.41",
              gradientUnits: "userSpaceOnUse",
              children: [
                /* @__PURE__ */ jsx5("stop", { offset: "0", stopColor: "#231f20" }),
                /* @__PURE__ */ jsx5("stop", { offset: ".18", stopColor: "#231f20", stopOpacity: ".48" }),
                /* @__PURE__ */ jsx5("stop", { offset: ".38", stopColor: "#231f20", stopOpacity: ".12" }),
                /* @__PURE__ */ jsx5("stop", { offset: ".58", stopColor: "#231f20", stopOpacity: "0" })
              ]
            }
          ),
          /* @__PURE__ */ jsx5(
            "linearGradient",
            {
              id: "Fade_to_Black_2-2",
              "data-name": "Fade to Black 2",
              x1: "286",
              y1: "242.89",
              x2: "265.05",
              y2: "206.61",
              xlinkHref: "#Fade_to_Black_2"
            }
          ),
          /* @__PURE__ */ jsx5(
            "linearGradient",
            {
              id: "linear-gradient-9",
              x1: "302.87",
              y1: "232.93",
              x2: "271.49",
              y2: "178.58",
              xlinkHref: "#linear-gradient-2"
            }
          ),
          /* @__PURE__ */ jsxs2(
            "linearGradient",
            {
              id: "linear-gradient-10",
              x1: "221.39",
              y1: "223.73",
              x2: "267.07",
              y2: "197.36",
              gradientUnits: "userSpaceOnUse",
              children: [
                /* @__PURE__ */ jsx5("stop", { offset: "0", stopColor: "#231f20" }),
                /* @__PURE__ */ jsx5("stop", { offset: ".31", stopColor: "#231f20", stopOpacity: ".5" }),
                /* @__PURE__ */ jsx5("stop", { offset: ".67", stopColor: "#231f20", stopOpacity: ".13" }),
                /* @__PURE__ */ jsx5("stop", { offset: "1", stopColor: "#231f20", stopOpacity: "0" })
              ]
            }
          )
        ] }),
        /* @__PURE__ */ jsxs2("g", { id: "Layer_1-2", "data-name": "Layer 1", children: [
          /* @__PURE__ */ jsx5(
            "path",
            {
              className: "cls-1",
              d: "m305.42,218.76c-.9-4.06-2.96-7.8-6.14-11.13-1.22-1.28-2.59-2.48-4.07-3.58-.72-.53-1.48-1.03-2.26-1.52-.97-.6-1.98-1.19-3.07-1.75-4.05-2.08-7.5-4.17-10.53-6.41-1.23-.91-2.42-1.86-3.53-2.83-2.71-2.37-4.53-4.38-5.88-6.53-.44-.69-.83-1.44-1.2-2.14-.16-.31-.39-.57-.66-.77-.49-.36-1.12-.52-1.75-.4-.97.18-1.72.97-1.83,1.96-.09.76-.08,1.57.02,2.41.06.5-.2.96-.66,1.17-.11.05-.22.08-.33.09-.64.08-1.23.43-1.6.96-.37.54-.48,1.2-.33,1.83.14.55.32.93.48,1.24l.14.28c.1.19.2.39.31.58.3.57.62,1.15,1,1.71.71,1.04,1.52,2.07,2.46,3.18.3.35.35.86.13,1.27-.22.41-.68.64-1.14.58-5.37-.73-10.17-1.93-14.65-3.59-.51-.19-1.03-.37-1.53-.57-4.02-1.69,3.23-8.92,6.55-14.03,14.55-22.37,17.56-48,17.68-73.93.12-25.07-2.59-49.78-7.57-74.18v-.04c-3.25-20.44-6.01-28.12-7.74-30.97-.37-.76-.78-1.22-1.21-1.45-.48-.32-.73-.17-.73-.17-.93.03-2.01.87-3.3,2.22-5.42,5.71-5.12,12.49-3.62,19.58,6.85,32.22,12.01,64.63,9.66,97.75-1.61,22.83-5.87,44.82-21.82,62.69-.96,1.08-1.99,2.08-3.02,3.1-1.2,1.17-3.04,3.46-4.42,2.51-1.84-1.28-.2-3.9.37-5.25,9.35-21.89,12.04-44.77,10.6-68.36-.03-.55-.09-1.09-.13-1.63l.02-.03c-.04-.44-.08-.85-.12-1.28-.24-3.12-.53-6.23-.92-9.33-4.02-37.42-8.84-39.84-8.84-39.84h0c-.32-.28-.72-.51-1.25-.62-2.53-.53-3.92,1.7-5.04,3.39-5.07,7.6-2.83,15.67-1.19,23.67,5.73,28.01,5.82,55.75-4.02,83-.9,2.48-1.98,4.9-3.12,7.28-1.2,2.53-1.99,5.7-6.12,4.34-3.86-1.28-2.78-4.2-2.27-6.87,1.29-6.79,2.33-13.59,2.98-20.42l.02.04c.06-.67.1-1.32.16-1.98.1-1.18.17-2.36.24-3.54.06-.99.11-1.96.15-2.91.02-.49.04-.97.06-1.46.78-21.63-2.85-31.46-4.23-34.37-.15-.36-.32-.68-.51-.97h0s0,0,0,0c-1.43-2.14-3.8-1.89-5.84.13-3.76,3.72-5.84,8.1-4.88,13.62,2.8,16.09,1.16,32.03-1.84,47.9-.41,2.13-1.36,6-5.9,5.01-3.09-.68-3.81-2.01-3.99-4.69.03-2.03.01-4.05-.06-6.08,0-.05,0-.1,0-.15h0c-.01-.29-.03-.57-.04-.86v-.02c0-.14,0-.27-.02-.4-.13-2.76-.36-5.53-.7-8.3-.03-.27-.08-.53-.12-.79-1.74-15.62-4-17.13-4-17.13-1.45-1.88-3.71-1.57-5.67.38-3.76,3.72-5.67,8.08-4.88,13.62.57,4.06.43,2.81.84,6.34.33,1.82.66,5.13.69,6.19-.09.94-.32,1.76-.9,2.37-1.92,2.07-5.02-.05-7.37-1.02-45.52-18.84-84.49-45.28-118.5-78.71C29.51,74.47,6.74,46.89,6.74,46.89h0c-.84-.99-1.91-1.55-3.53-.85C.24,47.32.33,51.13.06,54.33c-.54,6.41,2.88,11.07,6.62,15.42,51.36,59.92,114.05,102.98,189.7,124.51l13.61,3.61c.16.04.32.08.48.12.03,0,.05.02.07.02l11.72,3.11.32.08c-.38.11-.82.2-1.28.28-12.9,2.55-38.42-2.14-58.91-6.92-10.15-2.13-20.1-4.71-29.85-7.79-.45-.13-.69-.2-.69-.2v-.02c-37.88-12.05-72.58-31.59-102.92-61.4-2.87-2.82-5.54-5.86-8.15-8.95-2.41-2.86-7.36-8.84-9.06-10.89-.19-.27-.39-.51-.6-.73h0s0,0,0,0c-.52-.53-1.14-.87-2.03-.66-2.12.49-2.72,2.67-3.11,4.51-1.55,7.39.8,13.59,5.76,19.15,31.09,34.84,70.09,57.1,113.9,71.7,24.88,8.29,50.46,13.32,76.57,16.54-15.56,5.04-31.58,6.57-47.72,6.17-31.26-.78-60.57-8.29-88.12-21.68-10.16-5.22-19.62-11.05-22.11-12.6-1.43-.98-2.9-1.57-4.36-.45-2.74,2.12-.85,5.85.03,8.76,1.69,5.6,5.58,9.47,10.63,12.14,44.88,23.74,92.26,33.22,142.71,24.8,5.11-.85,9.95-1.79,15.29-3.59-8.43,7.3-18.2,12.06-28.47,15.82-31.59,11.56-62.98,11.09-94.25,3.27-10.03-2.69-21.68-7.05-21.68-7.05h0c-1.68-.73-3.34-.99-4.64.87-2.28,3.27-.29,6.66,1.68,9.74,4.67,7.27,13.68,7.98,20.81,10.44,2.44.77-4.2,5.21-6.34,6.84-10.34,7.91-20.46,15.14-30.76,22.8l-6.74,4.97h0c-1.16.8-2.18,1.69-1.64,3.37.61,1.88,2.57,2.22,4.47,2.62,7.37,1.53,13.66-.92,19.48-5.27,12.48-9.35,25.18-18.41,37.39-28.11,4.64-3.7,8.86-3.39,15.21-1.74-15.88,11.97-30.73,23.17-45.6,34.36-15.08,11.35-30.18,22.7-45.28,34.03l-9.98,7.38c-.15.1-.29.21-.43.32l-.15.11h0c-.85.68-1.48,1.44-1.3,2.44.4,2.25,3.05,2.81,5.21,3.18,8.92,1.54,14.44-1.82,20.54-6.39,30.5-22.9,61.12-45.64,91.44-68.76,6.8-5.18,13.79-8.11,23.61-7.01-8.36,6.25-16.38,12.24-24.3,18.16l-21.51,15.92c-.15.11-.3.22-.45.33h-.02c-1.14.9-1.94,1.96-1.49,3.53.82,2.84,4.24,3.18,7.15,3.62,5.34.8,9.87-1.09,14.06-4.21,2.41-1.8,4.84-3.57,7.28-5.33h0s32.84-26.08,32.84-26.08c0,0,7.76-5.54,16.74-10.64.8-.5,1.61-1,2.41-1.49.34-.15,1.2-.54,2.48-1.16.97-.5,1.93-.99,2.89-1.44,1.41-.72,3.05-1.59,4.88-2.59,5.3-2.2,20.44-9.27,32.98-22.62,5.96-4.6,14.34-10.6,20.87-13.49h0s.04-.02.04-.02c.5-.22.98-.42,1.46-.6h0s.03,0,.06-.02c.32-.12.63-.23.93-.33l.84-.33c2.36-.67,6.22-.92,6.71,4.29.09,1.28.06,2.59-.08,3.97-.11,1.04-.3,2.14-.46,3.02-.15.85.2,1.71.88,2.21.11.08.22.15.34.21.9.44,1.99.24,2.66-.51.25-.28.51-.55.77-.83,3.22-3.38,6.47-5.73,9.95-7.16,5.07-2.1,10.2-2.11,15.68-.02,2.6.99,5.05,2.34,7.48,4.14,1.03.76,2.08,1.62,3.11,2.55.61.56,1.22,1.18,1.76,1.72l.09.09.44.45c.08.08.17.16.26.22.52.38,1.18.53,1.82.39.75-.16,1.37-.69,1.63-1.41.05-.14.1-.28.15-.41,1.56-4.59,1.87-8.82.97-12.93Z"
            }
          ),
          /* @__PURE__ */ jsx5(
            "path",
            {
              className: "cls-4",
              d: "m208.42,169.5c-.37,2.28-.76,4.55-1.19,6.82.43-2.27.82-4.55,1.19-6.82h0Z"
            }
          ),
          /* @__PURE__ */ jsx5(
            "path",
            {
              className: "cls-4",
              d: "m248.79,194.81c.16.07.33.13.5.19-.17-.06-.33-.13-.5-.19"
            }
          ),
          /* @__PURE__ */ jsx5("path", { className: "cls-4", d: "m230.37,180.81s0,0,0,.01c0,0,0,0,0-.01" }),
          /* @__PURE__ */ jsx5(
            "path",
            {
              className: "cls-4",
              d: "m230.5,180.5s-.03.06-.04.1c.01-.03.03-.07.04-.1"
            }
          ),
          /* @__PURE__ */ jsx5(
            "path",
            {
              className: "cls-4",
              d: "m255.55,180.46s-.05.08-.08.13c.03-.04.05-.08.08-.13"
            }
          ),
          /* @__PURE__ */ jsx5(
            "path",
            {
              className: "cls-4",
              d: "m215.62,178.85c-.28.59-.54,1.22-.82,1.82.28-.59.54-1.22.82-1.82"
            }
          ),
          /* @__PURE__ */ jsx5(
            "path",
            {
              className: "cls-4",
              d: "m188.53,177.51s.01,0,.02,0c0,0-.01,0-.02,0"
            }
          ),
          /* @__PURE__ */ jsx5(
            "polyline",
            {
              className: "cls-4",
              points: "184.47 175.68 184.47 175.69 184.47 175.68"
            }
          ),
          /* @__PURE__ */ jsx5(
            "polyline",
            {
              className: "cls-4",
              points: "184.45 175.66 184.46 175.66 184.45 175.66"
            }
          ),
          /* @__PURE__ */ jsx5(
            "polyline",
            {
              className: "cls-4",
              points: "184.43 175.62 184.44 175.64 184.43 175.62"
            }
          ),
          /* @__PURE__ */ jsx5("path", { className: "cls-4", d: "m184.42,175.6s0,0,0,.01c0,0,0,0,0-.01" }),
          /* @__PURE__ */ jsx5(
            "path",
            {
              className: "cls-4",
              d: "m184.39,175.57s.01.02.02.03c0-.01-.01-.02-.02-.03"
            }
          ),
          /* @__PURE__ */ jsx5(
            "path",
            {
              className: "cls-4",
              d: "m183.65,172.72s0,.01,0,.02c0,0,0-.01,0-.02"
            }
          ),
          /* @__PURE__ */ jsx5(
            "path",
            {
              className: "cls-4",
              d: "m193.79,171c-.08.46-.17.91-.26,1.37.09-.46.17-.91.26-1.37"
            }
          ),
          /* @__PURE__ */ jsx5(
            "path",
            {
              className: "cls-4",
              d: "m168.79,167.86c-.3.32-.63.54-.99.68.35-.14.68-.36.99-.68"
            }
          ),
          /* @__PURE__ */ jsx5(
            "path",
            {
              className: "cls-5",
              d: "m184.47,175.69c.25.35.57.64.99.9h0c-.42-.25-.74-.55-.99-.9m-.02-.03s0,.01.01.02c0,0,0-.01-.01-.02m-.02-.02v.02s0-.01,0-.02m-.01-.02s0,0,0,0c0,0,0,0,0,0m-.01-.01s0,0,0,0c0,0,0,0,0,0m-.02-.04s0,0,0,0c0,0,0,0,0,0m-.74-2.82s0,.01,0,.01c0,0,0,0,0-.01m0-.06h0s0,.03,0,.04c0-.01,0-.02,0-.04m-19.74-4.71s.03.01.04.02c.95.41,1.9.74,2.79.74.37,0,.73-.06,1.06-.19-.34.13-.69.19-1.06.19-.9,0-1.87-.34-2.83-.75m19.61-2.97s0,.01,0,.02c0,0,0-.01,0-.02"
            }
          ),
          /* @__PURE__ */ jsx5(
            "path",
            {
              className: "cls-5",
              d: "m249.29,195c.08.03.16.06.24.09h0c-.08-.03-.16-.06-.24-.09m-18.14-7.32s0,0-.01,0c0,0,.01,0,.01,0m-2.75-1.47c0,.64.22,1.23.85,1.66.23.16.47.23.71.23.38,0,.77-.16,1.17-.41-.4.25-.79.41-1.17.41-.25,0-.49-.07-.72-.23-.63-.43-.85-1.02-.85-1.66m1.33-3.84c-.04.08-.07.17-.11.25.04-.08.07-.17.11-.25m.64-1.54c-.21.51-.42,1.02-.64,1.53.22-.51.43-1.02.64-1.53m.09-.23c-.03.07-.06.14-.09.22.03-.07.06-.14.09-.22m25.01-.01s-.01.02-.02.03c0-.01.01-.02.02-.03m.1-.16s-.01.02-.02.03c0-.01.01-.02.02-.03m-25.03-.01s-.03.06-.04.09c.01-.03.02-.06.04-.09m-23.84-.69c0,1.46.59,2.74,2.81,3.47.68.23,1.28.33,1.8.33,1.87,0,2.77-1.32,3.5-2.85-.73,1.53-1.62,2.85-3.5,2.85-.52,0-1.11-.1-1.8-.33-2.22-.73-2.8-2.01-2.81-3.47m-18.18-2.21h.01-.01m3.63-1.49c-.67.87-1.65,1.51-3.14,1.51-.15,0-.3,0-.46-.02.16.01.31.02.46.02,1.48,0,2.47-.63,3.14-1.51m28.75-10.95s-.01,0-.02,0c-.66,2.17-1.35,4.33-2.13,6.49-.9,2.48-1.98,4.9-3.12,7.28h0c1.13-2.38,2.22-4.8,3.12-7.28.78-2.16,1.5-4.33,2.16-6.49m-25.9-1.2c-.36,2.38-.76,4.75-1.2,7.12.44-2.37.84-4.75,1.2-7.12h0m58.07-11.39s0,0,0,0c-3.26,10.69-8.32,20.76-16.37,29.77-.96,1.08-1.99,2.08-3.02,3.1h0c1.03-1.01,2.06-2.02,3.02-3.1,8.05-9.02,13.12-19.09,16.38-29.78"
            }
          ),
          /* @__PURE__ */ jsx5(
            "path",
            {
              className: "cls-10",
              d: "m4.56,45.73c-.4,0-.85.09-1.34.31-2.11.91-2.68,3.11-2.93,5.45,11.33,14.85,56.07,69.62,126.46,107.18,0,0,68.91,36.38,138.24,40.31-5.37-.73-10.17-1.93-14.65-3.59-.26-.1-.53-.19-.8-.29h0c-25.19-5.44-46.66-12.25-61.84-17.7.29.06.57.1.84.13-.28-.03-.57-.07-.88-.14-.92-.2-1.62-.46-2.17-.79-12.01-4.39-19.66-7.76-21.51-8.59-.88-.38-1.75-.83-2.53-1.15-45.52-18.84-84.49-45.28-118.5-78.71C29.51,74.47,6.74,46.89,6.74,46.89h0c-.58-.68-1.28-1.16-2.18-1.16"
            }
          ),
          /* @__PURE__ */ jsx5(
            "path",
            {
              className: "cls-8",
              d: "m9.57,103.87c-.16,0-.33.02-.51.06-2.12.49-2.72,2.67-3.11,4.51-.07.33-.13.66-.18.99,35.19,47.67,82.41,67.15,82.41,67.15,47.15,22.21,85.84,26.69,109.4,26.69,9.75,0,16.91-.77,21.01-1.37-1.87.21-3.93.31-6.14.31-13.81,0-33.56-3.79-50.06-7.64-10.15-2.13-20.1-4.71-29.85-7.79-.45-.13-.69-.2-.69-.2v-.02c-37.88-12.05-72.58-31.59-102.92-61.4-2.87-2.82-5.54-5.86-8.15-8.95-2.41-2.86-7.36-8.84-9.06-10.89-.19-.27-.39-.51-.6-.73h0s0,0,0,0c-.41-.42-.9-.72-1.53-.72"
            }
          ),
          /* @__PURE__ */ jsx5(
            "path",
            {
              className: "cls-9",
              d: "m41.57,186.66c-.56,0-1.13.18-1.69.61-2.39,1.85-1.26,4.91-.35,7.6,17.64,10.71,58.1,31.53,106.02,31.53,18.09,0,37.24-2.97,56.64-10.57-14,4.54-28.37,6.23-42.87,6.23-1.61,0-3.23-.02-4.85-.06-31.26-.78-60.57-8.29-88.12-21.68-10.16-5.22-19.62-11.05-22.11-12.6-.88-.6-1.78-1.06-2.68-1.06"
            }
          ),
          /* @__PURE__ */ jsx5(
            "path",
            {
              className: "cls-12",
              d: "m205.41,231.93c-7.68,5.89-16.32,9.97-25.34,13.27-16.95,6.2-33.84,8.94-50.68,8.94-14.56,0-29.08-2.05-43.57-5.67-10.03-2.69-21.68-7.05-21.68-7.05h0c-.74-.32-1.47-.55-2.17-.55-.9,0-1.74.38-2.47,1.42-1.06,1.52-1.2,3.07-.85,4.6,11.13,5.17,35,14.36,64.11,14.36,25.24,0,54.41-6.9,82.66-29.31"
            }
          ),
          /* @__PURE__ */ jsx5(
            "path",
            {
              className: "cls-7",
              d: "m130.35,268.02c-27.34,0-48.01-5.54-50.62-6.27.77.23,1.52.46,2.26.71,2.44.77-4.2,5.21-6.34,6.84-7.65,5.85-15.17,11.32-22.73,16.88h23.2c7.31-5.4,14.6-10.84,21.72-16.5,2.65-2.11,5.15-2.91,7.99-2.91,2.15,0,4.48.46,7.22,1.17-15.88,11.97-30.73,23.17-45.6,34.36-8.69,6.54-17.39,13.07-26.09,19.61h23.34c20.99-15.71,41.97-31.42,62.82-47.32,4.81-3.67,9.71-6.2,15.64-6.98-4.39.29-8.67.41-12.8.41Z"
            }
          ),
          /* @__PURE__ */ jsx5(
            "path",
            {
              className: "cls-6",
              d: "m125.47,286.75h22.55l16.66-13.24s7.76-5.54,16.74-10.64c.8-.5,1.61-1,2.41-1.49.34-.15,1.2-.54,2.48-1.16.97-.5,1.93-.99,2.89-1.44,1.46-.75,3.18-1.65,5.09-2.71-16.08,6.73-32.54,10.02-47.79,11.29.21,0,.42,0,.63,0,1.28,0,2.61.07,3.99.23-8.36,6.25-16.38,12.24-24.3,18.16l-1.36,1Z"
            }
          ),
          /* @__PURE__ */ jsx5(
            "path",
            {
              className: "cls-11",
              d: "m183.65,172.69c.03-2.03.01-4.05-.06-6.08v-.15s0,0,0,0c-.01-.29-.03-.57-.04-.86v-.02s-.02-.4-.02-.4c-.08-1.7-.21-3.41-.37-5.12-5.38-2.26-10.45-5.15-15.12-8.56.03.48.05.96.12,1.46.57,4.06.43,2.81.84,6.34.33,1.82.66,5.13.69,6.19-.09.94-.32,1.76-.9,2.37-.59.63-1.29.87-2.05.87-.9,0-1.87-.34-2.83-.75,1.78.8,9.45,4.19,21.55,8.61-1.3-.79-1.69-2.01-1.81-3.9Z"
            }
          ),
          /* @__PURE__ */ jsx5(
            "path",
            {
              className: "cls-13",
              d: "m271.38,134.41c-5.03,7.01-11.24,13.15-18.32,18.08-3.26,10.69-8.32,20.76-16.37,29.77-.96,1.08-1.99,2.08-3.02,3.1-1,.97-2.45,2.73-3.7,2.73-.25,0-.49-.07-.72-.23-1.84-1.28-.2-3.9.37-5.25,3.02-7.06,5.33-14.23,7.04-21.49-5.04,1.89-10.33,3.22-15.79,3.96-.66,2.17-1.35,4.33-2.13,6.49-.9,2.48-1.98,4.9-3.12,7.28-1,2.11-1.72,4.67-4.32,4.67-.52,0-1.11-.1-1.8-.33-3.86-1.28-2.78-4.2-2.27-6.87.67-3.54,1.27-7.08,1.79-10.63-4.8-.15-9.49-.77-14.03-1.82-.43,2.83-.92,5.67-1.46,8.49-.36,1.89-1.16,5.17-4.53,5.17-.4,0-.85-.05-1.33-.15,15.19,5.45,36.66,12.26,61.84,17.71h0c-.25-.1-.5-.19-.74-.29-4.02-1.69,3.23-8.92,6.55-14.03,9.35-14.37,13.92-30.09,16.03-46.36Z"
            }
          ),
          /* @__PURE__ */ jsx5(
            "path",
            {
              className: "cls-2",
              d: "m267.61,212.35c-3.15,0-6.32.3-9.44.88-.59.11-1.17.16-1.72.16-.89,0-1.72-.13-2.5-.37.13.16.25.3.37.47,1.37,1.9,2.08,3.98,2.35,6.14.34.37.63.84.86,1.43h0s0,.02.01.03c0,0,0,0,0,0,0,0,0,.01,0,.02,0,0,0,0,0,0,0,0,0,.01,0,.02,0,0,0,0,0,0,0,0,0,.01,0,.02,0,0,0,0,0,0,0,0,0,.01,0,.02,0,0,0,0,0,0,0,0,0,.01,0,.02,0,0,0,0,0,.01,0,0,0,.01,0,.02,0,0,0,0,0,.01,0,0,0,0,0,.01,0,0,0,0,0,.01,0,0,0,.01,0,.01,0,0,0,0,0,0,0,0,0,.01,0,.02,0,0,0,0,0,.01,0,0,0,0,0,0v.02s0,0,0,.01c0,0,0,.01,0,.02,0,0,0,0,0,.01,0,0,0,.01,0,.02,0,0,0,0,0,0,0,0,0,.01,0,.02,0,0,0,0,0,0,0,0,0,.02,0,.02,0,0,0,0,0,0,0,0,0,.01,0,.02,0,0,0,0,0,0,0,.01,0,.02,0,.03,0,0,0,0,0,0,0,0,0,0,0,.01t0,0s0,.02,0,.03c0,0,0,0,0,0,0,0,0,.02,0,.03,0,0,0,0,0,0,0,0,0,.01,0,.02,0,0,0,0,0,.01,0,0,0,0,0,.02,0,0,0,.01,0,.02,0,0,0,.01,0,.01,0,0,0,.01,0,.01,0,0,0,.01,0,.02,0,0,0,.01,0,.01,0,0,0,0,0,.02s0,.01,0,.02c0,0,0,0,0,.01,0,0,0,.01,0,.02,0,0,0,0,0,.01,0,0,0,.01,0,.02,0,0,0,.01,0,.01s0,.01,0,.01c0,0,0,0,0,.01,0,0,0,.01,0,.02,0,0,0,0,0,.01,0,0,0,.01,0,.02,0,0,0,0,0,.01,0,0,0,.01,0,.02,0,0,0,0,0,.01,0,0,0,.01,0,.02,0,0,0,0,0,.01,0,0,0,.01,0,.02,0,0,0,0,0,0,0,0,0,.02,0,.03,0,0,0,0,0,0,0,0,0,.02,0,.03,0,0,0,0,0,0,0,0,0,.02,0,.02,0,0,0,0,0,0,0,.01,0,.02,0,.03,0,0,0,0,0,0,0,0,0,.02,0,.03,0,0,0,0,0,0,0,0,0,.02,0,.03h0s0,.03,0,.04h0s0,.02,0,.03h0s0,.03,0,.03h0s0,.03,0,.04h0s0,.02,0,.03h0s0,.02,0,.03h0s0,.02,0,.03h0s0,.02,0,.04c0,0,0,0,0,0,0,.03.01.07.01.1h0s0,.03,0,.04h0s0,.07.01.11h0s0,.02,0,.04h0s0,.03,0,.04h0s0,.05,0,.07h0s0,.02,0,.04h0s0,.03,0,.04h0s0,.03,0,.04h0c.03.5.05,1,.05,1.52,0,.8-.04,1.61-.13,2.46-.11,1.04-.3,2.14-.46,3.02-.02.13-.04.27-.04.4,0,.71.34,1.39.92,1.81l.34.21c.32.16.66.23,1,.23.62,0,1.23-.26,1.67-.74.25-.28.51-.55.77-.83,3.22-3.38,6.47-5.73,9.95-7.16,2.54-1.05,5.1-1.58,7.71-1.58s5.24.52,7.96,1.56c2.6.99,5.05,2.34,7.48,4.14,1.03.76,2.08,1.62,3.11,2.55.61.56,1.22,1.18,1.76,1.72l.09.09.44.45.26.22c.38.28.83.43,1.3.44-2.15-4.61-4.88-8.9-8.73-12.24-7.28-6.31-16.46-8.98-25.8-8.98"
            }
          ),
          /* @__PURE__ */ jsx5(
            "path",
            {
              className: "cls-14",
              d: "m266.74,181.67l-.41.04c-.97.18-1.72.97-1.83,1.96-.09.76-.08,1.57.02,2.41.03.26-.03.52-.16.73,3.89,5.78,12.33,16.03,25.15,19.91,0,0,19.81,10.36,14.8,25.38h0l.15-.41c1.56-4.59,1.87-8.82.97-12.93-.9-4.06-2.96-7.8-6.14-11.13-1.22-1.28-2.59-2.48-4.07-3.58-.72-.53-1.48-1.03-2.26-1.52-.97-.6-1.98-1.19-3.07-1.75-4.05-2.08-7.5-4.17-10.53-6.41-1.23-.91-2.42-1.86-3.53-2.83-2.71-2.37-4.53-4.38-5.88-6.53-.44-.69-.83-1.44-1.2-2.14-.16-.31-.39-.57-.66-.77-.38-.28-.85-.44-1.34-.44"
            }
          ),
          /* @__PURE__ */ jsx5(
            "path",
            {
              className: "cls-3",
              d: "m241.61,223.53l4.01-2.33,16.87-22.61s-9.24-1.75-13.7-3.78c0,0-4.64,21.12-21.73,38.76l6.3-4.67c2.51-1.76,4.79-3.29,8.24-5.37Z"
            }
          )
        ] })
      ]
    }
  );
}

// src/components/nav/Navbar.tsx
var navCSS2 = css`
  padding: var(--px-spacing-med) var(--px-spacing-lg);
  border-bottom: 1px solid var(--ac-global-color-grey-200);
  background-color: var(--ac-global-color-grey-75);
  flex: none;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
`;
var navIconCSS = css`
  padding: var(--ac-global-static-size-100);
  width: 20px;
  height: 20px;
  display: block;
  svg {
    fill: var(--ac-global-text-color-500);
    transition: fill 0.2s ease-in-out;
  }
  &:hover svg {
    fill: var(--ac-global-text-color-900);
  }
`;
var brandCSS = (theme3) => css`
  color: var(--ac-global-text-color-900);
  font-size: ${theme3.typography.sizes.large.fontSize}px;
  text-decoration: none;
  svg {
    margin-right: ${theme3.spacing.margin16}px;
  }
`;
var GitHubSVG = () => /* @__PURE__ */ jsx5(
  "svg",
  {
    xmlns: "http://www.w3.org/2000/svg",
    width: "20",
    height: "20",
    viewBox: "0 0 24 24",
    children: /* @__PURE__ */ jsxs2("g", { "data-name": "Layer 2", children: [
      /* @__PURE__ */ jsx5("rect", { width: "24", height: "24", transform: "rotate(180 12 12)", opacity: "0" }),
      /* @__PURE__ */ jsx5(
        "path",
        {
          d: "M12 1A10.89 10.89 0 0 0 1 11.77 10.79 10.79 0 0 0 8.52 22c.55.1.75-.23.75-.52v-1.83c-3.06.65-3.71-1.44-3.71-1.44a2.86 2.86 0 0 0-1.22-1.58c-1-.66.08-.65.08-.65a2.31 2.31 0 0 1 1.68 1.11 2.37 2.37 0 0 0 3.2.89 2.33 2.33 0 0 1 .7-1.44c-2.44-.27-5-1.19-5-5.32a4.15 4.15 0 0 1 1.11-2.91 3.78 3.78 0 0 1 .11-2.84s.93-.29 3 1.1a10.68 10.68 0 0 1 5.5 0c2.1-1.39 3-1.1 3-1.1a3.78 3.78 0 0 1 .11 2.84A4.15 4.15 0 0 1 19 11.2c0 4.14-2.58 5.05-5 5.32a2.5 2.5 0 0 1 .75 2v2.95c0 .35.2.63.75.52A10.8 10.8 0 0 0 23 11.77 10.89 10.89 0 0 0 12 1",
          "data-name": "github"
        }
      )
    ] })
  }
);
function IconLink(props) {
  return /* @__PURE__ */ jsx5("a", { href: props.href, target: "_blank", css: navIconCSS, rel: "noreferrer", children: props.children });
}
function IconButton(props) {
  return /* @__PURE__ */ jsx5("button", { css: navIconCSS, onClick: props.onClick, className: "button--reset", children: props.children });
}
function GitHubLink() {
  return /* @__PURE__ */ jsx5(IconLink, { href: "https://github.com/arize-ai/phoenix", children: /* @__PURE__ */ jsx5(GitHubSVG, {}) });
}
function DocsLink() {
  return /* @__PURE__ */ jsx5(IconLink, { href: "https://docs.arize.com/phoenix", children: /* @__PURE__ */ jsx5(Icons.BookFilled, {}) });
}
function ThemeToggle() {
  const { theme: theme3, setTheme } = useTheme2();
  const isDark = theme3 === "dark";
  return /* @__PURE__ */ jsx5(IconButton, { onClick: () => setTheme(isDark ? "light" : "dark"), children: isDark ? /* @__PURE__ */ jsx5(Icons.MoonOutline, {}) : /* @__PURE__ */ jsx5(Icons.SunOutline, {}) });
}
function Brand() {
  return /* @__PURE__ */ jsx5(Link, { to: "/", css: brandCSS, children: /* @__PURE__ */ jsx5(Logo, {}) });
}
function Navbar({ children }) {
  return /* @__PURE__ */ jsx5("nav", { css: navCSS2, children });
}

// src/components/nav/NavBreadcrumb.tsx
function isRouteMatchWithCrumb(match2) {
  return typeof match2.handle == "object" && // eslint-disable-next-line @typescript-eslint/no-explicit-any
  typeof match2.handle?.crumb === "function";
}
function NavBreadcrumb() {
  const navigate = useNavigate();
  const matches = useMatches();
  const matchesWithCrumb = matches.filter(isRouteMatchWithCrumb);
  return /* @__PURE__ */ jsx5(
    _Breadcrumbs,
    {
      onAction: (index) => {
        navigate(matchesWithCrumb[Number(index)].pathname);
      },
      children: matchesWithCrumb.map((match2, index) => /* @__PURE__ */ jsx5($c1d7fb2ec91bae71$export$6d08773d2e66f8f2, { children: match2.handle.crumb(match2.data) }, index))
    }
  );
}

// src/pages/Layout.tsx
var layoutCSS = css`
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
`;
var contentCSS = css`
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  height: 100%;
`;
var linksCSS = css`
  display: flex;
  flex-direction: row;
  margin: 0;
  list-style: none;
  gap: var(--ac-global-dimension-size-100);
  padding-inline-start: 0;
`;
function Layout() {
  return /* @__PURE__ */ jsxs2("div", { css: layoutCSS, "data-testid": "layout", children: [
    /* @__PURE__ */ jsxs2(Navbar, { children: [
      /* @__PURE__ */ jsx5(Brand, {}),
      /* @__PURE__ */ jsx5(NavBreadcrumb, {}),
      /* @__PURE__ */ jsxs2("ul", { css: linksCSS, children: [
        /* @__PURE__ */ jsx5("li", { children: /* @__PURE__ */ jsx5(DocsLink, {}) }),
        /* @__PURE__ */ jsx5("li", { children: /* @__PURE__ */ jsx5(GitHubLink, {}) }),
        /* @__PURE__ */ jsx5("li", { children: /* @__PURE__ */ jsx5(ThemeToggle, {}) })
      ] })
    ] }),
    /* @__PURE__ */ jsx5("div", { "data-testid": "content", css: contentCSS, children: /* @__PURE__ */ jsx5(Outlet, {}) })
  ] });
}

// src/pages/ErrorElement.tsx
var import_react199 = __toESM(require_react());
function ErrorElement() {
  const error = useRouteError();
  const content2 = (0, import_react199.useMemo)(() => {
    if (error instanceof Error && error.message === "Failed to fetch") {
      return /* @__PURE__ */ jsx5(NotFoundContent, {});
    }
    return /* @__PURE__ */ jsx5(ErrorContent, { error });
  }, [error]);
  return /* @__PURE__ */ jsx5(
    "main",
    {
      css: css`
        width: 100%;
        height: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
      `,
      children: /* @__PURE__ */ jsx5(
        "section",
        {
          css: css`
          width: 500px;
          /* Add spacing on the bottom so it gets pushed down */
          margin-top: 200px;
          display: flex;
          flex-direction: column;
        `,
          children: content2
        }
      )
    }
  );
}
function NotFoundContent() {
  return /* @__PURE__ */ jsxs2(Fragment5, { children: [
    /* @__PURE__ */ jsxs2(_Flex, { direction: "column", width: "100%", alignItems: "center", children: [
      /* @__PURE__ */ jsx5(EmptyGraphic, { graphicKey: "not found" }),
      /* @__PURE__ */ jsx5("h1", { children: "Server disconnected" })
    ] }),
    /* @__PURE__ */ jsx5("p", { children: "We are unable to reach the phoenix server. This is most likely due to the notebook runtime being no longer active. Please restart phoenix by re-running the initialization cell." })
  ] });
}
function ErrorContent({ error }) {
  return /* @__PURE__ */ jsxs2(Fragment5, { children: [
    /* @__PURE__ */ jsxs2(_Flex, { direction: "column", width: "100%", alignItems: "center", children: [
      /* @__PURE__ */ jsx5(EmptyGraphic, { graphicKey: "error" }),
      /* @__PURE__ */ jsx5("h1", { children: "Something went wrong" })
    ] }),
    /* @__PURE__ */ jsx5("p", { children: "We strive to do our very best but \u{1F41B} bugs happen. It would mean a lot to us if you could file a an issue. If you feel comfortable, please include the error details below in your issue. We will get back to you as soon as we can." }),
    /* @__PURE__ */ jsx5(
      "p",
      {
        css: css`
          display: flex;
          flex-direction: row;
          justify-content: flex-end;
          gap: var(--px-spacing-med);
        `,
        children: /* @__PURE__ */ jsxs2(
          "span",
          {
            css: css`
            display: inline-flex;
            flex-direction: row;
            align-items: baseline;
            gap: 0.2em;
          `,
            children: [
              "\u{1F499} the",
              /* @__PURE__ */ jsx5(ExternalLink, { href: "mailto:phoenix-devs@arize.com", children: "phoenix team" })
            ]
          }
        )
      }
    ),
    /* @__PURE__ */ jsxs2(
      "div",
      {
        css: css`
          display: flex;
          flex-direction: row;
          justify-content: flex-end;
          align-items: center;
          gap: var(--px-spacing-med);
        `,
        children: [
          /* @__PURE__ */ jsx5(ExternalLink, { href: "https://github.com/Arize-ai/phoenix/issues/new?assignees=&labels=bug&template=bug_report.md&title=%5BBUG%5D", children: "file an issue with us" }),
          /* @__PURE__ */ jsx5(
            _Button,
            {
              variant: "primary",
              size: "compact",
              onClick: () => {
                window.location.href = "/";
              },
              children: "Return Home"
            }
          )
        ]
      }
    ),
    /* @__PURE__ */ jsxs2("details", { children: [
      /* @__PURE__ */ jsx5("summary", { children: "error details" }),
      /* @__PURE__ */ jsx5(
        "pre",
        {
          css: css`
            white-space: pre-wrap;
            overflow-wrap: break-word;
            overflow: hidden;
            overflow-y: auto;
            max-height: 500px;
          `,
          children: error instanceof Error ? error.message : null
        }
      )
    ] })
  ] });
}

// src/pages/__generated__/ModelRootQuery.graphql.ts
var node55 = function() {
  var v0 = [
    {
      "alias": null,
      "args": null,
      "kind": "ScalarField",
      "name": "name",
      "storageKey": null
    },
    {
      "alias": null,
      "args": null,
      "kind": "ScalarField",
      "name": "startTime",
      "storageKey": null
    },
    {
      "alias": null,
      "args": null,
      "kind": "ScalarField",
      "name": "endTime",
      "storageKey": null
    }
  ], v12 = [
    {
      "alias": null,
      "args": null,
      "concreteType": "Model",
      "kind": "LinkedField",
      "name": "model",
      "plural": false,
      "selections": [
        {
          "alias": null,
          "args": null,
          "concreteType": "Dataset",
          "kind": "LinkedField",
          "name": "primaryDataset",
          "plural": false,
          "selections": v0,
          "storageKey": null
        },
        {
          "alias": null,
          "args": null,
          "concreteType": "Dataset",
          "kind": "LinkedField",
          "name": "referenceDataset",
          "plural": false,
          "selections": v0,
          "storageKey": null
        },
        {
          "alias": null,
          "args": null,
          "concreteType": "Dataset",
          "kind": "LinkedField",
          "name": "corpusDataset",
          "plural": false,
          "selections": v0,
          "storageKey": null
        }
      ],
      "storageKey": null
    }
  ];
  return {
    "fragment": {
      "argumentDefinitions": [],
      "kind": "Fragment",
      "metadata": null,
      "name": "ModelRootQuery",
      "selections": v12,
      "type": "Query",
      "abstractKey": null
    },
    "kind": "Request",
    "operation": {
      "argumentDefinitions": [],
      "kind": "Operation",
      "name": "ModelRootQuery",
      "selections": v12
    },
    "params": {
      "cacheID": "8b79fd7c38d3485b9945813c6fd68baa",
      "id": null,
      "metadata": {},
      "name": "ModelRootQuery",
      "operationKind": "query",
      "text": "query ModelRootQuery {\n  model {\n    primaryDataset {\n      name\n      startTime\n      endTime\n    }\n    referenceDataset {\n      name\n      startTime\n      endTime\n    }\n    corpusDataset {\n      name\n      startTime\n      endTime\n    }\n  }\n}\n"
    }
  };
}();
node55.hash = "3f5bceab9f77e4f079fb0083b04d39ed";
var ModelRootQuery_graphql_default = node55;

// src/pages/ModelRoot.tsx
var import_react_relay38 = __toESM(require_react_relay());
var RootQuery = ModelRootQuery_graphql_default;
function ModelRoot() {
  const data = (0, import_react_relay38.useLazyLoadQuery)(RootQuery, {});
  const {
    model: { primaryDataset, referenceDataset, corpusDataset }
  } = data;
  return /* @__PURE__ */ jsx5(
    DatasetsProvider,
    {
      primaryDataset,
      referenceDataset: referenceDataset ?? null,
      corpusDataset: corpusDataset ?? null,
      children: /* @__PURE__ */ jsx5(
        TimeRangeProvider,
        {
          timeRangeBounds: {
            start: new Date(primaryDataset.startTime),
            end: new Date(primaryDataset.endTime)
          },
          children: /* @__PURE__ */ jsx5(Outlet, {})
        }
      )
    }
  );
}

// src/pages/TracingRoot.tsx
function TracingRoot() {
  return /* @__PURE__ */ jsx5(TracingProvider, { children: /* @__PURE__ */ jsx5(StreamStateProvider, { children: /* @__PURE__ */ jsx5(Outlet, {}) }) });
}

// src/Routes.tsx
var router = createBrowserRouter(
  createRoutesFromChildren(
    /* @__PURE__ */ jsxs2(Route, { path: "/", element: /* @__PURE__ */ jsx5(Layout, {}), errorElement: /* @__PURE__ */ jsx5(ErrorElement, {}), children: [
      /* @__PURE__ */ jsx5(Route, { index: true, loader: homeLoader }),
      /* @__PURE__ */ jsxs2(
        Route,
        {
          path: "/model",
          handle: { crumb: () => "model" },
          element: /* @__PURE__ */ jsx5(ModelRoot, {}),
          children: [
            /* @__PURE__ */ jsx5(Route, { index: true, element: /* @__PURE__ */ jsx5(ModelPage, {}) }),
            /* @__PURE__ */ jsx5(Route, { element: /* @__PURE__ */ jsx5(ModelPage, {}), children: /* @__PURE__ */ jsx5(Route, { path: "dimensions", children: /* @__PURE__ */ jsx5(
              Route,
              {
                path: ":dimensionId",
                element: /* @__PURE__ */ jsx5(DimensionPage, {}),
                loader: dimensionLoader
              }
            ) }) }),
            /* @__PURE__ */ jsx5(Route, { path: "embeddings", children: /* @__PURE__ */ jsx5(
              Route,
              {
                path: ":embeddingDimensionId",
                element: /* @__PURE__ */ jsx5(EmbeddingPage, {}),
                loader: embeddingLoader,
                handle: {
                  // `crumb` is your own abstraction, we decided
                  // to make this one a function so we can pass
                  // the data from the loader to it so that our
                  // breadcrumb is made up of dynamic content
                  crumb: (data) => data.embedding.name
                }
              }
            ) })
          ]
        }
      ),
      /* @__PURE__ */ jsxs2(
        Route,
        {
          path: "/tracing",
          handle: { crumb: () => "tracing" },
          element: /* @__PURE__ */ jsx5(TracingRoot, {}),
          children: [
            /* @__PURE__ */ jsx5(Route, { index: true, element: /* @__PURE__ */ jsx5(TracingHomePage, {}) }),
            /* @__PURE__ */ jsx5(Route, { element: /* @__PURE__ */ jsx5(TracingHomePage, {}), children: /* @__PURE__ */ jsx5(Route, { path: "traces", children: /* @__PURE__ */ jsx5(Route, { path: ":traceId", element: /* @__PURE__ */ jsx5(TracePage, {}) }) }) })
          ]
        }
      )
    ] })
  ),
  {
    basename: window.Config.basename
  }
);
function AppRoutes() {
  return /* @__PURE__ */ jsx5(RouterProvider, { router });
}

// src/App.tsx
function App() {
  return /* @__PURE__ */ jsx5(ThemeProvider3, { children: /* @__PURE__ */ jsx5(AppContent, {}) });
}
function AppContent() {
  const { theme: componentsTheme } = useTheme2();
  return /* @__PURE__ */ jsx5(Provider, { theme: componentsTheme, children: /* @__PURE__ */ jsx5(ThemeProvider, { theme, children: /* @__PURE__ */ jsxs2(import_react_relay39.RelayEnvironmentProvider, { environment: RelayEnvironment_default, children: [
    /* @__PURE__ */ jsx5(GlobalStyles2, {}),
    /* @__PURE__ */ jsx5(FeatureFlagsProvider, { children: /* @__PURE__ */ jsx5(import_react201.Suspense, { children: /* @__PURE__ */ jsx5(NotificationProvider, { children: /* @__PURE__ */ jsx5(AppRoutes, {}) }) }) })
  ] }) }) });
}

// src/index.tsx
var rootEl = document.getElementById("root");
var root = import_client.default.createRoot(rootEl);
root.render(/* @__PURE__ */ jsx5(App, {}));
/*! Bundled license information:

react/cjs/react.development.js:
  (**
   * @license React
   * 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.
   *)

scheduler/cjs/scheduler.development.js:
  (**
   * @license React
   * 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.
   *)

react-dom/cjs/react-dom.development.js:
  (**
   * @license React
   * 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.
   *)
  (**
   * 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
   *)

fbjs/lib/areEqual.js:
  (**
   * Checks if two values are equal. Values may be primitives, arrays, or objects.
   * Returns true if both arguments have the same keys and values.
   *
   * @see http://underscorejs.org
   * @copyright 2009-2013 Jeremy Ashkenas, DocumentCloud Inc.
   * @license MIT
   *)

react-is/cjs/react-is.development.js:
  (** @license React v16.13.1
   * react-is.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.
   *)

object-assign/index.js:
  (*
  object-assign
  (c) Sindre Sorhus
  @license MIT
  *)

react/cjs/react-jsx-runtime.development.js:
  (**
   * @license React
   * react-jsx-runtime.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.
   *)

use-sync-external-store/cjs/use-sync-external-store-shim.development.js:
  (**
   * @license React
   * use-sync-external-store-shim.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.
   *)

use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js:
  (**
   * @license React
   * use-sync-external-store-shim/with-selector.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.
   *)

react-reconciler/cjs/react-reconciler-constants.development.js:
  (**
   * @license React
   * react-reconciler-constants.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.
   *)

scheduler/cjs/scheduler.development.js:
  (**
   * @license React
   * 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.
   *)

react-reconciler/cjs/react-reconciler.development.js:
  (**
   * @license React
   * react-reconciler.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.
   *)

classnames/index.js:
  (*!
  	Copyright (c) 2018 Jed Watson.
  	Licensed under the MIT License (MIT), see
  	http://jedwatson.github.io/classnames
  *)

decimal.js-light/decimal.js:
  (*! decimal.js-light v2.5.1 https://github.com/MikeMcl/decimal.js-light/LICENCE *)

three/build/three.module.js:
  (**
   * @license
   * Copyright 2010-2022 Three.js Authors
   * SPDX-License-Identifier: MIT
   *)

@remix-run/router/dist/router.js:
  (**
   * @remix-run/router v1.11.0
   *
   * Copyright (c) Remix Software Inc.
   *
   * This source code is licensed under the MIT license found in the
   * LICENSE.md file in the root directory of this source tree.
   *
   * @license MIT
   *)

react-router/dist/index.js:
  (**
   * React Router v6.18.0
   *
   * Copyright (c) Remix Software Inc.
   *
   * This source code is licensed under the MIT license found in the
   * LICENSE.md file in the root directory of this source tree.
   *
   * @license MIT
   *)

react-router-dom/dist/index.js:
  (**
   * React Router DOM v6.18.0
   *
   * Copyright (c) Remix Software Inc.
   *
   * This source code is licensed under the MIT license found in the
   * LICENSE.md file in the root directory of this source tree.
   *
   * @license MIT
   *)

@tanstack/table-core/build/lib/index.mjs:
  (**
   * table-core
   *
   * Copyright (c) TanStack
   *
   * This source code is licensed under the MIT license found in the
   * LICENSE.md file in the root directory of this source tree.
   *
   * @license MIT
   *)

@tanstack/react-table/build/lib/index.mjs:
  (**
   * react-table
   *
   * Copyright (c) TanStack
   *
   * This source code is licensed under the MIT license found in the
   * LICENSE.md file in the root directory of this source tree.
   *
   * @license MIT
   *)

react-resize-detector/build/index.esm.js:
  (*! *****************************************************************************
  Copyright (c) Microsoft Corporation.
  
  Permission to use, copy, modify, and/or distribute this software for any
  purpose with or without fee is hereby granted.
  
  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
  REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
  INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  PERFORMANCE OF THIS SOFTWARE.
  ***************************************************************************** *)
*/
//# sourceMappingURL=index.js.map
